@26lights/orcha 0.28.4-dnd11 → 0.28.4-dnd12

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/orcha.es.js CHANGED
@@ -3605,21 +3605,22 @@ function c0(a) {
3605
3605
  }
3606
3606
  function Rt(a, e) {
3607
3607
  if (a.moved)
3608
- return Ot(e, a.moved.oldIndex, a.moved.newIndex);
3609
- }
3610
- function Ot(a, e, t) {
3611
- const n = a[e];
3612
- let s, o;
3613
- if (t === 0)
3614
- o = a[t];
3615
- else if (t === a.length - 1)
3616
- s = a[t];
3617
- else {
3618
- s = a[t];
3619
- const i = e > t ? -1 : 1;
3620
- o = a[t + i];
3608
+ return Ot(e, a.moved.newIndex);
3609
+ }
3610
+ function Ot(a, e) {
3611
+ if (e === 0)
3612
+ if (a.length > 1) {
3613
+ const t = a[e + 1];
3614
+ return Te.LexoRank.parse(t.rank).genPrev().format();
3615
+ } else
3616
+ return Te.LexoRank.initial().format();
3617
+ else if (e === a.length - 1) {
3618
+ const t = a[e - 1];
3619
+ return Te.LexoRank.parse(t.rank).genNext().format();
3620
+ } else {
3621
+ const t = a[e - 1], n = a[e + 1];
3622
+ return Te.LexoRank.parse(n.rank).between(Te.LexoRank.parse(t.rank)).format();
3621
3623
  }
3622
- return !s && o ? Te.LexoRank.parse(o.rank).genPrev().format() : s && !o ? Te.LexoRank.parse(s.rank).genNext().format() : s && o ? Te.LexoRank.parse(o.rank).between(Te.LexoRank.parse(s.rank)).format() : Te.LexoRank.parse(n.rank).genNext().format();
3623
3624
  }
3624
3625
  function S1(a, e = "dd/MM/yyyy") {
3625
3626
  if (!a)
@@ -8418,7 +8419,6 @@ const v9 = { class: "ao-project-phase" }, p9 = {
8418
8419
  id: u.moved.element.id,
8419
8420
  rank: Ot(
8420
8421
  o.value,
8421
- u.moved.oldIndex,
8422
8422
  u.moved.newIndex
8423
8423
  )
8424
8424
  });
@@ -9029,7 +9029,6 @@ const a4 = { class: "ao-project-milestone" }, s4 = { class: "ao-project-mileston
9029
9029
  id: p.moved.element.id,
9030
9030
  rank: Ot(
9031
9031
  l.value,
9032
- p.moved.oldIndex,
9033
9032
  p.moved.newIndex
9034
9033
  )
9035
9034
  });
@@ -9369,7 +9368,7 @@ const y4 = {
9369
9368
  e("updateActivity", {
9370
9369
  id: r.added.element.id,
9371
9370
  statusId: t.status.id,
9372
- rank: Ot(t.list, 0, r.added.newIndex)
9371
+ rank: Ot(t.list, r.added.newIndex)
9373
9372
  });
9374
9373
  else if (!("removed" in r)) {
9375
9374
  if ("moved" in r) {
@@ -9377,7 +9376,6 @@ const y4 = {
9377
9376
  id: r.moved.element.id,
9378
9377
  rank: Ot(
9379
9378
  t.list,
9380
- r.moved.oldIndex,
9381
9379
  r.moved.newIndex
9382
9380
  )
9383
9381
  };