1(self.webpackChunkwumdrop_web=self.webpackChunkwumdrop_web||[]).push([[8536],{46329(e,t,n){"use strict";n.d(t,{A:()=>k});var o=n(80296),r=n(89379),l=n(76998),s=n(89705),i=n(51895);const a=e=>{let t=[];for(let n=0;n<e.length;n++)t.push({lat:e[n].lat,lng:e[n].lon});return t};var c=n(12275),u=n(79336),d=n(89376),p=n(52407);class g extends l.Component{constructor(e,t){super(e),this.map=e.mapContext,this.controlDiv=document.createElement("div"),this.map.controls[e.position].push(this.controlDiv)}componentWillUnmount(){var e,t;if(null===(e=this.map)||void 0===e||null===(t=e.controls)||void 0===t||!t[this.props.position]||!this.controlDiv)return;const n=this.map.controls[this.props.position],o="function"===typeof n.getLength?n.getLength():n.length;for(let l=0;l<o;l++){if(("function"===typeof n.getAt?n.getAt(l):n[l])===this.controlDiv){try{n.removeAt(l)}catch(r){}break}}}render(){const e=this.props.className;return e&&this.controlDiv.classList.add(e),(0,p.createPortal)(this.props.children,this.controlDiv)}}g.defaultProps={children:[],className:""};var h=n(23446);const m={container:{background:"#fff",border:"1px solid #dadce0",borderRadius:"2px",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",margin:"8px",padding:0,display:"flex",alignItems:"center"},button:{border:"none",padding:0,cursor:"pointer",width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center"}};function f(e){let t=e.onPolygonComplete,n=e.polygonOptions,i=void 0===n?{}:n,a=e.useMapControl,c=void 0===a||a,u=e.controlPosition,d=e.minPoints,p=void 0===d?3:d;const f=(0,s.ko)(),y=(0,l.useState)(!1),v=(0,o.A)(y,2),w=v[0],x=v[1],b=(0,l.useRef)(!1),k=(0,l.useRef)([]),C=(0,l.useRef)(null),L=(0,l.useRef)(null),j=(0,l.useRef)(null),M=(0,l.useRef)(null),A=(0,l.useRef)(null),P=(0,l.useRef)(t),E=(0,l.useRef)(i),R="undefined"!==typeof window?window.google:null;(0,l.useEffect)(()=>{P.current=t,E.current=i},[t,i]);const T=(0,l.useCallback)(()=>{if(!R)return;const e=R.maps;j.current&&(e.event.removeListener(j.current),j.current=null),M.current&&(e.event.removeListener(M.current),M.current=null),C.current&&(C.current.setMap(null),C.current=null),L.current&&(L.current.setMap(null),L.current=null)},[R]),D=(0,l.useCallback)(e=>{var t;if(!f||!R||!b.current)return;b.current=!1,x(!1),f.setOptions({disableDoubleClickZoom:null!==(t=A.current)&&void 0!==t&&t});const n=k.current;if(T(),e&&n.length>=p){const e=new R.maps.Polygon((0,r.A)({paths:n},E.current));if(P.current){const t=e.getPath().getArray().map(e=>({lat:e.lat(),lng:e.lng()}));P.current(e,t)}}k.current=[]},[f,R,T,p]),O=(0,l.useCallback)((e,t)=>{var n;if(!e)return null;const o=Math.floor(t),r=Math.pow(2,o),l=e.getNorthEast(),s=e.getSouthWest
1();try{const e=f.getProjection();if(e){const t=e.fromLatLngToPoint(l),n=e.fromLatLngToPoint(s);return{type:"world",threshold:Math.min(Math.abs(t.x-n.x),Math.abs(t.y-n.y))/r,projection:e}}}catch(i){}if(null!==(n=R.maps.geometry)&&void 0!==n&&n.spherical)try{return{type:"distance",threshold:R.maps.geometry.spherical.computeDistanceBetween(l,s)/r}}catch(a){}return{type:"latlng",threshold:Math.min(Math.abs(l.lat()-s.lat()),Math.abs(l.lng()-s.lng()))/r}},[f,R]),B=(0,l.useCallback)(e=>{if(!b.current||!R||!f)return;const t=e.latLng;if(k.current.length>=p){const o=k.current[0],r=f.getBounds(),l=f.getZoom(),s=O(r,l);if(s){let r=!1;if("world"===s.type&&s.projection)try{const e=s.projection.fromLatLngToPoint(o),n=s.projection.fromLatLngToPoint(t);r=Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))<s.threshold}catch(n){}else if("distance"===s.type)try{r=R.maps.geometry.spherical.computeDistanceBetween(o,t)<s.threshold}catch(e){}else if("latlng"===s.type){const e=Math.abs(t.lat()-o.lat()),n=Math.abs(t.lng()-o.lng());r=e<s.threshold&&n<s.threshold}if(r)return void D(!0)}}k.current.push(t),C.current&&C.current.setPath(k.current),L.current&&k.current.length>=p&&L.current.setPath(k.current)},[D,R,f,p,O]),S=(0,l.useCallback)(()=>{D(!0)},[D]),I=(0,l.useCallback)(()=>{var e,t,n;if(!f||!R||b.current)return;b.current=!0,x(!0),k.current=[],A.current=f.get("disableDoubleClickZoom"),f.setOptions({disableDoubleClickZoom:!0});const o=E.current;C.current=new R.maps.Polyline({map:f,path:[],clickable:!1,strokeColor:o.strokeColor||"#1a73e8",strokeOpacity:null!==(e=o.strokeOpacity)&&void 0!==e?e:1,strokeWeight:null!==(t=o.strokeWeight)&&void 0!==t?t:2}),L.current=new R.maps.Polygon({map:f,paths:[],clickable:!1,fillColor:o.fillColor||"#1a73e8",fillOpacity:null!==(n=o.fillOpacity)&&void 0!==n?n:.2,strokeOpacity:0}),j.current=f.addListener("click",B),M.current=f.addListener("dblclick",S)},[f,R,B,S]),N=(0,l.useCallback)(()=>{w?D(!0):I()},[w,D,I]),_=(0,l.useCallback)(e=>{e.currentTarget.style.background="#f1f3f4"},[]),Z=(0,l.useCallback)(e=>{const t="Draw polygon"===e.currentTarget.getAttribute("aria-label");e.currentTarget.style.background=t&&w?"#e8f0fe":"transparent"},[w]);(0,l.useEffect)(()=>()=>{b.current?D(!1):T()},[D,T]);const W=(0,l.useMemo)(()=>w?"#1a73e8":"#5f6368",[w]),F=(0,l.useMemo)(()=>w?"#e8f0fe":"transparent",[w]),H=(0,l.useMemo)(()=>(0,h.jsx)("div",{style:m.container,children:(0,h.jsx)("button",{"aria-label":"Draw polygon",title:"Draw polygon",onClick:N,onMouseEnter:_,onMouseLeave:Z,style:(0,r.A)((0,r.A)({},m.button),{},{background:F}),children:(0,h.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("polygon",{points:"6,4 18,7 16,18 5,15",fill:"none",stroke:W,strokeWidth:"1.5"}),(0,h.jsx)("circle",{cx:"6",cy:"4",r:"1.5",fill:W}),(0,h.jsx)("circle",{cx:"18",cy:"7",r:"1.5",fill:W}),(0,h.jsx)("circle",{cx:"16",cy:"18",r:"1.5",fill:W}),(0,h.jsx)("circle",{cx:"5",cy:"15",r:"1.5",fill:W})]})})}),[W,F,N,_,Z]);if(!f||!R)return null;if(c){const e=u||R.maps.ControlPosition.TOP_RIGHT;return(0,h.jsx)(g,{position:e,mapContext:f,children:H})}return H}const y={border:"1px solid transparent",width:"100%",maxWidth:"640px",height:"32px",padding:"0 12px",borderRadius:"3px",boxShadow:"0 2px 6px rgba(165, 161, 161, 0.3)",fontSize:"14px",outline:"none"},v=(e,t,n,o)=>{var r;if(!e||null===(r=window.google)||void 0===r||!r.maps)return;const l=((e,t)=>{let n=e;if(null!==t&&void 0!==t&&t.length){const o=e.filter(e=>{var n;return t.includes(e.id)&&(null===(n=e.coordinates)||void 0===n?void 0:n.length)});o.length&&(n=o)}let o=new window.google.maps.LatLngBounds;if(n.forEach(e=>{var t;null!==(t=e.coordinates)&&void 0!==t&&t.length&&a(e.coordinates).forEach(e=>o.extend(e))}),o.isEmpty()){let e=new google.maps.LatLng(-34.834,16.45),t=new google.maps.LatLng(-22.126,32.83);o=new google.maps.LatLngBounds(e,t)}return o})(t,n);if(!l||l.isEmpty())return;const s=(null===n||void 0===n?void 0:n.length)&&t.some(e=>{var t;return n.includes(e.id)&&(null===(t=e.coordinates)||void 0===t?void 0:t.length)});e.fitBounds(l,48),window.google.maps.event.addListenerOnce(e,"idle",()=>{const t=e.getZoom();o?s&&(t<i.j6?e.setZoom(i.j6):t>i.w$&&e.setZoom(i.w$)):t>i.kn&&e.setZoom(i.kn)})},w=e=>{let t=e.onPlacesChanged,n=e.placeholder,o=e.style;const i=(0,s.ko)(),a=(0,s.ST)("places"),c=(0,l.useRef)(null),u=(0,l.useRef)(null),d=(0,l.useRef)(!1);(0,l.useEffect)(()=>{var e,n;if(!i||!c.current||!a||null===(e=window.google)||void 0===e||null===(n=e.maps)||void 0===n||!n.places)return;if(!d.current){const e=console.warn;console.warn=function(){for(var t,n,o=arguments.length,r=new Array(o),l=0;l<o;l++)r[l]=arguments[l];null!==(t=r[0])&&void 0!==t&&null!==(n=t.includes)&&void 0!==n&&n.call(t,"google.maps.places.Autocomplete is not available")||e.a
1pply(console,r)},d.current=!0}const o=new window.google.maps.places.Autocomplete(c.current,{fields:["geometry","name"]});u.current=o,o.bindTo("bounds",i);return o.addListener("place_changed",()=>{const e=o.getPlace();if(null!==e&&void 0!==e&&e.geometry){const n=new window.google.maps.LatLngBounds;e.geometry.viewport?n.union(e.geometry.viewport):e.geometry.location&&n.extend(e.geometry.location),n.isEmpty()||i.fitBounds(n),null===t||void 0===t||t([e])}}),()=>{u.current&&(window.google.maps.event.clearInstanceListeners(u.current),u.current=null)}},[i,a,t]);const p=(0,l.useCallback)(e=>{e.target.style.outline="none",e.target.style.boxShadow="none"},[]);return(0,h.jsx)("input",{ref:c,type:"text",placeholder:n,style:(0,r.A)((0,r.A)({},o),{},{outline:"none"}),onFocus:p})},x=e=>{let t=e.path,n=e.options,o=e.draggable,i=e.clickable,a=void 0===i||i,c=e.onMouseUp;const u=(0,s.ko)(),d=(0,l.useRef)(null),p=(0,l.useRef)(n);return(0,l.useEffect)(()=>{p.current=n},[n]),(0,l.useEffect)(()=>{if(!u||!t)return;const e=new window.google.maps.Polygon((0,r.A)((0,r.A)({paths:t},p.current),{},{draggable:o,clickable:a}));return e.setMap(u),d.current=e,c&&window.google.maps.event.addListener(e,"mouseup",c),()=>{d.current&&(window.google.maps.event.clearInstanceListeners(d.current),d.current.setMap(null))}},[u,t,o,a,c]),null},b=e=>{let t=e.onMapLoad;const n=(0,s.ko)();return(0,l.useEffect)(()=>{n&&t&&t(n)},[n,t]),null},k=e=>{let t=e.polygons,n=e.drawingManager,p=e.drawingControl,m=e.areaId,k=e.onPolygonComplete,C=e.handleSearchPolygonChanged,L=e.isNational,j=e.isDrawable,M=e.mapContainerStyle,A=e.autoFitPolygons,P=void 0===A||A;const E=(0,l.useState)(null),R=(0,o.A)(E,2),T=R[0],D=R[1],O=(0,l.useMemo)(()=>(0,c.z)(),[]),B=(0,l.useMemo)(()=>O.REACT_APP_GOOGLE_MAP_ID,[O]),S=n||p,I=(0,l.useCallback)(e=>{null!==e&&void 0!==e&&e.length&&(null===C||void 0===C||C(e[0].name))},[C]),N=(0,l.useCallback)(()=>{v(T,t,m,S)},[T,t,m,S]),_=(0,l.useCallback)(e=>e.isHighRisk?i.NS:L&&i.k0[e.territoryName]?(0,r.A)((0,r.A)({},i.k0[e.territoryName]),{},{fillOpacity:.5,strokeOpacity:1,strokeWeight:2.5,draggable:!1,editable:!1}):m.includes(e.id)?i.Q9:i.Bl,[m,L]),Z=(0,l.useMemo)(()=>t.map((e,t)=>{var n,o,r;if(null===(n=e.coordinates)||void 0===n||!n.length)return null;const c=a(e.coordinates),u=m.includes(e.id),d=(e=>{var t,n;if(null===(t=window.google)||void 0===t||null===(n=t.maps)||void 0===n||!n.LatLngBounds)return{lat:0,lng:0};const o=new window.google.maps.LatLngBounds;e.forEach(e=>o.extend(e));const r=o.getCenter();return{lat:r.lat(),lng:r.lng()}})(c),p=(u||L)&&(e.areaName||e.territoryName)?(0,h.jsx)(s.Fu,{position:d,children:(0,h.jsx)("div",{style:{color:i.sv,fontWeight:500},children:e.areaName||e.territoryName})},"info-".concat(null!==(o=e.id)&&void 0!==o?o:t)):null;return(0,h.jsxs)(l.Fragment,{children:[(0,h.jsx)(x,{path:c,options:_(e),draggable:j,clickable:!S||u,onMouseUp:j?k:void 0}),p]},"frag-".concat(null!==(r=e.id)&&void 0!==r?r:t))}),[t,m,L,j,S,k,_]),W=(0,l.useMemo)(()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=null!==t&&void 0!==t&&t.length?t.slice().sort((e,t)=>e-t).join(","):"all",o=e.map(e=>"".concat(e.id,":").concat(e.placeId||"")).sort().join("|");return"".concat(n,"::").concat(o)}(t,m),[t,m]);(0,l.useEffect)(()=>{if(!T||!P)return;const e=window.setTimeout(()=>{v(T,t,m,S)},0);return()=>window.clearTimeout(e)},[T,m,S,P,W]);const F=(0,l.useMemo)(()=>(0,r.A)((0,r.A)({},M||{width:"100%",height:"100%"}),{},{position:"relative"}),[M]);return(0,h.jsx)("div",{style:F,children:(0,h.jsxs)(s.T5,{mapId:B,defaultCenter:i.tV,defaultZoom:S?i.j6:i.kn,gestureHandling:"greedy",options:{disableDefaultUI:!0,mapTypeControl:!1,streetViewControl:!1},children:[(0,h.jsx)(b,{onMapLoad:D}),T&&(0,h.jsx)(g,{position:window.google.maps.ControlPosition.TOP_RIGHT,mapContext:T,children:(0,h.jsx)("div",{style:{marginRight:S?"60px":0},children:(0,h.jsx)(u.A,{sx:{m:1,background:"white"},color:"primary",size:"small",onClick:N,children:(0,h.jsx)(d.A,{})})})}),S&&T&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(g,{position:window.google.maps.ControlPosition.TOP_LEFT,mapContext:T,children:(0,h.jsx)("div",{style:{padding:"0 15px",width:"min(640px, 63vw)"},children:(0,h.jsx)(w,{onPlacesChanged:I,placeholder:"Search for a location to draw a polygon...",style:y})})}),(0,h.jsx)(f,{onPolygonComplete:k,polygonOptions:i.pg})]}),Z]})})}},88916(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(37186),r=n.n(o),l=n(21770),s=n(5e4);function i(e){try{const t=r().enc.Base64.parse(s._),n=r().enc.Base64.parse(s.IV),o=r().AES.decrypt(e,t,{iv:n,mode:r().mode.CBC,padding:r().pad.Pkcs7}),i=r().enc.Utf8.stringify(o);if(!i)throw new Error("Decryption resulted in an empty string");const a=Uint8Array.from(atob(i),e=>
1e.charCodeAt(0)),c=l.Ay.inflate(a,{to:"string"});return JSON.parse(c)}catch(t){return console.error("Decryption or decompression failed:",t),null}}},89376(e,t,n){"use strict";n.d(t,{A:()=>l});var o=n(64172),r=n(23446);const l=(0,o.A)((0,r.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"}),"GpsFixed")},50477(){}}]); 2//# sourceMappingURL=8536.5db8503e.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.