@plannco-ppe/ppe-core 1.0.20 → 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
- const h = l.getProperties();
23601
- return $g(h);
23600
+ const h = l.getProperties(), c = (n == null ? void 0 : n._zoneFillVisible) ?? !0;
23601
+ return Jg(h, c);
23602
23602
  }
23603
23603
  }), o = new kf({
23604
23604
  source: e,
@@ -23622,6 +23622,9 @@ const bg = {
23622
23622
  _currentAction: "none",
23623
23623
  _currentDrawingZone: null,
23624
23624
  _zoneFilter: void 0,
23625
+ _zoneFillVisible: !0,
23626
+ _zonePopupVisible: !0,
23627
+ _hiddenZoneFills: /* @__PURE__ */ new Set(),
23625
23628
  ...n
23626
23629
  };
23627
23630
  },
@@ -23630,10 +23633,26 @@ const bg = {
23630
23633
  const t = n.initialState, { _zoneLayer: e, _zoneLabelLayer: i } = t;
23631
23634
  e && n.addLayer(e), i && n.addLayer(i), e.setStyle((o) => {
23632
23635
  const a = o.getProperties();
23633
- return t._zoneFilter && !t._zoneFilter(a) ? [] : us(a);
23634
- }), 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);
23635
23640
  const s = ((r = n.options.zoningConfig) == null ? void 0 : r.editMode) || "editing";
23636
- 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.isZoneLayerVisible = () => t._zoneLayer.getVisible(), n.isZoneLabelLayerVisible = () => t._zoneLabelLayer.getVisible(), n.restoreZones = (o) => Og(n, o);
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) => {
23642
+ t._zoneFillVisible = o, t._zoneLayer.changed();
23643
+ }, n.setZonePopupVisible = (o) => {
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
+ });
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);
23637
23656
  }
23638
23657
  };
23639
23658
  function Dg(n) {
@@ -23784,10 +23803,10 @@ function Ls(n) {
23784
23803
  function Yg(n, t) {
23785
23804
  const e = n.initialState, { _zoneLayer: i } = e;
23786
23805
  t === "occupation" ? (i.setStyle((s) => {
23787
- var l, h;
23806
+ var h, c;
23788
23807
  const r = s.getProperties();
23789
23808
  if (e._zoneFilter && !e._zoneFilter(r)) return [];
23790
- 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)) ?? [];
23791
23810
  if (o.length === 0)
23792
23811
  return [
23793
23812
  new rt({
@@ -23799,14 +23818,16 @@ function Yg(n, t) {
23799
23818
  fill: new lt({ color: "rgba(0,0,0,0)" })
23800
23819
  })
23801
23820
  ];
23802
- const a = o.length ? o : [r.color];
23821
+ const a = o.length ? o : [r.color], l = e._zoneFillVisible && !e._hiddenZoneFills.has(r.id);
23803
23822
  return [
23804
- ...us(s.getProperties()),
23823
+ ...us(r, l),
23805
23824
  Fg({ colors: a })
23806
23825
  ];
23807
23826
  }), se(n)) : (i.setStyle((s) => {
23808
23827
  const r = s.getProperties();
23809
- return e._zoneFilter && !e._zoneFilter(r) ? [] : us(r);
23828
+ if (e._zoneFilter && !e._zoneFilter(r)) return [];
23829
+ const o = e._zoneFillVisible && !e._hiddenZoneFills.has(r.id);
23830
+ return us(r, o);
23810
23831
  }), se(n));
23811
23832
  }
23812
23833
  function Zg(n) {
@@ -23924,15 +23945,26 @@ function Kg(n, t) {
23924
23945
  e._zoneFilter = t, e._zoneLayer.changed(), se(n);
23925
23946
  }
23926
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) {
23927
23958
  n.on("pointermove", (t) => {
23928
23959
  var s;
23929
- if (n.initialState._currentAction === "drawing") {
23960
+ const e = n.initialState;
23961
+ if (e._currentAction === "drawing" || !e._zonePopupVisible) {
23930
23962
  n._hidePopup();
23931
23963
  return;
23932
23964
  }
23933
23965
  const i = n.forEachFeatureAtPixel(t.pixel, (r) => r);
23934
23966
  if (i && i.get("__type") === "zone") {
23935
- 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);
23936
23968
  n._showPopup({
23937
23969
  event: t,
23938
23970
  content: a
@@ -23940,37 +23972,37 @@ function Ug(n) {
23940
23972
  } else i || n._hidePopup();
23941
23973
  });
23942
23974
  }
23943
- function Hg(n) {
23975
+ function qg(n) {
23944
23976
  const t = new Pn({ wrapX: !1 }), e = new Ai({
23945
23977
  source: t,
23946
23978
  style: (i) => us(i.getProperties())
23947
23979
  });
23948
23980
  return n && e.setExtent(n), { layer: e, source: t };
23949
23981
  }
23950
- function qg(n) {
23982
+ function $g(n) {
23951
23983
  const t = new Pn({ wrapX: !1 }), e = new Ai({
23952
23984
  source: t
23953
23985
  // Labels use their own styles set on each feature
23954
23986
  });
23955
23987
  return n && e.setExtent(n), { layer: e, source: t };
23956
23988
  }
23957
- function us({ color: n }) {
23989
+ function us({ color: n }, t = !0) {
23958
23990
  return [
23959
23991
  new rt({
23960
23992
  stroke: new ie({ color: n, width: 3 }),
23961
- fill: new lt({ color: n + "80" })
23993
+ fill: new lt({ color: t ? n + "80" : "rgba(0,0,0,0)" })
23962
23994
  })
23963
23995
  ];
23964
23996
  }
23965
- function $g({ color: n }) {
23997
+ function Jg({ color: n }, t = !0) {
23966
23998
  return [
23967
23999
  new rt({
23968
24000
  stroke: new ie({ color: n, width: 5 }),
23969
- fill: new lt({ color: n + "A0" })
24001
+ fill: new lt({ color: t ? n + "A0" : "rgba(0,0,0,0)" })
23970
24002
  })
23971
24003
  ];
23972
24004
  }
23973
- function Jg(n) {
24005
+ function Qg(n) {
23974
24006
  return `
23975
24007
  <div style="display: flex; gap: 1rem; background-color: rgba(220,220,220,0.75); padding: 1rem">
23976
24008
  <div style="height: 1rem; width: 1rem; background-color: ${n.color}"></div>
@@ -23978,20 +24010,20 @@ function Jg(n) {
23978
24010
  </div>
23979
24011
  `;
23980
24012
  }
23981
- const Qg = {
24013
+ const t_ = {
23982
24014
  a0: [1189, 841],
23983
24015
  a1: [841, 594],
23984
24016
  a2: [594, 420],
23985
24017
  a3: [420, 297],
23986
24018
  a4: [297, 210],
23987
24019
  a5: [210, 148]
23988
- }, t_ = {
24020
+ }, e_ = {
23989
24021
  name: "ppe-pdf-export",
23990
24022
  getInitialState: (n) => ({
23991
24023
  ...n
23992
24024
  }),
23993
24025
  createPlanEditor: (n) => {
23994
- 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);
23995
24027
  }
23996
24028
  };
23997
24029
  async function xh(n, t, e) {
@@ -24049,7 +24081,7 @@ function Ch(n, t) {
24049
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);
24050
24082
  }
24051
24083
  function wh(n, t, e, i) {
24052
- const s = Qg[t];
24084
+ const s = t_[t];
24053
24085
  if (!s)
24054
24086
  throw new Error(`Invalid PDF format: ${t}`);
24055
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;
@@ -24057,7 +24089,7 @@ function wh(n, t, e, i) {
24057
24089
  throw new Error("Unable to get editor container element");
24058
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 };
24059
24091
  }
24060
- async function e_(n, t) {
24092
+ async function i_(n, t) {
24061
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);
24062
24094
  try {
24063
24095
  const { width: h, height: c, canvasWidth: u, canvasHeight: d } = wh(
@@ -24073,7 +24105,7 @@ async function e_(n, t) {
24073
24105
  Ch(n, l);
24074
24106
  }
24075
24107
  }
24076
- async function i_(n, t) {
24108
+ async function n_(n, t) {
24077
24109
  var h, c, u;
24078
24110
  const e = t.format || "a4", i = t.orientation || "landscape", s = t.resolution || 350, r = t.filename || "periodic-export.pdf", o = t.periods;
24079
24111
  if (!o || o.length === 0)
@@ -24098,7 +24130,7 @@ async function i_(n, t) {
24098
24130
  Ch(n, l);
24099
24131
  }
24100
24132
  }
24101
- const n_ = {
24133
+ const s_ = {
24102
24134
  name: "ppe-history",
24103
24135
  getInitialState: (n) => ({
24104
24136
  _historyStack: [],
@@ -24123,7 +24155,7 @@ function Ua(n, t, e, i, s) {
24123
24155
  function _r(n, t) {
24124
24156
  return Math.abs(n[t * 4] - 210) > 2 || Math.abs(n[t * 4 + 3] - 0.75 * 255) > 2;
24125
24157
  }
24126
- function s_() {
24158
+ function r_() {
24127
24159
  if (gr === void 0) {
24128
24160
  const n = gt(6, 6, nn);
24129
24161
  n.globalCompositeOperation = "lighter", n.fillStyle = "rgba(210, 0, 0, 0.75)", Ua(n, 4, 5, 4, 0), Ua(n, 4, 5, 0, 5);
@@ -24132,7 +24164,7 @@ function s_() {
24132
24164
  }
24133
24165
  return gr;
24134
24166
  }
24135
- function r_(n, t, e, i) {
24167
+ function o_(n, t, e, i) {
24136
24168
  const s = gl(e, t, n);
24137
24169
  let r = na(
24138
24170
  t,
@@ -24150,7 +24182,7 @@ function r_(n, t, e, i) {
24150
24182
  }
24151
24183
  return r;
24152
24184
  }
24153
- 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) {
24154
24186
  const g = gt(
24155
24187
  Math.round(e * n),
24156
24188
  Math.round(e * t),
@@ -24219,7 +24251,7 @@ function o_(n, t, e, i, s, r, o, a, l, h, c, u, d, f) {
24219
24251
  ], pt = Zh(Ge);
24220
24252
  if (!pt)
24221
24253
  return;
24222
- if (g.save(), g.beginPath(), s_() || !u) {
24254
+ if (g.save(), g.beginPath(), r_() || !u) {
24223
24255
  g.moveTo(j, Q);
24224
24256
  const Vt = 4, Ie = b - j, Di = z - Q;
24225
24257
  for (let $t = 0; $t < Vt; $t++)
@@ -24260,8 +24292,8 @@ function o_(n, t, e, i, s, r, o, a, l, h, c, u, d, f) {
24260
24292
  function kr(n) {
24261
24293
  return Array.isArray(n) ? Math.min(...n) : n;
24262
24294
  }
24263
- const a_ = 10, Ha = 0.25;
24264
- class l_ {
24295
+ const l_ = 10, Ha = 0.25;
24296
+ class h_ {
24265
24297
  /**
24266
24298
  * @param {import("../proj/Projection.js").default} sourceProj Source projection.
24267
24299
  * @param {import("../proj/Projection.js").default} targetProj Target projection.
@@ -24284,7 +24316,7 @@ class l_ {
24284
24316
  const x = E[0] + "/" + E[1];
24285
24317
  return l[x] || (l[x] = h(E)), l[x];
24286
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;
24287
- 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(
24288
24320
  0,
24289
24321
  Math.ceil(
24290
24322
  Math.log2(
@@ -24477,8 +24509,8 @@ class l_ {
24477
24509
  return this.triangles_;
24478
24510
  }
24479
24511
  }
24480
- const h_ = 0.5;
24481
- class c_ extends so {
24512
+ const c_ = 0.5;
24513
+ class u_ extends so {
24482
24514
  /**
24483
24515
  * @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
24484
24516
  * @param {import("../proj/Projection.js").default} targetProj Target projection.
@@ -24494,12 +24526,12 @@ class c_ extends so {
24494
24526
  l && t.canWrapX() && (l = l.slice(), l[0] = -1 / 0, l[2] = 1 / 0);
24495
24527
  let h = e.getExtent();
24496
24528
  h && e.canWrapX() && (h = h.slice(), h[0] = -1 / 0, h[2] = 1 / 0);
24497
- 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_(
24498
24530
  t,
24499
24531
  e,
24500
24532
  u,
24501
24533
  s
24502
- ), f = h_, g = new l_(
24534
+ ), f = c_, g = new h_(
24503
24535
  t,
24504
24536
  e,
24505
24537
  c,
@@ -24536,7 +24568,7 @@ class c_ extends so {
24536
24568
  const t = this.sourceImage_.getState();
24537
24569
  if (t == M.LOADED) {
24538
24570
  const e = K(this.targetExtent_) / this.targetResolution_, i = ft(this.targetExtent_) / this.targetResolution_;
24539
- this.canvas_ = o_(
24571
+ this.canvas_ = a_(
24540
24572
  e,
24541
24573
  i,
24542
24574
  this.sourcePixelRatio_,
@@ -24606,7 +24638,7 @@ const Hn = 4, mr = {
24606
24638
  */
24607
24639
  IMAGELOADERROR: "imageloaderror"
24608
24640
  };
24609
- class u_ extends Lt {
24641
+ class d_ extends Lt {
24610
24642
  /**
24611
24643
  * @param {string} type Type.
24612
24644
  * @param {import("../Image.js").default} image The image.
@@ -24615,7 +24647,7 @@ class u_ extends Lt {
24615
24647
  super(t), this.image = e;
24616
24648
  }
24617
24649
  }
24618
- class d_ extends ih {
24650
+ class f_ extends ih {
24619
24651
  /**
24620
24652
  * @param {Options} options Single image source options.
24621
24653
  */
@@ -24669,7 +24701,7 @@ class d_ extends ih {
24669
24701
  return this.reprojectedImage_;
24670
24702
  this.reprojectedImage_.dispose(), this.reprojectedImage_ = null;
24671
24703
  }
24672
- return this.reprojectedImage_ = new c_(
24704
+ return this.reprojectedImage_ = new u_(
24673
24705
  r,
24674
24706
  s,
24675
24707
  t,
@@ -24690,7 +24722,7 @@ class d_ extends ih {
24690
24722
  */
24691
24723
  getImageInternal(t, e, i, s) {
24692
24724
  if (this.loader) {
24693
- const r = g_(t, e, i, 1), o = this.findNearestResolution(e);
24725
+ const r = __(t, e, i, 1), o = this.findNearestResolution(e);
24694
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)))
24695
24727
  return this.image;
24696
24728
  this.wantedProjection_ = s, this.wantedExtent_ = r, this.wantedResolution_ = o, this.image = new so(
@@ -24729,20 +24761,20 @@ class d_ extends ih {
24729
24761
  default:
24730
24762
  return;
24731
24763
  }
24732
- this.hasListener(i) && this.dispatchEvent(new u_(i, e));
24764
+ this.hasListener(i) && this.dispatchEvent(new d_(i, e));
24733
24765
  }
24734
24766
  }
24735
- function f_(n, t) {
24767
+ function g_(n, t) {
24736
24768
  n.getImage().src = t;
24737
24769
  }
24738
- function g_(n, t, e, i) {
24770
+ function __(n, t, e, i) {
24739
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;
24740
24772
  return qn(r, s, 0, [
24741
24773
  h,
24742
24774
  u
24743
24775
  ]);
24744
24776
  }
24745
- function __(n) {
24777
+ function m_(n) {
24746
24778
  const t = n.load || xl, e = n.imageExtent, i = n.crossOrigin ?? null;
24747
24779
  return () => {
24748
24780
  const s = new Image();
@@ -24752,12 +24784,12 @@ function __(n) {
24752
24784
  });
24753
24785
  };
24754
24786
  }
24755
- class m_ extends d_ {
24787
+ class y_ extends f_ {
24756
24788
  /**
24757
24789
  * @param {Options} options ImageStatic options.
24758
24790
  */
24759
24791
  constructor(t) {
24760
- 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_;
24761
24793
  super({
24762
24794
  attributions: t.attributions,
24763
24795
  interpolate: t.interpolate,
@@ -24766,7 +24798,7 @@ class m_ extends d_ {
24766
24798
  this.imageExtent_,
24767
24799
  void 0,
24768
24800
  1,
24769
- __({
24801
+ m_({
24770
24802
  url: t.url,
24771
24803
  imageExtent: t.imageExtent,
24772
24804
  crossOrigin: e,
@@ -24805,7 +24837,7 @@ class m_ extends d_ {
24805
24837
  return this.url_;
24806
24838
  }
24807
24839
  }
24808
- class y_ extends Ol {
24840
+ class p_ extends Ol {
24809
24841
  /**
24810
24842
  * @param {import("../../layer/Image.js").default} imageLayer Image layer.
24811
24843
  */
@@ -24906,7 +24938,7 @@ class y_ extends Ol {
24906
24938
  return this.postRender(this.context, t), E && p.restore(), p.imageSmoothingEnabled = !0, this.container;
24907
24939
  }
24908
24940
  }
24909
- class p_ extends Ps {
24941
+ class x_ extends Ps {
24910
24942
  /**
24911
24943
  * @param {Options<ImageSourceType>} [options] Layer options.
24912
24944
  */
@@ -24914,7 +24946,7 @@ class p_ extends Ps {
24914
24946
  t = t || {}, super(t);
24915
24947
  }
24916
24948
  }
24917
- class x_ extends p_ {
24949
+ class E_ extends x_ {
24918
24950
  /**
24919
24951
  * @param {import("./BaseImage.js").Options<ImageSourceType>} [options] Layer options.
24920
24952
  */
@@ -24925,7 +24957,7 @@ class x_ extends p_ {
24925
24957
  * @override
24926
24958
  */
24927
24959
  createRenderer() {
24928
- return new y_(this);
24960
+ return new p_(this);
24929
24961
  }
24930
24962
  /**
24931
24963
  * Get data for a pixel location. A four element RGBA array will be returned. For requests outside the
@@ -24947,31 +24979,31 @@ class x_ extends p_ {
24947
24979
  return super.getData(t);
24948
24980
  }
24949
24981
  }
24950
- function E_(n, t) {
24982
+ function C_(n, t) {
24951
24983
  return typeof n == "function" ? n(t) : n;
24952
24984
  }
24953
- const C_ = {
24985
+ const w_ = {
24954
24986
  name: "ppe-popup",
24955
24987
  getInitialState: (n) => ({
24956
24988
  ...n
24957
24989
  }),
24958
24990
  createPlanEditor: (n) => {
24959
- const { overlay: t, closerElement: e, popupElement: i } = S_();
24991
+ const { overlay: t, closerElement: e, popupElement: i } = I_();
24960
24992
  n.addOverlay(t), e.addEventListener("click", () => (t.setPosition(void 0), e.blur(), !1)), n._showPopup = (s, r) => {
24961
- 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));
24962
24994
  }, n._hidePopup = () => {
24963
24995
  t.setPosition(void 0);
24964
24996
  };
24965
24997
  }
24966
24998
  };
24967
- function w_(n, t, e) {
24999
+ function S_(n, t, e) {
24968
25000
  if (e && e != "auto") return e;
24969
25001
  const i = n.getSize();
24970
25002
  if (!i) return "top-right";
24971
25003
  const [s, r] = n.getPixelFromCoordinate(t.coordinate), [o, a] = i, l = s < o / 2 ? "left" : "right";
24972
25004
  return `${r < a / 2 ? "top" : "bottom"}-${l}`;
24973
25005
  }
24974
- function S_() {
25006
+ function I_() {
24975
25007
  const n = document.createElement("div");
24976
25008
  n.id = "ppe-popup", n.className = "ppe-popup";
24977
25009
  const t = document.createElement("button");
@@ -24986,7 +25018,7 @@ function S_() {
24986
25018
  closerElement: t
24987
25019
  };
24988
25020
  }
24989
- const I_ = {
25021
+ const R_ = {
24990
25022
  name: "ppe-layer",
24991
25023
  getInitialState: (n) => ({
24992
25024
  ...n
@@ -24997,28 +25029,28 @@ const I_ = {
24997
25029
  return n.initialState._extent && e.setExtent(n.initialState._extent), e;
24998
25030
  };
24999
25031
  }
25000
- }, R_ = [
25032
+ }, v_ = [
25001
25033
  bg,
25002
- I_,
25003
- C_,
25004
- t_,
25005
- n_
25034
+ R_,
25035
+ w_,
25036
+ e_,
25037
+ s_
25006
25038
  ];
25007
- function L_(n) {
25039
+ function A_(n) {
25008
25040
  var m;
25009
25041
  const t = [
25010
- ...R_,
25042
+ ...v_,
25011
25043
  ...n._plugins ?? []
25012
25044
  ], { plan: e } = n, i = [0, 0, e.file.width, e.file.height], s = new gs({
25013
25045
  code: "",
25014
25046
  units: "pixels",
25015
25047
  extent: i
25016
- }), r = new m_({
25048
+ }), r = new y_({
25017
25049
  imageExtent: i,
25018
25050
  projection: s,
25019
25051
  url: e.file.original_url,
25020
25052
  crossOrigin: "anonymous"
25021
- }), o = new x_({ source: r }), a = new te({
25053
+ }), o = new E_({ source: r }), a = new te({
25022
25054
  projection: s,
25023
25055
  center: Yt(i),
25024
25056
  zoom: 2,
@@ -25067,7 +25099,7 @@ function L_(n) {
25067
25099
  (p = (y = c.options).onStateChange) == null || p.call(y, _);
25068
25100
  },
25069
25101
  setOptions: (_) => {
25070
- const y = E_(_, c.options), p = c.getTarget(), E = f(y);
25102
+ const y = C_(_, c.options), p = c.getTarget(), E = f(y);
25071
25103
  c.options = E, E.target && E.target !== p && c.setTarget(E.target);
25072
25104
  },
25073
25105
  fitToContent: () => {
@@ -25085,11 +25117,11 @@ function L_(n) {
25085
25117
  return c;
25086
25118
  }
25087
25119
  export {
25088
- n_ as HistoryPlugin,
25089
- t_ as PdfExportPlugin,
25120
+ s_ as HistoryPlugin,
25121
+ e_ as PdfExportPlugin,
25090
25122
  bg as ZoningPlugin,
25091
25123
  Oo as convertToZoneGeometry,
25092
25124
  gh as convertZoneToGeometryFeatures,
25093
- L_ as createPlanEditor,
25094
- R_ as defaultPlugins
25125
+ A_ as createPlanEditor,
25126
+ v_ as defaultPlugins
25095
25127
  };