osmgl 0.31.53 → 0.31.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-CMTEQIP7.js +2 -0
- package/dist/chunk-CMTEQIP7.js.map +1 -0
- package/dist/chunk-TJGUBCJS.js +3 -0
- package/dist/chunk-TJGUBCJS.js.map +1 -0
- package/dist/nav.d.ts +35 -1
- package/dist/nav.js +1 -1
- package/dist/navigram.d.ts +47 -2
- package/dist/navigram.js +1 -1
- package/dist/osmgl.cjs +85 -85
- package/dist/osmgl.cjs.map +1 -1
- package/dist/osmgl.d.cts +52 -2
- package/dist/osmgl.d.ts +52 -2
- package/dist/osmgl.global.js +86 -86
- package/dist/osmgl.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2GMD3Q3A.js +0 -3
- package/dist/chunk-2GMD3Q3A.js.map +0 -1
- package/dist/chunk-BVYIYHK3.js +0 -2
- package/dist/chunk-BVYIYHK3.js.map +0 -1
package/dist/osmgl.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{td as ANCHOR_GRID,ge as AssetLoader,if as AttributionControl,$c as BASE_ICONS,R as BUILDING_HEIGHT_SCALE,S as BUILDING_POS_SCALE,Q as BUILDING_VERTEX_STRIDE,t as BoxZoomHandler,qb as CELL_GRID,Pa as CIRCLE_PROPS,Oa as CIRCLE_VERTEX_STRIDE,zc as CLIP_END,yc as CLIP_START,vf as Circle,u as CooperativeGesturesHandler,pa as DASH_MAX,ha as DATA_PAINT_EXT_STRIDE,ga as DATA_PAINT_STRIDE,kc as DEFAULT_HEATMAP_COLOR,dd as DEFAULT_ICONS,Jc as DEFAULT_SHADOWS,oc as DemLayerData,pc as DemLayers,$d as DemSource,Db as DemTile,_d as DemTileEntry,Na as DepthTarget,zb as FACADE_FOCUS_RANGE_M,rb as FACADE_GONE_MPP,he as FAR_LEVEL,U as FILL_VERTEX_STRIDE,kd as FLIP_HOLD_DEG,n as FOG_CUTOFF_MIN_M,Mb as FOG_FAR_MIN_M,Lb as FOG_NEAR_MIN_M,ja as FeaturePaint,Id as FeatureStatePainter,_c as FontFaces,jf as FullscreenControl,c as GLOBE_MAX_PITCH,e as GLOBE_ZOOM_MAX,d as GLOBE_ZOOM_MIN,Uc as GLYPH_BORDER,Vc as GLYPH_SIZE,Fc as GRADIENT_SIZE,Gc as GRADIENT_STEP_SIZE,sa as GROUND_SCALE,be as GeoJSONSource,kf as GeolocateControl,s as GestureHandler,mf as GlobeControl,Wc as GlyphSource,fb as GroundArrows,jc as HEATMAP_LAYOUT,hc as HEATMAP_PROPS,gc as HEATMAP_VERTEX_STRIDE,mc as HeatmapPass,ad as ICON_ALIASES,bd as ICON_SOURCES,cd as IconSource,Rc as ImageManager,pb as IndoorMask,Qb as LABEL_FOG_MAX,$e as LD_DEFAULTS,Y as LEVEL_LIMIT,Dc as LINE_PROGRESS_STRIDE,xa as LINE_VERTEX_STRIDE,xc as LayerOpacityTarget,Lc as LayerRenderer,a as LngLatBounds,nf as LogoControl,Za as MAPLIBRE_TRANSITION,bf as MAX_GRADE,Ve as MESH_BOTTOM,Ye as MESH_ISLAND,Xe as MESH_KERB_SIDE,We as MESH_KERB_TOP,Ue as MESH_SIDE,Te as MESH_TOP,df as MIN_PIER_HEIGHT_METERS,Ke as MITER_MAX_TURN,Mc as ML_EXTENT,yf as Map,rf as MapObject,pe as Marker,ae as MediaSource,Ld as MltTile,fc as ModelLayer,gf as NavigationControl,md as OCCLUSION_MAX_SAMPLES,pd as OCCLUSION_NEAR_M,qd as OCCLUSION_NEAR_SHARE,nd as OCCLUSION_STEP_M,od as OCCLUSION_TOLERANCE_M,ec as ObjectManager,je as Objects3DManager,Ya as PAINT_TRANSITIONS,cf as PIER_SPACING_METERS,o as PITCH_BY_ZOOM,za as PREFETCH_ZOOM,Ba as PREWARM_TYPES,bb as PaintStamp,ab as PaintTransitions,tf as Polygon,sf as Polyline,qe as Popup,I as QualityGovernor,Ib as RELIEF_DARK_KEEP,Hb as RELIEF_DARK_LUMA,Fb as RELIEF_LIGHT_ALTITUDE,Eb as RELIEF_LIGHT_AZIMUTH,Ud as RESERVE_MARGIN,Vd as RESERVE_MAX,Td as RESERVE_ZOOM_DELTA,Ze as ROAD_MESH_RADIUS_BY_CORNER,we as ROAD_SIGNS,bc as RUNTIME_FILL_STRIDE,ac as RUNTIME_LINE_STRIDE,Yd as RasterSource,Xd as RasterTile,uf as RouteArea,Sc as SDF_EDGE,Tc as SDF_PX,ve as SIGN_SIZE,ea as SURFACE_CUT_BLEED,da as SURFACE_LEVEL_SCALE,ca as SURFACE_VERTEX_STRIDE,hf as ScaleControl,Qc as SdfAtlas,Bd as SymbolRenderer,$ as TAPER_METERS,lf as TerrainControl,Ma as TileID,q as Transform,wd as ZOOM_HOLD_MAX,xd as ZOOM_HOLD_MS,Md as abbreviateStreet,ua as addGround,ed as allowsVerticalWritingMode,qf as alongFadeFactor,_b as anonymousParts,Gd as arrowLabelOffset,gb as arrowVertices,ff as bridgePiers,ef as bridgeProfile,ud as buildAnchorGrid,sb as buildCells,De as buildRoadGraph,dc as buildRuntimeFill,cc as buildRuntimeLine,Sd as buildTile,Fa as buildZoomFor,b as cameraForBounds,Bb as cellBeyondFocus,yb as cellFacadeGone,ub as cellGround,vb as cellOutside,tb as cellPlanBuildCount,ba as chainAxes,Ia as changedBuckets,Qa as circleValuesOf,G as clampPixelRatio,z as classifyRenderer,ue as clipLineToRect,Cc as clipLineWithMetrics,O as clipPolygonParts,Se as closeSlits,ce as clusterProperties,sc as colorsOf,jb as contrastFactor,re as coordinateDigits,Va as coveringTiles,ta as createGround,vd as cullAnchorGrid,N as cutMargin,qa as dashArrayAt,ra as dashRow,oa as dataPaintT,zf as default,M as densifyLine,F as deviceHints,wf as distToSegment,mb as drapeTileMatrix,_a as easeCubicInOut,la as evaluateVec2,$b as extractFeature,Ab as facadeFocusBand,wb as facadeGoneDepth,E as facadeLite,xb as facadeView,Z as featureLevel,nb as featureRuns,db as fillFootprint,Jd as fillTileUrl,Dd as fitIconToText,zd as flatLegibilityPx,Ob as fogCutoffFor,Tb as fogCutoffOf,Nb as fogPlanes,Pb as fogRangeOf,Ub as fogWall,eb as footprintOf,se as formatHash,Od as formattedSections,T as generateBuildings,Sa as generateCircles,V as generateFill,Ec as generateGradientLine,ic as generateHeatmap,ya as generateLine,fa as generateSurface,Nd as generateSymbols,j as globeBasis,g as globeFlatMix,f as globeRadius,k as globeToLocal,va as groundAt,lc as heatmapRamp,nc as heatmapT,Qd as iconRotateOf,Hd as iconRotation,cb as insideFootprint,Hc as isStepGradient,_ as junctionIndex,ob as keptIndices,Rb as labelFogFade,Sb as labelReach,ye as laneArrow,He as laneGuides,qc as latRange,wc as layerOpacityOf,Da as layerZoomCeiling,Aa as layersAhead,Ga as layersToRebuild,af as ldRoadMesh,ie as levelForScreen,w as liftFields,Ac as lineClipsOf,Ic as lineGradientRamp,h as lngLatToUnit,ke as loadStyle,ka as makeFeaturePaint,Oc as mapLibreCenterAnchor,Nc as mapLibreClipLine,Wb as mapLibreFogDepth,Xb as mapLibreFogOpacity,Vb as mapLibreHorizon,Pc as mapLibreLineAnchors,Ad as mapLibreSpot,Re as meanWidth,ee as mercFeaturesToGeometry,Ua as mercatorBounds,Ha as mergeBuild,C as modelDecorShadows,D as modelDecorShare,B as modelLodFloor,hb as needsAdjust,ia as needsDataPaint,H as nextQualityDown,rc as numbersOf,Ea as overzoomPlan,uc as packDem,Xc as parseGlyphs,te as parseHash,v as parseLift,Zc as parseUnicodeRange,Kd as parseVectorTile,lb as patchUV,Wa as patternNameAt,Xa as patternOrigin,Yb as pickBuilding,Zb as pickFill,r as pitchIntent,p as pitchLimitAt,vc as pixelAlignShift,ld as placeAlongLine,Ce as placeMarking,xf as pointInRing,Bc as polylineLength,Fd as projectSymbolLine,A as qualityFor,y as qualityProfile,ne as queryRendered,oe as querySource,l as raySphere,L as refineLine,Je as relaxAngle,Ie as relaxCurvature,Le as relaxForMiter,Gb as reliefLight,tc as reliefStops,Jb as reliefTintOn,Wd as reserveTiles,le as resolveStyleUrls,Pd as resolveSymbolField,Rd as resolveTemplate,Oe as ribbonFromEdges,W as ribbonRing,X as ribbonShape,Ne as ringEdges,Me as roadEdges,Qe as roadHeights,Ge as roadMarkings,_e as roadMesh,Pe as roadSurfaces,K as roundLine,J as roundRing,Fe as roundRings,kb as saturationFactor,Yc as sdfFromAlpha,jd as shapeFormatted,hd as shapeText,gd as shapeTextCached,id as shapeVertical,yd as shouldCarry,P as snapCutsInward,Ee as snapRoadEnds,xe as speedSign,ib as spinWeights,wa as splitByGround,Ka as squareClosed,Kb as steepFogScale,La as stitchPieces,Ae as stopLine,Ed as stretchQuads,x as surfaceWritesDepth,aa as taperedWidth,rd as terrainOccludes,Ta as tileInBounds,fe as tileLayer,me as tileRingsToGeometry,Zd as tileUrl,de as toMercator,m as toPoint,$a as transitionOf,ma as translateTileUnits,na as translatedMatrix,i as unitToLngLat,Cb as unpackVector,of as validateStyle,pf as validateTheme,Cd as variableOffset,fd as verticalizePunctuation,Be as waffle,Kc as wallMaterialId,sd as worldAlongLine,Ra as writeCircleValues,Ja as yieldTargetsOf,ze as zebra,Ca as zoomCeilingOf}from'./chunk-MATVSBB5.js';export{r as navigram}from'./chunk-
|
|
1
|
+
export{td as ANCHOR_GRID,ge as AssetLoader,if as AttributionControl,$c as BASE_ICONS,R as BUILDING_HEIGHT_SCALE,S as BUILDING_POS_SCALE,Q as BUILDING_VERTEX_STRIDE,t as BoxZoomHandler,qb as CELL_GRID,Pa as CIRCLE_PROPS,Oa as CIRCLE_VERTEX_STRIDE,zc as CLIP_END,yc as CLIP_START,vf as Circle,u as CooperativeGesturesHandler,pa as DASH_MAX,ha as DATA_PAINT_EXT_STRIDE,ga as DATA_PAINT_STRIDE,kc as DEFAULT_HEATMAP_COLOR,dd as DEFAULT_ICONS,Jc as DEFAULT_SHADOWS,oc as DemLayerData,pc as DemLayers,$d as DemSource,Db as DemTile,_d as DemTileEntry,Na as DepthTarget,zb as FACADE_FOCUS_RANGE_M,rb as FACADE_GONE_MPP,he as FAR_LEVEL,U as FILL_VERTEX_STRIDE,kd as FLIP_HOLD_DEG,n as FOG_CUTOFF_MIN_M,Mb as FOG_FAR_MIN_M,Lb as FOG_NEAR_MIN_M,ja as FeaturePaint,Id as FeatureStatePainter,_c as FontFaces,jf as FullscreenControl,c as GLOBE_MAX_PITCH,e as GLOBE_ZOOM_MAX,d as GLOBE_ZOOM_MIN,Uc as GLYPH_BORDER,Vc as GLYPH_SIZE,Fc as GRADIENT_SIZE,Gc as GRADIENT_STEP_SIZE,sa as GROUND_SCALE,be as GeoJSONSource,kf as GeolocateControl,s as GestureHandler,mf as GlobeControl,Wc as GlyphSource,fb as GroundArrows,jc as HEATMAP_LAYOUT,hc as HEATMAP_PROPS,gc as HEATMAP_VERTEX_STRIDE,mc as HeatmapPass,ad as ICON_ALIASES,bd as ICON_SOURCES,cd as IconSource,Rc as ImageManager,pb as IndoorMask,Qb as LABEL_FOG_MAX,$e as LD_DEFAULTS,Y as LEVEL_LIMIT,Dc as LINE_PROGRESS_STRIDE,xa as LINE_VERTEX_STRIDE,xc as LayerOpacityTarget,Lc as LayerRenderer,a as LngLatBounds,nf as LogoControl,Za as MAPLIBRE_TRANSITION,bf as MAX_GRADE,Ve as MESH_BOTTOM,Ye as MESH_ISLAND,Xe as MESH_KERB_SIDE,We as MESH_KERB_TOP,Ue as MESH_SIDE,Te as MESH_TOP,df as MIN_PIER_HEIGHT_METERS,Ke as MITER_MAX_TURN,Mc as ML_EXTENT,yf as Map,rf as MapObject,pe as Marker,ae as MediaSource,Ld as MltTile,fc as ModelLayer,gf as NavigationControl,md as OCCLUSION_MAX_SAMPLES,pd as OCCLUSION_NEAR_M,qd as OCCLUSION_NEAR_SHARE,nd as OCCLUSION_STEP_M,od as OCCLUSION_TOLERANCE_M,ec as ObjectManager,je as Objects3DManager,Ya as PAINT_TRANSITIONS,cf as PIER_SPACING_METERS,o as PITCH_BY_ZOOM,za as PREFETCH_ZOOM,Ba as PREWARM_TYPES,bb as PaintStamp,ab as PaintTransitions,tf as Polygon,sf as Polyline,qe as Popup,I as QualityGovernor,Ib as RELIEF_DARK_KEEP,Hb as RELIEF_DARK_LUMA,Fb as RELIEF_LIGHT_ALTITUDE,Eb as RELIEF_LIGHT_AZIMUTH,Ud as RESERVE_MARGIN,Vd as RESERVE_MAX,Td as RESERVE_ZOOM_DELTA,Ze as ROAD_MESH_RADIUS_BY_CORNER,we as ROAD_SIGNS,bc as RUNTIME_FILL_STRIDE,ac as RUNTIME_LINE_STRIDE,Yd as RasterSource,Xd as RasterTile,uf as RouteArea,Sc as SDF_EDGE,Tc as SDF_PX,ve as SIGN_SIZE,ea as SURFACE_CUT_BLEED,da as SURFACE_LEVEL_SCALE,ca as SURFACE_VERTEX_STRIDE,hf as ScaleControl,Qc as SdfAtlas,Bd as SymbolRenderer,$ as TAPER_METERS,lf as TerrainControl,Ma as TileID,q as Transform,wd as ZOOM_HOLD_MAX,xd as ZOOM_HOLD_MS,Md as abbreviateStreet,ua as addGround,ed as allowsVerticalWritingMode,qf as alongFadeFactor,_b as anonymousParts,Gd as arrowLabelOffset,gb as arrowVertices,ff as bridgePiers,ef as bridgeProfile,ud as buildAnchorGrid,sb as buildCells,De as buildRoadGraph,dc as buildRuntimeFill,cc as buildRuntimeLine,Sd as buildTile,Fa as buildZoomFor,b as cameraForBounds,Bb as cellBeyondFocus,yb as cellFacadeGone,ub as cellGround,vb as cellOutside,tb as cellPlanBuildCount,ba as chainAxes,Ia as changedBuckets,Qa as circleValuesOf,G as clampPixelRatio,z as classifyRenderer,ue as clipLineToRect,Cc as clipLineWithMetrics,O as clipPolygonParts,Se as closeSlits,ce as clusterProperties,sc as colorsOf,jb as contrastFactor,re as coordinateDigits,Va as coveringTiles,ta as createGround,vd as cullAnchorGrid,N as cutMargin,qa as dashArrayAt,ra as dashRow,oa as dataPaintT,zf as default,M as densifyLine,F as deviceHints,wf as distToSegment,mb as drapeTileMatrix,_a as easeCubicInOut,la as evaluateVec2,$b as extractFeature,Ab as facadeFocusBand,wb as facadeGoneDepth,E as facadeLite,xb as facadeView,Z as featureLevel,nb as featureRuns,db as fillFootprint,Jd as fillTileUrl,Dd as fitIconToText,zd as flatLegibilityPx,Ob as fogCutoffFor,Tb as fogCutoffOf,Nb as fogPlanes,Pb as fogRangeOf,Ub as fogWall,eb as footprintOf,se as formatHash,Od as formattedSections,T as generateBuildings,Sa as generateCircles,V as generateFill,Ec as generateGradientLine,ic as generateHeatmap,ya as generateLine,fa as generateSurface,Nd as generateSymbols,j as globeBasis,g as globeFlatMix,f as globeRadius,k as globeToLocal,va as groundAt,lc as heatmapRamp,nc as heatmapT,Qd as iconRotateOf,Hd as iconRotation,cb as insideFootprint,Hc as isStepGradient,_ as junctionIndex,ob as keptIndices,Rb as labelFogFade,Sb as labelReach,ye as laneArrow,He as laneGuides,qc as latRange,wc as layerOpacityOf,Da as layerZoomCeiling,Aa as layersAhead,Ga as layersToRebuild,af as ldRoadMesh,ie as levelForScreen,w as liftFields,Ac as lineClipsOf,Ic as lineGradientRamp,h as lngLatToUnit,ke as loadStyle,ka as makeFeaturePaint,Oc as mapLibreCenterAnchor,Nc as mapLibreClipLine,Wb as mapLibreFogDepth,Xb as mapLibreFogOpacity,Vb as mapLibreHorizon,Pc as mapLibreLineAnchors,Ad as mapLibreSpot,Re as meanWidth,ee as mercFeaturesToGeometry,Ua as mercatorBounds,Ha as mergeBuild,C as modelDecorShadows,D as modelDecorShare,B as modelLodFloor,hb as needsAdjust,ia as needsDataPaint,H as nextQualityDown,rc as numbersOf,Ea as overzoomPlan,uc as packDem,Xc as parseGlyphs,te as parseHash,v as parseLift,Zc as parseUnicodeRange,Kd as parseVectorTile,lb as patchUV,Wa as patternNameAt,Xa as patternOrigin,Yb as pickBuilding,Zb as pickFill,r as pitchIntent,p as pitchLimitAt,vc as pixelAlignShift,ld as placeAlongLine,Ce as placeMarking,xf as pointInRing,Bc as polylineLength,Fd as projectSymbolLine,A as qualityFor,y as qualityProfile,ne as queryRendered,oe as querySource,l as raySphere,L as refineLine,Je as relaxAngle,Ie as relaxCurvature,Le as relaxForMiter,Gb as reliefLight,tc as reliefStops,Jb as reliefTintOn,Wd as reserveTiles,le as resolveStyleUrls,Pd as resolveSymbolField,Rd as resolveTemplate,Oe as ribbonFromEdges,W as ribbonRing,X as ribbonShape,Ne as ringEdges,Me as roadEdges,Qe as roadHeights,Ge as roadMarkings,_e as roadMesh,Pe as roadSurfaces,K as roundLine,J as roundRing,Fe as roundRings,kb as saturationFactor,Yc as sdfFromAlpha,jd as shapeFormatted,hd as shapeText,gd as shapeTextCached,id as shapeVertical,yd as shouldCarry,P as snapCutsInward,Ee as snapRoadEnds,xe as speedSign,ib as spinWeights,wa as splitByGround,Ka as squareClosed,Kb as steepFogScale,La as stitchPieces,Ae as stopLine,Ed as stretchQuads,x as surfaceWritesDepth,aa as taperedWidth,rd as terrainOccludes,Ta as tileInBounds,fe as tileLayer,me as tileRingsToGeometry,Zd as tileUrl,de as toMercator,m as toPoint,$a as transitionOf,ma as translateTileUnits,na as translatedMatrix,i as unitToLngLat,Cb as unpackVector,of as validateStyle,pf as validateTheme,Cd as variableOffset,fd as verticalizePunctuation,Be as waffle,Kc as wallMaterialId,sd as worldAlongLine,Ra as writeCircleValues,Ja as yieldTargetsOf,ze as zebra,Ca as zoomCeilingOf}from'./chunk-MATVSBB5.js';export{r as navigram}from'./chunk-CMTEQIP7.js';export{a as GeomType,d as VectorTile,b as VectorTileFeature,c as VectorTileLayer,e as splitPolygons}from'./chunk-WVYYP6PV.js';import'./chunk-TJGUBCJS.js';export{lc as BASE_SOURCE,zd as CITY_STYLE,Mc as DEFAULT_FOG,Oc as DEFAULT_LIGHT,Nc as DEFAULT_MAPLIBRE_LIGHT,Lc as DEFAULT_SKY,vd as DEFAULT_STYLE,k as EARTH_CIRCUMFERENCE,Zb as EXPRESSION_OPERATORS,Dc as FeatureStateStore,Ob as GLOBAL_STATE,cd as HOST_SOURCE_KEY,jd as MAPLIBRE_STYLES,gd as MAPLIBRE_STYLE_BASE,Ec as MAPLIBRE_SUPPORT,l as MAX_LATITUDE,hd as MLIGHT_CITY_STYLE,id as MNIGHT_CITY_STYLE,Fd as MODEL_VERTEX_STRIDE,Ne as Model,Qc as OSMGL_FORMAT_VERSION,Ad as OSMGL_STYLES,Pc as OSMGL_VERSION_KEY,yd as RELIEF_STYLE,xd as SOFT_STYLE,mc as SPLIT_SEP,Fc as STYLE_REFERENCE,Hc as STYLE_REFERENCE_EXPRESSIONS,Ic as STYLE_REFERENCE_EXPRESSION_GROUPS,Gc as STYLE_REFERENCE_V2_FLAGS,oc as SYMBOL_DATA_FIELDS,Cc as StateIndexBuilder,td as Style,sc as SymbolDataBuilder,wd as TERRAIN_STYLE,Dd as THEMES,j as TILE_SIZE,v as altitudeFromMercatorZ,bd as applyTheme,Vb as asFormatted,Wb as asImage,kd as builtinMapLibreStyle,Cd as builtinOsmglStyle,t as circumferenceAtLatitude,o as clampLat,od as convertMapLibreFilter,nd as convertMapLibreValue,dc as evaluateColor,Rb as evaluateExpression,cc as evaluateNumber,Ub as expressionColor,_b as expressionIssues,Tb as expressionNumber,bc as featureContext,ud as featureDrivenPaint,Ac as featureStateIdOf,md as importMapLibreStyle,Kc as isDemLayer,Qb as isExpression,ld as isMapLibreStyle,Tc as isOsmglV2,Xb as isSupportedScript,s as latFromMercatorY,Wc as layerV1toV2,pc as layoutAtZoom,r as lngFromMercatorX,pd as loadMapLibreStyle,gc as matchesFilter,z as mercatorMetersPerTile,p as mercatorX,q as mercatorY,u as mercatorZFromAltitude,x as metersPerPixel,y as metersPerTile,Hd as parseGlb,Gd as parseGlbAsync,Me as parseGlbOffThread,w as pixelsPerMeter,ed as primaryVectorSource,zc as promoteName,Yc as propertyV2toV1,Pb as replaceGlobalState,uc as resolveSymbolColor,wc as resolveSymbolItem,tc as resolveSymbolNumber,vc as resolveSymbolVec2,xc as rewriteSymbolPaint,nc as splitBucketKey,Xc as styleV1toV2,Ed as styleWithTheme,rc as symbolDataPlan,_c as themeToInternal,Zc as themeV1toV2,A as tileOriginMeters,m as toLngLat,ad as toMapLibreStyle,h as tryParseColor,yc as usesFeatureState,dd as wantsHostSource,fd as withHostSource,n as worldSize,qc as zoomCurveOf}from'./chunk-PKZZZPZD.js';//# sourceMappingURL=osmgl.js.map
|
|
2
2
|
//# sourceMappingURL=osmgl.js.map
|
package/package.json
CHANGED
package/dist/chunk-2GMD3Q3A.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import {Le as Le$1,$ as $$1,X,x,Ne as Ne$1,Od}from'./chunk-PKZZZPZD.js';import*as Vr from'polygon-clipping';var Io=100,ko=50,No=30,So=12e3,Fo=60,ie=3,Co=1e4,Oo=1e3,Xo=2e3;function wn(t){return t.provider==="network"?true:t.provider==="gps"||t.provider==="fused"?false:t.accuracyM!=null&&t.accuracyM>No}var vt=t=>t.accuracyM!=null&&t.accuracyM>0?t.accuracyM:null,fe=t=>t.ageMs!=null&&t.ageMs>Co,_n=t=>t&&t.speedMps!=null&&t.speedMps>=0?t.speedMps:0;function ae(t,n){let e=Math.max((n.timeMs-t.timeMs)/1e3,.001);return X(t.pos,n.pos)<=Math.max(Fo,1.5*_n(t)+15)*e+(vt(t)??0)+(vt(n)??0)}var vn=class{constructor(){this.last=null;this.lastGpsMs=-1/0;this.rejects=0;this.pending=null;this.norm=null;this.staleRun=0;this.staleLastMs=-1/0;this.streams=new Map;}skewMs(n){return this.streams.get(n??"?")?.skew??0}normalize(n){let e=n.ageMs;if(e==null||!Number.isFinite(e))return n;let o=n.provider??"?",r=this.streams.get(o);if(!r)r={timeMs:n.timeMs,ageMs:e,minAge:e,skew:0},this.streams.set(o,r);else {let s=n.timeMs-r.timeMs;s>0&&Math.abs(e-r.ageMs)<=Math.min(Oo,s/2)?(r.minAge=Math.min(r.minAge,e),r.skew=r.minAge>Xo?r.minAge:0):r.minAge=e,r.timeMs=n.timeMs,r.ageMs=e;}let i=Math.min(r.skew,Math.max(0,e));return i>0?{...n,timeMs:n.timeMs+i,ageMs:e-i}:n}accept(n){let e=this.normalize(n);this.norm=e;let o=this.last,r=wn(e),i=fe(e);o&&e.timeMs<=o.timeMs&&!i?(this.staleRun=e.timeMs>this.staleLastMs?this.staleRun+1:1,this.staleLastMs=e.timeMs,this.staleRun>=ie&&(this.last=o=null,this.lastGpsMs=-1/0,this.pending=null,this.rejects=0)):i||(this.staleRun=0);let s=e.timeMs-this.lastGpsMs<So,a=vt(e),u="ok";if(o&&e.timeMs<=o.timeMs||i)u="stale";else if(r&&s)u="network";else if(s&&a!=null&&a>Io)u="inaccurate";else if(o&&!r&&wn(o))u="ok";else if(o){let l=(e.timeMs-o.timeMs)/1e3,c=vt(o),m=Math.max(5,(_n(e)+_n(o))/2);s&&a!=null&&c!=null&&a>c+m*l?u="worse":ae(o,e)||(u="jump");}if(u!=="ok"&&u!=="stale"&&u!=="network"){let l=this.pending;r&&l!=null&&!wn(l)||(this.rejects=l&&e.timeMs>l.timeMs&&ae(l,e)?this.rejects+1:1,this.pending=e,this.rejects>=ie&&(u="ok"));}return u==="ok"&&(this.last=e,this.rejects=0,this.pending=null,this.staleRun=0,r||(this.lastGpsMs=e.timeMs)),u}reset(){this.last=null,this.lastGpsMs=-1/0,this.rejects=0,this.pending=null,this.norm=null,this.staleRun=0,this.staleLastMs=-1/0,this.streams.clear();}},Yo=80,To=150,Do=3,Bo=50,Ho=2,$o=60,Go=25,Vo=10,jo=3,Ko=15,Uo=5e3;function ue(t,n){let e=0,o=t.cum.length-1;for(;e+1<o;){let r=e+o>>1;t.cum[r]<=n?e=r:o=r;}return e}function le(t,n,e,o){let r={dist:Math.max(0,e),off:1/0};if(t.coords.length<2)return r;let i=Math.max(0,ue(t,Math.max(0,e))),s=Math.min(t.coords.length-2,ue(t,Math.min(t.total,o)));for(let a=i;a<=s;a++){let u=$$1(n,t.coords[a],t.coords[a+1],t.lat0),l=t.cum[a]+(t.cum[a+1]-t.cum[a])*u.t,c=Math.max(e,Math.min(o,l)),m=c===l?u.off:X(n,t.positionAt(c));m<r.off&&(r={off:m,dist:c});}return r}var ce=class{constructor(){this.dist=null;this.last=null;this.back=0;this.jumps=0;this.accurateMs=-1/0;}update(n,e){let o=vt(e)??0,r=this.dist,i=this.last,s=i?Math.max(0,(e.timeMs-i.timeMs)/1e3):0,a=e.speedMps!=null&&e.speedMps>=0?e.speedMps:null,u,l,c=(Math.max(a??0,10)+10)*Math.max(s,1)*1.5+o+30;if(r==null)u=n.snap(e.pos,null);else {let b=r-Math.max(Yo,o),d=Math.max(a??0,jo)*Math.max(s,1)*1.5+o+Ko;u=le(n,e.pos,b,r+d);let M=To+Math.max(a??0,10)*Math.min(s,10)*1.5;if(M>d){let x=le(n,e.pos,b,r+M);x.off+Vo<u.off&&(u=x);}}l=u.off;let m=o>ko;if(r!=null&&u.off>$o&&!m){let b=n.snap(e.pos,null);b.off<u.off&&(l=b.off,b.off<=Math.max(Go,o)&&(u=b));}if(m&&r!=null&&e.timeMs-this.accurateMs<Uo)return {dist:r,off:Math.max(0,l-o),speedMps:a??0,reversed:false};m||(this.accurateMs=e.timeMs);let h=u.dist,f=false;r!=null&&(m&&h<r?h=r:h<r?(this.jumps=0,r-h>=Bo?++this.back>=Do?(f=true,this.back=0):h=r:(this.back=0,h=r)):h-r>c?(this.back=0,++this.jumps<Ho?h=r:this.jumps=0):(this.back=0,this.jumps=0));let p=a??(r!=null&&s>0?Math.max(0,h-r)/s:0);return this.dist=h,this.last=e,{dist:h,off:l,speedMps:p,reversed:f}}reset(){this.dist=null,this.last=null,this.back=0,this.jumps=0,this.accurateMs=-1/0;}},me=200,Wo=1500,zo=500,qo=.5,Zo=3,Jo=15,he=class{constructor(){this.filter=new vn;this.fix=null;this.provisional=false;this.from=null;this.t0=0;this.dur=0;this.lastPushMs=-1/0;this.held=false;}push(n,e){this.held=false;let o=this.filter.accept(n),r=o==="stale"&&this.fix==null&&fe(this.filter.norm??n);if(o!=="ok"&&!r)return false;let i=this.fix;if(i&&!this.provisional&&n.speedMps!=null&&n.speedMps>=0&&n.speedMps<qo&&X(i.pos,n.pos)<=Math.min(Jo,Math.max(Zo,vt(n)??0)))return this.held=true,false;let s=this.at(e),a=e-this.lastPushMs;return this.from=s,this.dur=s==null||this.provisional||X(s,n.pos)>zo?0:Math.min(Wo,Math.max(me,Number.isFinite(a)?a:me)),this.t0=e,this.fix=n,this.provisional=r,this.lastPushMs=e,true}at(n){let e=this.fix;if(!e)return null;let o=this.from;if(!o||this.dur<=0)return e.pos;let r=Math.min(1,Math.max(0,(n-this.t0)/this.dur));return [o[0]+(e.pos[0]-o[0])*r,o[1]+(e.pos[1]-o[1])*r]}get glideMs(){return this.dur}moving(n){return this.fix!=null&&this.dur>0&&n-this.t0<this.dur}reset(){this.filter.reset(),this.fix=null,this.provisional=false,this.from=null,this.dur=0,this.lastPushMs=-1/0,this.held=false;}};var Qo=["arrow","arrow3d","sedan","pickup","suv"],Ns={arrow:"Стрелка",arrow3d:"3D-стрелка",sedan:"Седан",pickup:"Пикап",suv:"Внедорожник"};function Ss(t){let n=(t||"").trim().toLowerCase();return Qo.includes(n)?n:"arrow"}var Pn={minPx:52,lift:.02,chamfer:.12},Cn={sedan:{length:4.6,width:.9,clearance:.26,color:"#d93a30",sections:[[0,.8,.62,.7,.66],[.14,.9,.8,.82,.84],[1.2,.9,.92,.8,.97],[2,.87,.96,.64,1.42],[2.52,.87,.96,.64,1.43],[2.62,.87,.96,.64,1.43],[3.05,.87,.96,.64,1.41],[3.8,.9,.98,.8,1.04],[4.46,.9,.96,.8,1],[4.6,.82,.8,.72,.84]],segs:"BBWRPRWBB",wheel:{r:.33,w:.22,axles:[.88,3.72]}},pickup:{length:5.3,width:.95,clearance:.36,color:"#2f9e4f",sections:[[0,.86,.8,.8,.84],[.14,.95,1,.88,1.04],[1.45,.95,1.1,.88,1.15],[2.08,.93,1.14,.74,1.8],[2.46,.93,1.14,.74,1.81],[2.56,.93,1.14,.74,1.81],[2.86,.93,1.14,.74,1.79],[2.9,.94,1.14,.8,1.22],[2.94,.95,1.14,.85,.74],[5.16,.95,1.14,.85,.74],[5.22,.95,1.12,.88,1.12],[5.3,.88,1,.82,1.02]],segs:"BBWRPRWDDDB",wheel:{r:.4,w:.26,axles:[1,4.32]}},suv:{length:4.8,width:.95,clearance:.32,color:"#f2b51d",sections:[[0,.86,.78,.8,.82],[.14,.95,.98,.88,1.02],[1.05,.95,1.06,.88,1.1],[1.78,.93,1.1,.8,1.72],[2.52,.93,1.1,.8,1.73],[2.62,.93,1.1,.8,1.73],[3.52,.93,1.1,.8,1.72],[3.62,.93,1.1,.8,1.72],[4.56,.93,1.1,.8,1.7],[4.72,.95,1.04,.88,1.1],[4.8,.88,.92,.82,.96]],segs:"BBWRPRPRWB",wheel:{r:.38,w:.25,axles:[.86,3.96]},rails:[2,4.3,.62,.07]}},Yt={length:3.5,outer:[[0,-2.2515],[1.7775,2.0145],[0,1.0072],[-1.7775,2.0145]],corners:[[.14,.14,.3846],[.1623,.367,.325],[.157,.157,.87],[.367,.1623,.325]],steps:8,base:.03,wall:.3,rim:[.14,.1],dome:[.1,.22],crown:.12,center:[0,.1],arc:[[1,0],[.96,.28],[.8,.6],[.6,.8],[.28,.96],[0,1]]},En={day:{high:"#3f7dff",top:"#2f6bff",low:"#2050d8",bevel:"#ffffff",side:"#1a3f9e"},night:{high:"#2c5ab8",top:"#2450b0",low:"#1c4098",bevel:"#e8eefc",side:"#163478",highGlow:[.24,.38,.5],topGlow:[.22,.36,.52],lowGlow:[.18,.32,.52],bevelGlow:[.36,.38,.44],sideGlow:[.13,.24,.5]}},In=[{name:"body",color:[0,0,0,1],metallic:0,roughness:.55},{name:"glass",color:[.1,.14,.19,1],metallic:0,roughness:.18},{name:"trim",color:[.13,.14,.16,1],metallic:0,roughness:.8},{name:"bed",color:[.22,.23,.25,1],metallic:0,roughness:.9},{name:"tire",color:[.09,.095,.1,1],metallic:0,roughness:.95},{name:"hub",color:[.74,.76,.79,1],metallic:0,roughness:.4},{name:"head",color:[1,.97,.86,1],metallic:0,roughness:.3,emissive:[.8,.76,.6]},{name:"tail",color:[.82,.1,.1,1],metallic:0,roughness:.3,emissive:[.45,.03,.03]},{name:"shadow",color:[0,0,0,.26],metallic:0,roughness:1,blend:true},{name:"shadow-soft",color:[0,0,0,.12],metallic:0,roughness:1,blend:true}];function kn(t){let n=parseInt(t.slice(1),16);return [(n>>16&255)/255,(n>>8&255)/255,(n&255)/255,1]}function tr(){let t=Math.sqrt(3)/2;return [[0,1],[.5,t],[t,.5],[1,0],[t,-0.5],[.5,-t],[0,-1],[-0.5,-t],[-t,-0.5],[-1,0],[-t,.5],[-0.5,t]]}function nr(t){let n=(e,o,r,i)=>i?{name:e,color:kn(o),metallic:0,roughness:r,emissive:i}:{name:e,color:kn(o),metallic:0,roughness:r};return [n("top-high",t.high,.22,t.highGlow),n("top",t.top,.2,t.topGlow),n("top-low",t.low,.25,t.lowGlow),n("bevel",t.bevel,.3,t.bevelGlow),n("side",t.side,.35,t.sideGlow),In[8],In[9]]}var zt=class{constructor(n){this.parts=n.map(e=>({material:e,positions:[],normals:[]}));}part(n){for(let e of this.parts)if(e.material.name===n)return e;throw new Error(`nav-car: нет материала ${n}`)}tri(n,e,o,r,i){let s=o[0]-e[0],a=o[1]-e[1],u=o[2]-e[2],l=r[0]-e[0],c=r[1]-e[1],m=r[2]-e[2],h=a*m-u*c,f=u*l-s*m,p=s*c-a*l,b=Math.sqrt(h*h+f*f+p*p);if(b<1e-9)return;h/=b,f/=b,p/=b;let d=o,M=r;h*i[0]+f*i[1]+p*i[2]<0&&(d=r,M=o,h=-h,f=-f,p=-p);let x=this.part(n);for(let g of [e,d,M])x.positions.push(g[0],g[1],g[2]),x.normals.push(h,f,p);}quad(n,e,o,r,i,s,a=false){a?(this.tri(n,e,o,i,s),this.tri(n,o,r,i,s)):(this.tri(n,e,o,r,s),this.tri(n,e,r,i,s));}triN(n,e,o,r,i,s,a){let u=o[0]-e[0],l=o[1]-e[1],c=o[2]-e[2],m=r[0]-e[0],h=r[1]-e[1],f=r[2]-e[2],p=l*f-c*h,b=c*m-u*f,d=u*h-l*m;if(Math.sqrt(p*p+b*b+d*d)<1e-9)return;let x=i[0]+s[0]+a[0],g=i[1]+s[1]+a[1],L=i[2]+s[2]+a[2],R=o,w=r,v=s,k=a;p*x+b*g+d*L<0&&(R=r,w=o,v=a,k=s);let S=this.part(n);for(let[N,Y]of [[e,i],[R,v],[w,k]])S.positions.push(N[0],N[1],N[2]),S.normals.push(Y[0],Y[1],Y[2]);}quadN(n,e,o,r,i,s,a,u,l,c){c?(this.triN(n,e,o,i,s,a,l),this.triN(n,o,r,i,a,u,l)):(this.triN(n,e,o,r,s,a,u),this.triN(n,e,r,i,s,u,l));}fan(n,e,o){let r=0,i=0,s=0;for(let l of e)r+=l[0],i+=l[1],s+=l[2];let a=e.length,u=[r/a,i/a,s/a];for(let l=0;l<a;l++)this.tri(n,u,e[l],e[(l+1)%a],o);}box(n,e,o,r,i,s,a){let u=(l,c,m)=>[l,c,m];this.quad(n,u(e,o,r),u(i,o,r),u(i,o,a),u(e,o,a),[0,-1,0]),this.quad(n,u(e,s,r),u(i,s,r),u(i,s,a),u(e,s,a),[0,1,0]),this.quad(n,u(e,o,r),u(e,s,r),u(e,s,a),u(e,o,a),[-1,0,0]),this.quad(n,u(i,o,r),u(i,s,r),u(i,s,a),u(i,o,a),[1,0,0]),this.quad(n,u(e,o,r),u(i,o,r),u(i,s,r),u(e,s,r),[0,0,-1]),this.quad(n,u(e,o,a),u(i,o,a),u(i,s,a),u(e,s,a),[0,0,1]);}};function er(t,n){let[,e,o,r,i]=n,s=t.clearance,a=Pn.chamfer;return [[-e*.9,s],[e*.9,s],[e,s+a],[e,o],[r,i],[-r,i],[-e,o],[-e,s+a]]}function or(t,n){return n===0?"trim":n===3||n===5?t==="W"||t==="R"?"glass":t==="D"?"bed":"body":n===4?t==="W"?"glass":t==="D"?"bed":"body":"body"}function rr(t){let n=Cn[t],e=kn(n.color),o=new zt(In.map(x=>x.name==="body"?{...x,color:e}:x)),r=n.length/2,i=n.sections,s=i.map(x=>er(n,x)),a=(x,g)=>[s[x][g][0],s[x][g][1],i[x][0]-r];for(let x=0;x+1<i.length;x++){let g=n.segs[x];for(let L=0;L<8;L++){let R=(L+1)%8,w=s[x][R][0]-s[x][L][0],v=s[x][R][1]-s[x][L][1];Math.abs(w)+Math.abs(v)<1e-9&&(w=s[x+1][R][0]-s[x+1][L][0],v=s[x+1][R][1]-s[x+1][L][1]),o.quad(or(g,L),a(x,L),a(x,R),a(x+1,R),a(x+1,L),[v,-w,0],L>=5);}}let u=i.length-1;o.fan("body",s[0].map((x,g)=>a(0,g)),[0,0,-1]),o.fan("body",s[u].map((x,g)=>a(u,g)),[0,0,1]);let l=i[0],c=i[u],m=l[2]-.1,h=c[2]-.1;for(let x of [-1,1]){let g=x*(l[1]-.26);o.box("head",g-.15,m-.05,-r-.02,g+.15,m+.05,-r+.06);let L=x*(c[1]-.2);o.box("tail",L-.14,h-.05,r-.06,L+.14,h+.05,r+.02);}if(n.rails){let[x,g,L,R]=n.rails,w=0;for(let v of i)v[0]>=x&&v[0]<=g&&(w=Math.max(w,v[4]));for(let v of [-1,1])o.box("trim",v*L-.03,w-.01,x-r,v*L+.03,w+R,g-r);}let f=tr(),{r:p,w:b,axles:d}=n.wheel;for(let x of d){let g=x-r;for(let L of [-1,1]){let R=L*(n.width+.03),w=L*(n.width+.03-b),v=(S,N,Y)=>[S,p+Y*f[N%12][0],g+Y*f[N%12][1]];for(let S=0;S<12;S++){let N=[0,f[S][0]+f[(S+1)%12][0],f[S][1]+f[(S+1)%12][1]];o.quad("tire",v(w,S,p),v(R,S,p),v(R,S+1,p),v(w,S+1,p),N);}let k=[L,0,0];o.fan("tire",Array.from({length:12},(S,N)=>v(R,N,p)),k),o.fan("hub",Array.from({length:12},(S,N)=>v(R+L*.012,N,p*.55)),k);}}let M=(x,g,L,R,w)=>{let v=[[L-w,g,-R],[L,g,-R+w],[L,g,R-w],[L-w,g,R],[-L+w,g,R],[-L,g,R-w],[-L,g,-R+w],[-L+w,g,-R]];o.fan(x,v,[0,1,0]);};return M("shadow-soft",.012,n.width+.3,r+.34,.5),M("shadow",.02,n.width+.1,r+.12,.3),o}function Me(){let t=Yt,n=t.outer,e=t.steps,o=[];for(let a=0;a<4;a++){let[u,l,c]=t.corners[a],m=n[a],h=n[(a+3)%4],f=n[(a+1)%4],p=m[0]+(h[0]-m[0])*u,b=m[1]+(h[1]-m[1])*u,d=m[0]+(f[0]-m[0])*l,M=m[1]+(f[1]-m[1])*l;for(let x=0;x<=e;x++){let g=x/e,L=1-g,R=L*L,w=g*g,v=2*c*(g*L),k=R+w+v;o.push([(R*p+w*d+v*m[0])/k,(R*b+w*M+v*m[1])/k]);}}let r=o.length,i=[];for(let a=0;a<r;a++){let u=o[a],l=o[(a+1)%r],c=l[0]-u[0],m=l[1]-u[1],h=Math.sqrt(c*c+m*m);i.push([m/h,-c/h]);}let s=[];for(let a=0;a<r;a++){let u=i[(a+r-1)%r],l=i[a],c=u[0]+l[0],m=u[1]+l[1],h=Math.sqrt(c*c+m*m);s.push([c/h,m/h]);}return {points:o,normals:s}}function be(t,n,e,o){return Yt.arc.map(([r,i])=>{let s=r*o,a=i*e,u=Math.sqrt(s*s+a*a);return {inset:t+e*(1-r),y:n+o*i,nh:s/u,nv:a/u}})}function sr(t){let n=Yt,e=new zt(nr(t?En.night:En.day)),{points:o,normals:r}=Me(),i=o.length,s=(b,d)=>[o[d][0]-r[d][0]*b.inset,b.y,o[d][1]-r[d][1]*b.inset],a=(b,d)=>[r[d][0]*b.nh,b.nv,r[d][1]*b.nh],u=(b,d,M)=>{for(let x=0;x<i;x++){let g=(x+1)%i,L=o[x][0]+o[g][0]<0;e.quadN(b,s(d,x),s(d,g),s(M,g),s(M,x),a(d,x),a(d,g),a(M,g),a(M,x),L);}};u("side",{inset:0,y:n.base,nh:1,nv:0},{inset:0,y:n.wall,nh:1,nv:0});let l=be(0,n.wall,n.rim[0],n.rim[1]);for(let b=0;b+1<l.length;b++)u("bevel",l[b],l[b+1]);let c=be(n.rim[0],n.wall+n.rim[1],n.dome[0],n.dome[1]).slice(0,n.arc.length-1);for(let b=0;b+1<c.length;b++)u(b<2?"top-low":"top",c[b],c[b+1]);let m=c[c.length-1],h=[0,1,0],f=[n.center[0],m.y+n.crown,n.center[1]];for(let b=0;b<i;b++){let d=(b+1)%i;e.triN("top-high",f,s(m,b),s(m,d),h,a(m,b),a(m,d));}let p=(b,d,M)=>{let x=n.center[0],g=n.center[1],L=[x,d,g],R=w=>[x+(o[w][0]-x)*M,d,g+(o[w][1]-g)*M];for(let w=0;w<i;w++)e.tri(b,L,R(w),R((w+1)%i),h);};return p("shadow-soft",.012,1.24),p("shadow",.02,1.08),e}function ir(t,n=false){return (t==="arrow3d"?sr(n):rr(t)).parts.filter(o=>o.positions.length>0)}function qt(t,n){let e=t<0,o=Math.abs(t),r=1;for(let a=0;a<n;a++)r*=10;let i=Math.floor(o/r),s=String(o-i*r);for(;s.length<n;)s="0"+s;return (e?"-":"")+String(i)+(n>0?"."+s:"")}function Nn(t){let n=Math.floor(Math.abs(t)*1e4+.5);return qt(t<0&&n>0?-n:n,4)}function H(t){let n=Math.floor(Math.abs(t)*10+.5);return qt(t<0&&n>0?-n:n,1)}var pe=t=>"["+t.map(Nn).join(",")+"]";function de(t,n,e){for(let o=0;o<e.length;o++)t.setFloat32(n+o*4,e[o],true);}function Zt(t,n=false){return t==="arrow3d"&&n?"arrow3d-night":t}function xe(t,n=false){let e=ir(t,n),o=Zt(t,n),r=0;for(let g of e)r+=g.positions.length*4*2+g.positions.length/3*4;let i=new DataView(new ArrayBuffer(r)),s=[],a=[],u=[],l=[],c=0;e.forEach((g,L)=>{let R=g.positions.length/3,w=g.material,v=[1/0,1/0,1/0],k=[-1/0,-1/0,-1/0];for(let F=0;F<R;F++)for(let K=0;K<3;K++){let y=g.positions[F*3+K];y<v[K]&&(v[K]=y),y>k[K]&&(k[K]=y);}let S=F=>qt(Math.floor(F*1e4),4),N=F=>qt(Math.ceil(F*1e4),4);de(i,c,g.positions),l.push(`{"buffer":0,"byteOffset":${c},"byteLength":${R*12},"target":34962}`),c+=R*12,de(i,c,g.normals),l.push(`{"buffer":0,"byteOffset":${c},"byteLength":${R*12},"target":34962}`),c+=R*12;for(let F=0;F<R;F++)i.setUint32(c+F*4,F,true);l.push(`{"buffer":0,"byteOffset":${c},"byteLength":${R*4},"target":34963}`),c+=R*4;let Y=L*3;u.push(`{"bufferView":${Y},"componentType":5126,"count":${R},"type":"VEC3","min":[${v.map(S).join(",")}],"max":[${k.map(N).join(",")}]}`),u.push(`{"bufferView":${Y+1},"componentType":5126,"count":${R},"type":"VEC3"}`),u.push(`{"bufferView":${Y+2},"componentType":5125,"count":${R},"type":"SCALAR"}`),s.push(`{"attributes":{"POSITION":${Y},"NORMAL":${Y+1}},"indices":${Y+2},"material":${L},"mode":4}`);let D=`{"name":"${w.name}","pbrMetallicRoughness":{"baseColorFactor":${pe(w.color)},"metallicFactor":${Nn(w.metallic)},"roughnessFactor":${Nn(w.roughness)}}`;w.emissive&&(D+=`,"emissiveFactor":${pe(w.emissive)}`),w.blend&&(D+=',"alphaMode":"BLEND","doubleSided":true'),a.push(D+"}");});let m=`{"asset":{"version":"2.0","generator":"osmgl nav-car"},"scene":0,"scenes":[{"nodes":[0]}],"nodes":[{"mesh":0,"name":"${o}"}],"meshes":[{"name":"${o}","primitives":[${s.join(",")}]}],"materials":[${a.join(",")}],"accessors":[${u.join(",")}],"bufferViews":[${l.join(",")}],"buffers":[{"byteLength":${r}}]}`,h=new TextEncoder().encode(m),f=(4-h.length%4)%4,p=h.length+f,b=20+p+8+r,d=new Uint8Array(b),M=new DataView(d.buffer);M.setUint32(0,1179937895,true),M.setUint32(4,2,true),M.setUint32(8,b,true),M.setUint32(12,p,true),M.setUint32(16,1313821514,true),d.set(h,20);for(let g=0;g<f;g++)d[20+h.length+g]=32;let x=20+p;return M.setUint32(x,r,true),M.setUint32(x+4,5130562,true),d.set(new Uint8Array(i.buffer),x+8),d}function Fs(t){let n=2166136261;for(let e=0;e<t.length;e++)n^=t[e],n=Math.imul(n,16777619)>>>0;return (n>>>0).toString(16).padStart(8,"0")}function ge(t,n,e,o,r=0){if(t==="arrow")return null;let i=t==="arrow3d"?Yt.length:Cn[t].length,s=Math.max(1,Pn.minPx*o/i),a=(e%360+360)%360;return {lng:n[0],lat:n[1],altitude:Le$1+Pn.lift+Math.max(0,r),rotation:a,scale:s}}function Cs(t,n){let e=0;for(let o of t){let r=o.stations,i=o.heights,s=Math.min(r.length,i.length);if(s===0||n<r[0]||n>r[s-1])continue;let a=i[s-1];for(let u=0;u+1<s;u++)if(n<=r[u+1]){let l=r[u+1]-r[u],c=l>0?(n-r[u])/l:0;a=i[u]+(i[u+1]-i[u])*c;break}a>e&&(e=a);}return e}var Sn=48,Fn=24;function Os(t){let n=ar(t);return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n.width} ${n.height}">`+n.paths.map(e=>`<path d="${e.d}" fill="${e.fill}"/>`).join("")+"</svg>"}function An(t,n,e){return `M${H(t-e)} ${H(n)}a${H(e)} ${H(e)} 0 1 0 ${H(2*e)} 0a${H(e)} ${H(e)} 0 1 0 ${H(-2*e)} 0Z`}function ar(t){if(t==="arrow"){let c=[[0,-19],[13,15],[0,7],[-13,15]].map(([m,h])=>[24+m*.475*.95,12+h*.475*.95]);return {width:Sn,height:Fn,paths:[{d:An(24,12,11),fill:"#2f6bff"},{d:"M"+c.map(([m,h])=>`${H(m)} ${H(h)}`).join("L")+"Z",fill:"#ffffff"}]}}if(t==="arrow3d")return ur();let n=Cn[t],e=44/n.length,o=l=>2+l*e,r=l=>21-l*e,i=n.sections,s=i.map(l=>`${H(o(l[0]))} ${H(r(Math.max(l[2],l[4])))}`),a=i.slice().reverse().map(l=>`${H(o(l[0]))} ${H(r(n.clearance))}`),u=[{d:"M"+s.concat(a).join("L")+"Z",fill:n.color}];for(let l=0;l+1<i.length;l++){let c=n.segs[l];if(c!=="W"&&c!=="R")continue;let m=i[l],h=i[l+1],f=b=>b[2]+(b[4]-b[2])*.82,p=[[o(m[0]),r(m[2])],[o(h[0]),r(h[2])],[o(h[0]),r(f(h))],[o(m[0]),r(f(m))]];u.push({d:"M"+p.map(([b,d])=>`${H(b)} ${H(d)}`).join("L")+"Z",fill:"#1c2733"});}for(let l of n.wheel.axles)u.push({d:An(o(l),r(n.wheel.r),n.wheel.r*e),fill:"#17181a"}),u.push({d:An(o(l),r(n.wheel.r),n.wheel.r*e*.5),fill:"#bdc1c7"});return {width:Sn,height:Fn,paths:u}}function ur(){let t=Yt,n=En.day,e=22/t.length,o=(t.outer[0][1]+t.outer[1][1])/2,{points:r,normals:i}=Me(),s=a=>"M"+r.map((u,l)=>`${H(24+(u[0]-i[l][0]*a)*e)} ${H(12+(u[1]-i[l][1]*a-o)*e)}`).join("L")+"Z";return {width:Sn,height:Fn,paths:[{d:s(0),fill:n.side},{d:s(.12),fill:n.bevel},{d:s(.3),fill:n.top}]}}var ye=class{constructor(n){this.map=n;this.models=new Map;this.shown=null;this._kind="arrow";this._night=false;}get kind(){return this._kind}set kind(n){this._kind!==n&&(this._kind=n,this.hide());}get night(){return this._night}set night(n){this._night!==n&&(this._night=n,this._kind==="arrow3d"&&this.hideModel());}get visible(){return this.shown!==null}update(n,e,o,r=0){this.map.setFacadeFocus?.(n);let i=ge(this._kind,n,e,x(n[1],o),r);if(!i)return this.hideModel(),false;let s=this._kind,a=Zt(s,this._night),u=this.models.get(a),l=!u;return u||(u=lr(s,this._night),this.models.set(a,u)),this.shown!==u&&this.hideModel(),this.shown=u,u.coordinates=[i.lng,i.lat],u.rotation=i.rotation,u.scale=i.scale,u.altitude=i.altitude,u.visible=true,l?this.map.addModel(u):this.map.triggerRepaint(),true}clear(){this.hide();}destroy(){this.map.setFacadeFocus?.(null),this.shown=null;for(let n of this.models.values())this.map.removeModel(n);this.models.clear();}hide(){this.map.setFacadeFocus?.(null),this.hideModel();}hideModel(){let n=this.shown;n&&(this.shown=null,n.visible=false,this.map.triggerRepaint());}};function lr(t,n){let e=Zt(t,n),o=new Ne$1({url:`osmgl://nav-car/${e}.glb`,coordinates:[0,0],fetchBytes:async()=>{let r=xe(t,n);return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)},id:`nav-car-${e}`,visible:false});return o.onTop=true,o.castShadows=false,o}function $(t){let n=111320*Math.cos(t[1]*Math.PI/180);return {toXY:e=>({x:(e[0]-t[0])*n,y:(e[1]-t[1])*111320}),toLonLat:e=>[t[0]+e.x/n,t[1]+e.y/111320]}}var bt=(t,n,e)=>t+(n-t)*e,rt=(t,n,e)=>({x:bt(t.x,n.x,e),y:bt(t.y,n.y,e)}),W=(t,n)=>Math.hypot(n.x-t.x,n.y-t.y),Pe=t=>t<0?0:t>1?1:t,U=t=>{let n=Pe(t);return n*n*(3-2*n)};function tn(t,n){let e=[0];for(let o=1;o<t.length;o++)e.push(e[o-1]+(n?n[o-1]:W(t[o-1],t[o])));return {pts:t,cum:e,length:e[e.length-1]??0}}function pt(t,n){let e=(n[0]-t[0])*Math.cos((t[1]+n[1])/2*Math.PI/180)*111320,o=(n[1]-t[1])*111320;return Math.hypot(e,o)}function At(t,n){let e=t.slice(1).map((o,r)=>pt(t[r],o));return tn(t.map(n.toXY),e)}function Dt(t,n){let e=0,o=t.pts.length-2;if(o<0)return 0;for(;e<o;){let r=e+o+1>>1;t.cum[r]<=n?e=r:o=r-1;}return e}function G(t,n){if(t.pts.length===1)return t.pts[0];let e=Dt(t,n),o=t.cum[e+1]-t.cum[e],r=o>1e-9?(n-t.cum[e])/o:0;return rt(t.pts[e],t.pts[e+1],r)}function Jt(t,n){if(t.pts.length<2)return {x:1,y:0};let e=Dt(t,n);for(;e<t.pts.length-2&&W(t.pts[e],t.pts[e+1])<1e-6;)e++;let o=t.pts[e],r=t.pts[e+1],i=W(o,r)||1;return {x:(r.x-o.x)/i,y:(r.y-o.y)/i}}function Dn(t,n,e=0){let o=e>0?(()=>{let r=G(t,n),i=G(t,Math.min(t.length,n+e)),s=W(r,i);return s>.5?{x:(i.x-r.x)/s,y:(i.y-r.y)/s}:Jt(t,n)})():Jt(t,n);return (Math.atan2(o.x,o.y)*180/Math.PI+360)%360}function dt(t,n,e=-1/0,o=1/0){let r={s:0,d:1/0};for(let i=0;i+1<t.pts.length;i++){if(t.cum[i+1]<e||t.cum[i]>o)continue;let s=t.pts[i],a=t.pts[i+1],u=a.x-s.x,l=a.y-s.y,c=u*u+l*l,m=c>1e-12?Pe(((n.x-s.x)*u+(n.y-s.y)*l)/c):0,h={x:s.x+u*m,y:s.y+l*m},f=W(n,h);f<r.d&&(r={s:t.cum[i]+m*(t.cum[i+1]-t.cum[i]),d:f});}return r}function cr(t,n){if(t.length<2)return t.slice();let e=[t[0]];for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o],s=Math.max(1,Math.ceil(W(r,i)/n));for(let a=1;a<=s;a++)e.push(rt(r,i,a/s));}return e}function Hs(t,n,e){let o=tn(t),r=Math.max(0,Math.min(n,e)),i=Math.min(o.length,Math.max(n,e));if(t.length<2||i-r<1e-6)return [];let s=[G(o,r)];for(let a=0;a<t.length;a++)o.cum[a]>r&&o.cum[a]<i&&s.push(t[a]);return s.push(G(o,i)),s}function $s(t,n){let e=t.length;if(e<2)return t.slice();let o=s=>typeof n=="number"?n:n[s]??0,r=(s,a)=>{let u=W(s,a)||1;return {x:(a.y-s.y)/u,y:-(a.x-s.x)/u}},i=[];for(let s=0;s<e;s++){let a=s>0?r(t[s-1],t[s]):null,u=s<e-1?r(t[s],t[s+1]):null,l,c;if(a&&u){l=a.x+u.x,c=a.y+u.y;let m=Math.hypot(l,c);if(m<1e-6)l=u.x,c=u.y;else {l/=m,c/=m;let h=Math.max(.5,l*u.x+c*u.y);l/=h,c/=h;}}else {let m=a??u;l=m.x,c=m.y;}i.push({x:t[s].x+l*o(s),y:t[s].y+c*o(s)});}return i}function mr(t,n,e){let o=G(t,n),r=Jt(t,n);return (e.x-o.x)*r.y-(e.y-o.y)*r.x}var hr=2;function fr(t,n,e){let o=cr(n,hr),r={s:[],pts:[]};for(let i of o){let{s}=dt(t,i,e[0],e[1]);r.s.length&&s<=r.s[r.s.length-1]+.05||(r.s.push(s),r.pts.push(i));}return r.s.length>=2?r:null}function Le(t,n,e){let o=n.s.length,r=u=>{let l=mr(t,n.s[u],n.pts[u]);return br(t,e,l)};if(e<=n.s[0])return r(0);if(e>=n.s[o-1])return r(o-1);let i=0,s=o-1;for(;s-i>1;){let u=i+s>>1;n.s[u]<=e?i=u:s=u;}let a=(e-n.s[i])/(n.s[s]-n.s[i]);return rt(n.pts[i],n.pts[s],a)}function br(t,n,e){let o=G(t,n),r=Jt(t,n);return {x:o.x+r.y*e,y:o.y-r.x*e}}var Ee=.7,On=2,Qt=25,Ie=4.5,pr=8,dr=["round","flat","arrow"],Mr="round",Gs=t=>typeof t=="string"&&dr.includes(t),Re=32,we=1.5;function Bt(t,n=0,e){let o=t.map(([i,s])=>[Math.min(i,s),Math.max(i,s)]).map(([i,s])=>e?[Math.max(i,e[0]),Math.min(s,e[1])]:[i,s]).filter(([i,s])=>s-i>1e-6).sort((i,s)=>i[0]-s[0]),r=[];for(let i of o){let s=r[r.length-1];s&&i[0]-s[1]<=n?s[1]=Math.max(s[1],i[1]):r.push([i[0],i[1]]);}return r}function xr(t){let n=[...t].sort((o,r)=>o.index-r.index),e=[];for(let o of n){let r=e[e.length-1];r&&o.index===r[r.length-1].index+1?r.push(o):e.push([o]);}return e}var Tt=4,_e=3.3,gr=.045;function Vs(t,n,e={}){if(n.length<2||!t.segments.length)return {features:[],hidden:[]};let o=$(n[0]),r=At(n,o),i=Bt(t.coverage,e.gapM??0,[0,r.length]);if(!i.length)return {features:[],hidden:[]};let s=[...t.segments].sort((y,_)=>y.fromM-_.fromM),a=new Map;for(let y of s){let _=[y.fromM-40,y.toM+40],I=new Map;for(let P of y.lanes){if(P.centre.length<2)continue;let O=fr(r,P.centre.map(o.toXY),_);O&&I.set(P.laneId,{lane:P,track:O});}a.set(y,I);}let u=y=>s.some(_=>a.get(_).has(y)),l=(y,_)=>_<y.fromM?y.fromM-_:_>y.toM?_-y.toM:0,c=(y,_)=>{let I=null;for(let P of s)a.get(P).has(y)&&(!I||l(P,_)<=l(I,_))&&(I=I&&l(I,_)===0&&l(P,_)===0?I:P);return I},m=(y,_,I)=>{let P=a.get(_),O=P.get(y[0].laneId),C=P.get(y[y.length-1].laneId);if(!O||!C)return null;let X=Le(r,O.track,I),E=Le(r,C.track,I),A=y.length===1?y[0].widthM:W(X,E)+(y[0].widthM+y[y.length-1].widthM)/2;return {p:rt(X,E,.5),w:A,level:_.level}},h=(y,_)=>xr(y.lanes.filter(I=>I.state===_&&a.get(y).has(I.laneId))),f=(y,_)=>{let I=h(y,"recommended").find(O=>O.some(C=>C.laneId===_));if(I)return I;let P=a.get(y).get(_);return P?[P.lane]:null},p=(y,_)=>{let I=c(y,_),P=I?f(I,y):null;return I&&P?m(P,I,_):null},b=t.changes.filter(y=>u(y.fromLane)&&u(y.toLane)&&y.endM>y.startM).sort((y,_)=>y.startM-_.startM),d=(y,_)=>{let I=a.get(y);if(y.ribbonLaneId&&I.has(y.ribbonLaneId)){let E=y.ribbonLaneId;for(let A of b)A.endM<=_+1e-6&&A.endM>=y.fromM-1&&A.fromLane===E&&(E=A.toLane);return E}let P=b.find(E=>E.startM>_&&E.startM<=y.toM&&I.has(E.fromLane));if(P)return P.fromLane;let O=[...b].reverse().find(E=>E.endM<=_+1e-6&&E.endM>=y.fromM-1&&I.has(E.toLane));if(O)return O.toLane;let C=b.find(E=>E.startM>=y.toM&&I.has(E.fromLane));if(C)return C.fromLane;let X=h(y,"recommended");return X.length?X.reduce((E,A)=>A.length>E.length?A:E)[0].laneId:null},M=(y,_)=>{let I=d(y,_),P=I?f(y,I):null;return P?m(P,y,_):null},x=new Map(s.map(y=>{let _=new Set;for(let I of [y.fromM,...b.map(P=>P.endM).filter(P=>P>y.fromM&&P<=y.toM),y.toM]){let P=d(y,I);P&&_.add(P);}return [y,_]})),g=y=>x.get(y).size>0,L=y=>{let _=b.find(E=>E.startM<=y&&y<=E.endM);if(_){let E=p(_.fromLane,y),A=p(_.toLane,y);if(E&&A){let T=U((y-_.startM)/(_.endM-_.startM));return {p:rt(E.p,A.p,T),w:bt(E.w,A.w,T),level:T<.5?E.level:A.level}}}let I=[...s].reverse().find(E=>E.fromM<=y&&y<=E.toM&&g(E));if(I)return M(I,y);let P=[...s].reverse().find(E=>E.toM<y&&g(E)),O=s.find(E=>E.fromM>y&&g(E)),C=P?M(P,P.toM):null,X=O?M(O,O.fromM):null;if(C&&X&&P&&O){let E=U((y-P.toM)/(O.fromM-P.toM));return {p:rt(C.p,X.p,E),w:bt(C.w,X.w,E),level:Math.max(C.level,X.level)}}return P?M(P,y):O?M(O,y):null},R=[],w=[],v={stations:[],line:[],weights:[]},k=e.cap??Mr,S=y=>[y[0]>0||k==="flat"?"flat":"round",y[1]>0?"flat":k],N=k==="flat"?"flat":"round",Y=(y,_,I,P,O)=>{for(let C=0;C+1<s.length;C++){let X=s[C],E=s[C+1];if(!g(X)||!g(E)||E.fromM-X.toM>2*Xn)continue;let A=Math.max(X.toM-Math.min(Xn,(X.toM-X.fromM)/2),P),T=Math.min(E.fromM+Math.min(Xn,(E.toM-E.fromM)/2),O);b.some(B=>B.endM>A-5&&B.startM<T+5)||Lr(r,y,_,I,A,T);}},D=e.outside===false?null:{laneM:e.outside?.laneM??_e,offsetM:e.outside?.offsetM??(e.outside?.laneM??_e)/2};if(D){let y=r.length,_=Yn(0,y,On),I=Ne(_.map(A=>G(r,A))),P=lt(I),O=A=>({x:I[A].x+P[A].x*D.offsetM,y:I[A].y+P[A].y*D.offsetM}),C=A=>i.some(([T,B])=>B-T>=Tt&&A>=T-1e-9&&A<=B+1e-9),X=_.map(A=>C(A)?L(A):null),E=[];for(let A=0;A<_.length;){if(!X[A]){A++;continue}let T=A;for(;T+1<_.length&&X[T+1];)T++;_[T]-_[A]>=Tt&&E.push([A,T]),A=T+1;}if(E.length){let A=_.map((V,et)=>({p:O(et),w:D.laneM,level:0})),T=_.slice(),B=_.map(V=>_r(V,E.map(([et,ut])=>[_[et],_[ut]])));for(let[V,et]of E){let ut=_[V],Lt=_[et],Rt=ot=>{let Ot=X[ot],wt=Math.max(W(Ot.p,O(ot)),2*Math.abs(Ot.w-D.laneM));return Math.min(Math.max(Qt,1.5*wt/gr),(Lt-ut)/2)},yn=ut>.5?Rt(V):0,Ln=Lt<y-.5?Rt(et):0;for(let ot=V;ot<=et;ot++){let Ot=_[ot],wt=X[ot],oe=Math.min(yn?(Ot-ut)/yn:1/0,Ln?(Lt-Ot)/Ln:1/0);if(oe>=1){A[ot]=wt;continue}let Rn=U(oe);A[ot]={p:rt(O(ot),wt.p,Rn),w:bt(D.laneM,wt.w,Rn),level:Rn<.5?0:wt.level};}Y(_,T,A,ut+yn,Lt-Ln);}w.push([0,y]),ve(T,A,[0,0],o,R,S([0,0]),v,B);}}else for(let[y,_]of i){if(_-y<Tt)continue;let I=Yn(y,_,On),P=[];for(let B of I){let V=L(B);if(!V){P.push({p:G(r,B),w:0,level:0});continue}P.push(V);}let O=Math.min(Qt,(_-y)/3),C=y>.5?O:0,X=_<r.length-.5?O:0;I.forEach((B,V)=>{let et=Math.min(C?(B-y)/C:1/0,X?(_-B)/X:1/0);if(et>=1)return;let ut=U(et),Lt=G(r,B),Rt=P[V];P[V]={p:rt(Lt,Rt.p,ut),w:Rt.w,level:Rt.level};});let E=I.slice();Y(I,E,P,y+C,_-X);let A={s:[],pts:[]},T=()=>{if(A.s.length>=2&&A.s[A.s.length-1]-A.s[0]>=Tt){w.push([A.s[0],A.s[A.s.length-1]]);let B=[A.s[0]-y<1e-6?C:0,_-A.s[A.s.length-1]<1e-6?X:0];ve(A.s,A.pts,B,o,R,S(B),v,A.s.map(()=>1));}A={s:[],pts:[]};};I.forEach((B,V)=>{if(P[V].w<=0){T();return}A.s.push(E[V]),A.pts.push(P[V]);}),T();}for(let y of s){let _=x.get(y);for(let I of h(y,"recommended"))I.some(P=>_.has(P.laneId))||F(I,y,"band");for(let I of h(y,"allowed"))F(I,y,"allowed");}function F(y,_,I){let P=Math.max(_.fromM,i[0][0]),O=Math.min(_.toM,i[i.length-1][1]);if(O-P<Tt)return;let C=[],X=[];for(let A of Yn(P,O,On)){let T=m(y,_,A);T&&(C.push(T),X.push(A));}if(C.length<2)return;let E=Math.max(.5,C[0].w-Ee);R.push(ke(I,C.map(A=>A.p),C.map(()=>E),C.map(A=>A.level),o,X,[N,N]).feature);}let K={features:R,hidden:Bt(w,.5)};return v.stations.length>=2&&(K.car=v),K}var Xn=14,yr=20;function Lr(t,n,e,o,r,i){if(i-r<8)return;let s=n.findIndex(F=>F>=r-1e-9),a=-1;for(let F=n.length-1;F>=0;F--)if(n[F]<=i+1e-9){a=F;break}if(s<2||a<0||a+2>=n.length||a-s<3)return;for(let F=s-2;F<=a+2;F++)if(o[F].w<=0)return;let u=o[s].p,l=o[a].p,c={x:u.x-o[s-2].p.x,y:u.y-o[s-2].p.y},m={x:o[a+2].p.x-l.x,y:o[a+2].p.y-l.y},h=Math.hypot(c.x,c.y),f=Math.hypot(m.x,m.y);if(h<1e-6||f<1e-6)return;let p={x:c.x/h,y:c.y/h},b={x:m.x/f,y:m.y/f},d=p.x*b.y-p.y*b.x,M=Math.abs(Math.atan2(d,p.x*b.x+p.y*b.y));if(M<yr*Math.PI/180||Math.abs(d)<1e-9)return;let x=l.x-u.x,g=l.y-u.y,L=(x*b.y-g*b.x)/d,R=(p.x*g-p.y*x)/d;if(L<.5||R<.5)return;let w={x:u.x+p.x*L,y:u.y+p.y*L},v=tn([u,w,l]),k=n[a]-n[s],S=n[s],N=Ie*Math.min(1,Math.max(.2,M/(Math.PI/2))),Y=o[s].w,D=o[a].w;for(let F=s+1;F<a;F++){let K=v.length*(n[F]-n[s])/k,y=Rr((K-L)/N),_=G(v,K);o[F]={...o[F],p:_,w:bt(Y,D,y)},S=Math.min(n[a],Math.max(S,dt(t,_,n[s],n[a]).s)),e[F]=S;}}function Rr(t){let n=Math.abs(t)/Math.SQRT2,e=1/(1+.3275911*n),o=1-((((1.061405429*e-1.453152027)*e+1.421413741)*e-.284496736)*e+.254829592)*e*Math.exp(-n*n);return t>=0?(1+o)/2:(1-o)/2}var wr=1;function _r(t,n){let e=wr;for(let[o,r]of n){if(t>=o&&t<=r)return 1;let i=t<o?o-t:t-r;i<Qt&&(e=Math.max(e,U(1-i/Qt)));}return e}function Z(t,n,e){let o=Math.min(t.length,n.length);if(o===0)return 0;if(!(e>t[0]))return n[0];if(e>=t[o-1])return n[o-1];let r=0,i=o-1;for(;i-r>1;){let a=r+i>>1;t[a]<=e?r=a:i=a;}let s=t[i]-t[r];return s>0?n[r]+(n[i]-n[r])*((e-t[r])/s):n[r]}function Yn(t,n,e){if(n<=t)return [t];let o=Math.max(1,Math.ceil((n-t)/e));return Array.from({length:o+1},(r,i)=>t+(n-t)*i/o)}function ve(t,n,e,o,r,i,s,a){let u=vr(n.map(f=>Math.max(.5,f.w-Ee))),l=ke("band",n.map(f=>f.p),u,n.map(f=>f.level),o,t,i);r.push(l.feature);for(let f=0;f<l.stations.length;f++){let p=l.stations[f];s.stations.length&&p<s.stations[s.stations.length-1]||(s.stations.push(p),s.line.push(l.feature.line[f]),s.weights.push(Z(t,a,p)));}let c=t[0]+e[0],m=t[t.length-1]-e[1],h=l.stations.map((f,p)=>f>=c-1e-6&&f<=m+1e-6?p:-1).filter(f=>f>=0);if(h.length>=2&&m-c>=10){let f=h.map(d=>l.centre[d]),p=Er(f,Ar),b=Math.max(1,Math.min(...h.map(d=>l.widths[d]))-.6);for(let d=0;d+1<p.length;d++){let M=h[p[d]],x=h[p[d+1]];W(l.centre[M],l.centre[x])<Pr||r.push({kind:"chevron",line:[l.feature.line[M],l.feature.line[x]],width:b,levels:[l.feature.levels[M],l.feature.levels[x]],stations:[l.stations[M],l.stations[x]]});}}}var Tn=.5;function vr(t){if(!t.length)return t;let n=[...t].sort((o,r)=>o-r),e=n[n.length>>1];return t.map(o=>{let r=Math.abs(o-e);return r<Tn?e:r<2*Tn?e+Math.sign(o-e)*2*(r-Tn):o})}var Ar=.1,Pr=6;function Er(t,n){let e=t.length;if(e<=2)return t.map((i,s)=>s);let o=new Array(e).fill(false);o[0]=true,o[e-1]=true;let r=[[0,e-1]];for(;r.length;){let[i,s]=r.pop(),a=-1,u=-1,l=t[i].x,c=t[i].y,m=t[s].x-l,h=t[s].y-c,f=Math.hypot(m,h);for(let p=i+1;p<s;p++){let b=f>1e-9?Math.abs((t[p].x-l)*h-(t[p].y-c)*m)/f:Math.hypot(t[p].x-l,t[p].y-c);b>a&&(a=b,u=p);}u>=0&&a>n&&(o[u]=true,r.push([i,u],[u,s]));}return o.map((i,s)=>i?s:-1).filter(i=>i>=0)}var Ir=1;function kr(t,n,e=Ir){let o=tn(t);if(t.length<2||o.length<1e-6)return {pts:t.slice(),attrs:n.map(a=>a.slice())};let r=Math.max(1,Math.round(o.length/e)),i=[],s=n.map(()=>[]);for(let a=0;a<=r;a++){let u=o.length*a/r,l=Dt(o,u),c=o.cum[l+1]-o.cum[l],m=c>1e-9?(u-o.cum[l])/c:0;i.push(rt(t[l],t[l+1],m)),n.forEach((h,f)=>s[f].push(bt(h[l],h[l+1],m)));}return {pts:i,attrs:s}}function ke(t,n,e,o,r,i,s){let a=kr(n,[e,o,i??e.map(()=>0)]),u=Ne(a.pts),l=Sr(a.attrs[0]),c=a.attrs[1].map(m=>Math.round(m));return {feature:{kind:t,line:u.map(r.toLonLat),width:Math.max(...l),levels:c,outline:Ht(u,l.map(m=>m/2),lt(u),s).map(r.toLonLat),stations:a.attrs[2],widths:l,caps:s},centre:u,widths:l,stations:a.attrs[2]}}var Nr=2;function Sr(t,n=Nr){let e=t.length;if(e<3||n<=0)return t.slice();let o=Math.ceil(n*3),r=[];for(let i=0;i<e;i++){let s=true;for(let l=Math.max(0,i-o);l<=Math.min(e-1,i+o)&&s;l++)s=Math.abs(t[l]-t[i])<1e-9;if(s||i===0||i===e-1){r.push(t[i]);continue}let a=0,u=0;for(let l=-o;l<=o;l++){let c=Math.min(e-1,Math.max(0,i+l)),m=Math.exp(-(l*l)/(2*n*n));a+=m,u+=t[c]*m;}r.push(u/a);}return r}function Fr(t,n){let e=t[n-1],o=t[n],r=t[n+1],i=o.x-e.x,s=o.y-e.y,a=r.x-o.x,u=r.y-o.y;return Math.hypot(i,s)<1e-6||Math.hypot(a,u)<1e-6?0:Math.abs(Math.atan2(i*u-s*a,i*a+s*u))}function Ne(t,n=Ie){let e=t.length;if(e<3||n<=0)return t.slice();let o=0;for(let c=1;c<e;c++)o+=W(t[c-1],t[c]);let r=Math.max(.05,o/(e-1)),i=pr*Math.PI/180,s=[];for(let c=1;c<e-1;c++){let m=Fr(t,c);if(Math.abs(m)<=i)continue;let h=s[s.length-1];h&&(c-h.to)*r<=3?(h.to=c,h.turn+=m):s.push({at:c,turn:m,from:c,to:c});}if(!s.length)return t.slice();let a=s.map(c=>{let m=Math.max(0,c.from-2),h=Math.min(e-1,c.to+2),f={x:t[c.from].x-t[m].x,y:t[c.from].y-t[m].y},p={x:t[h].x-t[c.to].x,y:t[h].y-t[c.to].y},b=Math.abs(Math.atan2(f.x*p.y-f.y*p.x,f.x*p.x+f.y*p.y))||Math.abs(c.turn),d=n*Math.min(1,Math.max(.2,b/(Math.PI/2)))/r;return {at:(c.from+c.to)/2,sig:d}}),u=c=>{if(c<0){let m=t[Math.min(e-1,-c)];return {x:2*t[0].x-m.x,y:2*t[0].y-m.y}}if(c>e-1){let m=t[Math.max(0,2*(e-1)-c)];return {x:2*t[e-1].x-m.x,y:2*t[e-1].y-m.y}}return t[c]},l=[];for(let c=0;c<e;c++){let m=0,h=0;for(let M of a){let x=Math.abs(M.at-c),g=2*M.sig,L=1.5*M.sig,R=x<=g?1:x>=g+L?0:U(1-(x-g)/L);(R>m||R===m&&R>0&&M.sig>h)&&(m=R,h=M.sig);}if(m<=0||c===0||c===e-1){l.push(t[c]);continue}let f=Math.ceil(h*2.5),p=0,b=0,d=0;for(let M=-f;M<=f;M++){let x=u(c+M),g=Math.exp(-(M*M)/(2*h*h));p+=x.x*g,b+=x.y*g,d+=g;}l.push(rt(t[c],{x:p/d,y:b/d},m));}return l}function Ht(t,n,e=lt(t),o=["flat","flat"]){let r=t.length;if(r<2)return [];let{right:i,left:s}=Cr(t,n,e),a=[...i,...Ae(t[r-1],e[r-1],n[r-1],o[1],true),...s.reverse(),...Ae(t[0],e[0],n[0],o[0],false)];return a.push(a[0]),a}function Ae(t,n,e,o,r){if(o==="flat"||!(e>0))return [];let i=r?1:-1,s=-n.y*i,a=n.x*i,u=n.x*i,l=n.y*i;if(o==="arrow")return [{x:t.x+s*e*we,y:t.y+a*e*we}];let c=[];for(let m=1;m<Re;m++){let h=Math.PI*m/Re,f=Math.cos(h),p=Math.sin(h);c.push({x:t.x+e*(u*f+s*p),y:t.y+e*(l*f+a*p)});}return c}function Cr(t,n,e=lt(t)){let o=t.length;if(o<2)return {right:[],left:[]};let r=i=>{let s=[],a=[],u=(l,c)=>{let m=s[s.length-1],h=a[a.length-1];return (l.x-m.x)*(t[c].x-t[h].x)+(l.y-m.y)*(t[c].y-t[h].y)<=1e-9};for(let l=0;l<o;l++){let c={x:t[l].x+e[l].x*n[l]*i,y:t[l].y+e[l].y*n[l]*i};if(s.length&&u(c,l)){if(l<o-1)continue;for(;s.length>1&&u(c,l);)s.pop(),a.pop();}s.push(c),a.push(l);}return s};return {right:r(1),left:r(-1)}}function lt(t){let n=t.length,e=[],o={x:0,y:-1};for(let r=0;r<n;r++){let i=t[Math.max(0,r-1)],s=t[Math.min(n-1,r+1)],a=W(i,s);a>1e-9&&(o={x:(s.y-i.y)/a,y:-(s.x-i.x)/a}),e.push(o);}return e}function js(t,n){if(t.length<2)return [];if(!n.length)return [{coords:t.slice(),source:t.map((a,u)=>Math.min(u,t.length-2))}];let e=$(t[0]),o=At(t,e),r=[],i=0;for(let[a,u]of Bt(n,0,[0,o.length]))a>i&&r.push([i,a]),i=Math.max(i,u);i<o.length&&r.push([i,o.length]);let s=[];for(let[a,u]of r){if(u-a<.5)continue;let l=Dt(o,a),c=Dt(o,u),m=[e.toLonLat(G(o,a))],h=[l];for(let f=l+1;f<=c;f++)o.cum[f]<=a||o.cum[f]>=u||(m.push(t[f]),h.push(Math.min(f,t.length-2)));m.push(e.toLonLat(G(o,u))),h.push(c),s.push({coords:m,source:h});}return s}function nn(t,n){if(t.length<2)return n.map(()=>0);let e=$(t[0]),o=At(t,e),r=0;return n.map(i=>{let{s}=dt(o,e.toXY(i),r);return r=Math.max(r,s-1),s})}function Se(t){let n=$(t[0]??[0,0]);return {frame:n,route:At(t,n)}}var Or=8,it=(t,n)=>Math.max(0,n)*Or;function Ks(t,n){return en(t.line,t.line.map((e,o)=>n(e,t.levels[o]??0)))}function en(t,n){let e=Math.min(...n),o=Math.max(...n);return o-e<.05?o>.01?{lift:+o.toFixed(2)}:{}:{liftPath:t.map((r,i)=>`${r[0].toFixed(7)},${r[1].toFixed(7)},${n[i].toFixed(2)}`).join(";")}}var Xr="/tiles/ldroads/guidance";function zs(t){let n=t.geometry,e=t.maneuvers??[],o=nn(n,e.map(r=>r.at));return {geometry:n.map(([r,i])=>[+r.toFixed(7),+i.toFixed(7)]),...t.edges?{edges:t.edges}:{},graphVersion:t.graphVersion??null,maneuvers:e.map((r,i)=>({atM:+o[i].toFixed(1),type:r.type,modifier:r.modifier??""}))}}var Yr=10*6e4,Bn=new Map;async function qs(t,n={}){let e=n.url??Xr;if(Date.now()<(Bn.get(e)??0))return null;let o=n.fetch??globalThis.fetch;if(!o)return null;try{let r=await o(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:n.signal});return r.status===404||r.status===405||r.status===501?(Bn.set(e,Date.now()+Yr),null):r.ok?Br(await r.json()):null}catch{return null}}function Zs(){Bn.clear();}var q=t=>typeof t=="number"&&Number.isFinite(t)?t:null,z=t=>typeof t=="string"?t:typeof t=="number"&&Number.isFinite(t)?String(t):null,J=t=>Array.isArray(t)?t:[],Pt=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:null,Fe=t=>typeof t=="string"?t.split(/[|;,\s]+/).filter(Boolean):J(t).map(z).filter(n=>n!==null&&n!==""),Tr=t=>{let n=J(t),e=q(n[0]),o=q(n[1]);return e!==null&&o!==null&&Math.abs(o)<=90&&Math.abs(e)<=180?[e,o]:null},Dr=new Set(["recommended","allowed","other"]);function Br(t){let n=Pt(t);if(!n)return null;let e=J(n.coverage).map(s=>{let a=J(s),u=q(a[0]),l=q(a[1]);return u!==null&&l!==null&&l>u?[u,l]:null}).filter(s=>s!==null);if(!e.length)return null;let o=[];for(let s of J(n.segments)){let a=Pt(s);if(!a)continue;let u=q(a.fromM),l=q(a.toM);if(u===null||l===null||l<=u)continue;let c=[];for(let m of J(a.lanes)){let h=Pt(m);if(!h)continue;let f=z(h.laneId),p=q(h.index),b=q(h.widthM),d=J(h.centre).map(Tr).filter(x=>x!==null);if(f===null||p===null||b===null||b<=0||d.length<2)continue;let M=Dr.has(h.state)?h.state:"other";c.push({laneId:f,index:p,widthM:b,centre:d,state:M,turns:Fe(h.turns)});}c.length&&o.push({fromM:u,toM:l,wayId:typeof a.wayId=="number"||typeof a.wayId=="string"?a.wayId:0,dir:z(a.dir)??"forward",level:q(a.level)??0,...z(a.ribbonLaneId)!==null?{ribbonLaneId:z(a.ribbonLaneId)}:{},lanes:c});}if(!o.length)return null;let r=[];for(let s of J(n.changes)){let a=Pt(s);if(!a)continue;let u=z(a.fromLane),l=z(a.toLane),c=q(a.startM),m=q(a.endM);u===null||l===null||c===null||m===null||m<=c||r.push({fromLane:u,toLane:l,startM:c,endM:m});}let i=[];for(let s of J(n.maneuvers)){let a=Pt(s);if(!a)continue;let u=q(a.atM);u!==null&&i.push({atM:u,kind:z(a.kind)??"",laneIds:J(a.laneIds).map(z).filter(l=>l!==null),arrows:J(a.arrows).flatMap(l=>{let c=Pt(l),m=c?z(c.laneId):null;return c&&m!==null?[{laneId:m,turns:Fe(c.turns)}]:[]})});}return {version:z(n.version)??"",matchedBy:z(n.matchedBy),coverage:e,segments:o.sort((s,a)=>s.fromM-a.fromM),changes:r,maneuvers:i.sort((s,a)=>s.atM-a.atM)}}var Et=(t,n,e)=>t+(n-t)*e;function gt(t){let n=[0];for(let e=1;e<t.length;e++)n.push(n[e-1]+pt(t[e-1],t[e]));return {geometry:t,cum:n,length:n[n.length-1]??0}}function Oe(t,n){let e=0,o=t.length-2;if(o<0)return 0;for(;e<o;){let r=e+o+1>>1;t[r]<=n?e=r:o=r-1;}return e}function Mt(t,n){let e=t.geometry;if(e.length===1)return e[0];let o=Oe(t.cum,n),r=t.cum[o+1]-t.cum[o],i=r>1e-9?Math.max(0,Math.min(1,(n-t.cum[o])/r)):0;return [Et(e[o][0],e[o+1][0],i),Et(e[o][1],e[o+1][1],i)]}function Hn(t,n,e,o=1e-6){let r=Math.max(0,n),i=Math.min(t.length,e);if(t.geometry.length<2||i-r<o)return [];let s=[Mt(t,r)];for(let a=Oe(t.cum,r)+1;a<t.geometry.length&&t.cum[a]<i;a++)t.cum[a]>r&&s.push(t.geometry[a]);return s.push(Mt(t,i)),s}var Hr=.5;function ti(t,n,e){if(t.geometry.length<2||!(e>0))return [];let o=Math.min(e,t.length),r=[],i=0,s=[];for(let[a,u]of Bt(n,0,[0,t.length]))a>i&&s.push([i,a]),i=Math.max(i,u);i<t.length&&s.push([i,t.length]);for(let[a,u]of s){if(u-a<.5||a>=o)continue;let l=Hn(t,a,Math.min(u,o),Hr);l.length>=2&&r.push(l);}return r}function Q(t,n){let e=t.length;if(e<2||n<=t[0])return 0;if(n>=t[e-1])return e-1;let o=0,r=e-2;for(;o<r;){let s=o+r+1>>1;t[s]<=n?o=s:r=s-1;}let i=t[o+1]-t[o];return o+(i>1e-12?(n-t[o])/i:0)}function j(t,n,e,o){let r=t.length,i=a=>{let u=Math.floor(a),l=a-u;return u>=r-1?t[r-1]:l<1e-12?t[u]:o(t[u],t[u+1],l)},s=[i(n)];for(let a=Math.floor(n)+1;a<e;a++)s.push(t[a]);return s.push(i(e)),s}var ct=(t,n,e)=>Et(t,n,e),$r=(t,n,e)=>Math.round(Et(t,n,e)),xt=(t,n,e)=>[Et(t[0],n[0],e),Et(t[1],n[1],e)],on=t=>t==="band"?"band-passed":t==="allowed"?"allowed-passed":t,Ce=1e-6;function ni(t,n){let e=[];return t.forEach((o,r)=>{let i=o.line.length,s=m=>e.push({feature:m,source:r,from:0,to:i-1}),a=o.stations;if(n===null||!a||a.length!==i||i<2)return s(o);if(o.kind==="chevron"){a[i-1]>n&&s(o);return}if(o.kind!=="band"&&o.kind!=="allowed")return s(o);let u=Q(a,n);if(u<=Ce)return s(o);if(u>=i-1-Ce)return s({...o,kind:on(o.kind)});let[l,c]=Gr(o,u);e.push({feature:l,source:r,from:0,to:u},{feature:c,source:r,from:u,to:i-1});}),e}function Gr(t,n){let e=t.line.length,o=t.widths&&t.widths.length===e?t.widths:t.line.map(()=>t.width),r=$(t.line[0]),i=j(t.line,0,n,xt),s=j(t.line,n,e-1,xt),a=[...i,...s.slice(1)].map(r.toXY),u=lt(a),l=i.length-1,c=t.caps,m=(h,f,p,b,d,M,x)=>{let g=j(o,p,b,ct);return {kind:h,line:f,width:Math.max(...g),levels:j(t.levels,p,b,$r),outline:Ht(a.slice(d,M),g.map(L=>L/2),u.slice(d,M),x).map(r.toLonLat),stations:j(t.stations,p,b,ct),widths:g,...x?{caps:x}:{}}};return [m(on(t.kind),i,0,n,0,l+1,c&&[c[0],"flat"]),m(t.kind,s,n,e-1,l,a.length,c&&["flat",c[1]])]}function ei(t,n){if(n===null)return {passed:-1,cut:false};let e=0,o=false;for(let r of t){let i=r.stations;!i||i.length<2||(i[i.length-1]<=n?e++:i[0]<n&&(r.kind==="band"||r.kind==="allowed")&&(o=true));}return {passed:e,cut:o}}var rn=Vr,Ye={intersection:rn.intersection??rn.default?.intersection,difference:rn.difference??rn.default?.difference},jr=18,st=4096,ii=1,sn=2**jr*st;function $t(t){let n=Math.sin(t[1]*Math.PI/180);return [(t[0]+180)/360*sn,(.5-Math.log((1+n)/(1-n))/(4*Math.PI))*sn]}function un(t){let n=t[0]/sn*360-180,e=Math.PI-2*Math.PI*t[1]/sn;return [n,Math.atan(Math.sinh(e))*180/Math.PI]}var Xe=t=>t%2===0?1.2:.6,an=t=>t;function Te(t){if(!t.length||t[0].length<4)return [];let n=t.map(f=>f.map($t)),e=1/0,o=1/0,r=-1/0,i=-1/0;for(let[f,p]of n[0])f<e&&(e=f),f>r&&(r=f),p<o&&(o=p),p>i&&(i=p);let s=Math.floor(e/st),a=Math.floor(r/st),u=Math.floor(o/st),l=Math.floor(i/st),c=(f,p)=>f-p*st>=2;if(s===a&&u===l&&c(e,s)&&c(o,u))return [t];let m=n.map(an),h=[];for(let f=s;f<=a;f++)for(let p=u;p<=l;p++){let b=f*st+Xe(f),d=p*st+Xe(p),M=(f+1)*st,x=(p+1)*st;if(M<=e||b>=r||x<=o||d>=i)continue;let g=[an([[b,d],[M,d],[M,x],[b,x],[b,d]])];for(let L of Ye.intersection(m,g))h.push(L.map(R=>R.map(w=>un([w[0],w[1]]))));}return h}function De(t){return {polys:t.filter(n=>n.length>=4).map(n=>{let e=n.map($t),o=e.map(i=>i[0]),r=e.map(i=>i[1]);return {box:[Math.min(...o),Math.min(...r),Math.max(...o),Math.max(...r)],geom:[an(e)]}})}}function Be(t,n){if(t.length<4||!n.polys.length)return [[t]];let e=t.map($t),o=e.map(u=>u[0]),r=e.map(u=>u[1]),i=[Math.min(...o),Math.min(...r),Math.max(...o),Math.max(...r)],s=n.polys.filter(u=>u.box[0]<i[2]&&u.box[2]>i[0]&&u.box[1]<i[3]&&u.box[3]>i[1]);return s.length?Ye.difference([an(e)],...s.map(u=>u.geom)).map(u=>u.map(l=>l.map(c=>un([c[0],c[1]])))):[[t]]}var $n=40,It=1e-6;function Gt(t,n,e=$n){let o=t.line.length,r=t.stations;if(!r||r.length!==o||o<2)return [{kind:t.kind,from:0,to:o-1}];let i=[0];for(let l=Math.ceil(r[0]/e)*e;l<r[o-1];l+=e){let c=Q(r,l);c>i[i.length-1]+It&&c<o-1-It&&i.push(c);}i.push(o-1);let s=n===null?-1:Q(r,n),a=on(t.kind),u=[];for(let l=0;l+1<i.length;l++){let c=i[l],m=i[l+1];n===null||s<=c+It?u.push({kind:t.kind,from:c,to:m}):s>=m-It?u.push({kind:a,from:c,to:m}):u.push({kind:a,from:c,to:s,cut:true},{kind:t.kind,from:s,to:m,cut:true});}return u}function ln(t){let n=$(t.line[0]),e=t.line.map(n.toXY),o=t.widths&&t.widths.length===t.line.length?t.widths:t.line.map(()=>t.width);return {frame:n,xy:e,normals:lt(e),widths:o,caps:t.caps??["flat","flat"]}}var He=(t,n,e)=>({x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e}),Kr=(t,n,e)=>{let o=He(t,n,e),r=Math.hypot(o.x,o.y);return r>1e-12?{x:o.x/r,y:o.y/r}:t};function Vt(t,n,e){let o=j(t.xy,n,e,He),r=j(t.normals,n,e,Kr),i=j(t.widths,n,e,ct).map(u=>u/2),s=t.xy.length-1,a=[n<=It?t.caps[0]:"flat",e>=s-It?t.caps[1]:"flat"];return Ht(o,i,r,a).map(t.frame.toLonLat)}var $e=(t,n,e)=>j(t.line,n,e,xt);var Gn=300,Ge=80,cn=40,Ve=50,mt={pitch:45,zoom:17.2},je={pitch:58,zoom:18.6},Ur=600,We=(t,n)=>t.coverage.some(([e,o])=>n>=e-5&&n<=o+30);function Wr(t,n){return t?t.maneuvers.find(e=>e.atM>=n-cn&&We(t,e.atM))??null:null}function zr(t,n){if(!t)return 0;let e=0;for(let r of t.maneuvers){if(!We(t,r.atM))continue;let i=r.atM-n,s=0;i>=0?s=i<=Gn?1:i<=Gn+Ge?1-(i-Gn)/Ge:0:s=-i<=cn?1:-i<=cn+Ve?1-(-i-cn)/Ve:0,s>e&&(e=s);}let o=e;return o*o*(3-2*o)}function qr(t,n){let e=zr(t,n);return {pitch:mt.pitch+(je.pitch-mt.pitch)*e,zoom:mt.zoom+(je.zoom-mt.zoom)*e,close:e}}function ze(t,n){if(!t||!n)return null;let e=[...t.segments].reverse().find(i=>i.fromM<=n.atM+1&&i.toM>=n.atM-40)??[...t.segments].reverse().find(i=>i.toM<=n.atM+1);if(!e)return null;let o=new Map(n.arrows.map(i=>[i.laneId,i.turns])),r=[...e.lanes].sort((i,s)=>i.index-s.index).map(i=>({laneId:i.laneId,turns:o.get(i.laneId)??i.turns,recommended:n.laneIds.includes(i.laneId),allowed:!n.laneIds.includes(i.laneId)&&i.state==="allowed"}));return r.length?{atM:n.atM,kind:n.kind,lanes:r}:null}function Ke(t,n){let e=Wr(t,n);if(!e||e.atM-n>Ur)return null;let o=ze(t,e);return o?{...o,distanceM:Math.max(0,e.atM-n)}:null}function li(t,n,e){if(!t||n.length<2)return null;let o=nn(n,[e])[0],r=t.maneuvers.find(i=>Math.abs(i.atM-o)<=25);return r?ze(t,r):null}var Ue=class{constructor(n,e){this.plan=n;this.progressM=0;this.cam={s:0,pitch:mt.pitch,zoom:mt.zoom,bearing:0};this.started=false;this.measure=e.length>=2?Se(e):null;}get lengthM(){return this.measure?.route.length??0}start(n,e,o=0){this.progressM=o,this.cam={s:o,pitch:n,zoom:e,bearing:this.measure?Dn(this.measure.route,o,30):0},this.started=true;}advance(n,e=11){let o=Ke(this.plan,this.progressM),r=o&&o.distanceM<120?e*.6:e;return this.progressM=Math.min(this.lengthM,this.progressM+r*n),this.progressM<this.lengthM}locate(n){let e=this.measure;if(!e||!Number.isFinite(n[0])||!Number.isFinite(n[1]))return false;let{s:o,d:r}=dt(e.route,e.frame.toXY(n),this.progressM-30,this.progressM+600);return !(r<60)||!Number.isFinite(o)?false:(this.progressM=o,true)}hint(){return Ke(this.plan,this.progressM)}step(n,e=false){let o=this.measure;if(!o)return null;this.started||this.start(mt.pitch,mt.zoom,this.progressM);let r=this.cam,i=Number.isFinite(n)?Math.min(.1,Math.max(0,n)):0,s=Math.min(1,i*3);r.s+=(this.progressM-r.s)*(e?1:s);let a=qr(this.plan,r.s);r.pitch+=(a.pitch-r.pitch)*s,r.zoom+=(a.zoom-r.zoom)*s;let u=Dn(o.route,r.s,30),l=(u-r.bearing+540)%360-180;return r.bearing=(r.bearing+l*Math.min(1,i*2.5)+360)%360,{center:o.frame.toLonLat(G(o.route,r.s)),zoom:r.zoom,pitch:r.pitch,bearing:r.bearing,close:a.close,courseDeg:u,s:r.s}}};var Kn="ld-roads",hn="ld-",Je="roadbed",di="/tiles/ldroads/index",Mi=t=>`/tiles/ldroads/style.json?v=${encodeURIComponent(t)}`,xi=t=>`/tiles/ldroads/roadbed/{z}/{x}/{y}.pbf?v=${encodeURIComponent(t)}`;function Zr(t,n){return n.startsWith("/")&&!n.startsWith("//")?t.url(n):!t.key||!t.owns(n)||/[?&]key=/.test(n)?n:n+(n.includes("?")?"&":"?")+"key="+t.key}var kt=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:null,Qe=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return null}},to=t=>typeof t=="number"&&Number.isFinite(t)?String(t):typeof t=="string"?t:null;function gi(t){let n=kt(Qe(t)),e=n?to(n.version):null;return !n||e===null?null:{version:e,areas:Array.isArray(n.areas)?n.areas.length:0}}var Jr="ld-mark-",Vn=.35;function Qr(t){let n=String(t.id),e={...t,id:n.startsWith(hn)?n:hn+n};e.source==null&&(e.source=Kn);let o=t.minzoom,r=kt(t.paint),i=r?.opacity;return String(e.id).startsWith(Jr)&&typeof o=="number"&&o>Vn&&(i===void 0||typeof i=="number")&&(e.paint={...r??{},opacity:{stops:[[o-Vn,0],[o,i??1]]}},e.minzoom=o-Vn),e}function yi(t,n){let e=kt(Qe(t));if(!e)return null;let o=kt(e.source),r=(Array.isArray(o?.tiles)?o.tiles.find(s=>typeof s=="string"):void 0)??(typeof o?.url=="string"?o.url:void 0),i=(Array.isArray(e.layers)?e.layers:[]).map(kt).filter(s=>s!==null&&typeof s.id=="string"&&s.id!==""&&typeof s.type=="string"&&s.type!=="").map(Qr);return r===void 0||!i.length?null:{version:to(e.version)??"",tiles:Zr(n,r),minzoom:typeof o?.minzoom=="number"?o.minzoom:14,maxzoom:typeof o?.maxzoom=="number"?o.maxzoom:16,layers:i}}function ts(t){return {url:t.tiles,minzoom:t.minzoom,maxzoom:t.maxzoom}}function Li(t,n,e=null){let o=t,r=o.sources??{};if(!(Od in r))return t;let i=o.layers.filter(u=>!String(u.id).startsWith(hn)),s=i.findIndex(u=>u.id===Je);i.splice(s>=0?s+1:i.length,0,...n.layers);let a={[Kn]:ts(n)};return e!==null&&(a[Od]={...kt(r[Od])??{},url:e}),{...t,sources:{...r,...a},layers:i}}function Ri(t){return t.layers.filter(n=>n.source===Kn).map(n=>String(n.id))}var no="lane-ribbon",Un="lane-ribbon-",pn=17.5,fn="#2f6bff",bn="#8f98a8",eo=.58,oo=.2,ro=.62,so=.16,wi={allowed:{color:fn,opacity:oo,zIndex:16},"allowed-passed":{color:bn,opacity:so,zIndex:16},band:{color:fn,opacity:eo,zIndex:17},"band-passed":{color:bn,opacity:ro,zIndex:17}},_i=100,qe=Le$1,ns=Le$1,io="route",es={type:"FeatureCollection",features:[]},ao=(t,n)=>({id:`${Un}${t}`,source:no,"source-layer":"geojson",minzoom:pn,filter:["==","kind",n]}),mn=(t,n,e)=>({...ao(t,n),type:"surface",overlay:io,elevation:qe,base:qe,bevel:0,bevelDrop:0,weld:0,groundField:false,paint:{material:"flat",...e}}),os=(t,n,e)=>({...ao(t,n),type:"line",overlay:io,depthTest:true,paint:{elevation:ns,material:"flat",...e}});function uo(){return [mn("allowed","allowed",{color:fn,opacity:oo}),mn("band","band",{color:fn,opacity:eo}),mn("allowed-passed","allowed-passed",{color:bn,opacity:so}),mn("band-passed","band-passed",{color:bn,opacity:ro}),os("chevron","chevron",{color:"rgba(255,255,255,0)",opacity:1,width:{stops:[[17,3],[18,6],[19,12],[20,24],[21,48],[22,96]]},arrow:true,arrowStyle:"chevron",arrowColor:"rgba(255,255,255,0.95)",arrowPeriod:{stops:[[17,28],[18,40],[19,64],[20,110],[21,200],[22,380]]},arrowSize:{stops:[[17,1.5],[18,3],[19,6],[20,12],[21,24],[22,48]]}})]}var vi=`${Un}chevron`,Ai=()=>uo().map(t=>String(t.id));function Pi(t,n=es){let e=t,o={...e.sources??{},[no]:{type:"geojson",sourceLayer:"geojson",minzoom:15,buffer:0,data:n}},r=e.layers.filter(s=>!String(s.id).startsWith(Un)),i=-1;return r.forEach((s,a)=>{String(s.id).startsWith(hn)&&(i=a);}),i<0&&(i=r.findIndex(s=>s.id===Je)),r.splice(i>=0?i+1:r.length,0,...uo()),{...t,sources:o,layers:r}}var at=111320,ht=32,rs=4096;function Ei(t){let n=new Map,e=0,o=0,r=(u,l)=>{l.length===1&&(l=[l[0],l[0]]);let c=n.get(u)??[];for(let m=1;m<l.length;m++){let[h,f,p]=l[m-1],[b,d,M]=l[m];c.push({ax:h,ay:f,ah:p,bx:b,by:d,bh:M}),e+=f,o++;}n.set(u,c);};for(let u of t){let l=u.properties,c=typeof l.layer=="number"?l.layer:0;if(typeof l.liftPath=="string"){for(let f of l.liftPath.split("|")){let p=f.split(";").map(b=>b.split(",").map(Number)).filter(b=>b.length===3&&b.every(Number.isFinite));p.length&&r(c,p);}continue}let m=typeof l.lift=="number"?l.lift:null;if(m===null)continue;let h=u.geometry;h.type==="LineString"?r(c,h.coordinates.map(([f,p])=>[f,p,m])):h.type==="Polygon"&&r(c,(h.coordinates[0]??[]).map(([f,p])=>[f,p,m]));}if(!o)return it;let i=at*Math.cos(e/o*Math.PI/180),s=22,a=new Map;if(Number.isFinite(i)){let u=s+1;for(let[l,c]of n){let m=new Map,h=false;for(let f of c){let p=Math.min(f.ax,f.bx)*i-u,b=Math.max(f.ax,f.bx)*i+u,d=Math.min(f.ay,f.by)*at-u,M=Math.max(f.ay,f.by)*at+u;if(Number.isFinite(p)&&Number.isFinite(b)&&Number.isFinite(d)&&Number.isFinite(M)){if((b-p)*(M-d)>rs*ht*ht){h=true;break}for(let x=Math.floor(p/ht);x<=Math.floor(b/ht);x++)for(let g=Math.floor(d/ht);g<=Math.floor(M/ht);g++){let L=`${x}:${g}`,R=m.get(L);R?R.push(f):m.set(L,[f]);}}}h||a.set(l,m);}}return (u,l)=>{if(l<0)return 0;let c=n.get(l);if(!c?.length)return it(u,l);let m=a.get(l),h=m?m.get(`${Math.floor(u[0]*i/ht)}:${Math.floor(u[1]*at/ht)}`)??[]:c,f=1/0,p=it(u,l);for(let b of h){let d=(b.ax-u[0])*i,M=(b.ay-u[1])*at,x=(b.bx-u[0])*i,g=(b.by-u[1])*at,L=x-d,R=g-M,w=L*L+R*R,v=w>1e-9?Math.max(0,Math.min(1,-(d*L+M*R)/w)):0,k=Math.hypot(d+L*v,M+R*v);k<f&&(f=k,p=b.ah+(b.bh-b.ah)*v);}return f<=s?p:it(u,l)}}var Ii=Le$1;function ss(t,n=it){let e=t.features.filter(r=>r.outline&&r.stations&&r.stations.length===r.line.length&&r.line.length>=2),o=e.filter(r=>r.kind==="band");return (o.length?o:e).map(r=>({stations:r.stations,heights:r.line.map((i,s)=>n(i,r.levels[s]??0))}))}function is(t,n=it){let e=ss(t,n);return e.length?o=>as(e,o):()=>0}function as(t,n){let e=0;for(let o of t){let r=o.stations,i=o.heights,s=Math.min(r.length,i.length);if(s===0||n<r[0]||n>r[s-1])continue;let a=0,u=s-1;for(;u-a>1;){let h=a+u>>1;r[h]<=n?a=h:u=h;}let l=r[u]-r[a],c=l>0?(n-r[a])/l:0,m=i[a]+(i[u]-i[a])*Math.max(0,Math.min(1,c));m>e&&(e=m);}return e}var Ze=25;function ki(t,n){if(t.length<2)return null;let e=gt(t),o=t[0][0],r=t[0][1],i=at*Math.cos(r*Math.PI/180),s=t.map(m=>(m[0]-o)*i),a=t.map(m=>(m[1]-r)*at),u=false;for(let m=0;m<=e.length&&!u;m+=5)n(m)>0&&(u=true);if(!u)return null;let l=Ze,c=new Map;for(let m=1;m<t.length;m++){let h=Math.floor(Math.min(s[m-1],s[m])/l),f=Math.floor(Math.max(s[m-1],s[m])/l),p=Math.floor(Math.min(a[m-1],a[m])/l),b=Math.floor(Math.max(a[m-1],a[m])/l);for(let d=h;d<=f;d++)for(let M=p;M<=b;M++){let x=`${d}:${M}`,g=c.get(x);g?g.push(m):c.set(x,[m]);}}return (m,h)=>{let f=(m-o)*i,p=(h-r)*at,b=Math.floor(f/l),d=Math.floor(p/l),M=Ze,x=-1;for(let g=-1;g<=1;g++)for(let L=-1;L<=1;L++){let R=c.get(`${b+g}:${d+L}`);if(R)for(let w of R){let v=s[w-1],k=a[w-1],S=s[w]-v,N=a[w]-k,Y=S*S+N*N,D=Y>1e-12?Math.max(0,Math.min(1,((f-v)*S+(p-k)*N)/Y)):0,F=Math.hypot(v+S*D-f,k+N*D-p);F<M&&(M=F,x=e.cum[w-1]+(e.cum[w]-e.cum[w-1])*D);}}return x<0?0:n(x)}}var jn=class{constructor(n,e=it,o={}){this.ribbon=n;this.heights=e;this.options=o;this.hs=[];this.props=new Map;this.shapes=new Map;this.frames=[];this.masks=[];this.routeLift=null;}setLift(n){this.options={...this.options,lift:n},this.hs=[],this.props.clear();}setHeights(n){this.heights=n,this.routeLift=null,this.hs=[],this.props.clear();}heightsOf(n){let e=this.hs[n];if(!e){let o=this.ribbon.features[n],r=o.stations,i=this.options.lift;if(i)e=o.line.map(s=>i(s[0],s[1]));else if(r&&r.length===o.line.length){let s=this.routeLift??(this.routeLift=is(this.ribbon,this.heights));e=r.map(s);}else e=o.line.map((s,a)=>this.heights(s,o.levels[a]??0));this.hs[n]=e;}return e}maskFor(n){let e=this.masks[n];if(!e){let o=s=>s==="band"?0:1,r=this.ribbon.features,i=o(r[n].kind);e=De(r.filter((s,a)=>s.outline&&a!==n&&(o(s.kind)<i||o(s.kind)===i&&a<n)).map(s=>s.outline)),this.masks[n]=e;}return e}shapesOf(n,e,o){var i;let r=(i=this.frames)[n]??(i[n]=ln(this.ribbon.features[n]));return Be(Vt(r,e,o),this.maskFor(n)).flatMap(Te)}at(n){let e=[],o=(r,i)=>e.push({type:"Feature",id:e.length+1,geometry:r,properties:i});return this.ribbon.features.forEach((r,i)=>{let s=Math.max(...r.levels);if(!r.outline){let a=r.stations;if(n!==null&&a&&a.length>=2&&a[a.length-1]<=n)return;let u=this.props.get(`${i}`);u||this.props.set(`${i}`,u=en(r.line,this.heightsOf(i))),o({type:"LineString",coordinates:r.line},{kind:r.kind,width:+r.width.toFixed(2),layer:s,...u});return}if(this.options.areas!==false)for(let a of Gt(r,n)){let u=`${i}:${a.kind}:${a.from}:${a.to}`,l=a.cut?void 0:this.shapes.get(u);l||(l=this.shapesOf(i,a.from,a.to),a.cut||this.shapes.set(u,l));let c=a.cut?void 0:this.props.get(u);c||(c=en($e(r,a.from,a.to),j(this.heightsOf(i),a.from,a.to,ct)),a.cut||this.props.set(u,c));for(let m of l)o({type:"Polygon",coordinates:m},{kind:a.kind,width:+r.width.toFixed(2),layer:s,...c});}}),{type:"FeatureCollection",features:e}}};function Ni(t,n=it){return new jn(t,n).at(null)}var Nt=Vr,yt={union:Nt.union??Nt.default?.union,intersection:Nt.intersection??Nt.default?.intersection,difference:Nt.difference??Nt.default?.difference},lo=t=>{let n=1/0,e=1/0,o=-1/0,r=-1/0;for(let i of t)for(let[s,a]of i[0]??[])s<n&&(n=s),s>o&&(o=s),a<e&&(e=a),a>r&&(r=a);return [n,e,o,r]},ls=(t,n)=>t[0]<=n[2]&&n[0]<=t[2]&&t[1]<=n[3]&&n[1]<=t[3],co=t=>t.map($t),mo=t=>t.map(n=>n.map(e=>e.map(o=>un([o[0],o[1]])))),jt=20,zn=5,cs=t=>t==="band"||t==="band-passed"?"band":"allowed",Wn=t=>t==="band"?"band-passed":"allowed-passed",ho=class{constructor(n,e=$n){this.ribbon=n;this.chunkM=e;this.groups=[];this.frames=[];this.built=false;this.featherCache=new Map;this.spans=null;}frame(n){var e;return (e=this.frames)[n]??(e[n]=ln(this.ribbon.features[n]))}build(){this.built=true;let n=new Map;this.ribbon.features.forEach((r,i)=>{if(!r.outline||r.line.length<2)return;let s=cs(r.kind);for(let a of Gt(r,null,this.chunkM)){let u=r.stations,l=u&&u.length===r.line.length?u[Math.floor(a.from)]+(u[Math.min(Math.floor(a.from)+1,u.length-1)]-u[Math.floor(a.from)])*(a.from-Math.floor(a.from)):0,c=Math.floor((l+1e-6)/this.chunkM),m=`${s}:${c}`,h=n.get(m);h||n.set(m,h={cat:s,chunk:c,pieces:[]}),h.pieces.push({i,from:a.from,to:a.to});}});let e=[...n.values()].sort((r,i)=>r.cat===i.cat?r.chunk-i.chunk:r.cat==="band"?-1:1),o=[];for(let r of e){let i=r.pieces.map(c=>[co(Vt(this.frame(c.i),c.from,c.to))]),s=i.length>1?yt.union(i[0],...i.slice(1)):yt.union(i[0]);if(!s.length)continue;let a=lo(s),u=o.filter(c=>ls(c.box,a));if(u.length&&(s=yt.difference(s,...u.map(c=>c.geom))),!s.length)continue;let l={cat:r.cat,chunk:r.chunk,geom:s,box:lo(s),pieces:r.pieces};this.groups.push(l),o.push(l);}}inside(n,e){for(let o of this.groups)if(!(n<o.box[0]||n>o.box[2]||e<o.box[1]||e>o.box[3]))for(let r of o.geom){if(!bo(n,e,r[0]))continue;let i=false;for(let s=1;s<r.length&&!i;s++)i=bo(n,e,r[s]);if(!i)return true}return false}featherOf(n){return n.map(e=>{let o=e,r=o.length-1,i=[];for(let s=0;s<r;s++){let[a,u]=o[s],[l,c]=o[s+1],m=Math.hypot(l-a,c-u);if(m<1e-9){i.push(false);continue}let h=(a+l)/2,f=(u+c)/2,p=-(c-u)/m*fo,b=(l-a)/m*fo;i.push(this.inside(h+p,f+b)!==this.inside(h-p,f-b));}return i})}spanOf(n){return this.spans||(this.spans=this.groups.map(e=>{if(e.pieces.every(r=>!this.ribbon.features[r.i].stations))return null;let o=(r,i)=>{let s=this.ribbon.features[r.i].stations;if(!s||!s.length)return 0;let a=Math.min(Math.floor(i),s.length-1);return s[a]+((s[Math.min(a+1,s.length-1)]??s[a])-s[a])*(i-a)};return {lo:Math.min(...e.pieces.map(r=>o(r,r.from))),hi:Math.max(...e.pieces.map(r=>o(r,r.to)))}})),this.spans[n]}passMode(n,e,o){let r=this.spanOf(n);return e===null||!r?"b":r.hi<=e-o-zn?"g":r.lo>=e+zn?"b":"x"}passKey(n,e=jt){this.built||this.build();let o="";for(let r=0;r<this.groups.length;r++)o+=this.passMode(r,n,e);return o}passAt(n,e=jt){this.built||this.build();let o=[],r=(i,s,a,u,l)=>{let c=mo(a);a.forEach((m,h)=>{let f=`${s}:${h}`,p=this.featherCache.get(f);p||this.featherCache.set(f,p=this.featherOf(m)),o.push({key:f,kind:i,polygon:c[h].map(b=>b.slice(0,-1)),feather:p,group:u,dir:l});});};return this.groups.forEach((i,s)=>{let a=`${i.cat}:${i.chunk}`,u=this.passMode(s,n,e),l=this.spanOf(s)!==null;u!=="g"&&r(i.cat,`${a}:whole`,i.geom,s,l?1:0),u!=="b"&&r(Wn(i.cat),`${a}:passed`,i.geom,s,-1);}),o}stationsFor(n,e){this.built||this.build();let o=this.groups[n];if(!o||!this.spanOf(n))return null;let r=[];for(let i of o.pieces){let s=this.ribbon.features[i.i],a=s.stations;if(!a||a.length!==s.line.length||a.length<2)continue;let u=this.frame(i.i),l=Math.max(0,Math.floor(i.from)),c=Math.min(a.length-1,Math.ceil(i.to));c>l&&r.push({xy:u.xy,st:a,frame:u.frame,k0:l,k1:c});}return r.length?e.map(i=>i.map(s=>{let a=1/0,u=0;for(let l of r){let c=l.frame.toXY(s);for(let m=l.k0;m<l.k1;m++){let h=l.xy[m],f=l.xy[m+1],p=f.x-h.x,b=f.y-h.y,d=p*p+b*b,M=d>1e-12?((c.x-h.x)*p+(c.y-h.y)*b)/d:0;M=M<0?0:M>1?1:M;let x=c.x-(h.x+p*M),g=c.y-(h.y+b*M),L=x*x+g*g;L<a&&(a=L,u=l.st[m]+(l.st[m+1]-l.st[m])*M);}}return u})):null}at(n){this.built||this.build();let e=[],o=(r,i,s)=>{let a=mo(s);s.forEach((u,l)=>{let c=`${i}:${l}`,m=this.featherCache.get(c);m||(m=this.featherOf(u),i.includes(":cut-")||this.featherCache.set(c,m)),e.push({key:c,kind:r,polygon:a[l].map(h=>h.slice(0,-1)),feather:m});});};for(let r of this.groups){let i=r.pieces.map(c=>this.ribbon.features[c.i]),s=(c,m)=>{let h=this.ribbon.features[c.i].stations;if(!h||!h.length)return 0;let f=Math.min(Math.floor(m),h.length-1);return h[f]+((h[Math.min(f+1,h.length-1)]??h[f])-h[f])*(m-f)},a=Math.min(...r.pieces.map(c=>s(c,c.from))),u=Math.max(...r.pieces.map(c=>s(c,c.to))),l=`${r.cat}:${r.chunk}`;if(n===null||n<=a||i.every(c=>!c.stations))o(r.cat,`${l}:whole`,r.geom);else if(n>=u)o(Wn(r.cat),`${l}:passed`,r.geom);else {let c=[];for(let p of r.pieces){let b=this.ribbon.features[p.i];for(let d of Gt(b,n,this.chunkM)){if(d.kind===b.kind||d.to<=p.from+1e-9||d.from>=p.to-1e-9)continue;let M=Math.max(d.from,p.from),x=Math.min(d.to,p.to);x-M>1e-6&&c.push([co(Vt(this.frame(p.i),M,x))]);}}if(!c.length){o(r.cat,`${l}:whole`,r.geom);continue}let m=c.length>1?yt.union(c[0],...c.slice(1)):yt.union(c[0]),h=yt.intersection(r.geom,m),f=yt.difference(r.geom,m);o(Wn(r.cat),`${l}:cut-passed:${n}`,h),o(r.cat,`${l}:cut-rest:${n}`,f);}}return e}},fo=5;function bo(t,n,e){let o=e,r=false;for(let i=0,s=o.length-1;i<o.length;s=i++){let[a,u]=o[i],[l,c]=o[s];u>n!=c>n&&t<(l-a)*(n-u)/(c-u)+a&&(r=!r);}return r}var Oi={COLOR:"rgba(255,255,255,0)",ARROW_COLOR:"rgba(255,255,255,0.95)",WIDTH_M:2.75,PERIOD_M:18.3,SIZE_M:1.37,Z:18};function Xi(t,n,e=jt){let o=[];return t.features.forEach((r,i)=>{if(r.outline||r.kind!=="chevron"||r.line.length<2)return;let s=r.stations,a=s&&s.length>=2?[s[0],s[s.length-1]]:null;n!==null&&a&&a[1]<=n-e-zn||o.push({key:`chevron:${i}`,line:r.line,stations:a});}),o}function Yi(t,n){let e=t.stations,o=t.line;if(!e||o.length<2||!n.length)return null;let r=$(o[0]),i=r.toXY(n[0]),s=0,a=1/0,u=0;for(let l=0;l+1<o.length;l++){let c=r.toXY(o[l]),m=r.toXY(o[l+1]),h=pt(o[l],o[l+1]),f=m.x-c.x,p=m.y-c.y,b=f*f+p*p,d=b>1e-12?((i.x-c.x)*f+(i.y-c.y)*p)/b:0;d=d<0?0:d>1?1:d;let M=i.x-(c.x+f*d),x=i.y-(c.y+p*d),g=M*M+x*x;g<a&&(a=g,u=s+h*d),s+=h;}return s>1e-9?e[0]+(e[1]-e[0])*u/s:e[0]}function Ti(t,n){let e=[];return t.features.forEach((o,r)=>{if(o.outline||o.kind!=="chevron"||o.line.length<2)return;let i=o.stations;n!==null&&i&&i.length>=2&&i[i.length-1]<=n||e.push({key:`chevron:${r}`,line:o.line});}),e}var St=5e-5;function Di(t,n){let e=[],o=new Map;for(let r of t){let i=r.lonlat,s=r.z,a=r.normals,u=r.indices;for(let l=0;l+2<u.length;l+=3){let c=u[l],m=u[l+1],h=u[l+2];if(a[3*c+2]<.5||a[3*m+2]<.5||a[3*h+2]<.5)continue;let f={ax:i[2*c],ay:i[2*c+1],az:s[c],bx:i[2*m],by:i[2*m+1],bz:s[m],cx:i[2*h],cy:i[2*h+1],cz:s[h]},p=e.push(f)-1,b=Math.floor(Math.min(f.ax,f.bx,f.cx)/St),d=Math.floor(Math.max(f.ax,f.bx,f.cx)/St),M=Math.floor(Math.min(f.ay,f.by,f.cy)/St),x=Math.floor(Math.max(f.ay,f.by,f.cy)/St);for(let g=b;g<=d;g++)for(let L=M;L<=x;L++){let R=`${g}:${L}`,w=o.get(R);w?w.push(p):o.set(R,[p]);}}}return (r,i,s)=>{let a=o.get(`${Math.floor(r/St)}:${Math.floor(i/St)}`),u=null;if(a)for(let l of a){let c=e[l],m=(c.by-c.cy)*(c.ax-c.cx)+(c.cx-c.bx)*(c.ay-c.cy);if(Math.abs(m)<1e-20)continue;let h=((c.by-c.cy)*(r-c.cx)+(c.cx-c.bx)*(i-c.cy))/m,f=((c.cy-c.ay)*(r-c.cx)+(c.ax-c.cx)*(i-c.cy))/m,p=1-h-f;if(h<-1e-9||f<-1e-9||p<-1e-9)continue;let b=h*c.az+f*c.bz+p*c.cz;(u===null||(s!==void 0?Math.abs(b-s)<Math.abs(u-s):b>u))&&(u=b);}if(u!==null)return u;for(let l of n)if(r>=l[0]&&r<=l[2]&&i>=l[1]&&i<=l[3])return null}}function Bi(t,n){return !t&&!n?null:(e,o)=>{let r=n?n(e,o):0,i=t?t(e,o,r):void 0;return i===void 0?r:i===null?0:i>0?i:0}}var Mo=20,qn=300,Zn=34,ms=pn+.05,hs=pn-.05,dn=2,Kt=30,Mn=1;function Vi(t,n,e=Mo){if(t.length<2||!n.length||!(e>0))return null;let o=$(t[0]),r=At(t,o),i=[];for(let[s,a]of n)s>Mn&&i.push({at:s,dir:1}),a<r.length-Mn&&i.push({at:a,dir:-1});return i.length?{frame:o,route:r,ends:i,fadeM:e}:null}function xo(t,n){let e=1;for(let o of t.ends){let r=dt(t.route,n,o.at-t.fadeM-Kt,o.at+t.fadeM+Kt);r.d>Kt||(e=Math.min(e,U((r.s-o.at)*o.dir/t.fadeM)));}return e}function fs(t,n){return xo(t,t.frame.toXY(n))}function bs(t,n){let e=t.fadeM+Kt;for(let o of t.ends){let r=G(t.route,o.at);if(Math.hypot(n.x-r.x,n.y-r.y)<=e)return true}return false}function ps(t,n,e){let o=e.x-n.x,r=e.y-n.y,i=o*o+r*r,s=i>1e-12?Math.min(Math.max(((t.x-n.x)*o+(t.y-n.y)*r)/i,0),1):0;return Math.hypot(t.x-(n.x+o*s),t.y-(n.y+r*s))}function go(t,n,e){let o=t.fadeM+Kt;for(let r of t.ends)if(ps(G(t.route,r.at),n,e)<=o)return true;return false}function ji(t,n,e){if(!t)return {polygon:n,feather:e,alphas:null};let o=[],r=[],i=[],s=false;return n.forEach((a,u)=>{let l=a.length,c=a.map(b=>t.frame.toXY(b)),m=[],h=[],f=[],p=(b,d,M)=>{let x=bs(t,d)?xo(t,d):1;x<1&&(s=true),m.push(b),h.push(M),f.push(x);};for(let b=0;b<l;b++){let d=(b+1)%l,M=e[u]?.[b]!==false;p(a[b],c[b],M);let x=Math.hypot(c[d].x-c[b].x,c[d].y-c[b].y);if(x<=dn||!go(t,c[b],c[d]))continue;let g=Math.ceil(x/dn);for(let L=1;L<g;L++){let R=L/g,w=[a[b][0]+(a[d][0]-a[b][0])*R,a[b][1]+(a[d][1]-a[b][1])*R];p(w,{x:c[b].x+(c[d].x-c[b].x)*R,y:c[b].y+(c[d].y-c[b].y)*R},M);}}o.push(m),r.push(h),i.push(f);}),s?{polygon:o,feather:r,alphas:i}:{polygon:n,feather:e,alphas:null}}function Ki(t,n){if(!t||n.length<2)return [n];let e=[],o=[],r=()=>{o.length>=2&&e.push(o),o=[];},i=s=>{fs(t,s)>=.999?o.push(s):r();};i(n[0]);for(let s=1;s<n.length;s++){let a=t.frame.toXY(n[s-1]),u=t.frame.toXY(n[s]),l=Math.hypot(u.x-a.x,u.y-a.y);if(l>dn&&go(t,a,u)){let c=Math.ceil(l/dn);for(let m=1;m<c;m++){let h=m/c;i([n[s-1][0]+(n[s][0]-n[s-1][0])*h,n[s-1][1]+(n[s][1]-n[s-1][1])*h]);}}i(n[s]);}return r(),e}function Ui(t,n,e=Mo){let o=0;for(let i=1;i<t.length;i++)o+=pt(t[i-1],t[i]);let r=[];for(let[i,s]of n){let a=i>Mn?i+e:i,u=s<o-Mn?s-e:s;u-a>.5&&r.push([a,u]);}return r}function Wi(t,n){let e=[],o=0;for(let[r,i]of t)r>o&&e.push([o,r]),o=Math.max(o,i);return o<n&&e.push([o,n]),e}var po=class{constructor(){this.on=false;this.t=0;this.at=null;}update(n,e,o){if(!o&&this.t===0)return this.on=false,this.at=null,false;let r=this.at===null||e-this.at>1e3||e<this.at?0:Math.min(e-this.at,Zn);this.at=e,o?(this.on?n<hs:n>=ms)&&(this.on=!this.on):this.on=false;let i=this.on?1:0,s=r/qn;return this.t=i>this.t?Math.min(i,this.t+s):Math.max(i,this.t-s),this.t!==i}get ribbonAlpha(){return U(this.t)}get lineAlpha(){return 1-U(this.t)}get animating(){return this.t!==(this.on?1:0)}};var Jn={RADIUS_M:15,MIN_TURN_DEG:2,ARC_STEP:Math.PI/16};function Ji(t,n=Jn.RADIUS_M){let e=t.length,o=[],r=[],i=s=>{let a=o[o.length-1];return (!a||Math.abs(a[0]-s[0])>1e-10||Math.abs(a[1]-s[1])>1e-10)&&o.push(s),o.length-1};for(let s=0;s<e;s++){if(s===0||s===e-1||!(n>0)){r.push(i(t[s]));continue}let a=$(t[s]),u=a.toXY(t[s-1]),l=a.toXY(t[s+1]),c=Math.hypot(u.x,u.y),m=Math.hypot(l.x,l.y);if(c<1e-6||m<1e-6){r.push(i(t[s]));continue}let h={x:-u.x/c,y:-u.y/c},f={x:l.x/m,y:l.y/m},p=Math.max(-1,Math.min(1,h.x*f.x+h.y*f.y)),b=Math.acos(p);if(b<Jn.MIN_TURN_DEG*Math.PI/180){r.push(i(t[s]));continue}let d=Math.tan(b/2),M=n*d,x=Math.min(c,m)/2;M>x&&(M=x);let g=M/d,L=h.x*f.y-h.y*f.x>0?1:-1,R={x:-h.x*M,y:-h.y*M},w={x:R.x-h.y*L*g,y:R.y+h.x*L*g},v=Math.atan2(R.y-w.y,R.x-w.x),k=Math.max(2,Math.ceil(b/Jn.ARC_STEP));k%2&&k++;let S=0;for(let N=0;N<=k;N++){let Y=v+L*b*N/k,D=i(a.toLonLat({x:w.x+Math.cos(Y)*g,y:w.y+Math.sin(Y)*g}));N===k/2&&(S=D);}r.push(S);}return {coords:o,anchors:r,line:gt(o),src:gt(t)}}function ds(t,n){let e=0,o=t.length-2;if(o<0)return 0;for(;e<o;){let r=e+o+1>>1;t[r]<=n?e=r:o=r-1;}return e}function xn(t,n){let e=t.src.cum;if(e.length<2)return 0;if(n<=0)return t.line.cum[t.anchors[0]];if(n>=t.src.length)return t.line.cum[t.anchors[t.anchors.length-1]];let o=ds(e,n),r=e[o+1]-e[o],i=r>1e-9?(n-e[o])/r:0,s=t.line.cum[t.anchors[o]],a=t.line.cum[t.anchors[o+1]];return s+(a-s)*i}function Lo(t,n){return Mt(t.line,xn(t,n))}var yo=3;function Qi(t,n){let e=xn(t,n),o=t.line.length,r=Mt(t.line,Math.max(0,Math.min(o,e-yo))),i=Mt(t.line,Math.max(0,Math.min(o,e+yo))),s=Math.cos((r[1]+i[1])/2*Math.PI/180),a=(i[0]-r[0])*s,u=i[1]-r[1],l=a===0&&u===0?0:(Math.atan2(a,u)*180/Math.PI+360)%360;return {point:Mt(t.line,e),bearing:l}}function ta(t,n){let e=[];for(let o of n){if(!(o.at>=0&&o.at<t.anchors.length))continue;let r=Math.min(t.anchors[o.at],t.coords.length-2);if(e.length&&r<=e[e.length-1].at){e[e.length-1]={at:e[e.length-1].at,factor:o.factor};continue}e.push({at:r,factor:o.factor});}return e}function na(t,n){return n.map(([e,o])=>[xn(t,e),xn(t,o)])}var Ft=111320,Ms=2,xs=.5;function gs(t,n){let e=Math.min(t.length,n.length),o=t.slice(0,e),r=i=>{let s=Math.cos(n[i][1]*Math.PI/180)*Ft;return Math.hypot((n[i][0]-n[i-1][0])*s,(n[i][1]-n[i-1][1])*Ft)};for(let i=1;i<e;i++){if(o[i]>o[i-1])continue;let s=i;for(;s+1<e&&!(o[s+1]>o[i-1]);)s++;let a=0,u=[];for(let h=i;h<=Math.min(s+1,e-1);h++)u.push(a+=r(h));let l=o[i-1],c=s+1<e?o[s+1]:l+a,m=s+1<e?a:a||1;for(let h=i;h<=s;h++)o[h]=m>0?l+(c-l)*u[h-i]/m:l+(c-l)*(h-i+1)/(s-i+2);i=s;}return o}function sa(t,n){if(!t||n.coords.length<2)return null;let e=Math.min(t.stations.length,t.line.length,t.weights.length);if(e<2)return null;let o=gs(t.stations.slice(0,e),t.line),r=t.line.slice(0,e).map(M=>M[0]),i=t.line.slice(0,e).map(M=>M[1]),s=o[0],a=o[e-1];if(!(a>s))return null;let u=Math.max(1,Math.ceil((a-s)/xs)),l=[],c=[],m=[],h=0,f=0;for(;h<=u||f<e;){let M=h<=u?h===u?a:s+(a-s)*h/u:1/0,x=f<e?o[f]:1/0,g;if(M<=x?(g=M,h++):(g=x,f++),l.length&&!(g>l[l.length-1]+1e-9))continue;let L=Z(o,t.weights,g),R=Lo(n,g),w=Math.cos(R[1]*Math.PI/180)*Ft;l.push(g),c.push(L*(Z(o,r,g)-R[0])*w),m.push(L*(Z(o,i,g)-R[1])*Ft);}let p=M=>c[M]===0&&m[M]===0,b={stations:[],east:[],north:[]},d=l.length-1;for(let M=0;M<=d;M++)p(M)&&M>0&&M<d&&p(M-1)&&p(M+1)||(b.stations.push(l[M]),b.east.push(c[M]),b.north.push(m[M]));return b}function ys(t,n){let e=t.stations,o=Ms;return {east:Z(e,t.east,n),north:Z(e,t.north,n),dEast:(Z(e,t.east,n+o)-Z(e,t.east,n-o))/(2*o),dNorth:(Z(e,t.north,n+o)-Z(e,t.north,n-o))/(2*o)}}function ia(t,n,e,o){if(!Number.isFinite(e))return {point:t,bearing:n};let r=0,i=0,s=0,a=0,u=false;for(let p of o){if(!p.track||!(p.alpha>0))continue;let b=Math.min(1,p.alpha),d=ys(p.track,e);r+=b*d.east,i+=b*d.north,s+=b*d.dEast,a+=b*d.dNorth,u=true;}if(!u)return {point:t,bearing:n};let l=n*Math.PI/180,c=Math.sin(l)+s,m=Math.cos(l)+a,h=c===0&&m===0?n:(Math.atan2(c,m)*180/Math.PI+360)%360,f=Math.cos(t[1]*Math.PI/180)*Ft;return {point:[t[0]+r/f,t[1]+i/Ft],bearing:h}}var ft={BEFORE_M:22,AFTER_M:18,NEARBY_M:50,END_MARGIN_M:3,MIN_ZOOM:14,BODY_PX:[[14,5],[16,10],[18,12]],BORDER_PX:[[14,8],[16,16],[18,19]],HEAD_SCALE:[[14,.5],[16,1],[18,1.15]],HEAD_BORDER_HALF_PX:15,HEAD_BORDER_LEN_PX:18,HEAD_FILL_HALF_PX:11,HEAD_FILL_LEN_PX:12,HEAD_FILL_INSET_PX:3,ROUND_PX:.75,SHADOW_PX:2.5,ARC_STEP:Math.PI/8,STEP_M:1,FILL:"#ffffff",CASING:"#055fcd",SHADOW:"#0b1a3a",FILL_OPACITY:1,CASING_OPACITY:1,SHADOW_OPACITY:.18,LIFT_M:.28,Z_SHADOW:23,Z_CASING:24,Z_FILL:25,ZOOM_STEP:.125,PASS_FADE_M:jt};function vo(t,n){let e=(t||"").toLowerCase(),o=(n||"").toLowerCase();switch(e){case "turn":case "merge":case "on ramp":case "off ramp":case "fork":case "end of road":case "roundabout":case "rotary":case "roundabout turn":case "exit roundabout":case "exit rotary":return true;case "continue":case "new name":return o!==""&&o!=="straight";default:return false}}function Qn(t,n){if(n<=t[0][0])return t[0][1];for(let e=1;e<t.length;e++){let[o,r]=t[e];if(n<=o){let[i,s]=t[e-1];return s+(r-s)*(n-i)/(o-i)}}return t[t.length-1][1]}function fa(t){return Math.floor(t/ft.ZOOM_STEP+.5)*ft.ZOOM_STEP}function Ls(t,n){let e=ft,o=n,r=Qn(e.HEAD_SCALE,t)*o;return {bodyHalfM:Qn(e.BODY_PX,t)/2*o,borderHalfM:Qn(e.BORDER_PX,t)/2*o,headBorderHalfM:e.HEAD_BORDER_HALF_PX*r,headBorderLenM:e.HEAD_BORDER_LEN_PX*r,headFillHalfM:e.HEAD_FILL_HALF_PX*r,headFillLenM:e.HEAD_FILL_LEN_PX*r,headFillInsetM:e.HEAD_FILL_INSET_PX*r,roundM:e.ROUND_PX*o,shadowM:e.SHADOW_PX*o}}var tt=(t,n)=>({x:t.x-n.x,y:t.y-n.y}),nt=t=>Math.sqrt(t.x*t.x+t.y*t.y);function Ao(t,n){let e=[];for(let s of t)(!e.length||nt(tt(s,e[e.length-1]))>1e-6)&&e.push(s);if(e.length<2)return e;let o=[e[0]],r=0;for(let s=1;s<e.length;s++){let a=e[s-1],u=e[s],l=nt(tt(u,a)),c=n-r;for(;c<l-1e-9;)o.push({x:a.x+(u.x-a.x)*c/l,y:a.y+(u.y-a.y)*c/l}),c+=n;r=l-(c-n);}let i=e[e.length-1];return nt(tt(i,o[o.length-1]))>n*.25?o.push(i):o[o.length-1]=i,o}function ee(t){let n=[0];for(let e=1;e<t.length;e++)n.push(n[e-1]+nt(tt(t[e],t[e-1])));return n}function ne(t,n,e){for(let o=1;o<t.length;o++)if(n[o]>=e){let r=n[o]-n[o-1],i=r>1e-12?(e-n[o-1])/r:0;return {x:t[o-1].x+(t[o].x-t[o-1].x)*i,y:t[o-1].y+(t[o].y-t[o-1].y)*i}}return t[t.length-1]}function Ro(t,n){let e=t[n>0?n-1:0],o=t[n+1<t.length?n+1:t.length-1],r=tt(o,e),i=nt(r)||1;return {x:-r.y/i,y:r.x/i}}function Rs(t){let n=0;for(let e=0;e<t.length;e++){let o=t[e],r=t[(e+1)%t.length];n+=o.x*r.y-r.x*o.y;}return n/2}function Ct(t,n){let e=t.length,o=[];for(let r=0;r<e;r++){let i=t[(r+e-1)%e],s=t[r],a=t[(r+1)%e],u=tt(s,i),l=tt(a,s),c=nt(u)||1,m=nt(l)||1,h={x:u.y/c,y:-u.x/c},f={x:l.y/m,y:-l.x/m};if(u.x*l.y-u.y*l.x>1e-12){let g=Math.atan2(h.y,h.x),L=Math.atan2(f.y,f.x);for(;L<g;)L+=2*Math.PI;let R=Math.max(1,Math.ceil((L-g)/ft.ARC_STEP));for(let w=0;w<=R;w++){let v=g+(L-g)*w/R;o.push({x:s.x+Math.cos(v)*n,y:s.y+Math.sin(v)*n});}continue}let b=h.x+f.x,d=h.y+f.y,M=Math.sqrt(b*b+d*d);if(M<1e-9){o.push({x:s.x+h.x*n,y:s.y+h.y*n});continue}let x=n/(M/2);o.push({x:s.x+b/M*x,y:s.y+d/M*x});}return _s(vs(o))}function ws(t,n,e,o){let r=n.x-t.x,i=n.y-t.y,s=o.x-e.x,a=o.y-e.y,u=r*a-i*s;if(Math.abs(u)<1e-12)return null;let l=((e.x-t.x)*a-(e.y-t.y)*s)/u,c=((e.x-t.x)*i-(e.y-t.y)*r)/u;return l>1e-9&&l<1-1e-9&&c>1e-9&&c<1-1e-9?{x:t.x+r*l,y:t.y+i*l}:null}function _s(t){let n=t;for(let e=0;e<64;e++){let o=n.length,r=null;for(let s=0;s<o&&!r;s++)for(let a=2;a<o/2&&!r;a++){let u=(s+a)%o,l=ws(n[s],n[(s+1)%o],n[u],n[(u+1)%o]);l&&(r={i:s,j:u,p:l});}if(!r)return n;let i=[];for(let s=0;s<o;s++)(r.i<r.j?s>r.i&&s<=r.j:s>r.i||s<=r.j)||i.push(n[s]),s===r.i&&i.push(r.p);n=i;}return n}function vs(t){let n=t;for(let e=true;e&&n.length>3;){e=false;let o=[],r=n.length;for(let i=0;i<r;i++){let s=o.length?o[o.length-1]:n[(i+r-1)%r],a=n[i],u=n[(i+1)%r],l=a.x-s.x,c=a.y-s.y,m=u.x-a.x,h=u.y-a.y,f=l*m+c*h,p=l*h-c*m,b=Math.sqrt(l*l+c*c),d=Math.sqrt(m*m+h*h);if(b<1e-9||f<0&&Math.abs(p)<=.2*b*d){e=true;continue}o.push(a);}n=o;}return n}function gn(t,n,e,o,r){let i=ee(t),s=i[i.length-1];if(s<o*1.2)return null;let a=s-o,u=ne(t,i,s-r),l=ne(t,i,a),c=tt(t[t.length-1],l),m=nt(c)||1,h={x:-c.y/m,y:c.x/m},f=Math.max(n-r,n*.02),p=Math.max(e-r,f),b=[],d=[];for(let v=0;v<t.length&&i[v]<a-1e-9;v++){let k=Ro(t,v);b.push({x:t[v].x+k.x*f,y:t[v].y+k.y*f}),d.push({x:t[v].x-k.x*f,y:t[v].y-k.y*f});}let M=v=>(v.x-l.x)*c.x+(v.y-l.y)*c.y>=-1e-9;for(;b.length>1&&M(b[b.length-1]);)b.pop();for(;d.length>1&&M(d[d.length-1]);)d.pop();b.push({x:l.x+h.x*f,y:l.y+h.y*f}),d.push({x:l.x-h.x*f,y:l.y-h.y*f});let x=Ro(t,0),g={x:-x.y,y:x.x},L=[],R=Math.max(2,Math.ceil(Math.PI/ft.ARC_STEP));for(let v=1;v<R;v++){let k=Math.PI*v/R,S=Math.cos(k),N=Math.sin(k);L.push({x:t[0].x+(x.x*S+g.x*N)*f,y:t[0].y+(x.y*S+g.y*N)*f});}let w=[...d,{x:l.x-h.x*p,y:l.y-h.y*p},u,{x:l.x+h.x*p,y:l.y+h.y*p},...b.reverse(),...L];return Rs(w)>=0?w:w.reverse()}function wo(t,n){let e=t[t.length-2],o=t[t.length-1],r=tt(o,e),i=nt(r)||1;return [...t,{x:o.x+r.x/i*n,y:o.y+r.y/i*n}]}function te(t,n,e,o,r){let i=t.length,s=n[i-1],a=[];for(let u of r){let l=1/0,c=0;for(let m=1;m<i;m++){let h=t[m-1],f=t[m],p=f.x-h.x,b=f.y-h.y,d=p*p+b*b,M=d>1e-12?((u.x-h.x)*p+(u.y-h.y)*b)/d:0;M=M<0?0:M>1?1:M;let x=u.x-(h.x+p*M),g=u.y-(h.y+b*M),L=x*x+g*g;L<l&&(l=L,c=n[m-1]+(n[m]-n[m-1])*M);}if(c<=0){let m=tt(t[1],t[0]),h=nt(m)||1;c=Math.min(0,((u.x-t[0].x)*m.x+(u.y-t[0].y)*m.y)/h);}else if(c>=s){let m=tt(t[i-1],t[i-2]),h=nt(m)||1;c=s+Math.max(0,((u.x-t[i-1].x)*m.x+(u.y-t[i-1].y)*m.y)/h);}a.push(e+c*o);}return a.push(a[0]),a}function Po(t,n,e,o,r,i,s){let a=f=>{let p=f.map(t.toLonLat);return p.push(p[0]),p},u=ee(n),l=u[u.length-1],c=l>1e-9?(o-e)/l:1,m=te(n,u,e,c,s),h=-1/0;for(let f of m)f>h&&(h=f);return {line:n.map(t.toLonLat),fill:a(r),casing:a(i),shadow:a(s),fillStations:te(n,u,e,c,r),casingStations:te(n,u,e,c,i),shadowStations:m,endM:h}}function ba(t,n,e={}){if(t.length<2)return [];let o=gt(t),r=ft,i=e.zoom??16,s=Ls(i,e.metersPerPixel??x(t[0][1],i)),a=Math.min(s.roundM,s.bodyHalfM*.5),u=n.map((m,h)=>({m,i:h})).filter(({m})=>vo(m.type,m.modifier)&&m.atM>=r.END_MARGIN_M&&o.length-m.atM>=r.END_MARGIN_M).sort((m,h)=>m.m.atM-h.m.atM||m.i-h.i),l=[];for(let m of u){let h=l[l.length-1];h&&m.m.atM-h[h.length-1].m.atM<=r.NEARBY_M?h.push(m):l.push([m]);}let c=[];for(let m of l){let h=m[0].m.atM,f=Math.max(0,h-r.BEFORE_M),p=Math.min(o.length,m[m.length-1].m.atM+r.AFTER_M),b=Hn(o,f,p);if(b.length<2)continue;let d=$(b[0]),M=Ao(b.map(d.toXY),r.STEP_M);if(M.length<3)continue;let x=gn(wo(M,s.headBorderLenM),s.borderHalfM,s.headBorderHalfM,s.headBorderLenM,a),g=gn(wo(M,s.headFillInsetM+s.headFillLenM),s.bodyHalfM,s.headFillHalfM,s.headFillLenM,a);!x||!g||c.push({index:m[0].i,indices:m.map(L=>L.i),atM:h,fromM:f,toM:p,...Po(d,M,f,p,Ct(g,a),Ct(x,a),Ct(x,a+s.shadowM))});}return c}var Eo={BODY:.3,BORDER:.36,HEAD_FILL_HALF:.4,HEAD_BORDER_HALF:.47,HEAD_FILL_LEN:.9,HEAD_BORDER_LEN:1.1,HEAD_FILL_INSET:.15,ROUND:.05,SHADOW:.04,MIN_AFTER_M:8,SETTLE_PROBE_M:4,SETTLE_AHEAD_M:12,SETTLE_TAIL_M:6,SETTLE_DEG:15,SETTLE_STEP_M:1,SETTLE_MAX_M:40};function pa(t,n){let e=ft,o=Eo,r=t.features.filter(u=>u.kind==="band"&&u.outline&&u.stations&&u.stations.length===u.line.length&&u.line.length>=2);if(!r.length)return [];let i=n.map((u,l)=>({m:u,i:l})).filter(({m:u})=>vo(u.type,u.modifier)).sort((u,l)=>u.m.atM-l.m.atM||u.i-l.i),s=[];for(let u of i){let l=s[s.length-1];l&&u.m.atM-l[l.length-1].m.atM<=e.NEARBY_M?l.push(u):s.push([u]);}let a=[];for(let u of s){let l=u[0].m.atM,c=u[u.length-1].m.atM,m=r.filter(N=>N.stations[0]<=l&&N.stations[N.stations.length-1]>=c+o.MIN_AFTER_M).sort((N,Y)=>Y.stations[Y.stations.length-1]-Y.stations[0]-(N.stations[N.stations.length-1]-N.stations[0]))[0];if(!m)continue;let h=m.stations,f=Math.max(h[0],l-e.BEFORE_M),p=As(m.line,h,Math.min(h[h.length-1],c+e.AFTER_M),Math.min(h[h.length-1],c+o.SETTLE_MAX_M)),b=Q(h,f),d=Q(h,p),M=j(m.line,b,d,xt);if(M.length<2)continue;let x=m.widths&&m.widths.length===m.line.length?m.widths:m.line.map(()=>m.width),g=j(x,Q(h,l),Q(h,l),ct)[0]??m.width,L=$(M[0]),R=Ao(M.map(L.toXY),e.STEP_M);if(R.length<3)continue;let w=Math.min(o.ROUND*g,o.BODY*g*.5),v=gn(R,o.BORDER*g,o.HEAD_BORDER_HALF*g,o.HEAD_BORDER_LEN*g,w),k=Ps(R,o.HEAD_FILL_INSET*g),S=k?gn(k,o.BODY*g,o.HEAD_FILL_HALF*g,o.HEAD_FILL_LEN*g,w):null;!v||!S||a.push({index:u[0].i,indices:u.map(N=>N.i),atM:l,fromM:f,toM:p,...Po(L,R,f,p,Ct(S,w),Ct(v,w),Ct(v,w+o.SHADOW*g))});}return a}function As(t,n,e,o){let r=Eo,i=l=>j(t,Q(n,l),Q(n,l),xt)[0],s=$(i(e)),a=(l,c)=>{let m=s.toXY(i(l)),h=s.toXY(i(c));return Math.atan2(h.y-m.y,h.x-m.x)},u=e;for(;u<o;){let l=Math.abs(a(u-r.SETTLE_PROBE_M,u)-a(u,u+r.SETTLE_AHEAD_M));if(Math.min(l,2*Math.PI-l)*180/Math.PI<=r.SETTLE_DEG)break;u=Math.min(o,u+r.SETTLE_STEP_M);}return u>e?Math.min(o,u+r.SETTLE_TAIL_M):u}function Ps(t,n){let e=ee(t),o=e[e.length-1];if(o-n<1)return null;let r=ne(t,e,o-n),i=[];for(let s=0;s<t.length&&e[s]<o-n-1e-9;s++)i.push(t[s]);return i.push(r),i.length>=2?i:null}function da(t,n,e,o=0){if(e<ft.MIN_ZOOM)return [];let r=n??-1/0,i=[];return t.forEach((s,a)=>{(o>0?s.endM>r-o:s.toM>r)&&i.push(a);}),i}var _o=class{constructor(){this.items=new Map;this.at=null;this.gone=[];}show(n){let e=new Set(n);for(let[o,r]of this.items)r.on=e.has(o);for(let o of e)this.items.has(o)||this.items.set(o,{t:0,on:true});}tick(n){this.gone=[];let e=this.at===null||n-this.at>1e3||n<this.at?0:Math.min(n-this.at,Zn);this.at=n;let o=e/qn,r=false;for(let[i,s]of this.items){let a=s.on?1:0;if(s.t=a>s.t?Math.min(a,s.t+o):Math.max(a,s.t-o),!s.on&&s.t===0){this.items.delete(i),this.gone.push(i);continue}s.t!==a&&(r=true);}return r}settle(){this.gone=[];for(let[n,e]of this.items)e.on?e.t=1:(this.items.delete(n),this.gone.push(n));}alpha(n){let e=this.items.get(n);return e?U(e.t):0}has(n){return this.items.has(n)}get animating(){for(let n of this.items.values())if(n.t!==(n.on?1:0))return true;return false}};
|
|
2
|
-
export{U as $,Or as $a,Zr as $b,ta as $c,Wo as A,_e as Aa,un as Ab,ho as Ac,zo as B,gr as Ba,Xe as Bb,Oi as Bc,qo as C,Vs as Ca,Te as Cb,Xi as Cc,Zo as D,Xn as Da,De as Db,Yi as Dc,Jo as E,yr as Ea,Be as Eb,Ti as Ec,he as F,Rr as Fa,$n as Fb,Di as Fc,Qo as G,wr as Ga,Gt as Gb,Bi as Gc,Ns as H,_r as Ha,ln as Hb,Mo as Hc,Ss as I,Z as Ia,Vt as Ib,qn as Ic,Pn as J,Yn as Ja,$e as Jb,Zn as Jc,Cn as K,Tn as Ka,Gn as Kb,ms as Kc,Yt as L,vr as La,mt as Lb,hs as Lc,En as M,Ar as Ma,je as Mb,dn as Mc,kn as N,Pr as Na,Ur as Nb,Kt as Nc,Me as O,Er as Oa,Wr as Ob,Vi as Oc,ir as P,Ir as Pa,zr as Pb,fs as Pc,Nn as Q,kr as Qa,qr as Qb,ji as Qc,H as R,Nr as Ra,ze as Rb,Ki as Rc,Zt as S,Sr as Sa,Ke as Sb,Ui as Sc,xe as T,Ne as Ta,li as Tb,Wi as Tc,Fs as U,Ht as Ua,Ue as Ub,po as Uc,ge as V,Ae as Va,Kn as Vb,Jn as Vc,Cs as W,Cr as Wa,hn as Wb,Ji as Wc,Os as X,lt as Xa,Je as Xb,xn as Xc,ar as Y,js as Ya,di as Yb,Lo as Yc,ye as Z,nn as Za,Mi as Zb,yo as Zc,$ as _,Se as _a,xi as _b,Qi as _c,Io as a,tn as aa,it as ab,gi as ac,na as ad,ko as b,pt as ba,Ks as bb,Jr as bc,Ms as bd,No as c,At as ca,en as cb,Vn as cc,xs as cd,So as d,G as da,Xr as db,yi as dc,gs as dd,Fo as e,Jt as ea,zs as eb,ts as ec,sa as ed,ie as f,Dn as fa,Yr as fb,Li as fc,ys as fd,Co as g,dt as ga,qs as gb,Ri as gc,ia as gd,Oo as h,cr as ha,Zs as hb,no as hc,ft as hd,Xo as i,Hs as ia,Br as ib,pn as ic,vo as id,wn as j,$s as ja,gt as jb,wi as jc,Qn as jd,fe as k,mr as ka,Mt as kb,_i as kc,fa as kd,vn as l,fr as la,Hn as lb,es as lc,Ls as ld,Yo as m,Le as ma,Hr as mb,uo as mc,Ct as md,To as n,br as na,ti as nb,vi as nc,ba as nd,Do as o,Ee as oa,Q as ob,Ai as oc,Eo as od,Bo as p,On as pa,j as pb,Pi as pc,pa as pd,Ho as q,Qt as qa,ct as qb,Ei as qc,da as qd,$o as r,Ie as ra,$r as rb,Ii as rc,_o as rd,Go as s,pr as sa,xt as sb,ss as sc,Vo as t,dr as ta,on as tb,is as tc,jo as u,Mr as ua,ni as ub,Ze as uc,Ko as v,Gs as va,ei as vb,ki as vc,Uo as w,Re as wa,jr as wb,jn as wc,le as x,we as xa,st as xb,Ni as xc,ce as y,Bt as ya,ii as yb,jt as yc,me as z,xr as za,$t as zb,zn as zc};//# sourceMappingURL=chunk-2GMD3Q3A.js.map
|
|
3
|
-
//# sourceMappingURL=chunk-2GMD3Q3A.js.map
|