@elyx-code/project-logic-tree 0.0.6983 → 0.0.6984

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
@@ -92084,7 +92084,9 @@ const Mi = class Mi extends an {
92084
92084
  !0,
92085
92085
  D.CreateFromGenerationTarget
92086
92086
  )
92087
- ) : a, e = te(i.parent), f = r.get(e), h = (i.calledByEntry || []).map((N) => {
92087
+ ) : a, e = te(i.parent), f = r.get(
92088
+ e
92089
+ ), h = (i.calledByEntry || []).map((N) => {
92088
92090
  const V = te(N);
92089
92091
  return r.get(V);
92090
92092
  }), m = (i.calledBySuccess || []).map((N) => {
@@ -92096,7 +92098,9 @@ const Mi = class Mi extends an {
92096
92098
  });
92097
92099
  let E = null;
92098
92100
  if (i.readsValue) {
92099
- const N = te(i.readsValue);
92101
+ const N = te(
92102
+ i.readsValue
92103
+ );
92100
92104
  E = r.get(
92101
92105
  N
92102
92106
  );
@@ -92227,9 +92231,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92227
92231
  const h = f.entity.afterAllChildrenInitialized(i);
92228
92232
  r.push(...h.updated), a.push(...h.added), c.push(...h.removed), e.push(...h.affected);
92229
92233
  }), i == null || i.attemptAutoclose("sync-dependents", this.id), {
92230
- updated: C(r),
92231
- added: C(a),
92232
- removed: C(c),
92234
+ updated: C(
92235
+ r
92236
+ ),
92237
+ added: C(
92238
+ a
92239
+ ),
92240
+ removed: C(
92241
+ c
92242
+ ),
92233
92243
  affected: C(
92234
92244
  e
92235
92245
  ),
@@ -92265,9 +92275,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92265
92275
  c.push(...m), e.push(...b), f.push(...E);
92266
92276
  }
92267
92277
  return {
92268
- updated: C(c),
92269
- added: C(e),
92270
- removed: C(f),
92278
+ updated: C(
92279
+ c
92280
+ ),
92281
+ added: C(
92282
+ e
92283
+ ),
92284
+ removed: C(
92285
+ f
92286
+ ),
92271
92287
  affected: C(
92272
92288
  h
92273
92289
  ),
@@ -92303,9 +92319,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92303
92319
  c.push(...m), e.push(...b), f.push(...E);
92304
92320
  }
92305
92321
  return {
92306
- updated: C(c),
92307
- added: C(e),
92308
- removed: C(f),
92322
+ updated: C(
92323
+ c
92324
+ ),
92325
+ added: C(
92326
+ e
92327
+ ),
92328
+ removed: C(
92329
+ f
92330
+ ),
92309
92331
  affected: C(
92310
92332
  h
92311
92333
  ),
@@ -92419,7 +92441,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92419
92441
  return this.knownVersions = this.knownVersions ? this.knownVersions.set(this.version, i) : (/* @__PURE__ */ new Map()).set(this.version, i), this.apply(i), this;
92420
92442
  }
92421
92443
  snapshot() {
92422
- const i = new Mi(this, this.project);
92444
+ const i = new Mi(
92445
+ this,
92446
+ this.project
92447
+ );
92423
92448
  return this.apply(i);
92424
92449
  }
92425
92450
  /**
@@ -92442,9 +92467,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92442
92467
  r.push(this.parent, ...f.updated), a.push(...f.added), c.push(...f.removed);
92443
92468
  }
92444
92469
  return {
92445
- updated: C(r),
92446
- added: C(a),
92447
- removed: C(c),
92470
+ updated: C(
92471
+ r
92472
+ ),
92473
+ added: C(
92474
+ a
92475
+ ),
92476
+ removed: C(
92477
+ c
92478
+ ),
92448
92479
  affected: C(
92449
92480
  e
92450
92481
  ),
@@ -92467,7 +92498,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92467
92498
  updated: C(
92468
92499
  a
92469
92500
  ),
92470
- added: C(c),
92501
+ added: C(
92502
+ c
92503
+ ),
92471
92504
  removed: C(
92472
92505
  e
92473
92506
  ),
@@ -92503,9 +92536,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92503
92536
  );
92504
92537
  }
92505
92538
  return this.metaSync(h.toShallowJSON(), null), this.previousVersion = h.previousVersion, this.version = h.version, this.createdAt = h.createdAt, this.author = h.author, this.deleted = h.deleted, this.outputs = [...h.outputs], this.readsValue = h.readsValue, this.defaultValue = h.defaultValue, this.dataType = h.dataType, this.throws = h.throws, this.calledBySuccess = [...h.calledBySuccess], this.calledByError = [...h.calledByError], this.calledByEntry = [...h.calledByEntry], this.parent = h.parent, {
92506
- updated: C(a),
92507
- added: C(c),
92508
- removed: C(e),
92539
+ updated: C(
92540
+ a
92541
+ ),
92542
+ added: C(
92543
+ c
92544
+ ),
92545
+ removed: C(
92546
+ e
92547
+ ),
92509
92548
  affected: C(
92510
92549
  f
92511
92550
  ),
@@ -92530,7 +92569,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92530
92569
  this.id
92531
92570
  ), this;
92532
92571
  if (this.metaSync(i, r), this.version = i.version, this.createdAt = i.createdAt, this.author = i.author, this.deleted = i.deleted, this.previousVersion = i.previousVersion, this.unsubscribeFromDependencies(), i.parent) {
92533
- const a = te(i.parent), c = this.project.get(a), e = this.parent;
92572
+ const a = te(i.parent), c = this.project.get(
92573
+ a
92574
+ ), e = this.parent;
92534
92575
  if (e && e.id !== (c == null ? void 0 : c.id) && this.removeFromParent(r), c)
92535
92576
  this.setParent(c, r), this.addSelfToProject(r);
92536
92577
  else
@@ -92544,7 +92585,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92544
92585
  throw r == null || r.attemptAutoclose(
92545
92586
  D.UpdateWithShallowTransfer,
92546
92587
  this.id
92547
- ), new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
92588
+ ), new Error(
92589
+ `${this.type} with id '${this.id}' must have a 'parent'`
92590
+ );
92548
92591
  if (i.readsValue) {
92549
92592
  const a = te(
92550
92593
  i.readsValue
@@ -92555,7 +92598,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92555
92598
  } else
92556
92599
  this.removeValueWriter(r);
92557
92600
  if (i.calledByEntry.forEach((a) => {
92558
- const c = te(a), e = this.project.get(c);
92601
+ const c = te(a), e = this.project.get(
92602
+ c
92603
+ );
92559
92604
  e && (this.addEntryCaller(e, r), e.addCall(this, r));
92560
92605
  }), [...this.calledByEntry].forEach((a) => {
92561
92606
  i.calledByEntry.find(
@@ -92587,7 +92632,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92587
92632
  (e) => te(e) === a.id
92588
92633
  ) || (this.removeOutput(a, r), a.removeFromParent(r));
92589
92634
  }), i.dataType) {
92590
- const a = te(i.dataType), c = this.project.get(a);
92635
+ const a = te(
92636
+ i.dataType
92637
+ ), c = this.project.get(a);
92591
92638
  c && this.setDataType(c, r);
92592
92639
  } else
92593
92640
  this.setDataType(null, r);
@@ -92624,7 +92671,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92624
92671
  this.id
92625
92672
  ), this;
92626
92673
  if (this.metaSync(i, r), i.parent) {
92627
- const f = te(i.parent), h = this.project.get(f), m = this.parent;
92674
+ const f = te(i.parent), h = this.project.get(
92675
+ f
92676
+ ), m = this.parent;
92628
92677
  if (m && m.id !== (h == null ? void 0 : h.id) && this.removeFromParent(r), h)
92629
92678
  this.setParent(h, r), this.addSelfToProject(r);
92630
92679
  else
@@ -92650,7 +92699,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92650
92699
  } else
92651
92700
  i.readsValue === null && this.removeValueWriter(r);
92652
92701
  return (a = i.calledByEntry) == null || a.forEach((f) => {
92653
- const h = te(f), m = this.project.get(h);
92702
+ const h = te(f), m = this.project.get(
92703
+ h
92704
+ );
92654
92705
  if (m)
92655
92706
  this.addEntryCaller(m, r), m.addCall(this, r);
92656
92707
  else
@@ -92702,7 +92753,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92702
92753
  if (this.initialData.parent) {
92703
92754
  const e = te(
92704
92755
  this.initialData.parent
92705
- ), f = this.project.get(e);
92756
+ ), f = this.project.get(
92757
+ e
92758
+ );
92706
92759
  if (f)
92707
92760
  this.setParent(f, null), i.push(f);
92708
92761
  else
@@ -92710,7 +92763,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92710
92763
  `${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`
92711
92764
  );
92712
92765
  } else
92713
- throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
92766
+ throw new Error(
92767
+ `${this.type} with id '${this.id}' must have a 'parent'`
92768
+ );
92714
92769
  if (this.initialData.readsValue) {
92715
92770
  const e = te(
92716
92771
  this.initialData.readsValue
@@ -92720,7 +92775,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92720
92775
  f && (this.setValueWriter(f, null), i.push(f));
92721
92776
  }
92722
92777
  return this.initialData.calledByEntry.forEach((e) => {
92723
- const f = te(e), h = this.project.get(f);
92778
+ const f = te(e), h = this.project.get(
92779
+ f
92780
+ );
92724
92781
  h && this.addEntryCaller(h, null);
92725
92782
  }), this.initialData.calledBySuccess.forEach((e) => {
92726
92783
  const f = te(e), h = this.project.get(
@@ -92733,9 +92790,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92733
92790
  );
92734
92791
  h && this.addErrorCaller(h, null);
92735
92792
  }), {
92736
- updated: C(i),
92737
- added: C(r),
92738
- removed: C(a),
92793
+ updated: C(
92794
+ i
92795
+ ),
92796
+ added: C(
92797
+ r
92798
+ ),
92799
+ removed: C(
92800
+ a
92801
+ ),
92739
92802
  affected: C(
92740
92803
  c
92741
92804
  ),
@@ -92766,7 +92829,11 @@ Specifically for return statements the parent needs to always be the 'function-d
92766
92829
  self: this
92767
92830
  };
92768
92831
  const r = [], a = [], c = [], e = [];
92769
- if (this.initialized = !0, !this.dataType || this.dataType.inferred, this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id)) {
92832
+ if (this.initialized = !0, !this.dataType || this.dataType.inferred, this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(
92833
+ this.defaultValue.id
92834
+ ) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(
92835
+ this.defaultValue.id
92836
+ )) {
92770
92837
  const E = this.defaultValue.clone(i, this);
92771
92838
  this.setDefaultValue(E, i);
92772
92839
  }
@@ -92780,9 +92847,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92780
92847
  D.AfterAllChildrenInitialized,
92781
92848
  this.id
92782
92849
  ), {
92783
- updated: C(r),
92784
- added: C(a),
92785
- removed: C(c),
92850
+ updated: C(
92851
+ r
92852
+ ),
92853
+ added: C(
92854
+ a
92855
+ ),
92856
+ removed: C(
92857
+ c
92858
+ ),
92786
92859
  affected: C(
92787
92860
  e
92788
92861
  ),
@@ -92811,9 +92884,15 @@ Specifically for return statements the parent needs to always be the 'function-d
92811
92884
  }), this.parent.addReturnStatement(this), e.push(this.parent), i == null || i.add(this.parent, W.Affected), (f = this.parent) == null || f.returnStatements.forEach((h) => {
92812
92885
  h.id !== this.id && (e.push(h), i == null || i.add(h, W.Affected));
92813
92886
  }), this.subscribe(), this.subscribeToDependencies(), i == null || i.attemptAutoclose("add-self-to-project", this.id), {
92814
- updated: C(r),
92815
- added: C(a),
92816
- removed: C(c),
92887
+ updated: C(
92888
+ r
92889
+ ),
92890
+ added: C(
92891
+ a
92892
+ ),
92893
+ removed: C(
92894
+ c
92895
+ ),
92817
92896
  affected: C(
92818
92897
  e
92819
92898
  ),
@@ -92851,7 +92930,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92851
92930
  owner: this,
92852
92931
  errorReason: Be.CannotSuccessCallItself,
92853
92932
  rootAction: ((c = r == null ? void 0 : r.self) == null ? void 0 : c.id) === this.id && (r == null ? void 0 : r.actionName) === D.AddSuccessCaller
92854
- })), this.calledBySuccess.find((e) => e.id === i.id) || (this.calledBySuccess.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(D.AddSuccessCaller, this.id), this) : this;
92933
+ })), this.calledBySuccess.find((e) => e.id === i.id) || (this.calledBySuccess.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(
92934
+ D.AddSuccessCaller,
92935
+ this.id
92936
+ ), this) : this;
92855
92937
  }
92856
92938
  addErrorCaller(i, r = this.project.addChangeSet(
92857
92939
  new Z(
@@ -92875,7 +92957,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92875
92957
  owner: this,
92876
92958
  errorReason: Be.CannotErrorCallItself,
92877
92959
  rootAction: ((c = r == null ? void 0 : r.self) == null ? void 0 : c.id) === this.id && (r == null ? void 0 : r.actionName) === D.AddErrorCaller
92878
- })), this.calledByError.find((e) => e.id === i.id) || (this.calledByError.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(D.AddErrorCaller, this.id), this) : this;
92960
+ })), this.calledByError.find((e) => e.id === i.id) || (this.calledByError.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(
92961
+ D.AddErrorCaller,
92962
+ this.id
92963
+ ), this) : this;
92879
92964
  }
92880
92965
  addEntryCaller(i, r = this.project.addChangeSet(
92881
92966
  new Z(
@@ -92899,7 +92984,10 @@ Specifically for return statements the parent needs to always be the 'function-d
92899
92984
  owner: this,
92900
92985
  errorReason: Be.CannotEntryCallItself,
92901
92986
  rootAction: ((c = r == null ? void 0 : r.self) == null ? void 0 : c.id) === this.id && (r == null ? void 0 : r.actionName) === D.AddEntryCaller
92902
- })), this.calledByEntry.find((e) => e.id === i.id) || (this.calledByEntry.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(D.AddEntryCaller, this.id), this) : this;
92987
+ })), this.calledByEntry.find((e) => e.id === i.id) || (this.calledByEntry.push(i), r == null || r.add(this, W.Updated), a && Rt(this, r)), r == null || r.attemptAutoclose(
92988
+ D.AddEntryCaller,
92989
+ this.id
92990
+ ), this) : this;
92903
92991
  }
92904
92992
  removeCaller(i, r = this.project.addChangeSet(
92905
92993
  new Z(
@@ -92967,7 +93055,9 @@ Specifically for return statements the parent needs to always be the 'function-d
92967
93055
  return ce.warn(
92968
93056
  `[removeOutput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
92969
93057
  ), r == null || r.attemptAutoclose("remove-output", this.id), this;
92970
- const a = this.outputs.findIndex((c) => c.id === i.id);
93058
+ const a = this.outputs.findIndex(
93059
+ (c) => c.id === i.id
93060
+ );
92971
93061
  return a > -1 && (this.outputs.splice(a, 1), r && (r == null || r.add(this, W.Affected))), r == null || r.attemptAutoclose("remove-output", this.id), this;
92972
93062
  }
92973
93063
  setParent(i, r = this.project.addChangeSet(
@@ -93009,7 +93099,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93009
93099
  owner: this,
93010
93100
  errorReason: Be.CannotValueWriteItself,
93011
93101
  rootAction: ((a = r == null ? void 0 : r.self) == null ? void 0 : a.id) === this.id && (r == null ? void 0 : r.actionName) === D.SetValueWriter
93012
- })), ((c = this.readsValue) == null ? void 0 : c.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((e = this.defaultValue) == null || e.remove({ ignoreUpstream: !1 }, r)), this.readsValue && ((f = this.throws) == null || f.remove({ ignoreUpstream: !1 }, r), this.setThrows(null, r)), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(D.SetValueWriter, this.id), this) : this;
93102
+ })), ((c = this.readsValue) == null ? void 0 : c.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((e = this.defaultValue) == null || e.remove({ ignoreUpstream: !1 }, r)), this.readsValue && ((f = this.throws) == null || f.remove({ ignoreUpstream: !1 }, r), this.setThrows(null, r)), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(
93103
+ D.SetValueWriter,
93104
+ this.id
93105
+ ), this) : this;
93013
93106
  }
93014
93107
  removeValueWriter(i = this.project.addChangeSet(
93015
93108
  new Z(
@@ -93025,7 +93118,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93025
93118
  this,
93026
93119
  D.RemoveValueWriter,
93027
93120
  i
93028
- ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(D.RemoveValueWriter, this.id), this);
93121
+ ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(
93122
+ D.RemoveValueWriter,
93123
+ this.id
93124
+ ), this);
93029
93125
  }
93030
93126
  initChildren(i = this.project.addChangeSet(
93031
93127
  new Z(
@@ -93138,10 +93234,19 @@ Specifically for return statements the parent needs to always be the 'function-d
93138
93234
  self: this
93139
93235
  };
93140
93236
  const r = [], a = [], c = [], e = [];
93141
- return this.parent.removeReturnStatement(this), e.push(this.parent), i == null || i.attemptAutoclose(D.RemoveFromParent, this.id), {
93142
- added: C(c),
93143
- updated: C(r),
93144
- removed: C(a),
93237
+ return this.parent.removeReturnStatement(this), e.push(this.parent), i == null || i.attemptAutoclose(
93238
+ D.RemoveFromParent,
93239
+ this.id
93240
+ ), {
93241
+ added: C(
93242
+ c
93243
+ ),
93244
+ updated: C(
93245
+ r
93246
+ ),
93247
+ removed: C(
93248
+ a
93249
+ ),
93145
93250
  affected: C(
93146
93251
  e
93147
93252
  ),
@@ -93175,7 +93280,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93175
93280
  owner: this,
93176
93281
  errorReason: Be.ActionOwnerEntityNonDeletable,
93177
93282
  rootAction: ((h = r == null ? void 0 : r.self) == null ? void 0 : h.id) === this.id && (r == null ? void 0 : r.actionName) === D.RemoveEntity
93178
- }), r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
93283
+ }), r == null || r.attemptAutoclose(
93284
+ D.RemoveEntity,
93285
+ this.id
93286
+ ), {
93179
93287
  added: [],
93180
93288
  updated: [],
93181
93289
  removed: [],
@@ -93184,7 +93292,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93184
93292
  };
93185
93293
  const a = [], c = [], e = [], f = [];
93186
93294
  if (r != null && r.hasRemoved(this.id))
93187
- return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
93295
+ return r == null || r.attemptAutoclose(
93296
+ D.RemoveEntity,
93297
+ this.id
93298
+ ), {
93188
93299
  added: [],
93189
93300
  updated: [],
93190
93301
  removed: [],
@@ -93237,9 +93348,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93237
93348
  return r == null || r.add(this.parent, W.Affected), (m = this.parent) == null || m.returnStatements.forEach((b) => {
93238
93349
  b.id !== this.id && (f.push(b), r == null || r.add(b, W.Affected));
93239
93350
  }), r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
93240
- added: C(e),
93241
- updated: C(a),
93242
- removed: C(c),
93351
+ added: C(
93352
+ e
93353
+ ),
93354
+ updated: C(
93355
+ a
93356
+ ),
93357
+ removed: C(
93358
+ c
93359
+ ),
93243
93360
  affected: C(
93244
93361
  f
93245
93362
  ),
@@ -93262,10 +93379,28 @@ Specifically for return statements the parent needs to always be the 'function-d
93262
93379
  if (!this.checkCanEdit(this, i))
93263
93380
  return ce.warn(
93264
93381
  `[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
93265
- ), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
93382
+ ), i == null || i.attemptAutoclose(
93383
+ D.RestoreEntity,
93384
+ this.id
93385
+ ), {
93386
+ added: [],
93387
+ updated: [],
93388
+ removed: [],
93389
+ affected: [],
93390
+ self: this
93391
+ };
93266
93392
  const r = [], a = [], c = [], e = [];
93267
93393
  if (i != null && i.hasAdded(this.id))
93268
- return i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
93394
+ return i == null || i.attemptAutoclose(
93395
+ D.RestoreEntity,
93396
+ this.id
93397
+ ), {
93398
+ added: [],
93399
+ updated: [],
93400
+ removed: [],
93401
+ affected: [],
93402
+ self: this
93403
+ };
93269
93404
  if (this.subscribe(), this.project.unsubscribeDeletedInstance(this), this.metaSync({ deleted: !1 }, i), Object.values(this.detachedDependents).forEach((f) => {
93270
93405
  const {
93271
93406
  updated: h,
@@ -93295,9 +93430,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93295
93430
  }), this.calledByEntry.forEach((f) => {
93296
93431
  a.push(f), f.addCall(this, i);
93297
93432
  }), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), {
93298
- added: C(r),
93299
- updated: C(a),
93300
- removed: C(c),
93433
+ added: C(
93434
+ r
93435
+ ),
93436
+ updated: C(
93437
+ a
93438
+ ),
93439
+ removed: C(
93440
+ c
93441
+ ),
93301
93442
  affected: C(
93302
93443
  e
93303
93444
  ),
@@ -93349,14 +93490,20 @@ Specifically for return statements the parent needs to always be the 'function-d
93349
93490
  deletable: this.deletable,
93350
93491
  x: this.x,
93351
93492
  y: this.y,
93352
- defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(i)) || null,
93493
+ defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(
93494
+ i
93495
+ )) || null,
93353
93496
  dataType: ((a = this.dataType) == null ? void 0 : a.toJSON(i)) || null,
93354
93497
  readsValue: ((c = this.readsValue) == null ? void 0 : c.toReference()) || null,
93355
93498
  calledBySuccess: this.calledBySuccess.map(
93356
93499
  (h) => h.toReference()
93357
93500
  ),
93358
- calledByError: this.calledByError.map((h) => h.toReference()),
93359
- calledByEntry: this.calledByEntry.map((h) => h.toReference()),
93501
+ calledByError: this.calledByError.map(
93502
+ (h) => h.toReference()
93503
+ ),
93504
+ calledByEntry: this.calledByEntry.map(
93505
+ (h) => h.toReference()
93506
+ ),
93360
93507
  outputs: this.outputs.map(
93361
93508
  (h) => h.toJSON(i)
93362
93509
  ),
@@ -93367,7 +93514,11 @@ Specifically for return statements the parent needs to always be the 'function-d
93367
93514
  toJSONClone(i = lt) {
93368
93515
  var a, c, e, f, h, m, b, E, A, _;
93369
93516
  let r;
93370
- return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(this, this.project, i.uuidStrategy), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
93517
+ return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(
93518
+ this,
93519
+ this.project,
93520
+ i.uuidStrategy
93521
+ ), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
93371
93522
  id: r,
93372
93523
  version: x.UUID.uuid(),
93373
93524
  createdAt: i.timestamp || G().toISOString(),
@@ -93405,7 +93556,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93405
93556
  newId: null
93406
93557
  })
93407
93558
  ),
93408
- parent: ((A = this.parent) == null ? void 0 : A.toReference({ seenEntityMaps: i.seenEntityMaps })) || null,
93559
+ parent: ((A = this.parent) == null ? void 0 : A.toReference({
93560
+ seenEntityMaps: i.seenEntityMaps
93561
+ })) || null,
93409
93562
  throws: ((_ = this.throws) == null ? void 0 : _.toJSONClone({
93410
93563
  ...i,
93411
93564
  newId: null
@@ -93463,7 +93616,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93463
93616
  this.toShallowJSON(),
93464
93617
  ...((a = this.defaultValue) == null ? void 0 : a.toFlatJSON(i)) || [],
93465
93618
  ...((c = this.dataType) == null ? void 0 : c.toFlatJSON(i)) || [],
93466
- ...this.outputs.flatMap((e) => e.toFlatJSON(i)),
93619
+ ...this.outputs.flatMap(
93620
+ (e) => e.toFlatJSON(i)
93621
+ ),
93467
93622
  ...this.throws ? this.throws.toFlatJSON(i) : []
93468
93623
  ]);
93469
93624
  }
@@ -93525,7 +93680,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93525
93680
  a.push(...c);
93526
93681
  }
93527
93682
  if (this.dataType) {
93528
- const c = await this.dataType.getErrorsAsync({ tracker: r });
93683
+ const c = await this.dataType.getErrorsAsync({
93684
+ tracker: r
93685
+ });
93529
93686
  a.push(...c);
93530
93687
  }
93531
93688
  for (const c of this.outputs) {
@@ -93560,7 +93717,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93560
93717
  ), r == null || r.attemptAutoclose("set-default-value", this.id), this;
93561
93718
  const a = this.defaultValue;
93562
93719
  if ((a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id)) {
93563
- if (a == null || a.remove({ ignoreUpstream: !0 }, r), this.defaultValue = i, this.defaultValue) {
93720
+ if (a == null || a.remove(
93721
+ { ignoreUpstream: !0 },
93722
+ r
93723
+ ), this.defaultValue = i, this.defaultValue) {
93564
93724
  const c = this.readsValue;
93565
93725
  this.removeValueWriter(r), c == null || c.removeValueReader(this, r);
93566
93726
  }
@@ -93642,11 +93802,17 @@ Specifically for return statements the parent needs to always be the 'function-d
93642
93802
  };
93643
93803
  const r = [], a = [], c = [], e = [], f = this.getDataType(null);
93644
93804
  return f && !f.isObject() ? [...this.outputs].forEach((m) => {
93645
- const b = m.remove({ ignoreUpstream: !1 }, i);
93805
+ const b = m.remove(
93806
+ { ignoreUpstream: !1 },
93807
+ i
93808
+ );
93646
93809
  c.push(...b.removed), r.push(...b.updated);
93647
93810
  }) : f && f.hasStrictObjectStructure() && [...this.outputs].forEach((m) => {
93648
93811
  if (!m.declaration) {
93649
- const E = m.remove({ ignoreUpstream: !1 }, i);
93812
+ const E = m.remove(
93813
+ { ignoreUpstream: !1 },
93814
+ i
93815
+ );
93650
93816
  c.push(...E.removed), r.push(...E.updated);
93651
93817
  return;
93652
93818
  }
@@ -93660,7 +93826,10 @@ Specifically for return statements the parent needs to always be the 'function-d
93660
93826
  )) || ((N = m.declaration.extends) == null ? void 0 : N.id) == E.id;
93661
93827
  }
93662
93828
  )) {
93663
- const E = m.remove({ ignoreUpstream: !1 }, i);
93829
+ const E = m.remove(
93830
+ { ignoreUpstream: !1 },
93831
+ i
93832
+ );
93664
93833
  c.push(...E.removed), r.push(...E.updated);
93665
93834
  }
93666
93835
  }), this.outputs.filter((m, b) => {
@@ -93678,9 +93847,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93678
93847
  D.RemoveUnrecognizedInputs,
93679
93848
  this.id
93680
93849
  ), {
93681
- updated: C(r),
93682
- added: C(a),
93683
- removed: C(c),
93850
+ updated: C(
93851
+ r
93852
+ ),
93853
+ added: C(
93854
+ a
93855
+ ),
93856
+ removed: C(
93857
+ c
93858
+ ),
93684
93859
  affected: C(
93685
93860
  e
93686
93861
  ),
@@ -93717,7 +93892,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93717
93892
  updated: C(
93718
93893
  r
93719
93894
  ),
93720
- added: C(a),
93895
+ added: C(
93896
+ a
93897
+ ),
93721
93898
  removed: C(
93722
93899
  c
93723
93900
  ),
@@ -93781,7 +93958,9 @@ Specifically for return statements the parent needs to always be the 'function-d
93781
93958
  updated: C(
93782
93959
  r
93783
93960
  ),
93784
- added: C(a),
93961
+ added: C(
93962
+ a
93963
+ ),
93785
93964
  removed: C(
93786
93965
  c
93787
93966
  ),
@@ -93804,9 +93983,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93804
93983
  } = E.afterAllChildrenInitialized(i);
93805
93984
  r.push(...A), a.push(..._), c.push(...N);
93806
93985
  }), this.outputs.sort((E, A) => E.index - A.index), i == null || i.attemptAutoclose("sync-returned-inputs", this.id), {
93807
- updated: C(r),
93808
- added: C(a),
93809
- removed: C(c),
93986
+ updated: C(
93987
+ r
93988
+ ),
93989
+ added: C(
93990
+ a
93991
+ ),
93992
+ removed: C(
93993
+ c
93994
+ ),
93810
93995
  affected: C(
93811
93996
  e
93812
93997
  ),
@@ -93826,9 +94011,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93826
94011
  if (!this.checkCanEdit(this, r))
93827
94012
  return ce.warn(
93828
94013
  `[setDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
93829
- ), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
94014
+ ), r == null || r.attemptAutoclose(
94015
+ D.SetDataType,
94016
+ this.id
94017
+ ), this;
93830
94018
  const a = this.dataType;
93831
- return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove({ ignoreUpstream: !0 }, r), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
94019
+ return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove(
94020
+ { ignoreUpstream: !0 },
94021
+ r
94022
+ ), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
93832
94023
  }
93833
94024
  removeDataType(i = this.project.addChangeSet(
93834
94025
  new Z(
@@ -93840,9 +94031,15 @@ Specifically for return statements the parent needs to always be the 'function-d
93840
94031
  D.RemoveDataType
93841
94032
  )
93842
94033
  )) {
93843
- return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this) : (ce.warn(
94034
+ return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(
94035
+ D.RemoveDataType,
94036
+ this.id
94037
+ ), this) : (ce.warn(
93844
94038
  `[removeDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
93845
- ), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this);
94039
+ ), i == null || i.attemptAutoclose(
94040
+ D.RemoveDataType,
94041
+ this.id
94042
+ ), this);
93846
94043
  }
93847
94044
  getDataType(i = this.project.addChangeSet(
93848
94045
  new Z(
@@ -139857,12 +140054,16 @@ const Ci = class Ci extends an {
139857
140054
  );
139858
140055
  let h = null;
139859
140056
  if (i.declaration) {
139860
- const A = te(i.declaration);
140057
+ const A = te(
140058
+ i.declaration
140059
+ );
139861
140060
  h = r.get(A);
139862
140061
  }
139863
140062
  let m = null;
139864
140063
  if (i.readsValue) {
139865
- const A = te(i.readsValue);
140064
+ const A = te(
140065
+ i.readsValue
140066
+ );
139866
140067
  m = r.get(
139867
140068
  A
139868
140069
  );
@@ -139904,7 +140105,10 @@ const Ci = class Ci extends an {
139904
140105
  {
139905
140106
  parent: {
139906
140107
  list: !1,
139907
- types: [...Vt, ...Ot]
140108
+ types: [
140109
+ ...Vt,
140110
+ ...Ot
140111
+ ]
139908
140112
  }
139909
140113
  },
139910
140114
  r
@@ -139961,9 +140165,11 @@ Only 'function-call', 'search' and 'internal-call' entities can have input-maps
139961
140165
  The parent entity of type '${h.type}' with id '${h.id}' is not compatible with this type of declaration.
139962
140166
  Only variables or terminations ('${It([...kt, ...Ot], "', '", "' or '")}') can have input-maps whose 'declaration' points to 'property' entities.`
139963
140167
  })
139964
- ) : h && m.type === d.ValueDescriptor && ![d.Condition, d.Operation, d.Loop].includes(
139965
- h.type
139966
- ) && e.push(
140168
+ ) : h && m.type === d.ValueDescriptor && ![
140169
+ d.Condition,
140170
+ d.Operation,
140171
+ d.Loop
140172
+ ].includes(h.type) && e.push(
139967
140173
  new De({
139968
140174
  id: `${a.id}--${Te.InvalidInputMapDeclaration}`,
139969
140175
  code: Te.InvalidInputMapDeclaration,
@@ -139996,7 +140202,11 @@ This is because a dynamically assembled object can have new properties added to
139996
140202
  severity: ve.Error,
139997
140203
  message: `Entity of type '${d.InputMap}' with id '${a.id}' has a 'declaration' property that points to an entity with id '${a.declaration}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`
139998
140204
  })
139999
- ) : (![...kt, ...Ot].includes(h.type) || [...kt, ...Ot].includes(h.type) && !((A = h.getDataType(null)) != null && A.canModifyObjectStructure())) && e.push(
140205
+ ) : (![...kt, ...Ot].includes(
140206
+ h.type
140207
+ ) || [...kt, ...Ot].includes(
140208
+ h.type
140209
+ ) && !((A = h.getDataType(null)) != null && A.canModifyObjectStructure())) && e.push(
140000
140210
  new De({
140001
140211
  id: `${a.id}--${Te.InvalidInputMapDeclaration}`,
140002
140212
  code: Te.InvalidInputMapDeclaration,
@@ -140033,7 +140243,9 @@ This means it can hold a function-call or operation as its value, to be executed
140033
140243
  Input maps can only be added to variables which hold an entity with properties.`
140034
140244
  })
140035
140245
  );
140036
- else if (U && !(M != null && M.inferred) && !U.properties.find((se) => se.id === m.id)) {
140246
+ else if (U && !(M != null && M.inferred) && !U.properties.find(
140247
+ (se) => se.id === m.id
140248
+ )) {
140037
140249
  const se = U.properties;
140038
140250
  let re = `
140039
140251
  The parent ${h.type} has a data-type that references an entity with `;
@@ -140069,7 +140281,9 @@ This means it can hold a function-call or operation as its value, to be executed
140069
140281
  Input maps can only be added to variables which hold an entity with properties.`
140070
140282
  })
140071
140283
  );
140072
- else if (U && !(M != null && M.inferred) && !U.properties.find((se) => se.id === m.id)) {
140284
+ else if (U && !(M != null && M.inferred) && !U.properties.find(
140285
+ (se) => se.id === m.id
140286
+ )) {
140073
140287
  const se = U.properties;
140074
140288
  let re = `
140075
140289
  The parent ${h.type} has a data-type that references an entity with `;
@@ -140114,7 +140328,10 @@ ${U}`
140114
140328
  const E = sn(
140115
140329
  a
140116
140330
  );
140117
- return e.push(...f.errors, ...E.errors), c.push(...E.explanations), {
140331
+ return e.push(
140332
+ ...f.errors,
140333
+ ...E.errors
140334
+ ), c.push(...E.explanations), {
140118
140335
  errors: e,
140119
140336
  explanations: c,
140120
140337
  modifiedData: a
@@ -140171,9 +140388,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140171
140388
  const h = f.entity.afterAllChildrenInitialized(i);
140172
140389
  r.push(...h.updated), a.push(...h.added), c.push(...h.removed), e.push(...h.affected);
140173
140390
  }), i == null || i.attemptAutoclose("sync-dependents", this.id), {
140174
- updated: C(r),
140175
- added: C(a),
140176
- removed: C(c),
140391
+ updated: C(
140392
+ r
140393
+ ),
140394
+ added: C(
140395
+ a
140396
+ ),
140397
+ removed: C(
140398
+ c
140399
+ ),
140177
140400
  affected: C(
140178
140401
  e
140179
140402
  ),
@@ -140193,9 +140416,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140193
140416
  c.push(...m), e.push(...b), f.push(...E);
140194
140417
  }
140195
140418
  return {
140196
- updated: C(c),
140197
- added: C(e),
140198
- removed: C(f),
140419
+ updated: C(
140420
+ c
140421
+ ),
140422
+ added: C(
140423
+ e
140424
+ ),
140425
+ removed: C(
140426
+ f
140427
+ ),
140199
140428
  affected: C(
140200
140429
  h
140201
140430
  ),
@@ -140215,9 +140444,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140215
140444
  c.push(...m), e.push(...b), f.push(...E);
140216
140445
  }
140217
140446
  return {
140218
- updated: C(c),
140219
- added: C(e),
140220
- removed: C(f),
140447
+ updated: C(
140448
+ c
140449
+ ),
140450
+ added: C(
140451
+ e
140452
+ ),
140453
+ removed: C(
140454
+ f
140455
+ ),
140221
140456
  affected: C(
140222
140457
  h
140223
140458
  ),
@@ -140295,7 +140530,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140295
140530
  return this.knownVersions = this.knownVersions ? this.knownVersions.set(this.version, i) : (/* @__PURE__ */ new Map()).set(this.version, i), this.apply(i), this;
140296
140531
  }
140297
140532
  snapshot() {
140298
- const i = new Ci(this, this.project);
140533
+ const i = new Ci(
140534
+ this,
140535
+ this.project
140536
+ );
140299
140537
  return this.apply(i);
140300
140538
  }
140301
140539
  /**
@@ -140318,9 +140556,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140318
140556
  r.push(this.parent, ...f.updated), a.push(...f.added), c.push(...f.removed);
140319
140557
  }
140320
140558
  return {
140321
- updated: C(r),
140322
- added: C(a),
140323
- removed: C(c),
140559
+ updated: C(
140560
+ r
140561
+ ),
140562
+ added: C(
140563
+ a
140564
+ ),
140565
+ removed: C(
140566
+ c
140567
+ ),
140324
140568
  affected: C(
140325
140569
  e
140326
140570
  ),
@@ -140343,7 +140587,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140343
140587
  updated: C(
140344
140588
  a
140345
140589
  ),
140346
- added: C(c),
140590
+ added: C(
140591
+ c
140592
+ ),
140347
140593
  removed: C(
140348
140594
  e
140349
140595
  ),
@@ -140379,9 +140625,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140379
140625
  );
140380
140626
  }
140381
140627
  return this.metaSync(h.toShallowJSON(), null), this.previousVersion = h.previousVersion, this.version = h.version, this.createdAt = h.createdAt, this.author = h.author, this.deleted = h.deleted, this.declaration = h.declaration, this.defaultValue = h.defaultValue, this.readsValue = h.readsValue, this.dataType = h.dataType, this.parent = h.parent, {
140382
- updated: C(a),
140383
- added: C(c),
140384
- removed: C(e),
140628
+ updated: C(
140629
+ a
140630
+ ),
140631
+ added: C(
140632
+ c
140633
+ ),
140634
+ removed: C(
140635
+ e
140636
+ ),
140385
140637
  affected: C(
140386
140638
  f
140387
140639
  ),
@@ -140422,7 +140674,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140422
140674
  throw r == null || r.attemptAutoclose(
140423
140675
  D.UpdateWithShallowTransfer,
140424
140676
  this.id
140425
- ), new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
140677
+ ), new Error(
140678
+ `${this.type} with id '${this.id}' must have a 'parent'`
140679
+ );
140426
140680
  if (i.readsValue) {
140427
140681
  const a = te(
140428
140682
  i.readsValue
@@ -140440,7 +140694,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140440
140694
  } else
140441
140695
  this.setDeclaration(null, r);
140442
140696
  if (i.dataType) {
140443
- const a = te(i.dataType), c = this.project.get(a);
140697
+ const a = te(
140698
+ i.dataType
140699
+ ), c = this.project.get(a);
140444
140700
  c && this.setDataType(c, r);
140445
140701
  } else
140446
140702
  this.setDataType(null, r);
@@ -140535,7 +140791,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140535
140791
  `${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`
140536
140792
  );
140537
140793
  } else
140538
- throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);
140794
+ throw new Error(
140795
+ `${this.type} with id '${this.id}' must have a 'parent'`
140796
+ );
140539
140797
  if (this.initialData.readsValue) {
140540
140798
  const e = te(
140541
140799
  this.initialData.readsValue
@@ -140551,9 +140809,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140551
140809
  f && (this.setDeclaration(f, null), i.push(f));
140552
140810
  }
140553
140811
  return {
140554
- updated: C(i),
140555
- added: C(r),
140556
- removed: C(a),
140812
+ updated: C(
140813
+ i
140814
+ ),
140815
+ added: C(
140816
+ r
140817
+ ),
140818
+ removed: C(
140819
+ a
140820
+ ),
140557
140821
  affected: C(
140558
140822
  c
140559
140823
  ),
@@ -140590,11 +140854,20 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140590
140854
  const h = (Ot.includes(this.parent.type) ? this.parent.outputs : this.parent.inputs).filter((V) => !V.deleted && V.id !== this.id);
140591
140855
  h.length && (f > h.length + 1 ? f = h.length : f < 0 && (f = 0)), h.find(
140592
140856
  (V) => (V.index || 0) === f && !V.deleted
140593
- ) && h.filter((V) => (V.index || 0) >= f && !V.deleted).forEach((V) => {
140594
- V.metaSync({ index: (V.index || 0) + 1 }, i), i == null || i.add(V, W.Updated), r.push(V);
140857
+ ) && h.filter(
140858
+ (V) => (V.index || 0) >= f && !V.deleted
140859
+ ).forEach((V) => {
140860
+ V.metaSync(
140861
+ { index: (V.index || 0) + 1 },
140862
+ i
140863
+ ), i == null || i.add(V, W.Updated), r.push(V);
140595
140864
  });
140596
140865
  const b = this.parent.type === d.VariableInstance && ((A = this.declaration) == null ? void 0 : A.type) === d.Property && ((_ = this.declaration) == null ? void 0 : _.constant);
140597
- if (b && this.readsValue && (this.readsValue.removeValueReader(this, i), this.removeValueWriter(i)), b && this.defaultValue && this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(this.defaultValue.id)) {
140866
+ if (b && this.readsValue && (this.readsValue.removeValueReader(this, i), this.removeValueWriter(i)), b && this.defaultValue && this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.readsValue && this.defaultValue && (this.project.diggestedBuiltInBaseEntitiesIds.has(
140867
+ this.defaultValue.id
140868
+ ) || this.defaultValue.remove({ ignoreUpstream: !1 }, i), this.setDefaultValue(null, i)), this.defaultValue && !this.readsValue && !this.project.diggestedBuiltInBaseEntitiesIds.has(this.id) && this.project.diggestedBuiltInBaseEntitiesIds.has(
140869
+ this.defaultValue.id
140870
+ )) {
140598
140871
  const V = this.defaultValue.clone(i, this);
140599
140872
  this.setDefaultValue(V, i);
140600
140873
  }
@@ -140613,9 +140886,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140613
140886
  D.AfterAllChildrenInitialized,
140614
140887
  this.id
140615
140888
  ), {
140616
- updated: C(r),
140617
- added: C(a),
140618
- removed: C(c),
140889
+ updated: C(
140890
+ r
140891
+ ),
140892
+ added: C(
140893
+ a
140894
+ ),
140895
+ removed: C(
140896
+ c
140897
+ ),
140619
140898
  affected: C(
140620
140899
  e
140621
140900
  ),
@@ -140635,13 +140914,25 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140635
140914
  )) {
140636
140915
  var f;
140637
140916
  const r = [this], a = [], c = [], e = [];
140638
- return Ot.includes(this.parent.type) ? this.parentRelationType === Fd.Error ? this.parent.setThrows(this, i) : this.parent.addOutput(this, i) : this.parent.addInput(
140917
+ return Ot.includes(this.parent.type) ? this.parentRelationType === Fd.Error ? this.parent.setThrows(
140918
+ this,
140919
+ i
140920
+ ) : this.parent.addOutput(
140921
+ this,
140922
+ i
140923
+ ) : this.parent.addInput(
140639
140924
  this,
140640
140925
  i
140641
140926
  ), e.push(this.parent), (f = this.readsValue) == null || f.addValueReader(this, i), this.readsValue && r.push(this.readsValue), this.subscribe(), this.subscribeToDependencies(), i == null || i.attemptAutoclose("add-self-to-project", this.id), {
140642
- updated: C(r),
140643
- added: C(a),
140644
- removed: C(c),
140927
+ updated: C(
140928
+ r
140929
+ ),
140930
+ added: C(
140931
+ a
140932
+ ),
140933
+ removed: C(
140934
+ c
140935
+ ),
140645
140936
  affected: C(
140646
140937
  e
140647
140938
  ),
@@ -140679,9 +140970,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140679
140970
  if (!this.checkCanEdit(this, r))
140680
140971
  return ce.warn(
140681
140972
  `[setDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
140682
- ), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
140973
+ ), r == null || r.attemptAutoclose(
140974
+ D.SetDataType,
140975
+ this.id
140976
+ ), this;
140683
140977
  const a = this.dataType;
140684
- return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove({ ignoreUpstream: !0 }, r), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
140978
+ return (a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id) && (a == null || a.remove(
140979
+ { ignoreUpstream: !0 },
140980
+ r
140981
+ ), this.dataType = i, this.subscribeToDependencies(), r == null || r.add(this, W.Affected)), r == null || r.attemptAutoclose(D.SetDataType, this.id), this;
140685
140982
  }
140686
140983
  removeDataType(i = this.project.addChangeSet(
140687
140984
  new Z(
@@ -140693,9 +140990,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140693
140990
  D.RemoveDataType
140694
140991
  )
140695
140992
  )) {
140696
- return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this) : (ce.warn(
140993
+ return this.checkCanEdit(this, i) ? (this.dataType && (this.dataType.remove({ ignoreUpstream: !0 }, i), i == null || i.add(this, W.Affected), this.dataType = null), i == null || i.attemptAutoclose(
140994
+ D.RemoveDataType,
140995
+ this.id
140996
+ ), this) : (ce.warn(
140697
140997
  `[removeDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
140698
- ), i == null || i.attemptAutoclose(D.RemoveDataType, this.id), this);
140998
+ ), i == null || i.attemptAutoclose(
140999
+ D.RemoveDataType,
141000
+ this.id
141001
+ ), this);
140699
141002
  }
140700
141003
  setDeclaration(i, r = this.project.addChangeSet(
140701
141004
  new Z(
@@ -140756,7 +141059,13 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140756
141059
  counterpart: i,
140757
141060
  errorReason: Be.ValueReadingOverridesConstantVariable,
140758
141061
  rootAction: ((h = r == null ? void 0 : r.self) == null ? void 0 : h.id) === this.id && (r == null ? void 0 : r.actionName) === D.SetValueWriter
140759
- }), r == null || r.attemptAutoclose(D.SetValueWriter, this.id), this) : (((m = this.readsValue) == null ? void 0 : m.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((b = this.defaultValue) == null || b.remove({ ignoreUpstream: !1 }, r), this.parent.type === d.Search && ((E = this.declaration) == null || E.setDefaultValue(null, r))), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(D.SetValueWriter, this.id), this)) : this;
141062
+ }), r == null || r.attemptAutoclose(
141063
+ D.SetValueWriter,
141064
+ this.id
141065
+ ), this) : (((m = this.readsValue) == null ? void 0 : m.id) !== (i == null ? void 0 : i.id) && (this.readsValue = i, this.readsValue && ((b = this.defaultValue) == null || b.remove({ ignoreUpstream: !1 }, r), this.parent.type === d.Search && ((E = this.declaration) == null || E.setDefaultValue(null, r))), r == null || r.add(this, W.Updated)), r == null || r.attemptAutoclose(
141066
+ D.SetValueWriter,
141067
+ this.id
141068
+ ), this)) : this;
140760
141069
  }
140761
141070
  removeValueWriter(i = this.project.addChangeSet(
140762
141071
  new Z(
@@ -140772,7 +141081,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140772
141081
  this,
140773
141082
  D.RemoveValueWriter,
140774
141083
  i
140775
- ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(D.RemoveValueWriter, this.id), this);
141084
+ ) ? this : (this.readsValue && (this.readsValue = null, i == null || i.add(this, W.Updated)), i == null || i.attemptAutoclose(
141085
+ D.RemoveValueWriter,
141086
+ this.id
141087
+ ), this);
140776
141088
  }
140777
141089
  subscribe() {
140778
141090
  var i;
@@ -140856,16 +141168,28 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140856
141168
  self: this
140857
141169
  };
140858
141170
  const r = [], a = [], c = [], e = [];
140859
- return Ot.includes((f = this.parent) == null ? void 0 : f.type) ? this.parentRelationType === Fd.Error ? (this.parent.setThrows(null, i), e.push(this.parent)) : (this.parent.removeOutput(
141171
+ return Ot.includes((f = this.parent) == null ? void 0 : f.type) ? this.parentRelationType === Fd.Error ? (this.parent.setThrows(
141172
+ null,
141173
+ i
141174
+ ), e.push(this.parent)) : (this.parent.removeOutput(
140860
141175
  this,
140861
141176
  i
140862
141177
  ), e.push(this.parent)) : (this.parent.removeInput(
140863
141178
  this,
140864
141179
  i
140865
- ), e.push(this.parent)), i == null || i.attemptAutoclose(D.RemoveFromParent, this.id), {
140866
- added: C(c),
140867
- updated: C(r),
140868
- removed: C(a),
141180
+ ), e.push(this.parent)), i == null || i.attemptAutoclose(
141181
+ D.RemoveFromParent,
141182
+ this.id
141183
+ ), {
141184
+ added: C(
141185
+ c
141186
+ ),
141187
+ updated: C(
141188
+ r
141189
+ ),
141190
+ removed: C(
141191
+ a
141192
+ ),
140869
141193
  affected: C(
140870
141194
  e
140871
141195
  ),
@@ -140891,7 +141215,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140891
141215
  )) {
140892
141216
  var h, m, b, E, A;
140893
141217
  if (this.deleted)
140894
- return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
141218
+ return r == null || r.attemptAutoclose(
141219
+ D.RemoveEntity,
141220
+ this.id
141221
+ ), {
140895
141222
  added: [],
140896
141223
  updated: [],
140897
141224
  removed: [],
@@ -140907,7 +141234,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140907
141234
  owner: this,
140908
141235
  errorReason: Be.ActionOwnerEntityNonDeletable,
140909
141236
  rootAction: ((h = r == null ? void 0 : r.self) == null ? void 0 : h.id) === this.id && (r == null ? void 0 : r.actionName) === D.RemoveEntity
140910
- }), r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
141237
+ }), r == null || r.attemptAutoclose(
141238
+ D.RemoveEntity,
141239
+ this.id
141240
+ ), {
140911
141241
  added: [],
140912
141242
  updated: [],
140913
141243
  removed: [],
@@ -140916,7 +141246,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140916
141246
  };
140917
141247
  const a = [], c = [], e = [], f = [];
140918
141248
  if (r != null && r.hasRemoved(this.id))
140919
- return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
141249
+ return r == null || r.attemptAutoclose(
141250
+ D.RemoveEntity,
141251
+ this.id
141252
+ ), {
140920
141253
  added: [],
140921
141254
  updated: [],
140922
141255
  removed: [],
@@ -140946,15 +141279,25 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140946
141279
  if (this.readsValue && (a.push(this.readsValue), this.readsValue.removeValueReader(this, r)), this.defaultValue && (a.push(this.defaultValue), this.defaultValue.remove({ ignoreUpstream: !0 }, r)), this.declaration) {
140947
141280
  if (
140948
141281
  // If the declaration is a property, aprt of an inferred, dynamic data type entity, we delete the property too
140949
- this.declaration.type === d.Property && ((m = this.declaration.parent) == null ? void 0 : m.type) === d.DefinitionEntity && ((E = (b = this.declaration.parent) == null ? void 0 : b.parent) == null ? void 0 : E.type) === d.DataType && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted
141282
+ this.declaration.type === d.Property && ((m = this.declaration.parent) == null ? void 0 : m.type) === d.DefinitionEntity && ((E = (b = this.declaration.parent) == null ? void 0 : b.parent) == null ? void 0 : E.type) === d.DataType && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted && !this.project.diggestedBuiltInBaseEntitiesIds.has(
141283
+ this.declaration.id
141284
+ )
140950
141285
  ) {
140951
- const { updated: _, removed: N } = this.declaration.remove({ ignoreUpstream: !1 }, r);
141286
+ const { updated: _, removed: N } = this.declaration.remove(
141287
+ { ignoreUpstream: !1 },
141288
+ r
141289
+ );
140952
141290
  a.push(..._), c.push(...N);
140953
141291
  } else if (
140954
141292
  // If the declaraiton if a value-descriptor, part of a search statement, we delete the value-descriptor too
140955
- this.declaration.type === d.ValueDescriptor && ((A = this.declaration.parent) == null ? void 0 : A.type) === d.Search && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted
141293
+ this.declaration.type === d.ValueDescriptor && ((A = this.declaration.parent) == null ? void 0 : A.type) === d.Search && !(r != null && r.hasRemoved(this.declaration.id)) && !this.declaration.deleted && !this.project.diggestedBuiltInBaseEntitiesIds.has(
141294
+ this.declaration.id
141295
+ )
140956
141296
  ) {
140957
- const { updated: _, removed: N } = this.declaration.remove({ ignoreUpstream: !1 }, r);
141297
+ const { updated: _, removed: N } = this.declaration.remove(
141298
+ { ignoreUpstream: !1 },
141299
+ r
141300
+ );
140958
141301
  a.push(..._), c.push(...N);
140959
141302
  }
140960
141303
  }
@@ -140974,9 +141317,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140974
141317
  a.push(..._), e.push(...N), c.push(...V), f.push(...B);
140975
141318
  }
140976
141319
  return r == null || r.attemptAutoclose(D.RemoveEntity, this.id), {
140977
- added: C(e),
140978
- updated: C(a),
140979
- removed: C(c),
141320
+ added: C(
141321
+ e
141322
+ ),
141323
+ updated: C(
141324
+ a
141325
+ ),
141326
+ removed: C(
141327
+ c
141328
+ ),
140980
141329
  affected: C(
140981
141330
  f
140982
141331
  ),
@@ -140999,10 +141348,28 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
140999
141348
  if (!this.checkCanEdit(this, i))
141000
141349
  return ce.warn(
141001
141350
  `[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`
141002
- ), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
141351
+ ), i == null || i.attemptAutoclose(
141352
+ D.RestoreEntity,
141353
+ this.id
141354
+ ), {
141355
+ added: [],
141356
+ updated: [],
141357
+ removed: [],
141358
+ affected: [],
141359
+ self: this
141360
+ };
141003
141361
  const r = [], a = [], c = [], e = [];
141004
141362
  if (i != null && i.hasAdded(this.id))
141005
- return i == null || i.attemptAutoclose(D.RestoreEntity, this.id), { added: [], updated: [], removed: [], affected: [], self: this };
141363
+ return i == null || i.attemptAutoclose(
141364
+ D.RestoreEntity,
141365
+ this.id
141366
+ ), {
141367
+ added: [],
141368
+ updated: [],
141369
+ removed: [],
141370
+ affected: [],
141371
+ self: this
141372
+ };
141006
141373
  if (this.subscribe(), this.project.unsubscribeDeletedInstance(this), this.metaSync({ deleted: !1 }, i), Object.values(this.detachedDependents).forEach((f) => {
141007
141374
  const {
141008
141375
  updated: h,
@@ -141025,9 +141392,15 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141025
141392
  this,
141026
141393
  i
141027
141394
  ), i == null || i.attemptAutoclose(D.RestoreEntity, this.id), {
141028
- added: C(r),
141029
- updated: C(a),
141030
- removed: C(c),
141395
+ added: C(
141396
+ r
141397
+ ),
141398
+ updated: C(
141399
+ a
141400
+ ),
141401
+ removed: C(
141402
+ c
141403
+ ),
141031
141404
  affected: C(
141032
141405
  e
141033
141406
  ),
@@ -141087,9 +141460,13 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141087
141460
  codeName: this.codeName,
141088
141461
  description: this.description,
141089
141462
  parentRelationType: this.parentRelationType,
141090
- defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(i)) || null,
141463
+ defaultValue: ((r = this.defaultValue) == null ? void 0 : r.toJSON(
141464
+ i
141465
+ )) || null,
141091
141466
  dataType: ((a = this.dataType) == null ? void 0 : a.toJSON(i)) || null,
141092
- declaration: ((c = this.declaration) == null ? void 0 : c.toJSON(i)) || null,
141467
+ declaration: ((c = this.declaration) == null ? void 0 : c.toJSON(
141468
+ i
141469
+ )) || null,
141093
141470
  readsValue: ((e = this.readsValue) == null ? void 0 : e.toReference()) || null,
141094
141471
  parent: this.parent.toReference()
141095
141472
  });
@@ -141097,7 +141474,11 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141097
141474
  toJSONClone(i = lt) {
141098
141475
  var a, c, e, f, h, m, b, E, A, _, N, V;
141099
141476
  let r;
141100
- return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(this, this.project, i.uuidStrategy), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
141477
+ return (a = i.seenEntityMaps) != null && a.has(this.id) ? r = i.seenEntityMaps.get(this.id) : (r = i.newId || fn(
141478
+ this,
141479
+ this.project,
141480
+ i.uuidStrategy
141481
+ ), i.seenEntityMaps && i.seenEntityMaps.set(this.id, r)), (c = i.seenEntities) != null && c.has(r) || (e = i.seenEntities) != null && e.has(this.id) ? this.toReference({ seenEntityMaps: i.seenEntityMaps }) : ((f = i.seenEntities) == null || f.add(r), (h = i.seenEntities) == null || h.add(this.id), {
141101
141482
  id: r,
141102
141483
  version: x.UUID.uuid(),
141103
141484
  createdAt: i.timestamp || G().toISOString(),
@@ -141254,7 +141635,10 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
141254
141635
  ), r == null || r.attemptAutoclose("set-default-value", this.id), this;
141255
141636
  const a = this.defaultValue;
141256
141637
  if ((a == null ? void 0 : a.id) !== (i == null ? void 0 : i.id)) {
141257
- if (a == null || a.remove({ ignoreUpstream: !0 }, r), this.defaultValue = i, this.defaultValue) {
141638
+ if (a == null || a.remove(
141639
+ { ignoreUpstream: !0 },
141640
+ r
141641
+ ), this.defaultValue = i, this.defaultValue) {
141258
141642
  const c = this.readsValue;
141259
141643
  this.removeValueWriter(r), c == null || c.removeValueReader(this, r);
141260
141644
  }