1"use strict";(self.webpackChunkone_web=self.webpackChunkone_web||[]).push([[6771],{98451:(e,t,o)=>{o.d(t,{q:()=>Z,oK:()=>H,H:()=>ce,clearSearch:()=>N,n$:()=>he,Kg:()=>ae,l4:()=>ne,Jw:()=>te,Zr:()=>ue,MG:()=>se,HQ:()=>re,AY:()=>pe,sV:()=>le,subscribeSearchRouteTrayToMapPolling:()=>B,c6:()=>J,Kh:()=>de});var i=o(52114),s=o(61531),r=o(94857),a=o(67896),n=o.n(a),l=o(30836),c=o(33655),p=o(7007),d=o(79233),u=o(78417),h=o(67077),g=o(29785),m=o(52850),y=o(26200),f=o(26001),v=o(18211),w=o(10388),M=o(30191),b=o(80027),T=o(22493),S=o(88014),E=o(5776),L=o(97474),I=o(62239),R=o(56188),_=o(31395),x=o(95050),A=o(46339),O=o(87190),C=o(25447),P=o(42791),$=o(97966),V=o(72357),k=o(66003),F=o(78707);const H="crc:search:originInput:focus",Z="crc:search:destInput:focus",D="route-search-geometry",U="route-search-geometry-history";let z="";const N=()=>{z=""},j=(0,s.A)((async(e,t)=>{let o=t().search.directionsGeometry;if(!o)return void console.warn("SearchRoute query called with no geometry given in app state.");if("LineString"===o.type&&(o={type:"MultiLineString",coordinates:[o.coordinates]}),"MultiLineString"===o.type&&JSON.stringify(o.coordinates)?.length>2e5){const e=(0,c.C)({type:"MultiLineString",coordinates:o.coordinates},{tolerance:25e-5/o.coordinates.length});o.coordinates=e.coordinates}if(JSON.stringify({geometry:o,layers:(0,M.LR)(t().app.activeLayers)})===z)return;z=JSON.stringify({geometry:o,layers:(0,M.LR)(t().app.activeLayers)}),setTimeout((()=>{z=""}),1500),setTimeout((async()=>{const{search:e}=t();if(null==e.directionsGeometry)return;let o="";o=null!=e.originPlace?.placeId&&null!=e.destPlace?.placeId?e.originPlace.placeId+e.destPlace.placeId:JSON.stringify(e.directionsGeometry);const i=await async function(e){const t=(new TextEncoder).encode(e),o=await window.crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(o)).map((e=>e.toString(16).padStart(2,"0"))).join("")}(o),s={hash:i,geometry:e.directionsGeometry},r=JSON.stringify(s),a=sessionStorage.getItem(D),n=sessionStorage.getItem(U);if(sessionStorage.setItem(D,r),null==a)sessionStorage.removeItem(U);else if(null==n)sessionStorage.setItem(D,r),sessionStorage.setItem(U,`[${a}]`);else{const e=JSON.parse(n);if(e.some((e=>e.hash===i)))return;const t=[...e,s];t.length>50&&t.shift();const o=JSON.stringify(t);sessionStorage.setItem(U,o)}}),0);const s=e=>({query:T.A` 2 query SearchGeometry( 3 $geometry: Geometry! 4 $layerSlugs: [String!]! 5 $viewLimit: Int! 6 $isCamerasEnabled: Boolean! 7 $showCommercialQuantities: Boolean! 8 ) { 9 searchGeometryQuery(geometry: $geometry, layerSlugs: $layerSlugs) { 10 cameraViews { 11 ...CameraViewContents 12 } 13 results { 14 ...SearchResults 15 } 16 error { 17 message 18 type 19 } 20 } 21 } 22 ${E.A.cameraViewContents} 23 ${E.A.searchResults} 24 `,variables:{geometry:(0,f.A)(e),layerSlugs:(0,M.LR)(t().app.activeLayers),viewLimit:m.az4,isCamerasEnabled:!!b.mc,showCommercialQuantities:(0,C.hf)(t(),b.UB,b.JM)}});let a;if("MultiLineString"===o.type){const e=o.coordinates.map((e=>({type:"LineString",coordinates:e}))).map(s),t=await Promise.all(e.map((e=>(0,V.A)(e,"POST")))),i=new Set,r=new Set;a=t.reduce(((e,t)=>{const o=e.searchGeometryQuery;return t?.searchGeometryQuery?.cameraViews.length&&t.searchGeometryQuery.cameraViews.forEach((e=>{if(null!=e){const t=e.url??e.uri;i.has(t)||(o.cameraViews.push(e),i.add(t))}})),null!=t?.searchGeometryQuery?.error?.message&&""!==t.searchGeometryQuery.error.message.trim()&&(null==o.error?o.error=t.searchGeometryQuery.error:o.error.message+=`; ${t.searchGeometryQuery.error.message.trim()}`),t?.searchGeometryQuery?.results.length&&t.searchGeometryQuery.results.forEach((e=>{if(null!=e){const t=e.uri;r.has(t)||(o.results.push(e),r.add(t))}})),e}),{searchGeometryQuery:{__typename:"SearchResult",cameraViews:[],error:null,results:[]}})}else{const e=s(o);a=await(0,V.A)(e,"POST")}if(!a.searchGeometryQuery)return;const n=t().search.directionsGeometry,l=a.searchGeometryQuery.results,u=[];l.forEach((e=>{const t=e?.features?.find((e=>"Point"===e?.geometry?.type));if(t){if(n&&"Point"===t.geometry.type){let o;if("LineString"===n.type)o={type:"Feature",geometry:{type:"MultiLineString",coordinates:[n.coordinates]},properties:{}};else{if("MultiLineString"!==n.type)return;o={type:"Feature",geometry:{type:"MultiLineString",coordinates:n.coordinates},properties:{}}}const i=(0,p.zx)(t.geometry.coordinates),s=(0,d.W)(o,i),r=b.hC.routeSearchEventBufferKM?b.hC.routeSearchEventBufferKM:.05;e&&s.properties.dist&&s.properties.dist<r&&u.push(e)}}else e&&u.push(e)}));try{const o=(0,i.S8)(u,[y.cI]),s=(0,i.S8)(a.searchGeometryQuery.cameraViews,[y.Ht]),{urlFrom:n,urlTo:l,urlWaypts:c,mode:p}=t().search,d=(0,L.A)(n,l,c,p);if(t().tray.activeUri!==t().tray.visibleUri||t().tray.isLoading){const o=(0,x.z1)(t());if(o){const i=(0,A.A)(o,(0,C.tV)(t()),t().map.mapPosition,_.YL,{maxZoom:b.VV.defaultMarkerZoom});e((0,O.b1)(i))}}e({type:m.JBx,visibleUri:`${S.UN.SEARCH_ROUTE}/${d}`,visibleView:S.UN.SEARCH_ROUTE}),e({type:m.MA8,results:o.result,cameraViews:s.result,error:a.searchGeometryQuery.error,entities:(0,r.A)(s.entities,o.entities)})}catch(t){console.error(t),e({type:m.dPK,error:{type:m.i65.INTERNAL_SERVER_ERROR}})}}),100),W=()=>(e,t)=>{e({type:m._T2}),j(e,t)},G=e=>e=>{},B=()=>{$.GS.subscribe(m.Vzk.TRAY,W),$.Rt.subscribe(m.Vzk.TRAY,G)},J=()=>{$.GS.has(m.Vzk.TRAY,W)&&$.GS.unsubscribe(m.Vzk.TRAY),$.Rt.has(m.Vzk.TRAY,G)&&$.Rt.unsubscribe(m.Vzk.TRAY)},q=e=>{const t=e.routes[0];
24return e.routes.forEach(((e,o)=>{0!==o&&t.legs.push(...e.legs)})),{type:"MultiLineString",coordinates:e.routes[0].legs.map((e=>e.steps.map((e=>e.path.map((e=>[e.lng(),e.lat()])))))).reduce(((e,t)=>e.concat(Array.isArray(t)?[...t]:t)),[])}},Q=new google.maps.Geocoder,Y=async e=>{let t=null;return await Q.geocode({address:e},((e,o)=>{o===google.maps.GeocoderStatus.OK&&e&&(t=e[0].geometry.location.toJSON())})),t},K=new google.maps.DirectionsService;let X=[],ee=!1;const te=(e,t,o,i,s={updateResults:!0})=>async(r,a)=>{if("string"==typeof e&&"string"==typeof t&&(X.push(`${e.toString()}${t.toString()}`),setTimeout((()=>{X=X.filter((o=>o!==`${e.toString()}${t.toString()}`))}),6e4)),X.length>b.DR.routeSearchRPM)return r({type:m.j2Q,error:{type:"Error",message:"You have reached your maximum number of searches. Please try again soon."}}),null;const l={updateResults:!0,forcePoll:!1,...s};let c=[...i];const g={first:[],last:[]};let y=e;"string"==typeof e&&(y=await Y(e));let f=t;if("string"==typeof t&&(f=await Y(t)),ee)return null;ee=!0,setTimeout((()=>{ee=!1}),1e3);const v=[],M=[];let T,S=[],E=[],L=0;const I=async(e,t)=>{let s=e;const l=e.location;null!=l&&(s={lat:"function"==typeof l.lat?l.lat():l.lat,lng:"function"==typeof l.lng?l.lng():l.lng});let R=t;const _=t.location;null!=_&&(R={lat:"function"==typeof _.lat?_.lat():_.lat,lng:"function"==typeof _.lng?_.lng():_.lng});const x=await(async(e,t)=>{if(!M.includes(t)&&y&&f&&b.DR.endpoints.osrm&&o===google.maps.TravelMode.DRIVING){M.push(t);try{let o=[];const i=new AbortController;setTimeout((()=>i.abort()),5e3);const s=c.map((e=>`${e.lng.toFixed(5)},${e.lat.toFixed(5)}`)),r=s.length?`${s.join(";").toString()};`:"",a=await fetch(`${b.DR.endpoints.osrm}/route/v1/driving/${e.lng.toFixed(5)},${e.lat.toFixed(5)};${r}${t.lng.toFixed(5)},${t.lat.toFixed(5)}?overview=full&steps=true`,{signal:i.signal}),l=await a.json();if(l?.routes?.length){const i=n().decode(l.routes?.[0]?.geometry);!0===b.VV.showOSRMRoute&&v.push([...i.map((e=>[e[1],e[0]]))]);let s=0;const r=async()=>{s<=5&&0===w.Ay.getState().map.mapCollections.length&&(await new Promise((e=>{setTimeout(e,1e3)})),s+=1,await r())};let a;await r();const y=[];w.Ay.getState().map.mapCollections?.forEach((e=>{e?.features?.[0]?.properties?.clustered?.length?e?.features?.[0]?.properties?.clustered?.forEach((e=>{e.uri.includes("event")&&(e.features[0]&&(e.features[0].collectionType=m.Tgm.Event),y.push(e))})):e&&y.push(e)})),y.forEach((e=>{!e||"Event"!==e.features?.[0]?.collectionType||"Point"!==e.features?.[0]?.geometry.type||e.features?.[0]?.properties?.icon?.url?.toLowerCase().includes("future")||e.features?.[0]?.properties?.tooltip?.toLowerCase()?.startsWith("starts")||i.forEach(((t,o)=>{if(o+2>i.length||a)return;const s=i[o],r=i[o+1],n={lat:e.features?.[0]?.geometry.coordinates[1],lng:e.features?.[0]?.geometry.coordinates[0]};if(n&&"number"==typeof n.lat&&"number"==typeof n.lng){const t=(0,p.wi)([[s[1],s[0]],[r[1],r[0]]]),i=(0,p.zx)([n.lng,n.lat]),l=(0,d.W)(t,i);l.properties.dist&&l.properties.dist<.008&&(a={feat:e,leg:o})}}))}));let f=[];if(void 0!==a&&a?.feat&&a.feat?.features.length>1){let e=!1;const t=a.feat.features?.filter((t=>{if("LineString"===t?.geometry.type&&!1===t.properties.visible&&t.properties.icons?.length){let o=1/0,s=1/0,r=0,a=0,n=0,l=0,c=!1;return i.forEach(((e,c)=>{if(c+2>i.length)return;const p=i[c],d=i[c+1],g=(t.geometry.coordinates?.[0])[1],m=(t.geometry.coordinates?.[0])[0],y=(t.geometry.coordinates?.[t.geometry.coordinates.length-1])[1],f=(t.geometry.coordinates?.[t.geometry.coordinates.length-1])[0],v={type:"Feature",geometry:{type:"LineString",coordinates:[p.reverse(),d.reverse()]},properties:{}},w=(0,u.B)(v),M=w/50;let b=0;const T=[];for(;b<=w;)b+=M,T.push((0,h.Q)(v,b));T.forEach(((e,t)=>{const i=Math.sqrt((m-e.geometry.coordinates[0])**2+(g-e.geometry.coordinates[1])**2),p=Math.sqrt((f-e.geometry.coordinates[0])**2+(y-e.geometry.coordinates[1])**2);i<o&&(o=i,r=c,a=t),p<s&&(s=p,n=c,l=t)}))})),2===t?.properties?.icons?.length?((r>=n||r===n&&a>l)&&(e=!0),c=!0):(r<=n||r===n&&a<l)&&(c=!0),c}return!1}));if(t.length&&t[0]){const i=e?t?.[0]?.geometry.coordinates.reverse():t?.[0]?.geometry.coordinates;f=i,i&&i.length>1&&(o=[i[0],i[i.length-1]])}}
24if(o?.length)return c.forEach((i=>{const s=(0,p.wi)([[e.lng,e.lat],[o?.[0]?.[0],o?.[0]?.[1]]]),r=(0,p.wi)([[o?.[1]?.[0],o?.[1]?.[1]],[t.lng,t.lat]]),a=(0,p.zx)([i.lng,i.lat]),n=(0,d.W)(s,a),l=(0,d.W)(r,a);n.properties.dist&&l.properties.dist&&n.properties.dist<=l.properties.dist?(g.first.push(i),c=c.filter((e=>e!==i))):(g.last.push(i),c=c.filter((e=>e!==i)))})),{detourStart:{lat:o?.[0]?.[1],lng:o?.[0]?.[0]},detourEnd:{lat:o?.[1]?.[1],lng:o?.[1]?.[0]},detourGeo:f}}}catch(e){}}return{detourStart:null,detourEnd:null,detourGeo:null}})(s,R);let A=[];0===g.first.length&&0===g.last.length?A=c.map((e=>({location:new google.maps.LatLng(e),stopover:!1}))):0===L?A=g.first.map((e=>({location:new google.maps.LatLng(e),stopover:!1}))):x.detourStart||(A=g.last.map((e=>({location:new google.maps.LatLng(e),stopover:!1}))));const O={origin:e?.location??e,destination:x?.detourStart??t?.location??t,waypoints:A||[],travelMode:o,unitSystem:google.maps.UnitSystem.IMPERIAL};L++;const C=new Date;(a().search.withTravelTimes||i.length>10)&&(O.drivingOptions={departureTime:C});const P=C.getTime();r({type:m.lOD,directionsRequestTime:P});try{const e={...await K.route(O,((e,t)=>{(t!==google.maps.DirectionsStatus.OK||!e||e.routes.length<1)&&r({type:m.YHj,status:t})}))};if(!e)return null;T||(T=e),S=[...S,...e.routes],e.geocoded_waypoints&&(E=[...E,...e.geocoded_waypoints]),x?.detourStart&&x?.detourEnd&&x?.detourGeo&&(v.push(x.detourGeo),await I(x.detourEnd,f))}catch{return null}return null};return await I(y,f),setTimeout((()=>{w.Ay.dispatch((0,F.gX)())}),500),T?(T.routes=[...S],T.geocoded_waypoints=[...E],T.waypoints=[...c],T.crcOptions=l,T.detours=v,r({type:m.Rqj,directionsResponse:{...T,detours:v,routes:S,geocoded_waypoints:E,time:Date.now()}}),T):null},oe=async e=>{const{results:t}=await Q.geocode({location:e});if(t?.[0])return{text:t[0].formatted_address,location:t[0].geometry.location.toJSON(),viewport:t[0].geometry.viewport.toJSON(),isLoading:!1,placeId:t[0].place_id};console.error("Could not reverse geocode location")};async function ie(e){if(null==b.VV.googleKey)throw new Error("Google API key not set");const t={points:`${e.lat},${e.lng}`,key:b.VV.googleKey},o=`https://roads.googleapis.com/v1/nearestRoads?${Object.entries(t).map((([e,t])=>`${e}=${encodeURIComponent(t)}`)).join("&")}`,i=await fetch(o);if(i.ok){const e=await i.json();if(!e?.snappedPoints?.[0])return;const t=await l.A.getMap(),o=new google.maps.places.PlacesService(t),s={placeId:e.snappedPoints[0].placeId},r=await new Promise((e=>{o.getDetails(s,((t,o)=>{e(o===google.maps.places.PlacesServiceStatus.OK&&null!=t?t:void 0)}))}));return null==r?void console.error("Could not determine nearest road details"):{text:r.formatted_address,location:{lat:e.snappedPoints[0].location.latitude,lng:e.snappedPoints[0].location.longitude},viewport:r.geometry?.viewport?.toJSON(),isLoading:!1,placeId:e.snappedPoints[0].placeId}}}const se=(e,t=!1)=>async(o,i)=>{const{destPlace:s,destChosen:r,directionsWaypts:a,mode:n}=i().search;let l;if(o({type:m.T96,location:e,isDragging:!1}),b.hC.roadSnappingEnabled){const[i,c]=await Promise.all([oe(e),ie(e)]);if(null==i&&null!=c)l=c;else if(null!=i&&null==c)l=i;else if(null!=i&&null!=c){const t=[e.lng,e.lat],o=[c.location.lng,c.location.lat];l=(0,g.I)(t,o,{units:"meters"})<(b.hC.roadSnappingBufferMeters??5)?c:i}if(s&&r&&!t){const t=await o(te(l||e,s,n,a));if(t&&null==l){const e=t.routes[0].legs[0];l={text:e.start_address,viewport:null,location:e.start_location.toJSON(),isLoading:!1}}}return o({type:m.izv,place:l}),l}if(s&&r&&!t){const t=await o(te(e,s.location,n,a));if(t){const e=t.routes[0].legs[0];l={text:e.start_address,viewport:null,location:e.start_location.toJSON(),isLoading:!1}}}return l||(l=await oe(e)),o({type:m.izv,place:l}),l},re=e=>async(t,o)=>{const{destPlace:i,destChosen:s,directionsWaypts:r,mode:a}=o().search;t({type:m.Za9}),i&&s&&await t(te(e.location,i.location,a,r))},ae=(e,t=!1)=>async(o,i)=>{const{originPlace:s,originChosen:r,directionsWaypts:a,mode:n}=i().search;let l;if(o({type:m.jGZ,location:e,isDragging:!1}),b.hC.roadSnappingEnabled){const[i,c]=await Promise.all([oe(e),ie(e)]);if(null==i&&null!=c)l=c;else if(null!=i&&null==c)l=i;else if(null!=i&&null!=c){const t=[e.lng,e.lat],o=[c.location.lng,c.location.lat];l=(0,g.I)(t,o,{units:"meters"})<(b.hC.roadSnappingBufferMeters??5)?c:i}
24if(s&&r&&!t){const t=await o(te(s.location,e,n,a));if(t&&null==l){const e=t.routes[t.routes.length-1].legs[t.routes[t.routes.length-1].legs.length-1];l={text:e.start_address,viewport:null,location:e.end_location.toJSON(),isLoading:!1}}}return o({type:m.izv,place:l}),l}if(s&&r&&!t){const t=await o(te(s.location,e,n,a));if(t){const e=t.routes[t.routes.length-1].legs[t.routes[t.routes.length-1].legs.length-1];l={text:e.end_address,viewport:null,location:e.end_location.toJSON(),isLoading:!1}}}return l||(l=await oe(e)),o({type:m.SEh,place:l}),l},ne=e=>async(t,o)=>{const{originPlace:i,originChosen:s,directionsWaypts:r,mode:a}=o().search;t({type:m.RV5}),i&&s&&await t(te(i.location,e.location,a,r))},le=e=>async(t,o)=>{t({type:m.e72,mode:e});const{search:i}=o();i.type===m.nXf.SEARCH_ROUTE&&""!==i.urlFrom&&""!==i.urlTo&&await t((0,k.oo)((0,P.X)(i.urlFrom,i.urlTo,e,i.urlWaypts)))},ce=e=>(t,o)=>{const{originPlace:i,destPlace:s,mode:r,directionsWaypts:a}=o().search;if(!i||!s)throw new Error("Invalid search state");const n=[...a];return n.push(e),t({type:m.Nzv,directionsWaypts:[...new Set(n)]}),t(te(i.location,s.location,r,n))},pe=e=>(t,o)=>{const{originPlace:i,destPlace:s,mode:r,directionsWaypts:a}=o().search,n=a.filter((t=>t.lng!==e.lng||t.lat!==e.lat));if(!i||!s)throw new Error("Invalid search state");return t({type:m.Nzv,directionsWaypts:n}),t(te(i.location,s.location,r,n))},de=e=>async(t,o)=>{try{const{activeView:i}=o().tray,{mode:s,favoriteId:r}=o().search,a=[];e.routes.forEach((e=>a.push(...e.legs)));const n=e.routes[0].legs[0],l=e.routes[e.routes.length-1].legs[e.routes[e.routes.length-1].legs.length-1],c=a.reduce(((e,t)=>e.concat(t.via_waypoints.map((e=>({lng:(0,v.A)(e.lng()),lat:(0,v.A)(e.lat())}))))),[]),p={text:n.start_address,viewport:null,location:n.start_location.toJSON(),isLoading:!1},d={text:l.end_address,viewport:null,location:l.end_location.toJSON(),isLoading:!1};t({type:m.Smv,directionsResponse:e,directionsGeometry:q(e),directionsWaypts:c,originPlace:p,destPlace:d}),i===S.UN.SEARCH_ROUTE&&await t((0,k.oo)((0,P.X)(p.text,d.text,s,c,r)))}catch(e){console.warn(e)}},ue=e=>async(t,o)=>{t((0,I.C)(m.nXf.SEARCH_ROUTE));const i=await t(se(e));if(window.dispatchEvent((0,R.h)(H)),!i)return;const{destPlace:s,mode:r,directionsWaypts:a,favoriteId:n}=o().search,{activeView:l}=o().tray;s&&l!==S.UN.SEARCH_ROUTE&&await t((0,k.oo)((0,P.X)(i.text,s.text,r,a,n)))},he=e=>async(t,o)=>{t((0,I.C)(m.nXf.SEARCH_ROUTE));const i=await t(ae(e));if(!i)return;window.dispatchEvent((0,R.h)(Z));const{originPlace:s,mode:r,directionsWaypts:a,favoriteId:n}=o().search,{activeView:l}=o().tray;s&&l!==S.UN.SEARCH_ROUTE&&await t((0,k.oo)((0,P.X)(s.text,i.text,r,a,n)))}},30836:(e,t,o)=>{o.d(t,{W:()=>B,A:()=>J});var i=o(71413),s=o(52706),r=o(56599),a=o(61531),n=o(66003),l=o(63822),c=o(31972),p=o(70192),d=o(80027),u=o(52850),h=o(10388),g=o(18211),m=o(80480),y=o(5218),f=o(30555),v=o(52081),w=o(91098),M=(o(82890),o(38155)),b=o(32701),T=Object.defineProperty,S=Object.getOwnPropertyDescriptor,E=(e,t,o,i)=>{for(var s,r=i>1?void 0:i?S(t,o):t,a=e.length-1;a>=0;a--)(s=e[a])&&(r=(i?s(t,o,r):s(r))||r);return i&&r&&T(t,o,r),r};let L=class extends i.WF{constructor(){super(...arguments),this.visible=!1,this.tooltip="",this.views=[],this.viewIndex=0,this.isImagesUnavailable=!1,this.loaderActive=!1,this.imageElementRef=(0,M._)(),this.cameraUnavailableTimeoutId=0}static get styles(){return[b.A,v.A]}updated(e){if(e.has("views")&&(clearInterval(this.slideshowIntervalId),clearTimeout(this.cameraUnavailableTimeoutId),this.viewIndex=0,this.isImagesUnavailable=!1,null!=this.views&&null!=this.imageElementRef.value)){const e=this.views[this.viewIndex]?this.views[this.viewIndex].url:"";this.imageElementRef.value.src=e??"",this.loaderActive=!0,null!=d.mc?.unavailableCameraTimeoutMilliseconds&&(this.cameraUnavailableTimeoutId=window.setTimeout((()=>{this.isImagesUnavailable=!0}),d.mc.unavailableCameraTimeoutMilliseconds))}}render(){return this.views?.length?i.qy`<div id="tooltip" class="tooltip--camera" ?visible=${this.visible} role="tooltip"> 25 <p class="tooltip-title">${this.tooltip}</p> 26 <div class="tooltip-img-container"> 27 <spinning-loader 28 class="${(0,f.H)({"tooltip-loader":!0,active:this.loaderActive&&!this.isImagesUnavailable})}" 29 ></spinning-loader> 30 ${this.renderImage()} 31 </div> 32 ${this.renderIcons()} 33 </div>`:i.qy` 34 <div id="tooltip" ?visible=${this.visible} role="tooltip">${(0,y._)(this.tooltip)}</div> 35 `}renderImage(){const e=this.views[this.viewIndex]?this.views[this.viewIndex].url:"";if(this.isImagesUnavailable){const e="/images/icon-camera-closed-fill-solid-padded.svg";return i.qy`<div 36 class="tooltip-img" 37 style=${(0,m.W)({backgroundImage:`url(${e})`})} 38 ></div>`}return i.qy`<img 39 ${(0,M.K)(this.imageElementRef)} 40 class="visually-hidden" 41 alt="" 42 role="presentation" 43 @error=${this.findHealthyImage} 44 @load=${this.showImage} 45 /> 46 <div 47 ?hidden=${this.loaderActive} 48 class="tooltip-img" 49 style=${(0,m.W)({backgroundImage:e?`url(${e.replace("(","\\(").replace(")","\\)")})`:void 0})} 50 ></div>`}renderIcons(){return"VIDEO"===this.views[this.viewIndex].category&&this.views[this.viewIndex].url!==w.QW["camera-video-unavailable"]?i.qy` 51 <div class="tooltip-video-icon" title="Video" ?visible=${!this.loaderActive}> 52 <svg role="presentation" part="icon" aria-hidden="true"> 53 <use href="${"/images/sprites.svg#play"}"></use> 54 </svg>
55 </div> 56 `:this.views&&this.views?.length>1?i.qy` 57 <ul class="tooltip-pagination" ?visible=${!this.loaderActive}> 58 ${this.views.map(((e,t)=>{const o=!(!e||t!==this.viewIndex);return i.qy` 59 <li 60 class=${(0,f.H)({active:o,"tooltip-pagination-dot":!0})} 61 > 62 <div class="btn bullet"> 63 <div></div> 64 </div> 65 </li> 66 `}))} 67 </ul> 68 `:i.qy``}findHealthyImage(){this.views&&this.viewIndex<this.views.length-1?this.viewIndex+=1:this.isImagesUnavailable=!0}showImage(){clearTimeout(this.cameraUnavailableTimeoutId),this.isImagesUnavailable=!1,this.loaderActive=!1,this.views&&this.views?.length>1&&(this.slideshowIntervalId=window.setInterval((()=>{this.views&&this.viewIndex<this.views.length-1?this.viewIndex+=1:this.viewIndex=0}),d.VV.cameraTooltipRotateMs||3e3))}setPosition(e,t){this.style.transform=`translate3D(${e}px, ${t}px, 0)`}};E([(0,s.MZ)({type:Boolean})],L.prototype,"visible",2),E([(0,s.MZ)({type:String})],L.prototype,"tooltip",2),E([(0,s.MZ)({type:Array})],L.prototype,"views",2),E([(0,s.MZ)({type:Number})],L.prototype,"viewIndex",2),E([(0,s.MZ)({type:Boolean})],L.prototype,"isImagesUnavailable",2),E([(0,s.MZ)({type:Boolean})],L.prototype,"loaderActive",2),L=E([(0,s.EM)("feature-tooltip")],L);const I=L;class R extends google.maps.OverlayView{constructor(){super(),this._featureTooltip=new I,google.maps.OverlayView.preventMapHitsFrom(this._featureTooltip)}setMessage(e,t,o,i=!1){if(!e||!t)return void this.hide();this.coords=t,this.resetTooltipState(),this._featureTooltip.tooltip=e;const s=o?.filter((e=>!!e));s?.length&&(this._featureTooltip.views=s),this._featureTooltip.updateComplete.then((()=>{this.draw(i)})),clearTimeout(this._timeout),this._timeout=window.setTimeout((()=>{e&&t&&(this._featureTooltip.visible=!0)}),d.VV.tooltipDelayMs)}resetTooltipState(){this._featureTooltip.loaderActive=!0,this._featureTooltip.isImagesUnavailable=!1,this._featureTooltip.viewIndex=0,this._featureTooltip.views=[]}drawWithCoords(e){this.coords=e,this.draw()}draw(e=!1){if(!this.coords)return;const t=this.getMap();if(!(t&&t instanceof google.maps.Map))throw new Error("`MapFeatureTooltip: draw()` called without map reference");const{x:o,y:i}=this.coords,s=this.getProjection(),r=t.getBounds();if(!r)return;
68const a=s.fromLatLngToDivPixel(r.getSouthWest()).x,n=s.fromLatLngToDivPixel(r.getNorthEast()).x,l=s.fromLatLngToDivPixel(r.getNorthEast()).y,c=o+a,p=i+l,{offsetWidth:d,offsetHeight:u}=this._featureTooltip;requestAnimationFrame((()=>{const t=c-d>a+window.appDimensions.sidebarWidth,o=c+d<n-window.appDimensions.legendWidth;let i=0;i=t&&o?c<0?c:c-d:t?c-d:o?c:c-d/2;let s=0;s=e?p-15:p>0?p-u:p,this._featureTooltip.setPosition(i,s)}))}hide(){clearTimeout(this._timeout),this._timeout=window.setTimeout((()=>{this._featureTooltip.visible=!1,this.resetTooltipState()}),50)}getIsVisible(){return this._featureTooltip.visible}getCurrentViewIndex(){return this._featureTooltip.viewIndex||0}onAdd(){this.getPanes().floatPane.appendChild(this._featureTooltip)}onRemove(){this._featureTooltip.parentNode&&this._featureTooltip.parentNode.removeChild(this._featureTooltip)}}const _=R;var x=o(87190),A=o(30191),O=o(11650),C=o(25447),P=o(93127),$=o(78707),V=o(83002),k=o(83184),F=o(98451),H=o(23356),Z=o(47479);var D,U=o(83448),z=o(85385),N=Object.defineProperty,j=Object.getOwnPropertyDescriptor,W=(e,t,o,i)=>{for(var s,r=i>1?void 0:i?j(t,o):t,a=e.length-1;a>=0;a--)(s=e[a])&&(r=(i?s(t,o,r):s(r))||r);return i&&r&&N(t,o,r),r},G=(e,t,o)=>(((e,t,o)=>{if(!t.has(e))throw TypeError("Cannot read from private field")})(e,t),o?o.call(e):t.get(e));let B=class extends((0,r.N)(h.M_)(i.WF)){constructor(){var e;super(),this.features={},this.simpleFeatures={},this.mouseoverFeatures=[],this.activeLayers=C.bj.activeLayers,this.drawingMode=!1,this.tooltip=new _,this.mouseOnMap=!1,this.googleTrafficLayer=new google.maps.TrafficLayer,this.googleBikeLayer=new google.maps.BicyclingLayer,this.weatherRadarLayer=d.VV.weatherRadar&&(e=d.VV.weatherRadar,new google.maps.ImageMapType({tileSize:new google.maps.Size(u.dn9,u.dn9),opacity:e.opacity,maxZoom:e.maxZoom,getTileUrl({x:t,y:o},i){if(i>e.maxZoom)return"";const s=(0,Z.I6)({x:t,y:o+1},i),r=(0,Z.I6)({x:t+1,y:o},i);return function(e,t,o){const{xmin:i,ymin:s,xmax:r,ymax:a}=e,{width:n,height:l}=t,c=6e4*o.updateIntervalMinutes,p=Math.floor(Date.now()/c)*c,d=Object.entries({SERVICE:"WMS",VERSION:"1.1.1",REQUEST:"GetMap",LAYERS:"conus_cref_qcd",STYLES:"",WIDTH:n,HEIGHT:l,FORMAT:"image/png",SRS:"EPSG:4326",TRANSPARENT:"TRUE",BBOX:[i,s,r,a],time:p}).reduce(((e,[t,o])=>`${e}${""===e?"?":"&"}${t}=${o.toString()}`),"");return`${o.baseUrl}${d}`}({xmin:s.lng,ymin:s.lat,xmax:r.lng,ymax:r.lat},this.tileSize,e)}})),this.mapType=google.maps.MapTypeId.ROADMAP,this.firstLoad=!0,this.lastZoom=null,this.toggledFarZoom=!1,this.handleLayerZoomChanges=(0,a.A)((e=>{if(this.toggledFarZoom=!1,this.lastZoom&&this.lastZoom<=9&&e>9&&(this.toggledFarZoom=!0),this.lastZoom&&this.lastZoom>9&&e<=9&&(this.toggledFarZoom=!0),null==this.lastZoom)return void(this.lastZoom=e);if(this.lastZoom===e)return;this.lastZoom=e;let t={};t=this.updateMapIcons(e,!0),this.commitFeatureUpdates(t,this.features,!0)}),500,{trailing:!0}),this.isAndroid=/Android/i.test(navigator.userAgent),this.isDebouncing=!1,this.debounceTimeout=setTimeout((()=>{}),0),this.updateMapPositionDebounced=()=>{const e=async()=>{if(!this.isDebouncing){this.isDebouncing=!0;const e=B.googleMap.getCenter(),t=B.googleMap.getZoom();if(!e||!t)return;const o={center:e.toJSON(),zoom:t};(0,H.A)(o,B.position)||(B.position=o,h.M_.dispatch((0,x.b1)(B.position)),await h.M_.dispatch((0,$.gX)(!0)),h.M_.dispatch((0,x.ec)(null)))}};clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout((()=>{this.isDebouncing=!1,e()}),d.VV.debounceTime||600)},this.initializeMapDebounced=(0,a.A)((()=>this.initializeMap()),200),this.setLastMouseCoords=e=>{const{top:t}=this.getBoundingClientRect();this.mouseCoords={x:e.clientX,y:e.clientY-t},this.tooltip.getIsVisible()&&this.tooltip.drawWithCoords(this.mouseCoords)},this.setTouchMouseCoords=e=>{this.mouseCoords={x:e.touches[0].clientX,y:e.touches[0].clientY}},this.previousZoom=0,this.previousFeatures="",this.onClickFeature=e=>{this.firstLoad=!0,document.activeElement instanceof HTMLElement&&document.activeElement.blur();const t=e.feature.getId(),o=this.features[t]||this.simpleFeatures[t],i=Object.values(this.features),s=e.feature.getProperty("uri");if(!o)throw new Error("Feature not found");if(!s)return void((0,z.C)()&&o.properties.tooltip&&(clearTimeout(this.tooltipTimeout),setTimeout((()=>{this.tooltip.setMessage(o.properties.tooltip,this.mouseCoords,null,!0),this.tooltipTimeout=setTimeout((()=>{this.tooltip.hide()}),1750)}),250)));h.M_.dispatch({type:u.VB3,id:t,collectionType:s});const r=(0,U.Lf)(o,this.position.zoom,i);if(!o.spidered&&(0,U.Z0)(o)&&"Point"===o.geometry.type){const e={lng:o.geometry.coordinates[0],lat:o.geometry.coordinates[1]};if(h.M_.dispatch((0,x.ec)(e)),r)return}if("Camera"===o.collectionType){const t=e.feature.getProperty("views"),o=this.tooltip.getCurrentViewIndex()||0,i=t?.[o]?.uri;if(i)return void h.M_.dispatch((0,n.oo)(`#${i}`))}if(o.spidered||!r){let t=`/${e.feature.getProperty("uri")}/`;if(e.feature.getProperty("uri").startsWith("event")){t=`/map/${e.feature.getProperty("uri")}/`;const o=(0,O.I3)(h.M_.getState());t=`${t}@${(0,g.A)(o.center.lng)},${(0,g.A)(o.center.lat)},${Math.floor(o.zoom)}`}h.M_.dispatch((0,n.oo)(t))}},this.onMouseoverFeature=e=>{if((0,z.C)()&&(0,z.V)())return;const t=e.feature.getId(),o=this.features[t]||this.simpleFeatures[t];let{tooltip:i,views:s}=o.properties;if(d.VV.spiderfying?.tooltipOverride){const e=Object.values(this.features);!o.spidered&&(0,U.Lf)(o,this.position.zoom,e)&&(i=d.VV.spiderfying.tooltipOverride,s=[])}this.mouseoverFeatures.push({tooltip:i,feature:o}),this.mouseoverFeatures.sort(((e,t)=>t.feature.properties.zIndex-e.feature.properties.zIndex)),this.currentHoverId=this.mouseoverFeatures[0].feature.id,this.currentHoverId&&e.feature.getId()!==this.currentHoverId||this.tooltip.setMessage(i,this.mouseCoords,s);const r=B.googleMap.getZoom()||0;if(d.k9){const e=o.collectionType===u.Tgm.OversizeLoad;(r>d.k9.zoomLevel||e)&&h.M_.dispatch((0,x.jF)(this.mouseoverFeatures[0]?.feature.properties.uri??null))}else h.M_.dispatch((0,x.jF)(this.mouseoverFeatures[0]?.feature.properties.uri??null))},this.onMouseoutFeature=e=>{this.mouseoverFeatures=this.mouseoverFeatures.filter((t=>t.feature.id!==e.feature.getId())),e.feature.getId()===this.currentHoverId&&this.tooltip.setMessage(this.mouseoverFeatures?.[0]?.tooltip,this.mouseCoords,this.mouseoverFeatures?.[0]?.feature?.views),this.mouseoverFeatures.length||this.tooltip.hide(),h.M_.dispatch((0,x.jF)(this.mouseoverFeatures[0]?.feature.properties.uri??null))},((e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)})(this,D,document.createElement("div")),G(this,D).setAttribute("aria-label","Interactive traffic map. Use list view for an accessible alternative."),G(this,D).setAttribute("role","application")}get position(){return B.position}set position(e){const t=B.position;(0,H.A)(e,t)||(B.position=e,this.requestUpdate("position",t))}static get styles(){return[i.AH` 69 *:focus:focus-visible { 70 outline: rgb(var(--peter-river)) solid 0.25rem; 71 } 72 73 .gm-style > div:nth-child(3) { 74 border-color: rgb(var(--peter-river)) !important; 75 border-width: 0.25rem !important; 76 } 77 78 .gm-style > div:nth-child(14) > div { 79 left: initial !important; 80 right: 0 !important; 81 bottom: 12px !important; 82 } 83 84 .gm-style > div:nth-child(14) > div > a:focus:focus-visible { 85 outline: rgb(var(--peter-river)) auto; 86 } 87 `]}updated(e){e.has("activeLayers")&&B.googleMap&&this.toggleMapLayers(),e.has("mapType")&&B.googleMap&&B.googleMap.setMapTypeId(this.mapType),e.has("position")&&this.position&&!B.googleMap?this.initializeMapDebounced():e.has("position")&&this.position&&(B.googleMap.setZoom(this.position.zoom),B.googleMap.panTo(this.position.center),this.handleLayerZoomChanges(this.position.zoom)),e.has("drawingMode")&&(this.drawingMode?(this.onMapFeaturesUpdated({},this.features),this.contextMenu?.hide()):this.onMapFeaturesUpdated(this.features,{}))}async onMapFeaturesUpdated(e,t={}){const o=await B.getBounds(),i=await B.getZoom(),s=await(0,c.A)(i,o,this.activeLayers);let r={...e,...s};Object.keys(this.features).length&&this.firstLoad&&(r={...this.updateMapIcons(i,!0),...s},this.firstLoad=!1),Object.entries(r).forEach((([e,t])=>{this.mouseOnMap||(t.properties.title=t.properties?.tooltip?.replace(/<[^>]*>/g,"")||t.properties.title||"Map Feature")})),this.commitFeatureUpdates(r,t),this.simpleFeatures=s}commitFeatureUpdates(e,t,o=!1){Object.entries({...t,...this.simpleFeatures}
87).forEach((([t])=>{if(!e[t]){const e=B.googleMap.data.getFeatureById(t);if(!e)return;B.googleMap.data.remove(e),this.mouseoverFeatures=this.mouseoverFeatures.filter((t=>t.feature.id!==e.getId()));const o=this.mouseoverFeatures[0]?.feature?.views;this.tooltip.setMessage(this.mouseoverFeatures[0]?.tooltip,this.mouseCoords,o)}})),Object.entries({...e,...this.simpleFeatures}).forEach((([e,i])=>{const s=t[e]||this.simpleFeatures[e];if(s){if(i.state!==s.state){const t=B.googleMap.data.getFeatureById(e);if(!t)return void B.googleMap.data.addGeoJson(i);B.googleMap.data.overrideStyle(t,i.properties)}else if(o){const t=B.googleMap.data.getFeatureById(e);if(!t)return void B.googleMap.data.addGeoJson(i);B.googleMap.data.overrideStyle(t,i.properties)}}else B.googleMap.data.addGeoJson(i)}))}updateMapIcons(e,t=!1){const o={};return Object.keys(this.features).forEach((t=>{const i=this.features[t],s=JSON.parse(JSON.stringify(i));i.state!==O.qX.ACTIVE&&d.k9&&(0,p.HV)(s)&&e<9?(s.collectionType===u.Tgm.Cluster?s.properties.icon.scaledSize={height:d.k9.clusters.height,width:d.k9.clusters.width}:i.properties?.priority&&i.properties?.priority<=d.k9.priority.level?s.properties.icon.scaledSize={height:d.k9.priority.height,width:d.k9.priority.width}:Object.keys(d.k9.resolvers).forEach((e=>{if(d.k9&&i.collectionType===e){s.properties.icon.scaledSize={height:d.k9.resolvers[e].height,width:d.k9.resolvers[e].width};const t=d.k9.resolvers[e].smallImageUrl||s.properties.icon.url;s.properties.icon.url=t}})),s.properties.icon.anchor={x:s.properties.icon.scaledSize.width/2,y:s.properties.icon.scaledSize.height/2},this.isAndroid&&!window.location.href.includes("localhost")&&s.properties.icon.url.endsWith(".svg")&&(s.properties.icon.url=`${s.properties.icon.url}.png`),o[s.id]=s):(this.isAndroid&&(0,p.HV)(i)&&!window.location.href.includes("localhost")&&i.properties.icon.url.endsWith(".svg")&&(i.properties.icon.url=`${i.properties.icon.url}.png`),o[i.id]=i)})),t?o:(this.toggledFarZoom&&this.commitFeatureUpdates(o,this.features,!0),{})}static getMap(){return B.mapResolving}static async getBounds(){if(await B.mapResolving,!B.position)throw new Error("`getBounds()` called before position set on `AppMap`");return(0,P.A)(B.position)}static async getZoom(){return(await B.mapResolving).getZoom()}static async setZoom(e){const t=await B.mapResolving;t.getZoom()!==e&&(t.setZoom(e),h.M_.dispatch((0,$.Dl)(Date.now())))}static async setPosition(e){const t=await B.mapResolving;t.setZoom(e.zoom),t.panTo(e.center)}initializeMap(){let e;const t=!0===d.VV.androidOnlyVector&&/Android/i.test(navigator.userAgent);e=d.VV.mapID&&(!0!==d.VV.androidOnlyVector||t)?{center:this.position.center,zoom:this.position.zoom,maxZoom:u.Klp,minZoom:u.u0R,disableDefaultUI:!0,scaleControl:!0,clickableIcons:!1,mapId:d.VV.mapID}:{center:this.position.center,zoom:this.position.zoom,maxZoom:u.Klp,minZoom:u.u0R,disableDefaultUI:!0,scaleControl:!0,clickableIcons:!1,styles:d.VV.styles},B.googleMap=new google.maps.Map(G(this,D),e),B.googleMap.data.setStyle((e=>{const t={};return e.forEachProperty(((e,o)=>{t[o]=e})),t})),B.googleMap.addListener("bounds_changed",this.updateMapPositionDebounced),B.googleMap.addListener("click",(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur(),h.M_.dispatch((0,x.ec)(null))})),B.googleMap.addListener("dragstart",(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur(),this.dispatchEvent(new CustomEvent("map-dragstart"))})),document.addEventListener("mousemove",this.setLastMouseCoords),(0,z.C)()&&document.addEventListener("touchstart",this.setTouchMouseCoords),this.addEventListener("click",(()=>{const e=G(this,D).querySelector('div[tabindex="0"]');e?.focus()})),G(this,D).addEventListener("mousemove",(()=>{this.mouseOnMap||(this.mouseOnMap=!0,B.googleMap.data.forEach((e=>{e.removeProperty("title"),B.googleMap.data.overrideStyle(e,{title:void 0})})))})),B.googleMap.data.addListener("click",this.onClickFeature),B.googleMap.data.addListener("mouseover",this.onMouseoverFeature),B.googleMap.data.addListener("mouseout",this.onMouseoutFeature),this._initContextMenu(B.googleMap),this.tooltip.setMap(B.googleMap),this.onMapFeaturesUpdated(this.features),B.mapResolver(B.googleMap),this.toggleMapLayers()}_initContextMenu(e){this.contextMenu=new V.A([{title:"Search visible area",callback:()=>{h.M_.dispatch((0,k.mG)())}},{title:(0,l.A)("map.startRoute","Start route here"),callback:function(e){h.M_.dispatch((0,F.Zr)(e.clickedLatLng))}},{title:(0,l.A)("map.endRoute","End route here"),callback:function(e){h.M_.dispatch((0,F.n$)(e.clickedLatLng))}}]),this.contextMenu.setMap(e),B.googleMap.addListener("rightclick",(e=>{!this.drawingMode&&e.latLng&&this.contextMenu?.show(e.latLng.toJSON(),!0)})),B.googleMap.data.addListener("rightclick",(e=>{!this.drawingMode&&e.latLng&&(this.contextMenu?.show(e.latLng.toJSON(),!0),this.tooltip.hide())}))}static async reloadTiles(){const e=await B.mapResolving,t=e.getMapTypeId();t===google.maps.MapTypeId.HYBRID?e.setMapTypeId(google.maps.MapTypeId.TERRAIN):e.setMapTypeId(google.maps.MapTypeId.HYBRID),e.setMapTypeId(t)}render(){return G(this,D)}async addPlowHistory(){if(!d.Hu)return;h.M_.dispatch({type:u.h_8,action:{show:!0}});const e=await async function(){if(d.Hu)try{const e=await fetch(`${d.Hu.url}?bbox=${d.Hu.wholeMapBounds.join(",")}`);return(await e.json()).features}catch(e){return h.Ay.dispatch({type:u.j2Q,error:{type:u.i65.INTERNAL_SERVER_ERROR}}),[]}return[]}();let t=!1;e.forEach((e=>{(0,A.Ap)(this.activeLayers,d.j9).includes(d.er.PLOW_HISTORY)?B.googleMap.data.addGeoJson({...e,properties:{...e.properties,id:`PH-${e.id}`,strokeWeight:d.Hu?.strokeWeight||2,strokeOpacity:d.Hu?.opacity||.75,clickable:!1,tooltip:null}}):t=!0,h.M_.dispatch({type:u.h_8,action:{show:!1}})})),t&&B.googleMap.data.forEach((e=>{e.getProperty("id")?.toString()?.includes("PH-")&&B.googleMap.data.remove(e)}))}async toggleMapLayers(){const e=(0,A.Ap)(this.activeLayers,d.j9),t=e.includes(u.f2p.TRAFFIC_SPEED);t&&!this.googleTrafficLayer.getMap()?this.googleTrafficLayer.setMap(await B.mapResolving):!t&&this.googleTrafficLayer.getMap()&&this.googleTrafficLayer.setMap(null),e.includes(d.er.BIKE)?this.googleBikeLayer.setMap(await B.mapResolving):this.googleBikeLayer.setMap(null);const o=e.includes(u.f2p.WEATHER_RADAR);this.weatherRadarLayer&&o&&!B.googleMap.overlayMapTypes.getAt(0)&&(B.googleMap.overlayMapTypes.push(this.weatherRadarLayer),h.M_.dispatch((0,$.Dl)(Date.now()))),this.weatherRadarLayer&&!o&&B.googleMap.overlayMapTypes.getAt(0)&&B.googleMap.overlayMapTypes.removeAt(0),e.includes(d.er.PLOW_HISTORY)?(await B.mapResolving||console.error("Map unavailable"),d.Hu&&this.addPlowHistory()):B.googleMap.data.forEach((e=>{e.getProperty("id")?.toString()?.includes("PH-")&&B.googleMap.data.remove(e)}))}static async forceWeatherRadarRefresh(){const e=await B.mapResolving;e.setZoom(e.getZoom()),h.M_.dispatch((0,$.Dl)(Date.now()))}stateChanged(e){const t=(0,O.iG)(e);Object.keys(t).length?(Object.keys(t).forEach((e=>{this.features[e]||(this.firstLoad=!0)})),this.onMapFeaturesUpdated(t,this.features),this.features=t):0===Object.keys(t).length&&(this.firstLoad=!0,this.onMapFeaturesUpdated(t,this.features),this.features=t),this.position=(0,O.I3)(e),this.mapType=e.map.mapType,this.activeLayers=e.app.activeLayers,this.drawingMode=e.search.drawingMode}};D=new WeakMap,B.mapResolving=new Promise((e=>{B.mapResolver=e})),W([(0,s.MZ)({type:Object})],B.prototype,"features",2),W([(0,s.MZ)({type:Object})],B.prototype,"activeLayers",2),W([(0,s.MZ)({type:Boolean})],B.prototype,"drawingMode",2),W([(0,s.MZ)({type:String})],B.prototype,"mapType",2),W([(0,s.MZ)({type:Object})],B.prototype,"position",1),B=W([(0,s.EM)("app-map")],B);const J=B},83002:(e,t,o)=>{o.d(t,{X:()=>u,A:()=>h});var i=o(71413),s=o(52706),r=o(24634),a=o(56365),n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=(e,t,o,i)=>{for(var s,r=i>
871?void 0:i?l(t,o):t,a=e.length-1;a>=0;a--)(s=e[a])&&(r=(i?s(t,o,r):s(r))||r);return i&&r&&n(t,o,r),r};let p=class extends i.WF{constructor(){super(...arguments),this.isVisible=!1,this.menuOptions=[]}static get styles(){return[r.A,a.A,i.AH` 88 :host { 89 position: absolute; 90 visibility: hidden; 91 pointer-events: none; 92 } 93 :host([visible]) { 94 visibility: visible; 95 pointer-events: all; 96 } 97 .context-menu { 98 box-shadow: var(--shadow-md); 99 } 100 `]}render(){return i.qy` 101 <div class="menu context-menu" role="menu"> 102 ${this.menuOptions.map(((e,t)=>i.qy` 103 <button 104 class="btn menu_item" 105 role="menuitem" 106 data-option-index=${t} 107 @click=${this.optionClicked} 108 > 109 ${e.title} 110 </button> 111 `))} 112 </div> 113 `}optionClicked(e){const t=parseInt(e.currentTarget.dataset.optionIndex,10),o=this.menuOptions[t];if(!this.clickedLatLng)throw new Error("clickedLatLng is undefined");o.callback({clickedLatLng:this.clickedLatLng})}};c([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"visible"})],p.prototype,"isVisible",2),c([(0,s.MZ)({type:Object})],p.prototype,"clickedLatLng",2),c([(0,s.MZ)({type:Array})],p.prototype,"menuOptions",2),p=c([(0,s.EM)("context-menu")],p);const d=p;class u extends google.maps.OverlayView{constructor(e){super(),this.allowClose=!1,this._menuEl=new d,this.hide=()=>{this._menuEl.isVisible=!1,document.removeEventListener("click",this.hideHandler)},this.hideHandler=()=>{this.allowClose&&this.hide(),this.allowClose=!0},this._menuEl.menuOptions=e,google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._menuEl)}get isShowing(){return this._menuEl.isVisible}show(e,t){this._menuEl.clickedLatLng=e,this._menuEl.isVisible=!0,this._clickedLatLng=e,this.draw(),this.allowClose=t,document.addEventListener("click",this.hideHandler)}draw(){if(!this._menuEl.isVisible)return;const e=this.getMap();if(!(e&&e instanceof google.maps.Map))throw new Error("`MapContextMenu: draw()` called without map reference");if(!this._clickedLatLng)throw new Error("`No _clickedLatLng");const t=this.getProjection(),o=t.fromLatLngToDivPixel(new google.maps.LatLng(this._clickedLatLng)),i=e.getBounds();if(!i)throw new Error("No bounds for context menu");
113const s=t.fromLatLngToDivPixel(i.getSouthWest()),r=t.fromLatLngToDivPixel(i.getNorthEast()),a=this._menuEl.offsetWidth,n=this._menuEl.offsetHeight,l=Math.max(s.x,r.x)-a;let{x:c,y:p}=o;c>l&&(c-=a),this._menuEl.style.left=`${c}px`,this._menuEl.style.top=p-n/2+"px"}onAdd(){this.getPanes().floatPane.appendChild(this._menuEl)}onRemove(){this._menuEl.parentNode.removeChild(this._menuEl)}}const h=u},82890:(e,t,o)=>{var i=o(71413),s=o(52706);Object.defineProperty,Object.getOwnPropertyDescriptor;let r=class extends i.WF{static get styles(){return[i.AH` 114 :host { 115 display: block; 116 margin: var(--spinner-margin, 1rem auto); 117 width: var(--spinner-size, 5rem); 118 height: var(--spinner-size, 5rem); 119 } 120 .spinner, 121 .spinner:after { 122 border-radius: 50%; 123 width: calc(100% - 1rem); 124 height: calc(100% - 1rem); 125 } 126 127 .spinner { 128 border: 0.5rem solid rgba(var(--asbestos), 0.3); 129 border-left: 0.5rem solid rgba(var(--asbestos), 1); 130 animation: spinner 1s infinite linear; 131 } 132 133 .spinner-light { 134 border: 0.5rem solid rgba(var(--clouds), 0.3); 135 border-left: 0.5rem solid rgba(var(--clouds), 1); 136 } 137 138 @keyframes spinner { 139 0% { 140 transform: rotate(0deg); 141 } 142 143 100% { 144 transform: rotate(360deg); 145 } 146 } 147 `]}render(){return i.qy` <div class="spinner" aria-label="Loading..."></div> `}};r=((e,t,o,i)=>{for(var s,r=t,a=e.length-1;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r})([(0,s.EM)("spinning-loader")],r)},85385:(e,t,o)=>{o.d(t,{C:()=>s,V:()=>r});var i=o(52850);function s(){return"ontouchstart"in document.documentElement}function r(){return window.matchMedia(`screen and (max-width: ${i.EA.DESKTOP})`).matches}},31972:(e,t,o)=>{o.d(t,{A:()=>d,h:()=>n});var i=o(80027),s=o(52850),r=o(11650),a=o(10388);const n={count:0},l={},c={};let p=!1;const d=async(e,t,o)=>{const d={},u=.025;try{if(i.Hp.length)for(const n of i.Hp){if(!o[n.layer]){l[n.file]=[],p=!1;break}if(!n.zoom||n.zoom<e){let e=[];try{l[n.file]?.length?e=l[n.file]:null!=c[n.file]?(e=await c[n.file],l[n.file]=e):(c[n.file]=(async()=>{const t=await fetch(n.file);return e=await t.json(),e})(),e=await c[n.file],l[n.file]=e,setTimeout((()=>{delete l[n.file],delete c[n.file]}),6e4)),e.forEach(((e,o)=>{"Error"!==e.tooltip&&e.coordinates[0]<t.east+u&&e.coordinates[0]>t.west-u&&e.coordinates[1]<t.north+u&&e.coordinates[1]>t.south-u&&(d[`${n.id_prefix}${o}`]={id:`${n.id_prefix}${o}`,type:"Feature",state:r.qX.NORMAL,collectionType:s.Tgm.Custom,properties:{icon:{url:e.icon||n.icon.url,scaledSize:{width:n.icon.w,height:n.icon.h},anchor:{x:n.icon.w/2,y:n.icon.h/2}},zIndex:4,tooltip:`${e.tooltip}`,uri:n.uri?`${n.uri}/${e.id}`:""},geometry:{type:"Point",coordinates:[...e.coordinates]}})}))}catch(e){p||(p=!0,a.Ay.dispatch({type:s.j2Q,error:{type:"Error",message:`The ${n.layer} layer is currently unavailable.`}})),l[n.file]=[{tooltip:"Error",coordinates:[0,0]}]}}}}catch(e){console.error(e)}return n.count=Object.keys(d).length,d}}}]);
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.