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GAChBC,EAAcD,EAAK,GACnBE,EAAUF,EAAK,GAGIvG,EAAI,EAC3B,GAAGsD,EAASoD,MAAK,SAASC,GAAM,OAA+B,IAAxBR,EAAgBQ,EAAW,IAAI,CACrE,IAAI5D,KAAYyD,EACZ1D,EAAoByC,EAAEiB,EAAazD,KACrCD,EAAoBtB,EAAEuB,GAAYyD,EAAYzD,IAGhD,GAAG0D,EAAS,IAAIpD,EAASoD,EAAQ3D,EAClC,CAEA,IADGwD,GAA4BA,EAA2BC,GACrDvG,EAAIsD,EAASjE,OAAQW,IACzBoG,EAAU9C,EAAStD,GAChB8C,EAAoByC,EAAEY,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOtD,EAAoBM,EAAEC,EAC9B,EAEIuD,EAAqBC,KAA6B,uBAAIA,KAA6B,wBAAK,GAC5FD,EAAmBrF,QAAQ8E,EAAqBS,KAAK,KAAM,IAC3DF,EAAmBxH,KAAOiH,EAAqBS,KAAK,KAAMF,EAAmBxH,KAAK0H,KAAKF,G,IClDvF9D,EAAoBiE,QAAKrI,ECGzB,IAAIsI,EAAsBlE,EAAoBM,OAAE1E,EAAW,CAAC,OAAO,WAAa,OAAOoE,EAAoB,MAAQ,IACnHkE,EAAsBlE,EAAoBM,EAAE4D,E","sources":["webpack://swyfft-web/webpack/runtime/chunk loaded","webpack://swyfft-web/webpack/runtime/create fake namespace object","webpack://swyfft-web/./Map.ts","webpack://swyfft-web/external var \"React\"","webpack://swyfft-web/external var \"ReactDOM\"","webpack://swyfft-web/external var \"numeral\"","webpack://swyfft-web/webpack/bootstrap","webpack://swyfft-web/webpack/runtime/amd options","webpack://swyfft-web/webpack/runtime/compat get default export","webpack://swyfft-web/webpack/runtime/define property getters","webpack://swyfft-web/webpack/runtime/global","webpack://swyfft-web/webpack/runtime/hasOwnProperty shorthand","webpack://swyfft-web/webpack/runtime/make namespace object","webpack://swyfft-web/webpack/runtime/runtimeId","webpack://swyfft-web/webpack/runtime/jsonp chunk loading","webpack://swyfft-web/webpack/runtime/nonce","webpack://swyfft-web/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","import * as Enumerable from '@app/Linq';\r\nimport * as Common from './Common';\r\nimport * as Constants from './Constants';\r\nimport * as Storage from './Storage';\r\nimport * as Models from './Models';\r\nimport * as Main from './Main';\r\nimport * as Api from './Api/HistoryApi';\r\n\r\nimport '@sass/Map/index.scss';\r\n\r\nexport function init() {\r\n if (!Storage.hasAuth()) {\r\n Common.navigate(Constants.pages.Login);\r\n return;\r\n }\r\n\r\n Main.init();\r\n\r\n $('#addressSearch').val('');\r\n\r\n if (Storage.hasAuth()) {\r\n $('#customer-care-call-details').hide();\r\n $('#user-details').show();\r\n $('#quote-menubar').show();\r\n $('#agentName').html(Storage.getUserName() || '');\r\n } else {\r\n $('#quote-menubar').hide();\r\n $('#customer-care-call-details').show();\r\n $('#user-details').hide();\r\n }\r\n\r\n $('#addressSearch').autocomplete({\r\n minLength: 4, // max number of characters\r\n delay: 200, // delay time for making API call\r\n source(request, response) {\r\n return Common.getAddressAutoCompleteLabels(request, response);\r\n },\r\n select(event, ui) {\r\n event.preventDefault();\r\n $('#addressSearch').val(ui.item.label);\r\n },\r\n focus(event, ui) {\r\n event.preventDefault();\r\n $('#addressSearch').val(ui.item.label);\r\n },\r\n change() {\r\n Map.getAddressFromString(String($('#addressSearch').val()));\r\n },\r\n });\r\n\r\n $('#addressSearch').keypress(e => {\r\n const key = e.which;\r\n if (key === 13) {\r\n // the enter key code\r\n const address = Common.asString($('#addressSearch').val());\r\n if (address !== '') {\r\n Map.getAddressFromString(address);\r\n }\r\n e.preventDefault();\r\n }\r\n });\r\n\r\n $(window).resize(() => {\r\n if (!Main.isHamburgerMenuOpen) {\r\n Map.handleResize();\r\n }\r\n });\r\n\r\n google.maps.event.addDomListener(window, 'load', Map.getCurrentLocation);\r\n}\r\n\r\nnamespace Map {\r\n let gMap: google.maps.Map;\r\n\r\n interface IMarker {\r\n latitude: number;\r\n longitude: number;\r\n title: string;\r\n isPurchased: boolean;\r\n }\r\n\r\n let mapResized: boolean, infoWindow: google.maps.InfoWindow;\r\n\r\n const mapMarkers: google.maps.Marker[] = [];\r\n const imageUrls = ['/Images/GreenPin.png', '/Images/GreyPin.png'];\r\n\r\n //Default Locations if user doesn't share its location\r\n const defaultLocation: Models.ILocation = {\r\n latitude: 41.8803,\r\n longitude: -87.6949,\r\n };\r\n\r\n let location = Storage.getLastLocation() || defaultLocation;\r\n\r\n export function getCurrentLocation() {\r\n if (navigator.geolocation) {\r\n setTimeout(handleError, 5000);\r\n navigator.geolocation.getCurrentPosition(renderPosition, handleError, { timeout: 5000 });\r\n } else {\r\n $('div.mapOverlay').removeClass('standard').addClass('hidden');\r\n initMap();\r\n }\r\n }\r\n\r\n function renderPosition(position: any) {\r\n $('div.mapOverlay').removeClass('standard').addClass('hidden');\r\n location = {\r\n latitude: position.coords.latitude,\r\n longitude: position.coords.longitude,\r\n };\r\n Storage.setLastLocation(location);\r\n initMap();\r\n }\r\n\r\n function handleError() {\r\n $('div.mapOverlay').removeClass('standard').addClass('hidden');\r\n initMap();\r\n }\r\n\r\n /**\r\n * Get the lat/long for the address from Google, and then setup the map so that it focuses in on that lat/long.\r\n * Once the map is loaded, it will trigger a retrieval of quotes based on the bounding box of the map.\r\n */\r\n export function getAddressFromString(address: string) {\r\n if (address.trim()) {\r\n const geocoder = new google.maps.Geocoder();\r\n geocoder.geocode(\r\n {\r\n address: address,\r\n componentRestrictions: undefined,\r\n },\r\n (results, status) => {\r\n if (status === google.maps.GeocoderStatus.OK && results) {\r\n location = {\r\n latitude: results[0].geometry.location.lat(),\r\n longitude: results[0].geometry.location.lng(),\r\n };\r\n Storage.setLastLocation(location);\r\n initMap();\r\n }\r\n },\r\n );\r\n } else {\r\n loadQuotesFromBounds(gMap.getBounds());\r\n }\r\n }\r\n\r\n function initMap() {\r\n const mapElement = document.getElementById('map');\r\n if (!mapElement) throw 'Map element was not found';\r\n gMap = new google.maps.Map(mapElement, {\r\n zoom: 16,\r\n center: new google.maps.LatLng(location.latitude, location.longitude),\r\n mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n scrollwheel: false,\r\n });\r\n setBoundsChangedHandler();\r\n }\r\n\r\n function setBoundsChangedHandler() {\r\n google.maps.event.addListener(gMap, 'bounds_changed', () => {\r\n if (mapResized) {\r\n mapResized = false;\r\n initMap();\r\n } else {\r\n const bounds = gMap.getBounds();\r\n if (bounds) {\r\n scheduleQuoteLoadRequest(bounds);\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Stack to hold all outstanding bounds requests\r\n */\r\n let outstandingBounds: google.maps.LatLngBounds[] = [];\r\n\r\n /**\r\n * If we process all the requests as soon as they come in, we'll get overwhelmed. Instead,\r\n * what we need to do is push them onto a stack. If there's only one outstanding, process that one.\r\n * Otherwise, wait until the current request is done, then grab only the *last* (new) one off the stack,\r\n * clear the stack of all the others (since they're outdated), and then process that one.\r\n */\r\n async function scheduleQuoteLoadRequest(bounds: google.maps.LatLngBounds): Promise {\r\n // Add the incoming bounds to the stack\r\n outstandingBounds.push(bounds);\r\n\r\n // If there's already more than one outstanding, don't process it right away.\r\n // It means that there's an outstanding request, so don't kick off another one.\r\n // We'll check the stack after we're done with that request.\r\n if (outstandingBounds.length !== 1) return;\r\n\r\n // Process the current request.\r\n try {\r\n await loadQuotesFromBounds(bounds);\r\n } finally {\r\n // Pop the last item from the stack.\r\n const last = outstandingBounds.pop();\r\n\r\n // Clear the stack\r\n outstandingBounds = [];\r\n\r\n // If that last item is the same as the one we just processed, don't do anything.\r\n if (!last || last === bounds) return;\r\n\r\n // Otherwise, add it back to the stack and process the stack again.\r\n scheduleQuoteLoadRequest(last);\r\n }\r\n }\r\n\r\n async function loadQuotesFromBounds(bounds: google.maps.LatLngBounds | null | undefined): Promise {\r\n if (!bounds) return;\r\n\r\n const ne = bounds.getNorthEast();\r\n const sw = bounds.getSouthWest();\r\n\r\n // Load it up\r\n try {\r\n const quotesResult: Models.QuotesResult = await Api.getQuotesByLatLong(ne, sw);\r\n clearMarkers(null);\r\n infoWindow = new google.maps.InfoWindow();\r\n const quotes = Enumerable.from(quotesResult.Results)\r\n .groupBy(x => Common.toAddress(x.Address))\r\n .select(x =>\r\n x\r\n .orderByDescending(y => y.Purchased)\r\n .thenByDescending(y => y.CreatedOn)\r\n .first(),\r\n )\r\n .select(x => {\r\n const address = Common.toAddress(x.Address);\r\n const marker = {\r\n latitude: x.Address.Lat,\r\n longitude: x.Address.Lon,\r\n title: address,\r\n isPurchased: x.Purchased,\r\n };\r\n return marker;\r\n })\r\n .take(1000)\r\n .toArray();\r\n quotes.forEach(m => renderMarker(m));\r\n } catch (err) {\r\n Common.handleGeneralError(err);\r\n }\r\n }\r\n\r\n function renderMarker(markerInfo: IMarker) {\r\n // Info Window Content\r\n let infoWindowContent: { heading: string; content: string };\r\n let imageurl: string;\r\n if (markerInfo.isPurchased) {\r\n imageurl = imageUrls[0];\r\n infoWindowContent = {\r\n heading: 'Purchased',\r\n content: markerInfo.title,\r\n };\r\n } else {\r\n imageurl = imageUrls[1];\r\n infoWindowContent = {\r\n heading: 'Saved',\r\n content: markerInfo.title,\r\n };\r\n }\r\n const gMarker = new google.maps.Marker({\r\n position: new google.maps.LatLng(markerInfo.latitude, markerInfo.longitude),\r\n map: gMap,\r\n icon: imageurl,\r\n title: markerInfo.title,\r\n });\r\n const content = `

${infoWindowContent.heading}

${infoWindowContent.content}

`; // Allow each marker to have an info window\r\n google.maps.event.addListener(\r\n gMarker,\r\n 'click',\r\n ((marker, content) => () => {\r\n // Display multiple markers on a map\r\n infoWindow.setContent(content);\r\n infoWindow.open(gMap, marker);\r\n })(gMarker, content),\r\n );\r\n\r\n mapMarkers.push(gMarker);\r\n }\r\n\r\n //clears previous markers\r\n function clearMarkers(map: any) {\r\n for (let i = 0; i < mapMarkers.length; i++) {\r\n mapMarkers[i].setMap(map);\r\n }\r\n }\r\n\r\n //Triggers google map resize event\r\n export function handleResize() {\r\n google.maps.event.trigger(gMap, 'resize');\r\n mapResized = true;\r\n }\r\n}\r\n\r\ninit();\r\n","module.exports = React;","module.exports = ReactDOM;","module.exports = numeral;","// 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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.j = 6163;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t6163: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkswyfft_web\"] = self[\"webpackChunkswyfft_web\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [2076], function() { return __webpack_require__(76573); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","leafPrototypes","getProto","init","Storage","hasAuth","Main","$","val","hide","show","html","getUserName","autocomplete","minLength","delay","source","request","response","Common","getAddressAutoCompleteLabels","select","event","ui","preventDefault","item","label","focus","change","Map","getAddressFromString","String","keypress","e","which","address","asString","window","resize","isHamburgerMenuOpen","handleResize","google","maps","addDomListener","getCurrentLocation","navigate","Constants","pages","Login","gMap","mapResized","infoWindow","mapMarkers","imageUrls","location","getLastLocation","latitude","longitude","renderPosition","position","removeClass","addClass","coords","setLastLocation","initMap","handleError","mapElement","document","getElementById","zoom","center","LatLng","mapTypeId","MapTypeId","ROADMAP","scrollwheel","addListener","bounds","getBounds","scheduleQuoteLoadRequest","navigator","geolocation","setTimeout","getCurrentPosition","timeout","trim","Geocoder","geocode","componentRestrictions","undefined","results","status","GeocoderStatus","OK","geometry","lat","lng","loadQuotesFromBounds","outstandingBounds","push","length","last","pop","ne","getNorthEast","sw","getSouthWest","quotesResult","Api","getQuotesByLatLong","map","i","setMap","clearMarkers","InfoWindow","Enumerable","from","Results","groupBy","x","toAddress","Address","orderByDescending","y","Purchased","thenByDescending","CreatedOn","first","Lat","Lon","title","isPurchased","take","toArray","forEach","m","markerInfo","infoWindowContent","imageurl","heading","content","gMarker","Marker","icon","marker","setContent","open","renderMarker","err","handleGeneralError","trigger","module","exports","React","ReactDOM","numeral","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","call","amdO","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","getPrototypeOf","obj","__proto__","t","value","mode","this","then","ns","create","def","current","indexOf","getOwnPropertyNames","definition","o","defineProperty","enumerable","get","g","globalThis","Function","prop","prototype","hasOwnProperty","Symbol","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","self","bind","nc","__webpack_exports__"],"sourceRoot":""}