mobility-toolbox-js 2.0.0-beta.1 → 2.0.0
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/README.md +7 -4
- package/api/index.js +0 -1
- package/api/tralis/TralisAPI.js +1 -1
- package/common/controls/Control.js +4 -1
- package/common/layers/Layer.js +18 -49
- package/common/layers/Layer.test.js +2 -106
- package/common/mixins/SearchMixin.js +1 -1
- package/common/mixins/TralisLayerMixin.js +549 -21
- package/common/styles/index.js +4 -0
- package/common/{utils/delayTrackerStyle.js → styles/trackerDefaultStyle.js} +8 -8
- package/common/styles/trackerDelayStyle.js +17 -0
- package/common/styles/trackerSimpleStyle.js +22 -0
- package/common/trackerConfig.test.js +0 -13
- package/common/utils/getMapboxMapCopyrights.js +1 -0
- package/common/utils/index.js +2 -3
- package/common/utils/sortByDelay.js +23 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/mapbox/controls/CopyrightControl.js +5 -1
- package/mapbox/index.js +0 -2
- package/mapbox/layers/Layer.test.js +2 -2
- package/mapbox/layers/TralisLayer.js +270 -5
- package/mapbox/layers/TralisLayer.test.js +40 -0
- package/module.js +1 -9
- package/ol/controls/CopyrightControl.js +4 -4
- package/ol/controls/CopyrightControl.test.js +16 -16
- package/ol/controls/RoutingControl.js +9 -7
- package/ol/controls/RoutingControl.test.js +1 -1
- package/ol/controls/StopFinderControl.js +8 -6
- package/ol/controls/StopFinderControl.test.js +1 -1
- package/ol/index.js +3 -3
- package/ol/layers/Layer.js +9 -0
- package/ol/layers/Layer.test.js +22 -7
- package/ol/layers/MapboxLayer.js +39 -44
- package/ol/layers/MapboxLayer.test.js +5 -5
- package/ol/layers/MapboxStyleLayer.js +0 -6
- package/ol/layers/MapboxStyleLayer.test.js +22 -6
- package/ol/layers/MaplibreLayer.js +280 -0
- package/ol/layers/RoutingLayer.test.js +1 -1
- package/ol/layers/TralisLayer.js +258 -76
- package/ol/layers/TralisLayer.test.js +1 -49
- package/ol/layers/VectorLayer.test.js +1 -1
- package/ol/layers/WMSLayer.test.js +6 -2
- package/ol/styles/fullTrajectoryDelayStyle.js +35 -0
- package/ol/styles/fullTrajectoryStyle.js +51 -0
- package/ol/styles/index.js +2 -0
- package/package.json +16 -8
- package/api/trajserv/TrajservAPI.js +0 -71
- package/api/trajserv/TrajservAPI.test.js +0 -171
- package/api/trajserv/TrajservAPIUtils.js +0 -191
- package/api/trajserv/TrajservAPIUtils.test.js +0 -40
- package/api/trajserv/typedefs.js +0 -44
- package/common/mixins/MapMixin.js +0 -103
- package/common/mixins/TrackerLayerMixin.js +0 -745
- package/common/mixins/TrajservLayerMixin.js +0 -544
- package/common/utils/simpleTrackerStyle.js +0 -18
- package/mapbox/Map.js +0 -87
- package/mapbox/layers/TrackerLayer.js +0 -282
- package/mapbox/layers/TrackerLayer.test.js +0 -68
- package/mapbox/layers/TrajservLayer.js +0 -114
- package/mapbox/layers/TrajservLayer.test.js +0 -90
- package/ol/Map.js +0 -109
- package/ol/Map.test.js +0 -34
- package/ol/layers/TrackerLayer.js +0 -296
- package/ol/layers/TrackerLayer.test.js +0 -70
- package/ol/layers/TrajservLayer.js +0 -190
- package/ol/layers/TrajservLayer.test.js +0 -113
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],t):"object"==typeof exports?exports["mobility-toolbox-js"]=t():e["mobility-toolbox-js"]=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=28)}([function(e,t){e.exports=require("ol/proj")},function(e,t){e.exports=require("ol/style")},function(e,t){e.exports=require("ol/extent")},function(e,t){e.exports=require("ol/Observable")},function(e,t){e.exports=require("ol/geom")},function(e,t){e.exports=require("ol/format/GeoJSON")},function(e,t){e.exports=require("query-string")},function(e,t){e.exports=require("ol/layer")},function(e,t){e.exports=require("ol/transform")},function(e,t){e.exports=require("ol/Object")},function(e,t){e.exports=require("ol/layer/Layer")},function(e,t){e.exports=require("maplibre-gl")},function(e,t){e.exports=require("ol/source/Source")},function(e,t){e.exports=require("ol/source")},function(e,t){e.exports=require("ol/Feature")},function(e,t){e.exports=require("ol")},function(e,t){e.exports=require("lodash.debounce")},function(e,t){e.exports=require("lodash.throttle")},function(e,t){e.exports=require("ol/geom/GeometryType")},function(e,t){e.exports=require("ol/format")},function(e,t){e.exports=require("@turf/transform-rotate")},function(e,t){e.exports=require("@turf/helpers")},function(e,t){e.exports=require("ol/Map")},function(e,t){e.exports=require("ol/control")},function(e,t){e.exports=require("ol/layer/Group")},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("ol/interaction")},function(e,t){e.exports=require("ol/events/condition")},function(e,t,r){e.exports=r(30)},function(e,t){e.exports=require("ol/geom/Point")},function(e,t,r){"use strict";r.r(t);var n=r(22),o=r.n(n),i=r(23),c=r(3),a=r.n(c),u=r(24),l=r.n(u),s=r(25);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(i,e);var t,r,n,o=m(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(e=o.call(this)).defineProperties(t);var r=t.onClick,n=t.onHover;return n&&e.onHover(n),r&&e.onClick(r),t.copyrights&&(e.copyrights=t.copyrights),e.onUserClickCallback=e.onUserClickCallback.bind(O(e)),e.onUserMoveCallback=e.onUserMoveCallback.bind(O(e)),e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},e),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,l=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(s.v4)(),v=n||b;Object.defineProperties(this,{options:{value:e},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!l},isClickActive:{value:!!l&&!!f},isHoverActive:{value:!!l&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return t.get("copyrights")},set:function(e){var r=Array.isArray(e)?e:[e];t.set("copyrights",r)}},visible:{value:void 0===c||c,writable:!0},properties:{value:y({},a||{})},map:{writable:!0},clickCallbacks:{value:[]},hoverCallbacks:{value:[]}})}},{key:"init",value:function(e){this.terminate(),this.map=e}},{key:"terminate",value:function(){}},{key:"get",value:function(e){return this.properties[e]}},{key:"set",value:function(e,t){this.properties[e]=t,this.dispatchEvent({type:"change:".concat(e),target:this})}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(this.visible=e,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:t,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(e){return e.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(e){return!!this.children.find((function(t){return t.visible===e}))}},{key:"addChild",value:function(e){this.children.unshift(e),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(e){for(var t=0;t<this.children.length;t+=1)if(this.children[t].name===e){this.children.splice(t,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:e})}},{key:"onClick",value:function(e){if("function"!=typeof e)throw new Error("onClick callback must be of type function:",e);this.clickCallbacks.includes(e)||this.clickCallbacks.push(e)}},{key:"unClick",value:function(e){if("function"==typeof e){var t=this.clickCallbacks.indexOf(e);t>-1&&this.clickCallbacks.splice(t,1)}}},{key:"onUserClickCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.clickCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(e){if("function"!=typeof e)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(e)||this.hoverCallbacks.push(e)}},{key:"unHover",value:function(e){if("function"==typeof e){var t=this.hoverCallbacks.indexOf(e);t>-1&&this.hoverCallbacks.splice(t,1)}}},{key:"onUserMoveCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.hoverCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}}])&&v(t.prototype,r),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(a.a);function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){T(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(){return(E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=R(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function R(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=I(e);if(t){var o=I(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(i,e);var t,r,n,o=_(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).olLayer&&t.olLayer.setVisible(t.visible),t}return t=i,(r=[{key:"defineProperties",value:function(e){E(I(i.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{olLayer:{value:e.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(e){var t=this;if(E(I(i.prototype),"init",this).call(this,e),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(e){e.element===t.olLayer&&t.terminate()}))),(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.olListenersKeys.push(this.on("change:visible",this.toggleVisibleListeners))),this.copyrights&&this.olLayer)){var r=this.copyrights||[];this.olLayer instanceof l.a?this.olLayer.getLayers().getArray().forEach((function(e){e.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),E(I(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(E(I(i.prototype),"setVisible",this).call(this,e,t,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var e=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(t){var r=e.olListenersKeys.indexOf(t);r>-1&&e.olListenersKeys.splice(r,1),Object(c.unByKey)([e.isHoverListenerKey,e.isClickListenerKey])})),this.visible&&(this.isClickActive&&(this.isClickListenerKey=this.map.on("singleclick",this.onUserClickCallback)),this.isHoverActive&&(this.isHoverListenerKey=this.map.on("pointermove",this.onUserMoveCallback)),this.olListenersKeys.push(this.isClickListenerKey,this.isHoverListenerKey))}},{key:"clone",value:function(e){return new i(S(S({},this.options),e))}}])&&C(t.prototype,r),n&&C(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w),M=r(9),L=r.n(M);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Z(e);if(t){var o=Z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return z(this,r)}}function z(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Z(e){return(Z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H(e,t)}(i,e);var t,r,n,o=K(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(e=o.call(this,t)).defineProperties(t);var r=U({active:!1!==t.active},t),n=r.active;return e.active=n,e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=U({},e),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return t.get("active")},set:function(e){t.set("active",e),e?t.activate():t.deactivate(),t.render()}},map:{get:function(){return t.get("map")},set:function(e){if(t.map&&t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.deactivate(),t.set("map",e),t.map){var r=t.target||t.map.getContainer();t.element||t.createDefaultElement(),t.element&&r.appendChild(t.element),t.active&&t.activate()}t.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&N(t.prototype,r),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(){return(X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Y(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Y(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ne(e);if(t){var o=ne(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return re(this,r)}}function re(e,t){if(t&&("object"===W(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ne(e){return(ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ce(e,t,r){return t&&ie(e.prototype,t),r&&ie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var ae=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(r,e);var t=te(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return oe(this,r),(e=t.call(this,J(J({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],e.mobilityControls=[],(n.controls||[]).forEach((function(t){e.addControl(t)})),(n.layers||[]).forEach((function(t){e.addLayer(t)})),e}return ce(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(e){this.mobilityControls.push(e),e.map=this}},{key:"removeMobilityControl",value:function(e){e.map=null,this.mobilityControls=this.mobilityControls.filter((function(t){return t!==e}))}},{key:"addControl",value:function(e,t){e instanceof G?this.addMobilityControl(e):X(ne(r.prototype),"addControl",this).call(this,e,t)}},{key:"removeControl",value:function(e){e instanceof G?this.removeMobilityControl(e):X(ne(r.prototype),"removeControl",this).call(this,e)}}]),r}(e)},ue=r(10),le=r.n(ue);function se(e){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=he(e);if(t){var o=he(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ye(this,r)}}function ye(e,t){if(t&&("object"===se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function de(e,t,r){return t&&ve(e.prototype,t),r&&ve(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var me=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fe(e,t)}(r,e);var t=pe(r);function r(){return be(this,r),t.apply(this,arguments)}return de(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(e)};function ge(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var je=function(e){var t=e.filter((function(e){return null!=e&&e.trim&&e.trim()})),r=t.map((function(e){return e.toLowerCase()}));return ge(new Set(r)).map((function(e){return t.find((function(t){return t.toLowerCase()===e}))}))};function we(e){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ke(){return(ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Se(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Se(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=xe(e)););return e}function Te(e,t){return(Te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=xe(e);if(t){var o=xe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ee(this,r)}}function Ee(e,t){if(t&&("object"===we(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Re(e)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}(i,e);var t,r,n,o=Ce(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).onPostRender=t.onPostRender.bind(Re(t)),t}return t=i,(r=[{key:"getCopyrights",value:function(){var e=this;if(!this.frameState)return[];var t=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ue.inView)(r,e.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(t=t.concat(n.getSource().getAttributions()(e.frameState)))})),je(t)}},{key:"activate",value:function(){ke(xe(i.prototype),"activate",this).call(this),this.map&&this.map.on("postrender",this.onPostRender)}},{key:"deactivate",value:function(){this.map&&this.map.un("postrender",this.onPostRender),ke(xe(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(e){this.map&&this.element&&(this.frameState=e.frameState,this.render())}}])&&Pe(t.prototype,r),n&&Pe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function De(e){return(De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ie(e){return function(e){if(Array.isArray(e))return Ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ae(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){Be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ve(){return(Ve="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=qe(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function qe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ze(e)););return e}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ze(e);if(t){var o=ze(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ke(this,r)}}function Ke(e,t){if(t&&("object"===De(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ze(e){return(ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ze=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}(c,e);var t,r,n,o=He(c);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Fe(this,c),o.call(this,Le({controls:[].concat(Ie(Object(i.defaults)({attribution:!1}).getArray()),[new _e])},e))}return t=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(e){e instanceof A?(e.init(this),this.mobilityLayers.push(e),e.olLayer&&Ve(ze(c.prototype),"addLayer",this).call(this,e.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Ve(ze(c.prototype),"addLayer",this).call(this,e)}},{key:"removeLayer",value:function(e){e instanceof A?(e.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(t){return t!==e})),e.olLayer&&Ve(ze(c.prototype),"removeLayer",this).call(this,e)):Ve(ze(c.prototype),"removeLayer",this).call(this,e)}},{key:"addControl",value:function(e){Ve(ze(c.prototype),"addControl",this).call(this,e)}},{key:"removeControl",value:function(e){Ve(ze(c.prototype),"removeControl",this).call(this,e)}}])&&Ue(t.prototype,r),n&&Ue(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(ae(o.a)),Ge=r(0),We=r(11),$e=r.n(We),Je=r(12),Qe=r.n(Je),Xe=r(5),Ye=r.n(Xe),et=r(6),tt=r.n(et);function rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(r),!0).forEach((function(t){ot(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var it=function(e,t,r){if(!1===e)return r;var n=tt.a.parseUrl(r);return!e&&n.query[t]?r:e?tt.a.stringifyUrl(nt(nt({},n),{},{query:nt(nt({},n.query),{},ot({},t,e))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},ct=function(e){if(!e||!e.style)return[];var t=e.style.sourceCaches,r=[];return Object.values(t).forEach((function(e){if(e.used){var t=e.getSource(),n=t.attribution||t.options&&t.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),je(r)},at={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},ut=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],lt=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],st=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ft=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],pt=function(e){return"string"==typeof e?ut.findIndex((function(t){return t.test(e)})):e},yt=function(e,t){try{var r=pt(e||0);return at[r][t]}catch(e){return 1}},ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return lt[t]}catch(e){return 1}},bt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=pt(e);return st[t]}catch(e){return 1}},vt=function(e,t,r,n){e.font="bold ".concat(n,"px Arial");for(var o=e.measureText(r),i=0;o.width>t-6&&i<25;)n-=.5,e.font="bold ".concat(n,"px arial, sans-serif"),o=e.measureText(r),i+=1;return n},dt=function(e,t,r){return t?r?"#ff0000":"#a0a0a0":e>=36e5?"#ed004c":e>=5e5?"#e80000":e>=3e5?"#ff4a00":e>=18e4?"#f7bf00":null===e?"#a0a0a0":"#00a00c"},mt=function(e,t){if(t)return String.fromCodePoint(215);if(e>36e5){var r=Math.round(e/36e5);return"+".concat(r,"h")}if(e>59e3){var n=Math.round(e/6e4);return"+".concat(n,"m")}return e>0?"+".concat(e,"s"):""},gt=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},Ot={},jt={},wt={},Pt={},kt={},St=function(e,t,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=t.zoom,l=t.pixelRatio,s=e.properties,f=s.line,p=s.type,y=e.properties,h=y.train_id,b=y.delay,v=y.cancelled,d=void 0!==v&&v,m=y.operator_provides_realtime_journey;p||(p="Rail"),f||(f={});var g=f,O=g.name,j=g.text_color,w=g.color;O||(O="I"),j||(j="#000000"),w&&"#"!==w[0]&&(w="#".concat(w)),"#"!==j[0]&&(j="#".concat(j));var P=Math.min(Math.floor(u||1),16),k=n&&n===h,S=o&&o===h,T=yt(p,P)*l,C=T>=7*l;(k||S)&&(T=C?T+5*l:14*l);var E=T>10*l,R="".concat(T).concat(p).concat(w).concat(k).concat(S).concat(d).concat(b);if(i&&(R+="".concat(m)),E&&(R+="".concat(O).concat(j)),!kt[R]){if(0===T)return kt[R]=null,null;var x,_=1*l,D=T+2,I=2*T,A=2*D+2*_+100*l,M=A/2,L=gt(A,A),B=L.getContext("2d");if(C&&null!==b){var F=function(e,t,r){var n="".concat(e,", ").concat(t,", ").concat(r);if(!Ot[n]){var o=gt(2*e,2*e),i=o.getContext("2d");i.beginPath(),i.arc(e,e,t,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),Ot[n]=o}return Ot[n]}(M,D,dt(b,d));B.drawImage(F,0,0)}if(C&&(k||b>=a||d)){var U=Math.max(d?19:14,Math.min(d?19:17,1.2*T))*l,V=mt(b,d);if(V){var q=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!jt[a]){var u=gt(e,r+8*c),l=u.getContext("2d");l.textAlign="left",l.textBaseline="middle",l.font=n,l.fillStyle=o,l.strokeStyle=i,l.lineWidth=1.5*c;var s=t;l.strokeText(s,0,r),l.fillText(s,0,r),jt[a]=u}return jt[a]}(V.length*U,V,U,"bold ".concat(U,"px arial, sans-serif"),dt(b,d,!0),c,l);B.drawImage(q,M+D+_,M-U)}}var N=function(e,t,r,n,o,i){var c="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!wt[c]){var a=gt(2*e,2*e),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(e,e,t,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),wt[c]=a}return wt[c]}(M,T,x=i?dt(b,d):w||ht(p),C||k||S,C&&i&&null===b&&"yes"===m,l);if(B.drawImage(N,0,0),E){var H=Math.max(T,10),K=function(e,t,r,n,o,i,c){var a="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!Pt[a]){var u=gt(2*t,2*t),l=u.getContext("2d");i&&(l.save(),l.textBaseline="middle",l.textAlign="center",l.font="bold ".concat(r+2,"px Arial"),l.strokeStyle=o,l.strokeText(e,t,t),l.restore()),l.textBaseline="middle",l.textAlign="center",l.fillStyle=n,l.font="bold ".concat(r,"px Arial"),l.strokeStyle=o,l.strokeText(e,t,t),l.fillText(e,t,t),Pt[a]=u}return Pt[a]}(O,M,vt(B,I,O,H),i?"#000000":j||bt(p),x,i&&null===b&&"yes"===m,l);B.drawImage(K,0,0)}kt[R]=L}return kt[R]},Tt=document.createElement("canvas");Tt.width=15,Tt.height=15;var Ct=Tt.getContext("2d");Ct.arc(8,8,5,0,2*Math.PI,!1),Ct.fillStyle="#8ED6FF",Ct.fill(),Ct.lineWidth=3,Ct.strokeStyle="black",Ct.stroke(),Ct.lineWidth=3;var Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=(e.getUTCMonth()+1).toString();t=1===t.length?"0".concat(t):t;var r=e.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[e.getUTCFullYear(),t,r].join("")},Rt=function(e){return[e.getUTCHours(),e.getUTCMinutes(),"".concat(e.getUTCSeconds(),".").concat(e.getUTCMilliseconds())].join(":")};function xt(e){return(xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function It(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?It(Object(r),!0).forEach((function(t){Mt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ft(){return(Ft="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ut(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ut(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kt(e)););return e}function Vt(e,t){return(Vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kt(e);if(t){var o=Kt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Nt(this,r)}}function Nt(e,t){if(t&&("object"===xt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ht(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vt(e,t)}(i,e);var t,r,n,o=qt(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Lt(this,i);var r=new le.a({source:new Qe.a({}),render:function(t){if(!e.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=e.mbMap.getCanvas(),o=t.viewState,i=e.olLayer.getVisible();e.renderState.visible!==i&&(n.style.display=i?"block":"none",e.renderState.visible=i,n.style.position="absolute");var c=e.olLayer.getOpacity();e.renderState.opacity!==c&&(n.style.opacity=c,e.renderState.opacity=c);var a=o.rotation;e.renderState.rotation!==a&&(e.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,e.renderState.rotation=a),e.renderState.zoom===o.zoom&&e.renderState.center[0]===o.center[0]&&e.renderState.center[1]===o.center[1]||(e.mbMap.jumpTo({center:Object(Ge.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,e.renderState.zoom=o.zoom,e.renderState.center=o.center);var u=e.map.getSize();if(e.renderState.size[0]===u[0]&&e.renderState.size[1]===u[1]||(r=!0,e.renderState.size=u),e.mbMap&&e.mbMap.style&&e.mbMap.isStyleLoaded()&&r)try{e.mbMap._frame&&(e.mbMap._frame.cancel(),e.mbMap._frame=null),e.mbMap._render()}catch(e){console.warn(e)}return n}});return(e=o.call(this,At(At({},t),{},{olLayer:r}))).styleUrl=t.url,e.apiKey=t.apiKey,e.apiKeyName=t.apiKeyName||"key",e.updateAttribution=e.updateAttribution.bind(Ht(e)),e}return t=i,(r=[{key:"init",value:function(e){var t=this;Ft(Kt(i.prototype),"init",this).call(this,e),this.map&&!this.mbMap&&(this.format=new Ye.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{t.mbMap&&t.mbMap.resize()}catch(e){console.warn(e)}}))))}},{key:"createStyleUrl",value:function(){return it(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var e=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){e.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var t=_t(this.map.getView().getCenter(),2),r=t[0],n=t[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new $e.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ge.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(e){console.warn("Failed creating mapbox map: ",e)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){e.loaded=!0,e.copyrights=e.copyrights||ct(e.mbMap)||[],e.olLayer.getSource().setAttributions(e.copyrights),e.dispatchEvent({type:"load",target:e})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){e.loadMbMap()})))}},{key:"updateAttribution",value:function(e){var t=this.copyrights||ct(e.target)||[];this.copyrights.toString()!==t.toString()&&this.olLayer.getSource().setAttributions(t)}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){var r=this;if(!(t&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:e,features:[],layer:this});var n=e&&this.mbMap.project(Object(Ge.toLonLat)(e));if(this.hitTolerance){var o=n,i=o.x,c=o.y;n=[{x:i-this.hitTolerance,y:c-this.hitTolerance},{x:i+this.hitTolerance,y:c+this.hitTolerance}]}var a=this.mbMap.queryRenderedFeatures(n,t).map((function(e){var t=r.format.readFeature(e);return t&&t.set("mapboxFeature",e),t}));return Promise.resolve({layer:this,features:a,coordinate:e})}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,Ft(Kt(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(e){return new i(At(At({},this.options),e))}}])&&Bt(t.prototype,r),n&&Bt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);var Zt=r(1),Gt=r(13),Wt=r(7);var $t=new Zt.Circle({radius:6,fill:new Zt.Fill({color:[255,0,0,1]}),stroke:new Zt.Stroke({color:[0,0,0,1],width:1})}),Jt=(new Zt.Style({stroke:new Zt.Stroke({color:[0,0,0,1],width:5})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3})}),new Zt.Style({image:$t,stroke:new Zt.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(8)),Qt=r(2),Xt=r(16),Yt=r.n(Xt),er=r(17),tr=r.n(er),rr=r(18),nr=r.n(rr);function or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ir(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ir(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var cr=function(e,t,r){var n,o,i=t.properties,c=i.time_intervals,a=i.olGeometry,u=i.coordinate;if(r&&u)n=u;else if(a.getType()===nr.a.POINT)n=a.getCoordinates();else if(a.getType()===nr.a.LINE_STRING){var l=c||[[]],s=l[0],f=l[l.length-1];if(e<s[0])o=or(s,3)[2],n=a.getFirstCoordinate();else if(e>f[0]){o=or(f,3)[2],n=a.getLastCoordinate()}else for(var p=0;p<l.length-1;p+=1){var y=or(l[p],2),h=y[0],b=y[1],v=or(l[p+1],2),d=v[0],m=v[1];if(h<=e&&e<=d){var g=Math.min((e-h)/(d-h),1)*(m-b)+b;n=a.getCoordinateAt(g),o=or(l[p],3)[2];break}}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",a);return{coord:n,rotation:o}};function ar(e){return function(e){if(Array.isArray(e))return sr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||lr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||lr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(e,t){if(e){if("string"==typeof e)return sr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sr(e,t):void 0}}function sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var pr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.style=t.style,this.canvas=t.canvas||document.createElement("canvas")}var t,r,n;return t=e,(r=[{key:"renderTrajectories",value:function(e,t,r){var n=t.time,o=void 0===n?Date.now():n,i=t.size,c=void 0===i?[]:i,a=t.center,u=t.resolution,l=t.rotation,s=void 0===l?0:l,f=t.pixelRatio,p=r.noInterpolate,y=void 0!==p&&p,h=r.hoverVehicleId,b=r.selectedVehicleId,v=this.canvas,d=v.getContext("2d");d.clearRect(0,0,v.width,v.height);var m=ur(c,2),g=m[0],O=m[1];if(g&&O&&(v.width!==g||v.height!==O)){var j=[g*f,O*f];v.width=j[0],v.height=j[1]}var w,P,k,S,T,C,E,R,x=Object(Jt.compose)(Object(Jt.create)(),c[0]/2,c[1]/2,1/u,-1/u,-s,-a[0],-a[1]);v.style&&(v.style.width="".concat(v.width/f,"px"),v.style.height="".concat(v.height/f,"px"));for(var _=0,D=e.length-1;D>=0;D-=1){var I=e[D],A=I.properties,M=A.train_id,L=A.timeOffset,B=cr(o-(L||0),I,y),F=B.coord,U=B.rotation;if(e[D].properties.coordinate=F,e[D].properties.rotation=U,F){var V=Object(Jt.apply)(x,ar(F));if(V&&!((V=V.map((function(e){return e*f})))[0]<0||V[0]>v.width||V[1]<0||V[1]>v.height)){var q=this.style(I,t,r);if(q){_+=1;var N=q.width,H=q.height;h!==M&&b!==M&&d.drawImage(q,V[0]-N/2,V[1]-H/2,N,H),h&&h===M&&(w=q,P=V,k=N,S=H),b&&b===M&&(T=q,C=V,E=N,R=H)}}}}return T&&d.drawImage(T,C[0]-E/2,C[1]-R/2,E,R),w&&d.drawImage(w,P[0]-k/2,P[1]-S/2,k,S),{nbTrajectoriesRendered:_}}}])&&fr(t.prototype,r),n&&fr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),yr=function(e,t,r,n){var o=[];if(!(e||t||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(e){var t=e.properties.name||e.properties.line&&e.properties.line.name||"";return!!t&&i.some((function(e){return new RegExp(e,"i").test(t)}))}))}if(e){var c=("string"==typeof e?e.split(","):e).map((function(e){return e.replace(/\s+/g,"").toUpperCase()}));o.push((function(e){var t=e.properties,r=t.line,n=(t.name||r&&r.name||"").toUpperCase();return!!n&&c.includes(n)}))}if(t){var a=("string"==typeof t?t.split(","):t).map((function(e){return parseInt(e,10)}));o.push((function(e){var t=parseInt(e.properties.routeIdentifier.split(".")[0],10);return a.includes(t)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(e){return u.some((function(t){return new RegExp(t,"i").test(e.properties.operator)}))}))}return o.length?function(e){for(var t=0;t<o.length;t+=1)if(!o[t](e))return!1;return!0}:null};function hr(e){return(hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function br(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||dr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vr(e){return function(e){if(Array.isArray(e))return mr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||dr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dr(e,t){if(e){if("string"==typeof e)return mr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mr(e,t):void 0}}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(r),!0).forEach((function(t){jr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wr(){return(wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Pr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Pr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Er(e)););return e}function kr(e,t){return(kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Er(e);if(t){var o=Er(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Tr(this,r)}}function Tr(e,t){if(t&&("object"===hr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cr(e)}function Cr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _r(e,t,r){return t&&xr(e.prototype,t),r&&xr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Dr=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kr(e,t)}(r,e);var t=Sr(r);function r(e){var n;return Rr(this,r),(n=t.call(this,Or({hitTolerance:10},e))).onFeatureHover=n.onFeatureHover.bind(Cr(n)),n.onFeatureClick=n.onFeatureClick.bind(Cr(n)),n.renderTrajectoriesInternal=n.renderTrajectoriesInternal.bind(Cr(n)),n.throttleRenderTrajectories=tr()(n.renderTrajectoriesInternal,50,{leading:!1,trailing:!0}),n.debounceRenderTrajectories=Yt()(n.renderTrajectoriesInternal,50,{leading:!0,trailing:!0,maxWait:5e3}),n}return _r(r,[{key:"defineProperties",value:function(e){var t=this,n=e.regexPublishedLineName,o=e.publishedLineName,i=e.tripNumber,c=e.operator,a=e.style,u=e.speed,l=e.pixelRatio,s=e.hoverVehicleId,f=e.selectedVehicleId,p=e.filter,y=e.sort,h=e.time,b=e.live,v={style:a};Object.keys(v).forEach((function(e){return void 0===v[e]&&delete v[e]}));var d=u||1,m=h||new Date;wr(Er(r.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:a||this.defaultStyle},speed:{get:function(){return d},set:function(e){d=e,t.start()}},filter:{value:p,writable:!0},sort:{value:y,writable:!0},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==b||b,writable:!0},time:{get:function(){return m},set:function(e){m=e&&e.getTime?e:new Date(e),t.renderTrajectories()}},trajectories:{value:{},writable:!0},renderedTrajectories:{get:function(){return t.tracker&&t.tracker.renderedTrajectories||[]}},hoverVehicleId:{value:s,writable:!0},selectedVehicleId:{value:f,writable:!0},pixelRatio:{value:l||window.devicePixelRatio||1,writable:!0},initTrackerOptions:{value:v,writable:!1},useRequestAnimationFrame:{value:e.useRequestAnimationFrame||!1,writable:!0},useThrottle:{value:e.useThrottle||!0,writable:!0},useDebounce:{value:e.useDebounce||!1,writable:!0},publishedLineName:{get:function(){return o},set:function(e){o=e,t.updateFilters()}},tripNumber:{get:function(){return i},set:function(e){i=e,t.updateFilters()}},operator:{get:function(){return c},set:function(e){c=e,t.updateFilters()}},regexPublishedLineName:{get:function(){return n},set:function(e){n=e,t.updateFilters()}},delayDisplay:{value:e.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:e.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:e.useDelayStyle||!1,writable:!0}}),this.useDelayStyle&&!this.sort&&(this.sort=function(e,t){var r=e.properties,n=t.properties;return null===r.delay&&null!==n.delay?1:null===n.delay&&null!==r.delay?-1:r.cancelled&&!n.cancelled?n.delay<18e4?-1:1:n.cancelled&&!r.cancelled?r.delay<18e4?1:-1:n.delay-r.delay}),this.updateFilters()}},{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};wr(Er(r.prototype),"init",this).call(this,e),this.tracker=new pr(Or(Or({style:function(){return t.style.apply(t,arguments)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(e){e.target.visible?t.start():t.stop()}))}},{key:"terminate",value:function(){if(this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker){var e=this.tracker.canvas;e.getContext("2d").clearRect(0,0,e.width,e.height),this.tracker=null}wr(Er(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var e=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){e.time=e.live?new Date:e.time.getTime()+e.updateTimeDelay*e.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){if(this.stopUpdateTime(),this.tracker){var e=this.tracker.canvas;e.getContext("2d").clearRect(0,0,e.width,e.height)}}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(e,t){if(!this.tracker)return!1;var r=this.live?Date.now():this.time,n=Object.values(this.trajectories);return this.sort&&n.sort(this.sort),this.renderState=this.tracker.renderTrajectories(n,Or(Or({},e),{},{pixelRatio:this.pixelRatio,time:r}),{noInterpolate:e.zoom<this.minZoomInterpolation||t,hoverVehicleId:this.hoverVehicleId,selectedVehicleId:this.selectedVehicleId,iconScale:this.iconScale,delayDisplay:this.delayDisplay,delayOutlineColor:this.delayOutlineColor,useDelayStyle:this.useDelayStyle}),!0}},{key:"renderTrajectories",value:function(e,t){var r=this;this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null),!t&&this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(e,t)})):!t&&this.useDebounce?this.debounceRenderTrajectories(e,t):!t&&this.useThrottle?this.throttleRenderTrajectories(e,t):this.renderTrajectoriesInternal(e,t)}},{key:"getVehicle",value:function(e){return Object.values(this.trajectories).filter(e)}},{key:"getVehiclesAtCoordinate",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(Qt.buffer)([].concat(vr(e),vr(e)),this.hitTolerance*t),o=Object.values(this.trajectories),i=[],c=0;c<o.length&&(o[c].properties.coordinate&&Object(Qt.containsCoordinate)(n,o[c].properties.coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.resolution,o=r.nb,i=this.getVehiclesAtCoordinate(e,n,o);return Promise.resolve({layer:this,features:i.map((function(e){return t.format.readFeature(e)})),coordinate:e})}},{key:"onZoomEnd",value:function(e){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(e){var t,r=Math.round(e),n=ft[r]||25,o=Math.max(25,n/this.speed),i=Math.min(o,500);if(this.useThrottle?this.throttleRenderTrajectories=tr()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0}):this.useDebounce&&(this.debounceRenderTrajectories=Yt()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0,maxWait:5e3})),null!==(t=this.api)&&void 0!==t&&t.buffer){var c=br(this.api.buffer,2)[1];this.api.buffer=[i,c]}return o}},{key:"updateFilters",value:function(){var e=tt.a.parse(window.location.search.toLowerCase()),t=this.publishedLineName||e.publishedlinename,r=this.tripNumber||e.tripnumber,n=this.operator||e.operator,o=this.regexPublishedLineName;(t||r||n||o)&&(this.filter=yr(t,r,n,o))}},{key:"defaultStyle",value:function(e,t){return St(e,t,this)}}]),r}(e)};function Ir(e){return(Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ar(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ar(Object(r),!0).forEach((function(t){Lr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ar(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Lr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ur(){return(Ur="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Vr(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Vr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kr(e)););return e}function qr(e,t){return(qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Nr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kr(e);if(t){var o=Kr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hr(this,r)}}function Hr(e,t){if(t&&("object"===Ir(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Kr(e){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qr(e,t)}(i,e);var t,r,n,o=Nr(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Br(this,i),(e=o.call(this,Mr({},t))).olLayer=t.olLayer||new Wt.Group({layers:[new Wt.Vector({source:new Gt.Vector({features:[]})}),new Wt.Layer({source:new Qe.a({}),render:function(t){if(!e.tracker||!e.tracker.canvas)return null;if(e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style.width="100%",e.container.style.height="100%",e.transformContainer=document.createElement("div"),e.transformContainer.style.position="absolute",e.transformContainer.style.width="100%",e.transformContainer.style.height="100%",e.container.appendChild(e.transformContainer),e.tracker.canvas.style.position="absolute",e.tracker.canvas.style.top="0",e.tracker.canvas.style.left="0",e.tracker.canvas.style.transformOrigin="top left",e.transformContainer.appendChild(e.tracker.canvas)),e.renderedViewState){var r=t.viewState,n=r.center,o=r.resolution,i=r.rotation,c=e.renderedViewState,a=c.center,u=c.resolution,l=c.rotation;if(u/o>=3){var s=e.tracker.canvas;s.getContext("2d").clearRect(0,0,s.width,s.height)}else{var f=e.map.getPixelFromCoordinate(a),p=e.map.getPixelFromCoordinate(n);e.transformContainer.style.transform=Object(Jt.composeCssTransform)(f[0]-p[0],f[1]-p[1],u/o,u/o,i-l,0,0)}}return e.container}})]}),e.vectorLayer=e.olLayer.getLayers().item(0),e.renderState={center:[0,0],zoom:null,rotation:0},e}return t=i,(r=[{key:"init",value:function(e){var t=this;Ur(Kr(i.prototype),"init",this).call(this,e),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(e){var r=t.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();t.currentZoom!==n&&t.onZoomEnd(e),t.currentZoom=n,t.onMoveEnd(e)}})))}},{key:"terminate",value:function(){Ur(Kr(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(e){if(this.map&&this.tracker&&this.tracker.canvas){var t=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(e);return!!t.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(e){var t=this.map.getView();Ur(Kr(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:t.calculateExtent(),resolution:t.getResolution(),rotation:t.getRotation(),zoom:t.getZoom(),pixelRatio:this.pixelRatio},e)}},{key:"renderTrajectoriesInternal",value:function(e,t){!this.map.getView().getAnimating()&&!this.map.getView().getInteracting()&&Ur(Kr(i.prototype),"renderTrajectoriesInternal",this).call(this,e,t)&&(this.renderedViewState=Mr({},e),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Ur(Kr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=this.map.getView().getResolution();return Ur(Kr(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(e))return Promise.resolve({features:[],layer:this,coordinate:e});var r=this.map.getView().getResolution();return Ur(Kr(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Mr({resolution:r},t))}},{key:"onMoveEnd",value:function(e){}},{key:"onZoomEnd",value:function(e){Ur(Kr(i.prototype),"onZoomEnd",this).call(this,e)}},{key:"onFeatureHover",value:function(e,t,r){Ur(Kr(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getTargetElement().style.cursor=e.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(e,t,r){Ur(Kr(i.prototype),"onFeatureClick",this).call(this,e,t,r),!e.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(e){return new i(Mr(Mr({},this.options),e))}}])&&Fr(t.prototype,r),n&&Fr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Dr(A)),Zr=r(14),Gr=r.n(Zr),Wr=r(4);function $r(e){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jr(Object(r),!0).forEach((function(t){Xr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function en(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tn(e,t){return(tn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=on(e);if(t){var o=on(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return nn(this,r)}}function nn(e,t){if(t&&("object"===$r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function on(e){return(on=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tn(e,t)}(i,e);var t,r,n,o=rn(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Yr(this,i),(e=o.call(this)).url=t.url,e.apiKey=t.apiKey,e}return t=i,(r=[{key:"fetch",value:function(e){function t(t,r,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r){var n=Qr(Qr({},t||{}),{},{key:this.apiKey}),o=Qr({},n);return Object.keys(n).forEach((function(e){return(void 0===o[e]||null===o[e])&&delete o[e]})),this.apiKey?fetch("".concat(this.url).concat(e||"","?").concat(tt.a.stringify(o)),r).then((function(e){try{return e.json().then((function(e){if(e.error)throw new Error(e.error);return e}))}catch(e){return Promise.reject(new Error(e))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&en(t.prototype,r),n&&en(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function an(e){return(an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ln(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?un(Object(r),!0).forEach((function(t){sn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yn(e,t){return(yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=vn(e);if(t){var o=vn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return bn(this,r)}}function bn(e,t){if(t&&("object"===an(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function vn(e){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yn(e,t)}(i,e);var t,r,n,o=hn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fn(this,i),o.call(this,ln({url:"https://api.geops.io/stops/v1/"},e))}return t=i,(r=[{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",e,{signal:t.signal}).then((function(e){return e.features}))}}])&&pn(t.prototype,r),n&&pn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(cn);function mn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var On=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=n.d,i=n.m,c=n.y;t.push({day:o,month:i,year:c})}return t},jn=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(r),!0).forEach((function(t){gn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);["a","f","tt"].forEach((function(e){t[e]||(t[e]={})}));for(var r=t.id,n=t.hs,o=t.t,i=t.ln,c=t.sn,a=t.wa,u=t.ba,l=t.rt,s=t.fid,f=t.rid,p=t.c,y=t.tc,h=t.a,b=h.n,v=h.u,d=h.tz,m=t.f,g=m.n,O=m.u,j=m.tz,w=t.tt,P=w.n,k=w.p,S=w.t,T=t.sts,C=On(P),E=On(k),R=p&&"#".concat(p),x=y&&"#".concat(y),_=[],D=0;D<(T||[]).length;D+=1){var I=T[D],A=I.sid,M=I.n,L=I.p,B=I.at,F=I.dt,U=I.ap,V=I.dp,q=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;_.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==B?1e3*U:null,departureTime:-1!==F?1e3*V:null,arrivalDelay:q,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:R,color:x,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:_,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:l,feedsId:s,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:E},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},wn=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],r=0;r<e.length;r+=1){var n=e[r],o=new Wr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,l=i.RouteIdentifier,s=i.DirectionText,f=i.Operator,p=i.OperatorURL,y=i.Publisher,h=i.PublisherURL,b=i.License,v=i.LicenseUrl,d=i.LicenseNote,m=i.Color,g=i.JourneyIdentifier,O=i.RealtimeAvailable,j=i.OperatorProvidesRealtime,w=i.DayOfOperation,P=i.Delay,k=i.TimeIntervals,S=i.TextColor,T=i.Cancelled;t.push({id:c,type:a,name:u,routeIdentifier:l,directionText:s,operator:f,operatorUrl:p,publisher:y,publisherUrl:h,license:b,licenseUrl:v,licenseNote:d,journeyIdentifier:g,realtimeAvailable:O,operatorProvidesRealtime:j,dayOfOperation:w,delay:P,timeIntervals:k,color:m&&"#".concat(m),textColor:S&&"#".concat(S),geometry:o,cancelled:T})}return t};function Pn(e){return(Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(r),!0).forEach((function(t){Tn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Tn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Rn(e,t){return(Rn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Dn(e);if(t){var o=Dn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _n(this,r)}}function _n(e,t){if(t&&("object"===Pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Dn(e){return(Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var In=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rn(e,t)}(i,e);var t,r,n,o=xn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Cn(this,i),o.call(this,Sn({url:"https://api.geops.io/tracker/v1"},e))}return t=i,(r=[{key:"fetchTrajectoryById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",e,{signal:t.signal})}},{key:"fetchTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",e,{signal:t.signal}).then((function(e){return wn(e.features)}))}},{key:"fetchTrajectoryStations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",e,{signal:t.signal}).then((function(e){return jn(e)}))}}])&&En(t.prototype,r),n&&En(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(cn);function An(e){return function(e){if(Array.isArray(e))return Mn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Mn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ln(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Bn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defineProperties()}var t,r,n;return t=e,n=[{key:"getRequestString",value:function(e,t){var r="".concat(e," ").concat(t.channel);return r+=t.args?" ".concat(t.args):"",(r+=t.id?" ".concat(t.id):"").trim()}}],(r=[{key:"defineProperties",value:function(){var e=this;Object.defineProperties(this,{closed:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSED)}},closing:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSING)}},connecting:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CONNECTING)}},open:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.OPEN)}},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}},{key:"connect",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(e),this.open?(r(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(function(){r(),t.subscribePreviousSubscriptions()}))}},{key:"close",value:function(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}},{key:"send",value:function(e){var t=this;if(this.websocket){var r=function(){t.websocket.send(e)};this.open?this.messagesOnOpen.includes(e)||r():this.messagesOnOpen.includes(e)||(this.messagesOnOpen.push(e),this.websocket.addEventListener("open",(function(){t.messagesOnOpen=[],r()})),this.websocket.addEventListener("close",(function(){t.messagesOnOpen=[]})))}}},{key:"listen",value:function(e,t,r){this.unlisten(e,t);var n=function(r){var n={};try{n=JSON.parse(r.data)}catch(e){console.error("WebSocket: unable to parse JSON data",e,r.data)}var o=e.channel;o+=e.args?" ".concat(e.args):"",("buffer"===n.source?n.content:[n]).forEach((function(r){(null==r?void 0:r.source)!==o||e.id&&e.id!==n.client_reference||t(r)}))};return this.websocket&&(this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r))),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(e,t){var r=this;this.websocket&&this.subscriptions.filter((function(r){return r.params.channel===e.channel&&(!t||r.cb===t)})).forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))}))}},{key:"get",value:function(t,r,n){var o=e.getRequestString("GET",t);this.send(o),this.listen(t,r,n)}},{key:"subscribe",value:function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(t,r,n),c=i.onMessageCb,a=i.onErrorCb,u=e.getRequestString("",t),l=this.subscriptions.findIndex((function(e){return t.channel===e.params.channel&&r===e.cb})),s={params:t,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,quiet:o};l>-1?this.subscriptions[l]=s:this.subscriptions.push(s),this.subscribed[u]||(s.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(e,t){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===e&&(!t||r.cb===t)}));n.forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==e||t&&r.cb!==t})),e&&this.subscribed[e]&&!this.subscriptions.find((function(t){return t.params.channel===e}))&&n.find((function(e){return!e.quiet}))&&(this.send("DEL ".concat(e)),this.subscribed[e]=!1)}},{key:"subscribePreviousSubscriptions",value:function(){var e=this;Object.keys(this.subscribed).forEach((function(t){e.subscribed[t]=!1})),An(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)}))}}])&&Ln(t.prototype,r),n&&Ln(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Fn=function(e,t){return e===t.SCHEMATIC?"_schematic":""},Un=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=e.has_fzo&&n.indexOf(e.state)>-1,i=t.has_fzo&&n.indexOf(t.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(e.state!==t.state)return n.indexOf(e.state)-n.indexOf(t.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(e.min_arrival_time||e.time).getTime()-u,a=new Date(t.min_arrival_time||t.time).getTime()-u):(c=new Date(e.time).getTime()-u,a=new Date(t.time).getTime()-u),c-a},Vn=function(e){if(e)return e.stations.forEach((function(e){e.arrivalTimeWithDelay=e.arrivalTime,e.departureTime&&(e.departureTimeWithDelay=e.departureTime),e.arrivalDelay&&(e.arrivalTime-=e.arrivalDelay,e.departureTime&&(e.departureTime-=e.arrivalDelay))})),e};function qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Hn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},Kn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qn(this,e),this.defineProperties(t),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=t.prefix||"",this.onOpen=this.onOpen.bind(this)}var t,r,n;return t=e,(r=[{key:"defineProperties",value:function(e){var t=this,r=e;"string"==typeof e&&(r={url:e});var n=r.apiKey,o=r,i=o.url,c=o.projection,a=o.bbox,u=o.buffer,l=void 0===u?[100,100]:u,s=new Bn;n&&(i="".concat(i||"wss://tralis-tracker-api.geops.io/ws","?key=").concat(n)),Object.defineProperties(this,{url:{get:function(){return i},set:function(e){i=e,t.open()}},projection:{get:function(){return c},set:function(e){e!==c&&(c=e,t.conn&&t.conn.send("PROJECTION ".concat(c)))}},bbox:{get:function(){return a},set:function(e){JSON.stringify(e)!==JSON.stringify(a)&&(a=e,t.conn&&t.conn.send("BBOX ".concat(a.join(" "))))}},buffer:{get:function(){return l},set:function(e){JSON.stringify(e)!==JSON.stringify(l)&&(l=e,t.conn&&t.conn.send("BUFFER ".concat(l.join(" "))))}},conn:{value:s,writable:!0},pingIntervalMs:{value:e.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:e.pingIntervalMs||100,writable:!0}})}},{key:"open",value:function(){var e=this;this.close(),this.conn.connect(this.url,this.onOpen),this.conn.websocket.onclose=function(){e.onClose()}}},{key:"close",value:function(){this.conn.close()}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"onOpen",value:function(){var e=this;this.projection&&this.conn.send("PROJECTION ".concat(this.projection)),this.bbox&&this.conn.send("BBOX ".concat(this.bbox.join(" "))),this.buffer&&this.conn.send("BUFFER ".concat(this.buffer.join(" "))),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval((function(){e.conn.send("PING")}),this.pingIntervalMs))}},{key:"onClose",value:function(){var e=this;window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((function(){return e.open()}),this.reconnectTimeoutMs))}},{key:"subscribe",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:e},t,r,n)}},{key:"unsubscribe",value:function(e,t,r){this.conn.unsubscribe("".concat(e).concat(Fn(Hn.SCHEMATIC,Hn)).concat(t),r),this.conn.unsubscribe("".concat(e).concat(Fn(Hn.TOPOGRAPHIC,Hn)).concat(t||""),r)}},{key:"filterDepartures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(e).map((function(t){return e[t]}));r.sort((function(e,r){return Un(e,r,t)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],c=[],a=null,u=r.length-1;u>=0;u-=1){var l=r[u],s=new Date(l.time).getTime();s>o&&s<n&&("BOARDING"===l.state&&(-1===c.indexOf(l.platform)?c.push(l.platform):l.state="HIDDEN"),a&&l.to[0]===a.to[0]&&Math.abs(s-a.time)<1e3&&l.line.name===a.line.name&&(l.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(l.state)&&(l.cancelled=!0),(a=l).time=s,i.unshift(l))}return i}},{key:"subscribeDepartures",value:function(e,t,r){var n=this;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=e;var o=e?"timetable_".concat(e):null,i={};this.subscribe(o,(function(e){if(e.source===o){var c=e.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(n.departureUpdateTimeout),n.departureUpdateTimeout=window.setTimeout((function(){var e=n.filterDepartures(i,t||!1);r(e)}),100)}}),(function(){r([])}))}},{key:"unsubscribeDepartures",value:function(e){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",e),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(e){this.subscribe("".concat(this.prefix,"newsticker"),(function(t){e(t.content)}))}},{key:"unsubscribeDisruptions",value:function(e){this.unsubscribe("".concat(this.prefix,"newsticker"),"",e)}},{key:"getStation",value:function(e,t){var r=this,n={channel:"station".concat(Fn(t,Hn)),args:e};return new Promise((function(e,t){r.conn.get(n,(function(r){r.content?e(r.content):t()}))}))}},{key:"getStations",value:function(e){var t=this,r=[],n={channel:"station".concat(Fn(e,Hn))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(e,o){t.conn.get(n,(function(n){n.content?(r.push(n.content),window.clearTimeout(t.stationUpdateTimeout),t.stationUpdateTimeout=window.setTimeout((function(){e(r)}),50)):o(n.content)}))}))}},{key:"subscribeStations",value:function(e,t){this.unsubscribeStations(),this.subscribe("station".concat(Fn(e,Hn)),(function(e){e.content&&t(e.content)}))}},{key:"unsubscribeStations",value:function(e){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",e)}},{key:"subscribeExtraGeoms",value:function(e){var t=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?t.extraGeoms[o]=n:delete t.extraGeoms[o],e(Object.keys(t.extraGeoms).map((function(e){return t.extraGeoms[e]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(e){this.unsubscribe("extra_geoms","",e)}},{key:"subscribeTrajectory",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeTrajectory(t),this.subscribe("trajectory".concat(Fn(e,Hn)),t,null,r)}},{key:"unsubscribeTrajectory",value:function(e){this.unsubscribe("trajectory","",e)}},{key:"subscribeDeletedVehicles",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeDeletedVehicles(t),this.subscribe("deleted_vehicles".concat(Fn(e,Hn)),t,null,r)}},{key:"unsubscribeDeletedVehicles",value:function(e){this.unsubscribe("deleted_vehicles","",e)}},{key:"getFullTrajectory",value:function(e,t,r){var n=this,o=["full_trajectory".concat(Fn(t,Hn))];e&&o.push(e),t&&t!==Hn.TOPOGRAPHIC||!r||o.push("gen".concat(r));var i={channel:o.join("_")};return new Promise((function(e){n.conn.get(i,(function(t){t.content&&e(t.content)}))}))}},{key:"getFullTrajectories",value:function(e,t,r){var n=this,o=e.map((function(e){return n.getFullTrajectory(e,t,r)}));return Promise.all(o)}},{key:"subscribeFullTrajectory",value:function(e,t){this.unsubscribeFullTrajectory(e),this.subscribe("full_trajectory".concat(Fn(t,Hn),"_").concat(e),(function(e){console.log("subscribe full_trajectory",e)}),(function(e){console.log("subscribe full_trajectory error",e)}))}},{key:"unsubscribeFullTrajectory",value:function(e,t){this.unsubscribe("full_trajectory","_".concat(e),t)}},{key:"getStopSequence",value:function(e){var t=this,r={channel:"stopsequence_".concat(e)};return new Promise((function(e,n){t.conn.get(r,(function(t){if(t.content&&t.content.length){var r=t.content.map((function(e){return Vn(e)}));e(r)}e([])}),(function(e){n(e)}))}))}},{key:"getStopSequences",value:function(e){var t=this,r=e.map((function(e){return t.getStopSequence(e)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(e,t){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(e),this.subscribe("stopsequence_".concat(e),(function(e){if(e.content&&e.content.length){var r=e.content.map((function(e){return Vn(e)}));t(r)}}),(function(e){console.log("subscribe stopsequence error",e)}))}},{key:"unsubscribeStopSequence",value:function(e,t){this.unsubscribe("stopsequence","_".concat(e),t)}},{key:"subscribeHealthCheck",value:function(e){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",e)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&Nn(t.prototype,r),n&&Nn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function zn(e){return(zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(r),!0).forEach((function(t){Wn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Jn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Qn(){return(Qn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Xn(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Xn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ro(e)););return e}function Yn(e,t){return(Yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ro(e);if(t){var o=ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return to(this,r)}}function to(e,t){if(t&&("object"===zn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ro(e){return(ro=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function no(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function io(e,t,r){return t&&oo(e.prototype,t),r&&oo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var co=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yn(e,t)}(r,e);var t=eo(r);function r(){return no(this,r),t.apply(this,arguments)}return io(r,[{key:"defineProperties",value:function(e){var t=this;Qn(ro(r.prototype),"defineProperties",this).call(this,e);var n,o=3;if(!e.api){var i={};e.url&&(i.url=e.url),e.apiKey&&(i.apiKey=e.apiKey),n=new In(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(e){e!==o&&(o=e,t.visible&&t.start())}},api:{value:e.api||n}})}},{key:"init",value:function(e){Qn(ro(r.prototype),"init",this).call(this,e),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(e,t){return null===e.delay||e.delay<t.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),Qn(ro(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Qn(ro(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(e,t,n){var o=$n(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Qn(ro(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=$n(e,1)[0];o?(this.selectedVehicleId=o.get("train_id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Qn(ro(r.prototype),"onFeatureClick",this).call(this,e,t,n)}},{key:"highlightTrajectory",value:function(){var e=this,t=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:t,time:Rt(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:Rt(new Date)}))];Promise.all(n).then((function(t){var r=$n(t,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(e){i.push(e.coordinates)})),o){var c=o.p,a=o.t,u=o.c,l=[];c.forEach((function(e){e.forEach((function(e){l.push([e.x,e.y])}))}));var s=u?"#".concat(u):ht(a),f=/#ffffff/i.test(s)?"#ff0000":s;e.drawFullTrajectory(i,l,e.useDelayStyle?"#a0a0a0":f)}})).catch((function(){e.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=1e3*(this.requestIntervalSeconds+5),r=this.speed*t,n=this.time,o=!0;if(this.later&&n.getTime()>this.later.getTime()-1e3*this.requestIntervalSeconds&&(o=!1),!this.later||!o||this.later.getTime()-n.getTime()>r){var i=new Date(n.getTime()+r);this.later=i}var c=Gn(Gn({},e),{},{btime:Rt(n),etime:Rt(this.later),date:Et(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var e=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){e.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var e=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(e){if("AbortError"!==e.name)throw e})).then((function(t){t&&(e.trajectories=t,e.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(e,t,r){}},{key:"defaultStyle",value:function(e,t){var r=t.zoom,n=e.type,o=e.name,i=e.id,c=e.color,a=e.textColor,u=e.delay,l=e.cancelled,s=e.operatorProvidesRealtime,f=Math.min(Math.floor(r||1),16),p=this.hoverVehicleId===i,y=this.selectedVehicleId===i,h="".concat(f).concat(n).concat(o).concat(s).concat(u).concat(p).concat(y).concat(l),b=yt(n,f)*this.pixelRatio,v=b>=7*this.pixelRatio;(p||y)&&(b=v?b+5*this.pixelRatio:14*this.pixelRatio);var d=b>10*this.pixelRatio;if(d||(h="".concat(f).concat(n).concat(c).concat(s).concat(u).concat(p).concat(y).concat(l)),!this.styleCache[h]){if(0===b)return this.styleCache[h]=null,null;var m=1*this.pixelRatio,g=b+2,O=2*b,j=document.createElement("canvas");j.width=2*g+2*m+100*this.pixelRatio,j.height=2*g+2*m+100*this.pixelRatio;var w,P=j.getContext("2d"),k=j.width/2;if(v&&null!==u&&(P.save(),P.beginPath(),P.arc(k,k,g,0,2*Math.PI,!1),P.fillStyle=dt(u,l),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||l)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(l?19:14,Math.min(l?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=dt(u,l,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=mt(u,l);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?dt(u,l):c||ht(n),P.save(),(v||p||y)&&(P.lineWidth=1*this.pixelRatio,P.strokeStyle="#000000"),P.fillStyle=w,P.beginPath(),P.arc(k,k,b,0,2*Math.PI,!1),P.fill(),v&&this.useDelayStyle&&null===u&&"yes"===s&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=vt(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===s&&(P.save(),P.textBaseline="middle",P.textAlign="center",P.font="bold ".concat(C+2,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.restore()),P.save(),P.textBaseline="middle",P.textAlign="center",P.fillStyle=this.useDelayStyle?"#000000":a||bt(n),P.font="bold ".concat(C,"px Arial"),P.strokeStyle=w,P.strokeText(o,k,k),P.fillText(o,k,k),P.restore()}this.styleCache[h]=j}return this.styleCache[h]}}]),r}(e)};function ao(e){return(ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(r),!0).forEach((function(t){so(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function so(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function po(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yo(){return(yo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ho(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ho(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=go(e)););return e}function bo(e,t){return(bo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=go(e);if(t){var o=go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mo(this,r)}}function mo(e,t){if(t&&("object"===ao(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function go(e){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Oo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bo(e,t)}(i,e);var t,r,n,o=vo(i);function i(){return fo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"start",value:function(){var e=this;this.map&&(yo(go(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){e.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),yo(go(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var e=this.map.getView().getZoom();e!==this.currentZoom&&(this.currentZoom=e,this.requestIntervalSeconds=200/e||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(e,t,r){var n=this.vectorLayer.getSource();if(n.clear(),e){var o=new Wr.MultiPoint(e.map((function(e){return Object(Ge.fromLonLat)(e)}))),i=new Gr.a(o);i.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var c=new Gr.a(o);c.setStyle(new Zt.Style({zIndex:4,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:r})})})),n.addFeatures([i,c])}if(t){var a=new Gr.a({geometry:new Wr.LineString(t)});a.setStyle([new Zt.Style({zIndex:2,stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,stroke:new Zt.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getView().calculateExtent(),r=Object(Qt.buffer)(t,Object(Qt.getWidth)(t)/10).join(","),n=this.map.getView().getZoom();return yo(go(i.prototype),"getParams",this).call(this,lo(lo({},e),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(e){return new i(lo(lo({},this.options),e))}}])&&po(t.prototype,r),n&&po(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(co(zr));r(29);function jo(e){return(jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(e,t)||ko(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Po(e){return function(e){if(Array.isArray(e))return So(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ko(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ko(e,t){if(e){if("string"==typeof e)return So(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?So(e,t):void 0}}function So(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function To(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Co(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?To(Object(r),!0).forEach((function(t){Eo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):To(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ro(){return(Ro="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=xo(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function xo(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Mo(e)););return e}function _o(e,t){return(_o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Do(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mo(e);if(t){var o=Mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Io(this,r)}}function Io(e,t){if(t&&("object"===jo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ao(e)}function Ao(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mo(e){return(Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Lo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fo(e,t,r){return t&&Bo(e.prototype,t),r&&Bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Uo=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_o(e,t)}(r,e);var t=Do(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Lo(this,r),(e=t.call(this,Co({},n))).debug=n.debug,e.mode=n.mode||Hn.TOPOGRAPHIC,e.api=n.api||new Kn(n),e.tenant=n.tenant||"",e.minZoomNonTrain=n.minZoomNonTrain||9,e.minZoomInterpolation=n.minZoomInterpolation||8,e.format=new Ye.a,e.generalizationLevelByZoom=n.generalizationLevelByZoom||{0:5,1:5,2:5,3:5,4:5,5:5,6:5,7:5,8:10,9:30,10:30,11:100,12:100,13:100},e.isUpdateBboxOnMoveEnd=!1!==n.isUpdateBboxOnMoveEnd,e.onTrajectoryMessage=e.onTrajectoryMessage.bind(Ao(e)),e.onDeleteTrajectoryMessage=e.onDeleteTrajectoryMessage.bind(Ao(e)),e.onDocumentVisibilityChange=e.onDocumentVisibilityChange.bind(Ao(e)),e}return Fo(r,[{key:"init",value:function(e){Ro(Mo(r.prototype),"init",this).call(this,e),document.addEventListener("visibilitychange",this.onDocumentVisibilityChange)}},{key:"terminate",value:function(){document.removeEventListener("visibilitychange",this.onDocumentVisibilityChange),Ro(Mo(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Ro(Mo(r.prototype),"start",this).call(this),this.api.open(),this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.isUpdateBboxOnMoveEnd&&this.setBbox()}},{key:"stop",value:function(){Ro(Mo(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close()}},{key:"setBbox",value:function(e,t){for(var r=Object.keys(this.trajectories),n=r.length-1;n>=0;n-=1)this.purgeTrajectory(this.trajectories[r[n]],e,t);var o=Po(e);this.isUpdateBboxOnMoveEnd&&(o.push(t),this.tenant&&o.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[t],this.generalizationLevel&&o.push("gen=".concat(this.generalizationLevel))),this.api.bbox=o}},{key:"setMode",value:function(e){this.mode!==e&&(this.mode=e,this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd))}},{key:"getTrajectoryInfos",value:function(e){var t=[this.api.getStopSequence(e,this.mode),this.api.getFullTrajectory(e,this.mode,this.generalizationLevel)];return Promise.all(t).then((function(e){var t=wo(e,2);return{stopSequence:t[0],fullTrajectory:t[1]}}))}},{key:"purgeTrajectory",value:function(e,t,r){var n=e.properties,o=n.type,i=n.bounds,c=n.train_id;return(!Object(Qt.intersects)(t,i)||"rail"!==o&&r<(this.minZoomNonTrain||9))&&(this.removeTrajectory(c),!0)}},{key:"addTrajectory",value:function(e){this.filter&&!this.filter(e)||(this.trajectories[e.properties.train_id]=e,this.renderTrajectories())}},{key:"removeTrajectory",value:function(e){delete this.trajectories[e]}},{key:"onDocumentVisibilityChange",value:function(){this.visible&&(document.hidden?this.stop():this.start())}},{key:"onTrajectoryMessage",value:function(e){if(e.content){var t=e.content,r=t.geometry,n=t.properties,o=(n.train_id,n.time_since_update),i=n.raw_coordinates;o<0||this.purgeTrajectory(t)||(this.debug&&this.mode===Hn.TOPOGRAPHIC&&i?t.properties.olGeometry={type:"Point",coordinates:Object(Ge.fromLonLat)(i,this.map.getView().getProjection())}:t.properties.olGeometry=this.format.readGeometry(r),t.properties.timeOffset=Date.now()-e.timestamp,this.addTrajectory(t))}}},{key:"onDeleteTrajectoryMessage",value:function(e){e.content&&this.removeTrajectory(e.content)}},{key:"onFeatureHover",value:function(e,t,n){var o=wo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories(!0)),Ro(Mo(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=wo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.selectedVehicleId!==i&&(this.selectedVehicleId=i,this.selectedVehicle=o,this.renderTrajectories(!0)),Ro(Mo(r.prototype),"onFeatureClick",this).call(this,e,t,n)}}]),r}(e)};function Vo(e){return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function No(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qo(Object(r),!0).forEach((function(t){Ho(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ho(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ko(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zo(){return(Zo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Go(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Go(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Qo(e)););return e}function Wo(e,t){return(Wo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qo(e);if(t){var o=Qo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jo(this,r)}}function Jo(e,t){if(t&&("object"===Vo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Qo(e){return(Qo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xo=new Ye.a,Yo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wo(e,t)}(i,e);var t,r,n,o=$o(i);function i(){return Ko(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"purgeTrajectory",value:function(e,t,r){return Zo(Qo(i.prototype),"purgeTrajectory",this).call(this,e,t||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.map.getView().calculateExtent(),n=Math.floor(this.map.getView().getZoom())),Zo(Qo(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Zo(Qo(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.isClickActive&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"onFeatureClick",value:function(e,t,r){Zo(Qo(i.prototype),"onFeatureClick",this).call(this,e,t,r),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"highlightTrajectory",value:function(e){var t=this;this.api.getFullTrajectory(e,this.mode,this.generalizationLevel).then((function(e){if(t.vectorLayer.getSource().clear(),e&&e.features&&e.features.length){var r="#ffffff";if(t.useDelayStyle)r="#a0a0a0";else{var n=e.features[0].properties,o=n.type,i=n.stroke;i&&"#"!==i[0]&&(i="#".concat(i)),r=i||ht(o),r=/#ffffff/i.test(r)?"#ff0000":r}var c=[new Zt.Style({zIndex:2,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})}),stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:r})}),stroke:new Zt.Stroke({color:r,width:4})})];t.vectorLayer.setStyle(c);var a=Xo.readFeatures(e);a.forEach((function(e){e.setStyle(c)})),t.vectorLayer.getSource().addFeatures(a)}}))}},{key:"clone",value:function(e){return new i(No(No({},this.options),e))}}])&&zo(t.prototype,r),n&&zo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Uo(zr));function ei(e){return(ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ri(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ti(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ti(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ni(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ii(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ci(e,t){return(ci=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ai(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=li(e);if(t){var o=li(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ui(this,r)}}function ui(e,t){if(t&&("object"===ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function li(e){return(li=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var si=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ci(e,t)}(i,e);var t,r,n,o=ai(i);function i(){return oi(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(e);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(e){return e===t.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:e})}},{key:"clone",value:function(e){return new i(ri(ri({},this.options),e))}}])&&ii(t.prototype,r),n&&ii(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);function fi(e){return(fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pi(Object(r),!0).forEach((function(t){hi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function di(e,t){return(di=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Oi(e);if(t){var o=Oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gi(this,r)}}function gi(e,t){if(t&&("object"===fi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oi(e){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ji=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&di(e,t)}(i,e);var t,r,n,o=mi(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return bi(this,i),(e=o.call(this,t)).abortController=new AbortController,e.format=new Ye.a,e}return t=i,(r=[{key:"getFeatureInfoUrl",value:function(e){var t=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(e,r,t,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(e),{signal:r}).then((function(e){return e.json()})).then((function(e){return e.features})).then((function(r){return{layer:t,coordinate:e,features:r.map((function(e){return t.format.readFeature(e)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:e,layer:t})}))}},{key:"clone",value:function(e){return new i(yi(yi({},this.options),e))}}])&&vi(t.prototype,r),n&&vi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);r(15),r(26),r(27),r(19);function wi(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ki(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pi(Object(r),!0).forEach((function(t){Si(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Si(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ti(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ci(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ri(e);if(t){var o=Ri(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ei(this,r)}}function Ei(e,t){if(t&&("object"===wi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ri(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Di(e,t,r){return t&&_i(e.prototype,t),r&&_i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ii(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ai(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Li(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ui(e);if(t){var o=Ui(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Fi(this,r)}}function Fi(e,t){if(t&&("object"===Ii(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ui(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Vi=G;var Vi;function qi(e){return(qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ni(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hi(){return(Hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ki(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ki(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$i(e)););return e}function zi(e,t){return(zi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$i(e);if(t){var o=$i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gi(this,r)}}function Gi(e,t){if(t&&("object"===qi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wi(e)}function Wi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $i(e){return($i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ji=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zi(e,t)}(i,e);var t,r,n,o=Zi(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).render=t.render.bind(Wi(t)),t}return t=i,(r=[{key:"activate",value:function(){Hi($i(i.prototype),"activate",this).call(this),this.map&&(this.map.on("sourcedata",this.render),this.map.on("styledata",this.render),this.map.on("idle",this.render))}},{key:"deactivate",value:function(){this.map&&(this.map.off("sourcedata",this.render),this.map.off("styledata",this.render),this.map.off("idle",this.render)),Hi($i(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return ct(this.map)}}])&&Ni(t.prototype,r),n&&Ni(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function Qi(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Yi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xi(Object(r),!0).forEach((function(t){ec(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ec(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rc(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=nc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function nc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==ac(e););return e}function oc(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ic(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ac(e);if(t){var o=ac(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return cc(this,r)}}function cc(e,t){if(t&&("object"===Qi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ac(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ae(We.Map);var uc=r(20),lc=r.n(uc),sc=r(21);function fc(e){return(fc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pc(e){return function(e){if(Array.isArray(e))return yc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(r),!0).forEach((function(t){vc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function gc(){return(gc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Oc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Oc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=kc(e)););return e}function jc(e,t){return(jc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kc(e);if(t){var o=kc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pc(this,r)}}function Pc(e,t){if(t&&("object"===fc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function kc(e){return(kc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Sc(e){return function(e){if(Array.isArray(e))return Tc(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Tc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tc(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Cc=function(e){var t=e.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Sc(r),Sc(n)),i=e.getCanvas(),c=i.width,a=i.height,u=Object(Qt.getWidth)(o)/c,l=Object(Qt.getHeight)(o)/a;return Math.max(u,l)},Ec=function(e,t){var r=e.getCanvas(),n=r.width,o=r.height,i=e.unproject({x:0,y:0}),c=e.unproject({x:0,y:o/t}),a=e.unproject({x:n/t,y:o/t}),u=e.unproject({x:n/t,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function Rc(e){return(Rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xc(e){return function(e){if(Array.isArray(e))return _c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return _c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _c(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Dc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ic(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dc(Object(r),!0).forEach((function(t){Ac(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ac(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Bc(){return(Bc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Fc(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Fc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Hc(e)););return e}function Uc(e,t){return(Uc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Hc(e);if(t){var o=Hc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qc(this,r)}}function qc(e,t){if(t&&("object"===Rc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Nc(e)}function Nc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hc(e){return(Hc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Kc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uc(e,t)}(i,e);var t,r,n,o=Vc(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Mc(this,i),(e=o.call(this,Ic({},t))).onMove=e.onMove.bind(Nc(e)),e.onMoveEnd=e.onMoveEnd.bind(Nc(e)),e.onZoomEnd=e.onZoomEnd.bind(Nc(e)),e.onVisibilityChange=e.onVisibilityChange.bind(Nc(e)),e}return t=i,(r=[{key:"init",value:function(e,t){if(e){var r=e.getCanvas();Bc(Hc(i.prototype),"init",this).call(this,e,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:Ec(e,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=t,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},e.addSource(this.key,n),e.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),Bc(Hc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Bc(Hc(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomend",this.onZoomEnd)}},{key:"stop",value:function(){Bc(Hc(i.prototype),"stop",this).call(this),this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd),this.map.off("zoomend",this.onZoomEnd))}},{key:"onUserClickCallback",value:function(e){Bc(Hc(i.prototype),"onUserClickCallback",this).call(this,Ic({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"onUserMoveCallback",value:function(e){Bc(Hc(i.prototype),"onUserMoveCallback",this).call(this,Ic({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"renderTrajectories",value:function(e){var t=this.map.getCanvas(),r=t.width,n=t.height,o=this.map.getCenter(),c=this.map.unproject({x:0,y:n/this.pixelRatio}),a=this.map.unproject({x:r/this.pixelRatio,y:0}),u=lc()(Object(sc.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=lc()(Object(sc.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=[].concat(xc(Object(Ge.fromLonLat)(u)),xc(Object(Ge.fromLonLat)(l))),f=Object(Qt.getWidth)(s)/(r/this.pixelRatio),p=Object(Qt.getHeight)(s)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ge.fromLonLat)([o.lng,o.lat]),extent:s,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};Bc(Hc(i.prototype),"renderTrajectories",this).call(this,h,e)}},{key:"getRefreshTimeInMs",value:function(){return Bc(Hc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=Cc(this.map);return Bc(Hc(i.prototype),"getVehiclesAtCoordinate",this).call(this,e,r,t)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Cc(this.map);return Bc(Hc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Ic({resolution:r},t))}},{key:"onVisibilityChange",value:function(){this.visible&&!this.map.getLayer(this.key)?this.map.addLayer(this.layer,this.beforeId):this.map.getLayer(this.key)&&this.map.removeLayer(this.key)}},{key:"onMove",value:function(){var e=Ec(this.map,this.pixelRatio),t=this.map.getSource(this.key);t&&t.setCoordinates(e),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){this.renderTrajectories()}},{key:"onFeatureHover",value:function(e,t,r){Bc(Hc(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getCanvasContainer().style.cursor=e.length?"pointer":"auto"}}])&&Lc(t.prototype,r),n&&Lc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Dr(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jc(e,t)}(i,e);var t,r,n,o=wc(i);function i(){return dc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"init",value:function(e){gc(kc(i.prototype),"init",this).call(this,e),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(e){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),gc(kc(i.prototype),"terminate",this).call(this,e)}},{key:"onUserClickCallback",value:function(e){gc(kc(i.prototype),"onUserClickCallback",this).call(this,bc({coordinate:e.lngLat.toArray()},e))}},{key:"onUserMoveCallback",value:function(e){gc(kc(i.prototype),"onUserMoveCallback",this).call(this,bc({coordinate:e.lngLat.toArray()},e))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var e=this.map.getBounds().toArray();return Object(Ge.transformExtent)([].concat(pc(e[0]),pc(e[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(e){return new i(bc(bc({},this.options),e))}}])&&mc(t.prototype,r),n&&mc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w)));function zc(e){return(zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wc(){return(Wc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=$c(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function $c(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Yc(e)););return e}function Jc(e,t){return(Jc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Yc(e);if(t){var o=Yc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Xc(this,r)}}function Xc(e,t){if(t&&("object"===zc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Yc(e){return(Yc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ea=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jc(e,t)}(i,e);var t,r,n,o=Qc(i);function i(){return Zc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"purgeTrajectory",value:function(e,t,r){return Wc(Yc(i.prototype),"purgeTrajectory",this).call(this,e,t||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.getMercatorExtent(),n=Math.floor(this.getOlZoom())),Wc(Yc(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Wc(Yc(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Gc(t.prototype,r),n&&Gc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Uo(Kc));function ta(e){return(ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ra(e){return function(e){if(Array.isArray(e))return na(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return na(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return na(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function oa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ia(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(r),!0).forEach((function(t){ca(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ca(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ua(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function la(){return(la="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=sa(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function sa(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ba(e)););return e}function fa(e,t){return(fa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ba(e);if(t){var o=ba(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ya(this,r)}}function ya(e,t){if(t&&("object"===ta(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ha(e)}function ha(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ba(e){return(ba=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var va={mapbox:{TrajservLayer:function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fa(e,t)}(i,e);var t,r,n,o=pa(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return aa(this,i),(e=o.call(this,ia({},t))).onMove=e.onMove.bind(ha(e)),e.onMoveEnd=e.onMoveEnd.bind(ha(e)),e.onVisibilityChange=e.onVisibilityChange.bind(ha(e)),e}return t=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(e){Object(c.unByKey)(e)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),la(ba(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(la(ba(i.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd))}},{key:"stop",value:function(){this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd)),la(ba(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.map.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(ra(r),ra(n)),c=Object(Qt.buffer)(o,Object(Qt.getWidth)(o)/10).join(","),a=this.map.getZoom();return la(ba(i.prototype),"getParams",this).call(this,ia(ia({},e),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(e,t,r){console.log("to be implemented")}}])&&ua(t.prototype,r),n&&ua(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(co(Kc)),TralisLayer:ea},ol:{Map:Ze,Layer:A,WMSLayer:ji,MapboxLayer:zt,TrajservLayer:Oo,TralisLayer:Yo,VectorLayer:si}};t.default=va}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],t):"object"==typeof exports?exports["mobility-toolbox-js"]=t():e["mobility-toolbox-js"]=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=require("ol/proj")},function(e,t){e.exports=require("ol/style")},function(e,t){e.exports=require("ol/Observable")},function(e,t){e.exports=require("ol/geom")},function(e,t){e.exports=require("ol/extent")},function(e,t){e.exports=require("ol/format/GeoJSON")},function(e,t){e.exports=require("query-string")},function(e,t){e.exports=require("ol/source/Source")},function(e,t){e.exports=require("ol/layer/Layer")},function(e,t){e.exports=require("ol/layer")},function(e,t){e.exports=require("ol/transform")},function(e,t){e.exports=require("ol/source")},function(e,t){e.exports=require("ol/Object")},function(e,t){e.exports=require("ol")},function(e,t){e.exports=require("lodash.debounce")},function(e,t){e.exports=require("lodash.throttle")},function(e,t){e.exports=require("ol/geom/GeometryType")},function(e,t){e.exports=require("ol/format")},function(e,t){e.exports=require("@turf/transform-rotate")},function(e,t){e.exports=require("@turf/helpers")},function(e,t){e.exports=require("ol/layer/Group")},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("mapbox-gl")},function(e,t){e.exports=require("maplibre-gl")},function(e,t){e.exports=require("ol/math")},function(e,t){e.exports=require("ol/interaction")},function(e,t){e.exports=require("ol/events/condition")},function(e,t,r){e.exports=r(29)},function(e,t){e.exports=require("ol/geom/Point")},function(e,t,r){"use strict";r.r(t);var n=r(2),o=r.n(n),i=r(20),a=r.n(i),c=r(21);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=m(e);if(t){var o=m(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return v(this,r)}}function v(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(i,e);var t,r,n,o=b(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p(this,i),(e=o.call(this)).defineProperties(t);var r=t.onClick,n=t.onHover;return n&&e.onHover(n),r&&e.onClick(r),t.copyrights&&(e.copyrights=t.copyrights),e.onUserClickCallback=e.onUserClickCallback.bind(d(e)),e.onUserMoveCallback=e.onUserMoveCallback.bind(d(e)),e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=l({isQueryable:!0,isClickActive:!0,isHoverActive:!0},e),n=r.name,o=r.key,i=r.children,a=r.visible,u=r.properties,s=r.isBaseLayer,f=r.isQueryable,p=r.isClickActive,y=r.isHoverActive,h=r.hitTolerance,b=Object(c.v4)(),v=n||b;Object.defineProperties(this,{options:{value:e},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!s},isQueryable:{value:!!f,writable:!0},isClickActive:{value:!!f&&!!p,writable:!0},isHoverActive:{value:!!f&&!!y,writable:!0},hitTolerance:{value:h||5,writable:!0},isMobilityLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return t.get("copyrights")},set:function(e){var r=Array.isArray(e)?e:[e];t.set("copyrights",r)}},visible:{value:void 0===a||a,writable:!0},properties:{value:l({},u||{})},map:{writable:!0},clickCallbacks:{value:[]},hoverCallbacks:{value:[]}})}},{key:"init",value:function(e){this.terminate(),this.map=e}},{key:"terminate",value:function(){}},{key:"get",value:function(e){return this.properties[e]}},{key:"set",value:function(e,t){t!==this.properties[e]&&(this.properties[e]=t,this.dispatchEvent({type:"change:".concat(e),target:this}))}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(this.visible=e,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:t,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(e){return e.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.children.find((function(e){return!0===e.visible}))}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),this.isQueryable=!1,Promise.resolve({layer:this,features:[],coordinate:e})}},{key:"onClick",value:function(e){if("function"!=typeof e)throw new Error("onClick callback must be of type function:",e);this.clickCallbacks.includes(e)||this.clickCallbacks.push(e)}},{key:"unClick",value:function(e){if("function"==typeof e){var t=this.clickCallbacks.indexOf(e);t>-1&&this.clickCallbacks.splice(t,1)}}},{key:"onUserClickCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.clickCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(e){if("function"!=typeof e)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(e)||this.hoverCallbacks.push(e)}},{key:"unHover",value:function(e){if("function"==typeof e){var t=this.hoverCallbacks.indexOf(e);t>-1&&this.hoverCallbacks.splice(t,1)}}},{key:"onUserMoveCallback",value:function(e){var t=this,r={features:[],layer:this,coordinate:e.coordinate,event:e};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(e.coordinate).then((function(e){var r=e.features,n=e.layer,o=e.coordinate;return t.hoverCallbacks.forEach((function(e){return e(r,n,o)})),e})).catch((function(){return r})):Promise.resolve(r)}}])&&y(t.prototype,r),n&&y(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(o.a);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function S(){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=T(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function T(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=R(e)););return e}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=R(e);if(t){var o=R(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return E(this,r)}}function E(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(c,e);var t,r,o,i=x(c);function c(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(t=i.call(this,e)).olLayer&&t.olLayer.setVisible(t.visible),t}return t=c,(r=[{key:"defineProperties",value:function(e){S(R(c.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{olLayer:{value:e.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(e){var t=this;if(S(R(c.prototype),"init",this).call(this,e),this.map&&(this.map&&this.olLayer&&this.map.addLayer(this.olLayer),this.olListenersKeys.push(this.map.getLayers().on("remove",(function(e){e.element===t.olLayer&&t.terminate()}))),(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.olListenersKeys.push(this.on("change:visible",this.toggleVisibleListeners))),this.copyrights&&this.olLayer)){var r=this.copyrights||[];this.olLayer instanceof a.a?this.olLayer.getLayers().getArray().forEach((function(e){e.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(n.unByKey)(this.olListenersKeys),this.map&&this.olLayer&&this.map.removeLayer(this.olLayer),S(R(c.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e!==this.visible&&(S(R(c.prototype),"setVisible",this).call(this,e,t,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var e=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(t){var r=e.olListenersKeys.indexOf(t);r>-1&&e.olListenersKeys.splice(r,1),Object(n.unByKey)([e.isHoverListenerKey,e.isClickListenerKey])})),this.visible&&(this.isClickActive&&(this.isClickListenerKey=this.map.on("singleclick",this.onUserClickCallback)),this.isHoverActive&&(this.isHoverListenerKey=this.map.on("pointermove",this.onUserMoveCallback)),this.olListenersKeys.push(this.isClickListenerKey,this.isHoverListenerKey))}},{key:"clone",value:function(e){return new c(j(j({},this.options),e))}}])&&P(t.prototype,r),o&&P(t,o),Object.defineProperty(t,"prototype",{writable:!1}),c}(g),L=r(0),D=r(22),I=r(7),M=r.n(I),A=r(8),B=r.n(A),U=r(5),F=r.n(U),V=r(6),q=r.n(V);function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var K=function(e,t,r){if(!1===e)return r;var n=q.a.parseUrl(r);return!e&&n.query[t]?r:e?q.a.stringifyUrl(H(H({},n),{},{query:H(H({},n.query),{},z({},t,e))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)};function G(e){return function(e){if(Array.isArray(e))return Z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var W=function(e){var t=e.filter((function(e){return null!=e&&e.trim&&e.trim()})),r=t.map((function(e){return e.toLowerCase()}));return G(new Set(r)).map((function(e){return t.find((function(t){return t.toLowerCase()===e}))}))},J=function(e){if(!e||!e.style)return[];var t=e.style.sourceCaches,r=[];return Object.values(t).forEach((function(e){if(e.used){var t=e.getSource(),n=t.attribution||t.options&&t.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),W(r)},$={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},Q=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],X=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],Y=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ee=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],te=function(e){return"string"==typeof e?Q.findIndex((function(t){return t.test(e)})):e},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=te(e);return X[t]}catch(e){return 1}},ne=function(e,t,r){return t?r?"#ff0000":"#a0a0a0":e>=36e5?"#ed004c":e>=5e5?"#e80000":e>=3e5?"#ff4a00":e>=18e4?"#f7bf00":null===e?"#a0a0a0":"#00a00c"},oe=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},ie={},ae={},ce={},ue={},se={},le=function(e,t,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,a=r.delayOutlineColor,c=r.delayDisplay,u=t.zoom,s=t.pixelRatio,l=e.properties,f=l.type,p=l.cancelled,y=e.properties,h=y.train_id,b=y.line,v=y.delay,d=y.state,m=y.operator_provides_realtime_journey,g=b||{},O=g.name,w=g.text_color,j=g.color;p=!0===p||"JOURNEY_CANCELLED"===d,f||(f="Rail"),O||(O="I"),w||(w="#000000"),j&&"#"!==j[0]&&(j="#".concat(j)),"#"!==w[0]&&(w="#".concat(w));var k=n&&n===h,P=o&&o===h,S=function(e,t){try{var r=te(e||0);return $[r][t]}catch(e){return 1}}(f,Math.min(Math.floor(u||1),16))*s,T=S>=7*s;(k||P)&&(S=T?S+5*s:14*s);var C=S>10*s,x="".concat(S).concat(f).concat(j).concat(k).concat(P).concat(p).concat(v);if(i&&(x+="".concat(m)),C&&(x+="".concat(O).concat(w)),!se[x]){if(0===S)return se[x]=null,null;var E,R=1*s,_=S+2,L=2*S,D=2*_+2*R+100*s,I=D/2,M=oe(D,D),A=M.getContext("2d");if(T&&null!==v){var B=function(e,t,r){var n="".concat(e,", ").concat(t,", ").concat(r);if(!ie[n]){var o=oe(2*e,2*e),i=o.getContext("2d");i.beginPath(),i.arc(e,e,t,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),ie[n]=o}return ie[n]}(I,_,ne(v,p));A.drawImage(B,0,0)}if(T&&(k||v>=c||p)){var U=Math.max(p?19:14,Math.min(p?19:17,1.2*S))*s,F=function(e,t){if(t)return String.fromCodePoint(215);if(e>36e5){var r=Math.round(e/36e5);return"+".concat(r,"h")}if(e>59e3){var n=Math.round(e/6e4);return"+".concat(n,"m")}return e>0?"+".concat(e,"s"):""}(v,p);if(F){var V=function(e,t,r,n,o,i,a){var c="".concat(e,", ").concat(t,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(a);if(!ae[c]){var u=oe(e,r+8*a),s=u.getContext("2d");s.textAlign="left",s.textBaseline="middle",s.font=n,s.fillStyle=o,s.strokeStyle=i,s.lineWidth=1.5*a;var l=t;s.strokeText(l,0,r),s.fillText(l,0,r),ae[c]=u}return ae[c]}(F.length*U,F,U,"bold ".concat(U,"px arial, sans-serif"),ne(v,p,!0),a,s);A.drawImage(V,I+_+R,I-U)}}var q=function(e,t,r,n,o,i){var a="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!ce[a]){var c=oe(2*e,2*e),u=c.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(e,e,t,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),ce[a]=c}return ce[a]}(I,S,E=i?ne(v,p):j||re(f),T||k||P,T&&i&&null===v&&"yes"===m,s);if(A.drawImage(q,0,0),C){var N=function(e,t,r,n,o,i,a){var c="".concat(e,", ").concat(t,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(a);if(!ue[c]){var u=oe(2*t,2*t),s=u.getContext("2d");i&&(s.save(),s.textBaseline="middle",s.textAlign="center",s.font="bold ".concat(r+2,"px Arial"),s.strokeStyle=o,s.strokeText(e,t,t),s.restore()),s.textBaseline="middle",s.textAlign="center",s.fillStyle=n,s.font="bold ".concat(r,"px Arial"),s.strokeStyle=o,s.strokeText(e,t,t),s.fillText(e,t,t),ue[c]=u}return ue[c]}(O,I,function(e,t,r,n){e.font="bold ".concat(n,"px Arial");for(var o=e.measureText(r),i=0;o.width>t-6&&i<25;)n-=.5,e.font="bold ".concat(n,"px arial, sans-serif"),o=e.measureText(r),i+=1;return n}(A,L,O,Math.max(S,10)),i?"#000000":w||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t=te(e);return Y[t]}catch(e){return 1}}(f),E,i&&null===v&&"yes"===m,s);A.drawImage(N,0,0)}se[x]=M}return se[x]};function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ye(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ye(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ve(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function de(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ge(){return(ge="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Oe(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Oe(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Se(e)););return e}function we(e,t){return(we=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function je(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Se(e);if(t){var o=Se(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ke(this,r)}}function ke(e,t){if(t&&("object"===fe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Pe(e)}function Pe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Se(e){return(Se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Te=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&we(e,t)}(i,e);var t,r,n,o=je(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};de(this,i);var r=new B.a({source:new M.a({}),render:function(t){if(!e.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=e.mbMap.getCanvas(),o=t.viewState,i=e.olLayer.getVisible();e.renderState.visible!==i&&(n.style.display=i?"block":"none",e.renderState.visible=i,n.style.position="absolute");var a=e.olLayer.getOpacity();e.renderState.opacity!==a&&(n.style.opacity=a,e.renderState.opacity=a);var c=o.rotation;e.renderState.rotation!==c&&(e.mbMap.rotateTo(180*-(c||0)/Math.PI,{animate:!1}),r=!0,e.renderState.rotation=c),e.renderState.zoom===o.zoom&&e.renderState.center[0]===o.center[0]&&e.renderState.center[1]===o.center[1]||(e.mbMap.jumpTo({center:Object(L.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,e.renderState.zoom=o.zoom,e.renderState.center=o.center);var u=e.map.getSize();if(e.renderState.size[0]===u[0]&&e.renderState.size[1]===u[1]||(r=!0,e.renderState.size=u),e.mbMap&&e.mbMap.style&&e.mbMap.isStyleLoaded()&&r)try{e.mbMap._frame&&(e.mbMap._frame.cancel(),e.mbMap._frame=null),e.mbMap._render()}catch(e){console.warn(e)}return e.mbMap.getContainer()}});return(e=o.call(this,be(be({},t),{},{olLayer:r}))).styleUrl=t.url,e.apiKey=t.apiKey,e.apiKeyName=t.apiKeyName||"key",e.updateAttribution=e.updateAttribution.bind(Pe(e)),e}return t=i,(r=[{key:"init",value:function(e){var t=this;ge(Se(i.prototype),"init",this).call(this,e),this.map&&!this.mbMap&&(this.format=new F.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{t.mbMap&&t.mbMap.resize()}catch(e){console.warn(e)}}))))}},{key:"terminate",value:function(){this.mbMap&&(this.mbMap.off("idle",this.updateAttribution),this.mbMap.triggerRepaint=function(){},this.mbMap.remove(),this.mbMap=null),this.loaded=!1,ge(Se(i.prototype),"terminate",this).call(this)}},{key:"createStyleUrl",value:function(){return K(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var e=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){e.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var t=pe(this.map.getView().getCenter(),2),r=t[0],n=t[1];r&&n||(r=0,n=0);var o=document.createElement("div");o.style.position="absolute",o.style.width="100%",o.style.height="100%",this.mbMap=new D.Map(be({style:this.createStyleUrl(),container:o,interactive:!1,trackResize:!1,attributionControl:!1},this.options.mapOptions||{})),this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){e.mbMap.resize(),e.loaded=!0,e.copyrights=J(e.mbMap)||[],e.olLayer.getSource().setAttributions(e.copyrights),e.dispatchEvent({type:"load",target:e})}));var i=this.mbMap.getCanvas();i&&(this.options.tabIndex?i.setAttribute("tabindex",this.options.tabIndex):i.removeAttribute("tabindex")),this.mbMap.on("idle",this.updateAttribution)}else this.olListenersKeys.push(this.once("change:visible",(function(){e.loadMbMap()})))}},{key:"updateAttribution",value:function(e){var t=J(e.target)||[];this.copyrights.toString()!==t.toString()&&(this.copyrights=t,this.olLayer.getSource().setAttributions(t))}},{key:"getFeatureInfoAtCoordinate",value:function(e,t){var r=this;if(!(t&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:e,features:[],layer:this});var n=e&&this.mbMap.project(Object(L.toLonLat)(e));if(this.hitTolerance){var o=n,i=o.x,a=o.y;n=[{x:i-this.hitTolerance,y:a-this.hitTolerance},{x:i+this.hitTolerance,y:a+this.hitTolerance}]}var c=this.mbMap.queryRenderedFeatures(n,t).map((function(e){var t=r.format.readFeature(e);return t&&t.set("mapboxFeature",e),t}));return Promise.resolve({layer:this,features:c,coordinate:e})}},{key:"clone",value:function(e){return new i(be(be({},this.options),e))}}])&&me(t.prototype,r),n&&me(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(_);r(23),r(24);var Ce=r(1),xe=r(11),Ee=r(9);var Re=new Ce.Circle({radius:6,fill:new Ce.Fill({color:[255,0,0,1]}),stroke:new Ce.Stroke({color:[0,0,0,1],width:1})}),_e=(new Ce.Style({stroke:new Ce.Stroke({color:[0,0,0,1],width:5})}),new Ce.Style({image:Re,stroke:new Ce.Stroke({color:[255,0,0,1],width:3})}),new Ce.Style({image:Re,stroke:new Ce.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(10)),Le=r(4),De=(r(28),r(14)),Ie=r.n(De),Me=r(15),Ae=r.n(Me),Be=r(16),Ue=r.n(Be);function Fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ve(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ve(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var qe=function(e,t,r){var n,o,i=t.properties,a=i.time_intervals,c=i.olGeometry,u=i.coordinate;if(r&&u)n=u;else if(c.getType()===Ue.a.POINT)n=c.getCoordinates();else if(c.getType()===Ue.a.LINE_STRING){var s=a||[[]],l=s[0],f=s[s.length-1];if(e<l[0])o=Fe(l,3)[2],n=c.getFirstCoordinate();else if(e>f[0]){o=Fe(f,3)[2],n=c.getLastCoordinate()}else for(var p=0;p<s.length-1;p+=1){var y=Fe(s[p],2),h=y[0],b=y[1],v=Fe(s[p+1],2),d=v[0],m=v[1];if(h<=e&&e<=d){var g=Math.min((e-h)/(d-h),1)*(m-b)+b;n=c.getCoordinateAt(g),o=Fe(s[p],3)[2];break}}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",c);return{coord:n,rotation:o}};function Ne(e){return function(e){if(Array.isArray(e))return Ke(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ze(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function He(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(e,t)||ze(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(e,t){if(e){if("string"==typeof e)return Ke(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ke(e,t):void 0}}function Ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ze=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.style=t.style,this.canvas=t.canvas||document.createElement("canvas")}var t,r,n;return t=e,(r=[{key:"renderTrajectories",value:function(e,t,r){var n=t.time,o=void 0===n?Date.now():n,i=t.size,a=void 0===i?[]:i,c=t.center,u=t.resolution,s=t.rotation,l=void 0===s?0:s,f=t.pixelRatio,p=r.noInterpolate,y=void 0!==p&&p,h=r.hoverVehicleId,b=r.selectedVehicleId,v=this.canvas,d=v.getContext("2d");d.clearRect(0,0,v.width,v.height);var m=He(a,2),g=m[0],O=m[1];if(g&&O&&(v.width!==g||v.height!==O)){var w=[g*f,O*f];v.width=w[0],v.height=w[1]}var j,k,P,S,T,C,x,E,R=Object(_e.compose)(Object(_e.create)(),a[0]/2,a[1]/2,1/u,-1/u,-l,-c[0],-c[1]);v.style&&(v.style.width="".concat(v.width/f,"px"),v.style.height="".concat(v.height/f,"px"));for(var _=0,L=e.length-1;L>=0;L-=1){var D=e[L],I=D.properties,M=I.train_id,A=I.timeOffset,B=qe(o-(A||0),D,y),U=B.coord,F=B.rotation;if(e[L].properties.coordinate=U,e[L].properties.rotation=F,U){var V=Object(_e.apply)(R,Ne(U));if(V&&!((V=V.map((function(e){return e*f})))[0]<0||V[0]>v.width||V[1]<0||V[1]>v.height)){var q=this.style(D,t,r);if(q){_+=1;var N=q.width,H=q.height;h!==M&&b!==M&&d.drawImage(q,V[0]-N/2,V[1]-H/2,N,H),h&&h===M&&(j=q,k=V,P=N,S=H),b&&b===M&&(T=q,C=V,x=N,E=H)}}}}return T&&d.drawImage(T,C[0]-x/2,C[1]-E/2,x,E),j&&d.drawImage(j,k[0]-P/2,k[1]-S/2,P,S),{nbTrajectoriesRendered:_}}}])&&Ge(t.prototype,r),n&&Ge(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),We=function(e,t,r,n){var o=[];if(!(e||t||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(e){var t=e.properties.name||e.properties.line&&e.properties.line.name||"";return!!t&&i.some((function(e){return new RegExp(e,"i").test(t)}))}))}if(e){var a=("string"==typeof e?e.split(","):e).map((function(e){return e.replace(/\s+/g,"").toUpperCase()}));o.push((function(e){var t=e.properties,r=t.line,n=(t.name||r&&r.name||"").toUpperCase();return!!n&&a.includes(n)}))}if(t){var c=("string"==typeof t?t.split(","):t).map((function(e){return parseInt(e,10)}));o.push((function(e){var t=parseInt(e.properties.routeIdentifier.split(".")[0],10);return c.includes(t)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(e){return u.some((function(t){return new RegExp(t,"i").test(e.properties.operator)}))}))}return o.length?function(e){for(var t=0;t<o.length;t+=1)if(!o[t](e))return!1;return!0}:null},Je=r(12),$e=r.n(Je);function Qe(e){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){et(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function nt(e,t){return(nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=at(e);if(t){var o=at(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return it(this,r)}}function it(e,t){if(t&&("object"===Qe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function at(e){return(at=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ct=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nt(e,t)}(i,e);var t,r,n,o=ot(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tt(this,i),(e=o.call(this)).url=t.url,e.apiKey=t.apiKey,e}return t=i,(r=[{key:"fetch",value:function(e){function t(t,r,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,r){var n=Ye(Ye({},t||{}),{},{key:this.apiKey}),o=Ye({},n);return Object.keys(n).forEach((function(e){return(void 0===o[e]||null===o[e])&&delete o[e]})),this.apiKey?fetch("".concat(this.url).concat(e||"","?").concat(q.a.stringify(o)),r).then((function(e){try{return e.json().then((function(e){if(e.error)throw new Error(e.error);return e}))}catch(e){return Promise.reject(new Error(e))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&rt(t.prototype,r),n&&rt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}($e.a);function ut(e){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function st(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?st(Object(r),!0).forEach((function(t){ft(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ft(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ht(e,t){return(ht=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=dt(e);if(t){var o=dt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return vt(this,r)}}function vt(e,t){if(t&&("object"===ut(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function dt(e){return(dt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ht(e,t)}(i,e);var t,r,n,o=bt(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pt(this,i),o.call(this,lt({url:"https://api.geops.io/stops/v1/"},e))}return t=i,(r=[{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",e,{signal:t.signal}).then((function(e){return e.features}))}}])&&yt(t.prototype,r),n&&yt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(ct);function gt(e){return function(e){if(Array.isArray(e))return Ot(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ot(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var jt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defineProperties()}var t,r,n;return t=e,n=[{key:"getRequestString",value:function(e,t){var r="".concat(e," ").concat(t.channel);return r+=t.args?" ".concat(t.args):"",(r+=t.id?" ".concat(t.id):"").trim()}}],(r=[{key:"defineProperties",value:function(){var e=this;Object.defineProperties(this,{closed:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSED)}},closing:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CLOSING)}},connecting:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.CONNECTING)}},open:{get:function(){return!(!e.websocket||e.websocket.readyState!==e.websocket.OPEN)}},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}},{key:"connect",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(e),this.open?(r(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(function(){r(),t.subscribePreviousSubscriptions()}))}},{key:"close",value:function(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}},{key:"send",value:function(e){var t=this;if(this.websocket){var r=function(){t.websocket.send(e)};this.open?this.messagesOnOpen.includes(e)||r():this.messagesOnOpen.includes(e)||(this.messagesOnOpen.push(e),this.websocket.addEventListener("open",(function(){t.messagesOnOpen=[],r()})),this.websocket.addEventListener("close",(function(){t.messagesOnOpen=[]})))}}},{key:"listen",value:function(e,t,r){this.unlisten(e,t);var n=function(r){var n={};try{n=JSON.parse(r.data)}catch(e){console.error("WebSocket: unable to parse JSON data",e,r.data)}var o=e.channel;o+=e.args?" ".concat(e.args):"",("buffer"===n.source?n.content:[n]).forEach((function(r){(null==r?void 0:r.source)!==o||e.id&&e.id!==n.client_reference||t(r)}))};return this.websocket&&(this.websocket.addEventListener("message",n),r&&(this.websocket.addEventListener("error",r),this.websocket.addEventListener("close",r))),{onMessageCb:n,onErrorCb:r}}},{key:"unlisten",value:function(e,t){var r=this;this.websocket&&this.subscriptions.filter((function(r){return r.params.channel===e.channel&&(!t||r.cb===t)})).forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))}))}},{key:"get",value:function(t,r,n){var o=e.getRequestString("GET",t);this.send(o),this.listen(t,r,n)}},{key:"subscribe",value:function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(t,r,n),a=i.onMessageCb,c=i.onErrorCb,u=e.getRequestString("",t),s=this.subscriptions.findIndex((function(e){return t.channel===e.params.channel&&r===e.cb})),l={params:t,cb:r,errorCb:n,onMessageCb:a,onErrorCb:c,quiet:o};s>-1?this.subscriptions[s]=l:this.subscriptions.push(l),this.subscribed[u]||(l.quiet||(this.send("GET ".concat(u)),this.send("SUB ".concat(u))),this.subscribed[u]=!0)}},{key:"unsubscribe",value:function(e,t){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===e&&(!t||r.cb===t)}));n.forEach((function(e){var t=e.onMessageCb,n=e.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",t),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==e||t&&r.cb!==t})),e&&this.subscribed[e]&&!this.subscriptions.find((function(t){return t.params.channel===e}))&&n.find((function(e){return!e.quiet}))&&(this.send("DEL ".concat(e)),this.subscribed[e]=!1)}},{key:"subscribePreviousSubscriptions",value:function(){var e=this;Object.keys(this.subscribed).forEach((function(t){e.subscribed[t]=!1})),gt(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)}))}}])&&wt(t.prototype,r),n&&wt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),kt=function(e,t){return e===t.SCHEMATIC?"_schematic":""},Pt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=e.has_fzo&&n.indexOf(e.state)>-1,i=t.has_fzo&&n.indexOf(t.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(e.state!==t.state)return n.indexOf(e.state)-n.indexOf(t.state)}var a=null,c=null,u=Date.now();return r?(a=new Date(e.min_arrival_time||e.time).getTime()-u,c=new Date(t.min_arrival_time||t.time).getTime()-u):(a=new Date(e.time).getTime()-u,c=new Date(t.time).getTime()-u),a-c},St=function(e){if(e)return e.stations.forEach((function(e){e.arrivalTimeWithDelay=e.arrivalTime,e.departureTime&&(e.departureTimeWithDelay=e.departureTime),e.arrivalDelay&&(e.arrivalTime-=e.arrivalDelay,e.departureTime&&(e.departureTime-=e.arrivalDelay))})),e};function Tt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ct(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xt={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},Et=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Tt(this,e),this.defineProperties(t),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=t.prefix||"",this.onOpen=this.onOpen.bind(this)}var t,r,n;return t=e,(r=[{key:"defineProperties",value:function(e){var t=this,r=e;"string"==typeof e&&(r={url:e});var n=r.apiKey,o=r,i=o.url,a=o.projection,c=o.bbox,u=o.buffer,s=void 0===u?[100,100]:u,l=new jt;n&&(i="".concat(i||"wss://api.geops.io/tracker-ws/v1/","?key=").concat(n)),Object.defineProperties(this,{url:{get:function(){return i},set:function(e){i=e,t.open()}},projection:{get:function(){return a},set:function(e){e!==a&&(a=e,t.conn&&t.conn.send("PROJECTION ".concat(a)))}},bbox:{get:function(){return c},set:function(e){JSON.stringify(e)!==JSON.stringify(c)&&(c=e,t.conn&&t.conn.send("BBOX ".concat(c.join(" "))))}},buffer:{get:function(){return s},set:function(e){JSON.stringify(e)!==JSON.stringify(s)&&(s=e,t.conn&&t.conn.send("BUFFER ".concat(s.join(" "))))}},conn:{value:l,writable:!0},pingIntervalMs:{value:e.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:e.pingIntervalMs||100,writable:!0}})}},{key:"open",value:function(){var e=this;this.close(),this.conn.connect(this.url,this.onOpen),this.conn.websocket.onclose=function(){e.onClose()}}},{key:"close",value:function(){this.conn.close()}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"onOpen",value:function(){var e=this;this.projection&&this.conn.send("PROJECTION ".concat(this.projection)),this.bbox&&this.conn.send("BBOX ".concat(this.bbox.join(" "))),this.buffer&&this.conn.send("BUFFER ".concat(this.buffer.join(" "))),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval((function(){e.conn.send("PING")}),this.pingIntervalMs))}},{key:"onClose",value:function(){var e=this;window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((function(){return e.open()}),this.reconnectTimeoutMs))}},{key:"subscribe",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:e},t,r,n)}},{key:"unsubscribe",value:function(e,t,r){this.conn.unsubscribe("".concat(e).concat(kt(xt.SCHEMATIC,xt)).concat(t),r),this.conn.unsubscribe("".concat(e).concat(kt(xt.TOPOGRAPHIC,xt)).concat(t||""),r)}},{key:"filterDepartures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(e).map((function(t){return e[t]}));r.sort((function(e,r){return Pt(e,r,t)}));var n=new Date;n.setMinutes(n.getMinutes()+this.maxDepartureAge),n=n.getTime();var o=new Date;o.setMinutes(o.getMinutes()-this.maxDepartureAge),o=o.getTime();for(var i=[],a=[],c=null,u=r.length-1;u>=0;u-=1){var s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===a.indexOf(s.platform)?a.push(s.platform):s.state="HIDDEN"),c&&s.to[0]===c.to[0]&&Math.abs(l-c.time)<1e3&&s.line.name===c.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(c=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(e,t,r){var n=this;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=e;var o=e?"timetable_".concat(e):null,i={};this.subscribe(o,(function(e){if(e.source===o){var a=e.content||{},c=new Date(a.timestamp).getTime()-Date.now();a.timediff=c,i[a.call_id]=a,window.clearTimeout(n.departureUpdateTimeout),n.departureUpdateTimeout=window.setTimeout((function(){var e=n.filterDepartures(i,t||!1);r(e)}),100)}}),(function(){r([])}))}},{key:"unsubscribeDepartures",value:function(e){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",e),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(e){this.subscribe("".concat(this.prefix,"newsticker"),(function(t){e(t.content)}))}},{key:"unsubscribeDisruptions",value:function(e){this.unsubscribe("".concat(this.prefix,"newsticker"),"",e)}},{key:"getStation",value:function(e,t){var r=this,n={channel:"station".concat(kt(t,xt)),args:e};return new Promise((function(e,t){r.conn.get(n,(function(r){r.content?e(r.content):t()}))}))}},{key:"getStations",value:function(e){var t=this,r=[],n={channel:"station".concat(kt(e,xt))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(e,o){t.conn.get(n,(function(n){n.content?(r.push(n.content),window.clearTimeout(t.stationUpdateTimeout),t.stationUpdateTimeout=window.setTimeout((function(){e(r)}),50)):o(n.content)}))}))}},{key:"subscribeStations",value:function(e,t){this.unsubscribeStations(),this.subscribe("station".concat(kt(e,xt)),(function(e){e.content&&t(e.content)}))}},{key:"unsubscribeStations",value:function(e){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",e)}},{key:"subscribeExtraGeoms",value:function(e){var t=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?t.extraGeoms[o]=n:delete t.extraGeoms[o],e(Object.keys(t.extraGeoms).map((function(e){return t.extraGeoms[e]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(e){this.unsubscribe("extra_geoms","",e)}},{key:"subscribeTrajectory",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeTrajectory(t),this.subscribe("trajectory".concat(kt(e,xt)),t,null,r)}},{key:"unsubscribeTrajectory",value:function(e){this.unsubscribe("trajectory","",e)}},{key:"subscribeDeletedVehicles",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeDeletedVehicles(t),this.subscribe("deleted_vehicles".concat(kt(e,xt)),t,null,r)}},{key:"unsubscribeDeletedVehicles",value:function(e){this.unsubscribe("deleted_vehicles","",e)}},{key:"getFullTrajectory",value:function(e,t,r){var n=this,o=["full_trajectory".concat(kt(t,xt))];e&&o.push(e),t&&t!==xt.TOPOGRAPHIC||!r||o.push("gen".concat(r));var i={channel:o.join("_")};return new Promise((function(e){n.conn.get(i,(function(t){t.content&&e(t.content)}))}))}},{key:"getFullTrajectories",value:function(e,t,r){var n=this,o=e.map((function(e){return n.getFullTrajectory(e,t,r)}));return Promise.all(o)}},{key:"subscribeFullTrajectory",value:function(e,t){this.unsubscribeFullTrajectory(e),this.subscribe("full_trajectory".concat(kt(t,xt),"_").concat(e),(function(e){console.log("subscribe full_trajectory",e)}),(function(e){console.log("subscribe full_trajectory error",e)}))}},{key:"unsubscribeFullTrajectory",value:function(e,t){this.unsubscribe("full_trajectory","_".concat(e),t)}},{key:"getStopSequence",value:function(e){var t=this,r={channel:"stopsequence_".concat(e)};return new Promise((function(e,n){t.conn.get(r,(function(t){if(t.content&&t.content.length){var r=t.content.map((function(e){return St(e)}));e(r)}e([])}),(function(e){n(e)}))}))}},{key:"getStopSequences",value:function(e){var t=this,r=e.map((function(e){return t.getStopSequence(e)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(e,t){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(e),this.subscribe("stopsequence_".concat(e),(function(e){if(e.content&&e.content.length){var r=e.content.map((function(e){return St(e)}));t(r)}}),(function(e){console.log("subscribe stopsequence error",e)}))}},{key:"unsubscribeStopSequence",value:function(e,t){this.unsubscribe("stopsequence","_".concat(e),t)}},{key:"subscribeHealthCheck",value:function(e){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",e)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&Ct(t.prototype,r),n&&Ct(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Rt(e){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,c=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(c)throw o}}return i}(e,t)||Dt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lt(e){return function(e){if(Array.isArray(e))return It(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Dt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(e,t){if(e){if("string"==typeof e)return It(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?It(e,t):void 0}}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(r),!0).forEach((function(t){Bt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ut(){return(Ut="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ft(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Ft(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=zt(e)););return e}function Vt(e,t){return(Vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zt(e);if(t){var o=zt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Nt(this,r)}}function Nt(e,t){if(t&&("object"===Rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ht(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zt(e){return(zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Zt(e,t,r){return t&&Gt(e.prototype,t),r&&Gt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Wt=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vt(e,t)}(r,e);var t=qt(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Kt(this,r),(e=t.call(this,At({hitTolerance:10},n))).debug=n.debug,e.mode=n.mode||xt.TOPOGRAPHIC,e.api=n.api||new Et(n),e.tenant=n.tenant||"",e.minZoomNonTrain=n.minZoomNonTrain||9,e.minZoomInterpolation=n.minZoomInterpolation||8,e.format=new F.a,e.generalizationLevelByZoom=n.generalizationLevelByZoom||{0:5,1:5,2:5,3:5,4:5,5:5,6:5,7:5,8:10,9:30,10:30,11:100,12:100,13:100},e.isUpdateBboxOnMoveEnd=!1!==n.isUpdateBboxOnMoveEnd,e.throttleRenderTrajectories=Ae()(e.renderTrajectoriesInternal,50,{leading:!1,trailing:!0}),e.debounceRenderTrajectories=Ie()(e.renderTrajectoriesInternal,50,{leading:!0,trailing:!0,maxWait:5e3}),e.onFeatureHover=e.onFeatureHover.bind(Ht(e)),e.onFeatureClick=e.onFeatureClick.bind(Ht(e)),e.renderTrajectoriesInternal=e.renderTrajectoriesInternal.bind(Ht(e)),e.onTrajectoryMessage=e.onTrajectoryMessage.bind(Ht(e)),e.onDeleteTrajectoryMessage=e.onDeleteTrajectoryMessage.bind(Ht(e)),e.onDocumentVisibilityChange=e.onDocumentVisibilityChange.bind(Ht(e)),e}return Zt(r,[{key:"defineProperties",value:function(e){var t=this,n=e.regexPublishedLineName,o=e.publishedLineName,i=e.tripNumber,a=e.operator,c=e.style,u=e.speed,s=e.pixelRatio,l=e.hoverVehicleId,f=e.selectedVehicleId,p=e.filter,y=e.sort,h=e.time,b=e.live,v={style:c};Object.keys(v).forEach((function(e){return void 0===v[e]&&delete v[e]}));var d=u||1,m=h||new Date;Ut(zt(r.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:function(e,r){return(c||le)(e,r,t)}},speed:{get:function(){return d},set:function(e){d=e,t.start()}},filter:{value:p,writable:!0},sort:{value:y,writable:!0},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==b||b,writable:!0},time:{get:function(){return m},set:function(e){m=e&&e.getTime?e:new Date(e),t.renderTrajectories()}},trajectories:{value:{},writable:!0},renderedTrajectories:{get:function(){return t.tracker&&t.tracker.renderedTrajectories||[]}},hoverVehicleId:{value:l,writable:!0},selectedVehicleId:{value:f,writable:!0},pixelRatio:{value:s||("undefined"!=typeof window?window.devicePixelRatio:1),writable:!0},initTrackerOptions:{value:v,writable:!1},useRequestAnimationFrame:{value:e.useRequestAnimationFrame||!1,writable:!0},useThrottle:{value:e.useThrottle||!0,writable:!0},useDebounce:{value:e.useDebounce||!1,writable:!0},publishedLineName:{get:function(){return o},set:function(e){o=e,t.updateFilters()}},tripNumber:{get:function(){return i},set:function(e){i=e,t.updateFilters()}},operator:{get:function(){return a},set:function(e){a=e,t.updateFilters()}},regexPublishedLineName:{get:function(){return n},set:function(e){n=e,t.updateFilters()}},delayDisplay:{value:e.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:e.delayOutlineColor||"#000000",writable:!0}}),this.updateFilters()}},{key:"init",value:function(e){var t=this;Ut(zt(r.prototype),"init",this).call(this,e),this.tracker=new Ze(At({style:function(){return t.style.apply(t,arguments)}},this.initTrackerOptions)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(e){e.target.visible?t.start():t.stop()})),document.addEventListener("visibilitychange",this.onDocumentVisibilityChange)}},{key:"terminate",value:function(){if(document.removeEventListener("visibilitychange",this.onDocumentVisibilityChange),this.stop(),Object(n.unByKey)(this.visibilityRef),this.tracker){var e=this.tracker.canvas;e.getContext("2d").clearRect(0,0,e.width,e.height),this.tracker=null}Ut(zt(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover),this.api.open(),this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.isUpdateBboxOnMoveEnd&&this.setBbox()}},{key:"startUpdateTime",value:function(){var e=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){e.time=e.live?new Date:e.time.getTime()+e.updateTimeDelay*e.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close()}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(e,t){if(!this.tracker)return!1;var r=this.live?Date.now():this.time,n=Object.values(this.trajectories);return this.sort&&n.sort(this.sort),this.renderState=this.tracker.renderTrajectories(n,At(At({},e),{},{pixelRatio:this.pixelRatio,time:r}),{noInterpolate:e.zoom<this.minZoomInterpolation||t,hoverVehicleId:this.hoverVehicleId,selectedVehicleId:this.selectedVehicleId,iconScale:this.iconScale,delayDisplay:this.delayDisplay,delayOutlineColor:this.delayOutlineColor}),!0}},{key:"renderTrajectories",value:function(e,t){var r=this;this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null),!t&&this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(e,t)})):!t&&this.useDebounce?this.debounceRenderTrajectories(e,t):!t&&this.useThrottle?this.throttleRenderTrajectories(e,t):this.renderTrajectoriesInternal(e,t)}},{key:"setBbox",value:function(e,t){for(var r=Object.keys(this.trajectories),n=r.length-1;n>=0;n-=1)this.purgeTrajectory(this.trajectories[r[n]],e,t);var o=Lt(e);this.isUpdateBboxOnMoveEnd&&(o.push(t),this.tenant&&o.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[t],this.generalizationLevel&&o.push("gen=".concat(this.generalizationLevel))),this.api.bbox=o}},{key:"setMode",value:function(e){this.mode!==e&&(this.mode=e,this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd))}},{key:"getRefreshTimeInMs",value:function(e){var t,r=Math.round(e),n=ee[r]||25,o=Math.max(25,n/this.speed),i=Math.min(o,500);if(this.useThrottle?this.throttleRenderTrajectories=Ae()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0}):this.useDebounce&&(this.debounceRenderTrajectories=Ie()(this.renderTrajectoriesInternal,i,{leading:!0,trailing:!0,maxWait:5e3})),null!==(t=this.api)&&void 0!==t&&t.buffer){var a=_t(this.api.buffer,2)[1];this.api.buffer=[i,a]}return o}},{key:"getVehicle",value:function(e){return Object.values(this.trajectories).filter(e)}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.resolution,o=r.nb,i=Object(Le.buffer)([].concat(Lt(e),Lt(e)),this.hitTolerance*n),a=Object.values(this.trajectories);this.sort&&(a=a.sort(this.sort));for(var c=[],u=0;u<a.length&&(a[u].properties.coordinate&&Object(Le.containsCoordinate)(i,a[u].properties.coordinate)&&c.push(a[u]),c.length!==o);u+=1);return Promise.resolve({layer:this,features:c.map((function(e){return t.format.readFeature(e)})),coordinate:e})}},{key:"getTrajectoryInfos",value:function(e){var t=[this.api.getStopSequence(e,this.mode),this.api.getFullTrajectory(e,this.mode,this.generalizationLevel)];return Promise.all(t).then((function(e){var t=_t(e,2);return{stopSequence:t[0],fullTrajectory:t[1]}}))}},{key:"purgeTrajectory",value:function(e,t,r){var n=e.properties,o=n.type,i=n.bounds,a=n.train_id;return(!Object(Le.intersects)(t,i)||"rail"!==o&&r<(this.minZoomNonTrain||9))&&(this.removeTrajectory(a),!0)}},{key:"addTrajectory",value:function(e){this.filter&&!this.filter(e)||(this.trajectories[e.properties.train_id]=e,this.renderTrajectories())}},{key:"removeTrajectory",value:function(e){delete this.trajectories[e]}},{key:"onZoomEnd",value:function(e){this.startUpdateTime()}},{key:"onDocumentVisibilityChange",value:function(){this.visible&&(document.hidden?this.stop():this.start())}},{key:"onTrajectoryMessage",value:function(e){if(e.content){var t=e.content,r=t.geometry,n=t.properties,o=(n.train_id,n.time_since_update),i=n.raw_coordinates;o<0||this.purgeTrajectory(t)||(this.debug&&this.mode===xt.TOPOGRAPHIC&&i?t.properties.olGeometry={type:"Point",coordinates:Object(L.fromLonLat)(i,this.map.getView().getProjection())}:t.properties.olGeometry=this.format.readGeometry(r),t.properties.timeOffset=Date.now()-e.timestamp,this.addTrajectory(t))}}},{key:"onDeleteTrajectoryMessage",value:function(e){e.content&&this.removeTrajectory(e.content)}},{key:"onFeatureHover",value:function(e,t,r){var n=_t(e,1)[0],o=null;n&&(o=n.get("train_id")),this.hoverVehicleId!==o&&(this.hoverVehicleId=o,this.renderTrajectories(!0))}},{key:"onFeatureClick",value:function(e,t,r){var n=_t(e,1)[0],o=null;n&&(o=n.get("train_id")),this.selectedVehicleId!==o&&(this.selectedVehicleId=o,this.selectedVehicle=n,this.renderTrajectories(!0))}},{key:"updateFilters",value:function(){var e=q.a.parse(window.location.search.toLowerCase()),t=this.publishedLineName||e.publishedlinename,r=this.tripNumber||e.tripnumber,n=this.operator||e.operator,o=this.regexPublishedLineName;(t||r||n||o)&&(this.filter=We(t,r,n,o))}}]),r}(e)},Jt=new Ce.Style({zIndex:2,image:new Ce.Circle({radius:5,fill:new Ce.Fill({color:"#000000"})}),stroke:new Ce.Stroke({color:"#000000",width:6})}),$t=function(e){var t="#ffffff",r=e.get("type"),n=e.get("stroke");return n&&"#"!==n[0]&&(n="#".concat(n)),t=n||re(r),t=/#ffffff/i.test(t)?"#ff0000":t,[Jt,new Ce.Style({zIndex:3,image:new Ce.Circle({radius:4,fill:new Ce.Fill({color:t})}),stroke:new Ce.Stroke({color:t,width:4})})]};new Ce.Style({zIndex:2,image:new Ce.Circle({radius:5,fill:new Ce.Fill({color:"#000000"})}),stroke:new Ce.Stroke({color:"#000000",width:6})}),new Ce.Style({zIndex:3,image:new Ce.Circle({radius:4,fill:new Ce.Fill({color:"#a0a0a0"})}),stroke:new Ce.Stroke({color:"#a0a0a0",width:4})});function Qt(e){return(Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xt(Object(r),!0).forEach((function(t){er(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function er(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function nr(){return(nr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=or(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function or(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ur(e)););return e}function ir(e,t){return(ir=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ar(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ur(e);if(t){var o=ur(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return cr(this,r)}}function cr(e,t){if(t&&("object"===Qt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ur(e){return(ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sr=new F.a,lr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ir(e,t)}(i,e);var t,r,n,o=ar(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tr(this,i),(e=o.call(this,Yt({},t))).olLayer=t.olLayer||new Ee.Group({layers:[new Ee.Vector({source:new xe.Vector({features:[]}),style:t.fullTrajectoryStyle||$t}),new Ee.Layer({source:new M.a({}),render:function(t){if(!e.tracker||!e.tracker.canvas)return null;if(e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style.width="100%",e.container.style.height="100%",e.transformContainer=document.createElement("div"),e.transformContainer.style.position="absolute",e.transformContainer.style.width="100%",e.transformContainer.style.height="100%",e.container.appendChild(e.transformContainer),e.tracker.canvas.style.position="absolute",e.tracker.canvas.style.top="0",e.tracker.canvas.style.left="0",e.tracker.canvas.style.transformOrigin="top left",e.transformContainer.appendChild(e.tracker.canvas)),e.renderedViewState){var r=t.viewState,n=r.center,o=r.resolution,i=r.rotation,a=e.renderedViewState,c=a.center,u=a.resolution,s=a.rotation;if(u/o>=3){var l=e.tracker.canvas;l.getContext("2d").clearRect(0,0,l.width,l.height)}else{var f=e.map.getPixelFromCoordinate(c),p=e.map.getPixelFromCoordinate(n);e.transformContainer.style.transform=Object(_e.composeCssTransform)(f[0]-p[0],f[1]-p[1],u/o,u/o,i-s,0,0)}}return e.container}})]}),e.vectorLayer=e.olLayer.getLayers().item(0),e.renderState={center:[0,0],zoom:null,rotation:0},e}return t=i,(r=[{key:"init",value:function(e){var t=this;nr(ur(i.prototype),"init",this).call(this,e),this.map&&this.olListenersKeys.push(this.map.on(["moveend","change:target"],(function(e){var r=t.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();t.currentZoom!==n&&t.onZoomEnd(e),t.currentZoom=n,t.onMoveEnd(e)}})))}},{key:"terminate",value:function(){nr(ur(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(e){if(this.map&&this.tracker&&this.tracker.canvas){var t=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(e);return!!t.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(e){var t=this.map.getView();nr(ur(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:t.calculateExtent(),resolution:t.getResolution(),rotation:t.getRotation(),zoom:t.getZoom(),pixelRatio:this.pixelRatio},e)}},{key:"renderTrajectoriesInternal",value:function(e,t){!this.map.getView().getAnimating()&&!this.map.getView().getInteracting()&&nr(ur(i.prototype),"renderTrajectoriesInternal",this).call(this,e,t)&&(this.renderedViewState=Yt({},e),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return nr(ur(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.map.getView().getResolution();return nr(ur(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Yt({resolution:r},t))}},{key:"onMoveEnd",value:function(){this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.isClickActive&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"onZoomEnd",value:function(e){nr(ur(i.prototype),"onZoomEnd",this).call(this,e)}},{key:"onFeatureHover",value:function(e,t,r){nr(ur(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getTargetElement().style.cursor=e.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(e,t,r){nr(ur(i.prototype),"onFeatureClick",this).call(this,e,t,r),!e.length&&this.vectorLayer&&this.vectorLayer.getSource().clear(),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"purgeTrajectory",value:function(e,t,r){return nr(ur(i.prototype),"purgeTrajectory",this).call(this,e,t||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.map.getView().calculateExtent(),n=Math.floor(this.map.getView().getZoom())),nr(ur(i.prototype),"setBbox",this).call(this,r,n)}},{key:"highlightTrajectory",value:function(e){var t=this;this.api.getFullTrajectory(e,this.mode,this.generalizationLevel).then((function(e){if(t.vectorLayer.getSource().clear(),e&&e.features&&e.features.length){var r=sr.readFeatures(e);t.vectorLayer.getSource().addFeatures(r)}}))}},{key:"clone",value:function(e){return new i(Yt(Yt({},this.options),e))}}])&&rr(t.prototype,r),n&&rr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Wt(_));function fr(e){return(fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(r),!0).forEach((function(t){hr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dr(e,t){return(dr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Or(e);if(t){var o=Or(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return gr(this,r)}}function gr(e,t){if(t&&("object"===fr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Or(e){return(Or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var wr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dr(e,t)}(i,e);var t,r,n,o=mr(i);function i(){return br(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(e);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(e){return e===t.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:e})}},{key:"clone",value:function(e){return new i(yr(yr({},this.options),e))}}])&&vr(t.prototype,r),n&&vr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(_);function jr(e){return(jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kr(Object(r),!0).forEach((function(t){Sr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Sr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xr(e,t){return(xr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Er(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_r(e);if(t){var o=_r(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rr(this,r)}}function Rr(e,t){if(t&&("object"===jr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _r(e){return(_r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xr(e,t)}(i,e);var t,r,n,o=Er(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Tr(this,i),(e=o.call(this,t)).abortController=new AbortController,e.format=new F.a,e}return t=i,(r=[{key:"getFeatureInfoUrl",value:function(e){var t=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(e,r,t,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(e),{signal:r}).then((function(e){return e.json()})).then((function(e){return e.features})).then((function(r){return{layer:t,coordinate:e,features:r.map((function(e){return t.format.readFeature(e)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:e,layer:t})}))}},{key:"clone",value:function(e){return new i(Pr(Pr({},this.options),e))}}])&&Cr(t.prototype,r),n&&Cr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(_);function Dr(e){return(Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ir(Object(r),!0).forEach((function(t){Ar(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ir(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ar(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ur(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fr(e,t){return(Fr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Nr(e);if(t){var o=Nr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qr(this,r)}}function qr(e,t){if(t&&("object"===Dr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Nr(e){return(Nr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fr(e,t)}(i,e);var t,r,n,o=Vr(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,i),(e=o.call(this,t)).defineProperties(t);var r=Mr({active:!1!==t.active},t),n=r.active;return e.active=n,e}return t=i,(r=[{key:"defineProperties",value:function(e){var t=this,r=Mr({},e),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return t.get("active")},set:function(e){t.set("active",e),e?t.activate():t.deactivate(),t.render()}},map:{get:function(){return t.get("map")},set:function(e){if(t.map&&t.element&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.deactivate(),t.set("map",e),t.map){var r=t.target||t.map.getTargetElement&&t.map.getTargetElement()||t.map.getContainer&&t.map.getContainer();t.element||t.createDefaultElement(),t.element&&r.appendChild(t.element),t.active&&t.activate()}t.render()}},target:{value:n},element:{value:o,writable:!0},render:{value:i||this.render,writable:!0}})}},{key:"activate",value:function(){this.deactivate()}},{key:"deactivate",value:function(){}},{key:"render",value:function(){}},{key:"createDefaultElement",value:function(){}}])&&Ur(t.prototype,r),n&&Ur(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}($e.a);function zr(e){return(zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kr(e,t){return(Kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Wr(e);if(t){var o=Wr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Zr(this,r)}}function Zr(e,t){if(t&&("object"===zr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Wr(e){return(Wr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Qr(e,t,r){return t&&$r(e.prototype,t),r&&$r(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Xr=function(e){return function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kr(e,t)}(r,e);var t=Gr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return Qr(r,[{key:"render",value:function(){this.element&&(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}},{key:"createDefaultElement",value:function(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}}]),r}(e)};function Yr(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function en(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tn(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=rn(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function rn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==un(e););return e}function nn(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function on(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=un(e);if(t){var o=un(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return an(this,r)}}function an(e,t){if(t&&("object"===Yr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return cn(e)}function cn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function un(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Xr(Hr),r(13),r(3),r(25),r(26),r(17);function sn(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ln(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(r),!0).forEach((function(t){pn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yn(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=vn(e);if(t){var o=vn(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return bn(this,r)}}function bn(e,t){if(t&&("object"===sn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function vn(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function gn(e,t,r){return t&&mn(e.prototype,t),r&&mn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function On(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function kn(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Tn(e);if(t){var o=Tn(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Sn(this,r)}}function Sn(e,t){if(t&&("object"===On(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Tn(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Cn=Hr;var Cn;var xn=r(18),En=r.n(xn),Rn=r(19);function _n(e){return(_n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ln(e){return function(e){if(Array.isArray(e))return Dn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Dn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function In(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?In(Object(r),!0).forEach((function(t){An(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):In(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function An(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Un(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fn(){return(Fn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Vn(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function Vn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=zn(e)););return e}function qn(e,t){return(qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Nn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zn(e);if(t){var o=zn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hn(this,r)}}function Hn(e,t){if(t&&("object"===_n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function zn(e){return(zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Kn(e){return function(e){if(Array.isArray(e))return Gn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Gn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Zn=function(e){var t=e.getBounds().toArray(),r=Object(L.fromLonLat)(t[0]),n=Object(L.fromLonLat)(t[1]),o=[].concat(Kn(r),Kn(n)),i=e.getCanvas(),a=i.width,c=i.height,u=Object(Le.getWidth)(o)/a,s=Object(Le.getHeight)(o)/c;return Math.max(u,s)},Wn=function(e,t){var r=e.getCanvas(),n=r.width,o=r.height,i=e.unproject({x:0,y:0}),a=e.unproject({x:0,y:o/t}),c=e.unproject({x:n/t,y:o/t}),u=e.unproject({x:n/t,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[c.lng,c.lat],[a.lng,a.lat]]};function Jn(e){return(Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $n(e){return function(e){if(Array.isArray(e))return Qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xn(Object(r),!0).forEach((function(t){eo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function to(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ro(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function no(){return(no="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=oo(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function oo(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=so(e)););return e}function io(e,t){return(io=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ao(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=so(e);if(t){var o=so(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return co(this,r)}}function co(e,t){if(t&&("object"===Jn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return uo(e)}function uo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function so(e){return(so=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&io(e,t)}(a,e);var t,r,o,i=ao(a);function a(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return to(this,a),(e=i.call(this,Yn({},t))).onLoad=e.onLoad.bind(uo(e)),e.onMove=e.onMove.bind(uo(e)),e.onMoveEnd=e.onMoveEnd.bind(uo(e)),e.onZoomEnd=e.onZoomEnd.bind(uo(e)),e.onVisibilityChange=e.onVisibilityChange.bind(uo(e)),e}return t=a,(r=[{key:"init",value:function(e,t){if(e){var r=e.getCanvas();no(so(a.prototype),"init",this).call(this,e,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio}),this.source={type:"canvas",canvas:this.tracker.canvas,coordinates:Wn(e,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")},this.beforeId=t,this.layer={id:this.key,type:"raster",source:this.key,layout:{visibility:this.visible?"visible":"none"},paint:{"raster-opacity":1,"raster-fade-duration":0,"raster-resampling":"nearest"}},e.isStyleLoaded()&&this.onLoad(),this.map.on("load",this.onLoad),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.map.off("load",this.onLoad),this.listeners.forEach((function(e){Object(n.unByKey)(e)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),no(so(a.prototype),"terminate",this).call(this)}},{key:"start",value:function(){no(so(a.prototype),"start",this).call(this),this.map.on("move",this.onMove),this.map.on("moveend",this.onMoveEnd),this.map.on("zoomend",this.onZoomEnd)}},{key:"stop",value:function(){no(so(a.prototype),"stop",this).call(this),this.map&&(this.map.off("move",this.onMove),this.map.off("moveend",this.onMoveEnd),this.map.off("zoomend",this.onZoomEnd))}},{key:"onLoad",value:function(){this.map.getSource(this.key)||this.map.addSource(this.key,this.source),this.map.getLayer(this.key)||this.map.addLayer(this.layer,this.beforeId)}},{key:"onUserClickCallback",value:function(e){no(so(a.prototype),"onUserClickCallback",this).call(this,Yn({coordinate:Object(L.fromLonLat)(e.lngLat.toArray())},e))}},{key:"onUserMoveCallback",value:function(e){no(so(a.prototype),"onUserMoveCallback",this).call(this,Yn({coordinate:Object(L.fromLonLat)(e.lngLat.toArray())},e))}},{key:"renderTrajectories",value:function(e){var t=this.map.getCanvas(),r=t.width,n=t.height,o=this.map.getCenter(),i=this.map.unproject({x:0,y:n/this.pixelRatio}),c=this.map.unproject({x:r/this.pixelRatio,y:0}),u=En()(Object(Rn.point)([i.lng,i.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=En()(Object(Rn.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat($n(Object(L.fromLonLat)(u)),$n(Object(L.fromLonLat)(s))),f=Object(Le.getWidth)(l)/(r/this.pixelRatio),p=Object(Le.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(L.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};no(so(a.prototype),"renderTrajectories",this).call(this,h,e)}},{key:"getRefreshTimeInMs",value:function(){return no(so(a.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Zn(this.map);return no(so(a.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Yn({resolution:r},t))}},{key:"onVisibilityChange",value:function(){this.visible&&!this.map.getLayer(this.key)?this.map.addLayer(this.layer,this.beforeId):this.map.getLayer(this.key)&&this.map.removeLayer(this.key)}},{key:"purgeTrajectory",value:function(e,t,r){return no(so(a.prototype),"purgeTrajectory",this).call(this,e,t||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(e,t){var r=e,n=t;!r&&this.isUpdateBboxOnMoveEnd&&(r=e||this.getMercatorExtent(),n=Math.floor(this.getOlZoom())),no(so(a.prototype),"setBbox",this).call(this,r,n)}},{key:"onMove",value:function(){var e=Wn(this.map,this.pixelRatio),t=this.map.getSource(this.key);t&&t.setCoordinates(e),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){this.renderTrajectories(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}},{key:"onFeatureHover",value:function(e,t,r){no(so(a.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getCanvasContainer().style.cursor=e.length?"pointer":"auto"}}])&&ro(t.prototype,r),o&&ro(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(Wt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qn(e,t)}(a,e);var t,r,o,i=Nn(a);function a(){return Bn(this,a),i.apply(this,arguments)}return t=a,(r=[{key:"init",value:function(e){Fn(zn(a.prototype),"init",this).call(this,e),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(e){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(n.unByKey)(this.onChangeVisibleKey)),Fn(zn(a.prototype),"terminate",this).call(this,e)}},{key:"onUserClickCallback",value:function(e){Fn(zn(a.prototype),"onUserClickCallback",this).call(this,Mn({coordinate:e.lngLat.toArray()},e))}},{key:"onUserMoveCallback",value:function(e){Fn(zn(a.prototype),"onUserMoveCallback",this).call(this,Mn({coordinate:e.lngLat.toArray()},e))}},{key:"toggleVisibleListeners",value:function(){this.visible?(this.isClickActive&&this.map.on("click",this.onUserClickCallback),this.isHoverActive&&this.map.on("mousemove",this.onUserMoveCallback)):(this.isClickActive&&this.map.off("click",this.onUserClickCallback),this.isHoverActive&&this.map.off("mousemove",this.onUserMoveCallback))}},{key:"getMercatorExtent",value:function(){var e=this.map.getBounds().toArray();return Object(L.transformExtent)([].concat(Ln(e[0]),Ln(e[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(e){return new a(Mn(Mn({},this.options),e))}}])&&Un(t.prototype,r),o&&Un(t,o),Object.defineProperty(t,"prototype",{writable:!1}),a}(g)));function fo(e){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function po(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yo(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ho(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}}).apply(this,arguments)}function ho(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==Oo(e););return e}function bo(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Oo(e);if(t){var o=Oo(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return mo(this,r)}}function mo(e,t){if(t&&("object"===fo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return go(e)}function go(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oo(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Xr(Hr);var wo={mapbox:{TralisLayer:lo},ol:{Layer:_,WMSLayer:Lr,MapboxLayer:Te,TralisLayer:lr,VectorLayer:wr}};t.default=wo}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|