@dartcom/ui-kit 10.3.0 → 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++) {
@@ -16471,7 +16455,7 @@ const encodeString = (string) => {
16471
16455
  return encoded;
16472
16456
  };
16473
16457
  const getUrlencodedBody = (body) => {
16474
- const urlencodedBody = Object.keys(body).reduce((request, key, index) => `${request}${index === 0 ? '' : '&'}${key}=${body[key]}`, '');
16458
+ const urlencodedBody = new URLSearchParams(Object.entries(body).map(([key, value]) => [key, String(value)])).toString();
16475
16459
  return urlencodedBody;
16476
16460
  };
16477
16461
  const showSnackbar = ({ variant, message, }) => {
@@ -16534,6 +16518,27 @@ const getImageSrc = (path) => {
16534
16518
  const imageSrc = `${"$VITE_API_HOST/api-image/images"}/${path}`;
16535
16519
  return imageSrc;
16536
16520
  };
16521
+ const loadState = (name) => {
16522
+ try {
16523
+ const serializedState = localStorage.getItem(name);
16524
+ return serializedState ? JSON.parse(serializedState) : null;
16525
+ }
16526
+ catch {
16527
+ return null;
16528
+ }
16529
+ };
16530
+ const saveState = (name, state) => {
16531
+ try {
16532
+ const serializedState = JSON.stringify(state);
16533
+ localStorage.setItem(name, serializedState);
16534
+ }
16535
+ catch {
16536
+ return;
16537
+ }
16538
+ };
16539
+ const removeState = (name) => {
16540
+ localStorage.removeItem(name);
16541
+ };
16537
16542
 
16538
16543
  var niceErrors = {
16539
16544
  0: "Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",
@@ -17833,6 +17838,14 @@ function _endAction(runInfo) {
17833
17838
  }
17834
17839
  globalState.suppressReactionErrors = false;
17835
17840
  }
17841
+ function allowStateChanges(allowStateChanges, func) {
17842
+ var prev = allowStateChangesStart(allowStateChanges);
17843
+ try {
17844
+ return func();
17845
+ } finally {
17846
+ allowStateChangesEnd(prev);
17847
+ }
17848
+ }
17836
17849
  function allowStateChangesStart(allowStateChanges) {
17837
17850
  var prev = globalState.allowStateChanges;
17838
17851
  globalState.allowStateChanges = allowStateChanges;
@@ -19298,6 +19311,70 @@ function createSchedulerFromOptions(opts) {
19298
19311
  return setTimeout(f, opts.delay);
19299
19312
  } : run;
19300
19313
  }
19314
+ function reaction(expression, effect, opts) {
19315
+ var _opts$name2, _opts4, _opts5;
19316
+ if (opts === void 0) {
19317
+ opts = EMPTY_OBJECT;
19318
+ }
19319
+ if (process.env.NODE_ENV !== "production") {
19320
+ if (!isFunction$1(expression) || !isFunction$1(effect)) {
19321
+ die("First and second argument to reaction should be functions");
19322
+ }
19323
+ if (!isPlainObject$2(opts)) {
19324
+ die("Third argument of reactions should be an object");
19325
+ }
19326
+ }
19327
+ var name = (_opts$name2 = opts.name) != null ? _opts$name2 : process.env.NODE_ENV !== "production" ? "Reaction@" + getNextId() : "Reaction";
19328
+ var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);
19329
+ var runSync = !opts.scheduler && !opts.delay;
19330
+ var scheduler = createSchedulerFromOptions(opts);
19331
+ var firstTime = true;
19332
+ var isScheduled = false;
19333
+ var value;
19334
+ var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer["default"];
19335
+ var r = new Reaction(name, function () {
19336
+ if (firstTime || runSync) {
19337
+ reactionRunner();
19338
+ } else if (!isScheduled) {
19339
+ isScheduled = true;
19340
+ scheduler(reactionRunner);
19341
+ }
19342
+ }, opts.onError, opts.requiresObservable);
19343
+ function reactionRunner() {
19344
+ isScheduled = false;
19345
+ if (r.isDisposed) {
19346
+ return;
19347
+ }
19348
+ var changed = false;
19349
+ var oldValue = value;
19350
+ r.track(function () {
19351
+ var nextValue = allowStateChanges(false, function () {
19352
+ return expression(r);
19353
+ });
19354
+ changed = firstTime || !equals(value, nextValue);
19355
+ value = nextValue;
19356
+ });
19357
+ if (firstTime && opts.fireImmediately) {
19358
+ effectAction(value, oldValue, r);
19359
+ } else if (!firstTime && changed) {
19360
+ effectAction(value, oldValue, r);
19361
+ }
19362
+ firstTime = false;
19363
+ }
19364
+ if (!((_opts4 = opts) != null && (_opts4 = _opts4.signal) != null && _opts4.aborted)) {
19365
+ r.schedule_();
19366
+ }
19367
+ return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);
19368
+ }
19369
+ function wrapErrorHandler(errorHandler, baseFn) {
19370
+ return function () {
19371
+ try {
19372
+ return baseFn.apply(this, arguments);
19373
+ } catch (e) {
19374
+ errorHandler.call(this, e);
19375
+ }
19376
+ };
19377
+ }
19301
19378
 
19302
19379
  var ON_BECOME_OBSERVED = "onBO";
19303
19380
  var ON_BECOME_UNOBSERVED = "onBUO";
@@ -21990,6 +22067,12 @@ const alertStore = new AlertStore();
21990
22067
  class AuthStore {
21991
22068
  constructor() {
21992
22069
  makeAutoObservable(this);
22070
+ reaction(() => this.isUnauthorized, (value) => {
22071
+ if (value) {
22072
+ removeState('access_token');
22073
+ removeState('token_type');
22074
+ }
22075
+ });
21993
22076
  }
21994
22077
  _isUnauthorized = false;
21995
22078
  get isUnauthorized() {
@@ -22053,10 +22136,14 @@ class ApiService {
22053
22136
  this.setupInterceptors();
22054
22137
  }
22055
22138
  setupInterceptors() {
22056
- // Interceptor для запросов
22057
22139
  this.client.interceptors.request.use((config) => {
22058
22140
  rootStore.authStore.isUnauthorized = false;
22059
22141
  const headers = this.config?.getHeaders?.();
22142
+ const access_token = loadState('access_token');
22143
+ const token_type = loadState('token_type');
22144
+ if (access_token && token_type) {
22145
+ config.headers['Authorization'] = `${token_type} ${access_token}`;
22146
+ }
22060
22147
  if (headers) {
22061
22148
  Object.entries(headers).forEach(([key, value]) => {
22062
22149
  config.headers[key] = value;
@@ -22070,7 +22157,6 @@ class ApiService {
22070
22157
  });
22071
22158
  return Promise.reject(error);
22072
22159
  });
22073
- // Interceptor для ответов с обработкой ошибок
22074
22160
  this.client.interceptors.response.use((response) => response, (error) => {
22075
22161
  showSnackbar({
22076
22162
  message: error.message,
@@ -24962,20 +25048,28 @@ function useMutation(options, queryClient) {
24962
25048
  }
24963
25049
 
24964
25050
  const useGetUser = () => {
24965
- return useQuery({
25051
+ const query = useQuery({
24966
25052
  queryKey: ['user'],
24967
25053
  queryFn: async () => {
24968
25054
  const response = await GlobalConfig.instance.apiService.get({
24969
25055
  url: `user/`,
24970
- config: {
24971
- // TODO Заглушка
24972
- baseURL: 'http://89.108.118.23:2292',
24973
- },
24974
25056
  });
24975
25057
  return response;
24976
25058
  },
24977
- staleTime: 5 * 60 * 1000,
24978
25059
  });
25060
+ return query;
25061
+ };
25062
+ const useLazyGetUser = () => {
25063
+ const mutation = useMutation({
25064
+ mutationKey: ['user'],
25065
+ mutationFn: async () => {
25066
+ const response = await GlobalConfig.instance.apiService.get({
25067
+ url: `user/`,
25068
+ });
25069
+ return response;
25070
+ },
25071
+ });
25072
+ return mutation;
24979
25073
  };
24980
25074
 
24981
25075
  const useShowSnackbar = () => {
@@ -25029,7 +25123,6 @@ const useSignIn = () => {
25029
25123
  url: 'token',
25030
25124
  body,
25031
25125
  config: {
25032
- withCredentials: true,
25033
25126
  headers: {
25034
25127
  'Content-Type': 'application/x-www-form-urlencoded',
25035
25128
  },
@@ -25037,6 +25130,10 @@ const useSignIn = () => {
25037
25130
  });
25038
25131
  return response;
25039
25132
  },
25133
+ onSuccess: ({ access_token, token_type }) => {
25134
+ saveState('access_token', access_token);
25135
+ saveState('token_type', token_type);
25136
+ },
25040
25137
  });
25041
25138
  return mutation;
25042
25139
  };
@@ -26697,30 +26794,6 @@ const DartcomInitializeProvider = ({ children, configOptions }) => {
26697
26794
  return jsxRuntime.jsx(React__namespace.Fragment, { children: children });
26698
26795
  };
26699
26796
 
26700
- const MapProvider = ({ children }) => {
26701
- const [isReady, setIsReady] = React__namespace.useState(false);
26702
- const init = async () => {
26703
- try {
26704
- await Promise.resolve().then(function () { return tangram_min; });
26705
- await Promise.resolve().then(function () { return leaflet_rotatedMarker; });
26706
- await Promise.resolve().then(function () { return leaflet_polylineoffset$1; });
26707
- await Promise.resolve().then(function () { return index$1; });
26708
- await Promise.resolve().then(function () { return index; });
26709
- await Promise.resolve().then(function () { return leafletArrows$1; });
26710
- setIsReady(true);
26711
- }
26712
- catch {
26713
- setIsReady(false);
26714
- }
26715
- };
26716
- React__namespace.useEffect(() => {
26717
- init();
26718
- }, []);
26719
- if (!isReady)
26720
- return null;
26721
- return jsxRuntime.jsx(React__namespace.Fragment, { children: children });
26722
- };
26723
-
26724
26797
  const queryClient = new QueryClient();
26725
26798
  const QueryProvider = (props) => (jsxRuntime.jsx(QueryClientProvider, { ...props, client: queryClient }));
26726
26799
 
@@ -26730,7 +26803,7 @@ const DartcomThemeProvider = ({ children, themeOptions }) => {
26730
26803
  };
26731
26804
 
26732
26805
  const DartcomProviders = ({ children, configOptions, themeOptions }) => {
26733
- 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 }) }) }) }) }) }));
26734
26807
  };
26735
26808
 
26736
26809
  const useSignOut = () => {
@@ -44345,10 +44418,10 @@ function requirePapaparse_min () {
44345
44418
  var papaparse_minExports = requirePapaparse_min();
44346
44419
  var e = /*@__PURE__*/getDefaultExportFromCjs(papaparse_minExports);
44347
44420
 
44348
- "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;
44349
44422
 
44350
44423
  const CSVUploader = ({ onDataParsed, onError, delimiter = ',', header = true, dynamicTyping = true, skipEmptyLines = true, worker = false, }) => {
44351
- const { readString } = S$1();
44424
+ const { readString } = S();
44352
44425
  const [loading, setLoading] = React__namespace.useState(false);
44353
44426
  const [error, setError] = React__namespace.useState(null);
44354
44427
  return (jsxRuntime.jsx(UploadButton, { accept: ".csv", loading: loading, error: error, onFilesLoad: ({ files }) => {
@@ -46800,7 +46873,7 @@ const defaultValues = {
46800
46873
  password: '',
46801
46874
  };
46802
46875
 
46803
- 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,"")}
46804
46877
 
46805
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)}}}
46806
46879
 
@@ -46901,1036 +46974,10 @@ try {
46901
46974
  }
46902
46975
  } catch(e) {}
46903
46976
 
46904
- var Tangram$1 = Tangram;
46905
-
46906
46977
  var tangram_min = /*#__PURE__*/Object.freeze({
46907
- __proto__: null,
46908
- default: Tangram$1
46909
- });
46910
-
46911
- (function() {
46912
- // save these original methods before they are overwritten
46913
- var proto_initIcon = L.Marker.prototype._initIcon;
46914
- var proto_setPos = L.Marker.prototype._setPos;
46915
-
46916
- var oldIE = (L.DomUtil.TRANSFORM === 'msTransform');
46917
-
46918
- L.Marker.addInitHook(function () {
46919
- var iconOptions = this.options.icon && this.options.icon.options;
46920
- var iconAnchor = iconOptions && this.options.icon.options.iconAnchor;
46921
- if (iconAnchor) {
46922
- iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px');
46923
- }
46924
- this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom' ;
46925
- this.options.rotationAngle = this.options.rotationAngle || 0;
46926
-
46927
- // Ensure marker keeps rotated during dragging
46928
- this.on('drag', function(e) { e.target._applyRotation(); });
46929
- });
46930
-
46931
- L.Marker.include({
46932
- _initIcon: function() {
46933
- proto_initIcon.call(this);
46934
- },
46935
-
46936
- _setPos: function (pos) {
46937
- proto_setPos.call(this, pos);
46938
- this._applyRotation();
46939
- },
46940
-
46941
- _applyRotation: function () {
46942
- if(this.options.rotationAngle) {
46943
- this._icon.style[L.DomUtil.TRANSFORM+'Origin'] = this.options.rotationOrigin;
46944
-
46945
- if(oldIE) {
46946
- // for IE 9, use the 2D rotation
46947
- this._icon.style[L.DomUtil.TRANSFORM] = 'rotate(' + this.options.rotationAngle + 'deg)';
46948
- } else {
46949
- // for modern browsers, prefer the 3D accelerated version
46950
- this._icon.style[L.DomUtil.TRANSFORM] += ' rotateZ(' + this.options.rotationAngle + 'deg)';
46951
- }
46952
- }
46953
- },
46954
-
46955
- setRotationAngle: function(angle) {
46956
- this.options.rotationAngle = angle;
46957
- this.update();
46958
- return this;
46959
- },
46960
-
46961
- setRotationOrigin: function(origin) {
46962
- this.options.rotationOrigin = origin;
46963
- this.update();
46964
- return this;
46965
- }
46966
- });
46967
- })();
46968
-
46969
- var leaflet_rotatedMarker = /*#__PURE__*/Object.freeze({
46970
46978
  __proto__: null
46971
46979
  });
46972
46980
 
46973
- var leaflet_polylineoffset$2 = {exports: {}};
46974
-
46975
- var hasRequiredLeaflet_polylineoffset;
46976
-
46977
- function requireLeaflet_polylineoffset () {
46978
- if (hasRequiredLeaflet_polylineoffset) return leaflet_polylineoffset$2.exports;
46979
- hasRequiredLeaflet_polylineoffset = 1;
46980
- (function (module, exports$1) {
46981
- (function (factory, window) {
46982
- {
46983
- module.exports = factory(requireLeafletSrc());
46984
- }
46985
- if (typeof window !== 'undefined' && window.L) {
46986
- window.L.PolylineOffset = factory(L);
46987
- }
46988
- }(function (L) {
46989
-
46990
- function forEachPair(list, callback) {
46991
- if (!list || list.length < 1) { return; }
46992
- for (var i = 1, l = list.length; i < l; i++) {
46993
- callback(list[i-1], list[i]);
46994
- }
46995
- }
46996
-
46997
- /**
46998
- Find the coefficients (a,b) of a line of equation y = a.x + b,
46999
- or the constant x for vertical lines
47000
- Return null if there's no equation possible
47001
- */
47002
- function lineEquation(pt1, pt2) {
47003
- if (pt1.x === pt2.x) {
47004
- return pt1.y === pt2.y ? null : { x: pt1.x };
47005
- }
47006
-
47007
- var a = (pt2.y - pt1.y) / (pt2.x - pt1.x);
47008
- return {
47009
- a: a,
47010
- b: pt1.y - a * pt1.x,
47011
- };
47012
- }
47013
-
47014
- /**
47015
- Return the intersection point of two lines defined by two points each
47016
- Return null when there's no unique intersection
47017
- */
47018
- function intersection(l1a, l1b, l2a, l2b) {
47019
- var line1 = lineEquation(l1a, l1b);
47020
- var line2 = lineEquation(l2a, l2b);
47021
-
47022
- if (line1 === null || line2 === null) {
47023
- return null;
47024
- }
47025
-
47026
- if (line1.hasOwnProperty('x')) {
47027
- return line2.hasOwnProperty('x')
47028
- ? null
47029
- : {
47030
- x: line1.x,
47031
- y: line2.a * line1.x + line2.b,
47032
- };
47033
- }
47034
- if (line2.hasOwnProperty('x')) {
47035
- return {
47036
- x: line2.x,
47037
- y: line1.a * line2.x + line1.b,
47038
- };
47039
- }
47040
-
47041
- if (line1.a === line2.a) {
47042
- return null;
47043
- }
47044
-
47045
- var x = (line2.b - line1.b) / (line1.a - line2.a);
47046
- return {
47047
- x: x,
47048
- y: line1.a * x + line1.b,
47049
- };
47050
- }
47051
-
47052
- function translatePoint(pt, dist, heading) {
47053
- return {
47054
- x: pt.x + dist * Math.cos(heading),
47055
- y: pt.y + dist * Math.sin(heading),
47056
- };
47057
- }
47058
-
47059
- var PolylineOffset = {
47060
- offsetPointLine: function(points, distance) {
47061
- var offsetSegments = [];
47062
-
47063
- forEachPair(points, L.bind(function(a, b) {
47064
- if (a.x === b.x && a.y === b.y) { return; }
47065
-
47066
- // angles in (-PI, PI]
47067
- var segmentAngle = Math.atan2(a.y - b.y, a.x - b.x);
47068
- var offsetAngle = segmentAngle - Math.PI/2;
47069
-
47070
- offsetSegments.push({
47071
- offsetAngle: offsetAngle,
47072
- original: [a, b],
47073
- offset: [
47074
- translatePoint(a, distance, offsetAngle),
47075
- translatePoint(b, distance, offsetAngle)
47076
- ]
47077
- });
47078
- }, this));
47079
-
47080
- return offsetSegments;
47081
- },
47082
-
47083
- offsetPoints: function(pts, offset) {
47084
- var offsetSegments = this.offsetPointLine(pts, offset);
47085
- return this.joinLineSegments(offsetSegments, offset);
47086
- },
47087
-
47088
- /**
47089
- Join 2 line segments defined by 2 points each with a circular arc
47090
- */
47091
- joinSegments: function(s1, s2, offset) {
47092
- // TODO: different join styles
47093
- return this.circularArc(s1, s2, offset)
47094
- .filter(function(x) { return x; })
47095
- },
47096
-
47097
- joinLineSegments: function(segments, offset) {
47098
- var joinedPoints = [];
47099
- var first = segments[0];
47100
- var last = segments[segments.length - 1];
47101
-
47102
- if (first && last) {
47103
- joinedPoints.push(first.offset[0]);
47104
- forEachPair(segments, L.bind(function(s1, s2) {
47105
- joinedPoints = joinedPoints.concat(this.joinSegments(s1, s2, offset));
47106
- }, this));
47107
- joinedPoints.push(last.offset[1]);
47108
- }
47109
-
47110
- return joinedPoints;
47111
- },
47112
-
47113
- segmentAsVector: function(s) {
47114
- return {
47115
- x: s[1].x - s[0].x,
47116
- y: s[1].y - s[0].y,
47117
- };
47118
- },
47119
-
47120
- getSignedAngle: function(s1, s2) {
47121
- const a = this.segmentAsVector(s1);
47122
- const b = this.segmentAsVector(s2);
47123
- return Math.atan2(a.x * b.y - a.y * b.x, a.x * b.x + a.y * b.y);
47124
- },
47125
-
47126
- /**
47127
- Interpolates points between two offset segments in a circular form
47128
- */
47129
- circularArc: function(s1, s2, distance) {
47130
- // if the segments are the same angle,
47131
- // there should be a single join point
47132
- if (s1.offsetAngle === s2.offsetAngle) {
47133
- return [s1.offset[1]];
47134
- }
47135
-
47136
- const signedAngle = this.getSignedAngle(s1.offset, s2.offset);
47137
- // for inner angles, just find the offset segments intersection
47138
- if ((signedAngle * distance > 0) &&
47139
- (signedAngle * this.getSignedAngle(s1.offset, [s1.offset[0], s2.offset[1]]) > 0)) {
47140
- return [intersection(s1.offset[0], s1.offset[1], s2.offset[0], s2.offset[1])];
47141
- }
47142
-
47143
- // draws a circular arc with R = offset distance, C = original meeting point
47144
- var points = [];
47145
- var center = s1.original[1];
47146
- // ensure angles go in the anti-clockwise direction
47147
- var rightOffset = distance > 0;
47148
- var startAngle = rightOffset ? s2.offsetAngle : s1.offsetAngle;
47149
- var endAngle = rightOffset ? s1.offsetAngle : s2.offsetAngle;
47150
- // and that the end angle is bigger than the start angle
47151
- if (endAngle < startAngle) {
47152
- endAngle += Math.PI * 2;
47153
- }
47154
- var step = Math.PI / 8;
47155
- for (var alpha = startAngle; alpha < endAngle; alpha += step) {
47156
- points.push(translatePoint(center, distance, alpha));
47157
- }
47158
- points.push(translatePoint(center, distance, endAngle));
47159
-
47160
- return rightOffset ? points.reverse() : points;
47161
- }
47162
- };
47163
-
47164
- // Modify the L.Polyline class by overwriting the projection function
47165
- L.Polyline.include({
47166
- _projectLatlngs: function (latlngs, result, projectedBounds) {
47167
- var isFlat = latlngs.length > 0 && latlngs[0] instanceof L.LatLng;
47168
-
47169
- if (isFlat) {
47170
- var ring = latlngs.map(L.bind(function(ll) {
47171
- var point = this._map.latLngToLayerPoint(ll);
47172
- if (projectedBounds) {
47173
- projectedBounds.extend(point);
47174
- }
47175
- return point;
47176
- }, this));
47177
-
47178
- // Offset management hack ---
47179
- if (this.options.offset) {
47180
- ring = L.PolylineOffset.offsetPoints(ring, this.options.offset);
47181
- }
47182
- // Offset management hack END ---
47183
-
47184
- result.push(ring.map(function (xy) {
47185
- return L.point(xy.x, xy.y);
47186
- }));
47187
- } else {
47188
- latlngs.forEach(L.bind(function(ll) {
47189
- this._projectLatlngs(ll, result, projectedBounds);
47190
- }, this));
47191
- }
47192
- }
47193
- });
47194
-
47195
- L.Polyline.include({
47196
- setOffset: function(offset) {
47197
- this.options.offset = offset;
47198
- this.redraw();
47199
- return this;
47200
- }
47201
- });
47202
-
47203
- return PolylineOffset;
47204
-
47205
- }, window));
47206
- } (leaflet_polylineoffset$2));
47207
- return leaflet_polylineoffset$2.exports;
47208
- }
47209
-
47210
- var leaflet_polylineoffsetExports = requireLeaflet_polylineoffset();
47211
- var leaflet_polylineoffset = /*@__PURE__*/getDefaultExportFromCjs(leaflet_polylineoffsetExports);
47212
-
47213
- var leaflet_polylineoffset$1 = /*#__PURE__*/_mergeNamespaces({
47214
- __proto__: null,
47215
- default: leaflet_polylineoffset
47216
- }, [leaflet_polylineoffsetExports]);
47217
-
47218
- /**
47219
- * L.Map.SelectArea - Area selection tool for leaflet
47220
- *
47221
- * @author Alexander Milevski <info@w8r.name>
47222
- * @see https://github.com/w8r/leaflet-area-select
47223
- * @license MIT
47224
- * @preserve
47225
- */
47226
- var r = function() {
47227
- return true;
47228
- };
47229
- s$3.Map.SelectArea = s$3.Map.BoxZoom.extend({
47230
- statics: {
47231
- /**
47232
- * @static
47233
- * @type {String}
47234
- */
47235
- SELECT_AREA_SELECTED: "selectarea:selected",
47236
- /**
47237
- * @static
47238
- * @type {String}
47239
- */
47240
- SELECT_AREA_START: "selectarea:start",
47241
- /**
47242
- * @static
47243
- * @type {String}
47244
- */
47245
- SELECT_AREA_TOGGLED: "selectarea:toggled"
47246
- },
47247
- options: {
47248
- shiftKey: false,
47249
- ctrlKey: true,
47250
- validate: r,
47251
- autoDisable: false,
47252
- cursor: "crosshair"
47253
- },
47254
- /**
47255
- * @param {L.Map} map
47256
- * @constructor
47257
- */
47258
- initialize: function(t, e) {
47259
- 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);
47260
- },
47261
- /**
47262
- * @param {Function=} validate
47263
- * @return {SelectArea}
47264
- */
47265
- setValidate: function(t) {
47266
- var e = this;
47267
- return typeof t != "function" && (t = r), this._validate = function(i) {
47268
- return t.call(e, i);
47269
- }, this;
47270
- },
47271
- /**
47272
- * @param {Boolean} autoDisable
47273
- */
47274
- setAutoDisable: function(t) {
47275
- this._autoDisable = !!t;
47276
- },
47277
- /**
47278
- * @param {Boolean} on
47279
- */
47280
- setControlKey: function(t) {
47281
- var e = this._enabled;
47282
- e && this.disable(), this.options.ctrlKey = !!t, t && (this.options.shiftKey = false), e && this.enable();
47283
- },
47284
- /**
47285
- * @param {Boolean} on
47286
- */
47287
- setShiftKey: function(t) {
47288
- var e = this._enabled;
47289
- e && this.disable(), this.options.shiftKey = !!t, t && (this.options.ctrlKey = false), e && this.enable();
47290
- },
47291
- /**
47292
- * Disable dragging or zoombox
47293
- * @param {Function=} validate
47294
- * @param {Boolean=} autoDisable
47295
- */
47296
- enable: function(t, e) {
47297
- 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);
47298
- },
47299
- /**
47300
- * Re-enable box zoom or dragging
47301
- */
47302
- disable: function() {
47303
- 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);
47304
- },
47305
- /**
47306
- * Also listen to ESC to cancel interaction
47307
- * @override
47308
- */
47309
- addHooks: function() {
47310
- 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);
47311
- },
47312
- /**
47313
- * @override
47314
- */
47315
- removeHooks: function() {
47316
- 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);
47317
- },
47318
- /**
47319
- * @override
47320
- */
47321
- _onMouseDown: function(t) {
47322
- if (this._moved = false, this._lastLayerPoint = null, this.options.shiftKey && !t.shiftKey || this.options.ctrlKey && !t.ctrlKey || t.which !== 1 && t.button !== 1)
47323
- return false;
47324
- s$3.DomEvent.stop(t);
47325
- var e = this._map.mouseEventToLayerPoint(t);
47326
- if (!this._validate(e)) return false;
47327
- 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);
47328
- },
47329
- /**
47330
- * @override
47331
- */
47332
- _onMouseMove: function(t) {
47333
- 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));
47334
- var e = this._startLayerPoint, i = this._box, o = this._map.mouseEventToLayerPoint(t), a = o.subtract(e);
47335
- if (this._validate(o)) {
47336
- this._lastLayerPoint = o;
47337
- var n = new s$3.Point(
47338
- Math.min(o.x, e.x),
47339
- Math.min(o.y, e.y)
47340
- );
47341
- 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";
47342
- }
47343
- },
47344
- /**
47345
- * General on/off toggle
47346
- * @param {KeyboardEvent} e
47347
- */
47348
- _onKeyUp: function(t) {
47349
- t.keyCode === 27 ? this._moved && this._box && this._finish() : this.options.ctrlKey && (this._restoreCursor(), this._map.dragging.enable());
47350
- },
47351
- /**
47352
- * Key down listener to enable on ctrl-press
47353
- * @param {KeyboardEvent} e
47354
- */
47355
- _onKeyPress: function(t) {
47356
- this.options.ctrlKey && (t.ctrlKey || t.type === "dragstart") && this._beforeCursor === null && (this._setCursor(), this._map.dragging._draggable._onUp(t), this._map.dragging.disable());
47357
- },
47358
- /**
47359
- * Window blur listener to restore state
47360
- * @param {Event} e
47361
- */
47362
- _onBlur: function(t) {
47363
- this._restoreCursor(), this._map.dragging.enable();
47364
- },
47365
- /**
47366
- * Set crosshair cursor
47367
- */
47368
- _setCursor: function() {
47369
- this._beforeCursor = this._container.style.cursor, this._container.style.cursor = this.options.cursor;
47370
- },
47371
- /**
47372
- * Restore status quo cursor
47373
- */
47374
- _restoreCursor: function() {
47375
- this._container.style.cursor = this._beforeCursor, this._beforeCursor = null;
47376
- },
47377
- /**
47378
- * @override
47379
- */
47380
- _onMouseUp: function(t) {
47381
- this._finish();
47382
- var e = this._map, i = this._lastLayerPoint;
47383
- if (!(!i || this._startLayerPoint.equals(i))) {
47384
- s$3.DomEvent.stop(t);
47385
- var o = e.layerPointToLatLng(this._startLayerPoint), a = e.layerPointToLatLng(i), n = new s$3.LatLngBounds(o, a);
47386
- this._autoDisable ? this.disable() : this._restoreCursor(), this._moved = false, s$3.Util.requestAnimFrame(function() {
47387
- e.fire(s$3.Map.SelectArea.SELECT_AREA_SELECTED, {
47388
- bounds: n,
47389
- start: o,
47390
- end: a
47391
- });
47392
- });
47393
- }
47394
- }
47395
- });
47396
- s$3.Map.mergeOptions({
47397
- selectArea: false
47398
- });
47399
- s$3.Map.addInitHook("addHandler", "selectArea", s$3.Map.SelectArea);
47400
- const l = s$3.Map.SelectArea;
47401
-
47402
- var index$1 = /*#__PURE__*/Object.freeze({
47403
- __proto__: null,
47404
- default: l
47405
- });
47406
-
47407
- leafletSrcExports.SVG.include({
47408
- /**
47409
- * Reset transform matrix
47410
- */
47411
- _resetTransformPath: function(t) {
47412
- t._path.setAttributeNS(null, "transform", "");
47413
- },
47414
- /**
47415
- * Applies matrix transformation to SVG
47416
- * @param {L.Path} layer
47417
- * @param {Array.<Number>} matrix
47418
- */
47419
- transformPath: function(t, i) {
47420
- t._path.setAttributeNS(
47421
- null,
47422
- "transform",
47423
- "matrix(" + i.join(" ") + ")"
47424
- );
47425
- }
47426
- });
47427
- leafletSrcExports.SVG.include(
47428
- leafletSrcExports.Browser.vml ? {
47429
- /**
47430
- * Reset transform matrix
47431
- */
47432
- _resetTransformPath: function(t) {
47433
- t._skew && (t._skew.on = false, t._path.removeChild(t._skew), t._skew = null);
47434
- },
47435
- /**
47436
- * Applies matrix transformation to VML
47437
- * @param {L.Path} layer
47438
- * @param {Array.<Number>} matrix
47439
- */
47440
- transformPath: function(t, i) {
47441
- let n = t._skew;
47442
- n || (n = leafletSrcExports.SVG.create("skew"), t._path.appendChild(n), n.style.behavior = "url(#default#VML)", t._skew = n);
47443
- 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;
47444
- let e = parseFloat(s.left), o = parseFloat(s.top), _ = parseFloat(s.width), p = parseFloat(s.height);
47445
- isNaN(e) && (e = 0), isNaN(o) && (o = 0), (isNaN(_) || !_) && (_ = 1), (isNaN(p) || !p) && (p = 1);
47446
- const u = (-e / _ - 0.5).toFixed(8) + " " + (-o / p - 0.5).toFixed(8);
47447
- n.on = "f", n.matrix = a, n.origin = u, n.offset = r, n.on = true;
47448
- }
47449
- } : {}
47450
- );
47451
- function E() {
47452
- return true;
47453
- }
47454
- leafletSrcExports.Canvas.include({
47455
- /**
47456
- * Do nothing
47457
- * @param {L.Path} layer
47458
- */
47459
- _resetTransformPath: function(t) {
47460
- this._containerCopy && (delete this._containerCopy, t._containsPoint_ && (t._containsPoint = t._containsPoint_, delete t._containsPoint_, this._requestRedraw(t)));
47461
- },
47462
- /**
47463
- * Algorithm outline:
47464
- *
47465
- * 1. pre-transform - clear the path out of the canvas, copy canvas state
47466
- * 2. at every frame:
47467
- * 2.1. save
47468
- * 2.2. redraw the canvas from saved one
47469
- * 2.3. transform
47470
- * 2.4. draw path
47471
- * 2.5. restore
47472
- * 3. Repeat
47473
- *
47474
- * @param {L.Path} layer
47475
- * @param {Array.<Number>} matrix
47476
- */
47477
- transformPath: function(t, i) {
47478
- let n = this._containerCopy;
47479
- const a = this._ctx;
47480
- let r;
47481
- const s = leafletSrcExports.Browser.retina ? 2 : 1, e = this._bounds, o = e.getSize(), _ = e.min;
47482
- 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();
47483
- }
47484
- });
47485
- /**
47486
- * Leaflet vector features drag functionality
47487
- * @author Alexander Milevski <info@w8r.name>
47488
- * @preserve
47489
- */
47490
- leafletSrcExports.Path.include({
47491
- /**
47492
- * Applies matrix transformation to SVG
47493
- * @param {Array.<Number>?} matrix
47494
- */
47495
- _transform: function(t) {
47496
- return this._renderer && (t ? this._renderer.transformPath(this, t) : (this._renderer._resetTransformPath(this), this._update())), this;
47497
- },
47498
- /**
47499
- * Check if the feature was dragged, that'll supress the click event
47500
- * on mouseup. That fixes popups for example
47501
- *
47502
- * @param {MouseEvent} e
47503
- */
47504
- _onMouseClick: function(t) {
47505
- this.dragging && this.dragging.moved() || this._map.dragging && this._map.dragging.moved() || this._fireMouseEvent(t);
47506
- }
47507
- });
47508
- const S = {
47509
- mousedown: "mouseup",
47510
- touchstart: "touchend",
47511
- pointerdown: "touchend",
47512
- MSPointerDown: "touchend"
47513
- }, M = {
47514
- mousedown: "mousemove",
47515
- touchstart: "touchmove",
47516
- pointerdown: "touchmove",
47517
- MSPointerDown: "touchmove"
47518
- };
47519
- function k(t, i) {
47520
- const n = t.x - i.x, a = t.y - i.y;
47521
- return Math.sqrt(n * n + a * a);
47522
- }
47523
- leafletSrcExports.Handler.PathDrag = leafletSrcExports.Handler.extend(
47524
- /** @lends L.Path.Drag.prototype */
47525
- {
47526
- statics: {
47527
- DRAGGING_CLS: "leaflet-path-draggable"
47528
- },
47529
- /**
47530
- * @param {L.Path} path
47531
- * @constructor
47532
- */
47533
- initialize: function(t) {
47534
- this._path = t, this._matrix = null, this._startPoint = null, this._dragStartPoint = null, this._mapDraggingWasEnabled = false, this._path._dragMoved = false;
47535
- },
47536
- /**
47537
- * Enable dragging
47538
- */
47539
- addHooks: function() {
47540
- 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);
47541
- },
47542
- /**
47543
- * Disable dragging
47544
- */
47545
- removeHooks: function() {
47546
- this._path.off("mousedown", this._onDragStart, this), this._path.options.className = this._path.options.className.replace(
47547
- new RegExp("\\s+" + leafletSrcExports.Handler.PathDrag.DRAGGING_CLS),
47548
- ""
47549
- ), this._path._path && leafletSrcExports.DomUtil.removeClass(this._path._path, leafletSrcExports.Handler.PathDrag.DRAGGING_CLS);
47550
- },
47551
- /**
47552
- * @return {Boolean}
47553
- */
47554
- moved: function() {
47555
- return this._path._dragMoved;
47556
- },
47557
- /**
47558
- * Start drag
47559
- * @param {L.MouseEvent} evt
47560
- */
47561
- _onDragStart: function(t) {
47562
- const i = t.originalEvent._simulated ? "touchstart" : t.originalEvent.type;
47563
- 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(
47564
- document,
47565
- S[i],
47566
- this._onDragEnd,
47567
- this
47568
- ), 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);
47569
- },
47570
- /**
47571
- * Dragging
47572
- * @param {L.MouseEvent} evt
47573
- */
47574
- _onDrag: function(t) {
47575
- leafletSrcExports.DomEvent.stop(t);
47576
- const i = t.touches && t.touches.length >= 1 ? t.touches[0] : t, n = this._path._map.mouseEventToContainerPoint(i);
47577
- if (t.type === "touchmove" && !this._path._dragMoved && this._dragStartPoint.distanceTo(n) <= this._path._map.options.tapTolerance)
47578
- return;
47579
- const a = n.x, r = n.y, s = a - this._startPoint.x, e = r - this._startPoint.y;
47580
- (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));
47581
- },
47582
- /**
47583
- * Dragging stopped, apply
47584
- * @param {L.MouseEvent} evt
47585
- */
47586
- _onDragEnd: function(t) {
47587
- const i = this._path._map.mouseEventToContainerPoint(t), n = this.moved();
47588
- 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) {
47589
- this._path.fire("dragend", {
47590
- distance: k(this._dragStartPoint, i)
47591
- });
47592
- const a = this._path._containsPoint;
47593
- this._path._containsPoint = leafletSrcExports.Util.falseFn, leafletSrcExports.Util.requestAnimFrame(function() {
47594
- this._path._dragMoved = false, this._path.options.interactive = true, this._path._containsPoint = a;
47595
- }, this);
47596
- }
47597
- this._mapDraggingWasEnabled && this._path._map.dragging.enable();
47598
- },
47599
- /**
47600
- * Applies transformation, does it in one sweep for performance,
47601
- * so don't be surprised about the code repetition.
47602
- *
47603
- * [ x ] [ a b tx ] [ x ] [ a * x + b * y + tx ]
47604
- * [ y ] = [ c d ty ] [ y ] = [ c * x + d * y + ty ]
47605
- *
47606
- * @param {Array.<Number>} matrix
47607
- */
47608
- _transformPoints: function(t, i) {
47609
- 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;
47610
- if (n._bounds = new leafletSrcExports.LatLngBounds(), n._point)
47611
- i = o.unproject(
47612
- o.project(n._latlng)._add(_)
47613
- ), p && (n._latlng = i, n._point._add(a));
47614
- else if (n._rings || n._parts) {
47615
- const u = n._rings || n._parts;
47616
- let c = n._latlngs;
47617
- i = i || c, leafletSrcExports.Util.isArray(c[0]) || (c = [c], i = [i]);
47618
- for (let g = 0, w = u.length; g < w; g++) {
47619
- i[g] = i[g] || [];
47620
- for (let d = 0, v = u[g].length; d < v; d++) {
47621
- const b = c[g][d];
47622
- i[g][d] = o.unproject(
47623
- o.project(b)._add(_)
47624
- ), p && (n._bounds.extend(c[g][d]), u[g][d]._add(a));
47625
- }
47626
- }
47627
- }
47628
- return i;
47629
- },
47630
- /**
47631
- * If you want to read the latlngs during the drag - your right,
47632
- * but they have to be transformed
47633
- */
47634
- _replaceCoordGetters: function() {
47635
- this._path.getLatLng ? (this._path.getLatLng_ = this._path.getLatLng, this._path.getLatLng = leafletSrcExports.Util.bind(function() {
47636
- return this.dragging._transformPoints(this.dragging._matrix, {});
47637
- }, this._path)) : this._path.getLatLngs && (this._path.getLatLngs_ = this._path.getLatLngs, this._path.getLatLngs = leafletSrcExports.Util.bind(function() {
47638
- return this.dragging._transformPoints(this.dragging._matrix, []);
47639
- }, this._path));
47640
- },
47641
- /**
47642
- * Put back the getters
47643
- */
47644
- _restoreCoordGetters: function() {
47645
- 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_);
47646
- }
47647
- }
47648
- );
47649
- leafletSrcExports.Handler.PathDrag.makeDraggable = function(t) {
47650
- return t.dragging = new leafletSrcExports.Handler.PathDrag(t), t;
47651
- };
47652
- leafletSrcExports.Path.prototype.makeDraggable = function() {
47653
- return leafletSrcExports.Handler.PathDrag.makeDraggable(this);
47654
- };
47655
- leafletSrcExports.Path.addInitHook(function() {
47656
- 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();
47657
- });
47658
- const T = leafletSrcExports.Handler.PathDrag;
47659
-
47660
- var index = /*#__PURE__*/Object.freeze({
47661
- __proto__: null,
47662
- default: T
47663
- });
47664
-
47665
- var leafletArrows$2 = {exports: {}};
47666
-
47667
- var hasRequiredLeafletArrows;
47668
-
47669
- function requireLeafletArrows () {
47670
- if (hasRequiredLeafletArrows) return leafletArrows$2.exports;
47671
- hasRequiredLeafletArrows = 1;
47672
- (function (module, exports$1) {
47673
- // Leaflet Arrows by Meteotest
47674
- // https://github.com/meteotest/leaflet-arrows
47675
- // Module Loader Boilerplate
47676
- (function (factory, window) {
47677
- // define an AMD module that relies on 'leaflet'
47678
- {
47679
- module.exports = factory(requireLeafletSrc());
47680
- }
47681
- // attach your plugin to the global 'L' variable
47682
- if (typeof window !== 'undefined' && window.L) {
47683
- window.L.Arrow = factory(L);
47684
- }
47685
- })(function (L) {
47686
- // beware! the arrow factory
47687
- const Arrow = L.FeatureGroup.extend({
47688
- options: {
47689
- distanceUnit: 'km', // can be [px,km]
47690
- stretchFactor: 1, // should the distance be stretched?
47691
- arrowheadLength: 4, // in distance unit
47692
- arrowheadClosingLine: false, // should a closing third line be drawn?
47693
- arrowheadDegree: 155, // degree of arrowhead
47694
- clickableWidth: 10, // defines the width in pixels of the "phantom" path to capture click events on a line
47695
- //optional: popupContent: function(data) {},
47696
- // add your own custom validator, probably not needed...
47697
- // the validator gets the bound data object as argument
47698
- validator: function (data) {
47699
- return (typeof data.latlng !== 'undefined' &&
47700
- typeof data.distance !== 'undefined' &&
47701
- !isNaN(data.distance));
47702
- }, // 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
47703
- colorScheme: function () {
47704
- return this.color;
47705
- }, // add own colorscheme callback
47706
- circleRadiusInvalidPoint: 1000, // Radius of the circle to display missing or '0'-value
47707
- // path options
47708
- color: '#333',
47709
- opacity: 0.9, // stroke opacity
47710
- fillOpacity: 0.9,
47711
- weight: 4, // the width of the arrow
47712
- smoothFactor: 0,
47713
- radius: 5, // default radius, when distance is 0
47714
- defaultPointOptions: {
47715
- stroke: false,
47716
- fillOpacity: 0.8,
47717
- fillColor: '#111',
47718
- radius: 7,
47719
- },
47720
- invalidPointOptions: {
47721
- stroke: false,
47722
- fillOpacity: 0.8,
47723
- fillColor: 'red',
47724
- radius: 7,
47725
- },
47726
- drawSourceMarker: false,
47727
- sourceMarkerOptions: {
47728
- stroke: false,
47729
- fillOpacity: 1,
47730
- fillColor: '#333',
47731
- radius: 5,
47732
- },
47733
- },
47734
- /**
47735
- * The data opject needs at least following properties:
47736
- * - latlng : L.LatLng
47737
- * - degree : float
47738
- * - distance: float
47739
- */
47740
- initialize: function (data, options) {
47741
- L.Util.setOptions(this, options);
47742
- this.setData(data);
47743
- },
47744
- onAdd: function (map) {
47745
- this._map = map;
47746
- this.redraw();
47747
- // add a viewreset event listener for updating layer's position
47748
- map.on('viewreset', this._reset, this);
47749
- },
47750
- onRemove: function () {
47751
- // remove layer's DOM elements and listeners
47752
- for (const i in this._layers) {
47753
- if (this._layers.hasOwnProperty(i)) {
47754
- this._map.removeLayer(this._layers[i]);
47755
- }
47756
- }
47757
- if (typeof this._sourceMarker !== 'undefined') {
47758
- this._map.removeLayer(this._sourceMarker);
47759
- }
47760
- this._map.off('viewreset', this._reset, this);
47761
- },
47762
- // draw
47763
- redraw: function () {
47764
- // only draw when on map
47765
- if (!this._map) {
47766
- return;
47767
- }
47768
- this._layers = {};
47769
- // bind popup to the whole feature group
47770
- if (typeof this.options.popupContent === 'function') {
47771
- this.bindPopup(this.options.popupContent(this._data));
47772
- }
47773
- if (this._data.valid && typeof this.options.colorScheme === 'function') {
47774
- this.options.color = this.options.colorScheme(this._data);
47775
- }
47776
- this._data.distance = parseFloat(this._data.distance);
47777
- // if distance or degree is falsy/Zero then draw a point instead of an arrow
47778
- if (!this._data.valid || !this._data.distance || !this._data.angle) {
47779
- let circle;
47780
- const pathOptions = this._data.valid
47781
- ? this.options.defaultPointOptions
47782
- : this.options.invalidPointOptions;
47783
- if (this.options.distanceUnit.toLowerCase() === 'km') {
47784
- // use a tenth of the supplied radius (usally used in the circlemarker)
47785
- circle = L.circle(this._data.latlng, this.options.radius / 10, pathOptions);
47786
- }
47787
- else {
47788
- circle = L.circleMarker(this._data.latlng, pathOptions);
47789
- }
47790
- this.addLayer(circle);
47791
- }
47792
- else {
47793
- const theLine = [
47794
- this._data.latlng,
47795
- this._calculateEndPoint(this._data.latlng, this._data.distance, this._data.angle),
47796
- ];
47797
- const theArrow = this._calculateArrowArray(theLine[1]);
47798
- const backgroundPathOption = L.Util.setOptions({}, this.pathOptions);
47799
- backgroundPathOption.opacity = 0;
47800
- backgroundPathOption.weight = this.options.clickableWidth;
47801
- const invisibleBackgroundPolyline = new L.Polyline([theLine, theArrow], backgroundPathOption);
47802
- const polyline = new L.Polyline([theLine, theArrow], this.options);
47803
- this.addLayer(invisibleBackgroundPolyline);
47804
- this.addLayer(polyline);
47805
- // that special case, where a circle has to be drawn on the source of the arrow
47806
- if (this.options.drawSourceMarker) {
47807
- if (typeof this._sourceMarker === 'undefined') {
47808
- // use the same coloar as the arrow does
47809
- this.options.sourceMarkerOptions.fillColor = this.color;
47810
- this._sourceMarker = L.circleMarker(this._data.latlng, this.options.sourceMarkerOptions);
47811
- }
47812
- else {
47813
- // there is a chance, that the latlng values have been changed by the setData-function
47814
- this._sourceMarker.setLatLng(this._data.latlng);
47815
- }
47816
- }
47817
- }
47818
- },
47819
- // custom methods
47820
- // just change the angle of the arrow
47821
- setAngle: function (angle) {
47822
- if (isNaN(angle)) {
47823
- this._data.angle = 0; // undefined direction.
47824
- }
47825
- else {
47826
- if (this.options.isWindDegree) {
47827
- this._data.angle = angle - 180;
47828
- if (this.options.distanceUnit.toLowerCase() === 'px') {
47829
- this._data.angle -= 90;
47830
- }
47831
- }
47832
- else {
47833
- this._data.angle = angle;
47834
- }
47835
- }
47836
- this.redraw();
47837
- },
47838
- // just change the length of the arrow
47839
- setDistance: function (distance) {
47840
- if (isNaN(distance)) {
47841
- this._data.distance = 0;
47842
- }
47843
- else {
47844
- this._data.distance = parseFloat(distance);
47845
- }
47846
- this.redraw();
47847
- },
47848
- // use this method to update the whole dataset that corresponds to the arrow
47849
- setData: function (data) {
47850
- this._data = data;
47851
- if (this.options.validator(this._data)) {
47852
- this._data.valid = true;
47853
- this.setAngle(data.degree);
47854
- }
47855
- else {
47856
- this._data.valid = false;
47857
- this._data.distance = NaN;
47858
- this._data.degree = NaN;
47859
- }
47860
- },
47861
- // private methods
47862
- // When using Screen Pixels as unit, the arrows have to be
47863
- // recalculated after the zoom level has changed
47864
- _reset: function () {
47865
- if (this.options.distanceUnit.toLowerCase() === 'px') {
47866
- this.redraw();
47867
- }
47868
- },
47869
- _calculateEndPoint: function (latlng, dist, degree) {
47870
- /*
47871
- * http://www.codeguru.com/cpp/cpp/algorithms/article.php/c5115/Geographic-Distance-and-Azimuth-Calculations.htm
47872
- */
47873
- // don't use this._data here.
47874
- // this function is also used to find the points of the arrow
47875
- let distance = dist * this.options.stretchFactor, d2r = Math.PI / 180, // degree 2 radius
47876
- r2d = 180 / Math.PI;
47877
- if (this.options.distanceUnit.toLowerCase() === 'km') {
47878
- const R = 6378.137, // earth radius in kmeters
47879
- bearing = degree * d2r;
47880
- distance = distance / R;
47881
- const a = Math.acos(Math.cos(distance) * Math.cos((90 - latlng.lat) * d2r) +
47882
- Math.sin((90 - latlng.lat) * d2r) *
47883
- Math.sin(distance) *
47884
- Math.cos(bearing));
47885
- const B = Math.asin((Math.sin(distance) * Math.sin(bearing)) / Math.sin(a));
47886
- return new L.LatLng(90 - a * r2d, B * r2d + latlng.lng);
47887
- }
47888
- else if (this.options.distanceUnit.toLowerCase() === 'px') {
47889
- const sourcePoint = this._map.latLngToLayerPoint(latlng);
47890
- const rad = degree * d2r;
47891
- const vector = L.point(Math.cos(rad) * distance, Math.sin(rad) * distance);
47892
- const targetPoint = sourcePoint.add(vector);
47893
- return this._map.layerPointToLatLng(targetPoint);
47894
- }
47895
- else {
47896
- throw Error('calculate end point undefined for distanceUnit: ' +
47897
- this.options.distanceUnit);
47898
- }
47899
- },
47900
- _calculateArrowArray: function (latlng) {
47901
- // calculates the Array for the arrow
47902
- // latlng is the position, where the arrow is added
47903
- const degree = this._data.angle;
47904
- if (latlng.length !== undefined) {
47905
- latlng = new L.LatLng(latlng);
47906
- }
47907
- const firstEdge = this._calculateEndPoint(latlng, this.options.arrowheadLength, degree - this.options.arrowheadDegree);
47908
- const arr = [
47909
- firstEdge,
47910
- latlng,
47911
- this._calculateEndPoint(latlng, this.options.arrowheadLength, degree + this.options.arrowheadDegree),
47912
- ];
47913
- if (this.options.arrowheadClosingLine) {
47914
- arr.push(firstEdge);
47915
- }
47916
- return arr;
47917
- },
47918
- });
47919
- return Arrow;
47920
- }, window);
47921
-
47922
- } (leafletArrows$2));
47923
- return leafletArrows$2.exports;
47924
- }
47925
-
47926
- var leafletArrowsExports = requireLeafletArrows();
47927
- var leafletArrows = /*@__PURE__*/getDefaultExportFromCjs(leafletArrowsExports);
47928
-
47929
- var leafletArrows$1 = /*#__PURE__*/_mergeNamespaces({
47930
- __proto__: null,
47931
- default: leafletArrows
47932
- }, [leafletArrowsExports]);
47933
-
47934
46981
  exports.Accordion = Accordion;
47935
46982
  exports.AlertDialog = alertDialog;
47936
46983
  exports.AlertStore = AlertStore;
@@ -48024,6 +47071,7 @@ exports.getUrlencodedBody = getUrlencodedBody;
48024
47071
  exports.getValidLayer = getValidLayer;
48025
47072
  exports.getWaterAreaLayers = getWaterAreaLayers;
48026
47073
  exports.getWaterLinkLayers = getWaterLinkLayers;
47074
+ exports.loadState = loadState;
48027
47075
  exports.loggerService = loggerService;
48028
47076
  exports.modalStore = modalStore;
48029
47077
  exports.modalStyle = modalStyle;
@@ -48032,7 +47080,9 @@ exports.numberSchema = numberSchema;
48032
47080
  exports.parseTrafficSignCSVFile = parseTrafficSignCSVFile;
48033
47081
  exports.pillarConfig = pillarConfig;
48034
47082
  exports.queryClient = queryClient;
47083
+ exports.removeState = removeState;
48035
47084
  exports.rootStore = rootStore;
47085
+ exports.saveState = saveState;
48036
47086
  exports.showSnackbar = showSnackbar;
48037
47087
  exports.sourceUrl = sourceUrl;
48038
47088
  exports.text_source = text_source;
@@ -48044,6 +47094,7 @@ exports.trafficSignsDop = trafficSignsDop;
48044
47094
  exports.useFormContext = useFormContext;
48045
47095
  exports.useGetLeafletLayer = useGetLeafletLayer;
48046
47096
  exports.useGetUser = useGetUser;
47097
+ exports.useLazyGetUser = useLazyGetUser;
48047
47098
  exports.useShowErrorSnackbar = useShowErrorSnackbar;
48048
47099
  exports.useShowSnackbar = useShowSnackbar;
48049
47100
  exports.useSignIn = useSignIn;