{"version":3,"sources":["_helpers/Constants.ts","context/WidgetContext.ts","_helpers/Enums/ViewPortEnum.ts","Data/StartWidget.ts","Data/WidgetStyle.ts","_helpers/Enums/EnumQuoteLeadSource.ts","components/common/start-widget/assets/MobileDayPickerOverlay.tsx","components/common/customDayPickerInput/CustomDayPickerInput.tsx","components/common/start-widget/widget-form/WidgetForm.tsx","_helpers/UseFetchHook.ts","components/common/start-widget/widget/data-service-hooks/UseCreateQuote.ts","components/common/start-widget/widget/widget-modals/schemas/RequestQuoteSchema.ts","components/common/start-widget/widget/widget-modals/RequestQuoteModal.tsx","Data/Rates/EnumProductRateType.ts","components/common/start-widget/widget/data-service-hooks/UseGetStartWidget.ts","components/common/start-widget/widget/data-service-hooks/UseGetWidgetStyle.ts","components/common/start-widget/widget/data-service-hooks/UseGetBrands.ts","Data/VendorUnit.ts","_helpers/Functions.ts","Data/Rates/UnitRateLogic.ts","components/common/start-widget/widget/itinerary/components/MobileUnitPriceEditDelete.tsx","Data/Reservation/ReservationStatus.ts","components/common/start-widget/widget/itinerary/components/MobileUnitTabDetails.tsx","components/common/start-widget/widget/itinerary/lodging-tab/LodgingTab.tsx","components/common/start-widget/widget/itinerary/golf-tab/GolfTab.tsx","components/common/start-widget/widget/itinerary/transportation-tab/TransportationTab.tsx","components/common/start-widget/widget/itinerary/custom-items-tab/CustomItemTab.tsx","components/common/start-widget/widget/itinerary/get-quote/GetQuote.tsx","Data/Reservation/PaymentAllocationCategory.ts","components/common/start-widget/widget/data-service-hooks/UseGetGlacierCompanyByResOrCompanyIdToken.ts","components/common/start-widget/widget/data-service-hooks/UseGetGlacierCustomer.ts","components/common/start-widget/widget/widget-modals/schemas/MakePaymentScheme.ts","components/common/start-widget/widget/data-service-hooks/UseValidateReCaptcha.ts","components/common/start-widget/widget/itinerary/make-payment/MakePayment.tsx","components/common/start-widget/widget/itinerary/totals/guest-info/GuestInfo.tsx","components/common/start-widget/widget/data-service-hooks/UseUpdateReservationCustomers.ts","components/common/start-widget/widget/data-service-hooks/UseCreateIndividualCategory.ts","components/common/start-widget/widget/itinerary/totals/Totals.tsx","components/common/start-widget/widget/itinerary/book-now/BookNow.tsx","components/common/start-widget/widget/itinerary/adjustment-tab/AdjustmentTab.tsx","components/common/start-widget/widget/data-service-hooks/UseGetPromoByName.ts","components/common/start-widget/widget/itinerary/components/AddItineraryUnitButton.tsx","components/common/start-widget/widget/itinerary/components/ItineraryModalButton.tsx","_helpers/UseWindowHook.ts","_helpers/UseCalculateWidgetHeight.ts","components/common/start-widget/widget/itinerary/ItineraryStart.tsx","components/common/start-widget/widget/widget-modals/custom/add-custom/data-service-hooks/UseGetCustomVendors.ts","components/common/start-widget/widget/widget-modals/VendorCard.tsx","components/common/start-widget/widget/widget-modals/custom/custom-details/CustomDetails.tsx","components/common/switchToggle/SwitchToggle.tsx","components/common/start-widget/widget/widget-modals/AddModalSortBy.tsx","components/common/start-widget/widget/widget-modals/custom/add-custom/AddCustomModal.tsx","components/common/start-widget/widget/widget-modals/golf/add-golf/data-service-hooks/UseGetGolfVendors.ts","components/common/start-widget/widget/widget-modals/golf/golf-details/GolfDetails.tsx","components/common/start-widget/widget/widget-modals/golf/add-golf/AddGolfModal.tsx","components/common/start-widget/widget/widget-modals/lodging/add-lodging/data-service-hooks/UseGetLodgingVendors.ts","components/common/start-widget/widget/widget-modals/lodging/lodging-details/LodgingDetail.tsx","components/common/start-widget/widget/widget-modals/lodging/add-lodging/AddLodgingModal.tsx","components/common/start-widget/widget/widget-modals/transportation/add-transportation/data-service-hooks/UseGetTransportVendors.ts","components/common/start-widget/widget/widget-modals/transportation/transportation-details/TransportationDetails.tsx","components/common/start-widget/widget/widget-modals/transportation/add-transportation/AddTransportationModal.tsx","components/common/start-widget/widget/widget-modals/schemas/FindReservationSchema.ts","components/common/start-widget/widget/widget-modals/FindReservationModal.tsx","components/common/start-widget/widget/widget-modals/pre-built-packages/add-packages/data-service-hooks/UseGetPreBuiltPackages.ts","components/common/start-widget/widget/widget-modals/pre-built-packages/packages-card/PackagesCard.tsx","components/common/start-widget/widget/widget-modals/PackageVendorCard.tsx","components/common/start-widget/widget/widget-modals/pre-built-packages/package-details/PackageDetails.tsx","components/common/start-widget/widget/widget-modals/pre-built-packages/add-packages/AddPreBuiltPackageModal.tsx","components/common/start-widget/widget/data-service-hooks/UseSearchQuote.ts","components/common/start-widget/widget/data-service-hooks/UseGetVendorTypeByGuid.ts","components/common/start-widget/widget/widget-modals/pre-built-packages/package-details/PackageDetailsModal.tsx","components/common/start-widget/widget/widget-modals/pre-built-packages/add-packages/data-service-hooks/UseGetQuickPackages.ts","components/common/start-widget/widget/widget-modals/pre-built-packages/add-packages/data-service-hooks/UseGetPackageById.ts","components/common/start-widget/widget/mobile-widget/MobileHamburgerMenu.tsx","components/common/start-widget/widget/Widget.tsx","components/common/confirmation/UseGetVendorConfirmationReservation.ts","components/common/confirmation/UseUpdateItineraryConfirmation.ts","components/common/confirmation/VendorConfirmation.tsx","components/common/start-widget/StartWidget.tsx","components/common/main-content/MainContent.js","App.tsx","serviceWorker.ts","index.tsx"],"names":["Constants","location","window","href","includes","apiUrl","getApiString","startingDate","Date","getTime","threeDaysFromStartingDate","version","ViewPort","WidgetContext","React","createContext","companyId","undefined","brandSettings","startWidget","startWidgetId","brandId","active","showLodgingButton","showGolfButton","showTransportationButton","showExtrasButton","showBookNowButton","showSaveQuoteButton","showQuickPackages","showLodgingModule","showGolfModule","showTransportationModule","showCustomItemsModule","showPerPersonPricing","showTaxesTotal","showGrandTotal","showResortFeeTotal","showCleaningFeeTotal","showPromoCodeTotal","showLodgingPricing","showGolfPricing","showTransportationPricing","showCustomItemsPricing","requireFirstLastName","requireEmailAddress","requirePhoneNumber","requireAddress","activateGoogleAnalytics","googleAnalyticsTrackingCode","googleTagImplementationCode","requireTermsAndConditions","style","id","buttonColor","fontColor","headerColor","linkColor","borderColor","itineraryButtonColor","bookNowButtonColor","getQuoteButtonColor","brandLogo","datesAndGuests","fromDate","toDate","guests","units","fromEmail","viewPortWidth","viewPortHeight","viewPortBreakPoint","brand","autoScroll","vendorGuid","campaignId","EnumQuoteLeadSource","MobileDayPickerOverlay","props","classNames","children","Fragment","className","overlayWrapper","backgroundColor","overlay","CustomDayPickerInput","inputProps","newBackgroundColor","disabled","readOnly","WidgetForm","useContext","brands","itineraryNotEmpty","onWidgetButtonPressed","onSetValidation","onSetBrandId","formatDate","reactMoment","parseDate","datesAndGuestsState","setDatesAndGuests","modifiers","start","end","useState","errors","setErrors","onBrandIdChanged","event","console","log","target","value","onGuestsInputChanged","getDateErrors","errs","push","message","useEffect","length","findIndex","e","filter","Form","onSubmit","dateErrors","brandErrors","getBrandErrors","preventDefault","Row","marginRight","Label","color","find","Control","as","onChange","hidden","key","sort","a","b","webOrder","map","index","brandName","Col","moment","format","placeholder","required","dayPickerProps","selectedDays","from","to","disabledDays","before","numberOfMonths","month","onDayChange","date","fromMonth","defaultValue","xs","overlayComponent","sm","fontSize","width","paddingLeft","useFetch","request","cancel","cancelRequest","useRef","responseStatusCode","setResponseStatusCode","data","setData","error","setError","isLoading","setIsLoading","setRequestUrl","abortController","AbortController","current","abort","url","method","body","isFormData","bodyData","hdr","JSON","stringify","fetch","headers","signal","result","status","ok","aborted","json","toast","hideProgressBar","errorText","fetchData","useCreateQuote","fetchRequest","setFetchRequest","fetchResponse","apiString","response","TravelerSchema","yup","shape","firstName","lastName","email","RequestQuoteSchema","phone","matches","groupName","transform","comments","numGuests","travelers","of","RequestQuoteSchemaDefaultValues","EnumProductRateType","extendedSchema","fields","needLodging","oneOf","RequestQuoteModal","show","onHide","isGroup","momentjs","createRequest","setCreateRequest","createResponse","useForm","mode","resolver","yupResolver","defaultValues","register","handleSubmit","formState","setValue","reset","getValues","success","Modal","scrollable","size","backdropClassName","dialogClassName","Header","translate","closeButton","closeLabel","Title","Body","fontFamily","noValidate","formData","customer","reservationId","customerId","isActive","emailAddress","streetAddress","city","state","country","zipCode","phone1","customerNotes","paymentAllocationCategoryId","paymentAllocationCategory","cancelled","quote","reservation","leadCustomer","itineraryNumber","lodgingItineraries","golfItineraries","transportItineraries","customItineraries","numChildren","totalSell","totalCost","balanceDue","arrive","depart","tax","resortFees","cleaningFee","name","isPreBuiltPkg","reservationCustomers","requestNote","quoteLeadSourceId","OnlineGroupQuote","OnlineQuote","fontWeight","type","ref","isValid","isSubmitted","isInvalid","Feedback","marginTop","md","min","parseInt","onBlur","rows","Button","variant","block","Spinner","animation","role","aria-hidden","useGetStartWidget","widgetId","UseGetWidgetStyle","useGetBrand","VendorUnit","init","vendorUnitId","vendorId","unitName","unitDescription","vendorUnitImages","uniqueIdForSelection","isLive","sortOrder","personPerUnit","sell","rates","published","Object","assign","this","roundDecimal","num","numForCeil","times","expression","RegExp","match","toString","truncated","lessThan","Decimal","decimalToFixed","modulo","equals","ceil","dividedBy","NormalizeCurrencyInput","negative","numbersOnly","replace","padStart","slice","decimalNumber","isStringEmpty","str","getUnitRate","numberUnits","getFirstIfNull","unitRates","flatMap","vendorUnitDisplayName","c","rateType","UnitQtyRange","startUnitNumber","endUnitNumber","unitRate","r","getHourlyRate","selectedStartTime","selectedEndTime","hourlyRates","HoursPerUnit","startHour","numberOfHours","duration","diff","asHours","add","hourlyRate","endHour","getDailyRate","startDate","endDate","dayRates","DayRange","selectedStartDate","selectedEndDate","numberOfDays","asDays","days","day","lastDate","isSameOrBefore","clone","ratesForDays","rate","isSame","rd","ur","ratesForNumberOfDays","poppedRateByDate","pop","noRateMessage","productRates","rateForNumberOfDays","startDay","endDay","getVendorUnitIdsFromSelectedName","selectedName","ids","forEach","dayRate","isSameOrAfter","getAvailableVendorUnits","vendorUnits","dateRates","dateRate","vu","trim","unit","u","some","getRateTypeFromUnitName","v","getVendorUnitIdFromUnitName","getUnitNameFromVendorUnitId","selectedUnit","populateTimes","startOf","endOf","hours","Math","label","ReservationStatus","MobileUnitPriceEditDelete","vendor","showPricing","getPriceString","editItem","removeItem","item","alignItems","display","flexDirection","height","justifyContent","onClick","margin","rateDisplayOptions","showPkgPriceOnly","MobileUnitTabDetails","quoteStatus","editable","paddingRight","LodgingTab","itinerary","itemIndex","quoteRequested","bookNowRequested","brandSetting","s","setVendorUnits","dailyRates","momentJs","checkIn","setCheckIn","checkOut","setCheckOut","guestsInUnit","setGuests","numberOfUnits","setNumberOfUnits","unavailableMessage","setUnavailableMessage","setSelectedUnit","selectedUnitName","setSelectedUnitName","travelPortLodgingOfferId","selectedTravePortLodgingOfferId","setSelectedTravePortLodgingOfferId","travelPortRateName","selectedTravePortUnitName","setSelectedTravePortUnitName","productRate","setProductRate","unitRateTotal","setUnitRateTotal","errorsImg","placeholderImgUrl","vendorImageUrl","description","vendorDescriptionImages","unitOptions","usePkgPriceByLodging","itineraryUnits","usePkgPriceByLodgingNumber","toFixed","_vendorUnits","toLowerCase","nights","night","checkOutDate","isBefore","unavailableDates","unavailableDatesMessage","ratesForUnitName","unavailableRates","unavailable","innerRates","testRate","test","reduce","price","toNumber","productRateId","showOnItinerary","Image","padding","src","onVendorImageClick","fluid","vendorName","after","onCheckInDateChanged","isAfter","onCheckOutDateChanged","options","maxGuests","getNumGuestsOptions","getNumUnitsOptions","lg","preBuiltPkgVendorUnit","currentTarget","Group","controlId","confirmationNumber","cancelationNumber","border","marginBottom","alignSelf","GolfTab","playDate","setPlayDate","players","setPlayers","teeTime","selectedTeeTime","setSelectedTeeTime","teeTimes","setTeeTimes","setRatesForPlayDate","setRatesForUnit","teeTimeRate","setTeeTimeRate","teeTimesOptions","populateTeeTimes","selectedPlayDate","ratesForDate","selectedRates","ratesForUnit","rateTeeTimes","startTime","endTime","pkgStart","fromTime","pkgEnd","toTime","minutes","openSpots","foreUpTeeTimeId","golfNowTeeTimeId","lightSpeedTeeTimeId","concat","Map","values","availableTeeTimes","playerOptions","Array","_","i","number","usePkgPriceByCourse","usePkgPriceByCourseNumber","unitIds","confirmedTime","TransportationTab","setStartDate","setEndDate","inUnit","setUnits","setStartTime","setEndTime","startTimes","setStartTimes","endTimes","setEndTimes","isHourlyRate","setIsHourlyRate","isUnitRate","setIsUnitRate","isDailyRate","setIsDailyRate","setSelectedProductRate","selectedProductRateType","setSelectedProductRateType","rangePickerMode","setRangePickerMode","startTimeOptions","time","endTimeOptions","usePkgPriceByTransport","usePkgPriceByTransportNumber","toDateString","CustomItemTab","setCurrentProductRate","isTimeRate","setIsTimeRate","timeRates","setTimeRates","usePkgPriceByCustom","usePkgPriceByCustomNumber","UseTime","unitTimeRates","UseUnit","newStartTimes","timeRate","GetQuote","travelerCount","setTravelerCount","requestItineraryQuote","control","useFieldArray","keyName","customers","t","traveler","PaymentAllocationCategory","categoryName","allocationItems","allocationLines","allocationCategory","reservationGuestsCount","cost","allocationItem","ai","itineraryUnitId","evenSplit","mul","numberGuestsPayingFor","numberUnitsPayingFor","perUnitPrice","unitsPayingFor","priceOfUnits","guestsPayingFor","perGuestPrice","perPlayerPrice","tax1","adjustments","adjustmentId","numUnits","toDecimalPlaces","allocationCatagories","count","cat","reservationGuests","g","total","getCost","UseGetGlacierCompanyByResOrCompanyIdToken","useGetGlacierCustomer","MakePaymentSchema","billingAddress","billingCity","billingCountry","billingEmail","billingFirstName","billingLastName","billingState","billingZip","otherAmount","when","is","then","agentTip","notRequired","termsCheck","MakePaymentSchemaDefaultValues","useValidateReCaptcha","MakePayment","payingCustomer","setPayingCustomer","paymentOption","setPaymentOption","_paymentOption","fetchGlacierTokenRequest","setGlacierTokenRequest","fetchGlacierTokenResponse","useGetGlacierCompanyToken","glacierToken","setGlacierToken","submitting","setSubmitting","fetchGlacierCustomerRequest","setGlacierCustomerRequest","fetchGlacierCustomerResponse","glacierCustomer","setGlacierCustomer","submitPaymentRequest","setSubmitPaymentRequest","submitPaymentResponse","setSubmitted","ccnumberInvalid","setCCNumberInvalid","ccNumberValidated","setccNumberValidated","ccnumberInvalidFeedback","setCCNumberInvalidFeedback","ccexpInvalid","setCCExpInvalid","ccExpValidated","setccExpValidated","ccexpInvalidFeedback","setCCExpInvalidFeedback","cvvInvalid","setCVVInvalid","cvvValidated","setCVVValidated","cvvInvalidFeedback","setCVVInvalidFeedback","validateReCaptchaRequest","setValidateReCaptchaRequest","validateReCaptchaResponse","captchaRef","captcha","setCaptcha","paymentAllocations","paymentCategories","evenCategory","evenPersonsToDivideBy","getTotalAllocationLines","priceMinusCategories","getTotalAllocationsCost","evenPerPersonPrice","fullPaymentPrice","setFullPaymentPrice","splitPaymentPrice","setSplitPaymentPrice","depositPrice","setDepositPrice","setPaymentsMadeTotal","setSelectedCustomerPaymentsAmount","setAgentTip","paymentAmount","setPaymentAmount","showTerms","setShowTerms","_setPaymentOption","option","tip","payments","paymentsAmount","acc","obj","tipsAmount","tipAmount","leadCustomerId","custPayments","p","customerPaymentsAmount","paymentTypeId","customerTipsAmount","fullPrice","deposit","downPaymentType","downPayment","token","existingScript","document","getElementById","remove","script","createElement","setAttribute","appendChild","onload","configureGlacier","paymentToken","billingPrice","submitPayment","CollectJS","startPaymentRequest","configure","field","valid","validationCallback","clearAllValidation","setValidated","paymentOptionChanged","onPaymentMade","amount","statusId","reservationStatus","onError","keys","getValue","alt","title","useDepositOnly","Check","Input","checked","rc","allowAgentTips","agent","payment","onAgentTip","objectFit","sitekey","borderBottom","termsAndConditions","tags","company","companyName","entries","rgx","parse","parseTerms","GuestInfo","onJoinClicked","remainingReservationBalance","onPayClicked","reservationGuest","setReservationGuest","newGuestName","setNewGuestName","newGuestEmail","setNewGuestEmail","isNewGuest","emailCustomerRequest","setEmailCustomerRequest","emailCustomerResponse","paymentCategory","customerCategory","setCustomerCategory","emailPayLink","Accordion","defaultActiveKey","Toggle","eventKey","minWidth","Collapse","marginLeft","utc","paymentDate","local","join","isQuoteExpired","categoryId","useUpdateReservationCustomers","useCreateIndividualCategory","Total","setShowModal","onReservationCustomerAdded","emailCustomer","setQuote","setReservationGuests","hasAllocations","cleaningFees","discountsApplied","discountApplied","promoCodeName","promo","resPerPersonPrice","setRemainingReservationBalance","updateRequest","setUpdateRequest","updateResponse","formErrors","setFormErrors","addGuest","guest","category","split","first","shift","last","filteredCustomers","reservationCustomer","customerPayments","okPayments","allocationCost","sortedCats","getGuestCount","totalPayments","createIndividualRequest","setCreateIndividualRequest","createIndividualResponse","resCust","handleUseIndividualPayments","allowPromo","discount","activeKey","phoneNumber","borderRadius","customerIds","BookNow","dateAndGuests","fullPaymentOption","setFullPaymentOption","depositPaymentOption","setDepositPaymentOption","isGettingQuote","setIsGettingQuote","setFormData","ac","ob","createdFromBooking","State","_formData","adjustmentName","UseGetPromoByName","promoQuery","queryUrl","AddItineraryUnitButton","buttonText","ItineraryModalButton","modalString","buttonLabel","requireLodgingPkgQuote","missing","useWindowSize","innerWidth","setWidth","innerHeight","setHeight","getBreakPoint","breakPoint","setBreakPoint","xl","useLayoutEffect","updateSize","addEventListener","removeEventListener","useCalculateWidgetHeight","showModal","isQuoteBooked","showModalValue","screen","availHeight","moduleAndButtonViewHeight","firstLoad","calculateMobileWidgetHeight","viewHeight","calculateTotalItineraryUnits","modules","numItems","viewHeightScalar","calculateTotalModuleAndButtonHeight","golfCount","transportCount","lodgingCount","customCount","sendItineraryUnitsMessage","calculateWidgetViewHeight","parent","postMessage","isMobile","ItineraryStart","quoteState","itineraryState","showState","onEditLodging","onEditGolf","onEditTransport","onEditCustom","pbPackage","setItinerary","setShow","setBookNowRequested","setQuoteRequested","setReservationCustomers","fromBooking","setFromBooking","setCreatedFromBooking","setGroupName","imgIndex","setImgIndex","selectedVendor","setSelectedVendor","promoInput","setPromoInput","promoRequest","setPromoRequest","promoFetchResponse","setPromo","promoError","setPromoError","promoErrorMsg","setPromoErrorMsg","Number","createdOn","quotesValidDays","webViewAddButtonConditional","allowCustomization","onSaveQuote","ReactGA","action","setTimeout","handlePromoEntry","removeLodgingItem","vendorIndex","itineraryIndex","splice","found","removeGolfItem","removeTransportItem","removeCustomItem","validPromo","validToBookFor","setHours","validToBookForStart","validToBookForEnd","validToBookFrom","today","validToBookFromStart","validToBookFromEnd","promoBrands","pb","tempItinerary","li","gi","ti","ci","invalidDoteFound","alert","promoId","preBuiltPkgId","deleted","fontStyle","allowLodging","requireLodgingNights","lodgingNightsRequiredNumber","missingRate","requireGolfItems","golfItemsRequiredNumber","iu","CancelPending","CancelComplete","dateA","dateB","ad","adjustment","AdjustmentTab","allowPromoCodeUse","InputGroup","Prepend","borderTopRightRadius","borderBottomRightRadius","span","offset","Totals","reload","displayPaymentModalForCustomer","_quote","localStorage","paymentId","ccExpiration","ccNumber","paymentType","Carousel","activeIndex","onSelect","selectedIndex","indicators","image","Item","imageUrl","Caption","UseGetCustomVendors","VendorCard","onSelectedVendor","priceSubText","lodging","golf","transport","custom","setErrorsImg","MAX_VALUE","fromPrice","setFromPrice","dict","messages","getUnavailableMessages","simpleView","vendorCardText","position","bulletPoint1","bulletPoint2","bulletPoint3","boxShadow","CustomDetails","onSelectedVendorUnit","isEditing","latlang","setLatLang","geoLocation","setGeoLocation","unitRateAverage","setUnitRateAverage","setIndex","handleSelect","onUnitsInputChanged","onStartDateChanged","onEndDateChanged","addClick","lat","results","geometry","lng","geolocationString","unitId","navLinkStyles","Tab","Container","Nav","Link","Content","Pane","amenities","amenityName","_unitId","SwitchToggle","isChecked","setIsChecked","newValue","htmlFor","AddModalSortBy","modalTitle","setSimpleView","showLodging","filterLodging","lodgingType","filterPricing","pricingType","filterCities","cityOptions","AddCustomModal","onSelectedCustom","unitToEdit","unitToEditState","setUnitToEdit","customVendors","setCustomVendors","priceFilter","setPriceFilter","cityFilter","setCityFilter","getCustomVendorsRequest","setGetCustomVendorsRequest","responseGetCustomVendors","setCityOptions","fromDateString","vendorGuidType","responseData","vendors","dr","dRate","uRate","pRate","cities","showOnCustomerPortal","sortedBy","UseGetGolfVendors","GolfDetails","setVendor","scorecardImg","img","imageType","selectedProductRate","getGolfVendorsRequest","setGetGolfVendorsRequest","responseGetGolfVendors","playerCount","startingIndex","displayVendorPriceOverride","paddingTop","AddGolfModal","onSelectedGolf","golfVendors","setGolfVendors","UseGetLodgingVendors","LodgingDetail","checkInDateChanged","checkOutDateChanged","useLocalRates","ratesForNights","toMonth","AddLodgingModal","onSelectedLodging","lodgingVendors","setLodgingVendors","lodgingFilter","setLodgingFilter","getLodgingVendorsRequest","setGetLodgingVendorsRequest","responseGetLodgingVendors","features","filterTags","lodgingTypeCardText","UseGetTransportVendors","TransportationDetails","vendorUnitIds","setVendorUnitIds","AddTransportationModal","onSelectedTransportation","transportVendors","setTransportVendors","getTransportVendorsRequest","setGetTransportVendorsRequest","getTransportVendorsResponse","setLocale","mixed","FindReservationSchema","ensure","FindReservationSchemaDefaultValues","FindReservation","handleSearchRequest","textAlign","UseGetPreBuiltPackages","PackagesCard","onSelectedPackage","stacked","packageImageUrl","packageName","bullet1","bullet2","bullet3","borderWidth","PackageDetails","preBuiltPkgVendors","pv","vendorType","PackageVendorCard","AddPreBuiltPackageModal","packages","setPackages","selectedPackage","setSelectedPackage","getPackagesRequest","setGetPackagesRequest","responseGetPackages","UseGetPackages","toLocaleDateString","displayOrder","pkg","useSearchQuote","UseGetVendorTypeByGuid","PackageDetailsModal","travelDaysAllow","travelDaysAllowed","daysFromStartingDate","validToTravelFrom","UseGetQuickPackages","useGetPackageById","packageId","MenuItemButton","menuItemName","MobileHamburgerMenu","setShowForm","showForm","isOpen","setIsOpen","clickedMenuItem","menuItem","opacity","visibility","Widget","packageParam","setFromEmail","setStartWidget","getWidgetRequest","setGetWidgetRequest","responseGetWidget","UseGetStartWidget","setStyle","getStyleRequest","setGetStyleRequest","responseGetStyle","getVendorTypeByGuidRequest","setGetVendorTypeByGuidRequest","responseGetVendorType","setVendorGuidType","setBrands","setBrandId","setCompanyId","setBrandSettings","getBrandsRequest","setGetBrandsRequest","responseGetBrands","UseGetBrands","setBrand","validated","quoteSearchRequest","setQuoteSearchRequest","quoteSearchResponse","setEmailCustomer","lodgingItemToEdit","setLodgingItemToEdit","golfItemToEdit","setGolfItemToEdit","transportItemToEdit","setTransportItemToEdit","customItemToEdit","setCustomItemToEdit","threeDaysFromStart","getQuickPackagesRequest","setGetQuickPackagesRequest","responseGetQuickPackages","getPackageParamRequest","setGetPackageParamRequest","getPackageByIdResponse","UseGetPackageById","setPackageFromParam","importedPackage","setImportedPackage","addSelectedLodging","lodgingItinerary","fees","itineraryUnit","max","profit","tax2","resortFee","overrideRate","liveRate","addSelectedGolf","golfItinerary","timeIndex","toGuests","initialize","gaOptions","cookieFlags","widgetStyle","settings","brandsSettings","widgetBrands","setting","calculateRateRequest","setCalculateRateRequest","calculateRateResponse","loadingPackage","setLoadingPackage","vendorIds","query","params","encodeURIComponent","ObjToQueryString","populateFromImportedPackage","pbVendor","preBuiltPkgVendorUnits","pbUnit","vendorUnit","outerRate","selection","formKey","setFormKey","viewPackageDetails","setViewPackageDetails","package","Provider","button","sameDayReplays","FindReservationModal","transportItinerary","addSelectedTransportation","customItinerary","customItemType","addSelectedCustom","useGetVendorConfirmationReservation","useUpdateItineraryUnitConfirmationNumber","command","VendorConfirmation","queryString","urlParams","URLSearchParams","get","vendorParam","vendorReservation","setVendorReservation","vendorReservationRequest","setVendorReservationRequest","vendorConfirmationResponse","lodgingUnits","setLodgingUnits","golfUnits","setGolfUnits","transportUnits","setTransportUnits","customUnits","setCustomUnits","setVendorName","setObj","startDateChanged","endDateChanged","startTimeChanged","endTimeChanged","unitsChanged","itineraryType","populateStartTimes","net","playDateChanged","teeTimeChanged","aria-label","golfConfirmedTimeChanged","productType","productRateTypeId","StartWidget","idParam","reservationParam","customerParam","campaignIdParam","setItem","getItem","MainContent","autoClose","closeOnClick","pauseOnHover","draggable","transition","Zoom","App","exact","path","component","Boolean","hostname","ReactDOM","render","navigator","serviceWorker","ready","registration","unregister"],"mappings":";idAAaA,EAAb,iGAUE,WACE,IAAMC,EAAWC,OAAOD,SAExB,OAAIA,EAASE,KAAKC,SAAS,aAClB,wBAEAH,EAASE,KAAKC,SAAS,OACvB,gCAEAH,EAASE,KAAKC,SAAS,WACvB,oCAEA,gCAtBb,KAAaJ,EACJK,OAASL,EAAUM,eADfN,EAMJO,aAAe,IAAIC,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,SAAS+6C,UAEe,UAA7B96C,OAAOD,SAAS+6C,UAEhB96C,OAAOD,SAAS+6C,SAAS5kC,MACvB,2DCXN6kC,IAASC,OAAO,kBAAC,GAAD,MAASppB,SAASC,eAAe,SDkI3C,kBAAmBopB,WACrBA,UAAUC,cAAcC,MAAMtvB,MAAK,SAAAuvB,GACjCA,EAAaC,iB","file":"static/js/main.070f672a.chunk.js","sourcesContent":["export class Constants {\n static apiUrl = Constants.getApiString();\n // static apiUrl = \"localhost:5001\";\n // static apiUrl = \"http://localhost:5000\";\n // static apiUrl = \"https://admin.pkgloop.com\";\n // static setApiString = Constants.getApiString();\n static startingDate = new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 14));\n static threeDaysFromStartingDate = new Date(Constants.startingDate.getTime() + (1000 * 60 * 60 * 24 * 3));\n static version: string = \"v1\";\n\n static getApiString(): string {\n const location = window.location;\n\n if (location.href.includes(\"localhost\")) {\n return \"http://localhost:5000\";\n }\n else if (location.href.includes(\"dev\")) {\n return \"https://admin-dev.pkgloop.com\";\n }\n else if (location.href.includes(\"staging\")) {\n return \"https://admin-staging.pkgloop.com\";\n } else {\n return \"https://admin.pkgloop.com\";\n }\n }\n\n // static getApiString(): Promise {\n // // console.log(\"in get api url\");\n // return fetch(\"/api/env\")\n // .then(res => {\n // const t = res.json();\n // // console.log(\"resjson\", t);\n // return t;\n // })\n // .then(res => {\n // // console.log(\"res\", res);\n // // console.log(\"res\", res);\n // // console.log(\"res[Object.keys(res)[0]]\", res[Object.keys(res)[0]]);\n // return Constants.apiUrl = res[Object.keys(res)[0]];\n // });\n // };\n}","import React from \"react\";\nimport { DatesAndGuests } from \"../components/common/start-widget/widget-form/WidgetForm\";\nimport Quote from \"../Data/Quote/Quote\";\nimport StartWidget, { StartWidgetDefaults } from \"../Data/StartWidget\";\nimport WidgetStyle, { WidgetStyleDefaults } from \"../Data/WidgetStyle\";\nimport { Constants } from \"../_helpers/Constants\";\nimport StartWidgetBrandSetting from \"../Data/StartWidgetBrandSetting\";\nimport StartWidgetBrand from \"../Data/StartWidgetBrand\";\n\ninterface ContextProps {\n companyId: number | undefined;\n // brandId: number | undefined;\n brandSettings: StartWidgetBrandSetting[];\n startWidget: StartWidget;\n style: WidgetStyle;\n datesAndGuests: DatesAndGuests;\n fromEmail: boolean;\n viewPortWidth: number;\n viewPortHeight: number;\n viewPortBreakPoint: number;\n autoScroll: boolean;\n vendorGuid: string | undefined;\n campaignId: string | undefined;\n brand: StartWidgetBrand | undefined;\n}\n\nexport const WidgetContext = React.createContext({\n companyId: undefined,\n // brandId: undefined,\n brandSettings: [],\n startWidget: StartWidgetDefaults,\n style: WidgetStyleDefaults,\n datesAndGuests: {\n fromDate: Constants.startingDate,\n toDate: Constants.threeDaysFromStartingDate,\n guests: 2,\n units: 1\n },\n fromEmail: false,\n viewPortWidth: 0,\n viewPortHeight: 0,\n viewPortBreakPoint: 0,\n brand: undefined,\n autoScroll: true,\n vendorGuid: undefined,\n campaignId: undefined\n});","enum ViewPort {\n xs = 0,\n sm = 576,\n md = 768,\n lg = 992,\n xl = 1200,\n}\n\nexport default ViewPort;","export default class StartWidget {\n startWidgetId!: number;\n brandId!: number;\n active!: boolean;\n // Button Display Options\n showLodgingButton!: boolean;\n showGolfButton!: boolean;\n showTransportationButton!: boolean;\n showExtrasButton!: boolean;\n showBookNowButton!: boolean;\n showSaveQuoteButton!: boolean;\n showQuickPackages!: boolean;\n // Itinerary Display Options\n showLodgingModule!: boolean;\n showGolfModule!: boolean;\n showTransportationModule!: boolean;\n showCustomItemsModule!: boolean;\n // Pricing Options\n showPerPersonPricing!: boolean;\n showTaxesTotal!: boolean;\n showGrandTotal!: boolean;\n showResortFeeTotal!: boolean;\n showCleaningFeeTotal!: boolean;\n showPromoCodeTotal!: boolean;\n // Vendor Rate Display Options In Cart\n showLodgingPricing!: boolean;\n showGolfPricing!: boolean;\n showTransportationPricing!: boolean;\n showCustomItemsPricing!: boolean;\n // Customer Requirements\n requireFirstLastName!: boolean;\n requireEmailAddress!: boolean;\n requirePhoneNumber!: boolean;\n requireAddress!: boolean;\n\n //Google Analytics\n activateGoogleAnalytics!: boolean;\n googleAnalyticsTrackingCode!: string;\n\n // this is not used currently\n googleTagImplementationCode!: string; // this is not used currently\n // Terms And Conditions\n requireTermsAndConditions!: boolean;\n}\n\nexport const StartWidgetDefaults: StartWidget = {\n startWidgetId: 0,\n brandId: 0,\n active: false,\n //!Button Display Options\n showLodgingButton: false,\n showGolfButton: false,\n showTransportationButton: false,\n showExtrasButton: false,\n showBookNowButton: false,\n showSaveQuoteButton: false,\n showQuickPackages: false,\n //!Itinerary Display Options\n showLodgingModule: false,\n showGolfModule: false,\n showTransportationModule: false,\n showCustomItemsModule: false,\n //!Pricing Options\n showPerPersonPricing: false,\n showTaxesTotal: false,\n showGrandTotal: false,\n showResortFeeTotal: false,\n showCleaningFeeTotal: false,\n showPromoCodeTotal: false,\n //!Vendor Rate Display Options In Cart\n showLodgingPricing: false,\n showGolfPricing: false,\n showTransportationPricing: false,\n showCustomItemsPricing: false,\n //!Customer Requirements\n requireFirstLastName: false,\n requireEmailAddress: false,\n requirePhoneNumber: false,\n requireAddress: false,\n //!Google Analytics\n activateGoogleAnalytics: false,\n googleAnalyticsTrackingCode: \"\",\n googleTagImplementationCode: \"\",\n //!Terms And Conditions\n requireTermsAndConditions: false\n}","export default class WidgetStyle {\n id!: number;\n startWidgetId!: number;\n buttonColor!: string;\n fontColor!: string;\n headerColor!: string;\n linkColor!: string;\n borderColor!: string;\n itineraryButtonColor!: string;\n bookNowButtonColor!: string;\n getQuoteButtonColor!: string;\n brandLogo!: string;\n}\n\nexport const WidgetStyleDefaults: WidgetStyle = {\n id: 0,\n startWidgetId: 0,\n buttonColor: \"\",\n fontColor: \"\",\n headerColor: \"\",\n linkColor: \"\",\n borderColor: \"\",\n itineraryButtonColor: \"\",\n bookNowButtonColor: \"\",\n getQuoteButtonColor: \"\",\n brandLogo: \"\"\n}","export enum EnumQuoteLeadSource { OnlineQuote = 10, OnlineGroupQuote = 20, OnlineForm = 30 };","import React, { useEffect } from \"react\";\nimport DayPicker from \"react-day-picker\";\nimport \"react-day-picker/lib/style.css\";\n\nexport const MobileDayPickerOverlay: React.FC = (props: any) => {\n const { classNames, children } = props;\n // console.log(\"children\", children);\n\n // function renderDay(day: any) {\n // const date = day.getDate();\n // return (\n //
\n //
{date}
\n //
\n // );\n // }\n\n// const bgCatch = `\n// .DayPickerInput-OverlayWrapper::before {\n// content: \"\";\n// width: 100vw;\n// height: 100vh;\n// display: block;\n// }`;\n\n return (\n \n {/* */}\n \n \n {children}\n {/* */}\n \n \n \n );\n}","import React from \"react\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\n\nconst CustomDayPickerInput = (props: any) => {\n const {inputProps} = props;\n // this background color matches the disabled color of all other inputs\n const newBackgroundColor = inputProps.disabled ? '#e9ecef' : '';\n\n return (\n \n );\n}\n\nexport default CustomDayPickerInput;","import \"../widget-form/widget-form.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { SetStateAction, useContext, useEffect, useState } from \"react\";\nimport { Row, Form, Button, Modal, Col, FormControl } from \"react-bootstrap\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { Modifier } from \"react-day-picker\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport { WidgetContext } from \"../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../_helpers/Enums/ViewPortEnum\";\nimport { MobileDayPickerOverlay } from \"../assets/MobileDayPickerOverlay\";\nimport moment from \"moment\";\nimport CustomDayPickerInput from \"../../customDayPickerInput/CustomDayPickerInput\";\n\nexport interface DatesAndGuests {\n fromDate: Date;\n toDate: Date;\n fromTime?: string;\n toTime?: string;\n guests: number;\n units: number;\n}\n\ninterface props {\n brands: any[];\n datesAndGuestsState: [DatesAndGuests, React.Dispatch>];\n onSetValidation: React.Dispatch>;\n onSetBrandId: React.Dispatch>;\n onWidgetButtonPressed: (button: string) => void;\n itineraryNotEmpty: boolean;\n}\n\nconst WidgetForm: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint, /* brandId */brand, vendorGuid } = useContext(WidgetContext);\n\n const {\n brands,\n itineraryNotEmpty,\n onWidgetButtonPressed,\n onSetValidation,\n onSetBrandId,\n } = props;\n\n const { formatDate, parseDate } = reactMoment;\n const [datesAndGuests, setDatesAndGuests] = props.datesAndGuestsState;\n // const [brandId, setBrandId] = useState(brands.length > 0 ? brands[0].brandId : undefined);\n // useEffect(() => {\n // console.log(\"brandId\", brandId);\n // }, [brandId]);\n\n const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n const [errors, setErrors] = useState([]);\n\n const onBrandIdChanged = (event: any) => {\n // if (+event.target.value > 0)\n // setBrandId(+event.target.value);\n console.log(\"brandId chnged\", event.target.value);\n onSetBrandId(+event.target.value);\n }\n\n const onGuestsInputChanged = (event: any) => {\n datesAndGuests.guests = +event.target.value;\n setDatesAndGuests({ ...datesAndGuests });\n }\n\n const onSubmit = (event: any) => {\n const dateErrors = getDateErrors();\n const brandErrors = getBrandErrors();\n setErrors([...dateErrors, ...brandErrors]);\n event.preventDefault();\n }\n\n function getDateErrors() {\n const errs: any[] = [];\n if (datesAndGuests.fromDate == undefined) {\n errs.push({\n id: \"fromDate\",\n message: \"Invalid date\"\n });\n }\n if (datesAndGuests.toDate == undefined) {\n errs.push({\n id: \"toDate\",\n message: \"Invalid date\"\n });\n }\n\n return errs;\n }\n\n function getBrandErrors() {\n const errs: any[] = [];\n\n // if (brandId == undefined) {\n // errs.push({\n // id: \"brandId\",\n // message: \"Required\"\n // });\n // }\n if (brand === undefined) {\n errs.push({\n id: \"brandId\",\n message: \"Required\"\n });\n }\n\n return errs;\n }\n\n useEffect(() => {\n setErrors(getDateErrors());\n }, [datesAndGuests]);\n\n useEffect(() => {\n if (errors.length > 0)\n onWidgetButtonPressed(\"\");\n onSetValidation(errors.length == 0);\n }, [errors]);\n\n useEffect(() => {\n if (brand === undefined) return;\n\n const brandIndex = errors.findIndex(e => e.id == \"brandId\");\n if (brandIndex > -1)\n setErrors(errors.filter(e => e.id != \"brandId\"));\n\n if (onSetBrandId) onSetBrandId(brand?.brandId);\n }, [brand]);\n\n return (\n \n
\n {/* Desktop */}\n
\n \n {/* DESTINATION SELECT */}\n
\n \n Destination{errors.length > 0 && errors.find(e => e.id == \"brandId\") && (\n {errors.find(e => e.id == \"brandId\").message}\n )}\n \n 1 ? undefined : brandId)}`}\n value={`${brand?.brandId}`}\n onChange={onBrandIdChanged}\n readOnly={itineraryNotEmpty}\n disabled={itineraryNotEmpty}\n >\n {brands.length > 1 && (\n \n )}\n {/* */}\n {brands.sort((a: any, b: any) => {\n if (a.webOrder < b.webOrder) return -1;\n if (a.webOrder > b.webOrder) return 1;\n return 0\n })\n .map((brand: any, index: number) => (\n \n ))}\n \n
\n\n {/* DAY PICKERS */}\n
\n \n \n Arrive{errors.length > 0 && errors.find(e => e.id == \"fromDate\") && (\n {errors.find(e => e.id == \"fromDate\").message}\n )}\n \n {\n datesAndGuests.fromDate = date;\n if (datesAndGuests.toDate && date > datesAndGuests.toDate) {\n datesAndGuests.toDate = date;\n }\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n
\n\n
\n \n \n Depart{errors.length > 0 && errors.find(e => e.id == \"toDate\") && (\n {errors.find(e => e.id == \"toDate\").message}\n )}\n \n\n {\n datesAndGuests.toDate = date;\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n
\n\n {/* GUEST SELECT */}\n
\n \n Guests\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n\n {/* \n {startWidget.showLodgingButton && (\n onWidgetButtonPressed(\"add-lodging\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Lodging\n \n )}\n {startWidget.showGolfButton && (\n onWidgetButtonPressed(\"add-golf\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Golf\n \n )}\n {startWidget.showTransportationButton && (\n onWidgetButtonPressed(\"add-transportation\")}\n style={{\n fontSize: \"14.75px\",\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Transport\n \n )}\n {startWidget.showExtrasButton && (\n onWidgetButtonPressed(\"add-custom\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Extras\n \n )}\n */}\n
\n\n {/* Mobile */}\n \n
\n \n {/* \n \n Destination:\n \n */}\n \n \n {brands.length > 1 && (\n \n )}\n {brands.map((brand: any, index: number) => (\n \n ))}\n \n {errors.length > 0 && errors.find(e => e.id == \"brandId\") && (\n {errors.find(e => e.id == \"brandId\").message}\n )}\n \n \n \n {/* \n \n Arrive:\n \n */}\n \n {\n datesAndGuests.fromDate = date;\n if (datesAndGuests.toDate && date > datesAndGuests.toDate) {\n datesAndGuests.toDate = date;\n }\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n {errors.length > 0 && errors.find(e => e.id == \"fromDate\") && (\n
\n {errors.find(e => e.id == \"fromDate\").message}\n
\n )}\n\n \n
\n \n \n {\n datesAndGuests.toDate = date;\n if (datesAndGuests.fromDate && date < datesAndGuests.fromDate) {\n datesAndGuests.fromDate = date;\n }\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n {errors.length > 0 && errors.find(e => e.id == \"toDate\") && (\n
\n {errors.find(e => e.id == \"toDate\").message}\n
\n )}\n\n \n
\n\n {/* GUEST/CHILD SELECT */}\n \n {/* \n \n Guests:\n \n */}\n \n \n {\n onGuestsInputChanged(e);\n }}\n defaultValue={\"2\"}\n >\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {false && (\n \n \n Child:\n \n { }} defaultValue={\"0\"}>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )}\n \n \n
\n\n {/*
\n {startWidget.showLodgingButton && (\n onWidgetButtonPressed(\"add-lodging\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n }}\n >\n + Lodging\n \n )}\n {startWidget.showGolfButton && (\n onWidgetButtonPressed(\"add-golf\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n }}\n >\n + Golf\n \n )}\n {startWidget.showTransportationButton && (\n onWidgetButtonPressed(\"add-transportation\")}\n style={{\n fontSize: \"16.75px\",\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n }}\n >\n + Transport\n \n )}\n {startWidget.showExtrasButton && (\n onWidgetButtonPressed(\"add-custom\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n }}\n >\n + Extras\n \n )}\n
*/}\n \n
\n
\n );\n}\n\nexport default WidgetForm;\n","import { useState, useEffect, useRef } from \"react\";\nimport { toast } from \"react-toastify\";\nimport { useAuthStateValue } from \"../Auth/AuthState\";\n\nexport type FetchRequest = {\n url: string,\n method: string,\n body?: any,\n isFormData?: boolean\n}\n\nconst useFetch = (request?: FetchRequest, cancel?: boolean) => {\n const cancelRequest = useRef(false);\n\n const [responseStatusCode, setResponseStatusCode] = useState();\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n const [requestUrl, setRequestUrl] = useState(\"\");\n\n useEffect(() => {\n const abortController = new AbortController();\n\n cancelRequest.current = false;\n\n if (cancel && cancel === true) {\n\n cancelRequest.current = true;\n abortController.abort();\n }\n else {\n if (request) {\n\n const { url, method, body, isFormData } = request;\n setRequestUrl(url);\n\n let bodyData: any = null;\n\n // Set header\n let hdr: any = {\n 'Authorization': {} ? `Bearer {}` : '',\n 'Access-Control-Allow-Origin': 'https://admin-dev.pkgloop.com/'\n };\n if (isFormData && isFormData === true) {\n // Note: Header contentType should be left blank for multipart/form-data as it provides its own\n bodyData = body;\n }\n else {\n hdr = {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin': 'https://admin-dev.pkgloop.com/',\n 'Referrer-Policy': 'strict-origin-when-cross-origin'\n };\n bodyData = JSON.stringify(body);\n }\n\n const fetchData = async () => {\n\n setIsLoading(true);\n\n try {\n const result = await fetch(url, {\n method: method,\n headers: hdr,\n body: bodyData,\n signal: abortController.signal\n });\n\n setResponseStatusCode(result.status);\n\n if (result.ok) {\n\n if (cancelRequest.current === false && !abortController.signal.aborted) {\n const json = await result.json();\n setData(json);\n setError(null);\n }\n\n }\n else {\n const json = await result.json();\n setError(json);\n\n if (result.status === 400 && (!!json.errors || json.message)) {\n // Validation error.\n let errorText: string = `Please check the form for errors.`;\n toast.error(errorText, { hideProgressBar: true });\n } else if (result.status === 401) {\n // Authentication error.\n let errorText: string = `Unauthenticated. Please re-login.`;\n toast.error(errorText, { hideProgressBar: true });\n } else if (result.status === 403) {\n // Authorization error.\n let errorText: string = `Unauthorized.`;\n toast.error(errorText, { hideProgressBar: true });\n } else {\n let errorText: string = `Internal Error: ${result.status}`;\n toast.error(errorText, { hideProgressBar: true });\n }\n }\n\n } catch (error) {\n if (!abortController.signal.aborted) {\n setIsLoading(false);\n }\n\n } finally {\n if (!abortController.signal.aborted) {\n setIsLoading(false);\n }\n\n //cancelRequest.current = true;\n }\n\n };\n\n fetchData();\n }\n\n }\n\n return () => {\n\n cancelRequest.current = true;\n abortController.abort();\n };\n\n }, [request]);\n\n return ({ responseStatusCode, data, error, isLoading });\n}\n\nexport default useFetch;\n\n\n// export type FetchOptions = {\n// method?: \"GET\" | \"POST\" | \"DELETE\" | \"PATCH\" | \"PUT\" | \"HEAD\" | \"OPTIONS\" | \"CONNECT\";\n// headers?: any;\n// body?: any;\n// mode?: \"cors\" | \"no-cors\" | \"same-origin\";\n// credentials?: \"omit\" | \"same-origin\" | \"include\";\n// cache?: \"default\" | \"no-store\" | \"reload\" | \"no-cache\" | \"force-cache\" | \"only-if-cached\";\n// redirect?: \"follow\" | \"error\" | \"manual\";\n// referrer?: string;\n// referrerPolicy?: \"referrer\" | \"no-referrer-when-downgrade\" | \"origin\" | \"origin-when-cross-origin\" | \"unsafe-url\";\n// integrity?: any;\n// signal?: any;\n// }\n\n// type FetchProps = {\n// url: string,\n// options?: any\n// }\n","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport Reservation from \"../../../../../Data/Reservation/Reservation\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport Quote from \"../../../../../Data/Quote/Quote\";\n\nconst useCreateQuote = (request?: CreateQuoteRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest); // Fetch Data Custom Hook\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n const url: string = `${apiString}/api/v1.0/customer-portal/request-quote/create`;\n \n setFetchRequest({\n url: url,\n method: 'POST',\n body: request\n // body: undefined\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: any = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\");\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useCreateQuote;\n\nexport interface CreateQuoteResponse extends FetchResponse {\n quote: Quote;\n}\n\nexport interface CreateQuoteRequest extends Quote {}","import * as yup from \"yup\";\n\n// Yup schema for field validations\nconst TravelerSchema = yup.object().shape({\n firstName: yup.string().required(\"Field is required\"),\n lastName: yup.string().required(\"Field is required\"),\n email: yup.string().required(\"Field is required\"),\n});\n\nconst phoneRegex = /^[0-9\\- ]{8,15}$/;\n\nexport const RequestQuoteSchema = yup.object().shape({\n firstName: yup.string().required(\"Field is required\"),\n lastName: yup.string().required(\"Field is required\"),\n email: yup.string().email(\"Must be in the format of an email\").required(\"Field is required\"),\n phone: yup.string().matches(phoneRegex, 'Phone number is not valid').required(\"Field is required\"),\n // phone: yup.string().required(\"Field is required\"),\n groupName: yup.string().transform(value => (value.length == 0 ? undefined : value)),\n comments: yup.string(),\n // numGuests: yup.number().notRequired(),\n numGuests: yup.number().required(\"Required\"),\n travelers: yup.array().of(TravelerSchema)\n});\n\nexport type RequestQuoteFormData = yup.InferType;\n\nexport const RequestQuoteSchemaDefaultValues: RequestQuoteFormData = {\n firstName: \"\",\n lastName: \"\",\n email: \"\",\n phone: \"\",\n groupName: \"\",\n comments: \"\",\n numGuests: 2,\n travelers: []\n};\n","import \"react-datepicker/dist/react-datepicker.css\";\n\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Form, Button, Modal, Spinner } from \"react-bootstrap\";\nimport { DatesAndGuests } from \"../../widget-form/WidgetForm\";\nimport momentjs from \"react-day-picker/moment\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport { WidgetContext } from \"../../../../../context/WidgetContext\";\nimport { Modifier } from \"react-day-picker\";\nimport useCreateQuote, { CreateQuoteRequest } from \"../data-service-hooks/UseCreateQuote\";\nimport Quote from \"../../../../../Data/Quote/Quote\";\nimport Customer from \"../../../../../Data/Customer/Customer\";\nimport { yupResolver } from \"@hookform/resolvers\";\nimport { useForm } from \"react-hook-form\";\nimport { RequestQuoteFormData, RequestQuoteSchema, RequestQuoteSchemaDefaultValues } from \"./schemas/RequestQuoteSchema\";\nimport { RBRef } from \"../../../../../_helpers/Types\";\nimport { ReservationCustomer } from \"../../../../../Data/Reservation/ReservationCustomer\";\nimport moment from \"moment\";\nimport ViewPort from \"../../../../../_helpers/Enums/ViewPortEnum\";\nimport { toast } from \"react-toastify\";\nimport CustomDayPickerInput from \"../../../customDayPickerInput/CustomDayPickerInput\";\nimport { EnumQuoteLeadSource } from \"../../../../../_helpers/Enums/EnumQuoteLeadSource\";\nimport * as yup from \"yup\";\n// import DatePicker from \"react-datepicker\";\n\ninterface props {\n show: boolean;\n onHide: () => void;\n datesAndGuests: DatesAndGuests;\n isGroup?: boolean;\n\n}\n\n// pull this out of the component since it never needs to be recalculated on re-render\nconst extendedSchema = yup.object().shape({\n ...RequestQuoteSchema.fields,\n needLodging: yup.string().required(\"You must select one lodging choice\").oneOf([\"Hotel\", \"Condo\", \"Private Home\", \"No Lodging\"], \"Must select one lodging choice\")\n});\n\ntype RequestQuoteExtendedFormData = yup.InferType\n\nconst RequestQuoteModal: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint, companyId, /* brandId */brand } = useContext(WidgetContext);\n\n const { show, onHide, isGroup } = props;\n const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const { formatDate, parseDate } = momentjs;\n const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n\n const [createRequest, setCreateRequest] = useState();\n const createResponse = useCreateQuote(createRequest);\n\n // const [validated, setValidated] = useState(false);\n const { register, handleSubmit, errors, formState, setValue, reset, getValues } = useForm({\n mode: \"onSubmit\",\n resolver: yupResolver(extendedSchema),\n defaultValues: {...RequestQuoteSchemaDefaultValues, needLodging: \"\"}\n });\n\n const submit = (formData: RequestQuoteExtendedFormData) => {\n const customer: ReservationCustomer = {\n reservationId: 0,\n customerId: 0,\n customer: {\n companyId: companyId as number,\n customerId: 0,\n isActive: true,\n firstName: formData.firstName,\n lastName: formData.lastName,\n emailAddress: formData.email,\n streetAddress: \"\",\n city: \"\",\n state: \"\",\n country: \"\",\n zipCode: \"\",\n phone1: formData.phone,\n customerNotes: formData.comments + \"\\n Customer Lodging Preference: \" + formData.needLodging,\n },\n paymentAllocationCategoryId: undefined,\n paymentAllocationCategory: undefined,\n cancelled: false\n };\n\n const quote: Quote = {\n reservation: {\n companyId: companyId as number,\n brandId: brand?.brandId,\n leadCustomer: undefined,\n itineraryNumber: \"\",\n lodgingItineraries: [],\n golfItineraries: [],\n transportItineraries: [],\n customItineraries: [],\n numGuests: datesAndGuests.guests,\n numChildren: 0,\n totalSell: 0.0,\n totalCost: 0.0,\n balanceDue: 0.0,\n arrive: moment(datesAndGuests.fromDate).format(\"YYYY-MM-DD\"),\n depart: moment(datesAndGuests.toDate).format(\"YYYY-MM-DD\"),\n tax: 0.0,\n resortFees: 0.0,\n cleaningFee: 0.0,\n groupName: !!!formData.groupName ? undefined : {\n companyId: companyId as number,\n name: formData.groupName\n },\n isPreBuiltPkg: false,\n reservationCustomers: [customer]\n },\n requestNote: formData.comments + \"\\n Customer Lodging Preference: \" + formData.needLodging,\n quoteLeadSourceId: isGroup ? EnumQuoteLeadSource.OnlineGroupQuote : EnumQuoteLeadSource.OnlineQuote,\n };\n\n setCreateRequest(quote);\n }\n\n useEffect(() => {\n if (createResponse.data) {\n // console.log(\"CREATE RESPONSE\", createResponse.data);\n onHide();\n // alert(\"A reservation agent will get in touch with you\");\n toast.success(\"A reservation agent will get in touch with you\", { hideProgressBar: false });\n }\n }, [createResponse.data]);\n\n useEffect(() => {\n if (createResponse.error) {\n console.log(\"request quote error\", createResponse.error);\n onHide();\n // alert(\"Error requesting a quote\");\n toast.error(\"Error requesting a quote\", { hideProgressBar: false });\n }\n }, [createResponse.error]);\n\n return (\n \n \n \n
\n Request Quote\n
\n
\n \n \n \n {/* Header */}\n
\n
\n
\n \n \n \n Step 1: Input contact info for your custom quote.\n

\n \n
\n {/* Contact Info */}\n \n \n {/* \n First Name\n */}\n \n\n \n {errors.firstName && errors.firstName.message}\n \n \n \n {/* \n Last Name\n */}\n \n\n \n {errors.lastName && errors.lastName.message}\n \n \n \n \n \n {/* \n Email Address\n */}\n \n\n \n {errors.email && errors.email.message}\n \n \n \n {/* \n Contact Phone\n */}\n \n\n \n {errors.phone && errors.phone.message}\n \n \n \n\n {isGroup && (\n \n \n {/* \n Group Name\n */}\n \n\n {/* \n {errors.groupName && errors.firstName.message}\n */}\n \n \n )}\n
\n\n {/* Step 2 */}\n \n \n \n Step 2: What dates do you plan to arrive/depart, and how many people are with you?\n

\n \n
\n\n {/* Dates */}\n \n {/* DAY PICKERS */}\n {/*
*/}\n \n {/* \n Arrive\n */}\n this.to.getInput().focus(),\n }}\n onDayChange={(date: Date) => {\n datesAndGuests.fromDate = date;\n if (datesAndGuests.toDate && date > datesAndGuests.toDate) {\n datesAndGuests.toDate = date;\n }\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n {/*
*/}\n\n {/*
*/}\n \n {/* \n Depart\n */}\n {\n datesAndGuests.toDate = date;\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n {/*
*/}\n
\n\n \n \n {/* */}\n {\n datesAndGuests.guests = parseInt(e.target.value);\n setDatesAndGuests({ ...datesAndGuests });\n }}\n onBlur={(e: any) => {}}\n />\n \n {errors.numGuests && errors.numGuests.message}\n \n \n \n {/* */}\n \n \n \n \n \n \n \n \n {errors.needLodging && errors.needLodging.message}\n \n \n \n\n {/* Step 3 */}\n \n \n \n Step 3: Let us know in detail below what you are looking for in this quote, and if you have any specific requests, or properties to include.\n

\n \n
\n \n \n \n\n {/* \n {errors.comments && errors.firstName.message}\n */}\n \n \n \n \n {createResponse.isLoading && (\n \n )}\n {createResponse.isLoading ? \"Saving...\" : \"Save & Get Quote\"}\n \n \n \n
\n \n
\n
\n \n\n
\n );\n}\n\nexport default RequestQuoteModal;","enum EnumProductRateType {\n UseUnit = 10,\n UseTime = 20,\n StartTime = 30,\n DayRange = 40,\n HoursPerUnit = 50,\n UnitQtyRange = 60\n //UseUnit = \"UseUnit\",\n //UseTime = \"UseTime\",\n //StartTime = \"StartTime\",\n //DayRange = \"DayRange\",\n //HoursPerUnit = \"HoursPerUnit\",\n //UnitQtyRange = \"UnitQtyRange\" \n}\n\nexport default EnumProductRateType;","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport StartWidget from \"../../../../../Data/StartWidget\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\n\nconst useGetStartWidget = (request?: GetStartWidgetRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest); // Fetch Data Custom Hook\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/get/widget/${request.widgetId}`;\n // console.log(\"url\", url);\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n // console.log(\"response widget\");\n const response: StartWidget = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n // console.log(\"fetch error\");\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useGetStartWidget;\n\nexport interface GetStartWidgetResponse extends FetchResponse {\n startWidget: any;\n}\n\nexport interface GetStartWidgetRequest {\n widgetId: number;\n}","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport WidgetStyle from \"../../../../../Data/WidgetStyle\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\n\nconst UseGetWidgetStyle = (request?: GetStyleRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/get/style/${request.widgetId}`;\n // console.log(\"url\", url);\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetStyleResponse = fetchResponse.data;\n\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default UseGetWidgetStyle;\n\nexport interface GetStyleResponse extends FetchResponse {\n widgetStyle: WidgetStyle;\n}\n\nexport interface GetStyleRequest {\n widgetId: number;\n}","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport StartWidgetBrand from \"../../../../../Data/StartWidgetBrand\";\nimport StartWidgetBrandSetting from \"../../../../../Data/StartWidgetBrandSetting\";\n\nconst useGetBrand = (request?: GetBrandsRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/get/brands/` + request.widgetId;\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetBrandsResponse = fetchResponse.data;\n setData(response);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"brands fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useGetBrand;\n\nexport interface GetBrandsRequest {\n widgetId: number;\n}\n\nexport interface GetBrandsResponse extends FetchResponse {\n widgetBrands: StartWidgetBrand[];\n brandsSettings: StartWidgetBrandSetting[];\n}","import Vendor from \"./Vendor\";\nimport VendorUnitImage from \"./VendorUnitImage\";\n\nexport default class VendorUnit {\n vendorUnitId!: number;\n vendorId!: number;\n unitName!: string;\n unitDescription!: string;\n vendorUnitImages!: VendorUnitImage[];\n uniqueIdForSelection!: string;\n isLive!: boolean;\n sortOrder!: number;\n personPerUnit!: number;\n\n sell!: number;\n rates!: any[];\n published!: boolean;\n\n // unitType!: string;\n\n public constructor(init?: Partial) {\n Object.assign(this, init);\n }\n}","import Decimal from \"decimal.js\";\n\n/**\n * Truncate decimal number to 2 decimal places.\n */\nexport function decimalToFixed(num: Decimal) {\n const expression = new RegExp(\"(\\\\d+\\\\.\\\\d{2})(\\\\d)\");\n const match = num.toString().match(expression);\n if (match) {\n let truncated = match[1];\n if (num.lessThan(0)) {\n truncated = '-' + truncated; // Negate.\n }\n return new Decimal(truncated);\n }\n return num;\n};\n\n/**\n * Round up to 2 decimal places.\n * Used for when JS floating point math leaves trailing zeros.\n * Example: 0.2 + 0.4\n */\nexport function roundDecimal(num: Decimal) {\n let numForCeil = num.times(100);\n // Truncate any floating point trailing zeros. Covers JS floating point multiplication with decimals, such as (64.9 * 100).\n numForCeil = decimalToFixed(numForCeil);\n if (!(numForCeil.modulo(1).equals(0))) {\n // numForCeil is still a decimal, round up. Example: a rate of 59.5959 needs to be 59.60.\n return Decimal.ceil(numForCeil).dividedBy(100);\n } else {\n // Number is a whole or decimal with no trailing zeros.\n return num;\n }\n}\n\nexport function NormalizeCurrencyInput(value: string, negative: boolean = false) {\n let numbersOnly: string = value.replace(/[^0-9]/g, \"\");\n if (numbersOnly.length > 0) {\n if (numbersOnly.length < 3) {\n numbersOnly = numbersOnly.padStart(3, '0');\n }\n }\n else {\n return \"\";\n }\n let start: string = numbersOnly.slice(0, -2);\n let end: string = numbersOnly.slice(-2);\n\n let decimalNumber: string = start + \".\" + end;\n decimalNumber = decimalNumber.replace(/(^[0]+)([0-9][.][0-9]{2}$)/, \"$2\");\n\n return (negative ? '-' : '') + decimalNumber;\n}\n\nexport function isStringEmpty(str: string | undefined | null) {\n return str === \"\" || str == undefined || str === null;\n}\n\nexport function ObjToQueryString(params: any = {}): string {\n return Object.keys(params).filter((key) => params[key] !== null && ((typeof params[key] === 'string' && params[key].length > 0) || typeof params[key] === 'number' || typeof params[key] === 'boolean')).map((key) => {\n return encodeURIComponent(key) + '=' + encodeURIComponent(params[key])\n }).join('&');\n}","import moment from \"moment\";\nimport VendorUnit from \"../VendorUnit\";\nimport RatesByDate from \"./DateRate\";\nimport EnumProductRateType from \"./EnumProductRateType\";\nimport { isStringEmpty } from \"../../_helpers/Functions\";\n\nexport function getUnitRate(rates: RatesByDate[], unitName: string | null, numberUnits: number, getFirstIfNull = false) {\n const unitRates = rates.flatMap(a => a.unitRates).filter(b => b.vendorUnitDisplayName === unitName).flatMap(a => a.rates).filter(c => c.rateType == EnumProductRateType.UnitQtyRange);\n\n // Find rate matching the selected number of units.\n unitRates.sort((a, b) => {\n // Sort by desc start unit.\n return b.startUnitNumber - a.endUnitNumber\n });\n\n let unitRate = unitRates.find(r => r.startUnitNumber <= numberUnits // Minimum units.\n && (r.endUnitNumber >= numberUnits || r.endUnitNumber === 1)); // Max units or 1-to-1.\n\n if (!unitRate && getFirstIfNull) {\n unitRate = unitRates.length > 0 ? unitRates[0] : undefined;\n }\n\n return unitRate;\n}\n\nexport function getHourlyRate(rates: RatesByDate[], unitName: string | null, selectedStartTime: string | null, selectedEndTime: string | null, getFirstIfNull = false) {\n const hourlyRates = rates.flatMap(a => a.unitRates).filter(b => b.vendorUnitDisplayName === unitName).flatMap(a => a.rates).filter(c => c.rateType == EnumProductRateType.HoursPerUnit);\n\n\n // Find rate matching the selected number of hours.\n hourlyRates.sort((a, b) => {\n // Sort by desc start hour.\n return b.startHour - a.startHour\n });\n\n selectedStartTime = selectedStartTime !== null ? selectedStartTime : \"\";\n selectedEndTime = selectedEndTime !== null ? selectedEndTime : \"\";\n\n let numberOfHours: number = moment.duration(moment(selectedEndTime, 'HH:mm').diff(moment(selectedStartTime, 'HH:mm'))).asHours();\n\n if (numberOfHours < 0) {\n //only 0-24 hours\n numberOfHours = moment.duration(moment(selectedEndTime, 'HH:mm').add(1, \"day\").diff(moment(selectedStartTime, 'HH:mm'))).asHours();\n }\n\n let hourlyRate = hourlyRates.find(r => r.startHour <= numberOfHours // Minimum hours.\n && (r.endHour >= numberOfHours || r.endHour === 1)); // Max hours or 1-to-1.\n\n if (!hourlyRate && getFirstIfNull) {\n hourlyRate = hourlyRates.length > 0 ? hourlyRates[0] : undefined;\n }\n\n return hourlyRate;\n}\n\nexport function getDailyRate(rates: RatesByDate[], unitName: string | null, startDate: string | null, endDate: string | null, selectedStartTime: string | undefined, selectedEndTime: string | undefined, getFirstIfNull = false) {\n const dayRates = rates.filter(a => a.unitRates.findIndex(b => b.vendorUnitDisplayName === unitName && b.rates.findIndex(c => c.rateType == EnumProductRateType.DayRange || c.rateType == null) >= 0) >= 0);\n // console.log(\"day rates\", dayRates);\n\n // Each ProductRate is a date. Rate Days n-to-n is applied individually to each date, based on the amount of selected days.\n\n startDate = startDate !== null ? startDate : \"\";\n endDate = endDate !== null ? endDate : \"\";\n selectedStartTime = selectedStartTime !== null ? selectedStartTime : \"\";\n selectedEndTime = selectedEndTime !== null ? selectedEndTime : \"\";\n\n // Find rate matching selected days amount.\n const selectedStartDate = moment(startDate);\n const selectedEndDate = moment(endDate);\n\n let numberOfDays = moment.duration(selectedEndDate.diff(selectedStartDate)).asDays() + 1;\n const numberOfHours: number = moment.duration(moment(selectedEndTime, 'HH:mm').diff(moment(selectedStartTime, 'HH:mm'))).asHours();\n\n // console.log(\"num days\", numberOfDays);\n // console.log(\"num hours\", numberOfHours);\n\n let days: Date[] = [];\n let day = moment(startDate);\n const lastDate = moment(endDate);\n while (day.isSameOrBefore(lastDate)) {\n days.push(day.toDate());\n day = day.clone().add(1, 'day');\n }\n\n let ratesForDays = dayRates.filter((rate: any) => days.find(day => moment(day).isSame(moment(rate.date))));\n\n ratesForDays = ratesForDays.filter((rd: RatesByDate) => rd.unitRates.filter(ur => ur.rates.length).length);\n\n let ratesForNumberOfDays = [...ratesForDays];\n let poppedRateByDate: (RatesByDate | undefined) = undefined;\n if (numberOfHours <= 0) {\n numberOfDays -= 1; //full 0-24 hours = 1 day\n poppedRateByDate = ratesForNumberOfDays.pop(); //remove last day rate\n }\n\n if (getFirstIfNull && numberOfDays == 0) {\n numberOfDays = 1;\n if (poppedRateByDate) {\n ratesForNumberOfDays.push(poppedRateByDate);\n }\n }\n\n let noRateMessage = \"\";\n\n let productRates = ratesForNumberOfDays.map(rd => {\n // Select the UnitRate for the numberOfDays.\n\n const rateForNumberOfDays = rd.unitRates.filter(a => a.vendorUnitDisplayName === unitName).flatMap(a => a.rates).sort((a, b) => {\n return b.startDay - a.startDay; // Sort by desc start day.\n }).find(r => { // Find the rate for the numberOfDays.\n return r.startDay <= numberOfDays // Minimum days.\n && (r.endDay >= numberOfDays || r.endDay === 1) // Max days or 1-to-1.\n })\n\n if (!rateForNumberOfDays) {\n noRateMessage += ` ${moment(rd.date).format('MM/DD/YYYY')} No rates available.`;\n }\n\n return rateForNumberOfDays;\n });\n\n if ((productRates.length == 0 || productRates.findIndex(a => a != null) < 0) && getFirstIfNull) {\n productRates = ratesForNumberOfDays.length > 0 ? ratesForNumberOfDays[0].unitRates[0].rates : [];\n }\n\n return {\n productRates,\n noRateMessage\n };\n}\n\n// export function getAvailableVendorUnits(rates: DateRate[]) {\n// let vendorUnits: VendorUnit[] = [];\n// rates.forEach(v => {\n// v.rates.forEach(r => {\n// if (vendorUnits.findIndex(vu => vu.uniqueIdForSelection == r.vendorUnitDisplayName) < 0) {\n// vendorUnits.push(new VendorUnit({ uniqueIdForSelection: r.vendorUnitDisplayName, unitName: r.vendorUnitDisplayName }));\n// }\n// })\n// });\n// return vendorUnits;\n// }\n\nexport function getVendorUnitIdsFromSelectedName(rates: RatesByDate[], selectedName: string | null, startDate: string | null = null, endDate: string | null = null) {\n if (startDate === null || selectedName === null) return [];\n if (endDate === null) endDate = startDate;\n\n const start = moment(startDate);\n const end = moment(endDate);\n const ids: Number[] = [];\n\n rates.forEach(dayRate => {\n const date = moment(dayRate.date);\n\n if (date.isSameOrAfter(start) && date.isSameOrBefore(end)) {\n dayRate.unitRates.forEach(rate => {\n if (ids.findIndex(id => id === rate.vendorUnitId) < 0 && rate.vendorUnitDisplayName === selectedName) {\n ids.push(rate.vendorUnitId);\n }\n });\n }\n });\n\n return ids;\n}\n\n// export function getAvailableVendorUnits(units: VendorUnit[], rates: RatesByDate[], startDate: string | null = null, endDate: string | null = null) {\n// if (startDate === null)\n// return [];\n\n// let start = moment(startDate);\n// let end = moment(endDate);\n// let vendorUnits: VendorUnit[] = [];\n// rates.forEach(v => {\n// let date = moment(v.date);\n// //12/20/21\n// //only show Units based on the startDate\n// if (date.isSame(start)) { //only selected 1 date\n// v.unitRates.forEach(r => {\n// if (vendorUnits.findIndex(vu => vu.uniqueIdForSelection.trim() == r.vendorUnitDisplayName.trim()) < 0) {\n\n// const vendUnit = new VendorUnit({ uniqueIdForSelection: r.vendorUnitDisplayName.trim(), unitName: r.vendorUnitDisplayName.trim(), vendorUnitId: r.vendorUnitId, isLive: r.rates.some(ur => ur.isLive), rates: r.rates, });\n// vendorUnits.push(vendUnit);\n// }\n// })\n// }\n// });\n// return vendorUnits;\n// }\n\nexport function getAvailableVendorUnits(vendorUnits: VendorUnit[], dateRates: RatesByDate[], startDate: string | null = null, endDate: string | null = null) {\n // if (startDate == null || dateRates === undefined || dateRates === null || vendorUnits === undefined || vendorUnits.length === 0)\n // return [];\n if (startDate === null)\n return [];\n\n // console.log(\"vendorUnits\", vendorUnits);\n let start = moment(startDate);\n // let end = moment(endDate);\n let units: VendorUnit[] = [];\n dateRates.forEach(dateRate => {\n let date = moment(dateRate.date);\n //12/20/21\n //only show Units based on the startDate\n if (date.isSame(start)) { //only select 1 date\n dateRate.unitRates.forEach(unitRate => {\n if (units.findIndex(vu => vu.uniqueIdForSelection.trim() === unitRate.vendorUnitDisplayName.trim()) < 0) {\n const unit = vendorUnits.find(u => u.vendorUnitId === unitRate.vendorUnitId);\n // console.log(\"unit\", unit);\n \n if (!!unit)\n units.push(new VendorUnit({\n ...unit,\n // this name shit needs to be reworked\n uniqueIdForSelection: unitRate.vendorUnitDisplayName.trim(),\n unitName: unitRate.vendorUnitDisplayName.trim(),\n // vendorUnitId: unitRate.vendorUnitId, \n isLive: unitRate.rates.some(ur => ur.isLive),\n rates: unitRate.rates,\n // personPerUnit: unit.personPerUnit, \n unitDescription: unit.unitDescription,\n // productRateId: unit.productRateId\n published: !unitRate.rates.some(r => !r.published)\n }));\n }\n })\n }\n });\n return units;\n}\n\nexport function getWeekIdAndRateType(weekId: any, rateType: any) {\n return weekId + \"-\" + rateType;\n}\n\nexport function getRateTypeFromUnitName(rates: RatesByDate[], name: string | null, date: string | null = null) {\n let rateType = 0;\n\n rates.forEach(v => {\n if (isStringEmpty(date) || moment(date).isSame(moment(v.date))) {\n v.unitRates.forEach(r => {\n if (r.vendorUnitDisplayName === name) {\n rateType = r.rates[0].rateType;\n }\n })\n }\n });\n return rateType;\n}\n\nexport function getVendorUnitIdFromUnitName(rates: RatesByDate[], name: string | null, date: string | null = null) {\n let vendorUnitId = 0;\n rates.forEach(v => {\n if (isStringEmpty(date) || moment(date).isSame(moment(v.date))) {\n v.unitRates.forEach(r => {\n if (r.vendorUnitDisplayName === name) {\n vendorUnitId = r.vendorUnitId;\n }\n })\n }\n });\n return vendorUnitId;\n}\n\nexport function getUnitNameFromVendorUnitId(rates: RatesByDate[], selectedUnit: number) {\n let name = \"\";\n if (selectedUnit && rates) {\n rates.forEach(v => {\n v.unitRates.forEach(r => {\n if (r.vendorUnitId === selectedUnit) {\n name = r.vendorUnitDisplayName;\n }\n })\n });\n }\n return name;\n}\n\nexport function populateTimes() {\n let start = moment().startOf('day');\n let end = moment().endOf('day');\n start.hours(Math.ceil(start.hours() / 1) * 1);\n let result: any[] = [];\n let current = moment(start);\n while (current <= end) {\n result.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a'),\n });\n current.add(1, 'hour');\n }\n return result;\n}","import React from 'react';\nimport { Button } from 'react-bootstrap';\n\ninterface Props {\n /** Big block commented out incase we bring back left stacked mobile price */\n vendor?: {\n vendorName: string;\n rateDisplayOptions: {\n showPkgPriceOnly: boolean;\n };\n };\n /** should unit price be shown */\n showPricing: boolean;\n /** method to retrieve the price value */\n getPriceString: () => string;\n /** method to trigger edit modal */\n editItem: (item: any) => void;\n /** remove item button method */\n removeItem: (item: any) => void;\n /** item to be edited or removed */\n item: any;\n}\n\nconst MobileUnitPriceEditDelete: React.FC = ({\n vendor,\n showPricing,\n getPriceString,\n editItem,\n removeItem,\n item,\n}) => {\n return (\n\n /** {Left-Justified Variant} may need to modify the css file for width\n
\n \n

\n {!vendor?.rateDisplayOptions.showPkgPriceOnly && showPricing ? getPriceString() : \"Package Price\"}\n

\n \n \n editItem(item)}\n >\n Edit\n \n removeItem(item)}\n >\n Remove\n \n \n
\n */\n /** {Right-Justified Variant} may need to modify the css file for width\n
\n editItem(item)}\n >\n Edit\n \n removeItem(item)}\n >\n Remove\n \n
*/\n /** {Icons: split horizontally Variant}\n
\n editItem(item)}\n >\n \n \n removeItem(item)}\n >\n \n \n
*/\n /** {Icons: split vertically Variant} */\n
\n removeItem(item)}\n >\n \n \n

\n {!vendor?.rateDisplayOptions.showPkgPriceOnly && showPricing ? getPriceString() : \"Package Price\"}\n

\n editItem(item)}\n >\n \n \n
\n );\n};\n\nexport default MobileUnitPriceEditDelete;","export enum ReservationStatus {\n Quote = 10,\n BookedPending = 20,\n BookedComplete = 30,\n CancelPending = 40,\n CancelComplete = 50,\n BookBalanceDue = 60\n}","import React from 'react';\nimport { Row, Col } from 'react-bootstrap';\nimport MobileUnitPriceEditDelete from './MobileUnitPriceEditDelete';\n\ninterface Props {\n /** vendor name and showPkgPrice properties */\n vendor?: {\n vendorName: string;\n rateDisplayOptions: {\n showPkgPriceOnly: boolean;\n };\n };\n /** the unit item being interacted with */\n item: any,\n /** whether the quote has been created yet */\n quoteStatus?: number;\n editable?: boolean,\n showPricing: boolean,\n getPriceString: () => string;\n editItem: (item: any) => void;\n removeItem: (item: any) => void;\n children?: any;\n}\n\nconst MobileUnitTabDetails: React.FC = ({\n vendor,\n item,\n quoteStatus,\n editable,\n showPricing,\n getPriceString,\n editItem,\n removeItem,\n children,\n}) => {\n return (\n \n \n {/** {Left-Justified Variant}\n \n {children}\n \n {quoteStatus === undefined && (editable ?? true) && (\n \n )}\n \n */}\n {/** {Right-Justified Variant or Icon Horizontal Variant}\n \n {children}\n \n {quoteStatus === undefined && (editable ?? true) && (\n \n

\n {!vendor?.rateDisplayOptions.showPkgPriceOnly && showPricing ? getPriceString() : \"Package Price\"}\n

\n \n \n )} */}\n {/** {Icon Vertical Variant} */}\n \n {children}\n \n {quoteStatus === undefined && (editable ?? true) && (\n \n \n \n )}\n \n \n \n \n );\n};\n\nexport default MobileUnitTabDetails;","import React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Button, Image, Form, Row } from \"react-bootstrap\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport momentJs from \"react-day-picker/moment\";\nimport LodgingItinerary from \"../../../../../../Data/Reservation/Lodging/LodgingItinerary\";\nimport LodgingItineraryUnit from \"../../../../../../Data/Reservation/Lodging/LodgingItineraryUnit\";\nimport { Modifier } from \"react-day-picker\";\nimport { DatesAndGuests } from \"../../../widget-form/WidgetForm\";\nimport VendorUnit from \"../../../../../../Data/VendorUnit\";\nimport WidgetStyle from \"../../../../../../Data/WidgetStyle\";\nimport StartWidget from \"../../../../../../Data/StartWidget\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport UnitRate from \"../../../../../../Data/Rates/UnitRate\";\nimport ProductRate from \"../../../../../../Data/Rates/ProductRate\";\nimport RatesByDate from \"../../../../../../Data/Rates/DateRate\";\nimport { DateExtensions } from \"../../../../../../_helpers/DateExtensions\";\nimport Decimal from \"decimal.js\";\nimport LodgingItem from \"../../../../../../Data/LodgingItem\";\nimport moment from \"moment\";\nimport Itinerary from \"../../../../../../Data/Itinerary\";\nimport { getAvailableVendorUnits, getVendorUnitIdFromUnitName, getUnitNameFromVendorUnitId, getVendorUnitIdsFromSelectedName } from \"../../../../../../Data/Rates/UnitRateLogic\";\nimport { roundDecimal, isStringEmpty } from \"../../../../../../_helpers/Functions\";\nimport { ReservationStatus } from \"../../../../../../Data/Reservation/ReservationStatus\";\nimport Vendor from \"../../../../../../Data/Vendor\";\nimport CustomDayPickerInput from \"../../../../customDayPickerInput/CustomDayPickerInput\";\nimport MobileUnitTabDetails from \"../components/MobileUnitTabDetails\";\n\ninterface props {\n itinerary: Itinerary;\n item: LodgingItineraryUnit;\n vendor: LodgingItem,\n itemIndex: number;\n datesAndGuests: DatesAndGuests;\n removeItem: (unit: LodgingItineraryUnit) => void;\n editItem: (unit: LodgingItineraryUnit) => void;\n bookNowRequested: boolean;\n quoteRequested: boolean;\n quoteStatus: number | undefined;\n onVendorImageClick: (vendor: LodgingItem) => void;\n editable: boolean;\n onCheckInDateChanged: (date: string) => void;\n onCheckOutDateChanged: (date: string) => void;\n}\n\nconst LodgingTab: React.FC = (props) => {\n const { startWidget, style, fromEmail, viewPortBreakPoint, brandSettings, /* brandId */ brand } = useContext(WidgetContext);\n const { itinerary, item, vendor, itemIndex, datesAndGuests, removeItem, editItem, quoteRequested, bookNowRequested, quoteStatus } = props;\n\n const brandSetting = brandSettings.find((s: any) => s.brandId === brand?.brandId);\n\n const [vendorUnits, setVendorUnits] = useState([]);\n const rates = vendor && vendor.dailyRates ? vendor.dailyRates : [];\n\n const { formatDate, parseDate } = momentJs;\n const [checkIn, setCheckIn] = useState(moment(item.checkIn).toDate());\n const [checkOut, setCheckOut] = useState(moment(item.checkOut).toDate());\n const modifiers = { start: checkIn, end: checkOut };\n\n const [guests, setGuests] = useState(item.guestsInUnit);\n const [numberOfUnits, setNumberOfUnits] = useState(item.numberOfUnits);\n\n const [unavailableMessage, setUnavailableMessage] = useState();\n\n const [selectedUnit, setSelectedUnit] = useState(null);\n const [selectedUnitName, setSelectedUnitName] = useState(getUnitNameFromVendorUnitId(rates, item.vendorUnitId));\n const [selectedTravePortLodgingOfferId, setSelectedTravePortLodgingOfferId] = useState(vendor.travelPortLodgingOfferId);\n const [selectedTravePortUnitName, setSelectedTravePortUnitName] = useState(vendor.travelPortRateName || item.travelPortRateName);\n const [productRate, setProductRate] = useState();\n\n const [unitRateTotal, setUnitRateTotal] = useState(0);\n\n const [errorsImg, setErrorsImg] = useState();\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const vendorImageUrl = errorsImg ? errorsImg : (vendor.description ?\n (vendor.description.vendorDescriptionImages.length > 0 ?\n ((vendor.description.vendorDescriptionImages[0].vendorImageUrl != undefined && vendor.description.vendorDescriptionImages[0].vendorImageUrl.length > 0) ? vendor.description.vendorDescriptionImages[0].vendorImageUrl\n : placeholderImgUrl)\n : placeholderImgUrl)\n : placeholderImgUrl);\n\n const checkInDateChanged = (date: Date) => {\n const checkIn = moment(date).hours(0).format(\"YYYY-MM-DD\");\n const checkOut = moment(date).hours(0).format(\"YYYY-MM-DD\");\n props.onCheckInDateChanged(checkIn);\n setCheckIn(moment(date, \"YYYY-MM-DD\").hours(0).toDate());\n if (moment(date).isAfter(checkOut)) {\n setCheckOut(date);\n props.onCheckOutDateChanged(checkOut);\n }\n }\n\n const checkOutDateChanged = (date: Date) => {\n const checkOut = moment(date).hours(0).format(\"YYYY-MM-DD\");\n props.onCheckOutDateChanged(checkOut);\n setCheckOut(moment(date, \"YYYY-MM-DD\").hours(0).toDate());\n }\n\n const onGuestsInputChanged = (event: any) => {\n setGuests(+event.target.value);\n if (numberOfUnits > +event.target.value)\n setNumberOfUnits(1);\n };\n\n const onUnitsInputChanged = (event: any) => {\n setNumberOfUnits(+event.target.value);\n };\n\n // const unitOptions = vendorUnits.map((unit: VendorUnit, index: number) => (\n // \n // ));\n\n const unitOptions = vendorUnits.filter(u => !props.editable || u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n function getNumGuestsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n const maxGuests = item.guestsInUnit;\n\n for (let index = 0; index < maxGuests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getNumUnitsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n // for (let index = 0; index < item.preBuiltPkgVendorUnit !== undefined ? item.preBuiltPkgVendorUnit.toUnits : guests; index++) {\n for (let index = 0; index < guests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getPriceString() {\n if (brandSetting && brandSetting.usePkgPriceByLodging && itinerary.lodgingItineraries && itinerary.lodgingItineraries[0].itineraryUnits.length >= brandSetting.usePkgPriceByLodgingNumber) return \"Package Price\";\n return \"$\" + (fromEmail ? item.sell.toFixed(2) : (unitRateTotal).toFixed(2));\n }\n\n // useEffect(() => {\n // console.log(\"vendor\", vendor);\n // }, [vendor]);\n\n useEffect(() => {\n if (!vendor) return;\n\n const _vendorUnits = getAvailableVendorUnits(props.vendor.vendorUnits, rates, moment(checkIn).format(\"MM/DD/YYYY\"), moment(checkOut).format(\"MM/DD/YYYY\"));\n _vendorUnits.sort((a, b) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n\n if (a.unitName.toLowerCase() < b.unitName.toLowerCase()) return -1;\n if (a.unitName.toLowerCase() > b.unitName.toLowerCase()) return 1;\n\n return 0;\n });\n setVendorUnits(_vendorUnits);\n // console.log(\"_vendorUnits\", _vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection == selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n }\n }\n\n let nights: Date[] = [];\n let night = moment(checkIn, 'YYYY-MM-DD');\n const checkOutDate = moment(checkOut, 'YYYY-MM-DD');\n while (night.isBefore(checkOutDate)) {\n nights.push(night.toDate());\n night = night.clone().add(1, 'day');\n }\n\n if (nights.length === 0)\n setUnavailableMessage(\"Invalid date range\");\n else setUnavailableMessage(\"\");\n }, [vendor, checkIn, checkOut]);\n\n useEffect(() => {\n setUnitRateTotal(0);\n\n const dayRates = rates.filter(a => a.unitRates.findIndex(b => b.vendorUnitDisplayName === selectedUnitName) >= 0);\n\n const nights: Date[] = [];\n let night = moment(checkIn, \"YYYY-MM-DD\");\n const checkOutDate = moment(checkOut, \"YYYY-MM-DD\");\n while (night.isBefore(checkOutDate)) {\n nights.push(night.toDate());\n night = night.clone().add(1, \"day\");\n }\n\n const unavailableDates = nights.filter(night => !dayRates.find(rate => {\n return moment(rate.date).format(\"MM/DD/YYYY\").toString() === moment(night).format(\"MM/DD/YYYY\").toString();\n }));\n\n if (unavailableDates.length) {\n let unavailableDatesMessage = \"\";\n unavailableDates.forEach(date => {\n unavailableDatesMessage += ` ${moment(date).format(\"MM/DD/YYYY\")} no rates available.`;\n });\n setUnavailableMessage(unavailableDatesMessage);\n return;\n }\n\n const ratesForNights = dayRates.filter(rate => nights.find(night => moment(night).format(\"MM/DD/YYYY\").toString() === moment(rate.date).format(\"MM/DD/YYYY\").toString()));\n const ratesForUnitName = ratesForNights.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName);\n\n // setRatesForDates(ratesForNights.flatMap(a => a.rates));\n const unavailableRates = ratesForUnitName.filter(rate => rate.unavailable);\n if (!unavailableRates.length) {\n setUnavailableMessage(\"\");\n } else {\n let message = \"\";\n unavailableRates.forEach(date => {\n message += ` ${moment(date.date).format(\"MM/DD/YYYY\")} ${date.unavailableMessage}`;\n });\n\n setUnavailableMessage(message);\n }\n\n if (ratesForUnitName.length > 0) {\n setSelectedUnit(ratesForUnitName[0].vendorUnitId);\n }\n\n // let rate = ratesForUnitName.flatMap(a => a.rates).reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0)).times(units);\n let rate: any = null;\n const innerRates = ratesForUnitName.flatMap((a: any) => a.rates);\n let testRate: any = undefined;\n\n if (!innerRates.some((r: any) => r.isLive))\n rate = innerRates.reduce((a: any, b: any) => a.add(new Decimal(b?.price || 0)), new Decimal(0)).times(numberOfUnits);\n else {\n const test = innerRates.filter((r: any) => r.travelPortRateName == selectedTravePortUnitName);\n if (test.length > 0) {\n rate = test.reduce((a: any, b: any) => a.add(new Decimal(b?.price || 0)), new Decimal(0)).times(numberOfUnits);\n testRate = test[0];\n }\n\n // rate = innerRates.reduce((a: any, b: any) => a.add(new Decimal(b?.price || 0)), new Decimal(0)).times(numberOfUnits);\n\n }\n // if (props.vendor.fees !== undefined && props.vendor.fees.cleaningFeePerDayOrPerUnit === \"Unit\") {\n // rate = rate.add(props.vendor.fees.cleaningFee * units);\n // }\n if (rate !== null) {\n setUnitRateTotal(roundDecimal(rate).toNumber());\n if (testRate !== undefined)\n setProductRate(testRate);\n }\n\n if (nights.length === 0)\n setUnavailableMessage(\"Invalid date range\");\n\n }, [checkIn, checkOut, selectedUnitName, numberOfUnits, selectedTravePortUnitName]);\n\n useEffect(() => {\n if (quoteRequested || bookNowRequested) {\n item.checkIn = moment(checkIn).format(\"YYYY-MM-DD\");\n item.checkOut = moment(checkOut).format(\"YYYY-MM-DD\");\n item.guestsInUnit = guests;\n item.numberOfUnits = numberOfUnits;\n item.vendorUnitId = getVendorUnitIdFromUnitName(vendor.dailyRates, selectedUnitName);;\n\n item.sell = moment(item.checkIn).isSame(item.checkOut) ? -1 : unitRateTotal;\n item.isValid = isStringEmpty(unavailableMessage);\n item.travelPortLodgingOfferId = selectedTravePortLodgingOfferId;\n item.travelPortRateName = selectedTravePortUnitName;\n item.productRateId = productRate !== undefined ? productRate.productRateId : 0;\n }\n }, [quoteRequested, bookNowRequested]);\n\n useEffect(() => {\n setCheckIn(moment(item.checkIn).toDate());\n setCheckOut(moment(item.checkOut).toDate());\n }, [props.item]);\n\n return (\n \n {/* Lodging Items */}\n {/* Desktop */}\n\n {item.showOnItinerary && (\n <>\n \n {/* Container for Lodging Items */}\n\n {/* Image */}\n \n {\n props.onVendorImageClick(props.vendor)\n }}\n fluid\n />\n \n\n {/* Form */}\n \n \n {/* */}\n \n {vendor ? vendor.vendorName : \"\"}\n \n \n {vendor ? vendor.city : \"\"}, {vendor ? vendor.state : \"\"}\n

\n {/* */}\n
\n\n {/* DatePickers */}\n \n \n \n Arrive\n \n \n \n\n \n \n Depart\n \n \n\n {/* {unavailableMessage && (\n \n

{unavailableMessage}

\n
\n )} */}\n \n\n
\n \n Guests\n \n \n {getNumGuestsOptions()}\n \n
\n\n
\n \n Units\n \n \n {getNumUnitsOptions()}\n \n
\n
\n\n {/* Selects */}\n \n \n \n Unit Type\n \n
\n \n\n {/* Buttons */}\n \n {quoteStatus === undefined && props.editable && (\n {\n removeItem(item);\n // sameDayReplays.splice(itemIndex, 1);\n }}\n >\n Remove\n \n )}\n {/* */}\n \n {/* If the quote is Booked Complete or Cancelled showing price is not necessary */}\n {props.quoteStatus !== 30 && props.quoteStatus !== 40 && props.quoteStatus !== 50 && (props.quoteStatus !== 10 || !!!unavailableMessage) && (\n
\n

{!vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showLodgingPricing ? getPriceString() : \"Package Price\"}

\n
\n )}\n {(props.quoteStatus === 40 || props.quoteStatus === 50) && (\n
\n

{\"Cancelled\"}

\n
\n )}\n {(quoteStatus === undefined || props.quoteStatus === 10) && unavailableMessage && (\n
\n

{unavailableMessage}

\n
\n )}\n \n
\n\n {/* Mobile */}\n \n
\n {vendor ? vendor.vendorName : \"\"}\n {/* {true && ( - Cancelled)} */}\n
\n

{moment(item.checkIn).format(\"MMM Do, YYYY\")} - {moment(item.checkOut).format(\"MMM Do, YYYY\")}

\n

{item.guestsInUnit} Guest{item.guestsInUnit == 1 ? \"\" : \"s\"}

\n

{item.numberOfUnits ? item.numberOfUnits : 1} Unit{item.numberOfUnits && item.numberOfUnits != 1 ? \"s\" : \"\"}\n  {selectedUnitName}\n

\n \n \n )}\n \n );\n}\n\nexport default LodgingTab;","import Decimal from \"decimal.js\";\nimport moment from \"moment\";\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Button, Image, Form } from \"react-bootstrap\";\nimport { Modifier } from \"react-day-picker\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport GolfItem from \"../../../../../../Data/GolfItem\";\nimport Itinerary from \"../../../../../../Data/Itinerary\";\nimport RatesByDate from \"../../../../../../Data/Rates/DateRate\";\nimport ProductRate from \"../../../../../../Data/Rates/ProductRate\";\nimport UnitRate from \"../../../../../../Data/Rates/UnitRate\";\nimport { getAvailableVendorUnits, getUnitNameFromVendorUnitId, getVendorUnitIdFromUnitName, getVendorUnitIdsFromSelectedName } from \"../../../../../../Data/Rates/UnitRateLogic\";\nimport GolfItinerary from \"../../../../../../Data/Reservation/Golf/GolfItinerary\";\nimport GolfItineraryUnit from \"../../../../../../Data/Reservation/Golf/GolfItineraryUnit\";\nimport { ReservationStatus } from \"../../../../../../Data/Reservation/ReservationStatus\";\nimport StartWidget from \"../../../../../../Data/StartWidget\";\nimport VendorUnit from \"../../../../../../Data/VendorUnit\";\nimport WidgetStyle from \"../../../../../../Data/WidgetStyle\";\nimport { roundDecimal, isStringEmpty } from \"../../../../../../_helpers/Functions\";\nimport { DatesAndGuests } from \"../../../widget-form/WidgetForm\";\n\nimport SameDayReplay from \"./SameDayReplay\";\nimport CustomDayPickerInput from \"../../../../customDayPickerInput/CustomDayPickerInput\";\nimport { TimeOption } from \"../../../../../../_helpers/Types\";\nimport MobileUnitTabDetails from \"../components/MobileUnitTabDetails\";\n\ninterface props {\n itineraryNumber: string;\n itinerary: Itinerary;\n item: GolfItineraryUnit;\n vendor: GolfItem;\n itemIndex: number;\n datesAndGuests: DatesAndGuests;\n removeItem: (unit: GolfItineraryUnit) => void;\n editItem: (unit: GolfItineraryUnit) => void;\n bookNowRequested: boolean;\n quoteRequested: boolean;\n quoteStatus: number | undefined;\n onVendorImageClick: (vendor: GolfItem) => void;\n editable: boolean;\n}\n\ninterface SameDayReplayData {\n playDate: Date;\n teeTime?: Date;\n players?: number;\n}\n\nconst GolfTab: React.FC = (props) => {\n const { startWidget, style, fromEmail, viewPortBreakPoint, brandSettings, /* brandId */brand } = useContext(WidgetContext);\n\n const brandSetting = brandSettings.find((s: any) => s.brandId === brand?.brandId);\n const { itinerary, item, vendor, itemIndex, datesAndGuests, removeItem, editItem, bookNowRequested, quoteRequested, quoteStatus } = props;\n // const [unitId, setUnitId] = useState(item.vendorUnitId);\n const [playDate, setPlayDate] = useState(moment(item.playDate).toDate());\n const [players, setPlayers] = useState(item.players);\n\n const { formatDate, parseDate } = reactMoment;\n const [sameDayReplays, setSameDayReplays] = useState([]);\n\n const [selectedUnit, setSelectedUnit] = useState(item.vendorUnitId);\n const [selectedTeeTime, setSelectedTeeTime] = useState(item.teeTime);\n const [productRate, setProductRate] = useState();\n\n const [teeTimes, setTeeTimes] = useState([]);\n const [ratesForPlayDate, setRatesForPlayDate] = useState([]);\n const [unavailableMessage, setUnavailableMessage] = useState('');\n const [ratesForUnit, setRatesForUnit] = useState([]);\n const [teeTimeRate, setTeeTimeRate] = useState();\n const [vendorUnits, setVendorUnits] = useState([]);\n\n const rates = vendor && vendor.dailyRates ? vendor.dailyRates : [];\n const [selectedUnitName, setSelectedUnitName] = useState(item.unitName || getUnitNameFromVendorUnitId(rates, item.vendorUnitId));\n\n const [errorsImg, setErrorsImg] = useState();\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const vendorImageUrl = errorsImg ? errorsImg : (vendor.description ?\n (vendor.description.vendorDescriptionImages.length > 0 ?\n ((vendor.description.vendorDescriptionImages[0].vendorImageUrl != undefined && vendor.description.vendorDescriptionImages[0].vendorImageUrl.length > 0) ? vendor.description.vendorDescriptionImages[0].vendorImageUrl\n : placeholderImgUrl)\n : placeholderImgUrl)\n : placeholderImgUrl);\n\n // function addSameDayReplay() {\n // if (item.playDate) {\n // sameDayReplays.push({ playDate: moment(item.playDate).toDate() });\n // setSameDayReplays([...sameDayReplays]);\n // }\n // }\n\n const playDateChanged = (date: Date) => {\n setPlayDate(date);\n }\n\n const onPlayersInputChanged = (event: any) => {\n setPlayers(+event.target.value);\n };\n\n // const onTeeTimeInputChanged = (event: any) => {\n // setSelectedTeeTime(event.target.value);\n // };\n\n const teeTimesOptions = teeTimes.map((teeTime: TimeOption, index: number) => (\n \n ));\n\n const unitOptions = vendorUnits.filter(u => !props.editable || u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n function populateTeeTimes() {\n const selectedPlayDate = moment(playDate).format('YYYY-MM-DD');\n const ratesForDate = rates.find(rate => selectedPlayDate.toString() === moment(rate.date).format('YYYY-MM-DD').toString());\n\n if (ratesForDate) {\n const selectedRates = ratesForDate.unitRates.filter(a => a.vendorUnitDisplayName === selectedUnitName);\n // const ratesForUnit = ratesForDate.unitRates.filter(a => a.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates);\n const ratesForUnit = selectedRates.flatMap(a => a.rates);\n\n // Set the tee times.\n let rateTeeTimes: TimeOption[] = [];\n console.log(\"ratesForUnit\", ratesForUnit);\n ratesForUnit.forEach(r => {\n let start = moment(r.startTime, 'HH:mm');\n let end = moment(r.endTime, 'HH:mm');\n\n // pbpkg stuffs\n const pkgStart = props.editable && item.preBuiltPkgVendorUnit !== undefined ? moment(item.preBuiltPkgVendorUnit.fromTime, \"HH:mm\") : start;\n const pkgEnd = props.editable && item.preBuiltPkgVendorUnit !== undefined ? moment(item.preBuiltPkgVendorUnit.toTime, \"HH:mm\") : end;\n\n if (r.startTime !== r.endTime)\n start.minutes(Math.ceil(start.minutes() / 10) * 10);\n\n let result: TimeOption[] = [];\n let current = moment(start);\n\n while (current <= end) {\n if (current >= pkgStart && current <= pkgEnd) {\n result.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a') + (r.isLive ? ` (${r.openSpots} players)` : \"\"),\n foreUpTeeTimeId: r.isLive ? r.foreUpTeeTimeId : \"\",\n golfNowTeeTimeId: r.isLive ? r.golfNowTeeTimeId : \"\",\n lightSpeedTeeTimeId: r.isLive ? r.lightSpeedTeeTimeId : \"\",\n openSpots: r.openSpots,\n price: r.price,\n isLive: r.isLive,\n vendorUnitId: r.vendorUnitId,\n productRateId: r.productRateId,\n });\n }\n\n current.add(10, 'minutes');\n }\n rateTeeTimes = rateTeeTimes.concat(result);\n });\n if (!!rateTeeTimes.length) {\n rateTeeTimes = [...new Map(rateTeeTimes.map(item => [item.value, item])).values()] // Remove any cross-over duplicates.\n }\n rateTeeTimes.sort((a, b) => {\n // Sort by time.\n return moment(a.value, 'HH:mm').isBefore(moment(b.value, 'HH:mm')) ? -1 : 0;\n });\n\n // if (!item.teeTime && !!rateTeeTimes.length) {\n if (!item.teeTime && !!rateTeeTimes.length) {\n setSelectedTeeTime(rateTeeTimes[0].value);\n setUnavailableMessage('');\n }\n\n item.availableTeeTimes = rateTeeTimes;\n setTeeTimes(rateTeeTimes);\n // console.log(\"selectedRates\", selectedRates);\n if (ratesForDate.unavailable) {\n setUnavailableMessage(ratesForDate.unavailableMessage || \"Unavailable\");\n } else if (selectedRates.some(r => r.unavailable)) {\n setUnavailableMessage(selectedRates[0].unavailableMessage);\n } else if (rateTeeTimes.length === 0) {\n setUnavailableMessage(\"No rates available for this date\");\n }\n }\n }\n\n const playerOptions = Array.from({\n length: Math.min(productRate !== undefined && productRate.isLive ?\n Math.min(productRate.openSpots, 4) : players, players)\n }, (_, i) => i + 1).map((number: number, index: number) => (\n \n ));\n\n function getPriceString() {\n if (brandSetting && brandSetting.usePkgPriceByCourse && itinerary.golfItineraries && itinerary.golfItineraries[0].itineraryUnits.length >= brandSetting.usePkgPriceByCourseNumber) return \"Package Price\";\n return \"$\" + (quoteStatus !== undefined ? item.sell.toFixed(2) : (unitRate()).toFixed(2));\n // return (0).toFixed(2);\n }\n\n function unitRate(): number {\n if (!teeTimeRate) {\n return 0;\n }\n\n return roundDecimal(teeTimeRate.times(players)).toNumber();\n }\n\n useEffect(() => {\n setSelectedTeeTime(item.teeTime);\n setPlayDate(moment(item.playDate).toDate());\n }, [item]);\n\n useEffect(() => {\n if (!vendor) return;\n\n const _vendorUnits = getAvailableVendorUnits(props.vendor.vendorUnits, rates, moment(playDate).format(\"MM/DD/YYYY\"));\n setVendorUnits(_vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection === selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n }\n }\n\n setUnavailableMessage(\"\");\n populateTeeTimes();\n\n }, [vendor, playDate]);\n\n useEffect(() => {\n populateTeeTimes();\n }, [selectedUnitName]);\n\n useEffect(() => {\n // setUnavailableMessage(\"\");\n\n const selectedPlayDate = moment(playDate).format('YYYY-MM-DD');\n const ratesForDate = rates.find(rate => selectedPlayDate.toString() === moment(rate.date).format('YYYY-MM-DD').toString());\n\n setRatesForPlayDate([]);\n\n if (!selectedTeeTime || !ratesForDate) {\n setTeeTimeRate(undefined);\n setProductRate(undefined);\n return;\n }\n\n if (ratesForDate.unavailable || ratesForDate.unitRates.length == 0) {\n var message = ratesForDate.unavailable ? ratesForDate.unavailableMessage as string : \"No rates available for the play date.\";\n setUnavailableMessage(message)\n // setTeeTimeRate(new Decimal(0));\n\n // return;\n\n if (ratesForDate.unitRates.length == 0) {\n setRatesForPlayDate([]);\n setTeeTimeRate(new Decimal(0));\n setTeeTimeRate(undefined);\n return;\n }\n }\n\n setRatesForPlayDate(ratesForDate.unitRates);\n\n const ratesForUnit = ratesForDate.unitRates.filter(r => r.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates);\n // console.log(\"ratesForDate\", ratesForDate);\n // console.log(\"ratesForUnit\", ratesForUnit);\n setRatesForUnit(ratesForUnit);\n\n if (ratesForDate.unavailable || teeTimes.length === 0) {\n setUnavailableMessage(ratesForDate.unavailableMessage || \"Unavailable\");\n }\n // else {\n // setUnavailableMessage(\"\");\n // }\n\n const unitIds = getVendorUnitIdsFromSelectedName(rates, selectedUnitName, moment(playDate).format(\"MM/DD/YYYY\"));\n const teeTimeRate = ratesForUnit.find(r => moment(r.startTime, \"HH:mm\").isSameOrBefore(moment(selectedTeeTime, \"HH:mm\")) && moment(r.endTime, \"HH:mm\").isSameOrAfter(moment(selectedTeeTime, \"HH:mm\")) && unitIds.includes(r.vendorUnitId));\n\n if (teeTimeRate) {\n setSelectedUnit(teeTimeRate ? teeTimeRate.vendorUnitId : null);\n }\n\n setTeeTimeRate(new Decimal(teeTimeRate ? teeTimeRate.price : 0));\n setProductRate(teeTimeRate);\n\n }, [selectedTeeTime, selectedUnitName, playDate, teeTimes]);\n\n useEffect(() => {\n if (quoteRequested || bookNowRequested) {\n item.playDate = moment(playDate).format(\"YYYY-MM-DD\");\n // item.vendorUnitId = unitId;\n item.vendorUnitId = selectedUnit as number;\n item.teeTime = selectedTeeTime as string;\n item.players = players;\n\n item.productRateId = productRate !== undefined ? productRate.productRateId : 0;\n item.foreUpTeeTimeId = productRate !== undefined ? productRate.foreUpTeeTimeId : \"\";\n item.golfNowTeeTimeId = productRate !== undefined ? productRate.golfNowTeeTimeId : \"\";\n item.lightSpeedTeeTimeId = productRate !== undefined ? productRate.lightSpeedTeeTimeId : \"\";\n\n item.sell = unitRate();\n\n item.isValid = isStringEmpty(unavailableMessage);\n }\n }, [quoteRequested, bookNowRequested]);\n\n return (\n \n {item.showOnItinerary && (\n <>\n {/* Desktop */}\n \n \n props.onVendorImageClick(props.vendor)}\n fluid\n />\n \n\n \n \n \n {vendor ? vendor.vendorName : \"\"}\n \n \n {vendor ? vendor.city : \"\"}, {vendor ? vendor.state : \"\"}\n

\n
\n\n
\n {/* DatePickers */}\n \n \n Date of Play\n \n \n \n {/* Tee Time Select */}\n
\n \n Tee Time\n \n\n {/* {quoteStatus == 20 || quoteStatus == 30 || quoteStatus == 60 ? (\n \n \n ) : (\n setSelectedTeeTime(event.currentTarget.value)}\n readOnly={quoteStatus !== undefined || teeTimesOptions.length === 0}\n disabled={quoteStatus !== undefined || teeTimesOptions.length === 0}\n >\n {teeTimesOptions}\n \n )} */}\n {/* {quoteStatus == 20 || quoteStatus == 30 || quoteStatus == 60 && (\n \n \n )} */}\n {!isStringEmpty(props.itineraryNumber) && (\n \n \n )}\n {isStringEmpty(props.itineraryNumber) && (\n setSelectedTeeTime(event.currentTarget.value)}\n readOnly={!props.editable || quoteStatus !== undefined || teeTimesOptions.length === 0}\n disabled={!props.editable || quoteStatus !== undefined || teeTimesOptions.length === 0}\n >\n {teeTimesOptions}\n \n )}\n\n
\n {/* Guests Select */}\n
\n \n Players\n \n {!isStringEmpty(props.itineraryNumber) ? (\n \n \n ) : ( \n playerOptions.length ? playerOptions.length.toString() : item.players.toString()}\n onChange={onPlayersInputChanged}\n disabled={!props.editable || quoteStatus !== undefined}\n readOnly={!props.editable || quoteStatus !== undefined}\n >\n {playerOptions}\n \n )}\n
\n
\n\n
\n \n \n Unit Type\n \n {!isStringEmpty(props.itineraryNumber) || item.preBuiltPkgVendorUnit !== undefined ? (\n \n \n ) : (\n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n )}\n \n\n {(quoteStatus == 20 || quoteStatus == 30 || quoteStatus == 60) && (\n <>\n
\n \n Confirmed Time\n \n \n \n
\n \n \n Confirmation #\n \n \n \n \n \n )}\n {(quoteStatus == 40 || quoteStatus == 50) && (\n \n \n Cancellation #\n \n \n \n \n )}\n
\n\n {/* {sameDayReplays.map((data: SameDayReplayData, index: number) =>\n
\n \n
\n )} */}\n\n {/* {false && sameDayReplays.length == 0 && (\n {\n // addSameDayReplay();\n console.log(\"add same day replay clicked\");\n }}\n >\n + Add Same Day Replay\n \n )} */}\n \n\n \n {quoteStatus === undefined && props.editable && (\n {\n removeItem(item);\n // sameDayReplays.splice(itemIndex, 1);\n }}\n >\n Remove\n \n )}\n\n {/* {sameDayReplays.length > 0 && (\n {\n console.log(\"REMOVE SAME DAY REPLAY CLICKED\");\n // sameDayReplays.splice(itemIndex, 1);\n }}\n >\n REMOVE X\n \n )} */}\n\n {/* If the quote is Booked Complete or Cancelled showing price is not necessary */}\n {teeTimesOptions.length > 0 && props.quoteStatus !== 30 && props.quoteStatus !== 40 && props.quoteStatus !== 50 && (props.quoteStatus !== 10 || !!!unavailableMessage) && (\n
\n

{!vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showGolfPricing ? getPriceString() : \"Package Price\"}

\n
\n )}\n\n {(props.quoteStatus === 40 || props.quoteStatus === 50) && (\n
\n

{\"Cancelled\"}

\n
\n )}\n\n {(props.quoteStatus === undefined || props.quoteStatus === 10) && unavailableMessage && (\n
\n

{unavailableMessage}

\n
\n )}\n {/* {unavailableMessage && (\n
\n

{unavailableMessage}

\n
\n )} */}\n \n
\n\n {/* Same Day Replays --> TODO */}\n\n {/* Mobile */}\n \n
{vendor ? vendor.vendorName : \"\"}
\n

{moment(item.playDate).format(\"MMM Do, YYYY\")}

\n

{item.players} Player{item.players == 1 ? \"\" : \"s\"}

\n

{item.players ? item.players : 1} Unit{item.players && item.players != 1 ? \"s\" : \"\"}\n  {selectedUnitName} - {`${(item.confirmedTime ? moment(item.confirmedTime, \"HH:mm\").format(\"hh:mm a\") : moment(selectedTeeTime, \"HH:mm\").format('hh:mm a'))}`}\n

\n \n \n )}\n
\n );\n}\n\nexport default GolfTab;","import Decimal from \"decimal.js\";\nimport moment from \"moment\";\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Button, Image, Form } from \"react-bootstrap\";\nimport { Modifier } from \"react-day-picker\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport Itinerary from \"../../../../../../Data/Itinerary\";\nimport RatesByDate from \"../../../../../../Data/Rates/DateRate\";\nimport EnumProductRateType from \"../../../../../../Data/Rates/EnumProductRateType\";\nimport ProductRate from \"../../../../../../Data/Rates/ProductRate\";\nimport UnitRate from \"../../../../../../Data/Rates/UnitRate\";\nimport { populateTimes, getAvailableVendorUnits, getDailyRate, getHourlyRate, getRateTypeFromUnitName, getUnitRate, getVendorUnitIdFromUnitName, getUnitNameFromVendorUnitId } from \"../../../../../../Data/Rates/UnitRateLogic\";\nimport GolfItinerary from \"../../../../../../Data/Reservation/Golf/GolfItinerary\";\nimport TransportItineraryUnit from \"../../../../../../Data/Reservation/Transportation/TransportItineraryUnit\";\nimport StartWidget from \"../../../../../../Data/StartWidget\";\nimport TransportationItem from \"../../../../../../Data/TransportationItem\";\nimport VendorUnit from \"../../../../../../Data/VendorUnit\";\nimport WidgetStyle from \"../../../../../../Data/WidgetStyle\";\nimport { roundDecimal, isStringEmpty } from \"../../../../../../_helpers/Functions\";\nimport { DatesAndGuests } from \"../../../widget-form/WidgetForm\";\nimport CustomDayPickerInput from \"../../../../customDayPickerInput/CustomDayPickerInput\";\nimport MobileUnitTabDetails from \"../components/MobileUnitTabDetails\";\n\ninterface props {\n itinerary: Itinerary;\n item: TransportItineraryUnit;\n vendor: TransportationItem;\n itemIndex: number;\n datesAndGuests: DatesAndGuests;\n removeItem: (unit: TransportItineraryUnit) => void;\n editItem: (unit: TransportItineraryUnit) => void;\n bookNowRequested: boolean;\n quoteRequested: boolean;\n quoteStatus: number | undefined;\n onVendorImageClick: (vendor: TransportationItem) => void;\n editable: boolean;\n}\n\nconst TransportationTab: React.FC = (props) => {\n const { startWidget, style, fromEmail, viewPortBreakPoint, brandSettings, /* brandId */brand } = useContext(WidgetContext);\n const { itinerary, item, vendor, itemIndex, datesAndGuests, removeItem, editItem, quoteRequested, bookNowRequested, quoteStatus } = props;\n\n const brandSetting = brandSettings.find((s: any) => s.brandId === brand?.brandId);\n const [vendorUnits, setVendorUnits] = useState([]);\n const rates = vendor && vendor.dailyRates ? vendor.dailyRates : [];\n\n const [startDate, setStartDate] = useState(moment(item.startDate).toDate());\n const [endDate, setEndDate] = useState(moment(item.endDate).toDate());\n const [guests, setGuests] = useState(item.inUnit);\n const [units, setUnits] = useState(item.units);\n const maxGuests = item.inUnit;\n const [startTime, setStartTime] = useState(item.startTime);\n const [endTime, setEndTime] = useState(item.endTime);\n const [startTimes, setStartTimes] = useState([]);\n const [endTimes, setEndTimes] = useState([]);\n const modifiers = { start: startDate, end: endDate };\n\n const { formatDate, parseDate } = reactMoment;\n\n const [hourlyRates, setHourlyRates] = useState([]);\n const [isHourlyRate, setIsHourlyRate] = useState(false);\n const [unitRates, setUnitRates] = useState([]);\n const [isUnitRate, setIsUnitRate] = useState(false);\n const [dayRates, setDayRates] = useState([]);\n const [isDailyRate, setIsDailyRate] = useState(false);\n const [unavailableMessage, setUnavailableMessage] = useState();\n\n const [selectedProductRate, setSelectedProductRate] = useState();\n const [selectedProductRateType, setSelectedProductRateType] = useState(null); //vendorUnit.productRateTypeId\n const [selectedUnit, setSelectedUnit] = useState(null); //vendorUnitId\n\n const [selectedUnitName, setSelectedUnitName] = useState(getUnitNameFromVendorUnitId(rates, item.vendorUnitId));\n\n const [rangePickerMode, setRangePickerMode] = useState(true);\n\n const [unitRateTotal, setUnitRateTotal] = useState(0);\n\n const [errorsImg, setErrorsImg] = useState();\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const vendorImageUrl = errorsImg ? errorsImg : (vendor.description ?\n (vendor.description.vendorDescriptionImages.length > 0 ?\n ((vendor.description.vendorDescriptionImages[0].vendorImageUrl != undefined && vendor.description.vendorDescriptionImages[0].vendorImageUrl.length > 0) ? vendor.description.vendorDescriptionImages[0].vendorImageUrl\n : placeholderImgUrl)\n : placeholderImgUrl)\n : placeholderImgUrl);\n\n const onGuestsInputChanged = (event: any) => {\n setGuests(+event.target.value);\n }\n\n const onUnitsInputChanged = (event: any) => {\n setUnits(+event.target.value);\n }\n\n const startDateChanged = (date: Date) => {\n setStartDate(date);\n if (date > endDate) {\n setEndDate(date);\n }\n }\n\n const onEndDateChanged = (date: Date) => {\n setEndDate(date);\n }\n\n const startTimeOptions = startTimes.map((time: any, index: number) => (\n \n ));\n\n const endTimeOptions = endTimes.map((time: any, index: number) => (\n \n ));\n\n const unitOptions = vendorUnits.filter(u => !props.editable || u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n function getNumGuestsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < maxGuests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getNumUnitsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < guests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getPriceString() {\n if (brandSetting && brandSetting.usePkgPriceByTransport && itinerary.transportItineraries && itinerary.transportItineraries[0].itineraryUnits.length >= brandSetting.usePkgPriceByTransportNumber) return \"Package Price\";\n return \"$\" + (fromEmail ? item.sell.toFixed(2) : (unitRateTotal).toFixed(2));\n // return (0).toFixed(2);\n }\n\n useEffect(() => {\n setStartDate(moment(item.startDate).toDate());\n setEndDate(moment(item.endDate).toDate());\n setStartTime(item.startTime);\n setEndTime(item.endTime);\n }, [item]);\n\n useEffect(() => {\n if (vendor === undefined) return;\n\n // console.log(\"vendor\", vendor);\n let result = populateTimes();\n setStartTimes(result);\n setEndTimes(result);\n\n let _vendorUnits = getAvailableVendorUnits(props.vendor.vendorUnits, rates, moment(startDate).format(\"MM/DD/YYYY\"), moment(endDate).format(\"MM/DD/YYYY\"));\n _vendorUnits.sort((a, b) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n\n if (a.unitName.toLowerCase() < b.unitName.toLowerCase()) return -1;\n if (a.unitName.toLowerCase() > b.unitName.toLowerCase()) return 1;\n\n return 0;\n });\n setVendorUnits(_vendorUnits);\n // console.log(\"_vendorUnits\", _vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection == selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n }\n }\n\n }, [vendor, startDate, endDate]);\n\n useEffect(() => {\n setIsDailyRate(false);\n setIsHourlyRate(false);\n setIsUnitRate(false);\n\n if (selectedProductRateType == EnumProductRateType.DayRange) {\n setIsDailyRate(true);\n //multiple days\n setRangePickerMode(true);\n // setEndDate(props.maxDate);\n\n // setStartTime(\"09:00\");\n // setEndTime(\"09:00\");\n // console.log(\"Day Range\");\n }\n else if (selectedProductRateType == EnumProductRateType.HoursPerUnit) {\n setIsHourlyRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n // setStartTime(\"09:00\");\n // setEndTime(\"10:00\");\n // console.log(\"HoursPerUnit\");\n\n }\n else if (selectedProductRateType == EnumProductRateType.UnitQtyRange) {\n setIsUnitRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n // setStartTime(\"09:00\");\n // console.log(\"UnitQtyRange\");\n\n }\n\n }, [selectedProductRateType]);\n\n useEffect(() => {\n if (!selectedUnitName) {\n return;\n }\n\n let rateType = getRateTypeFromUnitName(rates, selectedUnitName);\n\n setSelectedProductRateType(rateType);\n }, [selectedUnitName]);\n\n useEffect(() => {\n if (!isDailyRate) {\n return;\n }\n\n const { productRates, noRateMessage } = getDailyRate(rates, selectedUnitName, startDate.toDateString(), endDate.toDateString(), startTime, endTime);\n // console.log(\"product rates\", productRates);\n\n if (!!noRateMessage) {\n console.log(\"unavailable\");\n setUnavailableMessage(noRateMessage);\n return;\n }\n\n const rate = productRates.reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0)).times(units);\n setUnitRateTotal(roundDecimal(rate).toNumber());\n setUnavailableMessage(undefined);\n }, [isDailyRate, dayRates, units, startTime, endTime, startDate, endDate, selectedUnitName]);\n\n useEffect(() => {\n if (!(isHourlyRate && startTime && endTime)) {\n return;\n }\n\n var numberOfHours: number = moment.duration(moment(endTime, 'HH:mm').diff(moment(startTime, 'HH:mm'))).asHours();\n\n if (numberOfHours < 0) {\n //only 0-24 hours\n numberOfHours = moment.duration(moment(endTime, 'HH:mm').add(1, \"day\").diff(moment(startTime, 'HH:mm'))).asHours();\n }\n\n let hourlyRate = getHourlyRate(rates, selectedUnitName, startTime, endTime);\n\n if (!hourlyRate) {\n // console.log(`No rates available for ${numberOfHours} hours.`);\n setUnavailableMessage(`No rates available for ${numberOfHours} hours.`);\n setUnitRateTotal(0);\n return;\n }\n\n // console.log(\"hourly rate\", hourlyRate);\n const rate = (new Decimal(hourlyRate.price).times(numberOfHours)).times(units);\n setSelectedProductRate(hourlyRate);\n setUnitRateTotal(roundDecimal(rate).toNumber());\n setUnavailableMessage(undefined);\n }, [isHourlyRate, hourlyRates, startTime, endTime, units, selectedUnit, startDate, selectedUnitName]);\n\n useEffect(() => {\n if (!(isUnitRate)) {\n return;\n }\n\n let unitRate = getUnitRate(rates, selectedUnitName, units);\n\n if (!unitRate) {\n setUnavailableMessage(`No rates available for ${units} units.`)\n setUnitRateTotal(0);\n return;\n }\n\n const rate = new Decimal(unitRate.price).times(units);\n setUnitRateTotal(roundDecimal(rate).toNumber());\n setUnavailableMessage(undefined);\n }, [isUnitRate, unitRates, units, startDate, startTime, selectedUnitName]);\n\n useEffect(() => {\n if (quoteRequested || bookNowRequested) {\n item.vendorUnitId = getVendorUnitIdFromUnitName(rates, selectedUnitName);\n item.startDate = moment(startDate).format(\"YYYY-MM-DD\");\n item.endDate = isDailyRate ? moment(endDate).format(\"YYYY-MM-DD\") : moment(startDate).format(\"YYYY-MM-DD\");\n item.startTime = startTime;\n item.endTime = endTime;\n item.inUnit = guests;\n item.units = units;\n item.sell = unitRateTotal;\n\n item.isValid = isStringEmpty(unavailableMessage);\n }\n }, [quoteRequested, bookNowRequested]);\n\n return (\n \n {item.showOnItinerary && (\n <>\n {/* Golf Items */}\n {/* Desktop */}\n \n {/* Container for Golf Items */}\n {/* Image */}\n \n props.onVendorImageClick(props.vendor)}\n fluid\n />\n \n\n {/* Form */}\n \n \n \n {vendor ? vendor.vendorName : \"\"}\n \n \n {vendor ? vendor.city : \"\"}, {vendor ? vendor.state : \"\"}\n

\n
\n\n
\n {/* DatePickers */}\n \n \n Start Date\n \n \n \n {rangePickerMode && (\n \n \n End Date\n \n \n \n )}\n {/* From Time Select */}\n
\n\n
\n
\n \n Start Time\n \n {\n setStartTime(event.currentTarget.value);\n // setEndTime(null);\n }}\n readOnly={fromEmail}\n disabled={fromEmail}\n >\n\n {startTimeOptions}\n \n
\n\n {/* To Time Select */}\n {(isHourlyRate || isDailyRate) && (\n
\n \n To Time\n \n {\n setEndTime(event.currentTarget.value)\n }}\n readOnly={fromEmail}\n disabled={fromEmail}\n >\n\n {endTimeOptions}\n \n
\n )}\n {/* Guests Select */}\n
\n \n Guests\n \n \n {getNumGuestsOptions()}\n \n
\n\n {/* Units Select */}\n
\n \n Units\n \n \n {getNumUnitsOptions()}\n \n
\n
\n\n
\n \n \n Unit Type\n \n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n \n {(quoteStatus == 20 || quoteStatus == 30 || quoteStatus == 60) && (\n
\n \n Confirmation #\n \n \n \n
\n )}\n {(quoteStatus == 40 || quoteStatus == 50) && (\n
\n \n Cancellation #\n \n \n \n
\n )}\n
\n \n\n {/* Buttons */}\n \n {quoteStatus === undefined && (\n {\n removeItem(item);\n // sameDayReplays.splice(itemIndex, 1);\n }}\n >\n Remove\n \n )}\n \n {/* If the quote is Booked Complete or Cancelled showing price is not necessary */}\n {props.quoteStatus !== 30 && props.quoteStatus !== 40 && props.quoteStatus !== 50 && (props.quoteStatus !== 10 || !!!unavailableMessage) && (\n
\n

{!vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showTransportationPricing ? getPriceString() : \"Package Price\"}

\n
\n )}\n {(props.quoteStatus === 40 || props.quoteStatus === 50) && (\n
\n

{\"Cancelled\"}

\n
\n )}\n {(props.quoteStatus === undefined || props.quoteStatus === 10) && unavailableMessage && (\n
\n

{unavailableMessage}

\n
\n )}\n \n {/* */}\n
\n\n {/* */}\n {/* Mobile */}\n \n
{vendor ? vendor.vendorName : \"\"}
\n

{moment(startDate).format(\"MMM Do, YYYY\")} - {moment(endDate).format(\"MMM Do, YYYY\")}

\n

{item.inUnit} Guest{item.inUnit == 1 ? \"\" : \"s\"}

\n

{item.units ? item.units : 1} Unit{item.units && item.units != 1 ? \"s\" : \"\"}\n  {selectedUnitName}\n

\n \n \n )}\n
\n );\n}\n\nexport default TransportationTab;","import Decimal from \"decimal.js\";\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Button, Image, Form } from \"react-bootstrap\";\nimport { Modifier } from \"react-day-picker\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport moment from \"moment\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport CustomItem from \"../../../../../../Data/CustomItem\";\nimport RatesByDate from \"../../../../../../Data/Rates/DateRate\";\nimport EnumProductRateType from \"../../../../../../Data/Rates/EnumProductRateType\";\nimport ProductRate from \"../../../../../../Data/Rates/ProductRate\";\nimport UnitRate from \"../../../../../../Data/Rates/UnitRate\";\nimport { getAvailableVendorUnits, getRateTypeFromUnitName, getDailyRate, getHourlyRate, getVendorUnitIdFromUnitName, getUnitNameFromVendorUnitId } from \"../../../../../../Data/Rates/UnitRateLogic\";\nimport CustomItineraryUnit from \"../../../../../../Data/Reservation/Custom/CustomItineraryUnit\";\nimport VendorUnit from \"../../../../../../Data/VendorUnit\";\nimport { roundDecimal, isStringEmpty } from \"../../../../../../_helpers/Functions\";\nimport { DatesAndGuests } from \"../../../widget-form/WidgetForm\";\nimport Itinerary from \"../../../../../../Data/Itinerary\";\nimport CustomDayPickerInput from \"../../../../customDayPickerInput/CustomDayPickerInput\";\nimport MobileUnitTabDetails from \"../components/MobileUnitTabDetails\";\n\ninterface props {\n itinerary: Itinerary;\n item: CustomItineraryUnit;\n vendor: CustomItem;\n itemIndex: number;\n datesAndGuests: DatesAndGuests;\n removeItem: (unit: CustomItineraryUnit) => void;\n editItem: (unit: CustomItineraryUnit) => void;\n bookNowRequested: boolean;\n quoteRequested: boolean;\n quoteStatus: number | undefined;\n onVendorImageClick: (vendor: CustomItem) => void;\n editable: boolean;\n}\n\nconst CustomItemTab: React.FC = (props) => {\n const { startWidget, style, fromEmail, viewPortBreakPoint, brandSettings, /* brandId */brand } = useContext(WidgetContext);\n const { itinerary, item, vendor, itemIndex, datesAndGuests, removeItem, editItem, quoteRequested, bookNowRequested, quoteStatus } = props;\n\n const brandSetting = brandSettings.find((s: any) => s.brandId === brand?.brandId);\n\n const [vendorUnits, setVendorUnits] = useState([]);\n\n const [startDate, setStartDate] = useState(moment(item.fromDate).toDate());\n const [endDate, setEndDate] = useState(moment(item.toDate).toDate());\n const [startTimes, setStartTimes] = useState([]);\n const [endTimes, setEndTimes] = useState([]);\n const [startTime, setStartTime] = useState(item.fromTime);\n const [endTime, setEndTime] = useState(item.toTime);\n const [guests, setGuests] = useState(item.units);\n const [units, setUnits] = useState(item.units);\n const maxGuests = datesAndGuests.guests;\n const modifiers = { start: startDate, end: endDate };\n\n const { formatDate, parseDate } = reactMoment;\n\n const [currentProductRate, setCurrentProductRate] = useState();\n\n const [hourlyRates, setHourlyRates] = useState([]);\n const [isHourlyRate, setIsHourlyRate] = useState(false);\n const [unitRates, setUnitRates] = useState([]);\n const [isUnitRate, setIsUnitRate] = useState(false);\n const [dayRates, setDayRates] = useState([]);\n const [isDailyRate, setIsDailyRate] = useState(false);\n const [isTimeRate, setIsTimeRate] = useState(false);\n const [timeRates, setTimeRates] = useState([]);\n const [unavailableMessage, setUnavailableMessage] = useState();\n\n const rates = vendor ? vendor.dailyRates : [];\n const [selectedProductRateType, setSelectedProductRateType] = useState(null); //vendorUnit.productRateTypeId\n const [selectedUnit, setSelectedUnit] = useState(null); //vendorUnitId\n const [selectedUnitName, setSelectedUnitName] = useState(getUnitNameFromVendorUnitId(rates, item.vendorUnitId));\n\n // useEffect(() => {\n // console.log(\"selectedUnitName\", selectedUnitName);\n // }, [selectedUnitName]);\n\n const [rangePickerMode, setRangePickerMode] = useState(true);\n\n const [unitRateTotal, setUnitRateTotal] = useState(0);\n\n const [errorsImg, setErrorsImg] = useState();\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const vendorImageUrl = errorsImg ? errorsImg : (vendor.description ?\n (vendor.description.vendorDescriptionImages.length > 0 ?\n ((vendor.description.vendorDescriptionImages[0].vendorImageUrl != undefined && vendor.description.vendorDescriptionImages[0].vendorImageUrl.length > 0) ? vendor.description.vendorDescriptionImages[0].vendorImageUrl\n : placeholderImgUrl)\n : placeholderImgUrl)\n : placeholderImgUrl);\n\n const startDateChanged = (date: Date) => {\n setStartDate(date);\n }\n\n const endDateChanged = (date: Date) => {\n setStartDate(date);\n }\n\n // const onGuestsInputChanged = (event: any) => {\n // setGuests(+event.target.value);\n // };\n\n const onUnitsInputChanged = (event: any) => {\n setUnits(+event.target.value);\n };\n\n // this is being sorted AFTER the default rate is selected from the rate sheet\n const unitOptions = vendorUnits.filter(u => !props.editable || u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n const startTimeOptions = startTimes.map((time: any, index: number) => (\n \n ));\n\n const endTimeOptions = endTimes.map((time: any, index: number) => (\n \n ));\n\n function getNumGuestsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < maxGuests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getNumUnitsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < guests; index++) {\n options.push();\n }\n\n return options;\n }\n function getPriceString() {\n if (brandSetting && brandSetting.usePkgPriceByCustom && itinerary.customItineraries && itinerary.customItineraries[0].itineraryUnits.length >= brandSetting.usePkgPriceByCustomNumber) return \"Package Price\";\n return \"$\" + (quoteStatus !== undefined ? item.sell.toFixed(2) : (unitRateTotal).toFixed(2));\n // return (0).toFixed(2);\n }\n\n useEffect(() => {\n console.log(\"vendor\", vendor);\n }, [vendor]);\n\n useEffect(() => {\n setStartDate(moment(item.fromDate).toDate());\n setEndDate(moment(item.toDate).toDate());\n setStartTime(item.fromTime);\n setEndTime(item.toTime);\n }, [item])\n\n useEffect(() => {\n if (vendor === undefined) return;\n\n let _vendorUnits = getAvailableVendorUnits(props.vendor.vendorUnits, rates, moment(startDate).format(\"MM/DD/YYYY\"));\n _vendorUnits.sort((a, b) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n\n if (a.unitName.toLowerCase() < b.unitName.toLowerCase()) return -1;\n if (a.unitName.toLowerCase() > b.unitName.toLowerCase()) return 1;\n\n return 0;\n });\n setVendorUnits(_vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection == selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n }\n }\n }, [vendor, startDate]);\n\n useEffect(() => {\n setIsDailyRate(false);\n setIsHourlyRate(false);\n setIsUnitRate(false);\n setIsTimeRate(false);\n\n if (selectedProductRateType == EnumProductRateType.DayRange) {\n setIsDailyRate(true);\n //multiple days\n setRangePickerMode(true);\n // setEndDate(props.maxDate);\n\n setStartTime(\"09:00\");\n // setEndTime(\"09:00\");\n }\n else if (selectedProductRateType == EnumProductRateType.HoursPerUnit) {\n setIsHourlyRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n setStartTime(\"09:00\");\n setEndTime(\"10:00\");\n\n }\n else if (selectedProductRateType == EnumProductRateType.UnitQtyRange) {\n setIsUnitRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n setStartTime(\"09:00\");\n\n }\n else if (selectedProductRateType == EnumProductRateType.UseTime) {\n setIsTimeRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n const unitTimeRates = vendor.dailyRates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates).filter(r => r.rateType == EnumProductRateType.UseTime);\n setTimeRates(unitTimeRates);\n }\n else if (selectedProductRateType == EnumProductRateType.UseUnit) {\n setIsUnitRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n }\n\n console.log(\"selectedProductRateType\", selectedProductRateType);\n }, [selectedProductRateType]);\n\n useEffect(() => {\n if (!selectedUnitName) {\n return;\n }\n\n let rateType = getRateTypeFromUnitName(vendor.dailyRates, selectedUnitName, startDate.toDateString());\n // console.log(\"rateType\", rateType);\n\n if (rateType == EnumProductRateType.UseTime) {\n const unitTimeRates = rates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates).filter(r => r.rateType == EnumProductRateType.UseTime);\n setTimeRates(unitTimeRates);\n }\n\n setSelectedProductRateType(rateType);\n }, [selectedUnitName]);\n\n useEffect(() => {\n if (!timeRates.length) {\n return;\n }\n // Set the start times.\n let newStartTimes: any[] = [];\n timeRates.forEach(r => {\n let start = moment(r.startTime, 'HH:mm');\n let end = moment(r.endTime, 'HH:mm');\n\n //start.minutes(Math.ceil(start.minutes() / 10) * 10); //this will round up minutes to 10: 8:10, 8:20\n let result: any[] = [];\n let current = moment(start);\n while (current <= end) {\n result.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a'),\n });\n current.add(10, 'minutes');\n }\n newStartTimes = newStartTimes.concat(result);\n });\n if (!!newStartTimes.length) {\n newStartTimes = [...new Map(newStartTimes.map(item => [item.value, item])).values()] // Remove any cross-over duplicates.\n newStartTimes.sort((a, b) => {\n // Sort by time.\n return moment(a.value, 'HH:mm').isBefore(moment(b.value, 'HH:mm')) ? -1 : 0;\n });\n setStartTime(newStartTimes[0].value);\n }\n setStartTimes(newStartTimes);\n }, [timeRates, selectedProductRateType]);\n\n useEffect(() => {\n if (!(isTimeRate && startTime)) {\n return;\n }\n\n // Find rate matching the time.\n const dateRates = rates.filter(a => moment(a.date).format('YYYY-MM-DD').toString() === moment(startDate).format('YYYY-MM-DD'));\n const timeRates = dateRates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates);\n const timeRate = timeRates.find(r => moment(r.startTime, 'HH:mm').isSame(moment(startTime, 'HH:mm')));\n\n if (!timeRate) {\n setUnavailableMessage(`No rates available for the selected time.`)\n setUnitRateTotal(0);\n return;\n }\n\n setUnavailableMessage('');\n setSelectedUnit(timeRate.vendorUnitId);\n const rate = new Decimal(timeRate.price).times(units);\n setUnitRateTotal(roundDecimal(rate).toNumber());\n }, [isTimeRate, timeRates, startTime, units, startDate, selectedUnitName]);\n\n useEffect(() => {\n if (!isDailyRate) {\n return;\n }\n\n const { productRates, noRateMessage } = getDailyRate(vendor.dailyRates, selectedUnitName, startDate.toDateString(), endDate.toDateString(), startTime, endTime);\n\n if (!!noRateMessage) {\n setUnavailableMessage(noRateMessage);\n return;\n }\n\n const rate = productRates.reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0)).times(units);\n setUnitRateTotal(roundDecimal(rate).toNumber());\n setUnavailableMessage(undefined);\n }, [isDailyRate, dayRates, units, startTime, endTime, startDate, endDate, selectedUnitName]);\n\n useEffect(() => {\n if (!(isHourlyRate && startTime && endTime)) {\n return;\n }\n\n var numberOfHours: number = moment.duration(moment(endTime, 'HH:mm').diff(moment(startTime, 'HH:mm'))).asHours();\n\n if (numberOfHours < 0) {\n //only 0-24 hours\n numberOfHours = moment.duration(moment(endTime, 'HH:mm').add(1, \"day\").diff(moment(startTime, 'HH:mm'))).asHours();\n }\n\n let hourlyRate = getHourlyRate(vendor.dailyRates, selectedUnitName, startTime, endTime);\n\n if (!hourlyRate) {\n setUnavailableMessage(`No rates available for ${numberOfHours} hours.`);\n setUnitRateTotal(0);\n return;\n }\n\n const rate = (new Decimal(hourlyRate.price).times(numberOfHours)).times(units);\n setCurrentProductRate(hourlyRate);\n setUnitRateTotal(roundDecimal(rate).toNumber());\n setUnavailableMessage(undefined);\n }, [isHourlyRate, hourlyRates, startTime, endTime, units, selectedUnit, startDate, selectedUnitName]);\n\n useEffect(() => {\n if (!isUnitRate) {\n return;\n }\n\n setUnavailableMessage('');\n\n //const productRates = unitRates.map(rd => rd.rates[0].rates[0]);\n const dateRates = rates.filter(a => moment(a.date).format('YYYY-MM-DD').toString() === moment(startDate).format('YYYY-MM-DD').toString());\n const unitRates = dateRates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName);\n const productRates = unitRates.flatMap(rd => rd.rates);\n\n if (productRates.length > 0) {\n setSelectedUnit(productRates[0].vendorUnitId);\n const rate = productRates.reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0)).times(units);\n\n setUnitRateTotal(roundDecimal(rate).toNumber());\n }\n else {\n setUnavailableMessage(`No rates available for the selected Date.`)\n setUnitRateTotal(0);\n return;\n }\n }, [isUnitRate, unitRates, units, startDate, selectedUnitName]);\n\n useEffect(() => {\n if (quoteRequested || bookNowRequested) {\n item.vendorUnitId = getVendorUnitIdFromUnitName(vendor.dailyRates, selectedUnitName);\n item.fromDate = moment(startDate).format(\"YYYY-MM-DD\");\n item.toDate = isDailyRate ? moment(endDate).format(\"YYYY-MM-DD\") : moment(startDate).format(\"YYYY-MM-DD\");\n item.fromTime = startTime;\n item.toTime = endTime;\n item.personPerUnit = guests;\n item.units = units;\n item.sell = unitRateTotal;\n\n item.isValid = isStringEmpty(unavailableMessage);\n }\n }, [quoteRequested, bookNowRequested]);\n\n return (\n \n {item.showOnItinerary && (\n <>\n {/* Golf Items */}\n {/* Desktop */}\n \n {/* Container for Golf Items */}\n {/* Image */}\n \n props.onVendorImageClick(props.vendor)}\n fluid\n />\n \n\n {/* Form */}\n \n \n \n {vendor ? vendor.vendorName : \"\"}\n \n \n {vendor ? vendor.city : \"\"}, {vendor ? vendor.state : \"\"}\n

\n
\n\n
\n {/* DatePickers */}\n \n \n Start Date\n \n \n \n\n {rangePickerMode && (\n
\n \n End Date\n \n \n
\n )}\n {/* From Time Select */}\n
\n\n
\n {/* To Time Select */}\n {(isHourlyRate || isDailyRate) && (\n
\n \n To Time\n \n {\n setEndTime(event.currentTarget.value)\n }}\n readOnly={quoteStatus !== undefined}\n disabled={quoteStatus !== undefined}\n >\n\n {endTimeOptions}\n \n
\n )}\n\n {isTimeRate && (\n
\n \n From Time\n \n {\n setStartTime(event.currentTarget.value);\n // setEndTime(null);\n }}\n readOnly={quoteStatus !== undefined}\n disabled={quoteStatus !== undefined}\n >\n\n {startTimeOptions}\n \n
\n )}\n {/*
\n \n Guests\n \n \n {getNumGuestsOptions()}\n \n
*/}\n
\n \n Units\n \n \n {getNumUnitsOptions()}\n \n
\n
\n\n
\n \n \n Unit Type\n \n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n \n\n {(quoteStatus == 20 || quoteStatus == 30 || quoteStatus == 60) && (\n
\n \n Confirmation #\n \n \n \n
\n )}\n {(quoteStatus == 40 || quoteStatus == 50) && (\n
\n \n Cancellation #\n \n \n \n
\n )}\n
\n \n\n {/* Buttons */}\n \n {quoteStatus === undefined && (\n {\n removeItem(item);\n // sameDayReplays.splice(itemIndex, 1);\n }}\n >\n Remove\n \n )}\n \n {/* If the quote is Booked Complete or Cancelled showing price is not necessary */}\n {(props.quoteStatus !== 30 && props.quoteStatus !== 40 && props.quoteStatus !== 50) && (props.quoteStatus !== 10 || !!!unavailableMessage) && (\n
\n

{!vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showCustomItemsPricing ? getPriceString() : \"Package Price\"}

\n
\n )}\n {(props.quoteStatus === 40 || props.quoteStatus === 50) && (\n
\n

{\"Cancelled\"}

\n
\n )}\n {(props.quoteStatus === undefined || props.quoteStatus === 10) && unavailableMessage && (\n

{unavailableMessage}

\n )}\n \n {/* */}\n
\n\n {/* Mobile */}\n \n
{vendor ? vendor.vendorName : \"\"}
\n

{moment(startDate).format(\"MMM Do, YYYY\")} - {moment(endDate).format(\"MMM Do, YYYY\")}

\n {/*

{item.} Guest{item.inUnit == 1 ? \"\" : \"s\"}

*/}\n

{item.units ? item.units : 1} Unit{item.units && item.units != 1 ? \"s\" : \"\"}\n  {selectedUnitName}\n

\n \n \n )}\n
\n );\n}\n\nexport default CustomItemTab;","import { yupResolver } from \"@hookform/resolvers\";\nimport React, { ChangeEventHandler, useContext, useEffect, useState } from \"react\";\nimport { Col, Form, Button, Spinner, Row } from \"react-bootstrap\";\nimport { useForm, useFieldArray } from \"react-hook-form\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport Customer from \"../../../../../../Data/Customer/Customer\";\nimport { ReservationCustomer } from \"../../../../../../Data/Reservation/ReservationCustomer\";\nimport { DatesAndGuests } from \"../../../widget-form/WidgetForm\";\nimport { RequestQuoteFormData, RequestQuoteSchema, RequestQuoteSchemaDefaultValues } from \"../../widget-modals/schemas/RequestQuoteSchema\";\n\ninterface props {\n // datesAndGuests: DatesAndGuests;\n requestItineraryQuote: (customers: ReservationCustomer[], groupName: string | undefined, fromBooking: boolean) => void;\n isLoading: boolean;\n}\n\nconst GetQuote: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint, datesAndGuests, companyId } = useContext(WidgetContext);\n\n const [travelerCount, setTravelerCount] = useState([]);\n const { requestItineraryQuote, isLoading } = props;\n\n // const [validated, setValidated] = useState(false);\n const { register, control, handleSubmit, errors, formState, setValue, reset, getValues } = useForm({\n mode: \"onSubmit\",\n resolver: yupResolver(RequestQuoteSchema),\n defaultValues: RequestQuoteSchemaDefaultValues\n });\n\n useFieldArray(\n {\n control,\n name: \"travelers\",\n keyName: \"keyId\",\n }\n );\n\n function submit(formData: RequestQuoteFormData) {\n const customers: ReservationCustomer[] = [];\n const customer: ReservationCustomer = {\n reservationId: 0,\n customerId: 0,\n customer: {\n companyId: companyId as number,\n customerId: 0,\n isActive: true,\n firstName: formData.firstName,\n lastName: formData.lastName,\n emailAddress: formData.email,\n streetAddress: \"\",\n city: \"\",\n state: \"\",\n country: \"\",\n zipCode: \"\",\n phone1: formData.phone,\n customerNotes: formData.comments,\n },\n paymentAllocationCategoryId: undefined,\n paymentAllocationCategory: undefined,\n cancelled: false\n };\n\n customers.push(customer);\n\n if (formData.travelers !== undefined) {\n formData.travelers.forEach(t => {\n const traveler: ReservationCustomer = {\n reservationId: 0,\n customerId: 0,\n customer: {\n companyId: companyId as number,\n customerId: 0,\n isActive: true,\n firstName: t.firstName,\n lastName: t.lastName,\n emailAddress: t.email,\n streetAddress: \"\",\n city: \"\",\n state: \"\",\n country: \"\",\n zipCode: \"\",\n phone1: \"\",\n customerNotes: \"\",\n },\n paymentAllocationCategoryId: undefined,\n paymentAllocationCategory: undefined,\n cancelled: false\n };\n\n customers.push(traveler);\n });\n }\n\n requestItineraryQuote(customers, formData.groupName, false);\n }\n\n useEffect(() => {\n if (errors)\n console.log(\"form errors\", errors);\n }, [errors]);\n\n return (\n \n
\n \n {/* Travel / Party */}\n \n \n Contact Info\n \n \n\n
\n \n \n {/* \n First Name\n */}\n \n\n \n {errors.firstName && errors.firstName.message}\n \n \n \n {/* \n Last Name\n */}\n \n\n \n {errors.lastName && errors.lastName.message}\n \n \n \n \n \n {/* \n Email Address\n */}\n \n\n \n {errors.email && errors.email.message}\n \n \n \n {/* \n Contact Phone\n */}\n \n \n\n \n {errors.phone && errors.phone.message}\n \n \n \n\n \n \n {/* \n Group Name\n */}\n \n\n {/* \n {errors.groupName && errors.firstName.message}\n */}\n \n \n\n {/* Comments */}\n \n \n {/* Comments */}\n \n \n \n\n {/* Send Itinerary to Your Friends */}\n {datesAndGuests.guests !== 1 &&\n \n \n Send Itinerary to Your Friends\n \n \n }\n\n {/* Co Traveler Form */}\n {travelerCount.map((a: number) =>\n 0 ? \"mt-2\" : \"\"}`}>\n \n {/* First Name */}\n \n \n \n {/* Last Name */}\n \n \n \n {/* \n Email Address\n */}\n \n \n \n )}\n\n {travelerCount.length < datesAndGuests.guests - 1 &&\n \n { setTravelerCount([...travelerCount, travelerCount.length]); }}\n >\n + Add co-traveler\n \n \n }\n\n\n\n {/* Button */}\n \n \n \n {isLoading && (\n \n )}\n {isLoading ? \"Saving...\" : \"Save & Get Quote\"}\n \n \n \n \n \n
\n
\n );\n}\n\nexport default GetQuote;\n","import Decimal from \"decimal.js\";\nimport Itinerary from \"../Itinerary\";\nimport { ReservationCustomer } from \"./ReservationCustomer\";\nimport { PaymentAllocationCategoryItem } from \"./PaymentAllocationCategoryItem\";\nimport ReservationGuest from \"./ReservationGuest\";\n\nexport class PaymentAllocationCategory {\n paymentAllocationCategoryId!: number;\n reservationId!: number;\n categoryName!: string;\n allocationItems!: PaymentAllocationCategoryItem[];\n allocationLines?: number;\n\n static getCost(allocationCategory: PaymentAllocationCategory | undefined, itinerary: Itinerary, reservationGuestsCount: number): number {\n if (!!!allocationCategory || allocationCategory.categoryName === \"Even Split\" || !allocationCategory.allocationLines) return 0.0;\n\n let cost: number = 0.0;\n\n if (itinerary.lodgingItineraries && itinerary.lodgingItineraries.length > 0) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n const allocationItem = allocationCategory.allocationItems.find(ai => ai.itineraryUnitId === u.id && !u.cancelled)\n if (allocationItem != undefined) {\n if (allocationItem.evenSplit) {\n let price = new Decimal(u.sell).dividedBy(reservationGuestsCount);\n price = price.mul(allocationCategory.allocationLines || 1); // doing this because later we divide the cost by how many people have this allocation\n\n cost += price.toNumber();\n return;\n }\n\n if (allocationItem.numberGuestsPayingFor === 0 || allocationItem.numberUnitsPayingFor === 0) return;\n\n const perUnitPrice = new Decimal(u.sell).dividedBy(u.numberOfUnits);\n const unitsPayingFor = allocationItem.numberUnitsPayingFor > 0 ? allocationItem.numberUnitsPayingFor : u.numberOfUnits;\n const priceOfUnits = perUnitPrice.mul(unitsPayingFor);\n\n const guestsPayingFor = allocationItem.numberGuestsPayingFor > 0 ? allocationItem.numberGuestsPayingFor : 1;\n const perGuestPrice = priceOfUnits.dividedBy(allocationItem.numberUnitsPayingFor > 0 ? guestsPayingFor : u.guestsInUnit);\n\n cost += perGuestPrice.mul(guestsPayingFor).toNumber();\n }\n }));\n }\n\n if (itinerary.golfItineraries && itinerary.golfItineraries.length > 0) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n const allocationItem = allocationCategory.allocationItems.find(ai => ai.itineraryUnitId === u.id && !u.cancelled)\n if (allocationItem != undefined) {\n const perPlayerPrice = new Decimal(u.sell).dividedBy(u.players);\n\n cost += perPlayerPrice.mul(allocationItem.numberGuestsPayingFor).toNumber();\n }\n }))\n }\n\n if (itinerary.transportItineraries && itinerary.transportItineraries.length > 0) {\n itinerary.transportItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n const allocationItem = allocationCategory.allocationItems.find(ai => ai.itineraryUnitId === u.id && !u.cancelled)\n if (allocationItem != undefined) {\n if (allocationItem.evenSplit) {\n let price = new Decimal(u.sell).dividedBy(reservationGuestsCount);\n price = price.mul(allocationCategory.allocationLines || 1); // doing this because later we divide the cost by how many people have this allocation\n\n cost += price.toNumber();\n return;\n }\n\n if (allocationItem.numberGuestsPayingFor === 0 || allocationItem.numberUnitsPayingFor === 0) return;\n\n const perUnitPrice = new Decimal(u.sell).add(u.tax1).dividedBy(u.units);\n const perGuestPrice = new Decimal(u.sell).add(u.tax1).dividedBy(u.inUnit);\n const unitsPayingFor = allocationItem.numberUnitsPayingFor > 0 ? allocationItem.numberUnitsPayingFor : 1;\n const guestsPayingFor = allocationItem.numberGuestsPayingFor > 0 ? allocationItem.numberGuestsPayingFor : 1;\n\n // cost += perUnitPrice.mul(unitsPayingFor).toNumber();\n cost += perGuestPrice.mul(guestsPayingFor).toNumber();\n }\n }))\n }\n\n if (itinerary.customItineraries && itinerary.customItineraries.length > 0) {\n itinerary.customItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n const allocationItem = allocationCategory.allocationItems.find(ai => ai.itineraryUnitId === u.id && !u.cancelled)\n if (allocationItem != undefined) {\n const perUnitPrice = new Decimal(u.sell).add(u.tax1).dividedBy(u.units);\n\n cost += perUnitPrice.mul(allocationItem.numberUnitsPayingFor).toNumber();\n }\n }))\n }\n\n if (itinerary.adjustments && itinerary.adjustments.length > 0) {\n itinerary.adjustments.forEach(u => {\n const allocationItem = allocationCategory.allocationItems.find(ai => ai.adjustmentId === u.id && !u.cancelled)\n if (allocationItem != undefined) {\n if (allocationItem.evenSplit) {\n let price = new Decimal(u.sell).dividedBy(u.numUnits);\n price = price.mul(allocationCategory.allocationLines || 1); // doing this because later we divide the cost by how many people have this allocation\n\n cost += price.toNumber();\n return;\n }\n\n const perUnitPrice = new Decimal(u.sell);\n\n cost += perUnitPrice.mul(allocationItem.numberUnitsPayingFor).toNumber();\n }\n });\n }\n\n return new Decimal(cost).dividedBy(!!allocationCategory.allocationLines ? allocationCategory.allocationLines : 1).toDecimalPlaces(2).toNumber();\n }\n\n static getTotalAllocationLines(allocationCatagories: PaymentAllocationCategory[]): number {\n let count = 0;\n\n allocationCatagories.forEach(cat => {\n if (cat.categoryName !== \"Even Split\")\n count += cat.allocationLines ? cat.allocationLines : 0;\n });\n\n return count;\n }\n\n static getGuestCount(reservationGuests: ReservationGuest[], allocationCategory: PaymentAllocationCategory | undefined): number {\n if (allocationCategory === undefined) return 0;\n\n let count = 0;\n reservationGuests.forEach(g => {\n if (g.paymentAllocationCategoryId === allocationCategory.paymentAllocationCategoryId && !g.cancelled)\n count++;\n })\n\n return count;\n }\n\n static getTotalAllocationsCost(allocationCatagories: PaymentAllocationCategory[], itinerary: Itinerary, reservationGuestsCount: number): number {\n let total = 0.0;\n\n allocationCatagories.forEach(cat => {\n total += new Decimal(PaymentAllocationCategory.getCost(cat, itinerary, reservationGuestsCount)).mul(cat.allocationLines ? cat.allocationLines : 0).toDecimalPlaces(2).toNumber();\n });\n\n return total;\n }\n}","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport { ReservationCustomer } from \"../../../../../Data/Reservation/ReservationCustomer\";\n\nconst UseGetGlacierCompanyByResOrCompanyIdToken = (request?: Request) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/glacier-token?${(request.reservationId !== undefined ? \"&reservationId=\" + request.reservationId : \"\")}${(request.companyId !== undefined ? \"&companyId=\" + request.companyId : \"\")}`;\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetResponse = fetchResponse.data;\n setData(response);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default UseGetGlacierCompanyByResOrCompanyIdToken;\n\ninterface Request extends FetchResponse {\n reservationId?: number;\n companyId?: number;\n}\n\nexport interface GetResponse extends FetchResponse {\n data: any\n}","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport { ReservationCustomer } from \"../../../../../Data/Reservation/ReservationCustomer\";\nimport { GlacierCustomer } from \"../itinerary/make-payment/MakePayment\";\n\nconst useGetGlacierCustomer = (request?: ReservationCustomer) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/reservations/${request.reservationId}/customers/${request.customerId}`;\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GlacierCustomer = fetchResponse.data;\n setData(response);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useGetGlacierCustomer;","import * as yup from \"yup\";\n\n// Yup schema for field validations\nexport const MakePaymentSchema = yup.object().shape({\n billingAddress: yup.string().required(\"Required\"),\n billingCity: yup.string().required(\"Required\"),\n billingCountry: yup.string().required(\"Required\"),\n billingEmail: yup.string().required(\"Required\"),\n billingFirstName: yup.string().required(\"Required\"),\n billingLastName: yup.string().required(\"Required\"),\n billingState: yup.string().required(\"Required\"),\n billingZip: yup.string().required(\"Required\"),\n otherAmount: yup.number().when(\"otherAmountCheck\", {\n is: true,\n then: yup.number().required().min(0.01, \"Must be at least 0.01\"),\n }),\n agentTip: yup.number().notRequired(),\n termsCheck: yup.bool().oneOf([true], \"You must accept the Terms and Conditions\")\n});\n\nexport type MakePaymentFormData = yup.InferType;\n\nexport const MakePaymentSchemaDefaultValues: MakePaymentFormData = {\n billingAddress: \"\",\n billingCity: \"\",\n billingCountry: \"\",\n billingEmail: \"\",\n billingFirstName: \"\",\n billingLastName: \"\",\n billingState: \"\",\n billingZip: \"\",\n otherAmount: 0.0,\n agentTip: 0.0,\n termsCheck: false,\n};","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\n\nconst useValidateReCaptcha = (request: ValidateReCaptchaRequest | null) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request === null) return;\n\n let url: string = `${apiString}/api/v1.0/customer-portal/recaptcha`;\n setFetchRequest({\n url: url,\n method: 'POST',\n body: request\n });\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: ValidateReCaptchaResponse = fetchResponse.data;\n setData(response);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"validate reCaptcha fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useValidateReCaptcha;\n\nexport interface ValidateReCaptchaResponse extends FetchResponse { }\n\nexport interface ValidateReCaptchaRequest {\n token: string;\n}","import \"../itinerary.css\"\nimport { yupResolver } from \"@hookform/resolvers\";\nimport Decimal from \"decimal.js\";\nimport React, { useContext, useEffect, useState, useRef } from \"react\";\nimport { Col, Form, Button, Row, Spinner, Modal } from \"react-bootstrap\";\nimport { useForm } from \"react-hook-form\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport Quote from \"../../../../../../Data/Quote/Quote\";\nimport { PaymentAllocationCategory } from \"../../../../../../Data/Reservation/PaymentAllocationCategory\";\nimport { ReservationCustomer } from \"../../../../../../Data/Reservation/ReservationCustomer\";\nimport { Constants } from \"../../../../../../_helpers/Constants\";\nimport { NormalizeCurrencyInput, isStringEmpty } from \"../../../../../../_helpers/Functions\";\nimport useFetch, { FetchRequest } from \"../../../../../../_helpers/UseFetchHook\";\nimport Checkbox from \"../../../assets/check-box/CheckBox\";\nimport useGetGlacierCompanyToken from \"../../data-service-hooks/UseGetGlacierCompanyByResOrCompanyIdToken\";\nimport useGetGlacierCustomer from \"../../data-service-hooks/UseGetGlacierCustomer\";\nimport { MakePaymentFormData, MakePaymentSchema, MakePaymentSchemaDefaultValues } from \"../../widget-modals/schemas/MakePaymentScheme\";\nimport parse from 'html-react-parser';\nimport ViewPort from \"../../../../../../_helpers/Enums/ViewPortEnum\";\nimport ReCAPTCHA from \"react-google-recaptcha\";\nimport useValidateReCaptcha, { ValidateReCaptchaRequest } from \"../../data-service-hooks/UseValidateReCaptcha\";\nimport StartWidgetBrandSetting from \"../../../../../../Data/StartWidgetBrandSetting\";\n\ninterface props {\n // itinerary: Itinerary;\n quote: Quote;\n payingCustomer: ReservationCustomer | undefined;\n onPaymentMade: (data: any) => void;\n onError: (error: any) => void;\n}\n\nexport interface GlacierCustomer {\n billingFirstName: string,\n billingLastName: string,\n billingAddress: string,\n billingCity: string,\n billingState: string,\n billingZip: string,\n billingCountry: string,\n billingEmail: string,\n paymentToken?: string,\n ccType?: string,\n ccNumber?: string,\n ccExpiration?: string,\n}\n\nconst MakePayment: React.FC = (props) => {\n const { datesAndGuests, /* brandId */brand, brandSettings, viewPortBreakPoint } = useContext(WidgetContext);\n\n const { quote } = props;\n\n const [payingCustomer, setPayingCustomer] = useState(props.payingCustomer);\n // const [customerPayments, setCustomerPayments] = useState([]);\n const brandSetting: StartWidgetBrandSetting = brandSettings.find(s => s.brandId === brand?.brandId) as StartWidgetBrandSetting;\n\n const [paymentOption, setPaymentOption] = useState(\"split\");\n let _paymentOption: string = \"split\";\n\n const [fetchGlacierTokenRequest, setGlacierTokenRequest] = useState();\n const fetchGlacierTokenResponse = useGetGlacierCompanyToken(fetchGlacierTokenRequest);\n const [isLoading, setIsLoading] = useState(true);\n const [glacierToken, setGlacierToken] = useState(null);\n const [submitting, setSubmitting] = useState(false);\n\n const [fetchGlacierCustomerRequest, setGlacierCustomerRequest] = useState();\n const fetchGlacierCustomerResponse = useGetGlacierCustomer(fetchGlacierCustomerRequest);\n const [glacierCustomer, setGlacierCustomer] = useState(null);\n const [submitPaymentRequest, setSubmitPaymentRequest] = useState();\n const submitPaymentResponse = useFetch(submitPaymentRequest);\n const [paymentErrors, setPaymentErrors] = useState([]);\n\n const [submitted, setSubmitted] = useState(false);\n const [ccnumberInvalid, setCCNumberInvalid] = useState(false);\n const [ccNumberValidated, setccNumberValidated] = useState(false);\n const [ccnumberInvalidFeedback, setCCNumberInvalidFeedback] = useState(null);\n const [ccexpInvalid, setCCExpInvalid] = useState(false);\n const [ccExpValidated, setccExpValidated] = useState(false);\n const [ccexpInvalidFeedback, setCCExpInvalidFeedback] = useState(null);\n const [cvvInvalid, setCVVInvalid] = useState(false);\n const [cvvValidated, setCVVValidated] = useState(false);\n const [cvvInvalidFeedback, setCVVInvalidFeedback] = useState(null);\n\n const [validateReCaptchaRequest, setValidateReCaptchaRequest] = useState(null);\n const validateReCaptchaResponse = useValidateReCaptcha(validateReCaptchaRequest);\n const captchaRef = useRef(null);\n const [captcha, setCaptcha] = useState(null);\n\n const itinerary = {\n lodgingItineraries: quote.reservation.lodgingItineraries,\n golfItineraries: quote.reservation.golfItineraries,\n transportItineraries: quote.reservation.transportItineraries,\n customItineraries: quote.reservation.customItineraries,\n adjustments: quote.reservation.adjustments\n }\n\n const paymentAllocations: PaymentAllocationCategory[] = quote.reservation.paymentCategories ? quote.reservation.paymentCategories : [];\n const hasAllocations = paymentAllocations.length > 0;\n\n const balanceDue = new Decimal(quote.reservation.balanceDue ? quote.reservation.balanceDue : 0.0).toDecimalPlaces(2).toNumber();\n const totalSell = new Decimal(quote.reservation.totalSell ? quote.reservation.totalSell : 0.0).toDecimalPlaces(2).toNumber();\n\n const evenCategory = paymentAllocations.find(a => a.categoryName === \"Even Split\");\n const evenPersonsToDivideBy = quote.reservation.numGuests - PaymentAllocationCategory.getTotalAllocationLines(paymentAllocations);\n\n const priceMinusCategories = new Decimal(totalSell - PaymentAllocationCategory.getTotalAllocationsCost(paymentAllocations, itinerary, quote.reservation.numGuests - quote.reservation.reservationCustomers.filter(c => c.cancelled).length)).toDecimalPlaces(2).toNumber();\n const evenPerPersonPrice = new Decimal(priceMinusCategories).dividedBy(evenPersonsToDivideBy === 0 ? 1 : evenPersonsToDivideBy).toDecimalPlaces(2).toNumber();\n\n const [fullPaymentPrice, setFullPaymentPrice] = useState(0.0);\n const [splitPaymentPrice, setSplitPaymentPrice] = useState(0.0); // if customer has allocation use that else if even split defined, use that, else reservation balanceDue\n const [depositPrice, setDepositPrice] = useState(0.0);\n const [paymentsMadeTotal, setPaymentsMadeTotal] = useState(0);\n const [selectedCustomerPaymentsAmount, setSelectedCustomerPaymentsAmount] = useState(0);\n\n const [agentTip, setAgentTip] = useState(\"0.00\");\n const [paymentAmount, setPaymentAmount] = useState(0);\n\n const [showTerms, setShowTerms] = useState();\n\n const { register, handleSubmit, errors, formState, setValue, reset, getValues } = useForm({\n mode: \"onBlur\",\n resolver: yupResolver(MakePaymentSchema),\n defaultValues: MakePaymentSchemaDefaultValues\n });\n\n const _setPaymentOption = (option: string) => {\n setPaymentOption(option);\n\n const tip = NormalizeCurrencyInput(agentTip);\n setPaymentAmount(option === \"split\" ? splitPaymentPrice + +tip : (option === \"full\" ? fullPaymentPrice + +tip : depositPrice + +tip));\n }\n\n const onAgentTip = (event: any) => {\n const value = event.currentTarget.value;\n if (!value) {\n // setAgentTip(\"0.00\");\n return;\n }\n\n const tip = NormalizeCurrencyInput(value);\n const payment = paymentOption === \"full\" ? fullPaymentPrice : (paymentOption === \"split\" ? splitPaymentPrice : depositPrice);\n setAgentTip(tip);\n // setAgentTip(new Decimal(value).toDecimalPlaces(2).toNumber());\n setPaymentAmount(payment + +tip);\n }\n\n useEffect(() => {\n const payments = quote.reservation.payments ? quote.reservation.payments : [];\n const paymentsAmount = payments.reduce(function (acc, obj) { return new Decimal(acc).add(obj.paymentAmount).toNumber(); }, 0);\n const tipsAmount = payments.reduce(function (acc, obj) { return new Decimal(acc).add(obj.tipAmount).toNumber(); }, 0);\n\n console.log(\"paymentsAmount\", paymentsAmount);\n\n setPaymentsMadeTotal(paymentsAmount - tipsAmount);\n }, [quote]);\n\n useEffect(() => {\n if (payingCustomer) {\n setGlacierCustomerRequest(payingCustomer);\n setGlacierTokenRequest(payingCustomer);\n\n if (payingCustomer.customerId === quote.reservation.leadCustomerId) {\n _setPaymentOption(\"full\");\n _paymentOption = \"full\";\n }\n else if (paymentAllocations.length > 0) {\n _setPaymentOption(\"split\");\n _paymentOption = \"split\";\n }\n else {\n _setPaymentOption(\"full\");\n _paymentOption = \"full\";\n }\n\n //set customer payments history\n const payments = quote.reservation.payments;\n const custPayments = payments ? payments.filter(p => p.customerId === payingCustomer.customerId) : []\n\n let customerPaymentsAmount = (custPayments.filter(p => p.status === null || p.status === undefined || p.status == \"Complete\" || p.status == \"Pending\" || p.paymentTypeId === 20)\n .reduce(function (acc, obj) { return new Decimal(acc).add(obj.paymentAmount).toNumber(); }, 0));\n const customerTipsAmount = (custPayments.filter(p => p.status === null || p.status === undefined || p.status == \"Complete\" || p.status == \"Pending\" || p.paymentTypeId === 20)\n .reduce(function (acc, obj) { return new Decimal(acc).add(obj.tipAmount).toNumber(); }, 0));\n customerPaymentsAmount -= customerTipsAmount;\n\n setSelectedCustomerPaymentsAmount(customerPaymentsAmount);\n\n let price = 0.0;\n if ((payingCustomer.paymentAllocationCategory === null || payingCustomer.paymentAllocationCategory === undefined))\n price = evenCategory === undefined ? balanceDue : evenPerPersonPrice;\n else {\n if (evenCategory !== undefined && payingCustomer.paymentAllocationCategoryId === evenCategory.paymentAllocationCategoryId) price = evenPerPersonPrice;\n else price = PaymentAllocationCategory.getCost(payingCustomer.paymentAllocationCategory, itinerary, quote.reservation.numGuests - quote.reservation.reservationCustomers.filter(c => c.cancelled).length);\n }\n\n const totalSell = quote.reservation.totalSell as number;\n const fullPrice = quote.reservation.balanceDue !== undefined ? quote.reservation.balanceDue : 0.0;\n let deposit = 0.0;\n\n setFullPaymentPrice(fullPrice);\n setSplitPaymentPrice(price - customerPaymentsAmount);\n\n if (props.payingCustomer === undefined) {\n deposit = brandSetting.downPaymentType === \"$\" ? brandSetting.downPayment : (((brandSetting.downPayment / 100) * totalSell) - customerPaymentsAmount);\n }\n else {\n deposit = brandSetting.downPaymentType === \"$\" ? brandSetting.downPayment : (((brandSetting.downPayment / 100) * price)) - customerPaymentsAmount;\n }\n\n setDepositPrice(deposit);\n\n setPaymentAmount(_paymentOption === \"split\" ? price - customerPaymentsAmount : (_paymentOption === \"full\" ? fullPrice : deposit));\n } else {\n setPayingCustomer(quote.reservation.reservationCustomers[0]);\n }\n }, [payingCustomer]);\n\n useEffect(() => {\n if (fetchGlacierCustomerResponse.data) {\n setGlacierCustomer(fetchGlacierCustomerResponse.data);\n }\n }, [fetchGlacierCustomerResponse.data]);\n\n useEffect(() => {\n if (fetchGlacierTokenResponse.data) {\n setGlacierToken((fetchGlacierTokenResponse.data as any).token);\n }\n }, [fetchGlacierTokenResponse.data]);\n\n useEffect(() => {\n if (fetchGlacierTokenResponse.error) {\n console.log(\"glacier fetch error\", fetchGlacierTokenResponse.error);\n }\n }, [fetchGlacierTokenResponse.error]);\n\n useEffect(() => {\n if (glacierToken) {\n // Add the js script.\n setIsLoading(true);\n //outputIsBusy(true);\n\n const existingScript = document.getElementById('glacier');\n if (!!existingScript) {\n existingScript.remove();\n }\n const script = document.createElement('script');\n script.src = 'https://secure.glacierpaygateway.com/token/Collect.js';\n script.id = 'glacier';\n script.setAttribute('data-tokenization-key', glacierToken);\n document.body.appendChild(script);\n script.onload = () => {\n configureGlacier();\n };\n }\n }, [glacierToken]);\n\n useEffect(() => {\n if (glacierCustomer && !isStringEmpty(glacierCustomer.paymentToken)) {\n setSubmitPaymentRequest({\n url: `${Constants.apiUrl}/api/v1.0/customer/${payingCustomer && payingCustomer.customerId}/pay/${payingCustomer && payingCustomer.reservationId}/payments`,\n method: 'POST',\n body: { ...glacierCustomer, billingPrice: +(paymentAmount.toFixed(2)), tipAmount: +agentTip }\n });\n };\n }, [glacierCustomer && glacierCustomer.paymentToken]);\n\n useEffect(() => {\n _paymentOption = paymentOption;\n }, [paymentOption]);\n\n const submitForm = (formData: any) => {\n // make the call to verify the captcha\n if (captchaRef !== null && captchaRef.current !== null) {\n // const token = formData[\"g-recaptcha-response\"];\n const token = captchaRef.current.getValue();\n if (!isStringEmpty(token))\n setValidateReCaptchaRequest({ token });\n }\n }\n\n useEffect(() => {\n if (validateReCaptchaResponse.data === null) return;\n console.log(\"validateReCaptchaResponse\", validateReCaptchaResponse);\n\n if (validateReCaptchaResponse.data.success) submitPayment();\n else captchaRef.current.reset();\n\n setValidateReCaptchaRequest(null);\n\n }, [validateReCaptchaResponse.data]);\n\n const submitPayment = () => {\n if (ccNumberValidated && ccExpValidated && cvvValidated) {\n // Submit the form.\n setSubmitted(false);\n setSubmitting(true);\n //outputIsBusy(true);\n (window as any).CollectJS.startPaymentRequest();\n }\n else {\n setCCNumberInvalid(ccNumberValidated);\n setCCExpInvalid(ccExpValidated);\n setCVVInvalid(cvvValidated);\n }\n }\n\n const configureGlacier = () => {\n (window as any).CollectJS.configure({\n 'variant': 'inline',\n 'paymentType': 'cc',\n 'customCss': {\n 'font-family': 'sans-serif',\n 'padding-left': '10px',\n 'font-color': \"red\"\n },\n 'fields': {\n 'ccnumber': {\n 'selector': '#ccnumber',\n 'placeholder': 'Card Number'\n },\n 'ccexp': {\n 'selector': '#ccexp',\n 'placeholder': 'Expiry'\n },\n 'cvv': {\n 'display': 'required',\n 'selector': '#cvv',\n 'placeholder': 'CVV'\n },\n },\n 'validationCallback': (field: any, valid: boolean, message: any) => {\n if (!valid) {\n setSubmitted(false);\n setSubmitting(false);\n // outputIsBusy(false);\n // outputToken(null);\n }\n\n validationCallback(field, valid, message);\n },\n 'timeoutDuration': 5000,\n 'timeoutCallback': () => {\n clearAllValidation();\n console.log(\"The tokenization didn't respond in the expected timeframe. This could be due to an invalid or incomplete field or poor connectivity\");\n },\n 'fieldsAvailableCallback': () => {\n setIsLoading(false);\n // outputIsBusy(false);\n },\n 'callback': (response: any) => {\n setSubmitting(false);\n // outputIsBusy(false);\n setSubmitted(true);\n // outputToken(response.token);\n setGlacierCustomer({\n billingFirstName: `${getValues(\"billingFirstName\")}`,\n billingLastName: `${getValues(\"billingLastName\")}`,\n billingAddress: getValues(\"billingAddress\"),\n billingCity: getValues(\"billingCity\"),\n billingState: getValues(\"billingState\"),\n billingZip: getValues(\"billingZip\"),\n billingCountry: getValues(\"billingCountry\"),\n billingEmail: getValues(\"billingEmail\"),\n paymentToken: response.token\n });\n }\n });\n }\n\n const clearAllValidation = () => {\n setCCNumberInvalid(true);\n setccNumberValidated(false);\n setCCNumberInvalidFeedback(null);\n setCCExpInvalid(true);\n setccExpValidated(false);\n setCCExpInvalidFeedback(null);\n setCVVInvalid(true);\n setCVVValidated(false);\n setCVVInvalidFeedback(null);\n }\n\n const setValidated = (field: string) => {\n if (field == 'ccnumber') {\n setccNumberValidated(true);\n setCCNumberInvalid(false);\n setCCNumberInvalidFeedback(null);\n }\n if (field == 'ccexp') {\n setccExpValidated(true);\n setCCExpInvalid(false);\n setCCExpInvalidFeedback(null);\n }\n if (field == 'cvv') {\n setCVVValidated(true);\n setCVVInvalid(false);\n setCVVInvalidFeedback(null);\n }\n }\n\n const validationCallback = (field: any, valid: boolean, message: any) => {\n if (valid) {\n setValidated(field);\n return;\n }\n\n if (field == \"ccnumber\") {\n setccNumberValidated(false);\n setCCNumberInvalid(true);\n // setCCNumberInvalidFeedback(message);\n setCCNumberInvalidFeedback(\"Required\");\n } else if (field == \"ccexp\") {\n setccExpValidated(false);\n setCCExpInvalid(true);\n // setCCExpInvalidFeedback(message);\n setCCExpInvalidFeedback(\"Required\");\n } else if (field == \"cvv\") {\n setCVVValidated(false);\n setCVVInvalid(true);\n // setCVVInvalidFeedback(message);\n setCVVInvalidFeedback(\"Required\");\n }\n }\n\n const customerSelected = (event: any) => {\n setPayingCustomer(quote.reservation.reservationCustomers.find(rc => rc.customerId == event.target.value));\n }\n\n const paymentOptionChanged = (event: any) => {\n _setPaymentOption(event.target.value);\n }\n\n // function getFullPaymentSpaces() {\n // const spaceCount = viewPortBreakPoint < ViewPort.lg ? 30 : 37;\n // const space = \"\\xa0\";\n // const priceString = paymentAmount.toFixed(2);\n // const splitString = priceString.split(\".\");\n // const charCount = splitString[0].length;\n // return space.repeat(spaceCount - charCount);\n // }\n\n // function getSplitPaymentSpaces() {\n // const spaceCount = viewPortBreakPoint < ViewPort.lg ? 29 : 36;\n // const space = \"\\xa0\";\n // const priceString = paymentAmount.toFixed(2);\n // const splitString = priceString.split(\".\");\n // const charCount = splitString[0].length;\n // return space.repeat(spaceCount - charCount);\n // }\n\n // function getDepositPaymentSpaces() {\n // const spaceCount = viewPortBreakPoint < ViewPort.lg ? 29 : 37;\n // const space = \"\\xa0\";\n // const priceString = paymentAmount.toFixed(2);\n // const splitString = priceString.split(\".\");\n // const charCount = splitString[0].length;\n // return space.repeat(spaceCount - charCount);\n // }\n\n function parseTerms(): any {\n let data = brandSetting.brand.termsAndConditions;\n\n const tags = {\n \"\": brandSetting.brand.company.companyName,\n \"\": brandSetting.brand.company.phone,\n \"\": brandSetting.brand.brandName,\n \"\": brandSetting.brand.phone,\n \"<COMPANY>\": brandSetting.brand.company.companyName,\n \"<COMPANYPHONE>\": brandSetting.brand.company.phone,\n \"<BRAND>\": brandSetting.brand.brandName,\n \"<BRANDPHONE>\": brandSetting.brand.phone,\n }\n\n for (const [key, value] of Object.entries(tags)) {\n // console.log(`${key}: ${value}`);\n const rgx = new RegExp(key, 'g');\n if (value !== undefined && value !== null) {\n data = data.replace(rgx, value.toString());\n }\n }\n\n return parse(data);\n }\n\n useEffect(() => {\n // console.log(\"payment response\", submitPaymentResponse);\n if (submitPaymentResponse.data) {\n captchaRef.current.reset();\n // console.log(\"payment response data\", submitPaymentResponse.data);\n if (submitPaymentResponse.data.success && payingCustomer != undefined) {\n props.onPaymentMade({ customerId: payingCustomer.customerId, amount: paymentAmount, tipAmount: +agentTip, statusId: submitPaymentResponse.data.reservationStatus });\n } else {\n props.onError({ error: submitPaymentResponse.data.message });\n }\n }\n }, [submitPaymentResponse.data]);\n\n useEffect(() => {\n if (errors && Object.keys(errors).length > 0)\n console.log(\"form errors\", errors);\n }, [errors]);\n\n return (\n \n \n {/* Itinerary Info */}\n {/* Desktop */}\n {/*
\n \n

Itinerary# {quote.reservation.itineraryNumber}

\n

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n

{datesAndGuests.guests}{` Guest${datesAndGuests.guests > 1 ? \"s\" : \"\"}`}

\n \n
*/}\n {/* Itinerary Info */}\n {/* Mobile */}\n {/*
\n \n

Itinerary# {quote.reservation.itineraryNumber}

\n \n \n

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n \n \n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n \n \n

{datesAndGuests.guests}{` Guest${datesAndGuests.guests > 1 ? \"s\" : \"\"}`}

\n \n \n \n
*/}\n\n {/* Billing Info */}\n \n

Billing Info

\n \n \n\n
\n \n \n {/* First Name */}\n \n\n \n {errors.billingFirstName && errors.billingFirstName.message}\n \n \n \n {/* Last Name */}\n \n\n \n {errors.billingLastName && errors.billingLastName.message}\n \n \n \n\n \n \n \n\n \n {errors.billingAddress && errors.billingAddress.message}\n \n \n \n \n\n \n {errors.billingCity && errors.billingCity.message}\n \n \n \n {/* State */}\n \n\n \n {errors.billingState && errors.billingState.message}\n \n \n \n\n \n \n {/* Country */}\n \n\n \n {errors.billingCountry && errors.billingCountry.message}\n \n \n \n {/* Postal Code */}\n \n\n \n {errors.billingZip && errors.billingZip.message}\n \n \n \n {/* Email */}\n \n\n \n {errors.billingEmail && errors.billingEmail.message}\n \n \n \n\n \n\n
\n \n \n {/* Payment Info Form */}\n \"Credit\n \n \n {/* Card Number */}\n
\n \n {ccnumberInvalidFeedback}\n \n \n \n {/* Expiry */}\n
\n \n {ccexpInvalidFeedback}\n \n \n \n {/* CVV */}\n
\n \n {cvvInvalidFeedback}\n \n \n \n\n {/* Payment Section */}\n \n Choose Amount To Pay\n {/* \n {quote.reservation.leadCustomerId === payingCustomer?.customerId && !brandSetting.useDepositOnly && ()}\n\n {!brandSetting.useDepositOnly && splitPaymentPrice > 0 && evenCategory !== undefined && ()}\n {brandSetting.downPayment > 0 && depositPrice > 0 && ()}\n */}\n\n {quote.reservation.leadCustomerId === payingCustomer?.customerId && !brandSetting.useDepositOnly && (\n \n \n Full Payment -- {`$${fullPaymentPrice.toFixed(2)}`}\n \n )}\n\n {!brandSetting.useDepositOnly && splitPaymentPrice > 0 && evenCategory !== undefined && (\n \n \n {`${payingCustomer && payingCustomer.paymentAllocationCategory !== undefined ?\n (`${payingCustomer.paymentAllocationCategoryId === evenCategory.paymentAllocationCategoryId ? \"Split\" : \"Category\"}`) : \"Split\"} Payment`} --\n {`$${splitPaymentPrice.toFixed(2)}`}\n \n \n )}\n\n {brandSetting.downPayment > 0 && depositPrice > 0 && (\n \n \n Deposit Price -- {`$${depositPrice.toFixed(2)}`}\n \n )}\n\n \n \n\n \n \n Apply Payment To\n \n {props.payingCustomer && (\n \n )}\n\n {props.payingCustomer == undefined && quote.reservation.reservationCustomers.map(rc => (\n <>\n {!rc.cancelled && (\n \n )}\n )\n )}\n \n \n\n {/* Tip Section */}\n {brandSetting.allowAgentTips && props.quote.reservation.agent && (\n <>\n {/*

\n Would you like to add a Tip for your booking agent?\n

*/}\n \n {/*
Optional Agent Tip:
*/}\n

Would you like to add a Tip for your booking agent?

\n onAgentTip(event)}\n />\n
\n \n )}\n\n {/* Grand Total */}\n \n \n

\n Total Paying Today: {`$${paymentAmount.toFixed(2)}`}\n

\n
\n \n \n
\n\n {/* Terms & Conditions */}\n \n \n \n \n I Agree To The \n \n

\n
\n\n

{errors.termsCheck && errors.termsCheck.message}

\n \n\n {/* Make Payment Button */}\n \n \n {/*
*/}\n setCaptcha(s)}\n />\n
\n \n {\n validationCallback(\"ccnumber\", ccNumberValidated, \"Required\");\n validationCallback(\"ccexp\", ccExpValidated, \"Required\");\n validationCallback(\"cvv\", cvvValidated, \"Required\");\n }}\n >\n \n {(submitPaymentResponse.isLoading || submitting) && (\n \n )}\n {(submitPaymentResponse.isLoading || submitting) ? \"Paying...\" : \"Make Payment\"}\n \n \n \n \n \n\n {\n setShowTerms(false);\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow\"\n >\n \n \n Terms And Conditions\n \n \n \n {/* Make Payment */}\n {(brandSetting.brand.termsAndConditions !== undefined && brandSetting.brand.termsAndConditions !== null) && parseTerms()}\n \n \n \n );\n}\n\nexport default MakePayment;","import moment from \"moment\";\nimport React, { SetStateAction, useContext, useEffect, useState } from \"react\";\nimport { Col, Button, Accordion, Spinner, Row, Form } from \"react-bootstrap\";\nimport { toast } from \"react-toastify\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport Itinerary from \"../../../../../../../Data/Itinerary\";\nimport { Payment } from \"../../../../../../../Data/Reservation/Payment\";\nimport { PaymentAllocationCategory } from \"../../../../../../../Data/Reservation/PaymentAllocationCategory\";\nimport { ReservationCustomer } from \"../../../../../../../Data/Reservation/ReservationCustomer\";\nimport ReservationGuest from \"../../../../../../../Data/Reservation/ReservationGuest\";\nimport { Constants } from \"../../../../../../../_helpers/Constants\";\nimport ViewPort from \"../../../../../../../_helpers/Enums/ViewPortEnum\";\nimport useFetch, { FetchRequest } from \"../../../../../../../_helpers/UseFetchHook\";\n\ninterface props {\n index: number;\n reservationGuest: ReservationGuest;\n remainingReservationBalance: number;\n // reservationCustomer?: ReservationCustomer;\n onJoinClicked: (guest: any) => void;\n onPayClicked: (index: number) => void;\n isLoading: boolean;\n errors: { join: boolean, name: boolean, email: boolean, index: number };\n paymentCategories: PaymentAllocationCategory[] | undefined;\n itinerary: Itinerary;\n reservationGuests: ReservationGuest[];\n isQuoteExpired: boolean;\n}\n\nconst GuestInfo: React.FC = (props) => {\n const { style, viewPortBreakPoint } = useContext(WidgetContext);\n const { index, remainingReservationBalance, onJoinClicked, onPayClicked, isLoading, errors, paymentCategories, itinerary } = props;\n const [reservationGuest, setReservationGuest] = useState(props.reservationGuest);\n const [newGuestName, setNewGuestName] = useState();\n const [newGuestEmail, setNewGuestEmail] = useState();\n\n const isNewGuest = reservationGuest.name === undefined;\n\n const [emailCustomerRequest, setEmailCustomerRequest] = useState();\n const emailCustomerResponse = useFetch(emailCustomerRequest);\n // const fetchErrors = emailCustomerResponse.error.errors;\n const [paymentCategory, setPaymentCategory] = useState((isNewGuest && paymentCategories) ? paymentCategories.find(c => c.categoryName === \"Even Split\") : undefined);\n const [customerCategory, setCustomerCategory] = useState((reservationGuest.paymentAllocationCategoryId && paymentCategories) ? paymentCategories.find(c => c.paymentAllocationCategoryId === reservationGuest.paymentAllocationCategoryId) : paymentCategory);\n const evenCategory = !!props.paymentCategories ? props.paymentCategories.find(a => a.categoryName === \"Even Split\") : undefined;\n\n // const [balance, setBalance] = useState(reservationGuest.balanceDue);\n // const [price, setPrice] = useState(reservationGuest.price);\n\n function emailPayLink() {\n setEmailCustomerRequest({ url: `${Constants.apiUrl}/api/v1.0/reservations/${reservationGuest.reservationId}/customers/${reservationGuest.customerId}/email`, method: 'POST', body: {} });\n }\n\n useEffect(() => {\n // console.log(\"reservation guest\", reservationGuest);\n\n setReservationGuest(props.reservationGuest)\n }, [props.reservationGuest]);\n\n useEffect(() => {\n if (!!!reservationGuest) return;\n\n // console.log(\"state reservation guest\", reservationGuest);\n setCustomerCategory((reservationGuest.paymentAllocationCategoryId && paymentCategories) ? paymentCategories.find(c => c.paymentAllocationCategoryId === reservationGuest.paymentAllocationCategoryId) : paymentCategory);\n }, [reservationGuest]);\n\n useEffect(() => {\n if (!emailCustomerResponse.data) {\n return;\n }\n toast.success(emailCustomerResponse.data.message);\n }, [emailCustomerResponse.data]);\n\n // useEffect(() => {\n // if (!emailCustomerResponse.error) {\n // return;\n // }\n\n // // console.log(\"emailCustomerResponse\", emailCustomerResponse.error);\n\n // // if (fetchErrors && Object.keys(fetchErrors).length) {\n // // const errorsList = Object.values(fetchErrors).flat();\n // // toast.error(errorsList.join('. '));\n // // } else if (emailCustomerResponse.error.message) {\n // // toast.error(emailCustomerResponse.error.message);\n // // }\n\n // }, [emailCustomerResponse.error]);\n\n return (\n \n {/* Desktop */}\n {viewPortBreakPoint >= ViewPort.md && (\n \n \n \n \n {!isNewGuest && (\n <>\n

{reservationGuest.name}

\n \n \n \n Payments History\n

\n \n\n \n \n {reservationGuest.payments.map((p: Payment) =>\n

${`${p.paymentAmount.toFixed(2)} - ${moment.utc(p.paymentDate).local().format(\"MMMM Do, YYYY\")}`}

\n )}\n \n
\n
\n \n )}\n\n {reservationGuest.name === undefined && (\n \n setNewGuestName(e.target.value)}\n isValid={!errors.name && errors.join && errors.index === index}\n isInvalid={errors.join && errors.name && errors.index === index}\n />\n\n \n {errors && errors.name && (\n Invalid Name\n )}\n \n \n )}\n \n \n {reservationGuest.email !== undefined && (\n

\n {reservationGuest.email}\n

\n )}\n\n {reservationGuest.email === undefined && (\n \n setNewGuestEmail(e.target.value)}\n isValid={!!!errors.email && errors.join && errors.index == index}\n isInvalid={errors.join && errors.email && errors.index == index}\n />\n\n \n {errors && errors.name && (\n Invalid Email\n )}\n \n \n )}\n \n \n

\n {customerCategory ? customerCategory.categoryName : (evenCategory !== undefined ? \"Even Split\" : \"N/A\")}\n

\n \n \n\n \n {isNewGuest && (\n onJoinClicked({ name: newGuestName, email: newGuestEmail, index: index, categoryId: customerCategory ? customerCategory.paymentAllocationCategoryId : undefined })}\n >\n {isLoading && ()}\n {!isLoading && \"Join\"}\n \n )}\n {(!isNewGuest && !reservationGuest.cancelled) && (\n \n )}\n {!reservationGuest.cancelled && (\n \n )}\n \n\n {!reservationGuest.cancelled && (\n \n \n {/* ${Math.min(reservationGuest.balanceDue, remainingReservationBalance).toFixed(2)} */}\n ${reservationGuest.balanceDue.toFixed(2)}\n \n \n ${(reservationGuest.paymentsAmount).toFixed(2)}{reservationGuest.tipAmount > 0 && (<>{` + Tip`})}\n \n \n ${reservationGuest.price.toFixed(2)}\n \n \n )}\n
\n \n )}\n\n {/* Mobile */}\n {viewPortBreakPoint < ViewPort.md && (\n \n \n \n \n \n {`${(reservationGuest.name ? reservationGuest.name : \"Click to Join\")} - ${(customerCategory ? customerCategory.categoryName : \"Even Split\")}`}\n

\n
\n {(!isNewGuest && !reservationGuest.cancelled) && (\n \n )}\n
\n\n \n \n \n {/* Left Col */}\n \n {isNewGuest && (\n

\n Enter Name:\n

\n )}\n

\n Email:\n

\n \n Category:\n

\n \n Balance:\n

\n \n Paid:\n

\n \n Price:\n

\n \n

\n {isNewGuest && (\n onJoinClicked({ name: newGuestName, email: newGuestEmail, index: index, categoryId: customerCategory ? customerCategory.paymentAllocationCategoryId : undefined })}\n >\n {isLoading && ()}\n {!isLoading && \"Join\"}\n \n )}\n {(!isNewGuest && !reservationGuest.cancelled) && (\n \n )}\n

\n\n {/* Payment History */}\n {!isNewGuest && (\n \n \n \n Payments History\n

\n
\n\n \n \n {reservationGuest.payments.map((p: Payment) =>\n

${`${p.paymentAmount.toFixed(2)} - ${moment(p.paymentDate).format(\"MMMM Do, YYYY\")}`}

\n )}\n \n
\n
\n )}\n \n {/* Right Col */}\n \n {reservationGuest.name == undefined && (\n \n setNewGuestName(e.target.value)}\n isValid={!!!errors.name && errors.join && errors.index === index}\n isInvalid={errors.join && errors.name && errors.index === index}\n />\n\n \n {errors && errors.name && (\n Invalid Name\n )}\n \n \n )}\n

\n {reservationGuest.email != undefined && (\n

\n {reservationGuest.email}\n

\n )}\n\n {reservationGuest.email === undefined && (\n \n setNewGuestEmail(e.target.value)}\n isValid={!!!errors.email && errors.join && errors.index == index}\n isInvalid={errors.join && errors.email && errors.index == index}\n />\n\n \n {errors && errors.name && (\n Invalid Email\n )}\n \n \n )}\n

\n

{customerCategory ? customerCategory.categoryName : \"Even Split\"}

\n

${reservationGuest.balanceDue.toFixed(2)}

\n

\n ${(reservationGuest.paymentsAmount).toFixed(2)}{reservationGuest.tipAmount > 0 && (<>{` + Tip`})}\n

\n

\n ${reservationGuest.price.toFixed(2)}\n

\n \n \n

\n \n \n \n
\n
\n \n )}\n \n );\n}\n\nexport default GuestInfo;","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport Reservation from \"../../../../../Data/Reservation/Reservation\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport { ReservationCustomer } from \"../../../../../Data/Reservation/ReservationCustomer\";\n\nconst useUpdateReservationCustomers = (request?: UpdateRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest); // Fetch Data Custom Hook\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/update-customers`;\n\n setFetchRequest({\n url: url,\n method: 'PATCH',\n body: request\n // body: undefined\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: any = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useUpdateReservationCustomers;\n\nexport interface UpdateResponse extends FetchResponse {\n reservationCustomer: ReservationCustomer;\n}\n\nexport interface UpdateRequest extends ReservationCustomer { }","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport Reservation from \"../../../../../Data/Reservation/Reservation\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport Quote from \"../../../../../Data/Quote/Quote\";\nimport { PaymentAllocationCategory } from \"../../../../../Data/Reservation/PaymentAllocationCategory\";\n\nconst useCreateIndividualCategory = (request?: CreateIndividualCategoryRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest); // Fetch Data Custom Hook\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/create-category`;\n\n setFetchRequest({\n url: url,\n method: 'POST',\n body: request\n // body: undefined\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: any = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\");\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useCreateIndividualCategory;\n\nexport interface CreateIndividualCategoryResponse extends FetchResponse {\n category: PaymentAllocationCategory;\n}\n\nexport interface CreateIndividualCategoryRequest {\n reservationId: number;\n}","import React, { SetStateAction, useContext, useEffect, useState } from \"react\";\nimport { Col, Button, Row, Accordion, Spinner, useAccordionToggle } from \"react-bootstrap\";\nimport GuestInfo from \"./guest-info/GuestInfo\";\nimport CancelledGuest from \"./guest-info/CancelledGuest\";\nimport MobileGuestInfo from \"./guest-info/mobile-guest-info/MobileGuestInfo\";\nimport MobileCancelledGuest from \"./guest-info/mobile-canceled-guest/MobileCanceledGuest\";\nimport StartWidget from \"../../../../../../Data/StartWidget\";\nimport Itinerary from \"../../../../../../Data/Itinerary\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport Quote from \"../../../../../../Data/Quote/Quote\";\nimport ReservationGuest from \"../../../../../../Data/Reservation/ReservationGuest\";\nimport { ReservationCustomer } from \"../../../../../../Data/Reservation/ReservationCustomer\";\nimport useUpdateReservationCustomers from \"../../data-service-hooks/UseUpdateReservationCustomers\";\nimport Reservation from \"../../../../../../Data/Reservation/Reservation\";\nimport Decimal from \"decimal.js\";\nimport { PaymentAllocationCategory } from \"../../../../../../Data/Reservation/PaymentAllocationCategory\";\nimport useFetch, { FetchRequest } from \"../../../../../../_helpers/UseFetchHook\";\nimport { toast } from \"react-toastify\";\nimport { Constants } from \"../../../../../../_helpers/Constants\";\nimport useCreateIndividualCategory, { CreateIndividualCategoryRequest } from \"../../data-service-hooks/UseCreateIndividualCategory\";\nimport ViewPort from \"../../../../../../_helpers/Enums/ViewPortEnum\";\n\ninterface props {\n quote: Quote;\n setShowModal: React.Dispatch>;\n onReservationCustomerAdded: (reservationCustomer: ReservationCustomer) => void;\n onPayClicked: (customer: ReservationCustomer) => void;\n emailCustomer: ReservationCustomer | undefined;\n handleUseIndividualPayments: (quote: Quote) => void;\n isQuoteExpired: boolean;\n allowPromo: boolean;\n}\n\nconst Total: React.FC = (props) => {\n const { startWidget, style, fromEmail, viewPortBreakPoint, brand, companyId } = useContext(WidgetContext);\n const { setShowModal, onReservationCustomerAdded, onPayClicked, emailCustomer } = props;\n const [quote, setQuote] = useState(props.quote);\n\n const itinerary = {\n lodgingItineraries: quote.reservation.lodgingItineraries,\n golfItineraries: quote.reservation.golfItineraries,\n transportItineraries: quote.reservation.transportItineraries,\n customItineraries: quote.reservation.customItineraries,\n adjustments: quote.reservation.adjustments\n }\n\n const [collapsed, setCollapsed] = useState(false);\n const [reservationCustomers, setReservationCustomers] = useState(\n quote.reservation.reservationCustomers ? quote.reservation.reservationCustomers : []\n );\n const [reservationGuests, setReservationGuests] = useState([]);\n // const hasAllocations = quote.reservation.reservationCustomers.some(rc => rc.paymentAllocationCategory != null);\n\n const paymentAllocations: PaymentAllocationCategory[] = quote.reservation.paymentCategories ? quote.reservation.paymentCategories : [];\n const hasAllocations = paymentAllocations.length > 0;\n\n const balanceDue = new Decimal(quote.reservation.balanceDue ? quote.reservation.balanceDue : 0.0).toDecimalPlaces(2).toNumber();\n const totalSell = new Decimal(quote.reservation.totalSell ? quote.reservation.totalSell : 0.0).toDecimalPlaces(2).toNumber();\n const tax = new Decimal(quote.reservation.tax ? quote.reservation.tax : 0.0).toDecimalPlaces(2).toNumber();\n const resortFees = new Decimal(quote.reservation.resortFees ? quote.reservation.resortFees : 0.0).toDecimalPlaces(2).toNumber();\n const cleaningFees = new Decimal(quote.reservation.cleaningFee ? quote.reservation.cleaningFee : 0.0).toDecimalPlaces(2).toNumber();\n const discountsApplied = new Decimal(quote.reservation.discountApplied ? quote.reservation.discountApplied : 0.0).toDecimalPlaces(2).toNumber();\n // const grandTotal = ((totalSell * 100) + (tax * 100) + (resortFees * 100) + (cleaningFees * 100)) / 100;\n const promoCodeName = quote.reservation.promo ? quote.reservation.promo.promoCodeName : undefined;\n\n const evenCategory = paymentAllocations.find(a => a.categoryName === \"Even Split\");\n const allocatedCustomers = quote.reservation.reservationCustomers.filter(r => !!r.paymentAllocationCategory);\n // const customersCountWithEvenSplit = allocatedCustomers.filter(c => c.paymentAllocationCategory === evenCategory).length;\n const evenPersonsToDivideBy = quote.reservation.numGuests - PaymentAllocationCategory.getTotalAllocationLines(paymentAllocations);\n\n const priceMinusCategories = new Decimal(totalSell - PaymentAllocationCategory.getTotalAllocationsCost(paymentAllocations, itinerary, props.quote.reservation.numGuests - props.quote.reservation.reservationCustomers.filter(c => c.cancelled).length)).toDecimalPlaces(2).toNumber();\n const evenPerPersonPrice = new Decimal(priceMinusCategories).dividedBy(evenPersonsToDivideBy === 0 ? 1 : evenPersonsToDivideBy).toDecimalPlaces(2).toNumber();\n const resPerPersonPrice = new Decimal(totalSell).dividedBy(quote.reservation.numGuests === 0 ? 1 : quote.reservation.numGuests).toDecimalPlaces(2).toNumber();\n const [remainingReservationBalance, setRemainingReservationBalance] = useState(0.0);\n\n const [updateRequest, setUpdateRequest] = useState();\n const updateResponse = useUpdateReservationCustomers(updateRequest);\n\n const [emailCustomerRequest, setEmailCustomerRequest] = useState();\n const emailCustomerResponse = useFetch(emailCustomerRequest);\n\n const [formErrors, setFormErrors] = useState({ join: false, name: false, email: false, index: -1 });\n\n function emailPayLinks() {\n const customerIds: number[] = [];\n reservationCustomers.forEach((c => customerIds.push(c.customerId)));\n\n setEmailCustomerRequest({\n url: `${Constants.apiUrl}/api/v1.0/reservation/customers/emails`,\n method: 'POST',\n body: {\n reservationId: quote.reservation.reservationId,\n // customerIds: customerIds\n }\n });\n }\n\n const addGuest = (guest: any) => {\n if (reservationGuests.find(g => g.name == undefined) == undefined) return;\n\n const nameExp = /^(?=\\S)[a-zA-Z]{2,}(?:[a-zA-Z]| (?! ))*(?! )$/i;\n const emailExp = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/;\n\n if (guest.name !== undefined)\n guest.name = guest.name.trim();\n if (guest.email !== undefined)\n guest.email = guest.email.trim();\n\n const namePass = nameExp.test(guest.name) && guest.name !== undefined;\n const emailPass = emailExp.test(guest.email);\n\n const errors = { name: !namePass, email: !emailPass, join: true, index: guest.index };\n setFormErrors(errors);\n\n if (errors.name || errors.email) return;\n\n const category = quote.reservation.paymentCategories ? quote.reservation.paymentCategories.find(c => c.paymentAllocationCategoryId === guest.categoryId) : undefined;\n\n const name: string[] = guest.name.split(\" \");\n const first = name.shift();\n const last = name.join(\" \");\n\n setUpdateRequest({\n reservationId: quote.reservationId ? quote.reservationId : 0,\n customerId: 0,\n cancelled: false,\n paymentAllocationCategoryId: category ? category.paymentAllocationCategoryId : undefined,\n customer: {\n customerId: 0,\n companyId: companyId as number,\n firstName: first as string,\n lastName: last,\n emailAddress: `${guest.email}`\n }\n });\n }\n\n useEffect(() => {\n setQuote(props.quote);\n }, [props.quote]);\n\n useEffect(() => {\n const payments = quote.reservation.payments;\n const guests: ReservationGuest[] = [];\n const paymentCategories = quote.reservation.paymentCategories === undefined ? [] : quote.reservation.paymentCategories;\n\n const filteredCustomers = reservationCustomers.filter(rc => !rc.cancelled);\n const totalAllocationCost = PaymentAllocationCategory.getTotalAllocationsCost(paymentCategories, itinerary, props.quote.reservation.numGuests - props.quote.reservation.reservationCustomers.filter(c => c.cancelled).length);\n\n for (let index = 0; index < reservationCustomers.length; index++) {\n const reservationCustomer = reservationCustomers[index];\n const customerPayments = payments ? payments.filter(p => p.customerId === reservationCustomer.customerId) : [];\n const okPayments = customerPayments.filter(p => p.status === null || p.status == \"Complete\" || p.status == \"Pending\" || p.paymentTypeId === 20);\n const cancelledPayments = customerPayments.filter(p => p.status === \"Canceled\");\n\n // let paymentsAmount = customerPayments !== undefined && customerPayments.length > 0 ? okPayments.reduce(function (acc, obj) { return acc + obj.paymentAmount; }, 0) : 0.0;\n // const tipAmount = customerPayments !== undefined && customerPayments.length > 0 ? okPayments.reduce(function (acc, obj) { return acc + obj.tipAmount; }, 0) : 0.0;\n // let paymentsAmount = okPayments.reduce(function (acc, obj) { return acc + obj.paymentAmount; }, 0) - cancelledPayments.reduce(function (acc, obj) { return acc + obj.paymentAmount; }, 0);\n let paymentsAmount = okPayments.reduce(function (acc, obj) { return acc + obj.paymentAmount; }, 0);\n const tipAmount = okPayments.reduce(function (acc, obj) { return acc + obj.tipAmount; }, 0);\n paymentsAmount -= tipAmount;\n\n let allocationCost = 0.0;\n if (!!reservationCustomer.paymentAllocationCategory && reservationCustomer.paymentAllocationCategory.allocationLines !== undefined) {\n if (reservationCustomer.paymentAllocationCategory.categoryName === \"Even Split\") {\n // get even split cost\n\n // temp\n allocationCost = evenPerPersonPrice;\n\n } else {\n allocationCost = PaymentAllocationCategory.getCost(reservationCustomer.paymentAllocationCategory, itinerary, props.quote.reservation.numGuests - props.quote.reservation.reservationCustomers.filter(c => c.cancelled).length);\n }\n }\n\n guests.push({\n reservationId: reservationCustomer.reservationId,\n customerId: reservationCustomer.customerId,\n cancelled: reservationCustomer.cancelled,\n name: `${reservationCustomer.customer.firstName} ${reservationCustomer.customer.lastName}`,\n email: `${reservationCustomer.customer.emailAddress}`,\n price: !!reservationCustomer.paymentAllocationCategory ? allocationCost : (filteredCustomers.length > 1 ? evenPerPersonPrice : totalSell), // how much to pay from allocation category\n balanceDue: !!reservationCustomer.paymentAllocationCategory ? (allocationCost - paymentsAmount) : (filteredCustomers.length > 1 ? evenPerPersonPrice - paymentsAmount : totalSell - paymentsAmount), // this will come from the reservation guest info later\n payments: customerPayments,\n paymentAllocationCategoryId: reservationCustomer.paymentAllocationCategoryId,\n index,\n paymentsAmount: paymentsAmount,\n tipAmount: tipAmount\n });\n }\n\n if (paymentCategories.length > 0) {\n const count = filteredCustomers.length;\n const sortedCats = paymentCategories.sort((a, b) => {\n if (a.categoryName === \"Even Split\" && b.categoryName !== \"Even Split\") return -1;\n if (a.categoryName !== \"Even Split\" && b.categoryName === \"Even Split\") return 1;\n return 0;\n });\n\n for (let index = 0; index < quote.reservation.numGuests - count; index++) {\n let category: PaymentAllocationCategory | undefined;\n\n // console.log(\"paymentAllocations\", paymentAllocations);\n sortedCats.forEach(cat => {\n const count = PaymentAllocationCategory.getGuestCount(guests, cat);\n if (cat.allocationLines !== undefined && count < cat.allocationLines && cat.categoryName !== \"-\") {\n category = cat;\n return;\n }\n });\n\n let allocationCost = 0.0;\n\n if (!!category && category.allocationLines !== undefined) {\n if (category.categoryName === \"Even Split\") {\n // // get even split cost\n allocationCost = evenPerPersonPrice;\n } else {\n allocationCost = PaymentAllocationCategory.getCost(category, itinerary, props.quote.reservation.numGuests - props.quote.reservation.reservationCustomers.filter(c => c.cancelled).length);\n }\n }\n\n const guest = {\n reservationId: 0,\n customerId: 0,\n cancelled: false,\n price: allocationCost,\n balanceDue: allocationCost,\n payments: [],\n index: -1,\n customer: undefined,\n paymentAllocationCategoryId: category !== undefined ? category.paymentAllocationCategoryId : undefined,\n paymentsAmount: 0.0,\n tipAmount: 0.0\n };\n\n guests.push(guest);\n }\n }\n\n // //reservationGuest.payments.reduce(function (acc, obj) { return acc + obj.paymentAmount; }, 0).toFixed(2)\n let totalPayments = 0.0;\n guests.forEach((guest: ReservationGuest) => totalPayments += guest.payments.filter(p => p.status === null || p.status == \"Complete\" || p.status == \"Pending\" || p.paymentTypeId === 20).reduce(function (acc, obj) { return acc + obj.paymentAmount; }, 0))\n guests.forEach((guest: ReservationGuest) => totalPayments -= guest.payments.filter(p => p.status === null || p.status == \"Complete\" || p.status == \"Pending\" || p.paymentTypeId === 20).reduce(function (acc, obj) { return acc + obj.tipAmount; }, 0))\n setRemainingReservationBalance(totalSell - totalPayments);\n setReservationGuests([...guests]);\n\n }, [quote]);\n\n useEffect(() => {\n if (updateResponse.data == undefined) return;\n\n // console.log(\"customer updated\", updateResponse.data);\n onReservationCustomerAdded(updateResponse.data);\n }, [updateResponse.data]);\n\n useEffect(() => {\n if (!emailCustomerResponse.data) {\n return;\n }\n\n toast.success(emailCustomerResponse.data.message);\n }, [emailCustomerResponse.data]);\n\n useEffect(() => {\n if (!emailCustomerResponse.error) {\n return;\n }\n\n }, [emailCustomerResponse.error]);\n\n const [createIndividualRequest, setCreateIndividualRequest] = useState();\n const createIndividualResponse = useCreateIndividualCategory(createIndividualRequest);\n\n function handleIndividualPayments() {\n setCreateIndividualRequest({ reservationId: quote.reservationId as number });\n }\n\n useEffect(() => {\n if (!createIndividualResponse.data) return;\n\n const cat: PaymentAllocationCategory = createIndividualResponse.data.category;\n quote.reservation.paymentCategories = [cat];\n quote.reservation.reservationCustomers.forEach((resCust: ReservationCustomer) => {\n resCust.paymentAllocationCategory = cat;\n resCust.paymentAllocationCategoryId = cat.paymentAllocationCategoryId;\n });\n props.handleUseIndividualPayments(quote);\n }, [createIndividualResponse.data]);\n\n return (\n \n
\n {/* Totals */}\n \n
\n \n {/* Header */}\n

\n Totals\n

\n {/* TOGGLE */}\n {/* \n Collapse +\n */}\n \n
\n\n \n
\n \n {/* Discount Applied */}\n {props.allowPromo && promoCodeName !== undefined && quote.reservation.promo !== undefined && quote.reservation.promo.discount !== 0 && (\n \n \n \n \n \n \n )}\n\n {/* Package price */}\n \n \n \n \n \n \n\n {/* Tax */}\n \n {startWidget.showTaxesTotal && (\n \n \n \n \n )}\n \n\n {/* Resort Fee */}\n \n {startWidget.showResortFeeTotal && (\n \n \n \n \n )}\n \n\n {/* Cleaning Fee */}\n \n {startWidget.showCleaningFeeTotal && (\n \n \n \n \n )}\n \n \n
\n
\n\n
\n {/* Grand Total */}\n \n {startWidget.showGrandTotal && (\n \n \n \n \n )}\n \n\n {/* Per Person */}\n \n {startWidget.showPerPersonPricing && !quote.reservation.reservationCustomers.some(rc => rc.paymentAllocationCategory != null) && (\n \n \n \n \n )}\n \n\n \n \n \n \n \n \n
\n
\n\n {/* Make Payment Section */}\n \n {/* Make Payment Button */}\n {!hasAllocations && (\n \n \n setShowModal(\"make-payment\")}\n disabled={props.isQuoteExpired}\n >\n Make Payment\n \n \n \n )}\n\n {!hasAllocations && (\n
\n \n {createIndividualResponse.isLoading ? (\n Loading...\n ) : (\n \n Use Individual Payments\n \n )}\n \n
\n )}\n\n 0) ? \"0\" : undefined}>\n \n <>\n \n {/* Header */}\n

\n Payment Categories and Accounting\n

\n \n\n
\n \n
\n {/* Divider */}\n \n \n \n\n {/* Individual payment header */}\n {viewPortBreakPoint >= ViewPort.md && (\n \n \n \n Name of Guest\n \n \n Email Address\n \n \n Category\n \n \n\n \n\n \n \n Balance\n \n \n Paid\n \n \n Price\n \n \n
\n )}\n\n {/* Guest Info */}\n {reservationGuests.map((reservationGuest: ReservationGuest, index: number) => (\n
\n {!reservationGuest.cancelled && (\n {\n onPayClicked(reservationCustomers[reservationGuests[index].index])\n }}\n isLoading={updateResponse.isLoading}\n errors={formErrors}\n paymentCategories={quote.reservation.paymentCategories}\n itinerary={itinerary}\n reservationGuests={reservationGuests}\n isQuoteExpired={props.isQuoteExpired}\n />\n )}\n
\n ))}\n\n {/* Payment Emails */}\n \n \n

\n {`Do you need custom itineraries with single & double occupancy, specific schedules, or golf only costs? Call ${brand?.phoneNumber} we can set it up for you.`}\n

\n \n \n \n \n {(emailCustomerResponse.isLoading) && (\n \n )}\n {(emailCustomerResponse.isLoading) ? \"Emailing...\" : \"Send Payment Emails\"}\n \n \n \n \n\n {/* Canceled Guests */}\n {reservationGuests.filter((rc: ReservationGuest) => rc.cancelled).length > 0 && (\n <>\n \n
\n Canceled Guests\n
\n \n \n {reservationGuests.map((reservationGuest: ReservationGuest, index: number) => (\n <>\n {reservationGuest.cancelled && (\n {\n onPayClicked(reservationCustomers[reservationGuests[index].index])\n }}\n isLoading={updateResponse.isLoading}\n errors={formErrors}\n paymentCategories={quote.reservation.paymentCategories}\n itinerary={itinerary}\n reservationGuests={reservationGuests}\n isQuoteExpired={props.isQuoteExpired}\n />\n )}\n \n ))}\n \n \n )}\n
\n \n
\n \n \n \n \n
\n \n );\n}\n\nexport default Total;","import { yupResolver } from \"@hookform/resolvers\";\nimport Decimal from \"decimal.js\";\nimport React, { useContext, useEffect, useState, useRef } from \"react\";\nimport { Col, Form, Button, Row, Spinner, Modal } from \"react-bootstrap\";\nimport { useForm } from \"react-hook-form\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport Itinerary from \"../../../../../../Data/Itinerary\";\nimport Quote from \"../../../../../../Data/Quote/Quote\";\nimport { ReservationCustomer } from \"../../../../../../Data/Reservation/ReservationCustomer\";\nimport { Constants } from \"../../../../../../_helpers/Constants\";\nimport { NormalizeCurrencyInput, isStringEmpty } from \"../../../../../../_helpers/Functions\";\nimport useFetch, { FetchRequest } from \"../../../../../../_helpers/UseFetchHook\";\nimport Checkbox from \"../../../assets/check-box/CheckBox\";\nimport useGetGlacierCompanyToken from \"../../data-service-hooks/UseGetGlacierCompanyByResOrCompanyIdToken\";\nimport { MakePaymentFormData, MakePaymentSchema, MakePaymentSchemaDefaultValues } from \"../../widget-modals/schemas/MakePaymentScheme\";\nimport parse from 'html-react-parser';\nimport { DatesAndGuests } from \"../../../widget-form/WidgetForm\";\nimport ViewPort from \"../../../../../../_helpers/Enums/ViewPortEnum\";\nimport ReCAPTCHA from \"react-google-recaptcha\";\nimport useValidateReCaptcha, { ValidateReCaptchaRequest } from \"../../data-service-hooks/UseValidateReCaptcha\";\nimport StartWidgetBrandSetting from \"../../../../../../Data/StartWidgetBrandSetting\";\n\ninterface props {\n // itinerary: Itinerary;\n quote: Quote | undefined;\n itinerary: Itinerary;\n dateAndGuests: DatesAndGuests;\n onPaymentMade: (data: any) => void;\n onError: (error: any) => void;\n\n requestItineraryQuote: (customers: ReservationCustomer[], groupName: string | undefined, fromBooking: boolean) => void;\n // isLoading: boolean;\n createdFromBooking: boolean;\n}\n\nexport interface GlacierCustomer {\n billingFirstName: string,\n billingLastName: string,\n billingAddress: string,\n billingCity: string,\n billingState: string,\n billingZip: string,\n billingCountry: string,\n billingEmail: string,\n paymentToken?: string,\n ccType?: string,\n ccNumber?: string,\n ccExpiration?: string,\n}\n\nconst BookNow: React.FC = (props) => {\n const { companyId, datesAndGuests, /* brandId, */ brand, brandSettings, viewPortBreakPoint } = useContext(WidgetContext);\n\n const { itinerary, dateAndGuests } = props;\n\n const [payingCustomer, setPayingCustomer] = useState(undefined);\n // const [customerPayments, setCustomerPayments] = useState([]);\n const brandSetting: StartWidgetBrandSetting = brandSettings.find(s => s.brandId === brand?.brandId) as StartWidgetBrandSetting;\n\n const [fullPaymentOption, setFullPaymentOption] = useState(true);\n const [splitPaymentOption, setSplitPaymentOption] = useState(false);\n const [otherPaymentOption, setOtherPaymentOption] = useState(false);\n const [depositPaymentOption, setDepositPaymentOption] = useState(false);\n\n const [fetchGlacierTokenRequest, setGlacierTokenRequest] = useState();\n const fetchGlacierTokenResponse = useGetGlacierCompanyToken(fetchGlacierTokenRequest);\n const [isLoading, setIsLoading] = useState(true);\n const [glacierToken, setGlacierToken] = useState(null);\n const [submitting, setSubmitting] = useState(false);\n\n const [glacierCustomer, setGlacierCustomer] = useState(null);\n const [submitPaymentRequest, setSubmitPaymentRequest] = useState();\n const submitPaymentResponse = useFetch(submitPaymentRequest);\n const [paymentErrors, setPaymentErrors] = useState([]);\n const [isGettingQuote, setIsGettingQuote] = useState(false);\n\n const [submitted, setSubmitted] = useState(false);\n const [ccnumberInvalid, setCCNumberInvalid] = useState(false);\n const [ccNumberValidated, setccNumberValidated] = useState(false);\n const [ccnumberInvalidFeedback, setCCNumberInvalidFeedback] = useState(null);\n const [ccexpInvalid, setCCExpInvalid] = useState(false);\n const [ccExpValidated, setccExpValidated] = useState(false);\n const [ccexpInvalidFeedback, setCCExpInvalidFeedback] = useState(null);\n const [cvvInvalid, setCVVInvalid] = useState(false);\n const [cvvValidated, setCVVValidated] = useState(false);\n const [cvvInvalidFeedback, setCVVInvalidFeedback] = useState(null);\n\n const [fullPaymentPrice, setFullPaymentPrice] = useState(0.0);\n const [depositPrice, setDepositPrice] = useState(0.0);\n\n const [agentTip, setAgentTip] = useState(\"0.00\");\n const [paymentAmount, setPaymentAmount] = useState(0);\n\n const [showTerms, setShowTerms] = useState();\n\n const [formData, setFormData] = useState();\n const [validateReCaptchaRequest, setValidateReCaptchaRequest] = useState(null);\n const validateReCaptchaResponse = useValidateReCaptcha(validateReCaptchaRequest);\n const captchaRef = useRef(null);\n const [captcha, setCaptcha] = useState(null);\n\n const { register, handleSubmit, errors, formState, setValue, reset, getValues } = useForm({\n mode: \"onBlur\",\n resolver: yupResolver(MakePaymentSchema),\n defaultValues: MakePaymentSchemaDefaultValues\n });\n\n // useEffect(() => {\n // console.log(\"brandSetting\", brandSetting);\n // }, [brandSetting]);\n\n const setPaymentOption = (option: string) => {\n setFullPaymentOption(option === \"full\"); // remaining cost of reservation\n setDepositPaymentOption(option === \"deposit\"); // optional deposit amount; comes from brand setting\n // setOtherPaymentOption(option === \"other\");\n const tip = NormalizeCurrencyInput(agentTip);\n setPaymentAmount(option === \"full\" ? fullPaymentPrice + +tip : depositPrice + +tip);\n // console.log(\"option\", option);\n }\n\n const onAgentTip = (event: any) => {\n const value = event.currentTarget.value;\n if (!value) {\n // setAgentTip(\"0.00\");\n return;\n }\n\n const tip = NormalizeCurrencyInput(value);\n const payment = fullPaymentOption ? fullPaymentPrice : depositPrice;\n setAgentTip(tip);\n // setAgentTip(new Decimal(value).toDecimalPlaces(2).toNumber());\n setPaymentAmount(payment + +tip);\n }\n\n useEffect(() => {\n if (!!!itinerary) return;\n\n let total = 0.0;\n if (itinerary.lodgingItineraries) {\n total += itinerary.lodgingItineraries.reduce(function (acc, obj) {\n return new Decimal(acc).add(\n obj.itineraryUnits.reduce(function (ac, ob) { return new Decimal(ac).add(ob.sell).toNumber(); }, 0)\n ).toNumber();\n }, 0);\n }\n\n if (itinerary.golfItineraries) {\n total += itinerary.golfItineraries.reduce(function (acc, obj) {\n return new Decimal(acc).add(\n obj.itineraryUnits.reduce(function (ac, ob) { return new Decimal(ac).add(ob.sell).toNumber(); }, 0)\n ).toNumber();\n }, 0);\n }\n\n if (itinerary.transportItineraries) {\n total += itinerary.transportItineraries.reduce(function (acc, obj) {\n return new Decimal(acc).add(\n obj.itineraryUnits.reduce(function (ac, ob) { return new Decimal(ac).add(ob.sell).toNumber(); }, 0)\n ).toNumber();\n }, 0);\n }\n\n if (itinerary.customItineraries) {\n total += itinerary.customItineraries.reduce(function (acc, obj) {\n return new Decimal(acc).add(\n obj.itineraryUnits.reduce(function (ac, ob) { return new Decimal(ac).add(ob.sell).toNumber(); }, 0)\n ).toNumber();\n }, 0);\n }\n\n setDepositPrice(brandSetting.downPaymentType === \"$\" ? brandSetting.downPayment : ((brandSetting.downPayment / 100) * total));\n setFullPaymentPrice(total);\n setPaymentAmount(total);\n setGlacierTokenRequest({ companyId });\n }, [itinerary]);\n\n useEffect(() => {\n if (!props.createdFromBooking || props.quote === undefined) return;\n\n setPayingCustomer(props.quote.reservation.reservationCustomers[0]);\n submitPayment();\n }, [props.createdFromBooking]);\n\n useEffect(() => {\n if (fetchGlacierTokenResponse.data) {\n setGlacierToken((fetchGlacierTokenResponse.data as any).token);\n }\n }, [fetchGlacierTokenResponse.data]);\n\n useEffect(() => {\n if (fetchGlacierTokenResponse.error) {\n console.log(\"glacier fetch error\", fetchGlacierTokenResponse.error);\n }\n }, [fetchGlacierTokenResponse.error]);\n\n useEffect(() => {\n if (glacierToken) {\n // Add the js script.\n setIsLoading(true);\n //outputIsBusy(true);\n\n const existingScript = document.getElementById('glacier');\n if (!!existingScript) {\n existingScript.remove();\n }\n const script = document.createElement('script');\n script.src = 'https://secure.glacierpaygateway.com/token/Collect.js';\n script.id = 'glacier';\n script.setAttribute('data-tokenization-key', glacierToken);\n document.body.appendChild(script);\n script.onload = () => {\n configureGlacier();\n };\n }\n }, [glacierToken]);\n\n useEffect(() => {\n if (glacierCustomer && !isStringEmpty(glacierCustomer.paymentToken)) {\n setSubmitPaymentRequest({\n url: `${Constants.apiUrl}/api/v1.0/customer/${payingCustomer && payingCustomer.customerId}/pay/${payingCustomer && payingCustomer.reservationId}/payments`,\n method: 'POST',\n body: { ...glacierCustomer, billingPrice: +(paymentAmount.toFixed(2)), tipAmount: +agentTip }\n });\n };\n }, [glacierCustomer && glacierCustomer.paymentToken]);\n\n const submitForm = (_formData: any) => {\n\n setFormData({ ..._formData });\n\n if (captchaRef !== null && captchaRef.current !== null) {\n // const token = formData[\"g-recaptcha-response\"];\n const token = captchaRef.current.getValue();\n setValidateReCaptchaRequest({ token });\n }\n }\n\n useEffect(() => {\n if (validateReCaptchaResponse.data === null) return;\n\n if (validateReCaptchaResponse.data.success) {\n const customers: ReservationCustomer[] = [];\n const customer: ReservationCustomer = {\n reservationId: 0,\n customerId: 0,\n customer: {\n companyId: companyId as number,\n customerId: 0,\n isActive: true,\n firstName: formData.billingFirstName,\n lastName: formData.billingLastName,\n emailAddress: formData.billingEmail,\n streetAddress: formData.billingAddress,\n city: formData.billingCity,\n state: formData.State,\n country: formData.billingCountry,\n zipCode: formData.billingZip,\n phone1: \"\",\n customerNotes: undefined,\n },\n paymentAllocationCategoryId: undefined,\n paymentAllocationCategory: undefined,\n cancelled: false\n };\n\n setPayingCustomer(customer);\n\n setGlacierCustomer({ ...formData });\n\n customers.push(customer);\n\n setIsGettingQuote(true);\n props.requestItineraryQuote(customers, formData.groupName, true);\n }\n else captchaRef.current.reset();\n\n setValidateReCaptchaRequest(null);\n\n }, [validateReCaptchaResponse]);\n\n const submitPayment = () => {\n if (ccNumberValidated && ccExpValidated && cvvValidated) {\n // Submit the form.\n setSubmitted(false);\n setSubmitting(true);\n //outputIsBusy(true);\n (window as any).CollectJS.startPaymentRequest();\n }\n else {\n setCCNumberInvalid(ccNumberValidated);\n setCCExpInvalid(ccExpValidated);\n setCVVInvalid(cvvValidated);\n }\n }\n\n const configureGlacier = () => {\n (window as any).CollectJS.configure({\n 'variant': 'inline',\n 'paymentType': 'cc',\n 'customCss': {\n 'font-family': 'sans-serif',\n // 'border-style': 'none',\n 'padding-left': '10px',\n // 'margin': '0'\n },\n 'fields': {\n 'ccnumber': {\n 'selector': '#ccnumber',\n 'placeholder': 'Card Number'\n },\n 'ccexp': {\n 'selector': '#ccexp',\n 'placeholder': 'Expiry'\n },\n 'cvv': {\n 'display': 'required',\n 'selector': '#cvv',\n 'placeholder': 'CVV'\n },\n },\n 'validationCallback': (field: any, valid: boolean, message: any) => {\n if (!valid) {\n setSubmitted(false);\n setSubmitting(false);\n // outputIsBusy(false);\n // outputToken(null);\n }\n\n validationCallback(field, valid, message);\n },\n 'timeoutDuration': 5000,\n 'timeoutCallback': () => {\n clearAllValidation();\n console.log(\"The tokenization didn't respond in the expected timeframe. This could be due to an invalid or incomplete field or poor connectivity\");\n },\n 'fieldsAvailableCallback': () => {\n setIsLoading(false);\n // outputIsBusy(false);\n },\n 'callback': (response: any) => {\n setSubmitting(false);\n // outputIsBusy(false);\n setSubmitted(true);\n // outputToken(response.token);\n setGlacierCustomer({\n billingFirstName: `${getValues(\"billingFirstName\")}`,\n billingLastName: `${getValues(\"billingLastName\")}`,\n billingAddress: getValues(\"billingAddress\"),\n billingCity: getValues(\"billingCity\"),\n billingState: getValues(\"billingState\"),\n billingZip: getValues(\"billingZip\"),\n billingCountry: getValues(\"billingCountry\"),\n billingEmail: getValues(\"billingEmail\"),\n paymentToken: response.token\n });\n }\n });\n }\n\n const clearAllValidation = () => {\n setCCNumberInvalid(true);\n setccNumberValidated(false);\n setCCNumberInvalidFeedback(null);\n setCCExpInvalid(true);\n setccExpValidated(false);\n setCCExpInvalidFeedback(null);\n setCVVInvalid(true);\n setCVVValidated(false);\n setCVVInvalidFeedback(null);\n }\n\n const setValidated = (field: string) => {\n if (field == 'ccnumber') {\n setccNumberValidated(true);\n setCCNumberInvalid(false);\n setCCNumberInvalidFeedback(null);\n }\n if (field == 'ccexp') {\n setccExpValidated(true);\n setCCExpInvalid(false);\n setCCExpInvalidFeedback(null);\n }\n if (field == 'cvv') {\n setCVVValidated(true);\n setCVVInvalid(false);\n setCVVInvalidFeedback(null);\n }\n }\n\n const validationCallback = (field: any, valid: boolean, message: any) => {\n if (valid) {\n setValidated(field);\n return;\n }\n\n if (field == \"ccnumber\") {\n setccNumberValidated(false);\n setCCNumberInvalid(true);\n setCCNumberInvalidFeedback(message);\n } else if (field == \"ccexp\") {\n setccExpValidated(false);\n setCCExpInvalid(true);\n setCCExpInvalidFeedback(message);\n } else if (field == \"cvv\") {\n setCVVValidated(false);\n setCVVInvalid(true);\n setCVVInvalidFeedback(message);\n }\n }\n\n const paymentOptionChanged = (event: any) => {\n setPaymentOption(event.target.value);\n }\n\n function getFullPaymentSpaces() {\n const spaceCount = viewPortBreakPoint < ViewPort.lg ? 20 : 37;\n const space = \"\\xa0\";\n const priceString = paymentAmount.toFixed(2);\n const splitString = priceString.split(\".\");\n const charCount = splitString[0].length;\n return space.repeat(spaceCount - charCount);\n }\n\n function getDepositPaymentSpaces() {\n const spaceCount = viewPortBreakPoint < ViewPort.lg ? 19 : 37;\n const space = \"\\xa0\";\n const priceString = paymentAmount.toFixed(2);\n const splitString = priceString.split(\".\");\n const charCount = splitString[0].length;\n return space.repeat(spaceCount - charCount);\n }\n\n function parseTerms(): any {\n let data = brandSetting.brand.termsAndConditions;\n\n const tags = {\n \"\": brandSetting.brand.company.companyName,\n \"\": brandSetting.brand.company.phone,\n \"\": brandSetting.brand.brandName,\n \"\": brandSetting.brand.phone,\n \"<COMPANY>\": brandSetting.brand.company.companyName,\n \"<COMPANYPHONE>\": brandSetting.brand.company.phone,\n \"<BRAND>\": brandSetting.brand.brandName,\n \"<BRANDPHONE>\": brandSetting.brand.phone,\n }\n\n for (const [key, value] of Object.entries(tags)) {\n // console.log(`${key}: ${value}`);\n const rgx = new RegExp(key, 'g');\n if (value !== undefined && value !== null) {\n data = data.replace(rgx, value.toString());\n }\n }\n\n return parse(data);\n }\n\n useEffect(() => {\n if (submitPaymentResponse.data) {\n if (submitPaymentResponse.data.success && payingCustomer != undefined) {\n setIsGettingQuote(false);\n\n props.onPaymentMade({ customerId: payingCustomer.customerId, amount: paymentAmount, tipAmount: +agentTip });\n } else {\n props.onError({ error: submitPaymentResponse.data.error });\n }\n }\n }, [submitPaymentResponse.data]);\n\n useEffect(() => {\n if (errors && Object.keys(errors).length > 0)\n console.log(\"form errors\", errors);\n }, [errors]);\n\n return (\n \n \n {/* Billing Info */}\n \n

Billing Info

\n \n \n\n
\n \n \n {/* First Name */}\n \n \n\n \n {errors.billingFirstName && errors.billingFirstName.message}\n \n \n \n {/* Last Name */}\n \n\n \n {errors.billingLastName && errors.billingLastName.message}\n \n \n \n\n \n \n \n\n \n {errors.billingAddress && errors.billingAddress.message}\n \n \n \n \n\n \n {errors.billingCity && errors.billingCity.message}\n \n \n \n {/* State */}\n \n\n \n {errors.billingState && errors.billingState.message}\n \n \n \n\n \n \n {/* Country */}\n \n\n \n {errors.billingCountry && errors.billingCountry.message}\n \n \n \n {/* Postal Code */}\n \n\n \n {errors.billingZip && errors.billingZip.message}\n \n \n \n {/* Email */}\n \n\n \n {errors.billingEmail && errors.billingEmail.message}\n \n \n \n\n \n\n
\n \n \n {/* Payment Info Form */}\n \"Credit\n \n \n {/* Card Number */}\n
\n \n {ccnumberInvalidFeedback}\n \n \n \n {/* Expiry */}\n
\n \n {ccexpInvalidFeedback}\n \n \n \n {/* CVV */}\n
\n \n {cvvInvalidFeedback}\n \n \n \n \n\n \n {/* Payment Section */}\n \n Select A Payment\n {/* */}\n {/* {!brandSetting.useDepositOnly && ()} */}\n {/* {brandSetting.downPayment > 0 && ()} */}\n {/* */}\n \n \n Full Payment -- {`$${fullPaymentPrice.toFixed(2)}`}\n \n\n \n \n Deposit Price -- {`$${depositPrice.toFixed(2)}`}\n \n\n \n\n {/* Tip Section */}\n {/* {brandSetting.allowAgentTips && (\n <>\n \n

Would you like to add a Tip for your booking agent?

\n onAgentTip(event)}\n />\n
\n \n )} */}\n\n {/* Grand Total */}\n \n \n

\n Total Paying Today: {`$${paymentAmount.toFixed(2)}`}\n

\n
\n \n \n
\n\n {/* Terms & Conditions */}\n \n \n \n \n I Agree To The \n \n

\n
\n\n

{errors.termsCheck && errors.termsCheck.message}

\n \n\n {/* Make Payment Button */}\n \n \n setCaptcha(s)}\n />\n \n \n \n \n {(submitPaymentResponse.isLoading || submitting || isGettingQuote) && (\n \n )}\n {(submitPaymentResponse.isLoading || submitting || isGettingQuote) ? \"Paying...\" : \"Make Payment\"}\n \n \n \n \n \n\n {\n setShowTerms(false);\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow\"\n >\n \n \n Terms And Conditions\n \n \n \n {/* Make Payment */}\n {(brandSetting.brand.termsAndConditions !== undefined && brandSetting.brand.termsAndConditions !== null) && parseTerms()}\n \n \n \n );\n}\n\nexport default BookNow;","import React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Button, Image, Form, Row } from \"react-bootstrap\";\nimport { WidgetContext } from \"../../../../../../context/WidgetContext\";\nimport Itinerary from \"../../../../../../Data/Itinerary\";\nimport { Adjustment } from \"../../../../../../Data/Reservation/Adjustment\";\n\ninterface props {\n item: Adjustment;\n quoteStatus: number | undefined;\n}\n\nconst LodgingTab: React.FC = (props) => {\n const { style } = useContext(WidgetContext);\n const { item, quoteStatus } = props;\n\n return (\n \n {/* Lodging Items */}\n {/* Desktop */}\n\n {item.showOnItinerary && (\n <>\n \n {/* Form */}\n \n {/* Selects */}\n \n \n \n Adjustment Type\n \n \n \n \n\n {(quoteStatus == 20 || quoteStatus == 30) && (\n
\n \n Confirmation #\n \n \n \n
\n )}\n
\n \n \n
\n

${(item.sell * item.numUnits).toFixed(2)}

\n
\n \n \n\n {/* Mobile */}\n \n \n \n
{item.adjustmentName}
\n

{item.numUnits ? item.numUnits : 1} Unit{item.numUnits && item.numUnits != 1 ? \"s\" : \"\"}\n

\n \n
\n \n \n \n )}\n
\n );\n}\n\nexport default LodgingTab;\n","import Promo from \"../../../../../Data/Promo\";\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\n\n\nexport type PromoFetchQuery = {\n companyId: number;\n promoCodeName: string;\n}\n\nexport type PromoFetchResponse = {\n success: boolean;\n message: string;\n promo: Promo;\n}\n\nconst UseGetPromoByName = (promoQuery?: PromoFetchQuery) => {\n const url = `${Constants.apiUrl}/api/v1.0/promos/`;\n\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest); // Fetch Data Custom Hook\n\n useEffect(() => {\n if (promoQuery) {\n let queryUrl: string = url + `${promoQuery.companyId}/get-by-name/${promoQuery.promoCodeName}`;\n\n setFetchRequest({\n url: queryUrl,\n method: 'GET'\n });\n }\n }, [promoQuery]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: PromoFetchResponse = fetchResponse.data;\n setData(response);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default UseGetPromoByName;","import React, { useContext } from 'react';\nimport { Button } from 'react-bootstrap';\nimport { WidgetContext } from '../../../../../../context/WidgetContext';\n\ninterface AddItineraryUnitButtonProps {\n /** label of the button */\n buttonText: string;\n /** onClick function for the button */\n onClick: () => void;\n /** button color */\n buttonColor?: string;\n /** marginTop which is defaulted to 15px */\n marginTop?: string;\n /** button height which is defaulted to 30px */\n height?: string;\n}\n\nconst AddItineraryUnitButton: React.FC = ({\n buttonText,\n onClick,\n buttonColor,\n marginTop = '15px',\n height = '30px',\n}) => {\n const {style} = useContext(WidgetContext);\n \n /** if no button color is passed in assign the style color */\n if (!buttonColor) {\n buttonColor = style.itineraryButtonColor\n }\n\n return (\n
\n \n {buttonText}\n \n
\n );\n};\n\nexport default AddItineraryUnitButton;","import React from 'react';\nimport { Button } from 'react-bootstrap';\n\ninterface ItineraryModalButtonProps {\n className?: string,\n style?: {\n [key: string]: string | number | undefined;\n },\n brandSetting?: {\n requireLodgingPkgQuote?: boolean;\n },\n itinerary: {\n lodgingItineraries?: any[];\n golfItineraries?: Array<{\n itineraryUnits: Array<{\n availableTeeTimes: any[];\n }>;\n }>;\n },\n setShowModal: (modalType: string) => void,\n buttonLabel: string,\n modalString: string,\n disabled?: boolean,\n}\n\nconst ItineraryModalButton: React.FC = ({\n style = {},\n brandSetting,\n itinerary,\n setShowModal,\n modalString,\n buttonLabel,\n className,\n}) => {\n const handleClick = () => {\n if (brandSetting !== undefined) {\n if (\n !brandSetting.requireLodgingPkgQuote ||\n (itinerary.lodgingItineraries !== undefined &&\n itinerary.lodgingItineraries.length > 0)\n ) {\n setShowModal(modalString);\n } else {\n setShowModal('lodging-required');\n }\n }\n\n let missing = false;\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach((i) =>\n i.itineraryUnits.forEach((u) => {\n if (u.availableTeeTimes.length === 0) {\n missing = true;\n }\n })\n );\n }\n\n if (missing) setShowModal('missing-rate');\n };\n\n return (\n \n {buttonLabel}\n \n );\n};\n\nexport default ItineraryModalButton;\n","import { useLayoutEffect, useState } from 'react';\nimport ViewPort from \"./Enums/ViewPortEnum\";\n\nexport default function useWindowSize() {\n const [width, setWidth] = useState(window.innerWidth);\n const [height, setHeight] = useState(window.innerHeight);\n const [breakPoint, setBreakPoint] = useState(getBreakPoint());\n\n function getBreakPoint(): ViewPort {\n if (window.innerWidth >= 1200) {\n return ViewPort.xl;\n }\n else if (window.innerWidth >= 992) {\n return ViewPort.lg;\n }\n else if (window.innerWidth >= 768) {\n return ViewPort.md;\n }\n else if (window.innerWidth >= 576) {\n return ViewPort.sm;\n }\n else {\n return ViewPort.xs;\n }\n }\n\n useLayoutEffect(() => {\n function updateSize() {\n setWidth(window.innerWidth);\n setHeight(window.innerHeight);\n setBreakPoint(getBreakPoint());\n }\n\n window.addEventListener('resize', updateSize);\n return () => window.removeEventListener('resize', updateSize);\n }, []);\n return { width, height, breakPoint }; //size;\n}","import useWindowSize from \"./UseWindowHook\";\nimport Itinerary from \"../Data/Itinerary\";\nimport StartWidget from \"../Data/StartWidget\";\n\n\n// Hook used to determine what the height of the start widget should be in units of VH(desktop) or pixels(mobile)\nconst useCalculateWidgetHeight = (\n startWidget: StartWidget | undefined,\n itinerary: Itinerary,\n autoScroll: boolean,\n show: string,\n showModal?: string,\n isQuoteBooked?: boolean\n) => {\n // to determine whether to use mobile or desktop calculations\n const {width} = useWindowSize();\n\n const showModalValue = showModal || \"\";\n\n // using avail height helps during times when the VH changes temporarily(add item modal)\n const height = window.screen.availHeight;\n \n let moduleAndButtonViewHeight = 0;\n let firstLoad = false;\n\n // these look like arbitrary values but they are designed\n // around 1080p 100% browser size for desktop\n // TODO - more robust future solution should be implemented\n // TODO - to scale based on all window sizes, consider a pixel-based\n // approach which is more portable\n const calculateWidgetViewHeight = () => {\n const MODULE_ITEM_SCALAR_VH = 22.5;\n const BASE_VH = 31;\n const ADD_ITEM_VH = 93;\n const NO_ITEM_VH = 38;\n const TABLET_WIDTH_THRESHOLD = 768;\n\n // the threshold for tablet view\n if (width <= TABLET_WIDTH_THRESHOLD) {\n return calculateMobileWidgetHeight();\n }\n\n // calculate total units to scale the view height by\n const {numItems} = calculateTotalItineraryUnits();\n\n // base viewHeight to calculate from\n let viewHeight = BASE_VH;\n \n // expand size for \"add item\" modal\n if (show !== \"\" && show !== \"build-your-own\") {\n return viewHeightScalar(ADD_ITEM_VH);\n }\n\n if (numItems === 0) {\n firstLoad = true;\n return viewHeightScalar(NO_ITEM_VH);\n } \n \n viewHeight+=(MODULE_ITEM_SCALAR_VH*numItems);\n \n // if module and button viewheight has been calculated already\n // then skip re-calculation\n if (moduleAndButtonViewHeight == 0) {\n moduleAndButtonViewHeight = calculateTotalModuleAndButtonHeight();\n }\n viewHeight+=moduleAndButtonViewHeight;\n\n return viewHeightScalar(viewHeight);\n }\n\n const calculateMobileWidgetHeight = () => {\n const MODULE_SCALAR_PX = 220;\n const BASE_PX = 480;\n const ADD_ITEM_PX = 900;\n const NO_ITEM_PX = 510;\n const AT_LEAST_ONE_ITEM_PX = 535;\n const ITEMS_AFTER_ONE_SCALAR_PX = 140;\n const GET_QUOTE_PX = 900;\n const BOOK_NOW_PX = 1050;\n const REQUEST_QUOTE_PX = 1000;\n // TODO: this can be adjusted once the payment page is more mobile friendly\n const MAKE_PAYMENT_PX = 1200;\n const PACKAGE_SPECIALS_PX = 900;\n\n // try to do mobile in pixels to make it more transferable\n let viewHeight = BASE_PX;\n\n // expand size for \"add item\" modal, this supports two\n // full view elements being shown at once\n if (show.includes(\"add-\")) {\n return ADD_ITEM_PX;\n }\n\n if (show === \"get-quote\") {\n return GET_QUOTE_PX;\n }\n\n if (show.includes(\"request-\")) {\n return REQUEST_QUOTE_PX;\n }\n\n if (showModalValue === \"make-payment\") {\n return MAKE_PAYMENT_PX;\n }\n\n if (showModalValue === \"book-now\") {\n return BOOK_NOW_PX;\n }\n\n if (show === \"package-specials\") {\n return PACKAGE_SPECIALS_PX;\n }\n\n // calculate modules and total units to scale the view height\n const {modules, numItems} = calculateTotalItineraryUnits();\n\n if (numItems === 0) {\n // this height supports the calendar\n firstLoad = true;\n return NO_ITEM_PX;\n }\n\n // first item calculation is different because the shown fields change\n if (numItems >= 1) {\n viewHeight = AT_LEAST_ONE_ITEM_PX;\n }\n\n // each additional module after the first gets scaled linearly\n viewHeight+=((modules-1)*MODULE_SCALAR_PX);\n \n // pixels are already accounted for on the first item of each module\n viewHeight+=((numItems-modules)*ITEMS_AFTER_ONE_SCALAR_PX);\n\n // this adds extra padding to accommodate totals section\n if (isQuoteBooked) {\n viewHeight+=450;\n }\n\n return viewHeight;\n }\n\n // quick and dirty scalar solution to better support smaller screens\n const viewHeightScalar = (viewHeight: number) => {\n const TUNED_HEIGHT_PX = 1080;\n const MAGICAL_ADDITIVE = 1.2;\n\n // based on using 1080p as my tuned value\n if (height < TUNED_HEIGHT_PX) {\n // this is somewhat arbitrary but helps give smaller vertical screens better capability, even if its not tuned perfectly\n const lowHeightScalar = ((TUNED_HEIGHT_PX-height)/TUNED_HEIGHT_PX) + MAGICAL_ADDITIVE;\n viewHeight*=lowHeightScalar;\n }\n return viewHeight;\n }\n\n const calculateTotalModuleAndButtonHeight = () => {\n let viewHeight = 0;\n const MODULE_ADDITIVE_VH = 5;\n const BUTTON_ADDITIVE_VH = 3;\n const SAVE_BUTTON_ADDITIVE_VH = 5;\n\n // Module Calculations\n if (startWidget?.showCustomItemsModule) {\n viewHeight+=MODULE_ADDITIVE_VH;\n }\n if (startWidget?.showTransportationModule) {\n viewHeight+=MODULE_ADDITIVE_VH;\n }\n if (startWidget?.showLodgingModule) {\n viewHeight+=MODULE_ADDITIVE_VH;\n }\n if (startWidget?.showGolfModule) {\n viewHeight+=MODULE_ADDITIVE_VH;\n }\n\n // Button Calculations\n if (startWidget?.showExtrasButton) {\n viewHeight+=BUTTON_ADDITIVE_VH;\n }\n if (startWidget?.showGolfButton) {\n viewHeight+=BUTTON_ADDITIVE_VH;\n }\n if (startWidget?.showLodgingButton) {\n viewHeight+=BUTTON_ADDITIVE_VH;\n }\n if (startWidget?.showSaveQuoteButton) {\n viewHeight+=SAVE_BUTTON_ADDITIVE_VH;\n }\n \n return viewHeight;\n }\n\n const calculateTotalItineraryUnits = () => {\n // individual counts must be tracked since each type has its own itinerary type\n let golfCount = 0;\n let transportCount = 0;\n let lodgingCount = 0;\n let customCount = 0;\n let modules = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.map(itinerary => {\n golfCount+=itinerary.itineraryUnits.length;\n })\n if (golfCount > 0) modules++;\n }\n if (itinerary.transportItineraries !== undefined) {\n itinerary.transportItineraries.map(itinerary => {\n transportCount+=itinerary.itineraryUnits.length;\n })\n if (transportCount > 0) modules++;\n }\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.map(itinerary => {\n lodgingCount+=itinerary.itineraryUnits.length;\n })\n if (lodgingCount > 0) modules++;\n }\n if (itinerary.customItineraries !== undefined) {\n itinerary.customItineraries.map(itinerary => {\n customCount+=itinerary.itineraryUnits.length;\n })\n if (customCount > 0) modules++;\n }\n return {modules, numItems: (golfCount+transportCount+lodgingCount+customCount)};\n }\n\n const sendItineraryUnitsMessage = () => {\n const viewHeight = calculateWidgetViewHeight();\n window.parent.postMessage({viewHeight: viewHeight, autoScroll: autoScroll, isMobile: width<=768, firstLoad: firstLoad}, \"*\");\n firstLoad = false;\n }\n\n return {sendItineraryUnitsMessage}\n}\n\nexport default useCalculateWidgetHeight;","import \"../itinerary/itinerary.css\";\n\nimport React, { SetStateAction, useContext, useEffect, useImperativeHandle, useState } from \"react\";\nimport { Col, Button, Modal, Row, Carousel, Form, InputGroup, Spinner } from \"react-bootstrap\";\nimport LodgingTab from \"./lodging-tab/LodgingTab\";\nimport GolfTab from \"./golf-tab/GolfTab\";\nimport TransportationTab from \"./transportation-tab/TransportationTab\";\nimport CustomItemTab from \"./custom-items-tab/CustomItemTab\";\nimport GetQuote from \"./get-quote/GetQuote\";\nimport MakePayment from \"./make-payment/MakePayment\";\nimport Totals from \"./totals/Totals\";\n\nimport Itinerary from \"../../../../../Data/Itinerary\";\nimport LodgingItineraryUnit from \"../../../../../Data/Reservation/Lodging/LodgingItineraryUnit\";\nimport GolfItineraryUnit from \"../../../../../Data/Reservation/Golf/GolfItineraryUnit\";\nimport TransportItineraryUnit from \"../../../../../Data/Reservation/Transportation/TransportItineraryUnit\";\nimport CustomItineraryUnit from \"../../../../../Data/Reservation/Custom/CustomItineraryUnit\";\nimport { DatesAndGuests } from \"../../widget-form/WidgetForm\";\nimport { WidgetContext } from \"../../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../../_helpers/Enums/ViewPortEnum\";\nimport Quote from \"../../../../../Data/Quote/Quote\";\nimport Customer from \"../../../../../Data/Customer/Customer\";\nimport useCreateQuote, { CreateQuoteRequest } from \"../data-service-hooks/UseCreateQuote\";\nimport Reservation from \"../../../../../Data/Reservation/Reservation\";\nimport { ReservationCustomer } from \"../../../../../Data/Reservation/ReservationCustomer\";\nimport Decimal from \"decimal.js\";\nimport LodgingItinerary from \"../../../../../Data/Reservation/Lodging/LodgingItinerary\";\nimport CustomItinerary from \"../../../../../Data/Reservation/Custom/CustomItinerary\";\nimport GolfItinerary from \"../../../../../Data/Reservation/Golf/GolfItinerary\";\nimport TransportItinerary from \"../../../../../Data/Reservation/Transportation/TransportItinerary\";\nimport LodgingItem from \"../../../../../Data/LodgingItem\";\nimport CustomItem from \"../../../../../Data/CustomItem\";\nimport GolfItem from \"../../../../../Data/GolfItem\";\nimport TransportationItem from \"../../../../../Data/TransportationItem\";\nimport Vendor from \"../../../../../Data/Vendor\";\nimport VendorUnit from \"../../../../../Data/VendorUnit\";\nimport ItineraryUnit from \"../../../../../Data/ItineraryUnit\";\nimport moment from \"moment\";\nimport { ReservationStatus } from \"../../../../../Data/Reservation/ReservationStatus\";\nimport { toast } from \"react-toastify\";\nimport BookNow from \"./book-now/BookNow\";\nimport { Adjustment } from \"../../../../../Data/Reservation/Adjustment\";\nimport AdjustmentTab from \"./adjustment-tab/AdjustmentTab\";\nimport VendorUnitImage from \"../../../../../Data/VendorUnitImage\";\nimport ReactGA from 'react-ga4';\nimport UseGetPromoByName, { PromoFetchQuery, PromoFetchResponse } from \"../data-service-hooks/UseGetPromoByName\";\nimport Promo from \"../../../../../Data/Promo\";\nimport { isStringEmpty } from \"../../../../../_helpers/Functions\";\nimport { PreBuiltPkg } from \"../widget-modals/pre-built-packages/Models/PreBuiltPkg\";\nimport AddItineraryUnitButton from \"./components/AddItineraryUnitButton\";\nimport ItineraryModalButton from \"./components/ItineraryModalButton\";\nimport useCalculateWidgetHeight from \"../../../../../_helpers/UseCalculateWidgetHeight\";\nimport StartWidgetBrandSetting from \"../../../../../Data/StartWidgetBrandSetting\";\n\ninterface props {\n quoteState: [Quote | undefined, React.Dispatch>];\n itineraryState: [Itinerary, React.Dispatch>];\n showState: [string, React.Dispatch>];\n datesAndGuestsState: [DatesAndGuests, React.Dispatch>];\n pbPackage: PreBuiltPkg | undefined;\n sameDayReplays: any;\n emailCustomer: ReservationCustomer | undefined;\n\n onEditLodging: (item: LodgingItineraryUnit) => void;\n onEditGolf: (item: GolfItineraryUnit) => void;\n onEditTransport: (item: TransportItineraryUnit) => void;\n onEditCustom: (item: CustomItineraryUnit) => void;\n}\n\nconst ItineraryStart: React.FC = (props) => {\n // #region logic\n const { companyId, startWidget, style, fromEmail, viewPortBreakPoint/* , brandId */, brandSettings, autoScroll, campaignId, brand } = useContext(WidgetContext);\n const brandSetting: StartWidgetBrandSetting = brandSettings.find(s => s.brandId === brand?.brandId) as StartWidgetBrandSetting;\n\n const {\n quoteState,\n itineraryState,\n showState,\n onEditLodging,\n onEditGolf,\n onEditTransport,\n onEditCustom,\n emailCustomer,\n pbPackage,\n } = props;\n\n const [quote, setQuote] = quoteState;\n const [itinerary, setItinerary] = itineraryState;\n const [show, setShow] = showState;\n const [datesAndGuests, setDatesAndGuests] = props.datesAndGuestsState;\n const [bookNowRequested, setBookNowRequested] = useState(false);\n const [quoteRequested, setQuoteRequested] = useState(false);\n const [leadCustomer, setLeadCustomer] = useState();\n const [reservationCustomers, setReservationCustomers] = useState([]);\n const [payingCustomer, setPayingCustomer] = useState(emailCustomer);\n const [showModal, setShowModal] = useState(payingCustomer ? \"make-payment\" : \"\");\n const [fromBooking, setFromBooking] = useState(false);\n const [createdFromBooking, setCreatedFromBooking] = useState(false);\n\n const [createRequest, setCreateRequest] = useState();\n const createResponse = useCreateQuote(createRequest);\n\n const [groupName, setGroupName] = useState();\n const [imgIndex, setImgIndex] = useState(0);\n // const [selectedVendor, setSelectedVendor] = useState();\n const [selectedVendor, setSelectedVendor] = useState();\n\n const [promoInput, setPromoInput] = useState();\n const [promoRequest, setPromoRequest] = useState(undefined);\n const promoFetchResponse = UseGetPromoByName(promoRequest);\n const [promo, setPromo] = useState();\n const [promoError, setPromoError] = useState(false);\n const [promoErrorMsg, setPromoErrorMsg] = useState();\n\n const { sendItineraryUnitsMessage } = useCalculateWidgetHeight(\n startWidget,\n itinerary,\n autoScroll,\n show,\n showModal,\n (quote && quote.reservation.statusId && (Number)(quote.reservation.statusId) !== 40 && (Number)(quote.reservation.statusId) !== 50)\n );\n\n // useEffect(() => {\n // console.log(\"quote\", quote);\n // }, [quote]);\n\n const isQuoteExpired = quote === undefined ? false : (moment().isAfter(moment(quote.createdOn).add(brandSetting.quotesValidDays, \"days\")) && quote.reservation.statusId == 10);\n // console.log(\"isQuoteExpired\", isQuoteExpired);\n\n const handleSelect = (selectedIndex: any, e: any) => {\n setImgIndex(selectedIndex);\n };\n\n const webViewAddButtonConditional = (!!!quote && viewPortBreakPoint > ViewPort.sm) && (pbPackage === undefined ? true : pbPackage.allowCustomization);\n\n function requestItineraryQuote(customers: ReservationCustomer[], groupName: string | undefined, fromBooking: boolean) {\n // call function on all tabs to set item values\n setGroupName(groupName);\n // setLeadCustomer(customer);\n setFromBooking(fromBooking);\n setReservationCustomers(customers);\n setQuoteRequested(true);\n }\n\n function onSaveQuote(data: Quote | undefined) {\n let quote: Quote | undefined = undefined;\n\n if (data) {\n console.log(\"data\", data);\n toast.success(\"Quote has been created and sent to your email.\", { hideProgressBar: false });\n quote = data;\n console.log(\"quote\", quote);\n if (data.campaignId !== undefined) {\n if (startWidget.activateGoogleAnalytics && !isStringEmpty(startWidget.googleAnalyticsTrackingCode)) {\n ReactGA.event({\n category: \"PKGLoop_Custom\",\n action: \"PKGLoop_Quote_Created\",\n label: startWidget.brandId.toString(),\n value: quote.reservation.totalSell,\n });\n }\n }\n } else {\n toast.error(\"Error!\", { hideProgressBar: false });\n }\n\n setQuote(quote !== undefined ? { ...quote } : quote);\n if (!fromBooking) {\n setShowModal(\"\");\n\n if (quote !== undefined &&!window.location.href.includes(\"&itineraryNumber\"))\n {\n window.setTimeout(() => { \n window.location.href += `&itineraryNumber=${quote?.reservation.itineraryNumber}`;\n }, 3000);\n }\n }\n else setCreatedFromBooking(true);\n }\n\n function handlePromoEntry() {\n if (companyId !== undefined && !isStringEmpty(promoInput))\n setPromoRequest({\n companyId: companyId as number,\n promoCodeName: promoInput as string\n });\n }\n\n function handleDeletePromoEntry() {\n setPromo(undefined);\n setPromoInput(\"\");\n setPromoError(false);\n setPromoErrorMsg(undefined);\n }\n\n const onReservationCustomerAdded = (reservationCustomer: ReservationCustomer) => {\n if (quote == undefined) return;\n\n toast.success(\"Guest Added!\", { hideProgressBar: false });\n\n setTimeout(function () {\n if (!window.location.href.includes(\"&itineraryNumber=\"))\n window.location.href += `&itineraryNumber=${quote.reservation.itineraryNumber}`;\n else window.location.reload();\n }, 2000);\n }\n\n function displayPaymentModalForCustomer(customer: ReservationCustomer) {\n setPayingCustomer(customer);\n setShowModal(\"make-payment\");\n }\n\n function removeLodgingItem(unit: LodgingItineraryUnit) {\n if (itinerary.lodgingItineraries && itinerary.lodgingItineraries.length > 0) {\n const vendorIndex = itinerary.lodgingItineraries.findIndex((i: LodgingItinerary) => i.vendorId == unit.vendorId);\n\n itinerary.lodgingItineraries[vendorIndex].itineraryUnits.forEach((u, i) => {\n if (itinerary.lodgingItineraries !== undefined && (unit.itineraryIndex as number) === u.itineraryIndex as number) {\n itinerary.lodgingItineraries[vendorIndex].itineraryUnits.splice(i, 1);\n }\n });\n\n let found = false;\n if (itinerary.lodgingItineraries.some((v: any) => v.itineraryUnits.length > 0)) found = true;\n if (!found) itinerary.lodgingItineraries = undefined;\n\n setItinerary({ ...itinerary });\n sendItineraryUnitsMessage();\n }\n }\n\n function removeGolfItem(unit: GolfItineraryUnit) {\n if (itinerary.golfItineraries && itinerary.golfItineraries.length > 0) {\n const vendorIndex = itinerary.golfItineraries.findIndex((i: GolfItinerary) => i.vendorId == unit.vendorId);\n\n itinerary.golfItineraries[vendorIndex].itineraryUnits.forEach((u, i) => {\n if (itinerary.golfItineraries !== undefined && (unit.itineraryIndex as number) === u.itineraryIndex as number) {\n itinerary.golfItineraries[vendorIndex].itineraryUnits.splice(i, 1);\n }\n });\n\n let found = false;\n if (itinerary.golfItineraries.some((v: any) => v.itineraryUnits.length > 0)) found = true;\n if (!found) itinerary.golfItineraries = undefined;\n\n setItinerary({ ...itinerary });\n sendItineraryUnitsMessage();\n }\n }\n\n function removeTransportItem(unit: TransportItineraryUnit) {\n if (itinerary.transportItineraries && itinerary.transportItineraries.length > 0) {\n const vendorIndex = itinerary.transportItineraries.findIndex((i: TransportItinerary) => i.vendorId == unit.vendorId);\n\n itinerary.transportItineraries[vendorIndex].itineraryUnits.forEach((u, i) => {\n if (itinerary.transportItineraries !== undefined && (unit.itineraryIndex as number) === u.itineraryIndex as number) {\n itinerary.transportItineraries[vendorIndex].itineraryUnits.splice(i, 1);\n }\n });\n\n let found = false;\n if (itinerary.transportItineraries.some((v: any) => v.itineraryUnits.length > 0)) found = true;\n if (!found) itinerary.transportItineraries = undefined;\n\n setItinerary({ ...itinerary });\n sendItineraryUnitsMessage();\n }\n }\n\n function removeCustomItem(unit: CustomItineraryUnit) {\n if (itinerary.customItineraries && itinerary.customItineraries.length > 0) {\n const vendorIndex = itinerary.customItineraries.findIndex((i: CustomItinerary) => i.vendorId == unit.vendorId);\n\n itinerary.customItineraries[vendorIndex].itineraryUnits.forEach((u, i) => {\n if (itinerary.customItineraries !== undefined && (unit.itineraryIndex as number) === u.itineraryIndex as number) {\n itinerary.customItineraries[vendorIndex].itineraryUnits.splice(i, 1);\n }\n });\n\n let found = false;\n if (itinerary.customItineraries.some((v: any) => v.itineraryUnits.length > 0)) found = true;\n if (!found) itinerary.customItineraries = undefined;\n\n setItinerary({ ...itinerary });\n sendItineraryUnitsMessage();\n }\n }\n\n function handleIndividualPayments(_quote: Quote) {\n setQuote({ ..._quote });\n }\n\n useEffect(() => {\n if (!!!promoFetchResponse.data) return;\n // if (promoFetchResponse.data) {\n const response: PromoFetchResponse = promoFetchResponse.data;\n // console.log(\"response\", response);\n\n if (response && response.success && response.promo) {\n const promo = response.promo;\n // console.log(\"promo\", promo);\n setPromoInput(promo.promoCodeName);\n let validPromo: boolean = true;\n\n if (promo.validToBookFor) {\n const arrive = new Date(datesAndGuests.fromDate);\n arrive.setHours(0, 0, 0, 0,);\n\n const depart = new Date(datesAndGuests.toDate);\n depart.setHours(0, 0, 0, 0,);\n\n if ((promo.validToBookForStart && (new Date(promo.validToBookForStart) > arrive)) || (promo.validToBookForEnd && (new Date(promo.validToBookForEnd) < depart))) {\n validPromo = false;\n const reason: string = \"Outside of booking dates\";\n setPromoError(true);\n setPromoErrorMsg(reason);\n return;\n }\n }\n else\n if (promo.validToBookFrom) {\n const today = new Date();\n if ((promo.validToBookFromStart && (new Date(promo.validToBookFromStart) > today)) || (promo.validToBookFromEnd && (new Date(promo.validToBookFromEnd) < today))) {\n validPromo = false;\n const reason: string = \"Outside of usage dates\";\n setPromoError(true);\n setPromoErrorMsg(reason);\n return;\n }\n }\n\n if (promo.promoBrands.findIndex(pb => pb.brandId === brand?.brandId) === -1) {\n validPromo = false;\n }\n\n // if (promo.promoVendors.length > 0\n // // && promo.promoVendors.some(pv =>\n // // reservationData.current.lodgingItineraries.findIndex(li => li.vendorId === pv.vendorId) === -1 &&\n // // reservationData.current.golfItineraries.findIndex(li => li.vendorId === pv.vendorId) === -1 &&\n // // reservationData.current.transportItineraries.findIndex(li => li.vendorId === pv.vendorId) === -1 &&\n // // reservationData.current.customItineraries.findIndex(li => li.vendorId === pv.vendorId) === -1)\n // ) {\n // validPromo = false;\n // }\n\n if (validPromo) {\n setPromo(promo);\n\n setPromoError(false);\n setPromoErrorMsg(undefined);\n\n // handleDeletePromo(); // Delete existing applied promo first\n\n // if (promo.discount !== undefined && promo.discount > 0) {\n // if (promo.discountType == \"%\") {\n // // let sell: number = tempAdjustmentsAndTotals.sell;\n // // sell = sell * ((100 - promo.discount) / 100);\n // // tempAdjustmentsAndTotals.discountApplied = tempAdjustmentsAndTotals.sell - sell;\n // // tempAdjustmentsAndTotals.profit -= tempAdjustmentsAndTotals.discountApplied;\n // // tempAdjustmentsAndTotals.sell = sell;\n // }\n // else if (promo.discountType == \"$\") {\n // // tempAdjustmentsAndTotals.discountApplied = promo.discount;\n // // tempAdjustmentsAndTotals.profit -= tempAdjustmentsAndTotals.discountApplied;\n // // // tempAdjustmentsAndTotals.balanceDue -= promo.discount;\n // // tempAdjustmentsAndTotals.sell -= promo.discount;\n // }\n // }\n\n // setAdjustmentsAndTotals({ ...tempAdjustmentsAndTotals });\n // setRecalculateTotals(recalculateTotals + 1);\n }\n else {\n // Promo is invalid\n setPromoError(true);\n setPromoErrorMsg(\"Invalid promo code!\");\n }\n }\n else {\n // Promo is invalid\n setPromoError(true);\n setPromoErrorMsg(\"Invalid promo code!\");\n }\n // }\n }, [promoFetchResponse.data]);\n\n useEffect(() => {\n if (!bookNowRequested) return;\n\n setShowModal(\"book-now\");\n setBookNowRequested(false);\n }, [bookNowRequested]);\n\n // #region this is what actually sends the create request\n useEffect(() => {\n if (!quoteRequested || companyId === undefined) return;\n setQuoteRequested(false);\n\n const tempItinerary: Itinerary = JSON.parse(JSON.stringify(itinerary));\n\n const li = tempItinerary.lodgingItineraries ? tempItinerary.lodgingItineraries : [];\n const gi = tempItinerary.golfItineraries ? tempItinerary.golfItineraries : [];\n const ti = tempItinerary.transportItineraries ? tempItinerary.transportItineraries : [];\n const ci = tempItinerary.customItineraries ? tempItinerary.customItineraries : [];\n\n let invalidDoteFound = false;\n li.forEach(i => {\n if (i.vendor !== undefined) {\n i.vendor = undefined;\n\n i.itineraryUnits.forEach(u => {\n u.vendor = undefined;\n\n if (u.sell < 0 || !u.isValid) {\n invalidDoteFound = true;\n }\n });\n }\n });\n gi.forEach(i => {\n if (i.vendor !== undefined) {\n i.vendor = undefined;\n\n i.itineraryUnits.forEach(u => {\n u.vendor = undefined;\n\n if (u.sell < 0 || !u.isValid) {\n invalidDoteFound = true;\n }\n });\n }\n });\n ti.forEach(i => {\n if (i.vendor !== undefined) {\n i.vendor = undefined;\n\n i.itineraryUnits.forEach(u => {\n u.vendor = undefined;\n\n if (u.sell < 0 || !u.isValid) {\n invalidDoteFound = true;\n }\n });\n }\n });\n ci.forEach(i => {\n if (i.vendor !== undefined) {\n i.vendor = undefined;\n\n i.itineraryUnits.forEach(u => {\n u.vendor = undefined;\n\n if (u.sell < 0 || !u.isValid) {\n invalidDoteFound = true;\n }\n });\n }\n });\n\n if (invalidDoteFound) {\n alert(\"An itinerary item contains an invalid date range.\");\n return;\n }\n\n const reservation: Reservation = {\n companyId: companyId,\n brandId: brand?.brandId,\n leadCustomer: undefined,\n itineraryNumber: \"\",\n lodgingItineraries: li,\n golfItineraries: gi,\n transportItineraries: ti,\n customItineraries: ci,\n numGuests: datesAndGuests.guests,\n numChildren: 0,\n totalCost: 0.0,\n totalSell: 0.0,\n balanceDue: 0.0,\n arrive: moment(datesAndGuests.fromDate).format(\"YYYY-MM-DD\"),\n depart: moment(datesAndGuests.toDate).format(\"YYYY-MM-DD\"),\n tax: 0.0,\n resortFees: 0.0,\n cleaningFee: 0.0,\n promoId: promo !== undefined ? promo.promoId : undefined,\n groupName: !!!groupName ? undefined : {\n companyId: companyId,\n name: groupName\n },\n reservationCustomers: reservationCustomers,\n preBuiltPkgId: pbPackage?.preBuiltPkgId || undefined,\n isPreBuiltPkg: false\n }\n\n const quote: Quote = {\n reservation,\n requestNote: reservationCustomers[0].customer.customerNotes ? reservationCustomers[0].customer.customerNotes as string : \"\",\n campaignId: campaignId\n };\n\n // console.log(\"quote\", quote);\n\n setCreateRequest(quote);\n }, [quoteRequested]);\n\n useEffect(() => {\n if (createResponse.data) {\n console.log(\"createResponse.data\", createResponse.data);\n\n onSaveQuote(createResponse.data);\n }\n }, [createResponse.data]);\n\n useEffect(() => {\n if (createResponse.error) {\n console.log(\"quote error response\", createResponse.error);\n onSaveQuote(undefined);\n }\n }, [createResponse.error]);\n\n useEffect(() => {\n // this will trigger a view height recalculation\n sendItineraryUnitsMessage();\n }, [showModal]);\n\n useEffect(() => {\n sendItineraryUnitsMessage();\n }, [itinerary])\n\n // useEffect(() => {\n // console.log(\"brandSetting\", brandSetting);\n // }, [brandSetting]);\n\n // #endregion\n return (\n \n {/* Desktop/Mobile */}\n {quote && quote.reservation && quote.reservation.deleted ? (\n \n \n

Sorry this quote is no longer valid. Please call {brandSetting?.brand.phone}

\n \n
\n ) : (\n \n {!!!quote && viewPortBreakPoint < ViewPort.md && (\n \n {startWidget.showBookNowButton && !isQuoteExpired && (\n \n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"book-now\");\n }}\n >\n Book Now\n \n \n )}\n\n {startWidget.showSaveQuoteButton && (\n \n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"get-quote\");\n }}\n >\n Save/Get Quote\n \n \n )}\n \n )}\n\n
\n {/* Itinerary number */}\n {quote && quote.reservation && (\n \n \n

Itinerary# {quote.reservation.itineraryNumber}\n {quote.reservation.statusId && (\n <>\n {quote.reservation.statusId == 20 && (\n - Booked (Pending Confirmations)\n )}\n {quote.reservation.statusId == 30 && (\n - Booked (Complete)\n )}\n {quote.reservation.statusId == 40 && (\n - Cancelled (Pending Confirmations)\n )}\n {quote.reservation.statusId == 50 && (\n - Cancelled (Complete)\n )}\n {quote.reservation.statusId == 60 && (\n - Booked (Balance Due)\n )}\n \n )}\n

\n <>\n {quote.reservation.statusId && quote.reservation.statusId == 10 && isQuoteExpired && (\n
Sorry this quote is no longer valid. Please call {brandSetting.brand.phone}
\n )}\n \n \n \n {quote.reservation.groupName && (\n

{quote.reservation.groupName.name}

\n )}\n {!!!quote.reservation.groupName && quote.reservation.leadCustomer && (\n

\n {quote.reservation.leadCustomer.firstName} {quote.reservation.leadCustomer.lastName}\n

\n )}\n {startWidget.showBookNowButton && viewPortBreakPoint <= ViewPort.sm && quote.reservation.statusId !== 40 && quote.reservation.statusId !== 50 && (quote.reservation.paymentCategories === undefined || quote.reservation.paymentCategories.length === 0) && (\n \n )}\n \n
\n )}\n\n {viewPortBreakPoint >= ViewPort.md && (\n \n

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n

{datesAndGuests.guests}{` Guest${datesAndGuests.guests > 1 ? \"s\" : \"\"}`}

\n\n
\n {quote && quote.reservation.leadCustomer && (\n

{quote.reservation.groupName && ({quote.reservation.leadCustomer.firstName} {quote.reservation.leadCustomer.lastName} - )}{quote.reservation.leadCustomer.emailAddress}

\n )}\n
\n {!!!quote && (\n <>\n {startWidget.showBookNowButton && (\n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"book-now\");\n }}\n >\n Book Now\n \n )}\n {startWidget.showSaveQuoteButton && (\n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined && itinerary.lodgingItineraries !== null) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined && itinerary.golfItineraries !== null) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n console.log(\"u.availableTeeTimes\", u.availableTeeTimes);\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"get-quote\");\n }}\n >\n Save/Get Quote\n \n )}\n \n )}\n\n {quote && quote.reservation.statusId && (Number)(quote.reservation.statusId) !== 40 && (Number)(quote.reservation.statusId) !== 50 && (quote.reservation.paymentCategories === undefined || quote.reservation.paymentCategories.length === 0) && (\n \n )}\n
\n
\n
\n )}\n\n {viewPortBreakPoint < ViewPort.md && (\n \n

Dates:{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"} - {datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n
\n )}\n\n {viewPortBreakPoint < ViewPort.md && (\n \n

Guests:{datesAndGuests.guests}

\n
\n )}\n\n {/* Lodging Tab */}\n {(viewPortBreakPoint >= ViewPort.md || (itinerary.lodgingItineraries && itinerary.lodgingItineraries.some(i => i.itineraryUnits.length > 0))) && (\n <>\n {(!!quote || startWidget.showLodgingModule) && (!fromEmail || (itinerary.lodgingItineraries && itinerary.lodgingItineraries.length > 0)) && (\n <>\n
\n {(!!!quote || (itinerary.lodgingItineraries && itinerary.lodgingItineraries.some((li: LodgingItinerary) => li.itineraryUnits.some((iu: ItineraryUnit) => ((quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete) && iu.showOnItinerary) || !iu.cancelled && iu.showOnItinerary)))) && (\n <>\n { /* if any items are showOnItinerary true then draw the header and border */}\n \n Lodging\n \n\n \n \n )}\n\n {itinerary.lodgingItineraries && itinerary.lodgingItineraries.flatMap(i => i.itineraryUnits).filter(u => quote === undefined || quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete || !u.cancelled)\n .sort((a, b) => {\n const dateA = moment(a.checkIn);\n const dateB = moment(b.checkIn);\n\n if (dateA.isBefore(dateB)) return -1;\n if (dateA.isAfter(dateB)) return 1;\n return 0;\n })\n .map((item: LodgingItineraryUnit, index: number) => {\n item.itineraryIndex = index;\n return item;\n })\n .map((item: LodgingItineraryUnit, index: number) => ( // test\n {\n onEditLodging(unit);\n setShow(\"add-lodging\");\n }}\n bookNowRequested={bookNowRequested}\n quoteRequested={quoteRequested}\n datesAndGuests={datesAndGuests}\n quoteStatus={quote && quote.reservation.statusId ? quote.reservation.statusId : undefined}\n onVendorImageClick={(vendor: Vendor | undefined) => {\n setSelectedVendor(vendor);\n setShowModal(\"vendor-images\");\n }}\n editable={pbPackage === undefined ? quote === undefined : quote === undefined && pbPackage.allowCustomization}\n onCheckInDateChanged={(date) => {\n if (itinerary.lodgingItineraries === undefined || item.itineraryIndex === undefined) return;\n itinerary.lodgingItineraries[item.itineraryIndex].itineraryUnits[index].checkIn = date;\n setItinerary({ ...itinerary });\n }}\n onCheckOutDateChanged={(date) => {\n if (itinerary.lodgingItineraries === undefined || item.itineraryIndex === undefined) return;\n itinerary.lodgingItineraries[item.itineraryIndex].itineraryUnits[index].checkOut = date;\n setItinerary({ ...itinerary });\n }}\n />\n ))}\n {/* Add Lodging Button */}\n {webViewAddButtonConditional && (\n {\n setShow(\"add-lodging\");\n }}\n />\n )}\n
\n \n )}\n \n )}\n\n {/* Golf Tab */}\n {(viewPortBreakPoint >= ViewPort.md || (itinerary.golfItineraries && itinerary.golfItineraries.some(i => i.itineraryUnits.length > 0))) && (\n <>\n {(!!quote || startWidget.showGolfModule) && (!fromEmail || (itinerary.golfItineraries && itinerary.golfItineraries.length > 0)) && (\n <>\n
\n {(!!!quote || (itinerary.golfItineraries && itinerary.golfItineraries.some((gi: GolfItinerary) => gi.itineraryUnits.some((iu: ItineraryUnit) => ((quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete) && iu.showOnItinerary) || !iu.cancelled && iu.showOnItinerary)))) && (\n <>\n \n Golf\n \n \n \n )}\n\n {/* Golf items */}\n {itinerary.golfItineraries && itinerary.golfItineraries.flatMap(i => i.itineraryUnits).filter(u => quote === undefined || quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete || !u.cancelled)\n .sort((a, b) => {\n const dateA = moment(a.playDate);\n const dateB = moment(b.playDate);\n\n if (dateA.isBefore(dateB)) return -1;\n if (dateA.isAfter(dateB)) return 1;\n\n if (a.teeTime < b.teeTime) return -1;\n if (a.teeTime > b.teeTime) return 1;\n\n return 0;\n })\n .map((item: GolfItineraryUnit, index: number) => {\n item.itineraryIndex = index;\n return item;\n })\n .map((item: GolfItineraryUnit, index: number) =>\n //be able to add items to replays target correct array by index\n <>\n {/* {fromEmail && (\n

FROM EMAIL

\n )} */}\n {true && (\n {\n // unit.vendor.itineraryIndex = index;\n onEditGolf(unit);\n setShow(\"add-golf\");\n }}\n bookNowRequested={bookNowRequested}\n quoteRequested={quoteRequested}\n datesAndGuests={datesAndGuests}\n quoteStatus={quote && quote.reservation.statusId ? quote.reservation.statusId : undefined}\n onVendorImageClick={(vendor: Vendor | undefined) => {\n setSelectedVendor(vendor);\n setShowModal(\"vendor-images\");\n }}\n editable={pbPackage === undefined ? quote === undefined : quote === undefined && pbPackage.allowCustomization}\n />\n )}\n \n )}\n\n {/* Add Golf Button */}\n {webViewAddButtonConditional && (\n {\n setShow(\"add-golf\");\n }}\n />\n )}\n
\n \n )}\n \n )}\n\n {/* Transportation Tab */}\n {(viewPortBreakPoint >= ViewPort.md || (itinerary.transportItineraries && itinerary.transportItineraries.some(i => i.itineraryUnits.length > 0))) && (\n <>\n {(!!quote || startWidget.showTransportationModule) && (!fromEmail || (itinerary.transportItineraries && itinerary.transportItineraries.length > 0)) && (\n <>\n
\n {(!!!quote || (itinerary.transportItineraries && itinerary.transportItineraries.some((ti: TransportItinerary) => ti.itineraryUnits.some((iu: ItineraryUnit) => ((quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete) && iu.showOnItinerary) || !iu.cancelled && iu.showOnItinerary)))) && (\n <>\n \n Transportation\n \n \n \n )}\n\n {/* Transportation items */}\n {/* {itinerary.transportItineraries && itinerary.transportItineraries.map((transportItinerary: TransportItinerary) => transportItinerary.itineraryUnits.map((item: TransportItineraryUnit, index: number) => ( */}\n {itinerary.transportItineraries && itinerary.transportItineraries.flatMap(i => i.itineraryUnits).filter(u => quote === undefined || quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete || !u.cancelled)\n .sort((a, b) => {\n const dateA = moment(a.startDate);\n const dateB = moment(b.startDate);\n\n if (dateA.isBefore(dateB)) return -1;\n if (dateA.isAfter(dateB)) return 1;\n\n // if (isStringEmpty(a.startTime) || isStringEmpty(b.startTime)) return 0;\n\n if (a.startTime !== undefined && b.startTime !== undefined) {\n if (a.startTime < b.startTime) return -1;\n if (a.startTime > b.startTime) return 1;\n }\n return 0;\n })\n .map((item: TransportItineraryUnit, index: number) => {\n item.itineraryIndex = index;\n return item;\n })\n .map((item: TransportItineraryUnit, index: number) => (\n {\n // unit.vendor.itineraryIndex = index;\n onEditTransport(unit);\n setShow(\"add-transportation\");\n }}\n bookNowRequested={bookNowRequested}\n quoteRequested={quoteRequested}\n datesAndGuests={datesAndGuests}\n quoteStatus={quote && quote.reservation.statusId ? quote.reservation.statusId : undefined}\n onVendorImageClick={(vendor: Vendor | undefined) => {\n setSelectedVendor(vendor);\n setShowModal(\"vendor-images\");\n }}\n editable={pbPackage === undefined ? quote === undefined : quote === undefined && pbPackage.allowCustomization}\n />\n ))}\n\n {/* Add Transportation Button */}\n {webViewAddButtonConditional && (\n {\n setShow(\"add-transportation\");\n }}\n />\n )}\n
\n \n )}\n \n )}\n\n {/* Custom Tab */}\n {(viewPortBreakPoint >= ViewPort.md || (itinerary.customItineraries && itinerary.customItineraries.some(i => i.itineraryUnits.length > 0))) && (\n <>\n {(!!quote || startWidget.showCustomItemsModule) && (!fromEmail || (itinerary.customItineraries && itinerary.customItineraries.length > 0)) && (\n <>\n
\n {(!!!quote || (itinerary.customItineraries && itinerary.customItineraries.some((ci: CustomItinerary) => ci.itineraryUnits.some((iu: ItineraryUnit) => ((quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete) && iu.showOnItinerary) || !iu.cancelled && iu.showOnItinerary)))) && (\n <>\n \n Extras\n \n \n \n )}\n\n {/* Extra items */}\n {/* {itinerary.customItineraries && itinerary.customItineraries.map((customItinerary: CustomItinerary) => customItinerary.itineraryUnits.map((item: CustomItineraryUnit, index: number) => ( */}\n {itinerary.customItineraries && itinerary.customItineraries.flatMap(i => i.itineraryUnits).filter(u => quote === undefined || quote.reservation.statusId === ReservationStatus.CancelPending || quote.reservation.statusId === ReservationStatus.CancelComplete || !u.cancelled)\n .sort((a, b) => {\n const dateA = moment(a.fromDate);\n const dateB = moment(b.fromDate);\n\n if (dateA.isBefore(dateB)) return -1;\n if (dateA.isAfter(dateB)) return 1;\n if (a.fromTime !== undefined && b.fromTime !== undefined) {\n if (a.fromTime < b.fromTime) return -1;\n if (a.fromTime > b.fromTime) return 1;\n }\n return 0;\n })\n .map((item: CustomItineraryUnit, index: number) => {\n item.itineraryIndex = index;\n return item;\n })\n .map((item: CustomItineraryUnit, index: number) => (\n {\n // unit.vendor.itineraryIndex = index;\n onEditCustom(unit);\n setShow(\"add-custom\");\n }}\n bookNowRequested={bookNowRequested}\n quoteRequested={quoteRequested}\n datesAndGuests={datesAndGuests}\n quoteStatus={quote && quote.reservation.statusId ? quote.reservation.statusId : undefined}\n onVendorImageClick={(vendor: Vendor | undefined) => {\n setSelectedVendor(vendor);\n setShowModal(\"vendor-images\");\n }}\n editable={pbPackage === undefined ? quote === undefined : quote === undefined && pbPackage.allowCustomization}\n />\n ))}\n\n {/* Add Extras Button */}\n {webViewAddButtonConditional && (\n {\n setShow(\"add-custom\");\n }}\n />\n )}\n
\n \n )}\n \n )}\n\n\n {/* Adjustments */}\n {((itinerary.adjustments && itinerary.adjustments.length > 0)) && (\n <>\n {true && (true || (true)) && (\n <>\n
\n {(!!quote || (itinerary.adjustments && itinerary.adjustments.some((ad: Adjustment) => ad.showOnItinerary))) && (\n <>\n \n Adjustments\n \n \n \n )}\n\n {itinerary.adjustments && itinerary.adjustments.map((adjustment: Adjustment) =>\n \n )}\n
\n \n )}\n \n )}\n\n {(!!!quote && viewPortBreakPoint >= ViewPort.md) && (\n <>\n { /* if allow promocode use */}\n {(pbPackage === undefined ? true : pbPackage.allowPromoCodeUse) && (\n \n \n \n {promo !== undefined && (\n \n \n \n )}\n\n {\n setPromoInput(e.target.value);\n }}\n />\n {promo === undefined && (\n \n )}\n \n {promo !== undefined && (\n \n Promo Code applied!\n \n )}\n {promoError && (\n \n {promoErrorMsg}\n \n )}\n \n \n )}\n\n \n \n
\n {startWidget.showBookNowButton && (\n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"book-now\");\n }}\n >\n Book Now\n \n )}\n\n {startWidget.showSaveQuoteButton && (\n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"get-quote\");\n }}\n >\n Save/Get Quote\n \n )}\n
\n
\n
\n \n )}\n
\n\n {/* Mobile Book Now & Get Quote Button */}\n {!!!quote && viewPortBreakPoint < ViewPort.md && (\n <>\n {pbPackage === undefined ? true : pbPackage.allowPromoCodeUse && (\n <>\n \n \n \n {promo !== undefined && (\n \n \n \n )}\n\n {\n setPromoInput(e.target.value);\n }}\n />\n {promo === undefined && (\n \n )}\n \n {promo !== undefined && (\n \n Promo Code applied!\n \n )}\n {promoError && (\n \n {promoErrorMsg}\n \n )}\n \n \n \n )}\n\n \n {startWidget.showBookNowButton && (\n \n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"book-now\");\n }}\n >\n Book Now\n \n \n )}\n\n {startWidget.showSaveQuoteButton && (\n \n {\n let allowLodging = true;\n if (brandSetting !== undefined) {\n let nights = 0;\n\n if (itinerary.lodgingItineraries !== undefined) {\n itinerary.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n if (!allowLodging) return;\n\n const start = moment(u.checkIn);\n const end = moment(u.checkOut);\n nights = end.diff(start, \"days\");\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber) {\n allowLodging = false;\n }\n }));\n }\n\n if (brandSetting.requireLodgingNights && nights < brandSetting.lodgingNightsRequiredNumber)\n allowLodging = false;\n }\n\n let missingRate = false;;\n let golfCount = 0;\n\n if (itinerary.golfItineraries !== undefined) {\n itinerary.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n ++golfCount;\n if (u.availableTeeTimes.length === 0) {\n missingRate = true;\n }\n }))\n }\n\n if (!allowLodging) {\n setShowModal(\"lodging-nights-required\");\n return;\n }\n\n if (missingRate) {\n setShowModal(\"missing-rate\");\n return;\n }\n\n if (brandSetting.requireGolfItems && golfCount < brandSetting.golfItemsRequiredNumber) {\n setShowModal(\"golf-items-required\");\n return;\n }\n\n setShowModal(\"get-quote\");\n }}\n >\n Save/Get Quote\n \n \n )}\n \n \n )}\n\n {/* Totals */}\n {quote && quote.reservation.statusId && (Number)(quote.reservation.statusId) !== 40 && (Number)(quote.reservation.statusId) !== 50 && (\n displayPaymentModalForCustomer(customer)}\n emailCustomer={emailCustomer}\n handleUseIndividualPayments={handleIndividualPayments}\n isQuoteExpired={isQuoteExpired}\n allowPromo={pbPackage === undefined ? true : pbPackage.allowPromoCodeUse}\n />\n )}\n\n {startWidget.showBookNowButton && quote && quote.reservation.statusId !== 40 && quote.reservation.statusId !== 50 && viewPortBreakPoint < ViewPort.md && (quote.reservation.paymentCategories === undefined || quote.reservation.paymentCategories.length === 0) && (\n \n \n {\n setShowModal(\"make-payment\");\n }}\n >\n Book Now\n \n \n \n )}\n \n )\n }\n\n {/* Get Quote Modal */}\n setShowModal(\"\")}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n
\n Get Quote\n {/* \n

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n

-

\n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n

{datesAndGuests.guests}{` Guest${datesAndGuests.guests > 1 ? \"s\" : \"\"}`}

\n
*/}\n
\n \n \n {/* Get Quote */}\n \n \n \n\n {/* Make Payment Modal */}\n {quote && quote.reservation.statusId !== 40 && quote.reservation.statusId !== 50 && (\n {\n setShowModal(\"\");\n setPayingCustomer(undefined);\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n Make A Payment\n \n \n \n {/* Make Payment */}\n {\n // console.log(\"payment made\", data);\n setShowModal(\"\");\n setPayingCustomer(undefined);\n //need to reload the quote\n toast.success(\"Payment Successful!\", { hideProgressBar: false });\n if (quote.campaignId !== undefined) {\n if (startWidget.activateGoogleAnalytics && !isStringEmpty(startWidget.googleAnalyticsTrackingCode)) {\n ReactGA.event({\n category: \"PKGLoop_Custom\",\n action: \"PKGLoop_PaymentSuccess\",\n label: startWidget.brandId.toString(),\n value: data.amount, // amount paid\n });\n // consume the localStorage flag\n window.localStorage.removeItem(\"isAdConversion\");\n }\n }\n\n setTimeout(function () {\n if (!window.location.href.includes(\"&itineraryNumber=\"))\n window.location.href += `&itineraryNumber=${quote.reservation.itineraryNumber}`;\n else window.location.reload();\n }, 2000);\n }}\n onError={(error: any) => {\n console.log(\"payment error\", error);\n toast.error(`Payment Error! - ${error.error}`, { hideProgressBar: false });\n\n setShowModal(\"\");\n setPayingCustomer(undefined);\n\n // setTimeout(function () {\n // if (!window.location.href.includes(\"&itineraryNumber=\"))\n // window.location.href += `&itineraryNumber=${quote.reservation.itineraryNumber}`;\n // else window.location.reload();\n // }, 2000);\n }}\n />\n \n \n )}\n\n {\n setShowModal(\"\");\n // setPayingCustomer(undefined);\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n Book Now\n \n \n \n {/* Make Payment */}\n {\n setShowModal(\"\");\n setPayingCustomer(undefined);\n //need to reload the quote\n if (quote !== undefined) {\n toast.success(\"Payment Successful!\", { hideProgressBar: false });\n if (quote.campaignId !== undefined) {\n if (startWidget.activateGoogleAnalytics && !isStringEmpty(startWidget.googleAnalyticsTrackingCode)) {\n ReactGA.event({\n category: \"PKGLoop_Custom\",\n action: \"PKGLoop_PaymentSuccess\",\n label: startWidget.brandId.toString(),\n value: data.amount, // amount paid\n });\n // consume the localStorage flag\n window.localStorage.removeItem(\"isAdConversion\");\n }\n }\n\n setTimeout(function () {\n if (!window.location.href.includes(\"&itineraryNumber=\"))\n window.location.href += `&itineraryNumber=${quote.reservation.itineraryNumber}`;\n else window.location.reload();\n }, 2000);\n\n if (quote.reservation.payments === undefined) {\n quote.reservation.payments = [];\n quote.reservation.statusId = 20;\n }\n\n quote.reservation.payments.push({\n paymentId: 0,\n reservationId: quote.reservation.reservationId as number,\n paymentDate: new Date().toString(),\n customerId: data.customerId,\n paymentAmount: data.amount,\n createdOn: \"\",\n ccExpiration: \"\",\n ccNumber: \"\",\n paymentType: 0,\n paymentTypeId: 0,\n status: \"Pending\",\n tipAmount: data.tipAmount\n });\n\n quote.reservation.balanceDue = (quote.reservation.balanceDue as number) - (data.amount - data.tipAmount);\n\n setQuote(JSON.parse(JSON.stringify(quote)));\n }\n }}\n onError={(error: any) => {\n console.log(\"payment error\", error);\n toast.error(`Payment Error! - ${error.error}`, { hideProgressBar: false });\n\n setShowModal(\"\");\n setPayingCustomer(undefined);\n }}\n />\n \n \n\n {\n setShowModal(\"\");\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n Lodging Required\n \n \n \n

Please select Lodging before requesting a quote.

\n
\n \n\n {\n setShowModal(\"\");\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n Unavailable Tee Time\n \n \n \n

One or more golf items is unavailable on the specific date chosen, please select a new date and time.

\n
\n \n\n {\n setShowModal(\"\");\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n Lodging Nights Required\n \n \n \n

{`Please select Lodging with a minimum of ${brandSetting.lodgingNightsRequiredNumber} nights before requesting a quote.`}

\n
\n \n\n {\n setShowModal(\"\");\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n Golf Rounds Required\n \n \n \n

{`Please select a minimum of ${brandSetting.golfItemsRequiredNumber} Golf rounds before requesting a quote.`}

\n
\n \n\n {\n setShowModal(\"\");\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n Unavailable Tee Time\n \n \n \n

One or more golf items is unavailable on the specific date chosen, please select a new date and time.

\n
\n \n\n {\n setShowModal(\"\");\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n {/* \n \n Lodging Required\n \n */}\n \n \n {/* Vendor Units has images now */}\n {selectedVendor !== undefined && selectedVendor.vendorUnits && selectedVendor.vendorUnits.some(u => u.vendorUnitImages.length > 0) &&\n selectedVendor.vendorUnits.map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {selectedVendor !== undefined && selectedVendor.vendorUnits && !selectedVendor.vendorUnits.some(u => u.vendorUnitImages.length > 0) && (\n \n )}\n
\n
\n \n
\n );\n}\n\nexport default ItineraryStart;","import { useState, useEffect } from \"react\";\nimport useFetch, {\n FetchRequest,\n} from \"../../../../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../../../../_helpers/Constants\";\n\nconst UseGetCustomVendors = (request?: GetCustomVendorsRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n \n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/get/custom-vendors/${request.brandId}?startDate=${request.startDate}&endDate=${request.endDate}${(request.vendorId === undefined ? \"\" : `&vendorId=${request.vendorId}`)}${(request.vendorGuid === undefined ? \"\" : `&vendorGuid=${request.vendorGuid}`)}`;\n\n setFetchRequest({\n url: url,\n method: \"GET\",\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n // const response: GetCustomVendorsResponse = fetchResponse.data;\n setData(fetchResponse.data);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error);\n console.log(\"custom vendor fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return { data, error, isLoading };\n};\n\nexport default UseGetCustomVendors;\n\nexport interface GetCustomVendorsResponse extends FetchResponse {\n vendors: any;\n}\n\nexport interface GetCustomVendorsRequest {\n brandId: number;\n startDate: string;\n endDate: string;\n vendorId?: number;\n vendorGuid?: string;\n}\n","import \"./VendorCard.css\";\n\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Image, Button, Modal } from \"react-bootstrap\";\nimport { DatesAndGuests } from \"../../widget-form/WidgetForm\";\nimport { WidgetContext } from \"../../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../../_helpers/Enums/ViewPortEnum\";\nimport LodgingItem from \"../../../../../Data/LodgingItem\";\nimport moment from \"moment\";\n\ninterface props {\n lodging?: any;\n golf?: any;\n transport?: any;\n custom?: any;\n vendor: any;\n priceSubText?: string;\n onSelectedVendor: (vendor: any) => void;\n datesAndGuests: DatesAndGuests;\n vendorCardText?: string | undefined;\n sortedBy: number;\n simpleView: boolean;\n}\n\nconst VendorCard: React.FC = (props) => {\n const { viewPortBreakPoint, style, /* brandId */brand, brandSettings } = useContext(WidgetContext);\n const brandSetting = brandSettings.find((s: any) => s.brandId === brand?.brandId);\n\n const { vendor, onSelectedVendor, priceSubText, datesAndGuests, lodging, golf, transport, custom } = props;\n\n const [errorsImg, setErrorsImg] = useState();\n const [fromPrice, setFromPrice] = useState(Number.MAX_VALUE);\n const [unavailableMessages, setUnavailableMessages] = useState(!!lodging ? getUnavailableMessages() : []);\n\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const vendorImageUrl = errorsImg ? errorsImg : (vendor.description ?\n (vendor.description.vendorDescriptionImages.length > 0 ?\n ((vendor.description.vendorDescriptionImages[0].vendorImageUrl != undefined && vendor.description.vendorDescriptionImages[0].vendorImageUrl.length > 0) ? vendor.description.vendorDescriptionImages[0].vendorImageUrl\n : placeholderImgUrl)\n : placeholderImgUrl)\n : placeholderImgUrl);\n\n function getUnavailableMessages() {\n const nights: Date[] = [];\n let night = moment(datesAndGuests.fromDate, 'YYYY-MM-DD');\n const checkOutDate = moment(datesAndGuests.toDate, 'YYYY-MM-DD');\n while (night.isBefore(checkOutDate)) {\n nights.push(night.toDate());\n night = night.clone().add(1, 'day');\n }\n\n const dayRates = (vendor.rates || []);\n const unavailableDates = nights.filter(night => {\n const dayRate = dayRates.find((rate: any) => moment(moment(rate.date)).isSame(night))\n return !dayRate || dayRate.unavailable\n });\n\n const dict = {};\n for (var i = 0; i < unavailableDates.length; i++) {\n const date = dayRates.find((rate: any) => moment(moment(rate.date)).isSame(unavailableDates[i]));\n\n if (date && date.unavailable) {\n dict[date.unavailableMessage || \"Unavailable\"] = (dict[date.unavailableMessage || \"Unavailable\"] || \"\") + moment(date.date).format('MM/DD/YYYY') + \" \";\n }\n else {\n dict[\"Unavailable\"] = (dict[\"Unavailable\"] || \"\") + moment(unavailableDates[i]).format('MM/DD/YYYY') + \" \";\n }\n }\n\n const messages = [];\n\n for (const key in dict) {\n const value = dict[key];\n\n messages.push(key + \": \" + value);\n }\n\n return messages;\n }\n\n useEffect(() => {\n if (vendor) {\n setFromPrice(vendor.fromPrice);\n }\n }, [vendor]);\n\n return (\n \n {/* Desktop */}\n {viewPortBreakPoint >= ViewPort.lg && !props.simpleView && (\n \n \n\n \n \n
\n {props.vendorCardText !== undefined && (\n \n {/* {vendor.features ? (typeof vendor.features.vendorCardText == undefined ? vendor.features.vendorCardText : \"Card Text\") : \"Card Text\"} */}\n {props.vendorCardText}\n

\n )}\n setErrorsImg(placeholderImgUrl)}\n fluid\n />\n
\n \n\n \n

\n {vendor.vendorName}\n

\n\n {/* Feature text */}\n {vendor.description && (\n
\n
\n

  {vendor.description.bulletPoint1}

\n

  {vendor.description.bulletPoint2}

\n

  {vendor.description.bulletPoint3}

\n
\n
\n )}\n\n {/* from price */}\n
\n {fromPrice < Number.MAX_VALUE && (\n <>\n {vendor.rateDisplayOptions.showPkgPriceOnly && (\n \n Package Price\n \n )}\n {!vendor.rateDisplayOptions.showPkgPriceOnly && (\n

\n From:{\" \"}\n \n ${fromPrice.toFixed(0)}\n \n

\n )}\n \n )}\n {/* {fromPrice == Number.MAX_VALUE && (\n //

No Rates Available

\n
\n {unavailableMessages.length > 0 ? unavailableMessages.map(message => {\n return \n {message}\n

\n }) : (\n \n unavailable\n

\n )}\n
\n )} */}\n
\n\n {/* {fromPrice < Number.MAX_VALUE && ( */}\n {true && (\n onSelectedVendor(vendor)}\n >\n Select A Unit Type\n \n )}\n \n
\n\n \n
\n )}\n\n {/* Desktop Simple View */}\n {viewPortBreakPoint >= ViewPort.lg && props.simpleView && (\n \n \n\n \n \n
\n {props.vendorCardText !== undefined && (\n \n {/* {vendor.features ? (typeof vendor.features.vendorCardText == undefined ? vendor.features.vendorCardText : \"Card Text\") : \"Card Text\"} */}\n {props.vendorCardText}\n

\n )}\n setErrorsImg(placeholderImgUrl)}\n fluid\n />\n
\n \n\n \n

\n {vendor.vendorName}\n

\n\n {/* from price */}\n
\n {fromPrice < Number.MAX_VALUE && (\n <>\n {vendor.rateDisplayOptions.showPkgPriceOnly && (\n \n Package Price\n \n )}\n {!vendor.rateDisplayOptions.showPkgPriceOnly && (\n

\n From:{\" \"}\n \n ${fromPrice.toFixed(0)}\n \n

\n )}\n \n )}\n {/* {fromPrice == Number.MAX_VALUE && (\n //

No Rates Available

\n
\n {unavailableMessages.length > 0 ? unavailableMessages.map(message => {\n return \n {message}\n

\n }) : (\n \n unavailable\n

\n )}\n
\n )} */}\n
\n\n {/* {fromPrice < Number.MAX_VALUE && ( */}\n {true && (\n onSelectedVendor(vendor)}\n >\n Select A Unit Type\n \n )}\n \n
\n\n \n
\n )}\n\n {/* Mobile */}\n {viewPortBreakPoint < ViewPort.lg && !props.simpleView && (\n \n \n
\n
\n {vendor.vendorName}\n
\n {/*

Awesome place to be!

*/}\n
\n\n {vendor.description && (\n
\n
\n

  {vendor.description.bulletPoint1}

\n

  {vendor.description.bulletPoint2}

\n

  {vendor.description.bulletPoint3}

\n
\n
\n )}\n\n {/* from price */}\n
\n {fromPrice < Number.MAX_VALUE && (\n <>\n {vendor.rateDisplayOptions.showPkgPriceOnly && (\n \n Package Price\n \n )}\n {!vendor.rateDisplayOptions.showPkgPriceOnly && (\n

\n From:{\" \"}\n \n ${fromPrice.toFixed(0)}\n \n

\n )}\n \n )}\n {/* {fromPrice == Number.MAX_VALUE && (\n //

No Rates Available

\n
\n {unavailableMessages.length > 0 ? unavailableMessages.map(message => {\n return \n {message}\n

\n }) : (\n \n unavailable\n

\n )}\n
\n )} */}\n
\n\n {/* {fromPrice < Number.MAX_VALUE && ( */}\n {true && (\n
\n onSelectedVendor(vendor)}\n >\n Select\n \n
\n )}\n \n
\n )}\n\n {/* Mobile Simple View */}\n {viewPortBreakPoint < ViewPort.lg && props.simpleView && (\n \n \n
\n
\n {vendor.vendorName}\n
\n {/*

Awesome place to be!

*/}\n
\n\n {/* from price */}\n
\n {fromPrice < Number.MAX_VALUE && (\n <>\n {vendor.rateDisplayOptions.showPkgPriceOnly && (\n \n Package Price\n \n )}\n {!vendor.rateDisplayOptions.showPkgPriceOnly && (\n

\n From:{\" \"}\n \n ${fromPrice.toFixed(0)}\n \n

\n )}\n \n )}\n {/* {fromPrice == Number.MAX_VALUE && (\n //

No Rates Available

\n
\n {unavailableMessages.length > 0 ? unavailableMessages.map(message => {\n return \n {message}\n

\n }) : (\n \n unavailable\n

\n )}\n
\n )} */}\n
\n\n {/* {fromPrice < Number.MAX_VALUE && ( */}\n {true && (\n
\n onSelectedVendor(vendor)}\n >\n Select\n \n
\n )}\n \n
\n )}\n
\n );\n}\n\nexport default VendorCard;","import \"../../lodging/lodging-details/lodging-details.css\";\nimport \"../../VendorDetails.css\";\n\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Form, Row, Col, Tab, Nav, Carousel, Button, Modal } from \"react-bootstrap\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { Modifier } from \"react-day-picker\";\nimport Amenity from \"../../../../../../../Data/Amenity\";\nimport CustomItem from \"../../../../../../../Data/CustomItem\";\nimport VendorUnit from \"../../../../../../../Data/VendorUnit\";\nimport VendorUnitImage from \"../../../../../../../Data/VendorUnitImage\";\nimport WidgetStyle from \"../../../../../../../Data/WidgetStyle\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport StartWidget from \"../../../../../../../Data/StartWidget\";\nimport RatesByDate from \"../../../../../../../Data/Rates/DateRate\";\nimport UnitRate from \"../../../../../../../Data/Rates/UnitRate\";\nimport ProductRate from \"../../../../../../../Data/Rates/ProductRate\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport { MobileDayPickerOverlay } from \"../../../../assets/MobileDayPickerOverlay\";\nimport moment from \"moment\";\nimport { getAvailableVendorUnits, getDailyRate, getHourlyRate, getRateTypeFromUnitName, getUnitRate, getVendorUnitIdFromUnitName, populateTimes, getVendorUnitIdsFromSelectedName } from \"../../../../../../../Data/Rates/UnitRateLogic\";\nimport EnumProductRateType from \"../../../../../../../Data/Rates/EnumProductRateType\";\nimport Decimal from \"decimal.js\";\nimport { roundDecimal } from \"../../../../../../../_helpers/Functions\";\nimport CustomDayPickerInput from \"../../../../../customDayPickerInput/CustomDayPickerInput\";\n// import SameDayReplay from \"../../../../../../../Data/SameDayReplay\";\n\ninterface props {\n vendor: CustomItem;\n datesAndGuests: DatesAndGuests;\n onSelectedVendorUnit?: (item: CustomItem, index?: number) => void;\n}\n\ninterface GeoProps {\n lat: number;\n lng: number;\n}\n\nconst CustomDetails: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint, autoScroll } = useContext(WidgetContext);\n\n const { vendor, datesAndGuests, onSelectedVendorUnit } = props;\n const isEditing = vendor.itineraryIndex !== undefined && vendor.itineraryIndex > -1;\n\n const [vendorUnits, setVendorUnits] = useState([]);\n\n // const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const [guests, setGuests] = useState(vendor.guests !== undefined ? vendor.guests : datesAndGuests.guests);\n const [units, setUnits] = useState(vendor.numUnits !== undefined ? vendor.numUnits : datesAndGuests.units);\n const [startDate, setStartDate] = useState(vendor.checkIn !== undefined ? vendor.checkIn : moment(datesAndGuests.fromDate).toDate());\n const [endDate, setEndDate] = useState(vendor.checkIn !== undefined ? vendor.checkIn : moment(datesAndGuests.toDate).toDate());\n const [startTime, setStartTime] = useState(undefined);\n const [endTime, setEndTime] = useState(undefined);\n const [startTimes, setStartTimes] = useState([]);\n const [endTimes, setEndTimes] = useState([]);\n const modifiers = { start: startDate, end: endDate };\n\n const { formatDate, parseDate } = reactMoment;\n\n const [latlang, setLatLang] = useState();\n const [geoLocation, setGeoLocation] = useState(\"\");\n\n // const [currentProductRate, setCurrentProductRate] = useState();\n const maxGuests = datesAndGuests.guests;\n\n const [hourlyRates, setHourlyRates] = useState([]);\n const [isHourlyRate, setIsHourlyRate] = useState(false);\n const [unitRates, setUnitRates] = useState([]);\n const [isUnitRate, setIsUnitRate] = useState(false);\n const [dayRates, setDayRates] = useState([]);\n const [isDailyRate, setIsDailyRate] = useState(false);\n const [isTimeRate, setIsTimeRate] = useState(false);\n const [timeRates, setTimeRates] = useState([]);\n const [unavailableMessage, setUnavailableMessage] = useState();\n\n const [selectedProductRateType, setSelectedProductRateType] = useState(null); //vendorUnit.productRateTypeId\n const [selectedUnit, setSelectedUnit] = useState(null); //vendorUnitId\n const [selectedUnitName, setSelectedUnitName] = useState(null);\n const [selectedProductRate, setSelectedProductRate] = useState(null);\n // const [vendorUnitIds, setVendorUnitIds] = useState([]);\n\n const [rangePickerMode, setRangePickerMode] = useState(true);\n\n const rates = vendor ? vendor.dailyRates : [];\n\n const [unitRateTotal, setUnitRateTotal] = useState(0);\n const [unitRateAverage, setUnitRateAverage] = useState(0);\n\n const [imgErrors, setImgErrors] = useState([]);\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n\n const [index, setIndex] = useState(0);\n\n const handleSelect = (selectedIndex: any, e: any) => {\n setIndex(selectedIndex);\n };\n\n const onGuestsInputChanged = (event: any) => {\n setGuests(+event.target.value);\n }\n\n const onUnitsInputChanged = (event: any) => {\n setUnits(+event.target.value);\n }\n\n const onStartDateChanged = (date: Date) => {\n setStartDate(date);\n if (date > endDate) {\n setEndDate(date);\n }\n }\n\n const startTimeOptions = startTimes.map((time: any, index: number) => (\n \n ));\n\n const endTimeOptions = endTimes.map((time: any, index: number) => (\n \n ));\n\n const onEndDateChanged = (date: Date) => {\n setEndDate(date);\n }\n\n function getNumGuestsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < maxGuests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getNumUnitsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < guests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function addClick(unit: VendorUnit) {\n unit.vendorId = vendor.vendorId;\n\n unit.sell = unitRateTotal;\n\n vendor.selectedUnit = unit;\n vendor.checkIn = moment(startDate).toDate();\n vendor.checkOut = isDailyRate ? moment(endDate).toDate() : moment(startDate).toDate();\n vendor.fromTime = startTime ?? \"\";\n vendor.toTime = endTime ?? \"\";\n vendor.guests = guests;\n vendor.numUnits = units;\n\n if (onSelectedVendorUnit)\n onSelectedVendorUnit(vendor, vendor.itineraryIndex);\n }\n\n const unitOptions = vendorUnits.filter(u => u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n useEffect(() => {\n // map\n fetch(\n `https://maps.googleapis.com/maps/api/geocode/json?address=${vendor.streetAddress},+${vendor.city},+${vendor.state}&key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU`\n ).then((response) => {\n return response.json();\n }).then((response) => {\n setLatLang({ lat: response.results[0].geometry.location.lat, lng: response.results[0].geometry.location.lng });\n });\n }, []);\n\n useEffect(() => {\n if (latlang) {\n\n let geolocationString = `https://www.google.com/maps/embed/v1/view?key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU\n ¢er=${latlang.lat},${latlang.lng}\n &zoom=15\n &maptype=roadmap`;\n\n setGeoLocation(geolocationString);\n }\n }, [latlang]);\n\n useEffect(() => {\n if (vendor === undefined) return;\n\n const _vendorUnits = getAvailableVendorUnits(props.vendor.vendorUnits, rates, moment(startDate).format(\"MM/DD/YYYY\"));\n _vendorUnits.sort((a, b) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n\n if (a.unitName.toLowerCase() < b.unitName.toLowerCase()) return -1;\n if (a.unitName.toLowerCase() > b.unitName.toLowerCase()) return 1;\n\n return 0;\n });\n setVendorUnits(_vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection == selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n }\n }\n\n setUnavailableMessage('');\n\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, startDate.toString(), endDate.toString()));\n }, [vendor, startDate]);\n\n useEffect(() => {\n // console.log(\"selectedProductRateType\", selectedProductRateType);\n setIsDailyRate(false);\n setIsHourlyRate(false);\n setIsUnitRate(false);\n setIsTimeRate(false);\n\n if (selectedProductRateType == EnumProductRateType.DayRange) {\n setIsDailyRate(true);\n //multiple days\n setRangePickerMode(true);\n // setEndDate(props.maxDate);\n\n setStartTime(\"09:00\");\n setEndTime(\"09:00\");\n }\n else if (selectedProductRateType == EnumProductRateType.HoursPerUnit) {\n setIsHourlyRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n setStartTime(\"09:00\");\n setEndTime(\"10:00\");\n\n }\n else if (selectedProductRateType == EnumProductRateType.UnitQtyRange) {\n setIsUnitRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n setStartTime(\"09:00\");\n\n }\n else if (selectedProductRateType == EnumProductRateType.UseTime) {\n setIsTimeRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n const unitTimeRates = vendor.dailyRates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates).filter(r => r.rateType == EnumProductRateType.UseTime);\n setTimeRates(unitTimeRates);\n }\n else if (selectedProductRateType == EnumProductRateType.UseUnit) {\n setIsUnitRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n }\n }, [selectedProductRateType]);\n\n useEffect(() => {\n // console.log(\"selectedUnitName\", selectedUnitName);\n if (!selectedUnitName) {\n return;\n }\n\n const rateType = getRateTypeFromUnitName(vendor.dailyRates, selectedUnitName, startDate.toDateString());\n\n if (rateType == EnumProductRateType.UseTime) {\n const unitTimeRates = rates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates).filter(r => r.rateType == EnumProductRateType.UseTime);\n setTimeRates(unitTimeRates);\n }\n\n setSelectedProductRateType(rateType);\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, startDate.toString(), endDate.toString()));\n }, [selectedUnitName]);\n\n useEffect(() => {\n if (!timeRates.length) {\n return;\n }\n // Set the start times.\n let newStartTimes: any[] = [];\n timeRates.forEach(r => {\n let start = moment(r.startTime, 'HH:mm');\n let end = moment(r.endTime, 'HH:mm');\n\n //start.minutes(Math.ceil(start.minutes() / 10) * 10); //this will round up minutes to 10: 8:10, 8:20\n let result: any[] = [];\n let current = moment(start);\n while (current <= end) {\n result.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a'),\n });\n current.add(10, 'minutes');\n }\n newStartTimes = newStartTimes.concat(result);\n });\n if (!!newStartTimes.length) {\n newStartTimes = [...new Map(newStartTimes.map(item => [item.value, item])).values()] // Remove any cross-over duplicates.\n newStartTimes.sort((a, b) => {\n // Sort by time.\n return moment(a.value, 'HH:mm').isBefore(moment(b.value, 'HH:mm')) ? -1 : 0;\n });\n setStartTime(newStartTimes[0].value);\n }\n setStartTimes(newStartTimes);\n }, [timeRates, selectedProductRateType]);\n\n useEffect(() => {\n if (!(isTimeRate && startTime)) {\n return;\n }\n\n // Find rate matching the time.\n const dateRates = rates.filter(a => moment(a.date).format('YYYY-MM-DD').toString() === moment(startDate).format('YYYY-MM-DD'));\n const timeRates = dateRates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName).flatMap(a => a.rates);\n const timeRate = timeRates.find(r => moment(r.startTime, 'HH:mm').isSame(moment(startTime, 'HH:mm')));\n\n if (!timeRate) {\n setUnavailableMessage(`No rates available for the selected time.`)\n setUnitRateTotal(0);\n return;\n }\n\n setUnavailableMessage('');\n setSelectedUnit(timeRate.vendorUnitId);\n const rate = new Decimal(timeRate.price);\n setUnitRateTotal(roundDecimal(rate.times(units)).toNumber());\n setUnitRateAverage(roundDecimal(rate).toNumber())\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, startDate.toString(), endDate.toString()));\n }, [isTimeRate, timeRates, startTime, units, startDate, selectedUnitName]);\n\n useEffect(() => {\n if (!isDailyRate) {\n return;\n }\n\n const { productRates, noRateMessage } = getDailyRate(vendor.dailyRates, selectedUnitName, startDate.toDateString(), endDate.toDateString(), startTime, endTime);\n\n if (!!noRateMessage) {\n setUnavailableMessage(noRateMessage);\n return;\n }\n\n const rate = productRates.reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0));\n setUnitRateTotal(roundDecimal(rate.times(units)).toNumber());\n setUnitRateAverage(roundDecimal(rate.dividedBy(productRates.length === 0 ? 1 : productRates.length)).toNumber());\n setUnavailableMessage(undefined);\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, startDate.toString(), endDate.toString()));\n }, [isDailyRate, dayRates, units, startTime, endTime, startDate, endDate, selectedUnitName]);\n\n useEffect(() => {\n if (!(isHourlyRate && startTime && endTime)) {\n return;\n }\n\n var numberOfHours: number = moment.duration(moment(endTime, 'HH:mm').diff(moment(startTime, 'HH:mm'))).asHours();\n\n if (numberOfHours < 0) {\n //only 0-24 hours\n numberOfHours = moment.duration(moment(endTime, 'HH:mm').add(1, \"day\").diff(moment(startTime, 'HH:mm'))).asHours();\n }\n\n let hourlyRate = getHourlyRate(vendor.dailyRates, selectedUnitName, startTime, endTime);\n setSelectedProductRate(hourlyRate === undefined ? null : hourlyRate);\n\n if (!hourlyRate) {\n setUnavailableMessage(`No rates available for ${numberOfHours} hours.`);\n setUnitRateTotal(0);\n return;\n }\n\n const rate = (new Decimal(hourlyRate.price).times(numberOfHours));\n // setCurrentProductRate(hourlyRate);\n setUnitRateTotal(roundDecimal(rate.times(units)).toNumber());\n setUnitRateAverage(roundDecimal(rate.dividedBy(numberOfHours === 0 ? 1 : numberOfHours)).toNumber());\n setUnavailableMessage(undefined);\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, startDate.toString(), endDate.toString()));\n }, [isHourlyRate, hourlyRates, startTime, endTime, units, selectedUnit, startDate, selectedUnitName]);\n\n useEffect(() => {\n // console.log(isUnitRate);\n if (!isUnitRate) {\n return;\n }\n\n setUnavailableMessage('');\n\n //const productRates = unitRates.map(rd => rd.rates[0].rates[0]);\n const dateRates = rates.filter(a => moment(a.date).format('YYYY-MM-DD').toString() === moment(startDate).format('YYYY-MM-DD').toString());\n const unitId = getVendorUnitIdFromUnitName(dateRates, selectedUnitName);\n\n const unitRates = dateRates.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName && a.vendorUnitId === unitId);\n const productRates = unitRates.flatMap(rd => rd.rates);\n\n // console.log(\"productRates\", productRates);\n if (productRates.length > 0) {\n setSelectedUnit(productRates[0].vendorUnitId);\n setSelectedProductRate(productRates[0]);\n const rate = productRates.reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0));\n\n setUnitRateTotal(roundDecimal(rate.times(units)).toNumber());\n setUnitRateAverage(roundDecimal(rate).toNumber());\n }\n else {\n setUnavailableMessage(`No rates available for the selected Date.`)\n setUnitRateTotal(0);\n return;\n }\n\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, startDate.toString(), endDate.toString()));\n }, [isUnitRate, unitRates, units, startDate, selectedUnitName]);\n\n // useEffect(() => {\n // setIndex(0);\n // }, [vendorUnitIds]);\n useEffect(() => {\n setIndex(0);\n }, [selectedUnit]);\n\n useEffect(() => {\n //if (autoScroll) {\n //window.parent.postMessage(\"scroll\", \"*\");\n //if (document.documentElement.scrollTop > 0)\n //window.scrollTo({ top: 0, left: 0, behavior: \"smooth\" });\n //}\n }, []);\n\n const inputStyle = `\n .inline-style .DayPickerInput>input {\n padding-left: 15px;\n}`;\n\n const navLinkStyles = `\n .nav-pills .nav-link.active {\n background-color: rgb(247, 247, 247);\n color: ${style.buttonColor} !important;\n}`;\n\n return (\n \n \n \n\n {/* Desktop */}\n
\n {/* Dates */}\n \n \n \n \n \n \n Start Date\n \n \n \n {rangePickerMode && (\n \n \n End Date\n \n \n \n )}\n \n\n \n {vendorUnits.length > 0 && (\n \n \n Unit Type\n \n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n \n )}\n\n \n\n \n {/*
\n \n Guests\n \n \n {getNumGuestsOptions()}\n \n
*/}\n
\n \n Units\n \n \n {getNumUnitsOptions()}\n \n
\n {isTimeRate && (\n
\n \n Start Time\n \n {\n setStartTime(event.currentTarget.value);\n setEndTime(startTime);\n }}>\n {startTimeOptions}\n \n
\n )}\n {(isHourlyRate || isDailyRate) && (\n
\n \n End Time\n \n {\n setEndTime(event.currentTarget.value)\n }}\n >\n {endTimeOptions}\n \n
\n )}\n
\n \n\n \n {!!!unavailableMessage && (<>\n {!vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showCustomItemsPricing ? (\n
\n

${unitRateAverage.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n
\n {\n // const _unitId = getVendorUnitIdFromUnitName(vendor.rates, selectedUnitName);\n // if (_unitId)\n // addClick(vendor.vendorUnits.find(unit => unit.vendorUnitId == _unitId) as VendorUnit);\n const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId == selectedUnit) as VendorUnit;\n addClick(vu);\n }}\n >\n Add\n \n
\n )}\n \n
\n\n {vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n \n {unavailableMessage !== undefined && (\n \n

{unavailableMessage}

\n
\n )}\n
\n\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {/* Vendor Units has images now */}\n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n
\n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n \n \n
\n\n {/* Mobile */}\n
\n \n \n {/* Room Type Select */}\n \n {/* \n Type:\n */}\n\n {vendorUnits.length > 0 && (\n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n )}\n
\n\n {/* Arrive DatePicker */}\n
\n \n {/* \n Start Date:\n */}\n \n \n
\n\n {rangePickerMode && (\n <>\n {/* Depart DatePicker */}\n < div className=\"mobile InputFromTo\" style={{ marginRight: \"0px\" }}>\n \n {/* \n Depart:     \n */}\n\n \n \n
\n \n )}\n\n
\n {isTimeRate && (\n
\n \n From:\n \n {\n setStartTime(event.currentTarget.value);\n // setEndTime(null);\n }}\n >\n {startTimeOptions}\n \n
\n )}\n\n {(isHourlyRate || isDailyRate) && (\n
\n \n To:\n \n {\n setEndTime(event.currentTarget.value);\n }}\n >\n {endTimeOptions}\n \n
\n )}\n
\n\n {/* Guests / units add button */}\n
\n {/* Guests */}\n {/*
\n \n Guests:\n \n \n {getNumGuestsOptions()}\n \n
*/}\n\n
\n \n Units:\n \n \n {getNumUnitsOptions()}\n \n
\n
\n\n {vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n\n {/* Package Price */}\n {!!!unavailableMessage && (\n
\n {!vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showCustomItemsPricing ? (\n
\n

${unitRateAverage.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n\n {\n const _unitId = getVendorUnitIdFromUnitName(vendor.dailyRates, selectedUnitName);\n if (_unitId)\n addClick(vendor.vendorUnits.find(unit => unit.vendorUnitId == _unitId) as VendorUnit);\n // const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId == selectedUnit) as VendorUnit;\n // addClick(vu);\n }}\n >\n + {isEditing ? \"Save\" : \"Add\"}\n \n
)}\n\n {unavailableMessage && (\n \n

{unavailableMessage}

\n
\n )}\n\n {/* Navigation / Carousel / Tab Content */}\n
\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {/* Vendor Units has images now */}\n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n \n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n
\n \n
\n \n \n
\n
\n );\n}\n\nexport default CustomDetails;","import React, { useState } from 'react';\nimport './SwitchToggle.css';\n\ninterface SwitchToggleProps {\n id: string,\n checked: boolean,\n onChange: any,\n}\n\nconst SwitchToggle = (props: SwitchToggleProps) => {\n const [isChecked, setIsChecked] = useState(props.checked || false);\n\n const handleChange = () => {\n const newValue = !isChecked;\n setIsChecked(newValue);\n if (props.onChange) {\n props.onChange(newValue);\n }\n };\n\n return (\n
\n \n \n
\n)}\n\nexport default SwitchToggle;","import \"./AddModalSortBy.css\";\n\nimport React, { useContext, useState } from \"react\";\nimport { Col, Form, Modal, Row } from \"react-bootstrap\";\nimport { WidgetContext } from \"../../../../../context/WidgetContext\";\nimport SwitchToggle from \"../../../switchToggle/SwitchToggle\";\nimport { DatesAndGuests } from \"../../widget-form/WidgetForm\";\nimport useWindowSize from \"../../../../../_helpers/UseWindowHook\";\nimport ViewPort from \"../../../../../_helpers/Enums/ViewPortEnum\";\n\ninterface AddModalSortProps {\n /* name of the modal to display */\n modalTitle: String,\n /* dates to book and # of guests */\n datesAndGuests: DatesAndGuests,\n /* boolean toggle for thin vs expanded view on VendorCards */\n simpleView: boolean,\n /* stateful method to set simpleView */\n setSimpleView: any,\n /* optional method to filter by Lodging type */\n filterLodging?: any,\n /* method to filter by Pricing */\n filterPricing: any,\n /* cities to sort by */\n cityOptions: string[],\n /* method to filter by City */\n filterCities: any,\n /* whether to show lodging type filter */\n showLodging?: boolean,\n}\n\n/* Sort By Component for all Add [Type] Modals */\nconst AddModalSortBy = (props: AddModalSortProps) => {\n const { style } = useContext(WidgetContext);\n const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const { breakPoint } = useWindowSize();\n\n /* static lodging options */\n const lodgingOptions = [\n { title: 'Sort by - All', value: 0 },\n { title: 'Hotel', value: 1 },\n { title: 'Casino Hotel', value: 2 },\n { title: 'Condos', value: 4 },\n { title: 'Private Homes', value: 8 },\n ]\n\n /* static pricing options */\n const pricingOptions = [\n 'Sort by - Price',\n 'Price Low - High',\n 'Price High - Low',\n ]\n\n // useEffect(() => {\n // console.log(\"props.showLodging\", props.showLodging);\n // }, [props.showLodging]);\n\n return (\n
\n {props.modalTitle}\n \n

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n

-

\n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n {/* Desktop Switch Toggle */}\n {breakPoint >= ViewPort.md && (\n
\n

Simple View

\n \n
\n )}\n
\n \n {props.showLodging &&\n \n \n {/* */}\n {lodgingOptions.map((lodgingType, index) => (\n \n ))}\n \n \n }\n \n \n {pricingOptions.map((pricingType: string, index) => (\n \n ))}\n \n \n {!props.showLodging && (\n \n \n \n {props.cityOptions.map((city: string, index) => (\n \n ))}\n \n \n )}\n \n {props.showLodging && (\n \n \n \n {props.cityOptions.map((city: string, index) => (\n \n ))}\n \n \n )}\n {/* Mobile Switch Toggle */}\n {breakPoint < ViewPort.md && (\n
\n

Simple View

\n \n
\n )}\n
\n )\n}\n\nexport default AddModalSortBy;","import \"../../WidgetModal.css\";\nimport \"../../lodging/add-lodging/add-lodging.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { useState, useEffect, SetStateAction, useContext } from \"react\";\nimport { Col, Row, Modal, Spinner } from \"react-bootstrap\";\nimport reactMoment from \"react-day-picker/moment\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport CustomItem from \"../../../../../../../Data/CustomItem\";\nimport UseGetCustomVendors, { GetCustomVendorsRequest, GetCustomVendorsResponse } from \"./data-service-hooks/UseGetCustomVendors\";\nimport VendorCard from \"../../VendorCard\";\nimport CustomDetails from \"../custom-details/CustomDetails\";\nimport { Modifier } from \"react-day-picker\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport CustomItineraryUnit from \"../../../../../../../Data/Reservation/Custom/CustomItineraryUnit\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport moment from \"moment\";\nimport ViewPort from \"../../../../../../../_helpers/Enums/ViewPortEnum\";\nimport AddModalSortBy from \"../../AddModalSortBy\";\n\ninterface props {\n show: boolean,\n onHide: () => void;\n brandId: number,\n datesAndGuests: DatesAndGuests;\n onSelectedCustom?: (item: CustomItem, index?: number) => void;\n unitToEditState?: [CustomItineraryUnit | undefined, React.Dispatch>];\n vendorGuid: string | undefined;\n vendorGuidType: string | undefined;\n}\n\nconst AddCustomModal: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n const [simpleView, setSimpleView] = useState(viewPortBreakPoint >= ViewPort.md ? false : true);\n\n const { show, onHide, brandId, onSelectedCustom } = props;\n const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const unitToEdit = props.unitToEditState ? props.unitToEditState[0] : undefined;\n const setUnitToEdit = props.unitToEditState ? props.unitToEditState[1] : undefined;\n const [customVendors, setCustomVendors] = useState();\n const [selectedVendor, setSelectedVendor] = useState(unitToEdit ? undefined : undefined);\n const { formatDate, parseDate } = reactMoment;\n const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n\n const [priceFilter, setPriceFilter] = useState(0);\n const [cityFilter, setCityFilter] = useState(\"\");\n\n const [getCustomVendorsRequest, setGetCustomVendorsRequest] = useState();\n const responseGetCustomVendors = UseGetCustomVendors(getCustomVendorsRequest);\n\n const [cityOptions, setCityOptions] = useState([]);\n\n const onSelectedVendor = (vendor: CustomItem) => {\n setSelectedVendor(vendor);\n }\n\n const onSelectedVendorUnit = (item: CustomItem, index?: number) => {\n if (onSelectedCustom) {\n onSelectedCustom(item, index);\n }\n\n setSelectedVendor(undefined);\n }\n\n const sortByPrice = (e: any) => {\n setPriceFilter(+e.target.value);\n }\n\n const sortByCity = (e: any) => {\n setCityFilter(e.target.value);\n }\n\n useEffect(() => {\n let fromDateString = moment(datesAndGuests.fromDate).format(\"YYYY-MM-DD\");\n let toDateString = moment(datesAndGuests.toDate).format(\"YYYY-MM-DD\");\n setGetCustomVendorsRequest({\n brandId,\n startDate: fromDateString,\n endDate: toDateString,\n vendorGuid: props.vendorGuidType === \"Custom\" ? props.vendorGuid : undefined \n });\n }, [setCustomVendors]);\n\n useEffect(() => {\n if (responseGetCustomVendors.data) {\n // let responseData: GetCustomVendorsResponse = responseGetCustomVendors.data;\n const responseData = responseGetCustomVendors.data;\n // console.log(\"responseData\", responseData);\n if (props.vendorGuid !== undefined && responseData.length > 0 && responseData[0].vendorGuid === props.vendorGuid) {\n onSelectedVendor({ ...responseData[0] })\n return;\n }\n\n const fromPrice = Number.MAX_VALUE;\n const vendors = responseData.map((v: any) => {\n let price = fromPrice;\n if (v.rates !== null && v.rates !== undefined && v.rates.length > 0 && v.rates.some((dr: any) => dr.rates.length > 0)) {\n //search for lowest price\n\n for (let dRate = 0; dRate < v.rates.length; dRate++) {\n const dateRate = v.rates[dRate];\n for (let uRate = 0; uRate < dateRate.rates.length; uRate++) {\n const unitRate = dateRate.rates[uRate];\n for (let pRate = 0; pRate < unitRate.rates.length; pRate++) {\n const productRate = unitRate.rates[pRate];\n if (productRate.price < price) {\n price = productRate.price;\n }\n }\n }\n }\n }\n return { ...v, fromPrice: price }\n });\n setCustomVendors(vendors);\n\n const cities: string[] = [];\n for (let index = 0; index < vendors.length; index++) {\n const vendor = vendors[index];\n if (cities.includes(vendor.city)) continue;\n\n cities.push(vendor.city);\n }\n setCityOptions(cities);\n\n if (unitToEdit !== undefined) {\n const vendor: CustomItem = responseData.find((v: any) => v.vendorId === unitToEdit.vendorId);\n vendor.numUnits = unitToEdit.units;\n vendor.checkIn = moment(unitToEdit.fromDate).toDate();\n vendor.checkOut = moment(unitToEdit.toDate).toDate();\n vendor.fromTime = unitToEdit.fromTime;\n vendor.toTime = unitToEdit.toTime;\n vendor.itineraryIndex = unitToEdit.itineraryIndex;\n setSelectedVendor(vendor);\n }\n }\n }, [responseGetCustomVendors.data]);\n\n return (\n\n \n \n \n \n \n \n {/* Desktop */}\n \n \n {responseGetCustomVendors.isLoading && (\n Loading...\n )}\n {customVendors && (customVendors.length == 0 || customVendors.filter((v: any) => v.showOnCustomerPortal).length === 0) && (\n

No results found

\n )}\n {customVendors && customVendors.filter((v: any) => v.showOnCustomerPortal).length > 0 &&\n customVendors.filter((v: any) => v.showOnCustomerPortal)\n .filter((v: any) => cityFilter === \"\" || v.city === cityFilter)\n .sort((a: any, b: any) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n return 0;\n })\n .sort((a: any, b: any) => {\n if (priceFilter === 0) return 0;\n if (a.fromPrice < b.fromPrice) return priceFilter === 10 ? -1 : 1;\n if (a.fromPrice > b.fromPrice) return priceFilter === 10 ? 1 : -1;\n return 0;\n })\n .map((vendor: CustomItem, index: number) => (\n \n ))}\n \n
\n
\n \n\n {\n setSelectedVendor(undefined);\n if (!!setUnitToEdit) {\n setUnitToEdit(undefined);\n }\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n

{selectedVendor ? selectedVendor.vendorName : undefined}

\n {viewPortBreakPoint >= ViewPort.md && (\n
{selectedVendor ? selectedVendor.streetAddress : undefined} {selectedVendor ? selectedVendor.city : undefined} {selectedVendor ? selectedVendor.state : undefined} {selectedVendor ? selectedVendor.zipCode : undefined}
\n )}\n \n
\n \n {selectedVendor && (\n \n )}\n \n \n
\n );\n}\n\n\nexport default AddCustomModal;\n","import { useState, useEffect } from \"react\";\nimport useFetch, {\n FetchRequest,\n} from \"../../../../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../../../../_helpers/Constants\";\n\nconst UseGetGolfVendors = (request?: GetGolfVendorsRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/get/golf-vendors/${request.brandId}?startDate=${request.startDate}&endDate=${request.endDate}${(request.vendorId === undefined ? \"\" : `&vendorId=${request.vendorId}`)}${(request.vendorGuid === undefined ? \"\" : `&vendorGuid=${request.vendorGuid}`)}`;\n\n setFetchRequest({\n url: url,\n method: \"GET\",\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n // const response: GetGolfVendorsResponse = fetchResponse.data;\n setData(fetchResponse.data);\n // console.log(\"fetchResponse.data\", fetchResponse.data);\n \n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error);\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return { data, error, isLoading };\n};\n\nexport default UseGetGolfVendors;\n\nexport interface GetGolfVendorsResponse extends FetchResponse {\n vendors: any;\n}\n\nexport interface GetGolfVendorsRequest {\n brandId: number;\n startDate: string;\n endDate: string;\n vendorId?: number;\n vendorGuid?: string;\n}","import \"../../lodging/lodging-details/lodging-details.css\";\nimport \"../../golf/golf-details/golf-details.css\";\nimport \"../../VendorDetails.css\"\n\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Form, Row, Col, Tab, Nav, Carousel, Button, Modal, Spinner } from \"react-bootstrap\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { Modifier } from \"react-day-picker\";\nimport Amenity from \"../../../../../../../Data/Amenity\";\nimport GolfItem from \"../../../../../../../Data/GolfItem\";\nimport VendorUnit from \"../../../../../../../Data/VendorUnit\";\nimport VendorUnitImage from \"../../../../../../../Data/VendorUnitImage\";\nimport WidgetStyle from \"../../../../../../../Data/WidgetStyle\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport StartWidget from \"../../../../../../../Data/StartWidget\";\nimport RatesByDate from \"../../../../../../../Data/Rates/DateRate\";\nimport UnitRate from \"../../../../../../../Data/Rates/UnitRate\";\nimport ProductRate from \"../../../../../../../Data/Rates/ProductRate\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport { MobileDayPickerOverlay } from \"../../../../assets/MobileDayPickerOverlay\";\nimport moment from \"moment\";\nimport VendorDescriptionImage from \"../../../../../../../Data/VendorDescriptionImage\";\nimport Decimal from \"decimal.js\";\nimport { getAvailableVendorUnits, getVendorUnitIdFromUnitName, getVendorUnitIdsFromSelectedName } from \"../../../../../../../Data/Rates/UnitRateLogic\";\nimport { roundDecimal, isStringEmpty } from \"../../../../../../../_helpers/Functions\";\nimport { toast, useToast } from \"react-toastify\";\nimport CustomDayPickerInput from \"../../../../../customDayPickerInput/CustomDayPickerInput\";\nimport UseGetGolfVendors, { GetGolfVendorsRequest } from \"../add-golf/data-service-hooks/UseGetGolfVendors\";\nimport { TimeOption } from \"../../../../../../../_helpers/Types\";\n// import SameDayReplay from \"../../../../../../../Data/SameDayReplay\";\n\ninterface props {\n vendor: GolfItem;\n datesAndGuests: DatesAndGuests;\n onSelectedVendorUnit?: (item: GolfItem, index?: number) => void;\n}\n\ninterface GeoProps {\n lat: number;\n lng: number;\n}\n\nconst GolfDetails: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint, autoScroll, /* brandId */brand } = useContext(WidgetContext);\n\n const { datesAndGuests, onSelectedVendorUnit } = props;\n const [vendor, setVendor] = useState(props.vendor);\n const isEditing = vendor.itineraryIndex !== undefined && vendor.itineraryIndex > -1;\n\n const [players, setPlayers] = useState(isEditing ? vendor.guests : datesAndGuests.guests);\n const [playDate, setPlayDate] = useState(vendor.checkIn !== undefined ? vendor.checkIn : datesAndGuests.fromDate);\n const [showReplayModal, setShowReplayModal] = useState(false);\n const { formatDate, parseDate } = reactMoment;\n const [latlang, setLatLang] = useState();\n const [geoLocation, setGeoLocation] = useState(\"\");\n // const [unitId, setUnitId] = useState(vendor.vendorUnits.length > 0 ? vendor.vendorUnits[0].vendorUnitId : undefined);\n\n const maxGuests = datesAndGuests.guests;\n const scorecardImg = vendor.description && vendor.description.vendorDescriptionImages ? vendor.description.vendorDescriptionImages.find((img: VendorDescriptionImage) => img.imageType === 1) : undefined;\n\n const [selectedUnit, setSelectedUnit] = useState(null);\n const [selectedProductRate, setSelectedProductRate] = useState(null);\n const [selectedTeeTime, setSelectedTeeTime] = useState(null);\n const [productRate, setProductRate] = useState();\n\n const [teeTimes, setTeeTimes] = useState([]);\n const [ratesForPlayDate, setRatesForPlayDate] = useState([]);\n const [unavailableMessage, setUnavailableMessage] = useState('');\n const [ratesForUnit, setRatesForUnit] = useState([]);\n const [teeTimeRate, setTeeTimeRate] = useState();\n const [vendorUnits, setVendorUnits] = useState([]);\n\n const [isLoading, setIsLoading] = useState(true);\n const [getGolfVendorsRequest, setGetGolfVendorsRequest] = useState();\n const responseGetGolfVendors = UseGetGolfVendors(getGolfVendorsRequest);\n\n const rates = vendor && vendor.dailyRates ? vendor.dailyRates : [];\n const [selectedUnitName, setSelectedUnitName] = useState(null);\n // const [vendorUnitIds, setVendorUnitIds] = useState([]);\n\n const [imgErrors, setImgErrors] = useState([]);\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n\n const [index, setIndex] = useState(0);\n\n const handleSelect = (selectedIndex: any, e: any) => {\n setIndex(selectedIndex);\n };\n\n useEffect(() => {\n console.log(\"props.vendor\", props.vendor);\n setVendor(props.vendor);\n }, [props.vendor]);\n\n // function handleShow() {\n // setShowReplayModal(true);\n // }\n\n // function handleClose() {\n // setShowReplayModal(false);\n // }\n\n const onGuestsInputChanged = (event: any) => {\n setPlayers(+event.target.value);\n };\n\n const teeTimesOptions = teeTimes.map((teeTime: TimeOption, index: number) => (\n \n ));\n\n // const unitOptions = vendorUnits.map((unit: VendorUnit, index: number) => (\n // \n // ));\n const unitOptions = vendorUnits.filter(u => u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n const playerOptions = Array.from({\n length: Math.min(productRate !== undefined && productRate.isLive ?\n // Math.min(productRate.openSpots, 4) : players, players)\n Math.min(players, players) : players, players)\n }, (_, i) => i + 1).map((number: number, index: number) => (\n \n ));\n\n // function getNumGuestsOptions(): JSX.Element[] {\n // const options: JSX.Element[] = [];\n\n // for (let index = 0; index < maxGuests; index++) {\n // options.push();\n // }\n\n // return options;\n // }\n\n function addClick(golf: VendorUnit) {\n if (productRate !== undefined && productRate.isLive) {\n let playerCount = players;\n let startingIndex = teeTimes.findIndex(t => t.foreUpTeeTimeId === productRate.foreUpTeeTimeId || t.golfNowTeeTimeId === productRate.golfNowTeeTimeId || t.lightSpeedTeeTimeId === productRate.lightSpeedTeeTimeId);\n\n do {\n playerCount -= teeTimes[startingIndex++].openSpots;\n } while (playerCount > 0 && startingIndex < teeTimes.length);\n\n if (playerCount > 0) {\n toast.error(`Not enough remaining Tee Times to fulfill remaining ${playerCount} player${(playerCount > 1 ? \"s\" : \"\")}`);\n return;\n }\n }\n\n golf.vendorId = vendor.vendorId;\n\n golf.sell = unitRate();\n\n vendor.selectedUnit = golf;\n vendor.checkIn = playDate;\n vendor.checkOut = datesAndGuests.toDate;\n vendor.guests = players;\n vendor.teeTime = selectedTeeTime as string;\n\n vendor.productRateId = productRate !== undefined ? productRate.productRateId : 0;\n vendor.foreUpTeeTimeId = productRate !== undefined ? productRate.foreUpTeeTimeId : \"\";\n vendor.golfNowTeeTimeId = productRate !== undefined ? productRate.golfNowTeeTimeId : \"\";\n vendor.lightSpeedTeeTimeId = productRate !== undefined ? productRate.lightSpeedTeeTimeId : \"\";\n vendor.availableTeeTimes = teeTimes;\n\n // console.log(\"vendor\", vendor);\n\n if (onSelectedVendorUnit)\n onSelectedVendorUnit(vendor, vendor.itineraryIndex);\n // //push new array into golf replays\n // vendor.sameDayReplays.push([]);\n }\n\n function populateTeeTimes() {\n const selectedPlayDate = moment(playDate).format('YYYY-MM-DD');\n const ratesForDate = rates.find(rate => selectedPlayDate.toString() === moment(rate.date).format('YYYY-MM-DD').toString());\n\n if (ratesForDate) {\n const selectedRates = ratesForDate.unitRates.filter(a => a.vendorUnitDisplayName === selectedUnitName);\n const ratesForUnit = selectedRates.flatMap(a => a.rates);\n // Set the tee times.\n let rateTeeTimes: TimeOption[] = [];\n ratesForUnit.forEach(r => {\n let start = moment(r.startTime, 'HH:mm');\n let end = moment(r.endTime, 'HH:mm');\n if (r.startTime !== r.endTime)\n start.minutes(Math.ceil(start.minutes() / 10) * 10);\n let result: TimeOption[] = [];\n let current = moment(start);\n while (current <= end) {\n result.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a') + (r.isLive ? ` (${r.openSpots} players)` : \"\"),\n foreUpTeeTimeId: r.isLive ? r.foreUpTeeTimeId : \"\",\n golfNowTeeTimeId: r.isLive ? r.golfNowTeeTimeId : \"\",\n lightSpeedTeeTimeId: r.isLive ? r.lightSpeedTeeTimeId : \"\",\n openSpots: r.openSpots,\n price: r.price,\n isLive: r.isLive,\n vendorUnitId: r.vendorUnitId,\n productRateId: r.productRateId\n });\n current.add(10, 'minutes');\n }\n rateTeeTimes = rateTeeTimes.concat(result);\n });\n if (!!rateTeeTimes.length) {\n rateTeeTimes = [...new Map(rateTeeTimes.map(item => [item.value, item])).values()] // Remove any cross-over duplicates.\n }\n rateTeeTimes.sort((a, b) => {\n // Sort by time.\n return moment(a.value, 'HH:mm').isBefore(moment(b.value, 'HH:mm')) ? -1 : 0;\n });\n\n if (!!rateTeeTimes.length) {\n setSelectedTeeTime(isEditing ? vendor.teeTime : rateTeeTimes[0].value);\n setUnavailableMessage('');\n }\n setTeeTimes(rateTeeTimes);\n\n if (ratesForDate.unavailable) {\n setUnavailableMessage(ratesForDate.unavailableMessage || \"Unavailable\");\n } else if (selectedRates.some(r => r.unavailable)) {\n setUnavailableMessage(selectedRates[0].unavailableMessage);\n } else if (rateTeeTimes.length === 0) {\n setUnavailableMessage(\"No rates available for this date\");\n }\n }\n }\n\n function unitRate(): number {\n if (!teeTimeRate) {\n return 0;\n }\n\n return roundDecimal(teeTimeRate.times(players)).toNumber();\n }\n\n useEffect(() => {\n // map\n fetch(\n `https://maps.googleapis.com/maps/api/geocode/json?address=${vendor.streetAddress},+${vendor.city},+${vendor.state}&key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU`\n ).then((response) => {\n return response.json();\n }).then((response) => {\n setLatLang({ lat: response.results[0].geometry.location.lat, lng: response.results[0].geometry.location.lng });\n });\n }, []);\n\n useEffect(() => {\n if (latlang) {\n\n const geolocationString = `https://www.google.com/maps/embed/v1/view?key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU\n ¢er=${latlang.lat},${latlang.lng}\n &zoom=15\n &maptype=roadmap`;\n\n setGeoLocation(geolocationString);\n }\n }, [latlang]);\n\n useEffect(() => {\n if (!vendor || isLoading) return;\n\n console.log(\"vendor\", vendor);\n\n const _vendorUnits = getAvailableVendorUnits(vendor.vendorUnits, rates, moment(playDate).format(\"MM/DD/YYYY\"));\n _vendorUnits.sort((a, b) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n\n if (a.unitName.toLowerCase() < b.unitName.toLowerCase()) return -1;\n if (a.unitName.toLowerCase() > b.unitName.toLowerCase()) return 1;\n\n return 0;\n });\n setVendorUnits(_vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection == selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n // setSelectedUnit(_vendorUnits[0].vendorUnitId);\n }\n }\n\n setUnavailableMessage(\"\");\n populateTeeTimes();\n\n const ids = getVendorUnitIdsFromSelectedName(rates, selectedUnitName, moment(playDate).format(\"MM/DD/YYYY\"));\n // setVendorUnitIds(ids);\n }, [vendor, playDate, isLoading]);\n\n useEffect(() => {\n console.log(\"vendorUnits\", vendorUnits);\n }, [vendorUnits]);\n\n useEffect(() => {\n if (isLoading) return;\n\n populateTeeTimes();\n }, [selectedUnitName, isLoading]);\n\n useEffect(() => {\n if (isLoading) return;\n\n const selectedPlayDate = moment(playDate).format('YYYY-MM-DD');\n const ratesForDate = rates.find(rate => selectedPlayDate.toString() === moment(rate.date).format('YYYY-MM-DD').toString());\n\n setRatesForPlayDate([]);\n\n if (!selectedTeeTime || !ratesForDate) {\n setTeeTimeRate(undefined);\n setProductRate(undefined);\n return;\n }\n\n if (ratesForDate.unavailable || ratesForDate.unitRates.length == 0) {\n var message = ratesForDate.unavailable ? ratesForDate.unavailableMessage as string : \"No rates available for the play date.\";\n setUnavailableMessage(message)\n // setTeeTimeRate(new Decimal(0));\n\n // return;\n\n if (ratesForDate.unitRates.length == 0) {\n setRatesForPlayDate([]);\n setTeeTimeRate(new Decimal(0));\n // setTeeTimeRate(undefined);\n return;\n }\n }\n\n setRatesForPlayDate(ratesForDate.unitRates);\n\n const ratesForUnit = ratesForDate.unitRates.flatMap(a => a.rates);\n setRatesForUnit(ratesForUnit);\n\n // const unitId = getVendorUnitIdFromUnitName([ratesForDate], selectedUnitName);\n const unitIds = getVendorUnitIdsFromSelectedName(rates, selectedUnitName, moment(playDate).format(\"MM/DD/YYYY\"));\n const teeTimeRate = ratesForUnit.find(r => moment(r.startTime, \"HH:mm\").isSameOrBefore(moment(selectedTeeTime, \"HH:mm\")) && moment(r.endTime, \"HH:mm\").isSameOrAfter(moment(selectedTeeTime, \"HH:mm\")) && unitIds.includes(r.vendorUnitId));\n\n if (teeTimeRate) {\n setSelectedUnit(teeTimeRate ? teeTimeRate.vendorUnitId : null);\n setSelectedProductRate(teeTimeRate);\n }\n\n let rate = new Decimal(teeTimeRate ? teeTimeRate.price : 0);\n\n setTeeTimeRate(rate);\n setProductRate(teeTimeRate);\n // setVendorUnitIds(unitIds);\n }, [selectedTeeTime, selectedUnitName, playDate, isLoading]);\n\n useEffect(() => {\n setIndex(0);\n }, [selectedUnit]);\n\n useEffect(() => {\n if (brand === undefined) return;\n\n setGetGolfVendorsRequest({ brandId: brand?.brandId as number, startDate: moment(datesAndGuests.fromDate).format('YYYY-MM-DD'), endDate: moment(datesAndGuests.toDate).format('YYYY-MM-DD'), vendorId: vendor.vendorId });\n }, [props.vendor]);\n\n useEffect(() => {\n if (responseGetGolfVendors.data) {\n const responseData = responseGetGolfVendors.data;\n\n if (responseData.length > 0) {\n responseData[0].itineraryIndex = vendor.itineraryIndex;\n setVendor(responseData[0]);\n }\n setIsLoading(false);\n }\n }, [responseGetGolfVendors.data]);\n\n const inputStyle = `\n .inline-style .DayPickerInput>input {\n padding-left: 15px;\n}`;\n\n const navLinkStyles = `\n .nav-pills .nav-link.active {\n background-color: rgb(247, 247, 247);\n color: ${style.buttonColor} !important;\n}`;\n\n return (\n \n \n \n\n {/* Desktop */}\n
\n {/* Dates */}\n \n \n \n
\n \n Date of Play\n \n {\n setPlayDate(date);\n }}\n />\n
\n\n
\n \n Players\n \n \n {/* {getNumGuestsOptions()} */}\n {playerOptions}\n \n
\n\n {!isLoading && teeTimesOptions.length > 0 && (\n
\n \n Tee Times\n \n setSelectedTeeTime(event.currentTarget.value)}>\n {teeTimesOptions}\n \n
\n )}\n\n
\n \n {/* {unavailableMessage === \"\" && ( */}\n {!isLoading && teeTimesOptions.length > 0 && (\n
\n \n Unit Type\n \n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n
\n )}\n\n {isLoading && (\n Loading...\n )}\n\n {/* )} */}\n\n {/* {!!vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedProductRate?.vendorUnitId) && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedProductRate?.vendorUnitId)?.unitDescription}

\n
\n )} */}\n\n {vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n\n {!isStringEmpty(unavailableMessage) && (\n \n

{unavailableMessage}

\n
\n )}\n
\n \n\n {!isLoading && (\n \n {!!!unavailableMessage && teeTimesOptions.length > 0 && (<>\n {(selectedProductRate !== null && selectedProductRate.displayVendorPriceOverride && teeTimeRate !== undefined) || !vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showLodgingPricing && teeTimeRate !== undefined ? (\n
\n

${teeTimeRate.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n
\n {\n // const _unitId = getVendorUnitIdFromUnitName(vendor.rates, selectedUnitName);\n // if (_unitId)\n // addClick(vendor.vendorUnits.find(unit => unit.vendorUnitId == _unitId) as VendorUnit);\n const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId == selectedUnit) as VendorUnit;\n addClick(vu);\n }}\n >\n Add\n \n
\n )}\n \n )}\n
\n\n {!isLoading && (\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n
\n \n \n { imgErrors.push(index); setImgErrors([...imgErrors]); }}\n />\n \n \n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n \n \n )}\n\n \n\n {/* Mobile */}\n {!isLoading && (\n
\n \n \n {/* Room Type Select */}\n \n {/* \n Type:\n */}\n\n {vendorUnits.length > 0 && (\n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n )}\n
\n\n {/* Arrive DatePicker */}\n
\n \n {\n setPlayDate(date);\n }}\n />\n \n
\n\n {/* Guests / Tee Times */}\n {/*
*/}\n \n {/* Tee Times */}\n {teeTimesOptions.length > 0 && (\n
\n {/* \n Time:\n */}\n setSelectedTeeTime(event.currentTarget.value)}>\n {teeTimesOptions}\n \n
\n )}\n
\n {/*
*/}\n\n \n {/* Guests */}\n 394 ? 0 : \"12px\" }}\n // style={{marginTop: \"8px\"}}\n >\n \n Players:\n \n \n {/* {getNumGuestsOptions()} */}\n {playerOptions}\n \n \n \n\n \n {false && (\n \n )}\n \n\n {vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n\n {/* Package Price */}\n {!!!unavailableMessage && (\n
\n {(selectedProductRate !== null && selectedProductRate.displayVendorPriceOverride && teeTimeRate !== undefined) || !vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showGolfPricing && teeTimeRate !== undefined ? (\n
\n

${teeTimeRate.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n\n {\n // const _unitId = getVendorUnitIdFromUnitName(vendor.rates, selectedUnitName);\n // if (_unitId)\n // addClick(vendor.vendorUnits.find(unit => unit.vendorUnitId == _unitId) as VendorUnit);\n const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId == selectedUnit) as VendorUnit;\n addClick(vu);\n }}\n >\n + {isEditing ? \"Save\" : \"Add\"}\n \n
)}\n\n {unavailableMessage && (\n \n

{unavailableMessage}

\n
\n )}\n\n {/* Navigation / Carousel / Tab Content */}\n
\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {/* Vendor Units has images now */}\n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n \n \n \n { imgErrors.push(index); setImgErrors([...imgErrors]); }}\n />\n \n \n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n )}\n\n {isLoading && (\n
\n Loading...\n
\n )}\n\n\n {/* Same Day Replays Modal */}\n {/* handleClose()}\n >\n \n \n {vendor.vendorName} Replay\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n */}\n\n
\n );\n}\n\nexport default GolfDetails;","import \"../../WidgetModal.css\";\nimport \"../../lodging/add-lodging/add-lodging.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { useState, useEffect, SetStateAction, useContext } from \"react\";\nimport { Col, Row, Modal, Spinner } from \"react-bootstrap\";\nimport reactMoment from \"react-day-picker/moment\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport UseGetGolfVendors, { GetGolfVendorsRequest, GetGolfVendorsResponse } from \"./data-service-hooks/UseGetGolfVendors\";\nimport GolfItem from \"../../../../../../../Data/GolfItem\";\nimport VendorCard from \"../../VendorCard\";\nimport GolfDetails from \"../golf-details/GolfDetails\";\nimport { Modifier } from \"react-day-picker\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport GolfItineraryUnit from \"../../../../../../../Data/Reservation/Golf/GolfItineraryUnit\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport moment from \"moment\";\nimport ViewPort from \"../../../../../../../_helpers/Enums/ViewPortEnum\";\nimport AddModalSortBy from \"../../AddModalSortBy\";\n\ninterface props {\n show: boolean,\n onHide: () => void;\n brandId: number,\n datesAndGuests: DatesAndGuests;\n onSelectedGolf?: (item: GolfItem, index?: number) => void;\n unitToEditState?: [GolfItineraryUnit | undefined, React.Dispatch>];\n vendorGuid: string | undefined;\n vendorGuidType: string | undefined;\n}\n\nconst AddGolfModal: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n const [simpleView, setSimpleView] = useState(viewPortBreakPoint >= ViewPort.md ? false : true);\n\n const { show, onHide, brandId, onSelectedGolf } = props;\n const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const unitToEdit = props.unitToEditState ? props.unitToEditState[0] : undefined;\n const setUnitToEdit = props.unitToEditState ? props.unitToEditState[1] : undefined;\n\n const [priceFilter, setPriceFilter] = useState(0);\n const [cityFilter, setCityFilter] = useState(\"\");\n\n const [selectedVendor, setSelectedVendor] = useState();\n const [golfVendors, setGolfVendors] = useState();\n const { formatDate, parseDate } = reactMoment;\n const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n\n const [getGolfVendorsRequest, setGetGolfVendorsRequest] = useState();\n const responseGetGolfVendors = UseGetGolfVendors(getGolfVendorsRequest);\n\n const [cityOptions, setCityOptions] = useState([]);\n\n const onSelectedVendor = (vendor: GolfItem) => {\n // window.parent.postMessage(\"scroll\", \"*\");\n // // if (document.documentElement.scrollTop > 0)\n // window.scrollTo({ top: 0, left: 0, behavior: \"smooth\" });\n setSelectedVendor(vendor);\n }\n\n const onSelectedVendorUnit = (item: GolfItem, index?: number) => {\n if (onSelectedGolf) {\n onSelectedGolf(item, index);\n }\n\n setSelectedVendor(undefined);\n }\n\n const sortByPrice = (e: any) => {\n setPriceFilter(+e.target.value);\n }\n\n const sortByCity = (e: any) => {\n setCityFilter(e.target.value);\n }\n\n useEffect(() => {\n let fromDateString = moment(datesAndGuests.fromDate).format(\"YYYY-MM-DD\");\n let toDateString = moment(datesAndGuests.toDate).format(\"YYYY-MM-DD\");\n setGetGolfVendorsRequest({ brandId, startDate: fromDateString, endDate: toDateString, vendorGuid: props.vendorGuidType === \"Golf\" ? props.vendorGuid : undefined });\n }, [setGolfVendors]);\n\n useEffect(() => {\n if (responseGetGolfVendors.data) {\n const responseData = responseGetGolfVendors.data;\n\n if (props.vendorGuid !== undefined && responseData.length > 0 && responseData[0].vendorGuid === props.vendorGuid) {\n onSelectedVendor({ ...responseData[0] })\n return;\n }\n\n const fromPrice = Number.MAX_VALUE;\n const vendors = responseData.map((v: any) => {\n let price = fromPrice;\n if (v.rates !== null && v.rates !== undefined && v.rates.length > 0 && v.rates.some((dr: any) => !dr.unavailable && dr.rates.length > 0)) {\n //search for lowest price\n\n for (let dRate = 0; dRate < v.rates.length; dRate++) {\n const dateRate = v.rates[dRate];\n for (let uRate = 0; uRate < dateRate.rates.length; uRate++) {\n const unitRate = dateRate.rates[uRate];\n for (let pRate = 0; pRate < unitRate.rates.length; pRate++) {\n const productRate = unitRate.rates[pRate];\n if (productRate.price < price) {\n price = productRate.price;\n }\n }\n }\n }\n }\n return { ...v, fromPrice: price }\n });\n setGolfVendors(vendors);\n\n const cities: string[] = [];\n for (let index = 0; index < vendors.length; index++) {\n const vendor = vendors[index];\n if (cities.includes(vendor.city)) continue;\n\n cities.push(vendor.city);\n }\n setCityOptions(cities);\n\n if (unitToEdit !== undefined) {\n const vendor: GolfItem = responseData.find((v: any) => v.vendorId === unitToEdit.vendorId);\n vendor.guests = unitToEdit.players;\n vendor.checkIn = moment(unitToEdit.playDate).toDate();\n vendor.teeTime = unitToEdit.teeTime;\n vendor.itineraryIndex = unitToEdit.itineraryIndex;\n setSelectedVendor(vendor);\n }\n }\n }, [responseGetGolfVendors.data]);\n\n return (\n \n \n \n \n \n \n \n \n {responseGetGolfVendors.isLoading && (\n Loading...\n )}\n {golfVendors && (golfVendors.length === 0 || golfVendors.filter((v: any) => v.showOnCustomerPortal).length === 0) && (\n

No results found

\n )}\n {golfVendors && golfVendors.filter((v: any) => v.showOnCustomerPortal).length > 0 &&\n golfVendors.filter((v: any) => v.showOnCustomerPortal)\n .filter((v: any) => cityFilter === \"\" || v.city === cityFilter)\n .sort((a: any, b: any) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n return 0;\n })\n .sort((a: any, b: any) => {\n if (priceFilter === 0) return 0;\n if (a.fromPrice < b.fromPrice) return priceFilter === 10 ? -1 : 1;\n if (a.fromPrice > b.fromPrice) return priceFilter === 10 ? 1 : -1;\n return 0;\n })\n .map((vendor: GolfItem, index: number) => (\n \n ))}\n \n
\n
\n \n\n {\n setSelectedVendor(undefined);\n if (!!setUnitToEdit) {\n setUnitToEdit(undefined);\n }\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n

\n {selectedVendor ? selectedVendor.vendorName : undefined}\n

\n {viewPortBreakPoint >= ViewPort.md && (\n
{selectedVendor ? selectedVendor.streetAddress : undefined} {selectedVendor ? selectedVendor.city : undefined} {selectedVendor ? selectedVendor.state : undefined} {selectedVendor ? selectedVendor.zipCode : undefined}
\n )}\n \n
\n \n {selectedVendor && (\n \n )}\n \n \n\n
\n );\n}\n\n\nexport default AddGolfModal\n","import { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../../../../_helpers/Constants\";\n\nconst UseGetLodgingVendors = (request?: GetLodgingVendorsRequest) => {\n // const [data, setData] = useState(null);\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n \n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n const url: string = `${apiString}/api/v1.0/customer-portal/get/lodging-vendors/${request.brandId}?startDate=${request.startDate}&endDate=${request.endDate}${(request.vendorGuid === undefined ? \"\" : `&vendorGuid=${request.vendorGuid}`)}`;\n\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n // const response: GetLodgingVendorsResponse = fetchResponse.data; \n setData(fetchResponse.data);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default UseGetLodgingVendors;\n\nexport interface GetLodgingVendorsResponse extends FetchResponse {\n vendors: any;\n}\n\nexport interface GetLodgingVendorsRequest {\n brandId: number;\n startDate: string;\n endDate: string;\n vendorGuid?: string;\n}","import \"../lodging-details/lodging-details.css\";\nimport \"../../VendorDetails.css\";\n\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Form, Row, Col, Tab, Nav, Carousel, Button } from \"react-bootstrap\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { Modifier } from \"react-day-picker\";\nimport Amenity from \"../../../../../../../Data/Amenity\";\nimport LodgingItem from \"../../../../../../../Data/LodgingItem\";\nimport VendorUnit from \"../../../../../../../Data/VendorUnit\";\nimport VendorUnitImage from \"../../../../../../../Data/VendorUnitImage\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport { MobileDayPickerOverlay } from \"../../../../assets/MobileDayPickerOverlay\";\nimport moment from \"moment\";\nimport UnitRate from \"../../../../../../../Data/Rates/UnitRate\";\nimport { getAvailableVendorUnits, getDailyRate, getRateTypeFromUnitName, getVendorUnitIdFromUnitName, getVendorUnitIdsFromSelectedName } from \"../../../../../../../Data/Rates/UnitRateLogic\";\nimport EnumProductRateType from \"../../../../../../../Data/Rates/EnumProductRateType\";\nimport Decimal from \"decimal.js\";\nimport { roundDecimal } from \"../../../../../../../_helpers/Functions\";\nimport ProductRate from \"../../../../../../../Data/Rates/ProductRate\";\nimport CustomDayPickerInput from \"../../../../../customDayPickerInput/CustomDayPickerInput\";\n\ninterface props {\n vendor: LodgingItem;\n datesAndGuests: DatesAndGuests;\n onSelectedVendorUnit?: (item: LodgingItem, index?: number) => void;\n}\n\ninterface GeoProps {\n lat: number;\n lng: number;\n}\n\nconst LodgingDetail: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint, autoScroll } = useContext(WidgetContext);\n\n const { onSelectedVendorUnit, datesAndGuests } = props;\n const [vendor, setVendor] = useState(props.vendor);\n const isEditing = vendor.itineraryIndex !== undefined && vendor.itineraryIndex > -1;\n const [vendorUnits, setVendorUnits] = useState([]);\n\n const [checkIn, setCheckIn] = useState(vendor.checkIn !== undefined ? moment(vendor.checkIn).toDate() : moment(datesAndGuests.fromDate).toDate());\n const [checkOut, setCheckOut] = useState(vendor.checkOut !== undefined ? moment(vendor.checkOut).toDate() : moment(datesAndGuests.toDate).toDate());\n const modifiers = { start: checkIn, end: checkOut };\n\n const [guests, setGuests] = useState(isEditing ? vendor.guests : datesAndGuests.guests);\n const maxGuests = datesAndGuests.guests;\n const [numberOfUnits, setNumberOfUnits] = useState(isEditing ? vendor.units : datesAndGuests.units);\n const { formatDate, parseDate } = reactMoment;\n const [latlang, setLatLang] = useState();\n const [geoLocation, setGeoLocation] = useState(\"\");\n // const [unitId, setUnitId] = useState(vendor.vendorUnits.length > 0 ? vendor.vendorUnits[0].vendorUnitId : undefined);\n\n const [unavailableMessage, setUnavailableMessage] = useState();\n\n const [selectedUnit, setSelectedUnit] = useState(null);\n const [selectedProductRate, setSelectedProductRate] = useState(null);\n const [selectedUnitName, setSelectedUnitName] = useState(null);\n const [selectedTravePortLodgingOfferId, setSelectedTravePortLodgingOfferId] = useState(null);\n const [selectedTravePortUnitName, setSelectedTravePortUnitName] = useState(null);\n const [productRate, setProductRate] = useState();\n // const [vendorUnitIds, setVendorUnitIds] = useState([]);\n\n // const rates = vendor && vendor.rates ? vendor.rates : [];\n // const rates = vendor.rates || [];\n const [unitRateTotal, setUnitRateTotal] = useState(0);\n const [unitRateAverage, setUnitRateAverage] = useState(0);\n\n const [imgErrors, setImgErrors] = useState([]);\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n\n const [index, setIndex] = useState(0);\n\n const handleSelect = (selectedIndex: any, e: any) => {\n setIndex(selectedIndex);\n };\n\n const checkInDateChanged = (date: Date) => {\n setCheckIn(date);\n if (date > checkOut) {\n setCheckOut(date);\n }\n }\n\n const checkOutDateChanged = (date: Date) => {\n setCheckOut(date);\n }\n\n const onGuestsInputChanged = (event: any) => {\n setGuests(+event.target.value);\n if (numberOfUnits > +event.target.value)\n setNumberOfUnits(1);\n };\n\n const onUnitsInputChanged = (event: any) => {\n setNumberOfUnits(+event.target.value);\n };\n\n // const unitOptions = vendorUnits.map((unit: VendorUnit, index: number) => (\n // \n // ));\n\n const unitOptions = vendorUnits.filter(u => u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n function getNumUnitsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < guests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getNumGuestsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < maxGuests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function addClick(unit: VendorUnit) {\n unit.vendorId = vendor.vendorId;\n // console.log(\"unit\", unit);\n\n unit.sell = unitRateTotal;\n\n vendor.selectedUnit = unit;\n\n vendor.checkIn = checkIn;\n vendor.checkOut = checkOut;\n vendor.guests = guests;\n vendor.units = numberOfUnits;\n vendor.travelPortLodgingOfferId = selectedTravePortLodgingOfferId;\n vendor.travelPortRateName = selectedTravePortUnitName;\n vendor.useLocalRates = !unit.isLive;\n vendor.productRateId = productRate !== undefined ? productRate.productRateId : 0;\n\n if (onSelectedVendorUnit)\n onSelectedVendorUnit(vendor, vendor.itineraryIndex);\n }\n\n useEffect(() => {\n // map\n // `https://maps.googleapis.com/maps/api/geocode/json?address=${address},+${city},+${state}&key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU`\n fetch(\n `https://maps.googleapis.com/maps/api/geocode/json?address=${vendor.streetAddress},+${vendor.city},+${vendor.state}&key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU`\n )\n .then((response) => {\n return response.json();\n })\n .then((response) => {\n setLatLang({ lat: response.results[0].geometry.location.lat, lng: response.results[0].geometry.location.lng });\n });\n }, [])\n\n useEffect(() => {\n if (latlang) {\n\n let geolocationString = `https://www.google.com/maps/embed/v1/view?key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU\n ¢er=${latlang.lat},${latlang.lng}\n &zoom=15\n &maptype=roadmap`;\n\n setGeoLocation(geolocationString);\n }\n }, [latlang]);\n\n // useEffect(() => {\n // console.log(\"vendorUnits\", vendorUnits);\n // }, [vendorUnits]);\n\n useEffect(() => {\n if (!vendor) return;\n\n const rates = vendor.dailyRates;\n const _vendorUnits = getAvailableVendorUnits(props.vendor.vendorUnits, rates, moment(checkIn).format(\"MM/DD/YYYY\"), moment(checkOut).format(\"MM/DD/YYYY\"));\n // console.log(\"_vendorUnits\", _vendorUnits);\n _vendorUnits.sort((a, b) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n\n if (a.unitName.toLowerCase() < b.unitName.toLowerCase()) return -1;\n if (a.unitName.toLowerCase() > b.unitName.toLowerCase()) return 1;\n\n return 0;\n });\n setVendorUnits(_vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection == selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n setSelectedUnit(_vendorUnits[0].vendorUnitId);\n }\n }\n\n setUnavailableMessage('');\n // setIndex(0);\n\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, checkIn.toString(), checkOut.toString()));\n }, [vendor, checkIn, checkOut]);\n\n useEffect(() => {\n setUnitRateTotal(0);\n setUnitRateAverage(0);\n\n console.log(\"vendor.dailyRates\", vendor.dailyRates);\n\n const dayRates = vendor.dailyRates.filter(a => a.unitRates.findIndex(b => b.vendorUnitDisplayName === selectedUnitName) >= 0);\n\n let nights: Date[] = [];\n let night = moment(checkIn, 'YYYY-MM-DD');\n const checkOutDate = moment(checkOut, 'YYYY-MM-DD');\n while (night.isBefore(checkOutDate)) {\n nights.push(night.toDate());\n night = night.clone().add(1, 'day');\n }\n\n const unavailableDates = nights.filter(night => !dayRates.find(rate => {\n return moment(rate.date).format('MM/DD/YYYY').toString() === moment(night).format('MM/DD/YYYY').toString();\n }));\n\n if (unavailableDates.length) {\n let unavailableDatesMessage = '';\n unavailableDates.forEach(date => {\n unavailableDatesMessage += ` ${moment(date).format('MM/DD/YYYY')} no rates available.`;\n });\n setUnavailableMessage(unavailableDatesMessage);\n return;\n }\n\n const ratesForNights = dayRates.filter(rate => nights.find(night => moment(night).format('MM/DD/YYYY').toString() === moment(rate.date).format('MM/DD/YYYY').toString()));\n const ratesForUnitName = ratesForNights.flatMap(a => a.unitRates).filter(a => a.vendorUnitDisplayName === selectedUnitName);\n // setRatesForDates(ratesForNights.flatMap(a => a.rates));\n // const unavailableRates = ratesForNights.filter(rate => rate.unavailable);\n const unavailableRates = ratesForUnitName.filter(rate => rate.unavailable);\n if (!unavailableRates.length) {\n setUnavailableMessage('');\n } else {\n let message = '';\n unavailableRates.forEach(rate => {\n message += ` ${moment(rate.date).format('MM/DD/YYYY')} ${rate.unavailableMessage}`;\n // message += ` ${date.unavailableMessage}`;\n });\n setUnavailableMessage(message);\n }\n\n if (ratesForUnitName.length > 0) {\n setSelectedUnit(ratesForUnitName[0].vendorUnitId);\n if (ratesForUnitName[0].rates.length > 0)\n setSelectedProductRate(ratesForUnitName[0].rates[0]);\n }\n\n // const rate = ratesForUnitName.flatMap(a => a.rates).reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0)).times(units);\n let rate: any = null;\n const innerRates = ratesForUnitName.flatMap((a: any) => a.rates);\n let testRate: any = undefined;\n\n if (!innerRates.some((r: any) => r.isLive))\n rate = innerRates.reduce((a: any, b: any) => a.add(new Decimal(b?.price || 0)), new Decimal(0)).times(numberOfUnits);\n else {\n const test = innerRates.filter((r: any) => r.travelPortRateName == selectedTravePortUnitName);\n if (test.length > 0) {\n rate = test.reduce((a: any, b: any) => a.add(new Decimal(b?.price || 0)), new Decimal(0)).times(numberOfUnits);\n testRate = test[0];\n }\n\n // rate = innerRates.reduce((a: any, b: any) => a.add(new Decimal(b?.price || 0)), new Decimal(0)).times(numberOfUnits);\n\n }\n\n // let rate = ratesForUnitName.flatMap(a => a.rates).reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0));\n // if (props.vendor.fees !== undefined && props.vendor.fees.cleaningFeePerDayOrPerUnit === \"Unit\") {\n // rate = rate.add(props.vendor.fees.cleaningFee);\n // }\n\n if (rate !== null) {\n setUnitRateTotal(rate.toNumber());\n setUnitRateAverage(roundDecimal(rate.dividedBy(ratesForNights.length === 0 ? 1 : ratesForNights.length)).toNumber());\n if (testRate !== undefined)\n setProductRate(testRate);\n // set productRate\n\n }\n\n if (nights.length === 0)\n setUnavailableMessage(\"Arrival/Departure dates can not be the same day\");\n\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, checkIn.toString(), checkOut.toString()));\n // setIndex(0);\n }, [checkIn, checkOut, selectedUnitName, numberOfUnits, selectedTravePortUnitName]);\n\n // useEffect(() => {\n // setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, checkIn.toString(), checkOut.toString()));\n // }, [selectedUnitName]);\n\n // useEffect(() => {\n // setIndex(0);\n // }, [vendorUnitIds]);\n\n useEffect(() => {\n setIndex(0);\n }, [selectedUnit]);\n\n useEffect(() => {\n //if (autoScroll) {\n //window.parent.postMessage(\"scroll\", \"*\");\n //if (document.documentElement.scrollTop > 0)\n //window.scrollTo({ top: 0, left: 0, behavior: \"smooth\" });\n //}\n }, []);\n\n const inputStyle = `\n .inline-style .DayPickerInput>input {\n padding-left: 15px;\n}`;\n\n const navLinkStyles = `\n .nav-pills .nav-link.active {\n background-color: rgb(247, 247, 247);\n color: ${style.buttonColor} !important;\n}`;\n\n return (\n \n \n \n\n {/* Desktop */}\n
\n \n \n \n \n \n Check In Date\n \n \n \n\n \n \n Check Out Date\n \n \n \n\n
\n \n Guests\n \n \n {getNumGuestsOptions()}\n \n
\n\n
\n \n Units\n \n \n {getNumUnitsOptions()}\n \n
\n\n
\n \n {vendorUnits.length > 0 && (\n <>\n \n \n Unit Type\n \n \n \n\n \n {!!!unavailableMessage && (<>\n {(selectedProductRate !== null && selectedProductRate.displayVendorPriceOverride) || !vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showLodgingPricing ? (\n
\n

${unitRateAverage.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n
\n
\n )}\n \n
\n \n {vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n\n {unavailableMessage !== undefined && (\n \n

{unavailableMessage}

\n
\n )}\n\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {/* Vendor Units has images now */}\n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n
\n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n \n \n \n\n {/* Mobile */}\n
\n \n \n {/* Room Type Select */}\n \n {/* \n Type:\n */}\n\n {vendorUnits.length > 0 && (\n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n )}\n
\n\n {/* Arrive DatePicker */}\n
\n \n this.to.getInput().focus(),\n }}\n onDayChange={checkInDateChanged}\n />\n \n
\n\n {/* Depart DatePicker */}\n
\n \n \n \n
\n\n {/* Guests / Units / Add */}\n
\n \n {/* Guests */}\n
\n \n Guests:\n \n \n {getNumGuestsOptions()}\n \n
\n {/* Units */}\n 264 ? 0 : \"8px\" }}\n >\n 264 ? \"8px\" : 0,\n }}\n >\n Units:\n \n \n {getNumUnitsOptions()}\n \n
\n \n \n\n {vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n\n {/* Package Price */}\n {!!!unavailableMessage && (\n
\n\n {(selectedProductRate !== null && selectedProductRate.displayVendorPriceOverride) || !vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showLodgingPricing ? (\n
\n

${unitRateAverage.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n\n {\n // const _unitId = getVendorUnitIdFromUnitName(vendor.rates, selectedUnitName);\n // if (_unitId)\n // addClick(vendor.vendorUnits.find(unit => unit.vendorUnitId == _unitId) as VendorUnit);\n // const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId == selectedUnit) as VendorUnit;\n const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit) as VendorUnit;\n // console.log(\"vu\", vu);\n addClick(vu);\n }}\n >\n + {isEditing ? \"Save\" : \"Add\"}\n \n
)}\n\n {unavailableMessage && (\n \n

{unavailableMessage}

\n
\n )}\n\n {/* Navigation / Carousel / Tab Content */}\n
\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {/* Vendor Units has images now */}\n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n \n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default LodgingDetail;","import \"../../WidgetModal.css\";\nimport \"../add-lodging/add-lodging.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { useState, useEffect, SetStateAction, useContext } from \"react\";\nimport { Col, Row, Modal, Spinner } from \"react-bootstrap\";\nimport UseGetLodgingVendors, { GetLodgingVendorsRequest } from \"./data-service-hooks/UseGetLodgingVendors\";\nimport LodgingItem from \"../../../../../../../Data/LodgingItem\";\nimport VendorCard from \"../../VendorCard\";\nimport LodgingDetail from \"../lodging-details/LodgingDetail\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport LodgingItineraryUnit from \"../../../../../../../Data/Reservation/Lodging/LodgingItineraryUnit\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../../../../_helpers/Enums/ViewPortEnum\";\nimport moment from \"moment\";\nimport AddModalSortBy from \"../../AddModalSortBy\";\n\ninterface props {\n show: boolean;\n onHide: () => void;\n brandId: number,\n datesAndGuests: DatesAndGuests;\n onSelectedLodging: (item: LodgingItem, index?: number) => void;\n unitToEditState: [LodgingItineraryUnit | undefined, React.Dispatch>];\n vendorGuid: string | undefined;\n vendorGuidType: string | undefined;\n}\n\nconst AddLodgingModal: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n\n const [simpleView, setSimpleView] = useState(viewPortBreakPoint >= ViewPort.md ? false : true);\n\n const { show, onHide, brandId, onSelectedLodging } = props;\n const [lodgingVendors, setLodgingVendors] = useState();\n const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const unitToEdit = props.unitToEditState ? props.unitToEditState[0] : undefined;\n const setUnitToEdit = props.unitToEditState ? props.unitToEditState[1] : undefined;\n\n const [selectedVendor, setSelectedVendor] = useState();\n const [lodgingFilter, setLodgingFilter] = useState(0);\n const [priceFilter, setPriceFilter] = useState(0);\n const [cityFilter, setCityFilter] = useState(\"\");\n\n const [getLodgingVendorsRequest, setGetLodgingVendorsRequest] = useState();\n const responseGetLodgingVendors = UseGetLodgingVendors(getLodgingVendorsRequest);\n\n const [cityOptions, setCityOptions] = useState([]);\n\n const onSelectedVendor = (vendor: LodgingItem) => {\n // window.parent.postMessage(\"scroll\", \"*\");\n // if (document.documentElement.scrollTop > 0)\n // window.scrollTo({ top: 0, left: 0, behavior: \"smooth\" });\n setSelectedVendor(vendor);\n }\n\n const onSelectedVendorUnit = (item: LodgingItem, index?: number) => {\n if (onSelectedLodging) {\n onSelectedLodging(item, index);\n }\n\n setSelectedVendor(undefined);\n }\n\n const filterLodging = (e: any) => {\n setLodgingFilter(+e.target.value);\n }\n\n const sortByPrice = (e: any) => {\n setPriceFilter(+e.target.value);\n }\n\n const sortByCity = (e: any) => {\n setCityFilter(e.target.value);\n }\n\n useEffect(() => {\n let fromDateString = moment(datesAndGuests.fromDate).format(\"YYYY-MM-DD\");\n let toDateString = moment(datesAndGuests.toDate).format(\"YYYY-MM-DD\");\n setGetLodgingVendorsRequest({ brandId, startDate: fromDateString, endDate: toDateString, vendorGuid: props.vendorGuidType === \"Lodging\" ? props.vendorGuid : undefined });\n }, [setLodgingVendors]);\n\n useEffect(() => {\n if (responseGetLodgingVendors.data) {\n // const responseData: GetLodgingVendorsResponse = responseGetLodgingVendors.data;\n // console.log(\"responseGetLodgingVendors.data\", responseGetLodgingVendors.data);\n const responseData = responseGetLodgingVendors.data;\n\n if (props.vendorGuid !== undefined && responseData.length > 0 && responseData[0].vendorGuid === props.vendorGuid) {\n onSelectedVendor({ ...responseData[0] })\n return;\n }\n\n const fromPrice = Number.MAX_VALUE;\n const vendors = responseData.map((v: any) => {\n let price = fromPrice;\n if (v.rates !== null && v.rates !== undefined && v.rates.length > 0 && v.rates.some((dr: any) => dr.rates.length > 0)) {\n //search for lowest price\n\n for (let dRate = 0; dRate < v.rates.length; dRate++) {\n const dateRate = v.rates[dRate];\n for (let uRate = 0; uRate < dateRate.rates.length; uRate++) {\n const unitRate = dateRate.rates[uRate];\n for (let pRate = 0; pRate < unitRate.rates.length; pRate++) {\n const productRate = unitRate.rates[pRate];\n if (productRate.price < price) {\n price = productRate.price;\n }\n }\n }\n }\n }\n return { ...v, fromPrice: price }\n });\n\n setLodgingVendors(vendors);\n\n const cities: string[] = [];\n for (let index = 0; index < vendors.length; index++) {\n const vendor = vendors[index];\n if (cities.includes(vendor.city)) continue;\n\n cities.push(vendor.city);\n }\n setCityOptions(cities);\n\n if (unitToEdit !== undefined) {\n // set selected vendor\n const vendor: LodgingItem = responseData.find((v: any) => v.vendorId === unitToEdit.vendorId);\n vendor.guests = unitToEdit.guestsInUnit;\n vendor.units = unitToEdit.numberOfUnits;\n vendor.checkIn = moment(unitToEdit.checkIn).toDate();\n vendor.checkOut = moment(unitToEdit.checkOut).toDate();\n vendor.itineraryIndex = unitToEdit.itineraryIndex;\n setSelectedVendor(vendor);\n }\n }\n }, [responseGetLodgingVendors.data]);\n\n return (\n \n \n \n \n \n \n \n \n {responseGetLodgingVendors.isLoading && (\n Loading...\n )}\n {lodgingVendors && (lodgingVendors.length === 0 || lodgingVendors.filter((v: any) => v.showOnCustomerPortal).length === 0) && (\n

No results found

\n )}\n {lodgingVendors && lodgingVendors.filter((v: any) => v.showOnCustomerPortal).length > 0 &&\n lodgingVendors.filter((v: any) => v.showOnCustomerPortal)\n // .filter((v: any) => lodgingFilter === 0 || v.features.filterTags.some((t: any) => t.lodgingVendorTypeId === lodgingFilter))\n .filter((v: any) => lodgingFilter === 0 || ((v.features.filterTags & lodgingFilter) === lodgingFilter))\n .filter((v: any) => cityFilter === \"\" || v.city === cityFilter)\n .sort((a: any, b: any) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n return 0;\n })\n .sort((a: any, b: any) => {\n if (priceFilter === 0) return 0;\n if (a.fromPrice < b.fromPrice) return priceFilter === 10 ? -1 : 1;\n if (a.fromPrice > b.fromPrice) return priceFilter === 10 ? 1 : -1;\n return 0;\n })\n .map((vendor: LodgingItem, index: number) => (\n \n ))}\n \n
\n
\n \n\n {\n setSelectedVendor(undefined);\n if (!!setUnitToEdit) {\n setUnitToEdit(undefined);\n }\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n

{selectedVendor ? selectedVendor.vendorName : undefined}

\n {viewPortBreakPoint >= ViewPort.md && (\n
{selectedVendor ? selectedVendor.streetAddress : undefined} {selectedVendor ? selectedVendor.city : undefined} {selectedVendor ? selectedVendor.state : undefined} {selectedVendor ? selectedVendor.zipCode : undefined}
\n )}\n \n
\n \n {selectedVendor && (\n \n )}\n \n \n\n
\n )\n}\n\nexport default AddLodgingModal","import { useState, useEffect } from \"react\";\nimport useFetch, {\n FetchRequest,\n} from \"../../../../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../../../../_helpers/Constants\";\n\nconst UseGetTransportVendors = (request?: GetTransportVendorsRequest) => {\n \n \n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n \n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/get/transport-vendors/${request.brandId}?startDate=${request.startDate}&endDate=${request.endDate}${(request.vendorId === undefined ? \"\" : `&vendorId=${request.vendorId}`)}${(request.vendorGuid === undefined ? \"\" : `&vendorGuid=${request.vendorGuid}`)}`;\n\n setFetchRequest({\n url: url,\n method: \"GET\",\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n // const response: GetTransportVendorsResponse = fetchResponse.data;\n\n setData(fetchResponse.data);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error);\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return { data, error, isLoading };\n};\n\nexport default UseGetTransportVendors;\n\nexport interface GetTransportVendorsResponse extends FetchResponse {\n vendors: any;\n}\n\nexport interface GetTransportVendorsRequest {\n brandId: number;\n startDate: string;\n endDate: string;\n vendorId?: number;\n vendorGuid?: string;\n}\n","import \"../../lodging/lodging-details/lodging-details.css\";\nimport \"../../VendorDetails.css\";\n\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Form, Row, Col, Tab, Nav, Carousel, Button, Modal } from \"react-bootstrap\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { Modifier } from \"react-day-picker\";\nimport Amenity from \"../../../../../../../Data/Amenity\";\nimport TransportationItem from \"../../../../../../../Data/TransportationItem\";\nimport VendorUnit from \"../../../../../../../Data/VendorUnit\";\nimport VendorUnitImage from \"../../../../../../../Data/VendorUnitImage\";\nimport WidgetStyle from \"../../../../../../../Data/WidgetStyle\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport StartWidget from \"../../../../../../../Data/StartWidget\";\nimport RatesByDate from \"../../../../../../../Data/Rates/DateRate\";\nimport UnitRate from \"../../../../../../../Data/Rates/UnitRate\";\nimport ProductRate from \"../../../../../../../Data/Rates/ProductRate\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport { MobileDayPickerOverlay } from \"../../../../assets/MobileDayPickerOverlay\";\nimport moment from \"moment\";\nimport { getAvailableVendorUnits, getDailyRate, getHourlyRate, getRateTypeFromUnitName, getUnitRate, getVendorUnitIdFromUnitName, populateTimes, getVendorUnitIdsFromSelectedName } from \"../../../../../../../Data/Rates/UnitRateLogic\";\nimport EnumProductRateType from \"../../../../../../../Data/Rates/EnumProductRateType\";\nimport Decimal from \"decimal.js\";\nimport { roundDecimal } from \"../../../../../../../_helpers/Functions\";\nimport CustomDayPickerInput from \"../../../../../customDayPickerInput/CustomDayPickerInput\";\n// import SameDayReplay from \"../../../../../../../Data/SameDayReplay\";\n\ninterface props {\n vendor: TransportationItem;\n datesAndGuests: DatesAndGuests;\n onSelectedVendorUnit?: (item: TransportationItem, index?: number) => void;\n}\n\ninterface GeoProps {\n lat: number;\n lng: number;\n}\n\nconst TransportationDetails: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint, autoScroll } = useContext(WidgetContext);\n\n const { vendor, datesAndGuests, onSelectedVendorUnit } = props;\n const [vendorUnits, setVendorUnits] = useState([]);\n const rates = vendor && vendor.dailyRates ? vendor.dailyRates : [];\n\n const isEditing = vendor.itineraryIndex !== undefined && vendor.itineraryIndex > -1;\n\n // const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const [guests, setGuests] = useState(vendor.guests !== undefined ? vendor.guests : datesAndGuests.guests);\n const [units, setUnits] = useState(vendor.numUnits !== undefined ? vendor.numUnits : datesAndGuests.units);\n const [startDate, setStartDate] = useState(vendor.checkIn !== undefined ? vendor.checkIn : moment(datesAndGuests.fromDate).toDate());\n const [endDate, setEndDate] = useState(vendor.checkOut !== undefined ? vendor.checkOut : moment(datesAndGuests.toDate).toDate());\n const [startTime, setStartTime] = useState(\"90:00\");\n const [endTime, setEndTime] = useState(\"90:00\");\n const [startTimes, setStartTimes] = useState([]);\n const [endTimes, setEndTimes] = useState([]);\n const modifiers = { start: startDate, end: endDate };\n\n const { formatDate, parseDate } = reactMoment;\n\n const [latlang, setLatLang] = useState();\n const [geoLocation, setGeoLocation] = useState(\"\");\n\n // const [currentProductRate, setCurrentProductRate] = useState();\n const maxGuests = datesAndGuests.guests;\n\n const [hourlyRates, setHourlyRates] = useState([]);\n const [isHourlyRate, setIsHourlyRate] = useState(false);\n const [unitRates, setUnitRates] = useState([]);\n const [isUnitRate, setIsUnitRate] = useState(false);\n const [dayRates, setDayRates] = useState([]);\n const [isDailyRate, setIsDailyRate] = useState(false);\n const [unavailableMessage, setUnavailableMessage] = useState();\n\n const [selectedProductRateType, setSelectedProductRateType] = useState(null); //vendorUnit.productRateTypeId\n const [selectedUnit, setSelectedUnit] = useState(null); //vendorUnitId\n const [selectedProductRate, setSelectedProductRate] = useState(null);\n\n const [selectedUnitName, setSelectedUnitName] = useState(null);\n const [vendorUnitIds, setVendorUnitIds] = useState([]);\n\n const [rangePickerMode, setRangePickerMode] = useState(true);\n\n const [unitRateTotal, setUnitRateTotal] = useState(0);\n const [unitRateAverage, setUnitRateAverage] = useState(0);\n\n const [imgErrors, setImgErrors] = useState([]);\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n\n const [index, setIndex] = useState(0);\n\n const handleSelect = (selectedIndex: any, e: any) => {\n setIndex(selectedIndex);\n };\n\n const onGuestsInputChanged = (event: any) => {\n setGuests(+event.target.value);\n }\n\n const onUnitsInputChanged = (event: any) => {\n setUnits(+event.target.value);\n }\n\n const onStartDateChanged = (date: Date) => {\n setStartDate(date);\n if (date > endDate) {\n setEndDate(date);\n }\n }\n\n const startTimeOptions = startTimes.map((time: any, index: number) => (\n \n ));\n\n const endTimeOptions = endTimes.map((time: any, index: number) => (\n \n ));\n\n const onEndDateChanged = (date: Date) => {\n setEndDate(date);\n }\n\n function getNumGuestsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < maxGuests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function getNumUnitsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < guests; index++) {\n options.push();\n }\n\n return options;\n }\n\n function addClick(unit: VendorUnit) {\n unit.vendorId = vendor.vendorId;\n\n unit.sell = unitRateTotal;\n\n vendor.selectedUnit = unit;\n vendor.checkIn = moment(startDate).toDate();\n vendor.checkOut = isDailyRate ? moment(endDate).toDate() : moment(startDate).toDate();\n vendor.fromTime = startTime;\n vendor.toTime = endTime;\n vendor.guests = guests;\n vendor.numUnits = units;\n\n if (onSelectedVendorUnit)\n onSelectedVendorUnit(vendor, vendor.itineraryIndex);\n }\n\n const unitOptions = vendorUnits.filter(u => u.published).map((unit: VendorUnit, index: number) => (\n \n ));\n\n useEffect(() => {\n // map\n fetch(\n `https://maps.googleapis.com/maps/api/geocode/json?address=${vendor.streetAddress},+${vendor.city},+${vendor.state}&key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU`\n ).then((response) => {\n return response.json();\n }).then((response) => {\n setLatLang({ lat: response.results[0].geometry.location.lat, lng: response.results[0].geometry.location.lng });\n });\n }, []);\n\n useEffect(() => {\n if (latlang) {\n\n let geolocationString = `https://www.google.com/maps/embed/v1/view?key=AIzaSyAJ1DlLWQ9UpZ_46ufaWXdTzb6epSr87sU\n ¢er=${latlang.lat},${latlang.lng}\n &zoom=15\n &maptype=roadmap`;\n\n setGeoLocation(geolocationString);\n }\n }, [latlang]);\n\n useEffect(() => {\n if (vendor === undefined) return;\n\n let result = populateTimes();\n setStartTimes(result);\n setEndTimes(result);\n\n let _vendorUnits = getAvailableVendorUnits(props.vendor.vendorUnits, rates, moment(startDate).format(\"MM/DD/YYYY\"), moment(endDate).format(\"MM/DD/YYYY\"));\n _vendorUnits.sort((a, b) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n\n if (a.unitName.toLowerCase() < b.unitName.toLowerCase()) return -1;\n if (a.unitName.toLowerCase() > b.unitName.toLowerCase()) return 1;\n\n return 0;\n });\n setVendorUnits(_vendorUnits);\n\n if (_vendorUnits.findIndex(a => a.uniqueIdForSelection == selectedUnitName) < 0) {\n if (_vendorUnits.length > 0) {\n setSelectedUnitName(_vendorUnits[0].uniqueIdForSelection);\n }\n }\n\n setUnavailableMessage('');\n\n setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, moment(startDate).format(\"MM/DD/YYYY\"), moment(endDate).format(\"MM/DD/YYYY\")));\n\n }, [vendor, startDate, endDate]);\n\n useEffect(() => {\n setIsDailyRate(false);\n setIsHourlyRate(false);\n setIsUnitRate(false);\n\n if (selectedProductRateType == EnumProductRateType.DayRange) {\n setIsDailyRate(true);\n //multiple days\n setRangePickerMode(true);\n // setEndDate(props.maxDate);\n\n setStartTime(\"09:00\");\n setEndTime(\"09:00\");\n }\n else if (selectedProductRateType == EnumProductRateType.HoursPerUnit) {\n setIsHourlyRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n setStartTime(\"09:00\");\n setEndTime(\"10:00\");\n\n }\n else if (selectedProductRateType == EnumProductRateType.UnitQtyRange) {\n setIsUnitRate(true);\n //single day\n setRangePickerMode(false);\n // setEndDate(null);\n\n setStartTime(\"09:00\");\n }\n }, [selectedProductRateType]);\n\n useEffect(() => {\n if (!selectedUnitName) {\n return;\n }\n\n const rateType = getRateTypeFromUnitName(vendor.dailyRates, selectedUnitName);\n\n setSelectedProductRateType(rateType);\n setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, moment(startDate).format(\"MM/DD/YYYY\"), moment(endDate).format(\"MM/DD/YYYY\")));\n }, [selectedUnitName]);\n\n useEffect(() => {\n setIndex(0);\n }, [vendorUnitIds]);\n\n useEffect(() => {\n if (!isDailyRate) {\n return;\n }\n\n const { productRates, noRateMessage } = getDailyRate(vendor.dailyRates, selectedUnitName, startDate.toDateString(), endDate.toDateString(), startTime, endTime);\n setSelectedProductRate(productRates !== undefined && productRates.length > 0 ? (productRates[0] !== undefined ? productRates[0] : null) : null);\n\n if (!!noRateMessage) {\n setUnavailableMessage(noRateMessage);\n return;\n }\n\n const rate = productRates.reduce((a, b) => a.add(new Decimal(b ? b.price : 0)), new Decimal(0));\n setUnitRateTotal(roundDecimal(rate.times(units)).toNumber());\n setUnitRateAverage(roundDecimal(rate.dividedBy(productRates.length === 0 ? 1 : productRates.length)).toNumber());\n\n setUnavailableMessage(undefined);\n }, [isDailyRate, dayRates, units, startTime, endTime, startDate, endDate, selectedUnitName]);\n\n useEffect(() => {\n if (!(isHourlyRate && startTime && endTime)) {\n return;\n }\n\n var numberOfHours: number = moment.duration(moment(endTime, 'HH:mm').diff(moment(startTime, 'HH:mm'))).asHours();\n\n if (numberOfHours < 0) {\n //only 0-24 hours\n numberOfHours = moment.duration(moment(endTime, 'HH:mm').add(1, \"day\").diff(moment(startTime, 'HH:mm'))).asHours();\n }\n\n let hourlyRate = getHourlyRate(vendor.dailyRates, selectedUnitName, startTime, endTime);\n setSelectedProductRate(hourlyRate === undefined ? null : hourlyRate);\n\n if (!hourlyRate) {\n setUnavailableMessage(`No rates available for ${numberOfHours} hours.`);\n setUnitRateTotal(0);\n return;\n }\n // console.log(\"productRates.length\", productRates.length);\n\n const rate = (new Decimal(hourlyRate.price).times(numberOfHours));\n // setCurrentProductRate(hourlyRate);\n setUnitRateTotal(roundDecimal(rate.times(units)).toNumber());\n setUnitRateAverage(roundDecimal(rate.dividedBy(numberOfHours === 0 ? 1 : numberOfHours)).toNumber());\n setUnavailableMessage(undefined);\n setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, moment(startDate).format(\"MM/DD/YYYY\"), moment(endDate).format(\"MM/DD/YYYY\")));\n }, [isHourlyRate, hourlyRates, startTime, endTime, units, selectedUnit, startDate, selectedUnitName]);\n\n useEffect(() => {\n if (!(isUnitRate)) {\n return;\n }\n\n let unitRate = getUnitRate(vendor.dailyRates, selectedUnitName, units);\n setSelectedProductRate(unitRate === undefined ? null : unitRate);\n\n if (!unitRate) {\n setUnavailableMessage(`No rates available for ${units} units.`)\n setUnitRateTotal(0);\n return;\n }\n\n const rate = new Decimal(unitRate.price).times(units);\n setUnitRateTotal(roundDecimal(rate).toNumber());\n setUnavailableMessage(undefined);\n setVendorUnitIds(getVendorUnitIdsFromSelectedName(rates, selectedUnitName, moment(startDate).format(\"MM/DD/YYYY\"), moment(endDate).format(\"MM/DD/YYYY\")));\n\n }, [isUnitRate, unitRates, units, startDate, startTime, selectedUnitName]);\n\n useEffect(() => {\n setIndex(0);\n }, [vendorUnitIds]);\n\n useEffect(() => {\n //if (autoScroll) {\n //window.parent.postMessage(\"scroll\", \"*\");\n //if (document.documentElement.scrollTop > 0)\n //window.scrollTo({ top: 0, left: 0, behavior: \"smooth\" });\n //}\n }, []);\n\n const inputStyle = `\n .inline-style .DayPickerInput>input {\n padding-left: 15px;\n}`;\n\n const navLinkStyles = `\n .nav-pills .nav-link.active {\n background-color: rgb(247, 247, 247);\n color: ${style.buttonColor} !important;\n}`;\n\n return (\n \n \n \n\n {/* Desktop */}\n
\n {/* Dates */}\n \n \n \n \n \n \n Start Date\n \n \n \n {rangePickerMode && (\n \n \n End Date\n \n \n \n )}\n \n\n \n {vendorUnits.length > 0 && (\n
\n \n Unit Type\n \n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n
\n )}\n
\n\n \n
\n \n Guests\n \n \n {getNumGuestsOptions()}\n \n
\n
\n \n Units\n \n \n {getNumUnitsOptions()}\n \n
\n
\n \n Start Time\n \n {\n setStartTime(event.currentTarget.value);\n // setEndTime(null);\n }}\n >\n {startTimeOptions}\n \n
\n {(isHourlyRate || isDailyRate) && (\n
\n \n End Time\n \n {\n setEndTime(event.currentTarget.value)\n }}\n >\n {endTimeOptions}\n \n
\n )}\n
\n \n\n \n {!!!unavailableMessage && (<>\n {(selectedProductRate !== null && selectedProductRate.displayVendorPriceOverride) || !vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showTransportationPricing ? (\n
\n

${unitRateAverage.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n
\n {\n const _unitId = getVendorUnitIdFromUnitName(vendor.dailyRates, selectedUnitName);\n if (_unitId)\n addClick(vendor.vendorUnits.find(unit => unit.vendorUnitId == _unitId) as VendorUnit);\n // const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId == selectedUnit) as VendorUnit;\n // addClick(vu);\n }}\n >\n Add\n \n
\n )}\n \n
\n\n {vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n\n {unavailableMessage !== undefined && (\n \n

{unavailableMessage}

\n
\n )}\n
\n\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {/* Vendor Units has images now */}\n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n
\n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n \n \n \n\n {/* Mobile */}\n
\n \n \n {/* Room Type Select */}\n \n {vendorUnits.length > 0 && (\n {\n setSelectedUnitName(event.currentTarget.value)\n }} >\n \n {unitOptions}\n \n )}\n
\n\n {/* Arrive DatePicker */}\n
\n \n \n \n
\n\n {rangePickerMode && (\n <>\n {/* Depart DatePicker */}\n < div className=\"mobile InputFromTo\" style={{ marginRight: \"0px\" }}>\n \n \n \n \n \n )}\n\n
\n
\n \n From:\n \n {\n setStartTime(event.currentTarget.value);\n // setEndTime(null);\n }}\n >\n {startTimeOptions}\n \n
\n\n {(isHourlyRate || isDailyRate) && (\n
\n \n To:\n \n {\n setEndTime(event.currentTarget.value);\n }}\n >\n {endTimeOptions}\n \n
\n )}\n
\n\n {/* Guests / units add button */}\n
\n {/* Guests */}\n
\n \n Guests:\n \n \n {getNumGuestsOptions()}\n \n
\n\n
\n \n Units:\n \n \n {getNumUnitsOptions()}\n \n
\n
\n\n {vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription && (\n \n

{vendor.vendorUnits.find(unit => unit.vendorUnitId === selectedUnit)?.unitDescription}

\n
\n )}\n\n {/* Package Price */}\n {!!!unavailableMessage && (\n
\n\n {(selectedProductRate !== null && selectedProductRate.displayVendorPriceOverride) || !vendor.rateDisplayOptions.showPkgPriceOnly && startWidget.showTransportationPricing ? (\n
\n

${unitRateAverage.toFixed(2)}

\n
\n ) : (<>\n
\n

Package Price

\n
\n )}\n\n {\n const _unitId = getVendorUnitIdFromUnitName(vendor.dailyRates, selectedUnitName);\n if (_unitId)\n addClick(vendor.vendorUnits.find(unit => unit.vendorUnitId == _unitId) as VendorUnit);\n // const vu = vendor.vendorUnits.find(unit => unit.vendorUnitId == selectedUnit) as VendorUnit;\n // addClick(vu);\n }}\n >\n + {isEditing ? \"Save\" : \"Add\"}\n \n
)}\n\n {unavailableMessage && (\n \n

{unavailableMessage}

\n
\n )}\n\n {/* Navigation / Carousel / Tab Content */}\n
\n \n \n \n \n \n \n \n {/* Photos */}\n \n \n {/* Vendor Units has images now */}\n {vendor.vendorUnits && vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) &&\n vendor.vendorUnits.filter(u => u.vendorUnitId === selectedUnit).map((unit: VendorUnit) => {\n return unit.vendorUnitImages.map((image: VendorUnitImage, index: number) => {\n return (\n \n \n

{image.description}

\n
\n \n )\n })\n })\n }\n\n {vendor.vendorUnits && !vendor.vendorUnits.some(u => u.vendorUnitId === selectedUnit && u.vendorUnitImages.length > 0) && (\n 0 ? vendor.description.vendorDescriptionImages[0].vendorImageUrl as string : \"\"}\n alt={\"\"}\n />\n )}\n
\n
\n \n

{vendor.description ? vendor.description.description : \"\"}

\n \n \n {vendor.amenities.map((item: Amenity) => (\n

\n {item.amenityName}\n

\n ))}\n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n
\n );\n}\n\nexport default TransportationDetails;","\nimport \"../../WidgetModal.css\";\nimport \"../../lodging/add-lodging/add-lodging.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { useState, useEffect, SetStateAction, useContext } from \"react\";\nimport { Col, Row, Form, Modal, Spinner } from \"react-bootstrap\";\nimport reactMoment from \"react-day-picker/moment\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport UseGetTransportVendors, { GetTransportVendorsRequest, GetTransportVendorsResponse } from \"./data-service-hooks/UseGetTransportVendors\";\nimport TransportationItem from \"../../../../../../../Data/TransportationItem\";\nimport TransportationDetails from \"../transportation-details/TransportationDetails\";\nimport VendorCard from \"../../VendorCard\";\nimport { Modifier } from \"react-day-picker\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport TransportItineraryUnit from \"../../../../../../../Data/Reservation/Transportation/TransportItineraryUnit\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport moment from \"moment\";\nimport ViewPort from \"../../../../../../../_helpers/Enums/ViewPortEnum\";\nimport AddModalSortBy from \"../../AddModalSortBy\";\n\ninterface props {\n show: boolean,\n onHide: () => void;\n brandId: number,\n datesAndGuests: DatesAndGuests;\n onSelectedTransportation?: (item: TransportationItem, index?: number) => void;\n unitToEditState?: [TransportItineraryUnit | undefined, React.Dispatch>];\n vendorGuid: string | undefined;\n vendorGuidType: string | undefined;\n}\n\nconst AddTransportationModal: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n const [simpleView, setSimpleView] = useState(viewPortBreakPoint >= ViewPort.md ? false : true);\n\n const { show, onHide, brandId, onSelectedTransportation } = props;\n const [datesAndGuests, setDatesAndGuests] = useState(props.datesAndGuests);\n const unitToEdit = props.unitToEditState ? props.unitToEditState[0] : undefined;\n const setUnitToEdit = props.unitToEditState ? props.unitToEditState[1] : undefined;\n const [transportVendors, setTransportVendors] = useState();\n // const [selectedVendor, setSelectedVendor] = useState(unitToEdit ? unitToEdit.vendor : undefined);\n const [selectedVendor, setSelectedVendor] = useState();\n // const { formatDate, parseDate } = reactMoment;\n // const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n\n const [priceFilter, setPriceFilter] = useState(0);\n const [cityFilter, setCityFilter] = useState(\"\");\n\n const [getTransportVendorsRequest, setGetTransportVendorsRequest] = useState();\n const getTransportVendorsResponse = UseGetTransportVendors(getTransportVendorsRequest);\n\n const [cityOptions, setCityOptions] = useState([]);\n\n const onSelectedVendor = (vendor: TransportationItem) => {\n setSelectedVendor(vendor);\n }\n\n const onSelectedVendorUnit = (item: TransportationItem, index?: number) => {\n if (onSelectedTransportation) {\n onSelectedTransportation(item, index);\n }\n\n setSelectedVendor(undefined);\n }\n\n const sortByPrice = (e: any) => {\n setPriceFilter(+e.target.value);\n }\n\n const sortByCity = (e: any) => {\n setCityFilter(e.target.value);\n }\n\n useEffect(() => {\n let fromDateString = moment(datesAndGuests.fromDate).format(\"YYYY-MM-DD\");\n let toDateString = moment(datesAndGuests.toDate).format(\"YYYY-MM-DD\");\n setGetTransportVendorsRequest({\n brandId,\n startDate: fromDateString,\n endDate: toDateString,\n vendorGuid: props.vendorGuidType === \"Transport\" ? props.vendorGuid : undefined \n });\n }, [setTransportVendors]);\n\n useEffect(() => {\n if (getTransportVendorsResponse.data) {\n // let responseData: GetTransportVendorsResponse = getTransportVendorsResponse.data;\n const responseData = getTransportVendorsResponse.data;\n\n if (props.vendorGuid !== undefined && responseData.length > 0 && responseData[0].vendorGuid === props.vendorGuid) {\n onSelectedVendor({ ...responseData[0] })\n return;\n }\n \n const fromPrice = Number.MAX_VALUE;\n const vendors = responseData.map((v: any) => {\n let price = fromPrice;\n if (v.rates !== null && v.rates !== undefined && v.rates.length > 0 && v.rates.some((dr: any) => dr.rates.length > 0)) {\n //search for lowest price\n\n for (let dRate = 0; dRate < v.rates.length; dRate++) {\n const dateRate = v.rates[dRate];\n for (let uRate = 0; uRate < dateRate.rates.length; uRate++) {\n const unitRate = dateRate.rates[uRate];\n for (let pRate = 0; pRate < unitRate.rates.length; pRate++) {\n const productRate = unitRate.rates[pRate];\n if (productRate.price < price) {\n price = productRate.price;\n }\n }\n }\n }\n }\n return { ...v, fromPrice: price }\n });\n\n setTransportVendors(vendors);\n\n const cities: string[] = [];\n for (let index = 0; index < vendors.length; index++) {\n const vendor = vendors[index];\n if (cities.includes(vendor.city)) continue;\n\n cities.push(vendor.city);\n }\n setCityOptions(cities);\n\n if (unitToEdit !== undefined) {\n const vendor: TransportationItem = responseData.find((v: any) => v.vendorId === unitToEdit.vendorId);\n vendor.guests = unitToEdit.inUnit;\n vendor.numUnits = unitToEdit.units;\n vendor.checkIn = moment(unitToEdit.startDate).toDate();\n vendor.checkOut = moment(unitToEdit.endDate).toDate();\n vendor.fromTime = unitToEdit.startTime;\n vendor.toTime = unitToEdit.endTime;\n vendor.itineraryIndex = unitToEdit.itineraryIndex;\n setSelectedVendor(vendor);\n }\n }\n }, [getTransportVendorsResponse.data]);\n\n return (\n \n \n \n \n \n \n {/* Desktop */}\n {/* Transportation Cards */}\n \n \n {getTransportVendorsResponse.isLoading && (\n Loading...\n )}\n {transportVendors && (transportVendors.length == 0 || transportVendors.filter((v: any) => v.showOnCustomerPortal).length === 0) && (\n

No results found

\n )}\n {transportVendors && transportVendors.filter((v: any) => v.showOnCustomerPortal).length > 0 &&\n transportVendors.filter((v: any) => v.showOnCustomerPortal)\n .filter((v: any) => cityFilter === \"\" || v.city === cityFilter)\n .sort((a: any, b: any) => {\n if (a.sortOrder < b.sortOrder) return -1;\n if (a.sortOrder > b.sortOrder) return 1;\n return 0;\n })\n .sort((a: any, b: any) => {\n if (priceFilter === 0) return 0;\n if (a.fromPrice < b.fromPrice) return priceFilter === 10 ? -1 : 1;\n if (a.fromPrice > b.fromPrice) return priceFilter === 10 ? 1 : -1;\n return 0;\n })\n .map((vendor: TransportationItem, index: number) => (\n \n ))}\n \n
\n
\n \n\n {\n setSelectedVendor(undefined);\n if (!!setUnitToEdit) {\n setUnitToEdit(undefined);\n }\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow mobile-full-width\"\n >\n \n \n

{selectedVendor ? selectedVendor.vendorName : undefined}

\n {viewPortBreakPoint >= ViewPort.md && (\n
{selectedVendor ? selectedVendor.streetAddress : undefined} {selectedVendor ? selectedVendor.city : undefined} {selectedVendor ? selectedVendor.state : undefined} {selectedVendor ? selectedVendor.zipCode : undefined}
\n )}\n \n
\n \n {selectedVendor && (\n \n )}\n \n \n
\n );\n}\n\nexport default AddTransportationModal","import * as yup from \"yup\";\n\nconst {\n setLocale\n} = yup\n\nsetLocale({\n mixed: {\n // notType: 'the ${path} is obligatory',\n required: 'at least one field is required',\n // oneOf: 'the field ${path} must have one of the following values: ${values}'\n }\n});\n\n// Yup schema for field validations\nexport const FindReservationSchema = yup.object().shape({\n email: yup.string().ensure().when('itineraryNumber', {\n is: '',\n then: yup.string().required()\n }),\n itineraryNumber: yup.string().ensure().when('email', {\n is: '',\n then: yup.string().required()\n }),\n}, [[\"email\", \"itineraryNumber\"]]);\n\nexport type FindReservationFormData = yup.InferType;\n\nexport const FindReservationSchemaDefaultValues: FindReservationFormData = {\n email: \"\",\n itineraryNumber: \"\",\n};\n","import { yupResolver } from \"@hookform/resolvers\";\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Button, Form, Modal } from \"react-bootstrap\";\nimport { useForm } from \"react-hook-form\";\nimport { WidgetContext } from \"../../../../../context/WidgetContext\";\nimport { FindReservationFormData, FindReservationSchema, FindReservationSchemaDefaultValues } from \"./schemas/FindReservationSchema\";\n\ninterface props {\n show: boolean;\n onHide: () => void;\n handleSearchRequest: (email: string, itineraryNumber: string) => void;\n}\n\nconst FindReservation: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n const { show, onHide, handleSearchRequest } = props;\n\n const { register, handleSubmit, errors, formState, setValue, reset, getValues } = useForm({\n mode: \"onSubmit\",\n resolver: yupResolver(FindReservationSchema),\n defaultValues: FindReservationSchemaDefaultValues\n });\n\n const submit = (formData: FindReservationFormData) => {\n handleSearchRequest(formData.email, formData.itineraryNumber);\n }\n\n return (\n \n \n \n
\n Find Reservation\n
\n
\n \n
\n \n \n Please Enter the Itinerary Number or Email Address below to find a previously saved\n Quote or Itinerary\n

\n
\n \n \n {/* Itinerary # */}\n \n\n \n {errors.itineraryNumber && errors.itineraryNumber.message}\n \n \n \n {/* Email Address */}\n \n\n \n {errors.email && errors.email.message}\n \n \n \n \n \n Find Itinerary\n \n \n \n
\n \n
\n );\n}\n\nexport default FindReservation;\n","import { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../../../../_helpers/Constants\";\nimport { PreBuiltPkg } from \"../../Models/PreBuiltPkg\";\n\nconst UseGetPreBuiltPackages = (request?: GetPackagesRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n \n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/pre-built-packages/get/${request.brandId}?startDate=${request.startDate}&endDate=${request.endDate}`;\n\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetPackagesResponse = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default UseGetPreBuiltPackages;\n\nexport interface GetPackagesResponse extends FetchResponse {\n packages: PreBuiltPkg[];\n}\n\nexport interface GetPackagesRequest {\n brandId: number;\n startDate: string;\n endDate: string;\n}","import React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Image, Button, Modal } from \"react-bootstrap\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../../../../_helpers/Enums/ViewPortEnum\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\n\ninterface props {\n pbPackage: any;\n priceSubText?: string;\n onSelectedPackage: (vendor: any) => void;\n stacked: boolean;\n}\n\nconst PackagesCard: React.FC = (props) => {\n const { viewPortBreakPoint, style } = useContext(WidgetContext);\n\n const { pbPackage, onSelectedPackage, priceSubText } = props;\n const [errorsImg, setErrorsImg] = useState();\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const [fromPrice, setFromPrice] = useState(Number.MAX_VALUE);\n\n // return (
);\n\n return (\n \n {/* Desktop */}\n {/* viewPortBreakPoint >= ViewPort.lg && */!props.stacked && (\n \n \n \n \n
\n {/* \n Card Text\n

*/}\n setErrorsImg(placeholderImgUrl)}\n fluid\n />\n
\n \n\n \n
\n {pbPackage.packageName} - From ${pbPackage.fromPrice}\n
\n\n {/* Feature text */}\n
\n
\n \n {pbPackage.bullet1}\n
\n\n
\n \n {pbPackage.bullet2}\n
\n\n
\n \n {pbPackage.bullet3}\n
\n\n
\n\n {/* from price */}\n {/*
\n {fromPrice < Number.MAX_VALUE && (\n <>\n \n From:{\" \"}\n \n ${fromPrice.toFixed(2)}\n \n

\n \n )}\n {fromPrice == Number.MAX_VALUE && (\n

No Rates Available

\n )}\n
*/}\n\n {/* {fromPrice < Number.MAX_VALUE && (\n )} */}\n onSelectedPackage(pbPackage)}\n >\n View Details\n \n \n
\n \n
\n )}\n\n {/* viewPortBreakPoint >= ViewPort.lg && */props.stacked && (\n \n \n \n

\n {pbPackage.packageName} - From ${pbPackage.fromPrice}\n {/* 2 Rounds - 2 Nights - From $299 */}\n

\n\n {/* Feature text */}\n
\n
\n -{pbPackage.bullet1}\n
\n\n
\n -{pbPackage.bullet2}\n
\n\n
\n -{pbPackage.bullet3}\n
\n
\n \n
\n\n \n \n
\n {/* \n Card Text\n

*/}\n setErrorsImg(placeholderImgUrl)}\n style={{height: \"150px\", width: \"100%\"}}\n />\n
\n \n
\n\n \n onSelectedPackage(pbPackage)}\n >\n View Details\n \n \n \n )}\n\n {/* Mobile */}\n {/* {viewPortBreakPoint < ViewPort.lg && (\n \n {false && (\n \n
\n \n Card Text\n

\n setErrorsImg(placeholderImgUrl)}\n fluid\n />\n
\n \n )}\n\n \n
\n
\n {pbPackage.packageName}\n
\n

Awesome place to be!

\n
\n\n
\n {fromPrice < Number.MAX_VALUE && (\n <>\n \n From:{\" \"}\n \n ${fromPrice.toFixed(2)}\n \n

\n \n )}\n {fromPrice == Number.MAX_VALUE && (\n

No Rates Available

\n )}\n
\n\n {fromPrice < Number.MAX_VALUE && (\n
\n onSelectedPackage(pbPackage)}\n >\n View\n \n
\n )}\n \n
\n )} */}\n
\n );\n}\n\nexport default PackagesCard;","import \"./VendorCard.css\";\n\nimport React, { useContext, useEffect, useState } from \"react\";\nimport { Col, Row, Image, Button, Modal } from \"react-bootstrap\";\nimport { WidgetContext } from \"../../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../../_helpers/Enums/ViewPortEnum\";\nimport { isStringEmpty } from \"../../../../../_helpers/Functions\";\n\ninterface props {\n vendor: any;\n}\n\nconst VendorCard: React.FC = (props) => {\n const { viewPortBreakPoint, style, /* brandId */brand, brandSettings } = useContext(WidgetContext);\n const brandSetting = brandSettings.find((s: any) => s.brandId === brand?.brandId);\n\n const { vendor } = props;\n\n const [errorsImg, setErrorsImg] = useState();\n\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const vendorImageUrl = errorsImg ? errorsImg : (vendor.description ?\n (vendor.description.vendorDescriptionImages.length > 0 ?\n ((vendor.description.vendorDescriptionImages[0].vendorImageUrl != undefined && vendor.description.vendorDescriptionImages[0].vendorImageUrl.length > 0) ? vendor.description.vendorDescriptionImages[0].vendorImageUrl\n : placeholderImgUrl)\n : placeholderImgUrl)\n : placeholderImgUrl);\n\n useEffect(() => {\n console.log(\"vendor\", vendor);\n }, [vendor]);\n\n return (\n \n\n {/* Desktop Simple View */}\n {viewPortBreakPoint >= ViewPort.lg && (\n \n \n\n \n \n
\n setErrorsImg(placeholderImgUrl)}\n fluid\n />\n
\n \n\n \n
\n

\n {vendor.vendorName}\n

\n
\n
\n {vendor.vendorUnits.map((u: any, index: number) => (\n <>\n

{u.unitName}

\n {!isStringEmpty(u.unitDescription) && (\n

{u.unitDescription}

\n )}\n\n {index < vendor.vendorUnits.length - 1 && (\n
\n )}\n \n ))}\n
\n \n
\n\n \n
\n )}\n\n {/* Mobile Simple View */}\n {viewPortBreakPoint < ViewPort.lg && (\n \n \n
\n
\n {vendor.vendorName}\n
\n {/*

Awesome place to be!

*/}\n
\n \n
\n )}\n
\n );\n}\n\nexport default VendorCard;","// \"https://azusc-pkgloop-admin-web-dev.azurewebsites.net/api/v1.0/customer-portal/pre-built-packages/get/1\"\nimport \"../../WidgetModal.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { useEffect, useContext, useState } from \"react\";\nimport { Col, Row, Spinner, Button } from \"react-bootstrap\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport UseGetLodgingVendors, { GetLodgingVendorsRequest, GetLodgingVendorsResponse } from \"../../lodging/add-lodging/data-service-hooks/UseGetLodgingVendors\";\nimport UseGetCustomVendors, { GetCustomVendorsRequest, GetCustomVendorsResponse } from \"../../custom/add-custom/data-service-hooks/UseGetCustomVendors\";\nimport UseGetGolfVendors, { GetGolfVendorsRequest, GetGolfVendorsResponse } from \"../../golf/add-golf/data-service-hooks/UseGetGolfVendors\";\nimport UseGetTransportVendors, { GetTransportVendorsRequest, GetTransportVendorsResponse } from \"../../transportation/add-transportation/data-service-hooks/UseGetTransportVendors\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport PackageVendorCard from \"../../../widget-modals/PackageVendorCard\";\nimport { PreBuiltPkg } from \"../Models/PreBuiltPkg\";\n\ninterface props {\n pbPackage: PreBuiltPkg;\n datesAndGuests: DatesAndGuests;\n onSelectedPackage: (item: any) => void;\n}\n\nconst PackageDetails: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n\n const { pbPackage, onSelectedPackage } = props;\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n\n useEffect(() => {\n console.log(\"props.pbPackage\", props.pbPackage);\n }, [props.pbPackage]);\n\n return (\n \n \n \n {/* Lodging Tab */}\n {pbPackage.preBuiltPkgVendors && pbPackage.preBuiltPkgVendors.some((pv: any) => pv.vendor.vendorType === \"Lodging\") && (\n
\n \n Lodging\n \n\n \n\n \n {pbPackage.preBuiltPkgVendors.filter((pv: any) => pv.vendor !== undefined && pv.vendor.vendorType === \"Lodging\").map(pv =>\n \n )}\n \n
\n )}\n \n {/* Golf Tab */}\n {pbPackage.preBuiltPkgVendors && pbPackage.preBuiltPkgVendors.some((pv: any) => pv.vendor.vendorType === \"Golf\") && (\n
\n \n Golf\n \n\n \n\n \n {pbPackage.preBuiltPkgVendors.filter((pv: any) => pv.vendor !== undefined && pv.vendor.vendorType === \"Golf\").map(pv =>\n \n )}\n \n
\n )}\n\n {true && (\n \n )}\n \n
\n
\n )\n}\n\nexport default PackageDetails;","// \"https://azusc-pkgloop-admin-web-dev.azurewebsites.net/api/v1.0/customer-portal/pre-built-packages/get/1\"\nimport \"../../WidgetModal.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { useState, useEffect, SetStateAction, useContext } from \"react\";\nimport { Col, Row, Form, Modal, Spinner } from \"react-bootstrap\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\n// import { Modifier } from \"react-day-picker/types/common\";\nimport VendorCard from \"../../VendorCard\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../../../../_helpers/Enums/ViewPortEnum\";\nimport UseGetPackages, { GetPackagesRequest, GetPackagesResponse } from \"./data-service-hooks/UseGetPreBuiltPackages\";\nimport PackagesCard from \"../packages-card/PackagesCard\";\nimport PackageDetails from \"../package-details/PackageDetails\";\nimport { PreBuiltPkg } from \"../Models/PreBuiltPkg\";\nimport CustomDayPickerInput from \"../../../../../customDayPickerInput/CustomDayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport moment from \"moment\";\nimport { Modifier } from \"react-day-picker\";\n\ninterface props {\n show: boolean,\n onHide: () => void;\n brandId: number,\n datesAndGuestsState: [DatesAndGuests, React.Dispatch>];\n // datesAndGuests: DatesAndGuests;\n onSelectedPackage: (pkg: PreBuiltPkg) => void;\n}\n\nconst AddPreBuiltPackageModal: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n const { show, onHide, brandId, onSelectedPackage } = props;\n const [packages, setPackages] = useState();\n const [datesAndGuests, setDatesAndGuests] = props.datesAndGuestsState;\n const [selectedPackage, setSelectedPackage] = useState();\n // const { formatDate, parseDate } = moment;\n // const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n\n const [getPackagesRequest, setGetPackagesRequest] = useState();\n const responseGetPackages = UseGetPackages(getPackagesRequest);\n const { formatDate, parseDate } = reactMoment;\n const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n\n // const onSelectedPackage = (pkg: any) => {\n // setSelectedPackage(pkg);\n // }\n\n useEffect(() => {\n if (brandId === undefined || brandId === -1 || brandId === null) return;\n setPackages(undefined);\n\n let fromDateString = datesAndGuests.fromDate ? datesAndGuests.fromDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n fromDateString = fromDateString.replace(\"/\", \"-\");\n let toDateString = datesAndGuests.toDate ? datesAndGuests.toDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n toDateString = toDateString.replace(\"/\", \"-\");\n setGetPackagesRequest({ brandId, startDate: fromDateString, endDate: toDateString });\n }, [brandId, datesAndGuests]);\n\n useEffect(() => {\n if (responseGetPackages.data) {\n let responseData: GetPackagesResponse = responseGetPackages.data;\n setPackages(responseData.packages.sort((a: any, b: any) => {\n if (a.displayOrder < b.displayOrder) return -1;\n if (a.displayOrder > b.displayOrder) return 1;\n\n return 0;\n }));\n }\n }, [responseGetPackages.data]);\n\n return (\n \n \n \n
\n Package Specials\n {/* \n

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n

-

\n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n
*/}\n {/* DAY PICKERS */}\n \n
\n \n \n Arrive\n {/* {errors.length > 0 && errors.find(e => e.id == \"fromDate\") && (\n {errors.find(e => e.id == \"fromDate\").message}\n )} */}\n \n {\n datesAndGuests.fromDate = date;\n if (datesAndGuests.toDate && date > datesAndGuests.toDate) {\n datesAndGuests.toDate = date;\n }\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n
\n\n
\n \n \n Depart\n {/* {errors.length > 0 && errors.find(e => e.id == \"toDate\") && (\n {errors.find(e => e.id == \"toDate\").message}\n )} */}\n \n\n {\n datesAndGuests.toDate = date;\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n
\n
\n
\n\n
\n \n \n \n {responseGetPackages.isLoading && (\n Loading...\n )}\n {packages && packages.length == 0 && (\n

No results found

\n )}\n {packages && packages.map((pkg: any, index: number) => (\n setSelectedPackage(pkg)}\n stacked={false}\n />\n ))}\n \n
\n
\n \n\n {\n setSelectedPackage(undefined);\n }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow\"\n >\n \n
\n {selectedPackage ? selectedPackage.packageName : \"undefined\"}\n \n

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n

-

\n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

\n
\n
\n

{selectedPackage ? selectedPackage.description : \"Description\"}

\n

From ${selectedPackage ? selectedPackage.fromPrice : \"\"}

\n
\n
\n
\n \n {selectedPackage && (\n {\n onHide();\n onSelectedPackage(pkg);\n }}\n />\n )}\n \n \n\n
\n )\n}\n\nexport default AddPreBuiltPackageModal\n","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport Reservation from \"../../../../../Data/Reservation/Reservation\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\nimport Quote from \"../../../../../Data/Quote/Quote\";\n\nconst useSearchQuote = (request?: SearchQuoteRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest); // Fetch Data Custom Hook\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/search?email=${request.email}&itineraryNumber=${request.itineraryNumber}`;\n\n setFetchRequest({\n url: url,\n method: 'GET',\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: any = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useSearchQuote;\n\nexport interface SearchQuoteRequest {\n email: string,\n itineraryNumber: string;\n}\n\nexport interface SearchQuoteResponse extends FetchResponse {\n reservation: Reservation;\n quote: Quote;\n}","\nimport { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../_helpers/Types\";\nimport WidgetStyle from \"../../../../../Data/WidgetStyle\";\nimport { Constants } from \"../../../../../_helpers/Constants\";\n\nconst UseGetVendorTypeByGuid = (request?: GetVendorTypeByGuidRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/get/vendor-type/${request.vendorGuid}`;\n\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetVendorTypeByGuidResponse = fetchResponse.data;\n\n setData(response.vendorType);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default UseGetVendorTypeByGuid;\n\nexport interface GetVendorTypeByGuidResponse extends FetchResponse {\n vendorType: string;\n}\n\nexport interface GetVendorTypeByGuidRequest {\n vendorGuid: string;\n}","// \"https://azusc-pkgloop-admin-web-dev.azurewebsites.net/api/v1.0/customer-portal/pre-built-packages/get/1\"\nimport \"../../WidgetModal.css\";\nimport \"react-day-picker/lib/style.css\";\n\nimport React, { useEffect, useContext, useState, SetStateAction } from \"react\";\nimport { Col, Row, Spinner, Button, Modal, Form } from \"react-bootstrap\";\nimport { WidgetContext } from \"../../../../../../../context/WidgetContext\";\nimport { DatesAndGuests } from \"../../../../widget-form/WidgetForm\";\nimport PackageDetails from \"./PackageDetails\";\nimport CustomDayPickerInput from \"../../../../../customDayPickerInput/CustomDayPickerInput\";\nimport reactMoment from \"react-day-picker/moment\";\nimport { Modifier } from \"react-day-picker\";\nimport moment from \"moment\";\nimport { PreBuiltPkg } from \"../Models/PreBuiltPkg\";\n\ninterface props {\n show: boolean;\n pkg: PreBuiltPkg;\n onHide: () => void;\n datesAndGuestsState: [DatesAndGuests, React.Dispatch>];\n onSelectedPackage: (pkg: any) => void;\n}\n\nconst PackageDetailsModal: React.FC = (props) => {\n const { startWidget, style, viewPortBreakPoint } = useContext(WidgetContext);\n const [datesAndGuests, setDatesAndGuests] = props.datesAndGuestsState;\n const placeholderImgUrl = \"https://images.unsplash.com/photo-1566073771259-6a8506099945?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1050&q=80\";\n const { formatDate, parseDate } = reactMoment;\n const modifiers = { start: datesAndGuests.fromDate, end: datesAndGuests.toDate };\n\n useEffect(() => {\n if (props.pkg === undefined) return;\n const travelDaysAllow = props.pkg.travelDaysAllowed ?? 3\n console.log(\"phere\", travelDaysAllow);\n // set the dates and guests date obj to whatever the span is starting with todays date\n const daysFromStartingDate = new Date(datesAndGuests.fromDate.getTime() + (1000 * 60 * 60 * 24 * travelDaysAllow));\n\n const allowed = moment(datesAndGuests.fromDate).isSameOrAfter(props.pkg.validToTravelFrom);\n setDatesAndGuests({ ...datesAndGuests, toDate: daysFromStartingDate});\n }, [props.pkg]);\n\n return (\n { props.onHide(); }}\n backdropClassName=\"white-overlay\"\n dialogClassName=\"box-shadow\"\n >\n \n
\n {props.pkg ? props.pkg.packageName : \"undefined\"}\n \n {/*

{datesAndGuests.fromDate ? datesAndGuests.fromDate.toDateString() : \"Arrive\"}

\n

-

\n

{datesAndGuests.toDate ? datesAndGuests.toDate.toDateString() : \"Depart\"}

*/}\n
\n \n \n Arrive\n {/* {errors.length > 0 && errors.find(e => e.id == \"fromDate\") && (\n {errors.find(e => e.id == \"fromDate\").message}\n )} */}\n \n {\n datesAndGuests.fromDate = date;\n if (datesAndGuests.toDate && date > datesAndGuests.toDate) {\n datesAndGuests.toDate = date;\n }\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n
\n\n
\n \n \n Depart\n {/* {errors.length > 0 && errors.find(e => e.id == \"toDate\") && (\n {errors.find(e => e.id == \"toDate\").message}\n )} */}\n \n\n {\n datesAndGuests.toDate = date;\n setDatesAndGuests({ ...datesAndGuests });\n }}\n />\n \n
\n
\n
\n

{props.pkg ? props.pkg.description : \"Description\"}

\n

From ${(props.pkg ? props.pkg.fromPrice : \"\")}

\n
\n
\n
\n \n {props.pkg && (\n {\n props.onSelectedPackage(pkg);\n props.onHide();\n }}\n />\n )}\n \n \n );\n}\n\nexport default PackageDetailsModal; ","import { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../../../../_helpers/Constants\";\nimport { PreBuiltPkg } from \"../../Models/PreBuiltPkg\";\n\nconst UseGetQuickPackages = (request?: GetQuickPackagesRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n \n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/pre-built-packages/get/quick-packages/${request.brandId}?startDate=${request.startDate}&endDate=${request.endDate}`;\n\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetQuickPackagesResponse = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default UseGetQuickPackages;\n\nexport interface GetQuickPackagesResponse extends FetchResponse {\n packages: PreBuiltPkg[];\n}\n\nexport interface GetQuickPackagesRequest {\n brandId: number;\n startDate: string;\n endDate: string;\n}","import { useState, useEffect } from \"react\";\nimport useFetch, { FetchRequest } from \"../../../../../../../../_helpers/UseFetchHook\";\nimport { FetchResponse } from \"../../../../../../../../_helpers/Types\";\nimport { Constants } from \"../../../../../../../../_helpers/Constants\";\nimport { PreBuiltPkg } from \"../../Models/PreBuiltPkg\";\n\nconst useGetPackageById = (request?: GetPackageByIdRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n \n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/customer-portal/pre-built-packages/get/package/${request.packageId}?startDate=${request.startDate}&endDate=${request.endDate}`;\n\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetPackageByIdResponse = fetchResponse.data;\n setData(response);\n }\n\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useGetPackageById;\n\nexport interface GetPackageByIdRequest {\n packageId: number;\n startDate: string;\n endDate: string;\n}\n\nexport interface GetPackageByIdResponse extends FetchResponse {\n package: PreBuiltPkg;\n}","\nimport React, { useState } from \"react\";\nimport { Button } from \"react-bootstrap\";\n\nconst MenuItemButton = ({onClick, menuItemName}: {\n onClick: () => void;\n menuItemName: string;\n}) => {\n return (\n \n {menuItemName}\n \n )\n}\n\nconst MobileHamburgerMenu = ({setShow, setShowForm, showForm}: {\n setShow: (show: string) => void;\n setShowForm: (showForm: boolean) => void;\n showForm: boolean;\n}) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const clickedMenuItem = (menuItem: string) => {\n setIsOpen(false);\n setShow(menuItem);\n }\n\n return (\n
\n setIsOpen(!isOpen)}\n className=\"hamburger-button\"\n >\n \n Quote Options Menu\n \n \n
\n {\n setShowForm(!showForm);\n setIsOpen(false);\n }}\n menuItemName=\"Build Your Own Package\"\n />\n clickedMenuItem(\"package-specials\")} menuItemName=\"Specials\"/>\n clickedMenuItem(\"request-quote\")} menuItemName=\"Request Quote\"/>\n clickedMenuItem(\"request-group-quote\")} menuItemName=\"Request Group Quote\"/>\n clickedMenuItem(\"find-reservation\")} menuItemName=\"Find Quote\"/>\n
\n
\n )\n};\n\nexport default MobileHamburgerMenu;","import \"./mobile-widget/mobile-widget.css\"\nimport React, { useState, useEffect, useRef } from \"react\";\nimport { Col, Button, Accordion, Modal, Row, Form, Spinner } from \"react-bootstrap\";\nimport WidgetForm, { DatesAndGuests } from \"../widget-form/WidgetForm\";\n\nimport RequestQuoteModal from \"./widget-modals/RequestQuoteModal\";\nimport FindReservation from \"./widget-modals/FindReservationModal\";\nimport MobileWidget from \"./mobile-widget/MobileWidget\";\n\nimport UseGetStartWidget, { GetStartWidgetRequest, GetStartWidgetResponse } from \"./data-service-hooks/UseGetStartWidget\";\nimport UseGetWidgetStyle, { GetStyleRequest, GetStyleResponse } from \"./data-service-hooks/UseGetWidgetStyle\";\nimport UseGetBrands, { GetBrandsRequest, GetBrandsResponse } from \"./data-service-hooks/UseGetBrands\";\n\nimport ItineraryStart from \"./itinerary/ItineraryStart\";\nimport LodgingItem from \"../../../../Data/LodgingItem\";\nimport GolfItem from \"../../../../Data/GolfItem\";\nimport TransportationItem from \"../../../../Data/TransportationItem\";\nimport CustomItem from \"../../../../Data/CustomItem\";\n// import VendorUnit from \"../../../../Data/VendorUnit\";\n\nimport LodgingItinerary from \"../../../../Data/Reservation/Lodging/LodgingItinerary\";\nimport GolfItinerary from \"../../../../Data/Reservation/Golf/GolfItinerary\";\nimport TransportItinerary from \"../../../../Data/Reservation/Transportation/TransportItinerary\";\nimport CustomItinerary from \"../../../../Data/Reservation/Custom/CustomItinerary\";\nimport Itinerary from \"../../../../Data/Itinerary\";\nimport AddCustomModal from \"./widget-modals/custom/add-custom/AddCustomModal\";\nimport LodgingItineraryUnit from \"../../../../Data/Reservation/Lodging/LodgingItineraryUnit\";\nimport StartWidget from \"../../../../Data/StartWidget\";\nimport GolfItineraryUnit from \"../../../../Data/Reservation/Golf/GolfItineraryUnit\";\nimport TransportItineraryUnit from \"../../../../Data/Reservation/Transportation/TransportItineraryUnit\";\nimport CustomItineraryUnit from \"../../../../Data/Reservation/Custom/CustomItineraryUnit\";\nimport WidgetStyle from \"../../../../Data/WidgetStyle\";\nimport VendorUnit from \"../../../../Data/VendorUnit\";\nimport { Constants } from \"../../../../_helpers/Constants\";\nimport useWindowSize from \"../../../../_helpers/UseWindowHook\";\nimport { WidgetContext } from \"../../../../context/WidgetContext\";\nimport ViewPort from \"../../../../_helpers/Enums/ViewPortEnum\";\nimport AddGolfModal from \"./widget-modals/golf/add-golf/AddGolfModal\";\nimport AddLodgingModal from \"./widget-modals/lodging/add-lodging/AddLodgingModal\";\nimport AddTransportationModal from \"./widget-modals/transportation/add-transportation/AddTransportationModal\";\n// import GetQuote from \"./itinerary/get-quote/GetQuote\";\nimport Quote from \"../../../../Data/Quote/Quote\";\n// import MakePayment from \"./itinerary/make-payment/MakePayment\";\nimport FindReservationModal from \"./widget-modals/FindReservationModal\";\nimport AddPreBuiltPackageModal from \"./widget-modals/pre-built-packages/add-packages/AddPreBuiltPackageModal\";\nimport UseGetCustomVendors, { GetCustomVendorsRequest, GetCustomVendorsResponse } from \"./widget-modals/custom/add-custom/data-service-hooks/UseGetCustomVendors\";\nimport UseGetGolfVendors, { GetGolfVendorsRequest, GetGolfVendorsResponse } from \"./widget-modals/golf/add-golf/data-service-hooks/UseGetGolfVendors\";\nimport UseGetLodgingVendors, { GetLodgingVendorsRequest, GetLodgingVendorsResponse } from \"./widget-modals/lodging/add-lodging/data-service-hooks/UseGetLodgingVendors\";\nimport UseGetTransportVendors, { GetTransportVendorsRequest, GetTransportVendorsResponse } from \"./widget-modals/transportation/add-transportation/data-service-hooks/UseGetTransportVendors\";\nimport Reservation from \"../../../../Data/Reservation/Reservation\";\nimport useSearchQuote, { SearchQuoteRequest, SearchQuoteResponse } from \"./data-service-hooks/UseSearchQuote\";\nimport { ReservationCustomer } from \"../../../../Data/Reservation/ReservationCustomer\";\nimport Decimal from \"decimal.js\";\nimport moment from \"moment\";\nimport useCreateIndividualCategory, { CreateIndividualCategoryRequest } from \"./data-service-hooks/UseCreateIndividualCategory\";\nimport { isStringEmpty, ObjToQueryString } from \"../../../../_helpers/Functions\";\nimport ReactGA from 'react-ga4';\nimport useCalculateWidgetHeight from \"../../../../_helpers/UseCalculateWidgetHeight\";\nimport UseGetVendorTypeByGuid, { GetVendorTypeByGuidRequest } from \"./data-service-hooks/UseGetVendorTypeByGuid\";\nimport UseGetPackages, { GetPackagesRequest, GetPackagesResponse } from \"./widget-modals/pre-built-packages/add-packages/data-service-hooks/UseGetPreBuiltPackages\";\nimport PackagesCard from \"./widget-modals/pre-built-packages/packages-card/PackagesCard\";\nimport PackageDetails from \"./widget-modals/pre-built-packages/package-details/PackageDetails\";\nimport PackageDetailsModal from \"./widget-modals/pre-built-packages/package-details/PackageDetailsModal\";\nimport useFetch, { FetchRequest } from \"../../../../_helpers/UseFetchHook\";\nimport { TimeOption } from \"../../../../_helpers/Types\";\nimport { PreBuiltPkg } from \"./widget-modals/pre-built-packages/Models/PreBuiltPkg\";\nimport UseGetQuickPackages, { GetQuickPackagesRequest, GetQuickPackagesResponse } from \"./widget-modals/pre-built-packages/add-packages/data-service-hooks/UseGetQuickPackages\";\nimport UseGetPackageById, { GetPackageByIdRequest, GetPackageByIdResponse } from \"./widget-modals/pre-built-packages/add-packages/data-service-hooks/UseGetPackageById\";\nimport MobileHamburgerMenu from \"./mobile-widget/MobileHamburgerMenu\";\nimport StartWidgetBrand from \"../../../../Data/StartWidgetBrand\";\nimport StartWidgetBrandSetting from \"../../../../Data/StartWidgetBrandSetting\";\n\ninterface props {\n startWidgetId: number;\n itineraryNumber: string | undefined;\n customerId: number | undefined;\n autoScroll: boolean;\n vendorGuid: string | undefined;\n campaignId: string | undefined;\n packageParam: string | undefined;\n}\n\n// the main object that ties all the information together\nconst Widget: React.FC = (props) => {\n const { startWidgetId, itineraryNumber, customerId, autoScroll, campaignId, packageParam } = props;\n const [fromEmail, setFromEmail] = useState(itineraryNumber != undefined);\n\n const { width, height, breakPoint } = useWindowSize();\n const [startWidget, setStartWidget] = useState();\n // Fetch Start Widget\n const [getWidgetRequest, setGetWidgetRequest] = useState();\n const responseGetWidget = UseGetStartWidget(getWidgetRequest);\n\n const [style, setStyle] = useState();\n const [getStyleRequest, setGetStyleRequest] = useState();\n const responseGetStyle = UseGetWidgetStyle(getStyleRequest);\n\n const [getVendorTypeByGuidRequest, setGetVendorTypeByGuidRequest] = useState();\n const responseGetVendorType = UseGetVendorTypeByGuid(getVendorTypeByGuidRequest);\n const [vendorGuidType, setVendorGuidType] = useState();\n\n const [brands, setBrands] = useState([]);\n const [brandId, setBrandId] = useState(-1);\n const [companyId, setCompanyId] = useState();\n const [brandSettings, setBrandSettings] = useState([]);\n const [getBrandsRequest, setGetBrandsRequest] = useState();\n const responseGetBrands = UseGetBrands(getBrandsRequest);\n\n const [brand, setBrand] = useState();\n\n const [show, setShow] = useState(\"build-your-own\");\n const [validated, setValidated] = useState(false);\n\n const [quote, setQuote] = useState();\n const [quoteSearchRequest, setQuoteSearchRequest] = useState();\n const quoteSearchResponse = useSearchQuote(quoteSearchRequest);\n\n const [isLoading, setIsLoading] = useState(true);\n\n const [itinerary, setItinerary] = useState({});\n const [emailCustomer, setEmailCustomer] = useState();\n const itineraryNotEmpty = Object.keys(itinerary).length > 0 && Object.keys(itinerary).some(key => itinerary[key] != undefined);\n\n const [lodgingItemToEdit, setLodgingItemToEdit] = useState();\n const [golfItemToEdit, setGolfItemToEdit] = useState();\n const [transportItemToEdit, setTransportItemToEdit] = useState();\n const [customItemToEdit, setCustomItemToEdit] = useState();\n\n const [lodgingVendors, setLodgingVendors] = useState();\n const [getLodgingVendorsRequest, setGetLodgingVendorsRequest] = useState();\n const responseGetLodgingVendors = UseGetLodgingVendors(getLodgingVendorsRequest);\n\n const [golfVendors, setGolfVendors] = useState();\n const [getGolfVendorsRequest, setGetGolfVendorsRequest] = useState();\n const responseGetGolfVendors = UseGetGolfVendors(getGolfVendorsRequest);\n\n const [transportVendors, setTransportVendors] = useState();\n const [getTransportVendorsRequest, setGetTransportVendorsRequest] = useState();\n const responseGetTransportVendors = UseGetTransportVendors(getTransportVendorsRequest);\n\n const [customVendors, setCustomVendors] = useState();\n const [getCustomVendorsRequest, setGetCustomVendorsRequest] = useState();\n const responseGetCustomVendors = UseGetCustomVendors(getCustomVendorsRequest);\n\n const startingDate = Constants.startingDate;\n const threeDaysFromStart = Constants.threeDaysFromStartingDate;\n const [datesAndGuests, setDatesAndGuests] = useState({\n fromDate: startingDate,\n toDate: threeDaysFromStart,\n fromTime: undefined,\n toTime: undefined,\n guests: 2,\n units: 1\n });\n\n const [getQuickPackagesRequest, setGetQuickPackagesRequest] = useState();\n const responseGetQuickPackages = UseGetQuickPackages(getQuickPackagesRequest);\n const [packages, setPackages] = useState([]);\n\n const [getPackageParamRequest, setGetPackageParamRequest] = useState();\n const getPackageByIdResponse = UseGetPackageById(getPackageParamRequest);\n const [packageFromParam, setPackageFromParam] = useState();\n\n const { sendItineraryUnitsMessage } = useCalculateWidgetHeight(\n startWidget,\n itinerary,\n autoScroll,\n show,\n undefined,\n (quote && quote.reservation.statusId && (Number)(quote.reservation.statusId) !== 40 && (Number)(quote.reservation.statusId) !== 50)\n );\n\n const [importedPackage, setImportedPackage] = useState();\n\n /*******************************************/\n\n function addSelectedLodging(item: LodgingItem, index?: number) {\n const lodgingItineraries = itinerary.lodgingItineraries || [];\n let lodgingItinerary = lodgingItineraries.find((i: LodgingItinerary) => i.vendorId == item.vendorId);\n if (lodgingItinerary == undefined) {\n lodgingItinerary = {\n vendorId: item.vendorId,\n vendor: item,\n useLocalRates: item.useLocalRates,\n fees: 0.0,\n itineraryUnits: []\n }\n\n itinerary.lodgingItineraries = [...lodgingItineraries, lodgingItinerary];\n }\n\n // if index not undefined cut out the correct index then recreate the item\n if (index !== undefined && index > -1) {\n let itineraryIndex = -1;\n lodgingItinerary.itineraryUnits.forEach((unit, i) => {\n if ((unit.itineraryIndex as number) === index)\n itineraryIndex = i;\n });\n\n if (itineraryIndex > -1)\n lodgingItinerary.itineraryUnits.splice(itineraryIndex, 1);\n }\n\n // console.log(\"vendorUnitId\", item.selectedUnit);\n\n const itineraryUnit: LodgingItineraryUnit = {\n vendorUnitId: item.selectedUnit ? item.selectedUnit.vendorUnitId : 0,\n vendorId: item.vendorId,\n vendor: item,\n checkIn: moment(new Date(item.checkIn)).format(\"YYYY-MM-DD\"),\n checkOut: moment(new Date(item.checkOut)).format(\"YYYY-MM-DD\"),\n guestsInUnit: item.guests,\n // numberOfUnits: item.units ? item.units : 1,\n numberOfUnits: Math.max(item.units, Math.ceil(item.guests / (item.selectedUnit?.personPerUnit || 32))),\n sell: item.selectedUnit ? item.selectedUnit.sell : 0.0,\n cost: 0.0,\n profit: 0.0,\n tax1: 0.0,\n tax2: 0.0,\n resortFee: 0.0,\n cleaningFee: 0.0,\n showOnItinerary: true,\n overrideRate: false,\n liveRate: item.selectedUnit?.isLive || false,\n itineraryIndex: lodgingItineraries.flatMap(i => i.itineraryUnits).length,\n cancelled: false,\n unitName: !!item.selectedUnit ? item.selectedUnit.unitName : \"\",\n travelPortLodgingOfferId: item.travelPortLodgingOfferId,\n travelPortRateName: item.travelPortRateName,\n preBuiltPkgVendorUnit: item.preBuiltPkgVendorUnit\n }\n\n lodgingItinerary.itineraryUnits.push(itineraryUnit);\n setItinerary({ ...itinerary });\n }\n\n function addSelectedGolf(item: GolfItem, index?: number) {\n const golfItineraries = itinerary.golfItineraries || [];\n let golfItinerary = golfItineraries.find((i: GolfItinerary) => i.vendorId == item.vendorId);\n if (golfItinerary == undefined) {\n golfItinerary = {\n vendorId: item.vendorId,\n vendor: item,\n useLocalRates: true,\n fees: 0.0,\n itineraryUnits: []\n }\n\n itinerary.golfItineraries = [...golfItineraries, golfItinerary];\n }\n\n if (index !== undefined && index > -1) {\n let itineraryIndex = -1;\n golfItinerary.itineraryUnits.forEach((unit, i) => {\n if ((unit.itineraryIndex as number) === index)\n itineraryIndex = i;\n });\n\n if (itineraryIndex > -1)\n golfItinerary.itineraryUnits.splice(itineraryIndex, 1);\n }\n\n let playerCount = item.guests;\n let timeIndex = item.availableTeeTimes.findIndex(t => t.value === item.teeTime);\n let sell = item.selectedUnit ? item.selectedUnit.sell : 0.0;\n\n do {\n const itineraryUnit: GolfItineraryUnit = {\n vendorUnitId: item.selectedUnit ? item.selectedUnit.vendorUnitId : 0,\n vendorId: item.vendorId,\n vendor: item,\n players: timeIndex > -1 ? Math.min(item.preBuiltPkgVendorUnit === undefined ?\n item.availableTeeTimes[timeIndex].openSpots : Math.min(item.preBuiltPkgVendorUnit.toGuests, item.availableTeeTimes[timeIndex].openSpots), playerCount) : item.guests,\n playDate: moment(item.checkIn).format(\"YYYY-MM-DD\"),\n teeTime: item.teeTime,\n sell: sell,\n cost: 0.0,\n profit: 0.0,\n tax1: 0.0,\n tax2: 0.0,\n resortFee: 0.0,\n cleaningFee: 0.0,\n showOnItinerary: true,\n overrideRate: false,\n itineraryIndex: golfItinerary.itineraryUnits.length,\n cancelled: false,\n productRateId: item.productRateId,\n foreUpTeeTimeId: item.foreUpTeeTimeId,\n golfNowTeeTimeId: item.golfNowTeeTimeId,\n availableTeeTimes: item.availableTeeTimes,\n liveRate: !isStringEmpty(item.foreUpTeeTimeId) || !isStringEmpty(item.golfNowTeeTimeId) || !isStringEmpty(item.lightSpeedTeeTimeId),\n unitName: !!item.selectedUnit ? item.selectedUnit.unitName : \"\",\n preBuiltPkgVendorUnit: item.preBuiltPkgVendorUnit\n }\n\n golfItinerary.itineraryUnits.push(itineraryUnit);\n\n playerCount -= timeIndex > -1 ? Math.min(item.preBuiltPkgVendorUnit === undefined ?\n item.availableTeeTimes[timeIndex].openSpots : Math.min(item.preBuiltPkgVendorUnit.toGuests, item.availableTeeTimes[timeIndex].openSpots), playerCount) : item.guests;\n\n if (playerCount > 0 && timeIndex + 1 < item.availableTeeTimes.length) {\n item.teeTime = item.availableTeeTimes[timeIndex + 1].value;\n item.foreUpTeeTimeId = item.availableTeeTimes[timeIndex + 1].foreUpTeeTimeId;\n item.golfNowTeeTimeId = item.availableTeeTimes[timeIndex + 1].golfNowTeeTimeId;\n item.lightSpeedTeeTimeId = item.availableTeeTimes[timeIndex + 1].lightSpeedTeeTimeId;\n sell = item.availableTeeTimes[timeIndex + 1].price * playerCount;\n timeIndex += 1;\n }\n } while (playerCount > 0);\n\n setItinerary({ ...itinerary });\n }\n\n function addSelectedTransportation(item: TransportationItem, index?: number) {\n const transportItineraries = itinerary.transportItineraries || [];\n let transportItinerary = transportItineraries.find((i: TransportItinerary) => i.vendorId == item.vendorId);\n if (transportItinerary == undefined) {\n transportItinerary = {\n vendorId: item.vendorId,\n vendor: item,\n useLocalRates: true,\n fees: 0.0,\n itineraryUnits: []\n }\n\n itinerary.transportItineraries = [...transportItineraries, transportItinerary];\n }\n\n if (index !== undefined && index > -1) {\n let itineraryIndex = -1;\n transportItinerary.itineraryUnits.forEach((unit, i) => {\n if ((unit.itineraryIndex as number) === index)\n itineraryIndex = i;\n });\n\n if (itineraryIndex > -1)\n transportItinerary.itineraryUnits.splice(itineraryIndex, 1);\n }\n\n const itineraryUnit: TransportItineraryUnit = {\n vendorUnitId: item.selectedUnit ? item.selectedUnit.vendorUnitId : 0,\n vendorId: item.vendorId,\n vendor: item,\n startDate: moment(item.checkIn).format(\"YYYY-MM-DD\"),\n endDate: moment(item.checkOut).format(\"YYYY-MM-DD\"),\n startTime: item.fromTime,\n endTime: item.toTime,\n units: item.numUnits,\n inUnit: item.guests,\n sell: item.selectedUnit ? item.selectedUnit.sell : 0.0,\n cost: 0.0,\n profit: 0.0,\n tax1: 0.0,\n tax2: 0.0,\n resortFee: 0.0,\n cleaningFee: 0.0,\n showOnItinerary: true,\n overrideRate: false,\n liveRate: false,\n itineraryIndex: transportItinerary.itineraryUnits.length,\n cancelled: false,\n unitName: !!item.selectedUnit ? item.selectedUnit.unitName : \"\"\n }\n\n transportItinerary.itineraryUnits.push(itineraryUnit);\n setItinerary({ ...itinerary });\n }\n\n function addSelectedCustom(item: CustomItem, index?: number) {\n const customItineraries = itinerary.customItineraries || [];\n let customItinerary = customItineraries.find((i: CustomItinerary) => i.vendorId == item.vendorId);\n if (customItinerary == undefined) {\n customItinerary = {\n vendorId: item.vendorId,\n vendor: item,\n useLocalRates: true,\n fees: 0.0,\n itineraryUnits: []\n }\n\n itinerary.customItineraries = [...customItineraries, customItinerary];\n }\n\n if (index !== undefined && index > -1) {\n let itineraryIndex = -1;\n customItinerary.itineraryUnits.forEach((unit, i) => {\n if ((unit.itineraryIndex as number) === index)\n itineraryIndex = i;\n });\n\n if (itineraryIndex > -1)\n customItinerary.itineraryUnits.splice(itineraryIndex, 1);\n }\n\n const itineraryUnit: CustomItineraryUnit = {\n vendorUnitId: item.selectedUnit ? item.selectedUnit.vendorUnitId : 0,\n vendorId: item.vendorId,\n vendor: item,\n customItemType: true,\n fromDate: moment(item.checkIn).format(\"YYYY-MM-DD\"),\n toDate: moment(item.checkOut).format(\"YYYY-MM-DD\"),\n fromTime: item.fromTime,\n toTime: item.toTime,\n personPerUnit: item.guests,\n units: item.numUnits,\n sell: item.selectedUnit ? item.selectedUnit.sell : 0.0,\n cost: 0.0,\n profit: 0.0,\n tax1: 0.0,\n tax2: 0.0,\n resortFee: 0.0,\n cleaningFee: 0.0,\n showOnItinerary: true,\n overrideRate: false,\n liveRate: false,\n itineraryIndex: customItinerary.itineraryUnits.length,\n cancelled: false,\n unitName: !!item.selectedUnit ? item.selectedUnit.unitName : \"\"\n }\n\n customItinerary.itineraryUnits.push(itineraryUnit);\n setItinerary({ ...itinerary });\n }\n\n /*******************************************/\n\n useEffect(() => {\n setGetWidgetRequest({\n widgetId: startWidgetId,\n });\n }, []);\n\n useEffect(() => {\n if (!!!responseGetWidget.data) return;\n\n const startWidget: StartWidget = responseGetWidget.data;\n\n setStartWidget(startWidget)\n\n if (startWidget.activateGoogleAnalytics && !isStringEmpty(startWidget.googleAnalyticsTrackingCode)) {\n ReactGA.initialize(startWidget.googleAnalyticsTrackingCode, {\n gaOptions: {\n cookieFlags: 'secure;samesite=none',\n }\n });\n }\n }, [responseGetWidget.data]);\n\n useEffect(() => {\n setGetStyleRequest({\n widgetId: startWidgetId,\n });\n }, []);\n\n useEffect(() => {\n if (!!!responseGetStyle.data) return;\n const responseData: GetStyleResponse = responseGetStyle.data;\n\n setStyle(responseData.widgetStyle);\n }, [responseGetStyle.data]);\n\n useEffect(() => {\n setGetBrandsRequest({\n widgetId: startWidgetId,\n });\n }, []);\n\n useEffect(() => {\n if (brands === undefined || brands === null || brands.length === 0) return;\n\n console.log(\"brands\", brands);\n setBrandId(brands[0].brandId);\n console.log(\"id\", brands[0].brandId);\n }, [brands]);\n\n useEffect(() => {\n if (responseGetBrands.data) {\n const responseData: GetBrandsResponse = responseGetBrands.data;\n\n const settings = responseData.brandsSettings;\n const brands = responseData.widgetBrands.map((b: any) => {\n const setting = settings.find((s: any) => s.brandId === b.brandId);\n return { ...b, webOrder: setting?.brand.webOrder };\n });\n\n setBrands(brands);\n // setBrandId(brands.length > 1 ? undefined : brands[0].brandId);\n setBrandSettings(settings);\n }\n }, [responseGetBrands.data]);\n\n useEffect(() => {\n if (!fromEmail || itineraryNumber === undefined) return;\n // get the reservation and the customer\n setQuoteSearchRequest({ email: \"\", itineraryNumber: `${itineraryNumber}` });\n }, []);\n\n useEffect(() => {\n if (quoteSearchResponse.data) {\n console.log(\"quoteSearchResponse\", quoteSearchResponse);\n const response: SearchQuoteResponse = quoteSearchResponse.data;\n\n let _quote: Quote = response.quote == undefined ? {\n reservation: response.reservation,\n requestNote: \"\"\n } : response.quote;\n\n _quote.reservation = response.reservation;\n\n console.log(\"quote\", _quote);\n\n setFromEmail(true);\n setBrandId(_quote.reservation.brandId === undefined ? -1 : _quote.reservation.brandId as number);\n\n if (_quote.reservation.lodgingItineraries && _quote.reservation.lodgingItineraries.length > 0) {\n _quote.reservation.lodgingItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n u.vendor = i.vendor;\n }));\n itinerary.lodgingItineraries = _quote.reservation.lodgingItineraries;\n }\n\n if (_quote.reservation.golfItineraries && _quote.reservation.golfItineraries.length > 0) {\n _quote.reservation.golfItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n u.vendor = i.vendor;\n }));\n itinerary.golfItineraries = _quote.reservation.golfItineraries;\n }\n\n if (_quote.reservation.transportItineraries && _quote.reservation.transportItineraries.length > 0) {\n _quote.reservation.transportItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n u.vendor = i.vendor;\n }));\n itinerary.transportItineraries = _quote.reservation.transportItineraries;\n }\n\n if (_quote.reservation.customItineraries && _quote.reservation.customItineraries.length > 0) {\n _quote.reservation.customItineraries.forEach(i => i.itineraryUnits.forEach(u => {\n u.vendor = i.vendor;\n }));\n itinerary.customItineraries = _quote.reservation.customItineraries;\n }\n\n itinerary.adjustments = _quote.reservation.adjustments;\n _quote.reservation.reservationCustomers = _quote.reservation.reservationCustomers.sort((a: any, b: any) => {\n if (a.customerId === _quote.reservation.leadCustomerId && b.customerId !== _quote.reservation.leadCustomerId) return -1;\n if (a.customerId !== _quote.reservation.leadCustomerId && b.customerId === _quote.reservation.leadCustomerId) return 1;\n\n if (!a.cancelled && b.cancelled) return -1;\n if (a.cancelled && !b.cancelled) return 1;\n\n return 0;\n });\n\n setQuote(_quote);\n setItinerary({ ...itinerary });\n\n if (customerId) {\n const customer = _quote.reservation.reservationCustomers.find(c => c.customerId == customerId);\n setEmailCustomer(customer);\n }\n\n setDatesAndGuests({\n fromDate: moment(_quote.reservation.arrive).toDate(),\n toDate: moment(_quote.reservation.depart).toDate(),\n guests: Math.max(_quote.reservation.numGuests, _quote.reservation.reservationCustomers.filter(rc => !rc.cancelled).length),\n units: 1,\n });\n }\n }, [quoteSearchResponse.data]);\n\n useEffect(() => {\n if (quote) {\n setBrandId(quote.reservation.brandId === undefined ? -1 : quote.reservation.brandId);\n }\n }, [quote]);\n\n useEffect(() => {\n setIsLoading(responseGetWidget.isLoading || responseGetStyle.isLoading || responseGetBrands.isLoading || quoteSearchResponse.isLoading);\n }, [responseGetWidget.isLoading, responseGetStyle.isLoading, responseGetBrands.isLoading, quoteSearchResponse.isLoading]);\n\n useEffect(() => {\n if (isLoading || isStringEmpty(packageParam) || packageParam === undefined) return;\n\n let fromDateString = datesAndGuests.fromDate ? datesAndGuests.fromDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n fromDateString = fromDateString.replace(\"/\", \"-\");\n let toDateString = datesAndGuests.toDate ? datesAndGuests.toDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n toDateString = toDateString.replace(\"/\", \"-\");\n\n setGetPackageParamRequest({ packageId: +packageParam, startDate: fromDateString, endDate: toDateString });\n }, [packageParam, isLoading]);\n\n /****************************************** */\n\n // Import Pre Built Packages\n // useEffect(() => {\n // if (importedPackage === undefined || brandId === undefined || brandId === -1) return;\n\n // }, [importedPackage]);\n\n const [calculateRateRequest, setCalculateRateRequest] = useState();\n const calculateRateResponse = useFetch(calculateRateRequest);\n\n const [loadingPackage, setLoadingPackage] = useState(false);\n\n useEffect(() => {\n if (importedPackage /*&& reservationData.current.preBuiltPkgId === undefined*/) {\n setLoadingPackage(true);\n populateFromImportedPackage();\n }\n }, [importedPackage]);\n\n // useEffect(() => {\n // console.log(\"loadingPackage\", loadingPackage);\n // }, [loadingPackage]);\n\n\n function populateFromImportedPackage() {\n if (importedPackage === undefined) return;\n\n console.log(\"importedPackage\", importedPackage);\n\n const vendorIds = importedPackage.preBuiltPkgVendors.map((v: any) => v.vendorId);\n let fromDateString = datesAndGuests.fromDate ? datesAndGuests.fromDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n fromDateString = fromDateString.replace(\"/\", \"-\");\n let toDateString = datesAndGuests.toDate ? datesAndGuests.toDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n toDateString = toDateString.replace(\"/\", \"-\");\n\n const query = ObjToQueryString({\n brandId: brandId,\n startDate: fromDateString,\n endDate: toDateString,\n vendorIds: vendorIds.join(\",\"),\n });\n\n setCalculateRateRequest({\n url: `${Constants.apiUrl}/api/v1.0/customer-portal/get/rates?${query}`,\n method: 'GET',\n });\n }\n\n // this gets called when importing a pre built package\n useEffect(() => {\n if (!!!calculateRateResponse.data || !!!importedPackage) return;\n\n // console.log(\"calculateRateResponse.data\", calculateRateResponse.data);\n // calculateRateResponse.data is an array of VendorDtos\n const vendors = calculateRateResponse.data;\n // console.log(\"importedPackage\", importedPackage);\n let golfCount = 0;\n for (let index = 0; index < vendors.length; index++) {\n const pbVendor = importedPackage?.preBuiltPkgVendors.find((v: any) => v.vendorId === vendors[index].vendorId);\n // console.log(\"pbVendor\", pbVendor);\n\n pbVendor?.preBuiltPkgVendorUnits.forEach((pbUnit: any, i: number) => {\n const selectedUnitName = pbUnit.vendorUnit?.unitName;\n const outerRate = vendors[index].dailyRates[0].unitRates.find((r: any) => r.vendorUnitDisplayName === selectedUnitName);\n\n if (outerRate !== undefined) {\n if (vendors[index].vendorType === \"Lodging\") {\n const rate = outerRate.rates[0];\n\n const selectedTravePortUnitName = null;\n const selectedTravePortLodgingOfferId = null;\n\n let selection: LodgingItem = { ...vendors[index] };\n selection.vendor = vendors[index];\n selection.vendorUnitId = rate.vendorUnitId;\n selection.checkIn = datesAndGuests.fromDate;\n selection.checkOut = datesAndGuests.toDate;\n selection.guests = Math.min(datesAndGuests.guests, pbUnit.toGuests);\n selection.units = 1;\n selection.productRateId = rate.productRateId;\n selection.selectedUnit = pbUnit.vendorUnit;\n selection.travelPortRateName = selectedTravePortUnitName;\n selection.travelPortLodgingOfferId = selectedTravePortLodgingOfferId;\n selection.preBuiltPkgVendorUnit = pbUnit;\n\n addSelectedLodging(selection);\n }\n\n if (vendors[index].vendorType === \"Golf\") {\n const date = moment(datesAndGuests.fromDate).add(1 * (golfCount++), \"days\");\n const rate = outerRate.rates[0];\n\n let rateTeeTimes: TimeOption[] = [];\n let start = moment(rate.startTime, 'HH:mm');\n let end = moment(rate.endTime, 'HH:mm');\n\n // pbpkg stuffs\n const pkgStart = importedPackage.allowCustomization ? moment(pbUnit.fromTime, \"HH:mm\") : start;\n const pkgEnd = importedPackage.allowCustomization ? moment(pbUnit.toTime, \"HH:mm\") : end;\n\n if (rate.startTime !== rate.endTime)\n start.minutes(Math.ceil(start.minutes() / 10) * 10);\n\n let result: TimeOption[] = [];\n let current = moment(start);\n while (current <= end) {\n if (current >= pkgStart && current <= pkgEnd) {\n result.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a') + (rate.isLive ? ` (${rate.openSpots} players) - Live` : \"\"),\n openSpots: rate.openSpots,\n foreUpTeeTimeId: rate.isLive ? rate.foreUpTeeTimeId : \"\",\n golfNowTeeTimeId: rate.isLive ? rate.golfNowTeeTimeId : \"\",\n lightSpeedTeeTimeId: rate.isLive ? rate.lightSpeedTeeTimeId : \"\",\n price: rate.price,\n vendorUnitId: rate.vendorUnitId,\n productRateId: rate.productRateId,\n isLive: rate.isLive\n });\n }\n\n current.add(10, 'minutes');\n }\n\n rateTeeTimes = rateTeeTimes.concat(result);\n\n if (!!rateTeeTimes.length) {\n rateTeeTimes = [...new Map(rateTeeTimes.map(item => [item.value, item])).values()] // Remove any cross-over duplicates.\n }\n\n rateTeeTimes.sort((a, b) => {\n // Sort by time.\n return moment(a.value, 'HH:mm').isBefore(moment(b.value, 'HH:mm')) ? -1 : 0;\n });\n\n let selection: GolfItem = { ...vendors[index] };\n selection.vendor = vendors[index];\n selection.vendorUnitId = pbUnit.vendorUnit.vendorUnitId;\n selection.checkIn = date.isSameOrBefore(datesAndGuests.toDate) ? date.toDate() : datesAndGuests.toDate;\n selection.availableTeeTimes = rateTeeTimes;\n selection.teeTime = rateTeeTimes.length > 0 ? rateTeeTimes[0].value : \"\";\n // selection.guests = Math.min(datesAndGuests.guests, pbUnit.toGuests);\n selection.guests = datesAndGuests.guests;\n // selection.useLocal = true;\n selection.productRateId = pbUnit.vendorUnit.productRateId;\n // selection.unitName = selectedUnitName as string;\n selection.foreUpTeeTimeId = \"\";\n selection.golfNowTeeTimeId = \"\";\n selection.lightSpeedTeeTimeId = \"\";\n selection.selectedUnit = pbUnit.vendorUnit;\n selection.preBuiltPkgVendorUnit = pbUnit;\n\n addSelectedGolf(selection);\n }\n }\n });\n }\n }, [calculateRateResponse.data]);\n\n // useEffect(() => {\n // // console.log(\"brandId\", brandId);\n // }, [brandId]);\n\n useEffect(() => {\n if (brandId === undefined || brandId === -1 || brandId === null) return;\n\n const brand = brands.find(b => b.brandId === brandId);\n if (brand === undefined) return;\n\n setBrand(brand);\n setCompanyId(brand.companyId);\n\n if (props.vendorGuid !== undefined)\n setGetVendorTypeByGuidRequest({ vendorGuid: props.vendorGuid });\n\n let fromDateString = datesAndGuests.fromDate ? datesAndGuests.fromDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n fromDateString = fromDateString.replace(\"/\", \"-\");\n let toDateString = datesAndGuests.toDate ? datesAndGuests.toDate.toLocaleDateString(\"en-US\").replace(\"/\", \"-\") : \"\";\n toDateString = toDateString.replace(\"/\", \"-\");\n setGetQuickPackagesRequest({ brandId, startDate: fromDateString, endDate: toDateString });\n }, [brandId, datesAndGuests]);\n\n useEffect(() => {\n if (responseGetQuickPackages.data) {\n let responseData: GetQuickPackagesResponse = responseGetQuickPackages.data;\n setPackages(responseData.packages);\n }\n }, [responseGetQuickPackages.data]);\n\n const [formKey, setFormKey] = useState(12345);\n const [showForm, setShowForm] = useState(true);\n useEffect(() => {\n setShowForm(!itineraryNotEmpty);\n setLoadingPackage(false);\n }, [itineraryNotEmpty]);\n\n useEffect(() => {\n setFormKey(formKey + 1);\n }, [showForm]);\n\n useEffect(() => {\n sendItineraryUnitsMessage();\n }, [show]);\n\n useEffect(() => {\n if (!!!responseGetVendorType.data) return;\n\n const vendorType = responseGetVendorType.data;\n setVendorGuidType(isStringEmpty(vendorType) ? undefined : vendorType);\n\n if (vendorType === \"Lodging\") {\n setShow(\"add-lodging\")\n }\n if (vendorType === \"Golf\") {\n setShow(\"add-golf\")\n }\n if (vendorType === \"Transport\") {\n setShow(\"add-transportation\")\n }\n if (vendorType === \"Custom\") {\n setShow(\"add-custom\")\n }\n }, [responseGetVendorType.data]);\n\n const [viewPackageDetails, setViewPackageDetails] = useState();\n\n useEffect(() => {\n console.log(\"GetPackageByIdResponse.data\", getPackageByIdResponse.data);\n if (!!!getPackageByIdResponse.data) return;\n\n setPackageFromParam(getPackageByIdResponse.data.package);\n setViewPackageDetails(getPackageByIdResponse.data.package);\n }, [getPackageByIdResponse.data]);\n\n /*******************************************/\n\n return (\n \n {/* {responseGetWidget.isLoading || responseGetStyle.isLoading || responseGetBrands.isLoading || quoteSearchResponse.isLoading && ( */}\n {(isLoading || loadingPackage) && (\n \n {!loadingPackage ? ( Loading...) : ( Importing Package...)}\n \n )}\n\n {!loadingPackage && !!startWidget && !!style && brands.length > 0 && brandSettings.length > 0 && brand !== undefined && (\n \n {startWidget.active && (\n <>\n {/* {!fromEmail && ( */}\n {(!fromEmail && !!!quote) && (\n <>\n {!itineraryNotEmpty && (\n \n \n {/* Tab buttons */}\n \n {/* Desktop */}\n {breakPoint >= ViewPort.md && (\n
\n setShow(\"build-your-own\")}\n onClick={() => setShowForm(!showForm)}\n style={{ color: style.linkColor }}\n >\n Build Package\n \n\n setShow(\"package-specials\")}\n style={{ color: style.linkColor }}\n >\n View Specials\n \n\n setShow(\"request-quote\")}\n style={{ color: style.linkColor }}\n >\n Request Quote\n \n setShow(\"request-group-quote\")}\n style={{ color: style.linkColor }}\n >\n Request Group Quote\n \n setShow(\"find-reservation\")}\n style={{ color: style.linkColor }}\n >\n Find Quote\n \n
\n )}\n\n {/* Mobile */}\n {breakPoint < ViewPort.md && (\n \n \n \n )}\n\n \n <>\n setShow(button)}\n itineraryNotEmpty={itineraryNotEmpty}\n />\n \n \n
\n \n
\n )}\n\n
\n \n {startWidget.showLodgingButton && (importedPackage === undefined || importedPackage.allowCustomization ? true : false) && (\n setShow(brandId !== undefined ? \"add-lodging\" : \"\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Lodging\n \n )}\n {startWidget.showGolfButton && (importedPackage === undefined || importedPackage.allowCustomization ? true : false) && (\n setShow(brandId !== undefined ? \"add-golf\" : \"\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Golf\n \n )}\n {startWidget.showTransportationButton && (importedPackage === undefined || importedPackage.allowCustomization ? true : false) && (\n setShow(brandId !== undefined ? \"add-transportation\" : \"\")}\n style={{\n fontSize: \"14.75px\",\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Transport\n \n )}\n {startWidget.showExtrasButton && (importedPackage === undefined || importedPackage.allowCustomization ? true : false) && (\n setShow(brandId !== undefined ? \"add-custom\" : \"\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n }}\n >\n + Extras\n \n )}\n \n
\n\n {/* */}\n
\n \n {startWidget.showLodgingButton && (\n \n setShow(\"add-lodging\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n width: \"100%\"\n }}\n >\n + Lodging\n \n \n )}\n {startWidget.showGolfButton && (\n \n setShow(\"add-golf\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n width: \"100%\"\n }}\n >\n + Golf\n \n \n )}\n {startWidget.showTransportationButton && (\n \n setShow(\"add-transportation\")}\n style={{\n fontSize: \"16.75px\",\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n width: \"100%\"\n }}\n >\n + Transport\n \n \n )}\n {startWidget.showExtrasButton && (\n \n setShow(\"add-custom\")}\n style={{\n borderRadius: \".25rem\",\n backgroundColor: style.buttonColor,\n marginBottom: \"15px\",\n border: \"none\",\n width: \"100%\"\n }}\n >\n + Extras\n \n \n )}\n \n
\n {/* {loadingPackage && (\n Importing Package...\n )} */}\n {!loadingPackage && !itineraryNotEmpty && startWidget.showQuickPackages && packages.length > 0 && (\n <>\n
\n\n

Quick Packages

\n\n \n {packages.map(pkg =>\n \n { setViewPackageDetails(pkg) }}\n stacked={true}\n />\n \n )}\n \n \n )}\n {/* */}\n \n )}\n\n {/* Itinerary Start */}\n {itineraryNotEmpty && (\n setLodgingItemToEdit(unit)}\n onEditGolf={(unit: GolfItineraryUnit) => setGolfItemToEdit(unit)}\n onEditTransport={(unit: TransportItineraryUnit) => setTransportItemToEdit(unit)}\n onEditCustom={(unit: CustomItineraryUnit) => setCustomItemToEdit(unit)}\n />\n )}\n\n {/** Modals */}\n {/* Add Packages */}\n {brandId !== -1 && validated && show == \"package-specials\" && (\n setShow(\"build-your-own\")}\n brandId={brandId} // need brandID\n datesAndGuestsState={[datesAndGuests, setDatesAndGuests]}\n onSelectedPackage={pkg => setImportedPackage(pkg)}\n />\n )}\n\n {show == \"request-quote\" && (\n setShow(\"\")}\n datesAndGuests={datesAndGuests}\n />\n )}\n\n {show == \"request-group-quote\" && (\n setShow(\"\")}\n datesAndGuests={datesAndGuests}\n isGroup\n />\n )}\n\n {show == \"find-reservation\" && (\n setShow(\"\")}\n handleSearchRequest={(email: string, itineraryNumber: string) => { setQuoteSearchRequest({ email, itineraryNumber }) }}\n />\n )}\n\n {/* Add Lodging */}\n {(brandId != undefined && validated && show === \"add-lodging\") && (\n setShow(\"\")}\n brandId={brandId as number}\n datesAndGuests={datesAndGuests}\n unitToEditState={[lodgingItemToEdit, setLodgingItemToEdit]}\n onSelectedLodging={(item: LodgingItem, index?: number) => {\n // console.log(\"item\", item);\n setShow(\"\");\n addSelectedLodging(item, index);\n setLodgingItemToEdit(undefined);\n }}\n vendorGuid={props.vendorGuid}\n vendorGuidType={vendorGuidType}\n />\n )}\n\n {/* add golf vendor */}\n {brandId != undefined && validated && show === \"add-golf\" && (\n setShow(\"\")}\n brandId={brandId}\n datesAndGuests={datesAndGuests}\n unitToEditState={[golfItemToEdit, setGolfItemToEdit]}\n onSelectedGolf={(item: GolfItem, index?: number) => {\n setShow(\"\");\n addSelectedGolf(item, index);\n setGolfItemToEdit(undefined);\n }}\n vendorGuid={props.vendorGuid}\n vendorGuidType={vendorGuidType}\n // sameDayReplays={sameDayReplays}\n />\n )}\n\n {/* add transportation vendor */}\n {brandId != undefined && validated && show === \"add-transportation\" && (\n setShow(\"\")}\n brandId={brandId}\n datesAndGuests={datesAndGuests}\n onSelectedTransportation={(item: TransportationItem, index?: number) => {\n setShow(\"\");\n setTransportItemToEdit(undefined);\n addSelectedTransportation(item, index);\n }}\n unitToEditState={[transportItemToEdit, setTransportItemToEdit]}\n vendorGuid={props.vendorGuid}\n vendorGuidType={vendorGuidType}\n />\n )}\n\n {/* add custom vendor */}\n {brandId != undefined && validated && show === \"add-custom\" && (\n setShow(\"\")}\n brandId={brandId}\n datesAndGuests={datesAndGuests}\n onSelectedCustom={(item: CustomItem, index?: number) => {\n setShow(\"\");\n addSelectedCustom(item, index);\n setCustomItemToEdit(undefined);\n }}\n unitToEditState={[customItemToEdit, setCustomItemToEdit]}\n vendorGuid={props.vendorGuid}\n vendorGuidType={vendorGuidType}\n />\n )}\n\n setViewPackageDetails(undefined)}\n pkg={viewPackageDetails}\n datesAndGuestsState={[datesAndGuests, setDatesAndGuests]}\n onSelectedPackage={pkg => setImportedPackage(pkg)}\n />\n \n )}\n
\n )}\n
\n );\n}\n\nexport default Widget;","\nimport { useState, useEffect } from \"react\";\nimport { Constants } from \"../../../_helpers/Constants\";\nimport { FetchResponse } from \"../../../_helpers/Types\";\nimport useFetch, { FetchRequest } from \"../../../_helpers/UseFetchHook\";\n\nconst useGetVendorConfirmationReservation = (request?: GetVendorConfirmationReservationRequest) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (request) {\n let url: string = `${apiString}/api/v1.0/vendor-confirmation/reservation/?itineraryNumber=${request.itineraryNumber}&vendorId=${request.vendorId}`;\n setFetchRequest({\n url: url,\n method: 'GET'\n });\n }\n }, [request]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: GetVendorConfirmationReservationResponse = fetchResponse.data;\n setData(response);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"vendor confirmation reservation fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useGetVendorConfirmationReservation;\n\nexport interface GetVendorConfirmationReservationResponse extends FetchResponse {\n reservation: any;\n}\n\nexport interface GetVendorConfirmationReservationRequest {\n itineraryNumber: string;\n vendorId: string;\n}","\nimport { useState, useEffect } from \"react\";\nimport { Constants } from \"../../../_helpers/Constants\";\nimport { FetchResponse } from \"../../../_helpers/Types\";\nimport useFetch, { FetchRequest } from \"../../../_helpers/UseFetchHook\";\n\nconst useUpdateItineraryUnitConfirmationNumber = (command?: UpdateItineraryUnitConfirmationCommand) => {\n const [data, setData] = useState(null);\n const [error, setError] = useState(null);\n const [isLoading, setIsLoading] = useState(false);\n\n const [fetchRequest, setFetchRequest] = useState();\n const fetchResponse = useFetch(fetchRequest);\n const apiString = Constants.apiUrl;\n\n useEffect(() => {\n if (command) {\n let url: string = `${apiString}/api/v1.0/vendor-confirmation/update-confirmation`;\n setFetchRequest({\n url: url,\n method: 'PATCH',\n body: command\n });\n }\n }, [command]);\n\n useEffect(() => {\n if (fetchResponse.data) {\n const response: UpdateItineraryUnitConfirmationResponse = fetchResponse.data;\n setData(response);\n }\n }, [fetchResponse.data]);\n\n useEffect(() => {\n if (fetchResponse.error) {\n setError(fetchResponse.error)\n console.log(\"vendor confirmation reservation fetch error\", fetchResponse.error);\n }\n }, [fetchResponse.error]);\n\n useEffect(() => {\n setIsLoading(fetchResponse.isLoading);\n }, [fetchResponse.isLoading]);\n\n return ({ data, error, isLoading });\n}\n\nexport default useUpdateItineraryUnitConfirmationNumber;\n\nexport interface UpdateItineraryUnitConfirmationResponse extends FetchResponse {\n success: boolean;\n confirmationNumber: string;\n itineraryUnitId: number;\n}\n\nexport interface UpdateItineraryUnitConfirmationCommand {\n itineraryUnitId: number;\n checkIn?: string;\n checkOut?: string;\n dateOfPlay?: string;\n teeTime?: string;\n confirmationNumber?: string;\n itineraryType?: string;\n startDate?: string;\n endDate?: string;\n startTime?: string;\n endTime?: string;\n fromDate?: string;\n toDate?: string;\n fromTime?: string;\n toTime?: string;\n units?: number;\n inUnit?: number;\n}","import moment from \"moment\";\nimport React, { useState, useEffect, useRef } from \"react\";\nimport { Row, Form, Button, Modal, Col, FormControl, Spinner } from \"react-bootstrap\";\nimport DayPickerInput from \"react-day-picker/DayPickerInput\";\nimport CustomItineraryUnit from \"../../../Data/Reservation/Custom/CustomItineraryUnit\";\nimport GolfItineraryUnit from \"../../../Data/Reservation/Golf/GolfItineraryUnit\";\nimport LodgingItineraryUnit from \"../../../Data/Reservation/Lodging/LodgingItineraryUnit\";\nimport Reservation from \"../../../Data/Reservation/Reservation\";\nimport TransportItineraryUnit from \"../../../Data/Reservation/Transportation/TransportItineraryUnit\";\nimport UseGetCustomVendors from \"../start-widget/widget/widget-modals/custom/add-custom/data-service-hooks/UseGetCustomVendors\";\nimport useGetVendorConfirmationReservation, { GetVendorConfirmationReservationRequest } from \"./UseGetVendorConfirmationReservation\";\nimport useUpdateItineraryUnitConfirmationNumber from \"./UseUpdateItineraryConfirmation\";\nimport momentJs from \"react-day-picker/moment\";\nimport UnitRate from \"../../../Data/Rates/UnitRate\";\nimport EnumProductRateType from \"../../../Data/Rates/EnumProductRateType\";\nimport VendorReservation from \"../../../Data/Reservation/VendorReservation\";\nimport { toast } from \"react-toastify\";\nimport { isNullOrUndefined } from \"util\";\nimport { isStringEmpty } from \"../../../_helpers/Functions\";\nimport CustomDayPickerInput from \"../customDayPickerInput/CustomDayPickerInput\";\nimport { TimeOption } from \"../../../_helpers/Types\";\n\ninterface Props {\n startWidgetId: number;\n itineraryNumber: string;\n vendorGuid: string;\n}\n\nconst VendorConfirmation: React.FC = (props) => {\n const queryString = window.location.href;\n const urlParams = new URLSearchParams(queryString);\n\n const idParam = urlParams.get(\"id\");\n const itineraryNumber = urlParams.get(\"itineraryNumber\");\n const vendorParam = urlParams.get(\"vendorId\");\n\n const [vendorReservation, setVendorReservation] = useState();\n const [vendorReservationRequest, setVendorReservationRequest] = useState();\n const vendorConfirmationResponse = useGetVendorConfirmationReservation(vendorReservationRequest);\n\n const [lodgingUnits, setLodgingUnits] = useState([]);\n const [golfUnits, setGolfUnits] = useState([]);\n const [transportUnits, setTransportUnits] = useState([]);\n const [customUnits, setCustomUnits] = useState([]);\n const [vendorName, setVendorName] = useState();\n\n const [obj, setObj] = useState();\n const updateResponse = useUpdateItineraryUnitConfirmationNumber(obj);\n\n const { formatDate, parseDate } = momentJs;\n\n const [teeTimes, setTeeTimes] = useState([]);\n const teeTimesOptions = teeTimes.map((teeTime: TimeOption, index: number) => (\n \n ));\n\n const [startTimes, setStartTimes] = useState([]);\n const startTimeOptions = startTimes.map((time: TimeOption, index: number) => (\n \n ));\n\n const [errors, setErrors] = useState({});\n\n function checkInDateChanged(index: number, date: Date) {\n lodgingUnits[index].checkIn = moment(date).format(\"YYYY-MM-DD\");\n setLodgingUnits([...lodgingUnits]);\n }\n\n function checkOutDateChanged(index: number, date: Date) {\n lodgingUnits[index].checkOut = moment(date).format(\"YYYY-MM-DD\");\n setLodgingUnits([...lodgingUnits]);\n }\n\n function playDateChanged(index: number, date: Date) {\n golfUnits[index].playDate = moment(date).format(\"YYYY-MM-DD\");\n setGolfUnits([...golfUnits]);\n }\n\n function teeTimeChanged(index: number, time: string) {\n golfUnits[index].teeTime = time;\n setGolfUnits([...golfUnits]);\n }\n\n function startDateChanged(type: string, index: number, date: Date) {\n if (type === \"transport\") {\n transportUnits[index].startDate = moment(date).format(\"YYYY-MM-DD\");\n setTransportUnits([...transportUnits]);\n }\n else if (type === \"custom\") {\n customUnits[index].fromDate = moment(date).format(\"YYYY-MM-DD\");\n setCustomUnits([...customUnits]);\n }\n }\n\n function endDateChanged(type: string, index: number, date: Date) {\n if (type === \"transport\") {\n transportUnits[index].endDate = moment(date).format(\"YYYY-MM-DD\");\n setTransportUnits([...transportUnits]);\n }\n else if (type === \"custom\") {\n customUnits[index].toDate = moment(date).format(\"YYYY-MM-DD\");\n setCustomUnits([...customUnits]);\n }\n }\n\n function startTimeChanged(type: string, index: number, time: string) {\n if (type === \"transport\") {\n transportUnits[index].startTime = time;\n setTransportUnits([...transportUnits]);\n }\n else if (type === \"custom\") {\n customUnits[index].startTime = time;\n setCustomUnits([...customUnits]);\n }\n }\n\n function endTimeChanged(type: string, index: number, time: string) {\n if (type === \"transport\") {\n transportUnits[index].endTime = time;\n setTransportUnits([...transportUnits]);\n }\n else if (type === \"custom\") {\n customUnits[index].endTime = time;\n setCustomUnits([...customUnits]);\n }\n }\n\n function unitsChanged(type: string, index: number, units: number) {\n if (type === \"transport\") {\n transportUnits[index].units = units;\n setTransportUnits([...transportUnits]);\n }\n else if (type === \"custom\") {\n customUnits[index].units = units;\n setCustomUnits([...customUnits]);\n }\n }\n\n function golfConfirmedTimeChanged(index: number, time: string) {\n golfUnits[index].unit.confirmedTime = time;\n setGolfUnits([...golfUnits]);\n }\n\n function populateTeeTimes() {\n // Set the tee times.\n let rateTeeTimes: TimeOption[] = [];\n let start = moment(\"00:00\", 'HH:mm');\n let end = moment(\"23:50\", 'HH:mm');\n let current = moment(start);\n while (current <= end) {\n rateTeeTimes.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a'),\n foreUpTeeTimeId: \"\",\n golfNowTeeTimeId: \"\",\n lightSpeedTeeTimeId: \"\",\n openSpots: 0,\n price: 0,\n isLive: false,\n vendorUnitId: 0,\n productRateId: 0\n });\n current.add(10, 'minutes');\n }\n\n setTeeTimes(rateTeeTimes);\n }\n\n function populateStartTimes() {\n // Set the tee times.\n let rateTeeTimes: TimeOption[] = [];\n let start = moment(\"00:00\", 'HH:mm');\n let end = moment(\"23:00\", 'HH:mm');\n let current = moment(start);\n while (current <= end) {\n rateTeeTimes.push({\n value: current.format('HH:mm'),\n label: current.format('hh:mm a'),\n foreUpTeeTimeId: \"\",\n golfNowTeeTimeId: \"\",\n lightSpeedTeeTimeId: \"\",\n openSpots: 0,\n price: 0,\n isLive: false,\n vendorUnitId: 0,\n productRateId: 0\n });\n current.add(60, 'minutes');\n }\n\n setStartTimes(rateTeeTimes);\n }\n\n function getNumUnitsOptions(): JSX.Element[] {\n const options: JSX.Element[] = [];\n\n for (let index = 0; index < (!!vendorReservation ? vendorReservation.numGuests : 2); index++) {\n options.push();\n }\n\n return options;\n }\n\n function onSubmit(type: string, unit: any) {\n if (type === \"lodging\") {\n if (isStringEmpty(unit.confirmationNumber)) {\n setErrors({ unit });\n } else {\n setErrors({});\n setObj({\n itineraryUnitId: unit.id,\n checkIn: unit.checkIn,\n checkOut: unit.checkOut,\n confirmationNumber: unit.confirmationNumber,\n itineraryType: type\n });\n }\n }\n else if (type === \"golf\") {\n if (isStringEmpty(unit.confirmationNumber)) {\n setErrors({ unit });\n } else {\n setErrors({});\n setObj({\n itineraryUnitId: unit.id,\n playDate: unit.playDate,\n teeTime: unit.teeTime,\n confirmationNumber: unit.confirmationNumber,\n confirmedTime: unit.confirmedTime,\n itineraryType: type\n });\n }\n }\n else if (type === \"transport\") {\n if (isStringEmpty(unit.confirmationNumber)) {\n setErrors({ unit });\n } else {\n setErrors({});\n setObj({\n itineraryUnitId: unit.id,\n startDate: unit.startDate,\n endDate: unit.endDate,\n startTime: unit.startTime,\n endTime: unit.endTime,\n units: unit.units,\n confirmationNumber: unit.confirmationNumber,\n itineraryType: type\n });\n }\n }\n else if (type === \"custom\") {\n if (isStringEmpty(unit.confirmationNumber)) {\n setErrors({ unit });\n } else {\n setErrors({});\n setObj({\n itineraryUnitId: unit.id,\n fromDate: unit.fromDate,\n toDate: unit.toDate,\n fromTime: unit.fromTime,\n toTime: unit.toTime,\n units: unit.units,\n confirmationNumber: unit.confirmationNumber,\n itineraryType: type\n });\n }\n }\n }\n\n useEffect(() => {\n populateTeeTimes();\n populateStartTimes();\n }, []);\n\n useEffect(() => {\n if (itineraryNumber === null || vendorParam === null) return;\n\n setVendorReservationRequest({ itineraryNumber, vendorId: vendorParam });\n }, []);\n\n useEffect(() => {\n if (updateResponse.data === null) return;\n\n console.log(\"updateResponse\", updateResponse);\n toast.success('Itinerary Updated!', { hideProgressBar: true });\n }, [updateResponse.data]);\n\n useEffect(() => {\n // listen for reservation response\n if (vendorConfirmationResponse.data === null) return;\n\n setVendorReservation(vendorConfirmationResponse.data.reservation);\n }, [vendorConfirmationResponse.data]);\n\n useEffect(() => {\n if (vendorReservation === undefined) return;\n\n vendorReservation.lodgingItineraries.forEach((li: any) => {\n li.itineraryUnits.forEach((unit: any) => {\n if (!unit.cancelled)\n lodgingUnits.push({ unit: unit, vendorName: li.vendorName });\n setVendorName(li.vendorName);\n })\n });\n\n vendorReservation.golfItineraries.forEach((gi: any) => {\n gi.itineraryUnits.forEach((unit: any) => {\n if (!unit.cancelled)\n golfUnits.push({ unit: unit, vendorName: gi.vendorName });\n setVendorName(gi.vendorName);\n })\n });\n\n vendorReservation.transportItineraries.forEach((ti: any) => {\n ti.itineraryUnits.forEach((unit: any) => {\n if (!unit.cancelled)\n transportUnits.push({ unit: unit, vendorName: ti.vendorName });\n setVendorName(ti.vendorName);\n })\n });\n\n vendorReservation.customItineraries.forEach((ci: any) => {\n ci.itineraryUnits.forEach((unit: any) => {\n if (!unit.cancelled)\n customUnits.push({ unit: unit, vendorName: ci.vendorName });\n setVendorName(ci.vendorName);\n })\n });\n }, [vendorReservation]);\n\n return (\n
\n {vendorConfirmationResponse.isLoading && (\n Loading...\n )}\n {!vendorConfirmationResponse.isLoading && (\n
\n \n {vendorReservation !== undefined && vendorReservation.brand !== undefined && (\n

Automated Booking Link From: {vendorReservation.brand.companyName}

\n )}\n

Step 1. \n Carefully review the details below and enter exact tee time, confirmation or reference number into the fields.\n

\n

Step 2. \n Please confirm the NET rate to be billed to {vendorReservation !== undefined && vendorReservation.brand !== undefined && (\n {vendorReservation.brand.companyName}.\n )}\n

\n

Step 3. \n Press save & wait for the confirmation message.\n

\n\n

{vendorName}

\n {!!vendorReservation && !!vendorReservation.leadCustomer && (\n

Guest Name: {`${vendorReservation.leadCustomer.firstName} ${vendorReservation.leadCustomer.lastName}`}

\n )}\n\n \n {lodgingUnits !== undefined && lodgingUnits.map((item: any, index: number) =>\n <>\n \n
\n

Unit Type: {item.unit.vendorUnit.unitName}

\n

Net Rate $: {item.unit.net}

\n\n \n \n \n # of Guests\n \n \n \n \n \n # of Units\n \n \n \n \n\n \n
\n \n Arrive\n \n this.to.getInput().focus(),\n }}\n onDayChange={(date: Date) => checkInDateChanged(index, date)}\n />\n
\n\n
\n \n Depart\n \n checkOutDateChanged(index, date)}\n />\n
\n
\n\n \n Confirmation Number\n \n \n {\n item.unit.confirmationNumber = e.target.value;\n }}\n isInvalid={errors.unit !== undefined && errors.unit.id === item.unit.id}\n />\n \n \n \n \n\n \n {/* \n {\"Required\"}\n */}\n \n
\n \n
\n \n )}\n\n {golfUnits !== undefined && golfUnits.map((item: any, index: number) =>\n <>\n \n
\n

{item.unit.vendorUnit.unitName}

\n

Net Rate $: {item.unit.net}

\n\n \n
\n \n Date of Play\n \n this.to.getInput().focus(),\n }}\n onDayChange={(date: Date) => playDateChanged(index, date)}\n />\n
\n \n \n # of Players\n \n {\n // item.unit.confirmationNumber = e.target.value;\n // }}\n />\n \n
\n\n \n
\n \n Tee Time\n \n teeTimeChanged(index, e.currentTarget.value)}>\n {teeTimesOptions}\n \n
\n\n
\n \n Confirmed Time\n \n {\n golfConfirmedTimeChanged(index, event.target.value);\n }}\n />\n
\n
\n\n \n Confirmation Number\n \n \n {\n item.unit.confirmationNumber = e.target.value;\n }}\n // isValid={props.validate && props.validateFields.includes(`emailSubject_${props.keyId}`) && !!quoteTemplate.emailSubject}\n isInvalid={errors.unit !== undefined && errors.unit.id === item.unit.id}\n />\n \n \n \n \n\n \n {/* \n {\"Required\"}\n */}\n \n\n
\n \n
\n \n )}\n\n {transportUnits !== undefined && transportUnits.map((item: any, index: number) => {\n const productType = item.unit.vendorUnit.productRate.productRateTypeId as EnumProductRateType;\n const rangePickerMode = productType == EnumProductRateType.DayRange;\n const isHourlyRate = productType == EnumProductRateType.HoursPerUnit;\n const isUnitRate = productType == EnumProductRateType.UnitQtyRange;\n const isDailyRate = productType == EnumProductRateType.DayRange;\n\n return (\n <>\n \n
\n

{item.unit.vendorUnit.unitName}

\n

Net Rate $: {item.unit.net}

\n\n \n
\n \n Start Date\n \n this.to.getInput().focus(),\n }}\n onDayChange={(date: Date) => startDateChanged(\"transport\", index, date)}\n />\n
\n {rangePickerMode && (\n
\n \n End Date\n \n endDateChanged(\"transport\", index, date)}\n />\n
\n )}\n
\n \n
\n \n Start Time\n \n { startTimeChanged(\"transport\", index, event.currentTarget.value) }}\n >\n\n {startTimeOptions}\n \n
\n\n {/* To Time Select */}\n {(isHourlyRate || isDailyRate) && (\n
\n \n End Time\n \n { endTimeChanged(\"transport\", index, event.currentTarget.value) }}\n >\n\n {startTimeOptions}\n \n
\n )}\n\n
\n \n Units\n \n { unitsChanged(\"transport\", index, event.currentTarget.value) }}\n >\n {getNumUnitsOptions()}\n \n
\n
\n\n \n Confirmation Number\n \n \n {\n item.unit.confirmationNumber = e.target.value;\n }}\n isInvalid={errors.unit !== undefined && errors.unit.id === item.unit.id}\n />\n \n \n \n \n\n \n {/* \n {\"Required\"}\n */}\n \n
\n \n
\n \n )\n }\n )}\n\n {customUnits !== undefined && customUnits.map((item: any, index: number) => {\n const productType = item.unit.vendorUnit.productRate.productRateTypeId as EnumProductRateType;\n const rangePickerMode = productType == EnumProductRateType.DayRange;\n const isHourlyRate = productType == EnumProductRateType.HoursPerUnit;\n const isUnitRate = productType == EnumProductRateType.UnitQtyRange;\n const isDailyRate = productType == EnumProductRateType.DayRange;\n\n return (\n <>\n \n
\n

{item.unit.vendorUnit.unitName}

\n

Net Rate $: {item.unit.net}

\n\n \n
\n \n From Date\n \n this.to.getInput().focus(),\n }}\n onDayChange={(date: Date) => startDateChanged(\"custom\", index, date)}\n />\n
\n {rangePickerMode && (\n
\n \n To Date\n \n endDateChanged(\"custom\", index, date)}\n />\n
\n )}\n
\n \n
\n \n From Time\n \n { startTimeChanged(\"custom\", index, event.currentTarget.value) }}\n >\n\n {startTimeOptions}\n \n
\n\n {/* To Time Select */}\n {(isHourlyRate || isDailyRate) && (\n
\n \n To Time\n \n { endTimeChanged(\"custom\", index, event.currentTarget.value) }}\n >\n\n {startTimeOptions}\n \n
\n )}\n\n
\n \n Units\n \n { unitsChanged(\"custom\", index, event.currentTarget.value) }}\n >\n {getNumUnitsOptions()}\n \n
\n
\n\n \n Confirmation Number\n \n \n {\n item.unit.confirmationNumber = e.target.value;\n }}\n isInvalid={errors.unit !== undefined && errors.unit.id === item.unit.id}\n />\n \n \n \n \n\n \n {/* \n {\"Required\"}\n */}\n \n
\n \n
\n \n )\n }\n )}\n
\n \n
\n )}\n
\n );\n}\n\nexport default VendorConfirmation","import \"./start-widget.css\";\nimport React, { useState, useEffect, useRef } from \"react\";\nimport Widget from \"./widget/Widget\";\nimport VendorConfirmation from \"../confirmation/VendorConfirmation\";\nimport { Constants } from \"../../../_helpers/Constants\";\n\nconst StartWidget: React.FC = () => {\n const queryString = window.location.href;\n const urlParams = new URLSearchParams(queryString);\n\n const idParam = urlParams.get(\"id\");\n const reservationParam = urlParams.get(\"itineraryNumber\");\n const customerParam = urlParams.get(\"customerId\");\n const vendorParam = urlParams.get(\"vendorId\");\n const autoScroll = urlParams.get(\"autoScroll\");\n let campaignIdParam = urlParams.get(\"campaignId\");\n const packageParam = urlParams.get(\"pkg\");\n\n if (campaignIdParam) {\n // set the param in local storage to be reused if lost in traversal\n window.localStorage.setItem(\"isAdConversion\", \"true\");\n } else {\n campaignIdParam = window.localStorage.getItem(\"isAdConversion\");\n }\n\n return (\n
\n {(vendorParam === null || vendorParam === undefined) && (\n \n )}\n\n {(vendorParam !== null && vendorParam !== undefined && reservationParam !== null && reservationParam !== undefined) && (\n \n )}\n\n {(vendorParam !== null && vendorParam !== undefined && (reservationParam === null || reservationParam === undefined)) && (\n \n )}\n
\n )\n}\n\nexport default StartWidget","import \"../main-content/main-content.css\";\nimport React from \"react\";\nimport StartWidget from \"../start-widget/StartWidget\";\n\nfunction MainContent() {\n return (\n \n
\n \n
\n
\n );\n}\n\nexport default MainContent;","import React from \"react\";\nimport MainContent from \"./components/common/main-content/MainContent\";\nimport { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\nimport { toast, Zoom } from 'react-toastify';\nimport 'react-toastify/dist/ReactToastify.css';\n\ntoast.configure({\n position: \"top-center\",\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n transition: Zoom\n})\n\nconst App: React.FC = () => {\n return (\n \n \n \n \n \n );\n};\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(\n (process as { env: { [key: string]: string } }).env.PUBLIC_URL,\n window.location.href\n );\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import \"bootstrap/dist/css/bootstrap.min.css\";\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport \"./index.css\";\nimport App from \"./App\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nReactDOM.render(, document.getElementById(\"root\"));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}