2026-01-29 15:10:32 +01:00
( function ( ) { "use strict" ; function od ( h ) { return h && h . _ _esModule && Object . prototype . hasOwnProperty . call ( h , "default" ) ? h . default : h } var Oo = { exports : { } } , ld = Oo . exports , vu ; function cd ( ) { return vu || ( vu = 1 , ( function ( h , w ) { ( function ( E , L ) { h . exports = L ( ) } ) ( ld , ( function ( ) { var E , L , F ; function Q ( l , le ) { if ( ! E ) E = le ; else if ( ! L ) L = le ; else { var W = "var sharedChunk = {}; (" + E + ")(sharedChunk); (" + L + ")(sharedChunk);" , Se = { } ; E ( Se ) , F = le ( Se ) , typeof window < "u" && ( F . workerUrl = window . URL . createObjectURL ( new Blob ( [ W ] , { type : "text/javascript" } ) ) ) } } Q ( [ "exports" ] , ( function ( l ) { function le ( i , e , r , a ) { return new ( r || ( r = Promise ) ) ( ( function ( o , d ) { function f ( v ) { try { y ( a . next ( v ) ) } catch ( S ) { d ( S ) } } function m ( v ) { try { y ( a . throw ( v ) ) } catch ( S ) { d ( S ) } } function y ( v ) { var S ; v . done ? o ( v . value ) : ( S = v . value , S instanceof r ? S : new r ( ( function ( A ) { A ( S ) } ) ) ) . then ( f , m ) } y ( ( a = a . apply ( i , e || [ ] ) ) . next ( ) ) } ) ) } function W ( i ) { return i && i . _ _esModule && Object . prototype . hasOwnProperty . call ( i , "default" ) ? i . default : i } typeof SuppressedError == "function" && SuppressedError ; var Se = de ; function de ( i , e ) { this . x = i , this . y = e } de . prototype = { clone : function ( ) { return new de ( this . x , this . y ) } , add : function ( i ) { return this . clone ( ) . _add ( i ) } , sub : function ( i ) { return this . clone ( ) . _sub ( i ) } , multByPoint : function ( i ) { return this . clone ( ) . _multByPoint ( i ) } , divByPoint : function ( i ) { return this . clone ( ) . _divByPoint ( i ) } , mult : function ( i ) { return this . clone ( ) . _mult ( i ) } , div : function ( i ) { return this . clone ( ) . _div ( i ) } , rotate : function ( i ) { return this . clone ( ) . _rotate ( i ) } , rotateAround : function ( i , e ) { return this . clone ( ) . _rotateAround ( i , e ) } , matMult : function ( i ) { return this . clone ( ) . _matMult ( i ) } , unit : function ( ) { return this . clone ( ) . _unit ( ) } , perp : function ( ) { return this . clone ( ) . _perp ( ) } , round : function ( ) { return this . clone ( ) . _round ( ) } , mag : function ( ) { return Math . sqrt ( this . x * this . x + this . y * this . y ) } , equals : function ( i ) { return this . x === i . x && this . y === i . y } , dist : function ( i ) { return Math . sqrt ( this . distSqr ( i ) ) } , distSqr : function ( i ) { var e = i . x - this . x , r = i . y - this . y ; return e * e + r * r } , angle : function ( ) { return Math . atan2 ( this . y , this . x ) } , angleTo : function ( i ) { return Math . atan2 ( this . y - i . y , this . x - i . x ) } , angleWith : function ( i ) { return this . angleWithSep ( i . x , i . y ) } , angleWithSep : function ( i , e ) { return Math . atan2 ( this . x * e - this . y * i , this . x * i + this . y * e ) } , _matMult : function ( i ) { var e = i [ 2 ] * this . x + i [ 3 ] * this . y ; return this . x = i [ 0 ] * this . x + i [ 1 ] * this . y , this . y = e , this } , _add : function ( i ) { return this . x += i . x , this . y += i . y , this } , _sub : function ( i ) { return this . x -= i . x , this . y -= i . y , this } , _mult : function ( i ) { return this . x *= i , this . y *= i , this } , _div : function ( i ) { return this . x /= i , this . y /= i , this } , _multByPoint : function ( i ) { return this . x *= i . x , this . y *= i . y , this } , _divByPoint : function ( i ) { return this . x /= i . x , this . y /= i . y , this } , _unit : function ( ) { return this . _div ( this . mag ( ) ) , this } , _perp : function ( ) { var i = this . y ; return this . y = this . x , this . x = - i , this } , _rotate : function ( i ) { var e = Math . cos ( i ) , r = Math . sin ( i ) , a = r * this . x + e * this . y ; return this . x = e * this . x - r * this . y , this . y = a , this } , _rotateAround : function ( i , e ) { var r = Math . cos ( i ) , a = Math . sin ( i ) , o = e . y + a * ( this . x - e . x ) + r * ( this . y - e . y ) ; return this . x = e . x + r * ( this . x - e . x ) - a * ( this . y - e . y ) , this . y = o , this } , _round : function ( ) { return this . x = Math . round ( this . x ) , this . y = Math . round ( this . y ) , this } } , de . convert = function ( i ) { return i instanceof de ? i : Array . isArray ( i ) ? new de ( i [ 0 ] , i [ 1 ] ) : i } ; var ge = W ( Se ) , ve = $e ; function $e ( i , e , r , a ) { this . cx = 3 * i , this . bx = 3 * ( r - i ) - this . cx , this . ax = 1 - this . cx - this . bx , this . cy = 3 * e , this . by = 3 * ( a - e ) - this . cy , this . ay = 1 - this . cy - this . by , this . p1x = i , this . p1y = e , this . p2x = r , this . p2y = a } $e . prototype = { sampleCurveX : function ( i ) { return ( ( this . ax * i + this . bx ) * i + this . cx ) * i } , sampleCurveY : function ( i ) { return ( ( this . ay * i + this . by ) * i + this . cy ) * i } , sampleCurveDerivativeX : function ( i ) { return ( 3 * this . ax * i + 2 * this . bx ) * i + this . cx } , solveCurveX : function ( i , e ) { if ( e === void 0 && ( e = 1e-6 ) , i < 0 ) return 0 ; if ( i > 1 ) return 1 ; for ( var r = i , a = 0 ; a < 8 ; a ++ ) { var o = this . sampleCurveX ( r ) - i ; if ( Math . abs ( o ) < e ) return r ; var d = this . sampleCurveDerivativeX ( r ) ; if ( Math . abs ( d ) < 1e-6 ) break ; r -= o / d } var f = 0 , m = 1 ; for ( r = i , a = 0 ; a < 20 && ( o = this . sampleCurveX ( r ) , ! ( Math . abs ( o - i ) < e ) ) ; a ++ ) i > o ? f = r : m = r , r = . 5 * ( m - f ) + f ; return r } , solve : function ( i , e ) { return this . sampleCurveY ( this . solveCurveX ( i , e ) ) } } ; var Qe = W ( ve ) ; let Ke , Ye ; function st ( ) { return Ke == null && ( Ke = typeof
Use an identity property function instead : \ ` { "type": "identity", "property": ${ JSON . stringify ( A [ 1 ] ) } } \` . ` ) ] ; const C = [ ] ; return i . layerType === "symbol" && ( m === "text-field" && o && ! o . glyphs && C . push ( new Ae ( r , f , 'use of "text-field" requires a style "glyphs" property' ) ) , m === "text-font" && Bt ( wn ( f ) ) && jt ( f . type ) === "identity" && C . push ( new Ae ( r , f , '"text-font" does not support identity functions' ) ) ) , C . concat ( a ( { key : i . key , value : f , valueSpec : S , style : o , styleSpec : d , expressionContext : "property" , propertyType : e , propertyKey : m } ) ) } function dl ( i ) { return pl ( i , "paint" ) } function fl ( i ) { return pl ( i , "layout" ) } function ml ( i ) { let e = [ ] ; const r = i . value , a = i . key , o = i . style , d = i . styleSpec ; r . type || r . ref || e . push ( new Ae ( a , r , 'either "type" or "ref" is required' ) ) ; let f = jt ( r . type ) ; const m = jt ( r . ref ) ; if ( r . id ) { const y = jt ( r . id ) ; for ( let v = 0 ; v < i . arrayIndex ; v ++ ) { const S = o . layers [ v ] ; jt ( S . id ) === y && e . push ( new Ae ( a , r . id , ` duplicate layer id " ${ r . id } ", previously used at line ${ S . id . _ _line _ _ } ` ) ) } } if ( "ref" in r ) { let y ; [ "type" , "source" , "source-layer" , "filter" , "layout" ] . forEach ( ( v => { v in r && e . push ( new Ae ( a , r [ v ] , ` " ${ v } " is prohibited for ref layers ` ) ) } ) ) , o . layers . forEach ( ( v => { jt ( v . id ) === m && ( y = v ) } ) ) , y ? y . ref ? e . push ( new Ae ( a , r . ref , "ref cannot reference another ref layer" ) ) : f = jt ( y . type ) : e . push ( new Ae ( a , r . ref , ` ref layer " ${ m } " not found ` ) ) } else if ( f !== "background" ) if ( r . source ) { const y = o . sources && o . sources [ r . source ] , v = y && jt ( y . type ) ; y ? v === "vector" && f === "raster" ? e . push ( new Ae ( a , r . source , ` layer " ${ r . id } " requires a raster source ` ) ) : v !== "raster-dem" && f === "hillshade" ? e . push ( new Ae ( a , r . source , ` layer " ${ r . id } " requires a raster-dem source ` ) ) : v === "raster" && f !== "raster" ? e . push ( new Ae ( a , r . source , ` layer " ${ r . id } " requires a vector source ` ) ) : v !== "vector" || r [ "source-layer" ] ? v === "raster-dem" && f !== "hillshade" ? e . push ( new Ae ( a , r . source , "raster-dem source can only be used with layer type 'hillshade'." ) ) : f !== "line" || ! r . paint || ! r . paint [ "line-gradient" ] || v === "geojson" && y . lineMetrics || e . push ( new Ae ( a , r , ` layer " ${ r . id } " specifies a line-gradient, which requires a GeoJSON source with \` lineMetrics \` enabled. ` ) ) : e . push ( new Ae ( a , r , ` layer " ${ r . id } " must specify a "source-layer" ` ) ) : e . push ( new Ae ( a , r . source , ` source " ${ r . source } " not found ` ) ) } else e . push ( new Ae ( a , r , 'missing required property "source"' ) ) ; return e = e . concat ( Li ( { key : a , value : r , valueSpec : d . layer , style : i . style , styleSpec : i . styleSpec , validateSpec : i . validateSpec , objectElementValidators : { "*" : ( ) => [ ] , type : ( ) => i . validateSpec ( { key : ` ${ a } .type ` , value : r . type , valueSpec : d . layer . type , style : i . style , styleSpec : i . styleSpec , validateSpec : i . validateSpec , object : r , objectKey : "type" } ) , filter : Xn , layout : y => Li ( { layer : r , key : y . key , value : y . value , style : y . style , styleSpec : y . styleSpec , validateSpec : y . validateSpec , objectElementValidators : { "*" : v => fl ( wr ( { layerType : f } , v ) ) } } ) , paint : y => Li ( { layer : r , key : y . key , value : y . value , style : y . style , styleSpec : y . styleSpec , validateSpec : y . validateSpec , objectElementValidators : { "*" : v => dl ( wr ( { layerType : f } , v ) ) } } ) } } ) ) , e } function Tr ( i ) { const e = i . value , r = i . key , a = xt ( e ) ; return a !== "string" ? [ new Ae ( r , e , ` string expected, ${ a } found ` ) ] : [ ] } const ba = { promoteId : function ( { key : i , value : e } ) { if ( xt ( e ) === "string" ) return Tr ( { key : i , value : e } ) ; { const r = [ ] ; for ( const a in e ) r . push ( ... Tr ( { key : ` ${ i } . ${ a } ` , value : e [ a ] } ) ) ; return r } } } ; function Xi ( i ) { const e = i . value , r = i . key , a = i . styleSpec , o = i . style , d = i . validateSpec ; if ( ! e . type ) return [ new Ae ( r , e , '"type" is required' ) ] ; const f = jt ( e . type ) ; let m ; switch ( f ) { case "vector" : case "raster" : return m = Li ( { key : r , value : e , valueSpec : a [ ` source_ ${ f . replace ( "-" , "_" ) } ` ] , style : i . style , styleSpec : a , objectElementValidators : ba , validateSpec : d } ) , m ; case "raster-dem" : return m = ( function ( y ) { var v ; const S = ( v = y . sourceName ) !== null && v !== void 0 ? v : "" , A = y . value , C = y . styleSpec , z = C . source _raster _dem , D = y . style ; let O = [ ] ; const q = xt ( A ) ; if ( A === void 0 ) return O ; if ( q !== "object" ) return O . push ( new Ae ( "source_raster_dem" , A , ` object expected, ${ q } found ` ) ) , O ; const H = jt ( A . encoding ) === "custom" , re = [ "redFactor" , "greenFactor" , "blueFactor" , "baseShift" ] , Y = y . value . encoding ? ` " ${ y . value . encoding } " ` : "Default" ; for ( const ae in A ) ! H && re . includes ( ae ) ? O . push ( new Ae ( ae , A [ ae ] , ` In " ${ S } ": " ${ ae } " is only valid when "encoding" is se
2026-01-28 15:43:23 +01:00
precision mediump float ;
# else
# if ! defined ( lowp )
# define lowp
# endif
# if ! defined ( mediump )
# define mediump
# endif
# if ! defined ( highp )
# define highp
# endif
# endif
` , ` # ifdef GL _ES
precision highp float ;
# else
# if ! defined ( lowp )
# define lowp
# endif
# if ! defined ( mediump )
# define mediump
# endif
# if ! defined ( highp )
# define highp
# endif
# endif
vec2 unpack _float ( const float packedValue ) { int packedIntValue = int ( packedValue ) ; int v0 = packedIntValue / 256 ; return vec2 ( v0 , packedIntValue - v0 * 256 ) ; } vec2 unpack _opacity ( const float packedOpacity ) { int intOpacity = int ( packedOpacity ) / 2 ; return vec2 ( float ( intOpacity ) / 127.0 , mod ( packedOpacity , 2.0 ) ) ; } vec4 decode _color ( const vec2 encodedColor ) { return vec4 ( unpack _float ( encodedColor [ 0 ] ) / 255.0 , unpack _float ( encodedColor [ 1 ] ) / 255.0
) ; } float unpack _mix _vec2 ( const vec2 packedValue , const float t ) { return mix ( packedValue [ 0 ] , packedValue [ 1 ] , t ) ; } vec4 unpack _mix _color ( const vec4 packedColors , const float t ) { vec4 minColor = decode _color ( vec2 ( packedColors [ 0 ] , packedColors [ 1 ] ) ) ; vec4 maxColor = decode _color ( vec2 ( packedColors [ 2 ] , packedColors [ 3 ] ) ) ; return mix ( minColor , maxColor , t ) ; } vec2 get _pattern _pos ( const vec2 pixel _coord _upper , const vec2 pixel _coord _lower , const vec2 pattern _size , const float tile _units _to _pixels , const vec2 pos ) { vec2 offset = mod ( mod ( mod ( pixel _coord _upper , pattern _size ) * 256.0 , pattern _size ) * 256.0 + pixel _coord _lower , pattern _size ) ; return ( tile _units _to _pixels * pos + offset ) / pattern _size ; }
# ifdef TERRAIN3D
uniform sampler2D u _terrain ; uniform float u _terrain _dim ; uniform mat4 u _terrain _matrix ; uniform vec4 u _terrain _unpack ; uniform float u _terrain _exaggeration ; uniform highp sampler2D u _depth ;
# endif
const highp vec4 bitSh = vec4 ( 256. * 256. * 256. , 256. * 256. , 256. , 1. ) ; const highp vec4 bitShifts = vec4 ( 1. ) / bitSh ; highp float unpack ( highp vec4 color ) { return dot ( color , bitShifts ) ; } highp float depthOpacity ( vec3 frag ) {
# ifdef TERRAIN3D
highp float d = unpack ( texture2D ( u _depth , frag . xy * 0.5 + 0.5 ) ) + 0.0001 - frag . z ; return 1.0 - max ( 0.0 , min ( 1.0 , - d * 500.0 ) ) ;
# else
return 1.0 ;
# endif
} float calculate _visibility ( vec4 pos ) {
# ifdef TERRAIN3D
vec3 frag = pos . xyz / pos . w ; highp float d = depthOpacity ( frag ) ; if ( d > 0.95 ) return 1.0 ; return ( d + depthOpacity ( frag + vec3 ( 0.0 , 0.01 , 0.0 ) ) ) / 2.0 ;
# else
return 1.0 ;
# endif
} float ele ( vec2 pos ) {
# ifdef TERRAIN3D
vec4 rgb = ( texture2D ( u _terrain , pos ) * 255.0 ) * u _terrain _unpack ; return rgb . r + rgb . g + rgb . b - u _terrain _unpack . a ;
# else
return 0.0 ;
# endif
} float get _elevation ( vec2 pos ) {
# ifdef TERRAIN3D
vec2 coord = ( u _terrain _matrix * vec4 ( pos , 0.0 , 1.0 ) ) . xy * u _terrain _dim + 1.0 ; vec2 f = fract ( coord ) ; vec2 c = ( floor ( coord ) + 0.5 ) / ( u _terrain _dim + 2.0 ) ; float d = 1.0 / ( u _terrain _dim + 2.0 ) ; float tl = ele ( c ) ; float tr = ele ( c + vec2 ( d , 0.0 ) ) ; float bl = ele ( c + vec2 ( 0.0 , d ) ) ; float br = ele ( c + vec2 ( d , d ) ) ; float elevation = mix ( mix ( tl , tr , f . x ) , mix ( bl , br , f . x ) , f . y ) ; return elevation * u _terrain _exaggeration ;
# else
return 0.0 ;
# endif
2026-01-29 14:17:01 +01:00
} ` ),background:yt( ` uniform vec4 u _color ; uniform float u _opacity ; void main ( ) { gl _FragColor = u _color * u _opacity ;
2026-01-28 15:43:23 +01:00
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
2026-01-29 14:17:01 +01:00
} ` ,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:yt( ` uniform vec2 u _pattern _tl _a ; uniform vec2 u _pattern _br _a ; uniform vec2 u _pattern _tl _b ; uniform vec2 u _pattern _br _b ; uniform vec2 u _texsize ; uniform float u _mix ; uniform float u _opacity ; uniform sampler2D u _image ; varying vec2 v _pos _a ; varying vec2 v _pos _b ; void main ( ) { vec2 imagecoord = mod ( v _pos _a , 1.0 ) ; vec2 pos = mix ( u _pattern _tl _a / u _texsize , u _pattern _br _a / u _texsize , imagecoord ) ; vec4 color1 = texture2D ( u _image , pos ) ; vec2 imagecoord _b = mod ( v _pos _b , 1.0 ) ; vec2 pos2 = mix ( u _pattern _tl _b / u _texsize , u _pattern _br _b / u _texsize , imagecoord _b ) ; vec4 color2 = texture2D ( u _image , pos2 ) ; gl _FragColor = mix ( color1 , color2 , u _mix ) * u _opacity ;
2026-01-28 15:43:23 +01:00
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
2026-01-29 14:17:01 +01:00
} ` ,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:yt( ` varying vec3 v _data ; varying float v _visibility ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define highp vec4 color
# pragma mapbox : define mediump float radius
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
# pragma mapbox : define highp vec4 stroke _color
# pragma mapbox : define mediump float stroke _width
# pragma mapbox : define lowp float stroke _opacity
void main ( ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize mediump float radius
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize highp vec4 stroke _color
# pragma mapbox : initialize mediump float stroke _width
# pragma mapbox : initialize lowp float stroke _opacity
vec2 extrude = v _data . xy ; float extrude _length = length ( extrude ) ; lowp float antialiasblur = v _data . z ; float antialiased _blur = - max ( blur , antialiasblur ) ; float opacity _t = smoothstep ( 0.0 , antialiased _blur , extrude _length - 1.0 ) ; float color _t = stroke _width < 0.01 ? 0.0 : smoothstep ( antialiased _blur , 0.0 , extrude _length - radius / ( radius + stroke _width ) ) ; gl _FragColor = v _visibility * opacity _t * mix ( color * opacity , stroke _color * stroke _opacity , color _t ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` uniform mat4 u _matrix ; uniform bool u _scale _with _map ; uniform bool u _pitch _with _map ; uniform vec2 u _extrude _scale ; uniform lowp float u _device _pixel _ratio ; uniform highp float u _camera _to _center _distance ; attribute vec2 a _pos ; varying vec3 v _data ; varying float v _visibility ;
# pragma mapbox : define highp vec4 color
# pragma mapbox : define mediump float radius
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
# pragma mapbox : define highp vec4 stroke _color
# pragma mapbox : define mediump float stroke _width
# pragma mapbox : define lowp float stroke _opacity
void main ( void ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize mediump float radius
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize highp vec4 stroke _color
# pragma mapbox : initialize mediump float stroke _width
# pragma mapbox : initialize lowp float stroke _opacity
2026-01-29 14:17:01 +01:00
vec2 extrude = vec2 ( mod ( a _pos , 2.0 ) * 2.0 - 1.0 ) ; vec2 circle _center = floor ( a _pos * 0.5 ) ; float ele = get _elevation ( circle _center ) ; v _visibility = calculate _visibility ( u _matrix * vec4 ( circle _center , ele , 1.0 ) ) ; if ( u _pitch _with _map ) { vec2 corner _position = circle _center ; if ( u _scale _with _map ) { corner _position += extrude * ( radius + stroke _width ) * u _extrude _scale ; } else { vec4 projected _center = u _matrix * vec4 ( circle _center , 0 , 1 ) ; corner _position += extrude * ( radius + stroke _width ) * u _extrude _scale * ( projected _center . w / u _camera _to _center _distance ) ; } gl _Position = u _matrix * vec4 ( corner _position , ele , 1 ) ; } else { gl _Position = u _matrix * vec4 ( circle _center , ele , 1 ) ; if ( u _scale _with _map ) { gl _Position . xy += extrude * ( radius + stroke _width ) * u _extrude _scale * u _camera _to _center _distance ; } else { gl _Position . xy += extrude * ( radius + stroke _width ) * u _extrude _scale * gl _Position . w ; } } lowp float antialiasblur = 1.0 / u _device _pixel _ratio / ( radius + stroke _width ) ; v _data = vec3 ( extrude . x , extrude . y , antialiasblur ) ; } ` ),clippingMask:yt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:yt( ` uniform highp float u _intensity ; varying vec2 v _extrude ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define highp float weight
# define GAUSS _COEF 0.3989422804014327
void main ( ) {
# pragma mapbox : initialize highp float weight
float d = - 0.5 * 3.0 * 3.0 * dot ( v _extrude , v _extrude ) ; float val = weight * u _intensity * GAUSS _COEF * exp ( d ) ; gl _FragColor = vec4 ( val , 1.0 , 1.0 , 1.0 ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` uniform mat4 u _matrix ; uniform float u _extrude _scale ; uniform float u _opacity ; uniform float u _intensity ; attribute vec2 a _pos ; varying vec2 v _extrude ;
# pragma mapbox : define highp float weight
# pragma mapbox : define mediump float radius
const highp float ZERO = 1.0 / 255.0 / 16.0 ;
# define GAUSS _COEF 0.3989422804014327
void main ( void ) {
# pragma mapbox : initialize highp float weight
# pragma mapbox : initialize mediump float radius
2026-01-29 14:17:01 +01:00
vec2 unscaled _extrude = vec2 ( mod ( a _pos , 2.0 ) * 2.0 - 1.0 ) ; float S = sqrt ( - 2.0 * log ( ZERO / weight / u _intensity / GAUSS _COEF ) ) / 3.0 ; v _extrude = S * unscaled _extrude ; vec2 extrude = v _extrude * radius * u _extrude _scale ; vec4 pos = vec4 ( floor ( a _pos * 0.5 ) + extrude , 0 , 1 ) ; gl _Position = u _matrix * pos ; } ` ),heatmapTexture:yt( ` uniform sampler2D u _image ; uniform sampler2D u _color _ramp ; uniform float u _opacity ; varying vec2 v _pos ; void main ( ) { float t = texture2D ( u _image , v _pos ) . r ; vec4 color = texture2D ( u _color _ramp , vec2 ( t , 0.5 ) ) ; gl _FragColor = color * u _opacity ;
2026-01-28 15:43:23 +01:00
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 0.0 ) ;
# endif
2026-01-29 14:17:01 +01:00
} ` ,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:yt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:yt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:yt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:yt( ` # pragma mapbox : define highp vec4 color
2026-01-28 15:43:23 +01:00
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize lowp float opacity
gl _FragColor = color * opacity ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` attribute vec2 a _pos ; uniform mat4 u _matrix ;
# pragma mapbox : define highp vec4 color
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize lowp float opacity
2026-01-29 14:17:01 +01:00
gl _Position = u _matrix * vec4 ( a _pos , 0 , 1 ) ; } ` ),fillOutline:yt( ` varying vec2 v _pos ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define highp vec4 outline _color
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize highp vec4 outline _color
# pragma mapbox : initialize lowp float opacity
float dist = length ( v _pos - gl _FragCoord . xy ) ; float alpha = 1.0 - smoothstep ( 0.0 , 1.0 , dist ) ; gl _FragColor = outline _color * ( alpha * opacity ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` attribute vec2 a _pos ; uniform mat4 u _matrix ; uniform vec2 u _world ; varying vec2 v _pos ;
# pragma mapbox : define highp vec4 outline _color
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize highp vec4 outline _color
# pragma mapbox : initialize lowp float opacity
2026-01-29 14:17:01 +01:00
gl _Position = u _matrix * vec4 ( a _pos , 0 , 1 ) ; v _pos = ( gl _Position . xy / gl _Position . w + 1.0 ) / 2.0 * u _world ; } ` ),fillOutlinePattern:yt( ` uniform vec2 u _texsize ; uniform sampler2D u _image ; uniform float u _fade ; varying vec2 v _pos _a ; varying vec2 v _pos _b ; varying vec2 v _pos ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
void main ( ) {
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
vec2 pattern _tl _a = pattern _from . xy ; vec2 pattern _br _a = pattern _from . zw ; vec2 pattern _tl _b = pattern _to . xy ; vec2 pattern _br _b = pattern _to . zw ; vec2 imagecoord = mod ( v _pos _a , 1.0 ) ; vec2 pos = mix ( pattern _tl _a / u _texsize , pattern _br _a / u _texsize , imagecoord ) ; vec4 color1 = texture2D ( u _image , pos ) ; vec2 imagecoord _b = mod ( v _pos _b , 1.0 ) ; vec2 pos2 = mix ( pattern _tl _b / u _texsize , pattern _br _b / u _texsize , imagecoord _b ) ; vec4 color2 = texture2D ( u _image , pos2 ) ; float dist = length ( v _pos - gl _FragCoord . xy ) ; float alpha = 1.0 - smoothstep ( 0.0 , 1.0 , dist ) ; gl _FragColor = mix ( color1 , color2 , u _fade ) * alpha * opacity ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` uniform mat4 u _matrix ; uniform vec2 u _world ; uniform vec2 u _pixel _coord _upper ; uniform vec2 u _pixel _coord _lower ; uniform vec3 u _scale ; attribute vec2 a _pos ; varying vec2 v _pos _a ; varying vec2 v _pos _b ; varying vec2 v _pos ;
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
# pragma mapbox : define lowp float pixel _ratio _from
# pragma mapbox : define lowp float pixel _ratio _to
void main ( ) {
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
# pragma mapbox : initialize lowp float pixel _ratio _from
# pragma mapbox : initialize lowp float pixel _ratio _to
2026-01-29 14:17:01 +01:00
vec2 pattern _tl _a = pattern _from . xy ; vec2 pattern _br _a = pattern _from . zw ; vec2 pattern _tl _b = pattern _to . xy ; vec2 pattern _br _b = pattern _to . zw ; float tileRatio = u _scale . x ; float fromScale = u _scale . y ; float toScale = u _scale . z ; gl _Position = u _matrix * vec4 ( a _pos , 0 , 1 ) ; vec2 display _size _a = ( pattern _br _a - pattern _tl _a ) / pixel _ratio _from ; vec2 display _size _b = ( pattern _br _b - pattern _tl _b ) / pixel _ratio _to ; v _pos _a = get _pattern _pos ( u _pixel _coord _upper , u _pixel _coord _lower , fromScale * display _size _a , tileRatio , a _pos ) ; v _pos _b = get _pattern _pos ( u _pixel _coord _upper , u _pixel _coord _lower , toScale * display _size _b , tileRatio , a _pos ) ; v _pos = ( gl _Position . xy / gl _Position . w + 1.0 ) / 2.0 * u _world ; } ` ),fillPattern:yt( ` # ifdef GL _ES
2026-01-28 15:43:23 +01:00
precision highp float ;
# endif
uniform vec2 u _texsize ; uniform float u _fade ; uniform sampler2D u _image ; varying vec2 v _pos _a ; varying vec2 v _pos _b ;
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
void main ( ) {
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
vec2 pattern _tl _a = pattern _from . xy ; vec2 pattern _br _a = pattern _from . zw ; vec2 pattern _tl _b = pattern _to . xy ; vec2 pattern _br _b = pattern _to . zw ; vec2 imagecoord = mod ( v _pos _a , 1.0 ) ; vec2 pos = mix ( pattern _tl _a / u _texsize , pattern _br _a / u _texsize , imagecoord ) ; vec4 color1 = texture2D ( u _image , pos ) ; vec2 imagecoord _b = mod ( v _pos _b , 1.0 ) ; vec2 pos2 = mix ( pattern _tl _b / u _texsize , pattern _br _b / u _texsize , imagecoord _b ) ; vec4 color2 = texture2D ( u _image , pos2 ) ; gl _FragColor = mix ( color1 , color2 , u _fade ) * opacity ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` uniform mat4 u _matrix ; uniform vec2 u _pixel _coord _upper ; uniform vec2 u _pixel _coord _lower ; uniform vec3 u _scale ; attribute vec2 a _pos ; varying vec2 v _pos _a ; varying vec2 v _pos _b ;
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
# pragma mapbox : define lowp float pixel _ratio _from
# pragma mapbox : define lowp float pixel _ratio _to
void main ( ) {
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
# pragma mapbox : initialize lowp float pixel _ratio _from
# pragma mapbox : initialize lowp float pixel _ratio _to
2026-01-29 14:17:01 +01:00
vec2 pattern _tl _a = pattern _from . xy ; vec2 pattern _br _a = pattern _from . zw ; vec2 pattern _tl _b = pattern _to . xy ; vec2 pattern _br _b = pattern _to . zw ; float tileZoomRatio = u _scale . x ; float fromScale = u _scale . y ; float toScale = u _scale . z ; vec2 display _size _a = ( pattern _br _a - pattern _tl _a ) / pixel _ratio _from ; vec2 display _size _b = ( pattern _br _b - pattern _tl _b ) / pixel _ratio _to ; gl _Position = u _matrix * vec4 ( a _pos , 0 , 1 ) ; v _pos _a = get _pattern _pos ( u _pixel _coord _upper , u _pixel _coord _lower , fromScale * display _size _a , tileZoomRatio , a _pos ) ; v _pos _b = get _pattern _pos ( u _pixel _coord _upper , u _pixel _coord _lower , toScale * display _size _b , tileZoomRatio , a _pos ) ; } ` ),fillExtrusion:yt( ` varying vec4 v _color ; void main ( ) { gl _FragColor = v _color ;
2026-01-28 15:43:23 +01:00
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` uniform mat4 u _matrix ; uniform vec3 u _lightcolor ; uniform lowp vec3 u _lightpos ; uniform lowp float u _lightintensity ; uniform float u _vertical _gradient ; uniform lowp float u _opacity ; attribute vec2 a _pos ; attribute vec4 a _normal _ed ;
# ifdef TERRAIN3D
attribute vec2 a _centroid ;
# endif
varying vec4 v _color ;
# pragma mapbox : define highp float base
# pragma mapbox : define highp float height
# pragma mapbox : define highp vec4 color
void main ( ) {
# pragma mapbox : initialize highp float base
# pragma mapbox : initialize highp float height
# pragma mapbox : initialize highp vec4 color
vec3 normal = a _normal _ed . xyz ;
# ifdef TERRAIN3D
float height _terrain3d _offset = get _elevation ( a _centroid ) ; float base _terrain3d _offset = height _terrain3d _offset - ( base > 0.0 ? 0.0 : 10.0 ) ;
# else
float height _terrain3d _offset = 0.0 ; float base _terrain3d _offset = 0.0 ;
# endif
2026-01-29 14:17:01 +01:00
base = max ( 0.0 , base ) + base _terrain3d _offset ; height = max ( 0.0 , height ) + height _terrain3d _offset ; float t = mod ( normal . x , 2.0 ) ; gl _Position = u _matrix * vec4 ( a _pos , t > 0.0 ? height : base , 1 ) ; float colorvalue = color . r * 0.2126 + color . g * 0.7152 + color . b * 0.0722 ; v _color = vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ; vec4 ambientlight = vec4 ( 0.03 , 0.03 , 0.03 , 1.0 ) ; color += ambientlight ; float directional = clamp ( dot ( normal / 16384.0 , u _lightpos ) , 0.0 , 1.0 ) ; directional = mix ( ( 1.0 - u _lightintensity ) , max ( ( 1.0 - colorvalue + u _lightintensity ) , 1.0 ) , directional ) ; if ( normal . y != 0.0 ) { directional *= ( ( 1.0 - u _vertical _gradient ) + ( u _vertical _gradient * clamp ( ( t + base ) * pow ( height / 150.0 , 0.5 ) , mix ( 0.7 , 0.98 , 1.0 - u _lightintensity ) , 1.0 ) ) ) ; } v _color . r += clamp ( color . r * directional * u _lightcolor . r , mix ( 0.0 , 0.3 , 1.0 - u _lightcolor . r ) , 1.0 ) ; v _color . g += clamp ( color . g * directional * u _lightcolor . g , mix ( 0.0 , 0.3 , 1.0 - u _lightcolor . g ) , 1.0 ) ; v _color . b += clamp ( color . b * directional * u _lightcolor . b , mix ( 0.0 , 0.3 , 1.0 - u _lightcolor . b ) , 1.0 ) ; v _color *= u _opacity ; } ` ),fillExtrusionPattern:yt( ` uniform vec2 u _texsize ; uniform float u _fade ; uniform sampler2D u _image ; varying vec2 v _pos _a ; varying vec2 v _pos _b ; varying vec4 v _lighting ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define lowp float base
# pragma mapbox : define lowp float height
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
# pragma mapbox : define lowp float pixel _ratio _from
# pragma mapbox : define lowp float pixel _ratio _to
void main ( ) {
# pragma mapbox : initialize lowp float base
# pragma mapbox : initialize lowp float height
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
# pragma mapbox : initialize lowp float pixel _ratio _from
# pragma mapbox : initialize lowp float pixel _ratio _to
vec2 pattern _tl _a = pattern _from . xy ; vec2 pattern _br _a = pattern _from . zw ; vec2 pattern _tl _b = pattern _to . xy ; vec2 pattern _br _b = pattern _to . zw ; vec2 imagecoord = mod ( v _pos _a , 1.0 ) ; vec2 pos = mix ( pattern _tl _a / u _texsize , pattern _br _a / u _texsize , imagecoord ) ; vec4 color1 = texture2D ( u _image , pos ) ; vec2 imagecoord _b = mod ( v _pos _b , 1.0 ) ; vec2 pos2 = mix ( pattern _tl _b / u _texsize , pattern _br _b / u _texsize , imagecoord _b ) ; vec4 color2 = texture2D ( u _image , pos2 ) ; vec4 mixedColor = mix ( color1 , color2 , u _fade ) ; gl _FragColor = mixedColor * v _lighting ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` uniform mat4 u _matrix ; uniform vec2 u _pixel _coord _upper ; uniform vec2 u _pixel _coord _lower ; uniform float u _height _factor ; uniform vec3 u _scale ; uniform float u _vertical _gradient ; uniform lowp float u _opacity ; uniform vec3 u _lightcolor ; uniform lowp vec3 u _lightpos ; uniform lowp float u _lightintensity ; attribute vec2 a _pos ; attribute vec4 a _normal _ed ;
# ifdef TERRAIN3D
attribute vec2 a _centroid ;
# endif
varying vec2 v _pos _a ; varying vec2 v _pos _b ; varying vec4 v _lighting ;
# pragma mapbox : define lowp float base
# pragma mapbox : define lowp float height
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
# pragma mapbox : define lowp float pixel _ratio _from
# pragma mapbox : define lowp float pixel _ratio _to
void main ( ) {
# pragma mapbox : initialize lowp float base
# pragma mapbox : initialize lowp float height
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
# pragma mapbox : initialize lowp float pixel _ratio _from
# pragma mapbox : initialize lowp float pixel _ratio _to
vec2 pattern _tl _a = pattern _from . xy ; vec2 pattern _br _a = pattern _from . zw ; vec2 pattern _tl _b = pattern _to . xy ; vec2 pattern _br _b = pattern _to . zw ; float tileRatio = u _scale . x ; float fromScale = u _scale . y ; float toScale = u _scale . z ; vec3 normal = a _normal _ed . xyz ; float edgedistance = a _normal _ed . w ; vec2 display _size _a = ( pattern _br _a - pattern _tl _a ) / pixel _ratio _from ; vec2 display _size _b = ( pattern _br _b - pattern _tl _b ) / pixel _ratio _to ;
# ifdef TERRAIN3D
float height _terrain3d _offset = get _elevation ( a _centroid ) ; float base _terrain3d _offset = height _terrain3d _offset - ( base > 0.0 ? 0.0 : 10.0 ) ;
# else
float height _terrain3d _offset = 0.0 ; float base _terrain3d _offset = 0.0 ;
# endif
base = max ( 0.0 , base ) + base _terrain3d _offset ; height = max ( 0.0 , height ) + height _terrain3d _offset ; float t = mod ( normal . x , 2.0 ) ; float z = t > 0.0 ? height : base ; gl _Position = u _matrix * vec4 ( a _pos , z , 1 ) ; vec2 pos = normal . x == 1.0 && normal . y == 0.0 && normal . z == 16384.0
? a _pos
2026-01-29 14:17:01 +01:00
: vec2 ( edgedistance , z * u _height _factor ) ; v _pos _a = get _pattern _pos ( u _pixel _coord _upper , u _pixel _coord _lower , fromScale * display _size _a , tileRatio , pos ) ; v _pos _b = get _pattern _pos ( u _pixel _coord _upper , u _pixel _coord _lower , toScale * display _size _b , tileRatio , pos ) ; v _lighting = vec4 ( 0.0 , 0.0 , 0.0 , 1.0 ) ; float directional = clamp ( dot ( normal / 16383.0 , u _lightpos ) , 0.0 , 1.0 ) ; directional = mix ( ( 1.0 - u _lightintensity ) , max ( ( 0.5 + u _lightintensity ) , 1.0 ) , directional ) ; if ( normal . y != 0.0 ) { directional *= ( ( 1.0 - u _vertical _gradient ) + ( u _vertical _gradient * clamp ( ( t + base ) * pow ( height / 150.0 , 0.5 ) , mix ( 0.7 , 0.98 , 1.0 - u _lightintensity ) , 1.0 ) ) ) ; } v _lighting . rgb += clamp ( directional * u _lightcolor , mix ( vec3 ( 0.0 ) , vec3 ( 0.3 ) , 1.0 - u _lightcolor ) , vec3 ( 1.0 ) ) ; v _lighting *= u _opacity ; } ` ),hillshadePrepare:yt( ` # ifdef GL _ES
2026-01-28 15:43:23 +01:00
precision highp float ;
# endif
uniform sampler2D u _image ; varying vec2 v _pos ; uniform vec2 u _dimension ; uniform float u _zoom ; uniform vec4 u _unpack ; float getElevation ( vec2 coord , float bias ) { vec4 data = texture2D ( u _image , coord ) * 255.0 ; data . a = - 1.0 ; return dot ( data , u _unpack ) / 4.0 ; } void main ( ) { vec2 epsilon = 1.0 / u _dimension ; float a = getElevation ( v _pos + vec2 ( - epsilon . x , - epsilon . y ) , 0.0 ) ; float b = getElevation ( v _pos + vec2 ( 0 , - epsilon . y ) , 0.0 ) ; float c = getElevation ( v _pos + vec2 ( epsilon . x , - epsilon . y ) , 0.0 ) ; float d = getElevation ( v _pos + vec2 ( - epsilon . x , 0 ) , 0.0 ) ; float e = getElevation ( v _pos , 0.0 ) ; float f = getElevation ( v _pos + vec2 ( epsilon . x , 0 ) , 0.0 ) ; float g = getElevation ( v _pos + vec2 ( - epsilon . x , epsilon . y ) , 0.0 ) ; float h = getElevation ( v _pos + vec2 ( 0 , epsilon . y ) , 0.0 ) ; float i = getElevation ( v _pos + vec2 ( epsilon . x , epsilon . y ) , 0.0 ) ; float exaggerationFactor = u _zoom < 2.0 ? 0.4 : u _zoom < 4.5 ? 0.35 : 0.3 ; float exaggeration = u _zoom < 15.0 ? ( u _zoom - 15.0 ) * exaggerationFactor : 0.0 ; vec2 deriv = vec2 ( ( c + f + f + i ) - ( a + d + d + g ) , ( g + h + h + i ) - ( a + b + b + c ) ) / pow ( 2.0 , exaggeration + ( 19.2562 - u _zoom ) ) ; gl _FragColor = clamp ( vec4 ( deriv . x / 2.0 + 0.5 , deriv . y / 2.0 + 0.5 , 1.0 , 1.0 ) , 0.0 , 1.0 ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
2026-01-29 14:17:01 +01:00
} ` ,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:yt( ` uniform sampler2D u _image ; varying vec2 v _pos ; uniform vec2 u _latrange ; uniform vec2 u _light ; uniform vec4 u _shadow ; uniform vec4 u _highlight ; uniform vec4 u _accent ;
2026-01-28 15:43:23 +01:00
# define PI 3.141592653589793
void main ( ) { vec4 pixel = texture2D ( u _image , v _pos ) ; vec2 deriv = ( ( pixel . rg * 2.0 ) - 1.0 ) ; float scaleFactor = cos ( radians ( ( u _latrange [ 0 ] - u _latrange [ 1 ] ) * ( 1.0 - v _pos . y ) + u _latrange [ 1 ] ) ) ; float slope = atan ( 1.25 * length ( deriv ) / scaleFactor ) ; float aspect = deriv . x != 0.0 ? atan ( deriv . y , - deriv . x ) : PI / 2.0 * ( deriv . y > 0.0 ? 1.0 : - 1.0 ) ; float intensity = u _light . x ; float azimuth = u _light . y + PI ; float base = 1.875 - intensity * 1.75 ; float maxValue = 0.5 * PI ; float scaledSlope = intensity != 0.5 ? ( ( pow ( base , slope ) - 1.0 ) / ( pow ( base , maxValue ) - 1.0 ) ) * maxValue : slope ; float accent = cos ( scaledSlope ) ; vec4 accent _color = ( 1.0 - accent ) * u _accent * clamp ( intensity * 2.0 , 0.0 , 1.0 ) ; float shade = abs ( mod ( ( aspect + azimuth ) / PI + 0.5 , 2.0 ) - 1.0 ) ; vec4 shade _color = mix ( u _shadow , u _highlight , shade ) * sin ( scaledSlope ) * clamp ( intensity * 2.0 , 0.0 , 1.0 ) ; gl _FragColor = accent _color * ( 1.0 - shade _color . a ) + shade _color ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
2026-01-29 14:17:01 +01:00
} ` ,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:yt( ` uniform lowp float u _device _pixel _ratio ; varying vec2 v _width2 ; varying vec2 v _normal ; varying float v _gamma _scale ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define highp vec4 color
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
float dist = length ( v _normal ) * v _width2 . s ; float blur2 = ( blur + 1.0 / u _device _pixel _ratio ) * v _gamma _scale ; float alpha = clamp ( min ( dist - ( v _width2 . t - blur2 ) , v _width2 . s - dist ) / blur2 , 0.0 , 1.0 ) ; gl _FragColor = color * ( alpha * opacity ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , `
# define scale 0.015873016
attribute vec2 a _pos _normal ; attribute vec4 a _data ; uniform mat4 u _matrix ; uniform mediump float u _ratio ; uniform vec2 u _units _to _pixels ; uniform lowp float u _device _pixel _ratio ; varying vec2 v _normal ; varying vec2 v _width2 ; varying float v _gamma _scale ; varying highp float v _linesofar ;
# pragma mapbox : define highp vec4 color
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
# pragma mapbox : define mediump float gapwidth
# pragma mapbox : define lowp float offset
# pragma mapbox : define mediump float width
void main ( ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump float gapwidth
# pragma mapbox : initialize lowp float offset
# pragma mapbox : initialize mediump float width
float ANTIALIASING = 1.0 / u _device _pixel _ratio / 2.0 ; vec2 a _extrude = a _data . xy - 128.0 ; float a _direction = mod ( a _data . z , 4.0 ) - 1.0 ; v _linesofar = ( floor ( a _data . z / 4.0 ) + a _data . w * 64.0 ) * 2.0 ; vec2 pos = floor ( a _pos _normal * 0.5 ) ; mediump vec2 normal = a _pos _normal - 2.0 * pos ; normal . y = normal . y * 2.0 - 1.0 ; v _normal = normal ; gapwidth = gapwidth / 2.0 ; float halfwidth = width / 2.0 ; offset = - 1.0 * offset ; float inset = gapwidth + ( gapwidth > 0.0 ? ANTIALIASING : 0.0 ) ; float outset = gapwidth + halfwidth * ( gapwidth > 0.0 ? 2.0 : 1.0 ) + ( halfwidth == 0.0 ? 0.0 : ANTIALIASING ) ; mediump vec2 dist = outset * a _extrude * scale ; mediump float u = 0.5 * a _direction ; mediump float t = 1.0 - abs ( u ) ; mediump vec2 offset2 = offset * a _extrude * scale * normal . y * mat2 ( t , - u , u , t ) ; vec4 projected _extrude = u _matrix * vec4 ( dist / u _ratio , 0.0 , 0.0 ) ; gl _Position = u _matrix * vec4 ( pos + offset2 / u _ratio , 0.0 , 1.0 ) + projected _extrude ;
# ifdef TERRAIN3D
v _gamma _scale = 1.0 ;
# else
float extrude _length _without _perspective = length ( dist ) ; float extrude _length _with _perspective = length ( projected _extrude . xy / gl _Position . w * u _units _to _pixels ) ; v _gamma _scale = extrude _length _without _perspective / extrude _length _with _perspective ;
# endif
2026-01-29 14:17:01 +01:00
v _width2 = vec2 ( outset , inset ) ; } ` ),lineGradient:yt( ` uniform lowp float u _device _pixel _ratio ; uniform sampler2D u _image ; varying vec2 v _width2 ; varying vec2 v _normal ; varying float v _gamma _scale ; varying highp vec2 v _uv ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
float dist = length ( v _normal ) * v _width2 . s ; float blur2 = ( blur + 1.0 / u _device _pixel _ratio ) * v _gamma _scale ; float alpha = clamp ( min ( dist - ( v _width2 . t - blur2 ) , v _width2 . s - dist ) / blur2 , 0.0 , 1.0 ) ; vec4 color = texture2D ( u _image , v _uv ) ; gl _FragColor = color * ( alpha * opacity ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , `
# define scale 0.015873016
attribute vec2 a _pos _normal ; attribute vec4 a _data ; attribute float a _uv _x ; attribute float a _split _index ; uniform mat4 u _matrix ; uniform mediump float u _ratio ; uniform lowp float u _device _pixel _ratio ; uniform vec2 u _units _to _pixels ; uniform float u _image _height ; varying vec2 v _normal ; varying vec2 v _width2 ; varying float v _gamma _scale ; varying highp vec2 v _uv ;
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
# pragma mapbox : define mediump float gapwidth
# pragma mapbox : define lowp float offset
# pragma mapbox : define mediump float width
void main ( ) {
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump float gapwidth
# pragma mapbox : initialize lowp float offset
# pragma mapbox : initialize mediump float width
float ANTIALIASING = 1.0 / u _device _pixel _ratio / 2.0 ; vec2 a _extrude = a _data . xy - 128.0 ; float a _direction = mod ( a _data . z , 4.0 ) - 1.0 ; highp float texel _height = 1.0 / u _image _height ; highp float half _texel _height = 0.5 * texel _height ; v _uv = vec2 ( a _uv _x , a _split _index * texel _height - half _texel _height ) ; vec2 pos = floor ( a _pos _normal * 0.5 ) ; mediump vec2 normal = a _pos _normal - 2.0 * pos ; normal . y = normal . y * 2.0 - 1.0 ; v _normal = normal ; gapwidth = gapwidth / 2.0 ; float halfwidth = width / 2.0 ; offset = - 1.0 * offset ; float inset = gapwidth + ( gapwidth > 0.0 ? ANTIALIASING : 0.0 ) ; float outset = gapwidth + halfwidth * ( gapwidth > 0.0 ? 2.0 : 1.0 ) + ( halfwidth == 0.0 ? 0.0 : ANTIALIASING ) ; mediump vec2 dist = outset * a _extrude * scale ; mediump float u = 0.5 * a _direction ; mediump float t = 1.0 - abs ( u ) ; mediump vec2 offset2 = offset * a _extrude * scale * normal . y * mat2 ( t , - u , u , t ) ; vec4 projected _extrude = u _matrix * vec4 ( dist / u _ratio , 0.0 , 0.0 ) ; gl _Position = u _matrix * vec4 ( pos + offset2 / u _ratio , 0.0 , 1.0 ) + projected _extrude ;
# ifdef TERRAIN3D
v _gamma _scale = 1.0 ;
# else
float extrude _length _without _perspective = length ( dist ) ; float extrude _length _with _perspective = length ( projected _extrude . xy / gl _Position . w * u _units _to _pixels ) ; v _gamma _scale = extrude _length _without _perspective / extrude _length _with _perspective ;
# endif
2026-01-29 14:17:01 +01:00
v _width2 = vec2 ( outset , inset ) ; } ` ),linePattern:yt( ` # ifdef GL _ES
2026-01-28 15:43:23 +01:00
precision highp float ;
# endif
uniform lowp float u _device _pixel _ratio ; uniform vec2 u _texsize ; uniform float u _fade ; uniform mediump vec3 u _scale ; uniform sampler2D u _image ; varying vec2 v _normal ; varying vec2 v _width2 ; varying float v _linesofar ; varying float v _gamma _scale ; varying float v _width ;
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
# pragma mapbox : define lowp float pixel _ratio _from
# pragma mapbox : define lowp float pixel _ratio _to
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
# pragma mapbox : initialize lowp float pixel _ratio _from
# pragma mapbox : initialize lowp float pixel _ratio _to
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
vec2 pattern _tl _a = pattern _from . xy ; vec2 pattern _br _a = pattern _from . zw ; vec2 pattern _tl _b = pattern _to . xy ; vec2 pattern _br _b = pattern _to . zw ; float tileZoomRatio = u _scale . x ; float fromScale = u _scale . y ; float toScale = u _scale . z ; vec2 display _size _a = ( pattern _br _a - pattern _tl _a ) / pixel _ratio _from ; vec2 display _size _b = ( pattern _br _b - pattern _tl _b ) / pixel _ratio _to ; vec2 pattern _size _a = vec2 ( display _size _a . x * fromScale / tileZoomRatio , display _size _a . y ) ; vec2 pattern _size _b = vec2 ( display _size _b . x * toScale / tileZoomRatio , display _size _b . y ) ; float aspect _a = display _size _a . y / v _width ; float aspect _b = display _size _b . y / v _width ; float dist = length ( v _normal ) * v _width2 . s ; float blur2 = ( blur + 1.0 / u _device _pixel _ratio ) * v _gamma _scale ; float alpha = clamp ( min ( dist - ( v _width2 . t - blur2 ) , v _width2 . s - dist ) / blur2 , 0.0 , 1.0 ) ; float x _a = mod ( v _linesofar / pattern _size _a . x * aspect _a , 1.0 ) ; float x _b = mod ( v _linesofar / pattern _size _b . x * aspect _b , 1.0 ) ; float y = 0.5 * v _normal . y + 0.5 ; vec2 texel _size = 1.0 / u _texsize ; vec2 pos _a = mix ( pattern _tl _a * texel _size - texel _size , pattern _br _a * texel _size + texel _size , vec2 ( x _a , y ) ) ; vec2 pos _b = mix ( pattern _tl _b * texel _size - texel _size , pattern _br _b * texel _size + texel _size , vec2 ( x _b , y ) ) ; vec4 color = mix ( texture2D ( u _image , pos _a ) , texture2D ( u _image , pos _b ) , u _fade ) ; gl _FragColor = color * alpha * opacity ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , `
# define scale 0.015873016
# define LINE _DISTANCE _SCALE 2.0
attribute vec2 a _pos _normal ; attribute vec4 a _data ; uniform mat4 u _matrix ; uniform vec2 u _units _to _pixels ; uniform mediump float u _ratio ; uniform lowp float u _device _pixel _ratio ; varying vec2 v _normal ; varying vec2 v _width2 ; varying float v _linesofar ; varying float v _gamma _scale ; varying float v _width ;
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp float offset
# pragma mapbox : define mediump float gapwidth
# pragma mapbox : define mediump float width
# pragma mapbox : define lowp float floorwidth
# pragma mapbox : define lowp vec4 pattern _from
# pragma mapbox : define lowp vec4 pattern _to
# pragma mapbox : define lowp float pixel _ratio _from
# pragma mapbox : define lowp float pixel _ratio _to
void main ( ) {
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize lowp float offset
# pragma mapbox : initialize mediump float gapwidth
# pragma mapbox : initialize mediump float width
# pragma mapbox : initialize lowp float floorwidth
# pragma mapbox : initialize mediump vec4 pattern _from
# pragma mapbox : initialize mediump vec4 pattern _to
# pragma mapbox : initialize lowp float pixel _ratio _from
# pragma mapbox : initialize lowp float pixel _ratio _to
float ANTIALIASING = 1.0 / u _device _pixel _ratio / 2.0 ; vec2 a _extrude = a _data . xy - 128.0 ; float a _direction = mod ( a _data . z , 4.0 ) - 1.0 ; float a _linesofar = ( floor ( a _data . z / 4.0 ) + a _data . w * 64.0 ) * LINE _DISTANCE _SCALE ; vec2 pos = floor ( a _pos _normal * 0.5 ) ; mediump vec2 normal = a _pos _normal - 2.0 * pos ; normal . y = normal . y * 2.0 - 1.0 ; v _normal = normal ; gapwidth = gapwidth / 2.0 ; float halfwidth = width / 2.0 ; offset = - 1.0 * offset ; float inset = gapwidth + ( gapwidth > 0.0 ? ANTIALIASING : 0.0 ) ; float outset = gapwidth + halfwidth * ( gapwidth > 0.0 ? 2.0 : 1.0 ) + ( halfwidth == 0.0 ? 0.0 : ANTIALIASING ) ; mediump vec2 dist = outset * a _extrude * scale ; mediump float u = 0.5 * a _direction ; mediump float t = 1.0 - abs ( u ) ; mediump vec2 offset2 = offset * a _extrude * scale * normal . y * mat2 ( t , - u , u , t ) ; vec4 projected _extrude = u _matrix * vec4 ( dist / u _ratio , 0.0 , 0.0 ) ; gl _Position = u _matrix * vec4 ( pos + offset2 / u _ratio , 0.0 , 1.0 ) + projected _extrude ;
# ifdef TERRAIN3D
v _gamma _scale = 1.0 ;
# else
float extrude _length _without _perspective = length ( dist ) ; float extrude _length _with _perspective = length ( projected _extrude . xy / gl _Position . w * u _units _to _pixels ) ; v _gamma _scale = extrude _length _without _perspective / extrude _length _with _perspective ;
# endif
2026-01-29 14:17:01 +01:00
v _linesofar = a _linesofar ; v _width2 = vec2 ( outset , inset ) ; v _width = floorwidth ; } ` ),lineSDF:yt( ` uniform lowp float u _device _pixel _ratio ; uniform sampler2D u _image ; uniform float u _sdfgamma ; uniform float u _mix ; varying vec2 v _normal ; varying vec2 v _width2 ; varying vec2 v _tex _a ; varying vec2 v _tex _b ; varying float v _gamma _scale ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define highp vec4 color
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
# pragma mapbox : define mediump float width
# pragma mapbox : define lowp float floorwidth
void main ( ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump float width
# pragma mapbox : initialize lowp float floorwidth
float dist = length ( v _normal ) * v _width2 . s ; float blur2 = ( blur + 1.0 / u _device _pixel _ratio ) * v _gamma _scale ; float alpha = clamp ( min ( dist - ( v _width2 . t - blur2 ) , v _width2 . s - dist ) / blur2 , 0.0 , 1.0 ) ; float sdfdist _a = texture2D ( u _image , v _tex _a ) . a ; float sdfdist _b = texture2D ( u _image , v _tex _b ) . a ; float sdfdist = mix ( sdfdist _a , sdfdist _b , u _mix ) ; alpha *= smoothstep ( 0.5 - u _sdfgamma / floorwidth , 0.5 + u _sdfgamma / floorwidth , sdfdist ) ; gl _FragColor = color * ( alpha * opacity ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , `
# define scale 0.015873016
# define LINE _DISTANCE _SCALE 2.0
attribute vec2 a _pos _normal ; attribute vec4 a _data ; uniform mat4 u _matrix ; uniform mediump float u _ratio ; uniform lowp float u _device _pixel _ratio ; uniform vec2 u _patternscale _a ; uniform float u _tex _y _a ; uniform vec2 u _patternscale _b ; uniform float u _tex _y _b ; uniform vec2 u _units _to _pixels ; varying vec2 v _normal ; varying vec2 v _width2 ; varying vec2 v _tex _a ; varying vec2 v _tex _b ; varying float v _gamma _scale ;
# pragma mapbox : define highp vec4 color
# pragma mapbox : define lowp float blur
# pragma mapbox : define lowp float opacity
# pragma mapbox : define mediump float gapwidth
# pragma mapbox : define lowp float offset
# pragma mapbox : define mediump float width
# pragma mapbox : define lowp float floorwidth
void main ( ) {
# pragma mapbox : initialize highp vec4 color
# pragma mapbox : initialize lowp float blur
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize mediump float gapwidth
# pragma mapbox : initialize lowp float offset
# pragma mapbox : initialize mediump float width
# pragma mapbox : initialize lowp float floorwidth
float ANTIALIASING = 1.0 / u _device _pixel _ratio / 2.0 ; vec2 a _extrude = a _data . xy - 128.0 ; float a _direction = mod ( a _data . z , 4.0 ) - 1.0 ; float a _linesofar = ( floor ( a _data . z / 4.0 ) + a _data . w * 64.0 ) * LINE _DISTANCE _SCALE ; vec2 pos = floor ( a _pos _normal * 0.5 ) ; mediump vec2 normal = a _pos _normal - 2.0 * pos ; normal . y = normal . y * 2.0 - 1.0 ; v _normal = normal ; gapwidth = gapwidth / 2.0 ; float halfwidth = width / 2.0 ; offset = - 1.0 * offset ; float inset = gapwidth + ( gapwidth > 0.0 ? ANTIALIASING : 0.0 ) ; float outset = gapwidth + halfwidth * ( gapwidth > 0.0 ? 2.0 : 1.0 ) + ( halfwidth == 0.0 ? 0.0 : ANTIALIASING ) ; mediump vec2 dist = outset * a _extrude * scale ; mediump float u = 0.5 * a _direction ; mediump float t = 1.0 - abs ( u ) ; mediump vec2 offset2 = offset * a _extrude * scale * normal . y * mat2 ( t , - u , u , t ) ; vec4 projected _extrude = u _matrix * vec4 ( dist / u _ratio , 0.0 , 0.0 ) ; gl _Position = u _matrix * vec4 ( pos + offset2 / u _ratio , 0.0 , 1.0 ) + projected _extrude ;
# ifdef TERRAIN3D
v _gamma _scale = 1.0 ;
# else
float extrude _length _without _perspective = length ( dist ) ; float extrude _length _with _perspective = length ( projected _extrude . xy / gl _Position . w * u _units _to _pixels ) ; v _gamma _scale = extrude _length _without _perspective / extrude _length _with _perspective ;
# endif
2026-01-29 14:17:01 +01:00
v _tex _a = vec2 ( a _linesofar * u _patternscale _a . x / floorwidth , normal . y * u _patternscale _a . y + u _tex _y _a ) ; v _tex _b = vec2 ( a _linesofar * u _patternscale _b . x / floorwidth , normal . y * u _patternscale _b . y + u _tex _y _b ) ; v _width2 = vec2 ( outset , inset ) ; } ` ),raster:yt( ` uniform float u _fade _t ; uniform float u _opacity ; uniform sampler2D u _image0 ; uniform sampler2D u _image1 ; varying vec2 v _pos0 ; varying vec2 v _pos1 ; uniform float u _brightness _low ; uniform float u _brightness _high ; uniform float u _saturation _factor ; uniform float u _contrast _factor ; uniform vec3 u _spin _weights ; void main ( ) { vec4 color0 = texture2D ( u _image0 , v _pos0 ) ; vec4 color1 = texture2D ( u _image1 , v _pos1 ) ; if ( color0 . a > 0.0 ) { color0 . rgb = color0 . rgb / color0 . a ; } if ( color1 . a > 0.0 ) { color1 . rgb = color1 . rgb / color1 . a ; } vec4 color = mix ( color0 , color1 , u _fade _t ) ; color . a *= u _opacity ; vec3 rgb = color . rgb ; rgb = vec3 ( dot ( rgb , u _spin _weights . xyz ) , dot ( rgb , u _spin _weights . zxy ) , dot ( rgb , u _spin _weights . yzx ) ) ; float average = ( color . r + color . g + color . b ) / 3.0 ; rgb += ( average - rgb ) * u _saturation _factor ; rgb = ( rgb - 0.5 ) * u _contrast _factor + 0.5 ; vec3 u _high _vec = vec3 ( u _brightness _low , u _brightness _low , u _brightness _low ) ; vec3 u _low _vec = vec3 ( u _brightness _high , u _brightness _high , u _brightness _high ) ; gl _FragColor = vec4 ( mix ( u _high _vec , u _low _vec , rgb ) * color . a , color . a ) ;
2026-01-28 15:43:23 +01:00
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
2026-01-29 14:17:01 +01:00
} ` ,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:yt( ` uniform sampler2D u _texture ; varying vec2 v _tex ; varying float v _fade _opacity ;
2026-01-28 15:43:23 +01:00
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize lowp float opacity
lowp float alpha = opacity * v _fade _opacity ; gl _FragColor = texture2D ( u _texture , v _tex ) * alpha ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` const float PI = 3.141592653589793 ; attribute vec4 a _pos _offset ; attribute vec4 a _data ; attribute vec4 a _pixeloffset ; attribute vec3 a _projected _pos ; attribute float a _fade _opacity ; uniform bool u _is _size _zoom _constant ; uniform bool u _is _size _feature _constant ; uniform highp float u _size _t ; uniform highp float u _size ; uniform highp float u _camera _to _center _distance ; uniform highp float u _pitch ; uniform bool u _rotate _symbol ; uniform highp float u _aspect _ratio ; uniform float u _fade _change ; uniform mat4 u _matrix ; uniform mat4 u _label _plane _matrix ; uniform mat4 u _coord _matrix ; uniform bool u _is _text ; uniform bool u _pitch _with _map ; uniform vec2 u _texsize ; varying vec2 v _tex ; varying float v _fade _opacity ;
# pragma mapbox : define lowp float opacity
void main ( ) {
# pragma mapbox : initialize lowp float opacity
vec2 a _pos = a _pos _offset . xy ; vec2 a _offset = a _pos _offset . zw ; vec2 a _tex = a _data . xy ; vec2 a _size = a _data . zw ; float a _size _min = floor ( a _size [ 0 ] * 0.5 ) ; vec2 a _pxoffset = a _pixeloffset . xy ; vec2 a _minFontScale = a _pixeloffset . zw / 256.0 ; float ele = get _elevation ( a _pos ) ; highp float segment _angle = - a _projected _pos [ 2 ] ; float size ; if ( ! u _is _size _zoom _constant && ! u _is _size _feature _constant ) { size = mix ( a _size _min , a _size [ 1 ] , u _size _t ) / 128.0 ; } else if ( u _is _size _zoom _constant && ! u _is _size _feature _constant ) { size = a _size _min / 128.0 ; } else { size = u _size ; } vec4 projectedPoint = u _matrix * vec4 ( a _pos , ele , 1 ) ; highp float camera _to _anchor _distance = projectedPoint . w ; highp float distance _ratio = u _pitch _with _map ?
camera _to _anchor _distance / u _camera _to _center _distance :
2026-01-29 14:17:01 +01:00
u _camera _to _center _distance / camera _to _anchor _distance ; highp float perspective _ratio = clamp ( 0.5 + 0.5 * distance _ratio , 0.0 , 4.0 ) ; size *= perspective _ratio ; float fontScale = u _is _text ? size / 24.0 : size ; highp float symbol _rotation = 0.0 ; if ( u _rotate _symbol ) { vec4 offsetProjectedPoint = u _matrix * vec4 ( a _pos + vec2 ( 1 , 0 ) , ele , 1 ) ; vec2 a = projectedPoint . xy / projectedPoint . w ; vec2 b = offsetProjectedPoint . xy / offsetProjectedPoint . w ; symbol _rotation = atan ( ( b . y - a . y ) / u _aspect _ratio , b . x - a . x ) ; } highp float angle _sin = sin ( segment _angle + symbol _rotation ) ; highp float angle _cos = cos ( segment _angle + symbol _rotation ) ; mat2 rotation _matrix = mat2 ( angle _cos , - 1.0 * angle _sin , angle _sin , angle _cos ) ; vec4 projected _pos = u _label _plane _matrix * vec4 ( a _projected _pos . xy , ele , 1.0 ) ; float z = float ( u _pitch _with _map ) * projected _pos . z / projected _pos . w ; gl _Position = u _coord _matrix * vec4 ( projected _pos . xy / projected _pos . w + rotation _matrix * ( a _offset / 32.0 * max ( a _minFontScale , fontScale ) + a _pxoffset / 16.0 ) , z , 1.0 ) ; v _tex = a _tex / u _texsize ; vec2 fade _opacity = unpack _opacity ( a _fade _opacity ) ; float fade _change = fade _opacity [ 1 ] > 0.5 ? u _fade _change : - u _fade _change ; float visibility = calculate _visibility ( projectedPoint ) ; v _fade _opacity = max ( 0.0 , min ( visibility , fade _opacity [ 0 ] + fade _change ) ) ; } ` ),symbolSDF:yt( ` # define SDF _PX 8.0
2026-01-28 15:43:23 +01:00
uniform bool u _is _halo ; uniform sampler2D u _texture ; uniform highp float u _gamma _scale ; uniform lowp float u _device _pixel _ratio ; uniform bool u _is _text ; varying vec2 v _data0 ; varying vec3 v _data1 ;
# pragma mapbox : define highp vec4 fill _color
# pragma mapbox : define highp vec4 halo _color
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp float halo _width
# pragma mapbox : define lowp float halo _blur
void main ( ) {
# pragma mapbox : initialize highp vec4 fill _color
# pragma mapbox : initialize highp vec4 halo _color
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize lowp float halo _width
# pragma mapbox : initialize lowp float halo _blur
float EDGE _GAMMA = 0.105 / u _device _pixel _ratio ; vec2 tex = v _data0 . xy ; float gamma _scale = v _data1 . x ; float size = v _data1 . y ; float fade _opacity = v _data1 [ 2 ] ; float fontScale = u _is _text ? size / 24.0 : size ; lowp vec4 color = fill _color ; highp float gamma = EDGE _GAMMA / ( fontScale * u _gamma _scale ) ; lowp float inner _edge = ( 256.0 - 64.0 ) / 256.0 ; if ( u _is _halo ) { color = halo _color ; gamma = ( halo _blur * 1.19 / SDF _PX + EDGE _GAMMA ) / ( fontScale * u _gamma _scale ) ; inner _edge = inner _edge + gamma * gamma _scale ; } lowp float dist = texture2D ( u _texture , tex ) . a ; highp float gamma _scaled = gamma * gamma _scale ; highp float alpha = smoothstep ( inner _edge - gamma _scaled , inner _edge + gamma _scaled , dist ) ; if ( u _is _halo ) { lowp float halo _edge = ( 6.0 - halo _width / fontScale ) / SDF _PX ; alpha = min ( smoothstep ( halo _edge - gamma _scaled , halo _edge + gamma _scaled , dist ) , 1.0 - alpha ) ; } gl _FragColor = color * ( alpha * opacity * fade _opacity ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` const float PI = 3.141592653589793 ; attribute vec4 a _pos _offset ; attribute vec4 a _data ; attribute vec4 a _pixeloffset ; attribute vec3 a _projected _pos ; attribute float a _fade _opacity ; uniform bool u _is _size _zoom _constant ; uniform bool u _is _size _feature _constant ; uniform highp float u _size _t ; uniform highp float u _size ; uniform mat4 u _matrix ; uniform mat4 u _label _plane _matrix ; uniform mat4 u _coord _matrix ; uniform bool u _is _text ; uniform bool u _pitch _with _map ; uniform highp float u _pitch ; uniform bool u _rotate _symbol ; uniform highp float u _aspect _ratio ; uniform highp float u _camera _to _center _distance ; uniform float u _fade _change ; uniform vec2 u _texsize ; varying vec2 v _data0 ; varying vec3 v _data1 ;
# pragma mapbox : define highp vec4 fill _color
# pragma mapbox : define highp vec4 halo _color
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp float halo _width
# pragma mapbox : define lowp float halo _blur
void main ( ) {
# pragma mapbox : initialize highp vec4 fill _color
# pragma mapbox : initialize highp vec4 halo _color
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize lowp float halo _width
# pragma mapbox : initialize lowp float halo _blur
vec2 a _pos = a _pos _offset . xy ; vec2 a _offset = a _pos _offset . zw ; vec2 a _tex = a _data . xy ; vec2 a _size = a _data . zw ; float a _size _min = floor ( a _size [ 0 ] * 0.5 ) ; vec2 a _pxoffset = a _pixeloffset . xy ; float ele = get _elevation ( a _pos ) ; highp float segment _angle = - a _projected _pos [ 2 ] ; float size ; if ( ! u _is _size _zoom _constant && ! u _is _size _feature _constant ) { size = mix ( a _size _min , a _size [ 1 ] , u _size _t ) / 128.0 ; } else if ( u _is _size _zoom _constant && ! u _is _size _feature _constant ) { size = a _size _min / 128.0 ; } else { size = u _size ; } vec4 projectedPoint = u _matrix * vec4 ( a _pos , ele , 1 ) ; highp float camera _to _anchor _distance = projectedPoint . w ; highp float distance _ratio = u _pitch _with _map ?
camera _to _anchor _distance / u _camera _to _center _distance :
2026-01-29 14:17:01 +01:00
u _camera _to _center _distance / camera _to _anchor _distance ; highp float perspective _ratio = clamp ( 0.5 + 0.5 * distance _ratio , 0.0 , 4.0 ) ; size *= perspective _ratio ; float fontScale = u _is _text ? size / 24.0 : size ; highp float symbol _rotation = 0.0 ; if ( u _rotate _symbol ) { vec4 offsetProjectedPoint = u _matrix * vec4 ( a _pos + vec2 ( 1 , 0 ) , ele , 1 ) ; vec2 a = projectedPoint . xy / projectedPoint . w ; vec2 b = offsetProjectedPoint . xy / offsetProjectedPoint . w ; symbol _rotation = atan ( ( b . y - a . y ) / u _aspect _ratio , b . x - a . x ) ; } highp float angle _sin = sin ( segment _angle + symbol _rotation ) ; highp float angle _cos = cos ( segment _angle + symbol _rotation ) ; mat2 rotation _matrix = mat2 ( angle _cos , - 1.0 * angle _sin , angle _sin , angle _cos ) ; vec4 projected _pos = u _label _plane _matrix * vec4 ( a _projected _pos . xy , ele , 1.0 ) ; float z = float ( u _pitch _with _map ) * projected _pos . z / projected _pos . w ; gl _Position = u _coord _matrix * vec4 ( projected _pos . xy / projected _pos . w + rotation _matrix * ( a _offset / 32.0 * fontScale + a _pxoffset ) , z , 1.0 ) ; float gamma _scale = gl _Position . w ; vec2 fade _opacity = unpack _opacity ( a _fade _opacity ) ; float visibility = calculate _visibility ( projectedPoint ) ; float fade _change = fade _opacity [ 1 ] > 0.5 ? u _fade _change : - u _fade _change ; float interpolated _fade _opacity = max ( 0.0 , min ( visibility , fade _opacity [ 0 ] + fade _change ) ) ; v _data0 = a _tex / u _texsize ; v _data1 = vec3 ( gamma _scale , size , interpolated _fade _opacity ) ; } ` ),symbolTextAndIcon:yt( ` # define SDF _PX 8.0
2026-01-28 15:43:23 +01:00
# define SDF 1.0
# define ICON 0.0
uniform bool u _is _halo ; uniform sampler2D u _texture ; uniform sampler2D u _texture _icon ; uniform highp float u _gamma _scale ; uniform lowp float u _device _pixel _ratio ; varying vec4 v _data0 ; varying vec4 v _data1 ;
# pragma mapbox : define highp vec4 fill _color
# pragma mapbox : define highp vec4 halo _color
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp float halo _width
# pragma mapbox : define lowp float halo _blur
void main ( ) {
# pragma mapbox : initialize highp vec4 fill _color
# pragma mapbox : initialize highp vec4 halo _color
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize lowp float halo _width
# pragma mapbox : initialize lowp float halo _blur
float fade _opacity = v _data1 [ 2 ] ; if ( v _data1 . w == ICON ) { vec2 tex _icon = v _data0 . zw ; lowp float alpha = opacity * fade _opacity ; gl _FragColor = texture2D ( u _texture _icon , tex _icon ) * alpha ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
return ; } vec2 tex = v _data0 . xy ; float EDGE _GAMMA = 0.105 / u _device _pixel _ratio ; float gamma _scale = v _data1 . x ; float size = v _data1 . y ; float fontScale = size / 24.0 ; lowp vec4 color = fill _color ; highp float gamma = EDGE _GAMMA / ( fontScale * u _gamma _scale ) ; lowp float buff = ( 256.0 - 64.0 ) / 256.0 ; if ( u _is _halo ) { color = halo _color ; gamma = ( halo _blur * 1.19 / SDF _PX + EDGE _GAMMA ) / ( fontScale * u _gamma _scale ) ; buff = ( 6.0 - halo _width / fontScale ) / SDF _PX ; } lowp float dist = texture2D ( u _texture , tex ) . a ; highp float gamma _scaled = gamma * gamma _scale ; highp float alpha = smoothstep ( buff - gamma _scaled , buff + gamma _scaled , dist ) ; gl _FragColor = color * ( alpha * opacity * fade _opacity ) ;
# ifdef OVERDRAW _INSPECTOR
gl _FragColor = vec4 ( 1.0 ) ;
# endif
} ` , ` const float PI = 3.141592653589793 ; attribute vec4 a _pos _offset ; attribute vec4 a _data ; attribute vec3 a _projected _pos ; attribute float a _fade _opacity ; uniform bool u _is _size _zoom _constant ; uniform bool u _is _size _feature _constant ; uniform highp float u _size _t ; uniform highp float u _size ; uniform mat4 u _matrix ; uniform mat4 u _label _plane _matrix ; uniform mat4 u _coord _matrix ; uniform bool u _is _text ; uniform bool u _pitch _with _map ; uniform highp float u _pitch ; uniform bool u _rotate _symbol ; uniform highp float u _aspect _ratio ; uniform highp float u _camera _to _center _distance ; uniform float u _fade _change ; uniform vec2 u _texsize ; uniform vec2 u _texsize _icon ; varying vec4 v _data0 ; varying vec4 v _data1 ;
# pragma mapbox : define highp vec4 fill _color
# pragma mapbox : define highp vec4 halo _color
# pragma mapbox : define lowp float opacity
# pragma mapbox : define lowp float halo _width
# pragma mapbox : define lowp float halo _blur
void main ( ) {
# pragma mapbox : initialize highp vec4 fill _color
# pragma mapbox : initialize highp vec4 halo _color
# pragma mapbox : initialize lowp float opacity
# pragma mapbox : initialize lowp float halo _width
# pragma mapbox : initialize lowp float halo _blur
vec2 a _pos = a _pos _offset . xy ; vec2 a _offset = a _pos _offset . zw ; vec2 a _tex = a _data . xy ; vec2 a _size = a _data . zw ; float a _size _min = floor ( a _size [ 0 ] * 0.5 ) ; float is _sdf = a _size [ 0 ] - 2.0 * a _size _min ; float ele = get _elevation ( a _pos ) ; highp float segment _angle = - a _projected _pos [ 2 ] ; float size ; if ( ! u _is _size _zoom _constant && ! u _is _size _feature _constant ) { size = mix ( a _size _min , a _size [ 1 ] , u _size _t ) / 128.0 ; } else if ( u _is _size _zoom _constant && ! u _is _size _feature _constant ) { size = a _size _min / 128.0 ; } else { size = u _size ; } vec4 projectedPoint = u _matrix * vec4 ( a _pos , ele , 1 ) ; highp float camera _to _anchor _distance = projectedPoint . w ; highp float distance _ratio = u _pitch _with _map ?
camera _to _anchor _distance / u _camera _to _center _distance :
2026-01-29 14:34:28 +01:00
u _camera _to _center _distance / camera _to _anchor _distance ; highp float perspective _ratio = clamp ( 0.5 + 0.5 * distance _ratio , 0.0 , 4.0 ) ; size *= perspective _ratio ; float fontScale = size / 24.0 ; highp float symbol _rotation = 0.0 ; if ( u _rotate _symbol ) { vec4 offsetProjectedPoint = u _matrix * vec4 ( a _pos + vec2 ( 1 , 0 ) , ele , 1 ) ; vec2 a = projectedPoint . xy / projectedPoint . w ; vec2 b = offsetProjectedPoint . xy / offsetProjectedPoint . w ; symbol _rotation = atan ( ( b . y - a . y ) / u _aspect _ratio , b . x - a . x ) ; } highp float angle _sin = sin ( segment _angle + symbol _rotation ) ; highp float angle _cos = cos ( segment _angle + symbol _rotation ) ; mat2 rotation _matrix = mat2 ( angle _cos , - 1.0 * angle _sin , angle _sin , angle _cos ) ; vec4 projected _pos = u _label _plane _matrix * vec4 ( a _projected _pos . xy , ele , 1.0 ) ; float z = float ( u _pitch _with _map ) * projected _pos . z / projected _pos . w ; gl _Position = u _coord _matrix * vec4 ( projected _pos . xy / projected _pos . w + rotation _matrix * ( a _offset / 32.0 * fontScale ) , z , 1.0 ) ; float gamma _scale = gl _Position . w ; vec2 fade _opacity = unpack _opacity ( a _fade _opacity ) ; float visibility = calculate _visibility ( projectedPoint ) ; float fade _change = fade _opacity [ 1 ] > 0.5 ? u _fade _change : - u _fade _change ; float interpolated _fade _opacity = max ( 0.0 , min ( visibility , fade _opacity [ 0 ] + fade _change ) ) ; v _data0 . xy = a _tex / u _texsize ; v _data0 . zw = a _tex / u _texsize _icon ; v _data1 = vec4 ( gamma _scale , size , interpolated _fade _opacity , is _sdf ) ; } ` ),terrain:yt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",jn),terrainDepth:yt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",jn),terrainCoords:yt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",jn)};function yt(u,t){const n=/#pragma mapbox: ([ \w ]+) ([ \w ]+) ([ \w ]+) ([ \w ]+)/g,s=t.match(/attribute ([ \w ]+) ([ \w ]+)/g),c=u.match(/uniform ([ \w ]+) ([ \w ]+)([ \s ]*)([ \w ]*)/g),p=t.match(/uniform ([ \w ]+) ([ \w ]+)([ \s ]*)([ \w ]*)/g),g=p?p.concat(c):c,_={};return{fragmentSource:u=u.replace(n,((x,b,T,I,P)=>(_[P]=!0,b==="define"? `
2026-01-28 16:16:19 +01:00
# ifndef HAS _UNIFORM _u _$ { P }
varying $ { T } $ { I } $ { P } ;
2026-01-28 15:43:23 +01:00
# else
2026-01-28 16:16:19 +01:00
uniform $ { T } $ { I } u _$ { P } ;
2026-01-28 15:43:23 +01:00
# endif
` : `
2026-01-28 16:16:19 +01:00
# ifdef HAS _UNIFORM _u _$ { P }
$ { T } $ { I } $ { P } = u _$ { P } ;
# endif
2026-01-29 14:08:40 +01:00
` ))),vertexSource:t=t.replace(n,((x,b,T,I,P)=>{const V=I==="float"?"vec2":"vec4",N=P.match(/color/)?"color":V;return _[P]?b==="define"? `
2026-01-28 16:16:19 +01:00
# ifndef HAS _UNIFORM _u _$ { P }
uniform lowp float u _$ { P } _t ;
attribute $ { T } $ { V } a _$ { P } ;
varying $ { T } $ { I } $ { P } ;
2026-01-28 15:43:23 +01:00
# else
2026-01-28 16:16:19 +01:00
uniform $ { T } $ { I } u _$ { P } ;
2026-01-28 15:43:23 +01:00
# endif
2026-01-28 16:16:19 +01:00
` :N==="vec4"? `
# ifndef HAS _UNIFORM _u _$ { P }
$ { P } = a _$ { P } ;
2026-01-28 15:43:23 +01:00
# else
2026-01-28 16:16:19 +01:00
$ { T } $ { I } $ { P } = u _$ { P } ;
2026-01-28 15:43:23 +01:00
# endif
` : `
2026-01-28 16:16:19 +01:00
# ifndef HAS _UNIFORM _u _$ { P }
$ { P } = unpack _mix _$ { N } ( a _$ { P } , u _$ { P } _t ) ;
2026-01-28 15:43:23 +01:00
# else
2026-01-28 16:16:19 +01:00
$ { T } $ { I } $ { P } = u _$ { P } ;
2026-01-28 15:43:23 +01:00
# endif
2026-01-29 14:08:40 +01:00
` :b==="define"? `
2026-01-28 16:16:19 +01:00
# ifndef HAS _UNIFORM _u _$ { P }
uniform lowp float u _$ { P } _t ;
attribute $ { T } $ { V } a _$ { P } ;
2026-01-28 15:43:23 +01:00
# else
2026-01-28 16:16:19 +01:00
uniform $ { T } $ { I } u _$ { P } ;
2026-01-28 15:43:23 +01:00
# endif
2026-01-28 16:16:19 +01:00
` :N==="vec4"? `
# ifndef HAS _UNIFORM _u _$ { P }
$ { T } $ { I } $ { P } = a _$ { P } ;
2026-01-28 15:43:23 +01:00
# else
2026-01-28 16:16:19 +01:00
$ { T } $ { I } $ { P } = u _$ { P } ;
2026-01-28 15:43:23 +01:00
# endif
` : `
2026-01-28 16:16:19 +01:00
# ifndef HAS _UNIFORM _u _$ { P }
$ { T } $ { I } $ { P } = unpack _mix _$ { N } ( a _$ { P } , u _$ { P } _t ) ;
2026-01-28 15:43:23 +01:00
# else
2026-01-28 16:16:19 +01:00
$ { T } $ { I } $ { P } = u _$ { P } ;
2026-01-28 15:43:23 +01:00
# endif
2026-01-29 14:34:28 +01:00
` })),staticAttributes:s,staticUniforms:g}}class yn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,c,p,g,_,x,b){this.context=t;let T=this.boundPaintVertexBuffers.length!==c.length;for(let I=0;!T&&I<c.length;I++)this.boundPaintVertexBuffers[I]!==c[I]&&(T=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==s||T||this.boundIndexBuffer!==p||this.boundVertexOffset!==g||this.boundDynamicVertexBuffer!==_||this.boundDynamicVertexBuffer2!==x||this.boundDynamicVertexBuffer3!==b?this.freshBind(n,s,c,p,g,_,x,b):(t.bindVertexArray.set(this.vao),_&&_.bind(),p&&p.dynamicDraw&&p.bind(),x&&x.bind(),b&&b.bind())}freshBind(t,n,s,c,p,g,_,x){const b=t.numAttributes,T=this.context,I=T.gl;this.vao&&this.destroy(),this.vao=T.createVertexArray(),T.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=s,this.boundIndexBuffer=c,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=g,this.boundDynamicVertexBuffer2=_,this.boundDynamicVertexBuffer3=x,n.enableAttributes(I,t);for(const P of s)P.enableAttributes(I,t);g&&g.enableAttributes(I,t),_&&_.enableAttributes(I,t),x&&x.enableAttributes(I,t),n.bind(),n.setVertexAttribPointers(I,t,p);for(const P of s)P.bind(),P.setVertexAttribPointers(I,t,p);g&&(g.bind(),g.setVertexAttribPointers(I,t,p)),c&&c.bind(),_&&(_.bind(),_.setVertexAttribPointers(I,t,p)),x&&(x.bind(),x.setVertexAttribPointers(I,t,p)),T.currentNumAttributes=b}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function $ t(u){const t=[];for(let n=0;n<u.length;n++){if(u[n]===null)continue;const s=u[n].split(" ");t.push(s.pop())}return t}class $ a{constructor(t,n,s,c,p,g){const _=t.gl;this.program=_.createProgram();const x= $ t(n.staticAttributes),b=s?s.getBinderAttributes():[],T=x.concat(b),I=Rt.prelude.staticUniforms? $ t(Rt.prelude.staticUniforms):[],P=n.staticUniforms? $ t(n.staticUniforms):[],V=s?s.getBinderUniforms():[],N=I.concat(P).concat(V), $ =[];for(const ue of N) $ .indexOf(ue)<0&& $ .push(ue);const B=s?s.defines():[];p&&B.push("#define OVERDRAW_INSPECTOR;"),g&&B.push("#define TERRAIN3D;");const ee=B.concat(Rt.prelude.fragmentSource,n.fragmentSource).join( `
` ),se=B.concat(Rt.prelude.vertexSource,n.vertexSource).join( `
2026-01-29 15:10:32 +01:00
` ),G=_.createShader(_.FRAGMENT_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(G,ee),_.compileShader(G),!_.getShaderParameter(G,_.COMPILE_STATUS))throw new Error( ` Could not compile fragment shader : $ { _ . getShaderInfoLog ( G ) } ` );_.attachShader(this.program,G);const te=_.createShader(_.VERTEX_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(te,se),_.compileShader(te),!_.getShaderParameter(te,_.COMPILE_STATUS))throw new Error( ` Could not compile vertex shader : $ { _ . getShaderInfoLog ( te ) } ` );_.attachShader(this.program,te),this.attributes={};const ce={};this.numAttributes=T.length;for(let ue=0;ue<this.numAttributes;ue++)T[ue]&&(_.bindAttribLocation(this.program,ue,T[ue]),this.attributes[T[ue]]=ue);if(_.linkProgram(this.program),!_.getProgramParameter(this.program,_.LINK_STATUS))throw new Error( ` Program failed to link : $ { _ . getProgramInfoLog ( this . program ) } ` );_.deleteShader(te),_.deleteShader(G);for(let ue=0;ue< $ .length;ue++){const me= $ [ue];if(me&&!ce[me]){const be=_.getUniformLocation(this.program,me);be&&(ce[me]=be)}}this.fixedUniforms=c(t,ce),this.terrainUniforms=((ue,me)=>({u_depth:new l.aL(ue,me.u_depth),u_terrain:new l.aL(ue,me.u_terrain),u_terrain_dim:new l.aM(ue,me.u_terrain_dim),u_terrain_matrix:new l.aN(ue,me.u_terrain_matrix),u_terrain_unpack:new l.aO(ue,me.u_terrain_unpack),u_terrain_exaggeration:new l.aM(ue,me.u_terrain_exaggeration)}))(t,ce),this.binderUniforms=s?s.getUniforms(t,ce):[]}draw(t,n,s,c,p,g,_,x,b,T,I,P,V,N, $ ,B,ee,se){const G=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(c),t.setColorMode(p),t.setCullFace(g),x){t.activeTexture.set(G.TEXTURE2),G.bindTexture(G.TEXTURE_2D,x.depthTexture),t.activeTexture.set(G.TEXTURE3),G.bindTexture(G.TEXTURE_2D,x.texture);for(const ce in this.terrainUniforms)this.terrainUniforms[ce].set(x[ce])}for(const ce in this.fixedUniforms)this.fixedUniforms[ce].set(_[ce]); $ && $ .setUniforms(t,this.binderUniforms,V,{zoom:N});let te=0;switch(n){case G.LINES:te=2;break;case G.TRIANGLES:te=3;break;case G.LINE_STRIP:te=1}for(const ce of P.get()){const ue=ce.vaos||(ce.vaos={});(ue[b]||(ue[b]=new yn)).bind(t,this,T, $ ? $ .getPaintVertexBuffers():[],I,ce.vertexOffset,B,ee,se),G.drawElements(n,ce.primitiveLength*te,G.UNSIGNED_SHORT,ce.primitiveOffset*te*2)}}}function cr(u,t,n){const s=1/J(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),p=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,g=p*(n.tileID.canonical.x+n.tileID.wrap*c),_=p*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[g>>16,_>>16],u_pixel_coord_lower:[65535&g,65535&_]}}const zs=(u,t,n,s)=>{const c=t.style.light,p=c.properties.get("position"),g=[p.x,p.y,p.z],_=(function(){var b=new l.A(9);return l.A!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b})();c.properties.get("anchor")==="viewport"&&(function(b,T){var I=Math.sin(T),P=Math.cos(T);b[0]=P,b[1]=I,b[2]=0,b[3]=-I,b[4]=P,b[5]=0,b[6]=0,b[7]=0,b[8]=1})(_,-t.transform.angle),(function(b,T,I){var P=T[0],V=T[1],N=T[2];b[0]=P*I[0]+V*I[3]+N*I[6],b[1]=P*I[1]+V*I[4]+N*I[7],b[2]=P*I[2]+V*I[5]+N*I[8]})(g,g,_);const x=c.properties.get("color");return{u_matrix:u,u_lightpos:g,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[x.r,x.g,x.b],u_vertical_gradient:+n,u_opacity:s}},Qr=(u,t,n,s,c,p,g)=>l.e(zs(u,t,n,s),cr(p,t,g),{u_height_factor:-Math.pow(2,c.overscaledZ)/g.tileSize/8}),Ho=u=>({u_matrix:u}),Ds=(u,t,n,s)=>l.e(Ho(u),cr(n,t,s)),ja=(u,t)=>({u_matrix:u,u_world:t}),qa=(u,t,n,s,c)=>l.e(Ds(u,t,n,s),{u_world:c}),en=(u,t,n,s)=>{const c=u.transform;let p,g;if(s.paint.get("circle-pitch-alignment")==="map"){const _=J(n,1,c.zoom);p=!0,g=[_,_]}else p=!1,g=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:u
2026-01-28 15:43:23 +01:00
< div class = "maplibregl-desktop-message" > $ { u } < / d i v >
< div class = "maplibregl-mobile-message" > $ { typeof this . _cooperativeGestures != "boolean" && this . _cooperativeGestures . mobileHelpText ? this . _cooperativeGestures . mobileHelpText : "Use two fingers to move the map" } < / d i v >
2026-01-29 15:10:32 +01:00
` ,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){W.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(u,t,n){this._canvas.width=Math.floor(n*u),this._canvas.height=Math.floor(n*t),this._canvas.style.width= ` $ { u } px ` ,this._canvas.style.height= ` $ { t } px ` }_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(s=>{t={requestedAttributes:u},s&&(t.statusMessage=s.statusMessage,t.type=s.type)}),{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new wn(n,this.transform),Se.testSupport(n)}_onCooperativeGesture(u,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout((()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")}),100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,p=l.h.now();this.style.zoomHistory.update(c,p);const g=new l.a8(c,{now:p,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=g.crossFadingFactor();_===1&&_===this._crossFadingFactor||(n=!0,this._crossFadingFactor=_),this.style.update(g)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new l.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.bg.mark(l.bh.load),this.fire(new l.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,l.bg.mark(l.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),
2026-01-28 15:43:23 +01:00
2026-01-29 15:10:32 +01:00
` +h.mark.snippet),L+" "+E):L}function As(h,w){Error.call(this),this.name="YAMLException",this.reason=h,this.mark=w,this.message=Su(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}As.prototype=Object.create(Error.prototype),As.prototype.constructor=As,As.prototype.toString=function(w){return this.name+": "+Su(this,w)};var $ i=As;function Ql(h,w,E,L,F){var Q="",K="",l=Math.floor(F/2)-1;return L-w>l&&(Q=" ... ",w=L-l+Q.length),E-L>l&&(K=" ...",E=L+l-K.length),{str:Q+h.slice(w,E).replace(/ \t /g,"→")+K,pos:L-w+Q.length}}function ec(h,w){return ci.repeat(" ",w-h.length)+h}function Vd(h,w){if(w=Object.create(w||null),!h.buffer)return null;w.maxLength||(w.maxLength=79),typeof w.indent!="number"&&(w.indent=1),typeof w.linesBefore!="number"&&(w.linesBefore=3),typeof w.linesAfter!="number"&&(w.linesAfter=2);for(var E=/ \r ? \n | \r | \0 /g,L=[0],F=[],Q,K=-1;Q=E.exec(h.buffer);)F.push(Q.index),L.push(Q.index+Q[0].length),h.position<=Q.index&&K<0&&(K=L.length-2);K<0&&(K=L.length-1);var l="",le,W,Se=Math.min(h.line+w.linesAfter,F.length).toString().length,de=w.maxLength-(w.indent+Se+3);for(le=1;le<=w.linesBefore&&!(K-le<0);le++)W=Ql(h.buffer,L[K-le],F[K-le],h.position-(L[K]-L[K-le]),de),l=ci.repeat(" ",w.indent)+ec((h.line-le+1).toString(),Se)+" | "+W.str+ `
2026-01-29 14:34:28 +01:00
` +l;for(W=Ql(h.buffer,L[K],F[K],h.position,de),l+=ci.repeat(" ",w.indent)+ec((h.line+1).toString(),Se)+" | "+W.str+ `
` ,l+=ci.repeat("-",w.indent+Se+3+W.pos)+ ` ^
` ,le=1;le<=w.linesAfter&&!(K+le>=F.length);le++)W=Ql(h.buffer,L[K+le],F[K+le],h.position-(L[K]-L[K+le]),de),l+=ci.repeat(" ",w.indent)+ec((h.line+le+1).toString(),Se)+" | "+W.str+ `
2026-01-29 15:10:32 +01:00
` ;return l.replace(/ \n $ /,"")}var Ud=Vd, $ d=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],jd=["scalar","sequence","mapping"];function qd(h){var w={};return h!==null&&Object.keys(h).forEach(function(E){h[E].forEach(function(L){w[String(L)]=E})}),w}function Zd(h,w){if(w=w||{},Object.keys(w).forEach(function(E){if( $ d.indexOf(E)===-1)throw new $ i('Unknown option "'+E+'" is met in definition of "'+h+'" YAML type.')}),this.options=w,this.tag=h,this.kind=w.kind||null,this.resolve=w.resolve||function(){return!0},this.construct=w.construct||function(E){return E},this.instanceOf=w.instanceOf||null,this.predicate=w.predicate||null,this.represent=w.represent||null,this.representName=w.representName||null,this.defaultStyle=w.defaultStyle||null,this.multi=w.multi||!1,this.styleAliases=qd(w.styleAliases||null),jd.indexOf(this.kind)===-1)throw new $ i('Unknown kind "'+this.kind+'" is specified for "'+h+'" YAML type.')}var bi=Zd;function Tu(h,w){var E=[];return h[w].forEach(function(L){var F=E.length;E.forEach(function(Q,K){Q.tag===L.tag&&Q.kind===L.kind&&Q.multi===L.multi&&(F=K)}),E[F]=L}),E}function Gd(){var h={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},w,E;function L(F){F.multi?(h.multi[F.kind].push(F),h.multi.fallback.push(F)):h[F.kind][F.tag]=h.fallback[F.tag]=F}for(w=0,E=arguments.length;w<E;w+=1)arguments[w].forEach(L);return h}function tc(h){return this.extend(h)}tc.prototype.extend=function(w){var E=[],L=[];if(w instanceof bi)L.push(w);else if(Array.isArray(w))L=L.concat(w);else if(w&&(Array.isArray(w.implicit)||Array.isArray(w.explicit)))w.implicit&&(E=E.concat(w.implicit)),w.explicit&&(L=L.concat(w.explicit));else throw new $ i("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");E.forEach(function(Q){if(!(Q instanceof bi))throw new $ i("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(Q.loadKind&&Q.loadKind!=="scalar")throw new $ i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(Q.multi)throw new $ i("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),L.forEach(function(Q){if(!(Q instanceof bi))throw new $ i("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var F=Object.create(tc.prototype);return F.implicit=(this.implicit||[]).concat(E),F.explicit=(this.explicit||[]).concat(L),F.compiledImplicit=Tu(F,"implicit"),F.compiledExplicit=Tu(F,"explicit"),F.compiledTypeMap=Gd(F.compiledImplicit,F.compiledExplicit),F};var Iu=tc,Au=new bi("tag:yaml.org,2002:str",{kind:"scalar",construct:function(h){return h!==null?h:""}}),ku=new bi("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(h){return h!==null?h:[]}}),Cu=new bi("tag:yaml.org,2002:map",{kind:"mapping",construct:function(h){return h!==null?h:{}}}),Eu=new Iu({explicit:[Au,ku,Cu]});function Hd(h){if(h===null)return!0;var w=h.length;return w===1&&h==="~"||w===4&&(h==="null"||h==="Null"||h==="NULL")}function Wd(){return null}function Xd(h){return h===null}var Mu=new bi("tag:yaml.org,2002:null",{kind:"scalar",resolve:Hd,construct:Wd,predicate:Xd,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Kd(h){if(h===null)return!1;var w=h.length;return w===4&&(h==="true"||h==="True"||h==="TRUE")||w===5&&(h==="false"||h==="False"||h==="FALSE")}function Yd(h){return h==="true"||h==="True"||h==="TRUE"}function Jd(h){return Object.prototype.toString.call(h)==="[object Boolean]"}var Pu=new bi("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Kd,construct:Yd,predicate:Jd,represent:{lowercase:function(h){return h?"true":"false"},uppercase:function(h){return h?"TRUE":"FALSE"},camelcase:function(h){return h?"True":"False"}},defaultStyle:"lowercase"});functio
\ r ` ;function gf(h){if(h===null)return!1;var w,E,L=0,F=h.length,Q=ic;for(E=0;E<F;E++)if(w=Q.indexOf(h.charAt(E)),!(w>64)){if(w<0)return!1;L+=6}return L%8===0}function _f(h){var w,E,L=h.replace(/[ \r \n =]/g,""),F=L.length,Q=ic,K=0,l=[];for(w=0;w<F;w++)w%4===0&&w&&(l.push(K>>16&255),l.push(K>>8&255),l.push(K&255)),K=K<<6|Q.indexOf(L.charAt(w));return E=F%4*6,E===0?(l.push(K>>16&255),l.push(K>>8&255),l.push(K&255)):E===18?(l.push(K>>10&255),l.push(K>>2&255)):E===12&&l.push(K>>4&255),new Uint8Array(l)}function yf(h){var w="",E=0,L,F,Q=h.length,K=ic;for(L=0;L<Q;L++)L%3===0&&L&&(w+=K[E>>18&63],w+=K[E>>12&63],w+=K[E>>6&63],w+=K[E&63]),E=(E<<8)+h[L];return F=Q%3,F===0?(w+=K[E>>18&63],w+=K[E>>12&63],w+=K[E>>6&63],w+=K[E&63]):F===2?(w+=K[E>>10&63],w+=K[E>>4&63],w+=K[E<<2&63],w+=K[64]):F===1&&(w+=K[E>>2&63],w+=K[E<<4&63],w+=K[64],w+=K[64]),w}function xf(h){return Object.prototype.toString.call(h)==="[object Uint8Array]"}var Vu=new bi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:gf,construct:_f,predicate:xf,represent:yf}),vf=Object.prototype.hasOwnProperty,bf=Object.prototype.toString;function wf(h){if(h===null)return!0;var w=[],E,L,F,Q,K,l=h;for(E=0,L=l.length;E<L;E+=1){if(F=l[E],K=!1,bf.call(F)!=="[object Object]")return!1;for(Q in F)if(vf.call(F,Q))if(!K)K=!0;else return!1;if(!K)return!1;if(w.indexOf(Q)===-1)w.push(Q);else return!1}return!0}function Sf(h){return h!==null?h:[]}var Uu=new bi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:wf,construct:Sf}),Tf=Object.prototype.toString;function If(h){if(h===null)return!0;var w,E,L,F,Q,K=h;for(Q=new Array(K.length),w=0,E=K.length;w<E;w+=1){if(L=K[w],Tf.call(L)!=="[object Object]"||(F=Object.keys(L),F.length!==1))return!1;Q[w]=[F[0],L[F[0]]]}return!0}function Af(h){if(h===null)return[];var w,E,L,F,Q,K=h;for(Q=new Array(K.length),w=0,E=K.length;w<E;w+=1)L=K[w],F=Object.keys(L),Q[w]=[F[0],L[F[0]]];return Q}var $ u=new bi("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:If,construct:Af}),kf=Object.prototype.hasOwnProperty;function Cf(h){if(h===null)return!0;var w,E=h;for(w in E)if(kf.call(E,w)&&E[w]!==null)return!1;return!0}function Ef(h){return h!==null?h:{}}var ju=new bi("tag:yaml.org,2002:set",{kind:"mapping",resolve:Cf,construct:Ef}),rc=Fu.extend({implicit:[Ou,Nu],explicit:[Vu,Uu, $ u,ju]}),Ln=Object.prototype.hasOwnProperty,Vo=1,qu=2,Zu=3,Uo=4,nc=1,Mf=2,Gu=3,Pf=/[ \x 00- \x 08 \x 0B \x 0C \x 0E- \x 1F \x 7F- \x 84 \x 86- \x 9F \u FFFE \u FFFF]|[ \u D800- \u DBFF](?![ \u DC00- \u DFFF])|(?:[^ \u D800- \u DBFF]|^)[ \u DC00- \u DFFF]/,zf=/[ \x 85 \u 2028 \u 2029]/,Df=/[, \[ \] \{ \} ]/,Hu=/^(?:!|!!|![a-z \- ]+!) $ /i,Wu=/^(?:!|[^, \[ \] \{ \} ])(?:%[0-9a-f]{2}|[0-9a-z \- #; \/ \? :@&= \+ \$ ,_ \. !~ \* ' \( \) \[ \] ])* $ /i;function Xu(h){return Object.prototype.toString.call(h)}function Gr(h){return h===10||h===13}function oa(h){return h===9||h===32}function ir(h){return h===9||h===32||h===10||h===13}function Da(h){return h===44||h===91||h===93||h===123||h===125}function Lf(h){var w;return 48<=h&&h<=57?h-48:(w=h|32,97<=w&&w<=102?w-97+10:-1)}function Ff(h){return h===120?2:h===117?4:h===85?8:0}function Rf(h){return 48<=h&&h<=57?h-48:-1}function Ku(h){return h===48?" \0 ":h===97?" \x 07":h===98?" \b ":h===116||h===9?" ":h===110? `
` :h===118?" \v ":h===102?" \f ":h===114?" \r ":h===101?" \x 1B":h===32?" ":h===34?'"':h===47?"/":h===92?" \\ ":h===78?"
":h===95?" ":h===76?" \u 2028":h===80?" \u 2029":""}function Bf(h){return h<=65535?String.fromCharCode(h):String.fromCharCode((h-65536>>10)+55296,(h-65536&1023)+56320)}function Yu(h,w,E){w==="__proto__"?Object.defineProperty(h,w,{configurable:!0,enumerable:!0,writable:!0,value:E}):h[w]=E}for(var Ju=new Array(256),Qu=new Array(256),La=0;La<256;La++)Ju[La]=Ku(La)?1:0,Qu[La]=Ku(La);function Of(h,w){this.input=h,this.filename=w.filename||null,this.schema=w.schema||rc,this.onWarning=w.onWarning||null,this.legacy=w.legacy||!1,this.json=w.json||!1,this.listener=w.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=h.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function eh(h,w){var E={name:h.filename,buffer:h.input.slice(0,-1),position:h.position,line:h.line,column:h.position-h.lineStart};return E.snippet=Ud(E),new $ i(w,E)}function Xe(h,w){throw eh(h,w)}function $ o(h,w){h.onWarning&&h.onWarning.call(null,eh(h,w))}var th={YAML:function(w,E,L){var F,Q,K;w.version!==null&&Xe(w,"duplication of %YAML directive"),L.length!==1&&Xe(w,"YAML directive accepts exactly one argument"),F=/^([0-9]+) \. ([0-9]+) $ /.exec(L[0]),F===null&&Xe(w,"ill-formed argument of the YAML directive"),Q=parseInt(F[1],10),K=parseInt(F[2],10),Q!==1&&Xe(w,"unacceptable YAML version of the document"),w.version=L[0],w.checkLineBreaks=K<2,K!==1&&K!==2&& $ o(w,"unsupported YAML version of the document")},TAG:function(w,E,L){var F,Q;L.length!==2&&Xe(w,"TAG directive accepts exactly two arguments"),F=L[0],Q=L[1],Hu.test(F)||Xe(w,"ill-formed tag handle (first argument) of the TAG directive"),Ln.call(w.tagMap,F)&&Xe(w,'there is a previously declared suffix for "'+F+'" tag handle'),Wu.test(Q)||Xe(w,"ill-formed tag prefix (second argument) of the TAG directive");try{Q=decodeURIComponent(Q)}catch{Xe(w,"tag prefix is malformed: "+Q)}w.tagMap[F]=Q}};function Fn(h,w,E,L){var F,Q,K,l;if(w<E){if(l=h.input.slice(w,E),L)for(F=0,Q=l.length;F<Q;F+=1)K=l.charCodeAt(F),K===9||32<=K&&K<=1114111||Xe(h,"expected valid JSON character");else Pf.test(l)&&Xe(h,"the stream contains non-printable characters");h.result+=l}}function ih(h,w,E,L){var F,Q,K,l;for(ci.isObject(E)||Xe(h,"cannot merge mappings; the provided source object is unacceptable"),F=Object.keys(E),K=0,l=F.length;K<l;K+=1)Q=F[K],Ln.call(w,Q)||(Yu(w,Q,E[Q]),L[Q]=!0)}function Fa(h,w,E,L,F,Q,K,l,le){var W,Se;if(Array.isArray(F))for(F=Array.prototype.slice.call(F),W=0,Se=F.length;W<Se;W+=1)Array.isArray(F[W])&&Xe(h,"nested arrays are not supported inside keys"),typeof F=="object"&&Xu(F[W])==="[object Object]"&&(F[W]="[object Object]");if(typeof F=="object"&&Xu(F)==="[object Object]"&&(F="[object Object]"),F=String(F),w===null&&(w={}),L==="tag:yaml.org,2002:merge")if(Array.isArray(Q))for(W=0,Se=Q.length;W<Se;W+=1)ih(h,w,Q[W],E);else ih(h,w,Q,E);else!h.json&&!Ln.call(E,F)&&Ln.call(w,F)&&(h.line=K||h.line,h.lineStart=l||h.lineStart,h.position=le||h.position,Xe(h,"duplicated mapping key")),Yu(w,F,Q),delete E[F];return w}function ac(h){var w;w=h.input.charCodeAt(h.position),w===10?h.position++:w===13?(h.position++,h.input.charCodeAt(h.position)===10&&h.position++):Xe(h,"a line break is expected"),h.line+=1,h.lineStart=h.position,h.firstTabInLine=-1}function li(h,w,E){for(var L=0,F=h.input.charCodeAt(h.position);F!==0;){for(;oa(F);)F===9&&h.firstTabInLine===-1&&(h.firstTabInLine=h.position),F=h.input.charCodeAt(++h.position);if(w&&F===35)do F=h.input.charCodeAt(++h.position);while(F!==10&&F!==13&&F!==0);if(Gr(F))for(ac(h),F=h.input.charCodeAt(h.position),L++,h.lineIndent=0;F===32;)h.lineIndent++,F=h.input.charCodeAt(++h.position);else break}return E!==-1&&L!==0&&h.lineIndent<E&& $ o(h,"deficient indentation"),L}function jo(h){var w=h.position,E;return E=h.input.charCodeAt(w),!!((E===45||E===46)&&E===h.input.charCodeAt(w+1)&&E===h.input.charCodeAt(w+2)&&(w+=3,E=h.input.charCodeAt(w),E===0||ir(E)))}function sc(h,w
` ,w-1))}function Nf(h,w,E){var L,F,Q,K,l,le,W,Se,de=h.kind,ge=h.result,ve;if(ve=h.input.charCodeAt(h.position),ir(ve)||Da(ve)||ve===35||ve===38||ve===42||ve===33||ve===124||ve===62||ve===39||ve===34||ve===37||ve===64||ve===96||(ve===63||ve===45)&&(F=h.input.charCodeAt(h.position+1),ir(F)||E&&Da(F)))return!1;for(h.kind="scalar",h.result="",Q=K=h.position,l=!1;ve!==0;){if(ve===58){if(F=h.input.charCodeAt(h.position+1),ir(F)||E&&Da(F))break}else if(ve===35){if(L=h.input.charCodeAt(h.position-1),ir(L))break}else{if(h.position===h.lineStart&&jo(h)||E&&Da(ve))break;if(Gr(ve))if(le=h.line,W=h.lineStart,Se=h.lineIndent,li(h,!1,-1),h.lineIndent>=w){l=!0,ve=h.input.charCodeAt(h.position);continue}else{h.position=K,h.line=le,h.lineStart=W,h.lineIndent=Se;break}}l&&(Fn(h,Q,K,!1),sc(h,h.line-le),Q=K=h.position,l=!1),oa(ve)||(K=h.position+1),ve=h.input.charCodeAt(++h.position)}return Fn(h,Q,K,!1),h.result?!0:(h.kind=de,h.result=ge,!1)}function Vf(h,w){var E,L,F;if(E=h.input.charCodeAt(h.position),E!==39)return!1;for(h.kind="scalar",h.result="",h.position++,L=F=h.position;(E=h.input.charCodeAt(h.position))!==0;)if(E===39)if(Fn(h,L,h.position,!0),E=h.input.charCodeAt(++h.position),E===39)L=h.position,h.position++,F=h.position;else return!0;else Gr(E)?(Fn(h,L,F,!0),sc(h,li(h,!1,w)),L=F=h.position):h.position===h.lineStart&&jo(h)?Xe(h,"unexpected end of the document within a single quoted scalar"):(h.position++,F=h.position);Xe(h,"unexpected end of the stream within a single quoted scalar")}function Uf(h,w){var E,L,F,Q,K,l;if(l=h.input.charCodeAt(h.position),l!==34)return!1;for(h.kind="scalar",h.result="",h.position++,E=L=h.position;(l=h.input.charCodeAt(h.position))!==0;){if(l===34)return Fn(h,E,h.position,!0),h.position++,!0;if(l===92){if(Fn(h,E,h.position,!0),l=h.input.charCodeAt(++h.position),Gr(l))li(h,!1,w);else if(l<256&&Ju[l])h.result+=Qu[l],h.position++;else if((K=Ff(l))>0){for(F=K,Q=0;F>0;F--)l=h.input.charCodeAt(++h.position),(K=Lf(l))>=0?Q=(Q<<4)+K:Xe(h,"expected hexadecimal character");h.result+=Bf(Q),h.position++}else Xe(h,"unknown escape sequence");E=L=h.position}else Gr(l)?(Fn(h,E,L,!0),sc(h,li(h,!1,w)),E=L=h.position):h.position===h.lineStart&&jo(h)?Xe(h,"unexpected end of the document within a double quoted scalar"):(h.position++,L=h.position)}Xe(h,"unexpected end of the stream within a double quoted scalar")}function $ f(h,w){var E=!0,L,F,Q,K=h.tag,l,le=h.anchor,W,Se,de,ge,ve, $ e=Object.create(null),Qe,Ke,Ye,st;if(st=h.input.charCodeAt(h.position),st===91)Se=93,ve=!1,l=[];else if(st===123)Se=125,ve=!0,l={};else return!1;for(h.anchor!==null&&(h.anchorMap[h.anchor]=l),st=h.input.charCodeAt(++h.position);st!==0;){if(li(h,!0,w),st=h.input.charCodeAt(h.position),st===Se)return h.position++,h.tag=K,h.anchor=le,h.kind=ve?"mapping":"sequence",h.result=l,!0;E?st===44&&Xe(h,"expected the node content, but found ','"):Xe(h,"missed comma between flow collection entries"),Ke=Qe=Ye=null,de=ge=!1,st===63&&(W=h.input.charCodeAt(h.position+1),ir(W)&&(de=ge=!0,h.position++,li(h,!0,w))),L=h.line,F=h.lineStart,Q=h.position,Ra(h,w,Vo,!1,!0),Ke=h.tag,Qe=h.result,li(h,!0,w),st=h.input.charCodeAt(h.position),(ge||h.line===L)&&st===58&&(de=!0,st=h.input.charCodeAt(++h.position),li(h,!0,w),Ra(h,w,Vo,!1,!0),Ye=h.result),ve?Fa(h,l, $ e,Ke,Qe,Ye,L,F,Q):de?l.push(Fa(h,null, $ e,Ke,Qe,Ye,L,F,Q)):l.push(Qe),li(h,!0,w),st=h.input.charCodeAt(h.position),st===44?(E=!0,st=h.input.charCodeAt(++h.position)):E=!1}Xe(h,"unexpected end of the stream within a flow collection")}function jf(h,w){var E,L,F=nc,Q=!1,K=!1,l=w,le=0,W=!1,Se,de;if(de=h.input.charCodeAt(h.position),de===124)L=!1;else if(de===62)L=!0;else return!1;for(h.kind="scalar",h.result="";de!==0;)if(de=h.input.charCodeAt(++h.position),de===43||de===45)nc===F?F=de===43?Gu:Mf:Xe(h,"repeat of a chomping mode identifier");else if((Se=Rf(de))>=0)Se===0?Xe(h,"bad explicit indentation width of a block scalar; it cannot be less than one"):K?Xe(h,"repeat of an indentation width identifier"):(l=w+Se-1,K=!0);else break;if(oa(de)){do de=h.input.charCodeAt(++h.position);while(oa(de));if(de===35)do de=h.input.charCod
2026-01-29 14:34:28 +01:00
` ,Q?1+le:le):F===nc&&Q&&(h.result+= `
` );break}for(L?oa(de)?(W=!0,h.result+=ci.repeat( `
` ,Q?1+le:le)):W?(W=!1,h.result+=ci.repeat( `
` ,le+1)):le===0?Q&&(h.result+=" "):h.result+=ci.repeat( `
` ,le):h.result+=ci.repeat( `
2026-01-29 15:10:32 +01:00
` ,Q?1+le:le),Q=!0,K=!0,le=0,E=h.position;!Gr(de)&&de!==0;)de=h.input.charCodeAt(++h.position);Fn(h,E,h.position,!1)}return!0}function rh(h,w){var E,L=h.tag,F=h.anchor,Q=[],K,l=!1,le;if(h.firstTabInLine!==-1)return!1;for(h.anchor!==null&&(h.anchorMap[h.anchor]=Q),le=h.input.charCodeAt(h.position);le!==0&&(h.firstTabInLine!==-1&&(h.position=h.firstTabInLine,Xe(h,"tab characters must not be used in indentation")),!(le!==45||(K=h.input.charCodeAt(h.position+1),!ir(K))));){if(l=!0,h.position++,li(h,!0,-1)&&h.lineIndent<=w){Q.push(null),le=h.input.charCodeAt(h.position);continue}if(E=h.line,Ra(h,w,Zu,!1,!0),Q.push(h.result),li(h,!0,-1),le=h.input.charCodeAt(h.position),(h.line===E||h.lineIndent>w)&&le!==0)Xe(h,"bad indentation of a sequence entry");else if(h.lineIndent<w)break}return l?(h.tag=L,h.anchor=F,h.kind="sequence",h.result=Q,!0):!1}function qf(h,w,E){var L,F,Q,K,l,le,W=h.tag,Se=h.anchor,de={},ge=Object.create(null),ve=null, $ e=null,Qe=null,Ke=!1,Ye=!1,st;if(h.firstTabInLine!==-1)return!1;for(h.anchor!==null&&(h.anchorMap[h.anchor]=de),st=h.input.charCodeAt(h.position);st!==0;){if(!Ke&&h.firstTabInLine!==-1&&(h.position=h.firstTabInLine,Xe(h,"tab characters must not be used in indentation")),L=h.input.charCodeAt(h.position+1),Q=h.line,(st===63||st===58)&&ir(L))st===63?(Ke&&(Fa(h,de,ge,ve, $ e,null,K,l,le),ve= $ e=Qe=null),Ye=!0,Ke=!0,F=!0):Ke?(Ke=!1,F=!0):Xe(h,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),h.position+=1,st=L;else{if(K=h.line,l=h.lineStart,le=h.position,!Ra(h,E,qu,!1,!0))break;if(h.line===Q){for(st=h.input.charCodeAt(h.position);oa(st);)st=h.input.charCodeAt(++h.position);if(st===58)st=h.input.charCodeAt(++h.position),ir(st)||Xe(h,"a whitespace character is expected after the key-value separator within a block mapping"),Ke&&(Fa(h,de,ge,ve, $ e,null,K,l,le),ve= $ e=Qe=null),Ye=!0,Ke=!1,F=!1,ve=h.tag, $ e=h.result;else if(Ye)Xe(h,"can not read an implicit mapping pair; a colon is missed");else return h.tag=W,h.anchor=Se,!0}else if(Ye)Xe(h,"can not read a block mapping entry; a multiline key may not be an implicit key");else return h.tag=W,h.anchor=Se,!0}if((h.line===Q||h.lineIndent>w)&&(Ke&&(K=h.line,l=h.lineStart,le=h.position),Ra(h,w,Uo,!0,F)&&(Ke? $ e=h.result:Qe=h.result),Ke||(Fa(h,de,ge,ve, $ e,Qe,K,l,le),ve= $ e=Qe=null),li(h,!0,-1),st=h.input.charCodeAt(h.position)),(h.line===Q||h.lineIndent>w)&&st!==0)Xe(h,"bad indentation of a mapping entry");else if(h.lineIndent<w)break}return Ke&&Fa(h,de,ge,ve, $ e,null,K,l,le),Ye&&(h.tag=W,h.anchor=Se,h.kind="mapping",h.result=de),Ye}function Zf(h){var w,E=!1,L=!1,F,Q,K;if(K=h.input.charCodeAt(h.position),K!==33)return!1;if(h.tag!==null&&Xe(h,"duplication of a tag property"),K=h.input.charCodeAt(++h.position),K===60?(E=!0,K=h.input.charCodeAt(++h.position)):K===33?(L=!0,F="!!",K=h.input.charCodeAt(++h.position)):F="!",w=h.position,E){do K=h.input.charCodeAt(++h.position);while(K!==0&&K!==62);h.position<h.length?(Q=h.input.slice(w,h.position),K=h.input.charCodeAt(++h.position)):Xe(h,"unexpected end of the stream within a verbatim tag")}else{for(;K!==0&&!ir(K);)K===33&&(L?Xe(h,"tag suffix cannot contain exclamation marks"):(F=h.input.slice(w-1,h.position+1),Hu.test(F)||Xe(h,"named tag handle cannot contain such characters"),L=!0,w=h.position+1)),K=h.input.charCodeAt(++h.position);Q=h.input.slice(w,h.position),Df.test(Q)&&Xe(h,"tag suffix cannot contain flow indicator characters")}Q&&!Wu.test(Q)&&Xe(h,"tag name cannot contain such characters: "+Q);try{Q=decodeURIComponent(Q)}catch{Xe(h,"tag name is malformed: "+Q)}return E?h.tag=Q:Ln.call(h.tagMap,F)?h.tag=h.tagMap[F]+Q:F==="!"?h.tag="!"+Q:F==="!!"?h.tag="tag:yaml.org,2002:"+Q:Xe(h,'undeclared tag handle "'+F+'"'),!0}function Gf(h){var w,E;if(E=h.input.charCodeAt(h.position),E!==38)return!1;for(h.anchor!==null&&Xe(h,"duplication of an anchor property"),E=h.input.charCodeAt(++h.position),w=h.position;E!==0&&!ir(E)&&!Da(E);)E=h.input.charCodeAt(++h.position);return h.position===w&&Xe(h,"name of an anchor node must contain at least one character"),h.anchor=h.input.slice(w,h.positi
` ),h.charCodeAt(0)===65279&&(h=h.slice(1)));var E=new Of(h,w),L=h.indexOf(" \0 ");for(L!==-1&&(E.position=L,Xe(E,"null byte is not allowed in input")),E.input+=" \0 ";E.input.charCodeAt(E.position)===32;)E.lineIndent+=1,E.position+=1;for(;E.position<E.length-1;)Wf(E);return E.documents}function Xf(h,w,E){w!==null&&typeof w=="object"&&typeof E>"u"&&(E=w,w=null);var L=nh(h,E);if(typeof w!="function")return L;for(var F=0,Q=L.length;F<Q;F+=1)w(L[F])}function Kf(h,w){var E=nh(h,w);if(E.length!==0){if(E.length===1)return E[0];throw new $ i("expected a single document in the stream, but found more")}}var Yf=Xf,Jf=Kf,ah={loadAll:Yf,load:Jf},sh=Object.prototype.toString,oh=Object.prototype.hasOwnProperty,oc=65279,Qf=9,ks=10,em=13,tm=32,im=33,rm=34,lc=35,nm=37,am=38,sm=39,om=42,lh=44,lm=45,qo=58,cm=61,um=62,hm=63,pm=64,ch=91,uh=93,dm=96,hh=123,fm=124,ph=125,Mi={};Mi[0]=" \\ 0",Mi[7]=" \\ a",Mi[8]=" \\ b",Mi[9]=" \\ t",Mi[10]=" \\ n",Mi[11]=" \\ v",Mi[12]=" \\ f",Mi[13]=" \\ r",Mi[27]=" \\ e",Mi[34]=' \\ "',Mi[92]=" \\ \\ ",Mi[133]=" \\ N",Mi[160]=" \\ _",Mi[8232]=" \\ L",Mi[8233]=" \\ P";var mm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],gm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?: \. [0-9_]*)? $ /;function _m(h,w){var E,L,F,Q,K,l,le;if(w===null)return{};for(E={},L=Object.keys(w),F=0,Q=L.length;F<Q;F+=1)K=L[F],l=String(w[K]),K.slice(0,2)==="!!"&&(K="tag:yaml.org,2002:"+K.slice(2)),le=h.compiledTypeMap.fallback[K],le&&oh.call(le.styleAliases,l)&&(l=le.styleAliases[l]),E[K]=l;return E}function ym(h){var w,E,L;if(w=h.toString(16).toUpperCase(),h<=255)E="x",L=2;else if(h<=65535)E="u",L=4;else if(h<=4294967295)E="U",L=8;else throw new $ i("code point within a string may not be greater than 0xFFFFFFFF");return" \\ "+E+ci.repeat("0",L-w.length)+w}var xm=1,Cs=2;function vm(h){this.schema=h.schema||rc,this.indent=Math.max(1,h.indent||2),this.noArrayIndent=h.noArrayIndent||!1,this.skipInvalid=h.skipInvalid||!1,this.flowLevel=ci.isNothing(h.flowLevel)?-1:h.flowLevel,this.styleMap=_m(this.schema,h.styles||null),this.sortKeys=h.sortKeys||!1,this.lineWidth=h.lineWidth||80,this.noRefs=h.noRefs||!1,this.noCompatMode=h.noCompatMode||!1,this.condenseFlow=h.condenseFlow||!1,this.quotingType=h.quotingType==='"'?Cs:xm,this.forceQuotes=h.forceQuotes||!1,this.replacer=typeof h.replacer=="function"?h.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function dh(h,w){for(var E=ci.repeat(" ",w),L=0,F=-1,Q="",K,l=h.length;L<l;)F=h.indexOf( `
2026-01-29 14:34:28 +01:00
` ,L),F===-1?(K=h.slice(L),L=l):(K=h.slice(L,F+1),L=F+1),K.length&&K!== `
` &&(Q+=E),Q+=K;return Q}function cc(h,w){return `
2026-01-29 15:10:32 +01:00
` +ci.repeat(" ",h.indent*w)}function bm(h,w){var E,L,F;for(E=0,L=h.implicitTypes.length;E<L;E+=1)if(F=h.implicitTypes[E],F.resolve(w))return!0;return!1}function Zo(h){return h===tm||h===Qf}function Es(h){return 32<=h&&h<=126||161<=h&&h<=55295&&h!==8232&&h!==8233||57344<=h&&h<=65533&&h!==oc||65536<=h&&h<=1114111}function fh(h){return Es(h)&&h!==oc&&h!==em&&h!==ks}function mh(h,w,E){var L=fh(h),F=L&&!Zo(h);return(E?L:L&&h!==lh&&h!==ch&&h!==uh&&h!==hh&&h!==ph)&&h!==lc&&!(w===qo&&!F)||fh(w)&&!Zo(w)&&h===lc||w===qo&&F}function wm(h){return Es(h)&&h!==oc&&!Zo(h)&&h!==lm&&h!==hm&&h!==qo&&h!==lh&&h!==ch&&h!==uh&&h!==hh&&h!==ph&&h!==lc&&h!==am&&h!==om&&h!==im&&h!==fm&&h!==cm&&h!==um&&h!==sm&&h!==rm&&h!==nm&&h!==pm&&h!==dm}function Sm(h){return!Zo(h)&&h!==qo}function Ms(h,w){var E=h.charCodeAt(w),L;return E>=55296&&E<=56319&&w+1<h.length&&(L=h.charCodeAt(w+1),L>=56320&&L<=57343)?(E-55296)*1024+L-56320+65536:E}function gh(h){var w=/^ \n * /;return w.test(h)}var _h=1,uc=2,yh=3,xh=4,Ba=5;function Tm(h,w,E,L,F,Q,K,l){var le,W=0,Se=null,de=!1,ge=!1,ve=L!==-1, $ e=-1,Qe=wm(Ms(h,0))&&Sm(Ms(h,h.length-1));if(w||K)for(le=0;le<h.length;W>=65536?le+=2:le++){if(W=Ms(h,le),!Es(W))return Ba;Qe=Qe&&mh(W,Se,l),Se=W}else{for(le=0;le<h.length;W>=65536?le+=2:le++){if(W=Ms(h,le),W===ks)de=!0,ve&&(ge=ge||le- $ e-1>L&&h[ $ e+1]!==" ", $ e=le);else if(!Es(W))return Ba;Qe=Qe&&mh(W,Se,l),Se=W}ge=ge||ve&&le- $ e-1>L&&h[ $ e+1]!==" "}return!de&&!ge?Qe&&!K&&!F(h)?_h:Q===Cs?Ba:uc:E>9&&gh(h)?Ba:K?Q===Cs?Ba:uc:ge?xh:yh}function Im(h,w,E,L,F){h.dump=(function(){if(w.length===0)return h.quotingType===Cs?'""':"''";if(!h.noCompatMode&&(mm.indexOf(w)!==-1||gm.test(w)))return h.quotingType===Cs?'"'+w+'"':"'"+w+"'";var Q=h.indent*Math.max(1,E),K=h.lineWidth===-1?-1:Math.max(Math.min(h.lineWidth,40),h.lineWidth-Q),l=L||h.flowLevel>-1&&E>=h.flowLevel;function le(W){return bm(h,W)}switch(Tm(w,l,h.indent,K,le,h.quotingType,h.forceQuotes&&!L,F)){case _h:return w;case uc:return"'"+w.replace(/'/g,"''")+"'";case yh:return"|"+vh(w,h.indent)+bh(dh(w,Q));case xh:return">"+vh(w,h.indent)+bh(dh(Am(w,K),Q));case Ba:return'"'+km(w)+'"';default:throw new $ i("impossible error: invalid scalar style")}})()}function vh(h,w){var E=gh(h)?String(w):"",L=h[h.length-1]=== `
2026-01-29 14:34:28 +01:00
` ,F=L&&(h[h.length-2]=== `
` ||h=== `
2026-01-29 14:08:40 +01:00
` ),Q=F?"+":L?"":"-";return E+Q+ `
2026-01-29 14:34:28 +01:00
` }function bh(h){return h[h.length-1]=== `
` ?h.slice(0,-1):h}function Am(h,w){for(var E=/( \n +)([^ \n ]*)/g,L=(function(){var W=h.indexOf( `
` );return W=W!==-1?W:h.length,E.lastIndex=W,wh(h.slice(0,W),w)})(),F=h[0]=== `
` ||h[0]===" ",Q,K;K=E.exec(h);){var l=K[1],le=K[2];Q=le[0]===" ",L+=l+(!F&&!Q&&le!==""? `
` :"")+wh(le,w),F=Q}return L}function wh(h,w){if(h===""||h[0]===" ")return h;for(var E=/ [^ ]/g,L,F=0,Q,K=0,l=0,le="";L=E.exec(h);)l=L.index,l-F>w&&(Q=K>F?K:l,le+= `
` +h.slice(F,Q),F=Q+1),K=l;return le+= `
` ,h.length-F>w&&K>F?le+=h.slice(F,K)+ `
2026-01-29 15:10:32 +01:00
` +h.slice(K+1):le+=h.slice(F),le.slice(1)}function km(h){for(var w="",E=0,L,F=0;F<h.length;E>=65536?F+=2:F++)E=Ms(h,F),L=Mi[E],!L&&Es(E)?(w+=h[F],E>=65536&&(w+=h[F+1])):w+=L||ym(E);return w}function Cm(h,w,E){var L="",F=h.tag,Q,K,l;for(Q=0,K=E.length;Q<K;Q+=1)l=E[Q],h.replacer&&(l=h.replacer.call(E,String(Q),l)),(un(h,w,l,!1,!1)||typeof l>"u"&&un(h,w,null,!1,!1))&&(L!==""&&(L+=","+(h.condenseFlow?"":" ")),L+=h.dump);h.tag=F,h.dump="["+L+"]"}function Sh(h,w,E,L){var F="",Q=h.tag,K,l,le;for(K=0,l=E.length;K<l;K+=1)le=E[K],h.replacer&&(le=h.replacer.call(E,String(K),le)),(un(h,w+1,le,!0,!0,!1,!0)||typeof le>"u"&&un(h,w+1,null,!0,!0,!1,!0))&&((!L||F!=="")&&(F+=cc(h,w)),h.dump&&ks===h.dump.charCodeAt(0)?F+="-":F+="- ",F+=h.dump);h.tag=Q,h.dump=F||"[]"}function Em(h,w,E){var L="",F=h.tag,Q=Object.keys(E),K,l,le,W,Se;for(K=0,l=Q.length;K<l;K+=1)Se="",L!==""&&(Se+=", "),h.condenseFlow&&(Se+='"'),le=Q[K],W=E[le],h.replacer&&(W=h.replacer.call(E,le,W)),un(h,w,le,!1,!1)&&(h.dump.length>1024&&(Se+="? "),Se+=h.dump+(h.condenseFlow?'"':"")+":"+(h.condenseFlow?"":" "),un(h,w,W,!1,!1)&&(Se+=h.dump,L+=Se));h.tag=F,h.dump="{"+L+"}"}function Mm(h,w,E,L){var F="",Q=h.tag,K=Object.keys(E),l,le,W,Se,de,ge;if(h.sortKeys===!0)K.sort();else if(typeof h.sortKeys=="function")K.sort(h.sortKeys);else if(h.sortKeys)throw new $ i("sortKeys must be a boolean or a function");for(l=0,le=K.length;l<le;l+=1)ge="",(!L||F!=="")&&(ge+=cc(h,w)),W=K[l],Se=E[W],h.replacer&&(Se=h.replacer.call(E,W,Se)),un(h,w+1,W,!0,!0,!0)&&(de=h.tag!==null&&h.tag!=="?"||h.dump&&h.dump.length>1024,de&&(h.dump&&ks===h.dump.charCodeAt(0)?ge+="?":ge+="? "),ge+=h.dump,de&&(ge+=cc(h,w)),un(h,w+1,Se,!0,de)&&(h.dump&&ks===h.dump.charCodeAt(0)?ge+=":":ge+=": ",ge+=h.dump,F+=ge));h.tag=Q,h.dump=F||"{}"}function Th(h,w,E){var L,F,Q,K,l,le;for(F=E?h.explicitTypes:h.implicitTypes,Q=0,K=F.length;Q<K;Q+=1)if(l=F[Q],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof w=="object"&&w instanceof l.instanceOf)&&(!l.predicate||l.predicate(w))){if(E?l.multi&&l.representName?h.tag=l.representName(w):h.tag=l.tag:h.tag="?",l.represent){if(le=h.styleMap[l.tag]||l.defaultStyle,sh.call(l.represent)==="[object Function]")L=l.represent(w,le);else if(oh.call(l.represent,le))L=l.represent[le](w,le);else throw new $ i("!<"+l.tag+'> tag resolver accepts not "'+le+'" style');h.dump=L}return!0}return!1}function un(h,w,E,L,F,Q,K){h.tag=null,h.dump=E,Th(h,E,!1)||Th(h,E,!0);var l=sh.call(h.dump),le=L,W;L&&(L=h.flowLevel<0||h.flowLevel>w);var Se=l==="[object Object]"||l==="[object Array]",de,ge;if(Se&&(de=h.duplicates.indexOf(E),ge=de!==-1),(h.tag!==null&&h.tag!=="?"||ge||h.indent!==2&&w>0)&&(F=!1),ge&&h.usedDuplicates[de])h.dump="*ref_"+de;else{if(Se&&ge&&!h.usedDuplicates[de]&&(h.usedDuplicates[de]=!0),l==="[object Object]")L&&Object.keys(h.dump).length!==0?(Mm(h,w,h.dump,F),ge&&(h.dump="&ref_"+de+h.dump)):(Em(h,w,h.dump),ge&&(h.dump="&ref_"+de+" "+h.dump));else if(l==="[object Array]")L&&h.dump.length!==0?(h.noArrayIndent&&!K&&w>0?Sh(h,w-1,h.dump,F):Sh(h,w,h.dump,F),ge&&(h.dump="&ref_"+de+h.dump)):(Cm(h,w,h.dump),ge&&(h.dump="&ref_"+de+" "+h.dump));else if(l==="[object String]")h.tag!=="?"&&Im(h,h.dump,w,Q,le);else{if(l==="[object Undefined]")return!1;if(h.skipInvalid)return!1;throw new $ i("unacceptable kind of an object to dump "+l)}h.tag!==null&&h.tag!=="?"&&(W=encodeURI(h.tag[0]==="!"?h.tag.slice(1):h.tag).replace(/!/g,"%21"),h.tag[0]==="!"?W="!"+W:W.slice(0,18)==="tag:yaml.org,2002:"?W="!!"+W.slice(18):W="!<"+W+">",h.dump=W+" "+h.dump)}return!0}function Pm(h,w){var E=[],L=[],F,Q;for(hc(h,E,L),F=0,Q=L.length;F<Q;F+=1)w.duplicates.push(E[L[F]]);w.usedDuplicates=new Array(Q)}function hc(h,w,E){var L,F,Q;if(h!==null&&typeof h=="object")if(F=w.indexOf(h),F!==-1)E.indexOf(F)===-1&&E.push(F);else if(w.push(h),Array.isArray(h))for(F=0,Q=h.length;F<Q;F+=1)hc(h[F],w,E);else for(L=Object.keys(h),F=0,Q=L.length;F<Q;F+=1)hc(h[L[F]],w,E)}function zm(h,w){w=w||{};var E=new vm(w);E.noRefs||Pm(h,E);var L=h;return E.replacer&&(L=E.replacer.call({"":L},"",L)),un(E,0,L,!0,!0)?E.dump+ `
` :""}var Dm=zm,Lm={dump:Dm};function pc(h,w){return function(){throw new Error("Function yaml."+h+" is removed in js-yaml 4. Use yaml."+w+" instead, which is now safe by default.")}}var Fm=bi,Rm=Iu,Bm=Eu,Om=Lu,Nm=Fu,Vm=rc,Um=ah.load, $ m=ah.loadAll,jm=Lm.dump,qm= $ i,Zm={binary:Vu,float:Du,map:Cu,null:Mu,pairs: $ u,set:ju,timestamp:Ou,bool:Pu,int:zu,merge:Nu,omap:Uu,seq:ku,str:Au},Gm=pc("safeLoad","load"),Hm=pc("safeLoadAll","loadAll"),Wm=pc("safeDump","dump"),Ih={Type:Fm,Schema:Rm,FAILSAFE_SCHEMA:Bm,JSON_SCHEMA:Om,CORE_SCHEMA:Nm,DEFAULT_SCHEMA:Vm,load:Um,loadAll: $ m,dump:jm,YAMLException:qm,types:Zm,safeLoad:Gm,safeLoadAll:Hm,safeDump:Wm};function Xm(h={}){const{defaultCenter:w={lat:43.836699,lon:4.360054},defaultZoom:E=13,onSave:L=()=>{}}=h,F=Vue.ref({...w}),Q=Vue.ref(E),K=Vue.ref(null);Vue.onBeforeUnmount(()=>{K.value&&clearTimeout(K.value)});function l(Se){if(!Se||Se.trim()==="")return null;try{const de=Ih.load(Se);if(de)return de.center&&(F.value={lat:de.center.lat,lon:de.center.lon}),de.zoom!==void 0&&(Q.value=de.zoom),de}catch(de){return console.error("Error loading map data:",de),null}return null}function le(){const Se={background:{type:"osm"},center:{lat:F.value.lat,lon:F.value.lon},zoom:Q.value},de=Ih.dump(Se,{indent:2,lineWidth:-1,noRefs:!0});return L(de),de}function W(Se=300){K.value&&clearTimeout(K.value),K.value=setTimeout(()=>{le()},Se)}return{center:F,zoom:Q,loadMapData:l,saveMapData:le,debouncedSave:W}}const Km={components:{MapPreview:md,MarkerList:kd},props:{value:String,name:String,label:String,help:String,disabled:Boolean,defaultCenter:{type:Array,default:()=>[43.836699,4.360054]},defaultZoom:{type:Number,default:13},maxMarkers:{type:Number,default:50},mode:{type:String,default:"multi",validator:h=>["multi","single"].includes(h)},latitude:{type:[Number,String],default:null},longitude:{type:[Number,String],default:null}},setup(h,{emit:w}){const E=Vue.ref(!1),L=Vue.ref(null),F=Vue.ref(null),Q=Vue.computed(()=>{var nt;if(h.mode==="single")return null;const Ve=window.location.pathname.match(/ \/ panel \/ pages \/ (.+)/);if(Ve)return Ve[1].replace(/ \+ /g,"/");const it=(nt=h.name)==null?void 0:nt.match(/pages \/ ([^/]+)/);return it?it[1].replace(/ \+ /g,"/"):(console.warn("Could not extract page ID, using default"),"map/carte")}),K=h.mode==="multi"?Cd(Q.value):{markers:Vue.ref([]),loading:Vue.ref(!1),error:Vue.ref(null)},{center:l,zoom:le,loadMapData:W,debouncedSave:Se}=Xm({defaultCenter:{lat:h.defaultCenter[0],lon:h.defaultCenter[1]},defaultZoom:h.defaultZoom,onSave:Ve=>w("input",Ve)}),de=Vue.computed(()=>{if(h.mode==="single"){const Ve=ve.value,it= $ e.value;return!isNaN(Ve)&&!isNaN(it)&&Ve!==null&&it!==null&&Ve!==0&&it!==0?[{id:"single-marker",position:{lat:Ve,lon:it},title:"Current position"}]:[]}return K.markers.value}),ge=Vue.computed(()=>h.mode==="single"?!1:de.value.length<h.maxMarkers),ve=Vue.ref(null), $ e=Vue.ref(null);function Qe(){const Ve=document.querySelector(".k-form");if(!Ve)return{lat:null,lon:null};const it=Ve.querySelector('input[name*="latitude"]'),nt=Ve.querySelector('input[name*="longitude"]');return{lat:it?parseFloat(it.value):null,lon:nt?parseFloat(nt.value):null}}Vue.onMounted(async()=>{if(h.mode==="multi")try{await K.fetchMarkers()}catch(Ve){console.error("Failed to load markers:",Ve)}else if(h.mode==="single"){const Ve=Qe();ve.value=Ve.lat, $ e.value=Ve.lon,!isNaN(Ve.lat)&&!isNaN(Ve.lon)&&Ve.lat!==0&&Ve.lon!==0&&(l.value={lat:Ve.lat,lon:Ve.lon});const it=document.querySelector(".k-form");if(it){it.addEventListener("input",Vt=>{if(Vt.target.name&&(Vt.target.name.includes("latitude")||Vt.target.name.includes("longitude"))){const qi=Qe();ve.value=qi.lat, $ e.value=qi.lon}});const nt=it.querySelector('input[name*="latitude"]'),ji=it.querySelector('input[name*="longitude"]');if(nt&&ji){const Vt=new MutationObserver(()=>{const Dt=Qe();(Dt.lat!==ve.value||Dt.lon!== $ e.value)&&(ve.value=Dt.lat, $ e.value=Dt.lon)});Vt.observe(nt,{attributes:!0,attributeFilter:["value"]}),Vt.observe(ji,{attributes:!0,attributeFilter:["value"]});const qi=setInterval(()=>{const Dt=Qe();(Dt.lat!==ve.value||Dt.lon!== $ e.value)&&(ve.value