@tomtom-org/maps-sdk 0.31.1 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/core/dist/core.es.js +1 -1
- package/core/package.json +7 -4
- package/map/dist/THIRD_PARTY.txt +1 -1
- package/map/dist/index.d.ts +50 -104
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/map/package.json +7 -4
- package/package.json +1 -4
- package/services/dist/index.d.ts +14 -18
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
- package/services/package.json +7 -4
- package/core/dist/core.cjs.js +0 -530
- package/core/dist/core.cjs.js.map +0 -1
- package/core/dist/core.cjs.min.js +0 -2
- package/core/dist/core.cjs.min.js.map +0 -1
- package/core/main.js +0 -6
- package/map/dist/map.cjs.js +0 -7510
- package/map/dist/map.cjs.js.map +0 -1
- package/map/dist/map.cjs.min.js +0 -2
- package/map/dist/map.cjs.min.js.map +0 -1
- package/map/main.js +0 -6
- package/services/dist/services.cjs.js +0 -5059
- package/services/dist/services.cjs.js.map +0 -1
- package/services/dist/services.cjs.min.js +0 -2
- package/services/dist/services.cjs.min.js.map +0 -1
- package/services/main.js +0 -6
package/map/dist/map.cjs.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@tomtom-org/maps-sdk/core"),t=require("maplibre-gl");var r="object"==typeof global&&global&&global.Object===Object&&global,i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")(),s=o.Symbol,n=Object.prototype,a=n.hasOwnProperty,l=n.toString,c=s?s.toStringTag:void 0;var u=Object.prototype.toString;var h=s?s.toStringTag:void 0;function p(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":h&&h in Object(e)?function(e){var t=a.call(e,c),r=e[c];try{e[c]=void 0;var i=!0}catch(e){}var o=l.call(e);return i&&(t?e[c]=r:delete e[c]),o}(e):function(e){return u.call(e)}(e)}function d(e){return null!=e&&"object"==typeof e}function f(e){return"symbol"==typeof e||d(e)&&"[object Symbol]"==p(e)}function y(e,t){for(var r=-1,i=null==e?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}var g=Array.isArray,m=s?s.prototype:void 0,b=m?m.toString:void 0;function _(e){if("string"==typeof e)return e;if(g(e))return y(e,_)+"";if(f(e))return b?b.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function L(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function v(e){return e}function I(e){if(!L(e))return!1;var t=p(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var S,A=o["__core-js_shared__"],w=(S=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"";var E=Function.prototype.toString;function O(e){if(null!=e){try{return E.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var R=/^\[object .+?Constructor\]$/,T=Function.prototype,M=Object.prototype,x=T.toString,C=M.hasOwnProperty,D=RegExp("^"+x.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function P(e){return!(!L(e)||(t=e,w&&w in t))&&(I(e)?D:R).test(O(e));var t}function N(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return P(r)?r:void 0}var F=N(o,"WeakMap");var j=Date.now;var W,U,k,H=function(){try{var e=N(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),G=H?function(e,t){return H(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:v,z=(W=G,U=0,k=0,function(){var e=j(),t=16-(e-k);if(k=e,t>0){if(++U>=800)return arguments[0]}else U=0;return W.apply(void 0,arguments)});var V=/^(?:0|[1-9]\d*)$/;function B(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&V.test(e))&&e>-1&&e%1==0&&e<t}function $(e,t,r){"__proto__"==t&&H?H(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Y(e,t){return e===t||e!=e&&t!=t}var K=Object.prototype.hasOwnProperty;function q(e,t,r){var i=e[t];K.call(e,t)&&Y(i,r)&&(void 0!==r||t in e)||$(e,t,r)}var X=Math.max;function Z(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function J(e){return null!=e&&Z(e.length)&&!I(e)}var Q=Object.prototype;function ee(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Q)}function te(e){return d(e)&&"[object Arguments]"==p(e)}var re=Object.prototype,ie=re.hasOwnProperty,oe=re.propertyIsEnumerable,se=te(function(){return arguments}())?te:function(e){return d(e)&&ie.call(e,"callee")&&!oe.call(e,"callee")};var ne="object"==typeof exports&&exports&&!exports.nodeType&&exports,ae=ne&&"object"==typeof module&&module&&!module.nodeType&&module,le=ae&&ae.exports===ne?o.Buffer:void 0,ce=(le?le.isBuffer:void 0)||function(){return!1},ue={};function he(e){return function(t){return e(t)}}ue["[object Float32Array]"]=ue["[object Float64Array]"]=ue["[object Int8Array]"]=ue["[object Int16Array]"]=ue["[object Int32Array]"]=ue["[object Uint8Array]"]=ue["[object Uint8ClampedArray]"]=ue["[object Uint16Array]"]=ue["[object Uint32Array]"]=!0,ue["[object Arguments]"]=ue["[object Array]"]=ue["[object ArrayBuffer]"]=ue["[object Boolean]"]=ue["[object DataView]"]=ue["[object Date]"]=ue["[object Error]"]=ue["[object Function]"]=ue["[object Map]"]=ue["[object Number]"]=ue["[object Object]"]=ue["[object RegExp]"]=ue["[object Set]"]=ue["[object String]"]=ue["[object WeakMap]"]=!1;var pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,de=pe&&"object"==typeof module&&module&&!module.nodeType&&module,fe=de&&de.exports===pe&&r.process,ye=function(){try{var e=de&&de.require&&de.require("util").types;return e||fe&&fe.binding&&fe.binding("util")}catch(e){}}(),ge=ye&&ye.isTypedArray,me=ge?he(ge):function(e){return d(e)&&Z(e.length)&&!!ue[p(e)]},be=Object.prototype.hasOwnProperty;function _e(e,t){var r=g(e),i=!r&&se(e),o=!r&&!i&&ce(e),s=!r&&!i&&!o&&me(e),n=r||i||o||s,a=n?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],l=a.length;for(var c in e)!t&&!be.call(e,c)||n&&("length"==c||o&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||B(c,l))||a.push(c);return a}function Le(e,t){return function(r){return e(t(r))}}var ve=Le(Object.keys,Object),Ie=Object.prototype.hasOwnProperty;function Se(e){if(!ee(e))return ve(e);var t=[];for(var r in Object(e))Ie.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Ae(e){return J(e)?_e(e):Se(e)}var we=Object.prototype.hasOwnProperty;function Ee(e){if(!L(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=ee(e),r=[];for(var i in e)("constructor"!=i||!t&&we.call(e,i))&&r.push(i);return r}function Oe(e){return J(e)?_e(e,!0):Ee(e)}var Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Te=/^\w*$/;function Me(e,t){if(g(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!f(e))||(Te.test(e)||!Re.test(e)||null!=t&&e in Object(t))}var xe=N(Object,"create");var Ce=Object.prototype.hasOwnProperty;var De=Object.prototype.hasOwnProperty;function Pe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Ne(e,t){for(var r=e.length;r--;)if(Y(e[r][0],t))return r;return-1}Pe.prototype.clear=function(){this.__data__=xe?xe(null):{},this.size=0},Pe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Pe.prototype.get=function(e){var t=this.__data__;if(xe){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return Ce.call(t,e)?t[e]:void 0},Pe.prototype.has=function(e){var t=this.__data__;return xe?void 0!==t[e]:De.call(t,e)},Pe.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=xe&&void 0===t?"__lodash_hash_undefined__":t,this};var Fe=Array.prototype.splice;function je(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}je.prototype.clear=function(){this.__data__=[],this.size=0},je.prototype.delete=function(e){var t=this.__data__,r=Ne(t,e);return!(r<0)&&(r==t.length-1?t.pop():Fe.call(t,r,1),--this.size,!0)},je.prototype.get=function(e){var t=this.__data__,r=Ne(t,e);return r<0?void 0:t[r][1]},je.prototype.has=function(e){return Ne(this.__data__,e)>-1},je.prototype.set=function(e,t){var r=this.__data__,i=Ne(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var We=N(o,"Map");function Ue(e,t){var r,i,o=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function ke(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}ke.prototype.clear=function(){this.size=0,this.__data__={hash:new Pe,map:new(We||je),string:new Pe}},ke.prototype.delete=function(e){var t=Ue(this,e).delete(e);return this.size-=t?1:0,t},ke.prototype.get=function(e){return Ue(this,e).get(e)},ke.prototype.has=function(e){return Ue(this,e).has(e)},ke.prototype.set=function(e,t){var r=Ue(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this};function He(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var i=arguments,o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);var n=e.apply(this,i);return r.cache=s.set(o,n)||s,n};return r.cache=new(He.Cache||ke),r}He.Cache=ke;var Ge=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ze=/\\(\\)?/g,Ve=function(e){var t=He(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ge,function(e,r,i,o){t.push(i?o.replace(ze,"$1"):r||e)}),t});function Be(e,t){return g(e)?e:Me(e,t)?[e]:Ve(function(e){return null==e?"":_(e)}(e))}function $e(e){if("string"==typeof e||f(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ye(e,t){for(var r=0,i=(t=Be(t,e)).length;null!=e&&r<i;)e=e[$e(t[r++])];return r&&r==i?e:void 0}function Ke(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}var qe=s?s.isConcatSpreadable:void 0;function Xe(e){return g(e)||se(e)||!!(qe&&e&&e[qe])}function Ze(e){return(null==e?0:e.length)?function(e,t,r,i,o){var s=-1,n=e.length;for(r||(r=Xe),o||(o=[]);++s<n;){var a=e[s];r(a)?Ke(o,a):o[o.length]=a}return o}(e):[]}var Je=Le(Object.getPrototypeOf,Object),Qe=Function.prototype,et=Object.prototype,tt=Qe.toString,rt=et.hasOwnProperty,it=tt.call(Object);function ot(e){var t=this.__data__=new je(e);this.size=t.size}ot.prototype.clear=function(){this.__data__=new je,this.size=0},ot.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ot.prototype.get=function(e){return this.__data__.get(e)},ot.prototype.has=function(e){return this.__data__.has(e)},ot.prototype.set=function(e,t){var r=this.__data__;if(r instanceof je){var i=r.__data__;if(!We||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new ke(i)}return r.set(e,t),this.size=r.size,this};var st="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=st&&"object"==typeof module&&module&&!module.nodeType&&module,at=nt&&nt.exports===st?o.Buffer:void 0;function lt(){return[]}at&&at.allocUnsafe;var ct=Object.prototype.propertyIsEnumerable,ut=Object.getOwnPropertySymbols,ht=ut?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,i=null==e?0:e.length,o=0,s=[];++r<i;){var n=e[r];t(n,r,e)&&(s[o++]=n)}return s}(ut(e),function(t){return ct.call(e,t)}))}:lt,pt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ke(t,ht(e)),e=Je(e);return t}:lt;function dt(e,t,r){var i=t(e);return g(e)?i:Ke(i,r(e))}function ft(e){return dt(e,Ae,ht)}function yt(e){return dt(e,Oe,pt)}var gt=N(o,"DataView"),mt=N(o,"Promise"),bt=N(o,"Set"),_t="[object Map]",Lt="[object Promise]",vt="[object Set]",It="[object WeakMap]",St="[object DataView]",At=O(gt),wt=O(We),Et=O(mt),Ot=O(bt),Rt=O(F),Tt=p;(gt&&Tt(new gt(new ArrayBuffer(1)))!=St||We&&Tt(new We)!=_t||mt&&Tt(mt.resolve())!=Lt||bt&&Tt(new bt)!=vt||F&&Tt(new F)!=It)&&(Tt=function(e){var t=p(e),r="[object Object]"==t?e.constructor:void 0,i=r?O(r):"";if(i)switch(i){case At:return St;case wt:return _t;case Et:return Lt;case Ot:return vt;case Rt:return It}return t});var Mt=Object.prototype.hasOwnProperty;var xt=o.Uint8Array;function Ct(e){var t=new e.constructor(e.byteLength);return new xt(t).set(new xt(e)),t}var Dt=/\w*$/;var Pt=s?s.prototype:void 0,Nt=Pt?Pt.valueOf:void 0;function Ft(e,t,r){var i,o,s,n,a,l=e.constructor;switch(t){case"[object ArrayBuffer]":return Ct(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return a=Ct((n=e).buffer),new n.constructor(a,n.byteOffset,n.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=Ct(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return(s=new(o=e).constructor(o.source,Dt.exec(o))).lastIndex=o.lastIndex,s;case"[object Symbol]":return i=e,Nt?Object(Nt.call(i)):{}}}var jt=ye&&ye.isMap,Wt=jt?he(jt):function(e){return d(e)&&"[object Map]"==Tt(e)};var Ut=ye&&ye.isSet,kt=Ut?he(Ut):function(e){return d(e)&&"[object Set]"==Tt(e)},Ht="[object Arguments]",Gt="[object Function]",zt="[object Object]",Vt={};function Bt(e,t,r,i,o,s){var n;if(r&&(n=o?r(e,i,o,s):r(e)),void 0!==n)return n;if(!L(e))return e;var a=g(e);if(a)n=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Mt.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e);else{var l=Tt(e),c=l==Gt||"[object GeneratorFunction]"==l;if(ce(e))return e.slice();if(l==zt||l==Ht||c&&!o)n={};else{if(!Vt[l])return o?e:{};n=Ft(e,l)}}s||(s=new ot);var u=s.get(e);if(u)return u;s.set(e,n),kt(e)?e.forEach(function(i){n.add(Bt(i,t,r,i,e,s))}):Wt(e)&&e.forEach(function(i,o){n.set(o,Bt(i,t,r,o,e,s))});var h=a?void 0:yt(e);return function(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););}(h||e,function(i,o){h&&(i=e[o=i]),q(n,o,Bt(i,t,r,o,e,s))}),n}Vt[Ht]=Vt["[object Array]"]=Vt["[object ArrayBuffer]"]=Vt["[object DataView]"]=Vt["[object Boolean]"]=Vt["[object Date]"]=Vt["[object Float32Array]"]=Vt["[object Float64Array]"]=Vt["[object Int8Array]"]=Vt["[object Int16Array]"]=Vt["[object Int32Array]"]=Vt["[object Map]"]=Vt["[object Number]"]=Vt[zt]=Vt["[object RegExp]"]=Vt["[object Set]"]=Vt["[object String]"]=Vt["[object Symbol]"]=Vt["[object Uint8Array]"]=Vt["[object Uint8ClampedArray]"]=Vt["[object Uint16Array]"]=Vt["[object Uint32Array]"]=!0,Vt["[object Error]"]=Vt[Gt]=Vt["[object WeakMap]"]=!1;function $t(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new ke;++t<r;)this.add(e[t])}function Yt(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}$t.prototype.add=$t.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},$t.prototype.has=function(e){return this.__data__.has(e)};function Kt(e,t,r,i,o,s){var n=1&r,a=e.length,l=t.length;if(a!=l&&!(n&&l>a))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,p=!0,d=2&r?new $t:void 0;for(s.set(e,t),s.set(t,e);++h<a;){var f=e[h],y=t[h];if(i)var g=n?i(y,f,h,t,e,s):i(f,y,h,e,t,s);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!Yt(t,function(e,t){if(n=t,!d.has(n)&&(f===e||o(f,e,r,i,s)))return d.push(t);var n})){p=!1;break}}else if(f!==y&&!o(f,y,r,i,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function qt(e){var t=-1,r=Array(e.size);return e.forEach(function(e,i){r[++t]=[i,e]}),r}function Xt(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var Zt=s?s.prototype:void 0,Jt=Zt?Zt.valueOf:void 0;var Qt=Object.prototype.hasOwnProperty;var er="[object Arguments]",tr="[object Array]",rr="[object Object]",ir=Object.prototype.hasOwnProperty;function or(e,t,r,i,o,s){var n=g(e),a=g(t),l=n?tr:Tt(e),c=a?tr:Tt(t),u=(l=l==er?rr:l)==rr,h=(c=c==er?rr:c)==rr,p=l==c;if(p&&ce(e)){if(!ce(t))return!1;n=!0,u=!1}if(p&&!u)return s||(s=new ot),n||me(e)?Kt(e,t,r,i,o,s):function(e,t,r,i,o,s,n){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new xt(e),new xt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Y(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=qt;case"[object Set]":var l=1&i;if(a||(a=Xt),e.size!=t.size&&!l)return!1;var c=n.get(e);if(c)return c==t;i|=2,n.set(e,t);var u=Kt(a(e),a(t),i,o,s,n);return n.delete(e),u;case"[object Symbol]":if(Jt)return Jt.call(e)==Jt.call(t)}return!1}(e,t,l,r,i,o,s);if(!(1&r)){var d=u&&ir.call(e,"__wrapped__"),f=h&&ir.call(t,"__wrapped__");if(d||f){var y=d?e.value():e,m=f?t.value():t;return s||(s=new ot),o(y,m,r,i,s)}}return!!p&&(s||(s=new ot),function(e,t,r,i,o,s){var n=1&r,a=ft(e),l=a.length;if(l!=ft(t).length&&!n)return!1;for(var c=l;c--;){var u=a[c];if(!(n?u in t:Qt.call(t,u)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var d=!0;s.set(e,t),s.set(t,e);for(var f=n;++c<l;){var y=e[u=a[c]],g=t[u];if(i)var m=n?i(g,y,u,t,e,s):i(y,g,u,e,t,s);if(!(void 0===m?y===g||o(y,g,r,i,s):m)){d=!1;break}f||(f="constructor"==u)}if(d&&!f){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(d=!1)}return s.delete(e),s.delete(t),d}(e,t,r,i,o,s))}function sr(e,t,r,i,o){return e===t||(null==e||null==t||!d(e)&&!d(t)?e!=e&&t!=t:or(e,t,r,i,sr,o))}function nr(e){return e==e&&!L(e)}function ar(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function lr(e){var t=function(e){for(var t=Ae(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,nr(o)]}return t}(e);return 1==t.length&&t[0][2]?ar(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,i){var o=r.length,s=o;if(null==e)return!s;for(e=Object(e);o--;){var n=r[o];if(n[2]?n[1]!==e[n[0]]:!(n[0]in e))return!1}for(;++o<s;){var a=(n=r[o])[0],l=e[a],c=n[1];if(n[2]){if(void 0===l&&!(a in e))return!1}else if(!sr(c,l,3,i,new ot))return!1}return!0}(r,0,t)}}function cr(e,t){return null!=e&&t in Object(e)}function ur(e,t){return null!=e&&function(e,t,r){for(var i=-1,o=(t=Be(t,e)).length,s=!1;++i<o;){var n=$e(t[i]);if(!(s=null!=e&&r(e,n)))break;e=e[n]}return s||++i!=o?s:!!(o=null==e?0:e.length)&&Z(o)&&B(n,o)&&(g(e)||se(e))}(e,t,cr)}function hr(e,t){return Me(e)&&nr(t)?ar($e(e),t):function(r){var i=function(e,t,r){var i=null==e?void 0:Ye(e,t);return void 0===i?r:i}(r,e);return void 0===i&&i===t?ur(r,e):sr(t,i,3)}}function pr(e){return Me(e)?(t=$e(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Ye(t,e)}}(e);var t}function dr(e){return"function"==typeof e?e:null==e?v:"object"==typeof e?g(e)?hr(e[0],e[1]):lr(e):pr(e)}function fr(e,t){return t.length<2?e:Ye(e,function(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(o);++i<o;)s[i]=e[i+t];return s}(t,0,-1))}var yr=Object.prototype.hasOwnProperty;function gr(e){if(null==e)return!0;if(J(e)&&(g(e)||"string"==typeof e||"function"==typeof e.splice||ce(e)||me(e)||se(e)))return!e.length;var t=Tt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ee(e))return!Se(e).length;for(var r in e)if(yr.call(e,r))return!1;return!0}function mr(e,t){return sr(e,t)}function br(e){return null==e}function _r(e,t){return null==(e=fr(e,t=Be(t,e)))||delete e[$e((r=t,i=null==r?0:r.length,i?r[i-1]:void 0))];var r,i}function Lr(e){return function(e){if(!d(e)||"[object Object]"!=p(e))return!1;var t=Je(e);if(null===t)return!0;var r=rt.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&tt.call(r)==it}(e)?void 0:e}var vr=function(e){return z(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,s=X(i.length-t,0),n=Array(s);++o<s;)n[o]=i[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=i[o];return a[t]=r(n),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(e,void 0,Ze),e+"")}(function(e,t){var r={};if(null==e)return r;var i=!1;t=y(t,function(t){return t=Be(t,e),i||(i=t.length>1),t}),function(e,t,r){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var n=t[o],a=void 0;void 0===a&&(a=e[n]),i?$(r,n,a):q(r,n,a)}}(e,yt(e),r),i&&(r=Bt(r,7,Lr));for(var o=t.length;o--;)_r(r,t[o]);return r});function Ir(e,t,r,i){if(!L(e))return e;for(var o=-1,s=(t=Be(t,e)).length,n=s-1,a=e;null!=a&&++o<s;){var l=$e(t[o]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=n){var u=a[l];void 0===(c=void 0)&&(c=L(u)?u:B(t[o+1])?[]:{})}q(a,l,c),a=a[l]}return e}function Sr(e,t){if(null==e)return{};var r=y(yt(e),function(e){return[e]});return t=dr(t),function(e,t,r){for(var i=-1,o=t.length,s={};++i<o;){var n=t[i],a=Ye(e,n);r(a,n)&&Ir(s,Be(n,e),a)}return s}(e,r,function(e,r){return t(e,r[0])})}function Ar(e,t){return Sr(e,function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}(dr(t)))}var wr=Array.prototype.splice;function Er(e,t){var r=[];if(!e||!e.length)return r;var i=-1,o=[],s=e.length;for(t=dr(t);++i<s;){var n=e[i];t(n,i,e)&&(r.push(n),o.push(i))}return function(e,t){for(var r=e?t.length:0,i=r-1;r--;){var o=t[r];if(r==i||o!==s){var s=o;B(o)?wr.call(e,o,1):_r(e,o)}}}(e,o),r}const Or=()=>"undefined"!=typeof document&&"undefined"!=typeof DOMParser&&"undefined"!=typeof btoa,Rr=e=>{if(!Or())return;const t=document.createElement("img");return t.src=`data:image/svg+xml;base64,${btoa((new XMLSerializer).serializeToString(e))}`,t},Tr=e=>(new DOMParser).parseFromString(e,"image/svg+xml").documentElement,Mr=e=>{const t=Tr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path id="background" d="M63.95 137.516c6.556-12.737 19.098-21.09 30.828-29.388C110.046 97.324 120 79.603 120 59.574 120 26.671 93.138 0 60 0S0 26.671 0 59.574c0 20.029 9.954 37.75 25.22 48.55 11.734 8.302 24.274 16.652 30.83 29.388 1.706 3.316 6.194 3.316 7.9 0z"\n fill="#1988cf"/>\n <path id="outline" d="M91.298 103.272C105.052 93.544 114 77.596 114 59.574c0-29.61-24.176-53.617-54-53.617S6 29.964 6 59.574c0 18.022 8.95 33.97 22.7 43.698l2.27 1.601c10.172 7.153 21.922 15.423 29.03 27.416 7.104-11.993 18.858-20.259 29.03-27.416l2.268-1.601zm1.468 6.274c-11.13 7.845-22.632 15.957-28.816 27.966-1.706 3.316-6.194 3.316-7.9 0-6.182-12.009-17.686-20.121-28.816-27.966l-2.016-1.422C9.954 97.324 0 79.603 0 59.574 0 26.671 26.862 0 60 0s60 26.671 60 59.574c0 20.029-9.954 37.75-25.222 48.55l-2.016 1.422z"\n fill-opacity=".3"/>\n</svg>\n');return e?.fillColor&&t.querySelector("#background")?.setAttribute("fill",e.fillColor),e?.outlineColor&&t.querySelector("#outline")?.setAttribute("fill",e.outlineColor),void 0!==e?.outlineOpacity&&t.querySelector("#outline")?.setAttribute("fill-opacity",e.outlineOpacity.toString()),t},xr=e=>new Error(`Trying to ${e} while it is not in the map style. Did you exclude it when loading the map?`),Cr=async e=>{e.mapReady||(await e.mapLibreMap.once("styledata"),await Cr(e))},Dr=e=>{for(const t of e){if(!t||0===Object.keys(t.properties).length)return;for(const e in t.properties)if("string"==typeof t.properties[e])try{t.properties[e]=JSON.parse(t.properties[e])}catch(r){console.warn("Cannot deserialize feature property",e,"with value",t.properties[e],r)}}},Pr=(e,t,r)=>{const i=e.id;e.maxzoom===t.maxzoom&&e.minzoom===t.minzoom||r.setLayerZoomRange(i,e.minzoom??r.getMinZoom(),e.maxzoom??r.getMaxZoom()),r.setFilter(i,e.filter,{validate:!1});for(const o of Object.keys(t.layout??[]))e.layout?.[o]||r.setLayoutProperty(i,o,void 0,{validate:!1});for(const o of Object.keys(t.paint??[]))e.paint?.[o]||r.setPaintProperty(i,o,void 0,{validate:!1});for(const[t,o]of Object.entries(e.paint??[]))r.setPaintProperty(i,t,o,{validate:!1});for(const[t,o]of Object.entries(e.layout??[]))r.setLayoutProperty(i,t,o,{validate:!1})},Nr=(e,t,r)=>{e.forEach((e,i)=>Pr(e,t[i],r))},Fr=(e,t)=>{const r=new Set,i=e=>{t.getLayer(e.id)||t.addLayer({...e,layout:{...e.layout,visibility:"none"}},e.beforeID),r.add(e.id)},o={};for(e.forEach(e=>{e.beforeID?r.has(e.beforeID)||t.getLayer(e.beforeID)?(r.add(e.beforeID),i(e)):o[e.beforeID]?o[e.beforeID].push(e):o[e.beforeID]=[e]:i(e)});Object.keys(o).length>0;){const e=Object.keys(o).filter(e=>r.has(e));if(0===e.length)throw Error(`Circular dependency for before Ids ${JSON.stringify(Object.keys(o))}`);e.forEach(e=>{o[e].forEach(e=>i(e)),delete o[e]})}},jr=(e,t)=>{switch(typeof e){case"undefined":return{type:"standard",include:[t]};case"string":return{type:"standard",id:e,include:[t]};default:if("standard"===e.type)return e.include?{...e,include:[...e.include,t]}:{...e,include:[t]};throw(e=>new Error(`Trying to add style module ${e} to the custom style!`))(t)}},Wr=async(e,t,r,i)=>{await Cr(e),t&&!e.mapLibreMap.getSource(r)&&(e.mapLibreMap.isStyleLoaded()||await e.mapLibreMap.once("idle"),e.setStyle(jr(e.getStyle(),i)),await(async(e,t)=>{e.mapLibreMap.getSource(t)&&e.mapLibreMap.isSourceLoaded(t)||await e.mapLibreMap.once("sourcedata")})(e,r))},Ur=async(e,t,r,i)=>{if(!e.hasImage(t)&&r)if("string"==typeof r)if(r.includes("<svg")){const o=Rr(Tr(r));setTimeout(()=>e.addImage(t,o,i))}else{const o=(await e.loadImage(r)).data;e.hasImage(t)||e.addImage(t,o,i)}else setTimeout(()=>e.addImage(t,r,i))},kr=e=>{switch(e){case"standardDark":case"drivingDark":case"monoDark":case"satellite":return"dark";default:return"light"}},Hr=async(e,t)=>{t.setSprite(`${e.commonBaseURL}/maps/orbis/assets/sprites/2.*/sprite?key=${e.apiKey}&poi=poi_${(e=>{if("string"==typeof e)return kr(e);const t=e;return t?.id?kr(t.id):"light"})(e.style)}&apiVersion=1&apiChannel=preview`,{validate:!1}),Ur(t,"default_pin",(()=>{if(Or())return Rr(Mr(void 0))})(),{pixelRatio:2})};class Gr{constructor(e,t,r){this._initializing=!0,this.moduleReady=!1,this.sourceType=e,this.tomtomMap=t,this.eventsProxy=t._eventsProxy,this.tomtomMap.addStyleChangeHandler({onStyleAboutToChange:()=>{this.moduleReady=!1},onStyleChanged:()=>this.restoreDataAndConfig()}),this.mapLibreMap=t.mapLibreMap,this.initSourcesWithLayers(r),r&&this.applyConfig(r),this._initializing=!1}initSourcesWithLayers(e,t){this.moduleReady=!1,this.sourcesWithLayers=this._initSourcesWithLayers(e,t),this._sourceAndLayerIDs=Object.fromEntries(Object.entries(this.sourcesWithLayers).map(([e,t])=>[e,t.sourceAndLayerIDs])),t&&this.eventsProxy.updateIfRegistered(this.sourcesWithLayers),this.tomtomMap.mapReady&&(this.moduleReady=!0)}async waitUntilModuleReady(){await Cr(this.tomtomMap),this.moduleReady||await new Promise(e=>{const t=setInterval(()=>{this.tomtomMap.mapReady&&this.moduleReady&&(clearInterval(t),e())},200)})}applyConfig(e){this.config=this._applyConfig(e)}resetConfig(){this.applyConfig(void 0)}async restoreDataAndConfig(){this.moduleReady=!1,"geojson"===this.sourceType?setTimeout(()=>this.restoreDataAndConfigImpl(),400):this.restoreDataAndConfigImpl()}restoreDataAndConfigImpl(){this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config)}getConfig(){return this.config&&{...this.config}}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}}class zr{constructor(e,t){this.eventProxy=e,this.sourceWithLayers=t}on(e,t){this.eventProxy.addEventHandler(this.sourceWithLayers,t,e)}off(e){this.eventProxy.remove(this.sourceWithLayers,e)}}class Vr{constructor(){this.interactiveLayerIDs=[],this.handlers={},this.findHandlers=(e,t,r)=>t&&r&&e.flatMap(e=>{const i=this.handlers[t]?.[e];return 1===i?.length?i:this.handlers[t]?.[e]?.filter(e=>e.layerIDs.includes(r))||[]})||[]}ensureInteractiveLayerIDsAdded(e){e._layerSpecs.forEach(e=>{this.interactiveLayerIDs.includes(e.id)||this.interactiveLayerIDs.push(e.id)})}addEventHandler(e,t,r){this.ensureInteractiveLayerIDsAdded(e);const i=e.source.id;this.handlers[i]||(this.handlers[i]={[r]:[]}),this.handlers[i][r]??=[],this.handlers[i][r]?.push({sourceWithLayers:e,layerIDs:e._layerSpecs.map(e=>e.id),fn:t})}remove(e,t){const r=this.handlers[e.source.id]?.[t];r&&(Er(r,t=>{return r=e._layerSpecs,t.layerIDs.every((e,t)=>e===r[t].id);var r}),r.length||(delete this.handlers[e.source.id]?.[t],gr(this.handlers[e.source.id])&&delete this.handlers[e.source.id]));for(const t of e._layerSpecs)Er(this.interactiveLayerIDs,e=>t.id===e)}removeAll(){this.interactiveLayerIDs=[],this.handlers={}}hasSourceID(e){return!!this.handlers[e]}updateIfRegistered(e){for(const t of Object.values(e)){const e=this.handlers[t.source.id];if(e)for(const r of Object.values(e))for(const e of r)t.equalSourceAndLayerIDs(e.sourceWithLayers)&&(e.sourceWithLayers=t)}}}const Br=e=>(function(e){if(br(e))throw new Error(`${e} must not be null/undefined. Something went wrong with its initialization.`)}(e),e);class $r{constructor(e,t,r){this.id=e,this.spec=t,this.runtimeSource=r}ensureAddedToMap(e){this.runtimeSource||(!e.getSource(this.id)&&this.spec&&e.addSource(this.id,this.spec),this.runtimeSource=e.getSource(this.id))}}class Yr{constructor(e,t,r){this.map=e,this.source=t,this._layerSpecs=r,this._updateSourceAndLayerIDs()}isAnyLayerVisible(e){return this.getLayerSpecs(e).some(e=>this.isLayerVisible(e))}areAllLayersVisible(e){return this.getLayerSpecs(e).every(e=>this.isLayerVisible(e))}getLayerSpecs(e){return e?this._layerSpecs.filter(e):this._layerSpecs}_updateSourceAndLayerIDs(){this._sourceAndLayerIDs={sourceID:this.source.id,layerIDs:this._layerSpecs.map(e=>e.id)}}isLayerVisible(e){return"none"!==this.map.getLayoutProperty(e.id,"visibility")}setLayersVisible(e,t){for(const r of this.getLayerSpecs(t))this.map.setLayoutProperty(r.id,"visibility",e?"visible":"none",{validate:!1})}get sourceAndLayerIDs(){return this._sourceAndLayerIDs}equalSourceAndLayerIDs(e){return this.sourceAndLayerIDs.sourceID===e.sourceAndLayerIDs.sourceID&&this.sourceAndLayerIDs.layerIDs.length===e.sourceAndLayerIDs.layerIDs.length&&this.sourceAndLayerIDs.layerIDs.every((t,r)=>t===e.sourceAndLayerIDs.layerIDs[r])}}const Kr=(e,t)=>e.getStyle().layers.filter(e=>t.includes(e?.source));class qr extends Yr{constructor(e,t,r){let i=Kr(e,[t.id]);r&&(i=i.filter(r)),super(e,new $r(t.id,e.getStyle().sources[t.id],t),i)}}class Xr extends Yr{constructor(e,t,r,i){super(e,new $r(t,r),i.map(e=>({...e,source:t})))}ensureLayersAddedToMap(){for(const e of this._layerSpecs)this.map.getLayer(e.id)||this.map.addLayer(e,e.beforeID)}ensureAddedToMapWithVisibility(e,t){this.source.ensureAddedToMap(this.map),t&&(this.ensureLayersAddedToMap(),this.setLayersVisible(e))}}const Zr={type:"FeatureCollection",features:[]};class Jr extends Xr{constructor(e,t,r,i=!0){super(e,t,{type:"geojson",data:Zr,promoteId:"id"},r),this.shownFeatures=Zr,this.ensureAddedToMapWithVisibility(!1,i)}show(e){this.shownFeatures=e,Br(this.source.runtimeSource).setData(e),this.setLayersVisible(!!e.features.length)}clear(){this.show(Zr)}findFeature(e){return"index"in e?this.shownFeatures.features[e.index]:"id"in e?this.shownFeatures.features.find(t=>t.id===e.id):void 0}putEventState(e){if("put"===(e.mode??"put"))for(const t of this.shownFeatures.features)t.properties?.eventState===e.state&&delete t.properties.eventState;const t=this.findFeature(e);t&&(t.properties={...t.properties,eventState:e.state}),!1!==e.show&&this.show(this.shownFeatures)}cleanEventState(e){const t=this.findFeature(e);t?.properties?.eventState&&(delete t?.properties?.eventState,!1!==e?.show&&this.show(this.shownFeatures))}cleanEventStates(e){let t=!1;for(const r of this.shownFeatures.features)e?.states&&!e.states.includes(r.properties?.eventState)||(delete r.properties?.eventState,t=!0);!1!==e?.show&&t&&this.show(this.shownFeatures)}}const Qr=e=>"click"===e||"contextmenu"===e,ei=(e,t,r,i="updateInProps")=>{const{feature:o,index:s}=((e,t)=>{for(let r=0;r<e.length;r++){const i=e[r];if(i.id===t)return{feature:i,index:r}}})(r,t)||{};if(o&&(!Qr(o.properties?.eventState)||Qr(e))){const t={...o,properties:"updateInProps"===i?{...o?.properties,eventState:e}:vr(o?.properties,"eventState")};return r.splice(s,1,t),s}},ti=(e,t,r)=>{const i=[...r.shownFeatures.features];br(ei(e,t.id,i,"removeFromProps"))||r.show({...r.shownFeatures,features:i})},ri=(e,t,r,i,o)=>{if(t&&i instanceof Jr){const a=[...i.shownFeatures.features],l=ei(e,t.id,a);return!r||(n=t,(s=r)&&n&&s.id===n.id)||(o===i?ei(e,r.id,a,"removeFromProps"):o instanceof Jr&&ti(e,r,o)),i.show({...i.shownFeatures,features:a}),{feature:a[l],index:l}}var s,n;return r&&o instanceof Jr&&ti(e,r,o),{feature:t}},ii={precisionMode:"box",paddingBoxPx:5,cursorOnHover:"pointer",cursorOnMouseDown:"grabbing",cursorOnMap:"default",longHoverDelayAfterMapMoveMS:800,longHoverDelayOnStillMapMS:300};class oi extends Vr{constructor(e,t={}){super(),this.enabled=!0,this.firstDelayedHoverSinceMapMove=!0,this.map=e,this.mapCanvas=e.getCanvas(),this.config={...ii,...t},this.mapCanvas.style.cursor=this.config.cursorOnMap,this.lastCursorStyle=this.config.cursorOnMap,this.defaultZoomLevel=Math.round(this.map.getZoom()),this.listenToEvents()}listenToEvents(){this.map.on("mousemove",e=>this.onMouseMove(e)),this.map.on("movestart",()=>this.onMouseStart()),this.map.on("mouseout",()=>this.onMouseOut()),this.map.on("mouseover",e=>this.onMouseMove(e)),this.map.on("mousedown",()=>this.onMouseDown()),this.map.on("mouseup",()=>this.onMouseUp()),this.map.on("click",e=>this.onMapClick("click",e)),this.map.on("contextmenu",e=>this.onMapClick("contextmenu",e))}enable(e){this.enabled=e,e||this.clearLongHoverTimeout()}toPaddedBounds(e){const t=this.config.paddingBoxPx;return[[e.x-t,e.y+t],[e.x+t,e.y-t]]}isEnabled(){return this.enabled&&!this.map.isMoving()}getRenderedFeatures(e){const t={layers:this.interactiveLayerIDs},r=this.config.precisionMode,i="point-then-box"===r||"point"===r?this.map.queryRenderedFeatures(e,t):[];return i.length||"point"===r?i:this.map.queryRenderedFeatures(this.toPaddedBounds(e),t)}clearLongHoverTimeout(){window.clearTimeout(this.longHoverTimeoutHandlerID)}restartLongHoverTimeout(){this.clearLongHoverTimeout(),this.longHoverTimeoutHandlerID=window.setTimeout(()=>this.handleLongHoverTimeout(),this.firstDelayedHoverSinceMapMove?this.config.longHoverDelayAfterMapMoveMS:this.config.longHoverDelayOnStillMapMS)}handleLongHoverTimeout(){if(this.firstDelayedHoverSinceMapMove=!1,this.hoveringSourceWithLayers){const e=ri("long-hover",this.hoveringFeature,void 0,this.hoveringSourceWithLayers,void 0);this.findHandlers(["long-hover"],this.hoveringFeature?.source,this.hoveringFeature?.layer.id).forEach(t=>t.fn(e.feature,this.hoveringLngLat,this.hoveringFeatures,this.hoveringSourceWithLayers))}}onMouseStart(){this.firstDelayedHoverSinceMapMove=!0,this.clearLongHoverTimeout()}onMouseOut(){this.clearLongHoverTimeout()}onMouseDown(){this.lastCursorStyle=this.mapCanvas.style.cursor,this.mapCanvas.style.cursor=this.config.cursorOnMouseDown}onMouseUp(){this.mapCanvas.style.cursor=this.lastCursorStyle}onMouseMove(e){if(!this.isEnabled())return;this.hoveringFeatures=this.getRenderedFeatures(e.point),Dr(this.hoveringFeatures);const[t]=this.hoveringFeatures;if(t&&!this.hasSourceID(t.source))return;const{hoverChanged:r,mouseInMotionOverHoveredFeature:i}=((e,t,r,i)=>{if(t){if(!i)return{hoverChanged:!0};if(t.id&&t.id!==i.id||t.properties.id&&t.properties.id!==i.properties.id||t.source!==i.source||t.layer.id!==i.layer.id)return{hoverChanged:!0};if(r&&(e.x-r.x!=0||e.y-r.y!=0))return{mouseInMotionOverHoveredFeature:!0}}else if(i)return{hoverChanged:!0};return{}})(e.point,t,this.hoveringPoint,this.hoveringFeature);if(r||i){this.hoveringLngLat=e.lngLat,this.hoveringPoint=e.point;const i=this.hoveringFeature;this.hoveringFeature=t;const o=this.hoveringSourceWithLayers,s=this.findHandlers(["hover","long-hover","click","contextmenu"],t?.source,t?.layer.id);if(this.hoveringSourceWithLayers=s?.[0]?.sourceWithLayers,r){this.updateCursor(i);const r=ri("hover",this.hoveringFeature,i,this.hoveringSourceWithLayers,o),s=this.findHandlers(["hover"],t?.source,t?.layer.id);for(const t of s)t.fn(r.feature,e.lngLat,this.hoveringFeatures,this.hoveringSourceWithLayers)}this.restartLongHoverTimeout()}}updateCursor(e){!e&&this.hoveringFeature?this.mapCanvas.style.cursor=this.config.cursorOnHover:e&&!this.hoveringFeature&&(this.mapCanvas.style.cursor=this.config.cursorOnMap)}onMapClick(e,t){if(!this.isEnabled())return;const r=this.getRenderedFeatures(t.point);Dr(r);const i=this.lastClickedFeature;this.lastClickedFeature=r[0];const o=this.lastClickedSourceWithLayers,s=this.findHandlers([e],this.lastClickedFeature?.source,this.lastClickedFeature?.layer.id);this.lastClickedSourceWithLayers=s?.[0]?.sourceWithLayers;const n=ri(e,this.lastClickedFeature,i,this.lastClickedSourceWithLayers,o);for(const e of s)e.fn(n.feature,t.lngLat,r,this.lastClickedSourceWithLayers)}}const si={country:"Places - Country name",lowestPlaceLabel:"Places - Village / Hamlet",poi:"POI",lowestLabel:"Borders - Treaty label",lowestRoadLine:"Tunnel - Railway outline",lowestBuilding:"Buildings - Underground"},ni="vectorTiles",ai="hillshade",li="places",ci="vectorTiles",ui="vectorTilesIncidents",hi="vectorTilesFlow",pi=["POI","POI - Micro"],di={ACCESS_GATEWAY:"access_gateway",ADVENTURE_SPORTS_FACILITY:"adventure_sports_facility",ADVENTURE_SPORTS_VENUE:"adventure_sports_venue",AGRICULTURE:"agriculture_business",AIRPORT:"airport",AMUSEMENT_PARK:"amusement_park",AQUATIC_ZOO:"zoo_or_aquarium",ASHRAM:"religious_site",ATM:"atm",AUTOMOTIVE_DEALER:"automotive_dealer",BANK:"bank",BEACH:"beach",BUS_STOP:"bus_station",BUSINESS_PARK:"business_park",CAFE_PUB:"cafe",CAMPING_GROUND:"camping_ground",CAR_WASH:"car_wash",CASH_DISPENSER:"atm",CASINO:"casino",CLOTHING_SHOP:"clothing_shop",CHURCH:"religious_site",CINEMA:"cinema",CLUB_ASSOCIATION:"club_and_association",COLLEGE_UNIVERSITY:"college_or_university",COMMERCIAL_BUILDING:"commercial_building",COMMUNITY_CENTER:"community_center",COMPANY:"company_or_office",CONCERT_HALL:"nightlife",COURTHOUSE:"courthouse",CULTURAL_CENTER:"cultural_center",DENTIST:"dentist",DEPARTMENT_STORE:"department_store",DOCTOR:"doctor",ELECTRIC_VEHICLE_STATION:"charging_location",EMBASSY:"institution_office",EMERGENCY_MEDICAL_SERVICE:"emergency_medical_service",EMERGENCY_ROOM:"emergency_room",ENTERTAINMENT:"entertainment",EXCHANGE:"stock_exchange",EXHIBITION_CONVENTION_CENTER:"cultural_center",FERRY_TERMINAL:"ferry_terminal",FIRE_STATION_BRIGADE:"fire_station",FRONTIER_CROSSING:"frontier_crossing",FUEL_FACILITIES:"fuel_station",GAS_STATION:"fuel_station",GEOGRAPHIC_FEATURE:"geographic_feature",GOLD_EXCHANGE:"gold_exchange",GOLF_COURSE:"golf_course",GOVERNMENT_OFFICE:"institution_office",GURUDWARA:"religious_site",HEALTH_CARE_SERVICE:"healthcare_service",HELIPAD_HELICOPTER_LANDING:"heliport_or_helipad",HILL:"elevation_point",HOLIDAY_RENTAL:"holiday_home",HOSPITAL:"hospital",HOSPITAL_POLYCLINIC:"hospital",HOTEL_MOTEL:"hotel_or_motel",ICE_SKATING_RINK:"ice_skating_rink",IMPORTANT_TOURIST_ATTRACTION:"tourist_attraction",INDUSTRIAL_BUILDING:"industrial_building",LEISURE_CENTER:"leisure_center",LIBRARY:"library",MANUFACTURING_FACILITY:"manufacturing_facility",MARINA:"marina",MARKET:"marketplace",MEDIA_FACILITY:"media_facility",MILITARY_INSTALLATION:"military_facility",MOSQUE:"religious_site",MOTORING_ORGANIZATION_OFFICE:"motoring_organization_office",MOUNTAIN_PASS:"mountain_pass",MOUNTAIN_PEAK:"elevation_point",MOVIE_THEATER:"cinema",MUSEUM:"museum",NATIVE_RESERVATION:"native_reservation",NIGHTLIFE:"nightlife",NON_GOVERNMENTAL_ORGANIZATION:"non_governmental_organization",OPEN_PARKING_AREA:"parking_facility",OPERA_HOUSE:"theater",PAGODA:"religious_site",PARK_RECREATION_AREA:"park_and_recreation_area",PARKING_GARAGE:"parking_facility",PETROL_STATION:"fuel_station",PHARMACY:"pharmacy",PLACE_OF_WORSHIP:"place_of_worship",POLICE_STATION:"police_station",PORT_WAREHOUSE_FACILITY:"port_or_warehouse_facility",POST_OFFICE:"post_office",PRIMARY_RESOURCE_UTILITY:"primary_resource_or_utility",PRISON_CORRECTIONAL_FACILITY:"prison",PUBLIC_AMENITY:"public_amenity",PUBLIC_TRANSPORT_STOP:"public_transport_stop",RAILWAY_STATION:"railway_station",RENT_A_CAR_FACILITY:"car_rental",RENT_A_CAR_PARKING:"rent_a_car_parking",REPAIR_FACILITY:"repair_facility",RESEARCH_FACILITY:"research_facility",RESIDENTIAL_ACCOMMODATION:"urban_ground",REST_AREA:"rest_area",RESTAURANT:"restaurant",RESTAURANT_AREA:"restaurant_area",SCENIC_PANORAMIC_VIEW:"viewpoint",SCHOOL:"school",SHOP:"shop_or_store",SHOPPING_CENTER:"shop_or_store",SPORTS_CENTER:"sport_facility",STADIUM:"stadium",SUPERMARKETS_HYPERMARKETS:"supermarket",SWIMMING_POOL:"swimming_pool",SYNAGOG:"religious_site",TAXI_STAND:"taxi_stand",TEMPLE:"religious_site",TENNIS_COURT:"tennis_court",THEATER:"theater",TOLL_GATE:"toll_gate",TOURIST_INFORMATION_OFFICE:"tourist_information_office",TRAFFIC_CONTROL_DEPARTMENT:"traffic_control_department",TRAFFIC_SERVICE_CENTER:"traffic_service_center",TRAIL_SYSTEM:"trail_system",TRAILS:"trails",TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:"transport_authority_or_vehicle_registration",TRUCK_STOP:"truck_stop",VACATION_RENTAL:"vacation_rental",VETERINARIAN:"veterinarian",WATER_SPORT:"water_sport",WEIGH_STATION:"weigh_station",WELFARE_ORGANIZATION:"welfare_organization",WINERY:"manufacturing_facility",ZOOS_ARBORETA_BOTANICAL_GARDEN:"zoo_or_aquarium"},fi=e=>e in di?di[e]:e.toLowerCase(),yi="Noto-Bold",gi=["in",["get","eventState"],["literal",["click","contextmenu"]]],mi="title",bi="iconID",_i={"icon-image":["case",gi,"default_pin",["get",bi]],"icon-anchor":"bottom","icon-size":["interpolate",["linear"],["zoom"],8,.6,22,.8],"icon-allow-overlap":!0,"icon-padding":0},Li={"icon-translate":[0,5],"icon-translate-anchor":"viewport"},vi={"text-optional":!0,"text-font":[yi],"text-field":["get",mi],"text-justify":"auto","text-variable-anchor":["top","left","right"],"text-variable-anchor-offset":["top",[0,.7],"left",[1.4,-1.4],"right",[-1.4,-1.4]],"text-size":["interpolate",["linear"],["zoom"],10,14,18,16],"text-padding":5},Ii={"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"},Si={type:"symbol",layout:{..._i,...vi},paint:{...Li,...Ii}},Ai=["has","eventState"],wi="#3f9cd9",Ei={...Si,filter:["!",Ai]},Oi={...Si,filter:Ai,layout:{...Si.layout,"icon-size":["interpolate",["linear"],["zoom"],8,.8,22,1],"text-allow-overlap":!0},paint:{...Si.paint,"text-color":wi}},Ri=(e,t,r)=>{const i=t?.text,o=t?.layers?.[r];return{...e,layout:{...e.layout,...i?.size&&{"text-size":i.size},...i?.font&&{"text-font":i.font},...i?.offset&&{"text-offset":i.offset},...i?.title&&"function"!=typeof i?.title&&{"text-field":i?.title}},paint:{...e.paint,...i?.color&&{"text-color":i.color},...i?.haloColor&&{"text-halo-color":i.haloColor},...i?.haloWidth&&{"text-halo-width":i.haloWidth}},...o}},Ti=e=>JSON.parse(JSON.stringify(e)?.replace(/name/g,mi)),Mi=(e,t)=>{let r;if("base-map"===e?.theme){const e=(e=>{const t=e.getStyle().layers.filter(e=>"POI"===e.id)[0]||{},r=t.layout?.["text-size"];return{filter:["!",gi],type:"symbol",paint:t.paint,layout:{...t.layout,"text-field":["get",mi],"icon-image":["get",bi],...r&&{"text-size":Ti(r)}}}})(t);r={main:e,selected:{...e,filter:Ai,layout:{...e.layout,"text-allow-overlap":!0},paint:{...e.paint,"text-color":wi}}}}else r={main:Ei,selected:Oi};return{main:Ri(r.main,e,"main"),selected:Ri(r.selected,e,"selected"),...e?.layers?.additional}},xi=new Set([7339002,8099002,7369004,7321003,7376006,9362003,9362004,9160004,9376007,7315015,9376006,9376002,7315078,7315149,9376005,7372003,9352045,9352032,9361048,9902003,9378005,7383004,9910004,7320002,9362016,7320003,9362025,9942002,9942003,7380005,9663003,9361021,9379009,9379004,7315147,9376003,9160002,9160003,9352008,9361006,7389004,9910006]),Ci=e=>e.properties.poi?.name??e.properties.address.freeformAddress,Di=(e,t={})=>{const r=t.theme??"pin",i=t.icon?.customIcons,o=e.properties.poi?.classifications?.[0]?.code,s=i?.find(e=>e.id===o);if(s)return s.id;let n;return n="pin"===r?(e=>{const t=e.properties.poi?.categoryIds?.[0];return t?xi.has(t)?t.toString():t.toString().substring(0,4):"default_pin"})(e):(o&&`poi-${fi(o)}`)??"default_pin",n},Pi=e=>{const t=e.properties.poi?.classifications?.[0]?.code;return t&&fi(t)},Ni=e=>Array.isArray(e)?{type:"FeatureCollection",features:e}:"Feature"===e.type?{type:"FeatureCollection",features:[e]}:e,Fi=(e,t,r={})=>{const i=Ni(e);return{...i,features:i.features.map(e=>{const t="function"==typeof r?.text?.title?r?.text?.title(e):Ci(e),i=r.extraFeatureProps?Object.fromEntries(Object.entries(r.extraFeatureProps).map(([t,r])=>[t,"function"==typeof r?r(e):r])):{};return{...e,geometry:{...e.geometry,bbox:e.bbox},properties:{...e.properties,id:e.id,title:t,iconID:Di(e,r),..."base-map"===r?.theme&&{category:Pi(e)},...i}}})}},ji=class e extends Gr{constructor(e,t){super("geojson",e,t),this.instanceIndex=0}static async get(t,r){return await Cr(t),new e(t,r)}_initSourcesWithLayers(t,r){return r||(e.lastInstanceIndex++,this.instanceIndex=e.lastInstanceIndex,this.sourceID=`${li}-${this.instanceIndex}`,this.layerIDPrefix=`placesSymbols-${this.instanceIndex}`),this.layerSpecs=this.buildLayerSpecs(t),{places:new Jr(this.mapLibreMap,this.sourceID,[this.layerSpecs.main,this.layerSpecs.selected])}}buildLayerSpecs(e){const t=Mi(e,this.mapLibreMap);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,{...t,id:`${this.layerIDPrefix}-${e}`}]))}_applyConfig(e){return e?.theme||e?.icon||e?.text?this.updateLayersAndData(e):e?.extraFeatureProps&&this.updateData(e),e}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.places.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}applyTheme(e){this.applyConfigPart({theme:e})}applyIconConfig(e){this.applyConfigPart({icon:e})}applyTextConfig(e){this.applyConfigPart({text:e})}applyConfigPart(e){const t={...this.config,...e};this.updateLayersAndData(t),this.config=t}applyExtraFeatureProps(e){const t={...this.config,extraFeatureProps:e};this.updateData(t),this.config=t}updateLayersAndData(e){for(const t of e?.icon?.customIcons??[])Ur(this.mapLibreMap,t.id,t.image,{pixelRatio:t.pixelRatio??2});const t=this.buildLayerSpecs(e),r=[t.main,t.selected],i=[this.layerSpecs.main,this.layerSpecs.selected];Nr(r,i,this.mapLibreMap),this.layerSpecs=t,this.updateData(e)}updateData(e){this.sourcesWithLayers.places.source.runtimeSource?.setData(Fi(this.sourcesWithLayers.places.shownFeatures,this.mapLibreMap,e))}async show(e){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.show(Fi(e,this.mapLibreMap,this.config))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.places.clear()}putEventState(e){this.sourcesWithLayers.places.putEventState(e)}cleanEventState(e){this.sourcesWithLayers.places.cleanEventState(e)}cleanEventStates(e){this.sourcesWithLayers.places.cleanEventStates(e)}get events(){return new zr(this.eventsProxy,this.sourcesWithLayers.places)}};ji.lastInstanceIndex=-1;let Wi=ji;const Ui=e=>{if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!Ui(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}},ki=e=>e?.length?1===e.length?e[0]:{expression:["any",...e.map(e=>e?.expression)],legacy:["any",...e.map(e=>e?.legacy)]}:null,Hi=(e,t)=>{return t?["all",e[(r=t,Ui(r)?"expression":"legacy")],t]:e.expression;var r},Gi=(e,t,r)=>{if(1===r.length){const i="only"===t?"==":"!=";return{expression:[i,["get",e],r[0]],legacy:[i,e,r[0]]}}const i=["in",["get",e],["literal",r]];return"only"===t?{expression:i,legacy:["in",e,...r]}:{expression:["!",i],legacy:["!in",e,...r]}},zi=(e,t,r)=>Gi(e,t.show,r?t.values.map(r):t.values),Vi={FOOD_DRINKS_GROUP:["RESTAURANT","FAST_FOOD","CAFE_PUB","PUB","WINERY","PUB_FOOD","SOUL_FOOD","DELICATESSEN"],SHOPPING_GROUP:["SHOP","SHOPPING_CENTER","CLOTHING_SHOP","MARKET","FOOD_MARKET","SUPERMARKETS_HYPERMARKETS","DEPARTMENT_STORE","CONVENIENCE_STORE","GROCERY_STORE","HARDWARE_STORE","ELECTRICAL_APPLIANCES_SHOP"],TRANSPORTATION_GROUP:["AIRPORT","FERRY_TERMINAL","HELIPAD_HELICOPTER_LANDING","PUBLIC_TRANSPORT_STOP","RAILWAY_STATION","BUS_STOP","TAXI_STAND"],HEALTH_GROUP:["DOCTOR","EMERGENCY_MEDICAL_SERVICE","EMERGENCY_ROOM","HEALTH_CARE_SERVICE","HOSPITAL","HOSPITAL_POLYCLINIC","PHARMACY","DENTIST","WELFARE_ORGANIZATION"],PARKING_GROUP:["PARKING_GARAGE","OPEN_PARKING_AREA"],HOLIDAY_TOURISM_GROUP:["AMUSEMENT_PARK","BEACH","HOLIDAY_RENTAL","GEOGRAPHIC_FEATURE","IMPORTANT_TOURIST_ATTRACTION","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK","MUSEUM","SCENIC_PANORAMIC_VIEW","TOURIST_INFORMATION_OFFICE"],EV_CHARGING_STATIONS_GROUP:["ELECTRIC_VEHICLE_STATION"],GAS_STATIONS_GROUP:["GAS_STATION","PETROL_STATION"],ACCOMMODATION_GROUP:["CAMPING_GROUND","HOTEL_MOTEL","HOLIDAY_RENTAL"],ENTERTAINMENT_GROUP:["CINEMA","THEATER","MOVIE_THEATER","NIGHTLIFE","CONCERT_HALL","ENTERTAINMENT","CLUB_ASSOCIATION","CASINO"],SPORTS_LEISURE_GROUP:["SPORTS_CENTER","WATER_SPORT","SWIMMING_POOL","GOLF_COURSE","STADIUM","BEACH","ICE_SKATING_RINK","LEISURE_CENTER","MOUNTAIN_PASS","MOUNTAIN_PEAK"],EDUCATION_GROUP:["SCHOOL","COLLEGE_UNIVERSITY","LIBRARY","CULTURAL_CENTER"],GOVERNMENT_GROUP:["GOVERNMENT_OFFICE","COURTHOUSE","EMBASSY","FIRE_STATION_BRIGADE","POLICE_STATION"]},Bi=e=>{const t=[];return e.forEach(e=>{e in Vi?t.push(...Vi[e].map(fi)):t.push(fi(e))}),[...new Set(t)]};class $i extends Gr{static async get(e,t){return await Cr(e),new $i(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(ni);if(!e)throw xr(`init ${$i.name} with source ID ${ni}`);const t=new qr(this.mapLibreMap,e,e=>pi.includes(e.id)),r=t.sourceAndLayerIDs.layerIDs[0];return this.mapLibreMap.getLayer(r)&&(this.originalFilter=this.mapLibreMap.getFilter(r)),{poi:t}}_applyConfig(e){return e&&!br(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),this.filterCategories(e?.filters?.categories),e}isVisible(){return this.sourcesWithLayers.poi.isAnyLayerVisible()}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.poi.setLayersVisible(e)}filterCategories(e){if(e){if(this.tomtomMap.mapReady){const t=Gi("category",e.show,Bi(e.values));this.mapLibreMap.setFilter("POI",Hi(t,this.originalFilter))}this.config={...this.config,filters:{categories:e}}}else this.categoriesFilter&&(this.config={...this.config,filters:{categories:{show:"all_except",values:[]}}},this.tomtomMap.mapReady&&this.mapLibreMap.setFilter("POI",this.originalFilter));this.categoriesFilter=e}get events(){return new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.poi)}}const Yi={land:{layerIDMatches:["lulc"],layerTypes:["fill"]},borders:{layerIDMatches:["borders"],layerTypes:["line"]},water:{layerIDMatches:["water"],layerTypes:["fill","line"]},buildings2D:{layerIDMatches:["building"],layerTypes:["fill","line"]},buildings3D:{layerIDMatches:["building"],layerTypes:["fill-extrusion"]},houseNumbers:{layerIDMatches:["house number"],layerTypes:["symbol"]},roadLines:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["fill","line"]},roadLabels:{layerIDMatches:["road","tunnel","bridge","surface"],layerTypes:["symbol"]},roadShields:{layerIDMatches:["shield"],layerTypes:["symbol"]},placeLabels:{layerIDMatches:["places"],layerTypes:["symbol"]},smallerTownLabels:{layerIDMatches:["town","village","neighbourhood"],layerTypes:["symbol"]},cityLabels:{layerIDMatches:["city","capital"],layerTypes:["symbol"]},capitalLabels:{layerIDMatches:["capital"],layerTypes:["symbol"]},stateLabels:{layerIDMatches:["state"],layerTypes:["symbol"]},countryLabels:{layerIDMatches:["places - country"],layerTypes:["symbol"]}},Ki=(e,t)=>{const r=Yi[e];return r.layerIDMatches.some(e=>t.id.toLowerCase().includes(e))&&r.layerTypes.includes(t.type)},qi=e=>t=>(!e||((e,t)=>{const r=t?.mode,i=t?.names;if(r&&i?.length){if("include"===r)return i.some(t=>Ki(t,e));if("exclude"===r)return!i.some(t=>Ki(t,e))}return!0})(t,e))&&!pi.includes(t.id);class Xi extends Gr{static async get(e,t){return await Cr(e),new Xi(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(e){const t=this.mapLibreMap.getSource(ci);if(!t)throw xr(`init ${Xi.name} with source ID ${ci}`);return{vectorTiles:new qr(this.mapLibreMap,t,qi(e?.layerGroupsFilter))}}_applyConfig(e){return e&&!br(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),e?.layerGroupsVisibility&&this.setVisible(e.layerGroupsVisibility.visible,{layerGroups:e.layerGroupsVisibility}),{...this.config,...e}}isVisible(){return this.sourcesWithLayers.vectorTiles.isAnyLayerVisible()}setVisible(e,t){t?.layerGroups?this.config={...this.config,layerGroupsVisibility:{...t.layerGroups,visible:e}}:(delete this.config?.layerGroupsVisibility,this.config={...this.config,visible:e}),this.tomtomMap.mapReady&&this.sourcesWithLayers.vectorTiles.setLayersVisible(e,t?.layerGroups&&(e=>{const t=e.mode,r=e.names;return"include"===t?e=>r.some(t=>Ki(t,e)):"exclude"===t?e=>!r.some(t=>Ki(t,e)):(console.error("Unrecognized layer group mode:",t),()=>!0)})(t.layerGroups))}get events(){return new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vectorTiles)}}const Zi="title",Ji="color",Qi={warm:["#793F0D","#AC703D","#C38E63","#E49969","#E5AE86","#EEC5A9","#6E7649","#9D9754","#C7C397","#B4A851","#DFD27C","#E7E3B5","#846D74","#B7A6AD","#D3C9CE"],browns:["#edc4b3","#e6b8a2","#deab90","#d69f7e","#cd9777","#c38e70","#b07d62","#9d6b53","#8a5a44","#774936"],cold:["#344464","#548ca4","#549cac","#2c445c","#a4ccd4","#acbccc","#b4c4d4","#acd4cc","#5c8ca4"],fadedBlues:["#152033","#1d2d44","#2e455d","#3e5c76","#4c6884","#597491","#67809e","#6e86a5","#7b91ad","#879bb4"],blues:["#03045e","#023e8a","#0077b6","#0096c7","#00b4d8","#48cae4","#90e0ef","#ade8f4","#caf0f8"],greens:["#004b23","#006400","#007200","#008000","#38b000","#70e000","#9ef01a","#ccff33"],fadedGreenToBlue:["#d9ed92","#b5e48c","#99d98c","#76c893","#52b69a","#34a0a4","#168aad","#1a759f","#1e6091","#184e77"],blueToRed:["#033270","#1368aa","#4091c9","#9dcee2","#fedfd4","#f29479","#f26a4f","#ef3c2d","#cb1b16","#65010c"],greenToYellow:["#007f5f","#2b9348","#55a630","#80b918","#aacc00","#bfd200","#d4d700","#dddf00","#eeef20","#ffff3f"],pastel:["#fec5bb","#fcd5ce","#fae1dd","#f8edeb","#e8e8e4","#d8e2dc","#ece4db","#ffe5d9","#ffd7ba","#fec89a"],retro:["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],contrastRetro:["#001219","#005f73","#0a9396","#94d2bd","#e9d8a6","#ee9b00","#ca6702","#bb3e03","#ae2012","#9b2226"],fadedRainbow:["#ffadad","#ffd6a5","#fdffb6","#caffbf","#9bf6ff","#a0c4ff","#bdb2ff","#ffc6ff","#fffffc"],pastelRainbow:["#54478c","#2c699a","#048ba8","#0db39e","#16db93","#83e377","#b9e769","#efea5a","#f1c453","#f29e4c"]},eo="#0A3653",to={type:"fill",paint:{"fill-color":["coalesce",["get",Ji],eo],"fill-opacity":.15,"fill-antialias":!1}},ro={type:"line",paint:{"line-color":eo,"line-opacity":.45,"line-width":2}},io=(e,t,r)=>{const i=r?.colorConfig,o=r?.lineConfig;return[{...to,id:e,paint:{...to.paint,...!br(i?.fillOpacity)&&{"fill-opacity":i?.fillOpacity},...i?.fillColor&&{"fill-color":["get","color"]}}},{...ro,id:t,paint:{...ro.paint,...!br(o?.lineColor)&&{"line-color":o?.lineColor},...!br(o?.lineWidth)&&{"line-width":o?.lineWidth},...!br(o?.lineOpacity)&&{"line-opacity":o?.lineOpacity}}}]},oo=(e,t)=>{const r=t?.textConfig;return{type:"symbol",id:e,layout:{"text-field":["get",Zi],...r?.textField&&{"text-field":r.textField},"text-padding":5,"text-size":12,"text-font":[yi],"symbol-placement":"point"},paint:{"text-color":"#333333","text-halo-color":"#FFFFFF","text-halo-width":["interpolate",["linear"],["zoom"],6,1,10,1.5],"text-translate-anchor":"viewport"}}},so=(e,t={})=>({...e,features:e.features.map((e,r)=>{const i=e.properties?.title?e.properties.title:((e,t)=>t.textConfig?.textField?t.textConfig.textField:e.properties?.address?.freeformAddress)(e,t),o=e.properties?.color?e.properties.color:((e,t)=>{const r=e?.colorConfig?.fillColor;if("string"==typeof r&&Qi[r]){const e=Qi[r];return e[t%e.length]}return r})(t,r);return{...e,properties:{...e.properties,title:i,color:o}}})}),no=t=>{const r=t.features.map(t=>{let r;if(t.properties?.placeCoordinates)r=t.properties?.placeCoordinates;else if("MultiPolygon"===t.geometry.type){const i=(e=>e.flat().reduce((e,t)=>t.length>e.length?t:e,[]))(t.geometry.coordinates),o=e.bboxFromCoordsArray(i);r=o&&e.bboxCenter(o)||null}else r=t.geometry.coordinates.flat();return{type:"Feature",geometry:{type:"Point",coordinates:r},properties:t.properties}});return{type:"FeatureCollection",bbox:t.bbox,features:r}},ao=class e extends Gr{static async get(t,r){return await Cr(t),new e(t,r)}constructor(e,t){super("geojson",e,t)}_initSourcesWithLayers(t,r){if(!r){e.lastInstanceIndex++,this.sourceID=`geometry-${e.lastInstanceIndex}`,this.titleSourceID=`geometryTitle-${e.lastInstanceIndex}`;const t=`geometry-${e.lastInstanceIndex}`;this.fillLayerID=`${t}_Fill`,this.outlineLayerID=`${t}_Outline`,this.titleLayerID=`${t}_Title`}const[i,o]=io(this.fillLayerID,this.outlineLayerID,t),s=oo(this.titleLayerID,t);return this.titleLayerSpecs=s,this.geometryFillLayerSpecs=i,this.geometryOutlineLayerSpecs=o,{geometry:new Jr(this.mapLibreMap,this.sourceID,[{...i},{...o}]),geometryLabel:new Jr(this.mapLibreMap,this.titleSourceID,[s])}}_applyConfig(e){return(e?.textConfig||e?.colorConfig||e?.lineConfig)&&this.updateLayerAndData(e),e?.beforeLayerConfig&&this.moveBeforeLayer(e.beforeLayerConfig),e}moveBeforeLayerID(e){for(const t of this.sourcesWithLayers.geometry.sourceAndLayerIDs.layerIDs)this.mapLibreMap.moveLayer(t,e)}moveBeforeLayer(e){this.config={...this.config,beforeLayerConfig:e},this.moveBeforeLayerID("top"===e?this.titleLayerID:si[e])}applyTextConfig(e){const t={...this.config,textConfig:e};this.updateLayerAndData(t),this.sourcesWithLayers.geometryLabel.show(no(this.sourcesWithLayers.geometry.shownFeatures)),this.config=t}updateLayerAndData(e){const[t,r]=io(this.fillLayerID,this.outlineLayerID,e),i=oo(this.titleLayerID,e);Pr(t,this.geometryFillLayerSpecs,this.mapLibreMap),Pr(r,this.geometryOutlineLayerSpecs,this.mapLibreMap),Pr(i,this.titleLayerSpecs,this.mapLibreMap),this.geometryFillLayerSpecs=t,this.geometryOutlineLayerSpecs=r,this.titleLayerSpecs=i}restoreDataAndConfigImpl(){const e=this.sourcesWithLayers.geometry.shownFeatures;this.initSourcesWithLayers(this.config,!0),this.config&&this._applyConfig(this.config),this.show(e)}async show(e){await this.waitUntilModuleReady();const t=this.sourcesWithLayers.geometry;t.show(so(e,this.config)),this.sourcesWithLayers.geometryLabel.show(no(t.shownFeatures))}async clear(){await this.waitUntilModuleReady(),this.sourcesWithLayers.geometry.clear()}get events(){return new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.geometry)}};ao.lastInstanceIndex=-1;let lo=ao;class co extends Gr{static async get(e,t){return await Wr(e,t?.ensureAddedToStyle,ai,"hillshade"),new co(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(ai);if(!e)throw xr(`init ${co.name} with source ID ${ai}`);return{hillshade:new qr(this.mapLibreMap,e)}}_applyConfig(e){return e&&!br(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),e}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.hillshade.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.hillshade.isAnyLayerVisible()}get events(){return new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.hillshade)}}const uo="#36A8F0",ho="#105287",po="#ABAFB3",fo="#3C4956",yo="#727C85",go=["interpolate",["linear"],["zoom"],1,3,5,4,10,7,18,10],mo=["==",["get","routeState"],"selected"],bo=["==",["get","routeState"],"deselected"],_o="#AD0000",Lo="#FB2D09",vo="#f58240",Io="#000000",So=e=>!1===e?.visible?"":e?.title??["format",["get","title"],"\n",["get","chargingPower"]," • ",["get","chargingDuration"]],Ao=e=>({...Si,filter:mo,minzoom:4,layout:{...Si.layout,"text-field":So(e?.text)},paint:{...Si.paint}}),wo={filter:mo,minzoom:16},Eo={...wo,type:"line",layout:{"line-cap":"round"}},Oo={...Eo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,14,22,20],"line-color":"grey"}},Ro={...Eo,paint:{"line-width":["interpolate",["linear"],["zoom"],16,12,22,17],"line-color":"white"}},To="instruction-arrow",Mo={...wo,type:"symbol",layout:{"icon-allow-overlap":!0,"icon-image":To,"icon-rotation-alignment":"map","icon-rotate":["get","lastPointBearingDegrees"],"icon-size":["interpolate",["linear"],["zoom"],16,1,22,2]}},xo={filter:mo,type:"line",layout:{"line-join":"round"},paint:{"line-width":go,"line-color":"#6dc4ed"}},Co={filter:mo,type:"symbol",minzoom:6,maxzoom:16.5,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-ferry_terminal","icon-size":["interpolate",["linear"],["zoom"],6,.8,16.5,1],"icon-ignore-placement":!0}},Do={type:"line",layout:{"line-join":"round","line-cap":"round","line-sort-key":["get","index"]}},Po=["interpolate",["linear"],["zoom"],1,5,5,6,10,10,18,14],No={...Do,filter:bo,paint:{"line-color":fo,"line-width":Po}},Fo={...Do,filter:bo,paint:{"line-color":po,"line-width":go}},jo={...Do,filter:mo,paint:{"line-color":ho,"line-width":Po}},Wo={type:"symbol",layout:{"symbol-placement":"line","icon-image":"roads-arrow-white","icon-rotate":180}},Uo="selected-route-summary-popup",ko="deselected-route-summary-popup",Ho={filter:mo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["interpolate",["linear"],["zoom"],1,9,5,11,10,15,18,20],"line-color":"#BEBFFA"}},Go={filter:mo,type:"symbol",minzoom:4,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-image":"poi-toll_gantry","icon-size":["interpolate",["linear"],["zoom"],4,.8,16.5,1]}},zo=["interpolate",["linear"],["zoom"],1,2,5,3,10,4,18,6],Vo={type:"line",layout:{"line-cap":"round"},paint:{"line-width":zo,"line-color":["match",["get","magnitudeOfDelay"],"minor","#FFC105","moderate",Lo,"major",_o,"#C7D2D8"]}},Bo={type:"line",filter:["in",["get","magnitudeOfDelay"],["literal",["unknown","indefinite"]]],layout:{"line-join":"round"},paint:{"line-width":zo,"line-color":["match",["get","magnitudeOfDelay"],"unknown","rgba(190, 39, 27, 1)","rgba(137, 150, 168, 1)"],"line-dasharray":[1.5,1]}},$o=["match",["get","magnitudeOfDelay"],"minor",vo,"moderate",Lo,"major",_o,"indefinite","#666666",Io],Yo={filter:mo,type:"symbol",minzoom:6,layout:{"symbol-placement":"point","symbol-avoid-edges":!0,"icon-ignore-placement":!0}},Ko={...Yo,filter:["all",["has","jamIconID"],Yo.filter],layout:{...Yo.layout,"icon-image":["get","jamIconID"],"icon-anchor":"bottom-left","text-anchor":"bottom-left","text-field":["get","title"],"text-font":[yi],"text-offset":[3.9,-1.4],"text-size":13},paint:{...Yo.paint,"text-color":$o,"text-halo-color":"#FFFFFF","text-halo-width":1}},qo={...Yo,filter:["all",["has","causeIconID"],Yo.filter],layout:{...Yo.layout,"icon-image":["get","causeIconID"],"icon-anchor":"bottom-right"},paint:{...Yo.paint}},Xo={filter:mo,type:"line",layout:{"line-join":"round"},paint:{"line-width":go,"line-color":"#000000","line-opacity":.3}},Zo={filter:mo,type:"line",layout:{"line-join":"round"},paint:{"line-color":ho,"line-width":go}},Jo={filter:mo,type:"line",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":uo,"line-width":["interpolate",["linear"],["zoom"],1,2,5,3,10,5,18,7],"line-dasharray":[0,1.5]}},Qo="traffic-clear",es="traffic-major",ts="traffic-moderate",rs="traffic-minor",is=["has","formattedTraffic"],os={type:"symbol",layout:{"icon-image":["case",mo,Uo,ko],"symbol-placement":"point","icon-rotation-alignment":"viewport","text-rotation-alignment":"viewport","symbol-sort-key":["case",mo,0,1],"icon-text-fit":"both","icon-text-fit-padding":[10,5,5,10],"text-font":["Noto-Medium"],"text-size":13,"icon-padding":0,"text-justify":"left","text-line-height":1.5,"text-field":["format",["get","formattedDuration"],{"text-font":["literal",[yi]],"text-color":["case",mo,"black",yo]},["concat","\t\t",["get","formattedDistance"]],{"text-color":yo},["case",is,"\n",""],{},["image",["case",is,["match",["get","magnitudeOfDelay"],"major",es,"moderate",ts,"minor",rs,Qo],""]],{},["case",is,["concat"," ",["get","formattedTraffic"]],""],{"text-font":["literal",[yi]],"text-color":$o}]},paint:{"icon-translate":[0,-35],"text-translate":[0,-35]}},ss="start",ns="middle",as="finish",ls="indexType",cs="stopDisplayIndex",us="waypointStart",hs="waypointStop",ps="waypointSoft",ds="waypointFinish",fs={"text-field":["get",cs],"text-font":[yi],"text-size":["interpolate",["linear"],["zoom"],13,14,18,16],"text-offset":[0,-1.6],"icon-anchor":["case",["all",["==",["get",ls],ns],["!",["has",cs]]],"center","bottom"],"text-allow-overlap":!0},ys={type:"symbol",paint:{...Li,"text-color":"#ffffff"},layout:{..._i,...fs,"symbol-sort-key":["case",["==",["get",bi],ps],0,["abs",["-",["get","index"],1e3]]]}},gs={type:"symbol",paint:{...Ii,"text-color":"black","text-halo-width":1.5,"text-halo-color":"#ffffff"},layout:{...vi,"text-anchor":"top","text-offset":[0,.4]}},ms=(e={})=>{const t=e.layers,r=t?.sections,i=e.theme?.mainColor;return{mainLines:{routeLineArrows:{...Wo,beforeID:si.lowestLabel,...t?.mainLines?.routeLineArrows},routeLine:{...(o={color:i},{...Do,filter:mo,paint:{"line-color":o?.color??uo,"line-width":go}}),beforeID:"routeLineArrows",...t?.mainLines?.routeLine},routeOutline:{...jo,beforeID:"routeLine",...t?.mainLines?.routeOutline},routeDeselectedLine:{...Fo,beforeID:"routeOutline",...t?.mainLines?.routeDeselectedLine},routeDeselectedOutline:{...No,beforeID:"routeDeselectedLine",...t?.mainLines?.routeDeselectedOutline},...t?.mainLines?.additional},waypoints:{routeWaypointSymbol:{...ys,beforeID:"routeSummaryBubbleSymbol",...t?.waypoints?.routeWaypointSymbol},routeWaypointLabel:{...gs,beforeID:"routeWaypointSymbol",...t?.waypoints?.routeWaypointLabel},...t?.waypoints?.additional},chargingStops:{routeChargingStopSymbol:{...Ao(e.chargingStops),beforeID:"routeWaypointSymbol",...t?.chargingStops?.routeChargingStopSymbol},...t?.chargingStops?.additional},sections:{incident:{routeIncidentJamSymbol:{...Ko,beforeID:"routeChargingStopSymbol",...r?.incident?.routeIncidentJamSymbol},routeIncidentCauseSymbol:{...qo,beforeID:"routeChargingStopSymbol",...r?.incident?.routeIncidentCauseSymbol},routeIncidentBackgroundLine:{...Vo,beforeID:"routeIncidentDashedLine",...r?.incident?.routeIncidentBackgroundLine},routeIncidentDashedLine:{...Bo,beforeID:si.lowestLabel,...r?.incident?.routeIncidentDashedLine}},ferry:{routeFerryLine:{...xo,beforeID:"routeLineArrows",...r?.ferry?.routeFerryLine},routeFerrySymbol:{...Co,beforeID:"routeIncidentJamSymbol",...r?.ferry?.routeFerrySymbol},...r?.ferry?.additional},tollRoad:{routeTollRoadOutline:{...Ho,beforeID:"routeDeselectedOutline",...r?.tollRoad?.routeTollRoadOutline},routeTollRoadSymbol:{...Go,beforeID:"routeChargingStopSymbol",...r?.tollRoad?.routeTollRoadSymbol},...r?.tollRoad?.additional},tunnel:{routeTunnelLine:{...Xo,beforeID:"routeLineArrows",...r?.tunnel?.routeTunnelLine},...r?.tunnel?.additional},vehicleRestricted:{routeVehicleRestrictedBackgroundLine:{...Zo,beforeID:"routeVehicleRestrictedForegroundLine",...r?.vehicleRestricted?.routeVehicleRestrictedBackgroundLine},routeVehicleRestrictedForegroundLine:{...Jo,beforeID:si.lowestLabel,...r?.vehicleRestricted?.routeVehicleRestrictedForegroundLine},...r?.vehicleRestricted?.additional}},instructionLines:{routeInstructionLine:{...Ro,beforeID:si.lowestLabel,...t?.instructionLines?.routeInstructionLine},routeInstructionOutline:{...Oo,beforeID:"routeInstructionLine",...t?.instructionLines?.routeInstructionOutline},...t?.instructionLines?.additional},instructionArrows:{routeInstructionArrowSymbol:{...Mo,beforeID:"routeInstructionLine",...t?.instructionArrows?.routeInstructionArrowSymbol},...t?.instructionArrows?.additional},summaryBubbles:{routeSummaryBubbleSymbol:{...os,...t?.summaryBubbles?.routeSummaryBubbleSymbol},...t?.summaryBubbles?.additional}};var o},bs=ms();let _s;Or()&&(_s=Rr(Tr('<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">\n <path d="M1.562 40.569L25 1.562l23.438 39.007L25 27.566 1.562 40.569z" fill="#fff"/>\n <path d="M25.369.107c.782.429.506.167.917.682l23.438 39.007c.79 1.316-.671 2.829-2.014 2.085L25 29.281l-22.71 12.6c-1.343.744-2.804-.769-2.014-2.085L23.714.789c.461-.694.9-.682 1.656-.682zM25 1.562L1.562 40.569 25 27.566l23.438 13.003L25 1.562z"\n fill="gray"/>\n</svg>\n')));const Ls=e=>{if(!Or())return;const t=Tr('<svg xmlns="http://www.w3.org/2000/svg" width="160" height="65">\n <g filter="url(#A)">\n <rect id="pin" x="81.899" y="47" width="10" height="10" rx="2" transform="rotate(45 81.899 47)"/>\n <rect id="bubble" x="10" y="10" width="140" height="45" rx="12"/>\n </g>\n <defs>\n <filter id="A">\n <feDropShadow dx="0" dy="2" stdDeviation="4" flood-opacity=".3"/>\n </filter>\n </defs>\n</svg>\n');return t.querySelector("#bubble")?.setAttribute("fill",e),t.querySelector("#pin")?.setAttribute("fill",e),Rr(t)},vs={pixelRatio:2,stretchX:[[20,45],[100,130]],stretchY:[[20,35]],content:[10,10,130,45]},Is=e=>{if(!Or())return;const t=Tr('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">\n <g id="main">\n <path fill-rule="evenodd"\n d="M11.389 4H9.025a.86.86 0 0 0-.517.173l-.001-.001a.5.5 0 0 1-.464.059l-.028-.011a.5.5 0 0 1-.129-.83A1.86 1.86 0 0 1 9.025 3h2.364a2 2 0 0 1 1.789 1.106l1.02 2.04c.471.176.802.63.802 1.156v.803c0 .543 0 .815-.071 1.038a1.5 1.5 0 0 1-.914.953c-.219.08-.491.092-1.034.114l-1.481.062v-.166-.803a2.23 2.23 0 0 0-1.055-1.897l-.74-1.479 2.326.033h.955l-.703-1.406A1 1 0 0 0 11.389 4zM12 8.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"/>\n <path d="M11.833 11.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594h-1.187c-.328 0-.594-.266-.594-.594z"/>\n <path fill-rule="evenodd"\n d="M1.802 8.146C1.331 8.321 1 8.776 1 9.302v.803c0 .543 0 .815.071 1.038a1.5 1.5 0 0 0 .914.953c.219.08.491.092 1.034.114l2.731.114 2.731-.114c.543-.023.814-.034 1.034-.114a1.5 1.5 0 0 0 .914-.953c.071-.223.071-.494.071-1.038v-.803c0-.526-.331-.98-.802-1.156l-1.02-2.04A2 2 0 0 0 6.889 5H4.611a2 2 0 0 0-1.789 1.106l-1.02 2.04zM6.889 6H4.611a1 1 0 0 0-.894.553l-.703 1.406h.955 3.563.955l-.703-1.406A1 1 0 0 0 6.889 6zM2 10.4a1 1 0 1 1 2 0 .5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm6.5-1a1 1 0 0 0-1 1 .5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5 1 1 0 0 0-1-1z"/>\n <path d="M1.792 13.115c0-.109.089-.198.198-.198h1.979c.109 0 .198.089.198.198 0 .328-.266.594-.594.594H2.385c-.328 0-.594-.266-.594-.594zm5.739-.198c-.109 0-.198.089-.198.198 0 .328.266.594.594.594h1.188c.328 0 .594-.266.594-.594 0-.109-.089-.198-.198-.198h-1.98z"/>\n </g>\n</svg>\n'),r=t.querySelector("#main");return r.setAttribute("transform","scale(2)"),r.setAttribute("fill",e),Rr(t)},Ss=(e,t)=>{if(!Or())return;const r=Mr(t);return e&&r.appendChild(e),Rr(r)},As=(e={})=>Object.entries(e).map(([e,t])=>({...t,id:e})),ws=(e={})=>({mainLines:As(e.mainLines),waypoints:As(e.waypoints),chargingStops:As(e?.chargingStops),ferries:As(e.sections?.ferry),incidents:As(e.sections?.incident),tollRoads:As(e.sections?.tollRoad),tunnels:As(e.sections?.tunnel),vehicleRestricted:As(e.sections?.vehicleRestricted),instructionLines:As(e.instructionLines),instructionArrows:As(e.instructionArrows),summaryBubbles:As(e.summaryBubbles)}),Es=t=>{const r=e.TomTomConfig.instance.get().displayUnits,i=t?.displayUnits;return{...t,...i?{}:{displayUnits:r},layers:ms(t)}},Os={commonBaseURL:"https://api.tomtom.com",apiKey:"",apiVersion:1},Rs=class{constructor(){this.config={...Os}}put(e){this.config={...this.config,...e}}reset(){this.config={...Os}}get(){return this.config}};Rs.instance=new Rs;let Ts=Rs;const Ms=e=>e?.minutes??"min",xs=(e,t)=>{if(e){const i=Math.abs(e)/3600;let o=Math.floor(i),s=Math.round(i%1*60);60===s&&(s=0,o++);const n={...Ts.instance.get().displayUnits?.time,...t};if(o)return`${o} ${r=n,r?.hours??"hr"} ${s.toString().padStart(2,"0")} ${Ms(n)}`;if(s)return`${s.toString()} ${Ms(n)}`}var r},Cs=(e,t)=>{const r=t?.chargingStops?.icon;if(r?.mapping){const t=r.mapping;switch(t.basedOn){case"chargingSpeed":if(e.properties.chargingConnectionInfo?.chargingSpeed)return t.value[e.properties.chargingConnectionInfo?.chargingSpeed];break;case"custom":return t.fn(e)}}return"7309"},Ds=e=>{const t=e.properties;return t.chargingParkName??t.chargingParkOperatorName},Ps=(e,t)=>{const r=[];if(!1!==t?.chargingStops?.visible)for(const i of e.features)for(const e of i.properties.sections.leg){const o=e.summary.chargingInformationAtEndOfLeg;if(o){const e=o.properties;r.push({...o,properties:{...o.properties,id:o.properties.chargingParkId,iconID:Cs(o,t),title:Ds(o),chargingPower:`${e.chargingConnectionInfo?.chargingPowerInkW} kW`,chargingDuration:xs(e.chargingTimeInSeconds,t?.displayUnits?.time),routeState:i.properties.routeState}})}}return{type:"FeatureCollection",features:r}},Ns=e=>e.categories.includes("jam"),Fs=t=>{const r=(t=>{if(Ns(t))return e.formatDuration(t.delayInSeconds)})(t),i=((e,t)=>Ns(e)?`traffic-jam-${e.magnitudeOfDelay??"unknown"}-${(e=>e?.length?e.length<6?"small":e.length<8?"medium":"large":"collapsed")(t)}`:null)(t,r),o=(e=>{switch(e.categories.find(e=>"jam"!==e)){case"accident":return"traffic-incidents-accident";case"roadworks":return"traffic-incidents-roadworks";case"road-closed":return"traffic-incidents-road_closed";case"danger":case"animals-on-road":return"traffic-incidents-danger";case"broken-down-vehicle":return"traffic-incidents-broken_down_vehicle";case"lane-closed":case"narrow-lanes":return"traffic-incidents-lane_closed";case"wind":return"traffic-incidents-wind";case"fog":return"traffic-incidents-fog";case"rain":return"traffic-incidents-rain";case"frost":return"traffic-incidents-frost";case"flooding":return"traffic-incidents-flooding";default:return null}})(t);return{...t,...i&&{jamIconID:i},...o&&{causeIconID:o},...r&&{title:r}}},js=(e,t)=>{if(e.properties.radiusMeters)return ps;switch(t){case"start":return us;case"finish":return ds;default:return hs}},Ws=(t,r)=>{let i=-1;return{type:"FeatureCollection",features:t.map((o,s)=>{if(!o)return i++,null;const n=(e=>{return Array.isArray(e)?{type:"Feature",geometry:{type:"Point",coordinates:e},properties:{}}:"Point"===e.type?{type:"Feature",geometry:t=e,properties:{},...t.bbox&&{bbox:t.bbox}}:e;var t})(o),a=((e,t)=>0===e?ss:e<t-1?ns:as)(s,t.length),l=(e=>!e.properties.radiusMeters)(n);l&&i++;const c=(e=>{const t=e?.properties;return t?.poi?.name??t?.address?.freeformAddress??void 0})(n),u=n.id??e.generateId();return{...n,id:u,..."main-when-available"===r?.entryPoints&&{geometry:{type:"Point",coordinates:e.getPosition(n,{useEntryPoint:"main-when-available"})}},properties:{...n.properties,id:u,index:s,indexType:a,...c&&{title:c},iconID:js(n,a),...l&&a===ns&&{stopDisplayIndex:i}}}}).filter(e=>e)}};function Us(e){return e%360*Math.PI/180}function ks(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Hs(e,t,r={}){if(!0===r.final)return function(e,t){let r=Hs(t,e);return r=(r+180)%360,r}(e,t);const i=ks(e),o=ks(t),s=Us(i[0]),n=Us(o[0]),a=Us(i[1]),l=Us(o[1]),c=Math.sin(n-s)*Math.cos(l),u=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(n-s);return Math.atan2(c,u)%(2*Math.PI)*180/Math.PI}var Gs=Hs;const zs=(e,t,r)=>({type:"FeatureCollection",features:e.features.flatMap(e=>((e,t,r)=>e.properties.sections[t]?.map(t=>({type:"Feature",id:t.id,geometry:{type:"LineString",coordinates:e.geometry.coordinates.slice(t.startPointIndex,t.endPointIndex+1)},properties:{...r?r(t,e.properties):t,routeState:e.properties.routeState,...!br(e.properties.index)&&{routeIndex:e.properties.index}}}))||[])(e,t,r))}),Vs=(e,t)=>{return t.show((r=e,i=t.shownFeatures,{...i,features:i.features.map(e=>({...e,properties:{...e.properties,routeState:r.features[e.properties.routeIndex||0].properties.routeState}}))}));var r,i},Bs=(e,t=0)=>({...e,features:e.features.map((e,r)=>({...e,properties:{...e.properties,routeState:r===t?"selected":"deselected"}}))}),$s=(e,t)=>e.some(e=>e.magnitudeOfDelay===t),Ys=(t,r)=>({type:"FeatureCollection",features:t.features.map(t=>{const i=t.properties.summary,o=t.geometry.coordinates,s=e.formatDuration(i.trafficDelayInSeconds,r?.time),n=(e=>{const t=e.properties.sections.traffic;if(t?.length)return $s(t,"major")?"major":$s(t,"moderate")?"moderate":$s(t,"minor")?"minor":void 0})(t);return{type:"Feature",geometry:{type:"Point",coordinates:o[Math.round(o.length/2)]},properties:{routeIndex:t.properties.index,routeState:t.properties.routeState,formattedDistance:e.formatDistance(i.lengthInMeters,r?.distance),formattedDuration:e.formatDuration(i.travelTimeInSeconds,r?.time),...n&&{magnitudeOfDelay:n},...s&&{formattedTraffic:s}}}})});class Ks extends Gr{static async get(e,t){return await Cr(e),new Ks(e,t)}constructor(e,t){super("geojson",e,t)}createSourcesWithLayers(e){return{mainLines:new Jr(this.mapLibreMap,"routeMainLines",e.mainLines,!1),waypoints:new Jr(this.mapLibreMap,"routeWaypoints",e.waypoints,!1),incidents:new Jr(this.mapLibreMap,"routeIncidents",e.incidents,!1),ferries:new Jr(this.mapLibreMap,"routeFerries",e.ferries,!1),chargingStops:new Jr(this.mapLibreMap,"routeChargingStops",e.chargingStops,!1),tollRoads:new Jr(this.mapLibreMap,"routeTollRoads",e.tollRoads,!1),tunnels:new Jr(this.mapLibreMap,"routeTunnels",e.tunnels,!1),vehicleRestricted:new Jr(this.mapLibreMap,"routeVehicleRestricted",e.vehicleRestricted,!1),instructionLines:new Jr(this.mapLibreMap,"routeInstructionLines",e.instructionLines,!1),instructionArrows:new Jr(this.mapLibreMap,"routeInstructionArrows",e.instructionArrows,!1),summaryBubbles:new Jr(this.mapLibreMap,"routeSummaryBubbles",e.summaryBubbles,!1)}}_initSourcesWithLayers(e){this.layersSpecs=ws(Es(e).layers);const t=this.createSourcesWithLayers(this.layersSpecs);Fr(Object.values(t).flatMap(e=>e._layerSpecs),this.mapLibreMap);const r={fillColor:e?.theme?.mainColor,...e?.waypoints?.icon?.style},i={pixelRatio:2};this.addImageIfNotExisting(us,(e=>{if(Or())return Ss(Tr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M63.734 86.383c-1.404.026-2.78-.393-3.93-1.197s-2.01-1.949-2.46-3.271l-3.15-9.339c-1.093-3.403-3.748-6.089-7.154-7.238L37.5 62.21c-2.742-.902-4.567-3.477-4.5-6.345-.058-2.874 1.761-5.457 4.5-6.388l36-11.886c2.461-.88 5.213-.27 7.062 1.567s2.466 4.571 1.578 7.015L70.17 81.918c-.938 2.719-3.54 4.526-6.436 4.469h0z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(r),i),this.addImageIfNotExisting(hs,Ss(void 0,r),i),this.addImageIfNotExisting(ps,(()=>{if(Or())return Rr(Tr('<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <circle id="circle" cx="16" cy="16" r="12" fill="white" stroke="#105287" stroke-width="4"/>\n</svg>\n'))})(),i),this.addImageIfNotExisting(ds,(e=>{if(Or())return Ss(Tr('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="140">\n <path d="M33 83.404a2.99 2.99 0 0 1-3-2.978V44.681a2.99 2.99 0 1 1 6 0v35.745a2.99 2.99 0 0 1-3 2.978zm48-38.723H39v17.872h42V44.681zm3.878 37.851a3.02 3.02 0 0 0 4.244 0c.561-.559.878-1.317.878-2.106V44.681a2.99 2.99 0 1 0-6 0v35.745c0 .789.317 1.547.878 2.106z"\n fill="#f4f5f6"/>\n</svg>\n'),e)})(r),i),this.addImageIfNotExisting(To,_s,i),this.addImageIfNotExisting(Uo,Ls("white"),vs),this.addImageIfNotExisting(ko,Ls("#EEEEEE"),vs),this.addImageIfNotExisting(Qo,Is(Io),i),this.addImageIfNotExisting(es,Is(_o),i),this.addImageIfNotExisting(ts,Is(Lo),i),this.addImageIfNotExisting(rs,Is(vo),i);for(const t of e?.chargingStops?.icon?.customIcons??[])this.addImageIfNotExisting(t.id,t.image,{pixelRatio:t.pixelRatio??2});return t}_applyConfig(e){const t=Es(e);if(this.config){const e=ws(t.layers);Object.keys(e).forEach(t=>{const r=t;((e,t,r,i)=>{const o=e.reduce((e,t)=>({...e,[t.id]:t}),{}),s=t.reduce((e,t)=>({...e,[t.id]:t}),{}),n=[],a=[],l=[],c=[];Object.keys(o).forEach(e=>{s[e]?(l.push(o[e]),c.push(s[e])):n.push(e)}),Object.keys(s).forEach(e=>{o[e]||a.push(e)});const u=r._layerSpecs;a.forEach(e=>{i.removeLayer(e);for(let t=0;t<u.length;t++)if(u[t].id===e){u.splice(t,1);break}}),n.forEach(e=>{const t={...o[e],source:r.source.id};u.push(t)}),r._updateSourceAndLayerIDs(),Nr(l,c,i)})(e[r],this.layersSpecs[r],this.sourcesWithLayers[r],this.mapLibreMap)});const r=Object.values(this.sourcesWithLayers);Fr(r.flatMap(e=>e._layerSpecs),this.mapLibreMap),r.forEach(e=>e.setLayersVisible(!!e.shownFeatures.features.length)),this.layersSpecs=e}return!mr(this.config?.displayUnits,t.displayUnits)&&this.sourcesWithLayers.summaryBubbles.shownFeatures.features.length&&this.sourcesWithLayers.summaryBubbles.show(Ys(this.sourcesWithLayers.mainLines.shownFeatures,t.displayUnits)),t}async restoreDataAndConfigImpl(){const e=Object.entries(this.sourcesWithLayers).map(e=>({[e[0]]:e[1].shownFeatures})).reduce((e,t)=>({...e,...t}),{});this.initSourcesWithLayers(),this._applyConfig(this.config);for(const t of Object.keys(e))this.sourcesWithLayers[t].show(e[t])}addImageIfNotExisting(e,t,r){Ur(this.mapLibreMap,e,t,r)}async showRoutes(e,t){const r=Bs(e,t?.selectedIndex);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(r),this.sourcesWithLayers.vehicleRestricted.show(zs(r,"vehicleRestricted")),this.sourcesWithLayers.incidents.show(zs(r,"traffic",Fs)),this.sourcesWithLayers.chargingStops.show(Ps(r,this.config)),this.sourcesWithLayers.ferries.show(zs(r,"ferry")),this.sourcesWithLayers.tunnels.show(zs(r,"tunnel")),this.sourcesWithLayers.tollRoads.show(zs(r,"toll")),this.sourcesWithLayers.instructionLines.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,t)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length).map(r=>({type:"Feature",geometry:{type:"LineString",coordinates:r.routePath.map(e=>e.point)},properties:{...r,routeIndex:t,routeState:e.properties.routeState}}))||[])}))(r)),this.sourcesWithLayers.instructionArrows.show((e=>({type:"FeatureCollection",features:e.features.flatMap((e,t)=>e.properties.guidance?.instructions?.filter(e=>e.routePath?.length&&e.routePath.length>1).map(r=>{const i=[r.routePath[r.routePath.length-2]?.point,r.routePath[r.routePath.length-1]?.point];return{type:"Feature",geometry:{type:"Point",coordinates:i[1]},properties:{...r,routeIndex:t,routeState:e.properties.routeState,lastPointBearingDegrees:Gs(i[0],i[1])}}})||[])}))(r)),this.sourcesWithLayers.summaryBubbles.show(Ys(r,this.config?.displayUnits))}async clearRoutes(){await this.waitUntilModuleReady();for(const e of Object.keys(this.sourcesWithLayers))"waypoints"!==e&&this.sourcesWithLayers[e].clear()}async selectRoute(e){const t=Bs(this.sourcesWithLayers.mainLines.shownFeatures,e);await this.waitUntilModuleReady(),this.sourcesWithLayers.mainLines.show(t),this.sourcesWithLayers.chargingStops.show(Ps(t,this.config)),Vs(t,this.sourcesWithLayers.vehicleRestricted),Vs(t,this.sourcesWithLayers.incidents),Vs(t,this.sourcesWithLayers.ferries),Vs(t,this.sourcesWithLayers.tollRoads),Vs(t,this.sourcesWithLayers.tunnels),Vs(t,this.sourcesWithLayers.instructionLines),Vs(t,this.sourcesWithLayers.instructionArrows),Vs(t,this.sourcesWithLayers.summaryBubbles)}async showWaypoints(e){const t=Array.isArray(e)?Ws(e,this.config?.waypoints):Ws(e.features,this.config?.waypoints);await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.show(t)}async clearWaypoints(){await this.waitUntilModuleReady(),this.sourcesWithLayers.waypoints.clear()}get events(){return{mainLines:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.mainLines),waypoints:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.waypoints),chargingStops:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.chargingStops),summaryBubbles:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.summaryBubbles),incidents:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.incidents),vehicleRestricted:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.vehicleRestricted),ferries:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.ferries),tollRoads:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tollRoads),tunnels:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.tunnels),instructionLines:new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.instructionLines)}}getLayerToRenderLinesUnder(){return si.lowestLabel}}const qs="standardLight",Xs={standardLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},standardDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},drivingLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_light"},drivingDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_dark"},monoLight:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_mono-light"},monoDark:{trafficIncidents:"incidents_dark",trafficFlow:"flow_relative-dark",hillshade:"hillshade_mono-dark"},satellite:{trafficIncidents:"incidents_light",trafficFlow:"flow_relative-light",hillshade:"hillshade_satellite"}},Zs=e=>`\${baseURL}/maps/orbis/assets/styles/\${version}/style.json?&apiVersion=1&key=\${apiKey}&map=${e}`,Js={standardLight:Zs("basic_street-light"),standardDark:Zs("basic_street-dark"),drivingLight:Zs("basic_street-light-driving"),drivingDark:Zs("basic_street-dark-driving"),monoLight:Zs("basic_mono-light"),monoDark:Zs("basic_mono-dark"),satellite:Zs("basic_street-satellite")},Qs=(e,t,r)=>Js[e?.id??qs].replace("${baseURL}",t).replace("${version}",e.version??"0.6.0-0").replace("${apiKey}",r),en=e=>{let t,r=!0;const i=e.style,o=e.commonBaseURL,s=e.apiKey;return"string"==typeof i?t=Qs({id:i},o,s):"standard"===i?.type?(t=Qs(i,o,s),r=gr(i.include)):t="custom"===i?.type&&i?.url?((e,t)=>{const r=new URL(e);return r.searchParams.has("key")?console.warn("The style URL is coming with an API key parameter which takes priority. If you want to use the SDK configured API key, remove the key param from the style URL"):r.searchParams.set("key",t),r.toString()})(i.url,s):"custom"===i?.type&&i?.json?i.json:Qs({id:qs},o,s),r?t:((e,t)=>{const r=new URL(e);return t.include?.length&&t.include.forEach(e=>r.searchParams.append(e,Xs[t?.id??qs][e])),decodeURIComponent(r.toString())})(t,i)};const tn={unknown:0,accident:1,fog:2,dangerous_conditions:3,rain:4,ice:5,jam:6,lane_closed:7,road_closed:8,road_works:9,wind:10,flooding:11,broken_down_vehicle:14},rn=(e,t)=>e.length?1===e.length?{expression:e[0],legacy:t[0]}:{expression:["all",...e],legacy:["all",...t]}:null,on=(e,t,r)=>{e&&(t.push(e.expression),r.push(e.legacy))},sn=(e,t,r,i)=>{e&&on(zi(t,e),r,i)},nn=(e,t,r)=>{sn(e.roadCategories,"road_category",t,r),sn(e.roadSubCategories,"road_subcategory",t,r)},an=t=>{const r=[],i=[];if(nn(t,r,i),t.incidentCategories){const e=zi("icon_category_0",t.incidentCategories,e=>tn[e]);on(e,r,i)}if(t.magnitudes){const o=zi("magnitude",t.magnitudes,t=>e.indexedMagnitudes.indexOf(t));on(o,r,i)}return t.delays&&on((e=>{const t=[],r=[];if(e.mustHaveDelay&&e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push([">=",["get","delay"],i]),r.push([">=","delay",i])}else if(e.mustHaveDelay)t.push([">",["get","delay"],0]),r.push([">","delay",0]);else if(e.minDelayMinutes){const i=60*e.minDelayMinutes;t.push(["any",["!",["has","delay"]],["==",["get","delay"],0],[">=",["get","delay"],i]]),r.push(["any",["!has","delay"],["==","delay",0],[">=","delay",i]])}return rn(t,r)})(t.delays),r,i),rn(r,i)},ln=e=>{if(!e?.any?.length)return null;const t=e.any.map(an).filter(e=>!br(e));return ki(t)},cn=e=>{const t=[],r=[];if(nn(e,t,r),e.showRoadClosures){const i="only"===e.showRoadClosures?"==":"!=";t.push([i,["get","road_closure"],!0]),r.push([i,"road_closure",!0])}return rn(t,r)},un=(e,t,r,i)=>{for(const o of t)r.setFilter(o.id,e?Hi(e,i[o.id]):i[o.id])};class hn extends Gr{static async get(e,t){return await Wr(e,t?.ensureAddedToStyle,hi,"trafficFlow"),new hn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(hi);if(!e)throw xr(`init ${hn.name} with source ID ${hi}`);this.originalFilters={};for(const e of this.getLayers())this.originalFilters[e.id]=e.filter;return{trafficFlow:new qr(this.mapLibreMap,e)}}_applyConfig(e){return e&&!br(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),this._filter(e?.filters,!1),e}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[hi])}filter(e){this._filter(e)}_filter(e,t=!0){if(this.tomtomMap.mapReady)if(e?.any?.length){const t=(e=>{if(!e?.any?.length)return null;const t=e.any.map(cn).filter(e=>!br(e));return ki(t)})(e);t&&un(t,this.getLayers(),this.mapLibreMap,this.originalFilters)}else this.config?.filters?.any?.length&&un(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);t&&(this.config=Ar({...this.config,filters:e},br))}setVisible(e){this.config={...this.config,visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficFlow.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficFlow.isAnyLayerVisible()}get events(){return new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficFlow)}}class pn extends Gr{static async get(e,t){return await Wr(e,t?.ensureAddedToStyle,ui,"trafficIncidents"),new pn(e,t)}constructor(e,t){super("style",e,t)}_initSourcesWithLayers(){const e=this.mapLibreMap.getSource(ui);if(!e)throw xr(`init ${pn.name} with source ID ${ui}`);this.originalFilters={};for(const e of this.getLayers())this.originalFilters[e.id]=e.filter;return{trafficIncidents:new qr(this.mapLibreMap,e)}}_applyConfig(e){return e&&!br(e.visible)?this.setVisible(e.visible):this._initializing||this.isVisible()||this.setVisible(!0),e?.icons&&!br(e.icons.visible)&&this.setIconsVisible(e.icons.visible),this._filter(e?.filters,e?.icons?.filters,!1),e}filter(e,t){this._filter(e,t)}_filter(e,t,r=!0){if(this.tomtomMap.mapReady){if(e?.any?.length){const r=ln(e);if(r){const e=t?this.getNonSymbolLayers():this.getLayers();un(r,e,this.mapLibreMap,this.originalFilters)}}else this.config?.filters?.any?.length&&un(void 0,this.getLayers(),this.mapLibreMap,this.originalFilters);if(t?.any?.length){const e=ln(t);e&&un(e,this.getSymbolLayers(),this.mapLibreMap,this.originalFilters)}}r&&(this.config=Ar({...this.config,filters:e,icons:{...this.config?.icons,filters:t}},br))}getLayers(){return Kr(this.tomtomMap.mapLibreMap,[ui])}getSymbolLayers(){return this.getLayers().filter(e=>"symbol"===e.type)}getNonSymbolLayers(){return this.getLayers().filter(e=>"symbol"!=e.type)}setIconsVisible(e){this.sourcesWithLayers.trafficIncidents&&(this.config={...this.config,icons:{...this.config?.icons,visible:e}},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e,e=>"symbol"===e.type))}setVisible(e){delete this.config?.icons?.visible,this.config={...Ar({...this.config},gr),visible:e},this.tomtomMap.mapReady&&this.sourcesWithLayers.trafficIncidents.setLayersVisible(e)}isVisible(){return this.sourcesWithLayers.trafficIncidents.isAnyLayerVisible()}anyIconLayersVisible(){return!!this.sourcesWithLayers.trafficIncidents?.isAnyLayerVisible(e=>"symbol"===e.type)}get events(){return new zr(this.tomtomMap._eventsProxy,this.sourcesWithLayers.trafficIncidents)}}exports.AbstractMapModule=Gr,exports.AbstractSourceWithLayers=Yr,exports.AddedSourceWithLayers=Xr,exports.BASE_MAP_SOURCE_ID=ci,exports.BaseMapModule=Xi,exports.DESELECTED_FOREGROUND_COLOR=po,exports.DESELECTED_OUTLINE_COLOR=fo,exports.DESELECTED_ROUTE_FILTER=bo,exports.DESELECTED_SECONDARY_COLOR=yo,exports.EventsModule=zr,exports.EventsProxy=oi,exports.FINISH_INDEX=as,exports.GEOMETRY_COLOR_PROP=Ji,exports.GEOMETRY_TITLE_PROP=Zi,exports.GeoJSONSourceWithLayers=Jr,exports.GeometriesModule=lo,exports.HILLSHADE_SOURCE_ID=ai,exports.HillshadeModule=co,exports.INDEX_TYPE=ls,exports.MAJOR_DELAY_COLOR=_o,exports.MIDDLE_INDEX=ns,exports.MINOR_DELAY_LABEL_COLOR=vo,exports.MODERATE_DELAY_COLOR=Lo,exports.PLACES_SOURCE_PREFIX_ID=li,exports.POI_SOURCE_ID=ni,exports.POIsModule=$i,exports.PlacesModule=Wi,exports.ROUTE_LINE_FOREGROUND_COLOR=uo,exports.ROUTE_LINE_FOREGROUND_WIDTH=go,exports.ROUTE_LINE_OUTLINE_COLOR=ho,exports.RoutingModule=Ks,exports.SELECTED_ROUTE_FILTER=mo,exports.START_INDEX=ss,exports.STOP_DISPLAY_INDEX=cs,exports.StyleSourceWithLayers=qr,exports.TRAFFIC_FLOW_SOURCE_ID=hi,exports.TRAFFIC_INCIDENTS_SOURCE_ID=ui,exports.TomTomMap=class{constructor(r,i){this.mapReady=!1,this.styleChangeHandlers=[],this.setStyle=(e,t={keepState:!0})=>{this.mapReady=!1;for(const e of this.styleChangeHandlers)try{e.onStyleAboutToChange()}catch(e){console.error(e)}const r=t.keepState?((e,t)=>t&&"object"==typeof t&&"standard"===t.type&&t.include&&("string"==typeof e||"standard"===e.type&&!e.include)?{type:"standard",id:"string"==typeof e?e:e.id,include:t.include}:e)(e,this._params.style):e;this._params={...this._params,style:r},this.mapLibreMap.once("styledata",()=>{!this.mapReady&&mr(r,this._params.style)&&this.handleStyleData(t.keepState||!0)}),this.mapLibreMap.setStyle(en(this._params))},this.getStyle=()=>this._params.style,this._params=e.mergeFromGlobal(i),this.ensureMapLibreCSSLoaded(),this.mapLibreMap=new t.Map(((t,r)=>{return{validateStyle:!1,maxTileCacheZoomLevels:22,cancelPendingTileRequestsWhileZooming:!1,...t,style:en(r),attributionControl:{compact:!1},transformRequest:(i=r,(t,r)=>t.includes("tomtom.com")?"Image"===r?{url:t}:{url:t,headers:{...e.generateTomTomHeaders(i)}}:{url:t})};var i})(r,this._params)),this.mapLibreMap.once("styledata",()=>this.handleStyleData(!1)),this._eventsProxy=new oi(this.mapLibreMap,this._params?.eventsConfig),this.loadRTLTextPlugin()}loadRTLTextPlugin(){setTimeout(()=>{["deferred","loaded"].includes(t.getRTLTextPluginStatus())||t.setRTLTextPlugin("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!0).catch(e=>console.error("Something went wrong when setting RTL plugin",e))})}ensureMapLibreCSSLoaded(){if("undefined"==typeof document)return;if(Array.from(document.querySelectorAll('link[rel="stylesheet"], style')).some(e=>e.textContent?.includes("maplibre")))return;const e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/maplibre-gl@5.12.0/dist/maplibre-gl.css",document.head.appendChild(e)}_setLanguage(e){this._params={...this._params,language:e};const t=e?.includes("-")?e.split("-")[0]:e;this.mapLibreMap.getStyle().layers.forEach(e=>{if("symbol"===e.type&&(e=>{const t=e.layout?.["text-field"]??"";return!!t&&("{name}"===t||2===t.length&&"name"===t[1]||3===t.length&&Array.isArray(t[1])&&"string"==typeof t[1][1]&&t[1][1].includes("name_")&&Array.isArray(t[2])&&t[2].includes("name"))})(e)){const r=t?["coalesce",["get",`name_${t}`],["get","name"]]:["get","name"];this.mapLibreMap.setLayoutProperty(e.id,"text-field",r,{validate:!1})}})}setLanguage(e){this.mapReady?this._setLanguage(e):this.mapLibreMap.once("styledata",()=>this.setLanguage(e))}getBBox(){return this.mapLibreMap.getBounds().toArray().flat()}handleStyleData(e){if(this.mapReady=!0,e)for(const e of this.styleChangeHandlers)try{e.onStyleChanged()}catch(e){console.error(e)}this._params.language&&this._setLanguage(this._params.language),Hr(this._params,this.mapLibreMap)}addStyleChangeHandler(e){this.styleChangeHandlers.push(e)}},exports.TomTomMapSource=$r,exports.TrafficFlowModule=hn,exports.TrafficIncidentsModule=pn,exports.UNKNOWN_DELAY_COLOR=Io,exports.baseMapLayerGroupNames=["land","water","borders","buildings2D","buildings3D","houseNumbers","roadLines","roadLabels","roadShields","placeLabels","smallerTownLabels","cityLabels","capitalLabels","stateLabels","countryLabels"],exports.buildPlaceTitle=Ci,exports.buildRoutingLayers=ms,exports.defaultRoutingLayers=bs,exports.filterLayersBySources=Kr,exports.getIconIDForPlace=Di,exports.getPOILayerCategoryForPlace=Pi,exports.getStyleCategories=Bi,exports.incidentCategories=["unknown","accident","fog","dangerous_conditions","rain","ice","jam","lane_closed","road_closed","road_works","wind","flooding","broken_down_vehicle"],exports.incidentCategoriesMapping=tn,exports.mapStyleLayerIDs=si,exports.poiCategoryGroups=Vi,exports.poiLayerIDs=pi,exports.preparePlacesForDisplay=Fi,exports.roadCategories=["motorway","trunk","primary","secondary","tertiary","street"],exports.standardStyleIDs=["standardLight","standardDark","drivingLight","drivingDark","monoLight","monoDark","satellite"],exports.streetRoadCategories=["local","minor_local"],exports.tertiaryRoadCategories=["connecting","major_local"],exports.toMapDisplayPOICategory=fi,exports.toPlaces=Ni;
|
|
2
|
-
//# sourceMappingURL=map.cjs.min.js.map
|