\n\n\n\n\n\n","import { render } from \"./custom-gmap-autocomplete.vue?vue&type=template&id=1517509f&scoped=true\"\nimport script from \"./custom-gmap-autocomplete.vue?vue&type=script&lang=js\"\nexport * from \"./custom-gmap-autocomplete.vue?vue&type=script&lang=js\"\n\nimport \"./custom-gmap-autocomplete.vue?vue&type=style&index=0&id=1517509f&lang=scss&scoped=true\"\n\nimport exportComponent from \"../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-1517509f\"]])\n\nexport default __exports__","import assignLocationValues from '../helpers/assign-location-values'\nimport MapsService from '@/api/maps-service'\n\nexport default {\n data() {\n return {\n geocodeFinished: false,\n geocodeSucceeded: null\n }\n },\n\n computed: {\n commonLocationOptions() {\n let options = {}\n\n if (this.boundaryBox && this.boundaryBox.min_latitude && this.boundaryBox.max_latitude) {\n options.bounds = {south: this.boundaryBox.min_latitude,\n west: this.boundaryBox.min_longitude,\n north: this.boundaryBox.max_latitude,\n east: this.boundaryBox.max_longitude}\n }\n\n return options\n },\n\n geocoderOptions() {\n let options = this.commonLocationOptions\n\n // the geocoder only supports a single country\n if (this.country !== null && this.country !== '' && !Array.isArray(this.country)) {\n options.country = this.country\n }\n\n return options\n },\n\n autocompleteOptions() {\n let options = this.commonLocationOptions\n\n // the autocomplete component supports an array of countries\n if (this.country !== null && this.country !== '') {\n options.countries = Array.isArray(this.country) ? this.country : [this.country]\n }\n\n return options\n },\n\n showValidationError() {\n return this.geocodeFinished && !this.geocodeSucceeded\n }\n },\n\n methods: {\n geocodeLocation(postGeocode) {\n // start with the options we always pass to the geocoder\n const geocoderRequest = Object.assign({}, this.geocoderOptions)\n\n // set the address to be whatever the user typed in the field.\n geocoderRequest['address'] = this.currentQuery\n\n MapsService.geocode(geocoderRequest).then((results) => {\n if (results.length > 0) {\n this.geocodeSucceeded = true\n this.location = assignLocationValues(this.location, results[0], {keepExistingFieldValues: false, excludeVenue: this.excludeVenueField})\n\n // If we're using the venue field, use user's query as venue if it's not returned by Google Maps API\n if (!this.excludeVenueField && (!this.location.venue || this.location.venue === '')) {\n this.location.venue = this.currentQuery\n } else {\n this.currentQuery = this.location.query\n }\n } else {\n this.geocodeSucceeded = false\n }\n\n this.geocodeFinished = true\n\n postGeocode()\n })\n },\n\n autocompletePlaceChanged(place) {\n if ('coordinates' in place) {\n this.location = assignLocationValues({}, place, {keepExistingFieldValues: false, excludeVenue: this.excludeVenueField})\n this.changeAttribute() // Components including the mixin must implement this method\n }\n }\n }\n}\n","// Iterates over Google Map API's result for geocoded place and returns the\n// value of the component with name matching the fields argument.\n// If multiple components match the fields, the value from the last one is returned.\n// Arguments:\n// components: google.maps.places.PlaceResult Google Map API object\n// fields: this can either be\n// - the name of a single component being searched\n// - an array with multiple possible component names. The value of the last component found that matches\n// any of the items in the array will be returned\n// longName: a boolean indicating if long_name or short_name of the component should be returned\nexport default function(components, fields, longName) {\n let componentValue = null\n\n components.forEach((component) => {\n component.types.forEach((componentType) => {\n let included = false\n\n if (Array.isArray(fields)) {\n included = fields.includes(componentType)\n } else {\n included = componentType === fields\n }\n\n if (included) {\n componentValue = longName ? component.long_name : component.short_name\n }\n })\n })\n\n return componentValue\n}\n","import extractGoogleMapAddressComponent from './extract-google-map-address-component'\n\nexport default function(obj, place, { keepExistingFieldValues = false, excludeVenue = false}) {\n const assignValue = (locationProperty, value, override) => {\n if (!keepExistingFieldValues || override) {\n obj[locationProperty] = value\n }\n }\n\n assignValue('query', place.formatted_address, true)\n assignValue('street_number', extractGoogleMapAddressComponent(place.address_components, 'street_number', true))\n assignValue('street', extractGoogleMapAddressComponent(place.address_components, 'route', true))\n assignValue('postal_code', extractGoogleMapAddressComponent(place.address_components, 'postal_code', true))\n assignValue('country', extractGoogleMapAddressComponent(place.address_components, 'country', false), !obj['country'])\n assignValue('locality', extractGoogleMapAddressComponent(place.address_components, ['locality', 'postal_town'], true))\n assignValue('region', extractGoogleMapAddressComponent(place.address_components, ['administrative_area_level_1', 'administrative_area_level_2'], false))\n\n assignValue('latitude', place.coordinates.latitude, true)\n assignValue('longitude', place.coordinates.longitude, true)\n\n if (!excludeVenue) {\n assignValue('venue', place.name)\n }\n\n return obj\n}\n","\n
\n \n
\n\n\n\n","import { render } from \"./hidden-fields.vue?vue&type=template&id=69464e85\"\nimport script from \"./hidden-fields.vue?vue&type=script&lang=js\"\nexport * from \"./hidden-fields.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"names":["service","window","Agra","Configuration","stubGoogleMaps","stubbedService","loadStubbedService","module","importWithRetry","this","default","autocomplete","params","then","geocode","findPlace","getPlaceDetails","input","bounds","countries","tokyoHost","tokyoUrlBase","center","locationSearchBias","url","URLSearchParams","query","JSON","stringify","locale","htmlLang","toString","Promise","resolve","reject","ajax","get","camelCaseResponse","successHandler","resp","errorHandler","err","address","country","placeId","encodeURIComponent","key","class","for","components","CustomGmapAutocomplete","HiddenFields","ValidationErrors","mixins","GeocodeLocation","props","value","type","Object","required","validationErrors","Array","label","String","locationKindFieldName","nationalOptionHint","nationalOptionLabel","inject","t","localOptionHint","localOptionLabel","name","emits","data","blurGeocodingPromise","excludeVenueField","locationKind","location","assign","currentQuery","showLocalOptionLabel","length","computed","boundaryBox","agraConfiguration","organisationCountry","gmapAutocompleteClasses","attr","hasValidationError","isArray","locationQuery","showLocationField","validationErrorsForDisplay","methods","changeAttribute","updateQuery","$emit","focus","$refs","radioNational","gmapAutocomplete","handleAutocompletePlaceChanged","async","place","autocompletePlaceChanged","locationKindChanged","resetLocation","locationQueryBlurred","isPresent","latitude","geocodeLocation","geocodeSucceeded","setLocal","setNational","newQuery","skipLocationReset","street_number","street","postal_code","locality","region","longitude","_createElementBlock","$props","_hoisted_1","_toDisplayString","_createCommentVNode","_createTextVNode","_createElementVNode","_hoisted_2","_hoisted_3","id","ref","_cache","$event","$data","onChange","args","$options","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_Fragment","_createVNode","_component_custom_gmap_autocomplete","_normalizeClass","options","_ctx","autocompleteOptions","onBlur","onFocus","onInput","onPlaceChanged","_createBlock","_component_validation_errors","errors","_component_hidden_fields","inheritAttrs","allowEnterManuallyOption","Boolean","inputPlaceholder","selectFirstOnEnter","autofocusing","focusedOption","displayOptions","enterManuallyMainTerm","i18n","user_query","clearAutocompleteOptions","clearQuery","nextTick","focusNextOption","focusedOptionIndex","indexOf","focusPreviousOption","lookUpPlaces","getPlacePredictionOptions","predictionsForQuery","MapsService","predictions","map","prediction","description","mainMatchingTerm","terms","secondaryMatchingTerm","secondaryMatchingTermsForDisplay","place_id","push","isManualInput","payload","setTimeout","e","target","debouncedLookUpPlaces","debounce","onKeyDown","includes","code","preventDefault","selectedOption","optionIsFocused","autocompleteOption","slice","term","join","selectedEnterManuallyOption","option","result","_mergeProps","$attrs","placeholder","onKeydown","_renderList","selected","onMousedown","onClick","src","_imports_0","geocodeFinished","commonLocationOptions","min_latitude","max_latitude","south","west","min_longitude","north","east","max_longitude","geocoderOptions","showValidationError","postGeocode","geocoderRequest","results","assignLocationValues","keepExistingFieldValues","excludeVenue","venue","fields","longName","componentValue","forEach","component","types","componentType","included","long_name","short_name","obj","assignValue","locationProperty","override","formatted_address","extractGoogleMapAddressComponent","address_components","coordinates","fieldGroupName","locationFields","filteredLocationFields","getFullFieldName","difference","keys","locationField"],"sourceRoot":""}