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YAAajG,EAAKQ,GAAG,UACrB,iBAAkB0I,EAClB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAmB,GACnB5L,SAAUI,EAAQkE,WAClB,sBAAuB2H,EACvBY,aAAcd,EACde,WAAYd,EACZlD,mBAAmBhG,EAAAA,EAAAA,IAAOqJ,IACzB,CACD,kBAAkBnD,EAAAA,EAAAA,KAAS,IAAM,EAC/B3K,EAAAA,EAAAA,GAAoB,MAAO,CACzBF,OAAOyF,EAAAA,EAAAA,IAAgB,CAAC,yCAA0C,CAChE,sBAAsBd,EAAAA,EAAAA,IAAO6H,OAE9B,EACD5H,EAAAA,EAAAA,IAAaC,EAAAA,EAAgB,CAAEsF,KAAM,MACrCjK,EAAAA,EAAAA,GAAoB,OAAQ,MAAM4E,EAAAA,EAAAA,IAAiBP,EAAKQ,GAAG,2CAA4C,IACtG,MAEL,kBAAkB8F,EAAAA,EAAAA,KAAS,IAAM,KACjCC,EAAG,GACF,EAAG,CAAC,cAAe,SAAU,QAAS,cAAe,WAAY,8BAM7E,I,WC9UD,MAAMhF,GAA2B,OAAgB,EAAQ,CAAC,CAAC,YAAY,qBAEvE,O","sources":["webpack://touringery/./node_modules/date-fns/esm/startOfToday/index.js","webpack://touringery/./src/components/public/ExperienceAvailabilityPicker.vue?14ec","webpack://touringery/./src/components/public/ExperienceAvailabilityPicker.vue","webpack://touringery/./src/components/public/ExperienceSearch.vue?81c5","webpack://touringery/./src/components/public/ExperienceSearch.vue","webpack://touringery/./src/components/public/housing/HousingResultCardSearch.vue?58de","webpack://touringery/./src/components/public/housing/HousingResultCardSearch.vue"],"sourcesContent":["import startOfDay from \"../startOfDay/index.js\";\n/**\n * @name startOfToday\n * @category Day Helpers\n * @summary Return the start of today.\n * @pure false\n *\n * @description\n * Return the start of today.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * @returns {Date} the start of today\n *\n * @example\n * // If today is 6 October 2014:\n * const result = startOfToday()\n * //=> Mon Oct 6 2014 00:00:00\n */\n\nexport default function startOfToday() {\n return startOfDay(Date.now());\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, renderList as _renderList, Fragment as _Fragment, normalizeClass as _normalizeClass, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5aa0daf8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"experience-availability\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"hr\", { class: \"experience-availability__section-divider\" }, null, -1))\nconst _hoisted_3 = { class: \"experience-availability__section-wrapper\" }\nconst _hoisted_4 = {\n key: 0,\n class: \"experience-availability__section-loading\"\n}\nconst _hoisted_5 = {\n key: 1,\n class: \"experience-availability__section\"\n}\nconst _hoisted_6 = { class: \"experience-availability__sub-section experience-availability__sub-section-start\" }\nconst _hoisted_7 = { class: \"experience-availability__choice-section\" }\nconst _hoisted_8 = { class: \"experience-availability__choice-wrapper\" }\nconst _hoisted_9 = { class: \"experience-availability__sub-section experience-availability__sub-section-duration\" }\nconst _hoisted_10 = { class: \"experience-availability__choice-section\" }\nconst _hoisted_11 = { class: \"experience-availability__choice-wrapper\" }\n\nimport BaseTag from '@/components/BaseTag.vue'\nimport LoadingSpinner from '@/components/LoadingSpinner.vue'\nimport { formatMinutesToDuration } from '@/utils/formatters'\nimport { PropType, ref, watch } from 'vue'\nimport {\n ExperiencePeriodAvailabilityPayload,\n ExperienceTimeslot,\n PublicServiceDetails,\n} from '@/models/public/service.model'\nimport { useFetchExperienceDetailedAvailability } from '@/queries/public/services'\nimport { DurationMinutes, StringDateTime } from '@/models/shared.model'\nimport { format, parseISO } from 'date-fns'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExperienceAvailabilityPicker',\n props: {\n service: {\n type: Object as PropType,\n required: true,\n },\n date: {\n type: Object as PropType,\n required: true,\n },\n groupSize: {\n type: Number,\n required: true,\n },\n time: {\n type: String,\n default: null,\n },\n duration: {\n type: Number,\n default: null,\n },\n excludedReservations: {\n type: Array as PropType,\n default: () => [],\n },\n disabled: {\n type: Boolean,\n default: null,\n },\n},\n emits: ['fetchInfo'],\n setup(__props, { emit }) {\n\nconst props = __props\n\n\n\nconst experienceTimeSlots = ref(null)\n\nconst experienceTimeChips = ref([])\nconst selectedTime = ref(null)\nconst experienceDurationChips = ref([])\nconst selectedDuration = ref(null)\n\nconst selectedTimeSlot = ref(null)\n\nconst {\n mutateAsync: fetchExperienceDetailedAvailability,\n isLoading: isLoadingTimeSlots,\n} = useFetchExperienceDetailedAvailability(props.service.hash_id)\n\nfunction fetchTimeSlots(date: Date) {\n fetchExperienceDetailedAvailability({\n date: date,\n group_size: props.groupSize,\n excluded_reservations: props.excludedReservations,\n })\n .then((data) => {\n experienceTimeSlots.value = data\n setExperienceTimeChips(data)\n setExperienceDurationChips(data)\n })\n .catch(() => {\n experienceTimeSlots.value = []\n })\n}\n\nfunction setExperienceTimeChips(timeSlotList: ExperienceTimeslot[]) {\n experienceTimeChips.value = []\n timeSlotList.forEach((timeSlot: ExperienceTimeslot) => {\n if (!experienceTimeChips.value.includes(timeSlot.start)) {\n experienceTimeChips.value.push(timeSlot.start)\n }\n })\n}\n\nfunction setExperienceDurationChips(timeSlotList: ExperienceTimeslot[]) {\n experienceDurationChips.value = []\n timeSlotList.forEach((timeSlot: ExperienceTimeslot) => {\n if (!experienceDurationChips.value.includes(timeSlot.duration)) {\n experienceDurationChips.value.push(timeSlot.duration)\n }\n })\n}\n\nfunction filterExperienceTimeSlotsByTime() {\n if (!experienceTimeSlots.value) return []\n return experienceTimeSlots.value.filter((timeSlot: ExperienceTimeslot) => {\n return timeSlot.start === selectedTime.value\n })\n}\n\nfunction filterExperienceTimeSlotsByDuration() {\n if (!experienceTimeSlots.value) return []\n return experienceTimeSlots.value.filter((timeSlot: ExperienceTimeslot) => {\n return timeSlot.duration === selectedDuration.value\n })\n}\n\nwatch([() => selectedTime.value, () => selectedDuration.value], () => {\n if (!experienceTimeSlots.value) return null\n if (selectedTime.value && selectedDuration.value) {\n // TimeSlot is selected and experienceInfo can be fetched\n selectedTimeSlot.value =\n experienceTimeSlots.value.find(\n (timeSlot: ExperienceTimeslot) =>\n timeSlot.start === selectedTime.value &&\n timeSlot.duration === selectedDuration.value,\n ) ?? null\n } else if (selectedTime.value && !selectedDuration.value) {\n // Time hase been selected and available duration is refiltered\n setExperienceDurationChips(filterExperienceTimeSlotsByTime())\n } else if (selectedDuration.value && !selectedTime.value) {\n // Duration hase been selected and available time is refiltered\n setExperienceTimeChips(filterExperienceTimeSlotsByDuration())\n } else {\n // Set default chips\n emit('fetchInfo', null)\n setExperienceTimeChips(experienceTimeSlots.value)\n setExperienceDurationChips(experienceTimeSlots.value)\n }\n})\n\nwatch([() => selectedTimeSlot.value, () => props.groupSize], () => {\n if (selectedTimeSlot.value) {\n const payload: ExperiencePeriodAvailabilityPayload = {\n start: selectedTimeSlot.value.start,\n end: selectedTimeSlot.value.end,\n group_size: props.groupSize,\n }\n\n emit('fetchInfo', payload)\n }\n})\n\nwatch(\n () => props.date,\n () => {\n selectedTime.value = props.time || null\n selectedDuration.value = props.duration || null\n selectedTimeSlot.value = null\n emit('fetchInfo', null)\n fetchTimeSlots(props.date)\n },\n { immediate: true },\n)\n\nwatch(\n () => props.time,\n () => {\n selectedTime.value = props.time\n },\n { immediate: true },\n)\n\nwatch(\n () => props.duration,\n () => {\n selectedDuration.value = props.duration\n },\n { immediate: true },\n)\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createElementVNode(\"div\", _hoisted_3, [\n (_unref(isLoadingTimeSlots))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n _createVNode(LoadingSpinner)\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _createElementVNode(\"h6\", null, _toDisplayString(_ctx.$t('start')), 1),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"div\", _hoisted_8, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(experienceTimeChips.value, (dateTime, timeIndex) => {\n return (_openBlock(), _createBlock(BaseTag, {\n key: timeIndex,\n label: _unref(format)(_unref(parseISO)(dateTime), 'HH:mm'),\n \"hide-close\": \"\",\n disabled: __props.disabled,\n class: _normalizeClass([\"experience-availability__choice\", [\n selectedTime.value === dateTime &&\n 'experience-availability__choice-selected',\n ]]),\n onClick: ($event: any) => (\n selectedTime.value = selectedTime.value !== dateTime ? dateTime : null\n )\n }, null, 8, [\"label\", \"disabled\", \"class\", \"onClick\"]))\n }), 128))\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _createElementVNode(\"h6\", null, _toDisplayString(_ctx.$t('duration')), 1),\n _createElementVNode(\"div\", _hoisted_10, [\n _createElementVNode(\"div\", _hoisted_11, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(experienceDurationChips.value, (duration, durationIndex) => {\n return (_openBlock(), _createBlock(BaseTag, {\n key: durationIndex,\n label: _unref(formatMinutesToDuration)(duration),\n \"hide-close\": \"\",\n disabled: __props.disabled,\n class: _normalizeClass([\"experience-availability__choice\", [\n selectedDuration.value === duration &&\n 'experience-availability__choice-selected',\n ]]),\n onClick: ($event: any) => (\n selectedDuration.value =\n selectedDuration.value !== duration ? duration : null\n )\n }, null, 8, [\"label\", \"disabled\", \"class\", \"onClick\"]))\n }), 128))\n ])\n ])\n ])\n ]))\n ])\n ]))\n}\n}\n\n})","import script from \"./ExperienceAvailabilityPicker.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./ExperienceAvailabilityPicker.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./ExperienceAvailabilityPicker.vue?vue&type=style&index=0&id=5aa0daf8&scoped=true&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/touringery-frontend/touringery-frontend/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5aa0daf8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, withCtx as _withCtx, createTextVNode as _createTextVNode, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3695d9d3\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"experience-search__section-wrapper\" }\nconst _hoisted_2 = { class: \"experience-search__section\" }\nconst _hoisted_3 = { class: \"experience-search__section__date\" }\nconst _hoisted_4 = { class: \"experience-search__title\" }\nconst _hoisted_5 = { class: \"experience-search__date-controls\" }\nconst _hoisted_6 = {\n key: 0,\n class: \"experience-search__availabilities-loading\"\n}\nconst _hoisted_7 = { class: \"experience-search__section__participants\" }\nconst _hoisted_8 = { class: \"experience-search__title\" }\nconst _hoisted_9 = { class: \"experience-search__quantity-wrapper\" }\n\nimport BaseIcon from '@/components/BaseIcon.vue'\nimport BaseButton from '@/components/BaseButton.vue'\nimport DatePicker from '@/components/DatePicker.vue'\nimport AlertBanner from '@/components/AlertBanner.vue'\nimport LoadingSpinner from '@/components/LoadingSpinner.vue'\nimport BaseNumberIncrementer from '@/components/BaseNumberIncrementer.vue'\nimport ExperienceAvailabilityPicker from '@/components/public/ExperienceAvailabilityPicker.vue'\nimport { FORMATS, SIZES, ALERT_TYPES } from '@/enums/components'\nimport { computed, onMounted, PropType, reactive, ref, watch } from 'vue'\nimport { StringDate } from '@/models/shared.model'\nimport { useFetchExperiencePeriodAvailability } from '@/queries/public/services'\nimport { formatDateTime } from '@/utils/formatters'\nimport {\n ExperiencePeriodAvailability,\n ExperiencePeriodAvailabilitySearch,\n PublicServiceDetails,\n} from '@/models/public/service.model'\nimport { useOrderStore } from '@/store/order'\nimport format from 'date-fns/format'\nimport endOfMonth from 'date-fns/endOfMonth'\nimport { serviceResultCardCommonProps } from '@/enums/public'\n\n\nconst enum CALENDAR_STATE {\n PREVIOUS = 'PREVIOUS',\n CURRENT = 'CURRENT',\n NEXT = 'NEXT',\n}\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExperienceSearch',\n props: {\n selectedDate: {\n type: Date as PropType,\n default: null,\n },\n selectedGroupSize: {\n type: Number as PropType,\n default: undefined,\n },\n service: {\n type: Object as PropType,\n required: true,\n },\n isDisabled: {\n type: Boolean,\n default: false,\n },\n groupService: serviceResultCardCommonProps.groupService,\n time: {\n type: String,\n default: null,\n },\n duration: {\n type: Number,\n default: null,\n },\n excludedReservations: {\n type: Array as PropType,\n default: () => [],\n },\n},\n emits: ['fetchInfo'],\n setup(__props, { emit }) {\n\nconst props = __props\n\nconst orderStore = useOrderStore()\n\n\n\nconst currentCalendarAvailability = ref([])\nconst previewCalendarAvailability = ref([])\nconst err = ref(false)\n\nconst errors = ref | undefined>(undefined)\n\nconst currentState = reactive({\n pickerYearMonth: {\n instance: 0,\n month: new Date().getMonth(),\n year: new Date().getFullYear(),\n },\n selectedDate: props.selectedDate,\n group_size: props.selectedGroupSize ?? props.service?.min_group_size,\n})\n\nconst previewState = reactive({\n pickerYearMonth: {\n instance: 0,\n month: new Date().getMonth(),\n year: new Date().getFullYear(),\n },\n selectedDate: null,\n})\n\nconst currentAvailableDates = computed(() => {\n const availabilities = currentCalendarAvailability.value || []\n\n const dates = availabilities\n .filter((item: ExperiencePeriodAvailability) => item.is_available)\n .map((item: ExperiencePeriodAvailability) => item.date)\n\n return dates\n})\n\nconst previewAvailableDates = computed(() => {\n const availabilities = previewCalendarAvailability.value || []\n\n const dates = availabilities\n .filter((item: ExperiencePeriodAvailability) => item.is_available)\n .map((item: ExperiencePeriodAvailability) => item.date)\n\n return dates\n})\n\nconst selectedDateIndex = computed(() => {\n return currentAvailableDates.value.findIndex(\n (date) => date === formatDateTime(currentState.selectedDate, 'yyyy-mm-dd'),\n )\n})\n\nconst {\n mutateAsync: fetchExperiencePeriodAvailability,\n isLoading: isLoadingExperiencePeriodAvailability,\n} = useFetchExperiencePeriodAvailability(props.service.hash_id)\n\nconst getIsDateDisabled = (date: Date): boolean => {\n if (isLoadingExperiencePeriodAvailability.value) return true\n const dateStr: StringDate = formatDateTime(date)\n return !previewAvailableDates.value.includes(dateStr)\n}\n\nconst fetchPeriodAvailability = (calendarState: CALENDAR_STATE) => {\n changeMonth(calendarState)\n const firstDayOfMonth = new Date(\n previewState.pickerYearMonth.year,\n previewState.pickerYearMonth.month,\n 1,\n )\n\n const payload = {\n start: format(firstDayOfMonth, 'yyyy-MM-dd'),\n end: format(endOfMonth(firstDayOfMonth), 'yyyy-MM-dd'),\n group_size: props.service?.min_group_size,\n group_service: props.groupService,\n }\n fetchExperiencePeriodAvailability(payload)\n .then((data) => {\n if (!currentCalendarAvailability.value.length) {\n // Initialize state\n currentCalendarAvailability.value = data\n }\n previewCalendarAvailability.value = data\n })\n .then(() => {\n fetchResponseHandler(calendarState)\n })\n .catch((error) => {\n currentCalendarAvailability.value = []\n return error\n })\n}\n\nfunction synchronizePreviewState() {\n if (currentState.selectedDate) {\n previewCalendarAvailability.value = currentCalendarAvailability.value\n previewState.pickerYearMonth.month = currentState.selectedDate.getMonth()\n previewState.pickerYearMonth.year = currentState.selectedDate.getFullYear()\n }\n}\n\nfunction periodSelected(value: Date) {\n err.value = false\n previewState.selectedDate = value\n currentCalendarAvailability.value = previewCalendarAvailability.value\n Object.assign(currentState, previewState)\n}\n\nfunction changeMonth(calendarState: CALENDAR_STATE) {\n if (calendarState === CALENDAR_STATE.CURRENT) return\n else if (calendarState === CALENDAR_STATE.PREVIOUS) {\n if (currentState.pickerYearMonth.month === 0)\n currentState.pickerYearMonth.month = 11\n else currentState.pickerYearMonth.month -= 1\n } else if (calendarState === CALENDAR_STATE.NEXT) {\n if (currentState.pickerYearMonth.month === 11)\n currentState.pickerYearMonth.month = 0\n else currentState.pickerYearMonth.month += 1\n }\n}\n\nfunction previousDate() {\n err.value = false\n if (!currentState.selectedDate) return null\n emit('fetchInfo', null)\n // Check if the current selected date is first in the list\n if (selectedDateIndex.value <= 0) {\n // Change month and avaible dates. Preselect next date and refetech avaiable dates\n fetchPeriodAvailability(CALENDAR_STATE.PREVIOUS)\n } else {\n const newDate = new Date(\n currentAvailableDates.value[selectedDateIndex.value - 1],\n )\n currentState.selectedDate = newDate\n synchronizePreviewState()\n }\n}\n\nfunction nextDate() {\n err.value = false\n if (!currentState.selectedDate) return null\n emit('fetchInfo', null)\n // Check if the current selected date is last in the list\n if (selectedDateIndex.value === currentAvailableDates.value.length - 1) {\n // Change month and avaible dates. Preselect next date and refetech avaiable dates\n fetchPeriodAvailability(CALENDAR_STATE.NEXT)\n } else {\n const newDate = new Date(\n currentAvailableDates.value[selectedDateIndex.value + 1],\n )\n currentState.selectedDate = newDate\n synchronizePreviewState()\n }\n}\n\nfunction fetchResponseHandler(claendartState: CALENDAR_STATE) {\n if (!previewAvailableDates.value.length) {\n let newDate = null\n if (claendartState === CALENDAR_STATE.NEXT) {\n newDate = previewCalendarAvailability.value[0].date\n } else {\n newDate =\n previewCalendarAvailability.value[\n previewCalendarAvailability.value.length - 1\n ].date\n }\n periodSelected(new Date(newDate))\n err.value = true\n } else if (claendartState !== CALENDAR_STATE.CURRENT) {\n let newDate = null\n if (claendartState === CALENDAR_STATE.NEXT) {\n newDate = previewAvailableDates.value[0]\n } else {\n newDate =\n previewAvailableDates.value[previewAvailableDates.value.length - 1]\n }\n periodSelected(new Date(newDate))\n }\n}\n\nwatch(\n () => props.selectedDate,\n () => {\n currentState.selectedDate = props.selectedDate\n },\n)\n\nwatch(\n () => props.selectedGroupSize,\n () => {\n currentState.group_size = props.selectedGroupSize\n },\n)\n\nwatch([() => currentState.selectedDate, () => currentState.group_size], () => {\n const payload: ExperiencePeriodAvailabilitySearch = {\n start: null,\n end: null,\n group_size: currentState.group_size,\n }\n if (currentState.selectedDate) {\n payload.start = currentState.selectedDate\n }\n orderStore.updateAvailabilitySearch(payload)\n})\n\nonMounted(() => {\n // const sessionPayload = sessionStorage.getItem('availiability-search')\n // if (sessionPayload) {\n // const payload: ExperiencePeriodAvailabilitySearch =\n // JSON.parse(sessionPayload)\n // if (payload.start) {\n // currentState.selectedDate = new Date(payload.start)\n // }\n // currentState.group_size = payload.group_size\n // }\n fetchPeriodAvailability(CALENDAR_STATE.CURRENT)\n})\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"h4\", _hoisted_4, _toDisplayString(_ctx.$t('whenAreYouGoing')), 1),\n (currentState.selectedDate && err.value)\n ? (_openBlock(), _createBlock(AlertBanner, {\n key: 0,\n text: _ctx.$t('noAvaiableDatesInMonth'),\n \"alert-type\": _unref(ALERT_TYPES).WARNING\n }, null, 8, [\"text\", \"alert-type\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_5, [\n _createVNode(BaseButton, {\n format: _unref(FORMATS).ICON_CIRCULAR,\n size: _unref(SIZES).SMALL,\n \"icon-size\": 32,\n disabled: \n !currentState.selectedDate ||\n _unref(isLoadingExperiencePeriodAvailability)\n ,\n type: \"button\",\n icon: \"chevron-left\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (previousDate()))\n }, null, 8, [\"format\", \"size\", \"disabled\"]),\n _createVNode(DatePicker, {\n \"model-value\": currentState.selectedDate,\n \"min-date\": new Date(),\n \"month-change-on-scroll\": false,\n \"month-change-on-arrows\": false,\n \"disabled-dates\": getIsDateDisabled,\n disabled: __props.isDisabled,\n placeholder: _ctx.$t('selectDate'),\n \"keep-action-row\": \"\",\n clearable: \"\",\n class: _normalizeClass([\"experience-search__date-input\", {\n 'experience-search__input--error': errors.value?.start || errors.value?.end,\n }]),\n name: \"period\",\n errors: [...(errors.value?.start as Array || []), ...(errors.value?.end as Array || [])],\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = (value) => periodSelected(value)),\n onUpdateMonthYear: _cache[2] || (_cache[2] = \n (value) => (\n (previewState.pickerYearMonth = value),\n fetchPeriodAvailability(CALENDAR_STATE.CURRENT)\n )\n ),\n onClosed: _cache[3] || (_cache[3] = ($event: any) => (synchronizePreviewState()))\n }, {\n \"action-preview\": _withCtx(() => [\n (_unref(isLoadingExperiencePeriodAvailability))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n _createVNode(LoadingSpinner),\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.$t('experienceSearch.calendarLoading')), 1)\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n \"action-buttons\": _withCtx(() => []),\n \"clear-icon\": _withCtx(() => [\n (_unref(isLoadingExperiencePeriodAvailability))\n ? (_openBlock(), _createBlock(LoadingSpinner, {\n key: 0,\n class: \"experience-search__loading\"\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }, 8, [\"model-value\", \"min-date\", \"disabled\", \"placeholder\", \"class\", \"errors\"]),\n _createVNode(BaseButton, {\n format: _unref(FORMATS).ICON_CIRCULAR,\n size: _unref(SIZES).SMALL,\n \"icon-size\": 32,\n disabled: \n !currentState.selectedDate ||\n _unref(isLoadingExperiencePeriodAvailability)\n ,\n \"icon-right\": \"\",\n type: \"button\",\n icon: \"chevron-right\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (nextDate()))\n }, null, 8, [\"format\", \"size\", \"disabled\"])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"h4\", _hoisted_8, _toDisplayString(_ctx.$t('howManyAreYou')), 1),\n _createVNode(BaseNumberIncrementer, {\n amount: currentState.group_size,\n errors: errors.value?.group_size,\n \"min-amount\": __props.service.min_group_size,\n \"max-amount\": __props.service.max_group_size,\n disabled: __props.isDisabled,\n class: \"experience-search__input\",\n onClickMinus: _cache[5] || (_cache[5] = _withModifiers(() => (currentState.group_size -= 1), [\"prevent\"])),\n onClickPlus: _cache[6] || (_cache[6] = _withModifiers(() => (currentState.group_size += 1), [\"prevent\"]))\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_9, [\n _createVNode(BaseIcon, {\n size: 20,\n icon: \"user\"\n }),\n _createTextVNode(\"x \" + _toDisplayString(currentState.group_size), 1)\n ])\n ]),\n _: 1\n }, 8, [\"amount\", \"errors\", \"min-amount\", \"max-amount\", \"disabled\"])\n ])\n ]),\n (currentState.selectedDate && _unref(currentAvailableDates).length)\n ? (_openBlock(), _createBlock(ExperienceAvailabilityPicker, {\n key: 0,\n service: __props.service,\n date: currentState.selectedDate,\n \"group-size\": currentState.group_size,\n time: __props.time,\n duration: __props.duration,\n disabled: __props.isDisabled,\n \"excluded-reservations\": __props.excludedReservations,\n onFetchInfo: _cache[7] || (_cache[7] = (payload) => emit('fetchInfo', payload))\n }, null, 8, [\"service\", \"date\", \"group-size\", \"time\", \"duration\", \"disabled\", \"excluded-reservations\"]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ExperienceSearch.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./ExperienceSearch.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./ExperienceSearch.vue?vue&type=style&index=0&id=3695d9d3&scoped=true&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/touringery-frontend/touringery-frontend/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3695d9d3\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, createVNode as _createVNode, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4ad06f18\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"housing-search__section-wrapper\" }\nconst _hoisted_2 = { class: \"housing-search__section\" }\nconst _hoisted_3 = { class: \"housing-search__section__date\" }\nconst _hoisted_4 = { class: \"housing-search__title\" }\nconst _hoisted_5 = { class: \"housing-search__date-controls\" }\n\nimport DatePicker from '@/components/DatePicker.vue'\nimport LoadingSpinner from '@/components/LoadingSpinner.vue'\nimport { computed, PropType, reactive, ref, watch } from 'vue'\nimport {\n useFetchCompanyPeriodAvailability,\n useQueryCompanyHousingDateAvailabilityList,\n} from '@/queries/public/services'\nimport { formatDateTime } from '@/utils/formatters'\nimport {\n CompanyHousingDateAvailability,\n PeriodAvailability,\n PeriodAvailabilityPayload,\n PublicServiceDetails,\n} from '@/models/public/service.model'\nimport format from 'date-fns/format'\nimport { HousingAvailabilityPayload } from '@/models/public/order.model'\nimport subDays from 'date-fns/subDays'\nimport addDays from 'date-fns/addDays'\nimport parseISO from 'date-fns/parseISO'\nimport { getValidationErrorData } from '@/utils/errors'\nimport { watchEffect } from 'vue'\nimport isSameDay from 'date-fns/isSameDay'\nimport startOfToday from 'date-fns/startOfToday'\nimport { serviceResultCardCommonProps } from '@/enums/public'\nimport { getYearMonthAsInterval } from '@/utils/calendar'\n\n\nimport { YearMonth } from '@/models/calendar.model'\nimport { StringDate } from '@/models/shared.model'\nimport { getYearMonthForDate } from '@/utils/calendar'\n\nexport interface State {\n periodPickerYearMonth: YearMonth\n}\n\nexport const initializePickerYearMonth = (\n date: Date | StringDate | null,\n): YearMonth => {\n if (!date) {\n date = new Date()\n } else {\n // In case of StringDate\n date = new Date(date)\n }\n\n return getYearMonthForDate(date)\n}\n\nexport const stateFieldMonthYearChange =\n (state: object, field: string) =>\n ({ month, year }: { month: number; year: number }) => {\n Object.assign(state, {\n [field]: { year, month },\n })\n }\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'HousingResultCardSearch',\n props: {\n modelValue: {\n type: Object as PropType,\n required: true,\n },\n service: {\n type: Object as PropType,\n required: true,\n },\n isDisabled: {\n type: Boolean,\n default: false,\n },\n groupService: serviceResultCardCommonProps.groupService,\n},\n emits: ['update:modelValue', 'periodAvailability'],\n setup(__props, { emit }) {\n\nconst props = __props\n\n\n\n\n\n// We update parent based on these changes\nconst selectedPeriod = ref(null)\n// For internal usage, to show disabled dates based on period start or end selection\nconst _periodStart = ref(props.modelValue.check_in)\nconst _periodEnd = ref(props.modelValue?.check_out)\n\nconst periodAvailability = ref(undefined)\n\nconst errors = ref | undefined>(undefined)\n\nconst state = reactive({\n // What month is open in datepicker. We use it to fetch and show availability per date.\n periodPickerYearMonth: initializePickerYearMonth(props.modelValue.check_in),\n})\n\n/**\n * Availabilities query to show date availabilities on the fly in the START date picker.\n */\nconst {\n data: calendarAvailability,\n isFetching: isLoadingCalendarAvailability,\n} = useQueryCompanyHousingDateAvailabilityList(\n computed(() => {\n const periodPickerInterval = getYearMonthAsInterval(\n state.periodPickerYearMonth,\n )\n let startDate = periodPickerInterval.start\n // Necessary for when we change calendar period after choosing period start\n if (_periodStart.value && _periodStart.value < startDate) {\n startDate = _periodStart.value\n }\n const endDate = periodPickerInterval.end\n return {\n company: props.service.company.id,\n // If we don't specify only this housing it will try to load for all housings, which is unnecessary.\n services: [props.service.hash_id],\n // Because stay period end's options are based on previous day's availability\n // we need to fetch the day before calendar's start as well\n start: format(subDays(startDate, 1), 'yyyy-MM-dd'),\n end: format(endDate, 'yyyy-MM-dd'),\n group_service: props.groupService,\n }\n }),\n)\n\n/**\n * START date picker's available dates based on availability endpoint information which is filtered and mapped to list of dates.\n */\nconst startAvailableDates = computed(() => {\n const availabilities = calendarAvailability.value || []\n\n return availabilities\n .filter((item: CompanyHousingDateAvailability) => {\n return item.is_available\n })\n .map((item: CompanyHousingDateAvailability) => item.date)\n})\n\n/**\n * END date picker's available dates based on availability endpoint information which is filtered and mapped to list of dates.\n *\n * For period end the date is available when the previous date is available.\n * That means given date's availability state actually represents next day's availabilty as reservation end date.\n * That is we requested availability for the day before calendar's first shown date and why we add a day here to all available dates.\n */\nconst endAvailableDates = computed(() => {\n const startDate = _periodStart.value\n ? parseISO(_periodStart.value)\n : startOfToday()\n let nextExpectedDate = addDays(startDate, 1)\n\n const availabilities = calendarAvailability.value || []\n const endDates = availabilities\n .filter((item: CompanyHousingDateAvailability) => {\n return item.is_available\n })\n .map((item: CompanyHousingDateAvailability) =>\n addDays(parseISO(item.date), 1),\n )\n\n // Start date must be in the options for DatePicker picking to work\n const formattedValidEndDates: StringDate[] = [format(startDate, 'yyyy-MM-dd')]\n for (const date of endDates) {\n if (isSameDay(date, nextExpectedDate)) {\n formattedValidEndDates.push(format(date, 'yyyy-MM-dd'))\n nextExpectedDate = addDays(nextExpectedDate, 1)\n }\n }\n return formattedValidEndDates\n})\n\nconst getPeriodDisabledDates = (date: Date) => {\n const dateStr: StringDate = formatDateTime(date)\n if (!!_periodStart.value && !_periodEnd.value) {\n return !endAvailableDates.value.includes(dateStr)\n }\n return !startAvailableDates.value.includes(dateStr)\n}\n\nconst periodErrors = computed(() => {\n const _errors = []\n _errors.push(...(errors.value?.start ?? []))\n _errors.push(...(errors.value?.check_in ?? []))\n _errors.push(...(errors.value?.end ?? []))\n _errors.push(...(errors.value?.check_out ?? []))\n return _errors\n})\n\nconst updatePeriodStart = (value) => {\n _periodStart.value = value ? format(value, 'yyyy-MM-dd') : null\n updatePeriodEnd(null)\n}\n\nconst updatePeriodEnd = (value) => {\n _periodEnd.value = value ? format(value, 'yyyy-MM-dd') : null\n}\n\nconst updateSelectedPeriod = (period: Date[] | null) => {\n if (period === null) {\n selectedPeriod.value = null\n }\n\n selectedPeriod.value = [\n format(period[0], 'yyyy-MM-dd'),\n format(period[1], 'yyyy-MM-dd'),\n ]\n}\n\nconst startMonthYearChange = stateFieldMonthYearChange(\n state,\n 'periodPickerYearMonth',\n)\n\nconst {\n mutateAsync: fetchPeriodAvailability,\n isLoading: isLoadingPeriodAvailability,\n} = useFetchCompanyPeriodAvailability()\n\nconst searchAvailability = async () => {\n if (!selectedPeriod.value) {\n return\n }\n\n errors.value = undefined\n const payload: PeriodAvailabilityPayload = {\n company: props.service.company?.id,\n services: [props.service.hash_id],\n start: selectedPeriod.value[0],\n end: selectedPeriod.value[1],\n }\n\n fetchPeriodAvailability(payload)\n .then((data) => {\n // we only care about current service's availability.\n // there should be 0-1 items related to this service\n periodAvailability.value = data.find(\n (item) => item.service.id === props.service.id,\n )\n })\n .catch((error) => {\n errors.value = getValidationErrorData(error)\n })\n}\n\nwatch(\n () => props.modelValue,\n () => {\n _periodStart.value = props.modelValue.check_in\n _periodEnd.value = props.modelValue.check_out\n\n if (_periodStart.value && _periodEnd.value) {\n selectedPeriod.value = [_periodStart.value, _periodEnd.value]\n } else {\n selectedPeriod.value = null\n }\n },\n { immediate: true },\n)\n\nwatch(\n selectedPeriod,\n (newVal, oldVal) => {\n if (newVal !== null && newVal !== oldVal) {\n searchAvailability()\n }\n },\n {\n immediate: true,\n },\n)\n\nwatchEffect(() => {\n emit('update:modelValue', {\n ...props.modelValue,\n check_in: selectedPeriod.value?.[0] ?? null,\n check_out: selectedPeriod.value?.[1] ?? null,\n })\n})\n\nwatchEffect(() => {\n emit('periodAvailability', periodAvailability.value)\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"h4\", _hoisted_4, _toDisplayString(_ctx.$t('whenAreYouGoing')), 1),\n _createElementVNode(\"div\", _hoisted_5, [\n _createVNode(DatePicker, {\n range: \"\",\n \"model-value\": selectedPeriod.value,\n \"min-range\": 1,\n \"no-disabled-range\": false,\n name: \"stayPeriod\",\n errors: _unref(periodErrors),\n class: _normalizeClass([\"housing-search__input\", {\n 'housing-search__input--error': _unref(periodErrors).length > 0,\n }]),\n placeholder: _ctx.$t('period'),\n \"disabled-dates\": getPeriodDisabledDates,\n \"month-change-on-scroll\": false,\n \"month-change-on-arrows\": false,\n \"keep-action-row\": \"\",\n disabled: __props.isDisabled,\n \"onUpdate:modelValue\": updateSelectedPeriod,\n onRangeStart: updatePeriodStart,\n onRangeEnd: updatePeriodEnd,\n onUpdateMonthYear: _unref(startMonthYearChange)\n }, {\n \"action-preview\": _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"housing-search__availabilities-loading\", {\n 'visibility-hidden': !_unref(isLoadingCalendarAvailability),\n }])\n }, [\n _createVNode(LoadingSpinner, { size: 16 }),\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.$t('bookingForm.loadingDatePickerTimeslots')), 1)\n ], 2)\n ]),\n \"action-buttons\": _withCtx(() => []),\n _: 1\n }, 8, [\"model-value\", \"errors\", \"class\", \"placeholder\", \"disabled\", \"onUpdateMonthYear\"])\n ])\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./HousingResultCardSearch.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./HousingResultCardSearch.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./HousingResultCardSearch.vue?vue&type=style&index=0&id=4ad06f18&scoped=true&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/touringery-frontend/touringery-frontend/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4ad06f18\"]])\n\nexport default __exports__"],"names":["startOfToday","startOfDay","Date","now","_withScopeId","n","_pushScopeId","_popScopeId","_hoisted_1","class","_hoisted_2","_createElementVNode","_hoisted_3","_hoisted_4","key","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_defineComponent","__name","props","service","type","Object","required","date","groupSize","Number","time","String","default","duration","excludedReservations","Array","disabled","Boolean","emits","setup","__props","emit","experienceTimeSlots","ref","experienceTimeChips","selectedTime","experienceDurationChips","selectedDuration","selectedTimeSlot","mutateAsync","fetchExperienceDetailedAvailability","isLoading","isLoadingTimeSlots","useFetchExperienceDetailedAvailability","hash_id","fetchTimeSlots","group_size","excluded_reservations","then","data","value","setExperienceTimeChips","setExperienceDurationChips","catch","timeSlotList","forEach","timeSlot","includes","start","push","filterExperienceTimeSlotsByTime","filter","filterExperienceTimeSlotsByDuration","watch","find","payload","end","immediate","_ctx","_cache","_openBlock","_createElementBlock","_unref","_createVNode","LoadingSpinner","_toDisplayString","$t","_Fragment","_renderList","dateTime","timeIndex","_createBlock","BaseTag","label","format","parseISO","_normalizeClass","onClick","$event","durationIndex","formatMinutesToDuration","__exports__","CALENDAR_STATE","selectedDate","selectedGroupSize","undefined","isDisabled","groupService","serviceResultCardCommonProps","orderStore","useOrderStore","currentCalendarAvailability","previewCalendarAvailability","err","errors","currentState","reactive","pickerYearMonth","instance","month","getMonth","year","getFullYear","min_group_size","previewState","currentAvailableDates","computed","availabilities","dates","item","is_available","map","previewAvailableDates","selectedDateIndex","findIndex","formatDateTime","fetchExperiencePeriodAvailability","isLoadingExperiencePeriodAvailability","useFetchExperiencePeriodAvailability","getIsDateDisabled","dateStr","fetchPeriodAvailability","calendarState","changeMonth","firstDayOfMonth","endOfMonth","group_service","length","fetchResponseHandler","error","synchronizePreviewState","periodSelected","assign","CURRENT","PREVIOUS","NEXT","previousDate","newDate","nextDate","claendartState","updateAvailabilitySearch","onMounted","AlertBanner","text","ALERT_TYPES","WARNING","_createCommentVNode","BaseButton","FORMATS","ICON_CIRCULAR","size","SIZES","SMALL","icon","DatePicker","placeholder","clearable","name","onUpdateMonthYear","onClosed","_withCtx","_","BaseNumberIncrementer","amount","max_group_size","onClickMinus","_withModifiers","onClickPlus","BaseIcon","_createTextVNode","ExperienceAvailabilityPicker","onFetchInfo","initializePickerYearMonth","getYearMonthForDate","stateFieldMonthYearChange","state","field","modelValue","selectedPeriod","_periodStart","check_in","_periodEnd","check_out","periodAvailability","periodPickerYearMonth","calendarAvailability","isFetching","isLoadingCalendarAvailability","useQueryCompanyHousingDateAvailabilityList","periodPickerInterval","getYearMonthAsInterval","startDate","endDate","company","id","services","subDays","startAvailableDates","endAvailableDates","nextExpectedDate","addDays","endDates","formattedValidEndDates","isSameDay","getPeriodDisabledDates","periodErrors","_errors","updatePeriodStart","updatePeriodEnd","updateSelectedPeriod","period","startMonthYearChange","isLoadingPeriodAvailability","useFetchCompanyPeriodAvailability","searchAvailability","async","getValidationErrorData","newVal","oldVal","watchEffect","range","onRangeStart","onRangeEnd"],"sourceRoot":""}