@plannco-ppe/ppe-core 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -23593,12 +23593,12 @@ function Fg({
23593
23593
  const bg = {
23594
23594
  name: "ppe-zoning",
23595
23595
  getInitialState: (n) => {
23596
- const { layer: t, source: e } = Hg(n == null ? void 0 : n._extent), { layer: i, source: s } = qg(n == null ? void 0 : n._extent), r = new Lo({
23596
+ const { layer: t, source: e } = qg(n == null ? void 0 : n._extent), { layer: i, source: s } = $g(n == null ? void 0 : n._extent), r = new Lo({
23597
23597
  layers: [t],
23598
23598
  condition: Cf,
23599
23599
  style: (l) => {
23600
23600
  const h = l.getProperties(), c = (n == null ? void 0 : n._zoneFillVisible) ?? !0;
23601
- return $g(h, c);
23601
+ return Jg(h, c);
23602
23602
  }
23603
23603
  }), o = new kf({
23604
23604
  source: e,
@@ -23624,6 +23624,7 @@ const bg = {
23624
23624
  _zoneFilter: void 0,
23625
23625
  _zoneFillVisible: !0,
23626
23626
  _zonePopupVisible: !0,
23627
+ _hiddenZoneFills: /* @__PURE__ */ new Set(),
23627
23628
  ...n
23628
23629
  };
23629
23630
  },
@@ -23632,13 +23633,25 @@ const bg = {
23632
23633
  const t = n.initialState, { _zoneLayer: e, _zoneLabelLayer: i } = t;
23633
23634
  e && n.addLayer(e), i && n.addLayer(i), e.setStyle((o) => {
23634
23635
  const a = o.getProperties();
23635
- return t._zoneFilter && !t._zoneFilter(a) ? [] : us(a, t._zoneFillVisible);
23636
- }), Dg(n), se(n), Ug(n), kg(n);
23636
+ if (t._zoneFilter && !t._zoneFilter(a)) return [];
23637
+ const l = t._zoneFillVisible && !t._hiddenZoneFills.has(a.id);
23638
+ return us(a, l);
23639
+ }), Dg(n), se(n), Hg(n), Ug(n), kg(n);
23637
23640
  const s = ((r = n.options.zoningConfig) == null ? void 0 : r.editMode) || "editing";
23638
23641
  t._editMode = s, _h(n, s), n.drawZone = (o) => mh(n, o), n.deleteZone = (o) => yh(n, o), n.updateZone = (o) => jg(n, o), n.setZoningMode = (o) => Yg(n, o), n.setEditMode = (o) => Ng(n, o), n.selectZone = (o) => Gg(n, o), n.deselectZone = () => ko(n), n.getSelectedZone = () => zg(n), n.startDrawingZone = (o) => Vg(n, o), n.cancelCurrentAction = () => Ls(n), n.deleteSelectedZone = () => ph(n), n.updateZoneOccupationColors = () => Zg(n), n.filterZones = (o) => Kg(n, o), n.setZoneLayerVisible = (o) => t._zoneLayer.setVisible(o), n.setZoneLabelLayerVisible = (o) => t._zoneLabelLayer.setVisible(o), n.setZoneFillVisible = (o) => {
23639
23642
  t._zoneFillVisible = o, t._zoneLayer.changed();
23640
23643
  }, n.setZonePopupVisible = (o) => {
23641
23644
  t._zonePopupVisible = o;
23645
+ }, n.toggleZoneFill = (o) => {
23646
+ t._hiddenZoneFills.has(o) ? t._hiddenZoneFills.delete(o) : t._hiddenZoneFills.add(o), t._zoneLayer.changed();
23647
+ }, n.isZoneFillHidden = (o) => t._hiddenZoneFills.has(o), n.zoomToZone = (o) => {
23648
+ const a = t._zoneSource.getFeatureById(o);
23649
+ if (!a) return;
23650
+ const l = a.getGeometry();
23651
+ l && n.getView().fit(l.getExtent(), {
23652
+ padding: [50, 50, 50, 50],
23653
+ duration: 500
23654
+ });
23642
23655
  }, n.isZoneLayerVisible = () => t._zoneLayer.getVisible(), n.isZoneLabelLayerVisible = () => t._zoneLabelLayer.getVisible(), n.isZoneFillVisible = () => t._zoneFillVisible, n.isZonePopupVisible = () => t._zonePopupVisible, n.restoreZones = (o) => Og(n, o);
23643
23656
  }
23644
23657
  };
@@ -23790,10 +23803,10 @@ function Ls(n) {
23790
23803
  function Yg(n, t) {
23791
23804
  const e = n.initialState, { _zoneLayer: i } = e;
23792
23805
  t === "occupation" ? (i.setStyle((s) => {
23793
- var l, h;
23806
+ var h, c;
23794
23807
  const r = s.getProperties();
23795
23808
  if (e._zoneFilter && !e._zoneFilter(r)) return [];
23796
- const o = ((h = (l = n.options).getZoneOccupationColors) == null ? void 0 : h.call(l, r)) ?? [];
23809
+ const o = ((c = (h = n.options).getZoneOccupationColors) == null ? void 0 : c.call(h, r)) ?? [];
23797
23810
  if (o.length === 0)
23798
23811
  return [
23799
23812
  new rt({
@@ -23805,14 +23818,16 @@ function Yg(n, t) {
23805
23818
  fill: new lt({ color: "rgba(0,0,0,0)" })
23806
23819
  })
23807
23820
  ];
23808
- const a = o.length ? o : [r.color];
23821
+ const a = o.length ? o : [r.color], l = e._zoneFillVisible && !e._hiddenZoneFills.has(r.id);
23809
23822
  return [
23810
- ...us(s.getProperties(), e._zoneFillVisible),
23823
+ ...us(r, l),
23811
23824
  Fg({ colors: a })
23812
23825
  ];
23813
23826
  }), se(n)) : (i.setStyle((s) => {
23814
23827
  const r = s.getProperties();
23815
- return e._zoneFilter && !e._zoneFilter(r) ? [] : us(r, e._zoneFillVisible);
23828
+ if (e._zoneFilter && !e._zoneFilter(r)) return [];
23829
+ const o = e._zoneFillVisible && !e._hiddenZoneFills.has(r.id);
23830
+ return us(r, o);
23816
23831
  }), se(n));
23817
23832
  }
23818
23833
  function Zg(n) {
@@ -23930,6 +23945,16 @@ function Kg(n, t) {
23930
23945
  e._zoneFilter = t, e._zoneLayer.changed(), se(n);
23931
23946
  }
23932
23947
  function Ug(n) {
23948
+ n.on("dblclick", (t) => {
23949
+ var i, s;
23950
+ const e = n.forEachFeatureAtPixel(t.pixel, (r) => r);
23951
+ if (e && e.get("__type") === "zone") {
23952
+ const r = e.getProperties();
23953
+ (s = (i = n.options).onZoneDoubleClick) == null || s.call(i, r);
23954
+ }
23955
+ });
23956
+ }
23957
+ function Hg(n) {
23933
23958
  n.on("pointermove", (t) => {
23934
23959
  var s;
23935
23960
  const e = n.initialState;
@@ -23939,7 +23964,7 @@ function Ug(n) {
23939
23964
  }
23940
23965
  const i = n.forEachFeatureAtPixel(t.pixel, (r) => r);
23941
23966
  if (i && i.get("__type") === "zone") {
23942
- const r = i.getProperties(), o = (s = n.options.zoningConfig) == null ? void 0 : s.popup, a = o && o.template ? o.template(r) : Jg(r);
23967
+ const r = i.getProperties(), o = (s = n.options.zoningConfig) == null ? void 0 : s.popup, a = o && o.template ? o.template(r) : Qg(r);
23943
23968
  n._showPopup({
23944
23969
  event: t,
23945
23970
  content: a
@@ -23947,14 +23972,14 @@ function Ug(n) {
23947
23972
  } else i || n._hidePopup();
23948
23973
  });
23949
23974
  }
23950
- function Hg(n) {
23975
+ function qg(n) {
23951
23976
  const t = new Pn({ wrapX: !1 }), e = new Ai({
23952
23977
  source: t,
23953
23978
  style: (i) => us(i.getProperties())
23954
23979
  });
23955
23980
  return n && e.setExtent(n), { layer: e, source: t };
23956
23981
  }
23957
- function qg(n) {
23982
+ function $g(n) {
23958
23983
  const t = new Pn({ wrapX: !1 }), e = new Ai({
23959
23984
  source: t
23960
23985
  // Labels use their own styles set on each feature
@@ -23969,7 +23994,7 @@ function us({ color: n }, t = !0) {
23969
23994
  })
23970
23995
  ];
23971
23996
  }
23972
- function $g({ color: n }, t = !0) {
23997
+ function Jg({ color: n }, t = !0) {
23973
23998
  return [
23974
23999
  new rt({
23975
24000
  stroke: new ie({ color: n, width: 5 }),
@@ -23977,7 +24002,7 @@ function $g({ color: n }, t = !0) {
23977
24002
  })
23978
24003
  ];
23979
24004
  }
23980
- function Jg(n) {
24005
+ function Qg(n) {
23981
24006
  return `
23982
24007
  <div style="display: flex; gap: 1rem; background-color: rgba(220,220,220,0.75); padding: 1rem">
23983
24008
  <div style="height: 1rem; width: 1rem; background-color: ${n.color}"></div>
@@ -23985,20 +24010,20 @@ function Jg(n) {
23985
24010
  </div>
23986
24011
  `;
23987
24012
  }
23988
- const Qg = {
24013
+ const t_ = {
23989
24014
  a0: [1189, 841],
23990
24015
  a1: [841, 594],
23991
24016
  a2: [594, 420],
23992
24017
  a3: [420, 297],
23993
24018
  a4: [297, 210],
23994
24019
  a5: [210, 148]
23995
- }, t_ = {
24020
+ }, e_ = {
23996
24021
  name: "ppe-pdf-export",
23997
24022
  getInitialState: (n) => ({
23998
24023
  ...n
23999
24024
  }),
24000
24025
  createPlanEditor: (n) => {
24001
- n.exportToPdf = (t) => e_(n, t), n.exportPeriodicPdf = (t) => i_(n, t);
24026
+ n.exportToPdf = (t) => i_(n, t), n.exportPeriodicPdf = (t) => n_(n, t);
24002
24027
  }
24003
24028
  };
24004
24029
  async function xh(n, t, e) {
@@ -24056,7 +24081,7 @@ function Ch(n, t) {
24056
24081
  i.style.width = t.containerStyles.width, i.style.height = t.containerStyles.height, i.style.maxWidth = t.containerStyles.maxWidth, i.style.maxHeight = t.containerStyles.maxHeight, n.setSize(t.size), n.getView().setCenter(t.view.center), n.getView().setZoom(t.view.zoom), n.getView().setRotation(t.view.rotation);
24057
24082
  }
24058
24083
  function wh(n, t, e, i) {
24059
- const s = Qg[t];
24084
+ const s = t_[t];
24060
24085
  if (!s)
24061
24086
  throw new Error(`Invalid PDF format: ${t}`);
24062
24087
  const [r, o] = e === "landscape" ? [s[0], s[1]] : [s[1], s[0]], a = i / 25.4, l = Math.round(r * a), h = Math.round(o * a), c = n.getTarget(), u = typeof c == "string" ? document.getElementById(c) : c;
@@ -24064,7 +24089,7 @@ function wh(n, t, e, i) {
24064
24089
  throw new Error("Unable to get editor container element");
24065
24090
  return u.style.width = `${l}px`, u.style.height = `${h}px`, u.style.maxWidth = "none", u.style.maxHeight = "none", n.setSize([l, h]), { width: r, height: o, canvasWidth: l, canvasHeight: h };
24066
24091
  }
24067
- async function e_(n, t) {
24092
+ async function i_(n, t) {
24068
24093
  const e = (t == null ? void 0 : t.format) || "a4", i = (t == null ? void 0 : t.orientation) || "landscape", s = (t == null ? void 0 : t.resolution) || 350, r = (t == null ? void 0 : t.filename) || "map.pdf", o = (t == null ? void 0 : t.fitContent) !== !1, a = new qa(i, "mm", e), l = Eh(n);
24069
24094
  try {
24070
24095
  const { width: h, height: c, canvasWidth: u, canvasHeight: d } = wh(
@@ -24080,7 +24105,7 @@ async function e_(n, t) {
24080
24105
  Ch(n, l);
24081
24106
  }
24082
24107
  }
24083
- async function i_(n, t) {
24108
+ async function n_(n, t) {
24084
24109
  var h, c, u;
24085
24110
  const e = t.format || "a4", i = t.orientation || "landscape", s = t.resolution || 350, r = t.filename || "periodic-export.pdf", o = t.periods;
24086
24111
  if (!o || o.length === 0)
@@ -24105,7 +24130,7 @@ async function i_(n, t) {
24105
24130
  Ch(n, l);
24106
24131
  }
24107
24132
  }
24108
- const n_ = {
24133
+ const s_ = {
24109
24134
  name: "ppe-history",
24110
24135
  getInitialState: (n) => ({
24111
24136
  _historyStack: [],
@@ -24130,7 +24155,7 @@ function Ua(n, t, e, i, s) {
24130
24155
  function _r(n, t) {
24131
24156
  return Math.abs(n[t * 4] - 210) > 2 || Math.abs(n[t * 4 + 3] - 0.75 * 255) > 2;
24132
24157
  }
24133
- function s_() {
24158
+ function r_() {
24134
24159
  if (gr === void 0) {
24135
24160
  const n = gt(6, 6, nn);
24136
24161
  n.globalCompositeOperation = "lighter", n.fillStyle = "rgba(210, 0, 0, 0.75)", Ua(n, 4, 5, 4, 0), Ua(n, 4, 5, 0, 5);
@@ -24139,7 +24164,7 @@ function s_() {
24139
24164
  }
24140
24165
  return gr;
24141
24166
  }
24142
- function r_(n, t, e, i) {
24167
+ function o_(n, t, e, i) {
24143
24168
  const s = gl(e, t, n);
24144
24169
  let r = na(
24145
24170
  t,
@@ -24157,7 +24182,7 @@ function r_(n, t, e, i) {
24157
24182
  }
24158
24183
  return r;
24159
24184
  }
24160
- function o_(n, t, e, i, s, r, o, a, l, h, c, u, d, f) {
24185
+ function a_(n, t, e, i, s, r, o, a, l, h, c, u, d, f) {
24161
24186
  const g = gt(
24162
24187
  Math.round(e * n),
24163
24188
  Math.round(e * t),
@@ -24226,7 +24251,7 @@ function o_(n, t, e, i, s, r, o, a, l, h, c, u, d, f) {
24226
24251
  ], pt = Zh(Ge);
24227
24252
  if (!pt)
24228
24253
  return;
24229
- if (g.save(), g.beginPath(), s_() || !u) {
24254
+ if (g.save(), g.beginPath(), r_() || !u) {
24230
24255
  g.moveTo(j, Q);
24231
24256
  const Vt = 4, Ie = b - j, Di = z - Q;
24232
24257
  for (let $t = 0; $t < Vt; $t++)
@@ -24267,8 +24292,8 @@ function o_(n, t, e, i, s, r, o, a, l, h, c, u, d, f) {
24267
24292
  function kr(n) {
24268
24293
  return Array.isArray(n) ? Math.min(...n) : n;
24269
24294
  }
24270
- const a_ = 10, Ha = 0.25;
24271
- class l_ {
24295
+ const l_ = 10, Ha = 0.25;
24296
+ class h_ {
24272
24297
  /**
24273
24298
  * @param {import("../proj/Projection.js").default} sourceProj Source projection.
24274
24299
  * @param {import("../proj/Projection.js").default} targetProj Target projection.
@@ -24291,7 +24316,7 @@ class l_ {
24291
24316
  const x = E[0] + "/" + E[1];
24292
24317
  return l[x] || (l[x] = h(E)), l[x];
24293
24318
  }, this.maxSourceExtent_ = s, this.errorThresholdSquared_ = r * r, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!s && !!this.sourceProj_.getExtent() && K(s) >= K(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? K(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? K(this.targetProj_.getExtent()) : null;
24294
- const c = ds(i), u = Xr(i), d = Vr(i), f = Wr(i), g = this.transformInv_(c), m = this.transformInv_(u), _ = this.transformInv_(d), y = this.transformInv_(f), p = a_ + (o ? Math.max(
24319
+ const c = ds(i), u = Xr(i), d = Vr(i), f = Wr(i), g = this.transformInv_(c), m = this.transformInv_(u), _ = this.transformInv_(d), y = this.transformInv_(f), p = l_ + (o ? Math.max(
24295
24320
  0,
24296
24321
  Math.ceil(
24297
24322
  Math.log2(
@@ -24484,8 +24509,8 @@ class l_ {
24484
24509
  return this.triangles_;
24485
24510
  }
24486
24511
  }
24487
- const h_ = 0.5;
24488
- class c_ extends so {
24512
+ const c_ = 0.5;
24513
+ class u_ extends so {
24489
24514
  /**
24490
24515
  * @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
24491
24516
  * @param {import("../proj/Projection.js").default} targetProj Target projection.
@@ -24501,12 +24526,12 @@ class c_ extends so {
24501
24526
  l && t.canWrapX() && (l = l.slice(), l[0] = -1 / 0, l[2] = 1 / 0);
24502
24527
  let h = e.getExtent();
24503
24528
  h && e.canWrapX() && (h = h.slice(), h[0] = -1 / 0, h[2] = 1 / 0);
24504
- const c = h ? jr(i, h) : i, u = Yt(c), d = r_(
24529
+ const c = h ? jr(i, h) : i, u = Yt(c), d = o_(
24505
24530
  t,
24506
24531
  e,
24507
24532
  u,
24508
24533
  s
24509
- ), f = h_, g = new l_(
24534
+ ), f = c_, g = new h_(
24510
24535
  t,
24511
24536
  e,
24512
24537
  c,
@@ -24543,7 +24568,7 @@ class c_ extends so {
24543
24568
  const t = this.sourceImage_.getState();
24544
24569
  if (t == M.LOADED) {
24545
24570
  const e = K(this.targetExtent_) / this.targetResolution_, i = ft(this.targetExtent_) / this.targetResolution_;
24546
- this.canvas_ = o_(
24571
+ this.canvas_ = a_(
24547
24572
  e,
24548
24573
  i,
24549
24574
  this.sourcePixelRatio_,
@@ -24613,7 +24638,7 @@ const Hn = 4, mr = {
24613
24638
  */
24614
24639
  IMAGELOADERROR: "imageloaderror"
24615
24640
  };
24616
- class u_ extends Lt {
24641
+ class d_ extends Lt {
24617
24642
  /**
24618
24643
  * @param {string} type Type.
24619
24644
  * @param {import("../Image.js").default} image The image.
@@ -24622,7 +24647,7 @@ class u_ extends Lt {
24622
24647
  super(t), this.image = e;
24623
24648
  }
24624
24649
  }
24625
- class d_ extends ih {
24650
+ class f_ extends ih {
24626
24651
  /**
24627
24652
  * @param {Options} options Single image source options.
24628
24653
  */
@@ -24676,7 +24701,7 @@ class d_ extends ih {
24676
24701
  return this.reprojectedImage_;
24677
24702
  this.reprojectedImage_.dispose(), this.reprojectedImage_ = null;
24678
24703
  }
24679
- return this.reprojectedImage_ = new c_(
24704
+ return this.reprojectedImage_ = new u_(
24680
24705
  r,
24681
24706
  s,
24682
24707
  t,
@@ -24697,7 +24722,7 @@ class d_ extends ih {
24697
24722
  */
24698
24723
  getImageInternal(t, e, i, s) {
24699
24724
  if (this.loader) {
24700
- const r = g_(t, e, i, 1), o = this.findNearestResolution(e);
24725
+ const r = __(t, e, i, 1), o = this.findNearestResolution(e);
24701
24726
  if (this.image && (this.static_ || this.wantedProjection_ === s && (this.wantedExtent_ && _e(this.wantedExtent_, r) || _e(this.image.getExtent(), r)) && (this.wantedResolution_ && kr(this.wantedResolution_) === o || kr(this.image.getResolution()) === o)))
24702
24727
  return this.image;
24703
24728
  this.wantedProjection_ = s, this.wantedExtent_ = r, this.wantedResolution_ = o, this.image = new so(
@@ -24736,20 +24761,20 @@ class d_ extends ih {
24736
24761
  default:
24737
24762
  return;
24738
24763
  }
24739
- this.hasListener(i) && this.dispatchEvent(new u_(i, e));
24764
+ this.hasListener(i) && this.dispatchEvent(new d_(i, e));
24740
24765
  }
24741
24766
  }
24742
- function f_(n, t) {
24767
+ function g_(n, t) {
24743
24768
  n.getImage().src = t;
24744
24769
  }
24745
- function g_(n, t, e, i) {
24770
+ function __(n, t, e, i) {
24746
24771
  const s = t / e, r = Yt(n), o = Fn(K(n) / s, Hn), a = Fn(ft(n) / s, Hn), l = Fn((i - 1) * o / 2, Hn), h = o + 2 * l, c = Fn((i - 1) * a / 2, Hn), u = a + 2 * c;
24747
24772
  return qn(r, s, 0, [
24748
24773
  h,
24749
24774
  u
24750
24775
  ]);
24751
24776
  }
24752
- function __(n) {
24777
+ function m_(n) {
24753
24778
  const t = n.load || xl, e = n.imageExtent, i = n.crossOrigin ?? null;
24754
24779
  return () => {
24755
24780
  const s = new Image();
@@ -24759,12 +24784,12 @@ function __(n) {
24759
24784
  });
24760
24785
  };
24761
24786
  }
24762
- class m_ extends d_ {
24787
+ class y_ extends f_ {
24763
24788
  /**
24764
24789
  * @param {Options} options ImageStatic options.
24765
24790
  */
24766
24791
  constructor(t) {
24767
- const e = t.crossOrigin !== void 0 ? t.crossOrigin : null, i = t.imageLoadFunction !== void 0 ? t.imageLoadFunction : f_;
24792
+ const e = t.crossOrigin !== void 0 ? t.crossOrigin : null, i = t.imageLoadFunction !== void 0 ? t.imageLoadFunction : g_;
24768
24793
  super({
24769
24794
  attributions: t.attributions,
24770
24795
  interpolate: t.interpolate,
@@ -24773,7 +24798,7 @@ class m_ extends d_ {
24773
24798
  this.imageExtent_,
24774
24799
  void 0,
24775
24800
  1,
24776
- __({
24801
+ m_({
24777
24802
  url: t.url,
24778
24803
  imageExtent: t.imageExtent,
24779
24804
  crossOrigin: e,
@@ -24812,7 +24837,7 @@ class m_ extends d_ {
24812
24837
  return this.url_;
24813
24838
  }
24814
24839
  }
24815
- class y_ extends Ol {
24840
+ class p_ extends Ol {
24816
24841
  /**
24817
24842
  * @param {import("../../layer/Image.js").default} imageLayer Image layer.
24818
24843
  */
@@ -24913,7 +24938,7 @@ class y_ extends Ol {
24913
24938
  return this.postRender(this.context, t), E && p.restore(), p.imageSmoothingEnabled = !0, this.container;
24914
24939
  }
24915
24940
  }
24916
- class p_ extends Ps {
24941
+ class x_ extends Ps {
24917
24942
  /**
24918
24943
  * @param {Options<ImageSourceType>} [options] Layer options.
24919
24944
  */
@@ -24921,7 +24946,7 @@ class p_ extends Ps {
24921
24946
  t = t || {}, super(t);
24922
24947
  }
24923
24948
  }
24924
- class x_ extends p_ {
24949
+ class E_ extends x_ {
24925
24950
  /**
24926
24951
  * @param {import("./BaseImage.js").Options<ImageSourceType>} [options] Layer options.
24927
24952
  */
@@ -24932,7 +24957,7 @@ class x_ extends p_ {
24932
24957
  * @override
24933
24958
  */
24934
24959
  createRenderer() {
24935
- return new y_(this);
24960
+ return new p_(this);
24936
24961
  }
24937
24962
  /**
24938
24963
  * Get data for a pixel location. A four element RGBA array will be returned. For requests outside the
@@ -24954,31 +24979,31 @@ class x_ extends p_ {
24954
24979
  return super.getData(t);
24955
24980
  }
24956
24981
  }
24957
- function E_(n, t) {
24982
+ function C_(n, t) {
24958
24983
  return typeof n == "function" ? n(t) : n;
24959
24984
  }
24960
- const C_ = {
24985
+ const w_ = {
24961
24986
  name: "ppe-popup",
24962
24987
  getInitialState: (n) => ({
24963
24988
  ...n
24964
24989
  }),
24965
24990
  createPlanEditor: (n) => {
24966
- const { overlay: t, closerElement: e, popupElement: i } = S_();
24991
+ const { overlay: t, closerElement: e, popupElement: i } = I_();
24967
24992
  n.addOverlay(t), e.addEventListener("click", () => (t.setPosition(void 0), e.blur(), !1)), n._showPopup = (s, r) => {
24968
- t.setPosition(s.event.coordinate), i.innerHTML = s.content, r != null && r.offset && t.setOffset(r.offset), t.setPositioning(w_(n, s.event, r == null ? void 0 : r.positioning));
24993
+ t.setPosition(s.event.coordinate), i.innerHTML = s.content, r != null && r.offset && t.setOffset(r.offset), t.setPositioning(S_(n, s.event, r == null ? void 0 : r.positioning));
24969
24994
  }, n._hidePopup = () => {
24970
24995
  t.setPosition(void 0);
24971
24996
  };
24972
24997
  }
24973
24998
  };
24974
- function w_(n, t, e) {
24999
+ function S_(n, t, e) {
24975
25000
  if (e && e != "auto") return e;
24976
25001
  const i = n.getSize();
24977
25002
  if (!i) return "top-right";
24978
25003
  const [s, r] = n.getPixelFromCoordinate(t.coordinate), [o, a] = i, l = s < o / 2 ? "left" : "right";
24979
25004
  return `${r < a / 2 ? "top" : "bottom"}-${l}`;
24980
25005
  }
24981
- function S_() {
25006
+ function I_() {
24982
25007
  const n = document.createElement("div");
24983
25008
  n.id = "ppe-popup", n.className = "ppe-popup";
24984
25009
  const t = document.createElement("button");
@@ -24993,7 +25018,7 @@ function S_() {
24993
25018
  closerElement: t
24994
25019
  };
24995
25020
  }
24996
- const I_ = {
25021
+ const R_ = {
24997
25022
  name: "ppe-layer",
24998
25023
  getInitialState: (n) => ({
24999
25024
  ...n
@@ -25004,28 +25029,28 @@ const I_ = {
25004
25029
  return n.initialState._extent && e.setExtent(n.initialState._extent), e;
25005
25030
  };
25006
25031
  }
25007
- }, R_ = [
25032
+ }, v_ = [
25008
25033
  bg,
25009
- I_,
25010
- C_,
25011
- t_,
25012
- n_
25034
+ R_,
25035
+ w_,
25036
+ e_,
25037
+ s_
25013
25038
  ];
25014
- function L_(n) {
25039
+ function A_(n) {
25015
25040
  var m;
25016
25041
  const t = [
25017
- ...R_,
25042
+ ...v_,
25018
25043
  ...n._plugins ?? []
25019
25044
  ], { plan: e } = n, i = [0, 0, e.file.width, e.file.height], s = new gs({
25020
25045
  code: "",
25021
25046
  units: "pixels",
25022
25047
  extent: i
25023
- }), r = new m_({
25048
+ }), r = new y_({
25024
25049
  imageExtent: i,
25025
25050
  projection: s,
25026
25051
  url: e.file.original_url,
25027
25052
  crossOrigin: "anonymous"
25028
- }), o = new x_({ source: r }), a = new te({
25053
+ }), o = new E_({ source: r }), a = new te({
25029
25054
  projection: s,
25030
25055
  center: Yt(i),
25031
25056
  zoom: 2,
@@ -25074,7 +25099,7 @@ function L_(n) {
25074
25099
  (p = (y = c.options).onStateChange) == null || p.call(y, _);
25075
25100
  },
25076
25101
  setOptions: (_) => {
25077
- const y = E_(_, c.options), p = c.getTarget(), E = f(y);
25102
+ const y = C_(_, c.options), p = c.getTarget(), E = f(y);
25078
25103
  c.options = E, E.target && E.target !== p && c.setTarget(E.target);
25079
25104
  },
25080
25105
  fitToContent: () => {
@@ -25092,11 +25117,11 @@ function L_(n) {
25092
25117
  return c;
25093
25118
  }
25094
25119
  export {
25095
- n_ as HistoryPlugin,
25096
- t_ as PdfExportPlugin,
25120
+ s_ as HistoryPlugin,
25121
+ e_ as PdfExportPlugin,
25097
25122
  bg as ZoningPlugin,
25098
25123
  Oo as convertToZoneGeometry,
25099
25124
  gh as convertZoneToGeometryFeatures,
25100
- L_ as createPlanEditor,
25101
- R_ as defaultPlugins
25125
+ A_ as createPlanEditor,
25126
+ v_ as defaultPlugins
25102
25127
  };