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,YAAY9I,WAAW,GAEjD2H,GACHa,EAAY,QAAS1J,EAAMhC,MAGtByL,CACT,C,8GCzBA,iB,wBASA,GACEzM,MAAO,CACLsB,SAAU,CACRpB,KAAMC,OACNC,UAAU,GAEZ6M,eAAgB,CACd/M,KAAMM,OACNJ,UAAU,EACVjD,QAAS,aAIbwE,SAAU,CACRuL,cAAAA,GACE,OAAOhQ,KAAKiQ,uBAAuBjQ,KAAKoE,SAC1C,GAGFgB,QAAS,CACP8K,gBAAAA,CAAiBpM,GACf,MAAO,GAAG9D,KAAK+P,kBAAkBjM,IACnC,EAEAmM,sBAAAA,CAAuB7L,GACrB,IAAKA,EACH,MAAO,GAIT,OAAO+L,IAAWlN,OAAOmN,KAAKhM,GADP,CAAC,sBAAuB,eAAgB,UAEjE,ICjCJ,OAFiC,E,SAAA,GAAgB,EAAQ,CAAC,CAAC,SDL3D,wCACE6C,EAAAA,EAAAA,IAEM,2BADJA,EAAAA,EAAAA,IAA2J4B,EAAAA,GAAA,MAF/JuE,EAAAA,EAAAA,IAEmCnF,EAAA+H,gBAAjBK,KAAa,WAA3BpJ,EAAAA,EAAAA,IAA2J,SAA3G5E,IAAKgO,EAAgBtN,MAAOmE,EAAA9C,SAASiM,GAAgBrN,KAAK,SAAUc,KAAMmE,EAAAiI,iBAAiBG,IAAa,OAF5JlJ,MAAA,W","sources":["webpack://agra/./app/javascript/api/maps-service.js","webpack://agra/./app/javascript/components/inputs/national-local-location-selector.vue","webpack://agra/./app/javascript/components/inputs/national-local-location-selector.vue?7f76","webpack://agra/./app/javascript/components/inputs/custom-gmap-autocomplete.vue","webpack://agra/./app/javascript/components/inputs/custom-gmap-autocomplete.vue?f50b","webpack://agra/./app/javascript/mixins/geocode-location.js","webpack://agra/./app/javascript/helpers/extract-google-map-address-component.js","webpack://agra/./app/javascript/helpers/assign-location-values.js","webpack://agra/./app/javascript/components/inputs/locations/hidden-fields.vue","webpack://agra/./app/javascript/components/inputs/locations/hidden-fields.vue?b424"],"sourcesContent":["import ajax from '@/helpers/ajax'\nimport { htmlLang } from '@/i18n/translations'\nimport { importWithRetry } from '@/utils/component-loader'\n\nlet service = null\n\nif (window.Agra.Configuration.stubGoogleMaps) {\n  // In scenarios, we mock out Google Maps calls with our own stub data.\n  service = {\n    stubbedService: null,\n\n    async loadStubbedService() {\n      const module = await importWithRetry(() => import(/* webpackMode: \"lazy\" */ './stubbed-maps-service'))\n      this.stubbedService = module.default\n    },\n\n    autocomplete(params) {\n      return this.loadStubbedService().then(() => {\n        return this.stubbedService.autocomplete(params)\n      })\n    },\n\n    geocode(params) {\n      return this.loadStubbedService().then(() => {\n        return this.stubbedService.geocode(params)\n      })\n    },\n\n    findPlace(params) {\n      return this.loadStubbedService().then(() => {\n        return this.stubbedService.findPlace(params)\n      })\n    },\n\n    getPlaceDetails(params) {\n      return this.loadStubbedService().then(() => {\n        return this.stubbedService.getPlaceDetails(params)\n      })\n    }\n  }\n} else {\n  const MapsService = {\n    autocomplete({ input, bounds, countries }) {\n      const tokyoHost = window.Agra.Configuration.tokyoUrlBase\n\n      const center = window.Agra.Configuration.locationSearchBias.center\n      const urlParams = new URLSearchParams({\n        query: input,\n        bounds: bounds ? JSON.stringify(bounds) : '',\n        center: center ? JSON.stringify(center) : '',\n        countries: countries ? JSON.stringify(countries) : '',\n        locale: htmlLang()\n      })\n\n      const url = `${tokyoHost}/maps/places/autocomplete?${urlParams.toString()}`\n\n      // Return a promise; callers should use it with .then to get the data\n      return new Promise((resolve, reject) => {\n        ajax.get({\n          url,\n          camelCaseResponse: false,\n          successHandler: (resp) => {\n            resolve(resp)\n          },\n          errorHandler: (err) => {\n            reject(err)\n          }\n        })\n      })\n    },\n\n    geocode({ address, bounds, country }) {\n      const tokyoHost = window.Agra.Configuration.tokyoUrlBase\n\n      const urlParams = new URLSearchParams({\n        query: address,\n        bounds: bounds ? JSON.stringify(bounds) : '',\n        country: country || '',\n        locale: htmlLang()\n      })\n\n      const url = `${tokyoHost}/maps/geocode?${urlParams.toString()}`\n\n      // Return a promise; callers should use it with .then to get the data\n      return new Promise((resolve, reject) => {\n        ajax.get({\n          url,\n          camelCaseResponse: false,\n          successHandler: (resp) => {\n            resolve(resp)\n          },\n          errorHandler: (err) => {\n            reject(err)\n          }\n        })\n      })\n    },\n\n    findPlace({ query, bounds }) {\n      const tokyoHost = window.Agra.Configuration.tokyoUrlBase\n\n      const center = window.Agra.Configuration.locationSearchBias.center\n      const urlParams = new URLSearchParams({\n        query,\n        bounds: bounds ? JSON.stringify(bounds) : '',\n        center: center ? JSON.stringify(center) : '',\n        locale: htmlLang()\n      })\n\n      const url = `${tokyoHost}/maps/places/search?${urlParams.toString()}`\n\n      // Return a promise; callers should use it with .then to get the data\n      return new Promise((resolve, reject) => {\n        ajax.get({\n          url,\n          camelCaseResponse: false,\n          successHandler: (resp) => {\n            resolve(resp)\n          },\n          errorHandler: (err) => {\n            reject(err)\n          }\n        })\n      })\n    },\n\n    getPlaceDetails({ placeId }) {\n      const tokyoHost = window.Agra.Configuration.tokyoUrlBase\n      const encodedPlaceId = encodeURIComponent(placeId)\n\n      const urlParams = new URLSearchParams({\n        locale: htmlLang()\n      })\n\n      const url = `${tokyoHost}/maps/places/${encodedPlaceId}/details?${urlParams.toString()}`\n\n      // Return a promise; callers should use it with .then to get the data\n      return new Promise((resolve, reject) => {\n        ajax.get({\n          url,\n          camelCaseResponse: false,\n          successHandler: (resp) => {\n            resolve(resp)\n          },\n          errorHandler: (err) => {\n            reject(err)\n          }\n        })\n      })\n    }\n  }\n\n  service = MapsService\n}\n\nexport default service\n","<template>\n  <div>\n    <label v-if=\"label\" class=\"col-form-label\">\n      {{ label }}\n    </label>\n\n    <div class=\"form-check d-flex align-items-baseline\">\n      <div class=\"radio-input-wrapper\">\n        <input id=\"radio-national\" ref=\"radioNational\" v-model=\"locationKind\" type=\"radio\" class=\"form-check-input\"\n               :name=\"locationKindFieldName\" value=\"national\" @change=\"locationKindChanged\">\n      </div>\n      <label class=\"form-check-label\" for=\"radio-national\">\n        <div class=\"form-check-content\">\n          {{ nationalOptionLabel }}\n        </div>\n        <p v-if=\"nationalOptionHint\" class=\"form-check-content text-muted mb-0\">\n          {{ nationalOptionHint }}\n        </p>\n      </label>\n    </div>\n    <div class=\"form-check d-flex align-items-baseline\">\n      <div class=\"radio-input-wrapper\">\n        <input id=\"radio-local\" v-model=\"locationKind\" type=\"radio\" class=\"form-check-input\"\n               :name=\"locationKindFieldName\" value=\"local\" @change=\"locationKindChanged\">\n      </div>\n      <label class=\"local-option form-check-label flex-grow-1\" for=\"radio-local\">\n        <div class=\"form-check-content\">\n          <div v-if=\"showLocalOptionLabel\">\n            {{ localOptionLabel }}\n          </div>\n          <p v-if=\"localOptionHint\" class=\"text-muted\">\n            {{ localOptionHint }}\n          </p>\n          <template v-if=\"showLocationField\">\n            <custom-gmap-autocomplete id=\"location-query-field\"\n                                      ref=\"gmapAutocomplete\"\n                                      :value=\"locationQuery\"\n                                      :select-first-on-enter=\"true\"\n                                      :class=\"gmapAutocompleteClasses\"\n                                      :options=\"autocompleteOptions\"\n                                      name=\"query\"\n                                      @blur=\"locationQueryBlurred\"\n                                      @focus=\"setLocal\"\n                                      @input=\"updateQuery\"\n                                      @place-changed=\"handleAutocompletePlaceChanged\" />\n            <validation-errors v-if=\"hasValidationError\" :errors=\"validationErrorsForDisplay\" />\n          </template>\n        </div>\n      </label>\n    </div>\n\n    <hidden-fields :field-group-name=\"name\" :location=\"location\" />\n  </div>\n</template>\n\n<script>\nimport CustomGmapAutocomplete from './custom-gmap-autocomplete'\nimport GeocodeLocation from '../../mixins/geocode-location'\nimport HiddenFields from './locations/hidden-fields'\nimport { inject } from 'vue'\nimport isPresent from '../../helpers/is-present'\nimport ValidationErrors from './validation-errors'\n\nexport default {\n  components: { CustomGmapAutocomplete, HiddenFields, ValidationErrors },\n\n  mixins: [ GeocodeLocation ],\n\n  props: {\n    value: {\n      type: Object,\n      required: false\n    },\n    validationErrors: {\n      type: [Object, Array],\n      required: false,\n      default: () => ({})\n    },\n    label: {\n      type: String,\n      required: false\n    },\n    locationKindFieldName: {\n      type: String,\n      required: false,\n      default: 'location_kind'\n    },\n    nationalOptionHint: {\n      type: String,\n      required: false\n    },\n    nationalOptionLabel: {\n      type: String,\n      required: false,\n      default() { return inject('i18n').t('member.petitions.national_campaign') }\n    },\n    localOptionHint: {\n      type: String,\n      required: false\n    },\n    localOptionLabel: {\n      type: String,\n      required: false,\n      default: null\n    },\n    name: {\n      type: String,\n      required: false,\n      default: 'location'\n    }\n  },\n\n  emits: ['changed', 'location-kind-changed'],\n\n  data() {\n    return {\n      // Used for serialization of geocoding when there is one from input being blurred and one from clicking autocomplete option\n      blurGeocodingPromise: null,\n\n      // Used by the GeocodeLocation mixin, setting to true avoids including the venue field in the location object\n      excludeVenueField: true,\n\n      locationKind: this.value === null ? 'national' : 'local',\n      location: Object.assign({}, this.value), // Clone object received as prop to avoid updating from this child component\n      currentQuery: null,\n      showLocalOptionLabel: this.localOptionLabel && this.localOptionLabel.length\n    }\n  },\n\n  computed: {\n    boundaryBox() {\n      return this.agraConfiguration.locationSearchBias.boundaryBox\n    },\n\n    country() {\n      return this.agraConfiguration.organisationCountry\n    },\n\n    gmapAutocompleteClasses() {\n      let attr = 'form-control query-input'\n      if (this.hasValidationError) {\n        attr = `${attr} is-invalid`\n      }\n      if (this.showLocalOptionLabel) {\n        attr = `${attr} mt-4`\n      }\n      return attr\n    },\n\n    hasValidationError() {\n      return this.validationErrors &&\n        ((Array.isArray(this.validationErrors) && this.validationErrors.length > 0) ||\n         (this.validationErrors.query && this.validationErrors.query.length > 0))\n    },\n\n    locationQuery() {\n      // If there is a location loaded already, for eg from inititalLocation use its query. Otherwise, use\n      // whatever the user has typed into the field\n      if (this.currentQuery) {\n        return this.currentQuery\n      } else if (this.location && this.location.query ) {\n        return this.location.query\n      } else {\n        return ''\n      }\n    },\n\n    showLocationField() {\n      return (this.locationKind === 'local') || !this.showLocalOptionLabel\n    },\n\n    validationErrorsForDisplay() {\n      if (Array.isArray(this.validationErrors)) {\n        return this.validationErrors\n      } else {\n        return this.validationErrors.query\n      }\n    }\n  },\n\n  methods: {\n    changeAttribute() {\n      this.updateQuery(this.location.query, true)\n      this.$emit('changed', this.location)\n    },\n\n    focus() {\n      if (this.locationKind === 'national') {\n        this.$refs.radioNational.focus()\n      } else {\n        this.$refs.gmapAutocomplete.focus()\n      }\n    },\n\n    handleAutocompletePlaceChanged: async function(place) {\n      if (this.blurGeocodingPromise) {\n        await this.blurGeocodingPromise\n        this.blurGeocodingPromise = null\n      }\n      this.autocompletePlaceChanged(place)\n    },\n\n    locationKindChanged() {\n      if (this.locationKind === 'national') {\n        this.resetLocation()\n      }\n\n      this.$emit('location-kind-changed', this.locationKind)\n    },\n\n    locationQueryBlurred() {\n      // Automatically geocode the location if the user entered something on the query input but\n      // didn't select an option from the autocomplete results\n      if (isPresent(this.currentQuery) && (!this.location || !this.location.latitude)) {\n        this.blurGeocodingPromise = new Promise((resolve) => {\n          this.geocodeLocation(() => {\n            if (this.geocodeSucceeded) {\n              this.$emit('changed', this.location)\n            }\n            resolve(true)\n          })\n        })\n      }\n\n    },\n\n    setLocal() {\n      this.locationKind = 'local'\n      this.$emit('location-kind-changed', this.locationKind)\n    },\n\n    setNational() {\n      this.locationKind = 'national'\n      this.currentQuery = null\n      this.resetLocation()\n      this.$emit('location-kind-changed', this.locationKind)\n    },\n\n    updateQuery(newQuery, skipLocationReset) {\n      if (!skipLocationReset) {\n        // Reset the location to ensure the location is geocoded again on blur.\n        // We explicitly skip the reset when setting the query after the user\n        // chose an option from the Autocomplete results\n        this.resetLocation()\n      }\n\n      this.currentQuery = newQuery\n    },\n\n    resetLocation() {\n      this.location.query = null\n      this.location.street_number = null\n      this.location.street = null\n      this.location.postal_code = null\n      this.location.country = null\n      this.location.locality = null\n      this.location.region = null\n      this.location.latitude = null\n      this.location.longitude = null\n\n      this.$emit('changed', null)\n    }\n  }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.form-check {\n  margin-bottom: 1rem;\n}\n</style>\n","import { render } from \"./national-local-location-selector.vue?vue&type=template&id=3d54a3a4&scoped=true\"\nimport script from \"./national-local-location-selector.vue?vue&type=script&lang=js\"\nexport * from \"./national-local-location-selector.vue?vue&type=script&lang=js\"\n\nimport \"./national-local-location-selector.vue?vue&type=style&index=0&id=3d54a3a4&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-3d54a3a4\"]])\n\nexport default __exports__","<template>\n  <div class=\"autocomplete-wrapper\">\n    <input v-bind=\"$attrs\" ref=\"autocomplete\" autocomplete=\"off\" :value=\"query\" type=\"text\"\n           :placeholder=\"inputPlaceholder\"\n           @keydown=\"onKeyDown\" @blur=\"onBlur\" @focus=\"onFocus\" @input=\"onInput\">\n    <ul v-if=\"displayOptions\" class=\"autocomplete-options\">\n      <!-- Q: Why are we watching both @mousedown and @click on this element? Isn't @click enough?\n           A: In some cases, as soon as mousedown occurs, the input \"blur\" fires and removes the <li>\n              before the mouseup/click fires. This used to cause bugs where the selected option\n              would not be used. Watching @mousedown fixes this issue. We continue to watch @click\n              as well just in case @mousedown is not fired in some touchscreen contexts.\n              In testing, triggering selectedOption on both events did not cause problems. -->\n      <li v-for=\"autocompleteOption in autocompleteOptions\" :key=\"autocompleteOption.placeId\"\n          :class=\"['autocomplete-option', {selected: optionIsFocused(autocompleteOption)}]\"\n          @mousedown=\"selectedOption(autocompleteOption)\" @click=\"selectedOption(autocompleteOption)\">\n        <span class=\"main-matching-term\">{{ autocompleteOption.mainMatchingTerm }}</span>\n        <span class=\"secondary-matching-terms\">{{ autocompleteOption.secondaryMatchingTerm }}</span>\n      </li>\n\n      <li class=\"autocomplete-option-attribution\">\n        <img src=\"../../images/powered_by_google_on_white_hdpi.png\">\n      </li>\n    </ul>\n  </div>\n</template>\n\n<script>\nimport debounce from 'lodash/debounce'\nimport { inject, nextTick } from 'vue'\nimport MapsService from '@/api/maps-service'\n\nexport default {\n  // Avoid automatically inheriting the parent's attributes so they're only set explicitly\n  // to the autocomplete input via v-bind.\n  inheritAttrs: false,\n\n  props: {\n    allowEnterManuallyOption: {\n      type: Boolean,\n      required: false,\n      default: false\n    },\n\n    inputPlaceholder: {\n      type: String,\n      required: false,\n      default() {\n        return inject('i18n').t('components.custom_gmap_autocomplete.enter_a_location')\n      }\n    },\n\n    options: {\n      type: Object,\n      required: false,\n      default: () => ({})\n    },\n\n    selectFirstOnEnter: {\n      type: Boolean,\n      default: true\n    },\n\n    value: {\n      type: String,\n      required: false\n    }\n  },\n\n  emits: ['blur', 'enter-manually-selected', 'focus', 'input', 'place-changed'],\n\n  data() {\n    return {\n      autocompleteOptions: [],\n      autofocusing: false,\n      query: this.value,\n      focusedOption: null\n    }\n  },\n\n  computed: {\n    displayOptions() {\n      return this.autocompleteOptions.length > 0\n    },\n\n    enterManuallyMainTerm() {\n      return this.i18n.t('components.custom_gmap_autocomplete.enter_manually_option_main_text', { user_query: this.query })\n    }\n  },\n\n  methods: {\n    clearAutocompleteOptions() {\n      this.focusedOption = null\n      this.autocompleteOptions = []\n    },\n\n    clearQuery() {\n      this.query = null\n    },\n\n    focus() {\n      this.autofocusing = true\n      this.$refs.autocomplete.focus()\n\n      nextTick(() => {\n        this.autofocusing = false\n      })\n    },\n\n    focusNextOption() {\n      if (this.autocompleteOptions.length === 0) return\n\n      if (!this.focusedOption) {\n        this.focusedOption = this.autocompleteOptions[0]\n        return\n      }\n\n      const focusedOptionIndex = this.autocompleteOptions.indexOf(this.focusedOption)\n      if (focusedOptionIndex === this.autocompleteOptions.length - 1) {\n        this.focusedOption = null\n      } else {\n        this.focusedOption = this.autocompleteOptions[focusedOptionIndex + 1]\n      }\n    },\n\n    focusPreviousOption() {\n      if (this.autocompleteOptions.length === 0) return\n\n      if (!this.focusedOption) {\n        this.focusedOption = this.autocompleteOptions[this.autocompleteOptions.length - 1]\n        return\n      }\n\n      const focusedOptionIndex = this.autocompleteOptions.indexOf(this.focusedOption)\n      if (focusedOptionIndex === this.autocompleteOptions[0]) {\n        this.focusedOption = null\n      } else {\n        this.focusedOption = this.autocompleteOptions[focusedOptionIndex - 1]\n      }\n    },\n\n    lookUpPlaces() {\n      if (this.query.length === 0) {\n        // Input is empty. Clear the suggestion list and don't bother making an API call.\n        this.clearAutocompleteOptions()\n      } else {\n        // Make an API call to get suggestions\n        const getPlacePredictionOptions = {\n          input: this.query,\n          ...this.options\n        }\n\n        const predictionsForQuery = this.query\n        MapsService.autocomplete(getPlacePredictionOptions).then((predictions) => {\n          // Ignore the predictions response if the query that was used is different from the current. This can happen\n          // when the API response comes in a different order than the requests, most likely during scenarios run when\n          // there are multiple requests made in rapid succession.\n          if (this.query !== predictionsForQuery) {\n            return\n          }\n\n          this.autocompleteOptions = predictions.map((prediction) => {\n            return {\n              description: prediction.description,\n              mainMatchingTerm: prediction.terms[0].value,\n              secondaryMatchingTerm: this.secondaryMatchingTermsForDisplay(prediction.terms),\n              placeId: prediction.place_id\n            }\n          })\n\n          if (this.allowEnterManuallyOption) {\n            this.autocompleteOptions.push({\n              isManualInput: true,\n              mainMatchingTerm: this.enterManuallyMainTerm,\n              secondaryMatchingTerm: this.i18n.t('components.custom_gmap_autocomplete.enter_manually_option_subtitle')\n            })\n          }\n        })\n      }\n    },\n\n    onBlur(payload) {\n      // The `blur` event is sent before the `click` event on the option. So if we removed from the DOM the\n      // autocomplete option element, the click would never be sent. At the same time, the input can lose focus\n      // in different ways, but the only one that we care is the click on one of the autocomplete options.\n      // For this reason, we insert a small delay before closing the autocomplete options, allowing the\n      // `click` event to be send.\n      setTimeout(() => {\n        this.clearAutocompleteOptions()\n      }, 500)\n\n      this.$emit('blur', payload)\n    },\n\n    onFocus(payload) {\n      if (!this.autofocusing) {\n        if (this.query) {\n          this.lookUpPlaces()\n        }\n\n        this.$emit('focus', payload)\n      }\n    },\n\n    onInput(e) {\n      this.query = e.target.value\n      this.$emit('input', this.query)\n\n      this.debouncedLookUpPlaces()\n    },\n\n    debouncedLookUpPlaces: debounce(function() { this.lookUpPlaces() }, 200),\n\n    onKeyDown(e) {\n      const SPECIAL_KEYS = ['ArrowDown', 'ArrowUp', 'Enter']\n\n      if (!SPECIAL_KEYS.includes(e.code)) return\n\n      switch (e.code) {\n      case 'ArrowDown':\n        e.preventDefault()\n        this.focusNextOption()\n        break\n\n      case 'ArrowUp':\n        e.preventDefault()\n        this.focusPreviousOption()\n        break\n\n      case 'Enter':\n        if (this.focusedOption) {\n          e.preventDefault()\n          this.selectedOption(this.focusedOption)\n        } else if (this.selectFirstOnEnter && this.autocompleteOptions.length > 0) {\n          e.preventDefault()\n          this.selectedOption(this.autocompleteOptions[0])\n        }\n        break\n      }\n    },\n\n    optionIsFocused(autocompleteOption) {\n      return this.focusedOption && autocompleteOption.placeId === this.focusedOption.placeId\n    },\n\n    secondaryMatchingTermsForDisplay(terms) {\n      return terms.slice(1).map((term) => term.value ).join(', ')\n    },\n\n    selectedEnterManuallyOption() {\n      this.$emit('enter-manually-selected', this.query)\n    },\n\n    selectedOption(option) {\n      if (option.isManualInput) {\n        this.selectedEnterManuallyOption()\n        return\n      }\n\n      MapsService.getPlaceDetails({ placeId: option.placeId }).then((result) => {\n        this.$emit('place-changed', result)\n      })\n\n      this.query = option.description\n      this.clearAutocompleteOptions()\n    }\n  }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@use \"~friendship_styles/colors\" as colors;\n\n  .autocomplete-wrapper {\n    position: relative;\n  }\n\n  .autocomplete-options {\n    list-style: none;\n    border: solid 1px colors.$separator-gray;\n    border-radius: 6px;\n    box-shadow: 0 2px 7px 0 rgba(0, 0, 0, 0.15);\n    padding: 0;\n\n    position: absolute;\n    z-index: 1000;\n    background-color: white;\n    width: 100%;\n  }\n\n  .autocomplete-option {\n    border-bottom: solid 1px colors.$separator-gray;\n    padding: {\n      left: 20px;\n      top: 14px;\n      bottom: 16px;\n    }\n\n    &:hover, &.selected {\n      background-color: #f7f7f7;\n    }\n\n    .main-matching-term, .secondary-matching-terms {\n      display: block;\n    }\n\n    .main-matching-term {\n      font-size: 16px;\n      font-weight: normal;\n    }\n\n    .secondary-matching-terms {\n      font-size: 14px;\n      color: #666666;\n    }\n  }\n\n  .autocomplete-option-attribution {\n    text-align: right;\n    padding: 10px 20px 10px 20px;\n\n    img {\n      height: 18px;\n    }\n  }\n</style>\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","<template>\n  <div>\n    <input v-for=\"locationField in locationFields\" :key=\"locationField\" :value=\"location[locationField]\" type=\"hidden\" :name=\"getFullFieldName(locationField)\">\n  </div>\n</template>\n\n<script>\nimport difference from 'lodash/difference'\n\nexport default {\n  props: {\n    location: {\n      type: Object,\n      required: false\n    },\n    fieldGroupName: {\n      type: String,\n      required: false,\n      default: 'location'\n    }\n  },\n\n  computed: {\n    locationFields() {\n      return this.filteredLocationFields(this.location)\n    }\n  },\n\n  methods: {\n    getFullFieldName(name) {\n      return `${this.fieldGroupName}[${name}]`\n    },\n\n    filteredLocationFields(location) {\n      if (!location) {\n        return []\n      }\n\n      const excludedFields = ['extra_location_info', 'boundary_box', 'errors']\n      return difference(Object.keys(location), excludedFields)\n    }\n  }\n}\n\n</script>\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":""}