{"version":3,"file":"default/js/storeLocator.js","mappings":";;;;;;;;;;AAAA;AACa;;AAEb;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;;AAEb;AACA;AACA,SAAS;AACT,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,WAAW,aAAa;AACxB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wFAAwF,IAAI,qBAAqB,EAAE;AACnH;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,cAAc;AACd;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;ACpgBa;;AAEb;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;ACZA;AACA,IAAI,KAAyC;AAC7C,IAAI,iCAAO,EAAE,mCAAE;AACf;AACA,KAAK;AAAA,kGAAC,GAAG,CAGsD;AAC/D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,yBAAyB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B,gEAAgE;AAC7F;AACA;AACA;AACA,CAAC;;;;;;UCzGD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;ACtBa;;AAEb,qBAAqB,mBAAO,CAAC,sFAAQ;;AAErC;AACA,mBAAmB,mBAAO,CAAC,gIAA6B;AACxD,CAAC;;;;;;;;ACND,mBAAO,CAAC,yEAAe,IAAI","sources":["webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/storeLocator/storeLocator.js","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/util.js","webpack://sfra-startup-kit/./node_modules/svg4everybody/dist/svg4everybody.js","webpack://sfra-startup-kit/webpack/bootstrap","webpack://sfra-startup-kit/./cartridges/app_custom_fraserhart/cartridge/client/default/js/storeLocator.js","webpack://sfra-startup-kit/./node_modules/svg-spritemap-webpack-plugin/svg4everybody-helper.js"],"sourcesContent":["/* globals google */\n'use strict';\n\n/**\n * appends params to a url\n * @param {string} url - Original url\n * @param {Object} params - Parameters to append\n * @returns {string} result url with appended parameters\n */\nfunction appendToUrl(url, params) {\n var newUrl = url;\n newUrl += (newUrl.indexOf('?') !== -1 ? '&' : '?') + Object.keys(params).map(function (key) {\n return key + '=' + encodeURIComponent(params[key]);\n }).join('&');\n\n return newUrl;\n}\n\n/**\n * Uses google maps api to render a map\n */\nfunction maps() {\n var map;\n var infowindow = new google.maps.InfoWindow();\n\n // Init U.S. Map in the center of the viewport\n var latlng = new google.maps.LatLng(54.167582, -4.464872);\n var mapOptions = {\n scrollwheel: false,\n zoom: 5,\n center: latlng\n };\n\n map = new google.maps.Map($('.map-canvas')[0], mapOptions);\n var bounds = new google.maps.LatLngBounds();\n\n // Customized google map marker icon with svg format\n var markerImg = {\n path: 'M13.5,30.1460153 L16.8554555,25.5 L20.0024287,25.5 C23.039087,25.5 25.5,' +\n '23.0388955 25.5,20.0024287 L25.5,5.99757128 C25.5,2.96091298 23.0388955,0.5 ' +\n '20.0024287,0.5 L5.99757128,0.5 C2.96091298,0.5 0.5,2.96110446 0.5,5.99757128 ' +\n 'L0.5,20.0024287 C0.5,23.039087 2.96110446,25.5 5.99757128,25.5 L10.1445445,' +\n '25.5 L13.5,30.1460153 Z',\n fillColor: '#0070d2',\n fillOpacity: 1,\n scale: 1.1,\n strokeColor: 'white',\n strokeWeight: 1,\n anchor: new google.maps.Point(13, 30),\n labelOrigin: new google.maps.Point(12, 12)\n };\n\n var mapdiv = $('.map-canvas').attr('data-locations');\n var mapdivSingle = $('.map-canvas').attr('data-location');\n\n if (mapdiv) {\n mapdiv = JSON.parse(mapdiv);\n\n Object.keys(mapdiv).forEach(function (key) {\n var item = mapdiv[key];\n var lable = parseInt(key, 10) + 1;\n var storeLocation = new google.maps.LatLng(item.latitude, item.longitude);\n var marker = new google.maps.Marker({\n position: storeLocation,\n map: map,\n title: item.name,\n icon: markerImg,\n label: {\n text: lable.toString(),\n color: 'white',\n fontSize: '16px'\n }\n });\n\n marker.addListener('click', function () {\n infowindow.setOptions({\n content: item.infoWindowHtml\n });\n infowindow.open(map, marker);\n });\n\n // Create a minimum bound based on a set of storeLocations\n bounds.extend(marker.position);\n });\n } else if (mapdivSingle) {\n mapdiv = JSON.parse(mapdivSingle);\n var item = mapdiv;\n var storeLocation = new google.maps.LatLng(item.latitude, item.longitude);\n var marker = new google.maps.Marker({\n position: storeLocation,\n map: map,\n title: item.name,\n });\n\n marker.addListener('click', function () {\n infowindow.setOptions({\n content: item.infoWindowHtml\n });\n infowindow.open(map, marker);\n });\n\n // Create a minimum bound based on a set of storeLocations\n bounds.extend(marker.position);\n }\n\n // Fit the all the store marks in the center of a minimum bounds when any store has been found.\n if (mapdiv && mapdiv.length !== 0) {\n map.fitBounds(bounds);\n }\n}\n\n/**\n * Renders the results of the search and updates the map\n * @param {Object} data - Response from the server\n */\nfunction updateStoresResults(data) {\n var $resultsDiv = $('.results');\n var $mapDiv = $('.map-canvas');\n var hasResults = data.stores.length > 0;\n var isCheckout = $('#checkout-main').length > 0;\n var postalCodeField = $('#store-postal-code');\n\n if (!hasResults) {\n if (isCheckout && postalCodeField) {\n if (!$(postalCodeField).hasClass('is-invalid')) {\n $(postalCodeField).addClass('is-invalid');\n }\n $('.store-locator-component-result').hide();\n }\n\n $('.store-locator-no-results').show();\n } else {\n if (isCheckout && postalCodeField) {\n if ($(postalCodeField).hasClass('is-invalid')) {\n $(postalCodeField).removeClass('is-invalid');\n }\n $('.store-locator-component-result').show();\n }\n\n $('.store-locator-no-results').hide();\n }\n\n $resultsDiv.empty()\n .data('has-results', hasResults)\n .data('radius', data.radius)\n .data('search-key', data.searchKey);\n\n $mapDiv.attr('data-locations', data.locations);\n\n if ($mapDiv.data('has-google-api')) {\n maps();\n } else {\n $('.store-locator-no-apiKey').show();\n }\n\n if (data.storesResultsHtml) {\n $resultsDiv.append(data.storesResultsHtml);\n }\n}\n\n/**\n * Searches for in store availability\n * @param {Object} instoreAvailabilityInput - The input field for the search\n * @param {Object} invalidFeedback - The invalid feedback element\n * @param {Object} geocoder - The google maps geocoder\n * @param {Object} coordinates - The coordinates of the searched address\n * @param {Object} payload - The payload for the inStoreAvailabilitySearch\n */\nfunction searchInStoreAvailability() {\n var instoreAvailabilityInput = $('.instore-availability-input');\n var invalidFeedback = $('.instore-availability-stores-tab > .invalid-feedback');\n invalidFeedback.removeClass('d-block');\n\n if (instoreAvailabilityInput.val().length === 0) {\n invalidFeedback.text(instoreAvailabilityInput.data('missing-error'));\n invalidFeedback.addClass('d-block');\n } else if (checkSizeSelected()) {\n const geocoder = new google.maps.Geocoder();\n\n geocoder.geocode({\n 'address': instoreAvailabilityInput.val() // The address from the Input field. It can be a post code also\n }, function (results, status) {\n var coordinates = null;\n if (status == google.maps.GeocoderStatus.OK) {\n coordinates = results;\n }\n\n if (coordinates || instoreAvailabilityInput.val().length) {\n var payload = {};\n\n /* Check if there is a result with Location name */\n if (coordinates && coordinates.length) {\n payload.lat = coordinates[0].geometry.location.lat();\n payload.long = coordinates[0].geometry.location.lng();\n } else {\n /* If not guess the input as postalCode */\n payload.postalCode = instoreAvailabilityInput.val();\n }\n\n inStoreAvailabilitySearch(payload);\n }\n });\n }\n}\n\n/**\n * Search for stores with new zip code\n * @param {HTMLElement} element - the target html element\n * @returns {boolean} false to prevent default event\n */\nfunction search(element) {\n var dialog = element.closest('.in-store-inventory-dialog');\n var spinner = dialog.length ? dialog.spinner() : $.spinner();\n var $form = element.closest('.store-locator');\n var radius = $('.results').data('radius');\n var url = $form.attr('action');\n var urlParams = {\n radius: radius\n };\n var postalCode = $form.find('[name=\"postalCode\"]').val().toUpperCase();\n var isCheckout = $('#checkout-main').length > 0;\n var result = true;\n\n if ($('body').hasClass('fraser-hart') == true && isCheckout) {\n var postalCodeField = $('#store-postal-code');\n var pattern = /(^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$)/;\n result = pattern.test(postalCode);\n\n if (!result) {\n $(postalCodeField).addClass('is-invalid');\n } else if ($(postalCodeField).hasClass('is-invalid')) {\n $(postalCodeField).removeClass('is-invalid');\n }\n }\n\n if (result) {\n spinner.start();\n var payload = $form.is('form') ? $form.serialize() : {\n postalCode: postalCode\n };\n\n url = appendToUrl(url, urlParams);\n\n $.ajax({\n url: url,\n type: $form.attr('method'),\n data: payload,\n dataType: 'json',\n success: function (data) {\n spinner.stop();\n updateStoresResults(data);\n $('.select-store').prop('disabled', true);\n }\n });\n }\n return false;\n}\n\n/**\n * Checks if a size has been selected for the product\n * @returns {boolean} - true if a size has been selected, false otherwise\n */\nfunction checkSizeSelected() {\n /* Check if the product is ready to order / available */\n var buttonAddToCart = $('button.add-to-cart');\n if (!buttonAddToCart.hasClass('d-none') && buttonAddToCart.attr('data-readytoorder') === 'false') {\n var productSizeAttr = $('div.product-attribute[data-attr=\"Size\"]');\n var invalidFeedbackSelectSize = productSizeAttr.find('.error-msg');\n invalidFeedbackSelectSize.css('display', 'inline');\n\n var headerContainer = $('.header-container');\n var offsetPosition = productSizeAttr[0].getBoundingClientRect().top + window.scrollY - headerContainer.height();\n\n $('html, body').animate({\n scrollTop: offsetPosition\n }, 'slow');\n return false;\n }\n return true;\n}\n\n/**\n * Resets the in store availability tab\n */\nfunction resetInStoreAvailabilityTab() {\n $('.instore-availability-input').val('');\n $('.instore-availability-stores-result').html('');\n $('.instore-availability-stores-tab > .invalid-feedback').removeClass('d-block');\n $('.instore-availability-stores-tab > .invalid-feedback').addClass('d-none');\n}\n\n\n/**\n * Performs an AJAX call to search for stores with in-store availability\n * @param {Object} payload - the payload object containing the search parameters\n */\nfunction inStoreAvailabilitySearch(payload) {\n var instoreAvailabilityStoresResult = $('.instore-availability-stores-result');\n var InStoreAvailabilitySearchURL = $('input[name=\"InStoreAvailabilitySearchURL\"').val();\n var productId = $('.product-detail').data('pid');\n var invalidFeedback = $('.instore-availability-stores-tab > .invalid-feedback');\n\n invalidFeedback.removeClass('d-block');\n payload.products = productId;\n\n instoreAvailabilityStoresResult.fadeOut('slow', function () {\n $.ajax({\n url: InStoreAvailabilitySearchURL,\n type: 'GET',\n data: payload,\n dataType: 'json',\n success: function (data) {\n if (data.stores.length > 0) {\n instoreAvailabilityStoresResult.html(data.storesResultsHtml);\n instoreAvailabilityStoresResult.fadeIn('slow');\n } else {\n var instoreAvailabilityInput = $('.instore-availability-input');\n instoreAvailabilityStoresResult.html('');\n invalidFeedback.text(instoreAvailabilityInput.data('no-result-error'));\n invalidFeedback.addClass('d-block');\n }\n }\n });\n });\n}\n\nmodule.exports = {\n init: function () {\n if ($('.map-canvas').data('has-google-api')) {\n maps();\n } else {\n $('.store-locator-no-apiKey').show();\n }\n\n if (!$('.results').data('has-results')) {\n $('.store-locator-no-results').show();\n }\n },\n\n detectLocation: function () {\n // clicking on detect location.\n $('.detect-location').on('click', function () {\n $.spinner().start();\n if (!navigator.geolocation) {\n $.spinner().stop();\n return;\n }\n\n navigator.geolocation.getCurrentPosition(\n function (position) {\n var $detectLocationButton = $('.detect-location');\n var url = $detectLocationButton.data('action');\n var radius = $('.results').data('radius');\n var urlParams = {\n radius: radius,\n lat: position.coords.latitude,\n long: position.coords.longitude\n };\n\n url = appendToUrl(url, urlParams);\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $.spinner().stop();\n updateStoresResults(data);\n $('.select-store').prop('disabled', true);\n }\n });\n },\n function () {\n // Handle geolocation error.\n $.spinner().stop();\n });\n });\n },\n\n search: function () {\n $('.store-locator-container form.store-locator').submit(function (e) {\n e.preventDefault();\n search($(this));\n });\n $('.store-locator-container .btn-storelocator-search[type=\"button\"]').click(function (e) {\n e.preventDefault();\n search($(this));\n });\n $('body').on('keypress', '.store-locator-container', (function (e) {\n if (e.which == 13) {\n e.preventDefault();\n search($(this).find('.btn-storelocator-search[type=\"button\"]'));\n }\n }));\n },\n\n changeRadius: function () {\n $('.store-locator-container .radius').change(function () {\n var radius = $(this).val();\n var searchKeys = $('.results').data('search-key');\n var url = $(this).data('action-url');\n var urlParams = {};\n\n if (searchKeys.postalCode) {\n urlParams = {\n radius: radius,\n postalCode: searchKeys.postalCode\n };\n } else if (searchKeys.lat && searchKeys.long) {\n urlParams = {\n radius: radius,\n lat: searchKeys.lat,\n long: searchKeys.long\n };\n }\n\n url = appendToUrl(url, urlParams);\n var dialog = $(this).closest('.in-store-inventory-dialog');\n var spinner = dialog.length ? dialog.spinner() : $.spinner();\n spinner.start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n spinner.stop();\n updateStoresResults(data);\n $('.select-store').prop('disabled', true);\n }\n });\n });\n },\n selectStore: function () {\n $('.store-locator-container').on('click', '.select-store', (function (e) {\n e.preventDefault();\n var selectedStore = $(':checked', '.results-card .results');\n var data = {\n storeID: selectedStore.val(),\n searchRadius: $('#radius').val(),\n searchPostalCode: $('.results').data('search-key').postalCode,\n storeDetailsHtml: selectedStore.siblings('label').find('.store-details').html(),\n event: e\n };\n\n $('body').trigger('store:selected', data);\n $('.js-error-checkout').hide();\n }));\n },\n updateSelectStoreButton: function () {\n $('body').on('change', '.select-store-input', (function () {\n $('.select-store').prop('disabled', false);\n $('.store-locator-container .select-store').trigger('click');\n }));\n },\n storeDetailLinks: function () {\n $('.store-detail-links a').on('click', function () {\n var target = $(this).data('href');\n\n $([document.documentElement, document.body]).animate({\n scrollTop: $(target).offset().top - 95\n }, 750);\n });\n },\n updateInStoreTabVisibility: function () {\n $('body').on('product:statusUpdate', function (e, data) {\n var availableForInStorePickup = data.availableForInStorePickup;\n var $inStoreAvailabilityTabs = $('.in-store-availability-tabs');\n var $instoreAvailabilityStoresTab = $('.instore-availability-stores-tab');\n var $instoreAvailabilityStoresHeader = $('.instore-availability-stores-header');\n if (availableForInStorePickup === true) {\n $instoreAvailabilityStoresTab.removeClass('d-none');\n $instoreAvailabilityStoresHeader.removeClass('d-none');\n $inStoreAvailabilityTabs.tabs({\n active: 0\n });\n } else {\n $instoreAvailabilityStoresTab.addClass('d-none');\n $instoreAvailabilityStoresHeader.addClass('d-none');\n $inStoreAvailabilityTabs.tabs({\n active: 1\n });\n }\n });\n },\n intilizePDPInStoreTabs: function () {\n $(document).ready(function () {\n var $inStoreAvailabilityTabs = $('.in-store-availability-tabs');\n var availableForInStorePickup = $('input[name=\"availableForInStorePickup\"]').val();\n $inStoreAvailabilityTabs.tabs({\n active: availableForInStorePickup === 'true' ? 0 : 1,\n disabled: [],\n select: function (event, ui) {\n $(ui.panel).fadeOut('slow');\n },\n show: function (event, ui) {\n $(ui.panel).fadeIn('slow');\n }\n });\n $inStoreAvailabilityTabs.removeClass('d-none');\n });\n },\n afterAttributeSelection: function () {\n $('body').on('product:afterAttributeSelect', function () {\n resetInStoreAvailabilityTab();\n });\n },\n seachInstoreAvailability: function () {\n $('body').on('click', '.instore-availability-search-btn', function () {\n searchInStoreAvailability();\n });\n $('body').on('keydown', '.instore-availability-input', function (e) {\n if (e.which === 13) {\n e.preventDefault();\n searchInStoreAvailability();\n }\n });\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","!function(root, factory) {\n \"function\" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set\n define([], function() {\n return root.svg4everybody = factory();\n }) : \"object\" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory() : root.svg4everybody = factory();\n}(this, function() {\n /*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */\n function embed(parent, svg, target) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (// clone the target\n var clone = target.cloneNode(!0); clone.childNodes.length; ) {\n fragment.appendChild(clone.firstChild);\n }\n // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }\n function loadreadystatechange(xhr) {\n // listen to changes in the request\n xhr.onreadystatechange = function() {\n // if the request is ready\n if (4 === xhr.readyState) {\n // get the cached html document\n var cachedDocument = xhr._cachedDocument;\n // ensure the cached html document based on the xhr response\n cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(\"\"), \n cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item\n xhr._embeds.splice(0).map(function(item) {\n // get the cached target\n var target = xhr._cachedTarget[item.id];\n // ensure the cached target\n target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)), \n // embed the target into the svg\n embed(item.parent, item.svg, target);\n });\n }\n }, // test the ready state change immediately\n xhr.onreadystatechange();\n }\n function svg4everybody(rawopts) {\n function oninterval() {\n // while the index exists in the live collection\n for (// get the cached index\n var index = 0; index < uses.length; ) {\n // get the current \n var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute(\"xlink:href\") || use.getAttribute(\"href\");\n if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)), \n svg && src) {\n if (polyfill) {\n if (!opts.validate || opts.validate(src, svg, use)) {\n // remove the element\n parent.removeChild(use);\n // parse the src and get the url and id\n var srcSplit = src.split(\"#\"), url = srcSplit.shift(), id = srcSplit.join(\"#\");\n // if the link is external\n if (url.length) {\n // get the cached xhr request\n var xhr = requests[url];\n // ensure the xhr request exists\n xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open(\"GET\", url), xhr.send(), \n xhr._embeds = []), // add the svg and id as an item to the xhr embeds list\n xhr._embeds.push({\n parent: parent,\n svg: svg,\n id: id\n }), // prepare the xhr ready state change event\n loadreadystatechange(xhr);\n } else {\n // embed the local id into the svg\n embed(parent, svg, document.getElementById(id));\n }\n } else {\n // increase the index when the previous value was not \"valid\"\n ++index, ++numberOfSvgUseElementsToBypass;\n }\n }\n } else {\n // increase the index when the previous value was not \"valid\"\n ++index;\n }\n }\n // continue the interval\n (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);\n }\n var polyfill, opts = Object(rawopts), newerIEUA = /\\bTrident\\/[567]\\b|\\bMSIE (?:9|10)\\.0\\b/, webkitUA = /\\bAppleWebKit\\/(\\d+)\\b/, olderEdgeUA = /\\bEdge\\/12\\.(\\d+)\\b/, edgeUA = /\\bEdge\\/.(\\d+)\\b/, inIframe = window.top !== window.self;\n polyfill = \"polyfill\" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;\n // create xhr requests object\n var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName(\"use\"), numberOfSvgUseElementsToBypass = 0;\n // conditionally start the interval if the polyfill is active\n polyfill && oninterval();\n }\n function getSVGAncestor(node) {\n for (var svg = node; \"svg\" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}\n return svg;\n }\n return svg4everybody;\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","'use strict';\n\nvar processInclude = require('./util');\n\n$(document).ready(function () {\n processInclude(require('./storeLocator/storeLocator'));\n});\n","require('svg4everybody')({});\n"],"names":[],"sourceRoot":""}