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ACnBhK,OAAO,EAAE,IAAI,CAACtL,KAAK,CAAC,CAAC,CAAC8C;QAC1B;MACJ,CAAC;MAED,IAAI,IAAI,CAAC9C,KAAK,CAAC,CAAC,CAACia,oBAAoB,EAAE;QACnC,IAAI,CAAC9R,qBAAqB,CAACvD,qBAAqB,CAAC;QAEjD;MACJ;MAEA6P,4EAAiB,CAAC,CAAC,CACd/P,IAAI,CAAC,MAAM;QACR,IAAI,CAACqV,QAAQ,GAAGxE,6EAAkB,CAAC,CAAC;QAEpC,IAAI,CAACnG,OAAO,CAAC,sBAAsB,EAAE,IAAI,CAAC;QAE1C,IAAI,CAACjH,qBAAqB,CAACvD,qBAAqB,CAAC;MACrD,CAAC,CAAC,CAAC0V,KAAK,CAAC,MAAM;QACX;QACA5H,OAAO,CAAC6H,KAAK,CAAC,gCAAgC,CAAC;MACnD,CAAC,CAAC;IACV;;IAEA;AACR;AACA;AACA;IACQhX,aAAaA,CAACC,GAAG,EAAEC,KAAK,EAAE;MACtB,IAAI,CAACA,KAAK,EAAE;QACR;MACJ;MAEA,QAAQA,KAAK,CAACpB,OAAO;QACjB,KAAKA,OAAO,CAACG,KAAK;UACdiB,KAAK,CAACwJ,cAAc,CAAC,CAAC;UACtBxJ,KAAK,CAAC+W,eAAe,CAAC,CAAC;UACvB,IAAI,CAAC5S,cAAc,CAAC,CAAC;UACrB;QACJ;UACI;MACR;IACJ;EACJ;EAEA,OAAOlF,eAAe;AAC1B","sources":["webpack://sfra-boilerplate/./cartridges/app_custom_core/cartridge/client/default/js/widgets/account/TwitterFeeds.js","webpack://sfra-boilerplate/./cartridges/app_custom_core/cartridge/client/default/js/widgets/storelocator/SelectStoreSearchForm.js","webpack://sfra-boilerplate/./cartridges/app_custom_core/cartridge/client/default/js/widgets/storelocator/WoosMapLatLngDistance.js","webpack://sfra-boilerplate/./cartridges/app_custom_core/cartridge/client/default/js/widgets/storelocator/WoosMapSearchByPlace.js","webpack://sfra-boilerplate/./cartridges/app_custom_core/cartridge/client/default/js/widgets/storelocator/WoosmapStoreDirections.js","webpack://sfra-boilerplate/./cartridges/app_custom_core/cartridge/client/default/js/widgets/storelocator/WoosmapStoreLocatorMgr.js","webpack://sfra-boilerplate/./cartridges/app_storefront_widgets/cartridge/client/default/js/widgets/toolbox/googleMgr.ts","webpack://sfra-boilerplate/./cartridges/plugin_storelocator_w/cartridge/client/default/js/widgets/storelocator/LatLngDistance.ts","webpack://sfra-boilerplate/./cartridges/plugin_storelocator_w/cartridge/client/default/js/widgets/storelocator/SearchByPlace.ts","webpack://sfra-boilerplate/./cartridges/plugin_storelocator_w/cartridge/client/default/js/widgets/storelocator/StoreLocatorMgr.ts","webpack://sfra-boilerplate/./cartridges/plugin_storelocator_w/cartridge/client/default/js/widgets/storelocator/StoreSearchForm.ts"],"sourcesContent":["/**\n * @typedef {typeof import('widgets/Widget').default} Widget\n */\n\n/**\n * @description TwitterFeeds implementation\n * @param {Widget} Widget Base widget for extending\n * @returns {TwitterFeeds} TwitterFeeds class\n */\n/* eslint-disable no-underscore-dangle */\nexport default function (Widget) {\n /**\n * @class TwitterFeeds\n * @augments Widget\n */\n class TwitterFeeds extends Widget {\n /**\n * @description Initialize Twitter Feed\n * @returns {void}\n */\n init() {\n super.init();\n\n this.initTwitterIframe();\n }\n\n /**\n * @description Clear obsolete shareButtons element\n * @param {DOM} virtualDOM - DOM of the twitter feed\n * @returns {void}\n */\n processShareButtons(virtualDOM) {\n const shareButtons = virtualDOM.getElementsByClassName('timeline-ShareMenu');\n\n Array.from(shareButtons).forEach((shareButton) => {\n shareButton.remove();\n });\n }\n\n /**\n * @description Postprocess images and add 'src' attribute if needed\n * @param {DOM} virtualDOM - DOM of the twitter feed\n * @returns {void}\n */\n processImages(virtualDOM) {\n const images = virtualDOM.getElementsByTagName('img');\n\n Array.from(images).forEach((img) => {\n const imageSrc = img.getAttribute('src');\n\n if (!imageSrc) {\n const imageUrl = img.getAttribute('data-image');\n const imageExt = img.getAttribute('data-image-format') || img.getAttribute('src-format') || 'jpg';\n\n img.setAttribute('src', imageUrl + '.' + imageExt);\n }\n });\n }\n\n /**\n * @description Postprocess links\n * @param {DOM} virtualDOM - DOM of the twitter feed\n * @returns {void}\n */\n processLinks(virtualDOM) {\n const links = virtualDOM.getElementsByTagName('a');\n\n Array.from(links).forEach((link) => {\n if (!link.getAttribute('target')) {\n link.setAttribute('target', '_blank');\n }\n });\n }\n\n /**\n * @description Twitter callback function\n * @param {string} twitterDOM - stringified DOM of the twitter feed\n * @returns {void}\n */\n callback(twitterDOM) {\n const virtualDOM = document.createElement('div');\n\n virtualDOM.innerHTML = twitterDOM.body;\n\n // Prepare DOM\n this.processShareButtons(virtualDOM);\n this.processImages(virtualDOM);\n this.processLinks(virtualDOM);\n\n // Query Tweets\n const tweets = virtualDOM.getElementsByClassName('timeline-TweetList-tweet');\n const twtCollection = [];\n\n for (let step = 0; step < this.prefs().tweetLimit; step++) {\n const tweet = tweets[step];\n\n this.addActionButtons(tweet);\n\n twtCollection.push({\n body: tweet.innerHTML\n });\n }\n\n // Render\n window.__twttrf.renderTweets(twtCollection);\n }\n\n /**\n * @description Add missed interaction buttons\n * @param {DOM} tweet - Tweet DOM element\n * @returns {void}\n */\n addActionButtons(tweet) {\n const baseActionButton = tweet.getElementsByClassName('timeline-Tweet-action')[0];\n\n if (!baseActionButton) {\n return;\n }\n\n baseActionButton.innerHTML = baseActionButton.innerHTML.replaceAll('title=\"Like\"', '');\n\n const oldActionUrl = 'https://twitter.com/intent/like?tweet_id=';\n const baseUrl = 'https://twitter.com/intent/';\n\n const retweetUrl = baseUrl + 'retweet?tweet_id=';\n const favoriteUrl = baseUrl + 'favorite?tweet_id=';\n const commentUrl = baseUrl + 'tweet?in_reply_to=';\n\n const retweetEl = baseActionButton.cloneNode(true);\n\n retweetEl.innerHTML = retweetEl.innerHTML.replaceAll('heart', 'retweet');\n retweetEl.innerHTML = retweetEl.innerHTML.replaceAll(oldActionUrl, retweetUrl);\n\n const commentEl = baseActionButton.cloneNode(true);\n\n commentEl.innerHTML = commentEl.innerHTML.replaceAll('heart', 'reply');\n commentEl.innerHTML = commentEl.innerHTML.replaceAll(oldActionUrl, commentUrl);\n\n baseActionButton.innerHTML = baseActionButton.innerHTML.replaceAll(oldActionUrl, favoriteUrl);\n\n const tweetActions = tweet.getElementsByClassName('timeline-Tweet-actions')[0];\n\n tweetActions.insertBefore(retweetEl, tweetActions.firstChild);\n tweetActions.appendChild(commentEl);\n }\n\n /**\n * @description Initialization of the twitter script\n * @returns {void}\n */\n initTwitterIframe() {\n window.__twttrf = this;\n const head = document.getElementsByTagName('head')[0];\n const script = document.createElement('script');\n\n script.type = 'text/javascript';\n script.src = 'https://syndication.twitter.com/timeline/profile?'\n + 'callback=__twttrf.callback&dnt=false'\n + '&screen_name=' + this.prefs().accountId\n + '&suppress_response_codes=true'\n + '&rnd=' + Math.random(); // TODO check if we need it\n head.appendChild(script);\n }\n\n /**\n * @description Render selected tweets via Mustache\n * @param {array} tweets - List of the tweets\n * @returns {void}\n */\n renderTweets(tweets) {\n this.render('twitterTemplate', {\n tweets: tweets,\n twitterID: this.prefs().accountId\n }, this.ref('twitterFeedBlock'));\n }\n }\n\n return TwitterFeeds;\n}\n","import { getContentByUrl } from 'widgets/toolbox/ajax';\nimport { appendParamsToUrl, appendParamToURL } from 'widgets/toolbox/util';\nimport {\n getGeoLocation,\n Geocode\n} from '../../widgets/toolbox/woosmapMgr';\n\nconst keyCode = Object.freeze({\n ENTER: 13,\n SPACE: 32\n});\n\n/**\n * @typedef {ReturnType<typeof import('widgets/Widget').default>} Widget\n * @typedef {ReturnType<typeof import('plugin_storelocator/storelocator/StoreSearchForm').default>} StoreSearchForm\n * @typedef {ReturnType<typeof import('core/storelocator/PreferredStoreSelector').default>} PreferredStoreSelector\n * @typedef {InstanceType<PreferredStoreSelector>} preferredStoreSelector\n * @typedef {InstanceType<typeof import('widgets/toolbox/RefElement').RefElement>} refElement\n */\n\n/**\n * @param {StoreSearchForm} StoreSearchForm Base widget for extending\n * @returns {typeof SelectStoreSearchForm} StoreSearchForm widget\n */\nexport default function (StoreSearchForm) {\n class SelectStoreSearchForm extends StoreSearchForm {\n prefs() {\n return {\n classesClearEnabled: 'm-visible',\n language: 'en',\n countryCode: 'GBR',\n classesInputActive: 'm-active',\n productName: '',\n isStore: false,\n useWoosmapGeolocation: false,\n ...super.prefs()\n };\n }\n\n init() {\n super.init();\n\n if (this.prefs().coordinates) {\n this.searchStoresByCoordinates(this.prefs().coordinates);\n }\n\n this.eventBus().on('preferredstore.selected', 'onStoreSelect');\n }\n\n /**\n * @param {RefElement} _el event source element\n * @param {KeyboardEvent} event event instance if DOM event\n */\n handleKeydown(_el, event) {\n super.handleKeydown(_el, event);\n\n if (event.keyCode === keyCode.ENTER && this.ref('container').get()) {\n this.ref('container').get().click();\n }\n }\n\n /**\n * @description gets customer geo position data via woosmap api\n * @param {object} data - woosmap position result\n */\n handleWoosmapGeolocation(data) {\n const { latitude, longitude } = data;\n\n if (latitude && longitude) {\n this.userAllowCurrentLocation({ latitude, longitude });\n } else {\n this.userDenyCurrentLocation();\n }\n }\n\n /**\n * @description gets customer geo position data via browser api\n * @param {object} position - browser position result\n */\n handleBrowserGeolocation(position) {\n const { coords } = position;\n\n if (!coords) {\n this.userDenyCurrentLocation();\n\n return;\n }\n\n const { latitude, longitude } = coords;\n\n if (latitude && longitude) {\n this.userAllowCurrentLocation({ latitude, longitude });\n } else {\n this.userDenyCurrentLocation();\n }\n }\n\n /**\n * @description Get user current location\n * @listens dom#click\n * @returns {void}\n */\n getUserCurrentLocation() {\n navigator.geolocation.getCurrentPosition((position) => {\n if (this.prefs().useWoosmapGeolocation) {\n getGeoLocation(this.prefs().apiKey)\n .then((data) => {\n this.handleWoosmapGeolocation(data);\n });\n } else {\n this.handleBrowserGeolocation(position);\n }\n },\n this.userDenyCurrentLocation.bind(this));\n }\n\n /**\n * @description Handles success case on getting current user position\n * @param {object} position Current user location\n * @param {string} position.latitude user location latitude\n * @param {string} position.longitude user location longitude\n * @returns {void}\n */\n userAllowCurrentLocation(position) {\n const { latitude, longitude } = position;\n const geocoderRequestParams = {\n latlng: `${latitude},${longitude}`\n };\n\n this.geocodeByCoordinates(geocoderRequestParams);\n }\n\n /**\n * @description Build URL with coordinates and search phrase\n * @param {object} coordinates Current user location coordinates\n * @param {string} coordinates.latitude user location latitude\n * @param {string} coordinates.longitude user location longitude\n * @param {string} formattedAddress Formatted Address\n * @returns {void}\n */\n searchStoresByCoordinates(coordinates, formattedAddress = '') {\n this.getById('searchByPlace', (searchByPlace) => {\n this.toggleClearButton(!!searchByPlace.getValue(), searchByPlace);\n\n if (searchByPlace.getValue()) {\n searchByPlace.clearError();\n }\n });\n\n this.busy();\n\n if (this.prefs().isStore) {\n let actionUrl = appendParamsToUrl(this.prefs().actionUrl, {\n lat: coordinates.latitude,\n lng: coordinates.longitude\n });\n\n if (formattedAddress) {\n actionUrl = appendParamToURL(actionUrl, 'formattedAddress', formattedAddress);\n }\n\n window.location.assign(actionUrl);\n } else {\n getContentByUrl(this.prefs().actionUrl, {\n lat: coordinates.latitude,\n lng: coordinates.longitude,\n pid: this.prefs().productId,\n names: this.prefs().productName,\n formattedAddress: formattedAddress\n }).then((response) => {\n this.render(undefined, undefined, this.ref('container'), response.toString()).then(() => this.unbusy());\n this.eventBus().emit('gtm.datalayer.event', {\n event: 'data-layer-event',\n eventCategory: 'Store stock checker interaction',\n eventAction: 'Store stock step 2: location',\n eventLabel: this.prefs().productName\n });\n });\n }\n }\n\n /**\n * @description trigger event once store selected\n */\n onStoreSelect() {\n this.emit('storeselected');\n }\n\n /**\n * @description Search place based on parameters. Handles error in case address was not found\n * @param {object} geocoderRequestParams Google Geocoder Request parameters\n * @param {string} geocoderRequestParams.latitude user location latitude\n * @param {string} geocoderRequestParams.longitude user location longitude\n */\n geocodeByCoordinates(geocoderRequestParams) {\n this.busy();\n\n Geocode(this.prefs().apiKey, geocoderRequestParams)\n .then((response) => {\n const { status, results } = response;\n\n if ((status === 'OK') && results[0]) {\n const addressResult = results[0];\n const countryAddressResultComponent = this.findAddressResultCountryComponent(addressResult.address_components);\n\n if (countryAddressResultComponent\n && (countryAddressResultComponent.short_name === this.prefs().countryCode || this.prefs().isStore)) {\n this.searchStoresByCoordinates(\n {\n latitude: addressResult.geometry.location.lat,\n longitude: addressResult.geometry.location.lng\n },\n\n addressResult.formatted_address\n );\n } else {\n this.renderNoResultTemplate(this.prefs().errorMessageCountryNotAllowed);\n }\n } else {\n this.renderNoResultTemplate(this.prefs().errorMessagePlaceNotFound);\n }\n });\n }\n\n /**\n * @description finds address result country component\n * @param {Array<object>} addressResultComponents - geocode address result\n * @returns {Object} country address result component\n */\n findAddressResultCountryComponent(addressResultComponents) {\n return addressResultComponents.find((addressResultComponent) => addressResultComponent.types.indexOf('country') !== -1);\n }\n\n /**\n * @description Handles error case on getting current user position\n * @returns {void}\n */\n userDenyCurrentLocation() {\n if (this.has('selectStoreNoResultTemplate')) {\n this.renderNoResultTemplate(this.prefs().errorMessage);\n } else {\n super.userDenyCurrentLocation();\n }\n }\n\n /**\n * @description renders store no result template\n * @param {string} errorMessage - no result error message\n */\n renderNoResultTemplate(errorMessage) {\n this.getById('searchByPlace', (searchByPlace) => {\n searchByPlace.setError(errorMessage);\n });\n\n if (this.ref('selectStoreNoResultTemplate').length) {\n this.render('selectStoreNoResultTemplate', {}, this.ref('container')).then(() => this.unbusy());\n }\n }\n\n /**\n * @description Get value from search input.Init Google Geocoder\n * @listens dom#click\n * @returns {void}\n */\n searchByPhrase() {\n const address = this.getById('searchByPlace', (searchByPlace) => {\n const sbpValid = searchByPlace.validate();\n\n return sbpValid ? searchByPlace.ref('field').val() : null;\n });\n\n if (!address) { return; }\n\n const geocoderRequestParams = {\n language: this.prefs().language,\n components: `country:${this.prefs().countryCode}`,\n address: encodeURIComponent(address.replaceAll(' ', ''))\n };\n\n this.geocodeBySearchPhrase(geocoderRequestParams);\n }\n\n /**\n * @description Search place based on parameters. Handles error in case address was not found\n * @param {object} geocoderRequestParams Google Geocoder Request parameters\n * @param {string} geocoderRequestParams.address url encoded address phrase\n */\n geocodeBySearchPhrase(geocoderRequestParams) {\n Geocode(this.prefs().apiKey, geocoderRequestParams)\n .then((response) => {\n const { status, results } = response;\n\n if ((status === 'OK') && results && results[0]) {\n this.searchStoresByCoordinates(\n {\n latitude: results[0].geometry.location.lat,\n longitude: results[0].geometry.location.lng\n },\n results[0].formatted_address\n );\n } else {\n this.renderNoResultTemplate(this.prefs().errorMessagePlaceNotFound);\n }\n });\n }\n\n /**\n * @description Handle input event into the form field\n * @listens dom#input\n * @returns {void}\n */\n handleInput() {\n this.getById('searchByPlace', (searchByPlace) => {\n this.toggleClearButton(!!searchByPlace.getValue(), searchByPlace);\n searchByPlace.clearError();\n });\n }\n\n /**\n * @description Toggle Clear Button based on input value\n * @param {boolean} isInputHasValue - indicates if input has a value\n * @param {Widget} [inputWidget] - input widget\n * @returns {void}\n */\n toggleClearButton(isInputHasValue, inputWidget) {\n this.ref('clearButton').toggleClass(this.prefs().classesClearEnabled, isInputHasValue);\n\n if (inputWidget) {\n inputWidget.ref('field').toggleClass(this.prefs().classesInputActive, isInputHasValue);\n }\n }\n\n /**\n * @description Clears search input.\n * @listens dom#click\n * @returns {void}\n */\n clearInput() {\n this.getById('searchByPlace', (searchByPlace) => {\n searchByPlace.setValue('');\n this.toggleClearButton(false, searchByPlace);\n });\n }\n\n /**\n * @description Busy\n * @returns {void}\n */\n busy() {\n this.ref('container').attr('aria-busy', 'true');\n }\n\n /**\n * @description Unbusy\n * @returns {void}\n */\n unbusy() {\n this.ref('container').attr('aria-busy', false);\n }\n }\n\n return SelectStoreSearchForm;\n}\n","import {\n getGeoLocation,\n getDistance\n} from '../../widgets/toolbox/woosmapMgr';\n\n/**\n * @typedef {ReturnType<typeof import('plugin_storelocator/storelocator/LatLngDistance').default>} LatLngDistance\n */\n\nconst MAX_METRIC_LENGTH = 1001000;\nconst MAX_IMPERIAL_LENGTH = 621000;\nconst MINIMAL_DISTANCE = 0.1;\n\n/**\n * @param {LatLngDistance} LatLngDistance Base LatLngDistance for extending\n * @returns {typeof WoosMapLatLngDistance} Widget\n */\nexport default function (LatLngDistance) {\n class WoosMapLatLngDistance extends LatLngDistance {\n prefs() {\n return {\n useCurrentPosition: false,\n lowDistanceMessage: '',\n exceededDistanceMessage: '',\n ...super.prefs()\n };\n }\n\n /**\n * @description Widget initialization logic\n *\n * @returns {void}\n */\n init() {\n if (this.prefs().useCurrentPosition) {\n this.calculateDistanceByCurrentPosition();\n } else {\n super.init();\n }\n }\n\n /**\n * @description Calculate distance between current position via Woosmap API\n *\n * @returns {void}\n */\n calculateDistanceByCurrentPosition() {\n getGeoLocation(this.prefs().apiKey)\n .then((data) => {\n const { latitude, longitude } = data;\n\n if (latitude && longitude) {\n this.calculateDistance({ lat: latitude, lng: longitude });\n }\n });\n }\n\n /**\n * @description Get distance message depending on distance value\n *\n * @param {number} distance Distance between points\n * @returns {string} distance message\n */\n getDistanceMessage(distance) {\n const distanceUnit = this.prefs().distanceUnit;\n let distanceMessage = '';\n\n if (distance < 0) {\n distanceMessage = '';\n } else if (distance < MINIMAL_DISTANCE) {\n distanceMessage = this.prefs().lowDistanceMessage;\n } else if ((distanceUnit === 'mi' && distance >= MAX_IMPERIAL_LENGTH) || (distanceUnit === 'km' && distance >= MAX_METRIC_LENGTH)) {\n distanceMessage = this.prefs().exceededDistanceMessage;\n } else {\n distanceMessage = this.prefs().distanceMessage.replace('{0}', distance.toFixed(1));\n }\n\n return distanceMessage;\n }\n\n /**\n * @description Convert and prepare distance for rendering\n * @param {number} distance Distance between points\n * @returns {string} Distance converted and prepared for rendering\n */\n convertDistance(distance) {\n let result = distance;\n const distanceUnit = this.prefs().distanceUnit;\n\n if (distanceUnit === 'mi' && result < MAX_METRIC_LENGTH) {\n result /= this.prefs().metersInOneMile;\n } else if (distanceUnit === 'km' && result < MAX_METRIC_LENGTH) {\n result /= 1000;\n } else if (!distance) {\n result = -1;\n }\n\n return this.getDistanceMessage(result);\n }\n\n /**\n * @description Calculate distance between points using Woosmap API\n * @param {object} searchCoordinates Object with coordinates\n * @returns {void}\n */\n calculateDistance(searchCoordinates) {\n const searchPoint = searchCoordinates;\n const storePoint = { lat: this.prefs().latitude, lng: this.prefs().longitude };\n const data = {\n origins: `${searchPoint.lat},${searchPoint.lng}|${searchPoint.lat},${searchPoint.lng}`,\n destinations: `${storePoint.lat},${storePoint.lng}`,\n units: 'metric',\n element: 'distance'\n };\n\n getDistance(this.prefs().apiKey, data)\n .then((response) => {\n let result = null;\n\n if (response.status && response.status === 'MAX_ROUTE_LENGTH_EXCEEDED') {\n result = MAX_METRIC_LENGTH;\n } else {\n result = response?.rows[0]?.elements[0]?.distance?.value;\n }\n\n this.renderDistance(result);\n });\n }\n }\n\n return WoosMapLatLngDistance;\n}\n","import {\n initWoosMapAPI,\n initWoosMapAutocomplete,\n woosMapGetDetails\n} from '../../widgets/toolbox/woosmapMgr';\n\nconst minLength = 1; // default number of input chars which may be decreased\n\n/**\n * @param InputText Base widget for extending\n * @returns WoosMapSearchByPlace WoosMapSearchByPlace widget\n */\n\nexport default function (InputText) {\n /**\n * @category widgets\n * @subcategory storelocator\n * @class WoosMapSearchByPlace\n * @augments InputText\n * @classdesc Represents WoosMapSearchByPlace components that implement WoosMap Autocomplete functionality using WoosMap API.\n * It has next features:\n * 1. Inits woosmap autocomplete once user is clicked on the input field\n * 2. Emits widget event with the suggested address by woosmap autocomplete API\n * 3. Using dynamicforms.js to render input field.\n *\n * WoosmapAutocompleteField widget should receive countryCode\n * and WoosMaps API key values in order to properly init the woosmap autocomplete functionality\n * @property {string} data-country-code - current country code value\n * @property {string} data-api-key - woosmap API key\n * @example <caption>Example of StoreSearchForm widget usage</caption>\n * <isprint value=\"${\n * formElement(pdict.storeLocatorSearchForm.searchByPlace)\n * .setData('widget.attributes.data-api-key', require('util/sitepref').getValue('publicKey'))\n * .setData('widget.attributes.data-country-code', pdict.countryCode)\n * .render()\n * }\" encoding=\"off\"/>\n */\n class WoosMapSearchByPlace extends InputText {\n prefs() {\n return {\n countryCode: 'GB',\n apiKey: '',\n disableAddressSuggestion: false,\n ...super.prefs()\n };\n }\n\n /**\n * @description Initialize widget logic\n */\n init() {\n super.init();\n\n this.loaded = false;\n\n if (!this.prefs().disableAddressSuggestion) {\n this.loadAutocompleteApiAndInit();\n }\n }\n\n loadAutocompleteApiAndInit() {\n if (this.loaded) {\n return;\n }\n\n initWoosMapAPI(this.prefs().apiKey).then(() => {\n this.initWoosmapAutocomplete();\n });\n this.loaded = true;\n }\n\n initWoosmapAutocomplete() {\n initWoosMapAutocomplete({\n selector: this.ref('field').attr('id'),\n config: {\n minLength: minLength,\n components: {\n country: 'gb'\n }\n }\n }).then((localitiesWidget) => {\n window.localitiesWidget = localitiesWidget;\n\n localitiesWidget.predictions();\n\n this.initEvents(localitiesWidget);\n });\n }\n\n /**\n * @description Init woosmap API events\n * @param localitiesWidget - woosmap autocomplete\n */\n\n initEvents(localitiesWidget) {\n if (!localitiesWidget) {\n return;\n }\n\n localitiesWidget.addListener('selected_suggestion', () => {\n const selectedLocality = localitiesWidget.getSelectedSuggestionDetails();\n\n woosMapGetDetails({\n key: this.prefs().apiKey,\n public_id: selectedLocality.public_id,\n language: 'eu',\n addresses_per_page: this.prefs().wmNumberOfResults\n }).then(locality => {\n if (!locality || !locality.geometry) { return; }\n\n const location = locality.geometry.location;\n const formattedAddress = locality.formatted_address;\n\n if (location) {\n this.setCoordinates(location.lat, location.lng, formattedAddress);\n }\n });\n });\n }\n\n /**\n * @description Set coordinates provided by Woosmap Autocomplete\n * @emits SearchByPlace#placechanged\n * @param lat Latitude\n * @param lng Longitude\n * @param formattedAddress Formatted address\n */\n\n setCoordinates(lat, lng, formattedAddress) {\n /**\n * @description Event to\n * @event SearchByPlace#placechanged\n */\n this.emit('placechanged', {\n lat,\n lng,\n formattedAddress\n });\n }\n\n /**\n * @description Handle focus event\n */\n handleFocus() {}\n }\n\n return WoosMapSearchByPlace;\n}\n","/**\n * @typedef {ReturnType<typeof import('core/global/ProcessButton').default>} BasicProcessButton\n * @typedef {InstanceType<typeof import('widgets/toolbox/RefElement').RefElement>} refElement\n */\nimport { isDesktopView } from 'widgets/toolbox/viewtype';\n\n/**\n * @description ProcessButton implementation\n * @param {BasicProcessButton} BasicProcessButton Base widget for extending\n * @returns {class WoosmapStoreDirections} WoosmapStoreDirections class\n */\nexport default function (BasicProcessButton) {\n /**\n * @class WoosmapStoreDirections\n * @augments BasicProcessButton\n */\n class WoosmapStoreDirections extends BasicProcessButton {\n prefs() {\n return {\n errorFeedback: 'errorMessageLabel',\n errorMessage: '',\n geolocationOptions: {\n enableHighAccuracy: true,\n timeout: 5000,\n maximumAge: 0\n },\n ...super.prefs()\n };\n }\n\n /**\n * @description Widget initialization logic\n *\n * @returns {void}\n */\n init() {\n if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {\n var iosLink = this.prefs().iosLink;\n\n this.ref('directionsLink').attr('href', iosLink);\n }\n }\n\n /**\n * @description Click Event handler\n * @listens dom#click\n * @param {refElement} el Source of keydown event\n * @param {Event} event Event object\n * @returns {void}\n */\n handleClick(el, event) {\n if (isDesktopView()) {\n event.preventDefault();\n\n this.getUserCurrentLocation();\n }\n }\n\n /**\n * @description Get user current location\n * if successfully got - render directions\n * @listens dom#click\n * @returns {void}\n */\n getUserCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n this.ref(this.prefs().errorFeedback).hide();\n this.eventBus().emit('directions.get', {\n origin: {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n },\n destination: {\n lat: this.prefs().latitude,\n lng: this.prefs().longitude,\n name: this.prefs().storeName || undefined\n }\n });\n },\n // rendering error once Location is not available\n () => { this.userDenyCurrentLocation(); },\n this.prefs().geolocationOptions\n );\n }\n }\n\n /**\n * @description Handles error case on getting current user position\n * @returns {void}\n */\n userDenyCurrentLocation() {\n this.ref(this.prefs().errorFeedback)\n .setText(this.prefs().errorMessage)\n .show();\n }\n }\n\n return WoosmapStoreDirections;\n}\n","import {\n initWoosmapMapAPI,\n initWoosmapMap,\n getWoosmapMapBounds,\n initWoosmapMapMarker,\n getWoosmapMapInfoWindow,\n initWoosmapMapStoresOverlay\n} from '../../widgets/toolbox/woosmapMgr';\n\n/**\n * @typedef {ReturnType<typeof import('plugin_storelocator/storelocator/StoreLocatorMgr').default>} StoreLocatorMgr\n * @typedef {InstanceType<ReturnType<typeof import('widgets/global/Button').default>>} button\n */\n\n/**\n * @param {StoreLocatorMgr} StoreLocatorMgr Base StoreLocatorMgr Widget for extending\n * @returns {typeof WoosmapStoreLocatorMgr} Widget\n */\nexport default function (StoreLocatorMgr) {\n class WoosmapStoreLocatorMgr extends StoreLocatorMgr {\n prefs() {\n return {\n mapStoreStyleConfig: {},\n updateList: false,\n showAccessibilityAlerts: true,\n names: '',\n ...super.prefs()\n };\n }\n\n init() {\n super.init();\n\n this.eventBus().on('preferredstore.selected', 'updateList');\n\n this.eventBus().on('directions.get', 'renderDirections');\n\n if (this.prefs().names) {\n this.eventBus().emit('gtm.datalayer.event', {\n event: 'data-layer-event',\n eventCategory: 'Store stock checker interaction',\n eventAction: 'Store stock step 3: results',\n eventLabel: this.prefs().names,\n eventSublabel: this.prefs().storesAvailableForInstore + '/' + this.prefs().storesCount\n });\n }\n }\n\n /**\n * @description Update list stores after selecte preferred store\n * @param {object} data store objects selected\n */\n updateList(data) {\n if (!this.prefs().updateList) {\n return;\n }\n\n this.prefs().storesModel.stores.forEach(store => {\n store.isPreferredStore = store.ID === data.storeId;\n });\n\n this.render('storeLocatorTemplate', this.prefs().storesModel, this.ref('storeListContainer'));\n\n if (this.ref('storeModalContainer').length) {\n this.render('storeLocatorTemplateModal', this.prefs().storesModel, this.ref('storeModalContainer'));\n this.cachedTemplates = this.ref('storeModalContainer');\n }\n }\n\n /**\n * @description Init map on the page using Woosmap API\n */\n initMap() {\n initWoosmapMapAPI(this.prefs().apiKey)\n .then(() => {\n const mapContainer = (this.ref('WoosmapMap').get());\n\n if (!mapContainer) {\n return;\n }\n\n const { stores, lat, lng } = this.prefs().storesModel;\n\n if (!stores || !stores.length) {\n return;\n }\n\n const mapOptions = {\n center: {\n lat: lat || stores[0].latitude,\n lng: lng || stores[0].longitude\n },\n ...this.prefs().mapStyleConfig\n };\n const map = initWoosmapMap(mapContainer, mapOptions);\n\n this.map = map;\n this.setPref('isMapInited', true);\n this.handleMarkers(this.prefs().storesModel.stores);\n });\n }\n\n /**\n * @description Initialize store markers\n * @param {object} stores with store objects\n */\n handleMarkers(stores) {\n if (!this.prefs().isMapInited || !stores) {\n return;\n }\n\n this.removeAllMarkers();\n this.initStoreOverlay();\n this.getNewBounds();\n this.getNewInfoWindow();\n this.addUserLocationMarker();\n this.addMarkers(stores);\n\n this.map?.fitBounds(this.bounds);\n this.updatesMapZoom(stores);\n }\n\n /**\n * @description Removes all markers from the map\n */\n removeAllMarkers() {\n if (this.userLocationMarker) {\n this.userLocationMarker.setMap(null);\n }\n\n if (this.markers.length === 0) {\n return;\n }\n\n if (this.markerCluster) {\n this.markerCluster.clearMarkers();\n }\n\n this.markers.forEach((marker) => {\n marker.setMap(null);\n });\n\n this.markers = [];\n }\n\n /**\n * @description Gets the instance of the Woosmap Bounds class\n */\n getNewBounds() {\n this.bounds = getWoosmapMapBounds();\n }\n\n /**\n * @description Gets the instance of the Woosmap Info Window class\n */\n getNewInfoWindow() {\n this.infoWindow = getWoosmapMapInfoWindow();\n }\n\n /**\n * @description Initializes stores overlay styles\n */\n initStoreOverlay() {\n this.storeOverlay = initWoosmapMapStoresOverlay(this.prefs().mapStoreStyleConfig);\n this.storeOverlay.setMap(this.map);\n }\n\n /**\n * @description Adds marker for the current user's location\n */\n addUserLocationMarker() {\n if (!this.prefs().isMapInited\n || !this.map\n || !this.prefs().storesModel\n || !this.prefs().storesModel.lat\n || !this.prefs().storesModel.lng\n ) { return; }\n\n const userLocationMarker = initWoosmapMapMarker({\n position: {\n lat: this.prefs().storesModel.lat,\n lng: this.prefs().storesModel.lng\n },\n icon: this.prefs().staticUrlMarkersImage + 'search-location-marker.svg'\n });\n\n this.userLocationMarker = userLocationMarker;\n userLocationMarker.setMap(this.map);\n\n if (this.bounds) {\n const locationMarkerPosition = userLocationMarker.getPosition();\n\n this.bounds.extend(locationMarkerPosition);\n }\n }\n\n updatesMapZoom(stores) {\n if (stores.length === 1 && !this.userLocationMarker) {\n this.map.setZoom(this.map.zoom);\n }\n }\n\n /**\n * @description Handles click on Load More Button\n * @param {object} loadMoreButton Load More Button\n * @returns {Promise} a promise for further use\n */\n loadMore(loadMoreButton) {\n this.eventBus().emit('gtm.datalayer.event', {\n event: 'data-layer-event',\n eventCategory: 'Key interactions',\n eventAction: 'Load more'\n });\n\n return super.loadMore(loadMoreButton);\n }\n\n /**\n * @description Creates new instance google map marker for provided stores.\n * Adds a marker on the map and add a listener on click event.\n * @param {array} stores Array with store objects\n */\n addMarkers(stores = []) {\n if (!stores) {\n return;\n }\n\n stores.forEach((store) => {\n const storeMarker = initWoosmapMapMarker({\n position: {\n lat: store.latitude,\n lng: store.longitude\n },\n icon: this.prefs().staticUrlMarkersImage + 'default-marker.svg'\n });\n\n storeMarker.setMap(this.map);\n\n if (this.bounds) {\n const storeMarkerPosition = storeMarker.getPosition();\n\n this.bounds.extend(storeMarkerPosition);\n }\n\n this.markerClickEventHandler(store, storeMarker);\n this.markers.push(storeMarker);\n });\n }\n\n /**\n * @description Expands/Collapses map on click event\n * @listens dom#click\n * @param {button} button Target element\n */\n toggleMapState(button) {\n const mapContainer = this.ref('WoosmapMap');\n\n if (!mapContainer) {\n return;\n }\n\n mapContainer.toggleClass(this.prefs().classesExpandedMap);\n const isMapExpanded = mapContainer.hasClass(this.prefs().classesExpandedMap);\n\n if (isMapExpanded) {\n button.setText(this.prefs().hideButtonText);\n } else {\n button.setText(this.prefs().expandButtonText);\n }\n }\n\n /**\n * @description Render to template stores list\n * @param {object} storesModel Stores Model object to render\n * @returns {Promise} resolved if rendered or rejected if no found template promise\n */\n renderStoreLocatorList(storesModel) {\n // Please note that we need IDs to items to avoid strange rendering issues connected to DiffDOM SFRA-8129\n return this.render('storeLocatorTemplate', storesModel, this.ref('storeListContainer'))\n .then(() => {\n if (this.prefs().showAccessibilityAlerts) {\n this.accessibilityAlert(this.prefs().accessibilityAlerts.storesListUpdated);\n }\n });\n }\n\n /**\n * @description Update list stores after selecte preferred store\n * @param {object} params store objects selected\n * @property {object} params.origin - Woosmap Map latitude\n * @property {object} params.destination - Woosmap Map logitude\n */\n renderDirections(params) {\n const directionsService = new window.woosmap.map.DirectionsService();\n const directionsRenderer = new window.woosmap.map.DirectionsRenderer();\n\n const mapContainer = (this.ref('WoosmapMap').get());\n\n if (!mapContainer) {\n return;\n }\n\n const mapOptions = {\n center: params.destination,\n ...this.prefs().mapStyleConfig\n };\n\n // initWoosmapMap(mapContainer, mapOptions);\n const map = new window.woosmap.map.Map(mapContainer, mapOptions);\n\n directionsRenderer.setMap(map);\n directionsService.route({\n origin: params.origin,\n destination: params.destination\n }, (response, status) => {\n if (status === 'OK') {\n directionsRenderer.setDirections(response);\n // userLocationMarker\n initWoosmapMapMarker({\n position: params.origin,\n icon: this.prefs().staticUrlMarkersImage + 'search-location-marker.svg',\n label: 'Your Location'\n }).setMap(map);\n\n // storeLocationMarker\n initWoosmapMapMarker({\n position: params.destination,\n icon: this.prefs().staticUrlMarkersImage + 'default-marker.svg',\n label: params.destination.name\n }).setMap(map);\n } else {\n console.log('Directions request failed with status :' + status);\n }\n });\n }\n }\n\n return WoosmapStoreLocatorMgr;\n}\n","/**\n * @module googleMgr\n * @category widgets\n * @subcategory toolbox\n * @description\n * Represents googleMgr component with next features:\n * 1. Allow to init google maps API\n * 2. Allow to init Google Autocomplete\n * 3. Allow to parse address object\n * @example <caption>Example of googleMgr module usage</caption>\n * import {\n * initGoogleMapsApi,\n * initGoogleAutocomplete,\n * parseAddress\n * } from 'widgets/toolbox/googleMgr';\n *\n * initGoogleMapsApi(this.config.apiKey).then(() => {\n * const field = (this.ref('field').get());\n * if (field) {\n * initGoogleAutocomplete(field, this.prefs().countryCode)\n * .then(this.initEvents.bind(this))\n * .then(() => {\n * this.inited = true;\n * });\n * }\n * });\n *\n */\n\ndeclare global {\n interface Window {\n googleMapsApiCallback: () => void;\n google: typeof google;\n }\n}\n\nlet googleApi: typeof google;\nlet resolveGMapsFn;\nlet initialized = false;\n\nconst initializationPromise = new Promise((resolve) => {\n resolveGMapsFn = resolve;\n});\n\n/**\n * @description callback fires once google maps api loaded\n * @returns {void}\n */\nwindow.googleMapsApiCallback = () => {\n googleApi = window.google;\n\n resolveGMapsFn();\n};\n\n/**\n * @description Return mapping config for provided country\n * @param {string} country - Mapping config country\n * @returns {object} Mapping config\n */\nfunction getAddressFieldsMappingConfig(country) {\n const config = {\n address1: {\n serviceObjectTypes: ['street_number', 'route'],\n serviceObjectProperty: 'long_name'\n },\n address2: {\n serviceObjectTypes: [],\n serviceObjectProperty: ''\n },\n city: {\n serviceObjectTypes: [['locality', 'postal_town']],\n serviceObjectProperty: 'long_name'\n },\n stateCode: {\n serviceObjectTypes: ['administrative_area_level_1'],\n serviceObjectProperty: 'short_name'\n },\n postalCode: {\n serviceObjectTypes: ['postal_code'],\n serviceObjectProperty: 'long_name'\n }\n };\n\n switch (country) {\n case 'GB':\n config.stateCode.serviceObjectTypes = ['administrative_area_level_2'];\n break;\n default:\n break;\n }\n\n return config;\n}\n\n/**\n * @description Return address component by provided type\n * @param {Array} addressComponents - API address components\n * @param {string} type - Target component type\n * @returns {object|undefined} Address component\n */\nfunction getAddressComponentByType(addressComponents, type) {\n return addressComponents.find((addressComponent) => {\n return addressComponent.types.indexOf(type) === 0;\n });\n}\n\n/**\n * @description Return address component by provided type\n * @param {object} addressComponents - API address components\n * @param {object} fieldConfig - Configuration object for current field\n * @returns {string} Address field\n */\nfunction getAddressField(addressComponents, fieldConfig) {\n const typesForMerge = fieldConfig.serviceObjectTypes;\n const aimProperty = fieldConfig.serviceObjectProperty;\n const targetAddressProperties = [];\n let addressComponent;\n\n typesForMerge.forEach((mergeType) => {\n if (Array.isArray(mergeType)) {\n for (let i = 0, l = mergeType.length; i < l; i++) {\n addressComponent = getAddressComponentByType(addressComponents, mergeType[i]);\n\n if (addressComponent && addressComponent[aimProperty]) {\n break;\n }\n }\n } else {\n addressComponent = getAddressComponentByType(addressComponents, mergeType);\n }\n\n if (addressComponent && addressComponent[aimProperty]) {\n // @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message\n targetAddressProperties.push(addressComponent[aimProperty]);\n }\n });\n\n return targetAddressProperties.join(' ');\n}\n\n/**\n * @description Loads google maps API\n * @param {string} apiKey - api key\n * @returns {Promise} result\n */\nexport function initGoogleMapsApi(apiKey?) {\n if (!initialized) {\n if (!apiKey) {\n return Promise.reject();\n }\n\n const url = new URL('https://maps.googleapis.com/maps/api/js');\n\n url.searchParams.append('key', apiKey);\n url.searchParams.append('libraries', 'geometry,places');\n url.searchParams.append('callback', 'googleMapsApiCallback');\n\n const script = document.createElement('script');\n\n script.src = decodeURIComponent(url.toString());\n script.async = true;\n script.type = 'text/javascript';\n\n document.body.appendChild(script);\n\n initialized = true;\n }\n\n return initializationPromise;\n}\n\n/**\n * @description Init google autocomplete for the field\n * @param {HTMLInputElement} field - input field\n * @param {string} countryCode - country code to restrict search results\n * @returns {Promise} result\n */\nexport function initGoogleAutocomplete(field, countryCode) {\n return Promise.resolve(new googleApi.maps.places.Autocomplete(\n field, {\n componentRestrictions: {\n country: countryCode\n }\n }\n ));\n}\n\n/**\n * @description Init google geocoder\n * @returns {object} result\n */\nexport function initGoogleGeocoder() {\n return new googleApi.maps.Geocoder();\n}\n\nexport function getGoogleMap(mapContainer, options) {\n return new googleApi.maps.Map(mapContainer, options);\n}\n\nexport function getGoogleMapMarker(options) {\n return new googleApi.maps.Marker(options);\n}\n\nexport function getGoogleMapBounds() {\n return new googleApi.maps.LatLngBounds();\n}\n\nexport function getGoogleMapInfoWindow() {\n return new googleApi.maps.InfoWindow();\n}\n\nexport function createLatLngObject(lat, lng) {\n return new googleApi.maps.LatLng(lat, lng);\n}\n\nexport function computeDistanceBetween(storePoint, searchPoint) {\n return googleApi.maps.geometry.spherical.computeDistanceBetween(storePoint, searchPoint);\n}\n\n/**\n * @description Returns parsed address object\n * @param {Array} addressComponents - Array with google address components\n * @param {string} country - Components country\n * @returns {object} result\n */\nexport function parseAddress(addressComponents, country) {\n const mappingConfig = getAddressFieldsMappingConfig(country);\n const address = Object.keys(mappingConfig).reduce((addressObject, field) => {\n addressObject[field] = getAddressField(addressComponents, mappingConfig[field]);\n\n return addressObject;\n }, {});\n\n return Promise.resolve(address);\n}\n","import { initGoogleMapsApi, computeDistanceBetween, createLatLngObject } from 'widgets/toolbox/googleMgr';\nimport { TWidget } from 'widgets/Widget';\n\n/**\n * @param {Widget} Widget Base widget for extending\n * @returns {typeof LatLngDistance} LatLngDistance widget\n */\nexport default function (Widget: TWidget) {\n /**\n * @category widgets\n * @subcategory storelocator\n * @class LatLngDistance\n * @augments Widget\n * @classdesc Represents LatLngDistance component with next features:\n * 1. Calculates the distance between search location and store's location.\n * 2. Renders distance using mustache template for dynamic rendering.\n * 3. Converts distance to proper unit.\n * 4. Takes search location from URL hash to be able to cache the Store Details Page.\n *\n * @property {string} data-widget - Widget name `latLngDistance`\n * @property {string} data-api-key - google maps API key\n * @property {string} data-distance-unit - Distance unit\n * @property {string} data-latitude - Latitude\n * @property {string} data-longitude - Longitude\n * @example <caption>Example of LatLngDistance widget usage</caption>\n * <div\n * data-widget=\"latLngDistance\"\n * data-api-key=\"${require('util/sitepref').getValue('googleMapsApiKey')}\"\n * data-distance-unit=\"${distanceUnit}\"\n * data-latitude=\"${store.latitude}\"\n * data-longitude=\"${store.longitude}\"\n * >\n * <div data-ref=\"container\"></div>\n * <script type=\"template/mustache\" data-ref=\"template\">\n * <div data-ref=\"container\">\n * <p class=\"b-storelocator_result-distance\">{{distance}}</p>\n * </div>\n * </script>\n * </div>\n */\n class LatLngDistance extends Widget {\n prefs() {\n return {\n latitude: '',\n longitude: '',\n distanceUnit: 'mi',\n distanceMessage: '',\n metersInOneMile: 1609.34,\n apiKey: '',\n ...super.prefs()\n };\n }\n\n /**\n * @description Widget initialization logic\n * @returns {void}\n */\n init() {\n super.init();\n const searchCoordinates = this.getSearchCoordinatesFromUrl();\n\n if (searchCoordinates) {\n this.calculateDistance(searchCoordinates);\n }\n }\n\n /**\n * @description Get search coordinates from the URL\n * @returns {object} Object with coordinates\n */\n getSearchCoordinatesFromUrl() {\n const searchCoordinates = <{ lat: string | null; lng: string | null; }>{};\n const hash = window.location.hash;\n\n if (!hash) {\n return null;\n }\n\n // replace # to ? to get possibility use URLSearchParams\n const queryString = hash.replace('#', '?');\n const urlParams = new URLSearchParams(queryString);\n\n searchCoordinates.lat = urlParams.get('lat');\n searchCoordinates.lng = urlParams.get('lng');\n\n if (searchCoordinates.lat && searchCoordinates.lng) {\n return searchCoordinates;\n } else {\n return null;\n }\n }\n\n /**\n * @description Calculate distance between points using Google API\n * @param {object} searchCoordinates Object with coordinates\n * @returns {void}\n */\n calculateDistance(searchCoordinates) {\n initGoogleMapsApi(this.prefs().apiKey)\n .then(() => {\n const searchPoint = createLatLngObject(searchCoordinates.lat, searchCoordinates.lng);\n const storePoint = createLatLngObject(this.prefs().latitude, this.prefs().longitude);\n\n this.renderDistance(computeDistanceBetween(searchPoint, storePoint));\n });\n }\n\n /**\n * @description Convert and prepare distance for rendering\n * @param {number} distance Distance between points\n * @returns {string} Distance converted and prepared for rendering\n */\n convertDistance(distance) {\n let result = distance;\n const distanceUnit = this.prefs().distanceUnit;\n\n if (distanceUnit === 'mi') {\n result /= this.prefs().metersInOneMile;\n } else {\n result /= 1000;\n }\n\n return this.prefs().distanceMessage.replace('{0}', result.toFixed(1));\n }\n\n /**\n * @description Render distance into template\n * @param {string} distance Distance converted and prepared for rendering\n * @returns {void}\n */\n renderDistance(distance) {\n const convertedDistance = this.convertDistance(distance);\n\n this.render(undefined, {\n distance: convertedDistance\n }, this.ref('container'));\n }\n }\n\n return LatLngDistance;\n}\n","import {\n initGoogleMapsApi,\n initGoogleAutocomplete\n} from 'widgets/toolbox/googleMgr';\n\n/**\n * @param InputText Base widget for extending\n * @returns SearchByPlace widget\n */\nexport default function (InputText: ReturnType<typeof import('widgets/forms/InputText').default>) {\n /**\n * @category widgets\n * @subcategory storelocator\n * @class SearchByPlace\n * @augments InputText\n * @classdesc Represents SearchByPlace components that implement Google Autocomplete functionality using Google Places API.\n * It has next features:\n * 1. Inits google autocomplete once user is clicked on the input field\n * 2. Emits widget event with the suggested address by google autocomplete API\n * 3. Using dynamicforms.js to render input field.\n *\n * GoogleAutocompleteField widget should receive countryCode\n * and google maps API key values in order to properly init the google autocomplete functionality\n * @property {string} data-country-code - current country code value\n * @property {string} data-api-key - google maps API key\n * @example <caption>Example of StoreSearchForm widget usage</caption>\n * <isprint value=\"${\n * formElement(pdict.storeLocatorSearchForm.searchByPlace)\n * .setData('widget.attributes.data-api-key', require('util/sitepref').getValue('googleMapsApiKey'))\n * .setData('widget.attributes.data-country-code', pdict.countryCode)\n * .render()\n * }\" encoding=\"off\"/>\n */\n class SearchByPlace extends InputText {\n autocompleteInited = false;\n\n autocomplete?: google.maps.places.Autocomplete;\n\n prefs() {\n return {\n countryCode: 'US',\n apiKey: '',\n ...super.prefs()\n };\n }\n\n /**\n * @description Initialize widget logic\n */\n init(): void {\n super.init();\n\n this.autocompleteInited = false;\n }\n\n /**\n * @description Init google API once field is focused\n * @listens dom:focus\n */\n handleFocus(): void {\n if (this.autocompleteInited) {\n return;\n }\n\n initGoogleMapsApi(this.prefs().apiKey).then(() => {\n const field = <HTMLInputElement> this.ref('field').get();\n\n if (field) {\n initGoogleAutocomplete(field, this.prefs().countryCode)\n .then(this.initEvents.bind(this))\n .then(() => {\n this.autocompleteInited = true;\n });\n }\n });\n }\n\n /**\n * @description Init google API events\n * @param autocomplete - google autocomplete\n */\n initEvents(autocomplete: google.maps.places.Autocomplete): void {\n if (!autocomplete) {\n return;\n }\n\n this.autocomplete = autocomplete;\n\n this.autocomplete.addListener('place_changed', () => {\n const place = autocomplete.getPlace();\n\n if (!place.geometry) { return; }\n\n const location = place.geometry.location;\n const formattedAddress = place.formatted_address;\n\n if (location) {\n this.setCoordinates(location.lat(), location.lng(), formattedAddress);\n }\n });\n }\n\n /**\n * @description Set coordinates provided by Google Autocomplete\n * @emits SearchByPlace#placechanged\n * @param lat Latitude\n * @param lng Longitude\n * @param formattedAddress Formatted address\n */\n setCoordinates(lat: number, lng: number, formattedAddress: string | undefined): void {\n /**\n * @description Event to\n * @event SearchByPlace#placechanged\n */\n this.emit('placechanged', {\n lat,\n lng,\n formattedAddress\n });\n }\n }\n\n return SearchByPlace;\n}\n","import { getJSONByUrl } from 'widgets/toolbox/ajax';\nimport { render } from 'widgets/toolbox/render';\nimport { scrollElementTo } from 'widgets/toolbox/scroll';\nimport MarkerClusterer from '@googlemaps/markerclustererplus';\nimport {\n initGoogleMapsApi,\n getGoogleMap,\n getGoogleMapMarker,\n getGoogleMapBounds,\n getGoogleMapInfoWindow\n} from 'widgets/toolbox/googleMgr';\nimport { TWidget } from 'widgets/Widget';\nimport { RefElement } from 'widgets/toolbox/RefElement';\n\ntype TStore = {\n uuid: string;\n latitude: number;\n longitude: number;\n};\n\ntype TStoresModel = {\n mapInfoWindowMarkup?: string;\n lat?: number;\n lng?: number;\n isLoadMoreButtonEnabled: boolean;\n stores: Array<TStore>;\n};\n\n/**\n * @param Widget Base widget for extending\n * @returns StoreLocatorMgr widget\n */\nexport default function (Widget: TWidget) {\n /**\n * @category widgets\n * @subcategory storelocator\n * @class StoreLocatorMgr\n * @augments Widget\n * @classdesc Represents StoreLocatorMgr component with next features:\n * 1. Allows dynamic rendering list of the stores using the mustache template\n * 2. Allows dynamic rendering load more button using the mustache template\n * 3. Allows load more stores by \"Load More\" button click\n * 4. Allows adding markers on the map, creating info window for the marker, and clustering markers\n * 5. Allows expanding/collapsing map on the mobile/tablet devices\n * 6. Inits google map\n * @property {string} data-widget - Widget name `storeLocatorMgr`\n * @property {string} data-stores-model - Stores model\n * @property {boolean} data-allow-load-more-than-once - Allows use Load More button more than once times\n * @example <caption>Example of StoreLocatorMgr widget usage</caption>\n * <section\n * class=\"b-storelocator_results\"\n * data-widget=\"storeLocatorMgr\"\n * data-stores-model=\"${JSON.stringify(pdict.storesModel)}\"\n * data-allow-load-more-one-times=\"true\"\n * >\n * Stores List content...\n * <div\n * data-ref=\"storeLocatorLoadMoreButton\"\n * class=\"b-storelocator_results-load_more\"\n * >\n * {{${'#'}isLoadMoreButtonEnabled}}\n * <button\n * class=\"b-button m-outline b-storelocator_results-load_more_btn\"\n * type=\"button\"\n * data-event-click=\"loadMore\"\n * data-href=\"{{loadMoreButtonLink}}\"\n * data-lat=\"{{lat}}\"\n * data-lng=\"{{lng}}\"\n * data-page-number=\"{{pageNumber}}\"\n * >\n * {{loadMoreButtonText}}\n * </button>\n * {{/isLoadMoreButtonEnabled}}\n * </div>\n * </section>\n */\n class StoreLocatorMgr extends Widget {\n markers: Array<google.maps.Marker> = [];\n\n activeStoreMarker?: google.maps.Marker | null;\n\n map: google.maps.Map | null = null;\n\n infoWindow?: google.maps.InfoWindow;\n\n userLocationMarker?: google.maps.Marker;\n\n markerCluster?: MarkerClusterer;\n\n bounds?: google.maps.LatLngBounds;\n\n prefs() {\n return {\n isMapInited: false,\n activeStoreId: '',\n storesModel: <TStoresModel> {},\n allowLoadMoreThanOnce: false,\n loadMoreButton: 'storeLocatorLoadMoreButton',\n storeLocatorSearchForm: 'storeLocatorSearchForm',\n classesExpandedMap: 'm-expanded',\n classesSelectedStore: 'm-selected',\n staticUrlMarkersImage: '',\n apiKey: '',\n mapStyleConfig: {},\n expandButtonText: '',\n hideButtonText: '',\n accessibilityAlerts: <Record<string, string>> {},\n ...super.prefs()\n };\n }\n\n /**\n * @description Initialize widget logic\n */\n init(): void {\n super.init();\n\n this.markers = [];\n this.activeStoreMarker = null;\n\n this.initMap();\n }\n\n /**\n * @description Adds new markers to the map for the provided stores\n * Removes the old ones\n * @param stores Array with store objects\n */\n handleMarkers(stores: Array<TStore> = []): void {\n if (!this.prefs().isMapInited || !stores) {\n return;\n }\n\n this.removeAllMarkers();\n this.getNewBounds();\n this.getNewInfoWindow();\n this.addUserLocationMarker();\n this.addMarkers(stores);\n this.createClusters();\n\n this.map?.fitBounds(<google.maps.LatLngBounds> this.bounds);\n }\n\n /**\n * @description Creates new instance google map marker for provided stores.\n * Adds a marker on the map and add a listener on click event.\n * @param stores Array with store objects\n */\n addMarkers(stores: Array<TStore> = []): void {\n if (!stores) {\n return;\n }\n\n stores.forEach((store) => {\n const storeMarker = getGoogleMapMarker({\n position: {\n lat: store.latitude,\n lng: store.longitude\n },\n icon: this.prefs().staticUrlMarkersImage + 'default-marker.svg'\n });\n\n storeMarker.setMap(this.map);\n\n if (this.bounds) {\n this.bounds.extend(<google.maps.LatLng> storeMarker.getPosition());\n }\n\n this.markerClickEventHandler(store, storeMarker);\n this.markers.push(storeMarker);\n });\n }\n\n /**\n * @description Handles click event on the marker\n * @listens dom#click\n * @param store Store object\n * @param marker Marker object\n */\n markerClickEventHandler(store: TStore, marker: google.maps.Marker): void {\n marker.addListener('click', () => {\n this.setActiveMarker(marker);\n this.setActiveStore(store.uuid);\n this.renderInfoWindow(store, marker);\n });\n }\n\n /**\n * @description Sets active marker with a new icon on the map\n * @param marker Marker for the provided store\n */\n setActiveMarker(marker: google.maps.Marker): void {\n if (this.activeStoreMarker) {\n this.activeStoreMarker.setIcon(this.prefs().staticUrlMarkersImage + 'default-marker.svg');\n }\n\n marker.setIcon(this.prefs().staticUrlMarkersImage + 'active-marker.svg');\n\n this.activeStoreMarker = marker;\n }\n\n /**\n * @description Sets active store in stores list\n * @param storeId Selected store id\n */\n setActiveStore(storeId: string): void {\n const storeRefElement = this.ref('id-' + storeId);\n const storeElement = storeRefElement.get();\n const top = storeElement?.offsetTop;\n\n if (this.prefs().activeStoreId) {\n this.ref('id-' + this.prefs().activeStoreId).removeClass(this.prefs().classesSelectedStore);\n }\n\n storeRefElement.addClass(this.prefs().classesSelectedStore);\n\n this.setPref('activeStoreId', storeId);\n\n scrollElementTo(this.ref('storeListContainer').get(), top);\n }\n\n /**\n * @description Sets content for the marker's info window and render it on the map\n * @param store Store object\n * @param storeMarker Marker for the provided store\n */\n renderInfoWindow(store: TStore, storeMarker: google.maps.Marker): void {\n render(this.prefs().storesModel.mapInfoWindowMarkup, store).then((renderedStr) => {\n if (this.infoWindow) {\n this.infoWindow.setContent(renderedStr);\n this.infoWindow.open(this.map, storeMarker);\n }\n });\n }\n\n /**\n * @description Removes all markers from the map\n */\n removeAllMarkers(): void {\n if (this.userLocationMarker) {\n this.userLocationMarker.setMap(null);\n }\n\n if (this.markers.length === 0) {\n return;\n }\n\n if (this.markerCluster) {\n this.markerCluster.clearMarkers();\n }\n\n this.markers.forEach((marker) => {\n marker.setMap(null);\n });\n\n this.markers = [];\n }\n\n /**\n * @description Creates clusters from all markers on the map\n */\n createClusters(): void {\n if (!this.map || !this.markers) {\n return;\n }\n\n this.markerCluster = new MarkerClusterer(this.map, this.markers, {\n styles: [{\n anchorText: [14, 0],\n\n // @ts-expect-error ts-migrate(2322) FIXME: Type 'number' is not assignable to type 'string | ... Remove this comment to see the full error message\n fontWeight: 700,\n textColor: 'white',\n textSize: 16,\n url: this.prefs().staticUrlMarkersImage + 'cluster-marker.svg',\n height: 48,\n width: 48\n }]\n });\n }\n\n /**\n * @description Init map on the page\n */\n initMap(): void {\n initGoogleMapsApi(this.prefs().apiKey)\n .then(() => {\n const mapContainer: HTMLInputElement = <HTMLInputElement> (this.ref('googleMap').get());\n\n if (!mapContainer) {\n return;\n }\n\n const mapOptions = {\n center: {\n lat: this.prefs().storesModel.lat,\n lng: this.prefs().storesModel.lng\n },\n styles: this.prefs().mapStyleConfig\n };\n const map = getGoogleMap(mapContainer, mapOptions);\n\n this.map = map;\n\n this.setPref('isMapInited', true);\n\n this.handleMarkers(this.prefs().storesModel.stores);\n });\n }\n\n /**\n * @description Adds marker for the current user's location\n */\n addUserLocationMarker(): void {\n if (!this.prefs().isMapInited\n || !this.map\n || !this.prefs().storesModel\n || !this.prefs().storesModel.lat\n || !this.prefs().storesModel.lng\n ) { return; }\n\n const userLocationMarker = getGoogleMapMarker({\n position: {\n lat: this.prefs().storesModel.lat,\n lng: this.prefs().storesModel.lng\n },\n icon: this.prefs().staticUrlMarkersImage + 'search-location-marker.svg'\n });\n\n this.userLocationMarker = userLocationMarker;\n userLocationMarker.setMap(this.map);\n\n if (this.bounds) {\n this.bounds.extend(<google.maps.LatLng> userLocationMarker.getPosition());\n }\n }\n\n /**\n * @description Gets the instance of the Google Map Bounds class\n */\n getNewBounds(): void {\n this.bounds = getGoogleMapBounds();\n }\n\n /**\n * @description Gets the instance of the Google Map Info Window class\n */\n getNewInfoWindow(): void {\n this.infoWindow = getGoogleMapInfoWindow();\n }\n\n /**\n * @description Expands/Collapses map on click event\n * @listens dom#click\n * @param button Target element\n */\n toggleMapState(button: RefElement): void {\n const mapContainer = this.ref('googleMap');\n\n if (!mapContainer) {\n return;\n }\n\n mapContainer.toggleClass(this.prefs().classesExpandedMap);\n const isMapExpanded = mapContainer.hasClass(this.prefs().classesExpandedMap);\n\n if (isMapExpanded) {\n button.setText(this.prefs().hideButtonText);\n } else {\n button.setText(this.prefs().expandButtonText);\n }\n }\n\n /**\n * @description Show appropriate Global Alert for page changes\n * @emits \"alert.show\"\n * @param message - alert message\n */\n accessibilityAlert(message: string): void {\n // We need to show alerts with delay to not overlap with other big changes on the page\n /**\n * @description Global event to show alert\n * @event \"alert.show\"\n */\n window.setTimeout(() => this.eventBus().emit('alert.show', { accessibilityAlert: message }), 400);\n }\n\n /**\n * @description Render to template stores list\n * @param storesModel Stores Model object to render\n * @returns resolved if rendered or rejected if no found template promise\n */\n renderStoreLocatorList(storesModel: TStoresModel): Promise<void> {\n // Please note that we need IDs to items to avoid strange rendering issues connected to DiffDOM SFRA-8129\n return this.render('storeLocatorTemplate', storesModel, this.ref('storeListContainer'))\n .then(() => {\n this.accessibilityAlert(this.prefs().accessibilityAlerts.storesListUpdated);\n });\n }\n\n /**\n * @description Render Load More Button with all attributes\n * @param storesModel Stores Model object to render\n * @returns resolved if rendered or rejected if no found template promise\n */\n renderLoadMoreButton(storesModel: TStoresModel): Promise<void> {\n return this.render('storeLocatorLoadMoreTemplate', storesModel, this.ref('storeLocatorLoadMoreButton'));\n }\n\n /**\n * @description Handles click on Load More Button\n * @param loadMoreButton Load More Button\n * @listens dom#click\n * @returns Promise object represents server response that includes additional stores\n */\n loadMore(loadMoreButton: RefElement) {\n const url = <string> loadMoreButton.data('href');\n const pageNumber = String(parseInt(<string> loadMoreButton.data('pageNumber'), 10) + 1);\n const lat = <string> loadMoreButton.data('lat');\n const lng = <string> loadMoreButton.data('lng');\n\n if (!url) {\n return Promise.resolve({});\n }\n\n return getJSONByUrl(url, {\n pageNumber,\n lat,\n lng\n }).then(response => {\n if (this.prefs().storesModel && response.success) {\n this.setPref('storesModel', {\n ...<TStoresModel> response.storesModel,\n stores: this.prefs().storesModel.stores.concat((<TStoresModel> response.storesModel).stores)\n });\n\n Promise.all([\n this.renderStoreLocatorList(this.prefs().storesModel),\n this.renderLoadMoreButton(this.prefs().storesModel)\n ]).then(() => {\n if (!this.prefs().storesModel.isLoadMoreButtonEnabled || !this.prefs().allowLoadMoreThanOnce) {\n this.ref(this.prefs().loadMoreButton).hide();\n }\n }).finally(() => {\n this.initMap();\n });\n }\n\n return response;\n });\n }\n }\n\n return StoreLocatorMgr;\n}\n","import { initGoogleGeocoder, initGoogleMapsApi } from 'widgets/toolbox/googleMgr';\nimport { TWidget } from 'widgets/Widget';\n\nconst keyCode = Object.freeze({\n ENTER: 13,\n SPACE: 32\n});\n\ntype TSearchByPlace = ReturnType<typeof import('./SearchByPlace').default>;\ntype ISearchByPlace = InstanceType<TSearchByPlace>;\n\n/**\n * @param {Widget} Widget Base widget for extending\n * @returns {typeof StoreSearchForm} StoreSearchForm widget\n */\nexport default function (Widget: TWidget) {\n /**\n * @category widgets\n * @subcategory storelocator\n * @class StoreSearchForm\n * @augments Widget\n * @classdesc Represents StoreSearchForm component with next features:\n * 1. Allows getting current user location. In case the user denied to provide the current location allows handling those cases.\n * 2. Allows sending a request to the server with the user's coordinates for searching stores based on the provided location.\n * 3. Allows getting coordinates by provided search address phrase.\n *\n * StoreSearchForm widget should contain {@link SearchByPlace} widgets that implement search by place functionality.\n * @property {string} data-widget - Widget name `storeSearchForm`\n * @property {string} data-action-url - URL to be used for searching stores\n * @property {string} data-country-code - Current country code value\n * @property {string} data-error-message - Error message used in case the user deny the browser location prompt\n * @property {string} data-error-message-place-not-found - Error message used in case place was not found by the provided search phrase.\n * @example <caption>Example of StoreSearchForm widget usage</caption>\n * <main\n * data-widget=\"storeSearchForm\"\n * data-action-url=\"${URLUtils.url('Stores-FindStores')}\"\n * data-country-code=\"${pdict.countryCode}\"\n * data-error-message=\"${Resource.msg('storeLocator.currentLocation.error', 'storeLocator', null)}\"\n * data-error-message-place-not-found=\"${Resource.msg('form.storelocator.searchByPlace.error', 'forms', null)}\"\n * >\n * Store Search Form content\n * <button\n * type=\"button\"\n * data-event-click=\"getUserCurrentLocation\"\n * >\n * ${Resource.msg('storeLocator.findNearStores','storeLocator',null)}\n * </button>\n * Please check the template for more information\n * <isinclude template=\"storeLocator/storeLocatorFields\" />\n * </main>\n */\n class StoreSearchForm extends Widget {\n geocoder: google.maps.Geocoder | null = null;\n\n prefs() {\n return {\n errorFeedback: 'errorMessageLabel',\n errorMessage: '',\n errorMessagePlaceNotFound: '',\n actionUrl: '',\n searchInputFieldId: 'searchByPlace',\n geolocationOptions: {\n enableHighAccuracy: true,\n timeout: 5000,\n maximumAge: 0\n },\n countryCode: '',\n googleGeocoderInited: false,\n ...super.prefs()\n };\n }\n\n /**\n * @description Get user current location\n * @listens dom#click\n * @returns {void}\n */\n getUserCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n (position) => { this.userAllowCurrentLocation(position); },\n () => { this.userDenyCurrentLocation(); },\n this.prefs().geolocationOptions\n );\n }\n }\n\n /**\n * @description Handles success case on getting current user position\n * @param {object} position Current user location\n * @returns {void}\n */\n userAllowCurrentLocation(position) {\n const coordinates = position.coords;\n\n this.searchStoresByCoordinates(coordinates);\n }\n\n /**\n * @description Handles error case on getting current user position\n * @returns {void}\n */\n userDenyCurrentLocation() {\n this.ref(this.prefs().errorFeedback)\n .setText(this.prefs().errorMessage)\n .show();\n }\n\n /**\n * @description Build URL with coordinates and search phrase\n * @param {object} coordinates Current user location coordinates\n * @param {string} formattedAddress Formatted Address\n * @returns {void}\n */\n searchStoresByCoordinates(coordinates, formattedAddress = '') {\n const actionUrl = new URL(this.prefs().actionUrl);\n\n if (actionUrl) {\n actionUrl.searchParams.append('lat', coordinates.latitude);\n actionUrl.searchParams.append('lng', coordinates.longitude);\n\n if (formattedAddress) {\n actionUrl.searchParams.append('formattedAddress', formattedAddress);\n }\n\n window.location.assign(actionUrl.toString());\n }\n }\n\n /**\n * @description Stores search by coordinates on place change\n * @listens SearchByPlace#placechanged\n * @param searchField Input field\n * @param {object} place - place information\n * @returns {void}\n */\n handlePlaceChange(searchField: TSearchByPlace, place) {\n this.searchStoresByCoordinates({\n latitude: place.lat,\n longitude: place.lng\n }, place.formattedAddress);\n }\n\n /**\n * @description Search place based on parameters. Handles error in case address was not found\n * @param {object} geocoderRequestParams Google Geocoder Request parameters\n */\n geocodeBySearchPhrase(geocoderRequestParams) : void {\n if (!this.geocoder) {\n return;\n }\n\n this.geocoder.geocode(geocoderRequestParams, (results, status) => {\n if ((status === 'OK') && results && results[0]) {\n this.searchStoresByCoordinates(\n {\n latitude: results[0].geometry.location.lat(),\n longitude: results[0].geometry.location.lng()\n },\n results[0].formatted_address\n );\n } else {\n const actionUrl = new URL(this.prefs().actionUrl);\n\n window.location.assign(actionUrl.toString());\n }\n });\n }\n\n /**\n * @description Get value from search input.Init Google Geocoder\n * @listens dom#click\n * @returns {void}\n */\n searchByPhrase() {\n const address = this.getById<ISearchByPlace>('searchByPlace', (searchByPlace) => {\n return searchByPlace.isValid()\n ? searchByPlace.ref('field').val()\n : null;\n });\n\n if (!address) { return; }\n\n const geocoderRequestParams = {\n address: address,\n componentRestrictions: {\n country: this.prefs().countryCode\n }\n };\n\n if (this.prefs().googleGeocoderInited) {\n this.geocodeBySearchPhrase(geocoderRequestParams);\n\n return;\n }\n\n initGoogleMapsApi()\n .then(() => {\n this.geocoder = initGoogleGeocoder();\n\n this.setPref('googleGeocoderInited', true);\n\n this.geocodeBySearchPhrase(geocoderRequestParams);\n }).catch(() => {\n // eslint-disable-next-line no-console\n console.error('Not able to inti GoogleMapsApi');\n });\n }\n\n /**\n * @param {RefElement} _el event source element\n * @param {KeyboardEvent} event event instance if DOM event\n */\n handleKeydown(_el, event) {\n if (!event) {\n return;\n }\n\n switch (event.keyCode) {\n case keyCode.ENTER:\n event.preventDefault();\n event.stopPropagation();\n this.searchByPhrase();\n break;\n default:\n break;\n }\n }\n }\n\n return StoreSearchForm;\n}\n"],"names":["Widget","TwitterFeeds","init","initTwitterIframe","processShareButtons","virtualDOM","shareButtons","getElementsByClassName","Array","from","forEach","shareButton","remove","processImages","images","getElementsByTagName","img","imageSrc","getAttribute","imageUrl","imageExt","setAttribute","processLinks","links","link","callback","twitterDOM","document","createElement","innerHTML","body","tweets","twtCollection","step","prefs","tweetLimit","tweet","addActionButtons","push","window","__twttrf","renderTweets","baseActionButton","replaceAll","oldActionUrl","baseUrl","retweetUrl","favoriteUrl","commentUrl","retweetEl","cloneNode","commentEl","tweetActions","insertBefore","firstChild","appendChild","head","script","type","src","accountId","Math","random","render","twitterID","ref","getContentByUrl","appendParamsToUrl","appendParamToURL","getGeoLocation","Geocode","keyCode","Object","freeze","ENTER","SPACE","StoreSearchForm","SelectStoreSearchForm","classesClearEnabled","language","countryCode","classesInputActive","productName","isStore","useWoosmapGeolocation","coordinates","searchStoresByCoordinates","eventBus","on","handleKeydown","_el","event","get","click","handleWoosmapGeolocation","data","latitude","longitude","userAllowCurrentLocation","userDenyCurrentLocation","handleBrowserGeolocation","position","coords","getUserCurrentLocation","navigator","geolocation","getCurrentPosition","apiKey","then","bind","geocoderRequestParams","latlng","geocodeByCoordinates","formattedAddress","getById","searchByPlace","toggleClearButton","getValue","clearError","busy","actionUrl","lat","lng","location","assign","pid","productId","names","response","undefined","toString","unbusy","emit","eventCategory","eventAction","eventLabel","onStoreSelect","status","results","addressResult","countryAddressResultComponent","findAddressResultCountryComponent","address_components","short_name","geometry","formatted_address","renderNoResultTemplate","errorMessageCountryNotAllowed","errorMessagePlaceNotFound","addressResultComponents","find","addressResultComponent","types","indexOf","has","errorMessage","setError","length","searchByPhrase","address","sbpValid","validate","val","components","encodeURIComponent","geocodeBySearchPhrase","handleInput","isInputHasValue","inputWidget","toggleClass","clearInput","setValue","attr","getDistance","MAX_METRIC_LENGTH","MAX_IMPERIAL_LENGTH","MINIMAL_DISTANCE","LatLngDistance","WoosMapLatLngDistance","useCurrentPosition","lowDistanceMessage","exceededDistanceMessage","calculateDistanceByCurrentPosition","calculateDistance","getDistanceMessage","distance","distanceUnit","distanceMessage","replace","toFixed","convertDistance","result","metersInOneMile","searchCoordinates","searchPoint","storePoint","origins","destinations","units","element","rows","elements","value","renderDistance","initWoosMapAPI","initWoosMapAutocomplete","woosMapGetDetails","minLength","InputText","WoosMapSearchByPlace","disableAddressSuggestion","loaded","loadAutocompleteApiAndInit","initWoosmapAutocomplete","selector","config","country","localitiesWidget","predictions","initEvents","addListener","selectedLocality","getSelectedSuggestionDetails","key","public_id","addresses_per_page","wmNumberOfResults","locality","setCoordinates","handleFocus","isDesktopView","BasicProcessButton","WoosmapStoreDirections","errorFeedback","geolocationOptions","enableHighAccuracy","timeout","maximumAge","test","userAgent","iosLink","handleClick","el","preventDefault","hide","origin","destination","name","storeName","setText","show","initWoosmapMapAPI","initWoosmapMap","getWoosmapMapBounds","initWoosmapMapMarker","getWoosmapMapInfoWindow","initWoosmapMapStoresOverlay","StoreLocatorMgr","WoosmapStoreLocatorMgr","mapStoreStyleConfig","updateList","showAccessibilityAlerts","eventSublabel","storesAvailableForInstore","storesCount","storesModel","stores","store","isPreferredStore","ID","storeId","cachedTemplates","initMap","mapContainer","mapOptions","center","mapStyleConfig","map","setPref","handleMarkers","isMapInited","removeAllMarkers","initStoreOverlay","getNewBounds","getNewInfoWindow","addUserLocationMarker","addMarkers","fitBounds","bounds","updatesMapZoom","userLocationMarker","setMap","markers","markerCluster","clearMarkers","marker","infoWindow","storeOverlay","icon","staticUrlMarkersImage","locationMarkerPosition","getPosition","extend","setZoom","zoom","loadMore","loadMoreButton","storeMarker","storeMarkerPosition","markerClickEventHandler","toggleMapState","button","classesExpandedMap","isMapExpanded","hasClass","hideButtonText","expandButtonText","renderStoreLocatorList","accessibilityAlert","accessibilityAlerts","storesListUpdated","renderDirections","params","directionsService","woosmap","DirectionsService","directionsRenderer","DirectionsRenderer","Map","route","setDirections","label","console","log","googleApi","resolveGMapsFn","initialized","initializationPromise","Promise","resolve","googleMapsApiCallback","google","getAddressFieldsMappingConfig","address1","serviceObjectTypes","serviceObjectProperty","address2","city","stateCode","postalCode","getAddressComponentByType","addressComponents","addressComponent","getAddressField","fieldConfig","typesForMerge","aimProperty","targetAddressProperties","mergeType","isArray","i","l","join","initGoogleMapsApi","reject","url","URL","searchParams","append","decodeURIComponent","async","initGoogleAutocomplete","field","maps","places","Autocomplete","componentRestrictions","initGoogleGeocoder","Geocoder","getGoogleMap","options","getGoogleMapMarker","Marker","getGoogleMapBounds","LatLngBounds","getGoogleMapInfoWindow","InfoWindow","createLatLngObject","LatLng","computeDistanceBetween","spherical","parseAddress","mappingConfig","keys","reduce","addressObject","getSearchCoordinatesFromUrl","hash","queryString","urlParams","URLSearchParams","convertedDistance","SearchByPlace","autocompleteInited","autocomplete","place","getPlace","getJSONByUrl","scrollElementTo","MarkerClusterer","activeStoreId","allowLoadMoreThanOnce","storeLocatorSearchForm","classesSelectedStore","activeStoreMarker","createClusters","setActiveMarker","setActiveStore","uuid","renderInfoWindow","setIcon","storeRefElement","storeElement","top","offsetTop","removeClass","addClass","mapInfoWindowMarkup","renderedStr","setContent","open","styles","anchorText","fontWeight","textColor","textSize","height","width","message","setTimeout","renderLoadMoreButton","pageNumber","String","parseInt","success","concat","all","isLoadMoreButtonEnabled","finally","geocoder","searchInputFieldId","googleGeocoderInited","handlePlaceChange","searchField","geocode","isValid","catch","error","stopPropagation"],"sourceRoot":""}