@nextgis/ngw-leaflet 2.5.0 → 3.0.0-alpha.1

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 2.5.0; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.1; author: NextGIS */
2
2
  function styleInject(css, ref) {
3
3
  if ( ref === void 0 ) ref = {};
4
4
  var insertAt = ref.insertAt;
@@ -15048,15 +15048,15 @@ function createFeaturePositionOptions(features) {
15048
15048
  };
15049
15049
  }
15050
15050
 
15051
- var __defProp$$ = Object.defineProperty;
15052
- var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15053
- var __publicField$I = (obj, key, value) => __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
15051
+ var __defProp$Y = Object.defineProperty;
15052
+ var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15053
+ var __publicField$E = (obj, key, value) => __defNormalProp$Y(obj, typeof key !== "symbol" ? key + "" : key, value);
15054
15054
  class BaseAdapter {
15055
15055
  constructor(map, options) {
15056
15056
  this.map = map;
15057
15057
  this.options = options;
15058
- __publicField$I(this, "layer");
15059
- __publicField$I(this, "pane", "order-0");
15058
+ __publicField$E(this, "layer");
15059
+ __publicField$E(this, "pane", "order-0");
15060
15060
  if (options.order !== void 0) {
15061
15061
  const pane = "order-" + options.order;
15062
15062
  let exist = map.getPane(pane);
@@ -15085,19 +15085,19 @@ function convertMapClickEvent(evt) {
15085
15085
  };
15086
15086
  }
15087
15087
 
15088
- var __defProp$_ = Object.defineProperty;
15089
- var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
15090
- var __hasOwnProp$E = Object.prototype.hasOwnProperty;
15091
- var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
15092
- var __defNormalProp$_ = (obj, key, value) => key in obj ? __defProp$_(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15093
- var __spreadValues$D = (a, b) => {
15088
+ var __defProp$X = Object.defineProperty;
15089
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
15090
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
15091
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
15092
+ var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15093
+ var __spreadValues$F = (a, b) => {
15094
15094
  for (var prop in b || (b = {}))
15095
- if (__hasOwnProp$E.call(b, prop))
15096
- __defNormalProp$_(a, prop, b[prop]);
15097
- if (__getOwnPropSymbols$E)
15098
- for (var prop of __getOwnPropSymbols$E(b)) {
15099
- if (__propIsEnum$E.call(b, prop))
15100
- __defNormalProp$_(a, prop, b[prop]);
15095
+ if (__hasOwnProp$G.call(b, prop))
15096
+ __defNormalProp$X(a, prop, b[prop]);
15097
+ if (__getOwnPropSymbols$G)
15098
+ for (var prop of __getOwnPropSymbols$G(b)) {
15099
+ if (__propIsEnum$G.call(b, prop))
15100
+ __defNormalProp$X(a, prop, b[prop]);
15101
15101
  }
15102
15102
  return a;
15103
15103
  };
@@ -15107,7 +15107,7 @@ function createMouseEvent({
15107
15107
  }) {
15108
15108
  const layer_ = source.target;
15109
15109
  const feature = layer_.feature;
15110
- const opt = __spreadValues$D({
15110
+ const opt = __spreadValues$F({
15111
15111
  layer,
15112
15112
  feature,
15113
15113
  event: convertMapClickEvent(source),
@@ -15116,30 +15116,30 @@ function createMouseEvent({
15116
15116
  return opt;
15117
15117
  }
15118
15118
 
15119
- var __defProp$Z = Object.defineProperty;
15120
- var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
15121
- var __hasOwnProp$D = Object.prototype.hasOwnProperty;
15122
- var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
15123
- var __defNormalProp$Z = (obj, key, value) => key in obj ? __defProp$Z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15124
- var __spreadValues$C = (a, b) => {
15119
+ var __defProp$W = Object.defineProperty;
15120
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
15121
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
15122
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
15123
+ var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15124
+ var __spreadValues$E = (a, b) => {
15125
15125
  for (var prop in b || (b = {}))
15126
- if (__hasOwnProp$D.call(b, prop))
15127
- __defNormalProp$Z(a, prop, b[prop]);
15128
- if (__getOwnPropSymbols$D)
15129
- for (var prop of __getOwnPropSymbols$D(b)) {
15130
- if (__propIsEnum$D.call(b, prop))
15131
- __defNormalProp$Z(a, prop, b[prop]);
15126
+ if (__hasOwnProp$F.call(b, prop))
15127
+ __defNormalProp$W(a, prop, b[prop]);
15128
+ if (__getOwnPropSymbols$F)
15129
+ for (var prop of __getOwnPropSymbols$F(b)) {
15130
+ if (__propIsEnum$F.call(b, prop))
15131
+ __defNormalProp$W(a, prop, b[prop]);
15132
15132
  }
15133
15133
  return a;
15134
15134
  };
15135
- var __publicField$H = (obj, key, value) => __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
15135
+ var __publicField$D = (obj, key, value) => __defNormalProp$W(obj, typeof key !== "symbol" ? key + "" : key, value);
15136
15136
  class GeoJsonEvents {
15137
15137
  constructor(layer) {
15138
- __publicField$H(this, "layer");
15139
- __publicField$H(this, "_onclick");
15140
- __publicField$H(this, "_ondblclick");
15141
- __publicField$H(this, "_mouseout");
15142
- __publicField$H(this, "_mouseover");
15138
+ __publicField$D(this, "layer");
15139
+ __publicField$D(this, "_onclick");
15140
+ __publicField$D(this, "_ondblclick");
15141
+ __publicField$D(this, "_mouseout");
15142
+ __publicField$D(this, "_mouseover");
15143
15143
  this.layer = layer;
15144
15144
  }
15145
15145
  handleMouseEvents(layer) {
@@ -15148,7 +15148,7 @@ class GeoJsonEvents {
15148
15148
  if (onClick_) {
15149
15149
  this._onclick = (e) => {
15150
15150
  const selected = !!this.layer._getSelected(layer);
15151
- onClick_(__spreadValues$C({
15151
+ onClick_(__spreadValues$E({
15152
15152
  selected
15153
15153
  }, this._createMouseEvent(e)));
15154
15154
  };
@@ -15158,7 +15158,7 @@ class GeoJsonEvents {
15158
15158
  this._ondblclick = (e) => {
15159
15159
  leafletSrcExports.DomEvent.stopPropagation(e);
15160
15160
  const selected = !!this.layer._getSelected(layer);
15161
- onDoubleClick(__spreadValues$C({
15161
+ onDoubleClick(__spreadValues$E({
15162
15162
  selected
15163
15163
  }, this._createMouseEvent(e)));
15164
15164
  };
@@ -15836,19 +15836,19 @@ const typeExpressions = {
15836
15836
  typeof: evaluateArgs(([arg]) => typeOfValue(arg))
15837
15837
  };
15838
15838
 
15839
- var __defProp$Y = Object.defineProperty;
15840
- var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
15841
- var __hasOwnProp$C = Object.prototype.hasOwnProperty;
15842
- var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
15843
- var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15844
- var __spreadValues$B = (a, b) => {
15839
+ var __defProp$V = Object.defineProperty;
15840
+ var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
15841
+ var __hasOwnProp$E = Object.prototype.hasOwnProperty;
15842
+ var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
15843
+ var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15844
+ var __spreadValues$D = (a, b) => {
15845
15845
  for (var prop in b || (b = {}))
15846
- if (__hasOwnProp$C.call(b, prop))
15847
- __defNormalProp$Y(a, prop, b[prop]);
15848
- if (__getOwnPropSymbols$C)
15849
- for (var prop of __getOwnPropSymbols$C(b)) {
15850
- if (__propIsEnum$C.call(b, prop))
15851
- __defNormalProp$Y(a, prop, b[prop]);
15846
+ if (__hasOwnProp$E.call(b, prop))
15847
+ __defNormalProp$V(a, prop, b[prop]);
15848
+ if (__getOwnPropSymbols$E)
15849
+ for (var prop of __getOwnPropSymbols$E(b)) {
15850
+ if (__propIsEnum$E.call(b, prop))
15851
+ __defNormalProp$V(a, prop, b[prop]);
15852
15852
  }
15853
15853
  return a;
15854
15854
  };
@@ -15860,7 +15860,7 @@ function isExpression(value) {
15860
15860
  }
15861
15861
  return false;
15862
15862
  }
15863
- const expressions = __spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
15863
+ const expressions = __spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
15864
15864
  function evaluate(expression, data = {}) {
15865
15865
  const [name, ...args] = expression;
15866
15866
  const expressionFun = expressions[name];
@@ -15873,19 +15873,19 @@ function evaluate(expression, data = {}) {
15873
15873
  throw new Error(`Expression "${name}" is not supported.`);
15874
15874
  }
15875
15875
 
15876
- var __defProp$X = Object.defineProperty;
15877
- var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
15878
- var __hasOwnProp$B = Object.prototype.hasOwnProperty;
15879
- var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
15880
- var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15881
- var __spreadValues$A = (a, b) => {
15876
+ var __defProp$U = Object.defineProperty;
15877
+ var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
15878
+ var __hasOwnProp$D = Object.prototype.hasOwnProperty;
15879
+ var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
15880
+ var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15881
+ var __spreadValues$C = (a, b) => {
15882
15882
  for (var prop in b || (b = {}))
15883
- if (__hasOwnProp$B.call(b, prop))
15884
- __defNormalProp$X(a, prop, b[prop]);
15885
- if (__getOwnPropSymbols$B)
15886
- for (var prop of __getOwnPropSymbols$B(b)) {
15887
- if (__propIsEnum$B.call(b, prop))
15888
- __defNormalProp$X(a, prop, b[prop]);
15883
+ if (__hasOwnProp$D.call(b, prop))
15884
+ __defNormalProp$U(a, prop, b[prop]);
15885
+ if (__getOwnPropSymbols$D)
15886
+ for (var prop of __getOwnPropSymbols$D(b)) {
15887
+ if (__propIsEnum$D.call(b, prop))
15888
+ __defNormalProp$U(a, prop, b[prop]);
15889
15889
  }
15890
15890
  return a;
15891
15891
  };
@@ -15918,25 +15918,25 @@ function createExpressionCallback(paint) {
15918
15918
  for (const p in expressions) {
15919
15919
  fromCb[p] = expressions[p](feature);
15920
15920
  }
15921
- return __spreadValues$A(__spreadValues$A({}, paint), fromCb);
15921
+ return __spreadValues$C(__spreadValues$C({}, paint), fromCb);
15922
15922
  };
15923
15923
  }
15924
15924
  return;
15925
15925
  }
15926
15926
 
15927
- var __defProp$W = Object.defineProperty;
15928
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
15929
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
15930
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
15931
- var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15932
- var __spreadValues$z = (a, b) => {
15927
+ var __defProp$T = Object.defineProperty;
15928
+ var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
15929
+ var __hasOwnProp$C = Object.prototype.hasOwnProperty;
15930
+ var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
15931
+ var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15932
+ var __spreadValues$B = (a, b) => {
15933
15933
  for (var prop in b || (b = {}))
15934
- if (__hasOwnProp$A.call(b, prop))
15935
- __defNormalProp$W(a, prop, b[prop]);
15936
- if (__getOwnPropSymbols$A)
15937
- for (var prop of __getOwnPropSymbols$A(b)) {
15938
- if (__propIsEnum$A.call(b, prop))
15939
- __defNormalProp$W(a, prop, b[prop]);
15934
+ if (__hasOwnProp$C.call(b, prop))
15935
+ __defNormalProp$T(a, prop, b[prop]);
15936
+ if (__getOwnPropSymbols$C)
15937
+ for (var prop of __getOwnPropSymbols$C(b)) {
15938
+ if (__propIsEnum$C.call(b, prop))
15939
+ __defNormalProp$T(a, prop, b[prop]);
15940
15940
  }
15941
15941
  return a;
15942
15942
  };
@@ -15983,7 +15983,7 @@ function isPropertyFilter(filter) {
15983
15983
  return false;
15984
15984
  }
15985
15985
  function featureFilter(feature, filters) {
15986
- const properties = __spreadValues$z({}, feature.properties);
15986
+ const properties = __spreadValues$B({}, feature.properties);
15987
15987
  if (properties) {
15988
15988
  properties.$id = feature.id;
15989
15989
  return propertiesFilter(properties, filters);
@@ -16018,19 +16018,19 @@ function propertiesFilter(properties, filters) {
16018
16018
  return logic === "any" ? filters_.some(filterFunction) : filters_.every(filterFunction);
16019
16019
  }
16020
16020
 
16021
- var __defProp$V = Object.defineProperty;
16022
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
16023
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
16024
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
16025
- var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16026
- var __spreadValues$y = (a, b) => {
16021
+ var __defProp$S = Object.defineProperty;
16022
+ var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
16023
+ var __hasOwnProp$B = Object.prototype.hasOwnProperty;
16024
+ var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
16025
+ var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16026
+ var __spreadValues$A = (a, b) => {
16027
16027
  for (var prop in b || (b = {}))
16028
- if (__hasOwnProp$z.call(b, prop))
16029
- __defNormalProp$V(a, prop, b[prop]);
16030
- if (__getOwnPropSymbols$z)
16031
- for (var prop of __getOwnPropSymbols$z(b)) {
16032
- if (__propIsEnum$z.call(b, prop))
16033
- __defNormalProp$V(a, prop, b[prop]);
16028
+ if (__hasOwnProp$B.call(b, prop))
16029
+ __defNormalProp$S(a, prop, b[prop]);
16030
+ if (__getOwnPropSymbols$B)
16031
+ for (var prop of __getOwnPropSymbols$B(b)) {
16032
+ if (__propIsEnum$B.call(b, prop))
16033
+ __defNormalProp$S(a, prop, b[prop]);
16034
16034
  }
16035
16035
  return a;
16036
16036
  };
@@ -16059,7 +16059,7 @@ function createPropertiesPaint(propertiesPaint) {
16059
16059
  return (feature) => {
16060
16060
  const paint = paintsFilters.find((x) => featureFilter(feature, x[0]));
16061
16061
  if (paint) {
16062
- return __spreadValues$y(__spreadValues$y({}, mask), paint[1]);
16062
+ return __spreadValues$A(__spreadValues$A({}, mask), paint[1]);
16063
16063
  }
16064
16064
  return mask;
16065
16065
  };
@@ -16083,8 +16083,8 @@ function expressionCallback({
16083
16083
  }
16084
16084
  function finalizePaint({ paint, defaultPaint }) {
16085
16085
  var _a;
16086
- let newPaint = __spreadValues$y({}, defaultPaint);
16087
- newPaint = __spreadValues$y(__spreadValues$y({}, newPaint), paint);
16086
+ let newPaint = __spreadValues$A({}, defaultPaint);
16087
+ newPaint = __spreadValues$A(__spreadValues$A({}, newPaint), paint);
16088
16088
  newPaint.fill = (_a = newPaint.fill) != null ? _a : true;
16089
16089
  newPaint.stroke = newPaint.stroke !== void 0 ? newPaint.stroke : !newPaint.fill || !!(newPaint.strokeColor || newPaint.strokeOpacity);
16090
16090
  return newPaint;
@@ -16097,7 +16097,7 @@ function preparePaint({
16097
16097
  if (!paint) {
16098
16098
  throw new Error("paint is empty");
16099
16099
  }
16100
- let newPaint = __spreadValues$y({}, defaultPaint);
16100
+ let newPaint = __spreadValues$A({}, defaultPaint);
16101
16101
  if (isPaintCallback(paint)) {
16102
16102
  const getPaintFunction = (feature) => {
16103
16103
  const getPaint = preparePaint({
@@ -16154,41 +16154,41 @@ function preparePaint({
16154
16154
  return newPaint;
16155
16155
  }
16156
16156
 
16157
- var __defProp$U = Object.defineProperty;
16157
+ var __defProp$R = Object.defineProperty;
16158
16158
  var __defProps$l = Object.defineProperties;
16159
16159
  var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
16160
- var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
16161
- var __hasOwnProp$y = Object.prototype.hasOwnProperty;
16162
- var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
16163
- var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16164
- var __spreadValues$x = (a, b) => {
16160
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
16161
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
16162
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
16163
+ var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16164
+ var __spreadValues$z = (a, b) => {
16165
16165
  for (var prop in b || (b = {}))
16166
- if (__hasOwnProp$y.call(b, prop))
16167
- __defNormalProp$U(a, prop, b[prop]);
16168
- if (__getOwnPropSymbols$y)
16169
- for (var prop of __getOwnPropSymbols$y(b)) {
16170
- if (__propIsEnum$y.call(b, prop))
16171
- __defNormalProp$U(a, prop, b[prop]);
16166
+ if (__hasOwnProp$A.call(b, prop))
16167
+ __defNormalProp$R(a, prop, b[prop]);
16168
+ if (__getOwnPropSymbols$A)
16169
+ for (var prop of __getOwnPropSymbols$A(b)) {
16170
+ if (__propIsEnum$A.call(b, prop))
16171
+ __defNormalProp$R(a, prop, b[prop]);
16172
16172
  }
16173
16173
  return a;
16174
16174
  };
16175
16175
  var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
16176
- var __objRest$4 = (source, exclude) => {
16176
+ var __objRest$5 = (source, exclude) => {
16177
16177
  var target = {};
16178
16178
  for (var prop in source)
16179
- if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
16179
+ if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
16180
16180
  target[prop] = source[prop];
16181
- if (source != null && __getOwnPropSymbols$y)
16182
- for (var prop of __getOwnPropSymbols$y(source)) {
16183
- if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
16181
+ if (source != null && __getOwnPropSymbols$A)
16182
+ for (var prop of __getOwnPropSymbols$A(source)) {
16183
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
16184
16184
  target[prop] = source[prop];
16185
16185
  }
16186
16186
  return target;
16187
16187
  };
16188
- var __publicField$G = (obj, key, value) => __defNormalProp$U(obj, key + "" , value);
16188
+ var __publicField$C = (obj, key, value) => __defNormalProp$R(obj, key + "" , value);
16189
16189
  class GeoJsonPaint {
16190
16190
  constructor(layer) {
16191
- __publicField$G(this, "layer");
16191
+ __publicField$C(this, "layer");
16192
16192
  this.layer = layer;
16193
16193
  }
16194
16194
  setPaintEachLayer(paint) {
@@ -16256,7 +16256,7 @@ class GeoJsonPaint {
16256
16256
  return PAINT;
16257
16257
  }
16258
16258
  _createDivIcon(icon) {
16259
- const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$4(_a, ["html", "rotate", "className"]);
16259
+ const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$5(_a, ["html", "rotate", "className"]);
16260
16260
  const element = document.createElement("div");
16261
16261
  if (className) {
16262
16262
  element.className = className;
@@ -16267,7 +16267,7 @@ class GeoJsonPaint {
16267
16267
  if (html) {
16268
16268
  element.innerHTML = html;
16269
16269
  }
16270
- const divIcon = new leafletSrcExports.DivIcon(__spreadProps$l(__spreadValues$x({
16270
+ const divIcon = new leafletSrcExports.DivIcon(__spreadProps$l(__spreadValues$z({
16271
16271
  className: ""
16272
16272
  }, toLIconOpt), {
16273
16273
  html: element
@@ -16293,7 +16293,7 @@ class GeoJsonPaint {
16293
16293
  }
16294
16294
  return (_, latlng) => {
16295
16295
  const p = PAINT;
16296
- return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$x(__spreadValues$x({}, p), icon)));
16296
+ return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$z(__spreadValues$z({}, p), icon)));
16297
16297
  };
16298
16298
  }
16299
16299
  createPaintOptions(paint) {
@@ -16315,27 +16315,27 @@ class GeoJsonPaint {
16315
16315
  }
16316
16316
  }
16317
16317
 
16318
- var __defProp$T = Object.defineProperty;
16318
+ var __defProp$Q = Object.defineProperty;
16319
16319
  var __defProps$k = Object.defineProperties;
16320
16320
  var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
16321
- var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
16322
- var __hasOwnProp$x = Object.prototype.hasOwnProperty;
16323
- var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
16324
- var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16325
- var __spreadValues$w = (a, b) => {
16321
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
16322
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
16323
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
16324
+ var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16325
+ var __spreadValues$y = (a, b) => {
16326
16326
  for (var prop in b || (b = {}))
16327
- if (__hasOwnProp$x.call(b, prop))
16328
- __defNormalProp$T(a, prop, b[prop]);
16329
- if (__getOwnPropSymbols$x)
16330
- for (var prop of __getOwnPropSymbols$x(b)) {
16331
- if (__propIsEnum$x.call(b, prop))
16332
- __defNormalProp$T(a, prop, b[prop]);
16327
+ if (__hasOwnProp$z.call(b, prop))
16328
+ __defNormalProp$Q(a, prop, b[prop]);
16329
+ if (__getOwnPropSymbols$z)
16330
+ for (var prop of __getOwnPropSymbols$z(b)) {
16331
+ if (__propIsEnum$z.call(b, prop))
16332
+ __defNormalProp$Q(a, prop, b[prop]);
16333
16333
  }
16334
16334
  return a;
16335
16335
  };
16336
16336
  var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
16337
- var __publicField$F = (obj, key, value) => __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
16338
- var __async$l = (__this, __arguments, generator) => {
16337
+ var __publicField$B = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
16338
+ var __async$s = (__this, __arguments, generator) => {
16339
16339
  return new Promise((resolve, reject) => {
16340
16340
  var fulfilled = (value) => {
16341
16341
  try {
@@ -16358,22 +16358,22 @@ var __async$l = (__this, __arguments, generator) => {
16358
16358
  class GeoJsonAdapter extends BaseAdapter {
16359
16359
  constructor(map, options) {
16360
16360
  super(map, options);
16361
- __publicField$F(this, "layer");
16362
- __publicField$F(this, "selected", false);
16363
- __publicField$F(this, "type");
16364
- __publicField$F(this, "_layers", []);
16365
- __publicField$F(this, "_events");
16366
- __publicField$F(this, "paint");
16367
- __publicField$F(this, "selectedPaint");
16368
- __publicField$F(this, "_selectedLayers", []);
16369
- __publicField$F(this, "_filteredLayers", []);
16370
- __publicField$F(this, "_filterFun");
16371
- __publicField$F(this, "_openedPopup", []);
16372
- __publicField$F(this, "_paint");
16373
- __publicField$F(this, "$updateTooltip", debounce(() => {
16361
+ __publicField$B(this, "layer");
16362
+ __publicField$B(this, "selected", false);
16363
+ __publicField$B(this, "type");
16364
+ __publicField$B(this, "_layers", []);
16365
+ __publicField$B(this, "_events");
16366
+ __publicField$B(this, "paint");
16367
+ __publicField$B(this, "selectedPaint");
16368
+ __publicField$B(this, "_selectedLayers", []);
16369
+ __publicField$B(this, "_filteredLayers", []);
16370
+ __publicField$B(this, "_filterFun");
16371
+ __publicField$B(this, "_openedPopup", []);
16372
+ __publicField$B(this, "_paint");
16373
+ __publicField$B(this, "$updateTooltip", debounce(() => {
16374
16374
  this.updateTooltip();
16375
16375
  }, 300));
16376
- __publicField$F(this, "$unselect", () => {
16376
+ __publicField$B(this, "$unselect", () => {
16377
16377
  this.unselect();
16378
16378
  });
16379
16379
  this._events = new GeoJsonEvents(this);
@@ -16382,7 +16382,7 @@ class GeoJsonAdapter extends BaseAdapter {
16382
16382
  addLayer(options) {
16383
16383
  Object.assign(this.options, options);
16384
16384
  this.paint = options.paint;
16385
- this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$k(__spreadValues$w({}, options.nativeOptions), {
16385
+ this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$k(__spreadValues$y({}, options.nativeOptions), {
16386
16386
  pane: this.pane
16387
16387
  }));
16388
16388
  this.selectedPaint = options.selectedPaint;
@@ -16431,7 +16431,7 @@ class GeoJsonAdapter extends BaseAdapter {
16431
16431
  }
16432
16432
  getSelected() {
16433
16433
  return this._selectedLayers.map((x) => {
16434
- return __spreadValues$w({
16434
+ return __spreadValues$y({
16435
16435
  target: this,
16436
16436
  feature: x.feature,
16437
16437
  layer: x
@@ -16450,14 +16450,14 @@ class GeoJsonAdapter extends BaseAdapter {
16450
16450
  const filteredLayers = [];
16451
16451
  this._layers.forEach(({ feature, layer }) => {
16452
16452
  if (layer) {
16453
- const ok = fun ? fun(__spreadValues$w({
16453
+ const ok = fun ? fun(__spreadValues$y({
16454
16454
  target: this,
16455
16455
  feature,
16456
16456
  layer
16457
16457
  }, createFeaturePositionOptions(feature))) : true;
16458
16458
  if (ok) {
16459
16459
  layer_.addLayer(layer);
16460
- filteredLayers.push(__spreadValues$w({
16460
+ filteredLayers.push(__spreadValues$y({
16461
16461
  target: this,
16462
16462
  feature,
16463
16463
  layer
@@ -16478,7 +16478,7 @@ class GeoJsonAdapter extends BaseAdapter {
16478
16478
  getLayers() {
16479
16479
  return this._layers.map(({ layer, feature }) => {
16480
16480
  const visible = layer && !!layer._map;
16481
- return __spreadValues$w({
16481
+ return __spreadValues$y({
16482
16482
  feature,
16483
16483
  layer,
16484
16484
  visible,
@@ -16596,13 +16596,13 @@ class GeoJsonAdapter extends BaseAdapter {
16596
16596
  }
16597
16597
  }
16598
16598
  updatePaint(paint) {
16599
- this.paint = __spreadValues$w(__spreadValues$w({}, this.paint), paint);
16599
+ this.paint = __spreadValues$y(__spreadValues$y({}, this.paint), paint);
16600
16600
  for (const l of this._layers) {
16601
16601
  this._paint.setPaint(l, this.paint);
16602
16602
  }
16603
16603
  }
16604
16604
  updateSelectedPaint(paint) {
16605
- this.selectedPaint = __spreadValues$w(__spreadValues$w({}, this.selectedPaint), paint);
16605
+ this.selectedPaint = __spreadValues$y(__spreadValues$y({}, this.selectedPaint), paint);
16606
16606
  for (const l of this._selectedLayers) {
16607
16607
  this._paint.setPaint(l, this.selectedPaint);
16608
16608
  }
@@ -16619,7 +16619,7 @@ class GeoJsonAdapter extends BaseAdapter {
16619
16619
  if (feature.properties && labelField) {
16620
16620
  message = feature.properties[labelField];
16621
16621
  } else if (label) {
16622
- message = label(__spreadValues$w(__spreadValues$w({
16622
+ message = label(__spreadValues$y(__spreadValues$y({
16623
16623
  target: this
16624
16624
  }, layerDef), createFeaturePositionOptions(feature)));
16625
16625
  }
@@ -16630,7 +16630,7 @@ class GeoJsonAdapter extends BaseAdapter {
16630
16630
  }
16631
16631
  }
16632
16632
  _openPopup(_0) {
16633
- return __async$l(this, arguments, function* (def, options = {}, type, latLng) {
16633
+ return __async$s(this, arguments, function* (def, options = {}, type, latLng) {
16634
16634
  var _a, _b;
16635
16635
  const { feature, layer } = def;
16636
16636
  const {
@@ -16638,7 +16638,7 @@ class GeoJsonAdapter extends BaseAdapter {
16638
16638
  autoPan,
16639
16639
  maxWidth,
16640
16640
  closeButton: closeButton_
16641
- } = __spreadValues$w({
16641
+ } = __spreadValues$y({
16642
16642
  minWidth: 300
16643
16643
  }, options);
16644
16644
  const closeButton = closeButton_ != null ? closeButton_ : !this.options.selectOnHover;
@@ -16654,7 +16654,7 @@ class GeoJsonAdapter extends BaseAdapter {
16654
16654
  };
16655
16655
  let content;
16656
16656
  if (options.createPopupContent) {
16657
- content = yield options.createPopupContent(__spreadValues$w({
16657
+ content = yield options.createPopupContent(__spreadValues$y({
16658
16658
  layer,
16659
16659
  feature,
16660
16660
  target: this,
@@ -16730,9 +16730,9 @@ class GeoJsonAdapter extends BaseAdapter {
16730
16730
  lopt = {
16731
16731
  style: (feature) => {
16732
16732
  if (feature) {
16733
- return this._paint.preparePaint(__spreadValues$w(__spreadValues$w({}, PAINT), paint(feature)));
16733
+ return this._paint.preparePaint(__spreadValues$y(__spreadValues$y({}, PAINT), paint(feature)));
16734
16734
  } else {
16735
- return this._paint.preparePaint(__spreadProps$k(__spreadValues$w({}, PAINT), { type: "path" }));
16735
+ return this._paint.preparePaint(__spreadProps$k(__spreadValues$y({}, PAINT), { type: "path" }));
16736
16736
  }
16737
16737
  }
16738
16738
  };
@@ -16748,7 +16748,7 @@ class GeoJsonAdapter extends BaseAdapter {
16748
16748
  _onEachFeature(feature, layer) {
16749
16749
  const layer_ = this.layer;
16750
16750
  if (layer_) {
16751
- const def = __spreadValues$w({
16751
+ const def = __spreadValues$y({
16752
16752
  target: this,
16753
16753
  feature,
16754
16754
  layer
@@ -16783,7 +16783,7 @@ class GeoJsonAdapter extends BaseAdapter {
16783
16783
  setTimeout(() => {
16784
16784
  if (popup) {
16785
16785
  this._openPopup(
16786
- __spreadValues$w({
16786
+ __spreadValues$y({
16787
16787
  target: this,
16788
16788
  layer,
16789
16789
  feature
@@ -16801,7 +16801,7 @@ class GeoJsonAdapter extends BaseAdapter {
16801
16801
  leafletSrcExports.DomEvent.stopPropagation(e);
16802
16802
  const layer = e.target;
16803
16803
  const feature = layer.feature;
16804
- const def = __spreadValues$w({
16804
+ const def = __spreadValues$y({
16805
16805
  target: this,
16806
16806
  layer,
16807
16807
  feature
@@ -16834,7 +16834,7 @@ class GeoJsonAdapter extends BaseAdapter {
16834
16834
  }
16835
16835
  if (this.options.onSelect) {
16836
16836
  const features = def.feature ? [def.feature] : [];
16837
- this.options.onSelect(__spreadValues$w({
16837
+ this.options.onSelect(__spreadValues$y({
16838
16838
  type,
16839
16839
  layer: this,
16840
16840
  features
@@ -16926,20 +16926,20 @@ function callAjax({
16926
16926
  return [promise, abortFunc];
16927
16927
  }
16928
16928
 
16929
- var __defProp$S = Object.defineProperty;
16930
- var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16931
- var __publicField$E = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16929
+ var __defProp$P = Object.defineProperty;
16930
+ var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16931
+ var __publicField$A = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
16932
16932
  class Queue {
16933
16933
  /**
16934
16934
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
16935
16935
  */
16936
16936
  constructor({ concurrency = 1, delay = 0 } = {}) {
16937
- __publicField$E(this, "queue", []);
16938
- __publicField$E(this, "concurrency");
16939
- __publicField$E(this, "activeCount", 0);
16940
- __publicField$E(this, "timeoutId");
16941
- __publicField$E(this, "delay");
16942
- __publicField$E(this, "toAbort", []);
16937
+ __publicField$A(this, "queue", []);
16938
+ __publicField$A(this, "concurrency");
16939
+ __publicField$A(this, "activeCount", 0);
16940
+ __publicField$A(this, "timeoutId");
16941
+ __publicField$A(this, "delay");
16942
+ __publicField$A(this, "toAbort", []);
16943
16943
  this.concurrency = concurrency;
16944
16944
  this.delay = delay;
16945
16945
  }
@@ -17015,13 +17015,13 @@ class Queue {
17015
17015
 
17016
17016
  const imageQueue = new Queue({ concurrency: 6, delay: 200 });
17017
17017
 
17018
- var __defProp$R = Object.defineProperty;
17019
- var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17020
- var __publicField$D = (obj, key, value) => __defNormalProp$R(obj, key + "" , value);
17018
+ var __defProp$O = Object.defineProperty;
17019
+ var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17020
+ var __publicField$z = (obj, key, value) => __defNormalProp$O(obj, key + "" , value);
17021
17021
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
17022
17022
  constructor(imageUrl, bounds, options) {
17023
17023
  super(imageUrl, bounds, options);
17024
- __publicField$D(this, "_aborter");
17024
+ __publicField$z(this, "_aborter");
17025
17025
  }
17026
17026
  cancelLoad() {
17027
17027
  if (this._aborter) {
@@ -17050,13 +17050,13 @@ class ImageOverlay extends leafletSrcExports.ImageOverlay {
17050
17050
  }
17051
17051
  }
17052
17052
 
17053
- var __defProp$Q = Object.defineProperty;
17054
- var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17055
- var __publicField$C = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17053
+ var __defProp$N = Object.defineProperty;
17054
+ var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17055
+ var __publicField$y = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
17056
17056
  class ImageLayer extends leafletSrcExports.Layer {
17057
17057
  constructor(url, options) {
17058
17058
  super(options);
17059
- __publicField$C(this, "defaultWmsParams", {
17059
+ __publicField$y(this, "defaultWmsParams", {
17060
17060
  service: "WMS",
17061
17061
  request: "GetMap",
17062
17062
  version: "1.1.1",
@@ -17065,7 +17065,7 @@ class ImageLayer extends leafletSrcExports.Layer {
17065
17065
  format: "image/jpeg",
17066
17066
  transparent: false
17067
17067
  });
17068
- __publicField$C(this, "options", {
17068
+ __publicField$y(this, "options", {
17069
17069
  crs: null,
17070
17070
  uppercase: false,
17071
17071
  attribution: "",
@@ -17078,11 +17078,11 @@ class ImageLayer extends leafletSrcExports.Layer {
17078
17078
  viewPortBuffer: 0,
17079
17079
  setViewDelay: 100
17080
17080
  });
17081
- __publicField$C(this, "wmsParams");
17082
- __publicField$C(this, "_url");
17083
- __publicField$C(this, "_currentUrl");
17084
- __publicField$C(this, "_currentOverlay");
17085
- __publicField$C(this, "_loadedOverlay");
17081
+ __publicField$y(this, "wmsParams");
17082
+ __publicField$y(this, "_url");
17083
+ __publicField$y(this, "_currentUrl");
17084
+ __publicField$y(this, "_currentOverlay");
17085
+ __publicField$y(this, "_loadedOverlay");
17086
17086
  this._url = url;
17087
17087
  const params = {};
17088
17088
  const opts = {};
@@ -17242,34 +17242,34 @@ class ImageLayer extends leafletSrcExports.Layer {
17242
17242
  }
17243
17243
  }
17244
17244
 
17245
- var __defProp$P = Object.defineProperty;
17246
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17247
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17248
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17249
- var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17250
- var __spreadValues$v = (a, b) => {
17245
+ var __defProp$M = Object.defineProperty;
17246
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
17247
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
17248
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
17249
+ var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17250
+ var __spreadValues$x = (a, b) => {
17251
17251
  for (var prop in b || (b = {}))
17252
- if (__hasOwnProp$w.call(b, prop))
17253
- __defNormalProp$P(a, prop, b[prop]);
17254
- if (__getOwnPropSymbols$w)
17255
- for (var prop of __getOwnPropSymbols$w(b)) {
17256
- if (__propIsEnum$w.call(b, prop))
17257
- __defNormalProp$P(a, prop, b[prop]);
17252
+ if (__hasOwnProp$y.call(b, prop))
17253
+ __defNormalProp$M(a, prop, b[prop]);
17254
+ if (__getOwnPropSymbols$y)
17255
+ for (var prop of __getOwnPropSymbols$y(b)) {
17256
+ if (__propIsEnum$y.call(b, prop))
17257
+ __defNormalProp$M(a, prop, b[prop]);
17258
17258
  }
17259
17259
  return a;
17260
17260
  };
17261
- var __publicField$B = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17261
+ var __publicField$x = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
17262
17262
  class ImageAdapter extends BaseAdapter {
17263
17263
  constructor() {
17264
17264
  super(...arguments);
17265
- __publicField$B(this, "layer");
17265
+ __publicField$x(this, "layer");
17266
17266
  }
17267
17267
  addLayer(options) {
17268
17268
  const url = options && options.url;
17269
17269
  if (url) {
17270
- options = __spreadValues$v({ transparent: true }, options);
17270
+ options = __spreadValues$x({ transparent: true }, options);
17271
17271
  const updateWmsParamsFromOpt = options.updateWmsParams;
17272
- this.layer = new ImageLayer(url, __spreadValues$v(__spreadValues$v(__spreadValues$v({
17272
+ this.layer = new ImageLayer(url, __spreadValues$x(__spreadValues$x(__spreadValues$x({
17273
17273
  pane: this.pane,
17274
17274
  headers: options.headers,
17275
17275
  setViewDelay: options.setViewDelay
@@ -17285,7 +17285,7 @@ class ImageAdapter extends BaseAdapter {
17285
17285
  }
17286
17286
  }
17287
17287
  }
17288
- __publicField$B(ImageAdapter, "queue", imageQueue);
17288
+ __publicField$x(ImageAdapter, "queue", imageQueue);
17289
17289
 
17290
17290
  function makeRemote(Base) {
17291
17291
  return class RemoteTileLayer extends Base {
@@ -17347,33 +17347,33 @@ class TileLayerBase extends leafletSrcExports.TileLayer {
17347
17347
  }
17348
17348
  const TileLayer = makeRemote(TileLayerBase);
17349
17349
 
17350
- var __defProp$O = Object.defineProperty;
17350
+ var __defProp$L = Object.defineProperty;
17351
17351
  var __defProps$j = Object.defineProperties;
17352
17352
  var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
17353
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17354
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17355
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17356
- var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17357
- var __spreadValues$u = (a, b) => {
17353
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
17354
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
17355
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
17356
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17357
+ var __spreadValues$w = (a, b) => {
17358
17358
  for (var prop in b || (b = {}))
17359
- if (__hasOwnProp$v.call(b, prop))
17360
- __defNormalProp$O(a, prop, b[prop]);
17361
- if (__getOwnPropSymbols$v)
17362
- for (var prop of __getOwnPropSymbols$v(b)) {
17363
- if (__propIsEnum$v.call(b, prop))
17364
- __defNormalProp$O(a, prop, b[prop]);
17359
+ if (__hasOwnProp$x.call(b, prop))
17360
+ __defNormalProp$L(a, prop, b[prop]);
17361
+ if (__getOwnPropSymbols$x)
17362
+ for (var prop of __getOwnPropSymbols$x(b)) {
17363
+ if (__propIsEnum$x.call(b, prop))
17364
+ __defNormalProp$L(a, prop, b[prop]);
17365
17365
  }
17366
17366
  return a;
17367
17367
  };
17368
17368
  var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
17369
- var __objRest$3 = (source, exclude) => {
17369
+ var __objRest$4 = (source, exclude) => {
17370
17370
  var target = {};
17371
17371
  for (var prop in source)
17372
- if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17372
+ if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
17373
17373
  target[prop] = source[prop];
17374
- if (source != null && __getOwnPropSymbols$v)
17375
- for (var prop of __getOwnPropSymbols$v(source)) {
17376
- if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17374
+ if (source != null && __getOwnPropSymbols$x)
17375
+ for (var prop of __getOwnPropSymbols$x(source)) {
17376
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
17377
17377
  target[prop] = source[prop];
17378
17378
  }
17379
17379
  return target;
@@ -17382,9 +17382,9 @@ class TileAdapter extends BaseAdapter {
17382
17382
  addLayer(options) {
17383
17383
  this.options = Object.assign(this.options, options);
17384
17384
  if (options) {
17385
- const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17385
+ const _a = options, { url } = _a, opt = __objRest$4(_a, ["url"]);
17386
17386
  if (url) {
17387
- const tileLayerOptions = __spreadValues$u({
17387
+ const tileLayerOptions = __spreadValues$w({
17388
17388
  pane: this.pane,
17389
17389
  attribution: opt.attribution,
17390
17390
  minZoom: opt.minZoom,
@@ -17395,7 +17395,7 @@ class TileAdapter extends BaseAdapter {
17395
17395
  }
17396
17396
  let layer;
17397
17397
  if (opt.headers || opt.withCredentials) {
17398
- layer = new TileLayer(url, __spreadProps$j(__spreadValues$u({}, tileLayerOptions), {
17398
+ layer = new TileLayer(url, __spreadProps$j(__spreadValues$w({}, tileLayerOptions), {
17399
17399
  headers: opt.headers,
17400
17400
  withCredentials: opt.withCredentials,
17401
17401
  setViewDelay: opt.setViewDelay
@@ -17419,21 +17419,21 @@ class TileAdapter extends BaseAdapter {
17419
17419
  }
17420
17420
  }
17421
17421
 
17422
- var __defProp$N = Object.defineProperty;
17422
+ var __defProp$K = Object.defineProperty;
17423
17423
  var __defProps$i = Object.defineProperties;
17424
17424
  var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
17425
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17426
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17427
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17428
- var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17429
- var __spreadValues$t = (a, b) => {
17425
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17426
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17427
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17428
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17429
+ var __spreadValues$v = (a, b) => {
17430
17430
  for (var prop in b || (b = {}))
17431
- if (__hasOwnProp$u.call(b, prop))
17432
- __defNormalProp$N(a, prop, b[prop]);
17433
- if (__getOwnPropSymbols$u)
17434
- for (var prop of __getOwnPropSymbols$u(b)) {
17435
- if (__propIsEnum$u.call(b, prop))
17436
- __defNormalProp$N(a, prop, b[prop]);
17431
+ if (__hasOwnProp$w.call(b, prop))
17432
+ __defNormalProp$K(a, prop, b[prop]);
17433
+ if (__getOwnPropSymbols$w)
17434
+ for (var prop of __getOwnPropSymbols$w(b)) {
17435
+ if (__propIsEnum$w.call(b, prop))
17436
+ __defNormalProp$K(a, prop, b[prop]);
17437
17437
  }
17438
17438
  return a;
17439
17439
  };
@@ -17441,7 +17441,7 @@ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
17441
17441
  class OsmAdapter extends TileAdapter {
17442
17442
  addLayer(options) {
17443
17443
  const url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
17444
- return super.addLayer(__spreadProps$i(__spreadValues$t({
17444
+ return super.addLayer(__spreadProps$i(__spreadValues$v({
17445
17445
  name: "OpenStreetMap",
17446
17446
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
17447
17447
  }, options), {
@@ -17457,33 +17457,33 @@ class WmsLayerBase extends leafletSrcExports.TileLayer.WMS {
17457
17457
  }
17458
17458
  const WmsLayer = makeRemote(WmsLayerBase);
17459
17459
 
17460
- var __defProp$M = Object.defineProperty;
17460
+ var __defProp$J = Object.defineProperty;
17461
17461
  var __defProps$h = Object.defineProperties;
17462
17462
  var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
17463
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
17464
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
17465
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
17466
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17467
- var __spreadValues$s = (a, b) => {
17468
- for (var prop in b || (b = {}))
17469
- if (__hasOwnProp$t.call(b, prop))
17470
- __defNormalProp$M(a, prop, b[prop]);
17471
- if (__getOwnPropSymbols$t)
17472
- for (var prop of __getOwnPropSymbols$t(b)) {
17473
- if (__propIsEnum$t.call(b, prop))
17474
- __defNormalProp$M(a, prop, b[prop]);
17463
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17464
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17465
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17466
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17467
+ var __spreadValues$u = (a, b) => {
17468
+ for (var prop in b || (b = {}))
17469
+ if (__hasOwnProp$v.call(b, prop))
17470
+ __defNormalProp$J(a, prop, b[prop]);
17471
+ if (__getOwnPropSymbols$v)
17472
+ for (var prop of __getOwnPropSymbols$v(b)) {
17473
+ if (__propIsEnum$v.call(b, prop))
17474
+ __defNormalProp$J(a, prop, b[prop]);
17475
17475
  }
17476
17476
  return a;
17477
17477
  };
17478
17478
  var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
17479
- var __objRest$2 = (source, exclude) => {
17479
+ var __objRest$3 = (source, exclude) => {
17480
17480
  var target = {};
17481
17481
  for (var prop in source)
17482
- if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
17482
+ if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17483
17483
  target[prop] = source[prop];
17484
- if (source != null && __getOwnPropSymbols$t)
17485
- for (var prop of __getOwnPropSymbols$t(source)) {
17486
- if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
17484
+ if (source != null && __getOwnPropSymbols$v)
17485
+ for (var prop of __getOwnPropSymbols$v(source)) {
17486
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17487
17487
  target[prop] = source[prop];
17488
17488
  }
17489
17489
  return target;
@@ -17491,9 +17491,9 @@ var __objRest$2 = (source, exclude) => {
17491
17491
  class WmsAdapter extends BaseAdapter {
17492
17492
  addLayer(options) {
17493
17493
  Object.assign(this.options, options);
17494
- const _a = options, { url } = _a, opt = __objRest$2(_a, ["url"]);
17494
+ const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17495
17495
  if (url) {
17496
- const layerOptions = __spreadValues$s({
17496
+ const layerOptions = __spreadValues$u({
17497
17497
  pane: this.pane,
17498
17498
  attribution: opt.attribution,
17499
17499
  minZoom: opt.minZoom,
@@ -17504,7 +17504,7 @@ class WmsAdapter extends BaseAdapter {
17504
17504
  }, options.nativeOptions);
17505
17505
  let layer;
17506
17506
  if (opt.headers || opt.withCredentials) {
17507
- layer = new WmsLayer(url, __spreadProps$h(__spreadValues$s({}, layerOptions), {
17507
+ layer = new WmsLayer(url, __spreadProps$h(__spreadValues$u({}, layerOptions), {
17508
17508
  headers: opt.headers,
17509
17509
  withCredentials: opt.withCredentials
17510
17510
  }));
@@ -17524,33 +17524,33 @@ function arrayToBoundsExpression(bounds) {
17524
17524
  ];
17525
17525
  }
17526
17526
 
17527
- var __defProp$L = Object.defineProperty;
17528
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
17529
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
17530
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
17531
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17532
- var __spreadValues$r = (a, b) => {
17527
+ var __defProp$I = Object.defineProperty;
17528
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17529
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17530
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17531
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17532
+ var __spreadValues$t = (a, b) => {
17533
17533
  for (var prop in b || (b = {}))
17534
- if (__hasOwnProp$s.call(b, prop))
17535
- __defNormalProp$L(a, prop, b[prop]);
17536
- if (__getOwnPropSymbols$s)
17537
- for (var prop of __getOwnPropSymbols$s(b)) {
17538
- if (__propIsEnum$s.call(b, prop))
17539
- __defNormalProp$L(a, prop, b[prop]);
17534
+ if (__hasOwnProp$u.call(b, prop))
17535
+ __defNormalProp$I(a, prop, b[prop]);
17536
+ if (__getOwnPropSymbols$u)
17537
+ for (var prop of __getOwnPropSymbols$u(b)) {
17538
+ if (__propIsEnum$u.call(b, prop))
17539
+ __defNormalProp$I(a, prop, b[prop]);
17540
17540
  }
17541
17541
  return a;
17542
17542
  };
17543
- var __publicField$A = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17543
+ var __publicField$w = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
17544
17544
  const _LeafletMapAdapter = class _LeafletMapAdapter {
17545
17545
  constructor() {
17546
- __publicField$A(this, "options", { target: "map" });
17547
- __publicField$A(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17548
- __publicField$A(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17549
- __publicField$A(this, "emitter", new EventEmitter());
17550
- __publicField$A(this, "map");
17551
- __publicField$A(this, "_resizeObserver");
17552
- __publicField$A(this, "_unselectCb", []);
17553
- __publicField$A(this, "_universalEvents", [
17546
+ __publicField$w(this, "options", { target: "map" });
17547
+ __publicField$w(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17548
+ __publicField$w(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17549
+ __publicField$w(this, "emitter", new EventEmitter());
17550
+ __publicField$w(this, "map");
17551
+ __publicField$w(this, "_resizeObserver");
17552
+ __publicField$w(this, "_unselectCb", []);
17553
+ __publicField$w(this, "_universalEvents", [
17554
17554
  "move",
17555
17555
  "zoom",
17556
17556
  "zoomend",
@@ -17558,14 +17558,14 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17558
17558
  "moveend",
17559
17559
  "movestart"
17560
17560
  ]);
17561
- __publicField$A(this, "_positionEvents", [
17561
+ __publicField$w(this, "_positionEvents", [
17562
17562
  "mousemove",
17563
17563
  "mouseout",
17564
17564
  "mouseover"
17565
17565
  ]);
17566
17566
  }
17567
17567
  create(options) {
17568
- this.options = __spreadValues$r({}, options);
17568
+ this.options = __spreadValues$t({}, options);
17569
17569
  if (this.options.target) {
17570
17570
  const {
17571
17571
  zoom,
@@ -17575,7 +17575,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17575
17575
  maxBounds: mb,
17576
17576
  mapAdapterOptions
17577
17577
  } = this.options;
17578
- this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$r({
17578
+ this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$t({
17579
17579
  attributionControl: false,
17580
17580
  zoomControl: false,
17581
17581
  maxBounds: mb ? arrayToBoundsExpression(mb) : void 0,
@@ -17858,7 +17858,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17858
17858
  }
17859
17859
  }
17860
17860
  };
17861
- __publicField$A(_LeafletMapAdapter, "layerAdapters", {
17861
+ __publicField$w(_LeafletMapAdapter, "layerAdapters", {
17862
17862
  GEOJSON: GeoJsonAdapter,
17863
17863
  IMAGE: ImageAdapter,
17864
17864
  TILE: TileAdapter,
@@ -17866,315 +17866,13 @@ __publicField$A(_LeafletMapAdapter, "layerAdapters", {
17866
17866
  // // MVT: MvtAdapter,
17867
17867
  OSM: OsmAdapter
17868
17868
  });
17869
- __publicField$A(_LeafletMapAdapter, "controlAdapters", {
17869
+ __publicField$w(_LeafletMapAdapter, "controlAdapters", {
17870
17870
  ZOOM: leafletSrcExports.Control.Zoom,
17871
17871
  ATTRIBUTION: AttributionControl
17872
17872
  });
17873
- __publicField$A(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17873
+ __publicField$w(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17874
17874
  let LeafletMapAdapter = _LeafletMapAdapter;
17875
17875
 
17876
- var __defProp$K = Object.defineProperty;
17877
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17878
- var __publicField$z = (obj, key, value) => __defNormalProp$K(obj, key + "" , value);
17879
- class CancelError extends Error {
17880
- constructor() {
17881
- super();
17882
- __publicField$z(this, "name", "CancelError");
17883
- Object.setPrototypeOf(this, CancelError.prototype);
17884
- }
17885
- }
17886
-
17887
- var __defProp$J = Object.defineProperty;
17888
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17889
- var __publicField$y = (obj, key, value) => __defNormalProp$J(obj, key + "" , value);
17890
- class PromiseControl {
17891
- constructor(options = {}) {
17892
- this.options = options;
17893
- __publicField$y(this, "_promises", /* @__PURE__ */ new Map());
17894
- }
17895
- get isLoaded() {
17896
- return this._promises.size > 0;
17897
- }
17898
- remove(promise) {
17899
- if (this._promises.has(promise)) {
17900
- this._promises.delete(promise);
17901
- this._onStop();
17902
- }
17903
- }
17904
- get(promise) {
17905
- return this._promises.get(promise);
17906
- }
17907
- add(promise, name) {
17908
- const key = name ? name : promise;
17909
- const exist = this._promises.get(key);
17910
- if (this.options.onStart && !this.isLoaded) {
17911
- this.options.onStart();
17912
- }
17913
- if (exist) {
17914
- return exist;
17915
- }
17916
- this._promises.set(key, promise);
17917
- promise.finally(() => {
17918
- this.remove(key);
17919
- });
17920
- return promise;
17921
- }
17922
- abort() {
17923
- if (this.isLoaded) {
17924
- this._promises.forEach((x) => {
17925
- if (x.cancel) {
17926
- x.cancel();
17927
- }
17928
- });
17929
- this._promises.clear();
17930
- this._onStop();
17931
- }
17932
- }
17933
- waitFunc(func, name = "") {
17934
- name = name || func.name;
17935
- const exist = this.get(name);
17936
- if (exist) {
17937
- return exist;
17938
- }
17939
- return this.add(func(), name);
17940
- }
17941
- WaitForMe(name = "") {
17942
- const get = this.get.bind(this);
17943
- const add = this.add.bind(this);
17944
- return function(target, key, descriptor) {
17945
- const originalMethod = descriptor.value;
17946
- name = name || key;
17947
- descriptor.value = function(...args) {
17948
- const exist = get(name);
17949
- if (exist) {
17950
- return exist;
17951
- }
17952
- const result = add(originalMethod.apply(this, args), name);
17953
- return result;
17954
- };
17955
- return descriptor;
17956
- };
17957
- }
17958
- /** @deprecated use {@link PromiseControl.WaitForMe } instead */
17959
- GetOrCreateDecorator(name = "") {
17960
- return this.WaitForMe(name);
17961
- }
17962
- _onStop() {
17963
- if (this.options.onStop && !this.isLoaded) {
17964
- this.options.onStop();
17965
- }
17966
- }
17967
- }
17968
-
17969
- var __defProp$I = Object.defineProperty;
17970
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17971
- var __publicField$x = (obj, key, value) => __defNormalProp$I(obj, key + "" , value);
17972
- class TimeoutError extends Error {
17973
- constructor() {
17974
- super();
17975
- __publicField$x(this, "name", "TimeoutError");
17976
- Object.setPrototypeOf(this, TimeoutError.prototype);
17977
- }
17978
- }
17979
-
17980
- var __defProp$H = Object.defineProperty;
17981
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17982
- var __publicField$w = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
17983
- var _a;
17984
- const handleCallback = (resolve, reject, callback, r) => {
17985
- try {
17986
- resolve(callback(r));
17987
- } catch (e) {
17988
- reject(e);
17989
- }
17990
- };
17991
- let ID$3 = 0;
17992
- _a = Symbol.toStringTag;
17993
- const _CancelablePromise = class _CancelablePromise {
17994
- constructor(executor, timeout) {
17995
- // @ts-ignore
17996
- __publicField$w(this, _a);
17997
- __publicField$w(this, "id", ID$3++);
17998
- __publicField$w(this, "_isCanceled", false);
17999
- __publicField$w(this, "_isPending", true);
18000
- __publicField$w(this, "_promise");
18001
- __publicField$w(this, "_cancelPromise");
18002
- __publicField$w(this, "_cancelHandlers", []);
18003
- __publicField$w(this, "_setCanceledCallback");
18004
- __publicField$w(this, "_parentPromise");
18005
- __publicField$w(this, "_children", []);
18006
- this._cancelPromise = new Promise((resolve_, reject_) => {
18007
- this._setCanceledCallback = (er) => resolve_(er || new CancelError());
18008
- });
18009
- const promises = [
18010
- this._cancelPromise,
18011
- new Promise((resolve, reject) => {
18012
- const onResolve = (value) => {
18013
- if (value instanceof _CancelablePromise) {
18014
- this.attach(value);
18015
- } else {
18016
- this._isPending = false;
18017
- }
18018
- resolve(value);
18019
- };
18020
- const onReject = (error) => {
18021
- this._isPending = false;
18022
- reject(error);
18023
- };
18024
- const onCancel = (handler) => {
18025
- if (!this._isPending) {
18026
- throw new Error(
18027
- "The `onCancel` handler was attached after the promise settled."
18028
- );
18029
- }
18030
- this._cancelHandlers.push(handler);
18031
- };
18032
- return executor(onResolve, onReject, onCancel);
18033
- })
18034
- ];
18035
- if (timeout) {
18036
- promises.push(
18037
- new Promise((resolve, reject) => {
18038
- setTimeout(() => {
18039
- if (this._isPending) {
18040
- try {
18041
- this.cancel();
18042
- } finally {
18043
- reject(new TimeoutError());
18044
- }
18045
- }
18046
- }, timeout);
18047
- })
18048
- );
18049
- }
18050
- this._promise = Promise.race(promises);
18051
- }
18052
- static createControl(opt) {
18053
- return new PromiseControl(opt);
18054
- }
18055
- static resolve(value) {
18056
- return new _CancelablePromise((resolve) => resolve(value));
18057
- }
18058
- static reject(value) {
18059
- return new _CancelablePromise((resolve, reject) => reject(value));
18060
- }
18061
- static all(values) {
18062
- return new _CancelablePromise((resolve, reject) => {
18063
- Promise.all(values).then(resolve).catch(reject);
18064
- }).catch((er) => {
18065
- if (er instanceof this.CancelError) {
18066
- for (const v of values) {
18067
- const v_ = v;
18068
- if ("cancel" in v_) {
18069
- v_.cancel();
18070
- }
18071
- }
18072
- }
18073
- throw er;
18074
- });
18075
- }
18076
- attach(p) {
18077
- if (this._isCanceled) {
18078
- p.cancel();
18079
- } else {
18080
- this._children.push(p);
18081
- }
18082
- }
18083
- then(onfulfilled, onrejected) {
18084
- const p = new _CancelablePromise((resolve, reject) => {
18085
- if (this._promise) {
18086
- const reject_ = (r) => {
18087
- if (onrejected) {
18088
- handleCallback(resolve, reject, onrejected, r);
18089
- } else {
18090
- reject(r);
18091
- }
18092
- };
18093
- this._promise.then((r) => {
18094
- if (this._isCanceled) {
18095
- reject_(r);
18096
- } else {
18097
- if (onfulfilled) {
18098
- handleCallback(resolve, reject, onfulfilled, r);
18099
- } else {
18100
- resolve(r);
18101
- }
18102
- }
18103
- }, reject_);
18104
- }
18105
- });
18106
- p._parentPromise = this;
18107
- this._children.push(p);
18108
- return p;
18109
- }
18110
- catch(onrejected) {
18111
- if (this._isCanceled && onrejected) {
18112
- onrejected(new CancelError());
18113
- }
18114
- return this.then(void 0, onrejected);
18115
- }
18116
- finally(onfinally) {
18117
- if (this._promise) {
18118
- return this._promise.finally(onfinally);
18119
- }
18120
- if (this._isCanceled) {
18121
- return Promise.reject(new CancelError());
18122
- }
18123
- return Promise.reject(onfinally);
18124
- }
18125
- cancel() {
18126
- if (this._isCanceled || !this._isPending) {
18127
- return this;
18128
- }
18129
- this._isCanceled = true;
18130
- const parent = this._getTopParent();
18131
- if (parent) {
18132
- parent.cancel();
18133
- }
18134
- if (this._children) {
18135
- this._children.forEach((x) => x.cancel());
18136
- }
18137
- if (this._isPending) {
18138
- if (this._cancelHandlers.length) {
18139
- try {
18140
- for (const handler of this._cancelHandlers) {
18141
- handler();
18142
- }
18143
- } catch (error) {
18144
- }
18145
- }
18146
- if (this._setCanceledCallback) {
18147
- this._setCanceledCallback();
18148
- }
18149
- }
18150
- this._destroy();
18151
- return this;
18152
- }
18153
- _getTopParent() {
18154
- let parent = this._parentPromise;
18155
- let hasParent = !!parent;
18156
- while (hasParent) {
18157
- if (parent && parent._parentPromise) {
18158
- parent = parent._parentPromise;
18159
- hasParent = !!parent;
18160
- } else {
18161
- hasParent = false;
18162
- }
18163
- }
18164
- return parent;
18165
- }
18166
- _destroy() {
18167
- this._setCanceledCallback = void 0;
18168
- this._cancelPromise = void 0;
18169
- this._promise = void 0;
18170
- }
18171
- };
18172
- __publicField$w(_CancelablePromise, "CancelError", CancelError);
18173
- __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
18174
- __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
18175
- let CancelablePromise = _CancelablePromise;
18176
- Object.setPrototypeOf(CancelablePromise.prototype, Promise.prototype);
18177
-
18178
17876
  const svgPath = {
18179
17877
  brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
18180
17878
  circle: '<circle cx="6" cy="6" r="6"/>',
@@ -18247,9 +17945,9 @@ function getIcon(opt = {}) {
18247
17945
  };
18248
17946
  }
18249
17947
 
18250
- var __defProp$G = Object.defineProperty;
18251
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18252
- var __publicField$v = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
17948
+ var __defProp$H = Object.defineProperty;
17949
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17950
+ var __publicField$v = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18253
17951
  const _Cache = class _Cache {
18254
17952
  constructor(options = {}) {
18255
17953
  __publicField$v(this, "cache", []);
@@ -18285,8 +17983,7 @@ const _Cache = class _Cache {
18285
17983
  * // somewhere else in the code
18286
17984
  * const item = await cache.addFull('foo', getItemFunc).then((resp) => {
18287
17985
  * console.log(resp); // 'New item'
18288
- * })
18289
- *
17986
+ * });
18290
17987
  * ```
18291
17988
  */
18292
17989
  addFull(key, valueToSet, props) {
@@ -18301,13 +17998,11 @@ const _Cache = class _Cache {
18301
17998
  } else {
18302
17999
  value = valueToSet;
18303
18000
  }
18304
- const props_ = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
18001
+ const nonEmptyProps = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
18305
18002
  const cacheItem = {
18306
18003
  key,
18307
18004
  value,
18308
- props: props_,
18309
- // TODO: remove backward compatibility use only props
18310
- options: props_
18005
+ props: nonEmptyProps
18311
18006
  };
18312
18007
  if (onlyFull && !full(value)) {
18313
18008
  return value;
@@ -18316,7 +18011,6 @@ const _Cache = class _Cache {
18316
18011
  if (value instanceof Promise) {
18317
18012
  value.catch((er) => {
18318
18013
  this.delete(key, props);
18319
- throw er;
18320
18014
  });
18321
18015
  if (onlyFull) {
18322
18016
  value.then((x) => {
@@ -18335,9 +18029,7 @@ const _Cache = class _Cache {
18335
18029
  }
18336
18030
  match(key, props) {
18337
18031
  const cacheRecord = this._find(key, props);
18338
- if (cacheRecord) {
18339
- return cacheRecord.value;
18340
- }
18032
+ return cacheRecord == null ? void 0 : cacheRecord.value;
18341
18033
  }
18342
18034
  matchAll(key, props) {
18343
18035
  if (key) {
@@ -18346,37 +18038,30 @@ const _Cache = class _Cache {
18346
18038
  return this.cache.map((x) => x.value);
18347
18039
  }
18348
18040
  delete(keyOrItem, props) {
18349
- let exist = [];
18350
- if (typeof keyOrItem === "string") {
18351
- exist = this.cache.filter((x) => this._filter(x, keyOrItem, props));
18352
- } else {
18353
- exist.push(keyOrItem);
18354
- }
18355
- for (const e of exist) {
18356
- const index = this.cache.indexOf(e);
18357
- this.cache.splice(index, 1);
18041
+ const itemsToDelete = typeof keyOrItem === "string" ? this.cache.filter((x) => this._filter(x, keyOrItem, props)) : [keyOrItem];
18042
+ for (const item of itemsToDelete) {
18043
+ const index = this.cache.indexOf(item);
18044
+ if (index !== -1) {
18045
+ this.cache.splice(index, 1);
18046
+ }
18358
18047
  }
18359
18048
  }
18360
18049
  _find(key, props) {
18361
18050
  return this.cache.find((x) => this._filter(x, key, props));
18362
18051
  }
18363
18052
  _filter(item, key, props) {
18364
- if (item.key === key) {
18365
- if (props) {
18366
- const itemProps = item.props || item.options;
18367
- return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18368
- }
18369
- return true;
18370
- }
18371
- return false;
18053
+ if (item.key !== key) return false;
18054
+ if (!props) return true;
18055
+ const itemProps = item.props;
18056
+ return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18372
18057
  }
18373
18058
  };
18374
18059
  __publicField$v(_Cache, "instance", {});
18375
18060
  let Cache = _Cache;
18376
18061
 
18377
- var __defProp$F = Object.defineProperty;
18378
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18379
- var __publicField$u = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18062
+ var __defProp$G = Object.defineProperty;
18063
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18064
+ var __publicField$u = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18380
18065
  class NgwError extends Error {
18381
18066
  constructor(er) {
18382
18067
  super();
@@ -18393,9 +18078,9 @@ class NgwError extends Error {
18393
18078
  }
18394
18079
  }
18395
18080
 
18396
- var __defProp$E = Object.defineProperty;
18397
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18398
- var __publicField$t = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18081
+ var __defProp$F = Object.defineProperty;
18082
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18083
+ var __publicField$t = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18399
18084
  class ResourceNotFoundError extends NgwError {
18400
18085
  constructor(obj) {
18401
18086
  super(obj);
@@ -18434,27 +18119,24 @@ function resourceToQuery(resource, prefix = "") {
18434
18119
  return query;
18435
18120
  }
18436
18121
 
18437
- var __defProp$D = Object.defineProperty;
18438
- var __defProps$g = Object.defineProperties;
18439
- var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
18440
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18441
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18442
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18443
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18444
- var __spreadValues$q = (a, b) => {
18122
+ var __defProp$E = Object.defineProperty;
18123
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
18124
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
18125
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
18126
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18127
+ var __spreadValues$s = (a, b) => {
18445
18128
  for (var prop in b || (b = {}))
18446
- if (__hasOwnProp$r.call(b, prop))
18447
- __defNormalProp$D(a, prop, b[prop]);
18448
- if (__getOwnPropSymbols$r)
18449
- for (var prop of __getOwnPropSymbols$r(b)) {
18450
- if (__propIsEnum$r.call(b, prop))
18451
- __defNormalProp$D(a, prop, b[prop]);
18129
+ if (__hasOwnProp$t.call(b, prop))
18130
+ __defNormalProp$E(a, prop, b[prop]);
18131
+ if (__getOwnPropSymbols$t)
18132
+ for (var prop of __getOwnPropSymbols$t(b)) {
18133
+ if (__propIsEnum$t.call(b, prop))
18134
+ __defNormalProp$E(a, prop, b[prop]);
18452
18135
  }
18453
18136
  return a;
18454
18137
  };
18455
- var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
18456
- var __publicField$s = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18457
- var __async$k = (__this, __arguments, generator) => {
18138
+ var __publicField$s = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18139
+ var __async$r = (__this, __arguments, generator) => {
18458
18140
  return new Promise((resolve, reject) => {
18459
18141
  var fulfilled = (value) => {
18460
18142
  try {
@@ -18495,39 +18177,27 @@ class ResourcesControl {
18495
18177
  * Fetching resource would be cached to speed up next call
18496
18178
  */
18497
18179
  getOne(resource, requestOptions) {
18498
- const cache = this.cache;
18499
- const forCache = {};
18500
- const opt = __spreadProps$g(__spreadValues$q({}, requestOptions), { cache: false });
18501
- if (typeof resource === "string") {
18502
- forCache.keyname = resource;
18503
- } else if (typeof resource === "number") {
18504
- forCache.id = resource;
18505
- } else if (isObject(resource)) {
18180
+ const opt = __spreadValues$s({}, requestOptions);
18181
+ if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
18506
18182
  if (resource.id !== void 0) {
18507
- forCache.id = resource.id;
18183
+ resource.id;
18508
18184
  } else {
18509
18185
  if (resource.keyname) {
18510
- forCache.keyname = resource.keyname;
18186
+ resource.keyname;
18511
18187
  }
18512
18188
  if (resource.display_name) {
18513
- forCache.display_name = resource.display_name;
18189
+ resource.display_name;
18514
18190
  }
18515
18191
  }
18516
18192
  }
18517
- const makeRequest = () => {
18518
- if (typeof resource === "string") {
18519
- return this._fetchResourceBy({ keyname: resource }, opt);
18520
- } else if (typeof resource === "number") {
18521
- return this._fetchResourceById(resource, opt);
18522
- } else if (isObject(resource)) {
18523
- return this._fetchResourceBy(resource, opt);
18524
- }
18525
- return CancelablePromise.resolve(void 0);
18526
- };
18527
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18528
- return cache.addFull("resource", makeRequest, forCache);
18193
+ if (typeof resource === "string") {
18194
+ return this._fetchResourceBy({ keyname: resource }, opt);
18195
+ } else if (typeof resource === "number") {
18196
+ return this._fetchResourceById(resource, opt);
18197
+ } else if (isObject(resource)) {
18198
+ return this._fetchResourceBy(resource, opt);
18529
18199
  }
18530
- return makeRequest();
18200
+ return Promise.resolve(void 0);
18531
18201
  }
18532
18202
  getOneOrFail(resource, requestOptions) {
18533
18203
  return this.getOne(resource, requestOptions).then((res) => {
@@ -18549,7 +18219,7 @@ class ResourcesControl {
18549
18219
  */
18550
18220
  getId(resource, requestOptions) {
18551
18221
  if (typeof resource === "number") {
18552
- return CancelablePromise.resolve(resource);
18222
+ return Promise.resolve(resource);
18553
18223
  } else if (typeof resource === "string" || isObject(resource)) {
18554
18224
  return this.getOne(resource, requestOptions).then((res) => {
18555
18225
  if (res) {
@@ -18557,7 +18227,7 @@ class ResourcesControl {
18557
18227
  }
18558
18228
  });
18559
18229
  }
18560
- return CancelablePromise.resolve(void 0);
18230
+ return Promise.resolve(void 0);
18561
18231
  }
18562
18232
  /**
18563
18233
  * A fast way to retrieve resource ID for any resource definition.
@@ -18584,12 +18254,12 @@ class ResourcesControl {
18584
18254
  } else {
18585
18255
  Object.assign(query, resourceToQuery(resource));
18586
18256
  }
18587
- return this.connector.get("resource.search", requestOptions, __spreadValues$q({
18257
+ return this.connector.get("resource.search", requestOptions, __spreadValues$s({
18588
18258
  serialization: "full"
18589
18259
  }, query)).then((resources) => {
18590
- if (resources) {
18260
+ if ((requestOptions == null ? void 0 : requestOptions.cache) && resources) {
18591
18261
  for (const x of resources) {
18592
- this.cache.add("resource.item", CancelablePromise.resolve(x), {
18262
+ this.cache.add("resource.item", Promise.resolve(x), {
18593
18263
  id: x.resource.id
18594
18264
  });
18595
18265
  }
@@ -18605,7 +18275,7 @@ class ResourcesControl {
18605
18275
  if (child) {
18606
18276
  return this.getOne(child.resource.parent.id, requestOptions);
18607
18277
  }
18608
- return CancelablePromise.resolve(void 0);
18278
+ return Promise.resolve(void 0);
18609
18279
  });
18610
18280
  }
18611
18281
  getChildrenOf(resource, requestOptions) {
@@ -18635,18 +18305,16 @@ class ResourcesControl {
18635
18305
  });
18636
18306
  }
18637
18307
  _getChildrenOf(parent, requestOptions, _items = []) {
18638
- return this.connector.get(
18639
- "resource.collection",
18640
- __spreadValues$q({ cache: true }, requestOptions),
18641
- {
18642
- parent
18643
- }
18644
- ).then((items) => {
18308
+ return this.connector.get("resource.collection", requestOptions, {
18309
+ parent
18310
+ }).then((items) => {
18645
18311
  const recursivePromises = [];
18646
18312
  for (const item of items) {
18647
- this.cache.add("resource.item", CancelablePromise.resolve(item), {
18648
- id: item.resource.id
18649
- });
18313
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18314
+ this.cache.add("resource.item", Promise.resolve(item), {
18315
+ id: item.resource.id
18316
+ });
18317
+ }
18650
18318
  _items.push(item);
18651
18319
  if ((requestOptions == null ? void 0 : requestOptions.recursive) && item.resource.children) {
18652
18320
  recursivePromises.push(
@@ -18655,7 +18323,7 @@ class ResourcesControl {
18655
18323
  }
18656
18324
  }
18657
18325
  if (recursivePromises.length) {
18658
- return CancelablePromise.all(recursivePromises).then(() => {
18326
+ return Promise.all(recursivePromises).then(() => {
18659
18327
  return _items;
18660
18328
  });
18661
18329
  }
@@ -18663,11 +18331,12 @@ class ResourcesControl {
18663
18331
  });
18664
18332
  }
18665
18333
  _cleanResourceItemCache(id) {
18666
- return __async$k(this, null, function* () {
18334
+ return __async$r(this, null, function* () {
18335
+ var _a;
18667
18336
  const all = this.cache.all();
18668
18337
  const toDelete = [];
18669
18338
  for (const c of all) {
18670
- const cid = c.options && c.options.id;
18339
+ const cid = (_a = c.props) == null ? void 0 : _a.id;
18671
18340
  if (["resource.item", "resource"].includes(c.key) && cid !== void 0) {
18672
18341
  if (typeof cid === "number") {
18673
18342
  if (cid === id) {
@@ -18687,18 +18356,7 @@ class ResourcesControl {
18687
18356
  });
18688
18357
  }
18689
18358
  _fetchResourceById(id, requestOptions) {
18690
- const promise = () => this.connector.get("resource.item", requestOptions, { id });
18691
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18692
- return this.cache.add("resource.item", promise, {
18693
- id
18694
- }).catch((er) => {
18695
- if (!(er instanceof ResourceNotFoundError)) {
18696
- throw er;
18697
- }
18698
- return void 0;
18699
- });
18700
- }
18701
- return promise();
18359
+ return this.connector.get("resource.item", requestOptions, { id });
18702
18360
  }
18703
18361
  _fetchResourceBy(resource, requestOptions) {
18704
18362
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -18706,7 +18364,7 @@ class ResourcesControl {
18706
18364
  });
18707
18365
  }
18708
18366
  _resourceCacheFilter(resource) {
18709
- return CancelablePromise.all(this.cache.matchAll("resource.item")).then(
18367
+ return Promise.all(this.cache.matchAll("resource.item")).then(
18710
18368
  (resources) => {
18711
18369
  const items = [];
18712
18370
  resources.filter((x) => {
@@ -18750,9 +18408,16 @@ function removeConnector(connector) {
18750
18408
  }
18751
18409
  }
18752
18410
 
18753
- var __defProp$C = Object.defineProperty;
18754
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18755
- var __publicField$r = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18411
+ class AbortError extends Error {
18412
+ constructor(message = "AbortError") {
18413
+ super(message);
18414
+ this.name = "AbortError";
18415
+ }
18416
+ }
18417
+
18418
+ var __defProp$D = Object.defineProperty;
18419
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18420
+ var __publicField$r = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18756
18421
  class InsufficientPermissionsError extends NgwError {
18757
18422
  constructor(obj) {
18758
18423
  super(obj);
@@ -18775,58 +18440,90 @@ function template(str, data) {
18775
18440
  });
18776
18441
  }
18777
18442
 
18443
+ var __defProp$C = Object.defineProperty;
18444
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
18445
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
18446
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
18447
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18448
+ var __spreadValues$r = (a, b) => {
18449
+ for (var prop in b || (b = {}))
18450
+ if (__hasOwnProp$s.call(b, prop))
18451
+ __defNormalProp$C(a, prop, b[prop]);
18452
+ if (__getOwnPropSymbols$s)
18453
+ for (var prop of __getOwnPropSymbols$s(b)) {
18454
+ if (__propIsEnum$s.call(b, prop))
18455
+ __defNormalProp$C(a, prop, b[prop]);
18456
+ }
18457
+ return a;
18458
+ };
18459
+ var __async$q = (__this, __arguments, generator) => {
18460
+ return new Promise((resolve, reject) => {
18461
+ var fulfilled = (value) => {
18462
+ try {
18463
+ step(generator.next(value));
18464
+ } catch (e) {
18465
+ reject(e);
18466
+ }
18467
+ };
18468
+ var rejected = (value) => {
18469
+ try {
18470
+ step(generator.throw(value));
18471
+ } catch (e) {
18472
+ reject(e);
18473
+ }
18474
+ };
18475
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18476
+ step((generator = generator.apply(__this, __arguments)).next());
18477
+ });
18478
+ };
18778
18479
  function apiRequest(opt) {
18779
- const params = opt.params;
18780
- return new CancelablePromise((resolve, reject) => {
18781
- return opt.connector.connect().then((apiItems) => {
18782
- let apiItem = apiItems && apiItems[opt.name];
18783
- if (apiItem) {
18784
- apiItem = [...apiItem];
18785
- let url = apiItem.shift();
18786
- if (apiItem.length) {
18787
- const replaceParams = {};
18788
- for (let fry = 0; fry < apiItem.length; fry++) {
18789
- const arg = apiItem[fry];
18790
- replaceParams[fry] = "{" + arg + "}";
18791
- if (params[arg] === void 0) {
18792
- throw new Error(
18793
- "`" + arg + "` url api argument is not specified"
18794
- );
18795
- }
18796
- }
18797
- if (url) {
18798
- url = template(url, replaceParams);
18480
+ return __async$q(this, null, function* () {
18481
+ const { params, name, connector, requestOptions } = opt;
18482
+ const apiItems = yield connector.connect();
18483
+ let apiItem = apiItems && apiItems[name];
18484
+ if (apiItem) {
18485
+ apiItem = [...apiItem];
18486
+ let url = apiItem.shift();
18487
+ if (apiItem.length) {
18488
+ const replaceParams = {};
18489
+ for (let fry = 0; fry < apiItem.length; fry++) {
18490
+ const arg = apiItem[fry];
18491
+ replaceParams[fry] = `{${arg}}`;
18492
+ if (params[arg] === void 0) {
18493
+ throw new Error(`\`${arg}\` URL API argument is not specified`);
18799
18494
  }
18800
18495
  }
18801
- if (params) {
18802
- const paramArray = [];
18803
- const paramList = params.paramList;
18804
- if (Array.isArray(paramList)) {
18805
- delete params.paramList;
18806
- paramList.forEach((x) => {
18807
- paramArray.push(`${x[0]}=${x[1]}`);
18808
- });
18809
- }
18810
- for (const p in params) {
18811
- if (apiItem.indexOf(p) === -1) {
18812
- paramArray.push(`${p}=${params[p]}`);
18813
- }
18814
- }
18815
- if (paramArray.length) {
18816
- url = url + "?" + paramArray.join("&");
18496
+ if (url) {
18497
+ url = template(url, replaceParams);
18498
+ }
18499
+ }
18500
+ if (params) {
18501
+ const paramArray = [];
18502
+ const paramList = params.paramList;
18503
+ if (Array.isArray(paramList)) {
18504
+ paramList.forEach(([key, value]) => {
18505
+ paramArray.push(`${key}=${value}`);
18506
+ });
18507
+ }
18508
+ for (const p in params) {
18509
+ if (apiItem.indexOf(p) === -1) {
18510
+ paramArray.push(`${p}=${params[p]}`);
18817
18511
  }
18818
18512
  }
18819
- if (url) {
18820
- resolve(opt.connector.makeQuery(url, params, opt.requestOptions));
18821
- } else {
18822
- reject(new Error("request url is not set"));
18513
+ if (paramArray.length) {
18514
+ url = `${url}?${paramArray.join("&")}`;
18823
18515
  }
18516
+ }
18517
+ if (url) {
18518
+ return connector.makeQuery(url, params, __spreadValues$r({
18519
+ cacheName: name
18520
+ }, requestOptions));
18824
18521
  } else {
18825
- resolve(void 0);
18522
+ throw new Error("Request URL is not set");
18826
18523
  }
18827
- }).catch((er) => {
18828
- reject(er);
18829
- });
18524
+ } else {
18525
+ return void 0;
18526
+ }
18830
18527
  });
18831
18528
  }
18832
18529
 
@@ -18926,23 +18623,59 @@ let loadData;
18926
18623
  }
18927
18624
 
18928
18625
  var __defProp$A = Object.defineProperty;
18929
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
18930
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
18931
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
18626
+ var __defProps$g = Object.defineProperties;
18627
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
18628
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18629
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18630
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18932
18631
  var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18933
- var __spreadValues$p = (a, b) => {
18632
+ var __spreadValues$q = (a, b) => {
18934
18633
  for (var prop in b || (b = {}))
18935
- if (__hasOwnProp$q.call(b, prop))
18634
+ if (__hasOwnProp$r.call(b, prop))
18936
18635
  __defNormalProp$A(a, prop, b[prop]);
18937
- if (__getOwnPropSymbols$q)
18938
- for (var prop of __getOwnPropSymbols$q(b)) {
18939
- if (__propIsEnum$q.call(b, prop))
18636
+ if (__getOwnPropSymbols$r)
18637
+ for (var prop of __getOwnPropSymbols$r(b)) {
18638
+ if (__propIsEnum$r.call(b, prop))
18940
18639
  __defNormalProp$A(a, prop, b[prop]);
18941
18640
  }
18942
18641
  return a;
18943
18642
  };
18643
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
18644
+ var __objRest$2 = (source, exclude) => {
18645
+ var target = {};
18646
+ for (var prop in source)
18647
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
18648
+ target[prop] = source[prop];
18649
+ if (source != null && __getOwnPropSymbols$r)
18650
+ for (var prop of __getOwnPropSymbols$r(source)) {
18651
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
18652
+ target[prop] = source[prop];
18653
+ }
18654
+ return target;
18655
+ };
18944
18656
  var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18657
+ var __async$p = (__this, __arguments, generator) => {
18658
+ return new Promise((resolve, reject) => {
18659
+ var fulfilled = (value) => {
18660
+ try {
18661
+ step(generator.next(value));
18662
+ } catch (e) {
18663
+ reject(e);
18664
+ }
18665
+ };
18666
+ var rejected = (value) => {
18667
+ try {
18668
+ step(generator.throw(value));
18669
+ } catch (e) {
18670
+ reject(e);
18671
+ }
18672
+ };
18673
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18674
+ step((generator = generator.apply(__this, __arguments)).next());
18675
+ });
18676
+ };
18945
18677
  let ID$2 = 0;
18678
+ let REQUEST_ID = 0;
18946
18679
  class NgwConnector {
18947
18680
  constructor(options) {
18948
18681
  this.options = options;
@@ -18953,7 +18686,7 @@ class NgwConnector {
18953
18686
  __publicField$p(this, "cache");
18954
18687
  __publicField$p(this, "withCredentials");
18955
18688
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
18956
- __publicField$p(this, "activeRequests", []);
18689
+ __publicField$p(this, "activeRequests", {});
18957
18690
  __publicField$p(this, "requestTransform");
18958
18691
  const exist = findConnector(options);
18959
18692
  this.cache = new Cache({ namespace: options.cacheId });
@@ -19014,29 +18747,27 @@ class NgwConnector {
19014
18747
  * ```
19015
18748
  */
19016
18749
  connect() {
19017
- const auth = this.options.auth;
19018
- const makeConnect = () => new CancelablePromise((resolve, reject) => {
19019
- const makeQuery = () => {
19020
- return this.makeQuery(this.routeStr, {}, {}).then((route) => {
19021
- resolve(route);
19022
- }).catch((er) => {
19023
- reject(er);
19024
- });
19025
- };
18750
+ return __async$p(this, null, function* () {
18751
+ const auth = this.options.auth;
19026
18752
  if (auth) {
19027
18753
  const { login, password } = auth;
19028
18754
  if (login && password) {
19029
- return this._login({ login, password }).then(() => {
19030
- return makeQuery();
19031
- }).catch((er) => reject(er));
18755
+ yield this._login({ login, password });
19032
18756
  }
19033
18757
  }
19034
- return makeQuery();
19035
- });
19036
- return this.cache.add("route", makeConnect, {
19037
- id: this.id,
19038
- auth,
19039
- baseUrl: this.options.baseUrl
18758
+ return yield this.makeQuery(
18759
+ this.routeStr,
18760
+ {},
18761
+ {
18762
+ cacheName: "route",
18763
+ cache: true,
18764
+ cacheProps: {
18765
+ id: this.id,
18766
+ auth,
18767
+ baseUrl: this.options.baseUrl
18768
+ }
18769
+ }
18770
+ );
19040
18771
  });
19041
18772
  }
19042
18773
  /**
@@ -19060,20 +18791,22 @@ class NgwConnector {
19060
18791
  this.emitter.emit("logout");
19061
18792
  }
19062
18793
  getUserInfo(credentials, options) {
19063
- if (this.user && this.user.id) {
19064
- return CancelablePromise.resolve(this.user);
19065
- }
19066
- if (credentials) {
19067
- this.options.auth = credentials;
19068
- }
19069
- const options_ = __spreadValues$p({
19070
- headers: this.getAuthorizationHeaders(credentials)
19071
- }, options);
19072
- return this.makeQuery(
19073
- "/api/component/auth/current_user",
19074
- {},
19075
- options_
19076
- );
18794
+ return __async$p(this, null, function* () {
18795
+ if (this.user && this.user.id) {
18796
+ return this.user;
18797
+ }
18798
+ if (credentials) {
18799
+ this.options.auth = credentials;
18800
+ }
18801
+ const options_ = __spreadValues$q({
18802
+ headers: this.getAuthorizationHeaders(credentials)
18803
+ }, options);
18804
+ return this.makeQuery(
18805
+ "/api/component/auth/current_user",
18806
+ {},
18807
+ options_
18808
+ );
18809
+ });
19077
18810
  }
19078
18811
  /**
19079
18812
  * Obtaining the required Headers for authentication of requests in the NGW.
@@ -19082,7 +18815,7 @@ class NgwConnector {
19082
18815
  const client = this.makeClientId(credentials);
19083
18816
  if (client) {
19084
18817
  return {
19085
- Authorization: "Basic " + client
18818
+ Authorization: `Basic ${client}`
19086
18819
  };
19087
18820
  }
19088
18821
  }
@@ -19090,21 +18823,22 @@ class NgwConnector {
19090
18823
  credentials = credentials || this.options.auth;
19091
18824
  if (credentials) {
19092
18825
  const { login, password } = credentials;
19093
- const str = unescape(encodeURIComponent(`${login}:${password}`));
18826
+ const str = `${login}:${password}`;
18827
+ const encodedStr = encodeURIComponent(str);
19094
18828
  {
19095
- return window.btoa(str);
18829
+ return window.btoa(encodedStr);
19096
18830
  }
19097
18831
  }
19098
18832
  }
19099
18833
  /** Stop all api requests */
19100
18834
  abort() {
19101
- for (const req of this.activeRequests) {
19102
- req.cancel();
18835
+ for (const abortController of Object.values(this.activeRequests)) {
18836
+ abortController.abort();
19103
18837
  }
19104
- this.activeRequests = [];
18838
+ this.activeRequests = {};
19105
18839
  }
19106
18840
  getActiveApiRequests() {
19107
- return [...this.activeRequests];
18841
+ return __spreadValues$q({}, this.activeRequests);
19108
18842
  }
19109
18843
  /**
19110
18844
  * Send request to NGW api router.
@@ -19136,26 +18870,10 @@ class NgwConnector {
19136
18870
  * ```
19137
18871
  */
19138
18872
  apiRequest(name, params_ = {}, requestOptions = {}) {
19139
- var _a, _b;
19140
- requestOptions = __spreadValues$p({
19141
- withCredentials: this.withCredentials
19142
- }, requestOptions);
19143
- const { method, headers, withCredentials, responseType } = requestOptions;
19144
- params_ = (_a = requestOptions.params) != null ? _a : params_;
19145
- const params = objectRemoveEmpty(params_);
19146
- const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
19147
- if (requestOptions.cache && method === "GET") {
19148
- return this.cache.add(name, makeApiRequest, __spreadValues$p({
19149
- params
19150
- }, objectRemoveEmpty({
19151
- headers,
19152
- withCredentials,
19153
- responseType,
19154
- baseUrl: this.options.baseUrl,
19155
- userId: (_b = this.user) == null ? void 0 : _b.id
19156
- })));
19157
- }
19158
- return makeApiRequest();
18873
+ var _a;
18874
+ params_ = (_a = requestOptions.params) != null ? _a : params_;
18875
+ const params = objectRemoveEmpty(params_);
18876
+ return apiRequest({ name, params, requestOptions, connector: this });
19159
18877
  }
19160
18878
  /**
19161
18879
  * Shortcut method for send POST request to NGW.
@@ -19245,17 +18963,68 @@ class NgwConnector {
19245
18963
  * @param params - Query params
19246
18964
  * @param options - Request options
19247
18965
  */
19248
- makeQuery(url, params, options = {}) {
19249
- url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
19250
- if (url) {
18966
+ makeQuery(_0, _1) {
18967
+ return __async$p(this, arguments, function* (url, params, options = {}) {
18968
+ var _b;
18969
+ url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
18970
+ if (!url) {
18971
+ throw new Error("Empty `url` not allowed");
18972
+ }
19251
18973
  if (params) {
19252
- url = template(url, params);
18974
+ const _a = params, restParams = __objRest$2(_a, ["paramList"]);
18975
+ url = template(url, restParams);
19253
18976
  }
19254
18977
  url = encodeURI(fixUrlStr(url));
19255
- return this._loadData(url, options);
19256
- } else {
19257
- throw new Error("Empty `url` not allowed");
19258
- }
18978
+ options = __spreadValues$q({ withCredentials: this.withCredentials }, options);
18979
+ const {
18980
+ cache,
18981
+ signal: externalSignal,
18982
+ method = "GET",
18983
+ headers,
18984
+ cacheName,
18985
+ cacheProps,
18986
+ responseType,
18987
+ withCredentials
18988
+ } = options;
18989
+ const internalAbortController = new AbortController();
18990
+ const internalSignal = internalAbortController.signal;
18991
+ if (externalSignal) {
18992
+ if (externalSignal.aborted) {
18993
+ throw new AbortError();
18994
+ }
18995
+ externalSignal.addEventListener("abort", () => {
18996
+ internalAbortController.abort();
18997
+ });
18998
+ }
18999
+ options.signal = internalSignal;
19000
+ const createPromise = () => __async$p(this, null, function* () {
19001
+ const id = REQUEST_ID++;
19002
+ this.activeRequests[id] = internalAbortController;
19003
+ try {
19004
+ return this._loadData(url, options);
19005
+ } finally {
19006
+ this._cleanActiveRequest(id);
19007
+ }
19008
+ });
19009
+ if (cache && method === "GET") {
19010
+ const cacheOptions = cacheProps ? cacheProps : __spreadProps$g(__spreadValues$q({}, objectRemoveEmpty({
19011
+ headers,
19012
+ withCredentials,
19013
+ responseType,
19014
+ baseUrl: this.options.baseUrl,
19015
+ userId: (_b = this.user) == null ? void 0 : _b.id
19016
+ })), {
19017
+ params
19018
+ });
19019
+ return this.cache.add(
19020
+ cacheName || url,
19021
+ createPromise,
19022
+ cacheOptions,
19023
+ false
19024
+ );
19025
+ }
19026
+ return createPromise();
19027
+ });
19259
19028
  }
19260
19029
  // -------------------------------------------------------------------------
19261
19030
  // Resource Methods
@@ -19337,26 +19106,29 @@ class NgwConnector {
19337
19106
  */
19338
19107
  _loadData(url, options) {
19339
19108
  options.responseType = options.responseType || "json";
19340
- if (options.signal && options.signal.aborted) {
19341
- return CancelablePromise.reject(new CancelablePromise.CancelError());
19342
- }
19343
- const request = new CancelablePromise((resolve, reject, onCancel) => {
19109
+ return new Promise((resolve, reject) => {
19110
+ var _a;
19344
19111
  if (this.user) {
19345
19112
  options = options || {};
19346
- options.headers = __spreadValues$p(__spreadValues$p({}, this.getAuthorizationHeaders()), options.headers);
19113
+ options.headers = __spreadValues$q(__spreadValues$q({}, this.getAuthorizationHeaders()), options.headers);
19347
19114
  }
19348
19115
  if (this.requestTransform) {
19349
19116
  const [transUrl, transOptions] = this.requestTransform(url, options);
19350
19117
  url = transUrl;
19351
19118
  options = transOptions;
19352
19119
  }
19353
- loadData(url, resolve, options, reject, onCancel);
19354
- }).then((resp) => {
19355
- this._cleanActiveRequests(request);
19356
- return resp;
19120
+ let runOnAbort = void 0;
19121
+ loadData(url, resolve, options, reject, (handler) => {
19122
+ runOnAbort = handler;
19123
+ });
19124
+ (_a = options.signal) == null ? void 0 : _a.addEventListener("abort", () => {
19125
+ if (runOnAbort !== void 0) {
19126
+ runOnAbort();
19127
+ }
19128
+ reject(new AbortError());
19129
+ });
19357
19130
  }).catch((httpError) => {
19358
- this._cleanActiveRequests(request);
19359
- if (httpError instanceof CancelablePromise.CancelError) ; else {
19131
+ if (httpError.name !== "AbortError") {
19360
19132
  {
19361
19133
  console.warn("DEV WARN", httpError);
19362
19134
  }
@@ -19365,31 +19137,24 @@ class NgwConnector {
19365
19137
  throw er;
19366
19138
  }
19367
19139
  }
19140
+ throw httpError;
19368
19141
  });
19369
- if (options.signal && typeof options.signal.addEventListener === "function") {
19370
- options.signal.addEventListener("abort", () => {
19371
- request.cancel();
19372
- this._cleanActiveRequests(request);
19373
- });
19374
- }
19375
- this.activeRequests.push(request);
19376
- return request;
19377
19142
  }
19378
19143
  _login(credentials, options) {
19379
- return this.getUserInfo(credentials, options).then((data) => {
19380
- this.user = data;
19381
- this.emitter.emit("login", data);
19382
- return data;
19383
- }).catch((er) => {
19384
- this.emitter.emit("login:error", er);
19385
- throw er;
19144
+ return __async$p(this, null, function* () {
19145
+ try {
19146
+ const data = yield this.getUserInfo(credentials, options);
19147
+ this.user = data;
19148
+ this.emitter.emit("login", data);
19149
+ return data;
19150
+ } catch (er) {
19151
+ this.emitter.emit("login:error", er);
19152
+ throw er;
19153
+ }
19386
19154
  });
19387
19155
  }
19388
- _cleanActiveRequests(request) {
19389
- const activeRequestIndex = this.activeRequests.indexOf(request);
19390
- if (activeRequestIndex !== -1) {
19391
- this.activeRequests.splice(activeRequestIndex, 1);
19392
- }
19156
+ _cleanActiveRequest(requestId) {
19157
+ delete this.activeRequests[requestId];
19393
19158
  }
19394
19159
  _handleHttpError(er) {
19395
19160
  if (er) {
@@ -19412,22 +19177,42 @@ __publicField$p(NgwConnector, "errors", {
19412
19177
  var __defProp$z = Object.defineProperty;
19413
19178
  var __defProps$f = Object.defineProperties;
19414
19179
  var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
19415
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19416
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19417
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19180
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
19181
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
19182
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
19418
19183
  var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19419
- var __spreadValues$o = (a, b) => {
19184
+ var __spreadValues$p = (a, b) => {
19420
19185
  for (var prop in b || (b = {}))
19421
- if (__hasOwnProp$p.call(b, prop))
19186
+ if (__hasOwnProp$q.call(b, prop))
19422
19187
  __defNormalProp$z(a, prop, b[prop]);
19423
- if (__getOwnPropSymbols$p)
19424
- for (var prop of __getOwnPropSymbols$p(b)) {
19425
- if (__propIsEnum$p.call(b, prop))
19188
+ if (__getOwnPropSymbols$q)
19189
+ for (var prop of __getOwnPropSymbols$q(b)) {
19190
+ if (__propIsEnum$q.call(b, prop))
19426
19191
  __defNormalProp$z(a, prop, b[prop]);
19427
19192
  }
19428
19193
  return a;
19429
19194
  };
19430
19195
  var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
19196
+ var __async$o = (__this, __arguments, generator) => {
19197
+ return new Promise((resolve, reject) => {
19198
+ var fulfilled = (value) => {
19199
+ try {
19200
+ step(generator.next(value));
19201
+ } catch (e) {
19202
+ reject(e);
19203
+ }
19204
+ };
19205
+ var rejected = (value) => {
19206
+ try {
19207
+ step(generator.throw(value));
19208
+ } catch (e) {
19209
+ reject(e);
19210
+ }
19211
+ };
19212
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19213
+ step((generator = generator.apply(__this, __arguments)).next());
19214
+ });
19215
+ };
19431
19216
  const FEATURE_REQUEST_PARAMS = {
19432
19217
  srs: 4326,
19433
19218
  geom_format: "geojson"
@@ -19468,10 +19253,9 @@ function updateItemRequestParam(params, options) {
19468
19253
  }
19469
19254
  }
19470
19255
  function createFeatureFieldFilterQueries(opt) {
19471
- const queries = getQueries(
19472
- opt
19473
- );
19474
- return CancelablePromise.all(queries).then((itemsParts) => {
19256
+ return __async$o(this, null, function* () {
19257
+ const queries = getQueries(opt);
19258
+ const itemsParts = yield Promise.all(queries);
19475
19259
  const ids = [];
19476
19260
  const items = [];
19477
19261
  for (const part of itemsParts) {
@@ -19513,13 +19297,13 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
19513
19297
  for (const f of filters_) {
19514
19298
  if (isPropertyFilter(f)) {
19515
19299
  _queries.push(
19516
- fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$o({}, opt), {
19300
+ fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$p({}, opt), {
19517
19301
  paramList: [..._parentAllParams, ...paramList, createParam(f)]
19518
19302
  }))
19519
19303
  );
19520
19304
  } else {
19521
19305
  getQueries(
19522
- __spreadProps$f(__spreadValues$o({}, opt), {
19306
+ __spreadProps$f(__spreadValues$p({}, opt), {
19523
19307
  filters: f
19524
19308
  }),
19525
19309
  _queries,
@@ -19540,7 +19324,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
19540
19324
  if (propertiesFilterList.length) {
19541
19325
  for (const x of propertiesFilterList) {
19542
19326
  getQueries(
19543
- __spreadProps$f(__spreadValues$o({}, opt), {
19327
+ __spreadProps$f(__spreadValues$p({}, opt), {
19544
19328
  filters: x
19545
19329
  }),
19546
19330
  _queries,
@@ -19549,7 +19333,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
19549
19333
  }
19550
19334
  } else {
19551
19335
  _queries.push(
19552
- fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$o({}, opt), {
19336
+ fetchNgwLayerItemsRequest(__spreadProps$f(__spreadValues$p({}, opt), {
19553
19337
  paramList: [..._parentAllParams, ...paramList, ...filters2]
19554
19338
  }))
19555
19339
  );
@@ -19565,7 +19349,7 @@ function createWktFromCoordArray(coord) {
19565
19349
  return `POLYGON((${polygon.join(", ")}))`;
19566
19350
  }
19567
19351
  function fetchNgwLayerItemsRequest(options) {
19568
- const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19352
+ const params = __spreadValues$p({}, FEATURE_REQUEST_PARAMS);
19569
19353
  const {
19570
19354
  limit,
19571
19355
  cache,
@@ -19604,7 +19388,7 @@ function fetchNgwLayerItemsRequest(options) {
19604
19388
  if (paramList) {
19605
19389
  params.paramList = paramList;
19606
19390
  }
19607
- const reqParams = __spreadValues$o({
19391
+ const reqParams = __spreadValues$p({
19608
19392
  id: resourceId
19609
19393
  }, params);
19610
19394
  return connector.get(
@@ -19617,52 +19401,90 @@ function fetchNgwLayerItemsRequest(options) {
19617
19401
  var __defProp$y = Object.defineProperty;
19618
19402
  var __defProps$e = Object.defineProperties;
19619
19403
  var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
19620
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19621
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19622
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19404
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19405
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19406
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19623
19407
  var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19624
- var __spreadValues$n = (a, b) => {
19408
+ var __spreadValues$o = (a, b) => {
19625
19409
  for (var prop in b || (b = {}))
19626
- if (__hasOwnProp$o.call(b, prop))
19410
+ if (__hasOwnProp$p.call(b, prop))
19627
19411
  __defNormalProp$y(a, prop, b[prop]);
19628
- if (__getOwnPropSymbols$o)
19629
- for (var prop of __getOwnPropSymbols$o(b)) {
19630
- if (__propIsEnum$o.call(b, prop))
19412
+ if (__getOwnPropSymbols$p)
19413
+ for (var prop of __getOwnPropSymbols$p(b)) {
19414
+ if (__propIsEnum$p.call(b, prop))
19631
19415
  __defNormalProp$y(a, prop, b[prop]);
19632
19416
  }
19633
19417
  return a;
19634
19418
  };
19635
19419
  var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
19420
+ var __async$n = (__this, __arguments, generator) => {
19421
+ return new Promise((resolve, reject) => {
19422
+ var fulfilled = (value) => {
19423
+ try {
19424
+ step(generator.next(value));
19425
+ } catch (e) {
19426
+ reject(e);
19427
+ }
19428
+ };
19429
+ var rejected = (value) => {
19430
+ try {
19431
+ step(generator.throw(value));
19432
+ } catch (e) {
19433
+ reject(e);
19434
+ }
19435
+ };
19436
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19437
+ step((generator = generator.apply(__this, __arguments)).next());
19438
+ });
19439
+ };
19636
19440
  function fetchNgwLayerItem(options) {
19637
- const params = __spreadValues$n({}, FEATURE_REQUEST_PARAMS);
19638
- updateItemRequestParam(params, options);
19639
- const queryParams = __spreadValues$n({
19640
- id: options.resourceId,
19641
- fid: options.featureId
19642
- }, params);
19643
- const cache = options.cache || true;
19644
- return options.connector.get("feature_layer.feature.item", { cache }, queryParams).then((resp) => {
19645
- return __spreadProps$e(__spreadValues$n({}, resp), {
19646
- toGeojson: () => {
19647
- if (resp.geom) {
19648
- return CancelablePromise.resolve(createGeoJsonFeature(resp));
19649
- } else {
19650
- return fetchNgwLayerItem(__spreadProps$e(__spreadValues$n({}, options), {
19651
- geom: true,
19652
- fields: null,
19653
- extensions: null
19654
- })).then((onlyGeomItem) => {
19655
- const geom = onlyGeomItem.geom;
19656
- return createGeoJsonFeature(__spreadProps$e(__spreadValues$n({}, resp), { geom }));
19657
- });
19658
- }
19441
+ return __async$n(this, null, function* () {
19442
+ const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19443
+ updateItemRequestParam(params, options);
19444
+ const queryParams = __spreadValues$o({
19445
+ id: options.resourceId,
19446
+ fid: options.featureId
19447
+ }, params);
19448
+ const resp = yield options.connector.get(
19449
+ "feature_layer.feature.item",
19450
+ options,
19451
+ queryParams
19452
+ );
19453
+ const toGeojson = () => __async$n(this, null, function* () {
19454
+ if (resp.geom) {
19455
+ return createGeoJsonFeature(resp);
19456
+ } else {
19457
+ const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$e(__spreadValues$o({}, options), {
19458
+ geom: true,
19459
+ fields: null,
19460
+ extensions: null
19461
+ }));
19462
+ const geom = onlyGeomItem.geom;
19463
+ return createGeoJsonFeature(__spreadProps$e(__spreadValues$o({}, resp), { geom }));
19659
19464
  }
19660
19465
  });
19466
+ return __spreadProps$e(__spreadValues$o({}, resp), {
19467
+ toGeojson
19468
+ });
19661
19469
  });
19662
19470
  }
19663
19471
 
19664
19472
  var __defProp$x = Object.defineProperty;
19473
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19474
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19475
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19665
19476
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19477
+ var __spreadValues$n = (a, b) => {
19478
+ for (var prop in b || (b = {}))
19479
+ if (__hasOwnProp$o.call(b, prop))
19480
+ __defNormalProp$x(a, prop, b[prop]);
19481
+ if (__getOwnPropSymbols$o)
19482
+ for (var prop of __getOwnPropSymbols$o(b)) {
19483
+ if (__propIsEnum$o.call(b, prop))
19484
+ __defNormalProp$x(a, prop, b[prop]);
19485
+ }
19486
+ return a;
19487
+ };
19666
19488
  var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19667
19489
  class BookmarkItem {
19668
19490
  constructor(options) {
@@ -19680,11 +19502,11 @@ class BookmarkItem {
19680
19502
  this.name = String(item.id);
19681
19503
  }
19682
19504
  }
19683
- extent() {
19505
+ extent(opt) {
19684
19506
  if (this._extent) {
19685
- return CancelablePromise.resolve(this._extent);
19507
+ return Promise.resolve(this._extent);
19686
19508
  }
19687
- return this.options.connector.get("feature_layer.feature.item_extent", null, {
19509
+ return this.options.connector.get("feature_layer.feature.item_extent", opt, {
19688
19510
  id: this.resourceId,
19689
19511
  fid: this.item.id
19690
19512
  }).then((resp) => {
@@ -19694,18 +19516,18 @@ class BookmarkItem {
19694
19516
  return lonLat;
19695
19517
  });
19696
19518
  }
19697
- geoJson() {
19519
+ geoJson(opt) {
19698
19520
  if (this.item.geom) {
19699
- return CancelablePromise.resolve(createGeoJsonFeature(this.item));
19521
+ return Promise.resolve(createGeoJsonFeature(this.item));
19700
19522
  } else {
19701
- return fetchNgwLayerItem({
19523
+ return fetchNgwLayerItem(__spreadValues$n({
19702
19524
  resourceId: this.resourceId,
19703
19525
  featureId: this.item.id,
19704
19526
  connector: this.options.connector,
19705
19527
  geom: true,
19706
19528
  fields: null,
19707
19529
  extensions: null
19708
- }).then((onlyGeomItem) => {
19530
+ }, opt)).then((onlyGeomItem) => {
19709
19531
  const geom = onlyGeomItem.geom;
19710
19532
  this.item.geom = geom;
19711
19533
  return createGeoJsonFeature(this.item);
@@ -20335,9 +20157,10 @@ function getNgwWebmapExtent(webmap) {
20335
20157
  function fetchNgwLayerExtent({
20336
20158
  resourceId,
20337
20159
  connector,
20338
- cache = true
20160
+ cache = true,
20161
+ signal
20339
20162
  }) {
20340
- return connector.get("layer.extent", { cache }, { id: resourceId }).then((resp) => {
20163
+ return connector.get("layer.extent", { cache, signal }, { id: resourceId }).then((resp) => {
20341
20164
  if (resp) {
20342
20165
  const { maxLat, maxLon, minLat, minLon } = resp.extent;
20343
20166
  const extentArray = [minLon, minLat, maxLon, maxLat];
@@ -20349,11 +20172,12 @@ function fetchNgwLayerItemExtent({
20349
20172
  resourceId,
20350
20173
  featureId,
20351
20174
  connector,
20352
- cache = true
20175
+ cache = true,
20176
+ signal
20353
20177
  }) {
20354
20178
  return connector.get(
20355
20179
  "feature_layer.feature.item_extent",
20356
- { cache },
20180
+ { cache, signal },
20357
20181
  { id: resourceId, fid: featureId }
20358
20182
  ).then((resp) => {
20359
20183
  if (resp) {
@@ -20364,7 +20188,10 @@ function fetchNgwLayerItemExtent({
20364
20188
  });
20365
20189
  }
20366
20190
  function fetchNgwExtent(options) {
20367
- return options.connector.getResource(options.resourceId).then((resource) => {
20191
+ return options.connector.getResource(options.resourceId, {
20192
+ signal: options.signal,
20193
+ cache: options.cache
20194
+ }).then((resource) => {
20368
20195
  if (resource) {
20369
20196
  return fetchNgwResourceExtent(resource, options.connector, options);
20370
20197
  }
@@ -20372,11 +20199,11 @@ function fetchNgwExtent(options) {
20372
20199
  }
20373
20200
  function fetchNgwResourceExtent(item, connector, options) {
20374
20201
  if (item.webmap) {
20375
- return CancelablePromise.resolve(getNgwWebmapExtent(item.webmap));
20202
+ return Promise.resolve(getNgwWebmapExtent(item.webmap));
20376
20203
  } else {
20377
20204
  const resource = item.resource;
20378
20205
  if (resource.cls && resource.cls.indexOf("style") !== -1) {
20379
- return connector.getResource(resource.parent.id).then((res) => {
20206
+ return connector.getResource(resource.parent.id, options).then((res) => {
20380
20207
  if (res) {
20381
20208
  return fetchNgwLayerExtent(__spreadProps$d(__spreadValues$j({}, options), {
20382
20209
  resourceId: res.resource.id,
@@ -20396,7 +20223,7 @@ function fetchNgwResourceExtent(item, connector, options) {
20396
20223
  var __defProp$q = Object.defineProperty;
20397
20224
  var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20398
20225
  var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20399
- var __async$j = (__this, __arguments, generator) => {
20226
+ var __async$m = (__this, __arguments, generator) => {
20400
20227
  return new Promise((resolve, reject) => {
20401
20228
  var fulfilled = (value) => {
20402
20229
  try {
@@ -20424,12 +20251,12 @@ class NgwResource {
20424
20251
  }
20425
20252
  /** @deprecated use {@link NgwResource.getBounds} instead */
20426
20253
  getExtent() {
20427
- return __async$j(this, null, function* () {
20254
+ return __async$m(this, null, function* () {
20428
20255
  return this.getBounds();
20429
20256
  });
20430
20257
  }
20431
20258
  getBounds(options) {
20432
- return __async$j(this, null, function* () {
20259
+ return __async$m(this, null, function* () {
20433
20260
  if (this._extent) {
20434
20261
  return this._extent;
20435
20262
  }
@@ -20445,7 +20272,7 @@ class NgwResource {
20445
20272
  }
20446
20273
  }
20447
20274
 
20448
- var __async$i = (__this, __arguments, generator) => {
20275
+ var __async$l = (__this, __arguments, generator) => {
20449
20276
  return new Promise((resolve, reject) => {
20450
20277
  var fulfilled = (value) => {
20451
20278
  try {
@@ -20466,7 +20293,7 @@ var __async$i = (__this, __arguments, generator) => {
20466
20293
  });
20467
20294
  };
20468
20295
  function resourceIdFromLayerOptions(options, connector) {
20469
- return __async$i(this, null, function* () {
20296
+ return __async$l(this, null, function* () {
20470
20297
  const resource = options.resource;
20471
20298
  const item = resource;
20472
20299
  let { keyname, resourceId } = options;
@@ -20568,7 +20395,7 @@ var __objRest$1 = (source, exclude) => {
20568
20395
  return target;
20569
20396
  };
20570
20397
  var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20571
- var __async$h = (__this, __arguments, generator) => {
20398
+ var __async$k = (__this, __arguments, generator) => {
20572
20399
  return new Promise((resolve, reject) => {
20573
20400
  var fulfilled = (value) => {
20574
20401
  try {
@@ -20620,7 +20447,7 @@ function createQmsAdapter(webMapOrOptions, url = URL, createOpt = {}) {
20620
20447
  }
20621
20448
  }
20622
20449
  addLayer(options) {
20623
- return __async$h(this, null, function* () {
20450
+ return __async$k(this, null, function* () {
20624
20451
  if (!this.qms && options.qmsId) {
20625
20452
  try {
20626
20453
  this.qms = yield loadJson(
@@ -20728,7 +20555,7 @@ var __spreadValues$g = (a, b) => {
20728
20555
  };
20729
20556
  var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
20730
20557
  var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj);
20731
- var __async$g = (__this, __arguments, generator) => {
20558
+ var __async$j = (__this, __arguments, generator) => {
20732
20559
  return new Promise((resolve, reject) => {
20733
20560
  var fulfilled = (value) => {
20734
20561
  try {
@@ -20749,7 +20576,7 @@ var __async$g = (__this, __arguments, generator) => {
20749
20576
  });
20750
20577
  };
20751
20578
  function createBasemapLayerAdapter(_0) {
20752
- return __async$g(this, arguments, function* ({
20579
+ return __async$j(this, arguments, function* ({
20753
20580
  webMap,
20754
20581
  item
20755
20582
  }) {
@@ -20770,7 +20597,7 @@ function createBasemapLayerAdapter(_0) {
20770
20597
  if (TileAdapter) {
20771
20598
  class BasemapTileAdapter extends TileAdapter {
20772
20599
  addLayer(opt) {
20773
- return __async$g(this, null, function* () {
20600
+ return __async$j(this, null, function* () {
20774
20601
  return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$c(__spreadValues$g({}, opt), { url }));
20775
20602
  });
20776
20603
  }
@@ -20810,11 +20637,12 @@ function createPopupContent(feature, item) {
20810
20637
  function fetchNgwLayerCount({
20811
20638
  connector,
20812
20639
  resourceId,
20813
- cache = true
20640
+ cache = true,
20641
+ signal
20814
20642
  }) {
20815
20643
  return connector.get(
20816
20644
  "feature_layer.feature.count",
20817
- { cache },
20645
+ { cache, signal },
20818
20646
  {
20819
20647
  id: resourceId
20820
20648
  }
@@ -20868,13 +20696,34 @@ var __spreadValues$f = (a, b) => {
20868
20696
  return a;
20869
20697
  };
20870
20698
  var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
20699
+ var __async$i = (__this, __arguments, generator) => {
20700
+ return new Promise((resolve, reject) => {
20701
+ var fulfilled = (value) => {
20702
+ try {
20703
+ step(generator.next(value));
20704
+ } catch (e) {
20705
+ reject(e);
20706
+ }
20707
+ };
20708
+ var rejected = (value) => {
20709
+ try {
20710
+ step(generator.throw(value));
20711
+ } catch (e) {
20712
+ reject(e);
20713
+ }
20714
+ };
20715
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20716
+ step((generator = generator.apply(__this, __arguments)).next());
20717
+ });
20718
+ };
20871
20719
  function fetchNgwLayerItems(options) {
20872
- const filters = options.filters;
20873
- if (filters) {
20874
- return createFeatureFieldFilterQueries(__spreadProps$b(__spreadValues$f({}, options), {
20875
- filters
20876
- })).then((data) => {
20877
- var _a;
20720
+ return __async$i(this, null, function* () {
20721
+ var _a;
20722
+ const filters = options.filters;
20723
+ if (filters) {
20724
+ let data = yield createFeatureFieldFilterQueries(__spreadProps$b(__spreadValues$f({}, options), {
20725
+ filters
20726
+ }));
20878
20727
  const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
20879
20728
  if (clientFilterValidate) {
20880
20729
  data = data.filter((y) => {
@@ -20886,10 +20735,10 @@ function fetchNgwLayerItems(options) {
20886
20735
  });
20887
20736
  }
20888
20737
  return data;
20889
- });
20890
- } else {
20891
- return fetchNgwLayerItemsRequest(options);
20892
- }
20738
+ } else {
20739
+ return fetchNgwLayerItemsRequest(options);
20740
+ }
20741
+ });
20893
20742
  }
20894
20743
  function isFilterWithAnyCase(filters) {
20895
20744
  if (filters[0] === "any") {
@@ -20907,8 +20756,29 @@ function isFilterWithAnyCase(filters) {
20907
20756
  return false;
20908
20757
  }
20909
20758
 
20759
+ var __async$h = (__this, __arguments, generator) => {
20760
+ return new Promise((resolve, reject) => {
20761
+ var fulfilled = (value) => {
20762
+ try {
20763
+ step(generator.next(value));
20764
+ } catch (e) {
20765
+ reject(e);
20766
+ }
20767
+ };
20768
+ var rejected = (value) => {
20769
+ try {
20770
+ step(generator.throw(value));
20771
+ } catch (e) {
20772
+ reject(e);
20773
+ }
20774
+ };
20775
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20776
+ step((generator = generator.apply(__this, __arguments)).next());
20777
+ });
20778
+ };
20910
20779
  function fetchNgwLayerFeatures(options) {
20911
- return fetchNgwLayerItems(options).then((x) => {
20780
+ return __async$h(this, null, function* () {
20781
+ const x = yield fetchNgwLayerItems(options);
20912
20782
  const features = [];
20913
20783
  x.forEach((y) => {
20914
20784
  features.push(createGeoJsonFeature(y));
@@ -20968,7 +20838,7 @@ var __spreadValues$e = (a, b) => {
20968
20838
  var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
20969
20839
  var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
20970
20840
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
20971
- var __async$f = (__this, __arguments, generator) => {
20841
+ var __async$g = (__this, __arguments, generator) => {
20972
20842
  return new Promise((resolve, reject) => {
20973
20843
  var fulfilled = (value) => {
20974
20844
  try {
@@ -20989,7 +20859,7 @@ var __async$f = (__this, __arguments, generator) => {
20989
20859
  });
20990
20860
  };
20991
20861
  function createGeoJsonAdapter(props) {
20992
- return __async$f(this, null, function* () {
20862
+ return __async$g(this, null, function* () {
20993
20863
  var _a, _b;
20994
20864
  const {
20995
20865
  item,
@@ -21005,29 +20875,35 @@ function createGeoJsonAdapter(props) {
21005
20875
  const _loadedIds = [];
21006
20876
  let _fullDataLoad = false;
21007
20877
  let _lastFilterArgs;
21008
- let _dataPromise;
20878
+ let internalAbortController;
21009
20879
  const resourceId = yield resourceIdFromLayerOptions(options, connector);
21010
20880
  if ((_b = (_a = options.adapterOptions) == null ? void 0 : _a.popupOptions) == null ? void 0 : _b.fromProperties) {
21011
20881
  options.adapterOptions.popupOptions.createPopupContent = ({ feature }) => {
21012
20882
  return feature && createPopupContent(feature, item);
21013
20883
  };
21014
20884
  }
21015
- const getData = (filters, filterOpt) => __async$f(this, null, function* () {
20885
+ const getData = (filters, filterOpt) => __async$g(this, null, function* () {
21016
20886
  abort();
20887
+ internalAbortController = new AbortController();
20888
+ const internalSignal = internalAbortController.signal;
20889
+ if (filterOpt == null ? void 0 : filterOpt.signal) {
20890
+ filterOpt.signal.addEventListener("abort", internalAbortController.abort);
20891
+ }
20892
+ filterOpt = filterOpt || {};
20893
+ filterOpt.signal = internalSignal;
21017
20894
  _lastFilterArgs = { filters, options: filterOpt };
21018
- _dataPromise = fetchNgwLayerFeatureCollection(__spreadValues$e({
20895
+ return fetchNgwLayerFeatureCollection(__spreadValues$e({
21019
20896
  resourceId,
21020
20897
  filters,
21021
20898
  connector,
21022
20899
  cache: true
21023
20900
  }, filterOpt));
21024
- return yield _dataPromise;
21025
20901
  });
21026
20902
  let removed = false;
21027
20903
  const abort = () => {
21028
- if (_dataPromise) {
21029
- _dataPromise.cancel();
21030
- _dataPromise = void 0;
20904
+ if (internalAbortController) {
20905
+ internalAbortController.abort();
20906
+ internalAbortController = void 0;
21031
20907
  }
21032
20908
  };
21033
20909
  class NgwGeoJsonAdapter extends GeoJsonAdapter {
@@ -21040,7 +20916,7 @@ function createGeoJsonAdapter(props) {
21040
20916
  __publicField$f(this, "__disableMapMoveListener");
21041
20917
  }
21042
20918
  addLayer(opt) {
21043
- return __async$f(this, null, function* () {
20919
+ return __async$g(this, null, function* () {
21044
20920
  let needUpdate = !opt.data;
21045
20921
  const waitFullLoad = opt.waitFullLoad !== void 0 ? opt.waitFullLoad : true;
21046
20922
  if (options.id !== void 0) {
@@ -21085,7 +20961,7 @@ function createGeoJsonAdapter(props) {
21085
20961
  return this.getBounds();
21086
20962
  }
21087
20963
  getBounds() {
21088
- return __async$f(this, null, function* () {
20964
+ return __async$g(this, null, function* () {
21089
20965
  const hasData = this.getLayers && this.getLayers().length;
21090
20966
  const strategy = this.options.strategy;
21091
20967
  if ((strategy == null ? void 0 : strategy.startsWith("BBOX")) || hasData) {
@@ -21111,7 +20987,7 @@ function createGeoJsonAdapter(props) {
21111
20987
  return fetchNgwLayerCount({ connector, resourceId, cache: true });
21112
20988
  }
21113
20989
  updateLayer(filterArgs) {
21114
- return __async$f(this, null, function* () {
20990
+ return __async$g(this, null, function* () {
21115
20991
  var _a2;
21116
20992
  filterArgs = filterArgs || _lastFilterArgs || {};
21117
20993
  if ((_a2 = this.options.strategy) == null ? void 0 : _a2.startsWith("BBOX")) {
@@ -21177,7 +21053,7 @@ function createGeoJsonAdapter(props) {
21177
21053
  });
21178
21054
  }
21179
21055
  propertiesFilter(filters, opt) {
21180
- return __async$f(this, null, function* () {
21056
+ return __async$g(this, null, function* () {
21181
21057
  abort();
21182
21058
  if (this.filter && _fullDataLoad) {
21183
21059
  this.filter((e) => {
@@ -21251,7 +21127,7 @@ function createGeoJsonAdapter(props) {
21251
21127
  });
21252
21128
  }
21253
21129
 
21254
- var __async$e = (__this, __arguments, generator) => {
21130
+ var __async$f = (__this, __arguments, generator) => {
21255
21131
  return new Promise((resolve, reject) => {
21256
21132
  var fulfilled = (value) => {
21257
21133
  try {
@@ -21272,7 +21148,7 @@ var __async$e = (__this, __arguments, generator) => {
21272
21148
  });
21273
21149
  };
21274
21150
  function createWebMapAdapter(_0) {
21275
- return __async$e(this, arguments, function* ({
21151
+ return __async$f(this, arguments, function* ({
21276
21152
  layerOptions: options,
21277
21153
  webMap,
21278
21154
  connector
@@ -21400,7 +21276,7 @@ var __spreadValues$d = (a, b) => {
21400
21276
  };
21401
21277
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
21402
21278
  var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21403
- var __async$d = (__this, __arguments, generator) => {
21279
+ var __async$e = (__this, __arguments, generator) => {
21404
21280
  return new Promise((resolve, reject) => {
21405
21281
  var fulfilled = (value) => {
21406
21282
  try {
@@ -21421,7 +21297,7 @@ var __async$d = (__this, __arguments, generator) => {
21421
21297
  });
21422
21298
  };
21423
21299
  function createRasterAdapter(_0) {
21424
- return __async$d(this, arguments, function* ({
21300
+ return __async$e(this, arguments, function* ({
21425
21301
  layerOptions,
21426
21302
  webMap,
21427
21303
  connector,
@@ -21477,7 +21353,7 @@ function createRasterAdapter(_0) {
21477
21353
  return super.addLayer(__spreadValues$d(__spreadValues$d({}, this.options), addOptions));
21478
21354
  }
21479
21355
  getLegend(options) {
21480
- return __async$d(this, null, function* () {
21356
+ return __async$e(this, null, function* () {
21481
21357
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$d({
21482
21358
  params: { id: resourceId },
21483
21359
  cache: true
@@ -21497,7 +21373,7 @@ function createRasterAdapter(_0) {
21497
21373
  });
21498
21374
  }
21499
21375
  getIdentificationIds() {
21500
- return __async$d(this, null, function* () {
21376
+ return __async$e(this, null, function* () {
21501
21377
  if (this.item) {
21502
21378
  if (adapter === "MVT") {
21503
21379
  return [this.item.resource.id];
@@ -21538,7 +21414,7 @@ var __spreadValues$c = (a, b) => {
21538
21414
  return a;
21539
21415
  };
21540
21416
  var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
21541
- var __async$c = (__this, __arguments, generator) => {
21417
+ var __async$d = (__this, __arguments, generator) => {
21542
21418
  return new Promise((resolve, reject) => {
21543
21419
  var fulfilled = (value) => {
21544
21420
  try {
@@ -21574,7 +21450,7 @@ const supportCls = [
21574
21450
  "tmsclient_layer"
21575
21451
  ];
21576
21452
  function createAdapterFromFirstStyle(_0) {
21577
- return __async$c(this, arguments, function* ({
21453
+ return __async$d(this, arguments, function* ({
21578
21454
  layerOptions,
21579
21455
  webMap,
21580
21456
  connector,
@@ -21593,7 +21469,7 @@ function createAdapterFromFirstStyle(_0) {
21593
21469
  });
21594
21470
  }
21595
21471
  function createAsyncAdapter(options, webMap, connector) {
21596
- return __async$c(this, null, function* () {
21472
+ return __async$d(this, null, function* () {
21597
21473
  let adapter;
21598
21474
  let item;
21599
21475
  const adapterType = options.adapter;
@@ -21796,7 +21672,7 @@ var __spreadValues$a = (a, b) => {
21796
21672
  };
21797
21673
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
21798
21674
  var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21799
- var __async$b = (__this, __arguments, generator) => {
21675
+ var __async$c = (__this, __arguments, generator) => {
21800
21676
  return new Promise((resolve, reject) => {
21801
21677
  var fulfilled = (value) => {
21802
21678
  try {
@@ -21846,7 +21722,7 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
21846
21722
  }
21847
21723
  }
21848
21724
  static create(webMap, item, options, connector, parent) {
21849
- return __async$b(this, null, function* () {
21725
+ return __async$c(this, null, function* () {
21850
21726
  const ngwWebmapItem = new _NgwWebmapItem(
21851
21727
  webMap,
21852
21728
  item,
@@ -21875,15 +21751,14 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
21875
21751
  return this.layer;
21876
21752
  }
21877
21753
  getLegend(options) {
21878
- return __async$b(this, null, function* () {
21754
+ return __async$c(this, null, function* () {
21879
21755
  var _a;
21880
21756
  const id = (_a = this.layer) == null ? void 0 : _a.id;
21881
21757
  if (id !== void 0) {
21882
21758
  const connector = this.connector;
21883
21759
  if (connector) {
21884
21760
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$a({
21885
- params: { id: this.item.resourceId },
21886
- cache: true
21761
+ params: { id: this.item.resourceId }
21887
21762
  }, options));
21888
21763
  const legend = {
21889
21764
  layerId: id,
@@ -22071,7 +21946,7 @@ var __spreadValues$9 = (a, b) => {
22071
21946
  return a;
22072
21947
  };
22073
21948
  var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22074
- var __async$a = (__this, __arguments, generator) => {
21949
+ var __async$b = (__this, __arguments, generator) => {
22075
21950
  return new Promise((resolve, reject) => {
22076
21951
  var fulfilled = (value) => {
22077
21952
  try {
@@ -22092,7 +21967,7 @@ var __async$a = (__this, __arguments, generator) => {
22092
21967
  });
22093
21968
  };
22094
21969
  function createOnFirstShowAdapter(_0) {
22095
- return __async$a(this, arguments, function* ({
21970
+ return __async$b(this, arguments, function* ({
22096
21971
  webMap,
22097
21972
  adapterOptions = {},
22098
21973
  onLayerAdded,
@@ -22118,7 +21993,7 @@ function createOnFirstShowAdapter(_0) {
22118
21993
  return this._removed;
22119
21994
  }
22120
21995
  showLayer() {
22121
- return __async$a(this, null, function* () {
21996
+ return __async$b(this, null, function* () {
22122
21997
  this.options.visibility = true;
22123
21998
  if (this.layer.length) {
22124
21999
  for (const x of this.layer) {
@@ -22130,7 +22005,7 @@ function createOnFirstShowAdapter(_0) {
22130
22005
  });
22131
22006
  }
22132
22007
  hideLayer() {
22133
- return __async$a(this, null, function* () {
22008
+ return __async$b(this, null, function* () {
22134
22009
  this.options.visibility = false;
22135
22010
  if (this.layer) {
22136
22011
  for (const x of this.layer) {
@@ -22140,7 +22015,7 @@ function createOnFirstShowAdapter(_0) {
22140
22015
  });
22141
22016
  }
22142
22017
  loadLayer() {
22143
- return __async$a(this, null, function* () {
22018
+ return __async$b(this, null, function* () {
22144
22019
  if (!this.layer.length && !this._creatingInProgress) {
22145
22020
  this._creatingInProgress = true;
22146
22021
  const Adapter = yield createAdapter(this);
@@ -22174,7 +22049,7 @@ function createOnFirstShowAdapter(_0) {
22174
22049
  });
22175
22050
  }
22176
22051
 
22177
- var __async$9 = (__this, __arguments, generator) => {
22052
+ var __async$a = (__this, __arguments, generator) => {
22178
22053
  return new Promise((resolve, reject) => {
22179
22054
  var fulfilled = (value) => {
22180
22055
  try {
@@ -22195,7 +22070,7 @@ var __async$9 = (__this, __arguments, generator) => {
22195
22070
  });
22196
22071
  };
22197
22072
  function createOnFirstShowNgwAdapter(_0) {
22198
- return __async$9(this, arguments, function* ({
22073
+ return __async$a(this, arguments, function* ({
22199
22074
  webMap,
22200
22075
  connector,
22201
22076
  item,
@@ -22251,7 +22126,7 @@ var __spreadValues$8 = (a, b) => {
22251
22126
  };
22252
22127
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
22253
22128
  var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22254
- var __async$8 = (__this, __arguments, generator) => {
22129
+ var __async$9 = (__this, __arguments, generator) => {
22255
22130
  return new Promise((resolve, reject) => {
22256
22131
  var fulfilled = (value) => {
22257
22132
  try {
@@ -22302,7 +22177,7 @@ class NgwWebmapLayerAdapter {
22302
22177
  }
22303
22178
  }
22304
22179
  addLayer(options) {
22305
- return __async$8(this, null, function* () {
22180
+ return __async$9(this, null, function* () {
22306
22181
  var _a, _b;
22307
22182
  this.options = __spreadValues$8(__spreadValues$8({}, this.options), options);
22308
22183
  this.layer = yield this._getWebMapLayerItem();
@@ -22335,21 +22210,21 @@ class NgwWebmapLayerAdapter {
22335
22210
  delete this._webmapLayersIds;
22336
22211
  }
22337
22212
  showLayer() {
22338
- return __async$8(this, null, function* () {
22213
+ return __async$9(this, null, function* () {
22339
22214
  if (this.layer && this.layer.properties) {
22340
22215
  return this.layer.properties.property("visibility").set(true);
22341
22216
  }
22342
22217
  });
22343
22218
  }
22344
22219
  hideLayer() {
22345
- return __async$8(this, null, function* () {
22220
+ return __async$9(this, null, function* () {
22346
22221
  if (this.layer && this.layer.properties) {
22347
22222
  return this.layer.properties.property("visibility").set(false);
22348
22223
  }
22349
22224
  });
22350
22225
  }
22351
22226
  setOpacity(val) {
22352
- return __async$8(this, null, function* () {
22227
+ return __async$9(this, null, function* () {
22353
22228
  if (this.layer && this.layer.properties) {
22354
22229
  return this.layer.properties.property("opacity").set(val);
22355
22230
  }
@@ -22374,22 +22249,22 @@ class NgwWebmapLayerAdapter {
22374
22249
  return webmap.bookmark_resource.id;
22375
22250
  }
22376
22251
  }
22377
- fetchBookmarks() {
22252
+ fetchBookmarks(options) {
22378
22253
  const bookmarkResId = this.getBookmarksResourceId();
22379
22254
  const connector = this.options.connector;
22380
22255
  if (bookmarkResId) {
22381
- return connector.getResourceOrFail(bookmarkResId).then((item) => {
22256
+ return connector.getResourceOrFail(bookmarkResId, options).then((item) => {
22382
22257
  var _a;
22383
22258
  const labelField = (_a = item.feature_layer) == null ? void 0 : _a.fields.find(
22384
22259
  (x) => x.label_field
22385
22260
  );
22386
22261
  const keyname = labelField && labelField.keyname;
22387
- return fetchNgwLayerItems({
22262
+ return fetchNgwLayerItems(__spreadValues$8({
22388
22263
  connector,
22389
22264
  resourceId: bookmarkResId,
22390
22265
  geom: false,
22391
22266
  fields: keyname ? [keyname] : void 0
22392
- }).then((items) => {
22267
+ }, options)).then((items) => {
22393
22268
  const bookmarks = [];
22394
22269
  for (const i of items) {
22395
22270
  const bookmark = new BookmarkItem({
@@ -22408,24 +22283,24 @@ class NgwWebmapLayerAdapter {
22408
22283
  "Webmap was not loaded correctly, it is impossible to extract bookmarks"
22409
22284
  );
22410
22285
  }
22411
- getLegend() {
22412
- return __async$8(this, null, function* () {
22286
+ getLegend(options) {
22287
+ return __async$9(this, null, function* () {
22413
22288
  const legends = [];
22414
22289
  let deps = this.getDependLayers();
22415
22290
  deps = deps.sort((a, b) => b.id - a.id);
22416
22291
  for (const d of deps) {
22417
- const layerLegend = yield d.getLegend();
22292
+ const layerLegend = yield d.getLegend(options);
22418
22293
  legends.push(...layerLegend);
22419
22294
  }
22420
22295
  return legends;
22421
22296
  });
22422
22297
  }
22423
- getIdentificationIds() {
22424
- return __async$8(this, null, function* () {
22298
+ getIdentificationIds(options) {
22299
+ return __async$9(this, null, function* () {
22425
22300
  const visibleLayers = [];
22426
22301
  let ids = this._webmapLayersIds;
22427
22302
  if (!ids) {
22428
- ids = yield this._getWebMapIds();
22303
+ ids = yield this._getWebMapIds(options);
22429
22304
  this._webmapLayersIds = ids;
22430
22305
  }
22431
22306
  if (ids && ids.length) {
@@ -22447,7 +22322,7 @@ class NgwWebmapLayerAdapter {
22447
22322
  });
22448
22323
  }
22449
22324
  _getWebMapLayerItem() {
22450
- return __async$8(this, null, function* () {
22325
+ return __async$9(this, null, function* () {
22451
22326
  if (!this.resourceId) {
22452
22327
  return void 0;
22453
22328
  }
@@ -22477,7 +22352,7 @@ class NgwWebmapLayerAdapter {
22477
22352
  });
22478
22353
  }
22479
22354
  getWebMapConfig(id) {
22480
- return __async$8(this, null, function* () {
22355
+ return __async$9(this, null, function* () {
22481
22356
  const data = yield this.options.connector.getResource(id);
22482
22357
  if (data) {
22483
22358
  this.response = data;
@@ -22571,8 +22446,8 @@ class NgwWebmapLayerAdapter {
22571
22446
  }
22572
22447
  return item;
22573
22448
  }
22574
- _getWebMapIds() {
22575
- return __async$8(this, null, function* () {
22449
+ _getWebMapIds(options) {
22450
+ return __async$9(this, null, function* () {
22576
22451
  const webMapItem = this.layer;
22577
22452
  if (webMapItem && webMapItem.item.item_type === "root") {
22578
22453
  const layers = webMapItem.tree.getDescendants();
@@ -22581,7 +22456,7 @@ class NgwWebmapLayerAdapter {
22581
22456
  const item = x.item;
22582
22457
  if (item.item_type === "layer") {
22583
22458
  const id = item.layer_style_id;
22584
- const promise = this.options.connector.getResource(id).then((y) => {
22459
+ const promise = this.options.connector.getResource(id, options).then((y) => {
22585
22460
  if (y) {
22586
22461
  const parentId = Number(y.resource.parent.id);
22587
22462
  item.parentId = parentId;
@@ -22615,7 +22490,7 @@ var __spreadValues$7 = (a, b) => {
22615
22490
  return a;
22616
22491
  };
22617
22492
  var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22618
- var __async$7 = (__this, __arguments, generator) => {
22493
+ var __async$8 = (__this, __arguments, generator) => {
22619
22494
  return new Promise((resolve, reject) => {
22620
22495
  var fulfilled = (value) => {
22621
22496
  try {
@@ -22660,7 +22535,7 @@ class NgwKit {
22660
22535
  classAdapters[cls] = adapter;
22661
22536
  }
22662
22537
  onLoadSync(webMap) {
22663
- return __async$7(this, null, function* () {
22538
+ return __async$8(this, null, function* () {
22664
22539
  if (this.options.resourceId && this.url) {
22665
22540
  const resourceIds = [this.options.resourceId];
22666
22541
  if (resourceIds.length) {
@@ -22743,7 +22618,7 @@ class IdentifyItem {
22743
22618
  }
22744
22619
  identify(options = {}) {
22745
22620
  if (this._item) {
22746
- return CancelablePromise.resolve(this._item);
22621
+ return Promise.resolve(this._item);
22747
22622
  }
22748
22623
  return fetchNgwLayerItem(__spreadValues$6({
22749
22624
  connector: this.connector,
@@ -22758,30 +22633,30 @@ class IdentifyItem {
22758
22633
  return resp;
22759
22634
  });
22760
22635
  }
22761
- resource() {
22636
+ resource(opt) {
22762
22637
  if (this._resource) {
22763
- return CancelablePromise.resolve(this._resource.feature_layer);
22638
+ return Promise.resolve(this._resource.feature_layer);
22764
22639
  }
22765
- return this.connector.getResource(this.layerId).then((resp) => {
22640
+ return this.connector.getResource(this.layerId, opt).then((resp) => {
22766
22641
  this._resource = resp;
22767
22642
  return this._resource.feature_layer;
22768
22643
  });
22769
22644
  }
22770
- getBounds() {
22645
+ getBounds(opt) {
22771
22646
  if (this._extent) {
22772
- return CancelablePromise.resolve(this._extent);
22647
+ return Promise.resolve(this._extent);
22773
22648
  }
22774
- return fetchNgwLayerItemExtent({
22649
+ return fetchNgwLayerItemExtent(__spreadValues$6({
22775
22650
  connector: this.connector,
22776
22651
  featureId: this.id,
22777
22652
  resourceId: this.layerId
22778
- });
22653
+ }, opt));
22779
22654
  }
22780
- geojson() {
22655
+ geojson(options) {
22781
22656
  if (this._geojson) {
22782
- return CancelablePromise.resolve(this._geojson);
22657
+ return Promise.resolve(this._geojson);
22783
22658
  }
22784
- return this.identify().then((resp) => {
22659
+ return this.identify(options).then((resp) => {
22785
22660
  return resp.toGeojson().then((geojson) => {
22786
22661
  this._geojson = geojson;
22787
22662
  return geojson;
@@ -22790,8 +22665,29 @@ class IdentifyItem {
22790
22665
  }
22791
22666
  }
22792
22667
 
22668
+ var __async$7 = (__this, __arguments, generator) => {
22669
+ return new Promise((resolve, reject) => {
22670
+ var fulfilled = (value) => {
22671
+ try {
22672
+ step(generator.next(value));
22673
+ } catch (e) {
22674
+ reject(e);
22675
+ }
22676
+ };
22677
+ var rejected = (value) => {
22678
+ try {
22679
+ step(generator.throw(value));
22680
+ } catch (e) {
22681
+ reject(e);
22682
+ }
22683
+ };
22684
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
22685
+ step((generator = generator.apply(__this, __arguments)).next());
22686
+ });
22687
+ };
22793
22688
  function fetchNgwLayerFeature(options) {
22794
- return fetchNgwLayerItem(options).then((item) => {
22689
+ return __async$7(this, null, function* () {
22690
+ const item = yield fetchNgwLayerItem(options);
22795
22691
  return createGeoJsonFeature(item);
22796
22692
  });
22797
22693
  }
@@ -22876,7 +22772,7 @@ function fetchIdentifyGeoJson(options) {
22876
22772
  const withGeom = item.features.find((x) => x.geom);
22877
22773
  if (withGeom && withGeom.geom) {
22878
22774
  const geom = withGeom.geom;
22879
- return CancelablePromise.resolve(
22775
+ return Promise.resolve(
22880
22776
  createGeoJsonFeature(__spreadProps$5(__spreadValues$5({}, withGeom), {
22881
22777
  geom
22882
22778
  }))
@@ -22889,7 +22785,7 @@ function fetchIdentifyGeoJson(options) {
22889
22785
  if (params && params.length) {
22890
22786
  return fetchNgwLayerFeature(__spreadValues$5(__spreadProps$5(__spreadValues$5({}, requestOptions), { connector }), params[0]));
22891
22787
  }
22892
- return CancelablePromise.resolve(void 0);
22788
+ return Promise.resolve(void 0);
22893
22789
  }
22894
22790
  function fetchIdentifyItem(options) {
22895
22791
  const { connector, identify } = options;
@@ -22899,7 +22795,7 @@ function fetchIdentifyItem(options) {
22899
22795
  connector
22900
22796
  }, options.requestOptions), params[0]));
22901
22797
  }
22902
- return CancelablePromise.resolve(void 0);
22798
+ return Promise.resolve(void 0);
22903
22799
  }
22904
22800
  function featureLayerIdentify(options) {
22905
22801
  const { geom, signal, cache, layers } = options;
@@ -22943,9 +22839,9 @@ function getPolygonCoordinates(geom) {
22943
22839
  function sendIdentifyRequest(ev, options) {
22944
22840
  deprecatedMapClick(ev);
22945
22841
  const [lng, lat] = ev.lngLat;
22946
- const { geom, radius, signal, cache } = options;
22842
+ const { geom, radius } = options;
22947
22843
  const geom_ = geom != null ? geom : getCirclePolygonCoordinates(lng, lat, radius);
22948
- return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_, signal, cache }));
22844
+ return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_ }));
22949
22845
  }
22950
22846
  function createIdentifyItem(opt) {
22951
22847
  return new IdentifyItem(opt);
@@ -23291,7 +23187,7 @@ const _WebMapMain = class _WebMapMain {
23291
23187
  __publicField$3(this, "_mapState", []);
23292
23188
  __publicField$3(this, "_extent");
23293
23189
  __publicField$3(this, "_eventsStatus", {});
23294
- __publicField$3(this, "_coordFromMapClickPromise");
23190
+ __publicField$3(this, "_coordFromMapClickAbort");
23295
23191
  __publicField$3(this, "_mapEvents", {});
23296
23192
  this.mapAdapter = mapOptions.mapAdapter;
23297
23193
  this._starterKits = mapOptions.starterKits || [];
@@ -23606,36 +23502,34 @@ const _WebMapMain = class _WebMapMain {
23606
23502
  return { stop };
23607
23503
  }
23608
23504
  stopGetCoordFromMapClick() {
23609
- if (this._coordFromMapClickPromise) {
23610
- this._coordFromMapClickPromise.cancel();
23505
+ if (this._coordFromMapClickAbort) {
23506
+ this._coordFromMapClickAbort();
23507
+ this._coordFromMapClickAbort = void 0;
23611
23508
  }
23612
23509
  }
23613
23510
  getCoordFromMapClick() {
23614
- if (!this._coordFromMapClickPromise) {
23615
- this._coordFromMapClickPromise = new CancelablePromise(
23616
- (resolve, reject, onCancel) => {
23617
- const cursor = this.getCursor() || "grab";
23618
- this._removeEventListeners({ include: ["click"] });
23619
- this.setCursor("crosshair");
23620
- const onCancel_ = () => {
23621
- this.setCursor(cursor);
23622
- this._addEventsListeners({ include: ["click"] });
23623
- this.mapAdapter.emitter.off("click", onMapClick);
23624
- this._coordFromMapClickPromise = void 0;
23625
- };
23626
- const onMapClick = (e) => {
23627
- onCancel_();
23628
- deprecatedMapClick(e);
23629
- resolve(e.lngLat);
23630
- };
23631
- this.mapAdapter.emitter.once("click", onMapClick);
23632
- onCancel(onCancel_);
23633
- }
23634
- );
23511
+ if (!this._coordFromMapClickAbort) {
23512
+ return new Promise((resolve, reject) => {
23513
+ const cursor = this.getCursor() || "grab";
23514
+ this._removeEventListeners({ include: ["click"] });
23515
+ this.setCursor("crosshair");
23516
+ const onCancel_ = () => {
23517
+ this.setCursor(cursor);
23518
+ this._addEventsListeners({ include: ["click"] });
23519
+ this.mapAdapter.emitter.off("click", onMapClick);
23520
+ this._coordFromMapClickAbort = void 0;
23521
+ };
23522
+ const onMapClick = (e) => {
23523
+ onCancel_();
23524
+ deprecatedMapClick(e);
23525
+ resolve(e.lngLat);
23526
+ };
23527
+ this.mapAdapter.emitter.once("click", onMapClick);
23528
+ this._coordFromMapClickAbort = onCancel_;
23529
+ });
23635
23530
  } else {
23636
23531
  return this.getCoordFromMapClick();
23637
23532
  }
23638
- return this._coordFromMapClickPromise;
23639
23533
  }
23640
23534
  _emitStatusEvent(eventName, data) {
23641
23535
  const _eventName = eventName;
@@ -25424,26 +25318,35 @@ const _NgwMap = class _NgwMap extends WebMap {
25424
25318
  }, options));
25425
25319
  }
25426
25320
  fetchIdentifyItem(identify, requestOptions) {
25321
+ const abortController = new AbortController();
25322
+ const abortSignal = abortController.signal;
25323
+ if (requestOptions == null ? void 0 : requestOptions.signal) {
25324
+ requestOptions.signal.addEventListener("abort", abortController.abort);
25325
+ }
25326
+ requestOptions = requestOptions || {};
25327
+ requestOptions.signal = abortSignal;
25427
25328
  const promise = fetchIdentifyItem({
25428
25329
  identify,
25429
25330
  connector: this.connector,
25430
25331
  requestOptions
25431
25332
  // multiple,
25432
25333
  });
25433
- this._addPromise("identify", promise);
25334
+ this._addPromise("identify", promise, abortController);
25434
25335
  return promise;
25435
25336
  }
25436
25337
  fetchIdentifyGeoJson(identify, multiple = false) {
25338
+ const abortController = new AbortController();
25437
25339
  const promise = fetchIdentifyGeoJson({
25438
25340
  identify,
25439
25341
  connector: this.connector,
25440
- multiple
25342
+ multiple,
25343
+ requestOptions: { signal: abortController.signal }
25441
25344
  });
25442
25345
  if (promise && "then" in promise) {
25443
- this._addPromise("identify", promise);
25346
+ this._addPromise("identify", promise, abortController);
25444
25347
  return promise;
25445
25348
  } else {
25446
- return CancelablePromise.resolve(promise);
25349
+ return Promise.resolve(promise);
25447
25350
  }
25448
25351
  }
25449
25352
  /**
@@ -25617,7 +25520,7 @@ const _NgwMap = class _NgwMap extends WebMap {
25617
25520
  args.forEach((name) => {
25618
25521
  const group = this._promises[name];
25619
25522
  if (group) {
25620
- group.forEach((x) => x.cancel());
25523
+ group.forEach((x) => x[1].abort());
25621
25524
  this._promises[name] = [];
25622
25525
  }
25623
25526
  });
@@ -25684,11 +25587,13 @@ const _NgwMap = class _NgwMap extends WebMap {
25684
25587
  }, highlightDuration);
25685
25588
  }
25686
25589
  }
25590
+ const abortController = new AbortController();
25687
25591
  const selectPromise = sendIdentifyRequest(ev, {
25688
25592
  layers: ids,
25689
25593
  connector: this.connector,
25690
25594
  radius,
25691
- geom
25595
+ geom,
25596
+ signal: abortController.signal
25692
25597
  }).then((resp) => {
25693
25598
  const identify = __spreadProps$1(__spreadValues$1({}, resp), {
25694
25599
  resources: ids,
@@ -25699,22 +25604,22 @@ const _NgwMap = class _NgwMap extends WebMap {
25699
25604
  this._emitStatusEvent("ngw:select", identifyEvent);
25700
25605
  return identifyEvent;
25701
25606
  });
25702
- this._addPromise("select", selectPromise);
25607
+ this._addPromise("select", selectPromise, abortController);
25703
25608
  return selectPromise;
25704
25609
  });
25705
25610
  }
25706
- _addPromise(groupName, promise) {
25611
+ _addPromise(groupName, promise, abortController) {
25707
25612
  const group = this._promises[groupName];
25708
- if (group && group.indexOf(promise) === -1) {
25613
+ if (group && group.findIndex((g) => g[0] === promise) === -1) {
25709
25614
  const removeFromGroup = () => {
25710
- const index = group.indexOf(promise);
25615
+ const index = group.findIndex((g) => g[0] === promise);
25711
25616
  if (index !== -1) {
25712
25617
  group.splice(index, 1);
25713
25618
  }
25714
25619
  };
25715
25620
  promise.then(removeFromGroup);
25716
25621
  promise.catch(removeFromGroup);
25717
- group.push(promise);
25622
+ group.push([promise, abortController]);
25718
25623
  }
25719
25624
  }
25720
25625
  _isFitFromResource() {