/* MIT License - Copyright (c) Microsoft Corporation. */


!function(t,x){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function e(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},n=(r.merge=function(t,e){for(var n=window||global,i=0,r=t.split(".");i<r.length;i++){var o=r[i];if(!n[o])return e;n=n[o]}return a(a({},n),e)},r);function r(){}var o=(s.linear=function(t){return t},s.easeInSine=function(t){return 1-Math.cos(t*Math.PI*.5)},s.easeOutSine=function(t){return Math.sin(t*Math.PI*.5)},s.easeInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)},s.easeInQuad=function(t){return t*t},s.easeOutQuad=function(t){return t*(2-t)},s.easeInOutQuad=function(t){return t<.5?2*t*t:(4-2*t)*t-1},s.easeInCubic=function(t){return t*t*t},s.easeOutCubic=function(t){var e=t-1;return e*e*e+1},s.easeInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},s.easeInQuart=function(t){return t*t*t*t},s.easeOutQuart=function(t){var e=t-1;return 1-e*e*e*e},s.easeInOutQuart=function(t){if(t<.5)return 8*t*t*t*t;var e=t-1;return 1-8*e*e*e*e},s.easeInQuint=function(t){return t*t*t*t*t},s.easeOutQuint=function(t){var e=t-1;return 1+e*e*e*e*e},s.easeInOutQuint=function(t){if(t<.5)return 16*t*t*t*t*t;var e=t-1;return 1+16*e*e*e*e*e},s.easeInExpo=function(t){return 0===t?0:Math.pow(2,10*(t-1))},s.easeOutExpo=function(t){return 1===t?1:1-Math.pow(2,-10*t)},s.easeInOutExpo=function(t){if(0===t||1===t)return t;var e=2*t-1;return e<0?.5*Math.pow(2,10*e):.5*(2-Math.pow(2,-10*e))},s.easeInCirc=function(t){return-1*(Math.sqrt(1-t*t)-1)},s.easeOutCirc=function(t){var e=t-1;return Math.sqrt(1-e*e)},s.easeInOutCirc=function(t){var e=2*t;if(e<1)return-.5*(Math.sqrt(1-e*e)-1);var n=e-2;return.5*(Math.sqrt(1-n*n)+1)},s.easeInBack=function(t,e){return t*t*(((e=e||1.70158)+1)*t-e)},s.easeOutBack=function(t,e){var n=t-1;return n*n*(((e=e||1.70158)+1)*n+e)+1},s.easeInOutBack=function(t,e){var n=2*t,i=1.525*(e=e||1.70158);if(n<1)return.5*n*n*((1+i)*n-i);var r=n-2;return.5*(r*r*((1+i)*r+i)+2)},s.easeInElastic=function(t,e){if(0===t||1===t)return t;var n=t-1,i=1-(e=e||.7),r=i/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*n)*Math.sin((n-r)*(2*Math.PI)/i))},s.easeOutElastic=function(t,e){if(0===t||1===t)return t;var n=1-(e=e||.7),i=2*t,r=n/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*i)*Math.sin((i-r)*(2*Math.PI)/n)+1},s.easeInOutElastic=function(t,e){if(0===t||1===t)return t;var n=1-(e=e||.65),i=2*t-1,r=n/(2*Math.PI)*Math.asin(1);return i<0?Math.pow(2,10*i)*Math.sin((i-r)*(2*Math.PI)/n)*-.5:Math.pow(2,-10*i)*Math.sin((i-r)*(2*Math.PI)/n)*.5+1},s.easeOutBounce=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(e=t-1.5/2.75)*e+.75:t<2.5/2.75?7.5625*(e=t-2.25/2.75)*e+.9375:7.5625*(e=t-2.625/2.75)*e+.984375;var e},s.easeInBounce=function(t){return 1-s.easeOutBounce(1-t)},s.easeInOutBounce=function(t){return t<.5?.5*s.easeInBounce(2*t):.5*s.easeOutBounce(2*t-1)+.5},s);function s(){}var P=(c.getProgress=function(t,e,n,i){return Math.max(Math.min((t-e)*i/n,1),0)},c.getStartTime=function(t,e,n){return performance.now()-Math.round(e*t/n)},c.getDimensions=function(t){if(t&&Array.isArray(t)&&0<t.length){if("number"==typeof t[0])return 0;if(Array.isArray(t[0])&&0<t[0].length){if("number"==typeof t[0][0])return 1;if(Array.isArray(t[0][0])&&0<t[0][0].length){if("number"==typeof t[0][0][0])return 2;if(Array.isArray(t[0][0][0])&&0<t[0][0][0].length&&"number"==typeof t[0][0][0][0])return 3}}}return-1},c.getSuitableCoordinates=function(t,e){var n="Point";if(t instanceof x.Shape&&(n=t.getType()),e){var i=c.getDimensions(e);switch(n){case"Point":switch(i){case 0:return e;case 1:return e[0];case 2:return e[0][0];case 3:return e[0][0][0]}break;case"MultiPoint":case"LineString":switch(i){case 0:return"MultiPoint"===n?[e]:[e,e];case 1:return e;case 2:return e[0];case 3:return e[0][0]}break;case"MultiLineString":case"Polygon":switch(i){case 0:return[[e,e,e]];case 1:return[e];case 2:return e;case 3:return e[0]}break;case"MultiPolygon":switch(i){case 0:return[[[e,e,e]]];case 1:return[[e]];case 2:return[e];case 3:return e}}}return null},c.getPixelHeading=function(t,e){var n=(e[0]-t[0])*Math.PI/180,i=(t[1]-e[1])*Math.PI/180;return 180*(2.5*Math.PI-Math.atan2(i,n))/Math.PI%360},c.getPixelDestination=function(t,e,n){return[t[0]+n*Math.cos((e+270)*Math.PI/180),t[1]+n*Math.sin((e+270)*Math.PI/180)]},c.setMetadata=function(t,e){t&&e&&(t instanceof x.Shape?t.setProperties(Object.assign(t.getProperties(),e)):t instanceof x.HtmlMarker&&(t.metadata=Object.assign(t.metadata||{},e)))},c.setCoordinates=function(t,e,n){if(t)if(t instanceof x.Shape)switch(t.getType()){case"Point":t.setCoordinates(e);break;case"LineString":n&&t.setCoordinates(n)}else t instanceof x.HtmlMarker&&t.setOptions({position:e})},c.getPropertyPath=function(t){return t.split("/")},c.setValue=function(t,e,n){if(1<e.length){var i=e.shift();c.setValue(t[i]="[object Object]"===Object.prototype.toString.call(t[i])?t[i]:{},e,n)}else t[e[0]]=n},c.getValue=function(t,e){var n=e.length;if(0<n&&t){var i=t[e[0]];if(null!=i){var r=void 0;for(r=1;r<n&&null!=(i=i[e[r]]);r++);if(r===n&&null!=i)return i}}return null},c.interpolateValue=function(t,e,n,i,r){if(t&&e&&i){i.interpolation=i.interpolation||"linear";var o=c.getPropertyPath(i.propertyPath),a=c.getValue(t.properties,o),s=c.getValue(e.properties,o),h=typeof a,u=typeof s;if("undefined"!=h&&"undefined"!=u&&h==u){var p=void 0;if(a instanceof Date&&(a=a.getTime(),p="Date"),s instanceof Date&&(s=s.getTime(),"Date"!==p))return null;var l=void 0;if("number"==h&&"number"==u)switch(i.interpolation){case"linear":l=a+(s-a)*n;break;case"min":l=Math.min(a,s);break;case"max":l=Math.max(a,s);break;case"avg":l=.5*(a+s)}else"nearest"===i.interpolation&&(l=n<.5?a:s);void 0!==l&&("Date"===p&&(l=new Date(l)),c.setValue(r,o,l))}}return null},c.extractRoutePointsFromFeature=function(t,e){var n,i,r=[];switch(t.geometry.type){case"Point":(n=c.extractRoutePointFromPoint(t,e))&&(r=[n]);break;case"LineString":case"MultiPoint":if(t.properties[e]&&Array.isArray(t.properties[e])&&t.geometry.coordinates.length===t.properties[e])for(var o=0,a=t.geometry.coordinates.length;o<a;o++)(i=x.math.parseTimestamp(t.properties[e]))&&r.push(new x.data.Feature(new x.data.Point(t.geometry.coordinates[o]),{_timestamp:i.getTime()}));else if(t.properties.waypoints&&Array.isArray(t.properties.waypoints)&&t.geometry.coordinates.length===t.properties.waypoints.length&&0<t.properties.waypoints.length&&t.properties.waypoints[0].geometry)for(o=0,a=t.geometry.coordinates.length;o<a;o++)"Point"===t.properties.waypoints[o].geometry.type&&(n=c.extractRoutePointFromPoint(t.properties.waypoints[o],e))&&r.push(n)}return 0<r.length?r:null},c.extractRoutePointFromPoint=function(t,e){if(t.properties[e]){var n=x.math.parseTimestamp(t.properties[e]);if(void 0!==n)return t.properties._timestamp=n.getTime(),t}return null},c);function c(){}var h=(u.prototype.disable=function(){this._stopped||(this._stopped=!0,cancelAnimationFrame(this._animation))},u.prototype.enable=function(){this._stopped&&(this._stopped=!1,this._animation=requestAnimationFrame(this.animate.bind(this)))},u.prototype.add=function(t){return t._id||(t._id=this._getUuid()),this._idLookupTable[t._id]||(this._queue.push(t),this._idLookupTable[t._id]=t),t._id},u.prototype.getById=function(t){return this._idLookupTable[t]},u.prototype.remove=function(t){if(t&&this._idLookupTable[t._id])for(var e=this._queue.length-1;0<=e;e--)if(t._id===this._queue[e]._id){this._queue=this._queue.splice(e,1),this._idLookupTable[t._id]=void 0;break}},u.prototype.removeById=function(t){this.remove(this._idLookupTable[t])},u.prototype.animate=function(){if(!this._stopped){var t=performance.now();if(t-this._lastTime>=this._minFrameRate){for(var e=this._queue.length-1;0<=e;e--)try{this._queue[e]._onAnimationProgress(t)}catch(t){}this._lastTime=t}this._animation=requestAnimationFrame(this.animate.bind(this))}},u.prototype._getUuid=function(){return this._idCounter++},u.instance=new u,u);function u(){this._animation=null,this._queue=[],this._minFrameRate=33,this._stopped=!0,this._idCounter=1234567890,this._idLookupTable={},this._lastTime=performance.now(),this.enable()}var p,l=(e(f,p=x.internal.EventEmitter),f.prototype.dispose=function(){this.stop(),h.instance.remove(this),this._options=null,this._easing=null,this._start=null,this._onComplete=null,this._id=void 0,this._rawProgress=null},f.prototype.getDuration=function(){var t=this._options;return t.loop?1/0:t.duration/t.speedMultiplier},f.prototype.getOptions=function(){return Object.assign({},this._options)},f.prototype.isPlaying=function(){return null!==this._start},f.prototype.play=function(){1<=this._rawProgress&&(this._rawProgress=0),0<this._rawProgress?this._start=P.getStartTime(this._rawProgress,this._options.duration,this._options.speedMultiplier):this._start=performance.now()},f.prototype.pause=function(){this._start=null},f.prototype.seek=function(t){if("number"==typeof t){var e=this.isPlaying();e&&this.pause(),this._rawProgress=Math.min(Math.max(t,0),1)/this._options.speedMultiplier,this._processFrame(),e&&this.play()}},f.prototype.setOptions=function(t){if(t){t.easing&&("string"==typeof t.easing&&o[t.easing]?(this._easing=o[t.easing],this._options.easing=t.easing):t.easing instanceof Function&&(this._easing=t.easing,this._options.easing=t.easing)),"boolean"==typeof t.loop&&(this._options.loop=t.loop),"boolean"==typeof t.disposeOnComplete&&(this._options.disposeOnComplete=t.disposeOnComplete),"boolean"==typeof t.reverse&&(this._options.reverse=t.reverse),"number"==typeof t.speedMultiplier&&0<t.speedMultiplier&&(this._options.speedMultiplier=t.speedMultiplier);var e="number"==typeof t.duration&&0<t.duration&&this._options.duration!==t.duration,n="boolean"==typeof t.autoPlay;if(e||n){var i=this.isPlaying();i&&this.pause(),n&&(this._options.autoPlay=t.autoPlay||this._options.autoPlay,!i&&t.autoPlay&&(i=!0)),e&&(this._options.duration=t.duration||this._options.duration),i&&this.play()}}},f.prototype.stop=function(){this._rawProgress=1,this._processFrame(),this._start=null},f.prototype.reset=function(){this._start=null,this._rawProgress=0,this._processFrame()},f.prototype._onAnimationProgress=function(t){this._start&&(this._rawProgress=P.getProgress(t,this._start,this._options.duration,this._options.speedMultiplier),this._processFrame())},f.prototype._processFrame=function(){if(void 0!==this._id){var t=this._rawProgress||0;1<=t&&(this._options.loop?(this._rawProgress=0,this._start=performance.now()):(this._rawProgress=1,this._start=null,this._onComplete&&this._onComplete()));var e=this._options.reverse?1-this._rawProgress:this._rawProgress;this._easing&&(t=this._easing(e));var n=this.onAnimationProgress(t),i=Object.assign({progress:e,easingProgress:t,animation:this},n||{});this._invokeEvent("onprogress",Object.assign({type:"onprogress"},i)),null===this._start&&this._invokeEvent("oncomplete",Object.assign({type:"oncomplete"},i)),this._options.disposeOnComplete&&this.dispose()}},f);function f(t){var e=p.call(this)||this;return e._start=null,e._rawProgress=0,e._options={duration:1e3,autoPlay:!1,easing:"linear",loop:!1,reverse:!1,speedMultiplier:1,disposeOnComplete:!1},e._easing=o.linear,e._id=h.instance.add(e),e.setOptions(t),e}var g,y=(e(v,g=l),v.prototype.getCurrentFrameIdx=function(){return this._numberOfFrames<=0?-1:this._currentFrameIdx},v.prototype.getNumberOfFrames=function(){return this._numberOfFrames},v.prototype.setFrameIdx=function(t){(0<=t||t<this._numberOfFrames)&&this.seek(this._numberOfFrames/t)},v.prototype.setNumberOfFrames=function(t){"number"==typeof t&&this._numberOfFrames!==t&&(this._numberOfFrames=Math.max(t,0),this._currentFrameIdx=t<this._currentFrameIdx?this._currentFrameIdx:0,t<=0&&(this._currentFrameIdx=-1),this._triggerFrame(this._currentFrameIdx))},v.prototype.onAnimationProgress=function(t){var e=this._numberOfFrames;if(0<e){var n=Math.round(t*e-.5);if(n!==this._currentFrameIdx)return n===e?n--:n<0&&(n=-1),this._triggerFrame(n),{frameIdx:n}}return null},v.prototype._triggerFrame=function(t){this._onFrame&&-1!==t&&this._onFrame(t),-1!==(this._currentFrameIdx=t)&&this._invokeEvent("onframe",{type:"onFrame",frameIdx:t,animation:this,numFrames:this._numberOfFrames})},v);function v(t,e,n){var i=g.call(this,n)||this;return i._numberOfFrames=0,i._currentFrameIdx=-1,i._numberOfFrames=t,i._onFrame=e,n&&n.autoPlay&&i.play(),i}var m,_=(e(d,m=x.layer.Layer),d.prototype.dispose=function(){this._animation.stop(),h.instance.remove(this),h.instance.remove(this._animation),this._animation=void 0,this._onComplete=void 0,this._id=void 0,this._options=void 0},d.prototype.getDuration=function(){return this._options.loop?1/0:this._options.duration},d.prototype.getOptions=function(){return Object.assign({},this._options,this._animation.getOptions())},d.prototype.getPlayableAnimation=function(){return this._animation},d.prototype.isPlaying=function(){return this._animation.isPlaying()},d.prototype.pause=function(){this._animation.pause()},d.prototype.play=function(){this._animation.play()},d.prototype.reset=function(){this._animation.reset()},d.prototype.stop=function(){this._animation.stop()},d.prototype.setFrameIdx=function(t){this._animation.setFrameIdx(t)},d.prototype.setOptions=function(t){var e=this;if(t.tileLayerOptions){0<this._tileLayers.length&&(this._map&&this._map.layers.remove(this._tileLayers),this._tileLayers=[],this._currentTileLayer=null),t.tileLayerOptions.forEach(function(t){t.fadeDuration=0,t.visible=!0,e._tileLayers.push(new x.layer.TileLayer(Object.assign({},t,{opacity:0})))}),this._map&&this._map.layers.add(this._tileLayers,this),this._options.tileLayerOptions=t.tileLayerOptions,this._animation&&this._animation.setNumberOfFrames(this._options.tileLayerOptions.length);var n=this._animation?this._animation.getCurrentFrameIdx():0;0<=n&&(this._currentTileLayer=this._tileLayers[n],this._currentTileLayer.setOptions({fadeDuration:0,visible:!0}))}if("boolean"==typeof t.visible)if(this._options.visible=t.visible,t.visible){var i=this._animation.getCurrentFrameIdx();0<t.tileLayerOptions.length&&this._currentTileLayer.setOptions({fadeDuration:0,opacity:t.tileLayerOptions[i].opacity})}else this._tileLayers.forEach(function(t){return t.setOptions({opacity:0})});if(this._animation){var r=!1;Object.keys(t).forEach(function(t){switch(t){case"tileLayerOptions":case"visible":break;default:r=!0}}),r&&this._animation.setOptions(t)}},d.prototype.onAdd=function(t){(this._map=t).layers.add(this._tileLayers,this)},d.prototype.onRemove=function(){this._map.layers.remove(this._tileLayers),this._map=null},d.prototype._buildLayers=function(){return[]},d.prototype._getLayerIds=function(){return[this.id]},d.prototype._buildSource=function(){return null},d.prototype._getSourceId=function(){return null},d.prototype._onAnimationProgress=function(t){return null},d);function d(t){var o=m.call(this)||this;o._tileLayers=[],o._options={tileLayerOptions:[],visible:!0},o._onFrame=function(t){var e=o._options;if(e.visible&&e.tileLayerOptions&&0<e.tileLayerOptions.length&&t<e.tileLayerOptions.length){var n=o._map.map,i=o._currentTileLayer,r=void 0;i&&(r=i.getId(),n.setPaintProperty(r,"raster-opacity-transition",{duration:0,delay:0}),n.setPaintProperty(r,"raster-opacity",0)),i=o._tileLayers[t],r=(o._currentTileLayer=i).getId(),n.setPaintProperty(r,"raster-opacity-transition",{duration:0,delay:0}),n.setPaintProperty(r,"raster-opacity",e.tileLayerOptions[t].opacity)}},o._id=h.instance.add(o);var e=0;return t&&(o.setOptions(t),t.tileLayerOptions&&(e=t.tileLayerOptions.length)),o._animation=new y(e,o._onFrame,t),o._onComplete=o._animation._onComplete,o}var M,b=Object.freeze({__proto__:null,AnimatedTileLayer:_}),w=(e(O,M=l),O.prototype.onAnimationProgress=function(t){for(var e,n,i=0,r=this._shapes.length;i<r;i++)if(n=this._y0[i]-this._height*(1-t),e=[this._x0[i],n],this._shapes[i]instanceof x.Shape){var o=this._shapes[i];o.setProperties(Object.assign(o.getProperties(),{offset:e,opacity:0!==t?1:0}))}else this._shapes[i].setOptions({pixelOffset:e,visible:0!==t});return null},O);function O(t,e,n,i){var r=M.call(this,i)||this;if(r._height=200,!(t&&0<t.length))throw"No shape specified for animation.";r._shapes=t,r._x0=[],r._y0=[],r._height="number"==typeof n&&0<n?n:r._height;var o=[],a=void 0,s=void 0,h=void 0,u=[];e instanceof x.source.DataSource&&(s=e),e instanceof x.Map&&(u=(h=e).markers.getMarkers());for(var p=0,l=r._shapes.length;p<l;p++){if(a=null,r._shapes[p]instanceof x.Shape)a=r._shapes[p].getProperties().offset;else a=r._shapes[p].getOptions().pixelOffset;if(a&&Array.isArray(a)&&2<=a.length?(r._x0.push(a[0]),r._y0.push(a[1])):(r._x0.push(0),r._y0.push(0),a=[0,0]),a[1]-=r._height,r._shapes[p]instanceof x.Shape){var c=r._shapes[p];c.setProperties(Object.assign(c.getProperties(),{offset:a,opacity:0})),s&&null===s.getShapeById(r._shapes[p].getId())&&o.push(r._shapes[p])}else{var f=r._shapes[p];f.setOptions({pixelOffset:a,visible:!1}),h&&u&&-1===u.indexOf(f)&&h.markers.add(f)}}return s&&0<o.length&&s.add(o),i&&i.autoPlay&&r.play(),r}var L,A=(e(k,L=l),k.prototype.dispose=function(){this._pathOptions=null,L.prototype.dispose.call(this)},k.prototype.getOptions=function(){return Object.assign({},L.prototype.getOptions.call(this),this._pathOptions)},k.prototype.setOptions=function(t){if(t){var e={};"number"==typeof t.duration&&0<t.duration&&(e.duration=t.duration||this._pathOptions.duration),"boolean"==typeof t.captureMetadata&&(e.captureMetadata=t.captureMetadata),"boolean"==typeof t.geodesic&&(e.geodesic=t.geodesic),"boolean"==typeof t.reverse&&(e.reverse=t.reverse),"number"==typeof t.pitch&&(e.pitch=t.pitch),"number"==typeof t.zoom&&(e.zoom=t.zoom),"boolean"==typeof t.rotate&&(e.rotate=t.rotate),"number"==typeof t.rotationOffset&&(e.rotationOffset=t.rotationOffset),!t.map&&null!==t.map||(e.map=t.map),Object.assign(this._pathOptions,e),L.prototype.setOptions.call(this,t)}},k.prototype._setMapCamera=function(t,e,n){if(this._pathOptions.map&&t){var i={center:t};"number"==typeof this._pathOptions.pitch&&(i.pitch=this._pathOptions.pitch),"number"==typeof this._pathOptions.zoom&&(i.zoom=this._pathOptions.zoom),this._pathOptions.rotate&&"number"==typeof e&&(i.bearing=this._pathOptions.reverse?e+180:e,"number"==typeof this._pathOptions.rotationOffset&&(i.bearing+=this._pathOptions.rotationOffset)),n?(i.type="fly",i.duration=Math.min(60,this._pathOptions.duration)):i.type="jump",this._pathOptions.map.setCamera(i)}},k.prototype.onAnimationProgress=function(t){return null},k);function k(t){var e=L.call(this,t)||this;return e._pathOptions={duration:1e3},e.setOptions(t),e}var C,I=(e(S,C=A),S.prototype.setOptions=function(t){if(t&&C.prototype.setOptions.call(this,t),this._originPosition&&this._destinationPosition){if(this._pathOptions.geodesic)this._dx=x.math.getDistanceTo(this._originPosition,this._destinationPosition),this._heading=x.math.getHeading(this._originPosition,this._destinationPosition);else{var e=x.math.mercatorPositionsToPixels([this._originPosition,this._destinationPosition],21);if(this._originPixel=e[0],180<Math.abs(this._originPosition[0]-this._destinationPosition[0])){var n=512*Math.pow(2,21);e[0][0]>e[1][0]?e[1][0]+=n:e[0][0]+=n}this._dx=x.Pixel.getDistance(e[0],e[1]),this._heading=x.Pixel.getHeading(e[0],e[1])}this._pathOptions.captureMetadata&&P.setMetadata(this._shape,{heading:this._heading})}},S.prototype.onAnimationProgress=function(t){if(this._originPosition&&this._destinationPosition&&this._pathOptions){var e=void 0,n=!1;if(1===t)e=this._destinationPosition;else if(0===t)e=this._originPosition;else{var i=this._dx*t;e=this._pathOptions.geodesic?x.math.getDestination(this._originPosition,this._heading,i):x.math.mercatorPixelsToPositions([x.Pixel.getDestination(this._originPixel,this._heading,i)],21)[0],n=!0}return P.setCoordinates(this._shape,e),this._pathOptions.map&&this._setMapCamera(e,this._heading,n),{position:e,heading:this._heading}}return null},S);function S(t,e,n){var i=C.call(this)||this;return t instanceof x.Shape?i._originPosition=t.getCoordinates():i._originPosition=t.getOptions().position,i._shape=t,i._destinationPosition=e,i.setOptions(n),n&&n.autoPlay&&i.play(),i}var T,F=(e(q,T=A),q.prototype.dispose=function(){this._totalLength=null,this._positions=null,this._pixels=null,this._distances=null,this._headings=null,this._shape=null,T.prototype.dispose.call(this)},q.prototype.setOptions=function(t){t&&T.prototype.setOptions.call(this,t);var e=this.isPlaying();if(e&&this.pause(),this._positions){var n=0,i=[],r=[],o=this._positions;if(this._pathOptions.geodesic)for(var a=1,s=o.length;a<s;a++){n+=p=x.math.getDistanceTo(o[a-1],o[a]),i.push(p);var h=x.math.getHeading(o[a-1],o[a]);r.push(h)}else{var u=x.math.mercatorPositionsToPixels(o,21);for(a=1,s=(this._pixels=u).length;a<s;a++){var p;n+=p=x.Pixel.getDistance(u[a-1],u[a]),i.push(p),h=P.getPixelHeading(u[a-1],u[a]),r.push(h)}}this._totalLength=n,this._distances=i,this._headings=r,this._pathOptions.captureMetadata&&P.setMetadata(this._shape,{heading:this._headings[0]})}e&&this.play()},q.prototype.onAnimationProgress=function(t){var e,n,i=this._shape,r=this._positions,o=this._headings,a=this._distances,s=this._pathOptions,h=this._totalLength;if(1===t)e=r[r.length-1],n=0<o.length?o[o.length-1]:void 0,s.map&&this._setMapCamera(e,n,!1),P.setCoordinates(i,e,p);else if(0===t)e=r[0],n=0<o.length?o[0]:void 0,s.map&&this._setMapCamera(e,n,!1),P.setCoordinates(i,e,[e,e]);else{var u=h*t,p=null;if(s.geodesic)if(h<u)n=o[o.length-1],p=r.slice(0);else if(u<0)n=o[0],p=r.slice(0,1);else for(var l=0,c=0;c<a.length;c++){if(l+a[c]>=u){n=o[c],(p=r.slice(0,c+1)).push(x.math.getDestination(r[c],n,u-l));break}l+=a[c]}else{var f=null,g=this._pixels;if(h<u)n=o[o.length-1],f=P.getPixelDestination(g[g.length-1],n,u-h),(p=r.slice(0)).push(x.math.mercatorPixelsToPositions([f],21)[0]);else if(u<0)n=o[0],f=P.getPixelDestination(g[0],n,u),(p=r.slice(0,1)).push(x.math.mercatorPixelsToPositions([f],21)[0]);else for(c=l=0;c<a.length;c++){if(l+a[c]>=u){n=o[c],f=P.getPixelDestination(g[c],n,u-l),(p=r.slice(0,c+1)).push(x.math.mercatorPixelsToPositions([f],21)[0]);break}l+=a[c]}}p&&0<p.length&&(e=p[p.length-1],s.map&&this._setMapCamera(e,n,2<p.length),P.setCoordinates(i,e,p))}return s.captureMetadata&&P.setMetadata(i,{heading:n}),{position:e,heading:n}},q);function q(t,e,n){var i=T.call(this)||this;return i._shape=e,i._positions=t,i.setOptions(Object.assign({rotate:!0,rotationOffset:0},n||{})),n&&n.autoPlay&&i.play(),i}var E,D,j=(function(t){!function(t){function e(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&re.indexOf(t)>=0}function a(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function u(t){return t>=48&&t<=57}function s(t){return t>=48&&t<=57||43===t||45===t||46===t}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function h(t){for(;t.index<t.max&&e(t.path.charCodeAt(t.index));)t.index++}function p(t){var e,n=t.index,i=n,r=t.max,o=!1,a=!1,s=!1,h=!1;if(i>=r)return void(t.err="SvgPath: missed param (at pos "+i+")");if(e=t.path.charCodeAt(i),43!==e&&45!==e||(i++,e=i<r?t.path.charCodeAt(i):0),!u(e)&&46!==e)return void(t.err="SvgPath: param should start with 0..9 or `.` (at pos "+i+")");if(46!==e){if(o=48===e,i++,e=i<r?t.path.charCodeAt(i):0,o&&i<r&&e&&u(e))return void(t.err="SvgPath: numbers started with `0` such as `09` are ilegal (at pos "+n+")");for(;i<r&&u(t.path.charCodeAt(i));)i++,a=!0;e=i<r?t.path.charCodeAt(i):0}if(46===e){for(h=!0,i++;u(t.path.charCodeAt(i));)i++,s=!0;e=i<r?t.path.charCodeAt(i):0}if(101===e||69===e){if(h&&!a&&!s)return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");if(i++,e=i<r?t.path.charCodeAt(i):0,43!==e&&45!==e||i++,!(i<r&&u(t.path.charCodeAt(i))))return void(t.err="SvgPath: invalid float exponent (at pos "+i+")");for(;i<r&&u(t.path.charCodeAt(i));)i++}t.index=i,t.param=parseFloat(t.path.slice(n,i))+0}function l(t){var e,n;e=t.path[t.segmentStart],n=e.toLowerCase();var i=t.data;if("m"===n&&i.length>2&&(t.result.push([e,i[0],i[1]]),i=i.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.result.push([e].concat(i));else for(;i.length>=ie[n]&&(t.result.push([e].concat(i.splice(0,ie[n]))),ie[n]););}function r(t){var e,n,i,r,o=t.max;if(t.segmentStart=t.index,e=t.path.charCodeAt(t.index),!a(e))return void(t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")");if(i=ie[t.path[t.index].toLowerCase()],t.index++,h(t),t.data=[],!i)return void l(t);for(n=!1;;){for(r=i;r>0;r--){if(p(t),t.err.length)return;t.data.push(t.param),h(t),n=!1,t.index<o&&44===t.path.charCodeAt(t.index)&&(t.index++,h(t),n=!0)}if(!n){if(t.index>=t.max)break;if(!s(t.path.charCodeAt(t.index)))break}}l(t)}function n(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}function o(){if(!(this instanceof o))return new o;this.queue=[],this.cache=null}function A(t,e,n,i){var r=t*i-e*n<0?-1:1,o=Math.sqrt(t*t+e*e),a=Math.sqrt(t*t+e*e),s=t*n+e*i,h=s/(o*a);return h>1&&(h=1),h<-1&&(h=-1),r*Math.acos(h)}function x(t,e,n,i,r,o,a,s,h,u){var p=u*(t-n)/2+h*(e-i)/2,l=-h*(t-n)/2+u*(e-i)/2,c=a*a,f=s*s,g=p*p,y=l*l,v=c*f-c*y-f*g;v<0&&(v=0),v/=c*y+f*g,v=Math.sqrt(v)*(r===o?-1:1);var m=v*a/s*l,_=v*-s/a*p,d=u*m-h*_+(t+n)/2,x=h*m+u*_+(e+i)/2,P=(p-m)/a,M=(l-_)/s,b=(-p-m)/a,w=(-l-_)/s,O=A(1,0,P,M),L=A(P,M,b,w);return 0===o&&L>0&&(L-=le),1===o&&L<0&&(L+=le),[d,x,O,L]}function P(t,e){var n=4/3*Math.tan(e/4),i=Math.cos(t),r=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[i,r,i-r*n,r+i*n,o+a*n,a-o*n,o,a]}function c(t,e,n){if(!(this instanceof c))return new c(t,e,n);this.rx=t,this.ry=e,this.ax=n}function f(t){if(!(this instanceof f))return new f(t);var e=oe(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}function g(t){var e=t.match(xe);return e?e.map(Number):[]}function y(t,e,n,i,r,o,a,s){this.a={x:t,y:e},this.b={x:n,y:i},this.c={x:r,y:o},this.d={x:a,y:s},null!==a&&void 0!==a&&null!==s&&void 0!==s?(this.getArcLength=k,this.getPoint=M,this.getDerivative=m):(this.getArcLength=b,this.getPoint=d,this.getDerivative=v),this.init()}function v(t,e,n){return{x:2*(1-n)*(t[1]-t[0])+2*n*(t[2]-t[1]),y:2*(1-n)*(e[1]-e[0])+2*n*(e[2]-e[1])}}function m(t,e,n){return d([3*(t[1]-t[0]),3*(t[2]-t[1]),3*(t[3]-t[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],n)}function _(t,e,n,i,r){for(var o=1,a=t/e,s=(t-n(i,r,a))/e;o>.001;){var h=n(i,r,a+s),u=n(i,r,a-s),p=Math.abs(t-h)/e,l=Math.abs(t-u)/e;p<o?(o=p,a+=s):l<o?(o=l,a-=s):s/=2}return a}function d(t,e,n){return{x:(1-n)*(1-n)*t[0]+2*(1-n)*n*t[1]+n*n*t[2],y:(1-n)*(1-n)*e[0]+2*(1-n)*n*e[1]+n*n*e[2]}}function M(t,e,n){return{x:(1-n)*(1-n)*(1-n)*t[0]+3*(1-n)*(1-n)*n*t[1]+3*(1-n)*n*n*t[2]+n*n*n*t[3],y:(1-n)*(1-n)*(1-n)*e[0]+3*(1-n)*(1-n)*n*e[1]+3*(1-n)*n*n*e[2]+n*n*n*e[3]}}function b(t,e,n){void 0===n&&(n=1);var i=t[0]-2*t[1]+t[2],r=e[0]-2*e[1]+e[2],o=2*t[1]-2*t[0],a=2*e[1]-2*e[0],s=4*(i*i+r*r),h=4*(i*o+r*a),u=o*o+a*a;if(0===s)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));var p=h/(2*s),l=u/s,c=n+p,f=l-p*p;return Math.sqrt(s)/2*(c*Math.sqrt(c*c+f)-p*Math.sqrt(p*p+f)+f*Math.log(Math.abs((c+Math.sqrt(c*c+f))/(p+Math.sqrt(p*p+f)))))}function w(t,e){return we[t][e]}function O(t,e,n){var i,r,o,a=n.length-1;if(0===a)return 0;if(0===t){for(r=0,o=0;o<=a;o++)r+=w(a,o)*Math.pow(1-e,a-o)*Math.pow(e,o)*n[o];return r}for(i=new Array(a),o=0;o<a;o++)i[o]=a*(n[o+1]-n[o]);return O(t-1,e,i)}function L(t,e,n){var i=O(1,n,t),r=O(1,n,e),o=i*i+r*r;return Math.sqrt(o)}function k(t,e,n){var i,r,o,a;void 0===n&&(n=1);for(i=n/2,r=0,o=0;o<20;o++)a=i*Me[20][o]+i,r+=be[20][o]*L(t,e,a);return i*r}function C(t,e,n,i){var r=t*i-e*n<0?-1:1,o=t*n+e*i;return o>1&&(o=1),o<-1&&(o=-1),r*Math.acos(o)}function I(t,e,n,i,r,o,a,s,h,u){var p=u*(t-n)/2+h*(e-i)/2,l=-h*(t-n)/2+u*(e-i)/2,c=a*a,f=s*s,g=p*p,y=l*l,v=c*f-c*y-f*g;v<0&&(v=0),v/=c*y+f*g,v=Math.sqrt(v)*(r===o?-1:1);var m=v*a/s*l,_=v*-s/a*p,d=u*m-h*_+(t+n)/2,x=h*m+u*_+(e+i)/2,P=(p-m)/a,M=(l-_)/s,b=(-p-m)/a,w=(-l-_)/s,O=C(1,0,P,M),L=C(P,M,b,w);return 0===o&&L>0&&(L-=Oe),1===o&&L<0&&(L+=Oe),[d,x,O,L]}function S(t,e){var n=4/3*Math.tan(e/4),i=Math.cos(t),r=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[i,r,i-r*n,r+i*n,o+a*n,a-o*n,o,a]}function T(t,e,n,i,r,o,a,s,h){var u=0,p=[],l=[];Le(t,e,n,i,r,o,a,s,h).forEach(function(t){var e=new Pe(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),n=e.getTotalLength();u+=n,p.push(n),l.push(e)}),this.length=u,this.partialLengths=p,this.curves=l}function F(t,e,n,i){this.x0=t,this.x1=e,this.y0=n,this.y1=i}function q(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function E(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function D(t,e){return q(t,e)<1e-9}function j(t,n,i){var r=t.map(function(t,e){return G(t,n[e])});return function(e){var t=r.map(function(t){return t(e)});return i?N(t):t}}function G(t,i){return function(n){return t.map(function(t,e){return t+n*(i[e]-t)})}}function Z(t){return"number"==typeof t&&isFinite(t)}function B(t){return z(t)?ee(t):[(t[0][0]+t[t.length-1][0])/2,(t[0][1]+t[t.length-1][1])/2]}function z(t){for(var e=0;e<t.length-2;e++){var n=t[e],i=t[e+1],r=t[e+2];if(n[0]*(i[1]-r[1])+i[0]*(r[1]-n[1])+r[0]*(n[1]-i[1]))return!0}return!1}function H(t){return new ve(t).abs()}function V(t){return t.toString().split("M").map(function(t,e){return t=t.trim(),e&&t?"M"+t:t}).filter(function(t){return t})}function N(t){return"M"+t.join("L")+"Z"}function R(t){return V(H(t))}function Q(t,e){var n=H(t);return J(n)||X(n,e)}function J(t){var e=t.segments||[],n=[];if(!e.length||"M"!==e[0][0])return!1;for(var i=0;i<e.length;i++){var r=e[i],o=r[0],a=r[1],s=r[2];if("M"===o&&i||"Z"===o)break;if("M"===o||"L"===o)n.push([a,s]);else if("H"===o)n.push([a,n[n.length-1][1]]);else{if("V"!==o)return!1;n.push([n[n.length-1][0],a])}}return!!n.length&&{ring:n}}function X(t,e){var n,i,r=V(t)[0],o=[],a=3;if(!r)throw new TypeError(Ie);i=Y(r),n=i.getTotalLength(),e&&Z(e)&&e>0&&(a=Math.max(a,Math.ceil(n/e)));for(var s=0;s<a;s++){var h=i.getPointAtLength(n*s/a);o.push([h.x,h.y])}return{ring:o,skipBisect:!0}}function Y(t){if("undefined"!=typeof window&&window&&window.document)try{var e=window.document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttributeNS(null,"d",t),e}catch(t){}return Ce(t)}function U(t,e){for(var n=t.length+e,i=ne(t)/e,r=0,o=0,a=i/2;t.length<n;){var s=t[r],h=t[(r+1)%t.length],u=q(s,h);a<=o+u?(t.splice(r+1,0,u?E(s,h,(a-o)/u):s.slice(0)),a+=i):(o+=u,r++)}}function W(t,e){void 0===e&&(e=1/0);for(var n=0;n<t.length;n++)for(var i=t[n],r=n===t.length-1?t[0]:t[n+1];q(i,r)>e;)r=E(i,r,.5),t.splice(n+1,0,r)}function $(t,e){var n,i,r;if("string"==typeof t){var o=Q(t,e);t=o.ring,r=o.skipBisect}else if(!Array.isArray(t))throw new TypeError(Ie);if(n=t.slice(0),!K(n))throw new TypeError(Ie);return n.length>1&&D(n[0],n[n.length-1])&&n.pop(),i=te(n),i>0&&n.reverse(),!r&&e&&Z(e)&&e>0&&W(n,e),n}function K(t){return t.every(function(t){return Array.isArray(t)&&t.length>=2&&Z(t[0])&&Z(t[1])})}function tt(t,e,n){var i;return i=t.length-e.length,U(t,i<0?-1*i:0),U(e,i>0?i:0),Te(t,e),j(t,e,n)}function et(t,e,n){n=n||2;var i=e&&e.length,r=i?e[0]*n:t.length,o=nt(t,0,r,n,!0),a=[];if(!o)return a;var s,h,u,p,l,c,f;if(i&&(o=ut(t,e,o,n)),t.length>80*n){s=u=t[0],h=p=t[1];for(var g=n;g<r;g+=n)l=t[g],c=t[g+1],l<s&&(s=l),c<h&&(h=c),l>u&&(u=l),c>p&&(p=c);f=Math.max(u-s,p-h)}return rt(o,a,n,s,h,f),a}function nt(t,e,n,i,r){var o,a;if(r===Ct(t,e,n,i)>0)for(o=e;o<n;o+=i)a=Lt(o,t[o],t[o+1],a);else for(o=n-i;o>=e;o-=i)a=Lt(o,t[o],t[o+1],a);return a&&xt(a,a.next)&&(At(a),a=a.next),a}function it(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!xt(i,i.next)&&0!==dt(i.prev,i,i.next))i=i.next;else{if(At(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function rt(t,e,n,i,r,o,a){if(t){!a&&o&&ft(t,i,r,o);for(var s,h,u=t;t.prev!==t.next;)if(s=t.prev,h=t.next,o?at(t,i,r,o):ot(t))e.push(s.i/n),e.push(t.i/n),e.push(h.i/n),At(t),t=h.next,u=h.next;else if((t=h)===u){a?1===a?(t=st(t,e,n),rt(t,e,n,i,r,o,2)):2===a&&ht(t,e,n,i,r,o):rt(it(t),e,n,i,r,o,1);break}}}function ot(t){var e=t.prev,n=t,i=t.next;if(dt(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(mt(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&dt(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function at(t,e,n,i){var r=t.prev,o=t,a=t.next;if(dt(r,o,a)>=0)return!1;for(var s=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,h=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,u=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,p=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,l=yt(s,h,e,n,i),c=yt(u,p,e,n,i),f=t.nextZ;f&&f.z<=c;){if(f!==t.prev&&f!==t.next&&mt(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&dt(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&mt(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&dt(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function st(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!xt(r,o)&&Pt(r,i,i.next,o)&&bt(r,o)&&bt(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),At(i),At(i.next),i=t=o),i=i.next}while(i!==t);return i}function ht(t,e,n,i,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&_t(a,s)){var h=Ot(a,s);return a=it(a,a.next),h=it(h,h.next),rt(a,e,n,i,r,o),void rt(h,e,n,i,r,o)}s=s.next}a=a.next}while(a!==t)}function ut(t,e,n,i){var r,o,a,s,h,u=[];for(r=0,o=e.length;r<o;r++)a=e[r]*i,s=r<o-1?e[r+1]*i:t.length,h=nt(t,a,s,i,!1),h===h.next&&(h.steiner=!0),u.push(vt(h));for(u.sort(pt),r=0;r<u.length;r++)lt(u[r],n),n=it(n,n.next);return n}function pt(t,e){return t.x-e.x}function lt(t,e){if(e=ct(t,e)){var n=Ot(e,t);it(n,n.next)}}function ct(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a){if(a=s,s===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===a)return n.prev;var h,u=n,p=n.x,l=n.y,c=1/0;for(i=n.next;i!==u;)r>=i.x&&i.x>=p&&mt(o<l?r:a,o,p,l,o<l?a:r,o,i.x,i.y)&&((h=Math.abs(o-i.y)/(r-i.x))<c||h===c&&i.x>n.x)&&bt(i,t)&&(n=i,c=h),i=i.next;return n}function ft(t,e,n,i){var r=t;do{null===r.z&&(r.z=yt(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,gt(r)}function gt(t){var e,n,i,r,o,a,s,h,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,i=n,s=0,e=0;e<u&&(s++,i=i.nextZ);e++);for(h=u;s>0||h>0&&i;)0===s?(r=i,i=i.nextZ,h--):0!==h&&i?n.z<=i.z?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,h--):(r=n,n=n.nextZ,s--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(a>1);return t}function yt(t,e,n,i,r){return t=32767*(t-n)/r,e=32767*(e-i)/r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function vt(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function mt(t,e,n,i,r,o,a,s){return(r-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(r-a)*(i-s)>=0}function _t(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Mt(t,e)&&bt(t,e)&&bt(e,t)&&wt(t,e)}function dt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function xt(t,e){return t.x===e.x&&t.y===e.y}function Pt(t,e,n,i){return!!(xt(t,e)&&xt(n,i)||xt(t,i)&&xt(n,e))||dt(t,e,n)>0!=dt(t,e,i)>0&&dt(n,i,t)>0!=dt(n,i,e)>0}function Mt(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Pt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function bt(t,e){return dt(t.prev,t,t.next)<0?dt(t,e,t.next)>=0&&dt(t,t.prev,e)>=0:dt(t,e,t.prev)<0||dt(t,t.next,e)<0}function wt(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function Ot(t,e){var n=new kt(t.i,t.x,t.y),i=new kt(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Lt(t,e,n,i){var r=new kt(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function At(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function kt(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ct(t,e,n,i){for(var r=0,o=e,a=n-i;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}function It(t,e){var n=e.id,i=e.bbox,r=null==e.properties?{}:e.properties,o=St(t,e);return null==n&&null==i?{type:"Feature",properties:r,geometry:o}:null==i?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function St(t,e){function r(t,e){e.length&&e.pop();for(var n=u[t<0?~t:t],i=0,r=n.length;i<r;++i)e.push(h(n[i],i));t<0&&je(e,r)}function i(t){return h(t)}function o(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0]),e}function n(t){for(var e=o(t);e.length<4;)e.push(e[0]);return e}function a(t){return t.map(n)}function s(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(s)};case"Point":e=i(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(i);break;case"LineString":e=o(t.arcs);break;case"MultiLineString":e=t.arcs.map(o);break;case"Polygon":e=a(t.arcs);break;case"MultiPolygon":e=t.arcs.map(a);break;default:return null}return{type:n,coordinates:e}}var h=De(t.transform),u=t.arcs;return s(e)}function Tt(t){for(var e,n=-1,i=t.length,r=t[i-1],o=0;++n<i;)e=r,r=t[n],o+=e[0]*r[1]-e[1]*r[0];return Math.abs(o)}function Ft(s,t){function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":n(t.arcs);break;case"MultiPolygon":t.arcs.forEach(n)}}function n(e){e.forEach(function(t){t.forEach(function(t){(u[t=t<0?~t:t]||(u[t]=[])).push(e)})}),i.push(e)}function h(t){return Tt(St(s,{type:"Polygon",arcs:[t]}).coordinates[0])}var u={},i=[],r=[];return t.forEach(e),i.forEach(function(t){if(!t._){var e=[],n=[t];for(t._=1,r.push(e);t=n.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){u[t<0?~t:t].forEach(function(t){t._||(t._=1,n.push(t))})})})}}),i.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:r.map(function(t){var e,n=[];if(t.forEach(function(t){t.forEach(function(t){t.forEach(function(t){u[t<0?~t:t].length<2&&n.push(t)})})}),n=Ze(s,n),(e=n.length)>1)for(var i,r,o=1,a=h(n[0]);o<e;++o)(i=h(n[o]))>a&&(r=n[0],n[0]=n[o],n[o]=r,a=i);return n})}}function qt(n){return function(t,e){return He(n(t),e)}}function Et(t,o){var a={},s={type:"Topology",objects:{triangles:{type:"GeometryCollection",geometries:[]}},arcs:[]};return t.forEach(function(t){var r=[];t.forEach(function(t,e){var n=t[0]<t[1]?t.join(","):t[1]+","+t[0],i=t.map(function(t){return o[t]});n in a?r.push(~a[n]):(r.push(a[n]=s.arcs.length),s.arcs.push(i))}),s.objects.triangles.geometries.push({type:"Polygon",area:Math.abs(te(t.map(function(t){return o[t[0]]}))),arcs:[r]})}),s.objects.triangles.geometries.sort(function(t,e){return t.area-e.area}),s}function Dt(r,t){for(var o=r.objects.triangles.geometries,a=Ve(function(t){return t.area}).left;o.length>t;)!function(){var t=o[0],e=ze(o)[0][0],n=o[e],i=Ft(r,[t,n]);i.area=t.area+n.area,i.type="Polygon",i.arcs=i.arcs[0],o.splice(e,1),o.shift(),o.splice(a(o,i.area),0,i)}();if(t>o.length)throw new RangeError("Can't collapse topology into "+t+" pieces.");return Ge(r,r.objects.triangles).features.map(function(t){return t.geometry.coordinates[0].pop(),t.geometry.coordinates[0]})}function jt(t){for(var e=qe(t.reduce(function(t,e){return t.concat([e[0]],[e[1]])},[])),n=[],i=0,r=e.length;i<r;i+=3)n.push([[e[i],e[i+1]],[e[i+1],e[i+2]],[e[i+2],e[i]]]);return n}function Gt(t,e,a){function s(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=0);for(var i=0;i<t.length;i++){var r=t.splice(i,1),o=a[r[0]][e.length];n+o<h&&(t.length?s(t.slice(),e.concat(r),n+o):(h=n+o,u=e.concat(r))),t.length&&t.splice(i,0,r[0])}}var h=1/0,u=t.map(function(t,e){return e});return s(u),u}function Zt(t,e){var n=q(B(t),B(e));return n*n}function Bt(t,e,n){void 0===n&&(n={});var i=n.maxSegmentLength;void 0===i&&(i=10);var r=n.string;void 0===r&&(r=!0);var o=n.single;void 0===o&&(o=!1);var a=$(t,i);a.length<e.length+2&&U(a,e.length+2-a.length);var s,h=Re(a,e.length),u=e.map(function(t){return $(t,i)}),p="string"==typeof t&&t;return o&&!e.every(function(t){return"string"==typeof t})||(s=e.slice(0)),Vt(h,u,{match:!0,string:r,single:o,t0:p,t1:s})}function zt(t,e,n){void 0===n&&(n={});var i=n.maxSegmentLength;void 0===i&&(i=10);var r=n.string;void 0===r&&(r=!0);var o=n.single;void 0===o&&(o=!1);var a=Bt(e,t,{maxSegmentLength:i,string:r,single:o});return o?function(t){return a(1-t)}:a.map(function(e){return function(t){return e(1-t)}})}function Ht(t,e,n){void 0===n&&(n={});var i=n.maxSegmentLength;void 0===i&&(i=10);var r=n.string;void 0===r&&(r=!0);var o=n.single;if(void 0===o&&(o=!1),!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length||!t.length)throw new TypeError(Se);var a,s,h=function(t){return $(t,i)},u=t.map(h),p=e.map(h);return o?(t.every(function(t){return"string"==typeof t})&&(a=t.slice(0)),e.every(function(t){return"string"==typeof t})&&(s=e.slice(0))):(a=t.slice(0),s=e.slice(0)),Vt(u,p,{string:r,single:o,t0:a,t1:s,match:!1})}function Vt(n,i,t){void 0===t&&(t={});var r=t.string,e=t.single,o=t.t0,a=t.t1,s=t.match,h=s?Qe(n,i):n.map(function(t,e){return e}),u=h.map(function(t,e){return tt(n[t],i[e],r)});if(s&&Array.isArray(o)&&(o=h.map(function(t){return o[t]})),e&&r&&(Array.isArray(o)&&(o=o.join(" ")),Array.isArray(a)&&(a=a.join(" "))),e){var p=r?function(e){return u.map(function(t){return t(e)}).join(" ")}:function(e){return u.map(function(t){return t(e)})};return r&&(o||a)?function(t){return t<1e-4&&o||1-t<1e-4&&a||p(t)}:p}return r?(o=Array.isArray(o)?o.map(function(t){return"string"==typeof t&&t}):[],a=Array.isArray(a)?a.map(function(t){return"string"==typeof t&&t}):[],u.map(function(e,n){return o[n]||a[n]?function(t){return t<1e-4&&o[n]||1-t<1e-4&&a[n]||e(t)}:e})):u}function Nt(t,e,n,i,r){return Xt(Yt(t,e,n),i,$t(t,e,n),2*Math.PI*n,r)}function Rt(t,e,n,i,r){var o=Nt(e,n,i,t,r);return function(t){return o(1-t)}}function Qt(t,e,n,i,r,o){return Xt(Ut(t,e,n,i),r,Kt(t,e,n,i),2*n+2*i,o)}function Jt(t,e,n,i,r,o){var a=Qt(e,n,i,r,t,o);return function(t){return a(1-t)}}function Xt(t,e,n,i,r){void 0===r&&(r={});var o=r.maxSegmentLength;void 0===o&&(o=10);var a=r.string;void 0===a&&(a=!0);var s,h,u=$(e,o);return Z(i)&&u.length<i/o&&U(u,Math.ceil(i/o-u.length)),s=t(u),h=j(s,u,a),a?function(t){return t<1e-4?n:h(t)}:h}function Yt(s,h,u){return function(i){var t=B(i),r=ne(i.concat([i[0]])),o=Math.atan2(i[0][1]-t[1],i[0][0]-t[0]),a=0;return i.map(function(t,e){var n;return e&&(a+=q(t,i[e-1])),n=o+2*Math.PI*(r?a/r:e/i.length),[Math.cos(n)*u+s,Math.sin(n)*u+h]})}}function Ut(s,h,u,p){return function(i){var t=B(i),r=ne(i.concat([i[0]])),e=Math.atan2(i[0][1]-t[1],i[0][0]-t[0]),o=0;e<0&&(e=2*Math.PI+e);var a=e/(2*Math.PI);return i.map(function(t,e){e&&(o+=q(t,i[e-1]));var n=Wt((a+(r?o/r:e/i.length))%1);return[s+n[0]*u,h+n[1]*p]})}}function Wt(t){return t<=1/8?[1,.5+4*t]:t<=3/8?[1.5-4*t,1]:t<=5/8?[0,2.5-4*t]:t<=7/8?[4*t-2.5,0]:[1,4*t-3.5]}function $t(t,e,n){var i=t-n+","+e,r=t+n+","+e,o="A"+n+","+n+",0,1,1,";return"M"+i+o+r+o+i+"Z"}function Kt(t,e,n,i){var r=t+n,o=e+i;return"M"+t+","+e+"L"+r+","+e+"L"+r+","+o+"L"+t+","+o+"Z"}var te=function(t){for(var e,n=-1,i=t.length,r=t[i-1],o=0;++n<i;)e=r,r=t[n],o+=e[1]*r[0]-e[0]*r[1];return o/2},ee=function(t){for(var e,n,i=-1,r=t.length,o=0,a=0,s=t[r-1],h=0;++i<r;)e=s,s=t[i],h+=n=e[0]*s[1]-s[0]*e[1],o+=(e[0]+s[0])*n,a+=(e[1]+s[1])*n;return h*=3,[o/h,a/h]},ne=function(t){for(var e,n,i=-1,r=t.length,o=t[r-1],a=o[0],s=o[1],h=0;++i<r;)e=a,n=s,o=t[i],a=o[0],s=o[1],e-=a,n-=s,h+=Math.sqrt(e*e+n*n);return h},ie={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},re=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],oe=function(t){var e=new i(t),n=e.max;for(h(e);e.index<n&&!e.err.length;)r(e);return e.err.length?e.result=[]:e.result.length&&("mM".indexOf(e.result[0][0])<0?(e.err="SvgPath: string should start with `M` or `m`",e.result=[]):e.result[0][0]="M"),{err:e.err,segments:e.result}};o.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]?this:(this.cache=null,this.queue.push(t),this)},o.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},o.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},o.prototype.rotate=function(t,e,n){var i,r,o;return 0!==t&&(this.translate(e,n),i=t*Math.PI/180,r=Math.cos(i),o=Math.sin(i),this.queue.push([r,o,-o,r,0,0]),this.cache=null,this.translate(-e,-n)),this},o.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},o.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},o.prototype.toArray=function(){var t=this;if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var e=1;e<this.queue.length;e++)t.cache=n(t.cache,t.queue[e]);return this.cache},o.prototype.calc=function(t,e,n){var i;return this.queue.length?(this.cache||(this.cache=this.toArray()),i=this.cache,[t*i[0]+e*i[2]+(n?0:i[4]),t*i[1]+e*i[3]+(n?0:i[5])]):[t,e]};var ae=o,se={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},he=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,ue=/[\s,]+/,pe=function(t){var e,n,i=new ae;return t.split(he).forEach(function(t){if(t.length){if(void 0!==se[t])return void(e=t);switch(n=t.split(ue).map(function(t){return+t||0}),e){case"matrix":return void(6===n.length&&i.matrix(n));case"scale":return void(1===n.length?i.scale(n[0],n[0]):2===n.length&&i.scale(n[0],n[1]));case"rotate":return void(1===n.length?i.rotate(n[0],0,0):3===n.length&&i.rotate(n[0],n[1],n[2]));case"translate":return void(1===n.length?i.translate(n[0],0):2===n.length&&i.translate(n[0],n[1]));case"skewX":return void(1===n.length&&i.skewX(n[0]));case"skewY":return void(1===n.length&&i.skewY(n[0]))}}}),i},le=2*Math.PI,ce=function(t,e,n,i,r,o,a,s,h){var u=Math.sin(h*le/360),p=Math.cos(h*le/360),l=p*(t-n)/2+u*(e-i)/2,c=-u*(t-n)/2+p*(e-i)/2;if(0===l&&0===c)return[];if(0===a||0===s)return[];a=Math.abs(a),s=Math.abs(s);var f=l*l/(a*a)+c*c/(s*s);f>1&&(a*=Math.sqrt(f),s*=Math.sqrt(f));var g=x(t,e,n,i,r,o,a,s,u,p),y=[],v=g[2],m=g[3],_=Math.max(Math.ceil(Math.abs(m)/(le/4)),1);m/=_;for(var d=0;d<_;d++)y.push(P(v,m)),v+=m;return y.map(function(t){for(var e=0;e<t.length;e+=2){var n=t[e+0],i=t[e+1];n*=a,i*=s;var r=p*n-u*i,o=u*n+p*i;t[e+0]=r+g[0],t[e+1]=o+g[1]}return t})},fe=Math.PI/180;c.prototype.transform=function(t){var e=Math.cos(this.ax*fe),n=Math.sin(this.ax*fe),i=[this.rx*(t[0]*e+t[2]*n),this.rx*(t[1]*e+t[3]*n),this.ry*(-t[0]*n+t[2]*e),this.ry*(-t[1]*n+t[3]*e)],r=i[0]*i[0]+i[2]*i[2],o=i[1]*i[1]+i[3]*i[3],a=((i[0]-i[3])*(i[0]-i[3])+(i[2]+i[1])*(i[2]+i[1]))*((i[0]+i[3])*(i[0]+i[3])+(i[2]-i[1])*(i[2]-i[1])),s=(r+o)/2;if(a<1e-10*s)return this.rx=this.ry=Math.sqrt(s),this.ax=0,this;var h=i[0]*i[1]+i[2]*i[3];a=Math.sqrt(a);var u=s+a/2,p=s-a/2;return this.ax=Math.abs(h)<1e-10&&Math.abs(u-o)<1e-10?90:180*Math.atan(Math.abs(h)>Math.abs(u-o)?(u-r)/h:h/(u-o))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(u),this.ry=Math.sqrt(p)):(this.ax+=90,this.rx=Math.sqrt(p),this.ry=Math.sqrt(u)),this},c.prototype.isDegenerate=function(){return this.rx<1e-10*this.ry||this.ry<1e-10*this.rx};var ge=c;f.prototype.__matrix=function(p){var l,c=this;p.queue.length&&this.iterate(function(t,e,n,i){var r,o,a,s;switch(t[0]){case"v":r=p.calc(0,t[1],!0),o=0===r[0]?["v",r[1]]:["l",r[0],r[1]];break;case"V":r=p.calc(n,t[1],!1),o=r[0]===p.calc(n,i,!1)[0]?["V",r[1]]:["L",r[0],r[1]];break;case"h":r=p.calc(t[1],0,!0),o=0===r[1]?["h",r[0]]:["l",r[0],r[1]];break;case"H":r=p.calc(t[1],i,!1),o=r[1]===p.calc(n,i,!1)[1]?["H",r[0]]:["L",r[0],r[1]];break;case"a":case"A":var h=p.toArray(),u=ge(t[1],t[2],t[3]).transform(h);if(h[0]*h[3]-h[1]*h[2]<0&&(t[5]=t[5]?"0":"1"),r=p.calc(t[6],t[7],"a"===t[0]),"A"===t[0]&&t[6]===n&&t[7]===i||"a"===t[0]&&0===t[6]&&0===t[7]){o=["a"===t[0]?"l":"L",r[0],r[1]];break}o=u.isDegenerate()?["a"===t[0]?"l":"L",r[0],r[1]]:[t[0],u.rx,u.ry,u.ax,t[4],t[5],r[0],r[1]];break;case"m":s=e>0,r=p.calc(t[1],t[2],s),o=["m",r[0],r[1]];break;default:for(a=t[0],o=[a],s=a.toLowerCase()===a,l=1;l<t.length;l+=2)r=p.calc(t[l],t[l+1],s),o.push(r[0],r[1])}c.segments[e]=o},!0)},f.prototype.__evaluateStack=function(){var t,e,n=this;if(this.__stack.length){if(1===this.__stack.length)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=ae(),e=this.__stack.length;--e>=0;)t.matrix(n.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},f.prototype.toString=function(){var t,e,n=this,i=[];this.__evaluateStack();for(var r=0;r<this.segments.length;r++)e=n.segments[r][0],t=r>0&&"m"!==e&&"M"!==e&&e===n.segments[r-1][0],i=i.concat(t?n.segments[r].slice(1):n.segments[r]);return i.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},f.prototype.translate=function(t,e){return this.__stack.push(ae().translate(t,e||0)),this},f.prototype.scale=function(t,e){return this.__stack.push(ae().scale(t,e||0===e?e:t)),this},f.prototype.rotate=function(t,e,n){return this.__stack.push(ae().rotate(t,e||0,n||0)),this},f.prototype.skewX=function(t){return this.__stack.push(ae().skewX(t)),this},f.prototype.skewY=function(t){return this.__stack.push(ae().skewY(t)),this},f.prototype.matrix=function(t){return this.__stack.push(ae().matrix(t)),this},f.prototype.transform=function(t){return t.trim()?(this.__stack.push(pe(t)),this):this},f.prototype.round=function(i){var e,r=0,o=0,a=0,s=0;return i=i||0,this.__evaluateStack(),this.segments.forEach(function(n){var t=n[0].toLowerCase()===n[0];switch(n[0]){case"H":case"h":return t&&(n[1]+=a),a=n[1]-n[1].toFixed(i),void(n[1]=+n[1].toFixed(i));case"V":case"v":return t&&(n[1]+=s),s=n[1]-n[1].toFixed(i),void(n[1]=+n[1].toFixed(i));case"Z":case"z":return a=r,void(s=o);case"M":case"m":return t&&(n[1]+=a,n[2]+=s),a=n[1]-n[1].toFixed(i),s=n[2]-n[2].toFixed(i),r=a,o=s,n[1]=+n[1].toFixed(i),void(n[2]=+n[2].toFixed(i));case"A":case"a":return t&&(n[6]+=a,n[7]+=s),a=n[6]-n[6].toFixed(i),s=n[7]-n[7].toFixed(i),n[1]=+n[1].toFixed(i),n[2]=+n[2].toFixed(i),n[3]=+n[3].toFixed(i+2),n[6]=+n[6].toFixed(i),void(n[7]=+n[7].toFixed(i));default:return e=n.length,t&&(n[e-2]+=a,n[e-1]+=s),a=n[e-2]-n[e-2].toFixed(i),s=n[e-1]-n[e-1].toFixed(i),void n.forEach(function(t,e){e&&(n[e]=+n[e].toFixed(i))})}}),this},f.prototype.iterate=function(r,t){var e,n,i,o=this.segments,a={},s=!1,h=0,u=0,p=0,l=0;if(t||this.__evaluateStack(),o.forEach(function(t,e){var n=r(t,e,h,u);Array.isArray(n)&&(a[e]=n,s=!0);var i=t[0]===t[0].toLowerCase();switch(t[0]){case"m":case"M":return h=t[1]+(i?h:0),u=t[2]+(i?u:0),p=h,void(l=u);case"h":case"H":return void(h=t[1]+(i?h:0));case"v":case"V":return void(u=t[1]+(i?u:0));case"z":case"Z":return h=p,void(u=l);default:h=t[t.length-2]+(i?h:0),u=t[t.length-1]+(i?u:0)}}),!s)return this;for(i=[],e=0;e<o.length;e++)if(void 0!==a[e])for(n=0;n<a[e].length;n++)i.push(a[e][n]);else i.push(o[e]);return this.segments=i,this},f.prototype.abs=function(){return this.iterate(function(t,e,n,i){var r,o=t[0],a=o.toUpperCase();if(o!==a)switch(t[0]=a,o){case"v":return void(t[1]+=i);case"a":return t[6]+=n,void(t[7]+=i);default:for(r=1;r<t.length;r++)t[r]+=r%2?n:i}},!0),this},f.prototype.rel=function(){return this.iterate(function(t,e,n,i){var r,o=t[0],a=o.toLowerCase();if(o!==a&&(0!==e||"M"!==o))switch(t[0]=a,o){case"V":return void(t[1]-=i);case"A":return t[6]-=n,void(t[7]-=i);default:for(r=1;r<t.length;r++)t[r]-=r%2?n:i}},!0),this},f.prototype.unarc=function(){return this.iterate(function(t,e,n,i){var r,o,a,s=[],h=t[0];return"A"!==h&&"a"!==h?null:("a"===h?(o=n+t[6],a=i+t[7]):(o=t[6],a=t[7]),r=ce(n,i,o,a,t[4],t[5],t[1],t[2],t[3]),0===r.length?[["a"===t[0]?"l":"L",t[6],t[7]]]:(r.forEach(function(t){s.push(["C",t[2],t[3],t[4],t[5],t[6],t[7]])}),s))}),this},f.prototype.unshort=function(){var s,h,u,p,l,c=this.segments;return this.iterate(function(t,e,n,i){var r,o=t[0],a=o.toUpperCase();e&&("T"===a?(r="t"===o,u=c[e-1],"Q"===u[0]?(s=u[1]-n,h=u[2]-i):"q"===u[0]?(s=u[1]-u[3],h=u[2]-u[4]):(s=0,h=0),p=-s,l=-h,r||(p+=n,l+=i),c[e]=[r?"q":"Q",p,l,t[1],t[2]]):"S"===a&&(r="s"===o,u=c[e-1],"C"===u[0]?(s=u[3]-n,h=u[4]-i):"c"===u[0]?(s=u[3]-u[5],h=u[4]-u[6]):(s=0,h=0),p=-s,l=-h,r||(p+=n,l+=i),c[e]=[r?"c":"C",p,l,t[1],t[2],t[3],t[4]]))}),this};var ye,ve=f,me={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},_e=/([astvzqmhlc])([^astvzqmhlc]*)/gi,de=function(t){var r=[];return t.replace(_e,function(t,e,n){var i=e.toLowerCase();for(n=g(n),"m"===i&&n.length>2&&(r.push([e].concat(n.splice(0,2))),i="l",e="m"===e?"l":"L");n.length>=0;){if(n.length===me[i])return n.unshift(e),r.push(n);if(n.length<me[i])throw new Error("malformed path data");r.push([e].concat(n.splice(0,me[i])))}}),r},xe=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,Pe=function(t,e,n,i,r,o,a,s){return new y(t,e,n,i,r,o,a,s)};y.prototype={constructor:y,init:function(){this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y])},getTotalLength:function(){return this.length},getPointAtLength:function(t){var e=_(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]);return this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e)},getTangentAtLength:function(t){var e=_(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),n=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),i=Math.sqrt(n.x*n.x+n.y*n.y);return i>0?{x:n.x/i,y:n.y/i}:{x:0,y:0}},getPropertiesAtLength:function(t){var e,n=_(t,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),i=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n),r=Math.sqrt(i.x*i.x+i.y*i.y);e=r>0?{x:i.x/r,y:i.y/r}:{x:0,y:0};var o=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],n);return{x:o.x,y:o.y,tangentX:e.x,tangentY:e.y}}};var Me=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],be=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],we=[[1],[1,1],[1,2,1],[1,3,3,1]],Oe=2*Math.PI,Le=function(t,e,a,s,n,i,r,o,h){var u=Math.sin(n*Oe/360),p=Math.cos(n*Oe/360),l=p*(t-o)/2+u*(e-h)/2,c=-u*(t-o)/2+p*(e-h)/2;if(0===l&&0===c)return[];if(0===a||0===s)return[];a=Math.abs(a),s=Math.abs(s);var f=l*l/(a*a)+c*c/(s*s);f>1&&(a*=Math.sqrt(f),s*=Math.sqrt(f));var g=I(t,e,o,h,i,r,a,s,u,p),y=[],v=g[2],m=g[3],_=Math.max(Math.ceil(Math.abs(m)/(Oe/4)),1);m/=_;for(var d=0;d<_;d++)y.push(S(v,m)),v+=m;return y.map(function(t){for(var e=0;e<t.length;e+=2){var n=t[e+0],i=t[e+1];n*=a,i*=s;var r=p*n-u*i,o=u*n+p*i;t[e+0]=r+g[0],t[e+1]=o+g[1]}return t})},Ae=function(t,e,n,i,r,o,a,s,h){return new T(t,e,n,i,r,o,a,s,h)};T.prototype={constructor:T,init:function(){},getTotalLength:function(){return this.length},getPointAtLength:function(t){var e=this;t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var i=0,r=0;r<n;r++)i+=e.partialLengths[r];return this.curves[n].getPointAtLength(t-i)},getTangentAtLength:function(t){var e=this;t<0?t=0:t>this.length&&(t=this.length);for(var n=this.partialLengths.length-1;this.partialLengths[n]>=t&&this.partialLengths[n]>0;)n--;n<this.partialLengths.length-1&&n++;for(var i=0,r=0;r<n;r++)i+=e.partialLengths[r];return this.curves[n].getTangentAtLength(t-i)},getPropertiesAtLength:function(t){var e=this.getTangentAtLength(t),n=this.getPointAtLength(t);return{x:n.x,y:n.y,tangentX:e.x,tangentY:e.y}}};var ke=function(t,e,n,i){return new F(t,e,n,i)};F.prototype.getTotalLength=function(){return Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2))},F.prototype.getPointAtLength=function(t){var e=t/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),n=(this.x1-this.x0)*e,i=(this.y1-this.y0)*e;return{x:this.x0+n,y:this.y0+i}},F.prototype.getTangentAtLength=function(){var t=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/t,y:(this.y1-this.y0)/t}},F.prototype.getPropertiesAtLength=function(t){var e=this.getPointAtLength(t),n=this.getTangentAtLength();return{x:e.x,y:e.y,tangentX:n.x,tangentY:n.y}};var Ce=function(t){function a(t){if(!t)return null;for(var e,n=de(t),i=[0,0],r=[0,0],o=0;o<n.length;o++)"M"===n[o][0]?(i=[n[o][1],n[o][2]],u.push(null)):"m"===n[o][0]?(i=[n[o][1]+i[0],n[o][2]+i[1]],u.push(null)):"L"===n[o][0]?(s+=Math.sqrt(Math.pow(i[0]-n[o][1],2)+Math.pow(i[1]-n[o][2],2)),u.push(new ke(i[0],n[o][1],i[1],n[o][2])),i=[n[o][1],n[o][2]]):"l"===n[o][0]?(s+=Math.sqrt(Math.pow(n[o][1],2)+Math.pow(n[o][2],2)),u.push(new ke(i[0],n[o][1]+i[0],i[1],n[o][2]+i[1])),i=[n[o][1]+i[0],n[o][2]+i[1]]):"H"===n[o][0]?(s+=Math.abs(i[0]-n[o][1]),u.push(new ke(i[0],n[o][1],i[1],i[1])),i[0]=n[o][1]):"h"===n[o][0]?(s+=Math.abs(n[o][1]),u.push(new ke(i[0],i[0]+n[o][1],i[1],i[1])),i[0]=n[o][1]+i[0]):"V"===n[o][0]?(s+=Math.abs(i[1]-n[o][1]),u.push(new ke(i[0],i[0],i[1],n[o][1])),i[1]=n[o][1]):"v"===n[o][0]?(s+=Math.abs(n[o][1]),u.push(new ke(i[0],i[0],i[1],i[1]+n[o][1])),i[1]=n[o][1]+i[1]):"z"===n[o][0]||"Z"===n[o][0]?(s+=Math.sqrt(Math.pow(n[0][1]-i[0],2)+Math.pow(n[0][2]-i[1],2)),u.push(new ke(i[0],n[0][1],i[1],n[0][2])),i=[n[0][1],n[0][2]]):"C"===n[o][0]?(e=new Pe(i[0],i[1],n[o][1],n[o][2],n[o][3],n[o][4],n[o][5],n[o][6]),s+=e.getTotalLength(),i=[n[o][5],n[o][6]],u.push(e)):"c"===n[o][0]?(e=new Pe(i[0],i[1],i[0]+n[o][1],i[1]+n[o][2],i[0]+n[o][3],i[1]+n[o][4],i[0]+n[o][5],i[1]+n[o][6]),s+=e.getTotalLength(),i=[n[o][5]+i[0],n[o][6]+i[1]],u.push(e)):"S"===n[o][0]?(e=o>0&&["C","c","S","s"].indexOf(n[o-1][0])>-1?new Pe(i[0],i[1],2*i[0]-n[o-1][n[o-1].length-4],2*i[1]-n[o-1][n[o-1].length-3],n[o][1],n[o][2],n[o][3],n[o][4]):new Pe(i[0],i[1],i[0],i[1],n[o][1],n[o][2],n[o][3],n[o][4]),s+=e.getTotalLength(),i=[n[o][3],n[o][4]],u.push(e)):"s"===n[o][0]?(e=o>0&&["C","c","S","s"].indexOf(n[o-1][0])>-1?new Pe(i[0],i[1],i[0]+e.d.x-e.c.x,i[1]+e.d.y-e.c.y,i[0]+n[o][1],i[1]+n[o][2],i[0]+n[o][3],i[1]+n[o][4]):new Pe(i[0],i[1],i[0],i[1],i[0]+n[o][1],i[1]+n[o][2],i[0]+n[o][3],i[1]+n[o][4]),s+=e.getTotalLength(),i=[n[o][3]+i[0],n[o][4]+i[1]],u.push(e)):"Q"===n[o][0]?(e=new Pe(i[0],i[1],n[o][1],n[o][2],n[o][3],n[o][4]),s+=e.getTotalLength(),u.push(e),i=[n[o][3],n[o][4]],r=[n[o][1],n[o][2]]):"q"===n[o][0]?(e=new Pe(i[0],i[1],i[0]+n[o][1],i[1]+n[o][2],i[0]+n[o][3],i[1]+n[o][4]),s+=e.getTotalLength(),r=[i[0]+n[o][1],i[1]+n[o][2]],i=[n[o][3]+i[0],n[o][4]+i[1]],u.push(e)):"T"===n[o][0]?(e=o>0&&["Q","q","T","t"].indexOf(n[o-1][0])>-1?new Pe(i[0],i[1],2*i[0]-r[0],2*i[1]-r[1],n[o][1],n[o][2]):new ke(i[0],n[o][1],i[1],n[o][2]),u.push(e),s+=e.getTotalLength(),r=[2*i[0]-r[0],2*i[1]-r[1]],i=[n[o][1],n[o][2]]):"t"===n[o][0]?(e=o>0&&["Q","q","T","t"].indexOf(n[o-1][0])>-1?new Pe(i[0],i[1],2*i[0]-r[0],2*i[1]-r[1],i[0]+n[o][1],i[1]+n[o][2]):new ke(i[0],i[0]+n[o][1],i[1],i[1]+n[o][2]),s+=e.getTotalLength(),r=[2*i[0]-r[0],2*i[1]-r[1]],i=[n[o][1]+i[0],n[o][2]+i[0]],u.push(e)):"A"===n[o][0]?(e=new Ae(i[0],i[1],n[o][1],n[o][2],n[o][3],n[o][4],n[o][5],n[o][6],n[o][7]),s+=e.getTotalLength(),i=[n[o][6],n[o][7]],u.push(e)):"a"===n[o][0]&&(e=new Ae(i[0],i[1],n[o][1],n[o][2],n[o][3],n[o][4],n[o][5],i[0]+n[o][6],i[1]+n[o][7]),s+=e.getTotalLength(),i=[i[0]+n[o][6],i[1]+n[o][7]],u.push(e)),h.push(s);return a}var s=0,h=[],u=[];a.getTotalLength=function(){return s},a.getPointAtLength=function(t){var e=n(t);return u[e.i].getPointAtLength(e.fraction)},a.getTangentAtLength=function(t){var e=n(t);return u[e.i].getTangentAtLength(e.fraction)},a.getPropertiesAtLength=function(t){var e=n(t);return u[e.i].getPropertiesAtLength(e.fraction)};var n=function(t){t<0?t=0:t>s&&(t=s);for(var e=h.length-1;h[e]>=t&&h[e]>0;)e--;return e++,{fraction:t-h[e-1],i:e}};return a(t)},Ie='All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).\nExample valid ways of supplying a shape would be:\n[[0, 0], [10, 0], [10, 10]]\n"M0,0 L10,0 L10,10Z"\n',Se="flubber.all() expects two arrays of equal length as arguments. Each element in both arrays should be an array of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).",Te=function(r,t){for(var e,o,n,a=r.length,s=1/0,i=0;i<a;i++)!function(i){o=0,t.forEach(function(t,e){var n=q(r[(i+e)%a],t);o+=n*n}),o<s&&(s=o,e=i)}(i);e&&(n=r.splice(0,e),r.splice.apply(r,[r.length,0].concat(n)))},Fe=function(e,n,t){void 0===t&&(t={});var i=t.maxSegmentLength;void 0===i&&(i=10);var r=t.string;void 0===r&&(r=!0);var o=$(e,i),a=$(n,i),s=tt(o,a,r);return!r||"string"!=typeof e&&"string"!=typeof n?s:function(t){return t<1e-4&&"string"==typeof e?e:1-t<1e-4&&"string"==typeof n?n:s(t)}},qe=et;et.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,a=Math.abs(Ct(t,0,o,n));if(r)for(var s=0,h=e.length;s<h;s++){var u=e[s]*n,p=s<h-1?e[s+1]*n:t.length;a-=Math.abs(Ct(t,u,p,n))}var l=0;for(s=0;s<i.length;s+=3){var c=i[s]*n,f=i[s+1]*n,g=i[s+2]*n;l+=Math.abs((t[c]-t[g])*(t[f+1]-t[c+1])-(t[c]-t[f])*(t[g+1]-t[c+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},et.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[r][o][a]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n};var Ee=function(t){return t},De=function(t){if(null==t)return Ee;var o,a,s=t.scale[0],h=t.scale[1],u=t.translate[0],p=t.translate[1];return function(t,e){e||(o=a=0);var n=2,i=t.length,r=new Array(i);for(r[0]=(o+=t[0])*s+u,r[1]=(a+=t[1])*h+p;n<i;)r[n]=t[n],++n;return r}},je=function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n},Ge=function(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return It(e,t)})}:It(e,t)},Ze=function(r,o){function h(t){var e,n=r.arcs[t<0?~t:t],i=n[0];return r.transform?(e=[0,0],n.forEach(function(t){e[0]+=t[0],e[1]+=t[1]})):e=n[n.length-1],t<0?[e,i]:[i,e]}function t(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){a[t<0?~t:t]=1}),s.push(i)}}var a={},u={},p={},s=[],l=-1;return o.forEach(function(t,e){var n,i=r.arcs[t<0?~t:t];i.length<3&&!i[1][0]&&!i[1][1]&&(n=o[++l],o[l]=t,o[e]=n)}),o.forEach(function(t){var e,n,i=h(t),r=i[0],o=i[1];if(e=p[r])if(delete p[e.end],e.push(t),e.end=o,n=u[o]){delete u[n.start];var a=n===e?e:e.concat(n);u[a.start=e.start]=p[a.end=n.end]=a}else u[e.start]=p[e.end]=e;else if(e=u[o])if(delete u[e.start],e.unshift(t),e.start=r,n=p[r]){delete p[n.end];var s=n===e?e:n.concat(e);u[s.start=n.start]=p[s.end=e.end]=s}else u[e.start]=p[e.end]=e;else e=[t],u[e.start=r]=p[e.end=o]=e}),t(p,u),t(u,p),o.forEach(function(t){a[t<0?~t:t]||s.push([t])}),s},Be=function(t,e){for(var n=0,i=t.length;n<i;){var r=n+i>>>1;t[r]<e?n=r+1:i=r}return n},ze=function(t){function n(t,n){t.forEach(function(t){t<0&&(t=~t);var e=o[t];e?e.push(n):o[t]=[n]})}function i(t,e){t.forEach(function(t){n(t,e)})}function r(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){r(t,e)}):t.type in a&&a[t.type](t.arcs,e)}var o={},e=t.map(function(){return[]}),a={LineString:n,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach(function(t){i(t,e)})}};t.forEach(r);for(var s in o)for(var h=o[s],u=h.length,p=0;p<u;++p)for(var l=p+1;l<u;++l){var c,f=h[p],g=h[l];(c=e[f])[s=Be(c,g)]!==g&&c.splice(s,0,g),(c=e[g])[s=Be(c,f)]!==f&&c.splice(s,0,f)}return e},He=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Ve=function(o){return 1===o.length&&(o=qt(o)),{left:function(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var r=n+i>>>1;o(t[r],e)<0?n=r+1:i=r}return n},right:function(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var r=n+i>>>1;o(t[r],e)>0?i=r:n=r+1}return n}}},Ne=Ve(He),Re=function(t,e){return Dt(Et(jt(t),t),e)},Qe=function(t,n){if(t.length>8)return t.map(function(t,e){return e});var e=t.map(function(e){return n.map(function(t){return Zt(e,t)})});return Gt(t,n,e)};t.interpolate=Fe,t.separate=Bt,t.combine=zt,t.interpolateAll=Ht,t.splitPathString=R,t.toPathString=N,t.fromCircle=Nt,t.toCircle=Rt,t.fromRect=Qt,t.toRect=Jt,Object.defineProperty(t,"__esModule",{value:!0})}(t)}((E={exports:{}},E.exports)),E.exports),G=(D=j)&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D,Z=(B.prototype.interpolate=function(t){return this._constantPositions?this._constantPositions:this._interpolator(t)},B);function B(t,n){var i=!0;t.length!==n.length&&(i=!1),i&&t.forEach(function(t,e){i=i&&x.data.Position.areEqual(t,n[e])}),i?this._constantPositions=n:this._interpolator=G.interpolate(t,n,{string:!1})}var z=(H.prototype.interpolate=function(t){var e=this._fromGeometry,n=this._toGeometry;if(this._areSame)return n;if(0===t)return e;if(1===t)return n;var i=this._runInterpolators(t),r={type:n.type};switch(n.type){case"Point":"LineString"===e.type||"MultiPoint"===e.type?r={type:e.type,coordinates:this._sampleMultiPoint(i,e.coordinates.length)}:"Polygon"===e.type||"MultiLineString"===e.type?r={type:e.type,coordinates:i}:r.coordinates=i[0][0];break;case"LineString":if("Polygon"===e.type&&e.coordinates.length>n.coordinates.length)for(var o=Math.floor(i[0].length/(n.coordinates.length-1));0<=o;o--)i[0].pop();r.coordinates=i[0];break;case"MultiPoint":"Point"===e.type?r.coordinates=this._sampleMultiPoint(i,n.coordinates.length):"MultiPoint"!==e.type?r={type:e.type,coordinates:"LineString"===e.type?i[0]:i}:r.coordinates=i[0];break;case"Polygon":case"MultiLineString":r.coordinates=i}return r},H.prototype._initInterpolators=function(){var t=this._fromGeometry,e=this._toGeometry;if(!this._areSame&&t&&0<t.coordinates.length&&e&&0<e.coordinates.length){var n=[],i=[];switch(t.type){case"Point":var r=t.coordinates;n=[[r,r,r]];break;case"LineString":case"MultiPoint":n=[t.coordinates];break;case"Polygon":case"MultiLineString":n="number"==typeof t.coordinates[0]?[t.coordinates]:t.coordinates}switch(e.type){case"Point":var o=e.coordinates;i=[[o,o,o]];break;case"LineString":case"MultiPoint":i=[e.coordinates];break;case"Polygon":case"MultiLineString":i="number"==typeof e.coordinates[0]?[e.coordinates]:e.coordinates}var a=void 0,s=i.length;if(n.length<i.length)for(a=n.length;a<s;a++)n.push([n[0][0],n[0][0],n[0][0]]);for(a=0;a<s;a++)this._interpolators.push(new Z(n[a],i[a]))}},H.prototype._runInterpolators=function(t){for(var e=[],n=this._interpolators,i=0;i<n.length;i++)e.push(n[i].interpolate(t));return e},H.prototype._sampleMultiPoint=function(t,e){for(var n=Math.min(Math.ceil(t[0].length/e),e),i=[],r=0;r<e;r++)i.push(t[0][r*n]);return i},H);function H(t,e){if(this._interpolators=[],this._areSame=!1,"MultiPolygon"===t.type)throw"Only simple geometries supported.";this._fromGeometry=t,this._toGeometry=e,this._areSame=this._fromGeometry.type===this._toGeometry.type&&JSON.parse(JSON.stringify(this._fromGeometry.coordinates))===JSON.parse(JSON.stringify(this._toGeometry.coordinates)),this._initInterpolators()}var V=(N.prototype.interpolate=function(e){if(0===e)return this._fromGeometry;if(1===e)return this._toGeometry;if("MultiPolygon"===this._toGeometry.type){var n=[];return this._interpolators.forEach(function(t){n.push(t.interpolate(e).coordinates)}),{type:"MultiPolygon",coordinates:n}}if("GeometryCollection"!==this._toGeometry.type)return this._interpolators[0].interpolate(e);var i=[];return this._interpolators.forEach(function(t){i.push(t.interpolate(e))}),{type:"GeometryCollection",geometries:i}},N.prototype._initInterpolators=function(){var t=[],e=[];if(this.extractGeometries(this._fromGeometry,t),this.extractGeometries(this._toGeometry,e),t.length<e.length&&0<t.length){var n=x.data.BoundingBox.getCenter(x.data.BoundingBox.fromData(t[0])),i={type:t[0].type,coordinates:[]};switch(t[0].type){case"Point":i.coordinates=n;break;case"LineString":case"MultiPoint":i.coordinates=[n,n];break;case"MultiLineString":case"Polygon":i.coordinates=[[n,n,n]]}for(var r=t.length,o=e.length;r<o;r++)t.push(i)}for(r=0;r<e.length;r++)this._interpolators.push(new z(t[r],e[r]))},N.prototype.extractGeometries=function(t,e){var n=this;switch(t.type){case"MultiPolygon":t.coordinates.forEach(function(t){e.push({type:"Polygon",coordinates:t})});break;case"GeometryCollection":t.geometries.forEach(function(t){n.extractGeometries(t,e)});break;default:e.push(t)}},N);function N(t,e){this._interpolators=[],this._fromGeometry=t,this._toGeometry=e,this._initInterpolators()}var R,Q=(e(J,R=A),J.prototype.onAnimationProgress=function(t){var e=this._interpolator.interpolate(t),n=x.data.BoundingBox.getCenter(x.data.BoundingBox.fromData(e)),i=0;i=this._pathOptions.geodesic?this._heading:this._pixelHeading,this._pathOptions.map&&this._setMapCamera(n,i,!0);var r=this._shape;return this._pathOptions.captureMetadata&&r.addProperty("heading",i),r.isCircle()&&"Point"===e.type||(r.data.geometry.type=e.type),r.setCoordinates(e.coordinates),{position:n,heading:i}},J);function J(t,e,n){var i=R.call(this)||this;(i._shape=t).toJson().geometry;t.isCircle()&&"Point"!==e.type&&new x.data.Polygon(t.getCircleCoordinates()),i._interpolator=new V(t.toJson().geometry,e);var r=x.data.BoundingBox.getCenter(i._shape.getBounds()),o=x.data.BoundingBox.getCenter(x.data.BoundingBox.fromData(e));i._heading=x.math.getHeading(r,o);var a=x.math.mercatorPositionsToPixels([r,o],21);return i._pixelHeading=P.getPixelHeading(a[0],a[1]),n&&(i.setOptions(n),n.autoPlay&&i.play()),h.instance.add(i),i}var X=(Y.prototype.dispose=function(){h.instance.remove(this),this._id=void 0,this._delay=void 0,this._start=void 0,this._intervalCallback=void 0,this._numberOfIOntervals=void 0,this._currentInterval=void 0,this._onComplete=void 0},Y.prototype.getDuration=function(){return this._numberOfIOntervals*this._delay},Y.prototype.isPlaying=function(){return null!=this._start},Y.prototype.pause=function(){this._start=null},Y.prototype.play=function(){this._start=performance.now()},Y.prototype.reset=function(){this._start=null,this._currentInterval=0},Y.prototype.stop=function(){this._start=null,this._currentInterval=this._numberOfIOntervals},Y.prototype._onAnimationProgress=function(t){if(this._start){var e=Math.round((t-this._start)/this._delay);e!==this._currentInterval&&(this._currentInterval=e,this._intervalCallback&&setTimeout(this._intervalCallback,0,this._arguments),e>=this._numberOfIOntervals&&(this._start=null,this._onComplete&&(this._onComplete(),this.dispose())))}},Y);function Y(t,e,n){for(var i=[],r=3;r<arguments.length;r++)i[r-3]=arguments[r];this._delay=1,this._numberOfIOntervals=1/0,this._currentInterval=0,this._id=h.instance.add(this),this._intervalCallback=t,this._arguments=i,0<=e&&(this._delay=e),0<n&&(this._numberOfIOntervals=n)}var U,W=(e($,U=A),$.prototype.dispose=function(){this._route=null,this._headingIntervals=null,this._positions=null,this._timestamps=null,this._timeIntervals=null,this._totalTime=null,this._shape=null,U.prototype.dispose.call(this)},$.prototype.getDuration=function(){return void 0!==this._totalTime?this._totalTime/this._pathOptions.speedMultiplier:U.prototype.getDuration.call(this)},$.prototype.getOptions=function(){return Object.assign({},U.prototype.getOptions.call(this),{valueInterpolations:this._valueInterpolations})},$.prototype.setOptions=function(t){if(t){t.valueInterpolations&&Array.isArray(t.valueInterpolations)&&(this._positions=null,this._valueInterpolations=t.valueInterpolations),U.prototype.setOptions.call(this,t);var e=this.isPlaying();e&&this.pause(),this._positions||(this._processPath(),this._pathOptions.captureMetadata&&0<this._headingIntervals.length&&P.setMetadata(this._shape,{heading:this._headingIntervals[0],speed:this._speedIntervals[0],timestamp:this._timestamps[0]})),e&&this.play()}},$.prototype.getTimeSpan=function(){return 0<this._timestamps.length?{begin:this._timestamps[0],end:this._timestamps[this._timestamps.length-1]}:null},$.prototype.getPath=function(){return JSON.parse(JSON.stringify(this._positions))},$.prototype.onAnimationProgress=function(t){if(this._positions&&1<this._positions.length){var e={},n=0,i=void 0,r=0,o=this._shape,a=this._pathOptions,s=this._positions,h=this._headingIntervals,u=this._speedIntervals,p=this._timestamps,l=this._route;if(1===t)e={position:s[1+(n=h.length-1)],heading:h[n],speed:u[n],timestamp:p[n+1]},a.map&&this._setMapCamera(e.position,e.heading,!1),P.setCoordinates(o,e.position,s),i=l[n].properties,r=1;else if(0===t)e={position:s[n=0],heading:h[0],speed:u[0],timestamp:p[0]},a.map&&this._setMapCamera(e.position,e.heading,!1),P.setCoordinates(o,e.position,[e.position,e.position]),i=l[0].properties;else{var c=this._totalTime*t,f=null;if(c>this._totalTime)e={heading:h[n=h.length-1],speed:u[n],timestamp:p[n+1]},f=s.slice(0),i=l[n+1].properties,r=1;else if(c<0)e.heading=h[0],f=s.slice(0,1);else{var g=0,y=this._timeIntervals;for(n=0;n<h.length;n++){if(g+y[n]>=c){e.heading=h[n],e.speed=u[n],f=s.slice(0,n+1);var v=c-g,m=u[n]*v*.001;r=m/x.math.getDistanceTo(s[n],s[n+1]),e.timestamp=p[n]+v,f.push(x.math.getDestination(s[n],e.heading,m));break}g+=y[n]}}f&&0<f.length&&(e.position=f[f.length-1],a.map&&this._setMapCamera(e.position,e.heading,2<f.length),P.setCoordinates(o,e.position,f))}if(e=Object.assign(i||{},e),a.captureMetadata){var _={},d=this._valueInterpolations;d&&Array.isArray(d)&&d.forEach(function(t){P.interpolateValue(l[n],l[n+1],r,t,_)}),P.setMetadata(o,Object.assign(e,_))}return e}return null},$.prototype._processPath=function(){if(this._route){this._totalTime=0,this._positions=null;var t=[],e=[],n=[],i=[],r=[],o=this._route,a=o[0];if("Feature"!==a.type||"Point"!==a.geometry.type||"number"!=typeof a.properties._timestamp)throw"Feature is not a point or is missing a _timestamp value.";r.push(a.properties._timestamp),t.push(a.geometry.coordinates);for(var s=1,h=o.length;s<h;s++)if("Feature"===(a=o[s]).type&&"Point"===a.geometry.type&&"number"==typeof a.properties._timestamp){t.push(a.geometry.coordinates);var u=x.math.getDistanceTo(t[s-1],t[s]);r.push(a.properties._timestamp);var p=r[s]-r[s-1];i.push(p),this._totalTime+=p,n.push(u/(.001*p));var l=x.math.getHeading(t[s-1],t[s]);e.push(l)}if(o.length!==t.length)throw this.dispose(),"Unable to process all points in route.";this._headingIntervals=e,this._speedIntervals=n,this._timeIntervals=i,this._timestamps=r,this._positions=t,U.prototype.setOptions.call(this,{duration:this._totalTime})}},$);function $(t,e,n){var i=U.call(this)||this;return i._shape=e,i._route=t,i.setOptions(Object.assign({rotate:!0,rotationOffset:0},n||{})),n&&n.autoPlay&&i.play(),i}function K(t){var e=h.instance.getById(t);e&&e.stop()}function tt(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var r=new X(t,e,1,n);return r.play(),r._id}var et,nt=(e(it,et=x.internal.EventEmitter),it.prototype.dispose=function(){this.stop(),this._options=null,this._animations=null,this._onComplete=null,this._isPlaying=null,this._cancelAnimations=null},it.prototype.getDuration=function(){return this._calculateDuration()},it.prototype.getOptions=function(){return Object.assign({},this._options)},it.prototype.isPlaying=function(){return this._isPlaying},it.prototype.play=function(){switch(this._cancelAnimations=!1,this._options.playType){case"together":this._playTogether();break;case"sequential":this._playSeq();break;case"interval":this._playInterval()}},it.prototype.reset=function(){this._cancelAnimations=!0;var t=this._animations;if(t&&0<t.length)for(var e=0;e<t.length;e++)t[e].reset();this._isPlaying=!1},it.prototype.stop=function(){this._cancelAnimations=!0;var t=this._animations;if(t&&0<t.length)for(var e=0;e<t.length;e++)t[e].stop();this._isPlaying=!1},it.prototype.setOptions=function(t){if(t){var e=this._isPlaying;e&&this.stop(),t.playType&&-1!==["together","sequential","interval"].indexOf(t.playType)&&(this._options.playType=t.playType),"boolean"==typeof t.autoPlay&&(this._options.autoPlay=t.autoPlay,!e&&t.autoPlay&&(e=!0)),"number"==typeof t.interval&&(this._options.interval=0<t.interval?Math.abs(t.interval):100),this._calculateDuration(),e&&this.play()}},it.prototype._playTogether=function(){var t=this,e=this._animations;if(e&&0<e.length){this._isPlaying=!0;for(var n=0;n<e.length;n++)n===e.length-1&&(e[n]._onComplete=function(){t._isPlaying=!1,t._invokeEvent("oncomplete",null)}),e[n].play()}},it.prototype._playSeq=function(){var t=this,e=this._animations;if(e&&0<e.length){this._isPlaying=!0;var n=0,i=function(){t._isPlaying&&(0<n&&(e[n-1]._onComplete=null),!t._cancelAnimations&&n<e.length?(e[n]._onComplete=i,e[n].play(),n++):(t._isPlaying=!1,t._invokeEvent("oncomplete",null)))};i()}},it.prototype._playInterval=function(){if(this._animations&&0<this._animations.length){this._isPlaying=!0;var t=this,e=0,n=function(){t._isPlaying&&(!t._cancelAnimations&&e<t._animations.length?(e===t._animations.length-1&&(t._animations[e]._onComplete=function(){t._isPlaying&&(t._isPlaying=!1,t._invokeEvent("oncomplete",null))}),t._animations[e].play(),e++,tt(function(){n()},t._options.interval)):t._cancelAnimations&&t._isPlaying&&(t._isPlaying=!1,t._invokeEvent("oncomplete",null)))};n()}},it.prototype._calculateDuration=function(){var r=0,o=0,a=0,s=0,h=this._options,t=this._animations,u=h.interval*t.length;t.forEach(function(t,e,n){var i=t.getDuration();(o=u-e*h.interval)<i&&(r=Math.max(r,i-o)),a=Math.max(a,i),s+=i});var e=0;switch(h.playType){case"together":e=a;break;case"sequential":e=s;break;case"interval":e=r+u}return e},it);function it(t,e){var n=et.call(this)||this;return n._cancelAnimations=!1,n._isPlaying=!1,n._options={playType:"together",interval:100,autoPlay:!1},n._onComplete=function(){},n._animations=t,e?n.setOptions(e):n._calculateDuration(),n}var rt=Object.freeze({__proto__:null,FrameBasedAnimationTimer:y,GroupAnimation:nt,PlayableAnimation:l,drop:function(t,e,n,i){var r=[];if(Array.isArray(t))for(var o=0,a=t.length;o<a;o++)"Feature"===t[o].type&&"Point"===t[o].geometry.type||"Point"===t[o].type?r.push(new x.Shape(t[o])):t[o]instanceof x.Shape&&"Point"===t[o].getType()&&r.push(t[o]);else"Feature"===t.type&&"Point"===t.geometry.type||"Point"===t.type?r.push(new x.Shape(t)):t instanceof x.Shape&&"Point"===t.getType()&&r.push(t);if(0<r.length)return new w(r,e,n,i);throw"No supported shapes specified."},dropMarkers:function(t,e,n,i){var r=[];if(Array.isArray(t))for(var o=0,a=t.length;o<a;o++)t[o]instanceof x.HtmlMarker&&r.push(t[o]);else t instanceof x.HtmlMarker&&r.push(t);if(0<r.length)return new w(r,e,n,i);throw"No markers specified."},setCoordinates:function(t,e,n){var i=P.getSuitableCoordinates(t,e);if(t instanceof x.Shape){var r=t.getType();if("Point"===r)return new I(t,i,n);if("GeometryCollection"!==r)return new Q(t,{type:t.getType(),coordinates:i},n)}return new I(t,i,n)},snakeline:function(t,e){if(t&&"LineString"===t.getType())return new F(t.getCoordinates().slice(0),t,e);throw"Specified shape is not a LineString type, or no map specified."},moveAlongPath:function(t,e,n){if(e&&(e instanceof x.HtmlMarker||e instanceof x.Shape&&"Point"===e.getType())||n&&n.map){var i=void 0;if(t)if(Array.isArray(t))i=t;else if(t instanceof x.Shape){if("LineString"===t.getType())i=t.getCoordinates();else if("Polygon"===t.getType()){var r=t.getCoordinates();0<r.length&&(i=r[0])}}else"LineString"===t.type&&(i=t.coordinates);if(i.length<2)throw"Invalid path option specified.";return new F(i,e,n)}throw"Specified shape is not a Point type, or not map specified."},moveAlongRoute:function(t,e,n){if(t.length<2)throw"Invalid path option specified.";return new W(t,e,n)},extractRoutePoints:function(t,e){var n;if(e=e||"_timestamp",Array.isArray(t)){var i;n=[];for(var r=0,o=t.length;r<o;r++){var a=void 0;if(a=t[r]instanceof x.Shape?t[r].toJson():t[r],!i&&-1===["Polygon","MultiLineString","MultiPolygon","GeometryCollection"].indexOf(a.geometry.type)&&(a.properties[e]||"number"==typeof a.properties._timestamp||"Point"!==a.geometry.type&&a.properties.waypoints)&&(i=a.geometry.type),i&&(0===n.length||"Point"===a.geometry.type)){var s=this.extractRoutePoints(a,e);if(s&&(n=n.concat(s),"Point"!==i))break}}}else t instanceof x.Shape?n=P.extractRoutePointsFromFeature(t.toJson(),e):"FeatureCollection"===t.type?n=this.extractRoutePoints(t.features,e):t.type&&(n=P.extractRoutePointsFromFeature(t,e));return 0<(n=n&&n.sort(function(t,e){return t.properties._timestamp-e.properties._timestamp})).length?n:null},morph:function(t,e,n){return new Q(t,e,n)},delay:function(t,e){return new X(e,t,1)},interval:function(t,e,n){return new X(e,t,Math.max(n||1/0,1))},setInterval:function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var r=new X(t,e,1/0,n);return r.play(),r._id},clearInterval:K,setTimeout:tt,clearTimeout:function(t){K(t)},getEasingFn:function(t){return o[t]||null},getEasingNames:function(){return Object.keys(o)},flowingDashedLine:function(a,t){"round"===a.getOptions().lineCap&&a.setOptions({lineCap:"butt"});var s=t.dashLength||4,h=t.gapLength||4,u=40*s/(h+s),p=40-u;return new y(40,function(t){var e,n,i,r,o;o=t<u?(n=(1-(e=t/u))*s,i=h,r=e*s,0):(n=0,i=(1-(e=(t-u)/p))*h,r=s,e*h),a.setOptions({strokeDashArray:[n,i,r,o]})},t)}}),ot=n.merge("atlas.layer",b),at=n.merge("atlas.animations",rt);t.animations=at,t.layer=ot}(this.atlas=this.atlas||{},atlas);