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Q,CAAC,CAAC;IACVU,iBAAiB,CAAC,CAAC;IACnBO,eAAe,CAAC,CAAC;IACjBb,WAAW,CAAC,CAAC;IACb4B,MAAM,CAAC,CAAC;EACZ;AACJ,CAAC,CAAC,C","sources":["webpack://wp-hotel-booking/./assets/js/frontend/hotel-booking-v2.js"],"sourcesContent":["/** search api */\nconst urlCurrent = document.location.href;\nconst urlPageSearch = hotel_settings?.url_page_search;\nlet filterRooms = JSON.parse(window.localStorage.getItem('wphb_filter_rooms')) || {};\nlet firstLoad = true;\nconst hotelBookingSearchNode = document.querySelector('.hotel-booking-search');\n\nconst wphbAddQueryArgs = (endpoint, args) => {\n const url = new URL(endpoint);\n\n Object.keys(args).forEach((arg) => {\n url.searchParams.set(arg, args[arg]);\n });\n\n return url;\n};\n\nconst removeFilterArgs = (url, args) => {\n const filters = ['min_price', 'max_price', 'rating', 'room_type'];\n\n [...filters].map(filter => {\n if (!args.hasOwnProperty(filter)) {\n url.searchParams.delete(filter);\n }\n });\n\n return url;\n}\n\nconst searchRoomsPages = () => {\n\n const forms = document.querySelector('.wp-hotel-booking-search-rooms .hotel-booking-search form#hb-form-search-page');\n\n if (forms === null) {\n return;\n }\n\n requestSearchRoom(forms, filterRooms);\n}\n\nconst requestSearchRoom = (forms, args, btn = false) => {\n const skeleton = document.querySelector('.wp-hotel-booking-search-rooms .hotel-booking-search ul.wphb-skeleton-animation');\n const wrapperResult = document.querySelector('.wp-hotel-booking-search-rooms .hotel-booking-search .detail__booking-rooms');\n const showNumber = document.querySelector('.wp-hotel-booking-search-rooms .sort-by-wrapper .show-number');\n const wpRestUrl = hotel_settings.wphb_rest_url;\n\n if (!wpRestUrl) {\n return;\n }\n\n if (Object.keys(args).length === 0) {\n const monthName = new Intl.DateTimeFormat(\"en-US\", {month: \"long\"}).format;\n const today = new Date();\n const stringToday = (monthName(today) + ' ' + ('0' + today.getDate()).slice(-2) + ', ' + today.getFullYear());\n const tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);\n const stringTomorrow = (monthName(tomorrow) + ' ' + ('0' + tomorrow.getDate()).slice(-2) + ', ' + tomorrow.getFullYear());\n\n args.check_in_date = stringToday;\n args.check_out_date = stringTomorrow;\n args.adults = null;\n args.max_child = null;\n args.paged = 1;\n\n //Filter - Price, rating, type\n const searchFilter = document.querySelector('#hotel-booking-search-filter');\n\n if (searchFilter) {\n const priceField = searchFilter.querySelector('.hb-price-field');\n const ratingField = searchFilter.querySelector('.hb-rating-field');\n const typeField = searchFilter.querySelector('.hb-type-field');\n\n if (priceField) {\n args.min_price = '';\n args.max_price = '';\n }\n\n if (ratingField) {\n args.rating = '';\n }\n\n if (typeField) {\n args.room_type = '';\n }\n }\n }\n\n const urlWphbSearch = wphbAddQueryArgs(wpRestUrl + 'wphb/v1/rooms/search-rooms', {...args});\n\n wp.apiFetch({\n path: 'wphb/v1/rooms/search-rooms' + urlWphbSearch.search,\n method: 'GET',\n }).then((response) => {\n\n if (btn) {\n btn.classList.remove('wphb_loading');\n }\n\n const {status, data, message} = response;\n\n if (firstLoad) {\n formSearchRooms(forms, skeleton, wrapperResult);\n }\n\n const paginationEle = document.querySelector('.rooms-pagination');\n if (paginationEle) {\n paginationEle.remove();\n }\n\n if (status === 'error') {\n throw new Error(message || 'Error');\n }\n wrapperResult.style.display = 'block';\n wrapperResult.innerHTML = data.content;\n if (showNumber) {\n showNumber.innerHTML = data.show_number;\n }\n const pagination = data.pagination;\n\n if (typeof pagination !== 'undefined') {\n const paginationHTML = new DOMParser().parseFromString(pagination, 'text/html');\n const paginationNewNode = paginationHTML.querySelector('.rooms-pagination');\n\n if (paginationNewNode) {\n wrapperResult.after(paginationNewNode);\n wphbPaginationRoom(forms, skeleton, wrapperResult);\n }\n }\n\n }).catch((error) => {\n wrapperResult.innerHTML = '';\n const errorNode = document.querySelector('.wphb-message.error');\n\n if (errorNode) {\n errorNode.innerHTML = error.message || 'Error: Query wphb/v1/rooms/search-room';\n } else {\n wrapperResult.insertAdjacentHTML('beforeend', `

${error.message || 'Error: Query wphb/v1/rooms/search-room'}

`);\n }\n\n if (showNumber) {\n showNumber.innerHTML = '';\n }\n }).finally(() => {\n skeleton.style.display = 'none';\n // Save filter courses to Storage\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(args));\n\n let urlPush = wphbAddQueryArgs(document.location, args);\n urlPush = removeFilterArgs(urlPush, args);\n\n //check is room extra not push url\n const url_string = urlPush.href;\n const url = new URL(url_string);\n const isRoomExtra = url.searchParams.get(\"is_page_room_extra\");\n\n if (isRoomExtra != 'select-room-extra' && !firstLoad) {\n window.history.pushState('', '', urlPush);\n //update value checkin checkout to form search room when reload page\n const checkInDate = document.querySelector('.wp-hotel-booking-search-rooms .hotel-booking-search form#hb-form-search-page input[name=\"check_in_date\"]');\n const checkOutDate = document.querySelector('.wp-hotel-booking-search-rooms .hotel-booking-search form#hb-form-search-page input[name=\"check_out_date\"]');\n checkInDate.value = args.check_in_date;\n checkOutDate.value = args.check_out_date;\n }\n\n //form booking\n bookingRoomsPages(forms);\n\n firstLoad = false;\n const contentPageSearch = document.querySelector('.wp-hotel-booking-search-rooms .hotel-booking-search');\n if (contentPageSearch != null) {\n contentPageSearch.scrollIntoView({behavior: \"smooth\"});\n }\n //auto set quantity extra option when change select quantity before book room in page search\n toggleExtravalue();\n });\n}\n\nconst formSearchRooms = (forms, skeleton, wrapperResult) => {\n\n if (forms === null) return;\n\n forms.addEventListener('submit', (event) => {\n event.preventDefault();\n const checkinDate = forms.querySelector('input[name=\"check_in_date\"]').value;\n const checkoutDate = forms.querySelector('input[name=\"check_out_date\"]').value;\n const countAdults = forms.querySelector('select[name=\"adults_capacity\"]') ? forms.querySelector('select[name=\"adults_capacity\"]').value : 0;\n const maxChild = forms.querySelector('select[name=\"max_child\"]') ? forms.querySelector('select[name=\"max_child\"]').value : 0;\n const paged = forms.querySelector('input[name=\"paged\"]') ? forms.querySelector('input[name=\"paged\"]').value : 1;\n const btn = forms.querySelector('button.wphb-button');\n btn && btn.classList.add('wphb_loading');\n\n if (checkinDate === '' || checkoutDate === '') {\n alert(' Please select check in and check out date and search again! ');\n btn && btn.classList.remove('wphb_loading');\n return;\n }\n\n wrapperResult.innerHTML = '';\n skeleton.style.display = 'block';\n\n filterRooms = {\n ...filterRooms,\n check_in_date: checkinDate,\n check_out_date: checkoutDate,\n adults: countAdults,\n max_child: maxChild,\n paged: paged\n };\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n requestSearchRoom(forms, filterRooms, btn);\n });\n}\nconst wphbPaginationRoom = (forms, skeleton, wrapperResult) => {\n const paginationEle = document.querySelectorAll('.wp-hotel-booking-search-rooms .rooms-pagination .page-numbers');\n\n paginationEle.length > 0 && paginationEle.forEach((ele) => ele.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n wrapperResult.style.display = 'none';\n skeleton.style.display = 'block';\n\n let filterRooms = JSON.parse(window.localStorage.getItem('wphb_filter_rooms')) || {};\n\n const urlString = event.currentTarget.getAttribute('href');\n\n if (urlString) {\n const current = [...paginationEle].filter((el) => el.classList.contains('current'));\n const paged = parseInt(event.currentTarget.textContent) || (ele.classList.contains('next') && parseInt(current[0].textContent) + 1) || (ele.classList.contains('prev') && parseInt(current[0].textContent) - 1);\n filterRooms.paged = paged;\n\n requestSearchRoom(forms, {...filterRooms});\n }\n }));\n};\n/** end search api */\n\nconst addtocartElementor = () => {\n const formBookingel = document.querySelector('.hotel-booking-search-el form#hb-form-search-page');\n\n if ( !formBookingel ) {\n\t\treturn;\n\t}\n\n bookingRoomsPages(formBookingel);\n}\n/** Booking room search page */\n\nconst bookingRoomsPages = (formsCheck) => {\n\n const formBooking = document.querySelectorAll('.wp-hotel-booking-search-rooms form.hb-page-search-room-results');\n\n if (formBooking.length == 0) return;\n\n const checkinDate = formsCheck.querySelector('input[name=\"check_in_date\"]')?.value;\n const checkoutDate = formsCheck.querySelector('input[name=\"check_out_date\"]')?.value;\n\n const submit = async (form, btn = false, numRoom, roomID) => {\n const extraData = [];\n const hotelOption = form.querySelectorAll('input.hb_optional_quantity_selected');\n\n hotelOption && hotelOption.forEach((ele) => {\n if (ele.checked) {\n // const eleName = ele.getAttribute('name');\n // const extraID = eleName?.match(/(?<=\\[).+?(?=\\])/)?.[0] || null;\n const extraID = ele.dataset.id;\n const qty = parseInt(ele.parentElement?.nextElementSibling?.querySelector('input[class=\"hb_optional_quantity\"]')?.value) || 1;\n if (extraID) {\n extraData.push({extraID, qty});\n }\n }\n });\n\n try {\n const response = await wp.apiFetch({\n path: 'wphb/v1/rooms/book-rooms',\n method: 'POST',\n data: { roomID, checkinDate, checkoutDate, numRoom, extraData },\n });\n\n const { status, data } = response;\n const redirect = data?.results?.redirect || '';\n const message = data?.results?.message || '';\n const hasExtra = data?.results?.has_extra || false;\n\n if (btn) {\n btn.classList.remove('wphb_loading');\n }\n if ( 'error' === status ) {\n throw new Error( message );\n }\n if (!hasExtra) {\n window.location.href = redirect;\n } else {\n const htmlExtraOptions = data?.results?.extra_html || '';\n const addtocartWrap = form.querySelector( '.hb_search_add_to_cart' );\n if ( addtocartWrap ) {\n btn.style.display = 'none';\n addtocartWrap.insertAdjacentHTML('beforeend', htmlExtraOptions);\n } else {\n form.insertAdjacentHTML('beforeend', htmlExtraOptions);\n }\n }\n } catch (error) {\n alert(error);\n }\n };\n\n formBooking.forEach(function (form) {\n form.addEventListener('submit', function (e) {\n e.preventDefault();\n const numRoom = form.querySelector('select[name=\"hb-num-of-rooms\"]')?.value;\n const roomID = form.querySelector('input[name=\"room-id\"]')?.value;\n const quantityBook = form.querySelector('select[name=\"hb-num-of-rooms\"]')?.value;\n\n if (quantityBook == 0) {\n alert('Please select quantity room!');\n return;\n }\n if (checkinDate === '' || checkoutDate === '') {\n alert(' Please select check in and check out date and search again! ');\n return;\n }\n const btn = form.querySelector('button.hb_add_to_cart');\n btn && btn.classList.add('wphb_loading');\n submit(form, btn, numRoom, roomID);\n });\n form.addEventListener('click', (e) => {\n let target = e.target;\n if ( target.classList.contains( 'add-extra-to-cart' ) ) {\n target.classList.add('wphb_loading');\n const cartID = target.dataset.cartid;\n addExtraToCartNew( form, cartID, target );\n }\n });\n });\n const addExtraToCartNew = async ( form, cartID, btn ) => {\n const extraData = [];\n const hotelOption = form.querySelectorAll('input.hb_optional_quantity_selected');\n\n hotelOption && hotelOption.forEach((ele) => {\n if (ele.checked) {\n const extraID = ele?.dataset.id || null;\n const qty = parseInt(ele.parentElement?.nextElementSibling?.querySelector(`input[name=\"hb_optional_quantity[${extraID}]\"]`)?.value) || 1;\n\n if (extraID) {\n extraData.push({extraID, qty});\n }\n }\n });\n\n try {\n const response = await wp.apiFetch({\n path: 'wphb/v1/rooms/add-extra-cart',\n method: 'POST',\n data: {cartID, extraData},\n });\n\n const {status, data, message} = response;\n btn.classList.remove( 'wphb_loading' );\n if ( 'error' === status ) {\n throw new Error( message )\n }\n const redirect = data?.redirect || '';\n if ('success' === status && redirect) {\n window.location.href = redirect;\n }\n } catch (error) {\n alert(error);\n }\n }\n}\n\nconst addExtraToCart = () => {\n const formExtra = document.querySelector('form.hb-select-extra-results');\n\n if (formExtra === null) return;\n\n const submit = async () => {\n\n const extraData = [];\n const cartID = formExtra.querySelector('input[name=\"cart_id\"]').value;\n const hotelOption = formExtra.querySelectorAll('input.hb_optional_quantity_selected');\n\n hotelOption && hotelOption.forEach((ele) => {\n if (ele.checked) {\n // const eleName = ele.getAttribute('name');\n // const extraID = eleName?.match(/(?<=\\[).+?(?=\\])/)?.[0] || null;\n const extraID = ele?.dataset.id || null;\n const qty = parseInt(ele.parentElement?.nextElementSibling?.querySelector('input[class=\"hb_optional_quantity\"]')?.value) || 1;\n\n if (extraID) {\n extraData.push({extraID, qty});\n }\n }\n });\n\n try {\n const response = await wp.apiFetch({\n path: 'wphb/v1/rooms/add-extra-cart',\n method: 'POST',\n data: {cartID, extraData},\n });\n\n const {status, redirect} = response;\n if ('success' === status && redirect) {\n window.location.href = redirect;\n }\n\n } catch (error) {\n alert(error.message && error.message);\n }\n }\n\n formExtra.addEventListener('submit', function (e) {\n e.preventDefault();\n const btn = formExtra.querySelector('button[type=\"submit\"]');\n btn && btn.classList.add('wphb_loading');\n submit();\n });\n\n}\n/** End Booking search page */\n\n\n/** search form */\n\nconst checkAvailableRooms = () => {\n\n //remove sidebar search in page search room_select\n if (hotel_settings?.is_page_search) {\n const sideBar = document.querySelector('.thim-widget-search-room');\n if (sideBar != null) {\n const FormSidebar = sideBar.querySelector('form#hb-form-search-page');\n if (FormSidebar != null) {\n FormSidebar.removeAttribute('id');\n }\n const searchResult = sideBar.querySelector('#hotel-booking-results');\n if (searchResult != null) {\n searchResult.remove();\n }\n }\n }\n\n const forms = document.querySelectorAll('form[class^=\"hb-search-form\"]:not(#hb-form-search-page)');\n\n forms.length > 0 && forms.forEach((form) => {\n form.addEventListener('submit', function (e) {\n e.preventDefault();\n const checkinDate = form.querySelector('input[name=\"check_in_date\"]').value;\n const checkoutDate = form.querySelector('input[name=\"check_out_date\"]').value;\n const countAdults = form.querySelector('select[name=\"adults_capacity\"]') ? form.querySelector('select[name=\"adults_capacity\"]').value : 0;\n const maxChild = form.querySelector('select[name=\"max_child\"]') ? form.querySelector('select[name=\"max_child\"]').value : 0;\n const paged = form.querySelector('input[name=\"paged\"]') ? form.querySelector('input[name=\"paged\"]').value : 1;\n\n if (checkinDate === '' || checkoutDate === '') {\n alert(' Please select check in and check out date and search again! ');\n return;\n }\n\n const data = {\n check_in_date: checkinDate,\n check_out_date: checkoutDate,\n adults: countAdults,\n max_child: maxChild,\n paged: paged,\n }\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(data));\n const urlPush = wphbAddQueryArgs(document.location, data);\n const urlString = urlPush.search;\n window.location.href = urlPageSearch + urlString;\n })\n\n });\n}\n/** End search form */\n\nconst processCheckout = () => {\n const form = document.getElementById('hb-cart-form');\n if (form === null) return;\n const btn = form.querySelector('a.hb_checkout');\n if (btn === null) return;\n btn.addEventListener('click', function (e) {\n e.preventDefault();\n if (hotel_settings?.checkout_page_url) {\n window.location.href = hotel_settings.checkout_page_url;\n } else {\n alert('Please set checkout page url in settings');\n }\n });\n}\n\n//auto set quantity extra option when change select quantity before book room in page search\nconst toggleExtravalue = () => {\n const select = document.querySelector('.hb-page-search-room-results select.number_room_select');\n if (select == null) return;\n\n select.addEventListener('change', function (e) {\n e.preventDefault();\n const optionExtras = document.querySelectorAll('.hb-page-search-room-results .hb_optional_quantity');\n if (optionExtras == null) return;\n optionExtras.forEach(function (extra) {\n extra.value = select.value;\n });\n })\n}\n\nconst renderPrice = (price) => {\n const currencySymbol = hotel_settings.currency_symbol || '';\n const currencyPosition = hotel_settings.currency_position || 'left';\n\n price = renderPriceNumber(price);\n\n switch (currencyPosition) {\n case 'left':\n price = currencySymbol + price;\n break;\n case 'right':\n price = price + currencySymbol;\n break;\n case 'left_with_space':\n price = currencySymbol + ' ' + price;\n break;\n case 'right_with_space':\n price = price + ' ' + currencySymbol;\n break;\n default:\n break;\n }\n\n return price;\n};\n\nconst renderPriceNumber = (price) => {\n const numberDecimals = hotel_settings.number_decimal || 0;\n const thousandsSeparator = hotel_settings.thousands_separator || '';\n\n price = (price / 1).toFixed(numberDecimals);\n price = price.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n\n return price;\n};\n\nconst priceSlider = () => {\n const priceFields = document.querySelectorAll('.hb-price-field');\n if (!priceFields) {\n return;\n }\n\n for (let i = 0; i < priceFields.length; i++) {\n const priceField = priceFields[i];\n const minPrice = priceField.getAttribute('data-min');\n const maxPrice = priceField.getAttribute('data-max');\n let step = priceField.getAttribute('data-step');\n\n if (minPrice === '' || maxPrice === '' || step === '') {\n continue;\n }\n\n const minPriceNode = priceField.querySelector('.hb-min-price');\n const maxPriceNode = priceField.querySelector('.hb-max-price');\n\n\n const priceSliderNode = priceField.querySelector('.hb-price-range');\n\n const start = filterRooms.min_price || minPrice;\n const end = filterRooms.max_price || maxPrice;\n step = parseInt(step);\n\n noUiSlider.create(priceSliderNode, {\n start: [parseInt(start), parseInt(end)],\n connect: true,\n step,\n tooltips: false,\n range: {\n min: parseInt(minPrice), max: parseInt(maxPrice),\n },\n // direction: 'lt',\n });\n\n priceSliderNode.noUiSlider.on('update', function (values, handle, unencoded) {\n let minValue = values[0], maxValue = values[1];\n\n if (isNaN(minValue)) {\n minValue = 0;\n }\n if (isNaN(maxValue)) {\n maxValue = 0;\n }\n\n minPriceNode.value = parseInt(minValue);\n maxPriceNode.value = parseInt(maxValue);\n priceField.querySelector('.min').innerHTML = renderPrice(minValue);\n priceField.querySelector('.max').innerHTML = renderPrice(maxValue);\n });\n\n const applyBtn = priceField.querySelector('button.apply');\n\n //apply btn click event\n if(applyBtn){\n applyBtn.addEventListener('click', function (event) {\n event.preventDefault();\n\n const minPrice = minPriceNode.value;\n const maxPrice = maxPriceNode.value;\n\n filterRooms = {\n ...filterRooms,\n min_price: parseInt(minPrice),\n max_price: parseInt(maxPrice)\n };\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n });\n }\n }\n}\n\nconst rating = () => {\n const ratingFields = document.querySelectorAll('.hb-rating-field');\n if (!ratingFields) {\n return;\n }\n\n for (let i = 0; i < ratingFields.length; i++) {\n const ratingField = ratingFields[i];\n\n const allInputs = ratingField.querySelectorAll('input[type=\"checkbox\"]');\n const rating = filterRooms.rating || [];\n\n [...rating].map(value => {\n ratingField.querySelector(`input[name =\"rating\"][value =\"${value}\"]`).checked = true;\n });\n\n for (let i = 0; i < allInputs.length; i++) {\n const input = allInputs[i];\n\n input.addEventListener('change', function (event) {\n const allCheckedInput = ratingField.querySelectorAll('input[type=\"checkbox\"]:checked');\n\n let value = [];\n [...allCheckedInput].map(checkedInput => {\n value.push(checkedInput.value);\n });\n\n filterRooms = {\n ...filterRooms,\n rating: value\n };\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n });\n }\n }\n}\n\nconst roomType = () => {\n const roomTypeFields = document.querySelectorAll('.hb-type-field');\n if (!roomTypeFields) {\n return;\n }\n\n for (let i = 0; i < roomTypeFields.length; i++) {\n const roomTypeField = roomTypeFields[i];\n\n const allInputs = roomTypeField.querySelectorAll('input[type=\"checkbox\"]');\n\n const roomTypesValue = filterRooms.room_type || [];\n [...roomTypesValue].map(value => {\n roomTypeField.querySelector(`input[name =\"room_type\"][value =\"${value}\"]`).checked = true;\n });\n\n for (let i = 0; i < allInputs.length; i++) {\n const input = allInputs[i];\n\n input.addEventListener('change', function (event) {\n const allCheckedInput = roomTypeField.querySelectorAll('input[type=\"checkbox\"]:checked');\n\n let value = [];\n [...allCheckedInput].map(checkedInput => {\n value.push(checkedInput.value);\n });\n\n filterRooms = {\n ...filterRooms,\n room_type: value\n };\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n });\n }\n }\n}\n\nconst clearFilter = () => {\n const filterForms = document.querySelectorAll('.search-filter-form');\n if (!filterForms) {\n return;\n }\n\n for (let i = 0; i < filterForms.length; i++) {\n const filterForm = filterForms[i];\n const clearFilter = filterForm.querySelector('.clear-filter button');\n\n clearFilter.addEventListener('click', function (event) {\n const priceField = document.querySelector('.hb-price-field');\n if (priceField) {\n const minPrice = priceField.getAttribute('data-min');\n const maxPrice = priceField.getAttribute('data-max');\n const priceSliderNode = priceField.querySelector('.hb-price-range');\n const start = minPrice;\n const end = maxPrice;\n\n priceSliderNode.noUiSlider.updateOptions({\n start: [parseInt(start), parseInt(end)]\n });\n }\n\n const ratingFields = filterForm.querySelectorAll('.hb-rating-field input');\n\n [...ratingFields].map(ratingField => {\n ratingField.checked = false;\n });\n\n const roomTypeFields = filterForm.querySelectorAll('.hb-type-field input');\n\n [...roomTypeFields].map(roomTypeField => {\n roomTypeField.checked = false;\n });\n\n if (filterRooms.hasOwnProperty('min_price')) {\n delete filterRooms['min_price'];\n }\n\n if (filterRooms.hasOwnProperty('max_price')) {\n delete filterRooms['max_price'];\n }\n\n if (filterRooms.hasOwnProperty('rating')) {\n delete filterRooms['rating'];\n }\n\n if (filterRooms.hasOwnProperty('room_type')) {\n delete filterRooms['room_type'];\n }\n\n const listItemNodes = document.querySelectorAll('.hb-selection-field .list-item');\n [...listItemNodes].map(listItemNode => {\n listItemNode.remove();\n });\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n });\n }\n}\n\nconst hbFilterSelection = () => {\n const selectionWrapper = document.querySelector('.hb-selection-field');\n if (!selectionWrapper) {\n return;\n }\n\n const priceFields = document.querySelectorAll('.hb-price-field');\n\n if (priceFields.length) {\n for (let i = 0; i < priceFields.length; i++) {\n const priceField = priceFields[i];\n\n const priceSliderNode = priceField.querySelector('.hb-price-range');\n\n priceSliderNode.noUiSlider.on('update', function (values, handle, unencoded) {\n const minPrice = parseInt(values[0]);\n const maxPrice = parseInt(values[1]);\n\n changeSelectedField('price', minPrice + '-' + maxPrice, renderPrice(minPrice) + '-' + renderPrice(maxPrice));\n });\n }\n }\n\n const ratingFields = document.querySelectorAll('.hb-rating-field');\n\n if (ratingFields.length) {\n [...ratingFields].map(ratingField => {\n const allInputs = ratingField.querySelectorAll('input[type=\"checkbox\"]');\n [...allInputs].map(ratingNode => {\n if (ratingNode.checked) {\n const value = ratingNode.value;\n const label = ratingNode.closest('label').querySelector('span').innerHTML.replace('-', ' ');\n changeSelectedField('rating', value, label);\n }\n\n ratingNode.addEventListener('change', function () {\n const value = this.value;\n const label = ratingNode.closest('label').querySelector('span').innerHTML.replace('-', ' ');\n changeSelectedField('rating', value, label);\n });\n })\n });\n }\n\n const roomTypeFields = document.querySelectorAll('.hb-type-field');\n if (roomTypeFields.length) {\n for (let i = 0; i < roomTypeFields.length; i++) {\n const roomTypeField = roomTypeFields[i];\n\n const allInputs = roomTypeField.querySelectorAll('input[type=\"checkbox\"]');\n\n [...allInputs].map(roomTypeNode => {\n if (roomTypeNode.checked) {\n const value = roomTypeNode.value;\n const label = roomTypeNode.closest('label').querySelector('span').innerHTML.replace('-', ' ');\n changeSelectedField('room-type', value, label);\n }\n\n roomTypeNode.addEventListener('change', function () {\n const value = this.value;\n const label = roomTypeNode.closest('label').querySelector('span').innerHTML.replace('-', ' ');\n changeSelectedField('room-type', value, label);\n });\n })\n }\n }\n}\n\nconst removeSelection = () => {\n document.addEventListener('click', function (event) {\n const target = event.target;\n\n if (!target.classList.contains('remove')) {\n return;\n }\n\n const selectionWrapper = target.closest('.hb-selection-field');\n\n if (!selectionWrapper) {\n return;\n }\n\n const listItem = target.closest('.list-item');\n\n const field = listItem.getAttribute('data-field');\n switch (field) {\n case 'room-type':\n resetRoomType(listItem.getAttribute('data-value'));\n break;\n case 'rating':\n resetRating(listItem.getAttribute('data-value'));\n break;\n case 'price':\n resetPrice();\n break;\n default:\n break;\n }\n\n if (listItem) {\n listItem.remove();\n }\n });\n}\n\nconst resetRoomType = (value = 'all') => {\n const roomTypeFields = document.querySelectorAll('.hb-type-field');\n\n [...roomTypeFields].map(roomTypeField => {\n const roomTypeNodes = roomTypeField.querySelectorAll('input[type=\"checkbox\"]');\n if (value === 'all') {\n [...roomTypeNodes].map(roomTypeNode => {\n roomTypeNode.checked = false;\n })\n } else {\n const input = roomTypeField.querySelector(`.room-type-list input[value=\"${value}\"]`);\n input.checked = false;\n }\n\n let roomTypeVal = [];\n\n const allCheckedInput = roomTypeField.querySelectorAll('input[type=\"checkbox\"]:checked');\n\n [...allCheckedInput].map(checkedInput => {\n roomTypeVal.push(checkedInput.value);\n });\n\n filterRooms = {\n ...filterRooms,\n room_type: roomTypeVal\n };\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n });\n}\n\nconst resetRating = (value = 'all') => {\n const ratingFields = document.querySelectorAll('.hb-rating-field');\n\n [...ratingFields].map(ratingField => {\n const ratingNodes = ratingField.querySelectorAll('input[type=\"checkbox\"]');\n if (value === 'all') {\n [...ratingNodes].map(ratingNode => {\n ratingNode.checked = false;\n })\n } else {\n const input = ratingField.querySelector(`.rating-list input[value=\"${value}\"]`);\n input.checked = false;\n }\n\n let ratingVal = [];\n const allCheckedInput = ratingField.querySelectorAll('input[type=\"checkbox\"]:checked');\n\n [...allCheckedInput].map(checkedInput => {\n ratingVal.push(checkedInput.value);\n });\n\n filterRooms = {\n ...filterRooms,\n rating: ratingVal\n };\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n });\n}\n\nconst resetPrice = () => {\n const priceFields = document.querySelectorAll('.hb-price-field');\n\n if (priceFields.length) {\n for (let i = 0; i < priceFields.length; i++) {\n const priceField = priceFields[i];\n\n const priceSliderNode = priceField.querySelector('.hb-price-range');\n\n priceSliderNode.noUiSlider.updateOptions({\n start: [parseInt(priceField.getAttribute('data-min')), parseInt(priceField.getAttribute('data-max'))],\n });\n }\n }\n\n if (filterRooms.hasOwnProperty('min_price')) {\n delete filterRooms['min_price'];\n }\n\n if (filterRooms.hasOwnProperty('max_price')) {\n delete filterRooms['max_price'];\n }\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n}\n\nconst changeSelectedField = (field, value, text) => {\n const listNode = document.querySelector('.hb-selection-field .list');\n\n let fieldNode = listNode.querySelector(`li[data-field=\"${field}\"]`);\n\n if (field === 'rating' || field === 'room-type') {\n fieldNode = listNode.querySelector(`li[data-field=\"${field}\"][data-value=\"${value}\"]`);\n }\n\n if (fieldNode) {\n if (field === 'rating' || field === 'room-type') {\n fieldNode.remove();\n } else {\n if (value) {\n fieldNode.setAttribute('data-value', value);\n fieldNode.querySelector('.title').innerHTML = text;\n } else {\n fieldNode.remove();\n }\n }\n } else {\n const item = `
  • \n ${text}\n \n \n \n \n
  • `;\n listNode.insertAdjacentHTML('beforeend', item);\n }\n}\n\nconst sortBy = () => {\n const sortByWrapper = document.querySelector('.sort-by-wrapper');\n if (!sortByWrapper) {\n return;\n }\n\n const sortBy = filterRooms.sort_by || '';\n const listOptions = sortByWrapper.querySelectorAll('ul li');\n const toggle = sortByWrapper.querySelector('.toggle');\n\n [...listOptions].map(element => {\n if (element.getAttribute('data-value') === sortBy) {\n toggle.innerHTML = element.innerHTML;\n element.classList.add('active');\n } else {\n element.classList.remove('active');\n }\n\n element.addEventListener('click', function (event) {\n const value = element.getAttribute('data-value');\n\n filterRooms = {\n ...filterRooms,\n 'sort_by': value\n };\n\n window.localStorage.setItem('wphb_filter_rooms', JSON.stringify(filterRooms));\n\n searchRoomsPages();\n });\n });\n}\n\ndocument.addEventListener('DOMContentLoaded', () => {\n searchRoomsPages();//use in page search room\n addExtraToCart();\n addtocartElementor();\n checkAvailableRooms(); // use multi form search will redirect to page search room with data valid :\n processCheckout();\n\n if (hotelBookingSearchNode && hotel_settings && hotel_settings.is_page_search) {\n priceSlider();\n rating();\n roomType();\n hbFilterSelection();\n removeSelection();\n clearFilter();\n sortBy();\n }\n});\n"],"names":["urlCurrent","document","location","href","urlPageSearch","hotel_settings","url_page_search","filterRooms","JSON","parse","window","localStorage","getItem","firstLoad","hotelBookingSearchNode","querySelector","wphbAddQueryArgs","endpoint","args","url","URL","Object","keys","forEach","arg","searchParams","set","removeFilterArgs","filters","map","filter","hasOwnProperty","delete","searchRoomsPages","forms","requestSearchRoom","btn","skeleton","wrapperResult","showNumber","wpRestUrl","wphb_rest_url","length","monthName","Intl","DateTimeFormat","month","format","today","Date","stringToday","getDate","slice","getFullYear","tomorrow","getTime","stringTomorrow","check_in_date","check_out_date","adults","max_child","paged","searchFilter","priceField","ratingField","typeField","min_price","max_price","rating","room_type","urlWphbSearch","wp","apiFetch","path","search","method","then","response","classList","remove","status","data","message","formSearchRooms","paginationEle","Error","style","display","innerHTML","content","show_number","pagination","paginationHTML","DOMParser","parseFromString","paginationNewNode","after","wphbPaginationRoom","catch","error","errorNode","insertAdjacentHTML","finally","setItem","stringify","urlPush","url_string","isRoomExtra","get","history","pushState","checkInDate","checkOutDate","value","bookingRoomsPages","contentPageSearch","scrollIntoView","behavior","toggleExtravalue","addEventListener","event","preventDefault","checkinDate","checkoutDate","countAdults","maxChild","add","alert","querySelectorAll","ele","stopPropagation","urlString","currentTarget","getAttribute","current","el","contains","parseInt","textContent","addtocartElementor","formBookingel","formsCheck","formBooking","submit","form","numRoom","roomID","extraData","hotelOption","checked","extraID","dataset","id","qty","parentElement","nextElementSibling","push","redirect","results","hasExtra","has_extra","htmlExtraOptions","extra_html","addtocartWrap","e","quantityBook","target","cartID","cartid","addExtraToCartNew","addExtraToCart","formExtra","checkAvailableRooms","is_page_search","sideBar","FormSidebar","removeAttribute","searchResult","processCheckout","getElementById","checkout_page_url","select","optionExtras","extra","renderPrice","price","currencySymbol","currency_symbol","currencyPosition","currency_position","renderPriceNumber","numberDecimals","number_decimal","thousandsSeparator","thousands_separator","toFixed","toString","replace","priceSlider","priceFields","i","minPrice","maxPrice","step","minPriceNode","maxPriceNode","priceSliderNode","start","end","noUiSlider","create","connect","tooltips","range","min","max","on","values","handle","unencoded","minValue","maxValue","isNaN","applyBtn","ratingFields","allInputs","input","allCheckedInput","checkedInput","roomType","roomTypeFields","roomTypeField","roomTypesValue","clearFilter","filterForms","filterForm","updateOptions","listItemNodes","listItemNode","hbFilterSelection","selectionWrapper","changeSelectedField","ratingNode","label","closest","roomTypeNode","removeSelection","listItem","field","resetRoomType","resetRating","resetPrice","roomTypeNodes","roomTypeVal","ratingNodes","ratingVal","text","listNode","fieldNode","setAttribute","item","sortBy","sortByWrapper","sort_by","listOptions","toggle","element"],"sourceRoot":""}