@myrjfa/ui 0.3.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.
- package/LICENSE +201 -0
- package/README.md +19 -0
- package/dist/chat/ChatMain.d.ts +12 -0
- package/dist/chat/ChatMain.d.ts.map +1 -0
- package/dist/chat/ChatMain.js +390 -0
- package/dist/chat/ChatSidebar.d.ts +15 -0
- package/dist/chat/ChatSidebar.d.ts.map +1 -0
- package/dist/chat/ChatSidebar.js +32 -0
- package/dist/chat/ConversationList.d.ts +20 -0
- package/dist/chat/ConversationList.d.ts.map +1 -0
- package/dist/chat/ConversationList.js +95 -0
- package/dist/chat/EventPanel.d.ts +11 -0
- package/dist/chat/EventPanel.d.ts.map +1 -0
- package/dist/chat/EventPanel.js +76 -0
- package/dist/chat/ExpensePanel.d.ts +14 -0
- package/dist/chat/ExpensePanel.d.ts.map +1 -0
- package/dist/chat/ExpensePanel.js +282 -0
- package/dist/chat/MessageBubble.d.ts +29 -0
- package/dist/chat/MessageBubble.d.ts.map +1 -0
- package/dist/chat/MessageBubble.js +425 -0
- package/dist/chat/MessageInput.d.ts +34 -0
- package/dist/chat/MessageInput.d.ts.map +1 -0
- package/dist/chat/MessageInput.js +330 -0
- package/dist/chat/MilestonePanel.d.ts +14 -0
- package/dist/chat/MilestonePanel.d.ts.map +1 -0
- package/dist/chat/MilestonePanel.js +209 -0
- package/dist/chat/components/ParticipantSelector.d.ts +11 -0
- package/dist/chat/components/ParticipantSelector.d.ts.map +1 -0
- package/dist/chat/components/ParticipantSelector.js +26 -0
- package/dist/chat/components/SplitInputs.d.ts +12 -0
- package/dist/chat/components/SplitInputs.d.ts.map +1 -0
- package/dist/chat/components/SplitInputs.js +84 -0
- package/dist/chat/components/SplitTypeSelector.d.ts +8 -0
- package/dist/chat/components/SplitTypeSelector.d.ts.map +1 -0
- package/dist/chat/components/SplitTypeSelector.js +13 -0
- package/dist/chat/dialogs/AddMemberDialog.d.ts +15 -0
- package/dist/chat/dialogs/AddMemberDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/AddMemberDialog.js +43 -0
- package/dist/chat/dialogs/CameraDialog.d.ts +8 -0
- package/dist/chat/dialogs/CameraDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/CameraDialog.js +81 -0
- package/dist/chat/dialogs/ChatInfoDialog.d.ts +10 -0
- package/dist/chat/dialogs/ChatInfoDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/ChatInfoDialog.js +75 -0
- package/dist/chat/dialogs/ConversationSearchDialog.d.ts +8 -0
- package/dist/chat/dialogs/ConversationSearchDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/ConversationSearchDialog.js +53 -0
- package/dist/chat/dialogs/CreateEventDialog.d.ts +22 -0
- package/dist/chat/dialogs/CreateEventDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/CreateEventDialog.js +51 -0
- package/dist/chat/dialogs/CreatePollDialog.d.ts +8 -0
- package/dist/chat/dialogs/CreatePollDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/CreatePollDialog.js +38 -0
- package/dist/chat/dialogs/EditPollDialog.d.ts +14 -0
- package/dist/chat/dialogs/EditPollDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/EditPollDialog.js +33 -0
- package/dist/chat/dialogs/ExpenseAnalyticsDialog.d.ts +20 -0
- package/dist/chat/dialogs/ExpenseAnalyticsDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/ExpenseAnalyticsDialog.js +58 -0
- package/dist/chat/dialogs/GroupInfoDialog.d.ts +10 -0
- package/dist/chat/dialogs/GroupInfoDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/GroupInfoDialog.js +81 -0
- package/dist/chat/dialogs/GroupInfoViewDialog.d.ts +9 -0
- package/dist/chat/dialogs/GroupInfoViewDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/GroupInfoViewDialog.js +15 -0
- package/dist/chat/dialogs/HostWorkspaceDialog.d.ts +9 -0
- package/dist/chat/dialogs/HostWorkspaceDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/HostWorkspaceDialog.js +90 -0
- package/dist/chat/dialogs/MediaComposerDialog.d.ts +9 -0
- package/dist/chat/dialogs/MediaComposerDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/MediaComposerDialog.js +41 -0
- package/dist/chat/dialogs/NewChatDialog.d.ts +2 -0
- package/dist/chat/dialogs/NewChatDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/NewChatDialog.js +48 -0
- package/dist/chat/dialogs/NewGroupDialog.d.ts +2 -0
- package/dist/chat/dialogs/NewGroupDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/NewGroupDialog.js +44 -0
- package/dist/chat/dialogs/ParticipantsDialog.d.ts +12 -0
- package/dist/chat/dialogs/ParticipantsDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/ParticipantsDialog.js +134 -0
- package/dist/chat/dialogs/PayAndSplitDialog.d.ts +12 -0
- package/dist/chat/dialogs/PayAndSplitDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/PayAndSplitDialog.js +124 -0
- package/dist/chat/dialogs/PaymentProfileDialog.d.ts +5 -0
- package/dist/chat/dialogs/PaymentProfileDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/PaymentProfileDialog.js +45 -0
- package/dist/chat/dialogs/PollVotersDialog.d.ts +10 -0
- package/dist/chat/dialogs/PollVotersDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/PollVotersDialog.js +11 -0
- package/dist/chat/dialogs/ShareLocationDialog.d.ts +8 -0
- package/dist/chat/dialogs/ShareLocationDialog.d.ts.map +1 -0
- package/dist/chat/dialogs/ShareLocationDialog.js +47 -0
- package/dist/chat/index.d.ts +8 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +7 -0
- package/dist/components/CityAutocomplete.d.ts +5 -0
- package/dist/components/CityAutocomplete.d.ts.map +1 -0
- package/dist/components/CityAutocomplete.js +112 -0
- package/dist/components/CreateListingDropdown.d.ts +5 -0
- package/dist/components/CreateListingDropdown.d.ts.map +1 -0
- package/dist/components/CreateListingDropdown.js +21 -0
- package/dist/components/DestinationAutocomplete.d.ts +11 -0
- package/dist/components/DestinationAutocomplete.d.ts.map +1 -0
- package/dist/components/DestinationAutocomplete.js +24 -0
- package/dist/components/StateAutocomplete.d.ts +10 -0
- package/dist/components/StateAutocomplete.d.ts.map +1 -0
- package/dist/components/StateAutocomplete.js +34 -0
- package/dist/components/admin/AdminBookingRegistrationsList.d.ts +5 -0
- package/dist/components/admin/AdminBookingRegistrationsList.d.ts.map +1 -0
- package/dist/components/admin/AdminBookingRegistrationsList.js +69 -0
- package/dist/components/admin/AdminListingActionsWrapper.d.ts +9 -0
- package/dist/components/admin/AdminListingActionsWrapper.d.ts.map +1 -0
- package/dist/components/admin/AdminListingActionsWrapper.js +200 -0
- package/dist/components/ads/ActivateAdPlacementButton.d.ts +6 -0
- package/dist/components/ads/ActivateAdPlacementButton.d.ts.map +1 -0
- package/dist/components/ads/ActivateAdPlacementButton.js +27 -0
- package/dist/components/ads/AdOfferCard.d.ts +6 -0
- package/dist/components/ads/AdOfferCard.d.ts.map +1 -0
- package/dist/components/ads/AdOfferCard.js +15 -0
- package/dist/components/adventure/AdventureAvailabilityPlanner.d.ts +17 -0
- package/dist/components/adventure/AdventureAvailabilityPlanner.d.ts.map +1 -0
- package/dist/components/adventure/AdventureAvailabilityPlanner.js +106 -0
- package/dist/components/adventure/AdventureQueryCard.d.ts +5 -0
- package/dist/components/adventure/AdventureQueryCard.d.ts.map +1 -0
- package/dist/components/adventure/AdventureQueryCard.js +65 -0
- package/dist/components/adventure/AdventureSlotBuilder.d.ts +41 -0
- package/dist/components/adventure/AdventureSlotBuilder.d.ts.map +1 -0
- package/dist/components/adventure/AdventureSlotBuilder.js +146 -0
- package/dist/components/booking/booking-form.d.ts +39 -0
- package/dist/components/booking/booking-form.d.ts.map +1 -0
- package/dist/components/booking/booking-form.js +847 -0
- package/dist/components/brand/BrandPageView.d.ts +8 -0
- package/dist/components/brand/BrandPageView.d.ts.map +1 -0
- package/dist/components/brand/BrandPageView.js +97 -0
- package/dist/components/companion/AnonymousChat.d.ts +22 -0
- package/dist/components/companion/AnonymousChat.d.ts.map +1 -0
- package/dist/components/companion/AnonymousChat.js +24 -0
- package/dist/components/companion/SwipeCard.d.ts +25 -0
- package/dist/components/companion/SwipeCard.d.ts.map +1 -0
- package/dist/components/companion/SwipeCard.js +58 -0
- package/dist/components/create-flow/ConfirmDiscardDialog.d.ts +11 -0
- package/dist/components/create-flow/ConfirmDiscardDialog.d.ts.map +1 -0
- package/dist/components/create-flow/ConfirmDiscardDialog.js +14 -0
- package/dist/components/create-flow/EntityEditLoadingState.d.ts +2 -0
- package/dist/components/create-flow/EntityEditLoadingState.d.ts.map +1 -0
- package/dist/components/create-flow/EntityEditLoadingState.js +6 -0
- package/dist/components/create-flow/EntityFormCompletionState.d.ts +12 -0
- package/dist/components/create-flow/EntityFormCompletionState.d.ts.map +1 -0
- package/dist/components/create-flow/EntityFormCompletionState.js +10 -0
- package/dist/components/create-flow/EntityFormHeader.d.ts +9 -0
- package/dist/components/create-flow/EntityFormHeader.d.ts.map +1 -0
- package/dist/components/create-flow/EntityFormHeader.js +7 -0
- package/dist/components/create-flow/EntityFormPageFrame.d.ts +10 -0
- package/dist/components/create-flow/EntityFormPageFrame.d.ts.map +1 -0
- package/dist/components/create-flow/EntityFormPageFrame.js +10 -0
- package/dist/components/create-flow/ImageUploader.d.ts +30 -0
- package/dist/components/create-flow/ImageUploader.d.ts.map +1 -0
- package/dist/components/create-flow/ImageUploader.js +193 -0
- package/dist/components/create-flow/MultiStepWizard.d.ts +25 -0
- package/dist/components/create-flow/MultiStepWizard.d.ts.map +1 -0
- package/dist/components/create-flow/MultiStepWizard.js +31 -0
- package/dist/components/create-flow/ReviewConfirmationCard.d.ts +8 -0
- package/dist/components/create-flow/ReviewConfirmationCard.d.ts.map +1 -0
- package/dist/components/create-flow/ReviewConfirmationCard.js +5 -0
- package/dist/components/create-flow/ReviewMetricGrid.d.ts +15 -0
- package/dist/components/create-flow/ReviewMetricGrid.d.ts.map +1 -0
- package/dist/components/create-flow/ReviewMetricGrid.js +8 -0
- package/dist/components/create-flow/TemplateSelectionDialog.d.ts +17 -0
- package/dist/components/create-flow/TemplateSelectionDialog.d.ts.map +1 -0
- package/dist/components/create-flow/TemplateSelectionDialog.js +7 -0
- package/dist/components/discounts/OffersAndCouponsSheet.d.ts +13 -0
- package/dist/components/discounts/OffersAndCouponsSheet.d.ts.map +1 -0
- package/dist/components/discounts/OffersAndCouponsSheet.js +81 -0
- package/dist/components/enquiry/EnquiryFormParts.d.ts +40 -0
- package/dist/components/enquiry/EnquiryFormParts.d.ts.map +1 -0
- package/dist/components/enquiry/EnquiryFormParts.js +29 -0
- package/dist/components/form-sections/FaqSection.d.ts +24 -0
- package/dist/components/form-sections/FaqSection.d.ts.map +1 -0
- package/dist/components/form-sections/FaqSection.js +17 -0
- package/dist/components/form-sections/OpportunityBasicsSection.d.ts +8 -0
- package/dist/components/form-sections/OpportunityBasicsSection.d.ts.map +1 -0
- package/dist/components/form-sections/OpportunityBasicsSection.js +26 -0
- package/dist/components/form-sections/OpportunityDetailsSection.d.ts +18 -0
- package/dist/components/form-sections/OpportunityDetailsSection.d.ts.map +1 -0
- package/dist/components/form-sections/OpportunityDetailsSection.js +10 -0
- package/dist/components/form-sections/OpportunityTypeSection.d.ts +7 -0
- package/dist/components/form-sections/OpportunityTypeSection.d.ts.map +1 -0
- package/dist/components/form-sections/OpportunityTypeSection.js +15 -0
- package/dist/components/form-sections/PackageDetailsSection.d.ts +22 -0
- package/dist/components/form-sections/PackageDetailsSection.d.ts.map +1 -0
- package/dist/components/form-sections/PackageDetailsSection.js +20 -0
- package/dist/components/form-sections/PackageItinerarySection.d.ts +21 -0
- package/dist/components/form-sections/PackageItinerarySection.d.ts.map +1 -0
- package/dist/components/form-sections/PackageItinerarySection.js +112 -0
- package/dist/components/form-sections/PackagePricingSection.d.ts +8 -0
- package/dist/components/form-sections/PackagePricingSection.d.ts.map +1 -0
- package/dist/components/form-sections/PackagePricingSection.js +11 -0
- package/dist/components/form-sections/PackageReviewSection.d.ts +12 -0
- package/dist/components/form-sections/PackageReviewSection.d.ts.map +1 -0
- package/dist/components/form-sections/PackageReviewSection.js +26 -0
- package/dist/components/form-sections/RentalBasicsSection.d.ts +12 -0
- package/dist/components/form-sections/RentalBasicsSection.d.ts.map +1 -0
- package/dist/components/form-sections/RentalBasicsSection.js +91 -0
- package/dist/components/form-sections/RentalCapacitySection.d.ts +9 -0
- package/dist/components/form-sections/RentalCapacitySection.d.ts.map +1 -0
- package/dist/components/form-sections/RentalCapacitySection.js +23 -0
- package/dist/components/form-sections/RentalLocationSection.d.ts +10 -0
- package/dist/components/form-sections/RentalLocationSection.d.ts.map +1 -0
- package/dist/components/form-sections/RentalLocationSection.js +41 -0
- package/dist/components/form-sections/RentalReviewSection.d.ts +10 -0
- package/dist/components/form-sections/RentalReviewSection.d.ts.map +1 -0
- package/dist/components/form-sections/RentalReviewSection.js +27 -0
- package/dist/components/form-sections/RentalRulesSection.d.ts +7 -0
- package/dist/components/form-sections/RentalRulesSection.d.ts.map +1 -0
- package/dist/components/form-sections/RentalRulesSection.js +10 -0
- package/dist/components/form-sections/RentalSpecsSection.d.ts +7 -0
- package/dist/components/form-sections/RentalSpecsSection.d.ts.map +1 -0
- package/dist/components/form-sections/RentalSpecsSection.js +10 -0
- package/dist/components/host-dashboard/HostCalendar.d.ts +8 -0
- package/dist/components/host-dashboard/HostCalendar.d.ts.map +1 -0
- package/dist/components/host-dashboard/HostCalendar.js +43 -0
- package/dist/components/host-dashboard/HostCalendarGrid.d.ts +34 -0
- package/dist/components/host-dashboard/HostCalendarGrid.d.ts.map +1 -0
- package/dist/components/host-dashboard/HostCalendarGrid.js +30 -0
- package/dist/components/host-dashboard/HostListingMultiSelect.d.ts +12 -0
- package/dist/components/host-dashboard/HostListingMultiSelect.d.ts.map +1 -0
- package/dist/components/host-dashboard/HostListingMultiSelect.js +24 -0
- package/dist/components/host-dashboard/HostManageCalendarShell.d.ts +17 -0
- package/dist/components/host-dashboard/HostManageCalendarShell.d.ts.map +1 -0
- package/dist/components/host-dashboard/HostManageCalendarShell.js +5 -0
- package/dist/components/host-dashboard/HostSidebarNavigation.d.ts +2 -0
- package/dist/components/host-dashboard/HostSidebarNavigation.d.ts.map +1 -0
- package/dist/components/host-dashboard/HostSidebarNavigation.js +299 -0
- package/dist/components/host-dashboard/ManageFeatureSwitcher.d.ts +15 -0
- package/dist/components/host-dashboard/ManageFeatureSwitcher.d.ts.map +1 -0
- package/dist/components/host-dashboard/ManageFeatureSwitcher.js +43 -0
- package/dist/components/host-dashboard/PageHeader.d.ts +14 -0
- package/dist/components/host-dashboard/PageHeader.d.ts.map +1 -0
- package/dist/components/host-dashboard/PageHeader.js +8 -0
- package/dist/components/host-dashboard/PlaceholderPage.d.ts +4 -0
- package/dist/components/host-dashboard/PlaceholderPage.d.ts.map +1 -0
- package/dist/components/host-dashboard/PlaceholderPage.js +9 -0
- package/dist/components/host-dashboard/StatCard.d.ts +15 -0
- package/dist/components/host-dashboard/StatCard.d.ts.map +1 -0
- package/dist/components/host-dashboard/StatCard.js +38 -0
- package/dist/components/layout/AppProviders.d.ts +5 -0
- package/dist/components/layout/AppProviders.d.ts.map +1 -0
- package/dist/components/layout/AppProviders.js +11 -0
- package/dist/components/layout/PublicRouteLayout.d.ts +5 -0
- package/dist/components/layout/PublicRouteLayout.d.ts.map +1 -0
- package/dist/components/layout/PublicRouteLayout.js +5 -0
- package/dist/components/layout/PublicShell.d.ts +5 -0
- package/dist/components/layout/PublicShell.d.ts.map +1 -0
- package/dist/components/layout/PublicShell.js +5 -0
- package/dist/components/location/LocationPicker.d.ts +27 -0
- package/dist/components/location/LocationPicker.d.ts.map +1 -0
- package/dist/components/location/LocationPicker.js +415 -0
- package/dist/components/location/LocationPreview.d.ts +11 -0
- package/dist/components/location/LocationPreview.d.ts.map +1 -0
- package/dist/components/location/LocationPreview.js +12 -0
- package/dist/components/location/MapPicker.d.ts +9 -0
- package/dist/components/location/MapPicker.d.ts.map +1 -0
- package/dist/components/location/MapPicker.js +40 -0
- package/dist/components/location/MapPreview.d.ts +8 -0
- package/dist/components/location/MapPreview.d.ts.map +1 -0
- package/dist/components/location/MapPreview.js +17 -0
- package/dist/components/location/PlaceLinkInline.d.ts +14 -0
- package/dist/components/location/PlaceLinkInline.d.ts.map +1 -0
- package/dist/components/location/PlaceLinkInline.js +30 -0
- package/dist/components/location/leafletMap.d.ts +8 -0
- package/dist/components/location/leafletMap.d.ts.map +1 -0
- package/dist/components/location/leafletMap.js +74 -0
- package/dist/components/ui/GuestOrLoginDialog.d.ts +11 -0
- package/dist/components/ui/GuestOrLoginDialog.d.ts.map +1 -0
- package/dist/components/ui/GuestOrLoginDialog.js +19 -0
- package/dist/components/ui/ImageGalleryViewer.d.ts +10 -0
- package/dist/components/ui/ImageGalleryViewer.d.ts.map +1 -0
- package/dist/components/ui/ImageGalleryViewer.js +59 -0
- package/dist/components/ui/LocationInput.d.ts +12 -0
- package/dist/components/ui/LocationInput.d.ts.map +1 -0
- package/dist/components/ui/LocationInput.js +39 -0
- package/dist/components/ui/PropertyGalleryClient.d.ts +8 -0
- package/dist/components/ui/PropertyGalleryClient.d.ts.map +1 -0
- package/dist/components/ui/PropertyGalleryClient.js +22 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +75 -0
- package/dist/components/ui/dashboard/admin-adventures-table.d.ts +12 -0
- package/dist/components/ui/dashboard/admin-adventures-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/admin-adventures-table.js +94 -0
- package/dist/components/ui/dashboard/admin-blogs-table.d.ts +11 -0
- package/dist/components/ui/dashboard/admin-blogs-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/admin-blogs-table.js +58 -0
- package/dist/components/ui/dashboard/admin-opportunities-table.d.ts +20 -0
- package/dist/components/ui/dashboard/admin-opportunities-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/admin-opportunities-table.js +139 -0
- package/dist/components/ui/dashboard/admin-rentals-table.d.ts +12 -0
- package/dist/components/ui/dashboard/admin-rentals-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/admin-rentals-table.js +85 -0
- package/dist/components/ui/dashboard/admin-travel-package-table.d.ts +16 -0
- package/dist/components/ui/dashboard/admin-travel-package-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/admin-travel-package-table.js +103 -0
- package/dist/components/ui/dashboard/adventures-table.d.ts +16 -0
- package/dist/components/ui/dashboard/adventures-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/adventures-table.js +151 -0
- package/dist/components/ui/dashboard/approver-applications-table.d.ts +13 -0
- package/dist/components/ui/dashboard/approver-applications-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/approver-applications-table.js +85 -0
- package/dist/components/ui/dashboard/approver-package-enquiries-table.d.ts +11 -0
- package/dist/components/ui/dashboard/approver-package-enquiries-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/approver-package-enquiries-table.js +102 -0
- package/dist/components/ui/dashboard/archive-confirm-modal.d.ts +9 -0
- package/dist/components/ui/dashboard/archive-confirm-modal.d.ts.map +1 -0
- package/dist/components/ui/dashboard/archive-confirm-modal.js +6 -0
- package/dist/components/ui/dashboard/blogs-table.d.ts +10 -0
- package/dist/components/ui/dashboard/blogs-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/blogs-table.js +62 -0
- package/dist/components/ui/dashboard/bookings-table.d.ts +13 -0
- package/dist/components/ui/dashboard/bookings-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/bookings-table.js +165 -0
- package/dist/components/ui/dashboard/dashboard-page-shell.d.ts +7 -0
- package/dist/components/ui/dashboard/dashboard-page-shell.d.ts.map +1 -0
- package/dist/components/ui/dashboard/dashboard-page-shell.js +5 -0
- package/dist/components/ui/dashboard/data-table-shell.d.ts +18 -0
- package/dist/components/ui/dashboard/data-table-shell.d.ts.map +1 -0
- package/dist/components/ui/dashboard/data-table-shell.js +6 -0
- package/dist/components/ui/dashboard/delete-confirm-modal.d.ts +9 -0
- package/dist/components/ui/dashboard/delete-confirm-modal.d.ts.map +1 -0
- package/dist/components/ui/dashboard/delete-confirm-modal.js +6 -0
- package/dist/components/ui/dashboard/entity-list-page-state.d.ts +25 -0
- package/dist/components/ui/dashboard/entity-list-page-state.d.ts.map +1 -0
- package/dist/components/ui/dashboard/entity-list-page-state.js +17 -0
- package/dist/components/ui/dashboard/generic-entity-table.d.ts +36 -0
- package/dist/components/ui/dashboard/generic-entity-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/generic-entity-table.js +203 -0
- package/dist/components/ui/dashboard/opportunities-table.d.ts +17 -0
- package/dist/components/ui/dashboard/opportunities-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/opportunities-table.js +143 -0
- package/dist/components/ui/dashboard/rentals-table.d.ts +17 -0
- package/dist/components/ui/dashboard/rentals-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/rentals-table.js +155 -0
- package/dist/components/ui/dashboard/restore-confirm-modal.d.ts +9 -0
- package/dist/components/ui/dashboard/restore-confirm-modal.d.ts.map +1 -0
- package/dist/components/ui/dashboard/restore-confirm-modal.js +6 -0
- package/dist/components/ui/dashboard/stats-card.d.ts +6 -0
- package/dist/components/ui/dashboard/stats-card.d.ts.map +1 -0
- package/dist/components/ui/dashboard/stats-card.js +5 -0
- package/dist/components/ui/dashboard/travel-packages-table.d.ts +16 -0
- package/dist/components/ui/dashboard/travel-packages-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/travel-packages-table.js +134 -0
- package/dist/components/ui/dashboard/user-applications-table.d.ts +12 -0
- package/dist/components/ui/dashboard/user-applications-table.d.ts.map +1 -0
- package/dist/components/ui/dashboard/user-applications-table.js +79 -0
- package/dist/components/ui/loading-skeleton.d.ts +10 -0
- package/dist/components/ui/loading-skeleton.d.ts.map +1 -0
- package/dist/components/ui/loading-skeleton.js +49 -0
- package/dist/components/ui/misc/IosPwaNavBar.d.ts +8 -0
- package/dist/components/ui/misc/IosPwaNavBar.d.ts.map +1 -0
- package/dist/components/ui/misc/IosPwaNavBar.js +25 -0
- package/dist/components/ui/misc/document-upload-button.d.ts +10 -0
- package/dist/components/ui/misc/document-upload-button.d.ts.map +1 -0
- package/dist/components/ui/misc/document-upload-button.js +12 -0
- package/dist/components/ui/misc/empty-state.d.ts +9 -0
- package/dist/components/ui/misc/empty-state.d.ts.map +1 -0
- package/dist/components/ui/misc/empty-state.js +4 -0
- package/dist/components/ui/misc/image-cropper.d.ts +9 -0
- package/dist/components/ui/misc/image-cropper.d.ts.map +1 -0
- package/dist/components/ui/misc/image-cropper.js +28 -0
- package/dist/components/ui/misc/pwa-install-button.d.ts +2 -0
- package/dist/components/ui/misc/pwa-install-button.d.ts.map +1 -0
- package/dist/components/ui/misc/pwa-install-button.js +17 -0
- package/dist/components/ui/misc/rental-tile.d.ts +6 -0
- package/dist/components/ui/misc/rental-tile.d.ts.map +1 -0
- package/dist/components/ui/misc/rental-tile.js +56 -0
- package/dist/components/ui/misc/skeleton-extras.d.ts +32 -0
- package/dist/components/ui/misc/skeleton-extras.d.ts.map +1 -0
- package/dist/components/ui/misc/skeleton-extras.js +58 -0
- package/dist/components/ui/misc/tile.d.ts +4 -0
- package/dist/components/ui/misc/tile.d.ts.map +1 -0
- package/dist/components/ui/misc/tile.js +45 -0
- package/dist/components/ui/misc/whatsapp-help.d.ts +7 -0
- package/dist/components/ui/misc/whatsapp-help.d.ts.map +1 -0
- package/dist/components/ui/misc/whatsapp-help.js +6 -0
- package/dist/components/ui/motion.d.ts +14 -0
- package/dist/components/ui/motion.d.ts.map +1 -0
- package/dist/components/ui/motion.js +17 -0
- package/dist/components/ui/trippeaze/breadcrumb-trail.d.ts +10 -0
- package/dist/components/ui/trippeaze/breadcrumb-trail.d.ts.map +1 -0
- package/dist/components/ui/trippeaze/breadcrumb-trail.js +15 -0
- package/dist/components/ui/trippeaze/chip-tabs.d.ts +13 -0
- package/dist/components/ui/trippeaze/chip-tabs.d.ts.map +1 -0
- package/dist/components/ui/trippeaze/chip-tabs.js +6 -0
- package/dist/components/ui/trippeaze/page-shell.d.ts +22 -0
- package/dist/components/ui/trippeaze/page-shell.d.ts.map +1 -0
- package/dist/components/ui/trippeaze/page-shell.js +15 -0
- package/dist/components/ui/trippeaze/search-input.d.ts +5 -0
- package/dist/components/ui/trippeaze/search-input.d.ts.map +1 -0
- package/dist/components/ui/trippeaze/search-input.js +7 -0
- package/dist/components/user-dashboard/UserDashboardShellSidebar.d.ts +2 -0
- package/dist/components/user-dashboard/UserDashboardShellSidebar.d.ts.map +1 -0
- package/dist/components/user-dashboard/UserDashboardShellSidebar.js +17 -0
- package/dist/components/user-dashboard/UserSidebarNav.d.ts +2 -0
- package/dist/components/user-dashboard/UserSidebarNav.d.ts.map +1 -0
- package/dist/components/user-dashboard/UserSidebarNav.js +68 -0
- package/dist/dashboard/action-buttons.d.ts +17 -0
- package/dist/dashboard/action-buttons.d.ts.map +1 -0
- package/dist/dashboard/action-buttons.js +22 -0
- package/dist/dashboard/app-sidebar.d.ts +3 -0
- package/dist/dashboard/app-sidebar.d.ts.map +1 -0
- package/dist/dashboard/app-sidebar.js +61 -0
- package/dist/dashboard/card-header.d.ts +11 -0
- package/dist/dashboard/card-header.d.ts.map +1 -0
- package/dist/dashboard/card-header.js +7 -0
- package/dist/dashboard/dashboard-components.d.ts +13 -0
- package/dist/dashboard/dashboard-components.d.ts.map +1 -0
- package/dist/dashboard/dashboard-components.js +10 -0
- package/dist/dashboard/data-table.d.ts +24 -0
- package/dist/dashboard/data-table.d.ts.map +1 -0
- package/dist/dashboard/data-table.js +88 -0
- package/dist/dashboard/nav-main.d.ts +9 -0
- package/dist/dashboard/nav-main.d.ts.map +1 -0
- package/dist/dashboard/nav-main.js +9 -0
- package/dist/dashboard/nav-secondary.d.ts +10 -0
- package/dist/dashboard/nav-secondary.d.ts.map +1 -0
- package/dist/dashboard/nav-secondary.js +6 -0
- package/dist/dashboard/stats-card.d.ts +6 -0
- package/dist/dashboard/stats-card.d.ts.map +1 -0
- package/dist/dashboard/stats-card.js +5 -0
- package/dist/dashboard/table.d.ts +11 -0
- package/dist/dashboard/table.d.ts.map +1 -0
- package/dist/dashboard/table.js +21 -0
- package/dist/header/mobile-nav-item.d.ts +9 -0
- package/dist/header/mobile-nav-item.d.ts.map +1 -0
- package/dist/header/mobile-nav-item.js +6 -0
- package/dist/header/mobile-navbar.d.ts +5 -0
- package/dist/header/mobile-navbar.d.ts.map +1 -0
- package/dist/header/mobile-navbar.js +30 -0
- package/dist/header/nav-item.d.ts +10 -0
- package/dist/header/nav-item.d.ts.map +1 -0
- package/dist/header/nav-item.js +6 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/layout/AppProviders.d.ts +5 -0
- package/dist/layout/AppProviders.d.ts.map +1 -0
- package/dist/layout/AppProviders.js +11 -0
- package/dist/layout/PublicShell.d.ts +5 -0
- package/dist/layout/PublicShell.d.ts.map +1 -0
- package/dist/layout/PublicShell.js +5 -0
- package/dist/main/footer.d.ts +6 -0
- package/dist/main/footer.d.ts.map +1 -0
- package/dist/main/footer.js +58 -0
- package/dist/main/navbar.d.ts +6 -0
- package/dist/main/navbar.d.ts.map +1 -0
- package/dist/main/navbar.js +130 -0
- package/dist/main/paginationBar.d.ts +5 -0
- package/dist/main/paginationBar.d.ts.map +1 -0
- package/dist/main/paginationBar.js +28 -0
- package/dist/main/portfolio/portfolioItem.d.ts +7 -0
- package/dist/main/portfolio/portfolioItem.d.ts.map +1 -0
- package/dist/main/portfolio/portfolioItem.js +7 -0
- package/dist/main/portfolio/portfolioPopup.d.ts +8 -0
- package/dist/main/portfolio/portfolioPopup.d.ts.map +1 -0
- package/dist/main/portfolio/portfolioPopup.js +71 -0
- package/dist/main/review-page.d.ts +14 -0
- package/dist/main/review-page.d.ts.map +1 -0
- package/dist/main/review-page.js +209 -0
- package/dist/misc/IosPwaNavBar.d.ts +8 -0
- package/dist/misc/IosPwaNavBar.d.ts.map +1 -0
- package/dist/misc/IosPwaNavBar.js +25 -0
- package/dist/misc/accordion.d.ts +7 -0
- package/dist/misc/accordion.d.ts.map +1 -0
- package/dist/misc/accordion.js +18 -0
- package/dist/misc/alert-dialog.d.ts +14 -0
- package/dist/misc/alert-dialog.d.ts.map +1 -0
- package/dist/misc/alert-dialog.js +39 -0
- package/dist/misc/alert.d.ts +9 -0
- package/dist/misc/alert.d.ts.map +1 -0
- package/dist/misc/alert.js +24 -0
- package/dist/misc/alertdialogclaude.d.ts +15 -0
- package/dist/misc/alertdialogclaude.d.ts.map +1 -0
- package/dist/misc/alertdialogclaude.js +151 -0
- package/dist/misc/avatar.d.ts +6 -0
- package/dist/misc/avatar.d.ts.map +1 -0
- package/dist/misc/avatar.js +14 -0
- package/dist/misc/badge.d.ts +9 -0
- package/dist/misc/badge.d.ts.map +1 -0
- package/dist/misc/badge.js +22 -0
- package/dist/misc/button.d.ts +13 -0
- package/dist/misc/button.d.ts.map +1 -0
- package/dist/misc/button.js +59 -0
- package/dist/misc/card.d.ts +9 -0
- package/dist/misc/card.d.ts.map +1 -0
- package/dist/misc/card.js +21 -0
- package/dist/misc/carousel.d.ts +20 -0
- package/dist/misc/carousel.d.ts.map +1 -0
- package/dist/misc/carousel.js +99 -0
- package/dist/misc/checkbox.d.ts +4 -0
- package/dist/misc/checkbox.d.ts.map +1 -0
- package/dist/misc/checkbox.js +9 -0
- package/dist/misc/command.d.ts +18 -0
- package/dist/misc/command.d.ts.map +1 -0
- package/dist/misc/command.js +34 -0
- package/dist/misc/datepicker.d.ts +15 -0
- package/dist/misc/datepicker.d.ts.map +1 -0
- package/dist/misc/datepicker.js +221 -0
- package/dist/misc/dialog.d.ts +13 -0
- package/dist/misc/dialog.d.ts.map +1 -0
- package/dist/misc/dialog.js +36 -0
- package/dist/misc/discount-strategy-editor.d.ts +22 -0
- package/dist/misc/discount-strategy-editor.d.ts.map +1 -0
- package/dist/misc/discount-strategy-editor.js +61 -0
- package/dist/misc/document-upload-button.d.ts +12 -0
- package/dist/misc/document-upload-button.d.ts.map +1 -0
- package/dist/misc/document-upload-button.js +27 -0
- package/dist/misc/dropdown-menu.d.ts +25 -0
- package/dist/misc/dropdown-menu.d.ts.map +1 -0
- package/dist/misc/dropdown-menu.js +51 -0
- package/dist/misc/empty-state.d.ts +10 -0
- package/dist/misc/empty-state.d.ts.map +1 -0
- package/dist/misc/empty-state.js +5 -0
- package/dist/misc/faq.d.ts +5 -0
- package/dist/misc/faq.d.ts.map +1 -0
- package/dist/misc/faq.js +5 -0
- package/dist/misc/file-preview.d.ts +9 -0
- package/dist/misc/file-preview.d.ts.map +1 -0
- package/dist/misc/file-preview.js +76 -0
- package/dist/misc/filter.d.ts +12 -0
- package/dist/misc/filter.d.ts.map +1 -0
- package/dist/misc/filter.js +44 -0
- package/dist/misc/filterBar.d.ts +39 -0
- package/dist/misc/filterBar.d.ts.map +1 -0
- package/dist/misc/filterBar.js +384 -0
- package/dist/misc/form.d.ts +25 -0
- package/dist/misc/form.d.ts.map +1 -0
- package/dist/misc/form.js +60 -0
- package/dist/misc/image-compressor.d.ts +29 -0
- package/dist/misc/image-compressor.d.ts.map +1 -0
- package/dist/misc/image-compressor.js +70 -0
- package/dist/misc/image-cropper.d.ts +10 -0
- package/dist/misc/image-cropper.d.ts.map +1 -0
- package/dist/misc/image-cropper.js +44 -0
- package/dist/misc/input.d.ts +7 -0
- package/dist/misc/input.d.ts.map +1 -0
- package/dist/misc/input.js +11 -0
- package/dist/misc/label.d.ts +4 -0
- package/dist/misc/label.d.ts.map +1 -0
- package/dist/misc/label.js +8 -0
- package/dist/misc/line-carousel.d.ts +9 -0
- package/dist/misc/line-carousel.d.ts.map +1 -0
- package/dist/misc/line-carousel.js +5 -0
- package/dist/misc/listing-wishlist-button.d.ts +13 -0
- package/dist/misc/listing-wishlist-button.d.ts.map +1 -0
- package/dist/misc/listing-wishlist-button.js +42 -0
- package/dist/misc/location/leafletMap.d.ts +8 -0
- package/dist/misc/location/leafletMap.d.ts.map +1 -0
- package/dist/misc/location/leafletMap.js +62 -0
- package/dist/misc/location/locationPicker.d.ts +5 -0
- package/dist/misc/location/locationPicker.d.ts.map +1 -0
- package/dist/misc/location/locationPicker.js +95 -0
- package/dist/misc/location-autocomplete.d.ts +28 -0
- package/dist/misc/location-autocomplete.d.ts.map +1 -0
- package/dist/misc/location-autocomplete.js +121 -0
- package/dist/misc/newsLetter.d.ts +3 -0
- package/dist/misc/newsLetter.d.ts.map +1 -0
- package/dist/misc/newsLetter.js +41 -0
- package/dist/misc/non-modal-multi-select.d.ts +21 -0
- package/dist/misc/non-modal-multi-select.d.ts.map +1 -0
- package/dist/misc/non-modal-multi-select.js +25 -0
- package/dist/misc/non-modal-select.d.ts +22 -0
- package/dist/misc/non-modal-select.d.ts.map +1 -0
- package/dist/misc/non-modal-select.js +23 -0
- package/dist/misc/notification.d.ts +7 -0
- package/dist/misc/notification.d.ts.map +1 -0
- package/dist/misc/notification.js +157 -0
- package/dist/misc/pagination.d.ts +15 -0
- package/dist/misc/pagination.d.ts.map +1 -0
- package/dist/misc/pagination.js +30 -0
- package/dist/misc/password-eye.d.ts +7 -0
- package/dist/misc/password-eye.d.ts.map +1 -0
- package/dist/misc/password-eye.js +7 -0
- package/dist/misc/popover.d.ts +7 -0
- package/dist/misc/popover.d.ts.map +1 -0
- package/dist/misc/popover.js +17 -0
- package/dist/misc/pricing-strategy-editor.d.ts +17 -0
- package/dist/misc/pricing-strategy-editor.d.ts.map +1 -0
- package/dist/misc/pricing-strategy-editor.js +80 -0
- package/dist/misc/progress.d.ts +4 -0
- package/dist/misc/progress.d.ts.map +1 -0
- package/dist/misc/progress.js +8 -0
- package/dist/misc/pwa-install-button.d.ts +9 -0
- package/dist/misc/pwa-install-button.d.ts.map +1 -0
- package/dist/misc/pwa-install-button.js +160 -0
- package/dist/misc/rental-tile.d.ts +6 -0
- package/dist/misc/rental-tile.d.ts.map +1 -0
- package/dist/misc/rental-tile.js +33 -0
- package/dist/misc/scroll-area.d.ts +5 -0
- package/dist/misc/scroll-area.d.ts.map +1 -0
- package/dist/misc/scroll-area.js +13 -0
- package/dist/misc/searchBar.d.ts +6 -0
- package/dist/misc/searchBar.d.ts.map +1 -0
- package/dist/misc/searchBar.js +89 -0
- package/dist/misc/searchBox.d.ts +13 -0
- package/dist/misc/searchBox.d.ts.map +1 -0
- package/dist/misc/searchBox.js +63 -0
- package/dist/misc/select.d.ts +13 -0
- package/dist/misc/select.d.ts.map +1 -0
- package/dist/misc/select.js +38 -0
- package/dist/misc/separator.d.ts +4 -0
- package/dist/misc/separator.d.ts.map +1 -0
- package/dist/misc/separator.js +8 -0
- package/dist/misc/share.d.ts +5 -0
- package/dist/misc/share.d.ts.map +1 -0
- package/dist/misc/share.js +157 -0
- package/dist/misc/sheet.d.ts +13 -0
- package/dist/misc/sheet.d.ts.map +1 -0
- package/dist/misc/sheet.js +40 -0
- package/dist/misc/sidebar.d.ts +70 -0
- package/dist/misc/sidebar.d.ts.map +1 -0
- package/dist/misc/sidebar.js +212 -0
- package/dist/misc/skeleton.d.ts +38 -0
- package/dist/misc/skeleton.d.ts.map +1 -0
- package/dist/misc/skeleton.js +43 -0
- package/dist/misc/slider.d.ts +5 -0
- package/dist/misc/slider.d.ts.map +1 -0
- package/dist/misc/slider.js +11 -0
- package/dist/misc/starRating.d.ts +4 -0
- package/dist/misc/starRating.d.ts.map +1 -0
- package/dist/misc/starRating.js +11 -0
- package/dist/misc/stateCard.d.ts +7 -0
- package/dist/misc/stateCard.d.ts.map +1 -0
- package/dist/misc/stateCard.js +21 -0
- package/dist/misc/step-progress.d.ts +16 -0
- package/dist/misc/step-progress.d.ts.map +1 -0
- package/dist/misc/step-progress.js +40 -0
- package/dist/misc/switch.d.ts +5 -0
- package/dist/misc/switch.d.ts.map +1 -0
- package/dist/misc/switch.js +8 -0
- package/dist/misc/tabs.d.ts +8 -0
- package/dist/misc/tabs.d.ts.map +1 -0
- package/dist/misc/tabs.js +17 -0
- package/dist/misc/tag-filter-input.d.ts +16 -0
- package/dist/misc/tag-filter-input.d.ts.map +1 -0
- package/dist/misc/tag-filter-input.js +26 -0
- package/dist/misc/textarea.d.ts +4 -0
- package/dist/misc/textarea.d.ts.map +1 -0
- package/dist/misc/textarea.js +6 -0
- package/dist/misc/tile.d.ts +4 -0
- package/dist/misc/tile.d.ts.map +1 -0
- package/dist/misc/tile.js +45 -0
- package/dist/misc/time-select.d.ts +14 -0
- package/dist/misc/time-select.d.ts.map +1 -0
- package/dist/misc/time-select.js +13 -0
- package/dist/misc/tooltip.d.ts +8 -0
- package/dist/misc/tooltip.d.ts.map +1 -0
- package/dist/misc/tooltip.js +17 -0
- package/dist/misc/whatsapp-help.d.ts +9 -0
- package/dist/misc/whatsapp-help.d.ts.map +1 -0
- package/dist/misc/whatsapp-help.js +13 -0
- package/dist/misc/wizard-footer.d.ts +18 -0
- package/dist/misc/wizard-footer.d.ts.map +1 -0
- package/dist/misc/wizard-footer.js +11 -0
- package/dist/profile/socialLink.d.ts +10 -0
- package/dist/profile/socialLink.d.ts.map +1 -0
- package/dist/profile/socialLink.js +66 -0
- package/dist/utils/permissions.d.ts +7 -0
- package/dist/utils/permissions.d.ts.map +1 -0
- package/dist/utils/permissions.js +38 -0
- package/package.json +93 -0
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
import { format, } from "date-fns";
|
|
6
|
+
import { useAtomValue } from "jotai";
|
|
7
|
+
import { userAtom } from "@myrjfa/state/dist/lib/userAtom";
|
|
8
|
+
import { calculatePricingStrategyUnitTotal, getPricingCurrency, getPricingStrategies } from "@myrjfa/state/dist/lib/models/pricing";
|
|
9
|
+
import { createBooking, verifyBookingPayment } from "@myrjfa/state/dist/lib/actions/booking";
|
|
10
|
+
import { Input } from "@myrjfa/ui/dist/misc/input";
|
|
11
|
+
import { Label } from "@myrjfa/ui/dist/misc/label";
|
|
12
|
+
import { Textarea } from "@myrjfa/ui/dist/misc/textarea";
|
|
13
|
+
import { showAlert } from "@myrjfa/ui/dist/misc/alertdialogclaude";
|
|
14
|
+
import { DatePicker } from "@myrjfa/ui/dist/misc/datepicker";
|
|
15
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@myrjfa/ui/dist/misc/select";
|
|
16
|
+
import { ExternalLink, FileText, } from "lucide-react";
|
|
17
|
+
import { GuestOrLoginDialog } from "@myrjfa/ui/dist/components/ui/GuestOrLoginDialog";
|
|
18
|
+
import { OffersAndCouponsSheet } from "@myrjfa/ui/dist/components/discounts/OffersAndCouponsSheet";
|
|
19
|
+
const BOOKING_CONFIRMATION_STORAGE_KEY = "latest_booking_confirmation";
|
|
20
|
+
function formatDateKey(value) {
|
|
21
|
+
return format(new Date(value), "yyyy-MM-dd");
|
|
22
|
+
}
|
|
23
|
+
function addMonthsClamped(date, months) {
|
|
24
|
+
const next = new Date(date);
|
|
25
|
+
const day = next.getDate();
|
|
26
|
+
next.setDate(1);
|
|
27
|
+
next.setMonth(next.getMonth() + months);
|
|
28
|
+
const lastDay = new Date(next.getFullYear(), next.getMonth() + 1, 0).getDate();
|
|
29
|
+
next.setDate(Math.min(day, lastDay));
|
|
30
|
+
return next;
|
|
31
|
+
}
|
|
32
|
+
function addPackageFrequency(date, entity) {
|
|
33
|
+
const frequency = String((entity === null || entity === void 0 ? void 0 : entity.frequency) || "weekly").toLowerCase();
|
|
34
|
+
const next = new Date(date);
|
|
35
|
+
if (frequency === "daily")
|
|
36
|
+
next.setDate(next.getDate() + 1);
|
|
37
|
+
else if (frequency === "weekly")
|
|
38
|
+
next.setDate(next.getDate() + 7);
|
|
39
|
+
else if (frequency === "bi-weekly" || frequency === "biweekly")
|
|
40
|
+
next.setDate(next.getDate() + 14);
|
|
41
|
+
else if (frequency === "monthly")
|
|
42
|
+
return addMonthsClamped(next, 1);
|
|
43
|
+
else if (frequency === "yearly")
|
|
44
|
+
return addMonthsClamped(next, 12);
|
|
45
|
+
else if (frequency === "custom")
|
|
46
|
+
next.setDate(next.getDate() + Math.max(1, Number(entity === null || entity === void 0 ? void 0 : entity.customFrequencyDays) || 1));
|
|
47
|
+
else
|
|
48
|
+
next.setDate(next.getDate() + 7);
|
|
49
|
+
return next;
|
|
50
|
+
}
|
|
51
|
+
function buildPackageAvailableDateKeys(entity) {
|
|
52
|
+
if (Array.isArray(entity === null || entity === void 0 ? void 0 : entity.availableDateKeys) && entity.availableDateKeys.length) {
|
|
53
|
+
return entity.availableDateKeys.map((value) => formatDateKey(value));
|
|
54
|
+
}
|
|
55
|
+
if (!(entity === null || entity === void 0 ? void 0 : entity.availableFrom))
|
|
56
|
+
return [];
|
|
57
|
+
const dateKeys = [];
|
|
58
|
+
const todayKey = formatDateKey(new Date());
|
|
59
|
+
const bookedCounts = (entity === null || entity === void 0 ? void 0 : entity.bookedDateCounts) || {};
|
|
60
|
+
const capacity = Math.max(1, Number(entity === null || entity === void 0 ? void 0 : entity.peopleRequired) || 1);
|
|
61
|
+
let cursor = new Date(entity.availableFrom);
|
|
62
|
+
cursor = new Date(cursor.getFullYear(), cursor.getMonth(), cursor.getDate(), 12);
|
|
63
|
+
const horizon = new Date();
|
|
64
|
+
horizon.setDate(horizon.getDate() + 730);
|
|
65
|
+
let guard = 0;
|
|
66
|
+
while (cursor <= horizon && guard < 800) {
|
|
67
|
+
const key = formatDateKey(cursor);
|
|
68
|
+
if (key >= todayKey && Number(bookedCounts[key] || 0) < capacity) {
|
|
69
|
+
dateKeys.push(key);
|
|
70
|
+
}
|
|
71
|
+
cursor = addPackageFrequency(cursor, entity);
|
|
72
|
+
guard += 1;
|
|
73
|
+
}
|
|
74
|
+
return dateKeys;
|
|
75
|
+
}
|
|
76
|
+
function toNonNegativeAmount(value) {
|
|
77
|
+
const amount = Number(value);
|
|
78
|
+
return Number.isFinite(amount) ? Math.max(amount, 0) : 0;
|
|
79
|
+
}
|
|
80
|
+
function parseTimeMinutes(value) {
|
|
81
|
+
const [hourRaw, minuteRaw] = String(value || "").split(":");
|
|
82
|
+
const hour = Number(hourRaw);
|
|
83
|
+
const minute = Number(minuteRaw);
|
|
84
|
+
if (!Number.isFinite(hour) || !Number.isFinite(minute))
|
|
85
|
+
return null;
|
|
86
|
+
return hour * 60 + minute;
|
|
87
|
+
}
|
|
88
|
+
function calculateRentalChargeDays(startDate, endDate, pickupTime, returnTime, normalPickupTime, normalDropTime) {
|
|
89
|
+
if (!startDate || !endDate)
|
|
90
|
+
return 0;
|
|
91
|
+
const diff = new Date(endDate).getTime() - new Date(startDate).getTime();
|
|
92
|
+
const baseDays = Math.max(1, Math.ceil(diff / (1000 * 60 * 60 * 24)));
|
|
93
|
+
const pickupMins = parseTimeMinutes(pickupTime);
|
|
94
|
+
const returnMins = parseTimeMinutes(returnTime);
|
|
95
|
+
const normalPickupMins = parseTimeMinutes(normalPickupTime);
|
|
96
|
+
const normalDropMins = parseTimeMinutes(normalDropTime);
|
|
97
|
+
const pickupExtra = pickupMins !== null && normalPickupMins !== null && pickupMins < normalPickupMins
|
|
98
|
+
? 1
|
|
99
|
+
: 0;
|
|
100
|
+
const dropExtra = returnMins !== null && normalDropMins !== null && returnMins > normalDropMins
|
|
101
|
+
? 1
|
|
102
|
+
: 0;
|
|
103
|
+
return baseDays + pickupExtra + dropExtra;
|
|
104
|
+
}
|
|
105
|
+
function getCustomerProductUnitPrice(strategy) {
|
|
106
|
+
var _a;
|
|
107
|
+
if (!strategy)
|
|
108
|
+
return 0;
|
|
109
|
+
return (toNonNegativeAmount((_a = strategy.finalBasePrice) !== null && _a !== void 0 ? _a : strategy.basePrice) +
|
|
110
|
+
toNonNegativeAmount(strategy.platformFee));
|
|
111
|
+
}
|
|
112
|
+
function getCustomerTaxUnitTotal(strategy) {
|
|
113
|
+
if (!strategy)
|
|
114
|
+
return 0;
|
|
115
|
+
return (toNonNegativeAmount(strategy.gst) +
|
|
116
|
+
toNonNegativeAmount(strategy.governmentTaxes) +
|
|
117
|
+
toNonNegativeAmount(strategy.convenienceFee));
|
|
118
|
+
}
|
|
119
|
+
function getCustomerUnitTotal(strategy) {
|
|
120
|
+
return getCustomerProductUnitPrice(strategy) + getCustomerTaxUnitTotal(strategy);
|
|
121
|
+
}
|
|
122
|
+
function EditableNumberInput({ value, min = 0, onValueChange, ...props }) {
|
|
123
|
+
const [draft, setDraft] = useState(String(value !== null && value !== void 0 ? value : min));
|
|
124
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (!isFocused)
|
|
127
|
+
setDraft(String(value !== null && value !== void 0 ? value : min));
|
|
128
|
+
}, [isFocused, min, value]);
|
|
129
|
+
return (_jsx(Input, { ...props, type: "number", min: min, value: draft, onFocus: () => {
|
|
130
|
+
setIsFocused(true);
|
|
131
|
+
if (Number(draft) === 0)
|
|
132
|
+
setDraft("");
|
|
133
|
+
}, onBlur: () => {
|
|
134
|
+
setIsFocused(false);
|
|
135
|
+
const nextValue = draft.trim() === "" ? min : Math.max(min, Number(draft) || min);
|
|
136
|
+
setDraft(String(nextValue));
|
|
137
|
+
onValueChange(nextValue);
|
|
138
|
+
}, onChange: (event) => {
|
|
139
|
+
const nextDraft = event.target.value;
|
|
140
|
+
setDraft(nextDraft);
|
|
141
|
+
if (nextDraft.trim() !== "") {
|
|
142
|
+
onValueChange(Math.max(min, Number(nextDraft) || min));
|
|
143
|
+
}
|
|
144
|
+
} }));
|
|
145
|
+
}
|
|
146
|
+
export function BookingForm({ entity, type, preStartDate, preEndDate, preStartTime, prePickupTime, preReturnTime, prePickupPointIndex, preHomeDeliverySelected, preRoomId, preRoomQty, preNumberOfPeople, prePricingIndex, onDatesChange, onPackageSummaryChange, onBookingSnapshotChange, }) {
|
|
147
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
148
|
+
const user = useAtomValue(userAtom);
|
|
149
|
+
const router = useRouter();
|
|
150
|
+
const [loading, setLoading] = useState(false);
|
|
151
|
+
const [termsAccepted, setTermsAccepted] = useState(false);
|
|
152
|
+
const [showGuestDialog, setShowGuestDialog] = useState(false);
|
|
153
|
+
const [couponCode, setCouponCode] = useState("");
|
|
154
|
+
const [discountQuote, setDiscountQuote] = useState(null);
|
|
155
|
+
const [checkoutStartedAt] = useState(() => new Date().toISOString());
|
|
156
|
+
// Derive operating hours from entity (set during creation); default 09:00–21:00
|
|
157
|
+
const opStart = ((_a = entity === null || entity === void 0 ? void 0 : entity.operatingHours) === null || _a === void 0 ? void 0 : _a.start) || "09:00";
|
|
158
|
+
const opEnd = ((_b = entity === null || entity === void 0 ? void 0 : entity.operatingHours) === null || _b === void 0 ? void 0 : _b.end) || "21:00";
|
|
159
|
+
const normalPickupTime = (entity === null || entity === void 0 ? void 0 : entity.normalPickupTime) || opStart;
|
|
160
|
+
const normalDropTime = (entity === null || entity === void 0 ? void 0 : entity.normalDropTime) || opEnd;
|
|
161
|
+
// Dynamically generate 30-min slots within operating hours
|
|
162
|
+
const buildSlots = (start, end) => {
|
|
163
|
+
if (!start || !end)
|
|
164
|
+
return [];
|
|
165
|
+
const startParts = start.split(":").map(Number);
|
|
166
|
+
const endParts = end.split(":").map(Number);
|
|
167
|
+
const startH = startParts[0] !== undefined ? startParts[0] : 0;
|
|
168
|
+
const startM = startParts[1] !== undefined ? startParts[1] : 0;
|
|
169
|
+
const endH = endParts[0] !== undefined ? endParts[0] : 0;
|
|
170
|
+
const endM = endParts[1] !== undefined ? endParts[1] : 0;
|
|
171
|
+
const startMins = startH * 60 + startM;
|
|
172
|
+
const endMins = endH * 60 + endM;
|
|
173
|
+
const slots = [];
|
|
174
|
+
for (let m = startMins; m <= endMins; m += 30) {
|
|
175
|
+
const h = Math.floor(m / 60)
|
|
176
|
+
.toString()
|
|
177
|
+
.padStart(2, "0");
|
|
178
|
+
const min = (m % 60).toString().padStart(2, "0");
|
|
179
|
+
slots.push(`${h}:${min}`);
|
|
180
|
+
}
|
|
181
|
+
return slots;
|
|
182
|
+
};
|
|
183
|
+
const TIME_SLOTS = buildSlots(opStart, opEnd);
|
|
184
|
+
const todayDateKey = format(new Date(), "yyyy-MM-dd");
|
|
185
|
+
const blockedAdventureDateKeys = new Set(((entity === null || entity === void 0 ? void 0 : entity.blockedDates) || []).map((value) => format(new Date(value), "yyyy-MM-dd")));
|
|
186
|
+
const configuredAdventureSlots = Array.isArray(entity === null || entity === void 0 ? void 0 : entity.slots)
|
|
187
|
+
? entity.slots
|
|
188
|
+
.map((slot) => {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
const dateKey = (slot === null || slot === void 0 ? void 0 : slot.date)
|
|
191
|
+
? format(new Date(slot.date), "yyyy-MM-dd")
|
|
192
|
+
: "";
|
|
193
|
+
const remainingCapacity = (_a = slot === null || slot === void 0 ? void 0 : slot.remainingCapacity) !== null && _a !== void 0 ? _a : Math.max((Number(slot === null || slot === void 0 ? void 0 : slot.maxParticipants) || 0) -
|
|
194
|
+
(Number(slot === null || slot === void 0 ? void 0 : slot.bookedCount) || 0), 0);
|
|
195
|
+
return {
|
|
196
|
+
...slot,
|
|
197
|
+
dateKey,
|
|
198
|
+
startTime: String((slot === null || slot === void 0 ? void 0 : slot.startTime) || "").trim(),
|
|
199
|
+
endTime: String((slot === null || slot === void 0 ? void 0 : slot.endTime) || "").trim(),
|
|
200
|
+
remainingCapacity,
|
|
201
|
+
isBookable: (_b = slot === null || slot === void 0 ? void 0 : slot.isBookable) !== null && _b !== void 0 ? _b : ((slot === null || slot === void 0 ? void 0 : slot.isAvailable) !== false && remainingCapacity > 0),
|
|
202
|
+
};
|
|
203
|
+
})
|
|
204
|
+
.filter((slot) => slot.dateKey && slot.startTime)
|
|
205
|
+
: [];
|
|
206
|
+
const [formData, setFormData] = useState({
|
|
207
|
+
startDate: preStartDate ? new Date(preStartDate) : undefined,
|
|
208
|
+
endDate: preEndDate ? new Date(preEndDate) : undefined,
|
|
209
|
+
startTime: preStartTime || opStart,
|
|
210
|
+
pickupTime: prePickupTime || normalPickupTime,
|
|
211
|
+
returnTime: preReturnTime || normalDropTime,
|
|
212
|
+
numberOfPeople: preNumberOfPeople || 1,
|
|
213
|
+
specialRequests: "",
|
|
214
|
+
name: (user === null || user === void 0 ? void 0 : user.firstName) ? `${user.firstName} ${user.lastName}` : "",
|
|
215
|
+
email: (user === null || user === void 0 ? void 0 : user.email) || "",
|
|
216
|
+
phone: (user === null || user === void 0 ? void 0 : user.phoneNumber) || "",
|
|
217
|
+
});
|
|
218
|
+
const DRAFT_KEY = `booking_draft_${entity._id}`;
|
|
219
|
+
// Restore saved form state after login redirect
|
|
220
|
+
useEffect(() => {
|
|
221
|
+
const saved = sessionStorage.getItem(DRAFT_KEY);
|
|
222
|
+
if (!saved)
|
|
223
|
+
return;
|
|
224
|
+
try {
|
|
225
|
+
const parsed = JSON.parse(saved);
|
|
226
|
+
sessionStorage.removeItem(DRAFT_KEY);
|
|
227
|
+
const start = parsed.startDate ? new Date(parsed.startDate) : undefined;
|
|
228
|
+
const end = parsed.endDate ? new Date(parsed.endDate) : undefined;
|
|
229
|
+
setFormData((prev) => ({
|
|
230
|
+
...prev,
|
|
231
|
+
...parsed,
|
|
232
|
+
startDate: start,
|
|
233
|
+
endDate: end,
|
|
234
|
+
// User profile takes precedence over saved contact info
|
|
235
|
+
name: (user === null || user === void 0 ? void 0 : user.firstName) ? `${user.firstName} ${user.lastName}` : parsed.name || prev.name,
|
|
236
|
+
email: (user === null || user === void 0 ? void 0 : user.email) || parsed.email || prev.email,
|
|
237
|
+
phone: (user === null || user === void 0 ? void 0 : user.phoneNumber) || parsed.phone || prev.phone,
|
|
238
|
+
}));
|
|
239
|
+
onDatesChange === null || onDatesChange === void 0 ? void 0 : onDatesChange(start !== null && start !== void 0 ? start : null, end !== null && end !== void 0 ? end : null);
|
|
240
|
+
}
|
|
241
|
+
catch (_a) { }
|
|
242
|
+
}, []);
|
|
243
|
+
const isRental = type === "Rental";
|
|
244
|
+
const isStay = type === "Stay";
|
|
245
|
+
const isEvent = type === "Event";
|
|
246
|
+
const isAdventure = type === "Adventure";
|
|
247
|
+
const isGuide = type === "Guide";
|
|
248
|
+
const isPackage = type === "TravelPackage";
|
|
249
|
+
const selectedAdventureDateKey = formData.startDate
|
|
250
|
+
? format(formData.startDate, "yyyy-MM-dd")
|
|
251
|
+
: "";
|
|
252
|
+
const availableAdventureDateKeys = Array.from(new Set(configuredAdventureSlots
|
|
253
|
+
.filter((slot) => slot.isBookable &&
|
|
254
|
+
slot.dateKey >= todayDateKey &&
|
|
255
|
+
!blockedAdventureDateKeys.has(slot.dateKey))
|
|
256
|
+
.map((slot) => String(slot.dateKey))));
|
|
257
|
+
const selectedAdventureSlots = isAdventure
|
|
258
|
+
? configuredAdventureSlots.filter((slot) => slot.dateKey === selectedAdventureDateKey &&
|
|
259
|
+
!blockedAdventureDateKeys.has(slot.dateKey))
|
|
260
|
+
: [];
|
|
261
|
+
const bookableAdventureSlots = selectedAdventureSlots.filter((slot) => slot.isBookable);
|
|
262
|
+
const selectedAdventureSlot = bookableAdventureSlots.find((slot) => slot.startTime === formData.startTime);
|
|
263
|
+
const deliveryCharge = isRental && preHomeDeliverySelected && entity.homeDeliveryAvailable
|
|
264
|
+
? entity.homeDeliveryPrice || 0
|
|
265
|
+
: 0;
|
|
266
|
+
const selectedPickupPoint = isRental && prePickupPointIndex !== null && prePickupPointIndex !== undefined
|
|
267
|
+
? (_c = entity.pickupPoints) === null || _c === void 0 ? void 0 : _c[prePickupPointIndex]
|
|
268
|
+
: null;
|
|
269
|
+
const packagePricing = getPricingStrategies(entity) || [];
|
|
270
|
+
const packageAvailableDateKeys = useMemo(() => (isPackage ? buildPackageAvailableDateKeys(entity) : []), [entity, isPackage]);
|
|
271
|
+
const entityCurrency = getPricingCurrency(entity) || "INR";
|
|
272
|
+
const primaryEntityPricing = packagePricing[0];
|
|
273
|
+
const packageActivities = (entity === null || entity === void 0 ? void 0 : entity.activities) || [];
|
|
274
|
+
const compulsoryPackageActivities = packageActivities.filter((activity) => activity.type === "compulsory");
|
|
275
|
+
const optionalPackageActivities = packageActivities.filter((activity) => activity.type === "optional");
|
|
276
|
+
const [selectedPricingIndex, setSelectedPricingIndex] = useState(Math.max(0, Number(prePricingIndex) || 0));
|
|
277
|
+
const [males, setMales] = useState(0);
|
|
278
|
+
const [females, setFemales] = useState(0);
|
|
279
|
+
const [selectedOptionalActivities, setSelectedOptionalActivities] = useState([]);
|
|
280
|
+
const selectedEntityPricing = packagePricing[selectedPricingIndex] || primaryEntityPricing;
|
|
281
|
+
const experienceUnitPrice = isAdventure || isGuide
|
|
282
|
+
? getCustomerUnitTotal(selectedEntityPricing)
|
|
283
|
+
: 0;
|
|
284
|
+
// Calculate number of days/nights
|
|
285
|
+
let duration = 0;
|
|
286
|
+
if (isRental && formData.startDate && formData.endDate) {
|
|
287
|
+
duration = calculateRentalChargeDays(formData.startDate, formData.endDate, formData.pickupTime, formData.returnTime, normalPickupTime, normalDropTime);
|
|
288
|
+
}
|
|
289
|
+
else if (isStay && formData.startDate && formData.endDate) {
|
|
290
|
+
const diff = new Date(formData.endDate).getTime() - new Date(formData.startDate).getTime();
|
|
291
|
+
duration = Math.max(1, Math.ceil(diff / (1000 * 60 * 60 * 24)));
|
|
292
|
+
}
|
|
293
|
+
useEffect(() => {
|
|
294
|
+
if (!isPackage)
|
|
295
|
+
return;
|
|
296
|
+
const preferredKey = preStartDate && packageAvailableDateKeys.includes(formatDateKey(preStartDate))
|
|
297
|
+
? formatDateKey(preStartDate)
|
|
298
|
+
: packageAvailableDateKeys[0];
|
|
299
|
+
const pkgStartDate = preferredKey ? new Date(`${preferredKey}T12:00:00`) : undefined;
|
|
300
|
+
setFormData((prev) => {
|
|
301
|
+
const currentKey = prev.startDate ? formatDateKey(prev.startDate) : "";
|
|
302
|
+
if (currentKey &&
|
|
303
|
+
packageAvailableDateKeys.includes(currentKey) &&
|
|
304
|
+
prev.endDate === undefined) {
|
|
305
|
+
return prev;
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
...prev,
|
|
309
|
+
startDate: pkgStartDate,
|
|
310
|
+
endDate: undefined,
|
|
311
|
+
};
|
|
312
|
+
});
|
|
313
|
+
onDatesChange === null || onDatesChange === void 0 ? void 0 : onDatesChange(pkgStartDate !== null && pkgStartDate !== void 0 ? pkgStartDate : null, null);
|
|
314
|
+
}, [isPackage, onDatesChange, packageAvailableDateKeys, preStartDate]);
|
|
315
|
+
useEffect(() => {
|
|
316
|
+
if (!isEvent || !(entity === null || entity === void 0 ? void 0 : entity.startTime))
|
|
317
|
+
return;
|
|
318
|
+
setFormData((prev) => ({
|
|
319
|
+
...prev,
|
|
320
|
+
startTime: entity.startTime,
|
|
321
|
+
}));
|
|
322
|
+
}, [isEvent, entity === null || entity === void 0 ? void 0 : entity.startTime]);
|
|
323
|
+
useEffect(() => {
|
|
324
|
+
var _a, _b;
|
|
325
|
+
if (!isAdventure)
|
|
326
|
+
return;
|
|
327
|
+
if (configuredAdventureSlots.length === 0) {
|
|
328
|
+
if (formData.startTime) {
|
|
329
|
+
setFormData((prev) => ({ ...prev, startTime: "" }));
|
|
330
|
+
}
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const dateHasBookableSlot = selectedAdventureDateKey &&
|
|
334
|
+
availableAdventureDateKeys.includes(selectedAdventureDateKey);
|
|
335
|
+
const nextDateKey = dateHasBookableSlot
|
|
336
|
+
? selectedAdventureDateKey
|
|
337
|
+
: availableAdventureDateKeys[0] || "";
|
|
338
|
+
const nextDate = nextDateKey ? new Date(`${nextDateKey}T12:00:00`) : undefined;
|
|
339
|
+
const nextDateSlots = configuredAdventureSlots.filter((slot) => slot.dateKey === nextDateKey &&
|
|
340
|
+
slot.isBookable &&
|
|
341
|
+
!blockedAdventureDateKeys.has(slot.dateKey));
|
|
342
|
+
const nextSlot = nextDateSlots.find((slot) => slot.startTime === formData.startTime)
|
|
343
|
+
? formData.startTime
|
|
344
|
+
: ((_a = nextDateSlots[0]) === null || _a === void 0 ? void 0 : _a.startTime) || "";
|
|
345
|
+
const shouldChangeDate = ((nextDate === null || nextDate === void 0 ? void 0 : nextDate.getTime()) || 0) !== (((_b = formData.startDate) === null || _b === void 0 ? void 0 : _b.getTime()) || 0);
|
|
346
|
+
const shouldChangeTime = nextSlot !== formData.startTime;
|
|
347
|
+
if (shouldChangeDate || shouldChangeTime) {
|
|
348
|
+
setFormData((prev) => ({
|
|
349
|
+
...prev,
|
|
350
|
+
startDate: shouldChangeDate ? nextDate : prev.startDate,
|
|
351
|
+
startTime: nextSlot,
|
|
352
|
+
}));
|
|
353
|
+
if (shouldChangeDate)
|
|
354
|
+
onDatesChange === null || onDatesChange === void 0 ? void 0 : onDatesChange(nextDate !== null && nextDate !== void 0 ? nextDate : null, null);
|
|
355
|
+
}
|
|
356
|
+
}, [
|
|
357
|
+
availableAdventureDateKeys,
|
|
358
|
+
configuredAdventureSlots.length,
|
|
359
|
+
formData.startTime,
|
|
360
|
+
formData.startDate,
|
|
361
|
+
isAdventure,
|
|
362
|
+
onDatesChange,
|
|
363
|
+
selectedAdventureDateKey,
|
|
364
|
+
]);
|
|
365
|
+
const getRentalTotal = (days) => {
|
|
366
|
+
return calculatePricingStrategyUnitTotal(primaryEntityPricing) * days;
|
|
367
|
+
};
|
|
368
|
+
const getRentalUpfrontPayment = (days) => {
|
|
369
|
+
var _a, _b;
|
|
370
|
+
const strategy = (primaryEntityPricing || {});
|
|
371
|
+
const hostUnit = Number((_b = (_a = strategy.finalBasePrice) !== null && _a !== void 0 ? _a : strategy.basePrice) !== null && _b !== void 0 ? _b : 0);
|
|
372
|
+
const platformUnit = Number(strategy.platformFee || 0);
|
|
373
|
+
const gstUnit = Number(strategy.gst || 0);
|
|
374
|
+
const governmentUnit = Number(strategy.governmentTaxes || 0);
|
|
375
|
+
const convenienceUnit = Number(strategy.convenienceFee || 0);
|
|
376
|
+
const baseSubtotal = hostUnit * days;
|
|
377
|
+
const feeSubtotal = (platformUnit + gstUnit + governmentUnit + convenienceUnit) * days;
|
|
378
|
+
const total = baseSubtotal + feeSubtotal + (preHomeDeliverySelected ? deliveryCharge : 0);
|
|
379
|
+
return entity.payAtPickup
|
|
380
|
+
? feeSubtotal
|
|
381
|
+
: total;
|
|
382
|
+
};
|
|
383
|
+
let baseTotalPrice = 0;
|
|
384
|
+
if (isRental) {
|
|
385
|
+
baseTotalPrice = duration > 0 ? getRentalTotal(duration) : calculatePricingStrategyUnitTotal(primaryEntityPricing);
|
|
386
|
+
if (preHomeDeliverySelected) {
|
|
387
|
+
baseTotalPrice += deliveryCharge;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
else if (isStay) {
|
|
391
|
+
const room = preRoomId ? (_d = entity.rooms) === null || _d === void 0 ? void 0 : _d.find((r) => r._id === preRoomId) : null;
|
|
392
|
+
const roomRate = room ? room.pricePerNight : 0;
|
|
393
|
+
const qty = preRoomQty || 1;
|
|
394
|
+
let base = roomRate * (duration > 0 ? duration : 1) * qty;
|
|
395
|
+
let cleaningFee = ((_e = entity.fees) === null || _e === void 0 ? void 0 : _e.cleaningFee) || 0;
|
|
396
|
+
let taxAmount = Math.round(base * ((((_f = entity.fees) === null || _f === void 0 ? void 0 : _f.taxPercentage) || 0) / 100));
|
|
397
|
+
baseTotalPrice = base + cleaningFee + taxAmount;
|
|
398
|
+
}
|
|
399
|
+
else if (isEvent) {
|
|
400
|
+
baseTotalPrice = entity.isFree ? 0 : calculatePricingStrategyUnitTotal(primaryEntityPricing) * (formData.numberOfPeople || 1);
|
|
401
|
+
}
|
|
402
|
+
else if (isPackage) {
|
|
403
|
+
const selectedPricing = packagePricing[selectedPricingIndex];
|
|
404
|
+
const totalPeople = males + females;
|
|
405
|
+
const activityTotal = optionalPackageActivities
|
|
406
|
+
.filter((activity) => selectedOptionalActivities.includes(activity.name))
|
|
407
|
+
.reduce((sum, activity) => sum + ((activity.additionalPrice || 0) * totalPeople), 0);
|
|
408
|
+
if (selectedPricing && totalPeople > 0) {
|
|
409
|
+
baseTotalPrice = (getCustomerUnitTotal(selectedPricing) * totalPeople) + activityTotal;
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
baseTotalPrice = 0;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
// Adventure or guide
|
|
417
|
+
baseTotalPrice = experienceUnitPrice * formData.numberOfPeople;
|
|
418
|
+
}
|
|
419
|
+
const packageTotalPeople = males + females;
|
|
420
|
+
const featureType = { Rental: "rental", Adventure: "adventure", Guide: "guide", Stay: "stay", Event: "event", TravelPackage: "package" }[type];
|
|
421
|
+
const quoteInput = {
|
|
422
|
+
featureType,
|
|
423
|
+
targetId: entity._id,
|
|
424
|
+
subTargetId: isStay ? preRoomId || undefined : undefined,
|
|
425
|
+
pricingStrategyId: (selectedEntityPricing === null || selectedEntityPricing === void 0 ? void 0 : selectedEntityPricing._id) || undefined,
|
|
426
|
+
selectedPricingIndex,
|
|
427
|
+
quantity: isStay ? preRoomQty || 1 : isPackage ? packageTotalPeople || 1 : isRental ? 1 : formData.numberOfPeople,
|
|
428
|
+
participants: isPackage ? packageTotalPeople || 1 : formData.numberOfPeople,
|
|
429
|
+
startDate: (_g = formData.startDate) === null || _g === void 0 ? void 0 : _g.toISOString(),
|
|
430
|
+
endDate: (_h = formData.endDate) === null || _h === void 0 ? void 0 : _h.toISOString(),
|
|
431
|
+
startTime: formData.startTime || undefined,
|
|
432
|
+
pickupTime: isRental ? formData.pickupTime : undefined,
|
|
433
|
+
activityTotal: isPackage ? Math.max(baseTotalPrice - (getCustomerUnitTotal(selectedEntityPricing) * packageTotalPeople), 0) : undefined,
|
|
434
|
+
checkoutStartedAt,
|
|
435
|
+
};
|
|
436
|
+
const quoteFingerprint = JSON.stringify(quoteInput);
|
|
437
|
+
useEffect(() => setDiscountQuote(null), [quoteFingerprint]);
|
|
438
|
+
const displayedTotalPrice = (_j = discountQuote === null || discountQuote === void 0 ? void 0 : discountQuote.totalAfterDiscount) !== null && _j !== void 0 ? _j : baseTotalPrice;
|
|
439
|
+
const upfrontPayment = isRental
|
|
440
|
+
? entity.payAtPickup
|
|
441
|
+
? Math.max((duration > 0 ? getRentalUpfrontPayment(duration) : baseTotalPrice) - Number((discountQuote === null || discountQuote === void 0 ? void 0 : discountQuote.funding.platform) || 0) - Number((discountQuote === null || discountQuote === void 0 ? void 0 : discountQuote.funding.partner) || 0), 0)
|
|
442
|
+
: displayedTotalPrice
|
|
443
|
+
: displayedTotalPrice;
|
|
444
|
+
useEffect(() => {
|
|
445
|
+
if (!isPackage)
|
|
446
|
+
return;
|
|
447
|
+
onPackageSummaryChange === null || onPackageSummaryChange === void 0 ? void 0 : onPackageSummaryChange({
|
|
448
|
+
selectedPricingIndex,
|
|
449
|
+
totalPeople: packageTotalPeople,
|
|
450
|
+
males,
|
|
451
|
+
females,
|
|
452
|
+
totalPrice: baseTotalPrice,
|
|
453
|
+
optionalActivityNames: selectedOptionalActivities,
|
|
454
|
+
});
|
|
455
|
+
}, [
|
|
456
|
+
displayedTotalPrice,
|
|
457
|
+
females,
|
|
458
|
+
isPackage,
|
|
459
|
+
males,
|
|
460
|
+
onPackageSummaryChange,
|
|
461
|
+
packageTotalPeople,
|
|
462
|
+
selectedOptionalActivities,
|
|
463
|
+
selectedPricingIndex,
|
|
464
|
+
]);
|
|
465
|
+
useEffect(() => {
|
|
466
|
+
onBookingSnapshotChange === null || onBookingSnapshotChange === void 0 ? void 0 : onBookingSnapshotChange({
|
|
467
|
+
startDate: formData.startDate || null,
|
|
468
|
+
endDate: formData.endDate || null,
|
|
469
|
+
startTime: formData.startTime,
|
|
470
|
+
pickupTime: formData.pickupTime,
|
|
471
|
+
returnTime: formData.returnTime,
|
|
472
|
+
numberOfPeople: isPackage ? packageTotalPeople : Number(formData.numberOfPeople) || 1,
|
|
473
|
+
totalPrice: displayedTotalPrice,
|
|
474
|
+
termsAccepted,
|
|
475
|
+
specialRequests: formData.specialRequests,
|
|
476
|
+
selectedPricingIndex,
|
|
477
|
+
});
|
|
478
|
+
}, [
|
|
479
|
+
displayedTotalPrice,
|
|
480
|
+
formData.endDate,
|
|
481
|
+
formData.numberOfPeople,
|
|
482
|
+
formData.pickupTime,
|
|
483
|
+
formData.returnTime,
|
|
484
|
+
formData.specialRequests,
|
|
485
|
+
formData.startDate,
|
|
486
|
+
formData.startTime,
|
|
487
|
+
isPackage,
|
|
488
|
+
onBookingSnapshotChange,
|
|
489
|
+
packageTotalPeople,
|
|
490
|
+
selectedPricingIndex,
|
|
491
|
+
termsAccepted,
|
|
492
|
+
]);
|
|
493
|
+
const isFormValid = formData.startDate &&
|
|
494
|
+
(!(isRental || isStay) || formData.endDate) &&
|
|
495
|
+
(!isAdventure || !!selectedAdventureSlot) &&
|
|
496
|
+
(!(isAdventure || isEvent) || !!formData.startTime) &&
|
|
497
|
+
(!isPackage || packageTotalPeople > 0) &&
|
|
498
|
+
formData.name &&
|
|
499
|
+
formData.email &&
|
|
500
|
+
formData.phone &&
|
|
501
|
+
termsAccepted;
|
|
502
|
+
const handleChange = (e) => {
|
|
503
|
+
const { name, value } = e.target;
|
|
504
|
+
setFormData((prev) => ({ ...prev, [name]: value }));
|
|
505
|
+
};
|
|
506
|
+
const loadRazorpayScript = () => new Promise((resolve) => {
|
|
507
|
+
if (window.Razorpay)
|
|
508
|
+
return resolve(true);
|
|
509
|
+
const script = document.createElement("script");
|
|
510
|
+
script.src = "https://checkout.razorpay.com/v1/checkout.js";
|
|
511
|
+
script.onload = () => resolve(true);
|
|
512
|
+
script.onerror = () => resolve(false);
|
|
513
|
+
document.body.appendChild(script);
|
|
514
|
+
});
|
|
515
|
+
const postGuestJson = async (path, payload) => {
|
|
516
|
+
const baseUrl = process.env.NEXT_PUBLIC_API_URL;
|
|
517
|
+
const response = await fetch(`${baseUrl}${path}`, {
|
|
518
|
+
method: "POST",
|
|
519
|
+
credentials: "omit",
|
|
520
|
+
headers: {
|
|
521
|
+
"Content-Type": "application/json",
|
|
522
|
+
Accept: "application/json",
|
|
523
|
+
},
|
|
524
|
+
body: JSON.stringify(payload),
|
|
525
|
+
});
|
|
526
|
+
const data = await response.json().catch(() => ({}));
|
|
527
|
+
if (!response.ok) {
|
|
528
|
+
throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed");
|
|
529
|
+
}
|
|
530
|
+
return data;
|
|
531
|
+
};
|
|
532
|
+
const proceedWithSubmit = async () => {
|
|
533
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
534
|
+
if (isAdventure && !selectedAdventureSlot) {
|
|
535
|
+
await showAlert("Please select an available adventure slot.");
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
setLoading(true);
|
|
539
|
+
try {
|
|
540
|
+
const bookingRequest = {
|
|
541
|
+
entityId: isPackage ? (entity.slug || entity._id) : entity._id,
|
|
542
|
+
entityType: type,
|
|
543
|
+
roomId: preRoomId || undefined,
|
|
544
|
+
roomQty: preRoomQty || undefined,
|
|
545
|
+
startDate: formData.startDate.toISOString(),
|
|
546
|
+
endDate: formData.endDate ? formData.endDate.toISOString() : undefined,
|
|
547
|
+
startTime: (isAdventure || isEvent) ? formData.startTime : undefined,
|
|
548
|
+
pickupTime: isRental ? formData.pickupTime : undefined,
|
|
549
|
+
returnTime: isRental ? formData.returnTime : undefined,
|
|
550
|
+
pickupPointIndex: isRental ? prePickupPointIndex !== null && prePickupPointIndex !== void 0 ? prePickupPointIndex : undefined : undefined,
|
|
551
|
+
homeDeliverySelected: isRental ? !!preHomeDeliverySelected : undefined,
|
|
552
|
+
numberOfPeople: isPackage ? packageTotalPeople : formData.numberOfPeople,
|
|
553
|
+
totalPrice: displayedTotalPrice,
|
|
554
|
+
currency: entityCurrency,
|
|
555
|
+
contactDetails: {
|
|
556
|
+
name: formData.name,
|
|
557
|
+
email: formData.email,
|
|
558
|
+
phone: formData.phone,
|
|
559
|
+
},
|
|
560
|
+
specialRequests: formData.specialRequests,
|
|
561
|
+
selectedPricingIndex: isPackage || isAdventure || isRental ? selectedPricingIndex : undefined,
|
|
562
|
+
selectedPricingId: (selectedEntityPricing === null || selectedEntityPricing === void 0 ? void 0 : selectedEntityPricing._id) || undefined,
|
|
563
|
+
selectedActivities: isPackage
|
|
564
|
+
? [
|
|
565
|
+
...compulsoryPackageActivities.map((activity) => ({
|
|
566
|
+
activityName: activity.name,
|
|
567
|
+
name: activity.name,
|
|
568
|
+
type: activity.type,
|
|
569
|
+
additionalPrice: activity.additionalPrice || 0,
|
|
570
|
+
})),
|
|
571
|
+
...optionalPackageActivities
|
|
572
|
+
.filter((activity) => selectedOptionalActivities.includes(activity.name))
|
|
573
|
+
.map((activity) => ({
|
|
574
|
+
activityName: activity.name,
|
|
575
|
+
name: activity.name,
|
|
576
|
+
type: activity.type,
|
|
577
|
+
additionalPrice: activity.additionalPrice || 0,
|
|
578
|
+
})),
|
|
579
|
+
]
|
|
580
|
+
: undefined,
|
|
581
|
+
males: isPackage ? males : undefined,
|
|
582
|
+
females: isPackage ? females : undefined,
|
|
583
|
+
couponCode: couponCode || undefined,
|
|
584
|
+
checkoutStartedAt,
|
|
585
|
+
};
|
|
586
|
+
const result = user
|
|
587
|
+
? await createBooking(bookingRequest)
|
|
588
|
+
: await (async () => {
|
|
589
|
+
try {
|
|
590
|
+
const data = await postGuestJson("/bookings/create", bookingRequest);
|
|
591
|
+
return {
|
|
592
|
+
success: true,
|
|
593
|
+
booking: data.data.booking,
|
|
594
|
+
razorpayOrderId: data.data.razorpayOrderId,
|
|
595
|
+
razorpayKeyId: data.data.razorpayKeyId,
|
|
596
|
+
amount: data.data.amount,
|
|
597
|
+
currency: data.data.currency,
|
|
598
|
+
message: data.message,
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
catch (error) {
|
|
602
|
+
return {
|
|
603
|
+
success: false,
|
|
604
|
+
booking: null,
|
|
605
|
+
error: error.message,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
})();
|
|
609
|
+
const createdBooking = result.booking;
|
|
610
|
+
if (result.success && !result.razorpayOrderId && (createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.status) === "confirmed") {
|
|
611
|
+
sessionStorage.setItem(BOOKING_CONFIRMATION_STORAGE_KEY, JSON.stringify({
|
|
612
|
+
bookingId: createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking._id,
|
|
613
|
+
bookingCode: createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.bookingCode,
|
|
614
|
+
entityTitle: entity.title,
|
|
615
|
+
entityType: type,
|
|
616
|
+
currency: entityCurrency,
|
|
617
|
+
totalPrice: (_a = createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.totalPrice) !== null && _a !== void 0 ? _a : displayedTotalPrice,
|
|
618
|
+
pickupPointName: (createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.pickupPointName) || (selectedPickupPoint === null || selectedPickupPoint === void 0 ? void 0 : selectedPickupPoint.name),
|
|
619
|
+
pickupPointAddress: (createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.pickupPointAddress) || (selectedPickupPoint === null || selectedPickupPoint === void 0 ? void 0 : selectedPickupPoint.address),
|
|
620
|
+
homeDeliverySelected: (_b = createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.homeDeliverySelected) !== null && _b !== void 0 ? _b : !!preHomeDeliverySelected,
|
|
621
|
+
homeDeliveryCharge: (_c = createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.homeDeliveryCharge) !== null && _c !== void 0 ? _c : deliveryCharge,
|
|
622
|
+
startDate: (createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.startDate) || ((_d = formData.startDate) === null || _d === void 0 ? void 0 : _d.toISOString()),
|
|
623
|
+
endDate: (createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.endDate) || ((_e = formData.endDate) === null || _e === void 0 ? void 0 : _e.toISOString()),
|
|
624
|
+
startTime: (createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.startTime) || formData.startTime,
|
|
625
|
+
numberOfPeople: (_f = createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking.numberOfPeople) !== null && _f !== void 0 ? _f : bookingRequest.numberOfPeople,
|
|
626
|
+
contactName: formData.name,
|
|
627
|
+
contactEmail: formData.email,
|
|
628
|
+
specialRequests: formData.specialRequests,
|
|
629
|
+
createdAt: Date.now(),
|
|
630
|
+
}));
|
|
631
|
+
router.push(`/book/confirmed?bookingId=${(createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking._id) || ""}`);
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
if (!result.success || !result.razorpayOrderId) {
|
|
635
|
+
setLoading(false);
|
|
636
|
+
await showAlert(result.error || "Failed to initiate booking");
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
if (!result.razorpayKeyId) {
|
|
640
|
+
setLoading(false);
|
|
641
|
+
await showAlert("Payment gateway is not configured. Please contact support.");
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
const scriptLoaded = await loadRazorpayScript();
|
|
645
|
+
if (!scriptLoaded) {
|
|
646
|
+
setLoading(false);
|
|
647
|
+
await showAlert("Failed to load payment gateway. Please try again.");
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
const bookingId = createdBooking === null || createdBooking === void 0 ? void 0 : createdBooking._id;
|
|
651
|
+
const options = {
|
|
652
|
+
key: result.razorpayKeyId,
|
|
653
|
+
amount: ((_g = result.amount) !== null && _g !== void 0 ? _g : 0) * 100,
|
|
654
|
+
currency: result.currency || "INR",
|
|
655
|
+
name: "Trippeaze",
|
|
656
|
+
description: entity.title,
|
|
657
|
+
order_id: result.razorpayOrderId,
|
|
658
|
+
prefill: {
|
|
659
|
+
name: formData.name,
|
|
660
|
+
email: formData.email,
|
|
661
|
+
contact: formData.phone,
|
|
662
|
+
},
|
|
663
|
+
theme: { color: "#6366f1" },
|
|
664
|
+
retry: { enabled: false },
|
|
665
|
+
handler: async (response) => {
|
|
666
|
+
var _a, _b, _c, _d, _e, _f;
|
|
667
|
+
setLoading(true);
|
|
668
|
+
try {
|
|
669
|
+
const verifyPayload = {
|
|
670
|
+
bookingId,
|
|
671
|
+
razorpay_order_id: response.razorpay_order_id,
|
|
672
|
+
razorpay_payment_id: response.razorpay_payment_id,
|
|
673
|
+
razorpay_signature: response.razorpay_signature,
|
|
674
|
+
};
|
|
675
|
+
const verifyResult = user
|
|
676
|
+
? await verifyBookingPayment(verifyPayload)
|
|
677
|
+
: await (async () => {
|
|
678
|
+
try {
|
|
679
|
+
const data = await postGuestJson("/bookings/verify-payment", verifyPayload);
|
|
680
|
+
return {
|
|
681
|
+
success: true,
|
|
682
|
+
booking: data.data.booking,
|
|
683
|
+
message: data.message,
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
catch (error) {
|
|
687
|
+
return {
|
|
688
|
+
success: false,
|
|
689
|
+
booking: null,
|
|
690
|
+
error: error.message,
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
})();
|
|
694
|
+
if (verifyResult.success) {
|
|
695
|
+
const confirmedBooking = verifyResult.booking;
|
|
696
|
+
sessionStorage.setItem(BOOKING_CONFIRMATION_STORAGE_KEY, JSON.stringify({
|
|
697
|
+
bookingId: (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking._id) || bookingId,
|
|
698
|
+
bookingCode: confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.bookingCode,
|
|
699
|
+
entityTitle: entity.title,
|
|
700
|
+
entityType: type,
|
|
701
|
+
currency: entityCurrency,
|
|
702
|
+
totalPrice: (_a = confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.totalPrice) !== null && _a !== void 0 ? _a : displayedTotalPrice,
|
|
703
|
+
pickupPointName: (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.pickupPointName) || (selectedPickupPoint === null || selectedPickupPoint === void 0 ? void 0 : selectedPickupPoint.name),
|
|
704
|
+
pickupPointAddress: (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.pickupPointAddress) || (selectedPickupPoint === null || selectedPickupPoint === void 0 ? void 0 : selectedPickupPoint.address),
|
|
705
|
+
homeDeliverySelected: (_b = confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.homeDeliverySelected) !== null && _b !== void 0 ? _b : !!preHomeDeliverySelected,
|
|
706
|
+
homeDeliveryCharge: (_c = confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.homeDeliveryCharge) !== null && _c !== void 0 ? _c : deliveryCharge,
|
|
707
|
+
startDate: (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.startDate) || ((_d = formData.startDate) === null || _d === void 0 ? void 0 : _d.toISOString()),
|
|
708
|
+
endDate: (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.endDate) || ((_e = formData.endDate) === null || _e === void 0 ? void 0 : _e.toISOString()),
|
|
709
|
+
startTime: (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.startTime) || formData.startTime,
|
|
710
|
+
numberOfPeople: (_f = confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.numberOfPeople) !== null && _f !== void 0 ? _f : bookingRequest.numberOfPeople,
|
|
711
|
+
contactName: formData.name,
|
|
712
|
+
contactEmail: formData.email,
|
|
713
|
+
specialRequests: formData.specialRequests,
|
|
714
|
+
createdAt: Date.now(),
|
|
715
|
+
}));
|
|
716
|
+
await showAlert(`Booking confirmed! A confirmation email has been sent to ${formData.email}. Booking ID: ${bookingId === null || bookingId === void 0 ? void 0 : bookingId.slice(-8).toUpperCase()}`, "Payment Successful");
|
|
717
|
+
const query = new URLSearchParams();
|
|
718
|
+
if ((confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking._id) || bookingId)
|
|
719
|
+
query.set("bookingId", (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking._id) || bookingId);
|
|
720
|
+
if (confirmedBooking === null || confirmedBooking === void 0 ? void 0 : confirmedBooking.bookingCode)
|
|
721
|
+
query.set("bookingCode", confirmedBooking.bookingCode);
|
|
722
|
+
router.push(`/book/confirmed?${query.toString()}`);
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
await showAlert(verifyResult.error || "Payment verification failed. Please contact support.");
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
finally {
|
|
729
|
+
setLoading(false);
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
modal: {
|
|
733
|
+
ondismiss: () => setLoading(false),
|
|
734
|
+
},
|
|
735
|
+
};
|
|
736
|
+
const rzp = new window.Razorpay(options);
|
|
737
|
+
rzp.on("payment.failed", async (response) => {
|
|
738
|
+
var _a;
|
|
739
|
+
try {
|
|
740
|
+
rzp.close();
|
|
741
|
+
}
|
|
742
|
+
catch (_b) { }
|
|
743
|
+
setLoading(false);
|
|
744
|
+
await showAlert(`Payment failed: ${((_a = response.error) === null || _a === void 0 ? void 0 : _a.description) || "Unknown error"}`, "Payment Failed");
|
|
745
|
+
});
|
|
746
|
+
rzp.open();
|
|
747
|
+
// loading stays true until handler/ondismiss fires
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
catch (error) {
|
|
751
|
+
await showAlert(error.message || "An unexpected error occurred");
|
|
752
|
+
setLoading(false);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
const handleSubmit = (e) => {
|
|
756
|
+
var _a, _b;
|
|
757
|
+
e.preventDefault();
|
|
758
|
+
if (!user) {
|
|
759
|
+
sessionStorage.setItem(DRAFT_KEY, JSON.stringify({
|
|
760
|
+
...formData,
|
|
761
|
+
startDate: (_a = formData.startDate) === null || _a === void 0 ? void 0 : _a.toISOString(),
|
|
762
|
+
endDate: (_b = formData.endDate) === null || _b === void 0 ? void 0 : _b.toISOString(),
|
|
763
|
+
}));
|
|
764
|
+
setShowGuestDialog(true);
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
proceedWithSubmit();
|
|
768
|
+
};
|
|
769
|
+
return (_jsxs("form", { id: "booking-form", onSubmit: handleSubmit, className: "space-y-8", children: [_jsx(GuestOrLoginDialog, { open: showGuestDialog, onClose: () => setShowGuestDialog(false), onContinueAsGuest: proceedWithSubmit }), !user && (_jsxs("div", { className: "rounded-2xl border border-amber-200 bg-amber-50 px-4 py-4 text-sm text-amber-900", children: [_jsx("p", { className: "font-bold", children: "You can continue as a guest or log in." }), _jsx("p", { className: "mt-1 leading-6 text-amber-800", children: "Choose your date and time first. If you continue without logging in, we will ask for your contact details before payment." })] })), _jsxs("section", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center gap-2 pb-2 border-b border-slate-100", children: [_jsx("div", { className: "w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-bold text-sm", children: "1" }), _jsx("h3", { className: "font-bold text-slate-800", children: isRental ? "Rental Details" : isStay ? "Stay Details" : isPackage ? "Package Details" : "Activity Details" })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [isPackage && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "space-y-2", children: [_jsx(DatePicker, { label: "Trip Start Date", field: {
|
|
770
|
+
value: formData.startDate || null,
|
|
771
|
+
onChange: (date) => {
|
|
772
|
+
setFormData((prev) => ({
|
|
773
|
+
...prev,
|
|
774
|
+
startDate: date !== null && date !== void 0 ? date : undefined,
|
|
775
|
+
endDate: undefined,
|
|
776
|
+
}));
|
|
777
|
+
onDatesChange === null || onDatesChange === void 0 ? void 0 : onDatesChange(date !== null && date !== void 0 ? date : null, null);
|
|
778
|
+
},
|
|
779
|
+
}, minDate: new Date(), availableDateKeys: packageAvailableDateKeys }), _jsx("p", { className: "text-xs font-semibold text-slate-400", children: "Dates are based on package frequency and remaining group capacity." })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Pricing Plan" }), _jsxs(Select, { value: String(selectedPricingIndex), onValueChange: (val) => setSelectedPricingIndex(Number.parseInt(val, 10) || 0), children: [_jsx(SelectTrigger, { className: "w-full bg-slate-50 border-slate-200", children: _jsx(SelectValue, { placeholder: "Select pricing plan" }) }), _jsx(SelectContent, { children: packagePricing.map((plan, index) => (_jsx(SelectItem, { value: String(index), children: plan.description || `Plan ${index + 1}` }, `${plan.description || "plan"}-${index}`))) })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "packageMales", className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Male Travellers" }), _jsx(EditableNumberInput, { id: "packageMales", className: "bg-slate-50 border-slate-200 focus:bg-white transition-all", value: males, onValueChange: setMales })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "packageFemales", className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Female Travellers" }), _jsx(EditableNumberInput, { id: "packageFemales", className: "bg-slate-50 border-slate-200 focus:bg-white transition-all", value: females, onValueChange: setFemales })] }), (compulsoryPackageActivities.length > 0 || optionalPackageActivities.length > 0) && (_jsxs("div", { className: "md:col-span-2 space-y-4 rounded-2xl border border-slate-200 bg-slate-50 p-4", children: [_jsxs("div", { children: [_jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Activities" }), _jsx("p", { className: "text-sm text-slate-600 mt-1", children: "Compulsory activities are included automatically. Optional activities are charged per traveller." })] }), compulsoryPackageActivities.length > 0 && (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-semibold text-slate-800", children: "Included Activities" }), _jsx("div", { className: "flex flex-wrap gap-2", children: compulsoryPackageActivities.map((activity) => (_jsx("span", { className: "rounded-full bg-emerald-100 px-3 py-1 text-xs font-semibold text-emerald-700", children: activity.name }, activity.name))) })] })), optionalPackageActivities.length > 0 && (_jsxs("div", { className: "space-y-3", children: [_jsx("p", { className: "text-sm font-semibold text-slate-800", children: "Optional Add-ons" }), optionalPackageActivities.map((activity) => {
|
|
780
|
+
const checked = selectedOptionalActivities.includes(activity.name);
|
|
781
|
+
return (_jsxs("label", { className: `flex cursor-pointer select-none items-start gap-3 rounded-2xl border-2 p-4 transition-all duration-200 ${checked
|
|
782
|
+
? "border-emerald-300 bg-emerald-50/40"
|
|
783
|
+
: "border-slate-200 bg-white hover:border-primary/40"}`, children: [_jsxs("span", { className: "relative mt-0.5 shrink-0", children: [_jsx("input", { type: "checkbox", checked: checked, onChange: () => setSelectedOptionalActivities((prev) => checked ? prev.filter((name) => name !== activity.name) : [...prev, activity.name]), className: "sr-only peer" }), _jsx("span", { className: `flex h-5 w-5 items-center justify-center rounded-md border-2 transition-all duration-200 ${checked
|
|
784
|
+
? "border-emerald-500 bg-emerald-500"
|
|
785
|
+
: "border-slate-300 bg-white"}`, children: checked && (_jsx("svg", { className: "h-3 w-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) })) })] }), _jsxs("div", { className: "flex-1", children: [_jsx("p", { className: "font-semibold text-slate-900", children: activity.name }), _jsx("p", { className: "text-xs text-slate-500", children: toNonNegativeAmount(activity.additionalPrice) > 0
|
|
786
|
+
? `+ ${(entityCurrency || "INR").toUpperCase()} ${toNonNegativeAmount(activity.additionalPrice).toLocaleString()} per traveller`
|
|
787
|
+
: "Included" })] })] }, activity.name));
|
|
788
|
+
})] }))] }))] })), isRental && (selectedPickupPoint || preHomeDeliverySelected) && (_jsx("div", { className: "md:col-span-2 rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm text-slate-600", children: preHomeDeliverySelected
|
|
789
|
+
? `Delivery mode: Home delivery${deliveryCharge > 0 ? ` (+${deliveryCharge} ${entityCurrency})` : ""}`
|
|
790
|
+
: `Pickup point: ${(selectedPickupPoint === null || selectedPickupPoint === void 0 ? void 0 : selectedPickupPoint.address) || (selectedPickupPoint === null || selectedPickupPoint === void 0 ? void 0 : selectedPickupPoint.name) || "Selected pickup point"}` })), (isRental || isStay) && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx("div", { className: "space-y-2", children: _jsx(DatePicker, { label: isStay ? "Check-in Date" : "Pickup Date", field: {
|
|
791
|
+
value: formData.startDate || null,
|
|
792
|
+
onChange: (date) => {
|
|
793
|
+
var _a;
|
|
794
|
+
setFormData((prev) => ({ ...prev, startDate: date !== null && date !== void 0 ? date : undefined }));
|
|
795
|
+
onDatesChange === null || onDatesChange === void 0 ? void 0 : onDatesChange(date !== null && date !== void 0 ? date : null, (_a = formData.endDate) !== null && _a !== void 0 ? _a : null);
|
|
796
|
+
},
|
|
797
|
+
}, minDate: new Date() }) }), isRental && (_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Pickup Time" }), _jsxs(Select, { value: formData.pickupTime, onValueChange: (val) => setFormData((prev) => ({ ...prev, pickupTime: val })), children: [_jsx(SelectTrigger, { className: "w-full bg-slate-50 border-slate-200", children: _jsx(SelectValue, { placeholder: "Time" }) }), _jsx(SelectContent, { children: TIME_SLOTS.map((t) => (_jsx(SelectItem, { value: t, children: t }, t))) })] })] }))] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx("div", { className: "space-y-2", children: _jsx(DatePicker, { label: isStay ? "Check-out Date" : "Drop Date", field: {
|
|
798
|
+
value: formData.endDate || null,
|
|
799
|
+
onChange: (date) => {
|
|
800
|
+
var _a;
|
|
801
|
+
setFormData((prev) => ({ ...prev, endDate: date !== null && date !== void 0 ? date : undefined }));
|
|
802
|
+
onDatesChange === null || onDatesChange === void 0 ? void 0 : onDatesChange((_a = formData.startDate) !== null && _a !== void 0 ? _a : null, date !== null && date !== void 0 ? date : null);
|
|
803
|
+
},
|
|
804
|
+
}, minDate: formData.startDate || new Date() }) }), isRental && (_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Drop Time" }), _jsxs(Select, { value: formData.returnTime, onValueChange: (val) => setFormData((prev) => ({ ...prev, returnTime: val })), children: [_jsx(SelectTrigger, { className: "w-full bg-slate-50 border-slate-200", children: _jsx(SelectValue, { placeholder: "Time" }) }), _jsx(SelectContent, { children: TIME_SLOTS.map((t) => (_jsx(SelectItem, { value: t, children: t }, t))) })] })] }))] })] })), !(isRental || isStay || isPackage) && (_jsxs(_Fragment, { children: [isAdventure && packagePricing.length > 1 && (_jsxs("div", { className: "md:col-span-2 space-y-2", children: [_jsx(Label, { className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Pricing Option" }), _jsxs(Select, { value: String(selectedPricingIndex), onValueChange: (val) => setSelectedPricingIndex(parseInt(val, 10) || 0), children: [_jsx(SelectTrigger, { className: "w-full bg-slate-50 border-slate-200", children: _jsx(SelectValue, { placeholder: "Select pricing option" }) }), _jsx(SelectContent, { children: packagePricing.map((plan, index) => (_jsx(SelectItem, { value: String(index), children: plan.description || `Pricing ${index + 1}` }, `${plan.description || "plan"}-${index}`))) })] })] })), _jsx("div", { className: "space-y-2", children: isEvent ? (_jsxs(_Fragment, { children: [_jsx(Label, { className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Event Date" }), _jsx(Input, { value: formData.startDate ? formData.startDate.toLocaleDateString("en-IN", { day: "numeric", month: "short", year: "numeric" }) : "", disabled: true, className: "bg-slate-50 border-slate-200" })] })) : (_jsxs("div", { className: "space-y-2", children: [_jsx(DatePicker, { label: "Activity Date", field: {
|
|
805
|
+
value: formData.startDate || null,
|
|
806
|
+
onChange: (date) => {
|
|
807
|
+
const nextDate = date || undefined;
|
|
808
|
+
const nextDateKey = nextDate ? formatDateKey(nextDate) : "";
|
|
809
|
+
const nextDaySlots = configuredAdventureSlots.filter((slot) => slot.dateKey === nextDateKey &&
|
|
810
|
+
slot.isBookable &&
|
|
811
|
+
!blockedAdventureDateKeys.has(slot.dateKey));
|
|
812
|
+
setFormData((prev) => {
|
|
813
|
+
var _a, _b;
|
|
814
|
+
return ({
|
|
815
|
+
...prev,
|
|
816
|
+
startDate: nextDate,
|
|
817
|
+
startTime: isAdventure && configuredAdventureSlots.length
|
|
818
|
+
? ((_a = nextDaySlots.find((slot) => slot.startTime === prev.startTime)) === null || _a === void 0 ? void 0 : _a.startTime) ||
|
|
819
|
+
((_b = nextDaySlots[0]) === null || _b === void 0 ? void 0 : _b.startTime) ||
|
|
820
|
+
""
|
|
821
|
+
: prev.startTime || opStart,
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
onDatesChange === null || onDatesChange === void 0 ? void 0 : onDatesChange(date !== null && date !== void 0 ? date : null, null);
|
|
825
|
+
},
|
|
826
|
+
}, minDate: new Date(), availableDateKeys: isAdventure ? availableAdventureDateKeys : undefined }), isAdventure && (_jsx("div", { className: "rounded-2xl border border-slate-200 bg-slate-50 px-4 py-3 text-sm leading-6 text-slate-600", children: availableAdventureDateKeys.length <= 0
|
|
827
|
+
? "No upcoming bookable slots are configured for this adventure yet."
|
|
828
|
+
: selectedAdventureDateKey && bookableAdventureSlots.length > 0
|
|
829
|
+
? `${bookableAdventureSlots.length} slot${bookableAdventureSlots.length > 1 ? "s are" : " is"} open for ${(_k = formData.startDate) === null || _k === void 0 ? void 0 : _k.toLocaleDateString("en-IN", { day: "numeric", month: "short", year: "numeric" })}.`
|
|
830
|
+
: "Choose an available date to see open time slots." }))] })) }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: isEvent ? "Event Time" : "Preferred Time" }), isEvent ? (_jsx(Input, { value: formData.startTime, disabled: true, className: "bg-slate-50 border-slate-200" })) : (_jsxs(Select, { value: formData.startTime, onValueChange: (val) => setFormData((prev) => ({ ...prev, startTime: val })), disabled: isAdventure && !bookableAdventureSlots.length, children: [_jsx(SelectTrigger, { className: "w-full bg-slate-50 border-slate-200", children: _jsx(SelectValue, { placeholder: "Time" }) }), _jsx(SelectContent, { children: (isAdventure ? bookableAdventureSlots : TIME_SLOTS).map((slotOrTime) => {
|
|
831
|
+
const value = isAdventure ? slotOrTime.startTime : slotOrTime;
|
|
832
|
+
const label = isAdventure
|
|
833
|
+
? `${slotOrTime.startTime}${slotOrTime.endTime ? ` - ${slotOrTime.endTime}` : ""}`
|
|
834
|
+
: slotOrTime;
|
|
835
|
+
return (_jsx(SelectItem, { value: value, children: label }, value));
|
|
836
|
+
}) })] })), isAdventure && selectedAdventureSlot && (_jsxs("div", { className: "rounded-2xl border border-primary/10 bg-primary/5 px-4 py-3 text-xs leading-5 text-slate-700", children: [selectedAdventureSlot.remainingCapacity, " of", " ", selectedAdventureSlot.maxParticipants, " spots left for this slot", selectedAdventureSlot.endTime
|
|
837
|
+
? ` until ${selectedAdventureSlot.endTime}`
|
|
838
|
+
: "", "."] }))] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "numberOfPeople", className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Persons" }), _jsx(EditableNumberInput, { id: "numberOfPeople", name: "numberOfPeople", required: true, className: "bg-slate-50 border-slate-200 focus:bg-white transition-all", min: 1, value: Number(formData.numberOfPeople) || 1, onValueChange: (value) => setFormData((prev) => ({ ...prev, numberOfPeople: value })) })] })] })] }))] })] }), baseTotalPrice > 0 && (_jsx("section", { className: "rounded-2xl border border-emerald-200 bg-emerald-50/50 p-4", children: _jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm font-semibold text-slate-900", children: "Offers and coupons" }), _jsx("p", { className: "mt-1 text-sm text-slate-600", children: (discountQuote === null || discountQuote === void 0 ? void 0 : discountQuote.totalDiscount)
|
|
839
|
+
? `${entityCurrency} ${discountQuote.totalDiscount.toLocaleString("en-IN")} saved · total ${entityCurrency} ${displayedTotalPrice.toLocaleString("en-IN")}`
|
|
840
|
+
: "Check automatic, payment, partner, and reward offers." })] }), _jsx(OffersAndCouponsSheet, { quoteInput: quoteInput, value: couponCode, onValueChange: setCouponCode, onQuoteChange: setDiscountQuote, disabled: !formData.startDate || ((isRental || isStay) && !formData.endDate) || (isStay && !preRoomId) || (isPackage && packageTotalPeople <= 0) })] }) })), _jsxs("section", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center gap-2 pb-2 border-b border-slate-100", children: [_jsx("div", { className: "w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-bold text-sm", children: "2" }), _jsx("h3", { className: "font-bold text-slate-800", children: "Your Information" })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "name", className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Full Name" }), _jsx(Input, { id: "name", name: "name", placeholder: "John Doe", required: true, className: "bg-slate-50 border-slate-200 focus:bg-white transition-all", value: formData.name, onChange: handleChange })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "email", className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Email Address" }), _jsx(Input, { id: "email", name: "email", type: "email", placeholder: "john@example.com", required: true, className: "bg-slate-50 border-slate-200 focus:bg-white transition-all", value: formData.email, onChange: handleChange })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "phone", className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Phone Number" }), _jsx(Input, { id: "phone", name: "phone", placeholder: "+91 9876543210", required: true, className: "bg-slate-50 border-slate-200 focus:bg-white transition-all", value: formData.phone, onChange: handleChange })] })] })] }), _jsxs("section", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center gap-2 pb-2 border-b border-slate-100", children: [_jsx("div", { className: "w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-bold text-sm", children: "3" }), _jsx("h3", { className: "font-bold text-slate-800", children: "Additional Requests" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "specialRequests", className: "text-xs font-semibold uppercase tracking-wider text-slate-500", children: "Special Instructions (Optional)" }), _jsx(Textarea, { id: "specialRequests", name: "specialRequests", placeholder: "Any specific requirements or questions?", className: "bg-slate-50 border-slate-200 focus:bg-white transition-all min-h-[100px]", value: formData.specialRequests, onChange: handleChange })] })] }), _jsxs("section", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center gap-2 pb-2 border-b border-slate-100", children: [_jsx("div", { className: "w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-bold text-sm", children: "4" }), _jsx("h3", { className: "font-bold text-slate-800", children: "Terms & Conditions" })] }), _jsxs("div", { className: `relative rounded-2xl border-2 p-5 transition-all duration-200 ${termsAccepted
|
|
841
|
+
? "border-emerald-300 bg-emerald-50/40"
|
|
842
|
+
: "border-slate-200 bg-slate-50/50"}`, children: [_jsxs("div", { className: "mb-4 text-xs text-slate-500 leading-relaxed space-y-2 max-h-28 overflow-y-auto pr-1 scrollbar-thin", children: [_jsxs("p", { className: "font-semibold text-slate-700 text-sm flex items-center gap-2", children: [_jsx(FileText, { className: "w-4 h-4 text-primary shrink-0" }), "Booking Terms Summary"] }), _jsxs("p", { children: ["\u2022 ", isAdventure || isEvent
|
|
843
|
+
? "Your reservation is confirmed after successful payment if the selected slot is still available."
|
|
844
|
+
: "Your booking confirmation depends on the selected listing and payment completion."] }), _jsxs("p", { children: ["\u2022 Cancellations made 48 hours before the start date may be eligible for a partial refund per our ", _jsx("a", { href: "/terms#cancellation", target: "_blank", className: "text-primary underline", children: "Cancellation Policy" }), "."] }), isRental && (_jsxs(_Fragment, { children: [_jsx("p", { children: "\u2022 A valid driving license must be shown during vehicle pickup." }), _jsx("p", { children: "\u2022 Record a short video of the vehicle condition during pickup before starting the ride." })] })), _jsx("p", { children: "\u2022 By confirming, you agree that the information provided is accurate and truthful." }), _jsx("p", { children: "\u2022 Trippeaze acts as a platform; the host is responsible for delivering the booked experience." }), _jsx("p", { children: "\u2022 In case of any dispute, Trippeaze's decision shall be final and binding." })] }), _jsxs("label", { htmlFor: "terms-checkbox", className: "flex items-start gap-3 cursor-pointer group select-none", children: [_jsxs("div", { className: "relative mt-0.5 shrink-0", children: [_jsx("input", { id: "terms-checkbox", type: "checkbox", checked: termsAccepted, onChange: (e) => setTermsAccepted(e.target.checked), className: "sr-only peer" }), _jsx("div", { className: `w-5 h-5 rounded-md border-2 flex items-center justify-center transition-all duration-200 ${termsAccepted
|
|
845
|
+
? "bg-emerald-500 border-emerald-500"
|
|
846
|
+
: "border-slate-300 bg-white group-hover:border-primary"}`, children: termsAccepted && (_jsx("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) })) })] }), _jsxs("span", { className: "text-sm text-slate-700 leading-snug", children: ["I have read and agree to the", " ", _jsxs("a", { href: "/terms", target: "_blank", rel: "noopener noreferrer", className: "text-primary font-semibold hover:underline inline-flex items-center gap-0.5", onClick: (e) => e.stopPropagation(), children: ["Terms & Conditions", _jsx(ExternalLink, { className: "w-3 h-3" })] }), " ", "and", " ", _jsxs("a", { href: "/privacy", target: "_blank", rel: "noopener noreferrer", className: "text-primary font-semibold hover:underline inline-flex items-center gap-0.5", onClick: (e) => e.stopPropagation(), children: ["Privacy Policy", _jsx(ExternalLink, { className: "w-3 h-3" })] }), ". I understand the cancellation and refund terms."] })] }), !termsAccepted && (_jsxs("p", { className: "mt-3 text-[11px] text-amber-600 font-semibold flex items-center gap-1.5", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-amber-500 shrink-0" }), "You must accept the terms before proceeding to payment."] }))] })] })] }));
|
|
847
|
+
}
|