{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/mens_app/cartridge/client/default/js/checkout/checkoutShippingAutoComplate.js","webpack:///./cartridges/mens_app/cartridge/client/default/js/checkoutShippingAutoComplate.js","webpack:///./cartridges/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js"],"names":["geocoder","setAutoComplate","arrayPlace","length","some","place","postcode","address_components","component","componentType","types","$","val","long_name","text","stateMaps","normalize","replace","toLocaleLowerCase","each","index","option","normalizeOption","prop","change","e","console","log","useUserLocation2","search","data","success","coords","latlng","lat","latitude","lng","longitude","geocode","location","then","response","results","formatted_address","focus","trigger","catch","error","alert","navigator","geolocation","getCurrentPosition","initAutocomplete2","search2","document","getElementById","clearSearch","userAddressSearch","google","maps","Geocoder","options","componentRestrictions","country","on","preventDefault","autocomplete","places","Autocomplete","addListener","getPlace","emailGuest","localStorage","getItem","updateCustomerInformationCustom","customerData","orderData","registeredUser","$container","$containerShipping","$summaryDetails","find","nameGuest","profile","firstName","lastnameGuest","lastName","phone","phoneGuest","email","orderEmail","attr","JSON","stringify","customer","order","hasOwnProperty","form","htmlName","keys","Object","fieldErrors","parents","removeClass","dataGuest","shippingFormData","serialize","callback","allPanels","hide","click","slideUp","parent","slideDown","addClass","window","processInclude","require","checkoutShippingAutoComplete","ready","module","exports","include","forEach","key"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QAC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AmB,QAAvB,EAAiC;IACpCtB,MAAM,CAACD,IAAP,CAAYuB,OAAZ,EAAqBC,OAArB,CAA6B,UAAUC,GAAV,EAAe;MACxC,IAAI,OAAOF,OAAO,CAACE,GAAD,CAAd,KAAwB,UAA5B,EAAwC;QACpCF,OAAO,CAACE,GAAD,CAAP;MACH;IACJ,CAJD;EAKH;AACJ,CAVD,C","file":"default/js/checkoutShippingAutoComplate.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/mens_app/cartridge/client/default/js/checkoutShippingAutoComplate.js\");\n","var geocoder;\n\nfunction setAutoComplate(arrayPlace) {\n if(!arrayPlace.length) return;\n try {\n arrayPlace.some(function (place) {\n let postcode = false;\n for (const component of place.address_components) {\n const componentType = component.types[0];\n switch (componentType) {\n\n case \"postal_code\": {\n $(\".shippingZipCode\").val(component.long_name)\n $(\".postal-code\").text(component.long_name)\n postcode = true;\n break;\n }\n case \"locality\":\n $(\".form-control.shippingAddressCity\").val(component.long_name);\n break;\n case \"administrative_area_level_1\": {\n var stateMaps = component.long_name.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\").toLocaleLowerCase();\n\n $(\".form-control.shippingState option\").each(function (index,option) {\n let normalizeOption = ($(option).text()).normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\").toLocaleLowerCase();\n if(normalizeOption == stateMaps){\n $(option).prop('selected', 'selected').change();\n }\n })\n break;\n }\n case \"sublocality_level_1\":\n $(\".form-control.shippingAddressTwo\").val(component.long_name);\n break;\n\n case \"sublocality_level_1\":\n $(\".form-control.shippingAddressCity\").val(component.long_name);\n break;\n }\n }\n return postcode;\n })\n }catch (e) {\n console.log('Error setAutocomplate Address'+e)\n }\n\n}\nfunction useUserLocation2(search, data) {\n const success = ({ coords }) => {\n\n const latlng = {\n lat: coords.latitude,\n lng: coords.longitude,\n };\n geocoder.geocode({ location: latlng }).then((response) => {\n search.val(response.results[0].formatted_address)\n setAutoComplate(response.results)\n search.focus().trigger('change')\n\n }).catch((e) => console.log(\"Geocoder failed due to: \" + e));\n }\n\n const error = () => {\n alert(\"Imposible obtener la ubicacion\");\n };\n\n navigator.geolocation.getCurrentPosition(success, error);\n}\n\nfunction initAutocomplete2() {\n const search = $(\"#autocomplete-shipping-address\");\n const search2 = document.getElementById(\"autocomplete-shipping-address\");\n const clearSearch = $(\".edit-address-select\");\n const userAddressSearch = $(\"#user-location-search-address\");\n geocoder = new google.maps.Geocoder();\n\n const options = {\n componentRestrictions: { country: \"MX\" },\n types: [\"geocode\"],\n };\n\n clearSearch.on(\"click\", (e) => {\n e.preventDefault();\n search.val('');\n //$('.shipping-address-block').removeClass('select-address')\n\n });\n\n userAddressSearch.on(\"click\", (e) => {\n e.preventDefault();\n useUserLocation2(search);\n });\n\n const autocomplete = new google.maps.places.Autocomplete(search2, options);\n\n\n autocomplete.addListener(\"place_changed\", () => {\n const place = autocomplete.getPlace();\n setAutoComplate([place])\n $(\".description-address\").text(place.formatted_address);\n\n //$('.shipping-address-block').addClass('select-address')\n\n });\n}\n\n\nvar emailGuest = localStorage.getItem('guestemail')\nif(emailGuest){\n $('input[name$=coCustomer_email]').val(emailGuest);\n}\n\nfunction updateCustomerInformationCustom(customerData, orderData) {\n if(!customerData.registeredUser ) {\n var $container = $('.customer-summary');\n var $containerShipping = $('.shipping-form');\n var $summaryDetails = $container.find('.summary-details');\n var nameGuest = customerData.profile && customerData.profile.firstName ? customerData.profile.firstName : orderData.nameGuest;\n var lastnameGuest = customerData.profile && customerData.profile.lastName ? customerData.profile.lastName: orderData.lastnameGuest;\n var phone = customerData.profile && customerData.profile.phone ? customerData.profile.phone : orderData.phoneGuest;\n var email = customerData.profile && customerData.profile.email ? customerData.profile.email : orderData.orderEmail;\n\n if(nameGuest){\n $summaryDetails.find('.shippingFirstName').text(nameGuest);\n $('input[name$=_firstName]', $containerShipping).val(nameGuest);\n }\n\n if(lastnameGuest){\n $summaryDetails.find('.shippingLastName').text(lastnameGuest);\n $('input[name$=_lastName]', $containerShipping).val(lastnameGuest);\n }\n\n if(phone){\n $summaryDetails.find('.shippingPhoneNumber').text(phone);\n $('input[name$=_phone]', $containerShipping).val(phone);\n }\n\n if(email){\n $summaryDetails.find('.customer-summary-email').text(email);\n $('input[name$=coCustomer_email]', $containerShipping).val(email);\n }\n\n $containerShipping.attr('data-customer-guest', JSON.stringify({nameGuest:nameGuest,phone:phone,lastnameGuest:lastnameGuest}));\n }\n}\n\n$('body').on('checkout:updateCheckoutView', function (e, data) {\n updateCustomerInformationCustom(data.customer, data.order)\n})\n$('body').on('checkout:errorCheckoutShipping', function (e, data) {\n\n if(data && data.hasOwnProperty('error') && data.error){\n $('#'+data.form.htmlName).attr('data-address-mode', 'details')\n let keys = Object.keys(data.fieldErrors[0])\n $.each(keys, function (index, attr) {\n $('*[name=' + attr + ']', '#'+data.form.htmlName).parents('.row.d-none').removeClass('d-none')\n });\n }\n})\n\n$('body').on('checkout:serializeShipping', function (e,data) {\n let firstName = $('input[name$=_firstName]', data.form);\n let lastName = $('input[name$=_lastName]', data.form);\n let phone = $('input[name$=_phone]', data.form);\n if(!firstName.val() || !lastName.val() || !phone.val()){\n let dataGuest= data.form.data('customer-guest');\n if(dataGuest){\n dataGuest.nameGuest ? firstName.val(dataGuest.nameGuest) : '';\n dataGuest.lastnameGuest ? lastName.val(dataGuest.lastnameGuest) : '';\n dataGuest.phone ? phone.val(dataGuest.phone) : '';\n let shippingFormData = data.form.serialize();\n data.callback(shippingFormData)\n }\n }\n});\n\n\nvar allPanels = $('.accordion .accordion-content').hide();\n\n$('.accordion .accordion-title').click(function() {\n allPanels.slideUp();\n allPanels.find('.tab-pane').removeClass('active')\n $(this).parent().find('.accordion-content').slideDown();\n $(this).parent().find('.tab-pane').addClass('active')\n});\n\n\nwindow.initAutocomplete2 = initAutocomplete2;","const processInclude = require(\"base/js/util\");\nconst checkoutShippingAutoComplete = require(\"./checkout/checkoutShippingAutoComplate\");\n\n$(document).ready(() => {\n processInclude(checkoutShippingAutoComplete);\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"],"sourceRoot":""}