@123usmanhaider321/ui 0.1.8 → 1.0.2
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/README.md +416 -31
- package/dist/images/icon/1LINK.svg +50 -0
- package/dist/images/icon/CreditCard.svg +83 -0
- package/dist/images/icon/Easypaisa.png +0 -0
- package/dist/images/icon/MobileWallet.png +0 -0
- package/dist/images/icon/Raast-Logo.png +0 -0
- package/dist/images/icon/VISA.png +0 -0
- package/dist/images/icon/add-circle-1.svg +5 -0
- package/dist/images/icon/check-circle-broken.svg +3 -0
- package/dist/images/icon/close-circle.svg +5 -0
- package/dist/images/icon/jazzcash.png +0 -0
- package/dist/images/icon/loading_icon.json +3347 -0
- package/dist/images/icon/mastercard-logo.webp +0 -0
- package/dist/images/icon/paymo.jpeg +0 -0
- package/dist/images/icon/preview-svgrepo-com.svg +36 -0
- package/dist/images/icon/trash.svg +7 -0
- package/dist/images/icon/unionpay-logo.svg +9 -0
- package/dist/index-BLoegwT6.js +60476 -0
- package/dist/index-BLoegwT6.js.map +1 -0
- package/dist/index-CPnu5V8f.js +11119 -0
- package/dist/index-CPnu5V8f.js.map +1 -0
- package/dist/index.d.ts +1 -10
- package/dist/index.es-C5pDhGOr.js +16734 -0
- package/dist/index.es-C5pDhGOr.js.map +1 -0
- package/dist/index.js +40 -12
- package/dist/index.js.map +1 -1
- package/dist/loading_icon-n5H5dQBl.js +3375 -0
- package/dist/loading_icon-n5H5dQBl.js.map +1 -0
- package/dist/src/components/Alert/ErrorAlert.d.ts +6 -0
- package/dist/src/components/Alert/SuccessAlert.d.ts +6 -0
- package/dist/{components → src/components}/FormBuilder/DiscountInput.d.ts +3 -6
- package/dist/{components → src/components}/FormBuilder/FormBuilder.d.ts +2 -11
- package/dist/{components → src/components}/FormBuilder/QuestionCard.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/QuestionEditor.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/SortableQuestionList.d.ts +0 -5
- package/dist/src/components/FormBuilder/questionIcons.d.ts +5 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventLayout.d.ts +2 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventStepper.d.ts +2 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/ConfirmationModal.d.ts +1 -1
- package/dist/src/components/NewAddEvent/components/EventSubmissionConfirmationModal.d.ts +14 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/TicketTierSection.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTierForm.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useStepperForm.d.ts +22 -22
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useTicketTierForm.d.ts +63 -15
- package/dist/src/components/NewAddEvent/schemas/step1.d.ts +211 -0
- package/dist/src/components/NewAddEvent/schemas/step2.d.ts +411 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/schemas/utils.d.ts +8 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/IndividualFormStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/SocialProfilesStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/TeamFormStep.d.ts +1 -1
- package/dist/src/components/Spinner/spinner.d.ts +4 -0
- package/dist/src/components/TicketlyUIProvider.d.ts +35 -0
- package/dist/src/components/common/Loader/index.d.ts +8 -0
- package/dist/src/components/common/Modals/ConfirmationModal.d.ts +7 -0
- package/dist/{components/FormInput → src/components/ui}/FormInput.d.ts +1 -1
- package/dist/src/components/ui/Loader.d.ts +4 -0
- package/dist/{components/Button/Button.d.ts → src/components/ui/button.d.ts} +1 -1
- package/dist/src/index.d.ts +10 -0
- package/dist/{lib → src/lib}/actions.d.ts +0 -126
- package/dist/src/lib/dom-utils.d.ts +2 -0
- package/dist/src/lib/storage-utils.d.ts +5 -0
- package/dist/src/lib/types.d.ts +258 -0
- package/dist/src/redux/baseQuery.d.ts +16 -0
- package/dist/{services → src/redux/features}/eventApi.d.ts +1053 -1745
- package/dist/src/redux/features/globalSlice.d.ts +17 -0
- package/dist/{services → src/redux/features/single-event}/single-event-api.d.ts +856 -1190
- package/dist/src/redux/types.d.ts +2 -0
- package/dist/src/services/library-services.d.ts +15 -0
- package/dist/src/services/remote-config.d.ts +27 -0
- package/dist/{services → src/services}/utils.d.ts +1 -1
- package/dist/src/theme/colors.d.ts +127 -0
- package/dist/src/theme/typography.d.ts +13 -0
- package/dist/src/types/api.d.ts +18 -0
- package/dist/style.css +2984 -0
- package/dist/styles.css +3760 -4014
- package/package.json +78 -68
- package/dist/_virtual/_commonjsHelpers.js +0 -9
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/customParseFormat.js +0 -5
- package/dist/_virtual/customParseFormat.js.map +0 -1
- package/dist/_virtual/dayjs.min.js +0 -5
- package/dist/_virtual/dayjs.min.js.map +0 -1
- package/dist/_virtual/duration.js +0 -5
- package/dist/_virtual/duration.js.map +0 -1
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/isBetween.js +0 -5
- package/dist/_virtual/isBetween.js.map +0 -1
- package/dist/_virtual/relativeTime.js +0 -5
- package/dist/_virtual/relativeTime.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/_virtual/with-selector.development.js +0 -5
- package/dist/_virtual/with-selector.development.js.map +0 -1
- package/dist/_virtual/with-selector.js +0 -5
- package/dist/_virtual/with-selector.js.map +0 -1
- package/dist/_virtual/with-selector.production.js +0 -5
- package/dist/_virtual/with-selector.production.js.map +0 -1
- package/dist/components/Alert/Alert.js +0 -51
- package/dist/components/Alert/Alert.js.map +0 -1
- package/dist/components/Button/Button.js +0 -52
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.js +0 -50
- package/dist/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -25
- package/dist/components/CheckboxGroup/CheckboxGroup.js +0 -99
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +0 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -15
- package/dist/components/ConfirmationModal/ConfirmationModal.js +0 -136
- package/dist/components/ConfirmationModal/ConfirmationModal.js.map +0 -1
- package/dist/components/ConfirmationModal/index.d.ts +0 -2
- package/dist/components/CustomSelect/CustomSelect.js +0 -259
- package/dist/components/CustomSelect/CustomSelect.js.map +0 -1
- package/dist/components/EventAddForm/AddEventLayout.js +0 -227
- package/dist/components/EventAddForm/AddEventLayout.js.map +0 -1
- package/dist/components/EventAddForm/AddEventStepper.js +0 -719
- package/dist/components/EventAddForm/AddEventStepper.js.map +0 -1
- package/dist/components/EventAddForm/common/ConfirmationModal.js +0 -136
- package/dist/components/EventAddForm/common/ConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/common/DescriptionModal.js +0 -70
- package/dist/components/EventAddForm/common/DescriptionModal.js.map +0 -1
- package/dist/components/EventAddForm/components/AnimatedBackground.d.ts +0 -8
- package/dist/components/EventAddForm/components/ApprovalConfirmationModal.d.ts +0 -7
- package/dist/components/EventAddForm/components/CheckboxGroup.js +0 -92
- package/dist/components/EventAddForm/components/CheckboxGroup.js.map +0 -1
- package/dist/components/EventAddForm/components/CustomMeetingForm.js +0 -237
- package/dist/components/EventAddForm/components/CustomMeetingForm.js.map +0 -1
- package/dist/components/EventAddForm/components/DateTimeField.js +0 -173
- package/dist/components/EventAddForm/components/DateTimeField.js.map +0 -1
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.d.ts +0 -33
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js +0 -366
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/components/FileUpload.js +0 -412
- package/dist/components/EventAddForm/components/FileUpload.js.map +0 -1
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js +0 -197
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js.map +0 -1
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js +0 -1179
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js.map +0 -1
- package/dist/components/EventAddForm/components/InputField.d.ts +0 -15
- package/dist/components/EventAddForm/components/RadioGroupButton.d.ts +0 -14
- package/dist/components/EventAddForm/components/SelectField.d.ts +0 -19
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js +0 -102
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js +0 -277
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js +0 -148
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTierForm.js +0 -418
- package/dist/components/EventAddForm/components/TicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTypeSelection.js +0 -93
- package/dist/components/EventAddForm/components/TicketTypeSelection.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useStepperForm.js +0 -371
- package/dist/components/EventAddForm/hooks/useStepperForm.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js +0 -237
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/index.d.ts +0 -3
- package/dist/components/EventAddForm/index.js +0 -41
- package/dist/components/EventAddForm/index.js.map +0 -1
- package/dist/components/EventAddForm/schemas/index.d.ts +0 -2
- package/dist/components/EventAddForm/schemas/step1.d.ts +0 -47
- package/dist/components/EventAddForm/schemas/step1.js +0 -135
- package/dist/components/EventAddForm/schemas/step1.js.map +0 -1
- package/dist/components/EventAddForm/schemas/step2.d.ts +0 -138
- package/dist/components/EventAddForm/schemas/step2.js +0 -94
- package/dist/components/EventAddForm/schemas/step2.js.map +0 -1
- package/dist/components/EventAddForm/schemas/utils.js +0 -28
- package/dist/components/EventAddForm/schemas/utils.js.map +0 -1
- package/dist/components/EventAddForm/steps/IndividualFormStep.js +0 -85
- package/dist/components/EventAddForm/steps/IndividualFormStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js +0 -123
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepOne.js +0 -462
- package/dist/components/EventAddForm/steps/StepOne.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepTwo.js +0 -173
- package/dist/components/EventAddForm/steps/StepTwo.js.map +0 -1
- package/dist/components/EventAddForm/steps/TeamFormStep.js +0 -13
- package/dist/components/EventAddForm/steps/TeamFormStep.js.map +0 -1
- package/dist/components/FormBuilder/CategoryList.js +0 -242
- package/dist/components/FormBuilder/CategoryList.js.map +0 -1
- package/dist/components/FormBuilder/DiscountInput.js +0 -366
- package/dist/components/FormBuilder/DiscountInput.js.map +0 -1
- package/dist/components/FormBuilder/FormBuilder.js +0 -918
- package/dist/components/FormBuilder/FormBuilder.js.map +0 -1
- package/dist/components/FormBuilder/OptionList.js +0 -120
- package/dist/components/FormBuilder/OptionList.js.map +0 -1
- package/dist/components/FormBuilder/PaymentPreview.d.ts +0 -12
- package/dist/components/FormBuilder/PaymentPreview.js +0 -70
- package/dist/components/FormBuilder/PaymentPreview.js.map +0 -1
- package/dist/components/FormBuilder/PreviewInput.d.ts +0 -10
- package/dist/components/FormBuilder/PreviewInput.js +0 -143
- package/dist/components/FormBuilder/PreviewInput.js.map +0 -1
- package/dist/components/FormBuilder/QuestionCard.js +0 -252
- package/dist/components/FormBuilder/QuestionCard.js.map +0 -1
- package/dist/components/FormBuilder/QuestionEditor.js +0 -166
- package/dist/components/FormBuilder/QuestionEditor.js.map +0 -1
- package/dist/components/FormBuilder/RequiredToggle.js +0 -43
- package/dist/components/FormBuilder/RequiredToggle.js.map +0 -1
- package/dist/components/FormBuilder/SortableQuestionList.js +0 -137
- package/dist/components/FormBuilder/SortableQuestionList.js.map +0 -1
- package/dist/components/FormBuilder/index.d.ts +0 -4
- package/dist/components/FormBuilder/utils.js +0 -229
- package/dist/components/FormBuilder/utils.js.map +0 -1
- package/dist/components/FormInput/FormInput.js +0 -126
- package/dist/components/FormInput/FormInput.js.map +0 -1
- package/dist/components/FormInput/FormInput.test.d.ts +0 -1
- package/dist/components/FormInput/index.d.ts +0 -2
- package/dist/components/ImageCropModal/index.js +0 -464
- package/dist/components/ImageCropModal/index.js.map +0 -1
- package/dist/components/InformationPopover/InformationPopover.d.ts +0 -7
- package/dist/components/InformationPopover/InformationPopover.js +0 -19
- package/dist/components/InformationPopover/InformationPopover.js.map +0 -1
- package/dist/components/InformationPopover.js +0 -19
- package/dist/components/InformationPopover.js.map +0 -1
- package/dist/components/InputErrorMessage/InputErrorMessage.js +0 -21
- package/dist/components/InputErrorMessage/InputErrorMessage.js.map +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -15
- package/dist/components/Modal/Modal.js +0 -73
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Radio/Radio.js +0 -35
- package/dist/components/Radio/Radio.js.map +0 -1
- package/dist/components/Spinner/spinner.d.ts +0 -2
- package/dist/components/Spinner/spinner.js +0 -22
- package/dist/components/Spinner/spinner.js.map +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -16
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.js +0 -134
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/common/FallbackImage.js +0 -47
- package/dist/components/common/FallbackImage.js.map +0 -1
- package/dist/components/ui/Calendar/calendar-utils.js +0 -51
- package/dist/components/ui/Calendar/calendar-utils.js.map +0 -1
- package/dist/components/ui/Calendar/index.js +0 -142
- package/dist/components/ui/Calendar/index.js.map +0 -1
- package/dist/components/ui/Checkbox.d.ts +0 -9
- package/dist/components/ui/Checkbox.js +0 -50
- package/dist/components/ui/Checkbox.js.map +0 -1
- package/dist/components/ui/DatePicker/index.js +0 -188
- package/dist/components/ui/DatePicker/index.js.map +0 -1
- package/dist/components/ui/FormInput.js +0 -129
- package/dist/components/ui/FormInput.js.map +0 -1
- package/dist/components/ui/InputErrorMessage.d.ts +0 -7
- package/dist/components/ui/InputErrorMessage.js +0 -21
- package/dist/components/ui/InputErrorMessage.js.map +0 -1
- package/dist/components/ui/Modal/index.js +0 -73
- package/dist/components/ui/Modal/index.js.map +0 -1
- package/dist/components/ui/Radio.d.ts +0 -6
- package/dist/components/ui/Radio.js +0 -35
- package/dist/components/ui/Radio.js.map +0 -1
- package/dist/components/ui/RichTextEditor.js +0 -242
- package/dist/components/ui/RichTextEditor.js.map +0 -1
- package/dist/components/ui/TimePicker/index.js +0 -215
- package/dist/components/ui/TimePicker/index.js.map +0 -1
- package/dist/components/ui/TimeSelector/index.js +0 -138
- package/dist/components/ui/TimeSelector/index.js.map +0 -1
- package/dist/components/ui/Tooltip.d.ts +0 -12
- package/dist/components/ui/Tooltip.js +0 -136
- package/dist/components/ui/Tooltip.js.map +0 -1
- package/dist/hooks/useDropdownPosition.d.ts +0 -11
- package/dist/hooks/useFirebaseAuthState.d.ts +0 -6
- package/dist/hooks/useFirebaseAuthState.js +0 -23
- package/dist/hooks/useFirebaseAuthState.js.map +0 -1
- package/dist/hooks/useTicketTierForm.d.ts +0 -61
- package/dist/lib/actions.js +0 -32
- package/dist/lib/actions.js.map +0 -1
- package/dist/lib/cropImage.js +0 -113
- package/dist/lib/cropImage.js.map +0 -1
- package/dist/lib/imageAnalysis.js +0 -58
- package/dist/lib/imageAnalysis.js.map +0 -1
- package/dist/lib/utils.js +0 -9
- package/dist/lib/utils.js.map +0 -1
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -60
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +0 -3458
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -593
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -302
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +0 -1
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js +0 -768
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js +0 -340
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js +0 -123
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/storage/dist/index.esm.js +0 -2623
- package/dist/node_modules/@firebase/storage/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/index.esm.js +0 -658
- package/dist/node_modules/@firebase/util/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/postinstall.js +0 -5
- package/dist/node_modules/@firebase/util/dist/postinstall.js.map +0 -1
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +0 -3179
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +0 -60
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +0 -400
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js +0 -33
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/index.js +0 -5446
- package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -21
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -78
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -100
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -317
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -66
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -86
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -80
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -98
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -423
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -1039
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -61
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -7
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -79
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -76
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -376
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +0 -650
- package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -97
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
- package/dist/node_modules/dayjs/dayjs.min.js +0 -283
- package/dist/node_modules/dayjs/dayjs.min.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/customParseFormat.js +0 -130
- package/dist/node_modules/dayjs/plugin/customParseFormat.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/duration.js +0 -137
- package/dist/node_modules/dayjs/plugin/duration.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/isBetween.js +0 -20
- package/dist/node_modules/dayjs/plugin/isBetween.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/relativeTime.js +0 -49
- package/dist/node_modules/dayjs/plugin/relativeTime.js.map +0 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +0 -442
- package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
- package/dist/node_modules/idb/build/index.js +0 -70
- package/dist/node_modules/idb/build/index.js.map +0 -1
- package/dist/node_modules/idb/build/wrap-idb-value.js +0 -149
- package/dist/node_modules/idb/build/wrap-idb-value.js.map +0 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +0 -1159
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
- package/dist/node_modules/orderedmap/dist/index.js +0 -120
- package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +0 -527
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -137
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -221
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +0 -357
- package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -84
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +0 -3209
- package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -131
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +0 -936
- package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1881
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +0 -5232
- package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
- package/dist/node_modules/rope-sequence/dist/index.js +0 -184
- package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -82
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -63
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -106
- package/dist/node_modules/w3c-keyname/index.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/coerce.js +0 -10
- package/dist/node_modules/zod/v4/classic/coerce.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/compat.js +0 -8
- package/dist/node_modules/zod/v4/classic/compat.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -45
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.js +0 -44
- package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -30
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -711
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -588
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -411
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -75
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -73
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -359
- package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -96
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -84
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1391
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -363
- package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -431
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/redux/baseQuery.d.ts +0 -1
- package/dist/redux/baseQuery.js +0 -24
- package/dist/redux/baseQuery.js.map +0 -1
- package/dist/services/eventApi.js +0 -411
- package/dist/services/eventApi.js.map +0 -1
- package/dist/services/helpers.js +0 -115
- package/dist/services/helpers.js.map +0 -1
- package/dist/services/initialize-firebase.d.ts +0 -2
- package/dist/services/initialize-firebase.js +0 -20
- package/dist/services/initialize-firebase.js.map +0 -1
- package/dist/services/process-image-on-server.js +0 -30
- package/dist/services/process-image-on-server.js.map +0 -1
- package/dist/services/remote-config.d.ts +0 -5
- package/dist/services/remote-config.js +0 -9
- package/dist/services/remote-config.js.map +0 -1
- package/dist/services/single-event-api.js +0 -301
- package/dist/services/single-event-api.js.map +0 -1
- package/dist/services/utils.js +0 -107
- package/dist/services/utils.js.map +0 -1
- package/dist/setupTests.d.ts +0 -1
- package/dist/stories/Alert.stories.d.ts +0 -10
- package/dist/stories/Button.stories.d.ts +0 -13
- package/dist/types/redux-types.d.ts +0 -15
- package/dist/types/types.d.ts +0 -60
- package/dist/types/types.js +0 -10
- package/dist/types/types.js.map +0 -1
- package/dist/utils/cn.d.ts +0 -6
- package/dist/utils/cn.js +0 -9
- package/dist/utils/cn.js.map +0 -1
- package/dist/utils/date-range.d.ts +0 -4
- package/dist/utils/date-range.js +0 -13
- package/dist/utils/date-range.js.map +0 -1
- package/dist/utils/single-event-helpers.d.ts +0 -50
- package/dist/utils/single-event-helpers.js +0 -18
- package/dist/utils/single-event-helpers.js.map +0 -1
- package/dist/utils/social-validation.js +0 -42
- package/dist/utils/social-validation.js.map +0 -1
- package/dist/utils/utils.js +0 -20
- package/dist/utils/utils.js.map +0 -1
- /package/dist/{components/Alert/Alert.d.ts → src/components/Alert/index.d.ts} +0 -0
- /package/dist/{components → src/components}/FormBuilder/CategoryList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/OptionList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/RequiredToggle.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/types.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/utils.d.ts +0 -0
- /package/dist/{components → src/components}/ImageCropModal/index.d.ts +0 -0
- /package/dist/{components → src/components}/InformationPopover.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/DescriptionModal.d.ts +0 -0
- /package/dist/{components/ui/FormInput.d.ts → src/components/NewAddEvent/components/AddEventFormInput.d.ts} +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CheckboxGroup.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CustomMeetingForm.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/DateTimeField.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FileUpload.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FormBuilderProceedModal.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/GoogleMapsAutocompleteInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/SingleDateTimeInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/CustomFormSection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTypeSelection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepOne.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepTwo.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/types.d.ts +0 -0
- /package/dist/{components → src/components}/common/FallbackImage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/calendar-utils.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/index.d.ts +0 -0
- /package/dist/{components/Checkbox → src/components/ui}/Checkbox.d.ts +0 -0
- /package/dist/{components/CustomSelect → src/components/ui}/CustomSelect.d.ts +0 -0
- /package/dist/{components → src/components}/ui/DatePicker/index.d.ts +0 -0
- /package/dist/{components/InputErrorMessage → src/components/ui}/InputErrorMessage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Modal/index.d.ts +0 -0
- /package/dist/{components/Radio → src/components/ui}/Radio.d.ts +0 -0
- /package/dist/{components → src/components}/ui/RichTextEditor.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimePicker/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimeSelector/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Tooltip/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/constants.d.ts +0 -0
- /package/dist/{lib → src/lib}/cropImage.d.ts +0 -0
- /package/dist/{lib → src/lib}/imageAnalysis.d.ts +0 -0
- /package/dist/{utils → src/lib}/social-validation.d.ts +0 -0
- /package/dist/{lib/utils.d.ts → src/lib/tailwind-merge.d.ts} +0 -0
- /package/dist/{utils → src/lib}/utils.d.ts +0 -0
- /package/dist/{services → src/redux/features/single-event}/helpers.d.ts +0 -0
- /package/dist/{services → src/services}/process-image-on-server.d.ts +0 -0
- /package/dist/{types → src/types}/events.d.ts +0 -0
- /package/dist/{types → src/types}/question.d.ts +0 -0
|
@@ -1,1179 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useLayoutEffect, useEffect, useCallback } from "react";
|
|
3
|
-
import { Combobox, ComboboxInput, ComboboxOptions } from "@headlessui/react";
|
|
4
|
-
import clsx from "clsx";
|
|
5
|
-
import { FaCircleNotch, FaGoogle } from "react-icons/fa";
|
|
6
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
7
|
-
import { BASE_URL } from "../../../services/remote-config.js";
|
|
8
|
-
import CustomMeetingForm from "./CustomMeetingForm.js";
|
|
9
|
-
import { Search } from "lucide-react";
|
|
10
|
-
import InputErrorMessage from "../../ui/InputErrorMessage.js";
|
|
11
|
-
import FormInput from "../../ui/FormInput.js";
|
|
12
|
-
import Alert from "../../Alert/Alert.js";
|
|
13
|
-
import ForwardRef from "../../../node_modules/@heroicons/react/20/solid/esm/CheckIcon.js";
|
|
14
|
-
import ForwardRef$1 from "../../../node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js";
|
|
15
|
-
import ForwardRef$2 from "../../../node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js";
|
|
16
|
-
import ForwardRef$3 from "../../../node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js";
|
|
17
|
-
import ForwardRef$4 from "../../../node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js";
|
|
18
|
-
import ForwardRef$5 from "../../../node_modules/@heroicons/react/24/outline/esm/ClockIcon.js";
|
|
19
|
-
import ForwardRef$6 from "../../../node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js";
|
|
20
|
-
import ForwardRef$7 from "../../../node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js";
|
|
21
|
-
import ForwardRef$8 from "../../../node_modules/@heroicons/react/24/outline/esm/LinkIcon.js";
|
|
22
|
-
import ForwardRef$9 from "../../../node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js";
|
|
23
|
-
function loadGooglePlaces(apiKey) {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
26
|
-
return Promise.reject(new Error("Google Maps can only be loaded in browser environment"));
|
|
27
|
-
}
|
|
28
|
-
if ((_b = (_a = window.google) == null ? void 0 : _a.maps) == null ? void 0 : _b.places) return Promise.resolve();
|
|
29
|
-
return new Promise((resolve, reject) => {
|
|
30
|
-
const existingScript = document.querySelector(
|
|
31
|
-
`script[src*="maps.googleapis.com/maps/api/js"]`
|
|
32
|
-
);
|
|
33
|
-
if (existingScript) {
|
|
34
|
-
existingScript.addEventListener("load", () => resolve());
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const script = document.createElement("script");
|
|
38
|
-
script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places,geocoding`;
|
|
39
|
-
script.async = true;
|
|
40
|
-
script.defer = true;
|
|
41
|
-
script.onload = () => resolve();
|
|
42
|
-
script.onerror = () => reject(new Error("Failed to load Google Maps SDK"));
|
|
43
|
-
document.head.appendChild(script);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const RECENT_SEARCHES_KEY = "location-recent-searches";
|
|
47
|
-
const MAX_RECENT_SEARCHES = 8;
|
|
48
|
-
function GenericLocationInput({
|
|
49
|
-
googleApiKey,
|
|
50
|
-
defaultValue,
|
|
51
|
-
error: parentError,
|
|
52
|
-
field,
|
|
53
|
-
label,
|
|
54
|
-
placeholder = "Choose location or meeting type...",
|
|
55
|
-
required = false,
|
|
56
|
-
disabled = false,
|
|
57
|
-
formData,
|
|
58
|
-
helperText,
|
|
59
|
-
size = "sm",
|
|
60
|
-
variant = "default",
|
|
61
|
-
enableGoogleMeet = false,
|
|
62
|
-
enableCustomLinks = true,
|
|
63
|
-
enablePhysicalLocation = true,
|
|
64
|
-
googleMeetAuthEndpoint = BASE_URL + "/api/v1/google-auth/authorize",
|
|
65
|
-
onLocationSelected,
|
|
66
|
-
onFocus,
|
|
67
|
-
onBlur
|
|
68
|
-
}) {
|
|
69
|
-
const [currentLocation, setCurrentLocation] = useState(null);
|
|
70
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
71
|
-
const [dropdownPosition, setDropdownPosition] = useState("bottom");
|
|
72
|
-
const inputWrapperRef = useRef(null);
|
|
73
|
-
useLayoutEffect(() => {
|
|
74
|
-
if (!isOpen || !inputWrapperRef.current) return;
|
|
75
|
-
const updatePosition = () => {
|
|
76
|
-
if (!inputWrapperRef.current) return;
|
|
77
|
-
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
78
|
-
const spaceBelow = window.innerHeight - rect.bottom;
|
|
79
|
-
const spaceAbove = rect.top;
|
|
80
|
-
const minHeightNeeded = 300;
|
|
81
|
-
if (spaceBelow < minHeightNeeded && spaceAbove > spaceBelow) {
|
|
82
|
-
setDropdownPosition("top");
|
|
83
|
-
} else {
|
|
84
|
-
setDropdownPosition("bottom");
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
updatePosition();
|
|
88
|
-
window.addEventListener("resize", updatePosition);
|
|
89
|
-
window.addEventListener("scroll", updatePosition, true);
|
|
90
|
-
return () => {
|
|
91
|
-
window.removeEventListener("resize", updatePosition);
|
|
92
|
-
window.removeEventListener("scroll", updatePosition, true);
|
|
93
|
-
};
|
|
94
|
-
}, [isOpen]);
|
|
95
|
-
const [error, setError] = useState("");
|
|
96
|
-
const [viewMode, setViewMode] = useState("main");
|
|
97
|
-
const [showCopySuccess, setShowCopySuccess] = useState(false);
|
|
98
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
99
|
-
const [suggestions, setSuggestions] = useState(null);
|
|
100
|
-
const [loadingSearch, setLoadingSearch] = useState(false);
|
|
101
|
-
const [hasSearched, setHasSearched] = useState(false);
|
|
102
|
-
const [recentSearches, setRecentSearches] = useState([]);
|
|
103
|
-
const [isConnectingMeet, setIsConnectingMeet] = useState(false);
|
|
104
|
-
const popupRef = useRef(null);
|
|
105
|
-
const cleanupRef = useRef(null);
|
|
106
|
-
const messageListenerRef = useRef(null);
|
|
107
|
-
const checkClosedIntervalRef = useRef(null);
|
|
108
|
-
const [customMeetingData, setCustomMeetingData] = useState({
|
|
109
|
-
meetingUrl: "",
|
|
110
|
-
meetingId: "",
|
|
111
|
-
passcode: ""
|
|
112
|
-
});
|
|
113
|
-
const timeRef = useRef(null);
|
|
114
|
-
const reqId = useRef(0);
|
|
115
|
-
const isLibraryLoaded = useRef(false);
|
|
116
|
-
const dropdownRef = useRef(null);
|
|
117
|
-
const searchInputRef = useRef(null);
|
|
118
|
-
const blurTimeoutRef = useRef(null);
|
|
119
|
-
useEffect(() => {
|
|
120
|
-
try {
|
|
121
|
-
const stored = localStorage.getItem(RECENT_SEARCHES_KEY);
|
|
122
|
-
if (stored) {
|
|
123
|
-
const parsed = JSON.parse(stored);
|
|
124
|
-
setRecentSearches(Array.isArray(parsed) ? parsed : []);
|
|
125
|
-
}
|
|
126
|
-
} catch {
|
|
127
|
-
setRecentSearches([]);
|
|
128
|
-
}
|
|
129
|
-
}, []);
|
|
130
|
-
const saveRecentSearch = useCallback((location) => {
|
|
131
|
-
if (location.type !== "in-person" || !location.address) return;
|
|
132
|
-
const newSearch = {
|
|
133
|
-
id: Date.now().toString(),
|
|
134
|
-
displayName: location.displayName,
|
|
135
|
-
address: location.address,
|
|
136
|
-
placeId: location.placeId,
|
|
137
|
-
searchedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
138
|
-
};
|
|
139
|
-
setRecentSearches((prev) => {
|
|
140
|
-
const filtered = prev.filter(
|
|
141
|
-
(item) => item.address !== newSearch.address && item.placeId !== newSearch.placeId
|
|
142
|
-
);
|
|
143
|
-
const updated = [newSearch, ...filtered].slice(0, MAX_RECENT_SEARCHES);
|
|
144
|
-
try {
|
|
145
|
-
localStorage.setItem(RECENT_SEARCHES_KEY, JSON.stringify(updated));
|
|
146
|
-
} catch {
|
|
147
|
-
}
|
|
148
|
-
return updated;
|
|
149
|
-
});
|
|
150
|
-
}, []);
|
|
151
|
-
const clearRecentSearches = useCallback(() => {
|
|
152
|
-
setRecentSearches([]);
|
|
153
|
-
try {
|
|
154
|
-
localStorage.removeItem(RECENT_SEARCHES_KEY);
|
|
155
|
-
} catch {
|
|
156
|
-
}
|
|
157
|
-
}, []);
|
|
158
|
-
useEffect(() => {
|
|
159
|
-
let locationToSet = null;
|
|
160
|
-
if (defaultValue) {
|
|
161
|
-
locationToSet = defaultValue;
|
|
162
|
-
} else if (formData == null ? void 0 : formData.location_data) {
|
|
163
|
-
const locationData = formData.location_data;
|
|
164
|
-
if (typeof locationData === "object" && locationData !== null) {
|
|
165
|
-
const hasRealLocationData = locationData.displayName || locationData.display_name || locationData.name || locationData.address || locationData.meetingUrl || locationData.meeting_url || locationData.url || locationData.placeId || locationData.place_id;
|
|
166
|
-
if (hasRealLocationData) {
|
|
167
|
-
locationToSet = {
|
|
168
|
-
type: locationData.type || "in-person",
|
|
169
|
-
displayName: locationData.displayName || locationData.display_name || locationData.name || locationData.address || "Please select a location for event",
|
|
170
|
-
address: locationData.address,
|
|
171
|
-
placeId: locationData.placeId || locationData.place_id,
|
|
172
|
-
coordinates: locationData.coordinates || (locationData.lat && locationData.lng ? {
|
|
173
|
-
lat: locationData.lat,
|
|
174
|
-
lng: locationData.lng
|
|
175
|
-
} : void 0),
|
|
176
|
-
platform: locationData.platform,
|
|
177
|
-
meetingUrl: locationData.meetingUrl || locationData.meeting_url || locationData.url,
|
|
178
|
-
meetingId: locationData.meetingId || locationData.meeting_id,
|
|
179
|
-
passcode: locationData.passcode,
|
|
180
|
-
metadata: locationData.metadata || {}
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
if (locationToSet) {
|
|
186
|
-
setCurrentLocation(locationToSet);
|
|
187
|
-
if (locationToSet.type === "online") {
|
|
188
|
-
setCustomMeetingData({
|
|
189
|
-
meetingUrl: locationToSet.meetingUrl || "",
|
|
190
|
-
meetingId: locationToSet.meetingId || "",
|
|
191
|
-
passcode: locationToSet.passcode || ""
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}, [defaultValue, formData == null ? void 0 : formData.location_data]);
|
|
196
|
-
const cleanupPopup = useCallback(() => {
|
|
197
|
-
if (messageListenerRef.current) {
|
|
198
|
-
window.removeEventListener("message", messageListenerRef.current);
|
|
199
|
-
messageListenerRef.current = null;
|
|
200
|
-
}
|
|
201
|
-
if (checkClosedIntervalRef.current) {
|
|
202
|
-
clearInterval(checkClosedIntervalRef.current);
|
|
203
|
-
checkClosedIntervalRef.current = null;
|
|
204
|
-
}
|
|
205
|
-
if (cleanupRef.current) {
|
|
206
|
-
cleanupRef.current();
|
|
207
|
-
cleanupRef.current = null;
|
|
208
|
-
}
|
|
209
|
-
if (popupRef.current && !popupRef.current.closed) {
|
|
210
|
-
try {
|
|
211
|
-
popupRef.current.close();
|
|
212
|
-
} catch {
|
|
213
|
-
}
|
|
214
|
-
popupRef.current = null;
|
|
215
|
-
}
|
|
216
|
-
setIsConnectingMeet(false);
|
|
217
|
-
}, []);
|
|
218
|
-
useEffect(() => {
|
|
219
|
-
return () => {
|
|
220
|
-
cleanupPopup();
|
|
221
|
-
if (timeRef.current) clearTimeout(timeRef.current);
|
|
222
|
-
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
223
|
-
};
|
|
224
|
-
}, [cleanupPopup]);
|
|
225
|
-
const ensureGoogleLibraries = useCallback(async () => {
|
|
226
|
-
if (!googleApiKey) return;
|
|
227
|
-
if (!isLibraryLoaded.current) {
|
|
228
|
-
isLibraryLoaded.current = true;
|
|
229
|
-
try {
|
|
230
|
-
await loadGooglePlaces(googleApiKey);
|
|
231
|
-
await (window == null ? void 0 : window.google.maps.importLibrary("places"));
|
|
232
|
-
await (window == null ? void 0 : window.google.maps.importLibrary("geocoding"));
|
|
233
|
-
} catch (e) {
|
|
234
|
-
isLibraryLoaded.current = false;
|
|
235
|
-
setError(
|
|
236
|
-
(e == null ? void 0 : e.message) || "Unable to load location services. Please refresh and try again."
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}, [googleApiKey]);
|
|
241
|
-
const copyToClipboard = useCallback(async (e, text) => {
|
|
242
|
-
e.preventDefault();
|
|
243
|
-
try {
|
|
244
|
-
await navigator.clipboard.writeText(text);
|
|
245
|
-
setShowCopySuccess(true);
|
|
246
|
-
setTimeout(() => setShowCopySuccess(false), 3e3);
|
|
247
|
-
} catch (err) {
|
|
248
|
-
if (typeof document !== "undefined") {
|
|
249
|
-
const textArea = document.createElement("textarea");
|
|
250
|
-
textArea.value = text;
|
|
251
|
-
document.body.appendChild(textArea);
|
|
252
|
-
textArea.select();
|
|
253
|
-
document.execCommand("copy");
|
|
254
|
-
document.body.removeChild(textArea);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}, []);
|
|
258
|
-
const sizeClasses = {
|
|
259
|
-
sm: "pl-10 pr-12 py-2.5 text-sm",
|
|
260
|
-
md: "pl-11 pr-12 py-3.5 text-base",
|
|
261
|
-
lg: "pl-12 pr-14 py-4 text-lg"
|
|
262
|
-
};
|
|
263
|
-
const iconSizes = {
|
|
264
|
-
sm: "h-4 w-4",
|
|
265
|
-
md: "h-5 w-5",
|
|
266
|
-
lg: "h-6 w-6"
|
|
267
|
-
};
|
|
268
|
-
const iconPositions = {
|
|
269
|
-
sm: "left-3",
|
|
270
|
-
md: "left-3.5",
|
|
271
|
-
lg: "left-4"
|
|
272
|
-
};
|
|
273
|
-
const getVariantClasses = () => {
|
|
274
|
-
const baseClasses = "w-full rounded-lg transition-all duration-300 outline-none font-medium";
|
|
275
|
-
switch (variant) {
|
|
276
|
-
case "filled":
|
|
277
|
-
return clsx(
|
|
278
|
-
baseClasses,
|
|
279
|
-
"bg-grey-50 input-border",
|
|
280
|
-
"focus:bg-white focus:border-blue-500 focus:ring-4 focus:ring-blue-500/10 focus:shadow-lg",
|
|
281
|
-
"hover:bg-grey-100 hover:shadow-md",
|
|
282
|
-
parentError || error ? "bg-error-50 border-error-200 focus:border-error-500 focus:ring-error-500/10" : "input-border",
|
|
283
|
-
disabled ? "bg-grey-100 text-grey-500 cursor-not-allowed" : "text-grey-900"
|
|
284
|
-
);
|
|
285
|
-
case "outlined":
|
|
286
|
-
return clsx(
|
|
287
|
-
baseClasses,
|
|
288
|
-
"bg-white input-border",
|
|
289
|
-
"focus:border-blue-500 focus:ring-4 focus:ring-blue-500/10 focus:shadow-lg",
|
|
290
|
-
"hover:border-grey-400 hover:shadow-md",
|
|
291
|
-
parentError || error ? "border-error-300 focus:border-error-500 focus:ring-error-500/10" : "input-border",
|
|
292
|
-
disabled ? "bg-grey-50 text-grey-500 cursor-not-allowed border-grey-200" : "text-grey-900"
|
|
293
|
-
);
|
|
294
|
-
default:
|
|
295
|
-
return clsx(
|
|
296
|
-
baseClasses,
|
|
297
|
-
"bg-white input-border",
|
|
298
|
-
"focus:ring-2 focus:ring-primaryx-500/20 focus:border-primaryx-500 focus:shadow-lg",
|
|
299
|
-
"hover:border-grey-300 hover:shadow-md",
|
|
300
|
-
parentError || error ? "border-error-300 focus:border-error-500 focus:ring-error-500/10" : "input-border",
|
|
301
|
-
disabled ? "bg-grey-50 text-grey-500 cursor-not-allowed" : "text-grey-900"
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
const displayValue = (currentLocation == null ? void 0 : currentLocation.displayName) ?? "";
|
|
306
|
-
const handleGoogleMeetConnect = useCallback(async () => {
|
|
307
|
-
if (!enableGoogleMeet) return;
|
|
308
|
-
if (popupRef.current && !popupRef.current.closed) {
|
|
309
|
-
try {
|
|
310
|
-
popupRef.current.close();
|
|
311
|
-
} catch {
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
setIsConnectingMeet(true);
|
|
315
|
-
setError("");
|
|
316
|
-
try {
|
|
317
|
-
const width = 500;
|
|
318
|
-
const height = 600;
|
|
319
|
-
const left = Math.max(0, (window.screen.width - width) / 2);
|
|
320
|
-
const top = Math.max(0, (window.screen.height - height) / 2);
|
|
321
|
-
const popup = window.open(
|
|
322
|
-
googleMeetAuthEndpoint,
|
|
323
|
-
// + `?id=${vendor?.id}`,
|
|
324
|
-
"google-auth",
|
|
325
|
-
`width=${width},height=${height},left=${left},top=${top - 50},scrollbars=yes,resizable=yes,status=yes`
|
|
326
|
-
);
|
|
327
|
-
if (!popup) {
|
|
328
|
-
throw new Error("Popup blocked. Please allow popups and try again.");
|
|
329
|
-
}
|
|
330
|
-
popupRef.current = popup;
|
|
331
|
-
let isPopupClosed = false;
|
|
332
|
-
let messageReceived = false;
|
|
333
|
-
const checkClosed = setInterval(() => {
|
|
334
|
-
if (popup.closed && !messageReceived) {
|
|
335
|
-
clearInterval(checkClosed);
|
|
336
|
-
isPopupClosed = true;
|
|
337
|
-
setIsConnectingMeet(false);
|
|
338
|
-
setError("Google authorization was cancelled");
|
|
339
|
-
cleanupPopup();
|
|
340
|
-
}
|
|
341
|
-
}, 1e3);
|
|
342
|
-
checkClosedIntervalRef.current = checkClosed;
|
|
343
|
-
const messageListener = (event) => {
|
|
344
|
-
const allowedOrigins = [
|
|
345
|
-
window.location.origin,
|
|
346
|
-
"http://localhost:5000",
|
|
347
|
-
"https://localhost:5000",
|
|
348
|
-
"https://dev-dot-cardpay-1.el.r.appspot.com"
|
|
349
|
-
];
|
|
350
|
-
const isValidOrigin = allowedOrigins.some(
|
|
351
|
-
(origin) => event.origin === origin || event.origin.startsWith(origin)
|
|
352
|
-
);
|
|
353
|
-
if (!isValidOrigin || isPopupClosed) return;
|
|
354
|
-
let messageData = event.data;
|
|
355
|
-
if (typeof messageData === "string") {
|
|
356
|
-
try {
|
|
357
|
-
messageData = JSON.parse(messageData);
|
|
358
|
-
} catch {
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
messageReceived = true;
|
|
362
|
-
if (checkClosedIntervalRef.current) {
|
|
363
|
-
clearInterval(checkClosedIntervalRef.current);
|
|
364
|
-
checkClosedIntervalRef.current = null;
|
|
365
|
-
}
|
|
366
|
-
if (messageData.type === "GOOGLE_AUTH_SUCCESS" || messageData.success) {
|
|
367
|
-
const meetLink = messageData.meetLink || messageData.link || messageData.url;
|
|
368
|
-
const newLocation = {
|
|
369
|
-
type: "online",
|
|
370
|
-
displayName: "Google Meet (Online)",
|
|
371
|
-
platform: "google-meet",
|
|
372
|
-
meetingUrl: meetLink,
|
|
373
|
-
metadata: { autoGenerated: true, connectedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
374
|
-
};
|
|
375
|
-
setCurrentLocation(newLocation);
|
|
376
|
-
onLocationSelected(newLocation);
|
|
377
|
-
setIsOpen(false);
|
|
378
|
-
setViewMode("main");
|
|
379
|
-
setTimeout(() => {
|
|
380
|
-
if (!popup.closed) popup.close();
|
|
381
|
-
cleanupPopup();
|
|
382
|
-
}, 100);
|
|
383
|
-
} else if (messageData.type === "GOOGLE_AUTH_ERROR" || messageData.error) {
|
|
384
|
-
setError(messageData.error || messageData.message || "Failed to connect Google Meet");
|
|
385
|
-
setTimeout(() => {
|
|
386
|
-
if (!popup.closed) popup.close();
|
|
387
|
-
cleanupPopup();
|
|
388
|
-
}, 100);
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
messageListenerRef.current = messageListener;
|
|
392
|
-
window.addEventListener("message", messageListener);
|
|
393
|
-
const timeoutId = setTimeout(() => {
|
|
394
|
-
if (!messageReceived && !popup.closed) {
|
|
395
|
-
setError("Google authorization timed out. Please try again.");
|
|
396
|
-
cleanupPopup();
|
|
397
|
-
}
|
|
398
|
-
}, 3e5);
|
|
399
|
-
cleanupRef.current = () => {
|
|
400
|
-
clearTimeout(timeoutId);
|
|
401
|
-
if (checkClosedIntervalRef.current) {
|
|
402
|
-
clearInterval(checkClosedIntervalRef.current);
|
|
403
|
-
checkClosedIntervalRef.current = null;
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
} catch (e) {
|
|
407
|
-
setError(e instanceof Error ? e.message : "Failed to open Google authorization");
|
|
408
|
-
setIsConnectingMeet(false);
|
|
409
|
-
}
|
|
410
|
-
}, [
|
|
411
|
-
enableGoogleMeet,
|
|
412
|
-
googleMeetAuthEndpoint,
|
|
413
|
-
/*vendor?.id,*/
|
|
414
|
-
cleanupPopup,
|
|
415
|
-
onLocationSelected
|
|
416
|
-
]);
|
|
417
|
-
const handleCustomMeetingSubmit = useCallback(() => {
|
|
418
|
-
setError("");
|
|
419
|
-
if (!customMeetingData.meetingUrl.trim()) {
|
|
420
|
-
setError("Meeting URL is required");
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
try {
|
|
424
|
-
const u = new URL(customMeetingData.meetingUrl);
|
|
425
|
-
if (!["http:", "https:"].includes(u.protocol)) {
|
|
426
|
-
setError("Please enter a valid meeting URL");
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
} catch {
|
|
430
|
-
setError("Please enter a valid meeting URL");
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
const displayName = "Virtual Meeting (Custom Link)";
|
|
434
|
-
const newLocation = {
|
|
435
|
-
type: "online",
|
|
436
|
-
displayName,
|
|
437
|
-
platform: "custom",
|
|
438
|
-
// Always set as custom for manually added links
|
|
439
|
-
meetingUrl: customMeetingData.meetingUrl,
|
|
440
|
-
meetingId: customMeetingData.meetingId || void 0,
|
|
441
|
-
passcode: customMeetingData.passcode || void 0,
|
|
442
|
-
metadata: {
|
|
443
|
-
manuallyAdded: true,
|
|
444
|
-
addedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
445
|
-
originalUrl: customMeetingData.meetingUrl
|
|
446
|
-
// Store original URL for reference
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
setCurrentLocation(newLocation);
|
|
450
|
-
onLocationSelected(newLocation);
|
|
451
|
-
setViewMode("main");
|
|
452
|
-
setIsOpen(false);
|
|
453
|
-
}, [customMeetingData, onLocationSelected]);
|
|
454
|
-
const handleClear = useCallback(() => {
|
|
455
|
-
setCurrentLocation(null);
|
|
456
|
-
setSearchQuery("");
|
|
457
|
-
setSuggestions(null);
|
|
458
|
-
setViewMode("main");
|
|
459
|
-
setError("");
|
|
460
|
-
setCustomMeetingData({
|
|
461
|
-
meetingUrl: "",
|
|
462
|
-
meetingId: "",
|
|
463
|
-
passcode: ""
|
|
464
|
-
});
|
|
465
|
-
onLocationSelected(null);
|
|
466
|
-
}, [onLocationSelected]);
|
|
467
|
-
const runSearch = useCallback(
|
|
468
|
-
async (inputValue) => {
|
|
469
|
-
if (!enablePhysicalLocation || !googleApiKey) return;
|
|
470
|
-
if (!inputValue.trim()) {
|
|
471
|
-
setSuggestions(null);
|
|
472
|
-
setLoadingSearch(false);
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
setLoadingSearch(true);
|
|
476
|
-
if (timeRef.current) clearTimeout(timeRef.current);
|
|
477
|
-
const currentRequestId = (reqId.current + 1) % 100;
|
|
478
|
-
reqId.current = currentRequestId;
|
|
479
|
-
timeRef.current = setTimeout(async () => {
|
|
480
|
-
try {
|
|
481
|
-
await ensureGoogleLibraries();
|
|
482
|
-
const { suggestions: suggs } = await (window == null ? void 0 : window.google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions({
|
|
483
|
-
input: inputValue,
|
|
484
|
-
region: "PK"
|
|
485
|
-
}));
|
|
486
|
-
if (currentRequestId === reqId.current) {
|
|
487
|
-
setSuggestions(
|
|
488
|
-
(suggs || []).map((s) => {
|
|
489
|
-
var _a, _b, _c;
|
|
490
|
-
return {
|
|
491
|
-
placeId: (_a = s.placePrediction) == null ? void 0 : _a.placeId,
|
|
492
|
-
description: (_c = (_b = s.placePrediction) == null ? void 0 : _b.text) == null ? void 0 : _c.text
|
|
493
|
-
};
|
|
494
|
-
}).filter((s) => s.placeId && s.description)
|
|
495
|
-
);
|
|
496
|
-
setLoadingSearch(false);
|
|
497
|
-
}
|
|
498
|
-
} catch (e) {
|
|
499
|
-
if (currentRequestId === reqId.current) {
|
|
500
|
-
setError("Unable to search locations. Please try again.");
|
|
501
|
-
setLoadingSearch(false);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}, 300);
|
|
505
|
-
},
|
|
506
|
-
[enablePhysicalLocation, googleApiKey, ensureGoogleLibraries]
|
|
507
|
-
);
|
|
508
|
-
const handleSelectSuggestion = useCallback(
|
|
509
|
-
(s) => {
|
|
510
|
-
const newLocation = {
|
|
511
|
-
type: "in-person",
|
|
512
|
-
displayName: s.description,
|
|
513
|
-
address: s.description,
|
|
514
|
-
placeId: s.placeId,
|
|
515
|
-
metadata: { selectedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
516
|
-
};
|
|
517
|
-
setCurrentLocation(newLocation);
|
|
518
|
-
onLocationSelected(newLocation);
|
|
519
|
-
saveRecentSearch(newLocation);
|
|
520
|
-
setIsOpen(false);
|
|
521
|
-
setViewMode("main");
|
|
522
|
-
},
|
|
523
|
-
[onLocationSelected, saveRecentSearch]
|
|
524
|
-
);
|
|
525
|
-
const handleSelectRecentSearch = useCallback(
|
|
526
|
-
(recent) => {
|
|
527
|
-
const newLocation = {
|
|
528
|
-
type: "in-person",
|
|
529
|
-
displayName: recent.displayName,
|
|
530
|
-
address: recent.address,
|
|
531
|
-
placeId: recent.placeId,
|
|
532
|
-
metadata: { selectedAt: (/* @__PURE__ */ new Date()).toISOString(), fromRecent: true }
|
|
533
|
-
};
|
|
534
|
-
setCurrentLocation(newLocation);
|
|
535
|
-
onLocationSelected(newLocation);
|
|
536
|
-
setIsOpen(false);
|
|
537
|
-
setViewMode("main");
|
|
538
|
-
},
|
|
539
|
-
[onLocationSelected]
|
|
540
|
-
);
|
|
541
|
-
const handleUseCustomSearch = useCallback(() => {
|
|
542
|
-
if (!searchQuery.trim()) return;
|
|
543
|
-
const newLocation = {
|
|
544
|
-
type: "in-person",
|
|
545
|
-
displayName: searchQuery,
|
|
546
|
-
address: searchQuery,
|
|
547
|
-
metadata: { selectedAt: (/* @__PURE__ */ new Date()).toISOString(), isCustomText: true }
|
|
548
|
-
};
|
|
549
|
-
setCurrentLocation(newLocation);
|
|
550
|
-
onLocationSelected(newLocation);
|
|
551
|
-
saveRecentSearch(newLocation);
|
|
552
|
-
setIsOpen(false);
|
|
553
|
-
setViewMode("main");
|
|
554
|
-
}, [searchQuery, onLocationSelected, saveRecentSearch]);
|
|
555
|
-
const handleMainInputBlur = useCallback(() => {
|
|
556
|
-
blurTimeoutRef.current = setTimeout(() => {
|
|
557
|
-
setIsOpen(false);
|
|
558
|
-
setViewMode("main");
|
|
559
|
-
}, 150);
|
|
560
|
-
onBlur == null ? void 0 : onBlur();
|
|
561
|
-
}, [onBlur]);
|
|
562
|
-
const cancelBlurTimeout = useCallback(() => {
|
|
563
|
-
if (blurTimeoutRef.current) {
|
|
564
|
-
clearTimeout(blurTimeoutRef.current);
|
|
565
|
-
blurTimeoutRef.current = null;
|
|
566
|
-
}
|
|
567
|
-
}, []);
|
|
568
|
-
const handleInteractiveMouseDown = useCallback((e) => {
|
|
569
|
-
e.preventDefault();
|
|
570
|
-
cancelBlurTimeout();
|
|
571
|
-
}, [cancelBlurTimeout]);
|
|
572
|
-
useEffect(() => {
|
|
573
|
-
const handleClickOutside = (event) => {
|
|
574
|
-
const target = event.target;
|
|
575
|
-
if (dropdownRef.current && !dropdownRef.current.contains(target) && inputWrapperRef.current && !inputWrapperRef.current.contains(target)) {
|
|
576
|
-
setIsOpen(false);
|
|
577
|
-
setViewMode("main");
|
|
578
|
-
}
|
|
579
|
-
};
|
|
580
|
-
if (isOpen) {
|
|
581
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
582
|
-
}
|
|
583
|
-
return () => {
|
|
584
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
585
|
-
};
|
|
586
|
-
}, [isOpen]);
|
|
587
|
-
const handleSearchInputChange = useCallback((e) => {
|
|
588
|
-
e.stopPropagation();
|
|
589
|
-
const value = e.target.value;
|
|
590
|
-
setSearchQuery(value);
|
|
591
|
-
setHasSearched(true);
|
|
592
|
-
setError("");
|
|
593
|
-
runSearch(value);
|
|
594
|
-
}, [runSearch]);
|
|
595
|
-
useCallback((e) => {
|
|
596
|
-
e.stopPropagation();
|
|
597
|
-
cancelBlurTimeout();
|
|
598
|
-
}, [cancelBlurTimeout]);
|
|
599
|
-
const handleSearchInputBlur = useCallback((e) => {
|
|
600
|
-
e.stopPropagation();
|
|
601
|
-
}, []);
|
|
602
|
-
useCallback((e) => {
|
|
603
|
-
e.stopPropagation();
|
|
604
|
-
cancelBlurTimeout();
|
|
605
|
-
}, [cancelBlurTimeout]);
|
|
606
|
-
useCallback((e) => {
|
|
607
|
-
e.stopPropagation();
|
|
608
|
-
cancelBlurTimeout();
|
|
609
|
-
if (searchInputRef.current && typeof document !== "undefined" && document.activeElement !== searchInputRef.current) {
|
|
610
|
-
searchInputRef.current.focus();
|
|
611
|
-
}
|
|
612
|
-
}, [cancelBlurTimeout]);
|
|
613
|
-
const showClearButton = (displayValue || currentLocation) && !disabled;
|
|
614
|
-
const getLeadingIcon = () => {
|
|
615
|
-
if ((currentLocation == null ? void 0 : currentLocation.type) === "online") {
|
|
616
|
-
if (currentLocation.platform === "google-meet") {
|
|
617
|
-
return /* @__PURE__ */ jsx(FaGoogle, { className: clsx(iconSizes[size], "text-blue-600") });
|
|
618
|
-
}
|
|
619
|
-
return /* @__PURE__ */ jsx(ForwardRef$6, { className: clsx(iconSizes[size], "text-purple-600") });
|
|
620
|
-
}
|
|
621
|
-
return /* @__PURE__ */ jsx(ForwardRef$4, { className: clsx(iconSizes[size], "text-grey-500") });
|
|
622
|
-
};
|
|
623
|
-
const dropdownVariants = {
|
|
624
|
-
hidden: { opacity: 0, y: -10, scale: 0.95 },
|
|
625
|
-
visible: { opacity: 1, y: 0, scale: 1 },
|
|
626
|
-
exit: { opacity: 0, y: -10, scale: 0.95 }
|
|
627
|
-
};
|
|
628
|
-
const contentVariants = {
|
|
629
|
-
hidden: { opacity: 0, x: -20 },
|
|
630
|
-
visible: { opacity: 1, x: 0 },
|
|
631
|
-
exit: { opacity: 0, x: 20 }
|
|
632
|
-
};
|
|
633
|
-
const shouldShowRecentSearches = recentSearches.length > 0 && searchQuery.trim() === "";
|
|
634
|
-
const shouldShowSearchResults = searchQuery.trim() !== "" && (loadingSearch || (suggestions == null ? void 0 : suggestions.length) || hasSearched);
|
|
635
|
-
const renderLocationDetails = () => {
|
|
636
|
-
var _a, _b, _c;
|
|
637
|
-
if (!currentLocation) return null;
|
|
638
|
-
if (currentLocation.type === "online") {
|
|
639
|
-
return /* @__PURE__ */ jsxs(
|
|
640
|
-
motion.div,
|
|
641
|
-
{
|
|
642
|
-
initial: { opacity: 0, height: 0 },
|
|
643
|
-
animate: { opacity: 1, height: "auto" },
|
|
644
|
-
exit: { opacity: 0, height: 0 },
|
|
645
|
-
className: "mt-3 space-y-3",
|
|
646
|
-
children: [
|
|
647
|
-
currentLocation.platform !== "google-meet" && /* @__PURE__ */ jsx("div", { className: "p-4 bg-blue-50 border border-blue-200 rounded-xl", children: /* @__PURE__ */ jsx("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
648
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
649
|
-
/* @__PURE__ */ jsx(ForwardRef$6, { className: "h-4 w-4 text-purple-600" }),
|
|
650
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-grey-900", children: currentLocation.platform === "zoom" ? "Zoom Meeting" : currentLocation.platform === "teams" ? "Microsoft Teams" : "Virtual Meeting" }),
|
|
651
|
-
/* @__PURE__ */ jsx("span", { className: "px-2 py-1 bg-green-100 text-green-700 text-xs font-medium rounded-full", children: "Online" })
|
|
652
|
-
] }),
|
|
653
|
-
currentLocation.meetingUrl && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
654
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
655
|
-
/* @__PURE__ */ jsx(ForwardRef$8, { className: "h-4 w-4 text-grey-500 flex-shrink-0" }),
|
|
656
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-grey-600", children: "Meeting Link:" })
|
|
657
|
-
] }),
|
|
658
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1fr_auto] gap-2 bg-white p-2 rounded-lg border border-gray-300 items-center min-w-0", children: [
|
|
659
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 overflow-hidden", children: /* @__PURE__ */ jsx("code", { className: "block text-xs text-blue-600 break-all line-clamp-2 leading-relaxed", children: currentLocation.meetingUrl }) }),
|
|
660
|
-
/* @__PURE__ */ jsx(
|
|
661
|
-
"button",
|
|
662
|
-
{
|
|
663
|
-
type: "button",
|
|
664
|
-
onClick: (e) => copyToClipboard(e, currentLocation.meetingUrl),
|
|
665
|
-
className: "p-1 hover:bg-grey-100 rounded transition-colors flex-shrink-0",
|
|
666
|
-
title: "Copy link",
|
|
667
|
-
children: /* @__PURE__ */ jsx(ForwardRef$9, { className: "h-3 w-3 text-grey-500 hover:text-grey-600" })
|
|
668
|
-
}
|
|
669
|
-
)
|
|
670
|
-
] })
|
|
671
|
-
] }),
|
|
672
|
-
currentLocation.meetingId && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
673
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-grey-600", children: "Meeting ID:" }),
|
|
674
|
-
/* @__PURE__ */ jsx("code", { className: "text-xs text-grey-800 bg-white px-2 py-1 rounded border", children: currentLocation.meetingId })
|
|
675
|
-
] }) }),
|
|
676
|
-
currentLocation.passcode && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
677
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-grey-600", children: "Passcode:" }),
|
|
678
|
-
/* @__PURE__ */ jsx("code", { className: "text-xs text-grey-800 bg-white px-2 py-1 rounded border", children: currentLocation.passcode })
|
|
679
|
-
] }) })
|
|
680
|
-
] }) }) }),
|
|
681
|
-
currentLocation.platform === "google-meet" && ((_a = currentLocation.metadata) == null ? void 0 : _a.autoGenerated) && /* @__PURE__ */ jsx(
|
|
682
|
-
motion.div,
|
|
683
|
-
{
|
|
684
|
-
initial: { opacity: 0, height: 0 },
|
|
685
|
-
animate: { opacity: 1, height: "auto" },
|
|
686
|
-
transition: { duration: 0.3, ease: "easeOut" },
|
|
687
|
-
className: "bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-200 rounded-xl p-4",
|
|
688
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
689
|
-
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-blue-100", children: /* @__PURE__ */ jsx(FaGoogle, { className: "h-4 w-4 text-blue-600" }) }),
|
|
690
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
691
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
692
|
-
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold text-blue-900", children: "Smart Meeting Creation" }),
|
|
693
|
-
/* @__PURE__ */ jsx("span", { className: "px-2 py-0.5 bg-blue-200 text-blue-800 text-xs font-medium rounded-full", children: "Auto Generated" })
|
|
694
|
-
] }),
|
|
695
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-blue-700 leading-relaxed", children: "Your Google Meet will be automatically created when you publish the event, scheduled according to your event timing." }),
|
|
696
|
-
((_b = formData == null ? void 0 : formData.event_start_timestamp) == null ? void 0 : _b.date) && ((_c = formData == null ? void 0 : formData.event_end_timestamp) == null ? void 0 : _c.date) && /* @__PURE__ */ jsxs("div", { className: "mt-3 p-3 bg-white/70 rounded-lg border border-blue-200", children: [
|
|
697
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
698
|
-
/* @__PURE__ */ jsx(ForwardRef$5, { className: "h-3.5 w-3.5 text-blue-600" }),
|
|
699
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-blue-800", children: "Meeting Schedule" })
|
|
700
|
-
] }),
|
|
701
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
702
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
|
|
703
|
-
/* @__PURE__ */ jsx("span", { className: "text-blue-600 font-medium", children: "Start:" }),
|
|
704
|
-
/* @__PURE__ */ jsx("span", { className: "text-blue-800", children: (/* @__PURE__ */ new Date(`${formData.event_start_timestamp.date}T${formData.event_start_timestamp.time || "00:00"}`)).toLocaleString("en-US", {
|
|
705
|
-
weekday: "short",
|
|
706
|
-
month: "short",
|
|
707
|
-
day: "numeric",
|
|
708
|
-
hour: "2-digit",
|
|
709
|
-
minute: "2-digit"
|
|
710
|
-
}) })
|
|
711
|
-
] }),
|
|
712
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
|
|
713
|
-
/* @__PURE__ */ jsx("span", { className: "text-blue-600 font-medium", children: "End:" }),
|
|
714
|
-
/* @__PURE__ */ jsx("span", { className: "text-blue-800", children: (/* @__PURE__ */ new Date(`${formData.event_end_timestamp.date}T${formData.event_end_timestamp.time || "23:59"}`)).toLocaleString("en-US", {
|
|
715
|
-
weekday: "short",
|
|
716
|
-
month: "short",
|
|
717
|
-
day: "numeric",
|
|
718
|
-
hour: "2-digit",
|
|
719
|
-
minute: "2-digit"
|
|
720
|
-
}) })
|
|
721
|
-
] })
|
|
722
|
-
] })
|
|
723
|
-
] }),
|
|
724
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-1", children: [
|
|
725
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-blue-700", children: [
|
|
726
|
-
/* @__PURE__ */ jsx(ForwardRef, { className: "h-3 w-3 text-blue-600" }),
|
|
727
|
-
/* @__PURE__ */ jsx("span", { children: "Automatic calendar invites" })
|
|
728
|
-
] }),
|
|
729
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-blue-700", children: [
|
|
730
|
-
/* @__PURE__ */ jsx(ForwardRef, { className: "h-3 w-3 text-blue-600" }),
|
|
731
|
-
/* @__PURE__ */ jsx("span", { children: "Meeting link shared with attendees" })
|
|
732
|
-
] }),
|
|
733
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-blue-700", children: [
|
|
734
|
-
/* @__PURE__ */ jsx(ForwardRef, { className: "h-3 w-3 text-blue-600" }),
|
|
735
|
-
/* @__PURE__ */ jsx("span", { children: "Synchronized with event schedule" })
|
|
736
|
-
] })
|
|
737
|
-
] })
|
|
738
|
-
] })
|
|
739
|
-
] })
|
|
740
|
-
}
|
|
741
|
-
)
|
|
742
|
-
]
|
|
743
|
-
}
|
|
744
|
-
);
|
|
745
|
-
} else if (currentLocation.type === "in-person") {
|
|
746
|
-
return /* @__PURE__ */ jsx(
|
|
747
|
-
motion.div,
|
|
748
|
-
{
|
|
749
|
-
initial: { opacity: 0, height: 0 },
|
|
750
|
-
animate: { opacity: 1, height: "auto" },
|
|
751
|
-
exit: { opacity: 0, height: 0 },
|
|
752
|
-
className: "mt-3 p-4 bg-green-50 border border-green-200 rounded-xl",
|
|
753
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
754
|
-
/* @__PURE__ */ jsx(ForwardRef$4, { className: "h-5 w-5 text-green-600 flex-shrink-0 mt-0.5" }),
|
|
755
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
756
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
757
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-grey-900", children: "Physical location" }),
|
|
758
|
-
/* @__PURE__ */ jsx("span", { className: "px-2 py-1 bg-green-100 text-green-700 text-xs font-medium rounded-full", children: "In-Person" })
|
|
759
|
-
] }),
|
|
760
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm text-grey-700 leading-relaxed", children: currentLocation.address || currentLocation.displayName }),
|
|
761
|
-
currentLocation.coordinates && /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-grey-500", children: [
|
|
762
|
-
"Coordinates: ",
|
|
763
|
-
currentLocation.coordinates.lat.toFixed(6),
|
|
764
|
-
", ",
|
|
765
|
-
currentLocation.coordinates.lng.toFixed(6)
|
|
766
|
-
] })
|
|
767
|
-
] })
|
|
768
|
-
] })
|
|
769
|
-
}
|
|
770
|
-
);
|
|
771
|
-
}
|
|
772
|
-
return null;
|
|
773
|
-
};
|
|
774
|
-
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
775
|
-
label && /* @__PURE__ */ jsxs(
|
|
776
|
-
motion.label,
|
|
777
|
-
{
|
|
778
|
-
className: "block text-sm font-semibold text-grey-800 mb-3",
|
|
779
|
-
initial: { opacity: 0, y: -10 },
|
|
780
|
-
animate: { opacity: 1, y: 0 },
|
|
781
|
-
transition: { duration: 0.2 },
|
|
782
|
-
children: [
|
|
783
|
-
label,
|
|
784
|
-
required && /* @__PURE__ */ jsx("span", { className: "text-error-500 ml-1", children: "*" })
|
|
785
|
-
]
|
|
786
|
-
}
|
|
787
|
-
),
|
|
788
|
-
/* @__PURE__ */ jsx(Combobox, { value: displayValue, onChange: () => {
|
|
789
|
-
}, disabled, children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
790
|
-
/* @__PURE__ */ jsxs(
|
|
791
|
-
motion.div,
|
|
792
|
-
{
|
|
793
|
-
className: "relative",
|
|
794
|
-
ref: inputWrapperRef,
|
|
795
|
-
transition: { duration: 0.2, ease: "easeOut" },
|
|
796
|
-
children: [
|
|
797
|
-
/* @__PURE__ */ jsx("div", { className: clsx(
|
|
798
|
-
"absolute inset-y-0 flex items-center pointer-events-none",
|
|
799
|
-
iconPositions[size]
|
|
800
|
-
), children: getLeadingIcon() }),
|
|
801
|
-
/* @__PURE__ */ jsx(
|
|
802
|
-
ComboboxInput,
|
|
803
|
-
{
|
|
804
|
-
className: clsx(
|
|
805
|
-
getVariantClasses(),
|
|
806
|
-
sizeClasses[size],
|
|
807
|
-
"cursor-pointer font-normal placeholder:font-normal hover:shadow-none border-gray-300 hover:border-gray-400 truncate",
|
|
808
|
-
isOpen && "transform",
|
|
809
|
-
(currentLocation == null ? void 0 : currentLocation.type) === "online" ? "!pr-36" : showClearButton ? "!pr-20" : "!pr-12"
|
|
810
|
-
),
|
|
811
|
-
name: field,
|
|
812
|
-
value: displayValue,
|
|
813
|
-
onChange: () => {
|
|
814
|
-
},
|
|
815
|
-
readOnly: true,
|
|
816
|
-
placeholder,
|
|
817
|
-
onFocus: async () => {
|
|
818
|
-
cancelBlurTimeout();
|
|
819
|
-
setIsOpen(true);
|
|
820
|
-
await ensureGoogleLibraries();
|
|
821
|
-
onFocus == null ? void 0 : onFocus();
|
|
822
|
-
},
|
|
823
|
-
onClick: async () => {
|
|
824
|
-
cancelBlurTimeout();
|
|
825
|
-
setIsOpen(true);
|
|
826
|
-
await ensureGoogleLibraries();
|
|
827
|
-
},
|
|
828
|
-
onBlur: handleMainInputBlur
|
|
829
|
-
}
|
|
830
|
-
),
|
|
831
|
-
/* @__PURE__ */ jsxs("div", { className: "absolute inset-y-0 right-0 flex items-center pr-4 space-x-2", children: [
|
|
832
|
-
/* @__PURE__ */ jsxs(AnimatePresence, { mode: "wait", children: [
|
|
833
|
-
(currentLocation == null ? void 0 : currentLocation.type) === "online" && /* @__PURE__ */ jsxs(
|
|
834
|
-
motion.div,
|
|
835
|
-
{
|
|
836
|
-
initial: { opacity: 0, scale: 0.8 },
|
|
837
|
-
animate: { opacity: 1, scale: 1 },
|
|
838
|
-
exit: { opacity: 0, scale: 0.8 },
|
|
839
|
-
className: "flex items-center space-x-1.5 bg-green-50 px-2 py-1 rounded-full",
|
|
840
|
-
children: [
|
|
841
|
-
/* @__PURE__ */ jsx(ForwardRef, { className: "h-3.5 w-3.5 text-green-600" }),
|
|
842
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-green-700 font-medium", children: "Connected" })
|
|
843
|
-
]
|
|
844
|
-
},
|
|
845
|
-
"connected"
|
|
846
|
-
),
|
|
847
|
-
showClearButton && /* @__PURE__ */ jsx(
|
|
848
|
-
motion.button,
|
|
849
|
-
{
|
|
850
|
-
type: "button",
|
|
851
|
-
onClick: (e) => {
|
|
852
|
-
e.preventDefault();
|
|
853
|
-
e.stopPropagation();
|
|
854
|
-
handleClear();
|
|
855
|
-
},
|
|
856
|
-
onMouseDown: handleInteractiveMouseDown,
|
|
857
|
-
className: "text-grey-400 hover:text-grey-600 transition-all duration-200 p-1.5 rounded-full hover:bg-grey-100 focus:outline-none focus:ring-2 focus:ring-primaryx-500/20 focus:border-primaryx-500",
|
|
858
|
-
"aria-label": "Clear selection",
|
|
859
|
-
initial: { opacity: 0, scale: 0.8 },
|
|
860
|
-
animate: { opacity: 1, scale: 1 },
|
|
861
|
-
exit: { opacity: 0, scale: 0.8 },
|
|
862
|
-
whileHover: { scale: 1.1 },
|
|
863
|
-
whileTap: { scale: 0.95 },
|
|
864
|
-
disabled,
|
|
865
|
-
children: /* @__PURE__ */ jsx(ForwardRef$1, { className: "h-4 w-4" })
|
|
866
|
-
},
|
|
867
|
-
"clear"
|
|
868
|
-
)
|
|
869
|
-
] }),
|
|
870
|
-
/* @__PURE__ */ jsx(
|
|
871
|
-
motion.div,
|
|
872
|
-
{
|
|
873
|
-
animate: { rotate: isOpen ? 180 : 0 },
|
|
874
|
-
transition: { duration: 0.2 },
|
|
875
|
-
className: "text-grey-400",
|
|
876
|
-
children: /* @__PURE__ */ jsx(ForwardRef$2, { className: "h-5 w-5" })
|
|
877
|
-
}
|
|
878
|
-
)
|
|
879
|
-
] }),
|
|
880
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(
|
|
881
|
-
motion.div,
|
|
882
|
-
{
|
|
883
|
-
variants: dropdownVariants,
|
|
884
|
-
initial: "hidden",
|
|
885
|
-
animate: "visible",
|
|
886
|
-
exit: "exit",
|
|
887
|
-
style: { transformOrigin: dropdownPosition === "top" ? "bottom" : "top" },
|
|
888
|
-
transition: { duration: 0.3, ease: "easeOut" },
|
|
889
|
-
className: clsx(
|
|
890
|
-
"absolute left-0 w-full z-50",
|
|
891
|
-
dropdownPosition === "top" ? "bottom-full mb-1" : "top-full -mt-1"
|
|
892
|
-
),
|
|
893
|
-
children: /* @__PURE__ */ jsx(
|
|
894
|
-
ComboboxOptions,
|
|
895
|
-
{
|
|
896
|
-
ref: dropdownRef,
|
|
897
|
-
className: clsx(
|
|
898
|
-
"w-full mt-3 rounded-lg border border-grey-200 bg-white shadow-2xl p-1 overflow-hidden",
|
|
899
|
-
"focus:outline-none backdrop-blur-sm"
|
|
900
|
-
),
|
|
901
|
-
static: true,
|
|
902
|
-
children: /* @__PURE__ */ jsxs(AnimatePresence, { mode: "wait", children: [
|
|
903
|
-
viewMode === "main" && /* @__PURE__ */ jsx(
|
|
904
|
-
motion.div,
|
|
905
|
-
{
|
|
906
|
-
variants: contentVariants,
|
|
907
|
-
initial: "hidden",
|
|
908
|
-
animate: "visible",
|
|
909
|
-
exit: "exit",
|
|
910
|
-
transition: { duration: 0.2 },
|
|
911
|
-
className: "p-3",
|
|
912
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
913
|
-
enablePhysicalLocation && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
914
|
-
/* @__PURE__ */ jsxs("div", { className: "px-3 py-2", children: [
|
|
915
|
-
/* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold text-grey-500 uppercase tracking-wider mb-3", children: "Physical location" }),
|
|
916
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
917
|
-
/* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
|
|
918
|
-
"div",
|
|
919
|
-
{
|
|
920
|
-
onKeyDown: (e) => e.stopPropagation(),
|
|
921
|
-
onClick: (e) => {
|
|
922
|
-
e.stopPropagation();
|
|
923
|
-
cancelBlurTimeout();
|
|
924
|
-
},
|
|
925
|
-
onMouseDown: (e) => {
|
|
926
|
-
e.stopPropagation();
|
|
927
|
-
cancelBlurTimeout();
|
|
928
|
-
},
|
|
929
|
-
onFocus: (e) => {
|
|
930
|
-
e.stopPropagation();
|
|
931
|
-
cancelBlurTimeout();
|
|
932
|
-
},
|
|
933
|
-
children: /* @__PURE__ */ jsx(
|
|
934
|
-
FormInput,
|
|
935
|
-
{
|
|
936
|
-
type: "text",
|
|
937
|
-
value: searchQuery,
|
|
938
|
-
placeholder: "Search for venues, addresses, or landmarks...",
|
|
939
|
-
icon: Search,
|
|
940
|
-
inputClassName: "w-full pl-10 pr-4 h-10",
|
|
941
|
-
onChange: handleSearchInputChange,
|
|
942
|
-
onBlur: () => {
|
|
943
|
-
if (searchInputRef.current) {
|
|
944
|
-
const event = new Event("blur");
|
|
945
|
-
handleSearchInputBlur(event);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
)
|
|
950
|
-
}
|
|
951
|
-
) }),
|
|
952
|
-
shouldShowSearchResults && /* @__PURE__ */ jsxs("div", { className: "overflow-auto rounded-xl border border-grey-100", children: [
|
|
953
|
-
loadingSearch && /* @__PURE__ */ jsx("div", { className: "px-4 py-6 text-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center space-y-2", children: [
|
|
954
|
-
/* @__PURE__ */ jsx(FaCircleNotch, { className: "h-5 w-5 animate-spin text-blue-500" }),
|
|
955
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-grey-600", children: "Searching locations..." })
|
|
956
|
-
] }) }),
|
|
957
|
-
!loadingSearch && hasSearched && searchQuery.trim() !== "" && (!suggestions || suggestions.length === 0) && /* @__PURE__ */ jsx("div", { className: "px-4 py-6 text-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center space-y-2", children: [
|
|
958
|
-
/* @__PURE__ */ jsx(ForwardRef$3, { className: "h-6 w-6 text-grey-300" }),
|
|
959
|
-
/* @__PURE__ */ jsxs("p", { className: "text-xs text-grey-500", children: [
|
|
960
|
-
"No locations found for ",
|
|
961
|
-
searchQuery
|
|
962
|
-
] }),
|
|
963
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-grey-400", children: "Try different keywords or check spelling" })
|
|
964
|
-
] }) }),
|
|
965
|
-
!loadingSearch && (suggestions == null ? void 0 : suggestions.map((s, idx) => /* @__PURE__ */ jsxs(
|
|
966
|
-
"button",
|
|
967
|
-
{
|
|
968
|
-
type: "button",
|
|
969
|
-
onClick: (e) => {
|
|
970
|
-
e.preventDefault();
|
|
971
|
-
e.stopPropagation();
|
|
972
|
-
handleSelectSuggestion(s);
|
|
973
|
-
},
|
|
974
|
-
onMouseDown: handleInteractiveMouseDown,
|
|
975
|
-
className: clsx(
|
|
976
|
-
"w-full text-left px-4 py-3 hover:bg-grey-50 transition-colors flex items-center gap-3",
|
|
977
|
-
idx !== 0 && "border-t border-grey-100"
|
|
978
|
-
),
|
|
979
|
-
children: [
|
|
980
|
-
/* @__PURE__ */ jsx(ForwardRef$4, { className: "h-4 w-4 text-grey-400 flex-shrink-0" }),
|
|
981
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-grey-900", children: s.description })
|
|
982
|
-
]
|
|
983
|
-
},
|
|
984
|
-
s.placeId
|
|
985
|
-
)))
|
|
986
|
-
] }),
|
|
987
|
-
shouldShowRecentSearches && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
988
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
989
|
-
/* @__PURE__ */ jsxs("h4", { className: "text-xs font-medium text-grey-600 flex items-center gap-1", children: [
|
|
990
|
-
/* @__PURE__ */ jsx(ForwardRef$5, { className: "h-3 w-3" }),
|
|
991
|
-
"Recent searches"
|
|
992
|
-
] }),
|
|
993
|
-
/* @__PURE__ */ jsx(
|
|
994
|
-
"button",
|
|
995
|
-
{
|
|
996
|
-
type: "button",
|
|
997
|
-
onClick: (e) => {
|
|
998
|
-
e.preventDefault();
|
|
999
|
-
e.stopPropagation();
|
|
1000
|
-
clearRecentSearches();
|
|
1001
|
-
},
|
|
1002
|
-
onMouseDown: handleInteractiveMouseDown,
|
|
1003
|
-
className: "text-xs text-grey-400 hover:text-grey-600 transition-colors",
|
|
1004
|
-
children: "Clear all"
|
|
1005
|
-
}
|
|
1006
|
-
)
|
|
1007
|
-
] }),
|
|
1008
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-1 overflow-auto", children: recentSearches.map((recent) => /* @__PURE__ */ jsxs(
|
|
1009
|
-
"button",
|
|
1010
|
-
{
|
|
1011
|
-
type: "button",
|
|
1012
|
-
onClick: (e) => {
|
|
1013
|
-
e.preventDefault();
|
|
1014
|
-
e.stopPropagation();
|
|
1015
|
-
handleSelectRecentSearch(recent);
|
|
1016
|
-
},
|
|
1017
|
-
onMouseDown: handleInteractiveMouseDown,
|
|
1018
|
-
className: "w-full text-left px-3 py-2.5 hover:bg-grey-50 rounded-lg transition-colors flex items-center gap-3 group",
|
|
1019
|
-
children: [
|
|
1020
|
-
/* @__PURE__ */ jsx("div", { className: "p-1.5 rounded-md bg-grey-100 group-hover:bg-grey-200 transition-colors", children: /* @__PURE__ */ jsx(ForwardRef$5, { className: "h-3.5 w-3.5 text-grey-500" }) }),
|
|
1021
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1022
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-grey-700 truncate block", children: recent.displayName }),
|
|
1023
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-grey-400", children: new Date(recent.searchedAt).toLocaleDateString() })
|
|
1024
|
-
] })
|
|
1025
|
-
]
|
|
1026
|
-
},
|
|
1027
|
-
recent.id
|
|
1028
|
-
)) })
|
|
1029
|
-
] }),
|
|
1030
|
-
!shouldShowRecentSearches && !shouldShowSearchResults && /* @__PURE__ */ jsxs("div", { className: "text-center py-6", children: [
|
|
1031
|
-
/* @__PURE__ */ jsx(ForwardRef$5, { className: "h-8 w-8 text-grey-300 mx-auto mb-2" }),
|
|
1032
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-grey-500", children: "No recent searches" }),
|
|
1033
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-grey-400 mt-1", children: "Your recent location searches will appear here" })
|
|
1034
|
-
] }),
|
|
1035
|
-
searchQuery.trim() !== "" && /* @__PURE__ */ jsxs(
|
|
1036
|
-
"button",
|
|
1037
|
-
{
|
|
1038
|
-
type: "button",
|
|
1039
|
-
onClick: (e) => {
|
|
1040
|
-
e.preventDefault();
|
|
1041
|
-
e.stopPropagation();
|
|
1042
|
-
handleUseCustomSearch();
|
|
1043
|
-
},
|
|
1044
|
-
onMouseDown: handleInteractiveMouseDown,
|
|
1045
|
-
className: "w-full text-left px-4 py-3 bg-grey-100 hover:bg-grey-200 transition-colors flex items-center gap-3 border-t border-grey-100",
|
|
1046
|
-
children: [
|
|
1047
|
-
/* @__PURE__ */ jsx(ForwardRef$4, { className: "h-4 w-4 text-grey-500 flex-shrink-0" }),
|
|
1048
|
-
/* @__PURE__ */ jsxs("span", { className: "text-sm text-grey-900", children: [
|
|
1049
|
-
"Use ",
|
|
1050
|
-
`"${searchQuery}"`
|
|
1051
|
-
] })
|
|
1052
|
-
]
|
|
1053
|
-
}
|
|
1054
|
-
)
|
|
1055
|
-
] })
|
|
1056
|
-
] }),
|
|
1057
|
-
/* @__PURE__ */ jsx("div", { className: "mx-3 h-px bg-grey-100" })
|
|
1058
|
-
] }),
|
|
1059
|
-
/* @__PURE__ */ jsxs("div", { className: "px-3 py-2", children: [
|
|
1060
|
-
/* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold text-grey-500 uppercase tracking-wider mb-3", children: "Virtual Meeting" }),
|
|
1061
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
1062
|
-
enableGoogleMeet && /* @__PURE__ */ jsxs(
|
|
1063
|
-
"button",
|
|
1064
|
-
{
|
|
1065
|
-
type: "button",
|
|
1066
|
-
onClick: (e) => {
|
|
1067
|
-
e.preventDefault();
|
|
1068
|
-
e.stopPropagation();
|
|
1069
|
-
handleGoogleMeetConnect();
|
|
1070
|
-
},
|
|
1071
|
-
onMouseDown: handleInteractiveMouseDown,
|
|
1072
|
-
disabled: isConnectingMeet,
|
|
1073
|
-
className: "w-full flex items-center gap-3 px-3 py-3 rounded-xl hover:bg-blue-50 transition-all duration-200 text-left group disabled:opacity-50",
|
|
1074
|
-
children: [
|
|
1075
|
-
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-blue-100 group-hover:bg-blue-200 transition-colors", children: isConnectingMeet ? /* @__PURE__ */ jsx(FaCircleNotch, { className: "h-5 w-5 animate-spin text-blue-600" }) : /* @__PURE__ */ jsx(FaGoogle, { className: "h-5 w-5 text-blue-600" }) }),
|
|
1076
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
1077
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-grey-900", children: isConnectingMeet ? "Connecting..." : "Google Meet" }),
|
|
1078
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-grey-500", children: isConnectingMeet ? "Authorizing with Google" : "Auto-generate meeting link" })
|
|
1079
|
-
] })
|
|
1080
|
-
]
|
|
1081
|
-
}
|
|
1082
|
-
),
|
|
1083
|
-
enableCustomLinks && /* @__PURE__ */ jsxs(
|
|
1084
|
-
"button",
|
|
1085
|
-
{
|
|
1086
|
-
type: "button",
|
|
1087
|
-
onClick: (e) => {
|
|
1088
|
-
e.preventDefault();
|
|
1089
|
-
e.stopPropagation();
|
|
1090
|
-
setViewMode("custom-meeting");
|
|
1091
|
-
},
|
|
1092
|
-
onMouseDown: handleInteractiveMouseDown,
|
|
1093
|
-
className: "w-full flex items-center gap-3 px-3 py-3 rounded-xl hover:bg-purple-50 transition-all duration-200 text-left group",
|
|
1094
|
-
children: [
|
|
1095
|
-
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-lg bg-purple-100 group-hover:bg-purple-200 transition-colors", children: /* @__PURE__ */ jsx(ForwardRef$6, { className: "h-5 w-5 text-purple-600" }) }),
|
|
1096
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
1097
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-grey-900", children: "Custom meeting link" }),
|
|
1098
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-grey-500", children: "Add Zoom, Teams, or any meeting URL" })
|
|
1099
|
-
] }),
|
|
1100
|
-
/* @__PURE__ */ jsx(ForwardRef$7, { className: "h-4 w-4 text-grey-400 group-hover:text-purple-500 transition-colors" })
|
|
1101
|
-
]
|
|
1102
|
-
}
|
|
1103
|
-
)
|
|
1104
|
-
] })
|
|
1105
|
-
] })
|
|
1106
|
-
] })
|
|
1107
|
-
},
|
|
1108
|
-
"main"
|
|
1109
|
-
),
|
|
1110
|
-
viewMode === "custom-meeting" && enableCustomLinks && /* @__PURE__ */ jsx(
|
|
1111
|
-
motion.div,
|
|
1112
|
-
{
|
|
1113
|
-
variants: contentVariants,
|
|
1114
|
-
initial: "hidden",
|
|
1115
|
-
animate: "visible",
|
|
1116
|
-
exit: "exit",
|
|
1117
|
-
transition: { duration: 0.2 },
|
|
1118
|
-
className: "p-3",
|
|
1119
|
-
children: /* @__PURE__ */ jsx(
|
|
1120
|
-
CustomMeetingForm,
|
|
1121
|
-
{
|
|
1122
|
-
initialData: customMeetingData,
|
|
1123
|
-
onSubmit: (data) => {
|
|
1124
|
-
setCustomMeetingData(data);
|
|
1125
|
-
handleCustomMeetingSubmit();
|
|
1126
|
-
},
|
|
1127
|
-
onCancel: () => setViewMode("main"),
|
|
1128
|
-
cancelBlurTimeout,
|
|
1129
|
-
handleInteractiveMouseDown,
|
|
1130
|
-
contentVariants
|
|
1131
|
-
}
|
|
1132
|
-
)
|
|
1133
|
-
},
|
|
1134
|
-
"custom-meeting"
|
|
1135
|
-
)
|
|
1136
|
-
] })
|
|
1137
|
-
}
|
|
1138
|
-
)
|
|
1139
|
-
}
|
|
1140
|
-
) })
|
|
1141
|
-
]
|
|
1142
|
-
}
|
|
1143
|
-
),
|
|
1144
|
-
helperText && currentLocation && /* @__PURE__ */ jsx(
|
|
1145
|
-
motion.p,
|
|
1146
|
-
{
|
|
1147
|
-
initial: { opacity: 0 },
|
|
1148
|
-
animate: { opacity: 1 },
|
|
1149
|
-
className: "mt-2 text-sm text-grey-500",
|
|
1150
|
-
children: helperText
|
|
1151
|
-
}
|
|
1152
|
-
),
|
|
1153
|
-
!currentLocation && /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
|
|
1154
|
-
/* @__PURE__ */ jsx(InputErrorMessage, { error: parentError || error }),
|
|
1155
|
-
error && error.includes("Popup") && /* @__PURE__ */ jsx(
|
|
1156
|
-
"button",
|
|
1157
|
-
{
|
|
1158
|
-
onClick: handleGoogleMeetConnect,
|
|
1159
|
-
className: "mt-2 text-sm text-error-600 underline hover:text-error-800 font-medium",
|
|
1160
|
-
children: "Try again"
|
|
1161
|
-
}
|
|
1162
|
-
)
|
|
1163
|
-
] }),
|
|
1164
|
-
!parentError && !error && /* @__PURE__ */ jsx(AnimatePresence, { children: currentLocation && renderLocationDetails() })
|
|
1165
|
-
] }) }),
|
|
1166
|
-
/* @__PURE__ */ jsx(
|
|
1167
|
-
Alert,
|
|
1168
|
-
{
|
|
1169
|
-
type: "success",
|
|
1170
|
-
isVisible: showCopySuccess,
|
|
1171
|
-
message: "Meeting link copied to clipboard!"
|
|
1172
|
-
}
|
|
1173
|
-
)
|
|
1174
|
-
] });
|
|
1175
|
-
}
|
|
1176
|
-
export {
|
|
1177
|
-
GenericLocationInput
|
|
1178
|
-
};
|
|
1179
|
-
//# sourceMappingURL=GoogleMapsAutocompleteInput.js.map
|