mobility-toolbox-js 1.6.4 → 1.7.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/api/routing/RoutingAPI.test.js +1 -2
- package/api/trajserv/TrajservAPI.js +2 -6
- package/api/trajserv/TrajservAPI.test.js +5 -10
- package/api/tralis/TralisAPI.js +20 -29
- package/api/tralis/WebSocketConnector.js +21 -25
- package/common/Tracker.js +1 -3
- package/common/api/api.js +17 -16
- package/common/controls/Control.js +2 -6
- package/common/layers/Layer.js +4 -10
- package/common/layers/Layer.test.js +12 -16
- package/common/mixins/TrackerLayerMixin.js +31 -22
- package/common/mixins/TrajservLayerMixin.js +1 -3
- package/common/mixins/TralisLayerMixin.js +3 -4
- package/common/trackerConfig.js +4 -23
- package/common/utils/removeDuplicate.js +3 -3
- package/common/utils/simpleTrackerStyle.js +1 -3
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/ol/controls/CopyrightControl.test.js +2 -3
- package/ol/controls/RoutingControl.js +4 -12
- package/ol/layers/MapboxLayer.test.js +8 -15
- package/ol/layers/MapboxStyleLayer.js +12 -16
- package/ol/layers/MapboxStyleLayer.test.js +33 -51
- package/ol/layers/TrackerLayer.js +6 -10
- package/ol/layers/TrajservLayer.js +1 -3
- package/ol/layers/TralisLayer.test.js +43 -0
- package/package.json +60 -68
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("mobility-toolbox-js",[],e):"object"==typeof exports?exports["mobility-toolbox-js"]=e():t["mobility-toolbox-js"]=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e){t.exports=require("ol/style")},function(t,e){t.exports=require("ol/proj")},function(t,e){t.exports=require("ol/extent")},function(t,e){t.exports=require("ol/Observable")},function(t,e){t.exports=require("ol/geom")},function(t,e){t.exports=require("ol/Feature")},function(t,e){t.exports=require("ol/format/GeoJSON")},function(t,e){t.exports=require("query-string")},function(t,e){t.exports=require("ol/layer")},function(t,e){t.exports=require("ol/transform")},function(t,e){t.exports=require("ol/Object")},function(t,e){t.exports=require("ol/layer/Layer")},function(t,e){t.exports=require("mapbox-gl")},function(t,e){t.exports=require("ol/source/Source")},function(t,e){t.exports=require("ol/source")},function(t,e){t.exports=require("ol")},function(t,e){t.exports=require("ol/geom/GeometryType")},function(t,e){t.exports=require("ol/format")},function(t,e){t.exports=require("@turf/transform-rotate")},function(t,e){t.exports=require("@turf/helpers")},function(t,e){t.exports=require("ol/Map")},function(t,e){t.exports=require("ol/control")},function(t,e){t.exports=require("ol/layer/Group")},function(t,e){t.exports=require("uuid")},function(t,e){t.exports=require("ol/geom/Point")},function(t,e){t.exports=require("ol/interaction")},function(t,e){t.exports=require("ol/events/condition")},function(t,e,r){t.exports=r(28)},function(t,e,r){"use strict";r.r(e);var n=r(20),o=r.n(n),i=r(21),c=r(3),a=r.n(c),u=r(22),s=r.n(u),l=r(23);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){h(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=j(t);if(e){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return g(this,r)}}function g(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?O(t):e}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(i,t);var e,r,n,o=m(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,i),(t=o.call(this)).defineProperties(e);var r=e.onClick,n=e.onHover;return n&&t.onHover(n),r&&t.onClick(r),e.copyrights&&(t.copyrights=e.copyrights),t.onUserClickCallback=t.onUserClickCallback.bind(O(t)),t.onUserMoveCallback=t.onUserMoveCallback.bind(O(t)),t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=y({isQueryable:!0,isClickActive:!0,isHoverActive:!0},t),n=r.name,o=r.key,i=r.children,c=r.visible,a=r.properties,u=r.isBaseLayer,s=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(l.v4)(),v=n||b;Object.defineProperties(this,{options:{value:t},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!s},isClickActive:{value:!!s&&!!f},isHoverActive:{value:!!s&&!!p},hitTolerance:{value:h||5,writable:!0},isReactSpatialLayer:{value:!0},children:{value:i||[],writable:!0},copyrights:{get:function(){return e.get("copyrights")},set:function(t){var r=Array.isArray(t)?t:[t];return e.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(t){this.terminate(),this.map=t}},{key:"terminate",value:function(){}},{key:"get",value:function(t){return this.properties[t]}},{key:"set",value:function(t,e){this.properties[t]=e,this.dispatchEvent({type:"change:".concat(t),target:this})}},{key:"setVisible",value:function(t){var e=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];t!==this.visible&&(this.visible=t,this.dispatchEvent({type:"change:visible",target:this,stopPropagationDown:e,stopPropagationUp:r,stopPropagationSiblings:n}))}},{key:"getVisibleChildren",value:function(){return this.children.filter((function(t){return t.visible}))}},{key:"hasVisibleChildren",value:function(){return!!this.hasChildren(!0)}},{key:"hasChildren",value:function(t){return!!this.children.find((function(e){return e.visible===t}))}},{key:"addChild",value:function(t){this.children.unshift(t),this.dispatchEvent({type:"change:children",target:this})}},{key:"removeChild",value:function(t){for(var e=0;e<this.children.length;e+=1)if(this.children[e].name===t){this.children.splice(e,1);break}this.dispatchEvent({type:"change:children",target:this})}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){return console.error("getFeatureInfoAtCoordinate must be implemented by inheriting layers",this.key),Promise.resolve({layer:this,features:[],coordinate:t})}},{key:"onClick",value:function(t){if("function"!=typeof t)throw new Error("onClick callback must be of type function:",t);this.clickCallbacks.includes(t)||this.clickCallbacks.push(t)}},{key:"unClick",value:function(t){if("function"==typeof t){var e=this.clickCallbacks.indexOf(t);e>-1&&this.clickCallbacks.splice(e,1)}}},{key:"onUserClickCallback",value:function(t){var e=this,r={features:[],layer:this,coordinate:t.coordinate,event:t};return this.isClickActive&&this.clickCallbacks.length?this.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){var r=t.features,n=t.layer,o=t.coordinate;return e.clickCallbacks.forEach((function(t){return t(r,n,o)})),t})).catch((function(){return r})):Promise.resolve(r)}},{key:"onHover",value:function(t){if("function"!=typeof t)throw new Error("callback must be of type function.");this.hoverCallbacks.includes(t)||this.hoverCallbacks.push(t)}},{key:"unHover",value:function(t){if("function"==typeof t){var e=this.hoverCallbacks.indexOf(t);e>-1&&this.hoverCallbacks.splice(e,1)}}},{key:"onUserMoveCallback",value:function(t){var e=this,r={features:[],layer:this,coordinate:t.coordinate,event:t};return this.isHoverActive&&this.hoverCallbacks.length?this.getFeatureInfoAtCoordinate(t.coordinate).then((function(t){var r=t.features,n=t.layer,o=t.coordinate;return e.hoverCallbacks.forEach((function(t){return t(r,n,o)})),t})).catch((function(){return r})):Promise.resolve(r)}}])&&v(e.prototype,r),n&&v(e,n),i}(a.a);function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function x(t,e,r){return(x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function R(t,e){return(R=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function E(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_(t);if(e){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return D(this,r)}}function D(t,e){return!e||"object"!==P(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _(t){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var I=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&R(t,e)}(i,t);var e,r,n,o=E(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).olLayer&&e.olLayer.setVisible(e.visible),e}return e=i,(r=[{key:"defineProperties",value:function(t){x(_(i.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{olLayer:{value:t.olLayer,writable:!0},olListenersKeys:{value:[]}})}},{key:"init",value:function(t){var e=this;if(x(_(i.prototype),"init",this).call(this,t),this.map&&(this.olListenersKeys.push(this.map.getLayers().on("remove",(function(t){t.element===e.olLayer&&e.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 s.a?this.olLayer.getLayers().getArray().forEach((function(t){t.getSource().setAttributions(r)})):this.olLayer.getSource&&this.olLayer.getSource().setAttributions(r)}}},{key:"terminate",value:function(){Object(c.unByKey)(this.olListenersKeys),x(_(i.prototype),"terminate",this).call(this)}},{key:"setVisible",value:function(t){var e=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];t!==this.visible&&(x(_(i.prototype),"setVisible",this).call(this,t,e,r,n),this.olLayer&&this.olLayer.setVisible(this.visible))}},{key:"toggleVisibleListeners",value:function(){var t=this;this.isClickListenerKey&&this.isHoverListenerKey&&[this.isClickListenerKey,this.isHoverListenerKey].forEach((function(e){var r=t.olListenersKeys.indexOf(e);r>-1&&t.olListenersKeys.splice(r,1),Object(c.unByKey)([t.isHoverListenerKey,t.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(t){return new i(S(S({},this.options),t))}}])&&C(e.prototype,r),n&&C(e,n),i}(w),A=r(10),M=r.n(A);function L(t){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach((function(e){U(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function N(t,e){return(N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function H(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=z(t);if(e){var o=z(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return K(this,r)}}function K(t,e){return!e||"object"!==L(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&N(t,e)}(i,t);var e,r,n,o=H(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q(this,i),(t=o.call(this,e)).defineProperties(e);var r=F({active:!1!==e.active},e),n=r.active;return t.active=n,t}return e=i,(r=[{key:"defineProperties",value:function(t){var e=this,r=F({},t),n=r.target,o=r.element,i=r.render;Object.defineProperties(this,{active:{get:function(){return e.get("active")},set:function(t){e.set("active",t),t?e.activate():e.deactivate(),e.render()}},map:{get:function(){return e.get("map")},set:function(t){if(e.map&&e.element&&e.element.parentNode&&e.element.parentNode.removeChild(e.element),e.deactivate(),e.set("map",t),e.map){var r=e.target||e.map.getContainer();e.element||e.createDefaultElement(),e.element&&r.appendChild(e.element),e.active&&e.activate()}e.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(){}}])&&B(e.prototype,r),n&&B(e,n),i}(M.a);function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){J(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e,r){return(Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=et(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function X(t,e){return(X=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=et(t);if(e){var o=et(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tt(this,r)}}function tt(t,e){return!e||"object"!==G(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function et(t){return(et=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ot(t,e,r){return e&&nt(t.prototype,e),r&&nt(t,r),t}var it=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&X(t,e)}(r,t);var e=Y(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return rt(this,r),(t=e.call(this,$($({},n),{},{layers:[],controls:[]}))).mobilityLayers=[],t.mobilityControls=[],(n.controls||[]).forEach((function(e){t.addControl(e)})),(n.layers||[]).forEach((function(e){t.addLayer(e)})),t}return ot(r,[{key:"getMobilityLayers",value:function(){return this.mobilityLayers}},{key:"getMobilityControls",value:function(){return this.mobilityControls}},{key:"addMobilityControl",value:function(t){this.mobilityControls.push(t),t.map=this}},{key:"removeMobilityControl",value:function(t){t.map=null,this.mobilityControls=this.mobilityControls.filter((function(e){return e!==t}))}},{key:"addControl",value:function(t,e){t instanceof Z?this.addMobilityControl(t):Q(et(r.prototype),"addControl",this).call(this,t,e)}},{key:"removeControl",value:function(t){t instanceof Z?this.removeMobilityControl(t):Q(et(r.prototype),"removeControl",this).call(this,t)}}]),r}(t)},ct=r(11),at=r.n(ct);function ut(t){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function st(t,e){return(st=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=pt(t);if(e){var o=pt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ft(this,r)}}function ft(t,e){return!e||"object"!==ut(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pt(t){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bt(t,e,r){return e&&ht(t.prototype,e),r&&ht(t,r),t}var vt=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&st(t,e)}(r,t);var e=lt(r);function r(){return yt(this,r),e.apply(this,arguments)}return bt(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}(t)};function dt(t){return function(t){if(Array.isArray(t))return mt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mt(t,e)}(t)||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 mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gt=function(t){var e=t.filter((function(t){return null!=t&&t.trim&&t.trim()})),r=e.map((function(t){return t.toLowerCase()}));return dt(new Set(r)).map((function(t){return e.find((function(e){return e.toLowerCase()===t}))}))};function Ot(t){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wt(t,e,r){return(wt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ct(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Pt(t,e){return(Pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ct(t);if(e){var o=Ct(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return St(this,r)}}function St(t,e){return!e||"object"!==Ot(e)&&"function"!=typeof e?Tt(t):e}function Tt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ct(t){return(Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pt(t,e)}(i,t);var e,r,n,o=kt(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).onPostRender=e.onPostRender.bind(Tt(e)),e}return e=i,(r=[{key:"getCopyrights",value:function(){var t=this;if(!this.frameState)return[];var e=[];return this.frameState.layerStatesArray.forEach((function(r){var n=r.layer;Object(ct.inView)(r,t.frameState.viewState)&&n&&n.getSource&&n.getSource()&&n.getSource().getAttributions()&&(e=e.concat(n.getSource().getAttributions()(t.frameState)))})),gt(e)}},{key:"activate",value:function(){wt(Ct(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),wt(Ct(i.prototype),"deactivate",this).call(this)}},{key:"onPostRender",value:function(t){this.map&&this.element&&(this.frameState=t.frameState,this.render())}}])&&jt(e.prototype,r),n&&jt(e,n),i}(vt(Z));function Rt(t){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Et(t){return function(t){if(Array.isArray(t))return Dt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(t,e)}(t)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(r),!0).forEach((function(e){At(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function At(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vt(t,e,r){return(Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Ft(t,e){return(Ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bt(t);if(e){var o=Bt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qt(this,r)}}function qt(t,e){return!e||"object"!==Rt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Bt(t){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Nt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ft(t,e)}(c,t);var e,r,n,o=Ut(c);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Mt(this,c),o.call(this,It({controls:[].concat(Et(Object(i.defaults)({attribution:!1}).getArray()),[new xt])},t))}return e=c,(r=[{key:"getContainer",value:function(){return this.getTargetElement()}},{key:"addLayer",value:function(t){t instanceof I?(t.init(this),this.mobilityLayers.push(t),t.olLayer&&Vt(Bt(c.prototype),"addLayer",this).call(this,t.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Vt(Bt(c.prototype),"addLayer",this).call(this,t)}},{key:"removeLayer",value:function(t){t instanceof I?(t.terminate(),this.mobilityLayers=this.mobilityLayers.filter((function(e){return e!==t})),t.olLayer&&Vt(Bt(c.prototype),"removeLayer",this).call(this,t)):Vt(Bt(c.prototype),"removeLayer",this).call(this,t)}},{key:"addControl",value:function(t){Vt(Bt(c.prototype),"addControl",this).call(this,t)}},{key:"removeControl",value:function(t){Vt(Bt(c.prototype),"removeControl",this).call(this,t)}}])&&Lt(e.prototype,r),n&&Lt(e,n),c}(it(o.a)),Ht=r(1),Kt=r(12),zt=r.n(Kt),Zt=r(13),Gt=r.n(Zt),Wt=r(6),$t=r.n(Wt),Jt=r(7),Qt=r.n(Jt);function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Xt(Object(r),!0).forEach((function(e){te(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function te(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ee=function(t,e,r){if(!1===t)return r;var n=Qt.a.parseUrl(r);return!t&&n.query[e]?r:t?Qt.a.stringifyUrl(Yt(Yt({},n),{},{query:Yt(Yt({},n.query),{},te({},e,t))})):(console.warn("No apiKey is defined for request to ".concat(r)),null)},re=function(t){if(!t||!t.style)return[];var e=t.style.sourceCaches,r=[];return Object.values(e).forEach((function(t){if(t.used){var e=t.getSource(),n=e.attribution||e.options&&e.options.attribution;n&&(r=r.concat(n.replace(/©/g,"©").split(/(<a.*?<\/a>)/)))}})),gt(r)},ne={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]},oe=[/^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],ie=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],ce=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],ae=[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],ue=function(t){return"string"==typeof t?oe.findIndex((function(e){return e.test(t)})):t},se=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;try{var r=ue(t);return ne[r][e]}catch(t){return 1}},le=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=ue(t);return ie[e]}catch(t){return 1}},fe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var e=ue(t);return ce[e]}catch(t){return 1}},pe=function(t,e,r,n){t.font="bold ".concat(n,"px Arial");for(var o=t.measureText(r),i=0;o.width>e-6&&i<25;)n-=.5,t.font="bold ".concat(n,"px arial, sans-serif"),o=t.measureText(r),i+=1;return n},ye=function(t,e,r){return e?r?"#ff0000":"#a0a0a0":t>=36e5?"#ed004c":t>=5e5?"#e80000":t>=3e5?"#ff4a00":t>=18e4?"#f7bf00":null===t?"#a0a0a0":"#00a00c"},he=function(t,e){if(e)return String.fromCodePoint(215);if(t>36e5){var r=Math.round(t/36e5);return"+".concat(r,"h")}if(t>59e3){var n=Math.round(t/6e4);return"+".concat(n,"m")}return t>0?"+".concat(t,"s"):""},be=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r},ve={},de={},me={},ge={},Oe={},je=function(t,e,r){var n=r.hoverVehicleId,o=r.selectedVehicleId,i=r.useDelayStyle,c=r.delayOutlineColor,a=r.delayDisplay,u=e.zoom,s=e.pixelRatio,l=e.operator_provides_realtime_journey,f=t.line,p=t.type,y=t.id,h=t.delay,b=t.cancelled,v=void 0!==b&&b;p||(p="Rail"),f||(f={});var d=f,m=d.name,g=d.text_color,O=d.color;m||(m="I"),g||(g="#000000"),O&&"#"!==O[0]&&(O="#".concat(O)),"#"!==g[0]&&(g="#".concat(g));var j=Math.min(Math.floor(u||1),16),w=n===y,P=o===y,k=se(p,j)*s,S=k>=7*s;(w||P)&&(k=S?k+5*s:14*s);var T=k>10*s,C="".concat(k).concat(p).concat(O).concat(w).concat(P).concat(v).concat(h);if(i&&(C+="".concat(l)),T&&(C+="".concat(m).concat(g)),!Oe[C]){if(0===k)return Oe[C]=null,null;var x,R=1*s,E=k+2,D=2*k,_=2*E+2*R+100*s,I=_/2,A=be(_,_),M=A.getContext("2d");if(S&&null!==h){var L=function(t,e,r){var n="".concat(t,", ").concat(e,", ").concat(r);if(!ve[n]){var o=be(2*t,2*t),i=o.getContext("2d");i.beginPath(),i.arc(t,t,e,0,2*Math.PI,!1),i.fillStyle=r,i.filter="blur(1px)",i.fill(),ve[n]=o}return ve[n]}(I,E,ye(h,v));M.drawImage(L,0,0)}if(S&&(w||h>=a||v)){var V=Math.max(v?19:14,Math.min(v?19:17,1.2*k))*s,F=he(h,v);if(F){var U=function(t,e,r,n,o,i,c){var a="".concat(t,", ").concat(e,", ").concat(n,", ").concat(o,", ").concat(i,", ").concat(c);if(!de[a]){var u=be(t,r+8*c),s=u.getContext("2d");s.textAlign="left",s.textBaseline="middle",s.font=n,s.fillStyle=o,s.strokeStyle=i,s.lineWidth=1.5*c;var l=e;s.strokeText(l,0,r),s.fillText(l,0,r),de[a]=u}return de[a]}(F.length*V,F,V,"bold ".concat(V,"px arial, sans-serif"),ye(h,v,!0),c,s);M.drawImage(U,I+E+R,I-V)}}var q=function(t,e,r,n,o,i){var c="".concat(t,", ").concat(e,", ").concat(r,", ").concat(n,", ").concat(o,", ").concat(i);if(!me[c]){var a=be(2*t,2*t),u=a.getContext("2d");u.fillStyle=r,n&&(u.lineWidth=1*i,u.strokeStyle="#000000"),u.beginPath(),u.arc(t,t,e,0,2*Math.PI,!1),u.fill(),o&&u.setLineDash([5,3]),n&&u.stroke(),me[c]=a}return me[c]}(I,k,x=i?ye(h,v):O||le(p),S||w||P,S&&i&&null===h&&"yes"===l,s);if(M.drawImage(q,0,0),T){var B=Math.max(k,10),N=function(t,e,r,n,o,i,c){var a="".concat(t,", ").concat(e,", ").concat(r,", ").concat(n,",").concat(o,", ").concat(i,", ").concat(c);if(!ge[a]){var u=be(2*e,2*e),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(t,e,e),s.restore()),s.textBaseline="middle",s.textAlign="center",s.fillStyle=n,s.font="bold ".concat(r,"px Arial"),s.strokeStyle=o,s.strokeText(t,e,e),s.fillText(t,e,e),ge[a]=u}return ge[a]}(m,I,pe(M,D,m,B),i?"#000000":g||fe(p),x,i&&null===h&&"yes"===l,s);M.drawImage(N,0,0)}Oe[C]=A}return Oe[C]},we=document.createElement("canvas");we.width=15,we.height=15;var Pe=we.getContext("2d");Pe.arc(8,8,5,0,2*Math.PI,!1),Pe.fillStyle="#8ED6FF",Pe.fill(),Pe.lineWidth=3,Pe.strokeStyle="black",Pe.stroke(),Pe.lineWidth=3;var ke=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=(t.getUTCMonth()+1).toString();e=1===e.length?"0".concat(e):e;var r=t.getUTCDate().toString();return r=1===r.length?"0".concat(r):r,[t.getUTCFullYear(),e,r].join("")},Se=function(t){return[t.getUTCHours(),t.getUTCMinutes(),"".concat(t.getUTCSeconds(),".").concat(t.getUTCMilliseconds())].join(":")};function Te(t){return(Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ce(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return xe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xe(t,e)}(t,e)||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 xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ee(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Re(Object(r),!0).forEach((function(e){De(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function De(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ie(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ae(t,e,r){return(Ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ue(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Me(t,e){return(Me=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ue(t);if(e){var o=Ue(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ve(this,r)}}function Ve(t,e){return!e||"object"!==Te(e)&&"function"!=typeof e?Fe(t):e}function Fe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ue(t){return(Ue=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var qe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Me(t,e)}(i,t);var e,r,n,o=Le(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_e(this,i);var r=new at.a({source:new Gt.a({}),render:function(e){if(!t.mbMap)return console.warn("Mapbox map doesn't exist."),null;var r=!1,n=t.mbMap.getCanvas(),o=e.viewState,i=t.olLayer.getVisible();t.renderState.visible!==i&&(n.style.display=i?"block":"none",t.renderState.visible=i,n.style.position="absolute");var c=t.olLayer.getOpacity();t.renderState.opacity!==c&&(n.style.opacity=c,t.renderState.opacity=c);var a=o.rotation;t.renderState.rotation!==a&&(t.mbMap.rotateTo(180*-(a||0)/Math.PI,{animate:!1}),r=!0,t.renderState.rotation=a),t.renderState.zoom===o.zoom&&t.renderState.center[0]===o.center[0]&&t.renderState.center[1]===o.center[1]||(t.mbMap.jumpTo({center:Object(Ht.toLonLat)(o.center),zoom:o.zoom-1,animate:!1}),r=!0,t.renderState.zoom=o.zoom,t.renderState.center=o.center);var u=t.map.getSize();if(t.renderState.size[0]===u[0]&&t.renderState.size[1]===u[1]||(r=!0,t.renderState.size=u),t.mbMap&&t.mbMap.style&&t.mbMap.isStyleLoaded()&&r)try{t.mbMap._frame&&(t.mbMap._frame.cancel(),t.mbMap._frame=null),t.mbMap._render()}catch(t){console.warn(t)}return n}});return(t=o.call(this,Ee(Ee({},e),{},{olLayer:r}))).styleUrl=e.url,t.apiKey=e.apiKey,t.apiKeyName=e.apiKeyName||"key",t.updateAttribution=t.updateAttribution.bind(Fe(t)),t}return e=i,(r=[{key:"init",value:function(t){var e=this;Ae(Ue(i.prototype),"init",this).call(this,t),this.map&&!this.mbMap&&(this.format=new $t.a({featureProjection:this.map.getView().getProjection()}),this.loadMbMap(),this.olListenersKeys.push(this.map.on("change:size",(function(){try{e.mbMap&&e.mbMap.resize()}catch(t){console.warn(t)}}))))}},{key:"createStyleUrl",value:function(){return ee(this.apiKey,this.apiKeyName,this.styleUrl)}},{key:"loadMbMap",value:function(){var t=this;if(this.olListenersKeys.push(this.map.on("change:target",(function(){t.loadMbMap()}))),this.map.getTargetElement())if(this.visible){var e=Ce(this.map.getView().getCenter(),2),r=e[0],n=e[1];r&&n||(r=0,n=0);var o=this.createStyleUrl();try{this.mbMap=new zt.a.Map({style:o,attributionControl:!1,boxZoom:!1,center:Object(Ht.toLonLat)([r,n]),container:this.map.getTargetElement(),interactive:!1,fadeDuration:"fadeDuration"in this.options?this.options.fadeDuration:300,preserveDrawingBuffer:this.options.preserveDrawingBuffer||!1})}catch(t){console.warn("Failed creating mapbox map: ",t)}this.renderState={center:[r,n],zoom:null,rotation:null,visible:null,opacity:null,size:[0,0]},this.mbMap.once("load",(function(){t.loaded=!0,t.copyrights=t.copyrights||re(t.mbMap)||[],t.olLayer.getSource().setAttributions(t.copyrights),t.dispatchEvent({type:"load",target:t})}));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(){t.loadMbMap()})))}},{key:"updateAttribution",value:function(t){var e=this.copyrights||re(t.target)||[];this.copyrights.toString()!==e.toString()&&this.olLayer.getSource().setAttributions(e)}},{key:"getFeatureInfoAtCoordinate",value:function(t,e){var r=this;if(!(e&&this.format&&this.mbMap&&this.mbMap.isStyleLoaded()))return Promise.resolve({coordinate:t,features:[],layer:this});var n=t&&this.mbMap.project(Object(Ht.toLonLat)(t));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,e).map((function(t){var e=r.format.readFeature(t);return e&&e.set("mapboxFeature",t),e}));return Promise.resolve({layer:this,features:a,coordinate:t})}},{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,Ae(Ue(i.prototype),"terminate",this).call(this)}},{key:"clone",value:function(t){return new i(Ee(Ee({},this.options),t))}}])&&Ie(e.prototype,r),n&&Ie(e,n),i}(I);var Be=r(0),Ne=r(14),He=r(8);var Ke=new Be.Circle({radius:6,fill:new Be.Fill({color:[255,0,0,1]}),stroke:new Be.Stroke({color:[0,0,0,1],width:1})}),ze=(new Be.Style({stroke:new Be.Stroke({color:[0,0,0,1],width:5})}),new Be.Style({image:Ke,stroke:new Be.Stroke({color:[255,0,0,1],width:3})}),new Be.Style({image:Ke,stroke:new Be.Stroke({color:[255,0,0,1],width:3,lineDash:[1,10]})}),r(9)),Ze=r(2),Ge=r(5),We=r.n(Ge),$e=r(16),Je=r.n($e);function Qe(t){return function(t){if(Array.isArray(t))return tr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Ye(t)||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 Xe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||Ye(t,e)||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(t,e){if(t){if("string"==typeof t)return tr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tr(t,e):void 0}}function tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function er(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function rr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var or=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?er(Object(r),!0).forEach((function(e){rr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):er(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({interpolate:!0},e);this.pixelRatio=e.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var e,r,n;return e=t,(r=[{key:"setVisible",value:function(t){this.canvas&&(this.canvas.style.visibility=t?"visible":"hidden")}},{key:"setTrajectories",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&t.sort(this.sort),this.trajectories=t}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.time,n=void 0===r?Date.now():r,o=t.size,i=void 0===o?[]:o,c=t.center,a=t.resolution,u=t.rotation,s=void 0===u?0:u,l=t.pixelRatio;this.clear();var f=Xe(i,2),p=f[0],y=f[1];if(p&&y&&(this.canvas.width!==p||this.canvas.height!==y)){var h=[p*l,y*l];this.canvas.width=h[0],this.canvas.height=h[1]}var b,v,d,m,g,O,j,w,P=Object(ze.compose)(Object(ze.create)(),i[0]/2,i[1]/2,1/a,-1/a,-s,-c[0],-c[1]);this.canvas.style.width="".concat(this.canvas.width/l,"px"),this.canvas.style.height="".concat(this.canvas.height/l,"px"),this.currResolution=a||this.currResolution,this.renderedTrajectories=[];for(var k=(this.trajectories||[]).length-1;k>=0;k-=1){var S=this.trajectories[k];this.trajectories[k].rendered=!1;var T=S.geometry,C=S.timeIntervals,x=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var R=null,E=void 0;if(!S.coordinate||!e&&this.interpolate){if(C&&C.length>1){for(var D=n-(x||0),_=void 0,I=void 0,A=void 0,M=void 0,L=void 0,V=0;V<C.length-1;V+=1){var F=Xe(C[V],3);_=F[0],A=F[1],E=F[2];var U=Xe(C[V+1],2);if(I=U[0],M=U[1],_<=D&&D<=I)break;_=null,I=null}if(T.getType()===Je.a.POINT)R=T.getCoordinates();else if(T.getType()===Je.a.LINE_STRING){if(_&&I){L=this.interpolate?Math.min((D-_)/(I-_),1):0;var q=this.interpolate?L*(M-A)+A:0;R=T.getCoordinateAt(q),this.trajectories[k].rotation=E,this.trajectories[k].endFraction=L}else if(D<C[0][0]){var B=Xe(C,1),N=Xe(B[0],3);E=N[2],L=0,R=T.getFirstCoordinate()}else if(D>C[C.length-1][0]){var H=Xe(C[C.length-1],3);E=H[2],L=1,R=T.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",T);this.trajectories[k].rotation=E,this.trajectories[k].endFraction=L||0}}else R=S.coordinate;if(R){this.trajectories[k].coordinate=R;var K=Object(ze.apply)(P,Qe(R));if(!K)continue;if((K=K.map((function(t){return t*l})))[0]<0||K[0]>this.canvas.width||K[1]<0||K[1]>this.canvas.height)continue;var z=this.style(S,t);if(!z)continue;this.trajectories[k].rendered=!0,this.renderedTrajectories.push(this.trajectories[k]);var Z=z.width,G=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,K[0]-Z/2,K[1]-G/2,Z,G),this.hoverVehicleId===S.id&&(b=z,v=K,d=Z,m=G),this.selectedVehicleId===S.id&&(g=z,O=K,j=Z,w=G)}}}g&&this.canvasContext.drawImage(g,O[0]-j/2,O[1]-w/2,j,w),b&&this.canvasContext.drawImage(b,v[0]-d/2,v[1]-m/2,d,m)}},{key:"destroy",value:function(){this.renderedTrajectories=[],this.clear()}}])&&nr(e.prototype,r),n&&nr(e,n),t}(),ir=function(t,e,r,n){var o=[];if(!(t||e||r||n))return null;if(n){var i="string"==typeof n?[n]:n;o.push((function(t){var e=t.name||t.line&&t.line.name||"";return!!e&&i.some((function(t){return new RegExp(t,"i").test(e)}))}))}if(t){var c=("string"==typeof t?t.split(","):t).map((function(t){return t.replace(/\s+/g,"").toUpperCase()}));o.push((function(t){var e=(t.name||t.line&&t.line.name||"").toUpperCase();return!!e&&c.includes(e)}))}if(e){var a=("string"==typeof e?e.split(","):e).map((function(t){return parseInt(t,10)}));o.push((function(t){var e=parseInt(t.routeIdentifier.split(".")[0],10);return a.includes(e)}))}if(r){var u="string"==typeof r?[r]:r;o.push((function(t){return u.some((function(e){return new RegExp(e,"i").test(t.operator)}))}))}return o.length?function(t){for(var e=0;e<o.length;e+=1)if(!o[e](t))return!1;return!0}:null};function cr(t){return(cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ar(t){return function(t){if(Array.isArray(t))return ur(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ur(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ur(t,e)}(t)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?sr(Object(r),!0).forEach((function(e){fr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function fr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pr(t,e,r){return(pr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=dr(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function yr(t,e){return(yr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=dr(t);if(e){var o=dr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return br(this,r)}}function br(t,e){return!e||"object"!==cr(e)&&"function"!=typeof e?vr(t):e}function vr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dr(t){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Or(t,e,r){return e&&gr(t.prototype,e),r&&gr(t,r),t}var jr=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yr(t,e)}(r,t);var e=hr(r);function r(t){var n;return mr(this,r),(n=e.call(this,lr({hitTolerance:10},t))).onFeatureHover=n.onFeatureHover.bind(vr(n)),n.onFeatureClick=n.onFeatureClick.bind(vr(n)),n}return Or(r,[{key:"defineProperties",value:function(t){var e=this,n=lr({},t),o=n.style,i=n.speed,c=t.pixelRatio,a=t.interpolate,u=t.hoverVehicleId,s=t.selectedVehicleId,l=t.filter,f=t.sort,p=t.time,y=t.live,h=t.regexPublishedLineName,b=t.publishedLineName,v=t.tripNumber,d=t.operator,m={pixelRatio:c||window.devicePixelRatio||1,interpolate:a,hoverVehicleId:u,selectedVehicleId:s,filter:l,sort:f,style:o};Object.keys(m).forEach((function(t){return void 0===m[t]&&delete m[t]}));var g=i||1,O=p||new Date;pr(dr(r.prototype),"defineProperties",this).call(this,t),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:o||this.defaultStyle},speed:{get:function(){return g},set:function(t){g=t,e.start()}},filter:{get:function(){return e.tracker?e.tracker.filter:e.initTrackerOptions.filter},set:function(t){e.tracker?e.tracker.filter=t:e.initTrackerOptions.filter=t}},sort:{get:function(){return e.tracker?e.tracker.sort:e.initTrackerOptions.sort},set:function(t){e.tracker?e.tracker.sort=t:e.initTrackerOptions.sort=t}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==y||y,writable:!0},time:{get:function(){return O},set:function(t){O=t&&t.getTime?t:new Date(t),e.renderTrajectories()}},trajectories:{get:function(){return e.tracker&&e.tracker.trajectories||[]}},renderedTrajectories:{get:function(){return e.tracker&&e.tracker.renderedTrajectories||[]}},hoverVehicleId:{get:function(){return e.tracker?e.tracker.hoverVehicleId:e.initTrackerOptions.hoverVehicleId},set:function(t){e.tracker?e.tracker.hoverVehicleId=t:e.initTrackerOptions.hoverVehicleId=t}},selectedVehicleId:{get:function(){return e.tracker?e.tracker.selectedVehicleId:e.initTrackerOptions.selectedVehicleId},set:function(t){e.tracker?e.tracker.selectedVehicleId=t:e.initTrackerOptions.selectedVehicleId=t}},pixelRatio:{get:function(){return e.tracker?e.tracker.pixelRatio:e.initTrackerOptions.pixelRatio},set:function(t){e.tracker?e.tracker.pixelRatio=t:e.initTrackerOptions.pixelRatio=t}},initTrackerOptions:{value:m,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0},publishedLineName:{get:function(){return b},set:function(t){b=t,e.updateFilters()}},tripNumber:{get:function(){return v},set:function(t){v=t,e.updateFilters()}},operator:{get:function(){return d},set:function(t){d=t,e.updateFilters()}},regexPublishedLineName:{get:function(){return h},set:function(t){h=t,e.updateFilters()}},delayDisplay:{value:t.delayDisplay||3e5,writable:!0},delayOutlineColor:{value:t.delayOutlineColor||"#000000",writable:!0},useDelayStyle:{value:t.useDelayStyle||!1,writable:!0}})}},{key:"init",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};pr(dr(r.prototype),"init",this).call(this,t),this.tracker=new or(lr(lr({style:function(t,r){return e.style(t,r)}},this.initTrackerOptions),n)),this.visible&&this.start(),this.visibilityRef=this.on("change:visible",(function(t){t.target.visible?e.start():e.stop()}))}},{key:"terminate",value:function(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),pr(dr(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.updateFilters(),this.tracker.setVisible(!0),this.renderTrajectories(),this.startUpdateTime(),this.isClickActive&&this.onClick(this.onFeatureClick),this.isHoverActive&&this.onHover(this.onFeatureHover)}},{key:"startUpdateTime",value:function(){var t=this;this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs(),this.updateTimeInterval=setInterval((function(){t.time=t.live?new Date:t.time.getTime()+t.updateTimeDelay*t.speed}),this.updateTimeDelay)}},{key:"stop",value:function(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{key:"stopUpdateTime",value:function(){this.updateTimeInterval&&clearInterval(this.updateTimeInterval)}},{key:"renderTrajectoriesInternal",value:function(t,e){if(!this.tracker)return!1;var r=this.live?Date.now():this.time;return this.tracker.renderTrajectories(lr(lr({},t),{},{time:r}),e),!0}},{key:"renderTrajectories",value:function(t,e){var r=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(t,e)})):this.renderTrajectoriesInternal(t,e)}},{key:"getVehicle",value:function(t){return this.tracker.getTrajectories().filter(t)}},{key:"getVehiclesAtCoordinate",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=Object(Ze.buffer)([].concat(ar(t),ar(t)),this.hitTolerance*e),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Ze.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.resolution,n=e.nb,o=this.getVehiclesAtCoordinate(t,r,n);return Promise.resolve({layer:this,features:o.map((function(t){var e=new We.a({geometry:t.geometry});return e.setProperties(lr({},t)),e})),coordinate:t})}},{key:"onZoomEnd",value:function(t){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(t){var e=Math.round(t),r=ae[e]||25;return Math.max(25,r/this.speed)}},{key:"updateFilters",value:function(){var t=Qt.a.parse(window.location.search.toLowerCase());this.filter=ir(this.publishedLineName||t.publishedlinename,this.tripNumber||t.tripnumber,this.operator||t.operator,this.regexPublishedLineName)}},{key:"defaultStyle",value:function(t,e){return je(t,e,this)}}]),r}(t)};function wr(t){return(wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function kr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Pr(Object(r),!0).forEach((function(e){Sr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Sr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Tr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function xr(t,e,r){return(xr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_r(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Rr(t,e){return(Rr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Er(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_r(t);if(e){var o=_r(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Dr(this,r)}}function Dr(t,e){return!e||"object"!==wr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _r(t){return(_r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ir=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Rr(t,e)}(i,t);var e,r,n,o=Er(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Tr(this,i),(t=o.call(this,kr({},e))).renderWhenInteracting=e.renderWhenInteracting||function(){return t.tracker&&t.tracker.renderedTrajectories&&t.tracker.renderedTrajectories.length<=200},t.olLayer=e.olLayer||new He.Group({layers:[new He.Vector({source:new Ne.Vector({features:[]})}),new He.Layer({source:new Gt.a({}),render:function(e){if(!t.tracker||!t.tracker.canvas)return null;if(t.container||(t.container=document.createElement("div"),t.container.style.position="absolute",t.container.style.width="100%",t.container.style.height="100%",t.transformContainer=document.createElement("div"),t.transformContainer.style.position="absolute",t.transformContainer.style.width="100%",t.transformContainer.style.height="100%",t.container.appendChild(t.transformContainer),t.tracker.canvas.style.position="absolute",t.tracker.canvas.style.top="0",t.tracker.canvas.style.left="0",t.tracker.canvas.style.transformOrigin="top left",t.transformContainer.appendChild(t.tracker.canvas)),t.renderedViewState){var r=e.viewState,n=r.center,o=r.resolution,i=r.rotation,c=t.renderedViewState,a=c.center,u=c.resolution,s=c.rotation;if(t.renderWhenInteracting&&t.renderWhenInteracting(e.viewState,t.renderedViewState))t.renderTrajectories(!0);else if(u/o>=3)t.tracker.clear();else{var l=t.map.getPixelFromCoordinate(a),f=t.map.getPixelFromCoordinate(n);t.transformContainer.style.transform=Object(ze.composeCssTransform)(l[0]-f[0],l[1]-f[1],u/o,u/o,i-s,0,0)}}return t.container}})]}),t.vectorLayer=t.olLayer.getLayers().item(0),t.renderState={center:[0,0],zoom:null,rotation:0},t}return e=i,(r=[{key:"init",value:function(t){var e=this;xr(_r(i.prototype),"init",this).call(this,t),this.map&&this.olListenersKeys.push(this.map.on("moveend",(function(t){var r=e.map.getView();if(!r.getAnimating()&&!r.getInteracting()){var n=r.getZoom();e.currentZoom!==n&&e.onZoomEnd(t),e.currentZoom=n,e.onMoveEnd(t)}})))}},{key:"terminate",value:function(){xr(_r(i.prototype),"terminate",this).call(this),this.container=null}},{key:"hasFeatureInfoAtCoordinate",value:function(t){if(this.map&&this.tracker&&this.tracker.canvas){var e=this.tracker.canvas.getContext("2d"),r=this.map.getPixelFromCoordinate(t);return!!e.getImageData(r[0]*this.pixelRatio,r[1]*this.pixelRatio,1,1).data[3]}return!1}},{key:"renderTrajectories",value:function(t){var e=this.map.getView();xr(_r(i.prototype),"renderTrajectories",this).call(this,{size:this.map.getSize(),center:this.map.getView().getCenter(),extent:e.calculateExtent(),resolution:e.getResolution(),rotation:e.getRotation(),zoom:e.getZoom(),pixelRatio:this.pixelRatio},t)}},{key:"renderTrajectoriesInternal",value:function(t,e){(this.renderWhenInteracting(t,this.renderedViewState)||!this.map.getView().getAnimating()&&!this.map.getView().getInteracting())&&xr(_r(i.prototype),"renderTrajectoriesInternal",this).call(this,t,e)&&(this.renderedViewState=kr({},t),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return xr(_r(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=this.map.getView().getResolution();return xr(_r(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.hasFeatureInfoAtCoordinate(t))return Promise.resolve({features:[],layer:this,coordinate:t});var r=this.map.getView().getResolution();return xr(_r(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,kr({resolution:r},e))}},{key:"onMoveEnd",value:function(t){}},{key:"onZoomEnd",value:function(t){xr(_r(i.prototype),"onZoomEnd",this).call(this,t)}},{key:"onFeatureHover",value:function(t,e,r){xr(_r(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getTargetElement().style.cursor=t.length?"pointer":"auto"}},{key:"onFeatureClick",value:function(t,e,r){xr(_r(i.prototype),"onFeatureClick",this).call(this,t,e,r),!t.length&&this.vectorLayer&&this.vectorLayer.getSource().clear()}},{key:"clone",value:function(t){return new i(kr(kr({},this.options),t))}}])&&Cr(e.prototype,r),n&&Cr(e,n),i}(jr(I)),Ar=r(4);function Mr(t){return(Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lr(Object(r),!0).forEach((function(e){Fr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Fr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Br(t,e){return(Br=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Nr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Kr(t);if(e){var o=Kr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Hr(this,r)}}function Hr(t,e){return!e||"object"!==Mr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Kr(t){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Br(t,e)}(i,t);var e,r,n,o=Nr(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ur(this,i),(t=o.call(this)).url=e.url,t.apiKey=e.apiKey,t}return e=i,(r=[{key:"fetch",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=Vr(Vr({},e),{},{key:this.apiKey}),o=Vr({},n);return Object.keys(n).forEach((function(t){return(void 0===o[t]||null===o[t])&&delete o[t]})),this.apiKey?fetch("".concat(this.url).concat(t,"?").concat(Qt.a.stringify(o)),r).then((function(t){try{return t.json().then((function(t){if(t.error)throw new Error(t.error);return t}))}catch(t){return Promise.reject(new Error(t))}})):Promise.reject(new Error("No apiKey defined for request to ".concat(this.url)))}))}])&&qr(e.prototype,r),n&&qr(e,n),i}(M.a);function Zr(t){return(Zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gr(Object(r),!0).forEach((function(e){$r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Xr(t,e){return(Xr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Yr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=en(t);if(e){var o=en(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tn(this,r)}}function tn(t,e){return!e||"object"!==Zr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function en(t){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xr(t,e)}(i,t);var e,r,n,o=Yr(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Jr(this,i),o.call(this,Wr({url:"https://api.geops.io/stops/v1/"},t))}return e=i,(r=[{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("",t,{signal:e.signal}).then((function(t){return t.features}))}}])&&Qr(e.prototype,r),n&&Qr(e,n),i}(zr);function nn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function on(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var cn=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=n.d,i=n.m,c=n.y;e.push({day:o,month:i,year:c})}return e},an=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nn(Object(r),!0).forEach((function(e){on(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);["a","f","tt"].forEach((function(t){e[t]||(e[t]={})}));for(var r=e.id,n=e.hs,o=e.t,i=e.ln,c=e.sn,a=e.wa,u=e.ba,s=e.rt,l=e.fid,f=e.rid,p=e.c,y=e.tc,h=e.a,b=h.n,v=h.u,d=h.tz,m=e.f,g=m.n,O=m.u,j=m.tz,w=e.tt,P=w.n,k=w.p,S=w.t,T=e.sts,C=cn(P),x=cn(k),R=p&&"#".concat(p),E=y&&"#".concat(y),D=[],_=0;_<(T||[]).length;_+=1){var I=T[_],A=I.sid,M=I.n,L=I.p,V=I.at,F=I.dt,U=I.ap,q=I.dp,B=I.ad,N=I.dd,H=I.dot,K=I.put,z=I.c,Z=I.wa;D.push({stationId:A,stationName:M,coordinates:L,arrivalTime:-1!==V?1e3*U:null,departureTime:-1!==F?1e3*q:null,arrivalDelay:B,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:R,color:E,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:D,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:x},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},un=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[],r=0;r<t.length;r+=1){var n=t[r],o=new Ar.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=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;e.push({id:c,type:a,name:u,routeIdentifier:s,directionText:l,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 e};function sn(t){return(sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ln(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function fn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ln(Object(r),!0).forEach((function(e){pn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ln(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function bn(t,e){return(bn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=mn(t);if(e){var o=mn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dn(this,r)}}function dn(t,e){return!e||"object"!==sn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mn(t){return(mn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bn(t,e)}(i,t);var e,r,n,o=vn(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yn(this,i),o.call(this,fn({url:"https://api.geops.io/tracker/v1"},t))}return e=i,(r=[{key:"fetchTrajectoryById",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectorybyid",t,{signal:e.signal})}},{key:"fetchTrajectories",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajectory_collection",t,{signal:e.signal}).then((function(t){return un(t.features)}))}},{key:"fetchTrajectoryStations",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.fetch("/trajstations",t,{signal:e.signal}).then((function(t){return an(t)}))}}])&&hn(e.prototype,r),n&&hn(e,n),i}(zr);function On(t){return function(t){if(Array.isArray(t))return jn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return jn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jn(t,e)}(t)||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 jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Pn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.defineProperties()}var e,r,n;return e=t,n=[{key:"getRequestString",value:function(t,e){var r="".concat(t," ").concat(e.channel);return r+=e.args?" ".concat(e.args):"",(r+=e.id?" ".concat(e.id):"").trim()}}],(r=[{key:"defineProperties",value:function(){var t=this;Object.defineProperties(this,{closed:{get:function(){return!(!t.websocket||t.websocket.readyState!==t.websocket.CLOSED)}},closing:{get:function(){return!(!t.websocket||t.websocket.readyState!==t.websocket.CLOSING)}},connecting:{get:function(){return!(!t.websocket||t.websocket.readyState!==t.websocket.CONNECTING)}},open:{get:function(){return!(!t.websocket||t.websocket.readyState!==t.websocket.OPEN)}},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}},{key:"connect",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(t),this.open?(r(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(function(){r(),e.subscribePreviousSubscriptions()}))}},{key:"close",value:function(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}},{key:"send",value:function(t){var e=this;if(this.websocket){var r=function(){e.websocket.send(t)};this.open?this.messagesOnOpen.includes(t)||r():this.messagesOnOpen.includes(t)||(this.messagesOnOpen.push(t),this.websocket.addEventListener("open",(function(){e.messagesOnOpen=[],r()})),this.websocket.addEventListener("close",(function(){e.messagesOnOpen=[]})))}}},{key:"listen",value:function(t,e,r){this.unlisten(t,e);var n=function(r){var n=JSON.parse(r.data),o=t.channel;o+=t.args?" ".concat(t.args):"",n.source!==o||t.id&&t.id!==n.client_reference||e(n)};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(t,e){var r=this;this.websocket&&this.subscriptions.filter((function(r){return r.params.channel===t.channel&&(!e||r.cb===e)})).forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))}))}},{key:"get",value:function(e,r,n){var o=t.getRequestString("GET",e);this.send(o),this.listen(e,r,n)}},{key:"subscribe",value:function(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.listen(e,r,n),c=i.onMessageCb,a=i.onErrorCb,u=t.getRequestString("",e),s=this.subscriptions.findIndex((function(t){return e.channel===t.params.channel&&r===t.cb})),l={params:e,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,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(t,e){var r=this,n=this.subscriptions.filter((function(r){return r.params.channel===t&&(!e||r.cb===e)}));n.forEach((function(t){var e=t.onMessageCb,n=t.onErrorCb;r.websocket&&(r.websocket.removeEventListener("message",e),n&&(r.websocket.removeEventListener("error",n),r.websocket.removeEventListener("close",n)))})),this.subscriptions=this.subscriptions.filter((function(r){return r.params.channel!==t||e&&r.cb!==e})),t&&this.subscribed[t]&&!this.subscriptions.find((function(e){return e.params.channel===t}))&&n.find((function(t){return!t.quiet}))&&(this.send("DEL ".concat(t)),this.subscribed[t]=!1)}},{key:"subscribePreviousSubscriptions",value:function(){var t=this;Object.keys(this.subscribed).forEach((function(e){t.subscribed[e]=!1})),On(this.subscriptions).forEach((function(e){t.subscribe(e.params,e.cb,e.errorCb,e.quiet)}))}}])&&wn(e.prototype,r),n&&wn(e,n),t}(),kn=function(t,e){return t===e.SCHEMATIC?"_schematic":""},Sn=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=["HIDDEN","LEAVING","BOARDING"],o=t.has_fzo&&n.indexOf(t.state)>-1,i=e.has_fzo&&n.indexOf(e.state)>-1;if(o||i){if(o!==i)return o?-1:1;if(t.state!==e.state)return n.indexOf(t.state)-n.indexOf(e.state)}var c=null,a=null,u=Date.now();return r?(c=new Date(t.min_arrival_time||t.time).getTime()-u,a=new Date(e.min_arrival_time||e.time).getTime()-u):(c=new Date(t.time).getTime()-u,a=new Date(e.time).getTime()-u),c-a},Tn=function(t){if(t)return t.stations.forEach((function(t){t.arrivalTimeWithDelay=t.arrivalTime,t.departureTime&&(t.departureTimeWithDelay=t.departureTime),t.arrivalDelay&&(t.arrivalTime-=t.arrivalDelay,t.departureTime&&(t.departureTime-=t.arrivalDelay))})),t};function Cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Rn={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},En=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Cn(this,t),this.defineProperties(e),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=e.prefix||"",this.onOpen=this.onOpen.bind(this)}var e,r,n;return e=t,(r=[{key:"defineProperties",value:function(t){var e=this,r=t;"string"==typeof t&&(r={url:t});var n=r.apiKey,o=r,i=o.url,c=o.projection,a=o.bbox,u=new Pn;n&&(i="".concat(i||"wss://tralis-tracker-api.geops.io/ws","?key=").concat(n)),Object.defineProperties(this,{url:{get:function(){return i},set:function(t){i=t,e.open()}},projection:{get:function(){return c},set:function(t){t!==c&&(c=t,e.conn&&e.conn.send("PROJECTION ".concat(c)))}},bbox:{get:function(){return a},set:function(t){JSON.stringify(t)!==JSON.stringify(a)&&(a=t,e.conn&&e.conn.send("BBOX ".concat(a.join(" "))))}},conn:{value:u,writable:!0},pingIntervalMs:{value:t.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:t.pingIntervalMs||100,writable:!0}})}},{key:"open",value:function(){var t=this;this.close(),this.conn.connect(this.url,this.onOpen),this.conn.websocket.onclose=function(){t.onClose()}}},{key:"close",value:function(){this.conn.close()}},{key:"reset",value:function(){this.conn.send("RESET")}},{key:"onOpen",value:function(){var t=this;this.projection&&this.conn.send("PROJECTION ".concat(this.projection)),this.bbox&&this.conn.send("BBOX ".concat(this.bbox.join(" "))),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval((function(){t.conn.send("PING")}),this.pingIntervalMs))}},{key:"onClose",value:function(){var t=this;window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((function(){return t.open()}),this.reconnectTimeoutMs))}},{key:"subscribe",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.conn.subscribe({channel:t},e,r,n)}},{key:"unsubscribe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;this.conn.unsubscribe("".concat(t).concat(kn(Rn.SCHEMATIC,Rn)).concat(e),r),this.conn.unsubscribe("".concat(t).concat(kn(Rn.TOPOGRAPHIC,Rn)).concat(e),r)}},{key:"filterDepartures",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object.keys(t).map((function(e){return t[e]}));r.sort((function(t,r){return Sn(t,r,e)}));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 s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=s).time=l,i.unshift(s))}return i}},{key:"subscribeDepartures",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=t;var o=t?"timetable_".concat(t):null,i={};this.subscribe(o,(function(t){if(t.source===o){var c=t.content||{},a=new Date(c.timestamp).getTime()-Date.now();c.timediff=a,i[c.call_id]=c,window.clearTimeout(e.departureUpdateTimeout),e.departureUpdateTimeout=window.setTimeout((function(){var t=e.filterDepartures(i,r);n(t)}),100)}}),(function(){n([])}))}},{key:"unsubscribeDepartures",value:function(t){this.subscribedStationUic&&(this.unsubscribe("timetable_".concat(this.subscribedStationUic),"",t),this.subscribedStationUic=null)}},{key:"subscribeDisruptions",value:function(t){this.subscribe("".concat(this.prefix,"newsticker"),(function(e){t(e.content)}))}},{key:"unsubscribeDisruptions",value:function(t){this.unsubscribe("".concat(this.prefix,"newsticker"),"",t)}},{key:"getStation",value:function(t,e){var r=this,n={channel:"station".concat(kn(e,Rn)),args:t};return new Promise((function(t,e){r.conn.get(n,(function(r){r.content?t(r.content):e()}))}))}},{key:"getStations",value:function(t){var e=this,r=[],n={channel:"station".concat(kn(t,Rn))};return window.clearTimeout(this.stationUpdateTimeout),new Promise((function(t,o){e.conn.get(n,(function(n){n.content?(r.push(n.content),window.clearTimeout(e.stationUpdateTimeout),e.stationUpdateTimeout=window.setTimeout((function(){t(r)}),50)):o(n.content)}))}))}},{key:"subscribeStations",value:function(t,e){this.unsubscribeStations(),this.subscribe("station".concat(kn(t,Rn)),(function(t){t.content&&e(t.content)}))}},{key:"unsubscribeStations",value:function(t){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",t)}},{key:"subscribeExtraGeoms",value:function(t){var e=this;this.subscribe("extra_geoms",(function(r){var n=r.content;if(n){var o=n.properties.ref;"Feature"===n.type?e.extraGeoms[o]=n:delete e.extraGeoms[o],t(Object.keys(e.extraGeoms).map((function(t){return e.extraGeoms[t]})))}}))}},{key:"unsubscribeExtraGeoms",value:function(t){this.unsubscribe("extra_geoms","",t)}},{key:"subscribeTrajectory",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeTrajectory(e),this.subscribe("trajectory".concat(kn(t,Rn)),e,null,r)}},{key:"unsubscribeTrajectory",value:function(t){this.unsubscribe("trajectory","",t)}},{key:"subscribeDeletedVehicles",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.unsubscribeDeletedVehicles(e),this.subscribe("deleted_vehicles".concat(kn(t,Rn)),e,null,r)}},{key:"unsubscribeDeletedVehicles",value:function(t){this.unsubscribe("deleted_vehicles","",t)}},{key:"getFullTrajectory",value:function(t,e,r){var n=this,o=["full_trajectory".concat(kn(e,Rn))];t&&o.push(t),e&&e!==Rn.TOPOGRAPHIC||!r||o.push("gen".concat(r));var i={channel:o.join("_")};return new Promise((function(t){n.conn.get(i,(function(e){e.content&&t(e.content)}))}))}},{key:"getFullTrajectories",value:function(t,e,r){var n=this,o=t.map((function(t){return n.getFullTrajectory(t,e,r)}));return Promise.all(o)}},{key:"subscribeFullTrajectory",value:function(t,e){this.unsubscribeFullTrajectory(t),this.subscribe("full_trajectory".concat(kn(e,Rn),"_").concat(t),(function(t){console.log("subscribe full_trajectory",t)}),(function(t){console.log("subscribe full_trajectory error",t)}))}},{key:"unsubscribeFullTrajectory",value:function(t,e){this.unsubscribe("full_trajectory","_".concat(t),e)}},{key:"getStopSequence",value:function(t){var e=this,r={channel:"stopsequence_".concat(t)};return new Promise((function(t,n){e.conn.get(r,(function(e){if(e.content&&e.content.length){var r=e.content.map((function(t){return Tn(t)}));t(r)}t([])}),(function(t){n(t)}))}))}},{key:"getStopSequences",value:function(t){var e=this,r=t.map((function(t){return e.getStopSequence(t)}));return Promise.all(r)}},{key:"subscribeStopSequence",value:function(t,e){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(t),this.subscribe("stopsequence_".concat(t),(function(t){if(t.content&&t.content.length){var r=t.content.map((function(t){return Tn(t)}));e(r)}}),(function(t){console.log("subscribe stopsequence error",t)}))}},{key:"unsubscribeStopSequence",value:function(t,e){this.unsubscribe("stopsequence","_".concat(t),e)}},{key:"subscribeHealthCheck",value:function(t){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",t)}},{key:"unsubscribeHealthCheck",value:function(){this.unsubscribe("healthcheck")}}])&&xn(e.prototype,r),n&&xn(e,n),t}();function Dn(t){return(Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function In(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(r),!0).forEach((function(e){An(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function An(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Ln(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ln(t,e)}(t,e)||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 Ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vn(t,e,r){return(Vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bn(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Fn(t,e){return(Fn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Un(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Bn(t);if(e){var o=Bn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qn(this,r)}}function qn(t,e){return!e||"object"!==Dn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Bn(t){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Kn(t,e,r){return e&&Hn(t.prototype,e),r&&Hn(t,r),t}var zn=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fn(t,e)}(r,t);var e=Un(r);function r(){return Nn(this,r),e.apply(this,arguments)}return Kn(r,[{key:"defineProperties",value:function(t){var e=this;Vn(Bn(r.prototype),"defineProperties",this).call(this,t);var n,o=3;if(!t.api){var i={};t.url&&(i.url=t.url),t.apiKey&&(i.apiKey=t.apiKey),n=new gn(i)}Object.defineProperties(this,{requestIntervalSeconds:{get:function(){return o},set:function(t){t!==o&&(o=t,e.visible&&e.start())}},api:{value:t.api||n}})}},{key:"init",value:function(t){Vn(Bn(r.prototype),"init",this).call(this,t),this.sortFc?this.sort=this.sortFc:this.useDelayStyle&&(this.sort=function(t,e){return null===t.delay||t.delay<e.delay?1:-1})}},{key:"start",value:function(){this.updateFilters(),Vn(Bn(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Vn(Bn(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(t,e,n){var o=Mn(t,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Vn(Bn(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=Mn(t,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Vn(Bn(r.prototype),"onFeatureClick",this).call(this,t,e,n)}},{key:"highlightTrajectory",value:function(){var t=this,e=this.selectedVehicleId,r=this.journeyId,n=[this.api.fetchTrajectoryStations(this.getParams({id:e,time:Se(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:Se(new Date)}))];Promise.all(n).then((function(e){var r=Mn(e,2),n=r[0],o=r[1],i=[];if(n&&n.stations.forEach((function(t){i.push(t.coordinates)})),o){var c=o.p,a=o.t,u=o.c,s=[];c.forEach((function(t){t.forEach((function(t){s.push([t.x,t.y])}))}));var l=u?"#".concat(u):le(a),f=/#ffffff/i.test(l)?"#ff0000":l;t.drawFullTrajectory(i,s,t.useDelayStyle?"#a0a0a0":f)}})).catch((function(){t.drawFullTrajectory()}))}},{key:"abortFetchTrajectories",value:function(){this.abortController&&this.abortController.abort()}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=1e3*(this.requestIntervalSeconds+5),r=this.speed*e,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=In(In({},t),{},{btime:Se(n),etime:Se(this.later),date:ke(n),rid:1,a:1,cd:1,nm:1,fl:1});return c}},{key:"startUpdateTrajectories",value:function(){var t=this;this.stopUpdateTrajectories(),this.updateTrajectories(),this.updateInterval=window.setInterval((function(){t.updateTrajectories()}),1e3*this.requestIntervalSeconds)}},{key:"stopUpdateTrajectories",value:function(){clearInterval(this.updateInterval)}},{key:"updateTrajectories",value:function(){var t=this;this.abortFetchTrajectories(),this.abortController=new AbortController,this.api.fetchTrajectories(this.getParams({attr_det:1}),this.abortController).catch((function(t){if("AbortError"!==t.name)throw t})).then((function(e){e&&(t.tracker.setTrajectories(e),t.renderTrajectories())}))}},{key:"drawFullTrajectory",value:function(t,e,r){}},{key:"defaultStyle",value:function(t,e){var r=e.zoom,n=t.type,o=t.name,i=t.id,c=t.color,a=t.textColor,u=t.delay,s=t.cancelled,l=t.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(l).concat(u).concat(p).concat(y).concat(s),b=se(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(l).concat(u).concat(p).concat(y).concat(s)),!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=ye(u,s),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||s)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(s?19:14,Math.min(s?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=ye(u,s,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=he(u,s);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?ye(u,s):c||le(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"===l&&P.setLineDash([5,3]),(v||p||y)&&P.stroke(),P.restore(),d){var T=Math.max(b,10*this.pixelRatio),C=pe(P,O,o,T);this.useDelayStyle&&null===u&&"yes"===l&&(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||fe(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}(t)};function Zn(t){return(Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Wn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Gn(Object(r),!0).forEach((function(e){$n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Xn(t,e,r){return(Xn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ro(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Yn(t,e){return(Yn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function to(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ro(t);if(e){var o=ro(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return eo(this,r)}}function eo(t,e){return!e||"object"!==Zn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ro(t){return(ro=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var no=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yn(t,e)}(i,t);var e,r,n,o=to(i);function i(){return Jn(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"start",value:function(){var t=this;this.map&&(Xn(ro(i.prototype),"start",this).call(this),this.olEventsKeys=[this.map.on("movestart",(function(){t.abortFetchTrajectories()})),this.map.on("moveend",this.onMoveEnd.bind(this))])}},{key:"stop",value:function(){Object(c.unByKey)(this.olEventsKeys),Xn(ro(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){var t=this.map.getView().getZoom();t!==this.currentZoom&&(this.currentZoom=t,this.requestIntervalSeconds=200/t||1e3),this.abortFetchTrajectories(),this.map.getView().getAnimating()||this.map.getView().getInteracting()||this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"drawFullTrajectory",value:function(t,e,r){var n=this.vectorLayer.getSource();if(n.clear(),t){var o=new Ar.MultiPoint(t.map((function(t){return Object(Ht.fromLonLat)(t)}))),i=new We.a(o);i.setStyle(new Be.Style({zIndex:1,image:new Be.Circle({radius:5,fill:new Be.Fill({color:"#000000"})})}));var c=new We.a(o);c.setStyle(new Be.Style({zIndex:4,image:new Be.Circle({radius:4,fill:new Be.Fill({color:r})})})),n.addFeatures([i,c])}if(e){var a=new We.a({geometry:new Ar.LineString(e)});a.setStyle([new Be.Style({zIndex:2,stroke:new Be.Stroke({color:"#000000",width:6})}),new Be.Style({zIndex:3,stroke:new Be.Stroke({color:r,width:4})})]),n.addFeature(a)}}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getView().calculateExtent(),r=Object(Ze.buffer)(e,Object(Ze.getWidth)(e)/10).join(","),n=this.map.getView().getZoom();return Xn(ro(i.prototype),"getParams",this).call(this,Wn(Wn({},t),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(t){return new i(Wn(Wn({},this.options),t))}}])&&Qn(e.prototype,r),n&&Qn(e,n),i}(zn(Ir)),oo=r(24),io=r.n(oo);function co(t){return(co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ao(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(t,e)||so(t,e)||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 uo(t){return function(t){if(Array.isArray(t))return lo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||so(t)||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 so(t,e){if(t){if("string"==typeof t)return lo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lo(t,e):void 0}}function lo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function po(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fo(Object(r),!0).forEach((function(e){yo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function yo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ho(t,e,r){return(ho="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Oo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function bo(t,e){return(bo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Oo(t);if(e){var o=Oo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mo(this,r)}}function mo(t,e){return!e||"object"!==co(e)&&"function"!=typeof e?go(t):e}function go(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Oo(t){return(Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function jo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Po(t,e,r){return e&&wo(t.prototype,e),r&&wo(t,r),t}var ko=function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bo(t,e)}(r,t);var e=vo(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return jo(this,r),(t=e.call(this,po({},n))).debug=n.debug,t.mode=n.mode||Rn.TOPOGRAPHIC,t.api=n.api||new En(n),t.tenant=n.tenant||"",t.minZoomNonTrain=n.minZoomNonTrain||9,t.format=new $t.a,t.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},t.isUpdateBboxOnMoveEnd=!1!==n.isUpdateBboxOnMoveEnd,t.onTrajectoryMessage=t.onTrajectoryMessage.bind(go(t)),t.onDeleteTrajectoryMessage=t.onDeleteTrajectoryMessage.bind(go(t)),t}return Po(r,[{key:"start",value:function(){ho(Oo(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(){ho(Oo(r.prototype),"stop",this).call(this),this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close()}},{key:"setBbox",value:function(t,e){for(var r=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,t,e)){var o=uo(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}var i=uo(t);this.isUpdateBboxOnMoveEnd&&(i.push(e),this.tenant&&i.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[e],this.generalizationLevel&&i.push("gen=".concat(this.generalizationLevel))),this.api.bbox=i}},{key:"setMode",value:function(t){this.mode!==t&&(this.mode=t,this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,this.isUpdateBboxOnMoveEnd))}},{key:"getTrajectoryInfos",value:function(t){var e=[this.api.getStopSequence(t,this.mode),this.api.getFullTrajectory(t,this.mode,this.generalizationLevel)];return Promise.all(e).then((function(t){var e=ao(t,2);return{stopSequence:e[0],fullTrajectory:e[1]}}))}},{key:"mustNotBeDisplayed",value:function(t,e,r){return!Object(Ze.intersects)(e,t.bounds)||"rail"!==t.type&&r<(this.minZoomNonTrain||9)}},{key:"addTrajectory",value:function(t,e){var r=this.trajectories.findIndex((function(e){return e.train_id===t.train_id})),n=t.time_intervals,o=po(po({},t),{},{id:t.train_id,timeIntervals:n});e?(this.trajectories.unshift(o),-1!==r&&this.tracker.trajectories.splice(r+1,1)):(this.trajectories.push(o),-1!==r&&this.tracker.trajectories.splice(r,1)),this.tracker.setTrajectories(this.trajectories)}},{key:"removeTrajectory",value:function(t){for(var e=0,r=this.trajectories.length;e<r;e+=1)if(this.trajectories[e].train_id===t){this.trajectories.splice(e,1);break}}},{key:"onTrajectoryMessage",value:function(t){if(t.content){var e=this.format.readFeature(t.content);if(e.set("timeOffset",Date.now()-t.timestamp),e.get("time_since_update")>=0){if(this.debug&&this.mode===Rn.TOPOGRAPHIC&&e.get("raw_coordinates")){var r=new io.a(e.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),e.setGeometry(r)}this.mustNotBeDisplayed(e.getProperties())||this.addTrajectory(e.getProperties(),!e.get("line"))}}}},{key:"onDeleteTrajectoryMessage",value:function(t){t.content&&this.removeTrajectory(t.content)}},{key:"onFeatureHover",value:function(t,e,n){var o=ao(t,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),ho(Oo(r.prototype),"onFeatureHover",this).call(this,t,e,n)}},{key:"onFeatureClick",value:function(t,e,n){var o=ao(t,1)[0],i=null;o&&(i=o.get("train_id")),this.selectedVehicleId!==i&&(this.selectedVehicleId=i,this.selectedVehicle=o,this.renderTrajectories()),ho(Oo(r.prototype),"onFeatureClick",this).call(this,t,e,n)}}]),r}(t)};function So(t){return(So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function To(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Co(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?To(Object(r),!0).forEach((function(e){xo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):To(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function xo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ro(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Eo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Do(t,e,r){return(Do="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mo(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function _o(t,e){return(_o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Mo(t);if(e){var o=Mo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ao(this,r)}}function Ao(t,e){return!e||"object"!==So(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Mo(t){return(Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lo=new $t.a,Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_o(t,e)}(i,t);var e,r,n,o=Io(i);function i(){return Ro(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"mustNotBeDisplayed",value:function(t,e,r){return Do(Mo(i.prototype),"mustNotBeDisplayed",this).call(this,t,e||this.map.getView().calculateExtent(),r||this.map.getView().getZoom())}},{key:"setBbox",value:function(t,e){var r=t,n=e;!r&&this.isUpdateBboxOnMoveEnd&&(r=t||this.map.getView().calculateExtent(),n=Math.floor(this.map.getView().getZoom())),Do(Mo(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(t){Do(Mo(i.prototype),"onMoveEnd",this).call(this,t),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.visible&&this.isUpdateBboxOnMoveEnd&&this.isClickActive&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"onFeatureClick",value:function(t,e,r){Do(Mo(i.prototype),"onFeatureClick",this).call(this,t,e,r),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"highlightTrajectory",value:function(t){var e=this;this.getTrajectoryInfos(t).then((function(t){var r=t.stopSequence,n=t.fullTrajectory,o=e.vectorLayer.getSource();o.clear();var i="#ffffff";if(e.useDelayStyle)i="#a0a0a0";else{if(n){var c=n.features[0].properties,a=c.type,u=c.stroke;u&&"#"!==u[0]&&(u="#".concat(u)),i=u||le(a)}i=/#ffffff/i.test(i)?"#ff0000":i}if(r.forEach((function(t){if(t.stations){var e=new Ar.MultiPoint(t.stations.map((function(t){return t.coordinate}))),r=new We.a(e);r.setStyle(new Be.Style({zIndex:1,image:new Be.Circle({radius:5,fill:new Be.Fill({color:"#000000"})})}));var n=new We.a(e);n.setStyle(new Be.Style({zIndex:4,image:new Be.Circle({radius:4,fill:new Be.Fill({color:i})})})),o.addFeatures([r,n])}})),n){var s=[new Be.Style({zIndex:2,stroke:new Be.Stroke({color:"#000000",width:6})}),new Be.Style({zIndex:3,stroke:new Be.Stroke({color:i,width:4})})],l=Lo.readFeatures(n);l.forEach((function(t){t.setStyle(s)})),e.vectorLayer.getSource().addFeatures(l)}}))}},{key:"clone",value:function(t){return new i(Co(Co({},this.options),t))}}])&&Eo(e.prototype,r),n&&Eo(e,n),i}(ko(Ir));function Fo(t){return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Uo(Object(r),!0).forEach((function(e){Bo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Bo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function No(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ho(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ko(t,e){return(Ko=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function zo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Go(t);if(e){var o=Go(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Zo(this,r)}}function Zo(t,e){return!e||"object"!==Fo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Go(t){return(Go=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ko(t,e)}(i,t);var e,r,n,o=zo(i);function i(){return No(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this,r=[];if(this.map){var n=this.map.getPixelFromCoordinate(t);r=this.map.getFeaturesAtPixel(n,{layerFilter:function(t){return t===e.olLayer},hitTolerance:this.hitTolerance})}return Promise.resolve({features:r,layer:this,coordinate:t})}},{key:"clone",value:function(t){return new i(qo(qo({},this.options),t))}}])&&Ho(e.prototype,r),n&&Ho(e,n),i}(I);function $o(t){return($o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jo(Object(r),!0).forEach((function(e){Xo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Xo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ti(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ei(t,e){return(ei=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=oi(t);if(e){var o=oi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ni(this,r)}}function ni(t,e){return!e||"object"!==$o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function oi(t){return(oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ei(t,e)}(i,t);var e,r,n,o=ri(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Yo(this,i),(t=o.call(this,e)).abortController=new AbortController,t.format=new $t.a,t}return e=i,(r=[{key:"getFeatureInfoUrl",value:function(t){var e=this.map.getView().getProjection(),r=this.map.getView().getResolution();return!!this.olLayer.getSource().getFeatureInfoUrl&&this.olLayer.getSource().getFeatureInfoUrl(t,r,e,{info_format:"application/json",query_layers:this.olLayer.getSource().getParams().layers})}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=this;this.abortController.abort(),this.abortController=new AbortController;var r=this.abortController.signal;return fetch(this.getFeatureInfoUrl(t),{signal:r}).then((function(t){return t.json()})).then((function(t){return t.features})).then((function(r){return{layer:e,coordinate:t,features:r.map((function(t){return e.format.readFeature(t)}))}})).catch((function(){return Promise.resolve({features:[],coordinate:t,layer:e})}))}},{key:"clone",value:function(t){return new i(Qo(Qo({},this.options),t))}}])&&ti(e.prototype,r),n&&ti(e,n),i}(I);r(15),r(25),r(26),r(17);function ci(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ai(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ui(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ai(Object(r),!0).forEach((function(e){si(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ai(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function si(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function li(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=yi(t);if(e){var o=yi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return pi(this,r)}}function pi(t,e){return!e||"object"!==ci(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function yi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function vi(t,e,r){return e&&bi(t.prototype,e),r&&bi(t,r),t}function di(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Oi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pi(t);if(e){var o=Pi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return wi(this,r)}}function wi(t,e){return!e||"object"!==di(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Pi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ki=Z;var ki;function Si(t){return(Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ti(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ci(t,e,r){return(Ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_i(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function xi(t,e){return(xi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ri(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_i(t);if(e){var o=_i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ei(this,r)}}function Ei(t,e){return!e||"object"!==Si(e)&&"function"!=typeof e?Di(t):e}function Di(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _i(t){return(_i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ii=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xi(t,e)}(i,t);var e,r,n,o=Ri(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).render=e.render.bind(Di(e)),e}return e=i,(r=[{key:"activate",value:function(){Ci(_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)),Ci(_i(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return re(this.map)}}])&&Ti(e.prototype,r),n&&Ti(e,n),i}(vt(Z));function Ai(t){return("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Li(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mi(Object(r),!0).forEach((function(e){Vi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mi(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Vi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ui(t,e,r){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==Hi(t););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function qi(t,e){return(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Bi(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Hi(t);if(e){var o=Hi(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ni(this,r)}}function Ni(t,e){return!e||"object"!==Ai(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Hi(t){return(Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}it(Kt.Map);var Ki=r(18),zi=r.n(Ki),Zi=r(19);function Gi(t){return(Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wi(t){return function(t){if(Array.isArray(t))return $i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return $i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $i(t,e)}(t)||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 $i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ji(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Qi(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ji(Object(r),!0).forEach((function(e){Xi(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Xi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ec(t,e,r){return(ec="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ic(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function rc(t,e){return(rc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ic(t);if(e){var o=ic(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return oc(this,r)}}function oc(t,e){return!e||"object"!==Gi(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ic(t){return(ic=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cc(t){return function(t){if(Array.isArray(t))return ac(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ac(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ac(t,e)}(t)||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 ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var uc=function(t){var e=t.getBounds().toArray(),r=Object(Ht.fromLonLat)(e[0]),n=Object(Ht.fromLonLat)(e[1]),o=[].concat(cc(r),cc(n)),i=t.getCanvas(),c=i.width,a=i.height,u=Object(Ze.getWidth)(o)/c,s=Object(Ze.getHeight)(o)/a;return Math.max(u,s)},sc=function(t,e){var r=t.getCanvas(),n=r.width,o=r.height,i=t.unproject({x:0,y:0}),c=t.unproject({x:0,y:o/e}),a=t.unproject({x:n/e,y:o/e}),u=t.unproject({x:n/e,y:0});return[[i.lng,i.lat],[u.lng,u.lat],[a.lng,a.lat],[c.lng,c.lat]]};function lc(t){return(lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fc(t){return function(t){if(Array.isArray(t))return pc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return pc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pc(t,e)}(t)||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 pc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function hc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yc(Object(r),!0).forEach((function(e){bc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mc(t,e,r){return(mc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function gc(t,e){return(gc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Oc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Pc(t);if(e){var o=Pc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jc(this,r)}}function jc(t,e){return!e||"object"!==lc(e)&&"function"!=typeof e?wc(t):e}function wc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pc(t){return(Pc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var kc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gc(t,e)}(i,t);var e,r,n,o=Oc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return vc(this,i),(t=o.call(this,hc({},e))).onMove=t.onMove.bind(wc(t)),t.onMoveEnd=t.onMoveEnd.bind(wc(t)),t.onZoomEnd=t.onZoomEnd.bind(wc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(wc(t)),t}return e=i,(r=[{key:"init",value:function(t,e){if(t){var r=t.getCanvas();mc(Pc(i.prototype),"init",this).call(this,t,{width:r.width/this.pixelRatio,height:r.height/this.pixelRatio});var n={type:"canvas",canvas:this.tracker.canvas,coordinates:sc(t,this.pixelRatio),animate:!0,attribution:this.copyrights&&this.copyrights.join(", ")};this.beforeId=e,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"}},t.addSource(this.key,n),t.addLayer(this.layer,this.beforeId),this.listeners=[this.on("change:visible",this.onVisibilityChange)]}}},{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.getLayer(this.key)&&this.map.removeLayer(this.key),this.map.getSource(this.key)&&this.map.removeSource(this.key)),mc(Pc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){mc(Pc(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(){mc(Pc(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(t){mc(Pc(i.prototype),"onUserClickCallback",this).call(this,hc({coordinate:Object(Ht.fromLonLat)(t.lngLat.toArray())},t))}},{key:"onUserMoveCallback",value:function(t){mc(Pc(i.prototype),"onUserMoveCallback",this).call(this,hc({coordinate:Object(Ht.fromLonLat)(t.lngLat.toArray())},t))}},{key:"renderTrajectories",value:function(t){var e=this.map.getCanvas(),r=e.width,n=e.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=zi()(Object(Zi.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=zi()(Object(Zi.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(fc(Object(Ht.fromLonLat)(u)),fc(Object(Ht.fromLonLat)(s))),f=Object(Ze.getWidth)(l)/(r/this.pixelRatio),p=Object(Ze.getHeight)(l)/(n/this.pixelRatio),y=Math.max(f,p),h={size:[r/this.pixelRatio,n/this.pixelRatio],center:Object(Ht.fromLonLat)([o.lng,o.lat]),extent:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};mc(Pc(i.prototype),"renderTrajectories",this).call(this,h,t)}},{key:"getRefreshTimeInMs",value:function(){return mc(Pc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(t,e){var r=uc(this.map);return mc(Pc(i.prototype),"getVehiclesAtCoordinate",this).call(this,t,r,e)}},{key:"getFeatureInfoAtCoordinate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=uc(this.map);return mc(Pc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,t,hc({resolution:r},e))}},{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 t=sc(this.map,this.pixelRatio),e=this.map.getSource(this.key);e&&e.setCoordinates(t),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){}},{key:"onFeatureHover",value:function(t,e,r){mc(Pc(i.prototype),"onFeatureHover",this).call(this,t,e,r),this.map.getCanvasContainer().style.cursor=t.length?"pointer":"auto"}}])&&dc(e.prototype,r),n&&dc(e,n),i}(jr(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rc(t,e)}(i,t);var e,r,n,o=nc(i);function i(){return Yi(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"init",value:function(t){ec(ic(i.prototype),"init",this).call(this,t),this.map&&(this.isClickActive||this.isHoverActive)&&(this.toggleVisibleListeners(),this.onChangeVisibleKey=this.on("change:visible",this.toggleVisibleListeners))}},{key:"terminate",value:function(t){this.map&&(this.map.off("mousemove",this.onUserMoveCallback),this.map.off("click",this.onUserClickCallback),Object(c.unByKey)(this.onChangeVisibleKey)),ec(ic(i.prototype),"terminate",this).call(this,t)}},{key:"onUserClickCallback",value:function(t){ec(ic(i.prototype),"onUserClickCallback",this).call(this,Qi({coordinate:t.lngLat.toArray()},t))}},{key:"onUserMoveCallback",value:function(t){ec(ic(i.prototype),"onUserMoveCallback",this).call(this,Qi({coordinate:t.lngLat.toArray()},t))}},{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 t=this.map.getBounds().toArray();return Object(Ht.transformExtent)([].concat(Wi(t[0]),Wi(t[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(t){return new i(Qi(Qi({},this.options),t))}}])&&tc(e.prototype,r),n&&tc(e,n),i}(w)));function Sc(t){return(Sc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function xc(t,e,r){return(xc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_c(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Rc(t,e){return(Rc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ec(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_c(t);if(e){var o=_c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Dc(this,r)}}function Dc(t,e){return!e||"object"!==Sc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _c(t){return(_c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ic=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Rc(t,e)}(i,t);var e,r,n,o=Ec(i);function i(){return Tc(this,i),o.apply(this,arguments)}return e=i,(r=[{key:"mustNotBeDisplayed",value:function(t,e,r){return xc(_c(i.prototype),"mustNotBeDisplayed",this).call(this,t,e||this.getMercatorExtent(),r||Math.floor(this.map.getZoom()+1))}},{key:"setBbox",value:function(t,e){var r=t,n=e;!r&&this.isUpdateBboxOnMoveEnd&&(r=t||this.getMercatorExtent(),n=Math.floor(this.getOlZoom())),xc(_c(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(t){xc(_c(i.prototype),"onMoveEnd",this).call(this,t),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Cc(e.prototype,r),n&&Cc(e,n),i}(ko(kc));function Ac(t){return(Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mc(t){return function(t){if(Array.isArray(t))return Lc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Lc(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lc(t,e)}(t)||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 Lc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vc(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Fc(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Vc(Object(r),!0).forEach((function(e){Uc(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vc(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Uc(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Nc(t,e,r){return(Nc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Gc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function Hc(t,e){return(Hc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Gc(t);if(e){var o=Gc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zc(this,r)}}function zc(t,e){return!e||"object"!==Ac(e)&&"function"!=typeof e?Zc(t):e}function Zc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Gc(t){return(Gc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wc={mapbox:{TrajservLayer:function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Hc(t,e)}(i,t);var e,r,n,o=Kc(i);function i(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return qc(this,i),(t=o.call(this,Fc({},e))).onMove=t.onMove.bind(Zc(t)),t.onMoveEnd=t.onMoveEnd.bind(Zc(t)),t.onVisibilityChange=t.onVisibilityChange.bind(Zc(t)),t}return e=i,(r=[{key:"terminate",value:function(){this.map&&(this.listeners.forEach((function(t){Object(c.unByKey)(t)})),this.map.removeLayer(this.key),this.map.removeSource(this.key)),Nc(Gc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(Nc(Gc(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)),Nc(Gc(i.prototype),"stop",this).call(this)}},{key:"onMoveEnd",value:function(){this.updateTrajectories(),this.selectedVehicleId&&this.journeyId&&this.highlightTrajectory()}},{key:"getParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.map.getBounds().toArray(),r=Object(Ht.fromLonLat)(e[0]),n=Object(Ht.fromLonLat)(e[1]),o=[].concat(Mc(r),Mc(n)),c=Object(Ze.buffer)(o,Object(Ze.getWidth)(o)/10).join(","),a=this.map.getZoom();return Nc(Gc(i.prototype),"getParams",this).call(this,Fc(Fc({},t),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(t,e,r){console.log("to be implemented")}}])&&Bc(e.prototype,r),n&&Bc(e,n),i}(zn(kc)),TralisLayer:Ic},ol:{Map:Nt,Layer:I,WMSLayer:ii,MapboxLayer:qe,TrajservLayer:no,TralisLayer:Vo,VectorLayer:Wo}};e.default=Wc}])}));
|
|
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/style")},function(e,t){e.exports=require("ol/proj")},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/Feature")},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("mapbox-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")},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/geom/Point")},function(e,t){e.exports=require("ol/interaction")},function(e,t){e.exports=require("ol/events/condition")},function(e,t,r){e.exports=r(28)},function(e,t,r){"use strict";r.r(t);var n=r(20),o=r.n(n),i=r(21),c=r(3),a=r.n(c),u=r(22),s=r.n(u),l=r(23);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,s=r.isQueryable,f=r.isClickActive,p=r.isHoverActive,h=r.hitTolerance,b=Object(l.v4)(),v=n||b;Object.defineProperties(this,{options:{value:e},name:{value:v},key:{value:o||v.toLowerCase()},isBaseLayer:{value:!!u},isQueryable:{value:!!s},isClickActive:{value:!!s&&!!f},isHoverActive:{value:!!s&&!!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=x(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 x(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}function R(e,t){return(R=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&&R(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 s.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(10),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 V(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 F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){U(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(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=F({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=F({},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(11),se=r.n(ue);function le(e){return(le="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"===le(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=Re(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=Re(e);if(t){var o=Re(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 xe(e)}function xe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(e){return(Re=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(xe(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(Re(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(Re(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 Ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(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 Ue(){return(Ue="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 Ve(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&&Ue(ze(c.prototype),"addLayer",this).call(this,e.olLayer),this.dispatchEvent({type:"change:mobilityLayers",target:this})):Ue(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&&Ue(ze(c.prototype),"removeLayer",this).call(this,e)):Ue(ze(c.prototype),"removeLayer",this).call(this,e)}},{key:"addControl",value:function(e){Ue(ze(c.prototype),"addControl",this).call(this,e)}},{key:"removeControl",value:function(e){Ue(ze(c.prototype),"removeControl",this).call(this,e)}}])&&Fe(t.prototype,r),n&&Fe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(ae(o.a)),Ge=r(1),We=r(12),$e=r.n(We),Je=r(13),Qe=r.n(Je),Xe=r(6),Ye=r.n(Xe),et=r(7),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],st=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],lt=["#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 st[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 lt[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,s=t.pixelRatio,l=t.operator_provides_realtime_journey,f=e.line,p=e.type,y=e.id,h=e.delay,b=e.cancelled,v=void 0!==b&&b;p||(p="Rail"),f||(f={});var d=f,m=d.name,g=d.text_color,O=d.color;m||(m="I"),g||(g="#000000"),O&&"#"!==O[0]&&(O="#".concat(O)),"#"!==g[0]&&(g="#".concat(g));var j=Math.min(Math.floor(u||1),16),w=n===y,P=o===y,k=yt(p,j)*s,S=k>=7*s;(w||P)&&(k=S?k+5*s:14*s);var T=k>10*s,C="".concat(k).concat(p).concat(O).concat(w).concat(P).concat(v).concat(h);if(i&&(C+="".concat(l)),T&&(C+="".concat(m).concat(g)),!kt[C]){if(0===k)return kt[C]=null,null;var E,x=1*s,R=k+2,_=2*k,D=2*R+2*x+100*s,I=D/2,A=gt(D,D),M=A.getContext("2d");if(S&&null!==h){var L=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]}(I,R,dt(h,v));M.drawImage(L,0,0)}if(S&&(w||h>=a||v)){var B=Math.max(v?19:14,Math.min(v?19:17,1.2*k))*s,V=mt(h,v);if(V){var F=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),s=u.getContext("2d");s.textAlign="left",s.textBaseline="middle",s.font=n,s.fillStyle=o,s.strokeStyle=i,s.lineWidth=1.5*c;var l=t;s.strokeText(l,0,r),s.fillText(l,0,r),jt[a]=u}return jt[a]}(V.length*B,V,B,"bold ".concat(B,"px arial, sans-serif"),dt(h,v,!0),c,s);M.drawImage(F,I+R+x,I-B)}}var U=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]}(I,k,E=i?dt(h,v):O||ht(p),S||w||P,S&&i&&null===h&&"yes"===l,s);if(M.drawImage(U,0,0),T){var q=Math.max(k,10),N=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),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),Pt[a]=u}return Pt[a]}(m,I,vt(M,_,m,q),i?"#000000":g||bt(p),E,i&&null===h&&"yes"===l,s);M.drawImage(N,0,0)}kt[C]=A}return kt[C]},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("")},xt=function(e){return[e.getUTCHours(),e.getUTCMinutes(),"".concat(e.getUTCSeconds(),".").concat(e.getUTCMilliseconds())].join(":")};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=[],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 Vt(){return(Vt="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=Kt(e)););return e}function Ut(e,t){return(Ut=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"===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 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&&Ut(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 se.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;Vt(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,Vt(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(0),Gt=r(14),Wt=r(8);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(9)),Qt=r(2),Xt=r(5),Yt=r.n(Xt),er=r(16),tr=r.n(er);function rr(e){return function(e){if(Array.isArray(e))return ir(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||or(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 nr(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)||or(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 or(e,t){if(e){if("string"==typeof e)return ir(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)?ir(e,t):void 0}}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}function cr(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 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 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)}}var sr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cr(Object(r),!0).forEach((function(t){ar(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({interpolate:!0},t);this.pixelRatio=t.pixelRatio||window.devicePixelRatio||1,this.trajectories=[],this.renderedTrajectories=[],this.interpolate=!!r.interpolate,this.hoverVehicleId=r.hoverVehicleId,this.selectedVehicleId=r.selectedVehicleId,this.filter=r.filter,this.sort=r.sort,this.style=r.style,this.canvas=r.canvas||document.createElement("canvas"),this.canvas.width=r.width*this.pixelRatio,this.canvas.height=r.height*this.pixelRatio,this.canvas.setAttribute("style",["position: absolute","top: 0","bottom: 0","width: ".concat(r.width,"px"),"height: ".concat(r.height,"px"),"pointer-events: none","visibility: visible","margin-top: inherit"].join(";")),this.canvasContext=this.canvas.getContext("2d")}var t,r,n;return t=e,(r=[{key:"setVisible",value:function(e){this.canvas&&(this.canvas.style.visibility=e?"visible":"hidden")}},{key:"setTrajectories",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.sort&&e.sort(this.sort),this.trajectories=e}},{key:"getTrajectories",value:function(){return this.trajectories||[]}},{key:"clear",value:function(){this.canvasContext&&this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"renderTrajectories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.time,n=void 0===r?Date.now():r,o=e.size,i=void 0===o?[]:o,c=e.center,a=e.resolution,u=e.rotation,s=void 0===u?0:u,l=e.pixelRatio;this.clear();var f=nr(i,2),p=f[0],y=f[1];if(p&&y&&(this.canvas.width!==p||this.canvas.height!==y)){var h=[p*l,y*l];this.canvas.width=h[0],this.canvas.height=h[1]}var b,v,d,m,g,O,j,w,P=Object(Jt.compose)(Object(Jt.create)(),i[0]/2,i[1]/2,1/a,-1/a,-s,-c[0],-c[1]);this.canvas.style.width="".concat(this.canvas.width/l,"px"),this.canvas.style.height="".concat(this.canvas.height/l,"px"),this.currResolution=a||this.currResolution,this.renderedTrajectories=[];for(var k=(this.trajectories||[]).length-1;k>=0;k-=1){var S=this.trajectories[k];this.trajectories[k].rendered=!1;var T=S.geometry,C=S.timeIntervals,E=S.timeOffset;if(!this.filter||this.filter(S,k,this.trajectories)){var x=null,R=void 0;if(!S.coordinate||!t&&this.interpolate){if(C&&C.length>1){for(var _=n-(E||0),D=void 0,I=void 0,A=void 0,M=void 0,L=void 0,B=0;B<C.length-1;B+=1){var V=nr(C[B],3);D=V[0],A=V[1],R=V[2];var F=nr(C[B+1],2);if(I=F[0],M=F[1],D<=_&&_<=I)break;D=null,I=null}if(T.getType()===tr.a.POINT)x=T.getCoordinates();else if(T.getType()===tr.a.LINE_STRING){if(D&&I){L=this.interpolate?Math.min((_-D)/(I-D),1):0;var U=this.interpolate?L*(M-A)+A:0;x=T.getCoordinateAt(U),this.trajectories[k].rotation=R,this.trajectories[k].endFraction=L}else if(_<C[0][0]){var q=nr(C,1),N=nr(q[0],3);R=N[2],L=0,x=T.getFirstCoordinate()}else if(_>C[C.length-1][0]){var H=nr(C[C.length-1],3);R=H[2],L=1,x=T.getLastCoordinate()}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",T);this.trajectories[k].rotation=R,this.trajectories[k].endFraction=L||0}}else x=S.coordinate;if(x){this.trajectories[k].coordinate=x;var K=Object(Jt.apply)(P,rr(x));if(!K)continue;if((K=K.map((function(e){return e*l})))[0]<0||K[0]>this.canvas.width||K[1]<0||K[1]>this.canvas.height)continue;var z=this.style(S,e);if(!z)continue;this.trajectories[k].rendered=!0,this.renderedTrajectories.push(this.trajectories[k]);var Z=z.width,G=z.height;this.hoverVehicleId!==S.id&&this.selectedVehicleId!==S.id&&this.canvasContext.drawImage(z,K[0]-Z/2,K[1]-G/2,Z,G),this.hoverVehicleId===S.id&&(b=z,v=K,d=Z,m=G),this.selectedVehicleId===S.id&&(g=z,O=K,j=Z,w=G)}}}g&&this.canvasContext.drawImage(g,O[0]-j/2,O[1]-w/2,j,w),b&&this.canvasContext.drawImage(b,v[0]-d/2,v[1]-m/2,d,m)}},{key:"destroy",value:function(){this.renderedTrajectories=[],this.clear()}}])&&ur(t.prototype,r),n&&ur(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),lr=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.name||e.line&&e.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.name||e.line&&e.line.name||"").toUpperCase();return!!t&&c.includes(t)}))}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.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.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 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){return function(e){if(Array.isArray(e))return yr(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 yr(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 yr(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 yr(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 hr(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 br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(r),!0).forEach((function(t){vr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dr(){return(dr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=mr(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 mr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Pr(e)););return e}function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Or(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=Pr(e);if(t){var o=Pr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jr(this,r)}}function jr(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 wr(e)}function wr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pr(e){return(Pr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sr(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 Tr(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Cr=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&&gr(e,t)}(r,e);var t=Or(r);function r(e){var n;return kr(this,r),(n=t.call(this,br({hitTolerance:10},e))).onFeatureHover=n.onFeatureHover.bind(wr(n)),n.onFeatureClick=n.onFeatureClick.bind(wr(n)),n}return Tr(r,[{key:"defineProperties",value:function(e){var t=this,n=br({},e),o=n.style,i=n.speed,c=e.pixelRatio,a=e.interpolate,u=e.hoverVehicleId,s=e.selectedVehicleId,l=e.filter,f=e.sort,p=e.time,y=e.live,h=e.regexPublishedLineName,b=e.publishedLineName,v=e.tripNumber,d=e.operator,m={pixelRatio:c||window.devicePixelRatio||1,interpolate:a,hoverVehicleId:u,selectedVehicleId:s,filter:l,sort:f,style:o};Object.keys(m).forEach((function(e){return void 0===m[e]&&delete m[e]}));var g=i||1,O=p||new Date;dr(Pr(r.prototype),"defineProperties",this).call(this,e),Object.defineProperties(this,{isTrackerLayer:{value:!0},style:{value:o||this.defaultStyle},speed:{get:function(){return g},set:function(e){g=e,t.start()}},filter:{get:function(){return t.tracker?t.tracker.filter:t.initTrackerOptions.filter},set:function(e){t.tracker?t.tracker.filter=e:t.initTrackerOptions.filter=e}},sort:{get:function(){return t.tracker?t.tracker.sort:t.initTrackerOptions.sort},set:function(e){t.tracker?t.tracker.sort=e:t.initTrackerOptions.sort=e}},tracker:{value:null,writable:!0},styleCache:{value:{}},live:{value:!1!==y||y,writable:!0},time:{get:function(){return O},set:function(e){O=e&&e.getTime?e:new Date(e),t.renderTrajectories()}},trajectories:{get:function(){return t.tracker&&t.tracker.trajectories||[]}},renderedTrajectories:{get:function(){return t.tracker&&t.tracker.renderedTrajectories||[]}},hoverVehicleId:{get:function(){return t.tracker?t.tracker.hoverVehicleId:t.initTrackerOptions.hoverVehicleId},set:function(e){t.tracker?t.tracker.hoverVehicleId=e:t.initTrackerOptions.hoverVehicleId=e}},selectedVehicleId:{get:function(){return t.tracker?t.tracker.selectedVehicleId:t.initTrackerOptions.selectedVehicleId},set:function(e){t.tracker?t.tracker.selectedVehicleId=e:t.initTrackerOptions.selectedVehicleId=e}},pixelRatio:{get:function(){return t.tracker?t.tracker.pixelRatio:t.initTrackerOptions.pixelRatio},set:function(e){t.tracker?t.tracker.pixelRatio=e:t.initTrackerOptions.pixelRatio=e}},initTrackerOptions:{value:m,writable:!1},useRequestAnimationFrame:{default:!1,writable:!0},publishedLineName:{get:function(){return b},set:function(e){b=e,t.updateFilters()}},tripNumber:{get:function(){return v},set:function(e){v=e,t.updateFilters()}},operator:{get:function(){return d},set:function(e){d=e,t.updateFilters()}},regexPublishedLineName:{get:function(){return h},set:function(e){h=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){return null===e.delay&&null!==t.delay?1:null===t.delay&&null!==e.delay?-1:e.cancelled&&!t.cancelled?t.delay<18e4?-1:1:t.cancelled&&!e.cancelled?e.delay<18e4?1:-1:t.delay-e.delay})}},{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dr(Pr(r.prototype),"init",this).call(this,e),this.tracker=new sr(br(br({style:function(e,r){return t.style(e,r)}},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(){this.stop(),Object(c.unByKey)(this.visibilityRef),this.tracker&&(this.tracker.destroy(),this.tracker=null),dr(Pr(r.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.stop(),this.updateFilters(),this.tracker.setVisible(!0),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(){this.stopUpdateTime(),this.tracker&&(this.tracker.setVisible(!1),this.tracker.clear())}},{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;return this.tracker.renderTrajectories(br(br({},e),{},{time:r}),t),!0}},{key:"renderTrajectories",value:function(e,t){var r=this;this.requestId&&cancelAnimationFrame(this.requestId),this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((function(){r.renderTrajectoriesInternal(e,t)})):this.renderTrajectoriesInternal(e,t)}},{key:"getVehicle",value:function(e){return this.tracker.getTrajectories().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(pr(e),pr(e)),this.hitTolerance*t),o=this.tracker.getTrajectories(),i=[],c=0;c<o.length&&(o[c].coordinate&&Object(Qt.containsCoordinate)(n,o[c].coordinate)&&i.push(o[c]),i.length!==r);c+=1);return i}},{key:"getFeatureInfoAtCoordinate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.resolution,n=t.nb,o=this.getVehiclesAtCoordinate(e,r,n);return Promise.resolve({layer:this,features:o.map((function(e){var t=new Yt.a({geometry:e.geometry});return t.setProperties(br({},e)),t})),coordinate:e})}},{key:"onZoomEnd",value:function(e){this.startUpdateTime()}},{key:"onFeatureClick",value:function(){}},{key:"onFeatureHover",value:function(){}},{key:"getRefreshTimeInMs",value:function(e){var t=Math.round(e),r=ft[t]||25;return Math.max(25,r/this.speed)}},{key:"updateFilters",value:function(){var e=tt.a.parse(window.location.search.toLowerCase());this.filter=lr(this.publishedLineName||e.publishedlinename,this.tripNumber||e.tripnumber,this.operator||e.operator,this.regexPublishedLineName)}},{key:"defaultStyle",value:function(e,t){return St(e,t,this)}}]),r}(e)};function Er(e){return(Er="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 xr(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 Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xr(Object(r),!0).forEach((function(t){_r(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ir(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 Ar(){return(Ar="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Mr(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 Mr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Fr(e)););return e}function Lr(e,t){return(Lr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Br(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=Fr(e);if(t){var o=Fr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Vr(this,r)}}function Vr(e,t){if(t&&("object"===Er(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 Fr(e){return(Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ur=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&&Lr(e,t)}(i,e);var t,r,n,o=Br(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Dr(this,i),(e=o.call(this,Rr({},t))).renderWhenInteracting=t.renderWhenInteracting||function(){return e.tracker&&e.tracker.renderedTrajectories&&e.tracker.renderedTrajectories.length<=200},e.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,s=c.rotation;if(e.renderWhenInteracting&&e.renderWhenInteracting(t.viewState,e.renderedViewState))e.renderTrajectories(!0);else if(u/o>=3)e.tracker.clear();else{var l=e.map.getPixelFromCoordinate(a),f=e.map.getPixelFromCoordinate(n);e.transformContainer.style.transform=Object(Jt.composeCssTransform)(l[0]-f[0],l[1]-f[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;Ar(Fr(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(){Ar(Fr(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();Ar(Fr(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.renderWhenInteracting(e,this.renderedViewState)||!this.map.getView().getAnimating()&&!this.map.getView().getInteracting())&&Ar(Fr(i.prototype),"renderTrajectoriesInternal",this).call(this,e,t)&&(this.renderedViewState=Rr({},e),this.transformContainer&&(this.transformContainer.style.transform=""))}},{key:"getRefreshTimeInMs",value:function(){return Ar(Fr(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getView().getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=this.map.getView().getResolution();return Ar(Fr(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 Ar(Fr(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Rr({resolution:r},t))}},{key:"onMoveEnd",value:function(e){}},{key:"onZoomEnd",value:function(e){Ar(Fr(i.prototype),"onZoomEnd",this).call(this,e)}},{key:"onFeatureHover",value:function(e,t,r){Ar(Fr(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){Ar(Fr(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(Rr(Rr({},this.options),e))}}])&&Ir(t.prototype,r),n&&Ir(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Cr(A)),qr=r(4);function Nr(e){return(Nr="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 Hr(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 Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hr(Object(r),!0).forEach((function(t){zr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gr(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 Wr(e,t){return(Wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $r(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=Qr(e);if(t){var o=Qr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jr(this,r)}}function Jr(e,t){if(t&&("object"===Nr(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 Qr(e){return(Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xr=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&&Wr(e,t)}(i,e);var t,r,n,o=$r(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Zr(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=Kr(Kr({},t||{}),{},{key:this.apiKey}),o=Kr({},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)))}))}])&&Gr(t.prototype,r),n&&Gr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(L.a);function Yr(e){return(Yr="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){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 tn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?en(Object(r),!0).forEach((function(t){rn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):en(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function on(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 cn(e,t){return(cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function an(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=sn(e);if(t){var o=sn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return un(this,r)}}function un(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 function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function sn(e){return(sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ln=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&&cn(e,t)}(i,e);var t,r,n,o=an(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nn(this,i),o.call(this,tn({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}))}}])&&on(t.prototype,r),n&&on(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Xr);function fn(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 pn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var yn=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},hn=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(r),!0).forEach((function(t){pn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fn(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,s=t.rt,l=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=yn(P),E=yn(k),x=p&&"#".concat(p),R=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,V=I.dt,F=I.ap,U=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*F:null,departureTime:-1!==V?1e3*U:null,arrivalDelay:q,departureDelay:N,noDropOff:!!H,noPickUp:!!K,cancelled:!!z,wheelchairAccessible:!!Z})}return{id:r,destination:n,backgroundColor:x,color:R,vehicleType:o,routeIdentifier:f,longName:i,shortName:c,stations:_,wheelchairAccessible:!!a,bicyclesAllowed:!!u,realTime:s,feedsId:l,operatingInformations:{operatingPeriod:S,notOperatingDays:C,additionalOperatingDays:E},operator:b,operatorUrl:v,operatorTimeZone:d,publisher:g,publisherUrl:O,publisherTimeZone:j}},bn=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 qr.LineString(n.geometry.coordinates),i=n.properties,c=i.ID,a=i.ProductIdentifier,u=i.PublishedLineName,s=i.RouteIdentifier,l=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:s,directionText:l,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 vn(e){return(vn="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 dn(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?dn(Object(r),!0).forEach((function(t){gn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}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}function On(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 wn(e,t){return(wn=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=Sn(e);if(t){var o=Sn(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return kn(this,r)}}function kn(e,t){if(t&&("object"===vn(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 Sn(e){return(Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Tn=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&&wn(e,t)}(i,e);var t,r,n,o=Pn(i);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return On(this,i),o.call(this,mn({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 bn(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 hn(e)}))}}])&&jn(t.prototype,r),n&&jn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Xr);function Cn(e){return function(e){if(Array.isArray(e))return En(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 En(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 En(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 En(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){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 Rn=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=JSON.parse(r.data),o=e.channel;o+=e.args?" ".concat(e.args):"",n.source!==o||e.id&&e.id!==n.client_reference||t(n)};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),s=this.subscriptions.findIndex((function(e){return t.channel===e.params.channel&&r===e.cb})),l={params:t,cb:r,errorCb:n,onMessageCb:c,onErrorCb:a,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})),Cn(this.subscriptions).forEach((function(t){e.subscribe(t.params,t.cb,t.errorCb,t.quiet)}))}}])&&xn(t.prototype,r),n&&xn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_n=function(e,t){return e===t.SCHEMATIC?"_schematic":""},Dn=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},In=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 An(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)}}var Ln={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},Bn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};An(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=new Rn;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(" "))))}},conn:{value:u,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.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(_n(Ln.SCHEMATIC,Ln)).concat(t),r),this.conn.unsubscribe("".concat(e).concat(_n(Ln.TOPOGRAPHIC,Ln)).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 Dn(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 s=r[u],l=new Date(s.time).getTime();l>o&&l<n&&("BOARDING"===s.state&&(-1===c.indexOf(s.platform)?c.push(s.platform):s.state="HIDDEN"),a&&s.to[0]===a.to[0]&&Math.abs(l-a.time)<1e3&&s.line.name===a.line.name&&(s.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(s.state)&&(s.cancelled=!0),(a=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 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(_n(t,Ln)),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(_n(e,Ln))};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(_n(e,Ln)),(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(_n(e,Ln)),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(_n(e,Ln)),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(_n(t,Ln))];e&&o.push(e),t&&t!==Ln.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(_n(t,Ln),"_").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 In(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 In(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")}}])&&Mn(t.prototype,r),n&&Mn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Vn(e){return(Vn="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 Fn(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 Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fn(Object(r),!0).forEach((function(t){qn(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(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 Hn(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 Hn(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 Hn(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 Kn(){return(Kn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zn(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 zn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=$n(e)););return e}function Zn(e,t){return(Zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gn(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=$n(e);if(t){var o=$n(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Wn(this,r)}}function Wn(e,t){if(t&&("object"===Vn(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 $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qn(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 Xn(e,t,r){return t&&Qn(e.prototype,t),r&&Qn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Yn=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&&Zn(e,t)}(r,e);var t=Gn(r);function r(){return Jn(this,r),t.apply(this,arguments)}return Xn(r,[{key:"defineProperties",value:function(e){var t=this;Kn($n(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 Tn(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){Kn($n(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(),Kn($n(r.prototype),"start",this).call(this),this.startUpdateTrajectories()}},{key:"stop",value:function(){this.stopUpdateTrajectories(),this.abortFetchTrajectories(),Kn($n(r.prototype),"stop",this).call(this)}},{key:"onFeatureHover",value:function(e,t,n){var o=Nn(e,1)[0],i=null;o&&(i=o.get("id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),Kn($n(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=Nn(e,1)[0];o?(this.selectedVehicleId=o.get("id"),this.journeyId=o.get("journeyIdentifier"),this.highlightTrajectory()):(this.selectedVehicleId=null,this.journeyId=null),Kn($n(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:xt(new Date)})),this.api.fetchTrajectoryById(this.getParams({id:r,time:xt(new Date)}))];Promise.all(n).then((function(t){var r=Nn(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,s=[];c.forEach((function(e){e.forEach((function(e){s.push([e.x,e.y])}))}));var l=u?"#".concat(u):ht(a),f=/#ffffff/i.test(l)?"#ff0000":l;e.drawFullTrajectory(i,s,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=Un(Un({},e),{},{btime:xt(n),etime:xt(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.tracker.setTrajectories(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,s=e.cancelled,l=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(l).concat(u).concat(p).concat(y).concat(s),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(l).concat(u).concat(p).concat(y).concat(s)),!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,s),P.filter="blur(1px)",P.fill(),P.restore()),v&&(p||u>=this.delayDisplay||s)){P.save(),P.textAlign="left",P.textBaseline="middle",P.font="bold ".concat(Math.max(s?19:14,Math.min(s?19:17,1.2*b)),"px arial, sans-serif"),P.fillStyle=dt(u,s,!0),P.strokeStyle=this.delayOutlineColor,P.lineWidth=1.5*this.pixelRatio;var S=mt(u,s);P.strokeText(S,k+g+m,k),P.fillText(S,k+g+m,k),P.restore()}if(w=this.useDelayStyle?dt(u,s):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"===l&&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"===l&&(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 eo(e){return(eo="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 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 ro(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){no(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 no(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function io(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 co(){return(co="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ao(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 ao(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=fo(e)););return e}function uo(e,t){return(uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function so(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=fo(e);if(t){var o=fo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return lo(this,r)}}function lo(e,t){if(t&&("object"===eo(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 fo(e){return(fo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var po=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&&uo(e,t)}(i,e);var t,r,n,o=so(i);function i(){return oo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"start",value:function(){var e=this;this.map&&(co(fo(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),co(fo(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 qr.MultiPoint(e.map((function(e){return Object(Ge.fromLonLat)(e)}))),i=new Yt.a(o);i.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var c=new Yt.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 Yt.a({geometry:new qr.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 co(fo(i.prototype),"getParams",this).call(this,ro(ro({},e),{},{bbox:r,s:n<10?1:0,z:n}))}},{key:"clone",value:function(e){return new i(ro(ro({},this.options),e))}}])&&io(t.prototype,r),n&&io(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Yn(Ur)),yo=r(24),ho=r.n(yo);function bo(e){return(bo="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 vo(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)||go(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 mo(e){return function(e){if(Array.isArray(e))return Oo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||go(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 go(e,t){if(e){if("string"==typeof e)return Oo(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)?Oo(e,t):void 0}}function Oo(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 jo(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 wo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jo(Object(r),!0).forEach((function(t){Po(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Po(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(){return(ko="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=So(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 So(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ro(e)););return e}function To(e,t){return(To=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Co(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 Eo(this,r)}}function Eo(e,t){if(t&&("object"===bo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xo(e)}function xo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ro(e){return(Ro=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Do(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&&Do(e.prototype,t),r&&Do(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ao=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&&To(e,t)}(r,e);var t=Co(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _o(this,r),(e=t.call(this,wo({},n))).debug=n.debug,e.mode=n.mode||Ln.TOPOGRAPHIC,e.api=n.api||new Bn(n),e.tenant=n.tenant||"",e.minZoomNonTrain=n.minZoomNonTrain||9,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(xo(e)),e.onDeleteTrajectoryMessage=e.onDeleteTrajectoryMessage.bind(xo(e)),e}return Io(r,[{key:"start",value:function(){ko(Ro(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(){ko(Ro(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=this.trajectories.length-1;r>=0;r-=1){var n=this.trajectories[r];if(this.mustNotBeDisplayed(n,e,t)){var o=mo(this.trajectories);o.splice(r,1),this.tracker.setTrajectories(o)}}var i=mo(e);this.isUpdateBboxOnMoveEnd&&(i.push(t),this.tenant&&i.push("tenant=".concat(this.tenant)),this.generalizationLevel=this.generalizationLevelByZoom[t],this.generalizationLevel&&i.push("gen=".concat(this.generalizationLevel))),this.api.bbox=i}},{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=vo(e,2);return{stopSequence:t[0],fullTrajectory:t[1]}}))}},{key:"mustNotBeDisplayed",value:function(e,t,r){return!Object(Qt.intersects)(t,e.bounds)||"rail"!==e.type&&r<(this.minZoomNonTrain||9)}},{key:"addTrajectory",value:function(e,t){var r=this.trajectories.findIndex((function(t){return t.train_id===e.train_id})),n=e.time_intervals,o=wo(wo({},e),{},{id:e.train_id,timeIntervals:n});t?(this.trajectories.unshift(o),-1!==r&&this.tracker.trajectories.splice(r+1,1)):(this.trajectories.push(o),-1!==r&&this.tracker.trajectories.splice(r,1)),this.tracker.setTrajectories(this.trajectories)}},{key:"removeTrajectory",value:function(e){for(var t=0,r=this.trajectories.length;t<r;t+=1)if(this.trajectories[t].train_id===e){this.trajectories.splice(t,1);break}}},{key:"onTrajectoryMessage",value:function(e){if(e.content){var t=this.format.readFeature(e.content);if(t.set("timeOffset",Date.now()-e.timestamp),t.get("time_since_update")>=0){if(this.debug&&this.mode===Ln.TOPOGRAPHIC&&t.get("raw_coordinates")){var r=new ho.a(t.get("raw_coordinates"));r.transform("EPSG:4326",this.map.getView().getProjection()),t.setGeometry(r)}this.mustNotBeDisplayed(t.getProperties())||this.addTrajectory(t.getProperties(),!t.get("line"))}}}},{key:"onDeleteTrajectoryMessage",value:function(e){e.content&&this.removeTrajectory(e.content)}},{key:"onFeatureHover",value:function(e,t,n){var o=vo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.hoverVehicleId!==i&&(this.hoverVehicleId=i,this.renderTrajectories()),ko(Ro(r.prototype),"onFeatureHover",this).call(this,e,t,n)}},{key:"onFeatureClick",value:function(e,t,n){var o=vo(e,1)[0],i=null;o&&(i=o.get("train_id")),this.selectedVehicleId!==i&&(this.selectedVehicleId=i,this.selectedVehicle=o,this.renderTrajectories()),ko(Ro(r.prototype),"onFeatureClick",this).call(this,e,t,n)}}]),r}(e)};function Mo(e){return(Mo="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 Lo(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 Bo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(r),!0).forEach((function(t){Vo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vo(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 Uo(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 qo(){return(qo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=No(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 No(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Zo(e)););return e}function Ho(e,t){return(Ho=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ko(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=Zo(e);if(t){var o=Zo(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zo(this,r)}}function zo(e,t){if(t&&("object"===Mo(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 Zo(e){return(Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Go=new Ye.a,Wo=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&&Ho(e,t)}(i,e);var t,r,n,o=Ko(i);function i(){return Fo(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"mustNotBeDisplayed",value:function(e,t,r){return qo(Zo(i.prototype),"mustNotBeDisplayed",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())),qo(Zo(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){qo(Zo(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){qo(Zo(i.prototype),"onFeatureClick",this).call(this,e,t,r),this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}},{key:"highlightTrajectory",value:function(e){var t=this;this.getTrajectoryInfos(e).then((function(e){var r=e.stopSequence,n=e.fullTrajectory,o=t.vectorLayer.getSource();o.clear();var i="#ffffff";if(t.useDelayStyle)i="#a0a0a0";else{if(n){var c=n.features[0].properties,a=c.type,u=c.stroke;u&&"#"!==u[0]&&(u="#".concat(u)),i=u||ht(a)}i=/#ffffff/i.test(i)?"#ff0000":i}if(r.forEach((function(e){if(e.stations){var t=new qr.MultiPoint(e.stations.map((function(e){return e.coordinate}))),r=new Yt.a(t);r.setStyle(new Zt.Style({zIndex:1,image:new Zt.Circle({radius:5,fill:new Zt.Fill({color:"#000000"})})}));var n=new Yt.a(t);n.setStyle(new Zt.Style({zIndex:4,image:new Zt.Circle({radius:4,fill:new Zt.Fill({color:i})})})),o.addFeatures([r,n])}})),n){var s=[new Zt.Style({zIndex:2,stroke:new Zt.Stroke({color:"#000000",width:6})}),new Zt.Style({zIndex:3,stroke:new Zt.Stroke({color:i,width:4})})],l=Go.readFeatures(n);l.forEach((function(e){e.setStyle(s)})),t.vectorLayer.getSource().addFeatures(l)}}))}},{key:"clone",value:function(e){return new i(Bo(Bo({},this.options),e))}}])&&Uo(t.prototype,r),n&&Uo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Ao(Ur));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 Jo(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 Qo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(r),!0).forEach((function(t){Xo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ei(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 ti(e,t){return(ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ri(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 ni(this,r)}}function ni(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 oi(e){return(oi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ii=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&&ti(e,t)}(i,e);var t,r,n,o=ri(i);function i(){return Yo(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(Qo(Qo({},this.options),e))}}])&&ei(t.prototype,r),n&&ei(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);function ci(e){return(ci="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){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 ui(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(r),!0).forEach((function(t){si(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ai(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 li(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fi(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 pi(e,t){return(pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yi(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=bi(e);if(t){var o=bi(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return hi(this,r)}}function hi(e,t){if(t&&("object"===ci(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 bi(e){return(bi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vi=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&&pi(e,t)}(i,e);var t,r,n,o=yi(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return li(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(ui(ui({},this.options),e))}}])&&fi(t.prototype,r),n&&fi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(A);r(15),r(25),r(26),r(17);function di(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 mi(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 gi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mi(Object(r),!0).forEach((function(t){Oi(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ji(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wi(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=ki(e);if(t){var o=ki(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Pi(this,r)}}function Pi(e,t){if(t&&("object"===di(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 ki(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Si(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ti(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,r){return t&&Ti(e.prototype,t),r&&Ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ei(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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ri(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 _i(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Di(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=Ai(e);if(t){var o=Ai(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return Ii(this,r)}}function Ii(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 Ai(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Mi=G;var Mi;function Li(e){return(Li="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 Bi(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 Vi(){return(Vi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Fi(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 Fi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ki(e)););return e}function Ui(e,t){return(Ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qi(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=Ki(e);if(t){var o=Ki(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ni(this,r)}}function Ni(e,t){if(t&&("object"===Li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hi(e)}function Hi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ki(e){return(Ki=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zi=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&&Ui(e,t)}(i,e);var t,r,n,o=qi(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(Hi(t)),t}return t=i,(r=[{key:"activate",value:function(){Vi(Ki(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)),Vi(Ki(i.prototype),"deactivate",this).call(this)}},{key:"getCopyrights",value:function(){return ct(this.map)}}])&&Bi(t.prototype,r),n&&Bi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(me(G));function Zi(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 Gi(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 Wi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(r),!0).forEach((function(t){$i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ji(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 Qi(){return("undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Xi(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 Xi(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==rc(e););return e}function Yi(e,t){return(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(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=rc(e);if(t){var o=rc(this).constructor;Reflect.construct(n,arguments,o)}else n.apply(this,arguments);return tc(this,r)}}function tc(e,t){if(t&&("object"===Zi(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 rc(e){return(Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ae(We.Map);var nc=r(18),oc=r.n(nc),ic=r(19);function cc(e){return(cc="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 ac(e){return function(e){if(Array.isArray(e))return uc(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 uc(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 uc(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 uc(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 sc(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 lc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(r),!0).forEach((function(t){fc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yc(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 hc(){return(hc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=bc(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 bc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=gc(e)););return e}function vc(e,t){return(vc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dc(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=gc(e);if(t){var o=gc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return mc(this,r)}}function mc(e,t){if(t&&("object"===cc(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 gc(e){return(gc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oc(e){return function(e){if(Array.isArray(e))return jc(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 jc(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 jc(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 jc(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 wc=function(e){var t=e.getBounds().toArray(),r=Object(Ge.fromLonLat)(t[0]),n=Object(Ge.fromLonLat)(t[1]),o=[].concat(Oc(r),Oc(n)),i=e.getCanvas(),c=i.width,a=i.height,u=Object(Qt.getWidth)(o)/c,s=Object(Qt.getHeight)(o)/a;return Math.max(u,s)},Pc=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 kc(e){return(kc="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 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}function Cc(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 Ec(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cc(Object(r),!0).forEach((function(t){xc(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 Dc(){return(Dc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ic(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 Ic(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Vc(e)););return e}function Ac(e,t){return(Ac=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mc(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=Vc(e);if(t){var o=Vc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lc(this,r)}}function Lc(e,t){if(t&&("object"===kc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bc(e)}function Bc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vc(e){return(Vc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fc=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&&Ac(e,t)}(i,e);var t,r,n,o=Mc(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Rc(this,i),(e=o.call(this,Ec({},t))).onMove=e.onMove.bind(Bc(e)),e.onMoveEnd=e.onMoveEnd.bind(Bc(e)),e.onZoomEnd=e.onZoomEnd.bind(Bc(e)),e.onVisibilityChange=e.onVisibilityChange.bind(Bc(e)),e}return t=i,(r=[{key:"init",value:function(e,t){if(e){var r=e.getCanvas();Dc(Vc(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:Pc(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)),Dc(Vc(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){Dc(Vc(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(){Dc(Vc(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){Dc(Vc(i.prototype),"onUserClickCallback",this).call(this,Ec({coordinate:Object(Ge.fromLonLat)(e.lngLat.toArray())},e))}},{key:"onUserMoveCallback",value:function(e){Dc(Vc(i.prototype),"onUserMoveCallback",this).call(this,Ec({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=oc()(Object(ic.point)([c.lng,c.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,s=oc()(Object(ic.point)([a.lng,a.lat]),-this.map.getBearing(),{pivot:[o.lng,o.lat]}).geometry.coordinates,l=[].concat(Sc(Object(Ge.fromLonLat)(u)),Sc(Object(Ge.fromLonLat)(s))),f=Object(Qt.getWidth)(l)/(r/this.pixelRatio),p=Object(Qt.getHeight)(l)/(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:l,resolution:y,zoom:this.map.getZoom(),rotation:-this.map.getBearing()*Math.PI/180,pixelRatio:this.pixelRatio};Dc(Vc(i.prototype),"renderTrajectories",this).call(this,h,e)}},{key:"getRefreshTimeInMs",value:function(){return Dc(Vc(i.prototype),"getRefreshTimeInMs",this).call(this,this.map.getZoom())}},{key:"getVehiclesAtCoordinate",value:function(e,t){var r=wc(this.map);return Dc(Vc(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=wc(this.map);return Dc(Vc(i.prototype),"getFeatureInfoAtCoordinate",this).call(this,e,Ec({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=Pc(this.map,this.pixelRatio),t=this.map.getSource(this.key);t&&t.setCoordinates(e),this.renderTrajectories()}},{key:"onMoveEnd",value:function(){}},{key:"onFeatureHover",value:function(e,t,r){Dc(Vc(i.prototype),"onFeatureHover",this).call(this,e,t,r),this.map.getCanvasContainer().style.cursor=e.length?"pointer":"auto"}}])&&_c(t.prototype,r),n&&_c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Cr(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&&vc(e,t)}(i,e);var t,r,n,o=dc(i);function i(){return pc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"init",value:function(e){hc(gc(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)),hc(gc(i.prototype),"terminate",this).call(this,e)}},{key:"onUserClickCallback",value:function(e){hc(gc(i.prototype),"onUserClickCallback",this).call(this,lc({coordinate:e.lngLat.toArray()},e))}},{key:"onUserMoveCallback",value:function(e){hc(gc(i.prototype),"onUserMoveCallback",this).call(this,lc({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(ac(e[0]),ac(e[1])),"EPSG:4326","EPSG:3857")}},{key:"getOlZoom",value:function(){return this.map.getZoom()+1}},{key:"clone",value:function(e){return new i(lc(lc({},this.options),e))}}])&&yc(t.prototype,r),n&&yc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(w)));function Uc(e){return(Uc="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 qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nc(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 Hc(){return(Hc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Kc(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 Kc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Wc(e)););return e}function zc(e,t){return(zc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zc(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=Wc(e);if(t){var o=Wc(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Gc(this,r)}}function Gc(e,t){if(t&&("object"===Uc(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 Wc(e){return(Wc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $c=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&&zc(e,t)}(i,e);var t,r,n,o=Zc(i);function i(){return qc(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"mustNotBeDisplayed",value:function(e,t,r){return Hc(Wc(i.prototype),"mustNotBeDisplayed",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())),Hc(Wc(i.prototype),"setBbox",this).call(this,r,n)}},{key:"onMoveEnd",value:function(e){Hc(Wc(i.prototype),"onMoveEnd",this).call(this,e),this.visible&&this.isUpdateBboxOnMoveEnd&&this.setBbox()}}])&&Nc(t.prototype,r),n&&Nc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Ao(Fc));function Jc(e){return(Jc="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 Qc(e){return function(e){if(Array.isArray(e))return Xc(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 Xc(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 Xc(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 Xc(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 Yc(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 ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yc(Object(r),!0).forEach((function(t){ta(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ta(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function na(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 oa(){return(oa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ia(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 ia(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=la(e)););return e}function ca(e,t){return(ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aa(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=la(e);if(t){var o=la(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ua(this,r)}}function ua(e,t){if(t&&("object"===Jc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sa(e)}function sa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function la(e){return(la=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fa={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&&ca(e,t)}(i,e);var t,r,n,o=aa(i);function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ra(this,i),(e=o.call(this,ea({},t))).onMove=e.onMove.bind(sa(e)),e.onMoveEnd=e.onMoveEnd.bind(sa(e)),e.onVisibilityChange=e.onVisibilityChange.bind(sa(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)),oa(la(i.prototype),"terminate",this).call(this)}},{key:"start",value:function(){this.map&&(oa(la(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)),oa(la(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(Qc(r),Qc(n)),c=Object(Qt.buffer)(o,Object(Qt.getWidth)(o)/10).join(","),a=this.map.getZoom();return oa(la(i.prototype),"getParams",this).call(this,ea(ea({},e),{},{bbox:c,s:a<10?1:0,z:a}))}},{key:"drawFullTrajectory",value:function(e,t,r){console.log("to be implemented")}}])&&na(t.prototype,r),n&&na(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(Yn(Fc)),TralisLayer:$c},ol:{Map:Ze,Layer:A,WMSLayer:vi,MapboxLayer:zt,TrajservLayer:po,TralisLayer:Wo,VectorLayer:ii}};t.default=fa}])}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|