{"version":3,"sources":["webpack:///D:/a/1/s/frontend/src/views/blocks/searchDateTimeBlock/js/searchDateTimeBlock.js","webpack:///./query-string.js","webpack:///./dataLayer.js","webpack:///D:/a/1/s/frontend/src/views/blocks/addressSearchBar/js/AddressSearchBar.jsx","webpack:///D:/a/1/s/frontend/src/views/blocks/locationTopSearchBarBlock/js/DateTimePicker.jsx","webpack:///D:/a/1/s/frontend/src/views/blocks/searchDateTimeBlock/js/SearchDateTimeBlock.jsx"],"names":["__webpack_require__","defaultProps","SearchDateTimeBlock","$el","_classCallCheck3","default","this","parkSearchUrl","$","data","showEntryExitTimes","country","setSearchDateTimeBlock","hasClass","preventFetchingResults","ReactDOM","render","React","createElement","rSearchDateTimeBlock","strictUriEncode","require","objectAssign","decodeComponent","encode","value","opts","strict","encodeURIComponent","extract","str","queryStart","indexOf","slice","parse","formatter","result","arrayFormat","key","accumulator","exec","replace","undefined","concat","parserForArrayFormat","ret","_create2","trim","split","forEach","param","parts","shift","val","length","join","_keys2","sort","reduce","Boolean","_typeof3","Array","isArray","keysSorter","input","a","b","Number","map","exports","stringify","obj","index","encoderForArrayFormat","val2","push","filter","x","parseUrl","url","query","pushPageView","dataGroup","window","dataLayer","event","ecommerce","pushFormSubmit","formID","category","action","label","eventCallback","pushCarparkSearch","arrivalDate","departureDate","location","_react","_reactPlacesAutocomplete","props","_useState","useState","_useState2","_slicedToArray3","searchTerm","setSearchTerm","_useState3","_useState4","setActiveInput","_useState5","_useState6","_queryStr","queryToUpdate","_useState7","_useState8","prevSuggestions","setPrevSuggestions","_useState9","_useState10","canClear","setCanClear","useEffect","useCurrentLocation","getAddress","currentLocation","navigator","geolocation","geocoder","google","maps","Geocoder","getCurrentPosition","position","_position$coords","coords","latitude","longitude","geocodeLatLng","lat","lng","latlng","geocode","results","status","formatted_address","onSelect","_location","queryString","localStorage","getItem","setItem","handleSelect","address","shouldNotUpdateAddress","_latLng","geocodeByAddress","then","getLatLng","latLng","setUserLocation","fetchParkings","fetchRecommendedParkings","catch","error","finally","removeItem","searchOptions","types","componentRestrictions","handleActiveInput","clearInput","_react2","_reactPlacesAutocomplete2","onChange","includes","parsedQuery","search","entry","exit","highlightFirstSuggestion","shouldFetchSuggestions","_ref","getInputProps","getSuggestionItemProps","suggestions","className","onClick","placeholder","suggestion","i","_extends3","formattedSuggestion","mainText","secondaryText","selectedTime","setSelectedTime","dateTime","formatTimeToStr","getHourMinFromStr","hourMin","amPm","substring","hour","_parseInt2","min","date","_moment2","format","_reactDayPicker2","showOutsideDays","disabledDays","before","disableDateFrom","Date","onDayClick","originalHour","getHours","originalMin","getMinutes","newDateTime","setHours","setMinutes","setDateTime","selectedDays","month","halfHoursSelect","startDateTimeFrom","getTime","dateToEval","hourIndex","minIndex","validSelectableTime","getCorrectHoursAndMin","data-index","data-hour","_getHourMinFromStr","combined","toDate","onDateTimeSelected","onTimeSelected","_getHourMinFromStr2","minTimeFrom","maxTimeTo","disableSelectedTime","_utils","setAddress","userAddress","setUserAddress","DateTimeIn","setDateTimeIn","DateTimeOut","setDateTimeOut","showError","setShowError","_useState11","_useState12","userLocation","_useState13","_useState14","_useState15","_useState16","urlQueryDateTimeIn","urlQueryDateTimeOut","getDateSegments","dateTimeStr","updateUrl","DateTime","DateInStr","history","replaceState","utils","updateURLParameter","href","showResults","_AddressSearchBar2","type","alert"],"mappings":"yOAQAA,EAAA,UACAA,EAAA,UACAA,EAAA,yDATA,IAUMC,aAEOC,+BACZ,SAAAA,EAAYC,IAAK,EAAAC,EAAAC,SAAAC,KAAAJ,GAEhBI,KAAKH,IAAMA,EACXG,KAAKC,cAAgBC,EAAEF,KAAKH,KAAKM,KAAK,OACtCH,KAAKI,mBAAqBF,EAAEF,KAAKH,KAAKM,KAAK,sBAC3CH,KAAKK,QAAUH,EAAEF,KAAKH,KAAKM,KAAK,+DAIhCH,KAAKM,0EAKQJ,EAAEF,KAAKH,KACXU,SAAS,4BACjBZ,EAAaa,wBAAyB,GAEvCb,EAAaM,cAAgBD,KAAKC,c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AaE,QAAQ,qBAAsB,QAC3C2H,KAEAG,MAAM,sDAEP/B,EAAWC,KAuET3E,EAAAtK,QAAAa,cAAA,OAAKuK,UAAU,kBACfd,EAAAtK,QAAAa,cAAA,OAAKuK,UAAU,QAAf","file":"block-79.b9f88d4cffa17521b332.js","sourcesContent":["// CONSTANTS are all caps.\nconst NS = 'SearchDateTimeBlock';\nconst CLS = 'searchDateTimeBlock';\nconst BLK = '.' + CLS + '-';\n\n// Import stuff here if you need to or even better to import them dynamically\n// for ex. of dynamic import check out ./loadBlk.js using Webpack dynamic imports as chunks.\n// import $ from 'jquery'\nimport rSearchDateTimeBlock from './SearchDateTimeBlock.jsx';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nconst defaultProps = {};\n\nexport class SearchDateTimeBlock {\n\tconstructor($el) {\n\t\t// $el is the blk node return by the loadSearchDateTimeBlock function\n\t\tthis.$el = $el;\n\t\tthis.parkSearchUrl = $(this.$el).data('url');\n\t\tthis.showEntryExitTimes = $(this.$el).data('showentryexittimes');\n\t\tthis.country = $(this.$el).data('country');\n\t}\n\n\tinit() {\n\t\tthis.setSearchDateTimeBlock();\n\t}\n\n\tsetSearchDateTimeBlock() {\n\t\t// Add Some logic here\n\t\tconst $blk = $(this.$el);\n\t\tif ($blk.hasClass('preventFetchingResults')) {\n\t\t\tdefaultProps.preventFetchingResults = true;\n\t\t}\n\t\tdefaultProps.parkSearchUrl = this.parkSearchUrl;\n\t\tdefaultProps.showEntryExitTimes = this.showEntryExitTimes;\n\t\tdefaultProps.country = this.country;\n\t\t\n\t\tReactDOM.render(\n\t\t\tReact.createElement(rSearchDateTimeBlock, defaultProps),\n\t\t\tthis.$el\n\t\t);\n\t}\n\n\t// Add more functions like on above here\n}\n","'use strict';\nlet strictUriEncode = require('strict-uri-encode');\nlet objectAssign = require('object-assign');\nlet decodeComponent = require('decode-uri-component');\n\nfunction encoderForArrayFormat(opts) {\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function(key, value, index) {\n\t\t\t\treturn value === null ? [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tindex,\n\t\t\t\t\t']',\n\t\t\t\t].join('') : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tencode(index, opts),\n\t\t\t\t\t']=',\n\t\t\t\t\tencode(value, opts),\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function(key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[]=',\n\t\t\t\t\tencode(value, opts),\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function(key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'=',\n\t\t\t\t\tencode(value, opts),\n\t\t\t\t].join('');\n\t\t\t};\n\t}\n}\n\nfunction parserForArrayFormat(opts) {\n\tlet result;\n\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function(key, value, accumulator) {\n\t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n\t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = {};\n\t\t\t\t}\n\n\t\t\t\taccumulator[key][result[1]] = value;\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function(key, value, accumulator) {\n\t\t\t\tresult = /(\\[\\])$/.exec(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t} else if (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function(key, value, accumulator) {\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\t}\n}\n\nfunction encode(value, opts) {\n\tif (opts.encode) {\n\t\treturn opts.strict ? strictUriEncode(value) : encodeURIComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction keysSorter(input) {\n\tif (Array.isArray(input)) {\n\t\treturn input.sort();\n\t} else if (typeof input === 'object') {\n\t\treturn keysSorter(Object.keys(input)).sort(function(a, b) {\n\t\t\treturn Number(a) - Number(b);\n\t\t}).map(function(key) {\n\t\t\treturn input[key];\n\t\t});\n\t}\n\n\treturn input;\n}\n\nfunction extract(str) {\n\tlet queryStart = str.indexOf('?');\n\tif (queryStart === -1) {\n\t\treturn '';\n\t}\n\treturn str.slice(queryStart + 1);\n}\n\nfunction parse(str, opts) {\n\topts = objectAssign({arrayFormat: 'none'}, opts);\n\n\tlet formatter = parserForArrayFormat(opts);\n\n\t// Create an object with no prototype\n\t// https://github.com/sindresorhus/query-string/issues/47\n\tlet ret = Object.create(null);\n\n\tif (typeof str !== 'string') {\n\t\treturn ret;\n\t}\n\n\tstr = str.trim().replace(/^[?#&]/, '');\n\n\tif (!str) {\n\t\treturn ret;\n\t}\n\n\tstr.split('&').forEach(function(param) {\n\t\tlet parts = param.replace(/\\+/g, ' ').split('=');\n\t\t// Firefox (pre 40) decodes `%3D` to `=`\n\t\t// https://github.com/sindresorhus/query-string/pull/37\n\t\tlet key = parts.shift();\n\t\tlet val = parts.length > 0 ? parts.join('=') : undefined;\n\n\t\t// missing `=` should be `null`:\n\t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\t\tval = val === undefined ? null : decodeComponent(val);\n\n\t\tformatter(decodeComponent(key), val, ret);\n\t});\n\n\treturn Object.keys(ret).sort().reduce(function(result, key) {\n\t\tlet val = ret[key];\n\t\tif (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {\n\t\t\t// Sort object keys, not values\n\t\t\tresult[key] = keysSorter(val);\n\t\t} else {\n\t\t\tresult[key] = val;\n\t\t}\n\n\t\treturn result;\n\t}, Object.create(null));\n}\n\nexports.extract = extract;\nexports.parse = parse;\n\nexports.stringify = function(obj, opts) {\n\tlet defaults = {\n\t\tencode: true,\n\t\tstrict: true,\n\t\tarrayFormat: 'none',\n\t};\n\n\topts = objectAssign(defaults, opts);\n\n\tif (opts.sort === false) {\n\t\topts.sort = function() {};\n\t}\n\n\tlet formatter = encoderForArrayFormat(opts);\n\n\treturn obj ? Object.keys(obj).sort(opts.sort).map(function(key) {\n\t\tlet val = obj[key];\n\n\t\tif (val === undefined) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (val === null) {\n\t\t\treturn encode(key, opts);\n\t\t}\n\n\t\tif (Array.isArray(val)) {\n\t\t\tlet result = [];\n\n\t\t\tval.slice().forEach(function(val2) {\n\t\t\t\tif (val2 === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresult.push(formatter(key, val2, result.length));\n\t\t\t});\n\n\t\t\treturn result.join('&');\n\t\t}\n\n\t\treturn encode(key, opts) + '=' + encode(val, opts);\n\t}).filter(function(x) {\n\t\treturn x.length > 0;\n\t}).join('&') : '';\n};\n\nexports.parseUrl = function(str, opts) {\n\treturn {\n\t\turl: str.split('?')[0] || '',\n\t\tquery: parse(extract(str), opts),\n\t};\n};\n","/* eslint-disable no-trailing-spaces */\n/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\", \"info\"] }] */\n/* eslint no-invalid-this: 0 */\n/* eslint max-len: 0 */\n/* eslint comma-dangle: 0 */\nexport function pushPageView(dataGroup) {\n\twindow.dataLayer.push({\n\t\tevent: 'pageView',\n\t\tecommerce: {\n\t\t\t// index: CustomDimensionID is TBA,\n\t\t\t// dataGroup needs to be specified in BE\n\t\t\t// Body tag in HTML to include Visitor Groups via a custom data attribute - data-group=\"{VisitorGroup}\"\n\t\t\tindex: '123',\n\t\t\tvalue: dataGroup,\n\t\t},\n\t});\n}\n\nexport function pushFormSubmit(formID) {\n\twindow.dataLayer.push({\n\t\tevent: 'formSubmit',\n\t\tecommerce: {\n\t\t\tcategory: 'form',\n\t\t\taction: 'submit',\n\t\t\tlabel: formID,\n\t\t\tvalue: null\n\t\t},\n\t\teventCallback: function() {\n\t\t\t// may need callback logic in the future..\n\t\t\t// if (url) {\n\t\t\t// \twindow.location = url;\n\t\t\t// }\n\t\t\t// if (form) {\n\t\t\t// \t$(form).submit();\n\t\t\t// }\n\t\t}\n\t});\n}\n\nexport function pushCarparkSearch(arrivalDate, departureDate, location) {\n\tif (window.dataLayer) {\n\t\twindow.dataLayer.push({\n\t\t\tevent: 'formSubmit',\n\t\t\tecommerce: {\n\t\t\t\tarrivalDate,\n\t\t\t\tdepartureDate,\n\t\t\t\tlocation,\n\t\t\t}\n\t\t});\n\t}\n}\n// reference for GTM carpark tracking\n// export function cartCheckoutButton(products, form) {\n// \t// map props to what we need only\n// \tlet mappedProducts = products.map(function(product) {\n// \t\tlet obj = {\n// \t\t\tid: product.itemSkuNumber,\n// \t\t\tname: product.name,\n// \t\t\tbrand: product.brand,\n// \t\t\tcategory: product.categoryName,\n// \t\t\tprice: (product.lineItemDiscountTotal.amount) ? product.lineItemDiscountTotal.amount || 0 : product.price.amount || 0,\n// \t\t\tquantity: product.quantity || 1\n// \t\t};\n// \t\tif (obj.name || obj.id) return obj;\n// \t});\n// \tif (mappedProducts.length > 0) {\n// \t\twindow.dataLayer.push({\n// \t\t\tevent: 'checkout',\n// \t\t\tecommerce: {\n// \t\t\t\tcheckout: {\n// \t\t\t\t\tactionField: {\n// \t\t\t\t\t\tstep: 1,\n// \t\t\t\t\t\toption: 'Checkout'\n// \t\t\t\t\t},\n// \t\t\t\t\tproducts: mappedProducts\n// \t\t\t\t}\n// \t\t\t},\n// \t\t\teventCallback: function() {\n// \t\t\t\t$(form).submit();\n// \t\t\t}\n// \t\t});\n// \t}\n// }\n","import React, {useState, useEffect} from 'react';\nimport {utils} from '../../../../global/js/utils.js';\nimport * as dataLayer from '../../../../global/js/dataLayer';\nimport _ from 'lodash';\nimport queryString from '../../../../global/js/query-string';\nimport PlacesAutocomplete, {\n\tgeocodeByAddress,\n\tgetLatLng,\n} from 'react-places-autocomplete';\n\nconst AddressSearchBar = (props) => {\n\tconst [searchTerm, setSearchTerm] = useState('');\n\tconst [activeInput, setActiveInput] = useState('');\n\tconst [loaded, setLoaded]= useState(false);\n\tconst _queryStr = props.queryToUpdate || 'address';\n\tconst [prevSuggestions, setPrevSuggestions] = useState([]);\n\tconst [canClear, setCanClear] = useState(false);\n\n\tuseEffect(() => {\n\t\tif(props.useCurrentLocation === true) {\n\t\t\tif(props.getAddress === undefined || props.getAddress === '') {\n\t\t\t\tcurrentLocation();\n\t\t\t}\n\t\t}\n\t}, []);\n\n\t// useEffect(()=>{\n\t\t// _.debounce(() => {\n\t\t// \tif(!!searchTerm) onSelect(searchTerm);\n\t\t// }, 150)\n\t// }, [searchTerm]);\n\n\tconst currentLocation = () => {\n\t\tif (navigator.geolocation) {\n\t\t\t// eslint-disable-next-line no-undef\n\t\t\tlet geocoder = new google.maps.Geocoder;\n\t\t\tnavigator.geolocation.getCurrentPosition((position) => {\n\t\t\t\tconst {latitude, longitude} = position.coords;\n\t\t\t\tgeocodeLatLng(geocoder, {lat: latitude, lng: longitude});\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.err('Geolocation is not supported by this browser.');\n\t\t}\n\t};\n\n\tconst geocodeLatLng = (geocoder, latlng) => {\n\t\tgeocoder.geocode({'location': latlng}, function(results, status) {\n\t\t\tif (status === 'OK') {\n\t\t\t\tif (results[0]) {\n\t\t\t\t\tsetSearchTerm(results[0].formatted_address);\n\t\t\t\t\tprops.onSelect(results[0].formatted_address);\n\t\t\t\t\t// window.history.replaceState('', '', utils.updateURLParameter(window.location.href, _queryStr, results[0].formatted_address));\n\t\t\t\t\tconst _location = queryString.parse(localStorage.getItem('userLocation')) || {};\n\t\t\t\t\t_location[_queryStr] = results[0].formatted_address;\n\t\t\t\t\t_location['lat'] = latlng.lat;\n\t\t\t\t\t_location['lng'] = latlng.lng;\n\t\t\t\t\tlocalStorage.setItem('userLocation', $.param(_location));\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.log('Geocoder failed due to: ' + status);\n\t\t\t}\n\t\t});\n\t};\n\n\tuseEffect(() => {\n\t\tif(props.getAddress) {\n\t\t\tsetSearchTerm(props.getAddress);\n\t\t\tsetCanClear(true);\n\t\t}\n\t}, [props.getAddress]);\n\n\n\tconst onSelect = (address) =>{\n\t\tif(prevSuggestions.length < 1 || address.length <= 10) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(address.includes('Australia') === false && address.includes('New Zealand') === false) {\n\t\t\treturn;\n\t\t}\n\t\t// the following is an effort to work around the hard coded URL F-UP string and to allow the parent a back door to handle the update itself\n\t\tif(props.onSelect) {\n\t\t\tprops.onSelect(address);\n\t\t}\n\t\thandleSelect(address);\n\n\t\t// apply GTM datalayer search\n\t\tconst parsedQuery = queryString.parse(location.search);\n\t\tconst arrivalDate = parsedQuery.entry;\n\t\tconst departureDate = parsedQuery.exit;\n\t\tdataLayer.pushCarparkSearch(arrivalDate, departureDate, address);\n\t};\n\n\t// refactor the shouldNotUpdateAddress out\n\tconst handleSelect = (address, shouldNotUpdateAddress) => {\n\t\tsetSearchTerm(address);\n\n\t\t// OMG 😕 WHY HARD CODE THE ADDRESS ON A GENERIC COMPONENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t\t// window.history.replaceState('', '', utils.updateURLParameter(window.location.href, _queryStr, address));\n\t\tlet _latLng;\n\t\tgeocodeByAddress(address)\n\t\t\t.then((results) => getLatLng(results[0]))\n\t\t\t.then((latLng) => {\n\t\t\t\tconsole.log('Success', latLng);\n\t\t\t\t_latLng = latLng;\n\t\t\t\t// window.history.replaceState('', '', utils.updateURLParameter(window.location.href, 'lat', latLng.lat));\n\t\t\t\t// window.history.replaceState('', '', utils.updateURLParameter(window.location.href, 'lng', latLng.lng));\n\n\t\t\t\tif(props.setUserLocation) props.setUserLocation(latLng);\n\t\t\t\t// if (!props.preventFetchingResults) {\n\t\t\t\tif(props.fetchParkings) {\n\t\t\t\t\tprops.fetchParkings(latLng);\n\t\t\t\t}\n\n\t\t\t\tif(props.fetchRecommendedParkings) {\n\t\t\t\t\tprops.fetchRecommendedParkings(latLng);\n\t\t\t\t}\n\t\t\t\t// }\n\t\t\t})\n\t\t\t.catch((error) => console.error('Error', error))\n\t\t\t.finally(()=>{\n\t\t\t\tconst _location = queryString.parse(localStorage.getItem('searchLocation')) || {};\n\t\t\t\t_location[_queryStr] = address;\n\t\t\t\tif (_latLng) {\n\t\t\t\t\t_location['lat'] = _latLng.lat;\n\t\t\t\t\t_location['lng'] = _latLng.lng;\n\t\t\t\t}\n\t\t\t\tlocalStorage.setItem('searchLocation', $.param(_location));\n\t\t\t\tlocalStorage.removeItem('useCurrentLocation');\n\t\t\t});\n\t};\n\n\tconst searchOptions = {\n\t\ttypes: [],\n\t\tcomponentRestrictions: {\n\t\t\tcountry: !props.country ? 'au' : props.country,\n\t\t\t// country: 'au'\n\t\t},\n\t};\n\n\tconst handleActiveInput = ((str) => {\n\t\tsetActiveInput(str);\n\t});\n\n\tconst clearInput = () => {\n\t\tsetSearchTerm('');\n\t\tsetCanClear(false);\n\t};\n\n\tconst renderFunc = ({getInputProps, getSuggestionItemProps, suggestions}) => {\n\t\t// console.log(suggestions);\n\t\t// if(suggestions.length > 0) {\n\t\t// \tsetPrevSuggestions(suggestions)\n\t\t// } else {\n\t\t// \tsetPrevSuggestions([])\n\t\t// }\n\t\tsetPrevSuggestions(suggestions);\n\n\n\t\treturn (\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t{canClear && (
)}\n\t\t\t\t
\n\t\t\t\t
0) ? 'show-border' : ''}`}>\n\t\t\t\t\t{suggestions.map((suggestion, i) => (\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{suggestion.formattedSuggestion.mainText}\n\t\t\t\t\t\t\t, {suggestion.formattedSuggestion.secondaryText}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t))}\n\t\t\t\t\t{suggestions.length > 0 &&\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tSearch near my location\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t};\n\n\tconst onChange = (address) => {\n\t\tif(address) setCanClear(true);\n\t\tsetSearchTerm(address);\n\t};\n\n\treturn (\n\t\t
\n\t\t\t\t= 2}\n\t\t\t\t\t>\n\t\t\t\t\t{renderFunc}\n\t\t\t\t\n\t\t
\n\t);\n};\n\nexport default AddressSearchBar;\n","import React, { Component, useState, useEffect } from \"react\";\nimport DayPicker from \"react-day-picker\";\nimport moment from \"moment\";\n\nconst DateTimePicker = props => {\n\tconst [selectedTime, setSelectedTime] = useState(\"\");\n\n\tconst {dateTime} = props;\n\n\tReact.useEffect(()=>{\n\t\tconsole.log(dateTime);\n\n\t\tif(!!dateTime) {\n\t\t\tsetSelectedTime(formatTimeToStr(dateTime))\n\t\t}\n\t},[])\n\n\tconst getHourMinFromStr = hourMin =>({\n\t\tamPm: hourMin.substring(5),\n\t\thour:Number.parseInt(hourMin.split(\":\")[0]),\n\t\tmin:Number.parseInt(hourMin.split(\":\")[1])\n\t})\n\tconst onTimeSelected = hourMin =>{\n\t\tconst {hour, min, amPm} = getHourMinFromStr(hourMin);\n\t\tconst datePart = moment(!!dateTime? dateTime:new Date()).format(\"MM-DD-YYYY\");\n\t\tconst combined = `${datePart},${hour}:${min}${amPm}`\n\t\tlet newDateTime = moment(combined, \"MM-DD-YYYY,h:mma\").toDate()\n\t\tsetSelectedTime(hourMin);\n\t\tprops.setDateTime(newDateTime);\n\t\tprops.onDateTimeSelected(newDateTime);\n\t}\n\n\tconst disableSelectedTime = hourMin => {\n\t\tif(!hourMin) return \"\";\n\t\tconst {hour, min} = getHourMinFromStr(hourMin);\n\t\t//still need to work in min\n\t\tif(!!props.minTimeFrom){\n\t\t\tif(hour < props.minTimeFrom) return \"timeDisabled\"\n\t\t}\n\t\tif(!!props.maxTimeTo){\n\t\t\tif(hour > props.maxTimeTo) return \"timeDisabled\"\n\t\t}\n\n\t\treturn \"\";\n\t}\n\n\tconst OnDaySelected = date => {\n\t\tif (!!dateTime) {\n\t\t\tconst originalHour = dateTime.getHours();\n\t\t\tconst originalMin = dateTime.getMinutes();\n\t\t\tlet newDateTime = date;\n\t\t\tnewDateTime.setHours(originalHour);\n\t\t\tnewDateTime.setMinutes(originalMin);\n\t\t\tprops.setDateTime(newDateTime);\n\t\t}\n\t};\n\n\tconst formatTimeToStr = date => `${moment(date).format(\"hh:mma\")}`\n\n\tconst getCorrectHoursAndMin = () => {\n\t\tconst halfHoursSelect = [];\n\t\tlet startDateTimeFrom = props.disableDateFrom || new Date();\n\t\tlet originalMin = startDateTimeFrom.getMinutes();\n\t\tif (originalMin !== 0) {\n\t\t\tif (originalMin > 0 && originalMin <= 30) originalMin = 30;\n\t\t\telse {\n\t\t\t\t//if the min is more then 30 add an hour to the date and set the min at 30\n\t\t\t\tconst hourInMs = 60 * 1000 * 60\n\t\t\t\tstartDateTimeFrom = new Date(startDateTimeFrom.getTime() + hourInMs);\n\t\t\t\toriginalMin = 0;\n\t\t\t}\n\t\t\tstartDateTimeFrom.setMinutes(originalMin)\n\t\t}\n\t\tlet dateToEval = new Date(dateTime) || new Date()\n\t\tfor (let hourIndex = 1; hourIndex < 25; hourIndex++) {\n\t\t\tdateToEval.setHours(hourIndex);\n\t\t\tfor (let minIndex = 0; minIndex < 2; minIndex++) {\n\t\t\t\tlet min = minIndex % 2 === 0? 0 : 30;\n\t\t\t\tdateToEval.setMinutes(min);\n\n\t\t\t\tif(dateToEval < startDateTimeFrom) continue;\n\t\t\t\tconst validSelectableTime = formatTimeToStr(dateToEval)\n\t\t\t\thalfHoursSelect.push(validSelectableTime);\n\t\t\t}\n\t\t}\n\n\t\treturn halfHoursSelect;\n\t};\n\n\n\n\treturn (\n\t\t
\n\t\t\t
Please pick a day and time.
\n\t\t\t
\n\t\t\t\t\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t{getCorrectHoursAndMin().map((hour, index) => (\n\t\t\t\t\t\t\t\t onTimeSelected(hour)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{hour}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default DateTimePicker;\n","import React, {Component, useState, useEffect} from 'react';\nimport AddressSearchBar from '../../addressSearchBar/js/AddressSearchBar.jsx';\nimport DateTimePicker from './../../locationTopSearchBarBlock/js/DateTimePicker.jsx';\nimport {utils} from '../../../../global/js/utils.js';\nimport moment from 'moment';\nimport queryString from 'global/js/query-string.js';\n\nconst SearchDateTimeBlock = (props) => {\n\tlet [address, setAddress] = useState('');\n\tlet [userAddress, setUserAddress] = useState('');\n\n\tlet [DateTimeIn, setDateTimeIn] = useState(null);\n\tlet [DateTimeOut, setDateTimeOut] = useState(null);\n\n\tlet [showError, setShowError] = useState(null);\n\n\tlet [userLocation, setUserLocation] = useState({lat: null, lng: null});\n\n\tlet [showingDateTimeInDialogue, setShowingDateTimeInDialogue] = useState(false);\n\tlet [showingDateTimeOutDialogue, setShowingDateTimeOutDialogue] = useState(false);\n\n\tconst onFromTimeSelected = (dateTime) => {\n\t\tsetTimeout(() => {\n\t\t\tsetShowingDateTimeInDialogue(false);\n\t\t\tsetShowingDateTimeOutDialogue(true);\n\t\t}, 250);\n\t};\n\n\tconst onToTimeSelected = (dateTime) => {\n\t\tsetTimeout(() => {\n\t\t\tsetShowingDateTimeInDialogue(false);\n\t\t\tsetShowingDateTimeOutDialogue(false);\n\t\t}, 250);\n\t};\n\n\tuseEffect(() => {\n\t\t// eslint-disable-next-line no-undef\n\t\tlet geocoder = new google.maps.Geocoder();\n\t\tnavigator.geolocation.getCurrentPosition((position) => {\n\t\t\tconst {latitude, longitude} = position.coords;\n\t\t\tsetUserLocation({lat: latitude, lng: longitude});\n\t\t\tgeocodeLatLng(geocoder, {lat: latitude, lng: longitude});\n\t\t});\n\n\t\t// init the dateTime in & out...\n\t\tconst parsedQuery = queryString.parse(location.search);\n\t\tconst urlQueryDateTimeIn = parsedQuery.entry;\n\t\tconst urlQueryDateTimeOut = parsedQuery.exit;\n\t\tconst getDateSegments = (dateTimeStr) => moment(dateTimeStr, 'MM-DD-YYYY,h:mma').toDate();\n\t\tif(!urlQueryDateTimeIn) {\n\t\t\tsetDateTimeIn(new Date());\n\t\t} else {\n\t\t\tsetDateTimeIn(getDateSegments(urlQueryDateTimeIn));\n\t\t}\n\t\tif(!urlQueryDateTimeOut) {\n\t\t\tsetDateTimeOut(new Date(new Date().setHours(new Date().getHours() + 1)));\n\t\t} else {\n\t\t\tsetDateTimeOut(getDateSegments(urlQueryDateTimeOut));\n\t\t}\n\t}, []);\n\n\t// useEffect(() => {\n\t// \tif (userLocation.lat && userLocation.lng) {\n\t// \t\twindow.history.replaceState(\n\t// \t\t\t'',\n\t// \t\t\t'',\n\t// \t\t\tutils.updateURLParameter(\n\t// \t\t\t\twindow.location.href,\n\t// \t\t\t\t'lat',\n\t// \t\t\t\tuserLocation.lat\n\t// \t\t\t)\n\t// \t\t);\n\t// \t\twindow.history.replaceState(\n\t// \t\t\t'',\n\t// \t\t\t'',\n\t// \t\t\tutils.updateURLParameter(\n\t// \t\t\t\twindow.location.href,\n\t// \t\t\t\t'lng',\n\t// \t\t\t\tuserLocation.lng\n\t// \t\t\t)\n\t// \t\t);\n\t// \t}\n\t// }, [userLocation]);\n\n\tconst formatDateForUrl = (dateTime) => moment(dateTime).format('MM-DD-YYYY,hh:mma');\n\tconst updateUrl = (key, DateTime) => {\n\t\tconst DateInStr = formatDateForUrl(DateTime);\n\t\twindow.history.replaceState('', '', utils.updateURLParameter(window.location.href, key, DateInStr));\n\t};\n\n\tuseEffect(() => {\n\t\tif (DateTimeIn) {\n\t\t\tupdateUrl('entry', DateTimeIn);\n\t\t\tif(DateTimeIn > DateTimeOut) {\n\t\t\t\tsetDateTimeOut(DateTimeIn);\n\t\t\t\tupdateUrl('exit', DateTimeIn);\n\t\t\t}\n\t\t}\n\t}, [DateTimeIn]);\n\n\tuseEffect(() => {\n\t\tif (DateTimeOut) {\n\t\t\tupdateUrl('exit', DateTimeOut);\n\t\t}\n\t}, [DateTimeOut]);\n\n\tconst geocodeLatLng = (geocoder, latlng) => {\n\t\tgeocoder.geocode({location: latlng}, function(results, status) {\n\t\t\tif (status === 'OK') {\n\t\t\t\tif (results[0]) {\n\t\t\t\t\t// setAddress(results[0].formatted_address);\n\t\t\t\t\tsetUserAddress(results[0].formatted_address);\n\n\t\t\t\t\t// window.history.replaceState(\n\t\t\t\t\t// \t'',\n\t\t\t\t\t// \t'',\n\t\t\t\t\t// \tutils.updateURLParameter(\n\t\t\t\t\t// \t\twindow.location.href,\n\t\t\t\t\t// \t\t'address',\n\t\t\t\t\t// \t\tresults[0].formatted_address\n\t\t\t\t\t// \t)\n\t\t\t\t\t// );\n\t\t\t\t\tconst _location = queryString.parse(localStorage.getItem('userLocation')) || {};\n\t\t\t\t\t_location['address'] = results[0].formatted_address;\n\t\t\t\t\t_location['lat'] = latlng.lat;\n\t\t\t\t\t_location['lng'] = latlng.lng;\n\t\t\t\t\tlocalStorage.setItem('userLocation', $.param(_location));\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.log('Geocoder failed due to: ' + status);\n\t\t\t}\n\t\t});\n\t};\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tDateTimeIn != '' &&\n\t\t\tDateTimeOut != '' &&\n\t\t\tuserLocation.lat &&\n\t\t\tuserLocation.lng\n\t\t) {\n\t\t\tsetShowError(false);\n\t\t}\n\t}, [userLocation, DateTimeIn, DateTimeOut]);\n\n\tconst showResults = () => {\n\t\tsetShowError(false);\n\t\tconst queryString = window.location.href.split('?')[1];\n\t\tconst url = props.parkSearchUrl + '?' + queryString;\n\t\twindow.location = url;\n\t};\n\n\tconst searchByLocation = () => {\n\t\tlocalStorage.removeItem('useCurrentLocation');\n\t\tshowResults();\n\t};\n\n\tconst useCurrentLocation = () => {\n\t\tif (userLocation.lat && userLocation.lng) {\n\t\t\t// window.history.replaceState(\n\t\t\t// \t'',\n\t\t\t// \t'',\n\t\t\t// \tutils.updateURLParameter(\n\t\t\t// \t\twindow.location.href,\n\t\t\t// \t\t'lat',\n\t\t\t// \t\tuserLocation.lat\n\t\t\t// \t)\n\t\t\t// );\n\t\t\t// window.history.replaceState(\n\t\t\t// \t'',\n\t\t\t// \t'',\n\t\t\t// \tutils.updateURLParameter(\n\t\t\t// \t\twindow.location.href,\n\t\t\t// \t\t'lng',\n\t\t\t// \t\tuserLocation.lng\n\t\t\t// \t)\n\t\t\t// );\n\t\t\tlocalStorage.setItem('useCurrentLocation', 'true');\n\t\t\tshowResults();\n\t\t} else {\n\t\t\talert('Please enable the location service in your browser');\n\t\t}\n\t\tsetAddress(userAddress);\n\t};\n\n\treturn (\n\t\t
\n\t\t\t
\n\t\t\t\tPlease select entry and exit times.\n\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t{/* {props.showEntryExitTimes && (\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t setShowingDateTimeInDialogue(!showingDateTimeInDialogue)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{!!DateTimeIn ? moment(DateTimeIn).format(\"DD MMM hh:mma\") : \"Entry\"}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t{showingDateTimeInDialogue && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t setShowingDateTimeOutDialogue(!showingDateTimeOutDialogue)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{!!DateTimeOut ? moment(DateTimeOut).format(\"DD MMM hh:mma\") : \"Exit\"}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t{showingDateTimeOutDialogue && (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t)}\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t)} */}\n\t\t\t\n\t\t\t\tShow results\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
Search near me
\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default SearchDateTimeBlock;\n"],"sourceRoot":""}