first commit

This commit is contained in:
ISA
2024-04-15 10:37:53 +02:00
commit afee410333
736 changed files with 110561 additions and 0 deletions

869
public/js/vendor/bundle.js vendored Normal file
View File

@@ -0,0 +1,869 @@
(function (L) {
'use strict';
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var L__default = /*#__PURE__*/_interopDefaultLegacy(L);
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = privateMap.get(receiver);
if (!descriptor) {
throw new TypeError("attempted to get private field on non-instance");
}
if (descriptor.get) {
return descriptor.get.call(receiver);
}
return descriptor.value;
}
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = privateMap.get(receiver);
if (!descriptor) {
throw new TypeError("attempted to set private field on non-instance");
}
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
return value;
}
var BouncingOptions = /*#__PURE__*/function () {
/**
* How high marker can bounce (px)
* @type {number}
*/
/**
* How much marker can contract (px)
* @type {number}
*/
/**
* Bouncing speed coefficient
* @type {number}
*/
/**
* Contracting speed coefficient
* @type {number}
*/
/**
* Shadow inclination angle(radians); null to cancel shadow movement
* @type {number}
*/
/**
* Activate contract animation
* @type {boolean}
*/
/**
* Many markers can bounce in the same time
* @type {boolean}
*/
function BouncingOptions(options) {
_classCallCheck(this, BouncingOptions);
_defineProperty(this, "bounceHeight", 15);
_defineProperty(this, "contractHeight", 12);
_defineProperty(this, "bounceSpeed", 52);
_defineProperty(this, "contractSpeed", 52);
_defineProperty(this, "shadowAngle", -Math.PI / 4);
_defineProperty(this, "elastic", true);
_defineProperty(this, "exclusive", false);
options && Object.assign(this, options);
}
_createClass(BouncingOptions, [{
key: "override",
value: function override(options) {
return Object.assign(new BouncingOptions(this), options);
}
}]);
return BouncingOptions;
}();
var _bouncingMarkers = new WeakMap();
var Orchestration = /*#__PURE__*/function () {
function Orchestration() {
_classCallCheck(this, Orchestration);
_bouncingMarkers.set(this, {
writable: true,
value: []
});
}
_createClass(Orchestration, [{
key: "getBouncingMarkers",
value: function getBouncingMarkers() {
return _classPrivateFieldGet(this, _bouncingMarkers);
}
/**
* Adds the marker to the list of bouncing markers.
* If flag 'exclusive' is set to true, stops all bouncing markers before.
*
* @param marker {Marker} marker object
* @param exclusive {boolean} flag of exclusive bouncing. If set to true, stops the bouncing
* of all other markers.
*/
}, {
key: "addBouncingMarker",
value: function addBouncingMarker(marker, exclusive) {
if (exclusive || marker._bouncingMotion.bouncingOptions.exclusive) {
this.stopAllBouncingMarkers();
} else {
this.stopExclusiveMarkerBouncing();
}
_classPrivateFieldGet(this, _bouncingMarkers).push(marker);
}
/**
* Stops the bouncing of exclusive marker.
*/
}, {
key: "stopExclusiveMarkerBouncing",
value: function stopExclusiveMarkerBouncing() {
var exclusiveMarker = _classPrivateFieldGet(this, _bouncingMarkers).find(function (marker) {
return marker._bouncingMotion.bouncingOptions.exclusive;
});
if (exclusiveMarker) {
exclusiveMarker.stopBouncing();
}
}
/**
* Removes the marker from the list of bouncing markers.
* @param marker {Marker} marker
*/
}, {
key: "removeBouncingMarker",
value: function removeBouncingMarker(marker) {
var i = _classPrivateFieldGet(this, _bouncingMarkers).indexOf(marker);
if (~i) {
_classPrivateFieldGet(this, _bouncingMarkers).splice(i, 1);
}
}
/**
* Stops the bouncing of all currently bouncing markers. Purge the array of bouncing markers.
*/
}, {
key: "stopAllBouncingMarkers",
value: function stopAllBouncingMarkers() {
var marker;
while (marker = _classPrivateFieldGet(this, _bouncingMarkers).shift()) {
marker.stopBouncing();
}
}
}]);
return Orchestration;
}();
var oldSetPos = L.Marker.prototype._setPos;
var oldOnAdd = L.Marker.prototype.onAdd;
var oldSetIcon = L.Marker.prototype.setIcon;
var MarkerPrototypeExt = {
/** Bouncing options shared by all markers. */
_bouncingOptions: new BouncingOptions(),
_orchestration: new Orchestration(),
/**
* Registers options of bouncing animation for this marker. After registration of options for
* this marker, it will ignore changes of default options. Function automatically recalculates
* animation steps and delays.
*
* @param options {BouncingOptions|object} options object
* @return {Marker} this marker
*/
setBouncingOptions: function setBouncingOptions(options) {
this._bouncingMotion.updateBouncingOptions(options);
return this;
},
/**
* Returns true if this marker is bouncing. If this marker is not bouncing returns false.
* @return {boolean} true if marker is bouncing, false if not
*/
isBouncing: function isBouncing() {
return this._bouncingMotion.isBouncing;
},
/**
* Starts bouncing of this marker.
* @param times {number|null} number of times the marker must to bounce
* @return {Marker} this marker
*/
bounce: function bounce() {
var times = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
this._bouncingMotion.bounce(times);
var exclusive = this._bouncingMotion.bouncingOptions.exclusive;
L.Marker.prototype._orchestration.addBouncingMarker(this, exclusive);
return this;
},
/**
* Stops bouncing of this marker.
* Note: the bouncing not stops immediately after the call of this method.
* Instead, the animation is executed until marker returns to it's original position and takes
* it's full size.
*
* @return {Marker} this marker
*/
stopBouncing: function stopBouncing() {
this._bouncingMotion.stopBouncing();
L.Marker.prototype._orchestration.removeBouncingMarker(this);
return this;
},
/**
* Starts/stops bouncing of this marker.
* @return {Marker} marker
*/
toggleBouncing: function toggleBouncing() {
if (this._bouncingMotion.isBouncing) {
this.stopBouncing();
} else {
this.bounce();
}
return this;
},
isRealMarker: function isRealMarker() {
return this.__proto__ === L.Marker.prototype;
},
_setPos: function _setPos(position) {
oldSetPos.call(this, position);
if (this.isRealMarker()) {
this._bouncingMotion.position = position;
this._bouncingMotion.resetStyles(this);
}
},
onAdd: function onAdd(map) {
oldOnAdd.call(this, map);
if (this.isRealMarker()) {
this._bouncingMotion.resetStyles(this);
}
},
setIcon: function setIcon(icon) {
oldSetIcon.call(this, icon);
if (this.isRealMarker()) {
this._bouncingMotion.resetStyles(this);
}
}
};
/**
* Calculates the points to draw the continous line on the screen. Returns the array of ordered
* point coordinates. Uses Bresenham algorithm.
*
* @param x {number} x coordinate of origin
* @param y {number} y coordinate of origin
* @param angle {number} angle (radians)
* @param length {number} length of line (px)
*
* @return {[number, number][]} array of ordered point coordinates
*
* @see http://rosettacode.org/wiki/Bitmap/Bresenham's_line_algorithm#JavaScript
*/
function calculateLine(x, y, angle, length) {
// TODO: use something else than multiply length by 2 to calculate the line with defined
// length
var xD = Math.round(x + Math.cos(angle) * (length * 2)),
yD = Math.round(y + Math.sin(angle) * (length * 2)),
dx = Math.abs(xD - x),
sx = x < xD ? 1 : -1,
dy = Math.abs(yD - y),
sy = y < yD ? 1 : -1,
err = (dx > dy ? dx : -dy) / 2,
e2,
p = [],
i = 0;
while (true) {
p.push([x, y]);
i++;
if (i === length) break;
e2 = err;
if (e2 > -dx) {
err -= dy;
x += sx;
}
if (e2 < dy) {
err += dx;
y += sy;
}
}
return p;
}
function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
if (!css || typeof document === 'undefined') { return; }
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
var css_248z = "@keyframes l-smooth-marker-bouncing-move {\n from {\n transform: translate(var(--pos-x), var(--pos-y))\n }\n to {\n transform: translate(var(--pos-x-jump, var(--pos-x)), var(--pos-y-jump))\n }\n}\n\n@keyframes l-smooth-marker-bouncing-contract {\n from {\n transform: translate(var(--pos-x), var(--pos-y))\n }\n to {\n transform: translate(var(--pos-x), var(--pos-y-contract)) scaleY(var(--scale-contract))\n }\n}\n\n.bouncing {\n animation-name: l-smooth-marker-bouncing-move, l-smooth-marker-bouncing-move, l-smooth-marker-bouncing-contract, l-smooth-marker-bouncing-contract;\n animation-direction: normal, reverse, normal, reverse;\n animation-duration: var(--duration-jump), var(--duration-jump), var(--duration-contract), var(--duration-contract);\n animation-delay: var(--delays)\n}\n\n.bouncing.simple {\n animation-name: l-smooth-marker-bouncing-move, l-smooth-marker-bouncing-move;\n animation-direction: normal, reverse;\n animation-duration: var(--duration-jump), var(--duration-jump);\n animation-delay: var(--delays)\n}\n";
styleInject(css_248z);
/** Regex to parse style definitions. */
var regStyle = /([\w-]+): ([^;]+);/g;
var Styles = /*#__PURE__*/function () {
function Styles(styles) {
_classCallCheck(this, Styles);
styles && Object.assign(this, styles);
}
_createClass(Styles, [{
key: "findOpacity",
value: function findOpacity(options) {
this.opacity = (options === null || options === void 0 ? void 0 : options.opacityWhenUnclustered // used by cluster plugin
) || (options === null || options === void 0 ? void 0 : options.opacity) || 1;
}
/**
* Creates a copy of styles merged with provided 'styles'.
* @param {Object} styles object with styles to merge
* @return {Styles} copy of styles
*/
}, {
key: "withStyles",
value: function withStyles(styles) {
var copy = new Styles(this);
copy && Object.assign(copy, styles);
return copy;
}
}, {
key: "toString",
value: function toString() {
return Object.entries(this).map(function (entry) {
return "".concat(entry[0], ": ").concat(entry[1], ";");
}).join(' ');
}
/**
* Parses cssText attribute into Styles object.
* @param cssText {string} cssText string
* @return {Styles} Styles object
*/
}], [{
key: "parse",
value: function parse(cssText) {
var styles = {};
var match = regStyle.exec(cssText);
while (match) {
styles[match[1]] = match[2];
match = regStyle.exec(cssText);
}
delete styles['z-index'];
delete styles['opacity'];
styles['outline'] = 'none';
return new Styles(styles);
}
/**
* @param marker {Marker}
*/
}, {
key: "ofMarker",
value: function ofMarker(marker) {
var styles = Styles.parse(marker._icon.style.cssText);
styles.findOpacity(marker.options);
styles['z-index'] = marker._zIndex;
return styles;
}
}]);
return Styles;
}();
var animationNamePrefix = 'l-smooth-marker-bouncing-';
var moveAnimationName = animationNamePrefix + 'move';
var contractAnimationName = animationNamePrefix + 'contract';
/*
* CSS3 animation runs faster than transform-based animation. We need to reduce speed in order
* to be compatible with old API.
*/
var speedCoefficient = 0.8;
/**
* Removes and then resets required classes on the HTML element.
* Used as hack to restart CSS3 animation.
*
* @param element {HTMLElement} HTML element
* @param classes {string[]} names of classes
*/
function resetClasses(element, classes) {
classes.forEach(function (className) {
return L.DomUtil.removeClass(element, className);
});
void element.offsetWidth;
classes.forEach(function (className) {
return L.DomUtil.addClass(element, className);
});
}
var _lastAnimationName = new WeakMap();
var _classes = new WeakMap();
var _eventCounter = new WeakMap();
var _times = new WeakMap();
var _listener = new WeakMap();
var BouncingMotionCss3 = /*#__PURE__*/function () {
/**
* Constructor.
*
* @param marker {Marker} marker
* @param position {Point} marker current position on the map canvas
* @param bouncingOptions {BouncingOptions} options of bouncing animation
*/
function BouncingMotionCss3(marker, position, bouncingOptions) {
var _this = this;
_classCallCheck(this, BouncingMotionCss3);
_defineProperty(this, "marker", void 0);
_defineProperty(this, "position", void 0);
_defineProperty(this, "bouncingOptions", void 0);
_defineProperty(this, "isBouncing", false);
_defineProperty(this, "iconStyles", void 0);
_defineProperty(this, "shadowStyles", void 0);
_defineProperty(this, "bouncingAnimationPlaying", false);
_lastAnimationName.set(this, {
writable: true,
value: contractAnimationName
});
_classes.set(this, {
writable: true,
value: ['bouncing']
});
_eventCounter.set(this, {
writable: true,
value: void 0
});
_times.set(this, {
writable: true,
value: void 0
});
_listener.set(this, {
writable: true,
value: function value(event) {
return _this.onAnimationEnd(event);
}
});
this.marker = marker;
this.position = position;
this.updateBouncingOptions(bouncingOptions);
}
_createClass(BouncingMotionCss3, [{
key: "updateBouncingOptions",
value: function updateBouncingOptions(options) {
this.bouncingOptions = options instanceof BouncingOptions ? options : this.bouncingOptions.override(options);
if (!this.bouncingOptions.elastic) {
_classPrivateFieldSet(this, _lastAnimationName, moveAnimationName);
_classPrivateFieldGet(this, _classes).push('simple');
}
}
}, {
key: "onAnimationEnd",
value: function onAnimationEnd(event) {
var _this2 = this;
if (event.animationName === _classPrivateFieldGet(this, _lastAnimationName)) {
var _this$eventCounter;
_classPrivateFieldSet(this, _eventCounter, (_this$eventCounter = +_classPrivateFieldGet(this, _eventCounter)) + 1), _this$eventCounter;
_classPrivateFieldSet(this, _eventCounter, _classPrivateFieldGet(this, _eventCounter) % 2);
if (!_classPrivateFieldGet(this, _eventCounter)) {
if (this.isBouncing && (_classPrivateFieldGet(this, _times) === null || _classPrivateFieldSet(this, _times, +_classPrivateFieldGet(this, _times) - 1))) {
resetClasses(this.marker._icon, _classPrivateFieldGet(this, _classes));
if (this.marker._shadow) {
resetClasses(this.marker._shadow, _classPrivateFieldGet(this, _classes));
}
} else {
_classPrivateFieldGet(this, _classes).forEach(function (className) {
L.DomUtil.removeClass(_this2.marker._icon, className);
if (_this2.marker._shadow) {
L.DomUtil.removeClass(_this2.marker._shadow, className);
}
});
this.bouncingAnimationPlaying = false;
}
}
}
}
}, {
key: "resetStyles",
value: function resetStyles(marker) {
var _this$marker$getIcon, _this$marker$getIcon$, _this$marker, _this$marker$_iconObj, _this$marker$_iconObj2;
this.marker = marker;
this.iconStyles = Styles.ofMarker(marker);
if (marker._shadow) {
this.shadowStyles = Styles.parse(marker._shadow.style.cssText);
}
var iconHeight = ((_this$marker$getIcon = this.marker.getIcon()) === null || _this$marker$getIcon === void 0 ? void 0 : (_this$marker$getIcon$ = _this$marker$getIcon.options) === null || _this$marker$getIcon$ === void 0 ? void 0 : _this$marker$getIcon$.iconSize[1]) || ((_this$marker = this.marker) === null || _this$marker === void 0 ? void 0 : (_this$marker$_iconObj = _this$marker._iconObj) === null || _this$marker$_iconObj === void 0 ? void 0 : (_this$marker$_iconObj2 = _this$marker$_iconObj.options) === null || _this$marker$_iconObj2 === void 0 ? void 0 : _this$marker$_iconObj2.iconSize[1]);
var iconAnimationParams = BouncingMotionCss3.animationParams(this.position, this.bouncingOptions, iconHeight);
this.iconStyles = this.iconStyles.withStyles(iconAnimationParams);
this.marker._icon.style.cssText = this.iconStyles.toString();
if (this.bouncingAnimationPlaying) {
resetClasses(this.marker._icon, _classPrivateFieldGet(this, _classes));
this.marker._icon.addEventListener('animationend', _classPrivateFieldGet(this, _listener));
}
var _this$bouncingOptions = this.bouncingOptions,
bounceHeight = _this$bouncingOptions.bounceHeight,
contractHeight = _this$bouncingOptions.contractHeight,
shadowAngle = _this$bouncingOptions.shadowAngle;
if (this.marker._shadow && shadowAngle) {
var _this$marker$getIcon2, _this$marker$getIcon3;
var _this$position = this.position,
x = _this$position.x,
y = _this$position.y;
var points = calculateLine(x, y, shadowAngle, bounceHeight + 1);
var _points$bounceHeight = _slicedToArray(points[bounceHeight], 2),
posXJump = _points$bounceHeight[0],
posYJump = _points$bounceHeight[1];
var shadowHeight = (_this$marker$getIcon2 = this.marker.getIcon()) === null || _this$marker$getIcon2 === void 0 ? void 0 : (_this$marker$getIcon3 = _this$marker$getIcon2.options) === null || _this$marker$getIcon3 === void 0 ? void 0 : _this$marker$getIcon3.shadowSize[1];
var shadowScaleContract = BouncingMotionCss3.contractScale(shadowHeight, contractHeight);
this.shadowStyles = this.shadowStyles.withStyles(iconAnimationParams).withStyles({
'--pos-x-jump': "".concat(posXJump, "px"),
'--pos-y-jump': "".concat(posYJump, "px"),
'--scale-contract': shadowScaleContract
});
this.marker._shadow.style.cssText = this.shadowStyles.toString();
if (this.bouncingAnimationPlaying) {
resetClasses(this.marker._shadow, _classPrivateFieldGet(this, _classes));
}
}
}
}, {
key: "bounce",
value: function bounce() {
var times = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
_classPrivateFieldSet(this, _times, times);
_classPrivateFieldSet(this, _eventCounter, 0);
this.isBouncing = true;
if (this.bouncingAnimationPlaying) {
return;
}
this.bouncingAnimationPlaying = true;
resetClasses(this.marker._icon, _classPrivateFieldGet(this, _classes));
if (this.marker._shadow) {
resetClasses(this.marker._shadow, _classPrivateFieldGet(this, _classes));
}
this.marker._icon.addEventListener('animationend', _classPrivateFieldGet(this, _listener));
}
}, {
key: "stopBouncing",
value: function stopBouncing() {
this.isBouncing = false;
}
/**
* Calculates parameters of CSS3 animation of bouncing.
*
* @param position {Point} marker current position on the map canvas
* @param bouncingOptions {BouncingOptions} options of bouncing animation
* @param height {number} icons height
* @return {object} CSS3 animation parameters
*/
}], [{
key: "animationParams",
value: function animationParams(position, bouncingOptions, height) {
var x = position.x,
y = position.y;
var bounceHeight = bouncingOptions.bounceHeight,
contractHeight = bouncingOptions.contractHeight,
bounceSpeed = bouncingOptions.bounceSpeed,
contractSpeed = bouncingOptions.contractSpeed;
var scaleContract = BouncingMotionCss3.contractScale(height, contractHeight);
var durationJump = BouncingMotionCss3.calculateDuration(bounceHeight, bounceSpeed);
var durationContract = BouncingMotionCss3.calculateDuration(contractHeight, contractSpeed);
var delays = [0, durationJump, durationJump * 2, durationJump * 2 + durationContract];
return {
'--pos-x': "".concat(x, "px"),
'--pos-y': "".concat(y, "px"),
'--pos-y-jump': "".concat(y - bounceHeight, "px"),
'--pos-y-contract': "".concat(y + contractHeight, "px"),
'--scale-contract': scaleContract,
'--duration-jump': "".concat(durationJump, "ms"),
'--duration-contract': "".concat(durationContract, "ms"),
'--delays': "0ms, ".concat(delays[1], "ms, ").concat(delays[2], "ms, ").concat(delays[3], "ms")
};
}
/**
* Calculates scale of contracting.
*
* @param {number} height original height
* @param {number} contractHeight how much it must contract
* @return {number} contracting scale between 0 and 1
*/
}, {
key: "contractScale",
value: function contractScale(height, contractHeight) {
return (height - contractHeight) / height;
}
/**
* Calculates duration of animation.
*
* @param height {number} height of movement or resizing (px)
* @param speed {number} speed coefficient
*
* @return {number} duration of animation (ms)
*/
}, {
key: "calculateDuration",
value: function calculateDuration(height, speed) {
var duration = Math.round(speed * speedCoefficient);
var i = height;
while (--i) {
duration += Math.round(speed / (height - i));
}
return duration;
}
}]);
return BouncingMotionCss3;
}();
L__default['default'].Marker.include(MarkerPrototypeExt);
/**
* Registers default options of bouncing animation.
* @param options {BouncingOptions|object} object with options
*/
L__default['default'].Marker.setBouncingOptions = function (options) {
L.Marker.prototype._bouncingOptions = options instanceof BouncingOptions ? options : new BouncingOptions(options);
};
/**
* Returns array of currently bouncing markers.
* @return {Marker[]} array of bouncing markers
*/
L__default['default'].Marker.getBouncingMarkers = function () {
L.Marker.prototype._orchestration.getBouncingMarkers();
};
/**
* Stops the bouncing of all currently bouncing markers. Purge the array of bouncing markers.
*/
L__default['default'].Marker.stopAllBouncingMarkers = function () {
L.Marker.prototype._orchestration.stopAllBouncingMarkers();
};
L__default['default'].Marker.addInitHook(function () {
if (this.isRealMarker()) {
var bouncingOptions = new BouncingOptions(L.Marker.prototype._bouncingOptions);
this._bouncingMotion = new BouncingMotionCss3(this, new L.Point(0, 0), bouncingOptions);
}
});
}(L));

531
public/js/vendor/foundation.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/vendor/foundation.min.js vendored Normal file

File diff suppressed because one or more lines are too long

66
public/js/vendor/gktowgs.js vendored Normal file
View File

@@ -0,0 +1,66 @@
const proj4 = require('proj4')
const epsg = require('epsg')
const isObject = require('lodash.isobject')
const isNumber = require('lodash.isnumber')
const epsgFromZone = (zone) => 'EPSG:'+(31464+zone) // zone 2 = 31466, zone 5 = 31469
const toWGS = (coordinates) => {
if(!isObject(coordinates) || !isNumber(coordinates.x) || !isNumber(coordinates.y)){
throw new Error('missing or invalid parameter `coordinates`')
}
if(coordinates.x < 0 || coordinates.x >= Math.pow(10, 7)){
throw new Error('`coordinates.x` out of bounds')
}
if(coordinates.y < 0 || coordinates.y >= Math.pow(10, 7)){
throw new Error('`coordinates.y` out of bounds')
}
const zone = +(coordinates.x+'')[0]
const projected = proj4.default(epsg[epsgFromZone(zone)], 'WGS84', Object.assign({}, coordinates))
return ({
longitude: projected.x,
latitude: projected.y
})
}
const toGK = (coordinates, zone) => {
if(!isObject(coordinates) || !isNumber(coordinates.longitude) || !isNumber(coordinates.latitude)){
throw new Error('missing or invalid parameter `coordinates`')
}
if(coordinates.longitude < -180 || coordinates.longitude > 180){
throw new Error('`coordinates.longitude` out of bounds')
}
if(coordinates.latitude < -360 || coordinates.latitude > 360){
throw new Error('`coordinates.latitude` out of bounds')
}
if(zone){
if(!isNumber(zone)){
throw new Error('`zone` parameter must be a number')
}
if(![2,3,4,5].includes(zone)){
throw new Error('if set, `zone` parameter must be one of 2, 3, 4, 5')
}
}
else{
zone = Math.floor((+coordinates.longitude + 1.5) / 3)
if(![2,3,4,5].includes(zone)){
throw new Error('could not detect valid zone (2, 3, 4, 5) from input coordinates')
}
}
const proj4coordinates = {
x: coordinates.longitude,
y: coordinates.latitude
}
const projected = proj4('WGS84', epsg[epsgFromZone(zone)], proj4coordinates)
return ({
x: projected.x,
y: projected.y
})
}
module.exports = {toWGS, toGK}

10598
public/js/vendor/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

293
public/js/vendor/oms.min.js vendored Normal file
View File

@@ -0,0 +1,293 @@
(function () {
/*
OverlappingMarkerSpiderfier
https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet
Copyright (c) 2011 - 2012 George MacKerron
Released under the MIT licence: http://opensource.org/licenses/mit-license
Note: The Leaflet maps API must be included *before* this code
*/
(function () {
var q = {}.hasOwnProperty,
r = [].slice;
null != this.L &&
(this.OverlappingMarkerSpiderfier = (function () {
function n(c, b) {
var a,
e,
g,
f,
d = this;
this.map = c;
null == b && (b = {});
for (a in b) q.call(b, a) && ((e = b[a]), (this[a] = e));
this.initMarkerArrays();
this.listeners = {};
f = ["click", "zoomend"];
e = 0;
for (g = f.length; e < g; e++)
(a = f[e]),
this.map.addEventListener(a, function () {
return d.unspiderfy();
});
}
var d, k;
d = n.prototype;
d.VERSION = "0.2.6";
k = 2 * Math.PI;
d.keepSpiderfied = !1;
d.nearbyDistance = 20;
d.circleSpiralSwitchover = 9;
d.circleFootSeparation = 25;
d.circleStartAngle = k / 12;
d.spiralFootSeparation = 28;
d.spiralLengthStart = 11;
d.spiralLengthFactor = 5;
d.legWeight = 1.5;
d.legColors = { usual: "#222", highlighted: "#f00" };
d.initMarkerArrays = function () {
this.markers = [];
return (this.markerListeners = []);
};
d.addMarker = function (c) {
var b,
a = this;
if (null != c._oms) return this;
c._oms = !0;
b = function () {
return a.spiderListener(c);
};
c.addEventListener("click", b);
this.markerListeners.push(b);
this.markers.push(c);
return this;
};
d.getMarkers = function () {
return this.markers.slice(0);
};
d.removeMarker = function (c) {
var b, a;
null != c._omsData && this.unspiderfy();
b = this.arrIndexOf(this.markers, c);
if (0 > b) return this;
a = this.markerListeners.splice(b, 1)[0];
c.removeEventListener("click", a);
delete c._oms;
this.markers.splice(b, 1);
return this;
};
d.clearMarkers = function () {
var c, b, a, e, g;
this.unspiderfy();
g = this.markers;
c = a = 0;
for (e = g.length; a < e; c = ++a)
(b = g[c]),
(c = this.markerListeners[c]),
b.removeEventListener("click", c),
delete b._oms;
this.initMarkerArrays();
return this;
};
d.addListener = function (c, b) {
var a, e;
(null != (e = (a = this.listeners)[c]) ? e : (a[c] = [])).push(b);
return this;
};
d.removeListener = function (c, b) {
var a;
a = this.arrIndexOf(this.listeners[c], b);
0 > a || this.listeners[c].splice(a, 1);
return this;
};
d.clearListeners = function (c) {
this.listeners[c] = [];
return this;
};
d.trigger = function () {
var c, b, a, e, g, f;
b = arguments[0];
c = 2 <= arguments.length ? r.call(arguments, 1) : [];
b = null != (a = this.listeners[b]) ? a : [];
f = [];
e = 0;
for (g = b.length; e < g; e++) (a = b[e]), f.push(a.apply(null, c));
return f;
};
d.generatePtsCircle = function (c, b) {
var a, e, g, f, d;
g = (this.circleFootSeparation * (2 + c)) / k;
e = k / c;
d = [];
for (a = f = 0; 0 <= c ? f < c : f > c; a = 0 <= c ? ++f : --f)
(a = this.circleStartAngle + a * e),
d.push(new L.Point(b.x + g * Math.cos(a), b.y + g * Math.sin(a)));
return d;
};
d.generatePtsSpiral = function (c, b) {
var a, e, g, f, d;
g = this.spiralLengthStart;
a = 0;
d = [];
for (e = f = 0; 0 <= c ? f < c : f > c; e = 0 <= c ? ++f : --f)
(a += this.spiralFootSeparation / g + 5e-4 * e),
(e = new L.Point(b.x + g * Math.cos(a), b.y + g * Math.sin(a))),
(g += (k * this.spiralLengthFactor) / a),
d.push(e);
return d;
};
// Which Icon was clicked - c Icon Data
d.spiderListener = function (c) {
var b, a, e, g, f, d, h, k, l;
((b = null != c._omsData) && this.keepSpiderfied) ||
this.unspiderfy();
if (b) return this.trigger("click", c);
g = [];
f = [];
d = this.nearbyDistance * this.nearbyDistance;
e = this.map.latLngToLayerPoint(c.getLatLng());
l = this.markers;
h = 0;
for (k = l.length; h < k; h++)
(b = l[h]),
this.map.hasLayer(b) &&
((a = this.map.latLngToLayerPoint(b.getLatLng())),
this.ptDistanceSq(a, e) < d
? g.push({ marker: b, markerPt: a })
: f.push(b));
return 1 === g.length
? this.trigger("click", c)
: this.spiderfy(g, f);
};
d.makeHighlightListeners = function (c) {
var b = this;
return {
highlight: function () {
return c._omsData.leg.setStyle({
color: b.legColors.highlighted,
});
},
unhighlight: function () {
return c._omsData.leg.setStyle({ color: b.legColors.usual });
},
};
};
// spiderfy event
d.spiderfy = function (c, b) {
var a, e, g, d, p, h, k, l, n, m;
this.spiderfying = !0;
m = c.length;
a = this.ptAverage(
(function () {
var a, b, e;
e = [];
a = 0;
for (b = c.length; a < b; a++) (k = c[a]), e.push(k.markerPt);
return e;
})()
);
d =
m >= this.circleSpiralSwitchover
? this.generatePtsSpiral(m, a).reverse()
: this.generatePtsCircle(m, a);
a = function () {
var a,
b,
k,
m = this;
k = [];
a = 0;
for (b = d.length; a < b; a++)
(g = d[a]),
(e = this.map.layerPointToLatLng(g)),
(n = this.minExtract(c, function (a) {
return m.ptDistanceSq(a.markerPt, g);
})),
(h = n.marker),
(p = new L.Polyline([h.getLatLng(), e], {
color: this.legColors.usual,
weight: this.legWeight,
clickable: !1,
})),
this.map.addLayer(p),
(h._omsData = { usualPosition: h.getLatLng(), leg: p }),
this.legColors.highlighted !== this.legColors.usual &&
((l = this.makeHighlightListeners(h)),
(h._omsData.highlightListeners = l),
h.addEventListener("mouseover", l.highlight),
h.addEventListener("mouseout", l.unhighlight)),
h.setLatLng(e),
h.setZIndexOffset(1e6),
k.push(h);
return k;
}.call(this);
delete this.spiderfying;
this.spiderfied = !0;
return this.trigger("spiderfy", a, b);
};
d.unspiderfy = function (c) {
var b, a, e, d, f, k, h;
null == c && (c = null);
if (null == this.spiderfied) return this;
this.unspiderfying = !0;
d = [];
e = [];
h = this.markers;
f = 0;
for (k = h.length; f < k; f++)
(b = h[f]),
null != b._omsData
? (this.map.removeLayer(b._omsData.leg),
b !== c && b.setLatLng(b._omsData.usualPosition),
b.setZIndexOffset(0),
(a = b._omsData.highlightListeners),
null != a &&
(b.removeEventListener("mouseover", a.highlight),
b.removeEventListener("mouseout", a.unhighlight)),
delete b._omsData,
d.push(b))
: e.push(b);
delete this.unspiderfying;
delete this.spiderfied;
this.trigger("unspiderfy", d, e);
return this;
};
d.ptDistanceSq = function (c, b) {
var a, e;
a = c.x - b.x;
e = c.y - b.y;
return a * a + e * e;
};
d.ptAverage = function (c) {
var b, a, e, d, f;
d = a = e = 0;
for (f = c.length; d < f; d++) (b = c[d]), (a += b.x), (e += b.y);
c = c.length;
return new L.Point(a / c, e / c);
};
d.minExtract = function (c, b) {
var a, d, g, f, k, h;
g = k = 0;
for (h = c.length; k < h; g = ++k)
if (
((f = c[g]),
(f = b(f)),
"undefined" === typeof a || null === a || f < d)
)
(d = f), (a = g);
return c.splice(a, 1)[0];
};
d.arrIndexOf = function (c, b) {
var a, d, g, f;
if (null != c.indexOf) return c.indexOf(b);
a = g = 0;
for (f = c.length; g < f; a = ++g)
if (((d = c[a]), d === b)) return a;
return -1;
};
return n;
})());
}.call(this));
}.call(this));
/* Mon 14 Oct 2013 10:54:59 BST */

494
public/js/vendor/what-input.js vendored Normal file
View File

@@ -0,0 +1,494 @@
/**
* what-input - A global utility for tracking the current input method (mouse, keyboard or touch).
* @version v5.2.3
* @link https://github.com/ten1seven/what-input
* @license MIT
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("whatInput", [], factory);
else if(typeof exports === 'object')
exports["whatInput"] = factory();
else
root["whatInput"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
'use strict';
module.exports = function () {
/*
* bail out if there is no document or window
* (i.e. in a node/non-DOM environment)
*
* Return a stubbed API instead
*/
if (typeof document === 'undefined' || typeof window === 'undefined') {
return {
// always return "initial" because no interaction will ever be detected
ask: function ask() {
return 'initial';
},
// always return null
element: function element() {
return null;
},
// no-op
ignoreKeys: function ignoreKeys() {},
// no-op
specificKeys: function specificKeys() {},
// no-op
registerOnChange: function registerOnChange() {},
// no-op
unRegisterOnChange: function unRegisterOnChange() {}
};
}
/*
* variables
*/
// cache document.documentElement
var docElem = document.documentElement;
// currently focused dom element
var currentElement = null;
// last used input type
var currentInput = 'initial';
// last used input intent
var currentIntent = currentInput;
// UNIX timestamp of current event
var currentTimestamp = Date.now();
// check for sessionStorage support
// then check for session variables and use if available
try {
if (window.sessionStorage.getItem('what-input')) {
currentInput = window.sessionStorage.getItem('what-input');
}
if (window.sessionStorage.getItem('what-intent')) {
currentIntent = window.sessionStorage.getItem('what-intent');
}
} catch (e) {}
// form input types
var formInputs = ['button', 'input', 'select', 'textarea'];
// empty array for holding callback functions
var functionList = [];
// list of modifier keys commonly used with the mouse and
// can be safely ignored to prevent false keyboard detection
var ignoreMap = [16, // shift
17, // control
18, // alt
91, // Windows key / left Apple cmd
93 // Windows menu / right Apple cmd
];
var specificMap = [];
// mapping of events to input types
var inputMap = {
keydown: 'keyboard',
keyup: 'keyboard',
mousedown: 'mouse',
mousemove: 'mouse',
MSPointerDown: 'pointer',
MSPointerMove: 'pointer',
pointerdown: 'pointer',
pointermove: 'pointer',
touchstart: 'touch',
touchend: 'touch'
// boolean: true if the page is being scrolled
};var isScrolling = false;
// store current mouse position
var mousePos = {
x: null,
y: null
// map of IE 10 pointer events
};var pointerMap = {
2: 'touch',
3: 'touch', // treat pen like touch
4: 'mouse'
// check support for passive event listeners
};var supportsPassive = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function get() {
supportsPassive = true;
}
});
window.addEventListener('test', null, opts);
} catch (e) {}
/*
* set up
*/
var setUp = function setUp() {
// add correct mouse wheel event mapping to `inputMap`
inputMap[detectWheel()] = 'mouse';
addListeners();
doUpdate('input');
doUpdate('intent');
};
/*
* events
*/
var addListeners = function addListeners() {
// `pointermove`, `MSPointerMove`, `mousemove` and mouse wheel event binding
// can only demonstrate potential, but not actual, interaction
// and are treated separately
var options = supportsPassive ? { passive: true } : false;
// pointer events (mouse, pen, touch)
if (window.PointerEvent) {
window.addEventListener('pointerdown', setInput);
window.addEventListener('pointermove', setIntent);
} else if (window.MSPointerEvent) {
window.addEventListener('MSPointerDown', setInput);
window.addEventListener('MSPointerMove', setIntent);
} else {
// mouse events
window.addEventListener('mousedown', setInput);
window.addEventListener('mousemove', setIntent);
// touch events
if ('ontouchstart' in window) {
window.addEventListener('touchstart', setInput, options);
window.addEventListener('touchend', setInput);
}
}
// mouse wheel
window.addEventListener(detectWheel(), setIntent, options);
// keyboard events
window.addEventListener('keydown', setInput);
window.addEventListener('keyup', setInput);
// focus events
window.addEventListener('focusin', setElement);
window.addEventListener('focusout', clearElement);
};
// checks conditions before updating new input
var setInput = function setInput(event) {
var eventKey = event.which;
var value = inputMap[event.type];
if (value === 'pointer') {
value = pointerType(event);
}
var ignoreMatch = !specificMap.length && ignoreMap.indexOf(eventKey) === -1;
var specificMatch = specificMap.length && specificMap.indexOf(eventKey) !== -1;
var shouldUpdate = value === 'keyboard' && eventKey && (ignoreMatch || specificMatch) || value === 'mouse' || value === 'touch';
// prevent touch detection from being overridden by event execution order
if (validateTouch(value)) {
shouldUpdate = false;
}
if (shouldUpdate && currentInput !== value) {
currentInput = value;
try {
window.sessionStorage.setItem('what-input', currentInput);
} catch (e) {}
doUpdate('input');
}
if (shouldUpdate && currentIntent !== value) {
// preserve intent for keyboard interaction with form fields
var activeElem = document.activeElement;
var notFormInput = activeElem && activeElem.nodeName && (formInputs.indexOf(activeElem.nodeName.toLowerCase()) === -1 || activeElem.nodeName.toLowerCase() === 'button' && !checkClosest(activeElem, 'form'));
if (notFormInput) {
currentIntent = value;
try {
window.sessionStorage.setItem('what-intent', currentIntent);
} catch (e) {}
doUpdate('intent');
}
}
};
// updates the doc and `inputTypes` array with new input
var doUpdate = function doUpdate(which) {
docElem.setAttribute('data-what' + which, which === 'input' ? currentInput : currentIntent);
fireFunctions(which);
};
// updates input intent for `mousemove` and `pointermove`
var setIntent = function setIntent(event) {
var value = inputMap[event.type];
if (value === 'pointer') {
value = pointerType(event);
}
// test to see if `mousemove` happened relative to the screen to detect scrolling versus mousemove
detectScrolling(event);
// only execute if scrolling isn't happening
if ((!isScrolling && !validateTouch(value) || isScrolling && event.type === 'wheel' || event.type === 'mousewheel' || event.type === 'DOMMouseScroll') && currentIntent !== value) {
currentIntent = value;
try {
window.sessionStorage.setItem('what-intent', currentIntent);
} catch (e) {}
doUpdate('intent');
}
};
var setElement = function setElement(event) {
if (!event.target.nodeName) {
// If nodeName is undefined, clear the element
// This can happen if click inside an <svg> element.
clearElement();
return;
}
currentElement = event.target.nodeName.toLowerCase();
docElem.setAttribute('data-whatelement', currentElement);
if (event.target.classList && event.target.classList.length) {
docElem.setAttribute('data-whatclasses', event.target.classList.toString().replace(' ', ','));
}
};
var clearElement = function clearElement() {
currentElement = null;
docElem.removeAttribute('data-whatelement');
docElem.removeAttribute('data-whatclasses');
};
/*
* utilities
*/
var pointerType = function pointerType(event) {
if (typeof event.pointerType === 'number') {
return pointerMap[event.pointerType];
} else {
// treat pen like touch
return event.pointerType === 'pen' ? 'touch' : event.pointerType;
}
};
// prevent touch detection from being overridden by event execution order
var validateTouch = function validateTouch(value) {
var timestamp = Date.now();
var touchIsValid = value === 'mouse' && currentInput === 'touch' && timestamp - currentTimestamp < 200;
currentTimestamp = timestamp;
return touchIsValid;
};
// detect version of mouse wheel event to use
// via https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event
var detectWheel = function detectWheel() {
var wheelType = null;
// Modern browsers support "wheel"
if ('onwheel' in document.createElement('div')) {
wheelType = 'wheel';
} else {
// Webkit and IE support at least "mousewheel"
// or assume that remaining browsers are older Firefox
wheelType = document.onmousewheel !== undefined ? 'mousewheel' : 'DOMMouseScroll';
}
return wheelType;
};
// runs callback functions
var fireFunctions = function fireFunctions(type) {
for (var i = 0, len = functionList.length; i < len; i++) {
if (functionList[i].type === type) {
functionList[i].fn.call(undefined, type === 'input' ? currentInput : currentIntent);
}
}
};
// finds matching element in an object
var objPos = function objPos(match) {
for (var i = 0, len = functionList.length; i < len; i++) {
if (functionList[i].fn === match) {
return i;
}
}
};
var detectScrolling = function detectScrolling(event) {
if (mousePos['x'] !== event.screenX || mousePos['y'] !== event.screenY) {
isScrolling = false;
mousePos['x'] = event.screenX;
mousePos['y'] = event.screenY;
} else {
isScrolling = true;
}
};
// manual version of `closest()`
var checkClosest = function checkClosest(elem, tag) {
var ElementPrototype = window.Element.prototype;
if (!ElementPrototype.matches) {
ElementPrototype.matches = ElementPrototype.msMatchesSelector || ElementPrototype.webkitMatchesSelector;
}
if (!ElementPrototype.closest) {
do {
if (elem.matches(tag)) {
return elem;
}
elem = elem.parentElement || elem.parentNode;
} while (elem !== null && elem.nodeType === 1);
return null;
} else {
return elem.closest(tag);
}
};
/*
* init
*/
// don't start script unless browser cuts the mustard
// (also passes if polyfills are used)
if ('addEventListener' in window && Array.prototype.indexOf) {
setUp();
}
/*
* api
*/
return {
// returns string: the current input type
// opt: 'intent'|'input'
// 'input' (default): returns the same value as the `data-whatinput` attribute
// 'intent': includes `data-whatintent` value if it's different than `data-whatinput`
ask: function ask(opt) {
return opt === 'intent' ? currentIntent : currentInput;
},
// returns string: the currently focused element or null
element: function element() {
return currentElement;
},
// overwrites ignored keys with provided array
ignoreKeys: function ignoreKeys(arr) {
ignoreMap = arr;
},
// overwrites specific char keys to update on
specificKeys: function specificKeys(arr) {
specificMap = arr;
},
// attach functions to input and intent "events"
// funct: function to fire on change
// eventType: 'input'|'intent'
registerOnChange: function registerOnChange(fn, eventType) {
functionList.push({
fn: fn,
type: eventType || 'input'
});
},
unRegisterOnChange: function unRegisterOnChange(fn) {
var position = objPos(fn);
if (position || position === 0) {
functionList.splice(position, 1);
}
}
};
}();
/***/ })
/******/ ])
});
;