"use strict";(self.webpackChunkspd_widget=self.webpackChunkspd_widget||[]).push([[164,384],{490:(t,n,e)=>{e.r(n),e.d(n,{default:()=>f});var r=e(1413),o=e(9094),i=e(108),a=e(493),u=e(1707);function l(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,i,a,u=[],l=!0,c=!1;try{if(i=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=i.call(e)).done)&&(u.push(r.value),u.length!==n);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,n)||function(t,n){if(t){if("string"==typeof t)return c(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e{e.r(n),e.d(n,{PickupMapContext:()=>f,default:()=>s});var r=e(1413),o=e(9094),i=e(9607);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(t,n,e){return(n=function(t){var n=function(t,n){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==a(n)?n:n+""}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function l(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,i,a,u=[],l=!0,c=!1;try{if(i=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=i.call(e)).done)&&(u.push(r.value),u.length!==n);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,n)||function(t,n){if(t){if("string"==typeof t)return c(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e1&&void 0!==arguments[1])||arguments[1];p&&c&&(p.setCenter(t.getPosition()),p.setZoom(12),y((function(t){return t.map((function(t){return t.setIcon(A(!1)),t}))})),r&&(null===(n=document.getElementById("location_"+t.locationId))||void 0===n||n.focus()),t.setIcon(A(!0)),s(null==e?void 0:e.find((function(n){return n.id===t.locationId}))))}),[p,c]),A=function(t){return{url:t?"https://zapiet.s3.amazonaws.com/assets/redmapicon.png":"https://zapiet.s3.amazonaws.com/assets/whitemapicon.png",size:new google.maps.Size(44,80),anchor:new google.maps.Point(20,22),labelOrigin:new google.maps.Point(11,12),scaledSize:new google.maps.Size(22,40)}},j=function(t){return e?e.length-t:0},z=function(t){return String(t)},I=function(t){var n=v.find((function(n){return n.locationId===t.id}));n&&S(n)};return(0,o.vJ)((function(){p&&(h(),window.addEventListener("resize",(function(){if(p){var t=p.getCenter();google.maps.event.trigger(p,"resize"),p.setCenter(t)}})))}),[p]),(0,o.vJ)((function(){p&&h()}),[a]),(0,o.vJ)((function(){c&&I(c)}),[null==c?void 0:c.id]),(0,o.vJ)((function(){v.forEach((function(t){google.maps.event.clearListeners(t,"click"),b((function(n){return Object.assign(Object.assign({},n),u({},t.locationId,google.maps.event.addListener(t,"click",(function(){return S(t)}))))}))}))}),[S]),(0,r.Y)(f.Provider,{value:{updateMapMarker:I,setMap:g},children:t.children})}}}]);