@dartcom/ui-kit 10.3.1 → 10.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -41,21 +41,6 @@ function _interopNamespaceDefault(e) {
41
41
  return Object.freeze(n);
42
42
  }
43
43
 
44
- function _mergeNamespaces(n, m) {
45
- m.forEach(function (e) {
46
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
47
- if (k !== 'default' && !(k in n)) {
48
- var d = Object.getOwnPropertyDescriptor(e, k);
49
- Object.defineProperty(n, k, d.get ? d : {
50
- enumerable: true,
51
- get: function () { return e[k]; }
52
- });
53
- }
54
- });
55
- });
56
- return Object.freeze(n);
57
- }
58
-
59
44
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
60
45
 
61
46
  exports.Operations = void 0;
@@ -14648,11 +14633,10 @@ function requireLeafletSrc () {
14648
14633
  }
14649
14634
 
14650
14635
  var leafletSrcExports = requireLeafletSrc();
14651
- var s$3 = /*@__PURE__*/getDefaultExportFromCjs(leafletSrcExports);
14652
14636
 
14653
- function r$2(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$2(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$2(e))&&(n&&(n+=" "),n+=t);return n}
14637
+ function r$1(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$1(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$1(e))&&(n&&(n+=" "),n+=t);return n}
14654
14638
 
14655
- let e$1={data:""},t=t=>{if("object"==typeof window){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$2=(e,t)=>{let r="",l="",a="";for(let n in e){let c=e[n];"@"==n[0]?"i"==n[1]?r=n+" "+c+";":l+="f"==n[1]?o$2(c,n):n+"{"+o$2(c,"k"==n[1]?"":t)+"}":"object"==typeof c?l+=o$2(c,t?t.replace(/([^,])+/g,e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):n):null!=c&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=o$2.p?o$2.p(n,c):n+":"+c+";");}return r+(t&&a?t+"{"+a+"}":a)+l},c$1={},s$2=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+s$2(e[r]);return t}return e},i$2=(e,t,r,i,p)=>{let u=s$2(e),d=c$1[u]||(c$1[u]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(u));if(!c$1[d]){let t=u!==e?e:(e=>{let t,r,o=[{}];for(;t=l$1.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n$1," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n$1," ").trim();return o[0]})(e);c$1[d]=o$2(p?{["@keyframes "+d]:t}:t,r?"":"."+d);}let f=r&&c$1.g?c$1.g:null;return r&&(c$1.g=c$1[d]),((e,t,r,l)=>{l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(c$1[d],t,i,f),d},p=(e,t,r)=>e.reduce((e,l,a)=>{let n=t[a];if(n&&n.call){let e=n(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":o$2(e,""):false===e?"":e;}return e+l+(null==n?"":n)},"");function u(e){let r=this||{},l=e.call?e(r.p):e;return i$2(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):l,t(r.target),r.g,r.o,r.k)}u.bind({g:1});u.bind({k:1});
14639
+ let e$1={data:""},t=t=>{if("object"==typeof window){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||e$1},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$2=(e,t)=>{let r="",l="",a="";for(let n in e){let c=e[n];"@"==n[0]?"i"==n[1]?r=n+" "+c+";":l+="f"==n[1]?o$2(c,n):n+"{"+o$2(c,"k"==n[1]?"":t)+"}":"object"==typeof c?l+=o$2(c,t?t.replace(/([^,])+/g,e=>n.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):n):null!=c&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=o$2.p?o$2.p(n,c):n+":"+c+";");}return r+(t&&a?t+"{"+a+"}":a)+l},c$1={},s$2=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+s$2(e[r]);return t}return e},i$2=(e,t,r,i,p)=>{let u=s$2(e),d=c$1[u]||(c$1[u]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(u));if(!c$1[d]){let t=u!==e?e:(e=>{let t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n$1," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n$1," ").trim();return o[0]})(e);c$1[d]=o$2(p?{["@keyframes "+d]:t}:t,r?"":"."+d);}let f=r&&c$1.g?c$1.g:null;return r&&(c$1.g=c$1[d]),((e,t,r,l)=>{l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(c$1[d],t,i,f),d},p=(e,t,r)=>e.reduce((e,l,a)=>{let n=t[a];if(n&&n.call){let e=n(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;n=t?"."+t:e&&"object"==typeof e?e.props?"":o$2(e,""):false===e?"":e;}return e+l+(null==n?"":n)},"");function u(e){let r=this||{},l=e.call?e(r.p):e;return i$2(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>Object.assign(e,t&&t.call?t(r.p):t),{}):l,t(r.target),r.g,r.o,r.k)}u.bind({g:1});u.bind({k:1});
14656
14640
 
14657
14641
  function _defineProperties$1(target, props) {
14658
14642
  for (var i = 0; i < props.length; i++) {
@@ -26810,30 +26794,6 @@ const DartcomInitializeProvider = ({ children, configOptions }) => {
26810
26794
  return jsxRuntime.jsx(React__namespace.Fragment, { children: children });
26811
26795
  };
26812
26796
 
26813
- const MapProvider = ({ children }) => {
26814
- const [isReady, setIsReady] = React__namespace.useState(false);
26815
- const init = async () => {
26816
- try {
26817
- await Promise.resolve().then(function () { return tangram_min; });
26818
- await Promise.resolve().then(function () { return leaflet_rotatedMarker; });
26819
- await Promise.resolve().then(function () { return leaflet_polylineoffset$1; });
26820
- await Promise.resolve().then(function () { return index$1; });
26821
- await Promise.resolve().then(function () { return index; });
26822
- await Promise.resolve().then(function () { return leafletArrows$1; });
26823
- setIsReady(true);
26824
- }
26825
- catch {
26826
- setIsReady(false);
26827
- }
26828
- };
26829
- React__namespace.useEffect(() => {
26830
- init();
26831
- }, []);
26832
- if (!isReady)
26833
- return null;
26834
- return jsxRuntime.jsx(React__namespace.Fragment, { children: children });
26835
- };
26836
-
26837
26797
  const queryClient = new QueryClient();
26838
26798
  const QueryProvider = (props) => (jsxRuntime.jsx(QueryClientProvider, { ...props, client: queryClient }));
26839
26799
 
@@ -26843,7 +26803,7 @@ const DartcomThemeProvider = ({ children, themeOptions }) => {
26843
26803
  };
26844
26804
 
26845
26805
  const DartcomProviders = ({ children, configOptions, themeOptions }) => {
26846
- return (jsxRuntime.jsx(SnackbarProvider, { children: jsxRuntime.jsx(QueryProvider, { children: jsxRuntime.jsx(DartcomMobxProvider, { children: jsxRuntime.jsx(DartcomThemeProvider, { themeOptions: themeOptions, children: jsxRuntime.jsx(Provider, { children: jsxRuntime.jsx(MapProvider, { children: jsxRuntime.jsx(DartcomInitializeProvider, { configOptions: configOptions, children: children }) }) }) }) }) }) }));
26806
+ return (jsxRuntime.jsx(SnackbarProvider, { children: jsxRuntime.jsx(QueryProvider, { children: jsxRuntime.jsx(DartcomMobxProvider, { children: jsxRuntime.jsx(DartcomThemeProvider, { themeOptions: themeOptions, children: jsxRuntime.jsx(Provider, { children: jsxRuntime.jsx(DartcomInitializeProvider, { configOptions: configOptions, children: children }) }) }) }) }) }));
26847
26807
  };
26848
26808
 
26849
26809
  const useSignOut = () => {
@@ -44458,10 +44418,10 @@ function requirePapaparse_min () {
44458
44418
  var papaparse_minExports = requirePapaparse_min();
44459
44419
  var e = /*@__PURE__*/getDefaultExportFromCjs(papaparse_minExports);
44460
44420
 
44461
- "function"==typeof SuppressedError&&SuppressedError;function P(n,t){return e.parse(n,t)}function x$1(n,t){e.parse(n,Object.assign({},{download:true},t));}function O(n,t){return void 0===t&&(t={}),e.unparse(n,t)}function S$1(){return {readString:P,readRemoteFile:x$1,jsonToCSV:O}}e.BAD_DELIMITERS;e.RECORD_SEP;e.UNIT_SEP;e.WORKERS_SUPPORTED;e.LocalChunkSize;e.DefaultDelimiter;
44421
+ "function"==typeof SuppressedError&&SuppressedError;function P(n,t){return e.parse(n,t)}function x$1(n,t){e.parse(n,Object.assign({},{download:true},t));}function O(n,t){return void 0===t&&(t={}),e.unparse(n,t)}function S(){return {readString:P,readRemoteFile:x$1,jsonToCSV:O}}e.BAD_DELIMITERS;e.RECORD_SEP;e.UNIT_SEP;e.WORKERS_SUPPORTED;e.LocalChunkSize;e.DefaultDelimiter;
44462
44422
 
44463
44423
  const CSVUploader = ({ onDataParsed, onError, delimiter = ',', header = true, dynamicTyping = true, skipEmptyLines = true, worker = false, }) => {
44464
- const { readString } = S$1();
44424
+ const { readString } = S();
44465
44425
  const [loading, setLoading] = React__namespace.useState(false);
44466
44426
  const [error, setError] = React__namespace.useState(null);
44467
44427
  return (jsxRuntime.jsx(UploadButton, { accept: ".csv", loading: loading, error: error, onFilesLoad: ({ files }) => {
@@ -46913,7 +46873,7 @@ const defaultValues = {
46913
46873
  password: '',
46914
46874
  };
46915
46875
 
46916
- const r$1=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o$1=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r$1(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r$1(t,o,e));}},s=(r,s)=>{s.shouldUseNativeValidation&&o$1(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\.\\d+`))};function n(e){return e.replace(/\]|\[/g,"")}
46876
+ const r=(t,r,o)=>{if(t&&"reportValidity"in t){const s=get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o$1=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e));}},s=(r,s)=>{s.shouldUseNativeValidation&&o$1(r,s);const n={};for(const o in r){const f=get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},get(n,o));set(r,"root",c),set(n,o,r);}else set(n,o,c);}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\.\\d+`))};function n(e){return e.replace(/\]|\[/g,"")}
46917
46877
 
46918
46878
  function o(o,n,s$1){return void 0===s$1&&(s$1={}),function(a,i,c){try{return Promise.resolve(function(t,r){try{var u=(null!=n&&n.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(o["sync"===s$1.mode?"validateSync":"validate"](a,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&o$1({},c),{values:s$1.raw?Object.assign({},a):t,errors:{}}}));}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return {values:{},errors:s((o=e,n=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,s=o&&o[t.type];e[t.path]=appendErrors(t.path,n,e,t.type,s?[].concat(s,t.message):t.message);}return e},{})),c)};var o,n;}))}catch(e){return Promise.reject(e)}}}
46919
46879
 
@@ -47014,1036 +46974,10 @@ try {
47014
46974
  }
47015
46975
  } catch(e) {}
47016
46976
 
47017
- var Tangram$1 = Tangram;
47018
-
47019
46977
  var tangram_min = /*#__PURE__*/Object.freeze({
47020
- __proto__: null,
47021
- default: Tangram$1
47022
- });
47023
-
47024
- (function() {
47025
- // save these original methods before they are overwritten
47026
- var proto_initIcon = L.Marker.prototype._initIcon;
47027
- var proto_setPos = L.Marker.prototype._setPos;
47028
-
47029
- var oldIE = (L.DomUtil.TRANSFORM === 'msTransform');
47030
-
47031
- L.Marker.addInitHook(function () {
47032
- var iconOptions = this.options.icon && this.options.icon.options;
47033
- var iconAnchor = iconOptions && this.options.icon.options.iconAnchor;
47034
- if (iconAnchor) {
47035
- iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px');
47036
- }
47037
- this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom' ;
47038
- this.options.rotationAngle = this.options.rotationAngle || 0;
47039
-
47040
- // Ensure marker keeps rotated during dragging
47041
- this.on('drag', function(e) { e.target._applyRotation(); });
47042
- });
47043
-
47044
- L.Marker.include({
47045
- _initIcon: function() {
47046
- proto_initIcon.call(this);
47047
- },
47048
-
47049
- _setPos: function (pos) {
47050
- proto_setPos.call(this, pos);
47051
- this._applyRotation();
47052
- },
47053
-
47054
- _applyRotation: function () {
47055
- if(this.options.rotationAngle) {
47056
- this._icon.style[L.DomUtil.TRANSFORM+'Origin'] = this.options.rotationOrigin;
47057
-
47058
- if(oldIE) {
47059
- // for IE 9, use the 2D rotation
47060
- this._icon.style[L.DomUtil.TRANSFORM] = 'rotate(' + this.options.rotationAngle + 'deg)';
47061
- } else {
47062
- // for modern browsers, prefer the 3D accelerated version
47063
- this._icon.style[L.DomUtil.TRANSFORM] += ' rotateZ(' + this.options.rotationAngle + 'deg)';
47064
- }
47065
- }
47066
- },
47067
-
47068
- setRotationAngle: function(angle) {
47069
- this.options.rotationAngle = angle;
47070
- this.update();
47071
- return this;
47072
- },
47073
-
47074
- setRotationOrigin: function(origin) {
47075
- this.options.rotationOrigin = origin;
47076
- this.update();
47077
- return this;
47078
- }
47079
- });
47080
- })();
47081
-
47082
- var leaflet_rotatedMarker = /*#__PURE__*/Object.freeze({
47083
46978
  __proto__: null
47084
46979
  });
47085
46980
 
47086
- var leaflet_polylineoffset$2 = {exports: {}};
47087
-
47088
- var hasRequiredLeaflet_polylineoffset;
47089
-
47090
- function requireLeaflet_polylineoffset () {
47091
- if (hasRequiredLeaflet_polylineoffset) return leaflet_polylineoffset$2.exports;
47092
- hasRequiredLeaflet_polylineoffset = 1;
47093
- (function (module, exports$1) {
47094
- (function (factory, window) {
47095
- {
47096
- module.exports = factory(requireLeafletSrc());
47097
- }
47098
- if (typeof window !== 'undefined' && window.L) {
47099
- window.L.PolylineOffset = factory(L);
47100
- }
47101
- }(function (L) {
47102
-
47103
- function forEachPair(list, callback) {
47104
- if (!list || list.length < 1) { return; }
47105
- for (var i = 1, l = list.length; i < l; i++) {
47106
- callback(list[i-1], list[i]);
47107
- }
47108
- }
47109
-
47110
- /**
47111
- Find the coefficients (a,b) of a line of equation y = a.x + b,
47112
- or the constant x for vertical lines
47113
- Return null if there's no equation possible
47114
- */
47115
- function lineEquation(pt1, pt2) {
47116
- if (pt1.x === pt2.x) {
47117
- return pt1.y === pt2.y ? null : { x: pt1.x };
47118
- }
47119
-
47120
- var a = (pt2.y - pt1.y) / (pt2.x - pt1.x);
47121
- return {
47122
- a: a,
47123
- b: pt1.y - a * pt1.x,
47124
- };
47125
- }
47126
-
47127
- /**
47128
- Return the intersection point of two lines defined by two points each
47129
- Return null when there's no unique intersection
47130
- */
47131
- function intersection(l1a, l1b, l2a, l2b) {
47132
- var line1 = lineEquation(l1a, l1b);
47133
- var line2 = lineEquation(l2a, l2b);
47134
-
47135
- if (line1 === null || line2 === null) {
47136
- return null;
47137
- }
47138
-
47139
- if (line1.hasOwnProperty('x')) {
47140
- return line2.hasOwnProperty('x')
47141
- ? null
47142
- : {
47143
- x: line1.x,
47144
- y: line2.a * line1.x + line2.b,
47145
- };
47146
- }
47147
- if (line2.hasOwnProperty('x')) {
47148
- return {
47149
- x: line2.x,
47150
- y: line1.a * line2.x + line1.b,
47151
- };
47152
- }
47153
-
47154
- if (line1.a === line2.a) {
47155
- return null;
47156
- }
47157
-
47158
- var x = (line2.b - line1.b) / (line1.a - line2.a);
47159
- return {
47160
- x: x,
47161
- y: line1.a * x + line1.b,
47162
- };
47163
- }
47164
-
47165
- function translatePoint(pt, dist, heading) {
47166
- return {
47167
- x: pt.x + dist * Math.cos(heading),
47168
- y: pt.y + dist * Math.sin(heading),
47169
- };
47170
- }
47171
-
47172
- var PolylineOffset = {
47173
- offsetPointLine: function(points, distance) {
47174
- var offsetSegments = [];
47175
-
47176
- forEachPair(points, L.bind(function(a, b) {
47177
- if (a.x === b.x && a.y === b.y) { return; }
47178
-
47179
- // angles in (-PI, PI]
47180
- var segmentAngle = Math.atan2(a.y - b.y, a.x - b.x);
47181
- var offsetAngle = segmentAngle - Math.PI/2;
47182
-
47183
- offsetSegments.push({
47184
- offsetAngle: offsetAngle,
47185
- original: [a, b],
47186
- offset: [
47187
- translatePoint(a, distance, offsetAngle),
47188
- translatePoint(b, distance, offsetAngle)
47189
- ]
47190
- });
47191
- }, this));
47192
-
47193
- return offsetSegments;
47194
- },
47195
-
47196
- offsetPoints: function(pts, offset) {
47197
- var offsetSegments = this.offsetPointLine(pts, offset);
47198
- return this.joinLineSegments(offsetSegments, offset);
47199
- },
47200
-
47201
- /**
47202
- Join 2 line segments defined by 2 points each with a circular arc
47203
- */
47204
- joinSegments: function(s1, s2, offset) {
47205
- // TODO: different join styles
47206
- return this.circularArc(s1, s2, offset)
47207
- .filter(function(x) { return x; })
47208
- },
47209
-
47210
- joinLineSegments: function(segments, offset) {
47211
- var joinedPoints = [];
47212
- var first = segments[0];
47213
- var last = segments[segments.length - 1];
47214
-
47215
- if (first && last) {
47216
- joinedPoints.push(first.offset[0]);
47217
- forEachPair(segments, L.bind(function(s1, s2) {
47218
- joinedPoints = joinedPoints.concat(this.joinSegments(s1, s2, offset));
47219
- }, this));
47220
- joinedPoints.push(last.offset[1]);
47221
- }
47222
-
47223
- return joinedPoints;
47224
- },
47225
-
47226
- segmentAsVector: function(s) {
47227
- return {
47228
- x: s[1].x - s[0].x,
47229
- y: s[1].y - s[0].y,
47230
- };
47231
- },
47232
-
47233
- getSignedAngle: function(s1, s2) {
47234
- const a = this.segmentAsVector(s1);
47235
- const b = this.segmentAsVector(s2);
47236
- return Math.atan2(a.x * b.y - a.y * b.x, a.x * b.x + a.y * b.y);
47237
- },
47238
-
47239
- /**
47240
- Interpolates points between two offset segments in a circular form
47241
- */
47242
- circularArc: function(s1, s2, distance) {
47243
- // if the segments are the same angle,
47244
- // there should be a single join point
47245
- if (s1.offsetAngle === s2.offsetAngle) {
47246
- return [s1.offset[1]];
47247
- }
47248
-
47249
- const signedAngle = this.getSignedAngle(s1.offset, s2.offset);
47250
- // for inner angles, just find the offset segments intersection
47251
- if ((signedAngle * distance > 0) &&
47252
- (signedAngle * this.getSignedAngle(s1.offset, [s1.offset[0], s2.offset[1]]) > 0)) {
47253
- return [intersection(s1.offset[0], s1.offset[1], s2.offset[0], s2.offset[1])];
47254
- }
47255
-
47256
- // draws a circular arc with R = offset distance, C = original meeting point
47257
- var points = [];
47258
- var center = s1.original[1];
47259
- // ensure angles go in the anti-clockwise direction
47260
- var rightOffset = distance > 0;
47261
- var startAngle = rightOffset ? s2.offsetAngle : s1.offsetAngle;
47262
- var endAngle = rightOffset ? s1.offsetAngle : s2.offsetAngle;
47263
- // and that the end angle is bigger than the start angle
47264
- if (endAngle < startAngle) {
47265
- endAngle += Math.PI * 2;
47266
- }
47267
- var step = Math.PI / 8;
47268
- for (var alpha = startAngle; alpha < endAngle; alpha += step) {
47269
- points.push(translatePoint(center, distance, alpha));
47270
- }
47271
- points.push(translatePoint(center, distance, endAngle));
47272
-
47273
- return rightOffset ? points.reverse() : points;
47274
- }
47275
- };
47276
-
47277
- // Modify the L.Polyline class by overwriting the projection function
47278
- L.Polyline.include({
47279
- _projectLatlngs: function (latlngs, result, projectedBounds) {
47280
- var isFlat = latlngs.length > 0 && latlngs[0] instanceof L.LatLng;
47281
-
47282
- if (isFlat) {
47283
- var ring = latlngs.map(L.bind(function(ll) {
47284
- var point = this._map.latLngToLayerPoint(ll);
47285
- if (projectedBounds) {
47286
- projectedBounds.extend(point);
47287
- }
47288
- return point;
47289
- }, this));
47290
-
47291
- // Offset management hack ---
47292
- if (this.options.offset) {
47293
- ring = L.PolylineOffset.offsetPoints(ring, this.options.offset);
47294
- }
47295
- // Offset management hack END ---
47296
-
47297
- result.push(ring.map(function (xy) {
47298
- return L.point(xy.x, xy.y);
47299
- }));
47300
- } else {
47301
- latlngs.forEach(L.bind(function(ll) {
47302
- this._projectLatlngs(ll, result, projectedBounds);
47303
- }, this));
47304
- }
47305
- }
47306
- });
47307
-
47308
- L.Polyline.include({
47309
- setOffset: function(offset) {
47310
- this.options.offset = offset;
47311
- this.redraw();
47312
- return this;
47313
- }
47314
- });
47315
-
47316
- return PolylineOffset;
47317
-
47318
- }, window));
47319
- } (leaflet_polylineoffset$2));
47320
- return leaflet_polylineoffset$2.exports;
47321
- }
47322
-
47323
- var leaflet_polylineoffsetExports = requireLeaflet_polylineoffset();
47324
- var leaflet_polylineoffset = /*@__PURE__*/getDefaultExportFromCjs(leaflet_polylineoffsetExports);
47325
-
47326
- var leaflet_polylineoffset$1 = /*#__PURE__*/_mergeNamespaces({
47327
- __proto__: null,
47328
- default: leaflet_polylineoffset
47329
- }, [leaflet_polylineoffsetExports]);
47330
-
47331
- /**
47332
- * L.Map.SelectArea - Area selection tool for leaflet
47333
- *
47334
- * @author Alexander Milevski <info@w8r.name>
47335
- * @see https://github.com/w8r/leaflet-area-select
47336
- * @license MIT
47337
- * @preserve
47338
- */
47339
- var r = function() {
47340
- return true;
47341
- };
47342
- s$3.Map.SelectArea = s$3.Map.BoxZoom.extend({
47343
- statics: {
47344
- /**
47345
- * @static
47346
- * @type {String}
47347
- */
47348
- SELECT_AREA_SELECTED: "selectarea:selected",
47349
- /**
47350
- * @static
47351
- * @type {String}
47352
- */
47353
- SELECT_AREA_START: "selectarea:start",
47354
- /**
47355
- * @static
47356
- * @type {String}
47357
- */
47358
- SELECT_AREA_TOGGLED: "selectarea:toggled"
47359
- },
47360
- options: {
47361
- shiftKey: false,
47362
- ctrlKey: true,
47363
- validate: r,
47364
- autoDisable: false,
47365
- cursor: "crosshair"
47366
- },
47367
- /**
47368
- * @param {L.Map} map
47369
- * @constructor
47370
- */
47371
- initialize: function(t, e) {
47372
- s$3.Util.setOptions(this, e || {}), s$3.Map.BoxZoom.prototype.initialize.call(this, t), this._validate = null, this._moved = false, this._autoDisable = !this.options.ctrlKey && this.options.autoDisable, this._lastLayerPoint = null, this._beforeCursor = null, this.setValidate(this.options.validate), this.setAutoDisable(this.options.autoDisable);
47373
- },
47374
- /**
47375
- * @param {Function=} validate
47376
- * @return {SelectArea}
47377
- */
47378
- setValidate: function(t) {
47379
- var e = this;
47380
- return typeof t != "function" && (t = r), this._validate = function(i) {
47381
- return t.call(e, i);
47382
- }, this;
47383
- },
47384
- /**
47385
- * @param {Boolean} autoDisable
47386
- */
47387
- setAutoDisable: function(t) {
47388
- this._autoDisable = !!t;
47389
- },
47390
- /**
47391
- * @param {Boolean} on
47392
- */
47393
- setControlKey: function(t) {
47394
- var e = this._enabled;
47395
- e && this.disable(), this.options.ctrlKey = !!t, t && (this.options.shiftKey = false), e && this.enable();
47396
- },
47397
- /**
47398
- * @param {Boolean} on
47399
- */
47400
- setShiftKey: function(t) {
47401
- var e = this._enabled;
47402
- e && this.disable(), this.options.shiftKey = !!t, t && (this.options.ctrlKey = false), e && this.enable();
47403
- },
47404
- /**
47405
- * Disable dragging or zoombox
47406
- * @param {Function=} validate
47407
- * @param {Boolean=} autoDisable
47408
- */
47409
- enable: function(t, e) {
47410
- this.options.shiftKey ? this._map.boxZoom && this._map.boxZoom.disable() : this.options.ctrlKey || this._map.dragging.disable(), s$3.Map.BoxZoom.prototype.enable.call(this), this.options.ctrlKey || this._setCursor(), t && this.setValidate(t), this.setAutoDisable(e), this._map.fire(s$3.Map.SelectArea.SELECT_AREA_TOGGLED);
47411
- },
47412
- /**
47413
- * Re-enable box zoom or dragging
47414
- */
47415
- disable: function() {
47416
- s$3.Map.BoxZoom.prototype.disable.call(this), this.options.ctrlKey || this._restoreCursor(), this.options.shiftKey ? this._map.boxZoom && this._map.boxZoom.enable() : this._map.dragging.enable(), this._map.fire(s$3.Map.SelectArea.SELECT_AREA_TOGGLED);
47417
- },
47418
- /**
47419
- * Also listen to ESC to cancel interaction
47420
- * @override
47421
- */
47422
- addHooks: function() {
47423
- s$3.Map.BoxZoom.prototype.addHooks.call(this), s$3.DomEvent.on(document, "keyup", this._onKeyUp, this).on(document, "keydown", this._onKeyPress, this).on(document, "contextmenu", this._onMouseDown, this).on(window, "blur", this._onBlur, this), this._map.on("dragstart", this._onMouseDown, this);
47424
- },
47425
- /**
47426
- * @override
47427
- */
47428
- removeHooks: function() {
47429
- s$3.Map.BoxZoom.prototype.removeHooks.call(this), s$3.DomEvent.off(document, "keyup", this._onKeyUp, this).off(document, "keydown", this._onKeyPress, this).off(document, "contextmenu", this._onMouseDown, this).off(window, "blur", this._onBlur, this), this._map.off("dragstart", this._onMouseDown, this);
47430
- },
47431
- /**
47432
- * @override
47433
- */
47434
- _onMouseDown: function(t) {
47435
- if (this._moved = false, this._lastLayerPoint = null, this.options.shiftKey && !t.shiftKey || this.options.ctrlKey && !t.ctrlKey || t.which !== 1 && t.button !== 1)
47436
- return false;
47437
- s$3.DomEvent.stop(t);
47438
- var e = this._map.mouseEventToLayerPoint(t);
47439
- if (!this._validate(e)) return false;
47440
- s$3.DomUtil.disableTextSelection(), s$3.DomUtil.disableImageDrag(), this._startLayerPoint = e, s$3.DomEvent.on(document, "mousemove", this._onMouseMove, this).on(document, "mouseup", this._onMouseUp, this).on(document, "keydown", this._onKeyDown, this);
47441
- },
47442
- /**
47443
- * @override
47444
- */
47445
- _onMouseMove: function(t) {
47446
- this._moved || (this._box = s$3.DomUtil.create("div", "leaflet-zoom-box", this._pane), s$3.DomUtil.setPosition(this._box, this._startLayerPoint), this._map.fire(s$3.Map.SelectArea.SELECT_AREA_START));
47447
- var e = this._startLayerPoint, i = this._box, o = this._map.mouseEventToLayerPoint(t), a = o.subtract(e);
47448
- if (this._validate(o)) {
47449
- this._lastLayerPoint = o;
47450
- var n = new s$3.Point(
47451
- Math.min(o.x, e.x),
47452
- Math.min(o.y, e.y)
47453
- );
47454
- s$3.DomUtil.setPosition(i, n), this._moved = true, i.style.width = Math.max(0, Math.abs(a.x) - 4) + "px", i.style.height = Math.max(0, Math.abs(a.y) - 4) + "px";
47455
- }
47456
- },
47457
- /**
47458
- * General on/off toggle
47459
- * @param {KeyboardEvent} e
47460
- */
47461
- _onKeyUp: function(t) {
47462
- t.keyCode === 27 ? this._moved && this._box && this._finish() : this.options.ctrlKey && (this._restoreCursor(), this._map.dragging.enable());
47463
- },
47464
- /**
47465
- * Key down listener to enable on ctrl-press
47466
- * @param {KeyboardEvent} e
47467
- */
47468
- _onKeyPress: function(t) {
47469
- this.options.ctrlKey && (t.ctrlKey || t.type === "dragstart") && this._beforeCursor === null && (this._setCursor(), this._map.dragging._draggable._onUp(t), this._map.dragging.disable());
47470
- },
47471
- /**
47472
- * Window blur listener to restore state
47473
- * @param {Event} e
47474
- */
47475
- _onBlur: function(t) {
47476
- this._restoreCursor(), this._map.dragging.enable();
47477
- },
47478
- /**
47479
- * Set crosshair cursor
47480
- */
47481
- _setCursor: function() {
47482
- this._beforeCursor = this._container.style.cursor, this._container.style.cursor = this.options.cursor;
47483
- },
47484
- /**
47485
- * Restore status quo cursor
47486
- */
47487
- _restoreCursor: function() {
47488
- this._container.style.cursor = this._beforeCursor, this._beforeCursor = null;
47489
- },
47490
- /**
47491
- * @override
47492
- */
47493
- _onMouseUp: function(t) {
47494
- this._finish();
47495
- var e = this._map, i = this._lastLayerPoint;
47496
- if (!(!i || this._startLayerPoint.equals(i))) {
47497
- s$3.DomEvent.stop(t);
47498
- var o = e.layerPointToLatLng(this._startLayerPoint), a = e.layerPointToLatLng(i), n = new s$3.LatLngBounds(o, a);
47499
- this._autoDisable ? this.disable() : this._restoreCursor(), this._moved = false, s$3.Util.requestAnimFrame(function() {
47500
- e.fire(s$3.Map.SelectArea.SELECT_AREA_SELECTED, {
47501
- bounds: n,
47502
- start: o,
47503
- end: a
47504
- });
47505
- });
47506
- }
47507
- }
47508
- });
47509
- s$3.Map.mergeOptions({
47510
- selectArea: false
47511
- });
47512
- s$3.Map.addInitHook("addHandler", "selectArea", s$3.Map.SelectArea);
47513
- const l = s$3.Map.SelectArea;
47514
-
47515
- var index$1 = /*#__PURE__*/Object.freeze({
47516
- __proto__: null,
47517
- default: l
47518
- });
47519
-
47520
- leafletSrcExports.SVG.include({
47521
- /**
47522
- * Reset transform matrix
47523
- */
47524
- _resetTransformPath: function(t) {
47525
- t._path.setAttributeNS(null, "transform", "");
47526
- },
47527
- /**
47528
- * Applies matrix transformation to SVG
47529
- * @param {L.Path} layer
47530
- * @param {Array.<Number>} matrix
47531
- */
47532
- transformPath: function(t, i) {
47533
- t._path.setAttributeNS(
47534
- null,
47535
- "transform",
47536
- "matrix(" + i.join(" ") + ")"
47537
- );
47538
- }
47539
- });
47540
- leafletSrcExports.SVG.include(
47541
- leafletSrcExports.Browser.vml ? {
47542
- /**
47543
- * Reset transform matrix
47544
- */
47545
- _resetTransformPath: function(t) {
47546
- t._skew && (t._skew.on = false, t._path.removeChild(t._skew), t._skew = null);
47547
- },
47548
- /**
47549
- * Applies matrix transformation to VML
47550
- * @param {L.Path} layer
47551
- * @param {Array.<Number>} matrix
47552
- */
47553
- transformPath: function(t, i) {
47554
- let n = t._skew;
47555
- n || (n = leafletSrcExports.SVG.create("skew"), t._path.appendChild(n), n.style.behavior = "url(#default#VML)", t._skew = n);
47556
- const a = i[0].toFixed(8) + " " + i[1].toFixed(8) + " " + i[2].toFixed(8) + " " + i[3].toFixed(8) + " 0 0", r = Math.floor(i[4]).toFixed() + ", " + Math.floor(i[5]).toFixed(), s = this._path.style;
47557
- let e = parseFloat(s.left), o = parseFloat(s.top), _ = parseFloat(s.width), p = parseFloat(s.height);
47558
- isNaN(e) && (e = 0), isNaN(o) && (o = 0), (isNaN(_) || !_) && (_ = 1), (isNaN(p) || !p) && (p = 1);
47559
- const u = (-e / _ - 0.5).toFixed(8) + " " + (-o / p - 0.5).toFixed(8);
47560
- n.on = "f", n.matrix = a, n.origin = u, n.offset = r, n.on = true;
47561
- }
47562
- } : {}
47563
- );
47564
- function E() {
47565
- return true;
47566
- }
47567
- leafletSrcExports.Canvas.include({
47568
- /**
47569
- * Do nothing
47570
- * @param {L.Path} layer
47571
- */
47572
- _resetTransformPath: function(t) {
47573
- this._containerCopy && (delete this._containerCopy, t._containsPoint_ && (t._containsPoint = t._containsPoint_, delete t._containsPoint_, this._requestRedraw(t)));
47574
- },
47575
- /**
47576
- * Algorithm outline:
47577
- *
47578
- * 1. pre-transform - clear the path out of the canvas, copy canvas state
47579
- * 2. at every frame:
47580
- * 2.1. save
47581
- * 2.2. redraw the canvas from saved one
47582
- * 2.3. transform
47583
- * 2.4. draw path
47584
- * 2.5. restore
47585
- * 3. Repeat
47586
- *
47587
- * @param {L.Path} layer
47588
- * @param {Array.<Number>} matrix
47589
- */
47590
- transformPath: function(t, i) {
47591
- let n = this._containerCopy;
47592
- const a = this._ctx;
47593
- let r;
47594
- const s = leafletSrcExports.Browser.retina ? 2 : 1, e = this._bounds, o = e.getSize(), _ = e.min;
47595
- n || (n = this._containerCopy = document.createElement("canvas"), r = n.getContext("2d"), n.width = s * o.x, n.height = s * o.y, this._removePath(t), this._redraw(), r.translate(s * e.min.x, s * e.min.y), r.drawImage(this._container, 0, 0), this._initPath(t), t._containsPoint_ = t._containsPoint, t._containsPoint = E), a.save(), a.clearRect(_.x, _.y, o.x * s, o.y * s), a.setTransform(1, 0, 0, 1, 0, 0), a.restore(), a.save(), a.drawImage(this._containerCopy, 0, 0, o.x, o.y), a.transform.apply(a, i), this._drawing = true, t._updatePath(), this._drawing = false, a.restore();
47596
- }
47597
- });
47598
- /**
47599
- * Leaflet vector features drag functionality
47600
- * @author Alexander Milevski <info@w8r.name>
47601
- * @preserve
47602
- */
47603
- leafletSrcExports.Path.include({
47604
- /**
47605
- * Applies matrix transformation to SVG
47606
- * @param {Array.<Number>?} matrix
47607
- */
47608
- _transform: function(t) {
47609
- return this._renderer && (t ? this._renderer.transformPath(this, t) : (this._renderer._resetTransformPath(this), this._update())), this;
47610
- },
47611
- /**
47612
- * Check if the feature was dragged, that'll supress the click event
47613
- * on mouseup. That fixes popups for example
47614
- *
47615
- * @param {MouseEvent} e
47616
- */
47617
- _onMouseClick: function(t) {
47618
- this.dragging && this.dragging.moved() || this._map.dragging && this._map.dragging.moved() || this._fireMouseEvent(t);
47619
- }
47620
- });
47621
- const S = {
47622
- mousedown: "mouseup",
47623
- touchstart: "touchend",
47624
- pointerdown: "touchend",
47625
- MSPointerDown: "touchend"
47626
- }, M = {
47627
- mousedown: "mousemove",
47628
- touchstart: "touchmove",
47629
- pointerdown: "touchmove",
47630
- MSPointerDown: "touchmove"
47631
- };
47632
- function k(t, i) {
47633
- const n = t.x - i.x, a = t.y - i.y;
47634
- return Math.sqrt(n * n + a * a);
47635
- }
47636
- leafletSrcExports.Handler.PathDrag = leafletSrcExports.Handler.extend(
47637
- /** @lends L.Path.Drag.prototype */
47638
- {
47639
- statics: {
47640
- DRAGGING_CLS: "leaflet-path-draggable"
47641
- },
47642
- /**
47643
- * @param {L.Path} path
47644
- * @constructor
47645
- */
47646
- initialize: function(t) {
47647
- this._path = t, this._matrix = null, this._startPoint = null, this._dragStartPoint = null, this._mapDraggingWasEnabled = false, this._path._dragMoved = false;
47648
- },
47649
- /**
47650
- * Enable dragging
47651
- */
47652
- addHooks: function() {
47653
- this._path.on("mousedown", this._onDragStart, this), this._path.options.className = this._path.options.className ? this._path.options.className + " " + leafletSrcExports.Handler.PathDrag.DRAGGING_CLS : leafletSrcExports.Handler.PathDrag.DRAGGING_CLS, this._path._path && leafletSrcExports.DomUtil.addClass(this._path._path, leafletSrcExports.Handler.PathDrag.DRAGGING_CLS);
47654
- },
47655
- /**
47656
- * Disable dragging
47657
- */
47658
- removeHooks: function() {
47659
- this._path.off("mousedown", this._onDragStart, this), this._path.options.className = this._path.options.className.replace(
47660
- new RegExp("\\s+" + leafletSrcExports.Handler.PathDrag.DRAGGING_CLS),
47661
- ""
47662
- ), this._path._path && leafletSrcExports.DomUtil.removeClass(this._path._path, leafletSrcExports.Handler.PathDrag.DRAGGING_CLS);
47663
- },
47664
- /**
47665
- * @return {Boolean}
47666
- */
47667
- moved: function() {
47668
- return this._path._dragMoved;
47669
- },
47670
- /**
47671
- * Start drag
47672
- * @param {L.MouseEvent} evt
47673
- */
47674
- _onDragStart: function(t) {
47675
- const i = t.originalEvent._simulated ? "touchstart" : t.originalEvent.type;
47676
- this._mapDraggingWasEnabled = false, this._startPoint = t.containerPoint.clone(), this._dragStartPoint = t.containerPoint.clone(), this._matrix = [1, 0, 0, 1, 0, 0], leafletSrcExports.DomEvent.stop(t.originalEvent), leafletSrcExports.DomUtil.addClass(this._path._renderer._container, "leaflet-interactive"), leafletSrcExports.DomEvent.on(document, M[i], this._onDrag, this).on(
47677
- document,
47678
- S[i],
47679
- this._onDragEnd,
47680
- this
47681
- ), this._path._map.dragging.enabled() && (this._path._map.dragging.disable(), this._mapDraggingWasEnabled = true), this._path._dragMoved = false, this._path._popup && this._path._popup.close(), this._replaceCoordGetters(t);
47682
- },
47683
- /**
47684
- * Dragging
47685
- * @param {L.MouseEvent} evt
47686
- */
47687
- _onDrag: function(t) {
47688
- leafletSrcExports.DomEvent.stop(t);
47689
- const i = t.touches && t.touches.length >= 1 ? t.touches[0] : t, n = this._path._map.mouseEventToContainerPoint(i);
47690
- if (t.type === "touchmove" && !this._path._dragMoved && this._dragStartPoint.distanceTo(n) <= this._path._map.options.tapTolerance)
47691
- return;
47692
- const a = n.x, r = n.y, s = a - this._startPoint.x, e = r - this._startPoint.y;
47693
- (s || e) && (this._path._dragMoved || (this._path._dragMoved = true, this._path.options.interactive = false, this._path._map.dragging._draggable._moved = true, this._path.fire("dragstart", t), this._path.bringToFront()), this._matrix[4] += s, this._matrix[5] += e, this._startPoint.x = a, this._startPoint.y = r, this._path.fire("predrag", t), this._path._transform(this._matrix), this._path.fire("drag", t));
47694
- },
47695
- /**
47696
- * Dragging stopped, apply
47697
- * @param {L.MouseEvent} evt
47698
- */
47699
- _onDragEnd: function(t) {
47700
- const i = this._path._map.mouseEventToContainerPoint(t), n = this.moved();
47701
- if (n && (this._transformPoints(this._matrix), this._path._updatePath(), this._path._project(), this._path._transform(null), leafletSrcExports.DomEvent.stop(t)), leafletSrcExports.DomEvent.off(document, "mousemove touchmove", this._onDrag, this), leafletSrcExports.DomEvent.off(document, "mouseup touchend", this._onDragEnd, this), this._restoreCoordGetters(), n) {
47702
- this._path.fire("dragend", {
47703
- distance: k(this._dragStartPoint, i)
47704
- });
47705
- const a = this._path._containsPoint;
47706
- this._path._containsPoint = leafletSrcExports.Util.falseFn, leafletSrcExports.Util.requestAnimFrame(function() {
47707
- this._path._dragMoved = false, this._path.options.interactive = true, this._path._containsPoint = a;
47708
- }, this);
47709
- }
47710
- this._mapDraggingWasEnabled && this._path._map.dragging.enable();
47711
- },
47712
- /**
47713
- * Applies transformation, does it in one sweep for performance,
47714
- * so don't be surprised about the code repetition.
47715
- *
47716
- * [ x ] [ a b tx ] [ x ] [ a * x + b * y + tx ]
47717
- * [ y ] = [ c d ty ] [ y ] = [ c * x + d * y + ty ]
47718
- *
47719
- * @param {Array.<Number>} matrix
47720
- */
47721
- _transformPoints: function(t, i) {
47722
- const n = this._path, a = L.point(t[4], t[5]), r = n._map.options.crs, s = r.transformation, e = r.scale(n._map.getZoom()), o = r.projection, _ = s.untransform(a, e).subtract(s.untransform(leafletSrcExports.point(0, 0), e)), p = !i;
47723
- if (n._bounds = new leafletSrcExports.LatLngBounds(), n._point)
47724
- i = o.unproject(
47725
- o.project(n._latlng)._add(_)
47726
- ), p && (n._latlng = i, n._point._add(a));
47727
- else if (n._rings || n._parts) {
47728
- const u = n._rings || n._parts;
47729
- let c = n._latlngs;
47730
- i = i || c, leafletSrcExports.Util.isArray(c[0]) || (c = [c], i = [i]);
47731
- for (let g = 0, w = u.length; g < w; g++) {
47732
- i[g] = i[g] || [];
47733
- for (let d = 0, v = u[g].length; d < v; d++) {
47734
- const b = c[g][d];
47735
- i[g][d] = o.unproject(
47736
- o.project(b)._add(_)
47737
- ), p && (n._bounds.extend(c[g][d]), u[g][d]._add(a));
47738
- }
47739
- }
47740
- }
47741
- return i;
47742
- },
47743
- /**
47744
- * If you want to read the latlngs during the drag - your right,
47745
- * but they have to be transformed
47746
- */
47747
- _replaceCoordGetters: function() {
47748
- this._path.getLatLng ? (this._path.getLatLng_ = this._path.getLatLng, this._path.getLatLng = leafletSrcExports.Util.bind(function() {
47749
- return this.dragging._transformPoints(this.dragging._matrix, {});
47750
- }, this._path)) : this._path.getLatLngs && (this._path.getLatLngs_ = this._path.getLatLngs, this._path.getLatLngs = leafletSrcExports.Util.bind(function() {
47751
- return this.dragging._transformPoints(this.dragging._matrix, []);
47752
- }, this._path));
47753
- },
47754
- /**
47755
- * Put back the getters
47756
- */
47757
- _restoreCoordGetters: function() {
47758
- this._path.getLatLng_ ? (this._path.getLatLng = this._path.getLatLng_, delete this._path.getLatLng_) : this._path.getLatLngs_ && (this._path.getLatLngs = this._path.getLatLngs_, delete this._path.getLatLngs_);
47759
- }
47760
- }
47761
- );
47762
- leafletSrcExports.Handler.PathDrag.makeDraggable = function(t) {
47763
- return t.dragging = new leafletSrcExports.Handler.PathDrag(t), t;
47764
- };
47765
- leafletSrcExports.Path.prototype.makeDraggable = function() {
47766
- return leafletSrcExports.Handler.PathDrag.makeDraggable(this);
47767
- };
47768
- leafletSrcExports.Path.addInitHook(function() {
47769
- this.options.draggable ? (this.options.interactive = true, this.dragging ? this.dragging.enable() : (leafletSrcExports.Handler.PathDrag.makeDraggable(this), this.dragging.enable())) : this.dragging && this.dragging.disable();
47770
- });
47771
- const T = leafletSrcExports.Handler.PathDrag;
47772
-
47773
- var index = /*#__PURE__*/Object.freeze({
47774
- __proto__: null,
47775
- default: T
47776
- });
47777
-
47778
- var leafletArrows$2 = {exports: {}};
47779
-
47780
- var hasRequiredLeafletArrows;
47781
-
47782
- function requireLeafletArrows () {
47783
- if (hasRequiredLeafletArrows) return leafletArrows$2.exports;
47784
- hasRequiredLeafletArrows = 1;
47785
- (function (module, exports$1) {
47786
- // Leaflet Arrows by Meteotest
47787
- // https://github.com/meteotest/leaflet-arrows
47788
- // Module Loader Boilerplate
47789
- (function (factory, window) {
47790
- // define an AMD module that relies on 'leaflet'
47791
- {
47792
- module.exports = factory(requireLeafletSrc());
47793
- }
47794
- // attach your plugin to the global 'L' variable
47795
- if (typeof window !== 'undefined' && window.L) {
47796
- window.L.Arrow = factory(L);
47797
- }
47798
- })(function (L) {
47799
- // beware! the arrow factory
47800
- const Arrow = L.FeatureGroup.extend({
47801
- options: {
47802
- distanceUnit: 'km', // can be [px,km]
47803
- stretchFactor: 1, // should the distance be stretched?
47804
- arrowheadLength: 4, // in distance unit
47805
- arrowheadClosingLine: false, // should a closing third line be drawn?
47806
- arrowheadDegree: 155, // degree of arrowhead
47807
- clickableWidth: 10, // defines the width in pixels of the "phantom" path to capture click events on a line
47808
- //optional: popupContent: function(data) {},
47809
- // add your own custom validator, probably not needed...
47810
- // the validator gets the bound data object as argument
47811
- validator: function (data) {
47812
- return (typeof data.latlng !== 'undefined' &&
47813
- typeof data.distance !== 'undefined' &&
47814
- !isNaN(data.distance));
47815
- }, // validator is a callback function that takes the data object of the current point and returns whether it is 'valid'. Invalid arrows will be drawn gray
47816
- colorScheme: function () {
47817
- return this.color;
47818
- }, // add own colorscheme callback
47819
- circleRadiusInvalidPoint: 1000, // Radius of the circle to display missing or '0'-value
47820
- // path options
47821
- color: '#333',
47822
- opacity: 0.9, // stroke opacity
47823
- fillOpacity: 0.9,
47824
- weight: 4, // the width of the arrow
47825
- smoothFactor: 0,
47826
- radius: 5, // default radius, when distance is 0
47827
- defaultPointOptions: {
47828
- stroke: false,
47829
- fillOpacity: 0.8,
47830
- fillColor: '#111',
47831
- radius: 7,
47832
- },
47833
- invalidPointOptions: {
47834
- stroke: false,
47835
- fillOpacity: 0.8,
47836
- fillColor: 'red',
47837
- radius: 7,
47838
- },
47839
- drawSourceMarker: false,
47840
- sourceMarkerOptions: {
47841
- stroke: false,
47842
- fillOpacity: 1,
47843
- fillColor: '#333',
47844
- radius: 5,
47845
- },
47846
- },
47847
- /**
47848
- * The data opject needs at least following properties:
47849
- * - latlng : L.LatLng
47850
- * - degree : float
47851
- * - distance: float
47852
- */
47853
- initialize: function (data, options) {
47854
- L.Util.setOptions(this, options);
47855
- this.setData(data);
47856
- },
47857
- onAdd: function (map) {
47858
- this._map = map;
47859
- this.redraw();
47860
- // add a viewreset event listener for updating layer's position
47861
- map.on('viewreset', this._reset, this);
47862
- },
47863
- onRemove: function () {
47864
- // remove layer's DOM elements and listeners
47865
- for (const i in this._layers) {
47866
- if (this._layers.hasOwnProperty(i)) {
47867
- this._map.removeLayer(this._layers[i]);
47868
- }
47869
- }
47870
- if (typeof this._sourceMarker !== 'undefined') {
47871
- this._map.removeLayer(this._sourceMarker);
47872
- }
47873
- this._map.off('viewreset', this._reset, this);
47874
- },
47875
- // draw
47876
- redraw: function () {
47877
- // only draw when on map
47878
- if (!this._map) {
47879
- return;
47880
- }
47881
- this._layers = {};
47882
- // bind popup to the whole feature group
47883
- if (typeof this.options.popupContent === 'function') {
47884
- this.bindPopup(this.options.popupContent(this._data));
47885
- }
47886
- if (this._data.valid && typeof this.options.colorScheme === 'function') {
47887
- this.options.color = this.options.colorScheme(this._data);
47888
- }
47889
- this._data.distance = parseFloat(this._data.distance);
47890
- // if distance or degree is falsy/Zero then draw a point instead of an arrow
47891
- if (!this._data.valid || !this._data.distance || !this._data.angle) {
47892
- let circle;
47893
- const pathOptions = this._data.valid
47894
- ? this.options.defaultPointOptions
47895
- : this.options.invalidPointOptions;
47896
- if (this.options.distanceUnit.toLowerCase() === 'km') {
47897
- // use a tenth of the supplied radius (usally used in the circlemarker)
47898
- circle = L.circle(this._data.latlng, this.options.radius / 10, pathOptions);
47899
- }
47900
- else {
47901
- circle = L.circleMarker(this._data.latlng, pathOptions);
47902
- }
47903
- this.addLayer(circle);
47904
- }
47905
- else {
47906
- const theLine = [
47907
- this._data.latlng,
47908
- this._calculateEndPoint(this._data.latlng, this._data.distance, this._data.angle),
47909
- ];
47910
- const theArrow = this._calculateArrowArray(theLine[1]);
47911
- const backgroundPathOption = L.Util.setOptions({}, this.pathOptions);
47912
- backgroundPathOption.opacity = 0;
47913
- backgroundPathOption.weight = this.options.clickableWidth;
47914
- const invisibleBackgroundPolyline = new L.Polyline([theLine, theArrow], backgroundPathOption);
47915
- const polyline = new L.Polyline([theLine, theArrow], this.options);
47916
- this.addLayer(invisibleBackgroundPolyline);
47917
- this.addLayer(polyline);
47918
- // that special case, where a circle has to be drawn on the source of the arrow
47919
- if (this.options.drawSourceMarker) {
47920
- if (typeof this._sourceMarker === 'undefined') {
47921
- // use the same coloar as the arrow does
47922
- this.options.sourceMarkerOptions.fillColor = this.color;
47923
- this._sourceMarker = L.circleMarker(this._data.latlng, this.options.sourceMarkerOptions);
47924
- }
47925
- else {
47926
- // there is a chance, that the latlng values have been changed by the setData-function
47927
- this._sourceMarker.setLatLng(this._data.latlng);
47928
- }
47929
- }
47930
- }
47931
- },
47932
- // custom methods
47933
- // just change the angle of the arrow
47934
- setAngle: function (angle) {
47935
- if (isNaN(angle)) {
47936
- this._data.angle = 0; // undefined direction.
47937
- }
47938
- else {
47939
- if (this.options.isWindDegree) {
47940
- this._data.angle = angle - 180;
47941
- if (this.options.distanceUnit.toLowerCase() === 'px') {
47942
- this._data.angle -= 90;
47943
- }
47944
- }
47945
- else {
47946
- this._data.angle = angle;
47947
- }
47948
- }
47949
- this.redraw();
47950
- },
47951
- // just change the length of the arrow
47952
- setDistance: function (distance) {
47953
- if (isNaN(distance)) {
47954
- this._data.distance = 0;
47955
- }
47956
- else {
47957
- this._data.distance = parseFloat(distance);
47958
- }
47959
- this.redraw();
47960
- },
47961
- // use this method to update the whole dataset that corresponds to the arrow
47962
- setData: function (data) {
47963
- this._data = data;
47964
- if (this.options.validator(this._data)) {
47965
- this._data.valid = true;
47966
- this.setAngle(data.degree);
47967
- }
47968
- else {
47969
- this._data.valid = false;
47970
- this._data.distance = NaN;
47971
- this._data.degree = NaN;
47972
- }
47973
- },
47974
- // private methods
47975
- // When using Screen Pixels as unit, the arrows have to be
47976
- // recalculated after the zoom level has changed
47977
- _reset: function () {
47978
- if (this.options.distanceUnit.toLowerCase() === 'px') {
47979
- this.redraw();
47980
- }
47981
- },
47982
- _calculateEndPoint: function (latlng, dist, degree) {
47983
- /*
47984
- * http://www.codeguru.com/cpp/cpp/algorithms/article.php/c5115/Geographic-Distance-and-Azimuth-Calculations.htm
47985
- */
47986
- // don't use this._data here.
47987
- // this function is also used to find the points of the arrow
47988
- let distance = dist * this.options.stretchFactor, d2r = Math.PI / 180, // degree 2 radius
47989
- r2d = 180 / Math.PI;
47990
- if (this.options.distanceUnit.toLowerCase() === 'km') {
47991
- const R = 6378.137, // earth radius in kmeters
47992
- bearing = degree * d2r;
47993
- distance = distance / R;
47994
- const a = Math.acos(Math.cos(distance) * Math.cos((90 - latlng.lat) * d2r) +
47995
- Math.sin((90 - latlng.lat) * d2r) *
47996
- Math.sin(distance) *
47997
- Math.cos(bearing));
47998
- const B = Math.asin((Math.sin(distance) * Math.sin(bearing)) / Math.sin(a));
47999
- return new L.LatLng(90 - a * r2d, B * r2d + latlng.lng);
48000
- }
48001
- else if (this.options.distanceUnit.toLowerCase() === 'px') {
48002
- const sourcePoint = this._map.latLngToLayerPoint(latlng);
48003
- const rad = degree * d2r;
48004
- const vector = L.point(Math.cos(rad) * distance, Math.sin(rad) * distance);
48005
- const targetPoint = sourcePoint.add(vector);
48006
- return this._map.layerPointToLatLng(targetPoint);
48007
- }
48008
- else {
48009
- throw Error('calculate end point undefined for distanceUnit: ' +
48010
- this.options.distanceUnit);
48011
- }
48012
- },
48013
- _calculateArrowArray: function (latlng) {
48014
- // calculates the Array for the arrow
48015
- // latlng is the position, where the arrow is added
48016
- const degree = this._data.angle;
48017
- if (latlng.length !== undefined) {
48018
- latlng = new L.LatLng(latlng);
48019
- }
48020
- const firstEdge = this._calculateEndPoint(latlng, this.options.arrowheadLength, degree - this.options.arrowheadDegree);
48021
- const arr = [
48022
- firstEdge,
48023
- latlng,
48024
- this._calculateEndPoint(latlng, this.options.arrowheadLength, degree + this.options.arrowheadDegree),
48025
- ];
48026
- if (this.options.arrowheadClosingLine) {
48027
- arr.push(firstEdge);
48028
- }
48029
- return arr;
48030
- },
48031
- });
48032
- return Arrow;
48033
- }, window);
48034
-
48035
- } (leafletArrows$2));
48036
- return leafletArrows$2.exports;
48037
- }
48038
-
48039
- var leafletArrowsExports = requireLeafletArrows();
48040
- var leafletArrows = /*@__PURE__*/getDefaultExportFromCjs(leafletArrowsExports);
48041
-
48042
- var leafletArrows$1 = /*#__PURE__*/_mergeNamespaces({
48043
- __proto__: null,
48044
- default: leafletArrows
48045
- }, [leafletArrowsExports]);
48046
-
48047
46981
  exports.Accordion = Accordion;
48048
46982
  exports.AlertDialog = alertDialog;
48049
46983
  exports.AlertStore = AlertStore;