1import{m as Q}from"./chunk-NWVHRA4Y.js";import{Ab as c,Ba as p,Bb as m,Bc as A,Cb as T,Cc as O,Fb as U,Gb as Z,Ib as G,Jb as P,Mc as W,Ra as u,Tb as N,Ub as V,Uc as q,Wb as L,Zb as j,_ as E,_a as k,ca as b,db as S,ib as v,kc as K,la as x,ma as w,pb as B,qb as M,rb as R,sa as F,vb as g,xa as C,ya as n}from"./chunk-TET5VYI6.js";import{g as r}from"./chunk-SLISG6NT.js";var X=(()=>{class s{constructor(){this.atlasPromise=null,this.isLoaded=p(!1)}load(){return r(this,null,function*(){return this.atlasPromise?this.atlasPromise:(this.atlasPromise=this.loadAzureMaps(),this.atlasPromise)})}loadAzureMaps(){return r(this,null,function*(){try{let t=yield import("./chunk-FQSVCYJY.js");return yield this.loadAzureMapsStyles(),this.isLoaded.set(!0),t}catch(t){throw console.error("Failed to load Azure Maps:",t),this.atlasPromise=null,t}})}loadAzureMapsStyles(){return new Promise((t,e)=>{if(document.querySelector('link[href*="atlas.min.css"]')){t();return}let o=document.createElement("link");o.rel="stylesheet",o.href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css",o.onload=()=>t(),o.onerror=()=>e(new Error("Failed to load Azure Maps styles")),document.head.appendChild(o)})}get loaded(){return this.isLoaded()}preload(){this.load().catch(t=>{console.warn("Azure Maps preload failed:",t)})}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=E({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var l={height:400,initialCenter:[5.2913,52.1326],initialZoom:5.9,style:"grayscale_light",enableClustering:!0,clusterRadius:45,clusterMaxZoom:15};var tt=["mapContainer"],et=s=>({$implicit:s});function it(s,f){s&1&&(c(0,"div",2),T(1,"div",7),m())}function st(s,f){s&1&&(c(0,"div",3)(1,"span"),L(2,"Failed to load map"),m()())}function ot(s,f){s&1&&U(0)}function nt(s,f){if(s&1){let t=Z();c(0,"div",8),G("mouseenter",function(){x(t);let i=P();return w(i.onPopupMouseEnter())})("mouseleave",function(){x(t);let i=P();return w(i.onPopupMouseLeave())}),v(1,ot,1,0,"ng-container",9),m()}if(s&2){let t=P();M("left",t.popupPosition().x,"px")("top",t.popupPosition().y,"px"),R("placement-bottom",t.popupPosition().placement==="bottom"),u(),B("ngTemplateOutlet",t.popupTemplate())("ngTemplateOutletContext",K(8,et,t.hoveredPin()))}}function at(s,f){if(s&1&&(c(0,"div",6),L(1),m()),s&2){let t=P();u(),j(" Showing ",t.pinCount()," of ",t.totalCount()," on map ")}}var bt=(()=>{class s{constructor(){this.mapContainer=k.required("mapContainer"),this.pins=n.required(),this.height=n(l.height),this.initialCenter=n(l.initialCenter),this.initialZoom=n(l.initialZoom),this.style=n(l.style),this.enableClustering=n(l.enableClustering),this.clusterRadius=n(l.clusterRadius),this.clusterMaxZoom=n(l.clusterMaxZoom),this.popupTemplate=n(null),this.totalCount=n(null),this.autoFitBounds=n(!0),this.highlightedPinId=n(null),this.pinClicked=C(),this.pinHovered=C(),this.boundsChanged=C(),this.loading=p(!0),this.error=p(null),this.hoveredPin=p(null),this.popupPosition=p({x:0,y:0,placement:"top"}),this.POPUP_WIDTH=340,this.POPUP_HEIGHT=100,this.POPUP_PADDING=10,this.POPUP_HIDE_DELAY=150,this.PIN_MARKER_HEIGHT=30,this.isMouseOverPopup=!1,this.hidePopupTimeout=null,this.pinCount=A(()=>this.pins()?.length??0),this.showPinCount=A(()=>{let t=this.totalCount(),e=this.pinCount();return t!==null&&e<t}),this.map=null,this.atlas=null,this.datasource=null,this.clusterBubbleLayer=null,this.symbolLayer=null,this.mapId=`azure-map-${crypto.randomUUID()}`,this.azureMapsLoader=b(X),this.destroyRef=b(F),O(()=>{let t=this.pins();this.map&&this.datasource&&t&&this.updatePins(t)}),O(()=>{let t=this.highlightedPinId();this.map&&this.symbolLayer&&this.updatePinHighlight(t)})}ngAfterViewInit(){return r(this,null,function*(){try{this.atlas=yield this.azureMapsLoader.load(),yield this.initMap(),this.loading.set(!1)}catch(t){console.error("Failed to initialize Azure Map:",t),this.error.set("Failed to load map"),this.loading.set(!1)}})}ngOnDestroy(){this.cancelHidePopup(),this.map&&(this.map.dispose(),this.map=null)}initMap(){return r(this,null,function*(){let t=this.atlas;return this.map=new t.Map(this.mapContainer().nativeElement,{center:this.initialCenter(),zoom:this.initialZoom(),view:"Auto",authOptions:{authType:t.AuthenticationType.subscriptionKey,subscriptionKey:Q.azureMaps.subscriptionKey}
1,style:this.style(),showLogo:!1,showFeedbackLink:!1}),new Promise(e=>{this.map.events.add("ready",()=>r(this,null,function*(){yield this.setupDataSource(),this.setupLayers(),this.setupEventHandlers();let i=this.pins();i?.length&&this.updatePins(i),setTimeout(()=>this.emitCurrentBounds(),0),e()}))})})}setupDataSource(){return r(this,null,function*(){let t=this.atlas;this.datasource=new t.source.DataSource(null,{cluster:this.enableClustering(),clusterRadius:this.clusterRadius(),clusterMaxZoom:this.clusterMaxZoom()}),this.map.sources.add(this.datasource),yield this.map.imageSprite.createFromTemplate("marker-pin","marker","#0096e9","#0066a3",.8),yield this.map.imageSprite.createFromTemplate("marker-pin-highlighted","marker","#0096e9","#0066a3",.8)})}setupLayers(){let t=this.atlas;this.clusterBubbleLayer=new t.layer.BubbleLayer(this.datasource,null,{radius:["step",["get","point_count"],20,10,25,50,30,100,35],color:["step",["get","point_count"],"#0096e9",10,"#007acc",50,"#0066a3",100,"#004d7a"],strokeWidth:2,strokeColor:"white",filter:["has","point_count"]});let e=new t.layer.SymbolLayer(this.datasource,null,{iconOptions:{image:"none"},textOptions:{textField:["get","point_count_abbreviated"],offset:[0,.4],color:"white",size:12},filter:["has","point_count"]});this.symbolLayer=new t.layer.SymbolLayer(this.datasource,null,{iconOptions:{image:"marker-pin",allowOverlap:!0,ignorePlacement:!0},filter:["!",["has","point_count"]]}),this.map.layers.add([this.clusterBubbleLayer,e,this.symbolLayer])}setupEventHandlers(){this.map.events.add("click",this.clusterBubbleLayer,t=>{if(t.shapes?.length){let e=t.shapes[0],i=typeof e.getProperties=="function"?e.getProperties():e.properties;if(i?.cluster_id!==void 0){let o=i.cluster_id,a=typeof e.getCoordinates=="function"?e.getCoordinates():e.geometry?.coordinates;this.datasource.getClusterExpansionZoom(o).then(h=>{this.map.setCamera({center:a,zoom:h,type:"ease",duration:300})})}}}),this.map.events.add("click",this.symbolLayer,t=>{if(t.shapes?.length){let o=t.shapes[0].getProperties().pinData;o&&this.pinClicked.emit(o)}}),this.map.events.add("mouseover",this.symbolLayer,t=>{if(t.shapes?.length){let e=t.shapes[0],o=e.getProperties().pinData;if(o&&this.popupTemplate()){this.cancelHidePopup();let a=this.map.positionsToPixels([e.getCoordinates()]);if(a?.length){let h=a[0][0],y=a[0][1];this.popupPosition.set(this.calculatePopupPosition(h,y))}this.hoveredPin.set(o),this.pinHovered.emit(o)}this.map.getCanvasContainer().style.cursor="pointer"}}),this.map.events.add("mouseout",this.symbolLayer,()=>{this.map.getCanvasContainer().style.cursor="grab",this.scheduleHidePopup()}),this.map.events.add("mouseover",this.clusterBubbleLayer,()=>{this.map.getCanvasContainer().style.cursor="pointer"}),this.map.events.add("mouseout",this.clusterBubbleLayer,()=>{this.map.getCanvasContainer().style.cursor="grab"}),this.map.events.add("moveend",()=>{this.emitCurrentBounds()})}emitCurrentBounds(){let t=this.map?.getCamera()?.bounds;t&&this.boundsChanged.emit({north:t[3],south:t[1],east:t[2],west:t[0]})}updatePins(t){let e=this.atlas;if(this.datasource.clear(),!t?.length)return;let i=t.map(o=>new e.data.Feature(new e.data.Point([o.longitude,o.latitude]),{id:o.id,pinData:o}));this.datasource.add(i),this.autoFitBounds()&&this.fitBoundsToFeatures(i)}fitBoundsToFeatures(t){if(!t.length)return;let e=this.atlas,i=t.map(a=>a.geometry.coordinates),o=e.data.BoundingBox.fromPositions(i);this.map.setCamera({bounds:o,padding:50,maxZoom:15})}updatePinHighlight(t){!this.symbolLayer||!this.atlas||this.symbolLayer.setOptions({iconOptions:{image:["case",["==",["get","id"],t??""],"marker-pin-highlighted","marker-pin"],allowOverlap:!0,ignorePlacement:!0,size:["case",["==",["get","id"],t??""],1.1,1]},filter:["!",["has","point_count"]]})}centerOnPin(t){this.map&&this.map.setCamera({center:[t.longitude,t.latitude],zoom:14,type:"ease",duration:300})}calculatePopupPosition(t,e){let i=this.mapContainer().nativeElement,o=i.offsetWidth,a=i.offsetHeight,h=e-this.PIN_MARKER_HEIGHT,y=a-e,z=this.POPUP_HEIGHT+this.POPUP_PADDING,d,_,D=h>=z,H=y>=z;D&&H||D?d="top":H?d="bottom":d=h>=y?"top":"bottom",d==="top"?_=e-this.PIN_MARKER_HEIGHT:_=e+this.POPUP_PADDING;let I=this.POPUP_WIDTH/2,Y=I+this.POPUP_PADDING,$=o-I-this.POPUP_PADDING;return{x:Math.max(Y,Math.min($,t)),y:_,placement:d}}onPopupMouseEnter(){this.isMouseOverPopup=!0,this.cancelHidePopup()}onPopupMouseLeave(){this.isMouseOverPopup=!1,this.scheduleHidePopup()}scheduleHidePopup(){this.cancelHidePopup(),this.hidePopupTimeout=setTimeout(()=>{this.isMouseOverPopup||(this.hoveredPin.set(null),this.pinHovered.emit(null))},this.POPUP_HIDE_DELAY)}cancelHidePopup(){this.hidePopupTimeout&&(clearTimeout(this.hidePopupTimeout),this.hidePopupTimeout=null)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275cmp=S({type:s,selectors:[["app-azure-map"]],viewQuery:function(e,i){e&1&&N(i.mapContainer,tt,5),e&2&&V()},inputs:{pins:[1,"pins"],height:[1,"height"],initialCenter:[1,"initialCenter"],initialZoom:[1,"initialZoom"],style:[1,"style"],enableClustering:[1,"enableClustering"],clusterRadius:[1,"clusterRadius"],clusterMa
1xZoom:[1,"clusterMaxZoom"],popupTemplate:[1,"popupTemplate"],totalCount:[1,"totalCount"],autoFitBounds:[1,"autoFitBounds"],highlightedPinId:[1,"highlightedPinId"]},outputs:{pinClicked:"pinClicked",pinHovered:"pinHovered",boundsChanged:"boundsChanged"},decls:7,vars:6,consts:[["mapContainer",""],[1,"relative","w-full","rounded-md","overflow-hidden","bg-gray-100"],[1,"absolute","inset-0","flex","items-center","justify-center","bg-white/75",2,"z-index","10"],[1,"absolute","inset-0","flex","items-center","justify-center","bg-red-500/10","text-red-500","text-sm"],[1,"w-full","h-full"],[1,"map-popup","bg-white","rounded-md","shadow","p-0",3,"placement-bottom","left","top"],[1,"absolute","bottom-0","left-0","mb-2","ml-2","px-2","py-1","bg-white","rounded-md","shadow-sm","text-sm","text-gray-500"],[1,"spinner"],[1,"map-popup","bg-white","rounded-md","shadow","p-0",3,"mouseenter","mouseleave"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,i){e&1&&(c(0,"div",1),v(1,it,2,0,"div",2)(2,st,3,0,"div",3),T(3,"div",4,0),v(5,nt,2,10,"div",5)(6,at,2,2,"div",6),m()),e&2&&(M("height",i.height(),"px"),u(),g(i.loading()?1:-1),u(),g(i.error()?2:-1),u(3),g(i.hoveredPin()&&i.popupTemplate()?5:-1),u(),g(i.showPinCount()?6:-1))},dependencies:[q,W],styles:[".map-popup[_ngcontent-%COMP%]{position:absolute;z-index:1050;pointer-events:auto;min-width:280px;max-width:360px;transform:translate(-50%) translateY(-100%)}.map-popup.placement-bottom[_ngcontent-%COMP%]{transform:translate(-50%) translateY(0)}"],changeDetection:0})}}return s})();export{bt as a}; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="08dc2281-a734-5706-88c2-4565071f1043")}catch(e){}}(); 3//# debugId=08dc2281-a734-5706-88c2-4565071f1043
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.