@elyx-code/project-logic-tree 0.0.591 → 0.0.593

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
@@ -32499,7 +32499,9 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
32499
32499
  toFlatIds(e = /* @__PURE__ */ new Set()) {
32500
32500
  return e.has(this.id) ? [] : (e.add(this.id), [
32501
32501
  this.id,
32502
- ...this.fixedArguments.flatMap((i) => i.toFlatIds(e)),
32502
+ ...this.fixedArguments.flatMap(
32503
+ (i) => i.toFlatIds(e)
32504
+ ),
32503
32505
  ...this.fixedReturns.flatMap((i) => i.toFlatIds(e)),
32504
32506
  ...this.dynamicArgumentTypes ? this.dynamicArgumentTypes.toFlatIds(e) : [],
32505
32507
  ...this.dynamicReturnTypes ? this.dynamicReturnTypes.toFlatIds(e) : []
@@ -32974,7 +32976,12 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
32974
32976
  return this.fixedReturns = this.fixedReturns.filter((t) => t.id !== e.id), this;
32975
32977
  }
32976
32978
  };
32977
- l(ce, "MUTABLE_BASE_PROPERTIES", ["name", "description", "argumentsType", "returnsType"]), l(ce, "INMUTABLE_BASE_PROPERTIES", ["id", "version", "type"]), l(ce, "BASE_PROPERTIES", [
32979
+ l(ce, "MUTABLE_BASE_PROPERTIES", [
32980
+ "name",
32981
+ "description",
32982
+ "argumentsType",
32983
+ "returnsType"
32984
+ ]), l(ce, "INMUTABLE_BASE_PROPERTIES", ["id", "version", "type"]), l(ce, "BASE_PROPERTIES", [
32978
32985
  ...ce.MUTABLE_BASE_PROPERTIES,
32979
32986
  ...ce.INMUTABLE_BASE_PROPERTIES
32980
32987
  ]), // Includes the base properties and the meta properties
@@ -39816,8 +39823,6 @@ class D9 extends Me {
39816
39823
  l(this, "dynamicReturnTypes", null);
39817
39824
  // Parent project full state
39818
39825
  l(this, "project");
39819
- l(this, "implementation", async () => {
39820
- });
39821
39826
  this.project = t, this.fixedArguments = Lt.fixedArguments.map((i) => {
39822
39827
  const a = E(
39823
39828
  i,
@@ -39837,6 +39842,21 @@ class D9 extends Me {
39837
39842
  this.project
39838
39843
  ) : null;
39839
39844
  }
39845
+ // implementation = async () =>
39846
+ // // project: VisualLanguageCanvasService,
39847
+ // // inputs: [FunctionDeclarationState[]] = [[]]
39848
+ // // ): Promise<any[]> => {
39849
+ // {
39850
+ // // const functions = inputs[0];
39851
+ // // const result = await Promise.all(
39852
+ // // functions.map((func) => {
39853
+ // // // Execute the function and capture its return value
39854
+ // // const execution = new Execution(project, [func], func);
39855
+ // // return execution.execute();
39856
+ // // })
39857
+ // // );
39858
+ // // return [result];
39859
+ // };
39840
39860
  }
39841
39861
  class S9 extends Me {
39842
39862
  constructor(t) {
@@ -39856,14 +39876,6 @@ class S9 extends Me {
39856
39876
  l(this, "dynamicReturnTypes", null);
39857
39877
  // Parent project full state
39858
39878
  l(this, "project");
39859
- l(this, "implementation", async (t = [0]) => {
39860
- const i = t[0];
39861
- return [new Promise((s) => {
39862
- setTimeout(() => {
39863
- s();
39864
- }, i);
39865
- })];
39866
- });
39867
39879
  this.project = t, this.fixedArguments = ct.fixedArguments.map((i) => {
39868
39880
  const a = E(
39869
39881
  i,
@@ -39881,6 +39893,18 @@ class S9 extends Me {
39881
39893
  this.project
39882
39894
  ) : null;
39883
39895
  }
39896
+ // implementation = async (
39897
+ // // _: VisualLanguageCanvasService,
39898
+ // inputs: [number] = [0]
39899
+ // ): Promise<any[]> => {
39900
+ // const milliseconds = inputs[0];
39901
+ // const result = new Promise<void>((resolve) => {
39902
+ // setTimeout(() => {
39903
+ // resolve();
39904
+ // }, milliseconds);
39905
+ // });
39906
+ // return [result];
39907
+ // };
39884
39908
  }
39885
39909
  class A9 extends Me {
39886
39910
  constructor(t) {
@@ -39900,7 +39924,6 @@ class A9 extends Me {
39900
39924
  l(this, "dynamicReturnTypes", null);
39901
39925
  // Parent project full state
39902
39926
  l(this, "project");
39903
- l(this, "implementation", async (t = [[]]) => [[]]);
39904
39927
  this.project = t, this.fixedArguments = ln.fixedArguments.map((i) => {
39905
39928
  const a = E(
39906
39929
  i,
@@ -39920,6 +39943,18 @@ class A9 extends Me {
39920
39943
  this.project
39921
39944
  ) : null;
39922
39945
  }
39946
+ // implementation = async (
39947
+ // _: [FunctionDeclarationState[]] = [[]]
39948
+ // ): Promise<any[]> => {
39949
+ // // const functions = inputs[0];
39950
+ // const results: any[] = [];
39951
+ // // for (const func of functions) {
39952
+ // // const execution = new Execution(project, [func], func);
39953
+ // // const result = await execution.execute();
39954
+ // // results.push(result);
39955
+ // // }
39956
+ // return [results];
39957
+ // };
39923
39958
  }
39924
39959
  function O9(n) {
39925
39960
  const e = [
@@ -359,4 +359,4 @@ If an entity is called by another, they must be in the same scope, which means t
359
359
  You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writters of its inputs, or the value readers of its outputs.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var e;return this.parent===this.project&&this.project.addFunctionCall(this),(e=this.process)==null||e.writesValues.forEach(t=>{t.setValueWriter(this.process)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this)}),this.calledByError.forEach(t=>{t.addErrorCall(this)}),this.calledByEntry.forEach(t=>{t.addCall(this)}),this}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(i=>i.id===e.id);return t>-1&&this.inputs.splice(t,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(i=>i.id===e.id);return t>-1&&this.outputs.splice(t,1),this}addValueReader(e){var t;return(t=this.process)==null||t.addValueReader(e),this}removeValueReader(e){var t;return(t=this.process)==null||t.removeValueReader(e),this}addSuccessCaller(e){return this.calledBySuccess.find(t=>t.id===e.id)||this.calledBySuccess.push(e),this}addErrorCaller(e){return this.calledByError.find(t=>t.id===e.id)||this.calledByError.push(e),this}addEntryCaller(e){return this.calledByEntry.find(t=>t.id===e.id)||this.calledByEntry.push(e),this}addErrorCall(e){return this.errorCalls.push(e),this}addSuccessCall(e){return this.successCalls.push(e),this}removeCall(e){const t=this.successCalls.findIndex(a=>a.id===e.id);t>-1&&this.successCalls.splice(t,1);const i=this.errorCalls.findIndex(a=>a.id===e.id);return i>-1&&this.errorCalls.splice(i,1),this}removeCaller(e){return this.calledBySuccess=this.calledBySuccess.filter(t=>t.id!==e.id),this.calledByError=this.calledByError.filter(t=>t.id!==e.id),this.calledByEntry=this.calledByEntry.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===r.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=D(this.initialData.declaration),t=this.project.get(e);this.declaration=t}return this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initOutputs(),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this}initOutputs(){const e=[];this.outputs=this.initialData.outputs.map(s=>{const o=R(s,this.project);return e.push(o.index),o.setParent(this),o.initChildren(),o});const i=bd(this).filter(s=>!this.outputs.find(o=>o.declaration.id===s.id));i.sort((s,o)=>s.index-o.index);const a=i.map((s,o)=>{const u=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:$.UUID.uuid(),type:r.OutputMap,version:1,declaration:s,index:u,parent:this,writesValues:[]},h=R(p,this.project);return h.setParent(this),h.initChildren(),h});return this.outputs.push(...a),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){var s;const i=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.process){const{affected:o,removed:u}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}if(this.inputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.outputs.forEach(o=>{const{affected:u,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...u),a.push(...p)}),this.error){const{affected:o,removed:u}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}return this.successCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{i.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{i.push(o),o.removeCall(this)}),{affected:S(i),removed:S(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];if(e.has(this.id))return{affected:[],self:this};if(e.add(this.id),this.subscribe(),this.process){const{affected:i}=this.process.restore({seenEntities:e});t.push(...i)}return this.inputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(i=>{t.push(i),i.addSuccessCaller(this)}),this.errorCalls.forEach(i=>{t.push(i),i.addErrorCaller(this)}),this.calledBySuccess.forEach(i=>{t.push(i),i.addSuccessCall(this)}),this.calledByError.forEach(i=>{t.push(i),i.addErrorCall(this)}),this.calledByEntry.forEach(i=>{t.push(i),i.addCall(this)}),{affected:S(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(i=>i.toFlat(e)),...this.errorCalls.flatMap(i=>i.toFlat(e)),...this.inputs.flatMap(i=>i.toFlat(e)),...this.outputs.flatMap(i=>i.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.error?this.error.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.successCalls.flatMap(i=>i.toFlatIds(e)),...this.errorCalls.flatMap(i=>i.toFlatIds(e)),...this.inputs.flatMap(i=>i.toFlatIds(e)),...this.outputs.flatMap(i=>i.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,successCalls:this.successCalls.map(i=>i.toJSON()),errorCalls:this.errorCalls.map(i=>i.toJSON()),calledBySuccess:this.calledBySuccess.map(i=>i.toReference()),calledByError:this.calledByError.map(i=>i.toReference()),calledByEntry:this.calledByEntry.map(i=>i.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(i=>i.toJSON()),outputs:this.outputs.map(i=>i.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,process:this.process?this.process.toReference():null,inputs:this.inputs.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),declaration:this.declaration.toReference(),successCalls:this.successCalls.map(e=>e.toReference()),errorCalls:this.errorCalls.map(e=>e.toReference()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),error:this.error?this.error.toReference():null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.successCalls.flatMap(i=>i.toFlatJSON(e)),...this.errorCalls.flatMap(i=>i.toFlatJSON(e)),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.outputs.flatMap(i=>i.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,version:this.version,type:this.type,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),declaration:this.declaration.id,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.outputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(i=>i.clearErrors()),this.outputs.forEach(i=>i.clearErrors()),this.successCalls.forEach(i=>i.clearErrors()),this.errorCalls.forEach(i=>i.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=N6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new ge(this.toJSON(),this.project)}};l(ge,"MUTABLE_BASE_PROPERTIES",[]),l(ge,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),l(ge,"MUTABLE_META_PROPERTIES",["x","y"]),l(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),l(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),l(ge,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),l(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),l(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),l(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),l(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let Rr=ge;function uv(n){var e,t,i;switch(n.id){case Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=n.project.entities.filter(m=>!!m.implements.find(T=>T.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(m=>!!m.properties.find(T=>{var b;return T.implements&&T.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((b=T.getDefaultValue())==null?void 0:b.value)===!0}))){const T=a[0].properties.find(I=>I.implements&&I.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),b=(e=T==null?void 0:T.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(T!=null&&T.dataType){const I=(t=T==null?void 0:T.dataType)==null?void 0:t.id.split("-id")[0],C=R({id:I+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:T==null?void 0:T.dataType.toReference()},n.project);return C.setParent(T==null?void 0:T.dataType),C.initChildren(),C.addSelfToProject(),{newEntities:[C]}}return{newEntities:[]}}const o=n.project.get(Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),u=ao(o,"Main database");if(u.errors.length>0)return{newEntities:[]};const p=u.implemented.properties.find(m=>m.implements&&m.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),h=(i=p==null?void 0:p.dataType)==null?void 0:i.defaultValue;if(h)h.value=!0;else if(p!=null&&p.dataType){const m=p==null?void 0:p.dataType.id.split("-id")[0],T=R({id:m+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},n.project);T.setParent(p==null?void 0:p.dataType),T.initChildren(),T.addSelfToProject()}return{newEntities:[u.implemented]}}}return{newEntities:[]}}function pv(n){return n.implements.filter(t=>t.type===r.BuiltInBaseEntity).map(t=>{var i;switch(t.id){case Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=n.project.entities.filter(p=>p.implements.find(h=>h.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(h=>{var m;return h.implements&&h.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((m=h.getDefaultValue())==null?void 0:m.value)===!0}));if(!s)return{newEntities:[]};const o=n.properties.find(p=>p.implements&&p.implements.id===Ve["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database),u=(i=o==null?void 0:o.dataType)==null?void 0:i.defaultValue;if(o&&(o!=null&&o.dataType)&&!u){const p=o==null?void 0:o.dataType.id.split("-id")[0],h=R({id:p+"-default-value-id",version:1,type:r.PrimitiveValue,name:g.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},n.project);return h.setParent(o==null?void 0:o.dataType),h.initChildren(),h.addSelfToProject(),{newEntities:[h]}}return{newEntities:[]}}}}),{newEntities:[]}}function ao(n,e,t){const i=t||Xt(e,r.CustomEntity,n.project),a=i.split("-id"),s=a[a.length-1||0]||i,o={id:i,version:1,name:e,type:r.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[n],x:0,y:0,parent:n.project},u=Zs(o,n.project);if(u.length>0)return{errors:u,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=uv(n),h=R(o,n.project);h.setParent(n.project),h.initChildren();const m=n.properties.map(I=>{const C=s+"-"+Xt(A(I,n.project),r.Property,n.project),G=I.clone(h,C);return G.abstract=!1,G.implements=I,G.setParent(h),h.addProperty(G),G}),T=n.abstractMethods.map(I=>{const C=s+Xt(I.name,r.FunctionDeclaration,n.project),G=I.implementAsFunctionDeclaration(C),J={id:C+"-parent-ref-id",type:r.GenericReference,entityId:i,entityType:r.CustomEntity},xt={...G,implements:I,parent:J},Le=R(xt,n.project);return h.addMethod(Le),Le.setParent(h),Le.initChildren(),Le.implements=I,Le});o.properties=m,o.methods=T;const b=pv(h);return{implemented:h,errors:[],entitiesChanges:{new:[h,...p.newEntities,...b.newEntities],updated:[h],deleted:[]}}}function so(n,e){const t=gr(n);if(t.length===0)return{list:[],last:null};let i=null;return{list:t.flatMap(s=>{if(s===e)return i=s,[s];const o=so(s,e);return o.last&&(i=o.last),[s,...o.list]}),last:i}}function yv(n,e,t=new Set){const i=Ln(n),a=Ln(e),s=i.filter(p=>!a.includes(p)),o=i.filter(p=>a.includes(p)),u=s.reduce((p,h)=>t.has(h.id)?p:(t.add(h.id),S([...p,...yv(h,e,t)])),[]);return S([...o,...u])}function ua(n,e){const t=so(n,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function $6(n,e){return!!so(n,e).last}function V6(n){if($e.includes(n.type))return n;if([...En,r.VariableDeclaration].includes(n.type)){const e=n.parent;return $e.includes(e.type)?e:null}return null}function md(n,e){if(!n||!e)throw new Error("Both entities must be defined to find a common ancestor");if(n===e)return n;const t=n.parent;if(t){if(t===e)return e;if(t.type===r.Project)return null}else return null;const i=e.parent;if(i){if(i===n)return n;if(i.type===r.Project)return null}else return null;return md(t,i)}function He(n){if(To.includes(n.type)){if(n.type===r.FunctionDeclaration){const e=n.parent;if(e.type===r.CustomEntity)return e}return n}else{const e=n.parent;return e?He(e):null}}function L6(n){return n.type===r.VariableDeclaration?[n]:Ne.includes(n.type)?[...n.inputs,...n.outputs||[]]:n.type===r.ReturnStatement?n.outputs:Pr.includes(n.type)||n.type===r.FunctionDeclaration?n.inputs:[]}function G6(n){const e=Ln(n),t=[],i=[];Bd.includes(n.type)&&t.push(...Td(n));const a=e.filter(s=>{const o=t.includes(s);return o?!1:En.includes(s.type)&&!o?(i.push(s),!1):!0});return t.sort((s,o)=>ua(o,s)?-1:0),i.sort((s,o)=>ua(o,s)?-1:0),[...t,...i,...a]}function hv(n){return[...n].sort((e,t)=>ua(t,e)?-1:0)}function F6(n){const e=hv(n),t=[];return e.forEach(i=>{const a=t[t.length-1];if(a){const s=a[a.length-1];ua(i,s)?t.push([i]):a.push(i)}else t.push([i])}),t}function _t(n){const e=n.map(t=>He(t));return S(e)}function Td(n){return Ne.includes(n.type)?[..._t(n.successCalls),..._t(n.errorCalls)]:$e.includes(n.type)?_t(n.calls):[]}function U6(n,e){return Td(n).includes(e)}function Ed(n){return n.writesValues||[]}function x6(n,e){return Ed(n).includes(e)}function fv(n){var e;return Fe.includes((e=n==null?void 0:n.readsValue)==null?void 0:e.type)?n.readsValue:null}function j6(n){return n.writesValues}function mv(n=[]){return n.map(fv).filter(e=>!!e)}function oo(n=[]){return n.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function Tv(n=[]){return n.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function Ev(n){return Fe.includes(n.type)?n:null}function Rv(n){return n.writesValues.map(Ev).filter(e=>!!e)}function bv(n=[]){return n.reduce((e,t)=>t.type===r.OutputMap?[...e,...Rv(t)]:e,[])}function Me(n){return Ne.includes(n.type)?[...br(_t(n.successCalls)),...br(_t(n.errorCalls))]:$e.includes(n.type)?br(_t(n.calls)):[]}function gv(n,e=new Set){return n.writesValues.filter(i=>Fe.includes(i.type)&&!e.has(i.id)).reduce((i,a)=>e.has(a.id)?i:[...i,...z(a,e)],[])}function vv(n,e=new Set){var i;return(((i=n.readsValue)==null?void 0:i.writesValues)||[]).filter(a=>Fe.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...z(s,e)],[])}function z(n,e=new Set){if(e.has(n.id))return[];if(n.type===r.ReturnStatement)return Tv(n.outputs).reduce((i,a)=>[...i,...z(a,e)],[]);if(n.type===r.FunctionCall||n.type===r.Operation||n.type===r.Condition)return[...Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]),...mv(n.inputs),...bv(n.outputs)].reduce((s,o)=>[...s,...z(o,e)],[]);if(Pr.includes(n.type)){const t=oo(n.inputs),a=Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...z(o,e)],[])}if(n.type===r.FunctionDeclaration){const t=[...oo(n.inputs)],a=Me(n).reduce((s,o)=>{const u=He(o);return[...s,...z(u||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...z(o)],[])}if(Fe.includes(n.type)){e.add(n.id);const i=Me(n).reduce((a,s)=>{const o=He(s);return[...a,...z(o||s,e)]},[]);return[n,...i,...vv(n,e),...gv(n,e)]}return[]}function gt(n,e=new Set){return e.has(n.id)?[]:(e.add(n.id),[...Ln(n).reduce((a,s)=>[...a,s,...gt(s,e)],[])])}function br(n){return n.reduce((e,t)=>t.type===r.ReturnStatement||t.type===r.ContinueStatement||t.type===r.BreakStatement?e:[...e,t,...Me(t)],[])}function Iv(n){const e=n.entities||[],t=[...e,...n.functions||[],...n.events||[],...n.projects||[]],i=e.reduce((p,h)=>[...p,...h.properties],[]),a=e.reduce((p,h)=>[...p,...h.methods],[]),s=a.reduce((p,h)=>[...p,...oo(h.inputs),...br(_t(h.calls)),...h.returnStatements],[]),o=n.functions.reduce((p,h)=>[...p,...br(_t(h.calls)),...h.returnStatements],[]),u=n.events.reduce((p,h)=>[...p,...br(_t(h.calls)),...h.returnStatements],[]);return[...t,...i,...a,...s,...o,...u]}function Pv(n,e){return e.filter(i=>{if(!i)return!1;switch(i.type){case r.FunctionCall:return i.inputs.find(a=>a.id===n.id)!==void 0||i.outputs.find(a=>a.id===n.id)!==void 0;case r.Condition:return i.successCalls.find(a=>a.id===n.id)!==void 0||i.errorCalls.find(a=>a.id===n.id)!==void 0||i.inputs.find(a=>a.id===n.id)!==void 0;case r.Operation:return i.outputs.find(a=>a.id===n.id)!==void 0;case r.VariableDeclaration:return Ne.includes(n.type)?Dv(n).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===i.id})!==void 0:!1;case r.CustomEntity:return i.properties.find(a=>a.id===n.id)!==void 0||i.methods.find(a=>a.id===n.id)!==void 0;case r.FunctionDeclaration:return i.inputs.find(a=>a.id===n.id)!==void 0||(i.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===n.id)!==void 0;default:return!1}})}function k6(n){const e=Iv(n.project);return Pv(n,e)}function gr(n){const e=[];if(En.includes(n.type)){n.calledBy.forEach(a=>{const s=He(a);s&&e.push(s)});const i=[...n.inputs||[],...n.outputs||[]].map(a=>gd(a)).filter(a=>a!==null);e.push(...S(i))}if(Fe.includes(n.type)){const t=gd(n);t&&e.push(t)}return S(e)}function Rd(n){return n.type===r.FunctionCall||n.type===r.InternalCall?n.declaration.inputs:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedArguments:n.type===r.FunctionDeclaration||Pr.includes(n.type)?n.inputs:n.type===r.Search?n.inputsDeclarations:[]}function q6(n,e){return e.type===r.Condition?e.inputs.find(t=>t.declaration.id===n.id):e.type===r.FunctionCall||e.type===r.Operation?e.inputs.find(t=>t.declaration.id===n.id):null}function Dv(n){return Ne.includes(n.type)?n.inputs:[]}function bd(n){var e;return n.type===r.FunctionCall?((e=n.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[r.Operation,r.Condition,r.Loop].includes(n.type)?n.declaration.fixedReturns:n.type===r.Search?n.outputsDeclarations:Oe.includes(n.type)?n.outputs:[]}function J6(n,e){return e.type===r.Condition?null:e.type===r.FunctionCall||e.type===r.Operation?e.outputs.find(t=>t.declaration.id===n.id):null}function W6(n){return n.type===r.Condition?[]:Ne.includes(n.type)?n.outputs:[]}function gd(n){const e=n.readsValue;return e?He(e):null}function Av(n){const e=n.internalCalls||[];return S(_t(S(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function ci(n){const e=Ed(n),t=[];return e.forEach(i=>{if(Fe.includes(i.type))t.push(i);else if(i.type===r.InputMap){const a=i.parent;if(a.type===r.InputMap){const s=a.parent;t.push(s)}else t.push(a)}else[r.ActionDescriptor].includes(i.parent.type)||t.push(i.parent)}),t}function S(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function Ln(n,e=!1){const t=[];if(n.type===r.Project&&t.push(...(n==null?void 0:n.entities)||[],...(n==null?void 0:n.functions)||[],...(n==null?void 0:n.variableDeclarations)||[],...(n==null?void 0:n.variableInstances)||[],...(n==null?void 0:n.searches)||[],...(n==null?void 0:n.loops)||[],...(n==null?void 0:n.operations)||[],...(n==null?void 0:n.conditions)||[],...(n==null?void 0:n.functionCalls)||[],...(n==null?void 0:n.events)||[],...(n==null?void 0:n.projects)||[]),st.includes(n.type)&&t.push(...(n==null?void 0:n.detachedChildren)||[]),n.type===r.CustomEntity){const i=[...n.suggestedMethods,...n.methods].flatMap(a=>a.collapsed&&e?[]:Ln(a));t.push(...i)}if(n.type===r.Condition){const i=n.successCalls.map(s=>He(s)),a=n.errorCalls.map(s=>He(s));t.push(...i,...a)}if(Pr.includes(n.type)){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ci(s)).flat(),a=n.calls.map(s=>He(s));t.push(...S(i),...a)}if(Ne.includes(n.type)&&n.type!==r.Condition){const i=n==null?void 0:n.outputs.map(o=>ci(o)).flat(),a=n.successCalls.map(o=>He(o)),s=n.errorCalls.map(o=>He(o));t.push(...S(i),...a,...s)}if(Fe.includes(n.type)){const i=ci(n),a=Av(n);t.push(...i,...a)}if(n.type===r.Loop){const i=n.outputs.map(o=>ci(o)).flat();if(n.body){const o=Ln(n.body,e);t.push(...o)}const a=n.errorCalls.map(o=>He(o)),s=n.successCalls.map(o=>He(o));t.push(...S(i),...s,...a)}if(n.type===r.FunctionDeclaration){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ci(s)).flat(),a=n.calls.map(s=>He(s));t.push(...S(i),...a)}return S(t)}function Sv(n,e=!1){const t=Ln(n,e),i=[...t,...t.reduce((a,s)=>[...a,...Sv(s,e)],[])];return S(i)}function Ov(n){const e=gr(n),t=[...e,...e.reduce((i,a)=>[...i,...Ov(a)],[])];return S(t)}function lo(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...lo(t),...co(t)]:[...e,t.name],[])}function co(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...co(t),...lo(t)]:[...e,t.name],[])}function vd(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...vd(t),...Id(t)]:[...e,t],[])}function Id(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...Id(t),...vd(t)]:[...e,t],[])}function Cv(n){return[...co(n),...lo(n)].filter((t,i,a)=>a.indexOf(t)===i)}function Bv(n){return n.implements.length===0&&n.extends.length===0?null:n.implements.find(i=>i.type===r.BuiltInBaseEntity&&i.name===w.PERSISTED_ENTITY)?n:[...n.implements,...n.extends].reduce((i,a)=>{if(a.type===r.CustomEntity){const s=Bv(a);if(s)return s}return i},null)}function H6(n){const e=n.extends.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function Y6(n){const e=n.implements.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function wv(n){const e=n.extends.find(t=>t.type===r.CustomEntity);return e&&e.type===r.CustomEntity?e:null}function Gn(n){const e=[...n.implements,...n.extends].reduce((t,i)=>i.type===r.BuiltInBaseEntity?[...t,i]:i.type===r.CustomEntity?[...t,...Gn(i)]:t,[]);return S(e)}function _v(n){return n.type===r.PrimitiveEntity?!0:n.type===r.BuiltInBaseEntity?n.interactive:!Gn(n).find(i=>!i.interactive)}function z6(n){return n.parent===n.project&&n.project.variableDeclarations.includes(n)}function Pd(n){return n.parent!==n.project?!1:r.VariableDeclaration===n.type?n.project.variableDeclarations.includes(n):r.VariableInstance===n.type?n.project.variableInstances.includes(n):r.FunctionCall===n.type?n.project.functionCalls.includes(n):r.Condition===n.type?n.project.conditions.includes(n):r.Operation===n.type?n.project.operations.includes(n):r.Loop===n.type?n.project.loops.includes(n):r.Search===n.type?n.project.searches.includes(n):!1}function Mv(n){if([...$e,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||Pd(n))return!1;const e=gr(n);return e.length===0?!0:e.some(t=>Mv(t))}function Dd(n){return[...$e,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||Pd(n)?!1:gr(n).length===0}function Nv(n,e=0){if(Dd(n)){const t=gr(n);return t.length===0?n:t.map(a=>Nv(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function $v(n){const e=[];if(Dd(n))e.push(n);else return[];return gr(n).forEach(i=>{e.push(...$v(i))}),e}function Vv(n){return n.type===r.FunctionDeclaration&&n.parent!==n.project&&!![r.CustomEntity,r.Loop,r.InstalledProject].includes(n.parent.type)}function Lv(n,e){const t=new Map;return n.forEach(i=>{t.set(i.id,i)}),e.forEach(i=>{t.set(i.id,i)}),Array.from(t.values())}function uo(n){switch(n){case r.CustomEntity:return Ir;case r.FunctionDeclaration:return lr;case r.VariableDeclaration:return pr;case r.VariableInstance:return yr;case r.FunctionCall:return Rr;case r.Operation:return cr;case r.Condition:return ur;case r.ReturnStatement:return Tr;case r.Loop:return dr;case r.Search:return hr;case r.InputMap:return hn;case r.OutputMap:return fn;case r.ArgumentDeclaration:return mr;case r.ReturnDeclaration:return Ot;case r.Property:return or;case r.InstalledProject:return fr;case r.Project:return $;case r.BuiltInBaseEntity:return Ut;default:return null}}function ht(n,e){if(st.includes(n.type))return n;if(Dr.includes(n.type))return null;const t=n.parent;if(!t)return null;if(t.type===r.GenericReference){const i=D(t);if(!i)return null;const a=e.get(i);return a?ht(a,e):null}else return t===e?e:ht(t,e)}function Ad(n,e){if(Dr.includes(n.type)||e.getAllBuiltInIds().includes(n.id))return null;const i=Mt(n.parent,e);return i?i===e?st.includes(n.type)?n:null:i.type===r.CustomEntity?n:Ad(i,e):null}function po(n,e,t){if(n===e||e===t||n===t)return!1;const i=ht(e.parent,t);return i===n?!0:po(i,e,t)}var yo=(n=>(n.SameBothLocal="same-both-local",n.AInB="a-in-b",n.BInA="b-in-a",n.ParallelInCommonParent="parallel-in-common-parent",n.ParallelInProject="parallel-in-project",n.AIsGlobalBIsNot="a-is-global-b-is-not",n.BIsGlobalAIsNot="b-is-global-a-is-not",n.SameBothGlobal="same-both-global",n))(yo||{});function pa(n,e,t){const i=ht(n,t),a=ht(e,t);if(!i)throw new Error("Could not find scope owner for the entity: "+n.id);if(!a)throw new Error("Could not find scope owner for the entity: "+e.id);if(i===a&&i.type!==r.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:i};if(i===a&&i.type===r.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:i};if(i.type===r.Project&&a.type!==r.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:i};if(i.type!==r.Project&&a.type===r.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(po(i,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:i};if(po(a,i,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const u=md(i,a);return u===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:u}:u?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:ht(u,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function Gv(n,e,t){const i=pa(n,e,t);if(!i.compatible||i.type!=="same-both-local")return null;if(n===e)return n;let a=ht(n.parent,t);if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;for(;a;){if(a){if(a===e)return e;if(a.type===r.Project)return n}else return n;a=ht(a.parent,t)}let s=ht(e.parent,t);if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;for(;s;){if(s){if(s===n)return n;if(s.type===r.Project)return e}else return e;s=ht(s.parent,t)}return null}function Fv(n){return n.length===0?null:n.length===1?n[0]:n.reduce((t,i)=>{const a=Gv(t,i,i.project);return!a||a===i?t:i},n[0])}function Mt(n,e){let t;return typeof n=="string"?t=n:n.type===r.GenericReference?t=D(n):t=n.id,t===e.id?e:e.get(t)}function vr(n){if(Dr.includes(n.type))return n;if(n.type===r.Project)return null;if(n.project.getAllBuiltInIds().includes(n.id))return n;const t=n.parent;return!t||t.type===r.Project?null:vr(t)}function ya(n,e){var t;if(n.readsValue){const i=Mt(n.readsValue,e.project);e.setValueWriter(i),i.addValueReader(e)}else n.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function Sd(n){const e=[];function t(o,u){return e.some(p=>p.blockedByCaller===o&&p.blockedByCalling===u)}function i(o,u){t(o,u)||e.push({blockedByCaller:o,blockedByCalling:u})}const a=Ad(n,n.project);return n.calledBy.forEach(o=>{if([...o.calls||[],...o.successCalls||[],...o.errorCalls||[]].forEach(h=>{Oe.includes(h.type)&&i(o,h)}),o===a)return;let p;if(Ne.includes(o.type))p=o;else if(o.type===r.FunctionDeclaration){const h=He(o);if(h.type===r.CustomEntity)return;h.type===r.Loop&&(p=h)}if(p){const h=Sd(p);h.reachable||(Oe.includes(n.type)?h.blocks.forEach(m=>{i(o,m.blockedByCalling)}):Me(n).find(b=>b===o)||h.blocks.forEach(b=>{i(o,b.blockedByCalling)}))}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function Z6(n){return To.includes(n.type)?n.type===r.FunctionDeclaration?!Vv(n):!0:!1}function X6(n){if(r.ActionDescriptor===n.type){if(n.project.operationDeclarations.find(s=>s.id===n.id))return r.Operation;if(n.project.globalEventActionDescriptors.find(s=>s.id===n.id))return r.GlobalEvent;if(n.project.loopDeclarations.find(s=>s.id===n.id))return r.Loop;if(n.project.conditionDeclarations.find(s=>s.id===n.id))return r.Condition}return n.type}function Q6(n,e){const t=[];if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'parent'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));else{const i=e.get(n.parent);i?[r.Project,r.DataType].includes(i.type)||t.push(new E({id:`${n.id}--${n.parent}--${y.InvalidParentReference}`,code:y.InvalidParentReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'project' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.parent}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return n.implements&&Array.isArray(n.implements)?n.implements.forEach(i=>{if(n.id===i){t.push(new E({id:`${n.id}--${i}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at one of the 'implements' references. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}));return}const a=e.get(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${n.id}--${i}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an abstract entity.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}):t.push(new E({id:`${n.id}--${v.InvalidObjectStructure}`,code:v.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' property that isn't an array.`,issue:null})),n.extends&&Array.isArray(n.extends)&&n.extends.forEach(i=>{const a=e.get(i);a?[r.CustomEntity,r.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${n.id}--${i}--${y.InvalidExtendsReference}`,code:y.InvalidExtendsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'extends' reference that isn't pointing to a non-abstract entity. Did you want to use the property 'implements', which holds a list of references to absract entities, instead?`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.InvalidExtendsReference}`,code:y.InvalidExtendsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'extends' reference that isn't pointing to an entity of type 'custom-entity' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${i}--${y.ReferencedEntityNotFound}`,code:y.ReferencedEntityNotFound,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${i}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}const pe=class pe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"x");l(this,"y");l(this,"static");l(this,"abstract");l(this,"type",r.CustomEntity);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"implements",[]);l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"suggestedProperties",[]);l(this,"suggestedMethods",[]);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.x=e.x,this.y=e.y,this.static=e.static,this.abstract=e.abstract}static fromGenerationTarget(e,t){let i=t;if(e.parent){const p=D(e.parent);i=t.get(p)}const a=[];e.implements&&e.implements.forEach(p=>{a.push(t.get(p)||t.getBuiltIn(p))});const s=[];e.extends&&e.extends.forEach(p=>{s.push(t.get(p)||t.getBuiltIn(p))});const o={id:e.id,version:1,name:e.name,type:r.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:i},u=R(o,t);return u.setParent(i),u.initChildren(),u}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=Q6(i,t),o=Zs(i,t);a.push(...s,...o,...Pe(i));const u=i.parent?t.get(i.parent):null;if(u&&u.type===r.DataType){const p=u;p.entity&&a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${p.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
360
360
  You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
361
361
  ${Qt({describe_entity:p.entity.id})}
362
- Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return{errors:a,modifiedData:i}}get extendedProperties(){return S(this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]))}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an '${this.type}', must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){if(this.parent.type===r.DataType){const e=this.parent;e.entity=this}else this.project.addCustomEntity(this);return this}setParent(e){return this.parent=e,this}removeProperty(e){return this.properties=this.properties.filter(t=>t.id!==e.id),this}addMethod(e){return this.methods.includes(e)||(this.methods.push(e),this.suggestedMethods=this.suggestedMethods.filter(t=>t.name!==e.name)),this}removeMethod(e){return this.methods=this.methods.filter(t=>t.id!==e.id),this}addProperty(e){return this.properties.includes(e)||(this.properties.push(e),this.suggestedProperties=this.suggestedProperties.filter(t=>t.name!==e.name)),this}addSuggestedProperty(e){return this.suggestedProperties.includes(e)||this.suggestedProperties.push(e),this}addSuggestedMethod(e){return this.suggestedMethods.includes(e)||this.suggestedMethods.push(e),this}removeSuggestedProperty(e){return this.suggestedProperties=this.suggestedProperties.filter(t=>t.id!==e.id),this}removeSuggestedMethod(e){return this.suggestedMethods=this.suggestedMethods.filter(t=>t.id!==e.id),this}addAbstractMethod(e){return this.abstractMethods.includes(e)||this.abstractMethods.push(e),this}removeAbstractMethod(e){return this.abstractMethods=this.abstractMethods.filter(t=>t.id!==e.id),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.properties=this.initialData.properties.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.methods=this.initialData.methods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.abstractMethods=this.initialData.abstractMethods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.extends=this.initialData.extends.map(e=>R(e,this.project)),this.implements=this.initialData.implements.map(e=>R(e,this.project)),this.addSuggestions(),this)}addSuggestions(){return this.implements.forEach(e=>{$x(this,e).forEach(a=>{const s=a.toJSON();s.id=`_suggestion--parent--${this.id}--${a.id}`;const o=R(s,this.project);o.suggestion=!0,o.setParent(this),o.initChildren(),this.addSuggestedProperty(o)}),Vx(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),u=R(o,this.project);if(u.suggestion=!0,u.setParent(this),u.initChildren(),u.inputs.forEach(p=>{p.suggestion=!0}),u.returnStatements.length){const p=u.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(u)})}),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.x=e.x||this.x,this.y=e.y||this.y,this.static=e.static||this.static,this.abstract=e.abstract||this.abstract,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.properties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.methods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.properties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(i=>i.toFlat(e)),...this.implements.flatMap(i=>i.toFlat(e)),...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(i=>i.toFlatIds(e)),...this.implements.flatMap(i=>i.toFlatIds(e)),...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),implements:this.implements.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),implements:this.implements.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e)),...this.implements.flatMap(i=>i.toFlatJSON(e)),...this.extends.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,static:this.static,abstract:this.abstract,extends:this.extends.map(t=>t.id),implements:this.implements.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){return this.errors=Nx(this),{success:!0,error:null,data:null}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new pe(this.toJSON(),this.project)}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return ao(this,e,t)}};l(pe,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),l(pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"x","y"]),l(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),l(pe,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),l(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),l(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let Ir=pe;function K6(n){const e=n4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Nt{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.PrimitiveEntity);l(this,"static");l(this,"abstract");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.static=e.static,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a})}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=K6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Nt(this.toJSON(),this.project)}}function e3(n){const e=u4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Ut{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",!1);l(this,"static");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"interactive",!1);l(this,"errors",[]);l(this,"project");this.initialData=this.initialData||e,this.project=this.project||t,this.id=this.id||e.id,this.version=this.version||e.version,this.name=this.name||e.name,this.static=this.static||e.static,this.interactive=this.interactive||e.interactive,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}get extendedProperties(){return S(this.extends.reduce((e,t)=>{if(t instanceof Ut){const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);e.push(...i)}return e},[]))}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove(e={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e)),...this.extends.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e)),...this.extends.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=e3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Ut(this.toJSON(),this.project)}implement(e,t){return ao(this,e,t)}}function ha(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case r.PrimitiveValue:return t||new oi(n,e);case r.CustomEntity:return t||new Ir(n,e);case r.PrimitiveEntity:return t||new Nt(n,e);case r.FunctionDeclaration:return t||new lr(n,e);case r.GlobalEvent:return t||new ai(n,e);case r.DataType:return t||new ii(n,e);case r.Property:return t||new or(n,e);case r.FunctionCall:return t||new Rr(n,e);case r.Condition:return t||new ur(n,e);case r.Operation:return t||new cr(n,e);case r.VariableDeclaration:return t||new pr(n,e);case r.VariableInstance:return t||new yr(n,e);case r.OutputMap:return t||new fn(n,e);case r.ReturnDeclaration:return t||new Ot(n,e);case r.ArgumentDeclaration:return t||new mr(n,e);case r.InputMap:return t||new hn(n,e);case r.Project:return t||new $(n);case r.InstalledProject:return t||new fr(n,e);case r.ActionDescriptor:return t||new _e(n,e);case r.ReturnStatement:return t||new Tr(n,e);case r.Loop:return t||new dr(n,e);case r.Search:return t||new hr(n,e);case r.ValueDescriptor:return t||new Er(n,e);case r.BuiltInBaseEntity:return t||new Ut(n,e);case r.InternalCall:return t||new si(n,e);case r.ContinueStatement:return t||new yt(n,e);case r.BreakStatement:return t||new li(n,e);default:throw new Error("Invalid entity type: "+n.type)}}function R(n,e){if(!n)throw new Error("Entity is null");const t=ha(n,e);return t.subscribe(),t}function t3(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case r.PrimitiveValue:return oi.fromGenerationTarget(n,e);case r.CustomEntity:return Ir.fromGenerationTarget(n,e);case r.FunctionDeclaration:return lr.fromGenerationTarget(n,e);case r.GlobalEvent:return ai.fromGenerationTarget(n,e);case r.DataType:return ii.fromGenerationTarget(n,e);case r.Property:return or.fromGenerationTarget(n,e);case r.FunctionCall:return Rr.fromGenerationTarget(n,e);case r.Condition:return ur.fromGenerationTarget(n,e);case r.Operation:return cr.fromGenerationTarget(n,e);case r.VariableDeclaration:return pr.fromGenerationTarget(n,e);case r.VariableInstance:return yr.fromGenerationTarget(n,e);case r.OutputMap:return fn.fromGenerationTarget(n,e);case r.ReturnDeclaration:return Ot.fromGenerationTarget(n,e);case r.ArgumentDeclaration:return mr.fromGenerationTarget(n,e);case r.InputMap:return hn.fromGenerationTarget(n,e);case r.InstalledProject:return fr.fromGenerationTarget(n,e);case r.ReturnStatement:return Tr.fromGenerationTarget(n,e);case r.Loop:return dr.fromGenerationTarget(n,e);case r.Search:return hr.fromGenerationTarget(n,e);case r.ActionDescriptor:return _e.fromGenerationTarget(n,e);case r.ValueDescriptor:return Er.fromGenerationTarget(n,e);case r.InternalCall:return si.fromGenerationTarget(n,e);case r.ContinueStatement:return yt.fromGenerationTarget(n,e);case r.BreakStatement:return li.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const Z=class Z{constructor(e){l(this,"initialData");l(this,"id");l(this,"version");l(this,"type",r.Project);l(this,"name",null);l(this,"description",null);l(this,"x");l(this,"y");l(this,"entities",[]);l(this,"projects",[]);l(this,"functions",[]);l(this,"events",[]);l(this,"variableDeclarations",[]);l(this,"variableInstances",[]);l(this,"conditions",[]);l(this,"operations",[]);l(this,"functionCalls",[]);l(this,"loops",[]);l(this,"searches",[]);l(this,"primitives",[]);l(this,"builtInBaseEntities",[]);l(this,"operationDeclarations",[]);l(this,"globalEventActionDescriptors",[]);l(this,"loopDeclarations",[]);l(this,"conditionDeclarations",[]);l(this,"valueDescriptors",[]);l(this,"dataTypes",[]);l(this,"project");l(this,"instances",{});l(this,"builtInInstances",{});l(this,"errors",[]);l(this,"references",[]);this.initialData=e,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=0,this.y=0}static injectUUIDModule(e){Z.UUID=e}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Pe(i)),{errors:a,modifiedData:i}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async i=>{await t.init(this),i(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this}get instancesList(){return Object.values(this.instances)}isOperationDeclaration(e){return this.operationDeclarations.includes(e)}isGlobalEventActionDescriptor(e){return this.globalEventActionDescriptors.includes(e)}isLoopDeclaration(e){return this.loopDeclarations.includes(e)}isConditionDeclaration(e){return this.conditionDeclarations.includes(e)}initChildren(){return this.entities=this.initialData.entities.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.projects=this.initialData.projects.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functions=this.initialData.functions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableDeclarations=this.initialData.variableDeclarations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableInstances=this.initialData.variableInstances.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.conditions=this.initialData.conditions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.operations=this.initialData.operations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functionCalls=this.initialData.functionCalls.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.loops=this.initialData.loops.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.searches=this.initialData.searches.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.attachOrphanReferences(),this.validate(),this}subscribeInstance(e){return(!this.instances[e.id]||this.instances[e.id]!==e)&&(this.instances[e.id]=e),this}subscribeBuiltInInstance(e){return(!this.builtInInstances[e.id]||this.builtInInstances[e.id]!==e)&&(this.builtInInstances[e.id]=e),this}subscribe(){return this}unsubscribe(){return this}unsubscribeInstance(e){return delete this.instances[e.id],this}findSubscribedInstance(e){return this.instances[e.id]||null}findSubscribedBuiltInInstance(e){return this.builtInInstances[e.id]||null}get(e){return this.instances[e]||this.builtInInstances[e]||null}getManaged(e){return this.instances[e]||null}getBuiltIn(e){return this.builtInInstances[e]||null}findSubscribedInstanceFromReference(e){return this.instances[e.entityId]||null}findSubscribedBuiltInInstanceFromReference(e){return this.builtInInstances[e.entityId]||null}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e}={ignoreUpstream:!1}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}getAllBuiltInIds(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlatIds(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlatIds(e)),...this.operationDeclarations.flatMap(t=>t.toFlatIds(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlatIds(e)),...this.loopDeclarations.flatMap(t=>t.toFlatIds(e)),...this.conditionDeclarations.flatMap(t=>t.toFlatIds(e)),...this.valueDescriptors.flatMap(t=>t.toFlatIds(e)),...this.dataTypes.flatMap(t=>t.toFlatIds(e))]}getAllBuiltIn(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlat(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlat(e)),...this.operationDeclarations.flatMap(t=>t.toFlat(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlat(e)),...this.loopDeclarations.flatMap(t=>t.toFlat(e)),...this.conditionDeclarations.flatMap(t=>t.toFlat(e)),...this.valueDescriptors.flatMap(t=>t.toFlat(e)),...this.dataTypes.flatMap(t=>t.toFlat(e))]}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlat(e)),...this.functions.flatMap(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e)),...this.projects.flatMap(i=>i.toFlat(e)),...this.variableDeclarations.flatMap(i=>i.toFlat(e)),...this.variableInstances.flatMap(i=>i.toFlat(e)),...this.conditions.flatMap(i=>i.toFlat(e)),...this.operations.flatMap(i=>i.toFlat(e)),...this.functionCalls.flatMap(i=>i.toFlat(e)),...this.loops.flatMap(i=>i.toFlat(e)),...this.searches.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+Z.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toReference()),functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),projects:this.projects.map(e=>e.toReference()),variableDeclarations:this.variableDeclarations.map(e=>e.toReference()),variableInstances:this.variableInstances.map(e=>e.toReference()),conditions:this.conditions.map(e=>e.toReference()),operations:this.operations.map(e=>e.toReference()),functionCalls:this.functionCalls.map(e=>e.toReference()),loops:this.loops.map(e=>e.toReference()),searches:this.searches.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatJSON(e)),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.toFlatJSON(e)),...this.projects.flatMap(i=>i.toFlatJSON(e)),...this.variableDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.variableInstances.flatMap(i=>i.toFlatJSON(e)),...this.conditions.flatMap(i=>i.toFlatJSON(e)),...this.operations.flatMap(i=>i.toFlatJSON(e)),...this.functionCalls.flatMap(i=>i.toFlatJSON(e)),...this.loops.flatMap(i=>i.toFlatJSON(e)),...this.searches.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e)),...this.projects.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(i=>i.toFlatGenerationTarget(e)),...this.conditions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.operations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.loops.flatMap(i=>i.toFlatGenerationTarget(e)),...this.searches.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.entities.forEach(e=>e.clearErrors()),this.projects.forEach(e=>e.clearErrors()),this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this.variableDeclarations.forEach(e=>e.clearErrors()),this.variableInstances.forEach(e=>e.clearErrors()),this.conditions.forEach(e=>e.clearErrors()),this.operations.forEach(e=>e.clearErrors()),this.functionCalls.forEach(e=>e.clearErrors()),this.loops.forEach(e=>e.clearErrors()),this.searches.forEach(e=>e.clearErrors()),this}validate(){const e=Ox(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Z(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(i=>i.id===e.id);if(t>-1){const i=this.entities[t];return this.entities.splice(t,1),i}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(i=>i.id===e.id);if(t>-1){const i=this.functions[t];return this.functions.splice(t,1),i}return null}removeExternalProject(e){const t=this.projects.findIndex(i=>i.id===e.id);if(t>-1){const i=this.projects[t];return this.projects.splice(t,1),i}return null}removeGlobalEvent(e){const t=this.events.findIndex(i=>i.id===e.id);if(t>-1){const i=this.events[t];return this.events.splice(t,1),i}return null}removeTopLevelVariableDeclaration(e){if(e.type!==r.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(i=>i.id===e.id);if(t>-1){const i=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),i}return null}getEntryPoints(){return[...this.functions,...this.events,...this.entities.flatMap(t=>t.methods)]}getFunctionDeclaration(e){return this.functions.find(t=>t.id===e)||null}getConditions(){return[...this.conditions,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.functionCalls.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.conditions.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.operations.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.loops.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.searches.reduce((t,i)=>{const a=z(i);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return S([...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(i=>{if(!i.declaration){const a=i.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(u=>u.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===w.PERSISTED_ENTITY)||null}};l(Z,"UUID",$m()),l(Z,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(Z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Z,"BASE_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,...Z.INMUTABLE_BASE_PROPERTIES]),l(Z,"MUTABLE_META_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,"x","y"]),l(Z,"INMUTABLE_META_PROPERTIES",[...Z.INMUTABLE_BASE_PROPERTIES]),l(Z,"META_PROPERTIES",[...Z.MUTABLE_META_PROPERTIES,...Z.INMUTABLE_META_PROPERTIES]),l(Z,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Z,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(Z,"UPSTREAM_PROPERTIES",[...Z.MUTABLE_UPSTREAM_PROPERTIES,...Z.INMUTABLE_UPSTREAM_PROPERTIES]),l(Z,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(Z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Z,"DOWNSTREAM_PROPERTIES",[...Z.MUTABLE_DOWNSTREAM_PROPERTIES,...Z.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Z,"PROPERTIES",[...Z.META_PROPERTIES,...Z.UPSTREAM_PROPERTIES,...Z.DOWNSTREAM_PROPERTIES]);let $=Z;class Uv extends _e{constructor(t){super($t,t);l(this,"id",Ie.Parallel);l(this,"name",Ie.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",$t);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async()=>{});this.project=t,this.fixedArguments=$t.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=$t.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=$t.error?R($t.error,this.project):null}}class xv extends _e{constructor(t){super(ot,t);l(this,"id",ot.id);l(this,"name",ot.name);l(this,"description",ot.description);l(this,"version",ot.version);l(this,"autoexecutable",!1);l(this,"initialData",ot);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[0])=>{const i=t[0];return[new Promise(s=>{setTimeout(()=>{s()},i)})]});this.project=t,this.fixedArguments=ot.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ot.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ot.error?R(ot.error,this.project):null}}class jv extends _e{constructor(t){super(tn,t);l(this,"id",Ie.Sequential);l(this,"name",Ie.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",tn);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");l(this,"implementation",async(t=[[]])=>[[]]);this.project=t,this.fixedArguments=tn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=tn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=tn.error?R(tn.error,this.project):null}}function n3(n){const e=[new jv(n),new Uv(n),new xv(n),new _e(hi,n),new _e(Sr,n),new _e(xn,n),new _e(Ra,n),new _e(vo,n),new _e(Do,n),new _e(Po,n),new _e(ma,n),new _e(pi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class kv extends Ut{constructor(t){super(Be,t);l(this,"initialData");l(this,"id",w.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",w.PERSISTED_ENTITY);l(this,"description",Be.description);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",Be.abstract);l(this,"static",Be.static);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=Be,this.project=t,this.id=Be.id,this.version=Be.version,this.name=Be.name,this.static=Be.static,this.abstract=Be.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}}function r3(n){const e=[new kv(n),new Ut(Sa,n),new Ut(bn,n),new Ut(jo,n),new Ut(Aa,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function i3(n){const e=[new Nt(F,n),new Nt(Fn,n),new Nt(Ce,n),new Nt(Xe,n),new Nt(Rn,n),new Nt(Ar,n),new Nt(fa,n),new Nt(Eo,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function a3(n){const e=[new _e(_a,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function s3(n){const e=[new _e(jn,n),new _e(Vo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function o3(n){const e=[new Er(Wo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function l3(n){const e=[new _e(kn,n),new _e(Cr,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const di={},ho={};async function c3(n,e={}){const t={...XR};return t.id=n.id,e.empty?{data:{id:n.id,type:r.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function qv(n){const e=new $(n);return i3(e),r3(e),n3(e),a3(e),s3(e),o3(e),l3(e),e.initChildren(),e}async function d3(n,e={}){try{if(n.id&&di[n.id])return di[n.id];if(n.id&&ho[n.id])return await ho[n.id],di[n.id];const t=c3(n,e);n.id&&(ho[n.id]=t);const i=await t;if(i.data){const a=qv(i.data);return di[n.id]=a,n.id&&delete ho[n.id],a}return null}catch(t){return console.error("Error fetching project",t),null}}function u3(n){return di[n.id]&&delete di[n.id],null}const p3="test_primitive_entities_export";d.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=hd,d.ActionDescriptorState=_e,d.ActionDescriptorValuesType=L,d.ActionInputMapState=d6,d.ActionOutputMapState=y6,d.AppendToListOperationInputIds=rp,d.AppendToListOperationOutputIds=ip,d.ArgumentDeclarationState=mr,d.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=dd,d.BUILT_IN_BASE_ENTITY_IDS=Ve,d.BUILT_IN_ENTITY_TYPES=Dr,d.BaseCanvasDraggableState=z9,d.BaseEntityNames=w,d.BaseState=Y9,d.BaseValueDescriptorIds=_o,d.BreakStatementState=li,d.BuiltInBaseEntityState=Ut,d.CALLABLE_ENTITIES_EXPLANATION=D6,d.CALLABLE_TYPES=En,d.CALLER_ENTITIES_EXPLANATION=tv,d.CALLER_TYPES=en,d.CALLS_UPDATE_EXPLANATION=$n,d.COMPARISON_CONDITIONS=em,d.CONDITIONS=bI,d.CUSTOM_ENTITY_OPERATIONS=Ey,d.CallableEntityClass=X9,d.CallerEntityClass=sd,d.ChildEntityState=Z9,d.ComparisonOperatorTypes=Ae,d.ConditionState=ur,d.ContinueStatementState=yt,d.CreateNewInputIds=Yp,d.CreateNewOutputIds=zp,d.CustomEntityState=Ir,d.DRAGGABLE_CALLABLE_TYPES=mo,d.DRAGGABLE_CALLER_TYPES=Bd,d.DRAGGABLE_ELEMENT_TYPES=To,d.DRAGGABLE_EXECUTABLE_TYPES=zv,d.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=fo,d.DataTypeCompatibilityTypes=wt,d.DataTypeParentChildRelation=qe,d.DataTypeState=ii,d.ENTITIES_WITH_VALLUES_EXPLANATION=eo,d.ENTITY_TYPES=Zv,d.ENTITY_WITH_LOGIC_SCOPE_TYPES=st,d.ENTITY_WITH_NAMES_TYPES=wd,d.ENTITY_WITH_VALUE_TYPES=Cd,d.ENTRY_POINT_ENTITIES_EXPLANATION=ca,d.ENTRY_POINT_TYPES=$e,d.EVENT_TYPES=Pr,d.EXECUTABLE_TYPES=Yv,d.EXECUTION_OPERATIONS=Hp,d.EntityError=Xn,d.EntityErrorSeverity=f,d.EntityGenerationError=E,d.EntityGenerationErrorCode=y,d.EntityInstanceErrorCode=M,d.EntityOperations=Ze,d.EntityType=r,d.EntityWithLogicScopeClass=t6,d.EntityWithValueClass=e6,d.EntryPointEntityClass=Q9,d.ExecutionOperations=Ie,d.FunctionCallState=Rr,d.FunctionDeclarationState=lr,d.GLOBAL_EVENT_DECLARATIONS=gI,d.GetLastInListOperationInputIds=Ju,d.GetLastInListOperationOutputIds=Wu,d.GlobalEventNames=Kt,d.GlobalEventState=ai,d.HTTPOperations=Ye,d.HTTP_OPERATIONS=Qy,d.InputMapState=hn,d.InstalledProjectState=fr,d.InternalCallState=si,d.JoinListOperationInputIds=uu,d.JoinListOperationOutputIds=pu,d.JoinStringOperationInputIds=Xd,d.JoinStringOperationOutputIds=Qd,d.LIST_OPERATIONS=Tp,d.ListOperations=j,d.LoopState=dr,d.LoopTypes=je,d.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Vn,d.NUMBER_OPERATIONS=Zd,d.NumberAdditionOperationInputIds=Ld,d.NumberAdditionOperationOutputIds=Gd,d.NumberOperations=at,d.OPERATION_DECLARATIONS=Qv,d.OperationState=cr,d.OutputMapParentChildRelation=Od,d.OutputMapState=fn,d.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=to,d.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Nn,d.PASS_THROUGH_CALLABLE_TYPES=Ne,d.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=yd,d.ParallelExecutionOperation=Uv,d.ParallelExecutionOperationInputIds=Ep,d.ParallelExecutionOperationOutputIds=Rp,d.PassThroughCallableEntityClass=K9,d.PersistedEntity=kv,d.PersistedEntityMethods=vt,d.PrimitiveEntityState=Nt,d.PrimitiveTypes=g,d.PrimitiveValueState=oi,d.ProjectState=$,d.PropertyState=or,d.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=A6,d.ReturnDeclarationState=Ot,d.ReturnStatementState=Tr,d.STANDALONE_CONDITIONS=Yf,d.STRING_OPERATIONS=du,d.ScopeCompatibilityType=yo,d.SearchState=hr,d.SequentialExecutionOperation=jv,d.SequentialExecutionOperationInputIds=Vp,d.SequentialExecutionOperationOutputIds=Lp,d.SharedEntityErrorCode=v,d.SharedStateFunctionality=Qg,d.SplitListOperationInputIds=Su,d.SplitListOperationOutputIds=Ou,d.StandaloneOperatorTypes=Ct,d.StringOperations=ve,d.TERMINATION_TYPES=Oe,d.USER_MANAGED_ENTITY_TYPES=Xv,d.UserManagedEntityStateFunctionality=H9,d.VALUE_READING_ENTITIES_EXPLANATION=pd,d.VALUE_READING_TYPES=Tn,d.VALUE_WRITING_ENTITIES_EXPLANATION=nv,d.VALUE_WRITING_TYPES=Se,d.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=ud,d.VARIABLE_TYPES=Fe,d.ValidationInputIds=iy,d.ValidationOutputIds=ay,d.ValueAutogenerationType=xe,d.ValueDescriptorParentChildRelation=O,d.ValueDescriptorState=Er,d.ValueReadingEntityClass=oa,d.ValueWritingEntityClass=la,d.VariableDeclarationState=pr,d.VariableInputMapState=c6,d.VariableInstanceState=yr,d.VariableOutputMapState=p6,d.WaitOperation=xv,d.WaitOperationInputIds=Cp,d.WaitOperationOutputIds=Bp,d._VALUE_READING_TYPES=Wv,d._VALUE_WRITING_TYPES=Hv,d.appendToListOperation=Ra,d.appendToListOperationElementToAppendArgument=So,d.appendToListOperationElementToAppendArgumentParentRef=pp,d.appendToListOperationElementToAppendArgumentRef=op,d.appendToListOperationError=mp,d.appendToListOperationErrorParentRef=fp,d.appendToListOperationListArgument=Ao,d.appendToListOperationListArgumentParentRef=up,d.appendToListOperationListArgumentRef=ap,d.appendToListOperationListDataType=sp,d.appendToListOperationResultListDataType=dp,d.appendToListOperationResultListReturn=hp,d.appendToListOperationResultListReturnParentRef=yp,d.appendToListOperationResultListReturnRef=cp,d.appendToListOperationSecondListDataType=lp,d.asGenerationActionExample=Qt,d.baseHttpRequestFunctionDeclaration=hi,d.baseHttpRequestFunctionDeclarationErrorValueDescriptor=$o,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=Xy,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=Zy,d.baseHttpRequestFunctionDeclarationRef=Wy,d.baseHttpRequestFunctionDeclarationRefEight=Yy,d.baseHttpRequestFunctionDeclarationRefFive=qy,d.baseHttpRequestFunctionDeclarationRefFour=ky,d.baseHttpRequestFunctionDeclarationRefNine=zy,d.baseHttpRequestFunctionDeclarationRefSeven=Hy,d.baseHttpRequestFunctionDeclarationRefSix=Jy,d.baseHttpRequestFunctionDeclarationRefThree=jy,d.baseHttpRequestFunctionDeclarationRefTwo=xy,d.booleanPrototype=Fn,d.capitalizeFirstLetter=Js,d.checkAreCustomEntitiesCompatibleAsDataType=Vg,d.checkAreDataTypesCompatible=Ws,d.checkArePropertiesCompatibleAsDataType=$g,d.checkIsBranchDependentButNotDirectlyOnBranch=ua,d.checkIsBranchDependentOnBranch=$6,d.checkIsCallableEntityReachable=Sd,d.checkIsCanvasEntity=Z6,d.checkIsDetachedBranch=Mv,d.checkIsDetachedBranchShallow=Dd,d.checkIsGlobalVariable=z6,d.checkIsGloballyDeclared=Pd,d.checkIsMethod=Vv,d.checkIsNestedScope=po,d.checkScopeCompatibility=pa,d.createEntityError=H,d.createNewInstanceOperation=Sr,d.createNewInstanceOperationEntityToInstanciateArgument=Kp,d.createNewInstanceOperationEntityToInstanciateArgumentRef=Zp,d.createNewInstanceOperationEntityToInstanciateDataType=Xp,d.createNewInstanceOperationError=ry,d.createNewInstanceOperationErrorParentRef=ny,d.createNewInstanceOperationOutputEntityDeclaration=ty,d.createNewInstanceOperationOutputEntityDeclarationParentRef=ey,d.createNewInstanceOperationRef=Qp,d.createSemanticId=Xt,d.createStateFromGenerationTargetType=t3,d.createStateFromType=ha,d.createStateFromTypeAndSubscribe=R,d.cronJobBuiltInBaseEntity=jo,d.cronJobBuiltInBaseEntityExpressionProperty=qf,d.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=TI,d.cronJobBuiltInBaseEntityExpressionPropertyRef=jf,d.cronJobBuiltInBaseEntityRef=kf,d.cronJobTriggeredFunctionDeclarationBlueprint=xo,d.cronJobTriggeredFunctionDeclarationBlueprintParentRef=Uf,d.customEntityToZodSchema=Em,d.dataTypeCompatibilityToErrorExplanation=dv,d.datePrototype=Ar,d.dateValueAutogenerationSchema=Wl,d.deletePersistedEntityMethod=Uo,d.deletePersistedEntityMethodParentRef=Ef,d.deleteRootProject=u3,d.endpointBuiltInBaseEntity=Sa,d.endpointBuiltInBaseEntityRef=Rh,d.endpointBuiltInBaseEntityRefFour=lf,d.endpointBuiltInBaseEntityRefThree=Oh,d.endpointBuiltInBaseEntityRefTwo=Ph,d.endpointBuiltInCorsProperty=bh,d.endpointBuiltInCorsPropertyDataType=Eh,d.endpointBuiltInCorsPropertyDataTypeRef=mh,d.endpointBuiltInCorsPropertyRef=Th,d.endpointBuiltInMethodProperty=Go,d.endpointBuiltInMethodPropertyDataType=Sh,d.endpointBuiltInMethodPropertyDataTypeRef=Dh,d.endpointBuiltInMethodPropertyRef=Ah,d.endpointBuiltInPathProperty=Lo,d.endpointBuiltInPathPropertyDataType=Ih,d.endpointBuiltInPathPropertyDataTypeRef=gh,d.endpointBuiltInPathPropertyRef=vh,d.endpointPathParamsArgumentDeclaration=kh,d.endpointPathParamsArgumentDeclarationRef=Gh,d.endpointPathParamsVariableDataType=Fh,d.endpointPathParamsVariableDataTypeRef=Lh,d.endpointReachedTriggerActionDescriptor=Fo,d.endpointReachedTriggerActionDescriptorRef=Uh,d.endpointReachedTriggerActionDescriptorRefFour=Wh,d.endpointReachedTriggerActionDescriptorRefThree=qh,d.endpointReachedTriggerActionDescriptorRefTwo=jh,d.endpointRequestBodyArgumentDeclaration=Hh,d.endpointRequestBodyArgumentDeclarationRef=_h,d.endpointRequestBodyVariableDataType=Mh,d.endpointRequestHeadersArgumentDeclaration=xh,d.endpointRequestHeadersArgumentDeclarationRef=Bh,d.endpointRequestHeadersVariableDataType=wh,d.endpointRequestHeadersVariableDataTypeRef=Ch,d.endpointRequestQueryParamsArgumentDeclaration=Jh,d.endpointRequestQueryParamsArgumentDeclarationRef=$h,d.endpointRequestQueryParamsVariableDataType=Vh,d.endpointRequestQueryParamsVariableDataTypeRef=Nh,d.endpointResponseBodyDataType=af,d.endpointResponseBodyReturnDeclaration=of,d.endpointResponseBodyReturnDeclarationRef=rf,d.endpointResponseCodeDataType=zh,d.endpointResponseCodeReturnDeclaration=Xh,d.endpointResponseCodeReturnDeclarationRef=Yh,d.endpointResponseHeadersDataType=ef,d.endpointResponseHeadersDataTypeRef=Qh,d.endpointResponseHeadersReturnDeclaration=nf,d.endpointResponseHeadersReturnDeclarationRef=Kh,d.endpointReturnStatementRef=Zh,d.endpointReturnStatementRefThree=sf,d.endpointReturnStatementRefTwo=tf,d.enumOptionsProperty=Vd,d.enumOptionsPropertyDataType=Nd,d.enumOptionsPropertyDataTypeRef=_d,d.enumOptionsPropertyRef=Md,d.enumPrototype=Rn,d.enumPrototypeRef=$d,d.executionBuiltInEntity=qo,d.executionBuiltInEntityAbortMethod=ko,d.executionBuiltInEntityAbortMethodParentRef=Jf,d.filterOutDuplicateEntities=S,d.filterOutDuplicateErrors=HF,d.findReferenceToSelfInList=Pv,d.findReferencesToSelfInProject=k6,d.flattenCalls=br,d.flattenCanvasAncestorsUntil=so,d.flattenCustomEntityExtensionAndImplementationTypes=Cv,d.flattenCustomEntityExtensionTypes=co,d.flattenCustomEntityExtensions=vd,d.flattenCustomEntityImplementations=Id,d.flattenCustomEntityImplementionTypes=lo,d.flattenDerivedCanvasEntities=gt,d.flattenDetachedBranch=$v,d.flattenElementCalls=Me,d.flattenProjectElements=Iv,d.flattenRelatedCanvasElementsOnTheLeft=Ov,d.flattenRelatedCanvasElementsOnTheRight=Sv,d.flattenVariableReads=vv,d.flattenVariableWrites=gv,d.flattenVariables=z,d.fromZodParseToEntityGenerationErrors=od,d.generate=ED,d.generateActionExample=S6,d.generateExecutionDataType=Lg,d.generateMutablePropertiesExplanation=Xs,d.generateRandomBoolean=Jm,d.generateRandomDate=vm,d.generateRandomDateAfter=Rm,d.generateRandomDateBefore=bm,d.generateRandomDateBetweenRange=gm,d.generateRandomNumber=Um,d.generateRandomNumberAfter=Lm,d.generateRandomNumberBefore=Gm,d.generateRandomNumberBetweenRange=Fm,d.generateRandomText=qm,d.generateRandomTextAfter=xm,d.generateRandomTextBefore=jm,d.generateRandomTextBetweenRange=km,d.generateUniqueUUID=Vm,d.getAllActionDescriptorsForConditions=io,d.getAllActionDescriptorsForGlobalEvents=no,d.getAllActionDescriptorsForLoops=ro,d.getAllActionDescriptorsForOperations=w6,d.getAllGloballyDeclaredFunctionDeclarationsExplanation=ov,d.getBaseBuiltInEntities=Gn,d.getBaseSchemaBasedOnType=Kg,d.getBuiltInEntityOwner=vr,d.getCallableEntityReferenceSchema=ke,d.getCallableEntityTypeSchema=vb,d.getCallerEntityReferenceSchema=QU,d.getCallerEntityTypeSchema=XU,d.getCalls=Td,d.getCanvasEntitiesDerivedFromInternalCalls=Av,d.getCanvasEntitiesDerivedFromWrites=ci,d.getCanvasEntityDerivedFromValueReadingEntity=gd,d.getCanvasEntityReferenceSchema=fx,d.getCanvasEntityTypeSchema=hx,d.getChildrenEntityWithValues=L6,d.getCommonAncestor=md,d.getCommonChildren=yv,d.getDeclaration=Zc,d.getDeepestScope=Fv,d.getDraggableCallableEntityReferenceSchema=Pb,d.getDraggableCallableEntityTypeSchema=Ib,d.getDraggableCallerEntityReferenceSchema=ex,d.getDraggableCallerEntityTypeSchema=KU,d.getDraggableExecutableEntityReferenceSchema=ix,d.getDraggableExecutableEntityTypeSchema=rx,d.getDraggablePassThroughCallableEntityReferenceSchema=Ls,d.getDraggablePassThroughCallableEntityTypeSchema=Vs,d.getDraggablePlayableEntityReferenceSchema=cx,d.getDraggablePlayableEntityTypeSchema=lx,d.getEntityArgumentDeclarations=Rd,d.getEntityInputMaps=Dv,d.getEntityOutputMaps=W6,d.getEntityReferenceSchema=yx,d.getEntityReturnDeclarations=bd,d.getEntityTypeSchema=px,d.getEntityWithLogicScopeReferenceSchema=un,d.getEntityWithLogicScopeTypeSchema=ax,d.getEntityWithValueReferenceSchema=gb,d.getEntityWithValueTypeSchema=ZU,d.getEntryPointEntityReferenceSchema=Ue,d.getEntryPointEntityTypeSchema=wn,d.getEventEntityReferenceSchema=Ns,d.getEventEntityTypeSchema=Ms,d.getExecutableEntityReferenceSchema=nx,d.getExecutableEntityTypeSchema=tx,d.getExtendedBuiltInEntity=H6,d.getExtendedCustomEntity=wv,d.getGenerationTargetSchemaBasedOnType=ev,d.getHeadIfPartOfDetachedBranch=Nv,d.getHighestScope=Gv,d.getImplementedBuiltInEntity=Y6,d.getIsInteractive=_v,d.getLastInListOperation=Do,d.getLastInListOperationError=np,d.getLastInListOperationErrorParentRef=tp,d.getLastInListOperationInputListArgument=Qu,d.getLastInListOperationInputListArgumentParentRef=Xu,d.getLastInListOperationInputListArgumentRef=Hu,d.getLastInListOperationInputListDataType=Yu,d.getLastInListOperationOutputElementDataType=Zu,d.getLastInListOperationOutputElementReturn=ep,d.getLastInListOperationOutputElementReturnParentRef=Ku,d.getLastInListOperationOutputElementReturnRef=zu,d.getLinkedEntitiesFromArgumentDeclaration=j6,d.getLowestPersistedEntityImplementation=Bv,d.getParentCanvasEntities=_t,d.getParentCanvasEntity=He,d.getParentEntryPoint=V6,d.getPassThroughCallableEntityReferenceSchema=ye,d.getPassThroughCallableEntityTypeSchema=$s,d.getPlayableEntityReferenceSchema=ox,d.getPlayableEntityTypeSchema=sx,d.getProject=d3,d.getPrototypeByType=uo,d.getReferenceEntityId=D,d.getReferencedEntitiesStateOrErrors=Ks,d.getReferencedEntityStateOrErrors=ld,d.getRelatedCanvasElementsOnTheLeft=gr,d.getRelatedCanvasElementsOnTheRight=Ln,d.getRootEntryPointScopeOwner=Ad,d.getScopeOwner=ht,d.getTerminationReferenceSchema=ux,d.getTerminationTypeSchema=dx,d.getUsedArgFromDeclaration=q6,d.getUsedReturnFromDeclaration=J6,d.getValueReadingEntityReferenceSchema=bb,d.getValueReadingEntityTypeSchema=dn,d.getValueWritingEntityReferenceSchema=zU,d.getValueWritingEntityTypeSchema=Xi,d.getVariableFromInputMapping=fv,d.getVariableFromReturnVariablePointer=Ev,d.getVariableReferenceSchema=Bn,d.getVariableTypeSchema=er,d.getVariablesFromArgumentDeclarations=oo,d.getVariablesFromInputMaps=mv,d.getVariablesFromOutputMapping=Rv,d.getVariablesFromOutputMaps=bv,d.getVariablesFromReturnDeclarations=Tv,d.getVariablesInSameOrHigherScope=Xc,d.getWrites=Ed,d.groupCallsBasedOnParallelizableExecution=F6,d.handleAfterEntityImplementationSideEffects=pv,d.handleBeforeEntityImplementationSideEffects=uv,d.httpRequestBodyArgument=Ia,d.httpRequestBodyArgumentRef=wy,d.httpRequestBodyDataType=_y,d.httpRequestHeadersArgument=va,d.httpRequestHeadersArgumentRef=Cy,d.httpRequestHeadersDataType=By,d.httpRequestMethodArgument=ba,d.httpRequestMethodArgumentRef=Sy,d.httpRequestMethodDataType=Oy,d.httpRequestMethodDataTypeRef=Dy,d.httpRequestQueryParamsArgument=Mo,d.httpRequestQueryParamsArgumentRef=Iy,d.httpRequestQueryParamsDataType=Py,d.httpRequestVariableURLArgument=ga,d.httpRequestVariableURLArgumentRef=gy,d.httpRequestVariableURLDataType=vy,d.httpRequestVariableURLDataTypeRef=Ry,d.httpResponseBodyReturnDataType=Uy,d.httpResponseBodyReturnDataTypeRef=Gy,d.httpResponseBodyReturnReturn=yi,d.httpResponseBodyReturnReturnRef=Fy,d.httpResponseCodeDataType=Ny,d.httpResponseCodeReturn=No,d.httpResponseCodeReturnRef=My,d.httpResponseHeadersDataType=Ly,d.httpResponseHeadersDataTypeRef=$y,d.httpResponseHeadersReturn=Pa,d.httpResponseHeadersReturnRef=Vy,d.implement=ao,d.inferArgumentDeclarationDataType=Gg,d.inferDataType=Hs,d.inferInputMapDataType=Fg,d.inferOutputMapDataType=jg,d.inferVariableDeclarationDataType=xg,d.inferVariableInstanceDataType=Ug,d.initProject=qv,d.iterateOverListActionDescriptor=jn,d.iterateOverListActionDescriptorListArgumentDeclaration=ah,d.iterateOverListActionDescriptorListArgumentDeclarationDataType=rh,d.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=nh,d.iterateOverListActionDescriptorListArgumentDeclarationParentRef=ih,d.iterateOverListActionDescriptorReturnDeclaration=th,d.iterateOverListActionDescriptorReturnDeclarationParentRef=eh,d.joinListOperation=vo,d.joinListOperationError=Au,d.joinListOperationErrorParentRef=Du,d.joinListOperationFirstListArgument=bu,d.joinListOperationFirstListArgumentParentRef=Ru,d.joinListOperationFirstListArgumentRef=yu,d.joinListOperationFirstListDataType=hu,d.joinListOperationResultListDataType=Eu,d.joinListOperationResultListReturn=Pu,d.joinListOperationResultListReturnParentRef=Iu,d.joinListOperationResultListReturnRef=Tu,d.joinListOperationSecondListArgument=vu,d.joinListOperationSecondListArgumentParentRef=gu,d.joinListOperationSecondListArgumentRef=fu,d.joinListOperationSecondListDataType=mu,d.joinListWithLastSeparator=N,d.joinStringOperation=pi,d.joinStringOperationError=cu,d.joinStringOperationErrorParentRef=lu,d.joinStringOperationFirstStringArgument=Ta,d.joinStringOperationFirstStringArgumentParentRef=au,d.joinStringOperationFirstStringArgumentRef=Kd,d.joinStringOperationFirstStringDataType=eu,d.joinStringOperationResultStringDataType=iu,d.joinStringOperationResultStringReturn=ui,d.joinStringOperationResultStringReturnParentRef=ou,d.joinStringOperationResultStringReturnRef=ru,d.joinStringOperationSecondStringArgument=Ea,d.joinStringOperationSecondStringArgumentParentRef=su,d.joinStringOperationSecondStringArgumentRef=tu,d.joinStringOperationSecondStringDataType=nu,d.jsonPrototype=Eo,d.keyValueParamBuiltInBaseEntity=Aa,d.keyValueParamBuiltInBaseEntityNameProperty=ph,d.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=eI,d.keyValueParamBuiltInBaseEntityNamePropertyParentRef=uh,d.keyValueParamBuiltInBaseEntityNamePropertyRef=dh,d.keyValueParamBuiltInBaseEntityValueProperty=fh,d.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=nI,d.keyValueParamBuiltInBaseEntityValuePropertyParentRef=hh,d.keyValueParamBuiltInBaseEntityValuePropertyRef=yh,d.lowercaseFirstLetter=Ng,d.manualFlowActionDescriptor=Vo,d.manualFlowActionDescriptorDeclarationReturnDeclaration=ch,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=oh,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=sh,d.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=lh,d.mapActionDescriptorToTypeItRepresents=X6,d.mergeEntityErrorsList=YF,d.mergeListOfEntities=Lv,d.methodDefaultValue=Ay,d.mockClientProject=XR,d.moreThanOrEqualCondition=Cr,d.moreThanOrEqualConditionLeftHandArgument=Xf,d.moreThanOrEqualConditionLeftHandArgumentParentRef=Zf,d.moreThanOrEqualConditionRightHandArgument=Kf,d.moreThanOrEqualConditionRightHandArgumentParentRef=Qf,d.notEmptyCondition=kn,d.notEmptyConditionArgument=Hf,d.notEmptyConditionRef=Wf,d.numberAdditionOperation=ma,d.numberAdditionOperationError=zd,d.numberAdditionOperationErrorParentRef=Yd,d.numberAdditionOperationFirstNumberArgument=Ro,d.numberAdditionOperationFirstNumberArgumentRef=Fd,d.numberAdditionOperationFirstNumberDataType=Ud,d.numberAdditionOperationRef=Jd,d.numberAdditionOperationRefThree=Hd,d.numberAdditionOperationRefTwo=Wd,d.numberAdditionOperationResultNumberDataType=qd,d.numberAdditionOperationResultNumberReturn=go,d.numberAdditionOperationResultNumberReturnRef=kd,d.numberAdditionOperationSecondNumberArgument=bo,d.numberAdditionOperationSecondNumberArgumentRef=xd,d.numberAdditionOperationSecondNumberDataType=jd,d.numberPrototype=Ce,d.numberValueAutogenerationSchema=Jl,d.parallelExecutionOperation=$t,d.parallelExecutionOperationError=Op,d.parallelExecutionOperationErrorParentRef=Sp,d.parallelExecutionOperationListOfExecutionResultsDataType=Pp,d.parallelExecutionOperationListOfExecutionResultsReturn=Co,d.parallelExecutionOperationListOfExecutionResultsReturnRef=Ip,d.parallelExecutionOperationListOfFunctionsArgument=Oo,d.parallelExecutionOperationListOfFunctionsArgumentDatatype=vp,d.parallelExecutionOperationListOfFunctionsArgumentRef=gp,d.parallelExecutionOperationListOfFunctionsBlueprint=bp,d.parallelExecutionOperationRef=Dp,d.parallelExecutionOperationRefThree=Ap,d.persistedBuiltInBaseEntity=Be,d.persistedBuiltInBaseEntityCreatedAtProperty=$f,d.persistedBuiltInBaseEntityCreatedAtPropertyDataType=Mf,d.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=fI,d.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=Nf,d.persistedBuiltInBaseEntityCreatedAtPropertyRef=_f,d.persistedBuiltInBaseEntityDatabaseProperty=mi,d.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=uI,d.persistedBuiltInBaseEntityDatabasePropertyParentRef=If,d.persistedBuiltInBaseEntityDatabasePropertyRef=vf,d.persistedBuiltInBaseEntityDeletedAtProperty=wf,d.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Cf,d.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=hI,d.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Bf,d.persistedBuiltInBaseEntityDeletedAtPropertyRef=Of,d.persistedBuiltInBaseEntityIdentifierProperty=Sf,d.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=Pf,d.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Af,d.persistedBuiltInBaseEntityIdentifierPropertyRef=Df,d.persistedBuiltInBaseEntityUpdatedAtProperty=Ff,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=Lf,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=mI,d.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Gf,d.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Vf,d.processOutputGlobalValueDescriptorDataType=nm,d.processOutputGlobalValueDescriptorReturn=Wo,d.processOutputGlobalValueDescriptorReturnRef=tm,d.projectPublicationCompletedGlobalEvent=_a,d.propertyToZodSchema=Tm,d.relationalDatabaseBuiltInBaseEntity=bn,d.relationalDatabaseBuiltInBaseEntityDefaultProperty=Tf,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=ff,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=mf,d.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Oa,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=cf,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=df,d.relationalDatabaseBuiltInBaseEntityMinSizeProperty=wa,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=yf,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=hf,d.relationalDatabaseBuiltInBaseEntityPasswordProperty=Ba,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=oI,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=pf,d.relationalDatabaseBuiltInBaseEntityRef=Or,d.relationalDatabaseBuiltInBaseEntityUsernameProperty=Ca,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=aI,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=uf,d.resolveActionDescriptorName=Xg,d.resolveBaseEntityName=Yg,d.resolveBuiltInBaseEntityDataTypeLabel=Qc,d.resolveConditionOperatorLabel=zs,d.resolveCustomEntityDataTypeLabel=Kc,d.resolveDataType=zc,d.resolveDataTypeLabel=Jg,d.resolveEntityDataTypeLabel=Hg,d.resolveEntityName=A,d.resolveFirstCallsSecond=U6,d.resolveFirstWritesSecond=x6,d.resolvePrimitiveEntityName=Zg,d.resolvePropertyDataTypeLabel=Wg,d.resolveSearchName=zg,d.resolveVariableDataTypeLabel=_9,d.resolveVariableDeclarationDataTypeLabel=sr,d.resolveVariableInstanceDataTypeLabel=qg,d.resolveVariableScope=C9,d.sequentialExecutionOperation=tn,d.sequentialExecutionOperationError=Wp,d.sequentialExecutionOperationErrorParentRef=Jp,d.sequentialExecutionOperationListOfExecutionResultsDataType=jp,d.sequentialExecutionOperationListOfExecutionResultsReturn=wo,d.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=qp,d.sequentialExecutionOperationListOfExecutionResultsReturnRef=xp,d.sequentialExecutionOperationListOfFunctionsArgument=Bo,d.sequentialExecutionOperationListOfFunctionsArgumentDatatype=Up,d.sequentialExecutionOperationListOfFunctionsArgumentParentRef=kp,d.sequentialExecutionOperationListOfFunctionsArgumentRef=Fp,d.sequentialExecutionOperationListOfFunctionsBlueprint=Gp,d.softDeletePersistedEntityMethod=bf,d.softDeletePersistedEntityMethodParentRef=Rf,d.sortCallsBasedOnExecutionDependencies=hv,d.sortChildrenEntitiesBasedOnExecutionDependencies=G6,d.splitListOperation=Po,d.splitListOperationError=qu,d.splitListOperationErrorParentRef=ku,d.splitListOperationFirstOutputListDataType=Mu,d.splitListOperationFirstOutputListReturn=Fu,d.splitListOperationFirstOutputListReturnParentRef=Gu,d.splitListOperationFirstOutputListReturnRef=Io,d.splitListOperationInputListArgument=$u,d.splitListOperationInputListArgumentParentRef=Nu,d.splitListOperationInputListArgumentRef=Cu,d.splitListOperationInputListDataType=Bu,d.splitListOperationSecondOutputListDataType=Uu,d.splitListOperationSecondOutputListReturn=ju,d.splitListOperationSecondOutputListReturnParentRef=xu,d.splitListOperationSplitIndexArgument=Lu,d.splitListOperationSplitIndexArgumentParentRef=Vu,d.splitListOperationSplitIndexArgumentRef=wu,d.splitListOperationSplitIndexDataType=_u,d.stringPrototype=F,d.stringValueAutogenerationSchema=ql,d.suggestNewIdForEntity=ad,d.test_primitive_entities_export=p3,d.toCamelCase=B9,d.toEntityState=Mt,d.toKebabCase=kg,d.toLowerCaseKebabCase=Ys,d.toPascalCase=w9,d.untypedObjectPrototype=Xe,d.updateErrorsList=X,d.updateValueReader=ya,d.urlDefaultValue=by,d.uuidPrototype=fa,d.validateArgumentDeclarationName=rd,d.validateCalledByErrorIdInAction=C6,d.validateCalledByIdInAction=O6,d.validateCallers=sv,d.validateConditionEntityDeclaration=_6,d.validateCustomEntityName=Zs,d.validateDataOperation=xn,d.validateDataOperationDataToValidateArgument=cy,d.validateDataOperationDataToValidateArgumentParentRef=ly,d.validateDataOperationDataToValidateArgumentRef=sy,d.validateDataOperationDataToValidateDataType=oy,d.validateDataOperationEntityToMatchTypeArgument=yy,d.validateDataOperationEntityToMatchTypeArgumentParentRef=py,d.validateDataOperationEntityToMatchTypeArgumentRef=dy,d.validateDataOperationEntityToMatchTypeDataType=uy,d.validateDataOperationError=Ty,d.validateDataOperationErrorParentRef=my,d.validateDataOperationOutputEntityDeclaration=fy,d.validateDataOperationOutputEntityDeclarationParentRef=hy,d.validateEntryCaller=av,d.validateErrorCaller=iv,d.validateFunctionCallDeclaration=lv,d.validateFunctionDeclarationName=ed,d.validateGeneratedEntityParentIsNotBuiltInEntity=P6,d.validateGeneration=v6,d.validateGenerationTarget=Pe,d.validateGenerationUpdate=I6,d.validateLoopEntityDeclaration=M6,d.validateName=M9,d.validateOperationEntityDeclaration=cv,d.validatePropertyName=nd,d.validateReachability=mn,d.validateReadsValueInActionPayload=B6,d.validateReferenceObject=Qs,d.validateReferenceToOne=cd,d.validateReferences=Ge,d.validateReturnDeclarationName=id,d.validateSuccessCaller=rv,d.validateValueReaderGenerationUpdate=da,d.validateValueWritter=fd,d.validateVariableDeclarationName=td,d.valueAutogenerationCurrentDateAndTimeSchema=KR,d.valueAutogenerationGenericSchema=Es,d.valueAutogenerationOptions=Hl,d.valueAutogenerationOptionsSchema=QR,d.valueAutogenerationRandomBooleanSchema=kl,d.valueAutogenerationRandomDateBetweenSchema=lb,d.valueAutogenerationRandomDateFromSchema=sb,d.valueAutogenerationRandomDateSchema=gs,d.valueAutogenerationRandomDateUntilSchema=ob,d.valueAutogenerationRandomNumberBetweenSchema=nb,d.valueAutogenerationRandomNumberFromSchema=eb,d.valueAutogenerationRandomNumberSchema=Rs,d.valueAutogenerationRandomNumberUntilSchema=tb,d.valueAutogenerationRandomSchema=Wi,d.valueAutogenerationRandomTextBetweenSchema=ab,d.valueAutogenerationRandomTextFromSchema=rb,d.valueAutogenerationRandomTextSchema=bs,d.valueAutogenerationRandomTextUntilSchema=ib,d.valueAutogenerationRangeValueTypesSchema=Ji,d.valueAutogenerationUniqueSchema=jl,d.waitOperation=ot,d.waitOperationMillisecondsNumberArgument=Un,d.waitOperationMillisecondsNumberArgumentRef=wp,d.waitOperationMillisecondsNumberDataType=_p,d.waitOperationOperationError=$p,d.waitOperationOperationErrorParentRef=Np,d.waitOperationRef=Mp,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
362
+ Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return{errors:a,modifiedData:i}}get extendedProperties(){return S(this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]))}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${y.InvalidParentUpdate}`,code:y.InvalidParentUpdate,severity:f.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an '${this.type}', must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){if(this.parent.type===r.DataType){const e=this.parent;e.entity=this}else this.project.addCustomEntity(this);return this}setParent(e){return this.parent=e,this}removeProperty(e){return this.properties=this.properties.filter(t=>t.id!==e.id),this}addMethod(e){return this.methods.includes(e)||(this.methods.push(e),this.suggestedMethods=this.suggestedMethods.filter(t=>t.name!==e.name)),this}removeMethod(e){return this.methods=this.methods.filter(t=>t.id!==e.id),this}addProperty(e){return this.properties.includes(e)||(this.properties.push(e),this.suggestedProperties=this.suggestedProperties.filter(t=>t.name!==e.name)),this}addSuggestedProperty(e){return this.suggestedProperties.includes(e)||this.suggestedProperties.push(e),this}addSuggestedMethod(e){return this.suggestedMethods.includes(e)||this.suggestedMethods.push(e),this}removeSuggestedProperty(e){return this.suggestedProperties=this.suggestedProperties.filter(t=>t.id!==e.id),this}removeSuggestedMethod(e){return this.suggestedMethods=this.suggestedMethods.filter(t=>t.id!==e.id),this}addAbstractMethod(e){return this.abstractMethods.includes(e)||this.abstractMethods.push(e),this}removeAbstractMethod(e){return this.abstractMethods=this.abstractMethods.filter(t=>t.id!==e.id),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.properties=this.initialData.properties.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.methods=this.initialData.methods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.abstractMethods=this.initialData.abstractMethods.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.extends=this.initialData.extends.map(e=>R(e,this.project)),this.implements=this.initialData.implements.map(e=>R(e,this.project)),this.addSuggestions(),this)}addSuggestions(){return this.implements.forEach(e=>{$x(this,e).forEach(a=>{const s=a.toJSON();s.id=`_suggestion--parent--${this.id}--${a.id}`;const o=R(s,this.project);o.suggestion=!0,o.setParent(this),o.initChildren(),this.addSuggestedProperty(o)}),Vx(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),u=R(o,this.project);if(u.suggestion=!0,u.setParent(this),u.initChildren(),u.inputs.forEach(p=>{p.suggestion=!0}),u.returnStatements.length){const p=u.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(u)})}),this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.x=e.x||this.x,this.y=e.y||this.y,this.static=e.static||this.static,this.abstract=e.abstract||this.abstract,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.properties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.methods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:u}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...u)}),{affected:S(i),removed:S(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.properties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(i=>{const{affected:a}=i.restore({seenEntities:e});t.push(...a)}),{affected:S(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(i=>i.toFlat(e)),...this.implements.flatMap(i=>i.toFlat(e)),...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(i=>i.toFlatIds(e)),...this.implements.flatMap(i=>i.toFlatIds(e)),...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),implements:this.implements.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,x:this.x,y:this.y,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),implements:this.implements.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e)),...this.implements.flatMap(i=>i.toFlatJSON(e)),...this.extends.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===r.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,static:this.static,abstract:this.abstract,extends:this.extends.map(t=>t.id),implements:this.implements.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e)),...this.implements.filter(i=>i.type===r.CustomEntity).flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){return this.errors=Nx(this),{success:!0,error:null,data:null}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new pe(this.toJSON(),this.project)}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return ao(this,e,t)}};l(pe,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),l(pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"MUTABLE_META_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,"x","y"]),l(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),l(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),l(pe,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),l(pe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),l(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),l(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),l(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let Ir=pe;function K6(n){const e=n4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Nt{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.PrimitiveEntity);l(this,"static");l(this,"abstract");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.static=e.static,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a})}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=K6(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Nt(this.toJSON(),this.project)}}function e3(n){const e=u4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Ut{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"name");l(this,"description",null);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",!1);l(this,"static");l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"interactive",!1);l(this,"errors",[]);l(this,"project");this.initialData=this.initialData||e,this.project=this.project||t,this.id=this.id||e.id,this.version=this.version||e.version,this.name=this.name||e.name,this.static=this.static||e.static,this.interactive=this.interactive||e.interactive,this.abstract=e.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}get extendedProperties(){return S(this.extends.reduce((e,t)=>{if(t instanceof Ut){const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);e.push(...i)}return e},[]))}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}async load(){return this}remove(e={ignoreUpstream:!1,seenEntities:new Set}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.properties.flatMap(i=>i.toFlat(e)),...this.methods.flatMap(i=>i.toFlat(e)),...this.abstractMethods.flatMap(i=>i.toFlat(e)),...this.extends.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(i=>i.toFlatIds(e)),...this.methods.flatMap(i=>i.toFlatIds(e)),...this.abstractMethods.flatMap(i=>i.toFlatIds(e)),...this.extends.flatMap(i=>i.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toJSON()),methods:this.methods.map(e=>e.toJSON()),abstractMethods:this.abstractMethods.map(e=>e.toJSON()),extends:this.extends.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:this.extends.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(i=>i.toFlatJSON(e)),...this.methods.flatMap(i=>i.toFlatJSON(e)),...this.abstractMethods.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,extends:this.extends.map(e=>e.id)}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(i=>i.toFlatGenerationTarget(e)),...this.methods.flatMap(i=>i.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.properties.forEach(e=>e.clearErrors()),this.methods.forEach(e=>e.clearErrors()),this.abstractMethods.forEach(e=>e.clearErrors()),this}validate(){const e=e3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.properties.flatMap(t=>t.getErrors()),...this.methods.flatMap(t=>t.getErrors()),...this.abstractMethods.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Ut(this.toJSON(),this.project)}implement(e,t){return ao(this,e,t)}}function ha(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case r.PrimitiveValue:return t||new oi(n,e);case r.CustomEntity:return t||new Ir(n,e);case r.PrimitiveEntity:return t||new Nt(n,e);case r.FunctionDeclaration:return t||new lr(n,e);case r.GlobalEvent:return t||new ai(n,e);case r.DataType:return t||new ii(n,e);case r.Property:return t||new or(n,e);case r.FunctionCall:return t||new Rr(n,e);case r.Condition:return t||new ur(n,e);case r.Operation:return t||new cr(n,e);case r.VariableDeclaration:return t||new pr(n,e);case r.VariableInstance:return t||new yr(n,e);case r.OutputMap:return t||new fn(n,e);case r.ReturnDeclaration:return t||new Ot(n,e);case r.ArgumentDeclaration:return t||new mr(n,e);case r.InputMap:return t||new hn(n,e);case r.Project:return t||new $(n);case r.InstalledProject:return t||new fr(n,e);case r.ActionDescriptor:return t||new _e(n,e);case r.ReturnStatement:return t||new Tr(n,e);case r.Loop:return t||new dr(n,e);case r.Search:return t||new hr(n,e);case r.ValueDescriptor:return t||new Er(n,e);case r.BuiltInBaseEntity:return t||new Ut(n,e);case r.InternalCall:return t||new si(n,e);case r.ContinueStatement:return t||new yt(n,e);case r.BreakStatement:return t||new li(n,e);default:throw new Error("Invalid entity type: "+n.type)}}function R(n,e){if(!n)throw new Error("Entity is null");const t=ha(n,e);return t.subscribe(),t}function t3(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case r.PrimitiveValue:return oi.fromGenerationTarget(n,e);case r.CustomEntity:return Ir.fromGenerationTarget(n,e);case r.FunctionDeclaration:return lr.fromGenerationTarget(n,e);case r.GlobalEvent:return ai.fromGenerationTarget(n,e);case r.DataType:return ii.fromGenerationTarget(n,e);case r.Property:return or.fromGenerationTarget(n,e);case r.FunctionCall:return Rr.fromGenerationTarget(n,e);case r.Condition:return ur.fromGenerationTarget(n,e);case r.Operation:return cr.fromGenerationTarget(n,e);case r.VariableDeclaration:return pr.fromGenerationTarget(n,e);case r.VariableInstance:return yr.fromGenerationTarget(n,e);case r.OutputMap:return fn.fromGenerationTarget(n,e);case r.ReturnDeclaration:return Ot.fromGenerationTarget(n,e);case r.ArgumentDeclaration:return mr.fromGenerationTarget(n,e);case r.InputMap:return hn.fromGenerationTarget(n,e);case r.InstalledProject:return fr.fromGenerationTarget(n,e);case r.ReturnStatement:return Tr.fromGenerationTarget(n,e);case r.Loop:return dr.fromGenerationTarget(n,e);case r.Search:return hr.fromGenerationTarget(n,e);case r.ActionDescriptor:return _e.fromGenerationTarget(n,e);case r.ValueDescriptor:return Er.fromGenerationTarget(n,e);case r.InternalCall:return si.fromGenerationTarget(n,e);case r.ContinueStatement:return yt.fromGenerationTarget(n,e);case r.BreakStatement:return li.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const Z=class Z{constructor(e){l(this,"initialData");l(this,"id");l(this,"version");l(this,"type",r.Project);l(this,"name",null);l(this,"description",null);l(this,"x");l(this,"y");l(this,"entities",[]);l(this,"projects",[]);l(this,"functions",[]);l(this,"events",[]);l(this,"variableDeclarations",[]);l(this,"variableInstances",[]);l(this,"conditions",[]);l(this,"operations",[]);l(this,"functionCalls",[]);l(this,"loops",[]);l(this,"searches",[]);l(this,"primitives",[]);l(this,"builtInBaseEntities",[]);l(this,"operationDeclarations",[]);l(this,"globalEventActionDescriptors",[]);l(this,"loopDeclarations",[]);l(this,"conditionDeclarations",[]);l(this,"valueDescriptors",[]);l(this,"dataTypes",[]);l(this,"project");l(this,"instances",{});l(this,"builtInInstances",{});l(this,"errors",[]);l(this,"references",[]);this.initialData=e,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=0,this.y=0}static injectUUIDModule(e){Z.UUID=e}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Pe(i)),{errors:a,modifiedData:i}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async i=>{await t.init(this),i(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return this}get instancesList(){return Object.values(this.instances)}isOperationDeclaration(e){return this.operationDeclarations.includes(e)}isGlobalEventActionDescriptor(e){return this.globalEventActionDescriptors.includes(e)}isLoopDeclaration(e){return this.loopDeclarations.includes(e)}isConditionDeclaration(e){return this.conditionDeclarations.includes(e)}initChildren(){return this.entities=this.initialData.entities.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.projects=this.initialData.projects.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functions=this.initialData.functions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableDeclarations=this.initialData.variableDeclarations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.variableInstances=this.initialData.variableInstances.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.conditions=this.initialData.conditions.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.operations=this.initialData.operations.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.functionCalls=this.initialData.functionCalls.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.loops=this.initialData.loops.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.searches=this.initialData.searches.map(e=>{const t=R(e,this);return t.setParent(this),t.initChildren(),t}),this.attachOrphanReferences(),this.validate(),this}subscribeInstance(e){return(!this.instances[e.id]||this.instances[e.id]!==e)&&(this.instances[e.id]=e),this}subscribeBuiltInInstance(e){return(!this.builtInInstances[e.id]||this.builtInInstances[e.id]!==e)&&(this.builtInInstances[e.id]=e),this}subscribe(){return this}unsubscribe(){return this}unsubscribeInstance(e){return delete this.instances[e.id],this}findSubscribedInstance(e){return this.instances[e.id]||null}findSubscribedBuiltInInstance(e){return this.builtInInstances[e.id]||null}get(e){return this.instances[e]||this.builtInInstances[e]||null}getManaged(e){return this.instances[e]||null}getBuiltIn(e){return this.builtInInstances[e]||null}findSubscribedInstanceFromReference(e){return this.instances[e.entityId]||null}findSubscribedBuiltInInstanceFromReference(e){return this.builtInInstances[e.entityId]||null}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.description=e.description||this.description,this.x=e.x||this.x,this.y=e.y||this.y,this}async load(){return this}async create(){return this}async update(e){return this}async delete(){return this}remove({ignoreUpstream:e}={ignoreUpstream:!1}){return{affected:[],removed:[]}}restore({seenEntities:e}={seenEntities:new Set}){return{affected:[],self:this}}getAllBuiltInIds(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlatIds(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlatIds(e)),...this.operationDeclarations.flatMap(t=>t.toFlatIds(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlatIds(e)),...this.loopDeclarations.flatMap(t=>t.toFlatIds(e)),...this.conditionDeclarations.flatMap(t=>t.toFlatIds(e)),...this.valueDescriptors.flatMap(t=>t.toFlatIds(e)),...this.dataTypes.flatMap(t=>t.toFlatIds(e))]}getAllBuiltIn(){const e=new Set;return[...this.primitives.flatMap(t=>t.toFlat(e)),...this.builtInBaseEntities.flatMap(t=>t.toFlat(e)),...this.operationDeclarations.flatMap(t=>t.toFlat(e)),...this.globalEventActionDescriptors.flatMap(t=>t.toFlat(e)),...this.loopDeclarations.flatMap(t=>t.toFlat(e)),...this.conditionDeclarations.flatMap(t=>t.toFlat(e)),...this.valueDescriptors.flatMap(t=>t.toFlat(e)),...this.dataTypes.flatMap(t=>t.toFlat(e))]}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlat(e)),...this.functions.flatMap(i=>i.toFlat(e)),...this.events.flatMap(i=>i.toFlat(e)),...this.projects.flatMap(i=>i.toFlat(e)),...this.variableDeclarations.flatMap(i=>i.toFlat(e)),...this.variableInstances.flatMap(i=>i.toFlat(e)),...this.conditions.flatMap(i=>i.toFlat(e)),...this.operations.flatMap(i=>i.toFlat(e)),...this.functionCalls.flatMap(i=>i.toFlat(e)),...this.loops.flatMap(i=>i.toFlat(e)),...this.searches.flatMap(i=>i.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+Z.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toReference()),functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),projects:this.projects.map(e=>e.toReference()),variableDeclarations:this.variableDeclarations.map(e=>e.toReference()),variableInstances:this.variableInstances.map(e=>e.toReference()),conditions:this.conditions.map(e=>e.toReference()),operations:this.operations.map(e=>e.toReference()),functionCalls:this.functionCalls.map(e=>e.toReference()),loops:this.loops.map(e=>e.toReference()),searches:this.searches.map(e=>e.toReference())}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatJSON(e)),...this.functions.flatMap(i=>i.toFlatJSON(e)),...this.events.flatMap(i=>i.toFlatJSON(e)),...this.projects.flatMap(i=>i.toFlatJSON(e)),...this.variableDeclarations.flatMap(i=>i.toFlatJSON(e)),...this.variableInstances.flatMap(i=>i.toFlatJSON(e)),...this.conditions.flatMap(i=>i.toFlatJSON(e)),...this.operations.flatMap(i=>i.toFlatJSON(e)),...this.functionCalls.flatMap(i=>i.toFlatJSON(e)),...this.loops.flatMap(i=>i.toFlatJSON(e)),...this.searches.flatMap(i=>i.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,description:this.description}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.entities.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.events.flatMap(i=>i.toFlatGenerationTarget(e)),...this.projects.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(i=>i.toFlatGenerationTarget(e)),...this.conditions.flatMap(i=>i.toFlatGenerationTarget(e)),...this.operations.flatMap(i=>i.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.loops.flatMap(i=>i.toFlatGenerationTarget(e)),...this.searches.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.entities.forEach(e=>e.clearErrors()),this.projects.forEach(e=>e.clearErrors()),this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this.variableDeclarations.forEach(e=>e.clearErrors()),this.variableInstances.forEach(e=>e.clearErrors()),this.conditions.forEach(e=>e.clearErrors()),this.operations.forEach(e=>e.clearErrors()),this.functionCalls.forEach(e=>e.clearErrors()),this.loops.forEach(e=>e.clearErrors()),this.searches.forEach(e=>e.clearErrors()),this}validate(){const e=Ox(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Z(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(i=>i.id===e.id);if(t>-1){const i=this.entities[t];return this.entities.splice(t,1),i}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(i=>i.id===e.id);if(t>-1){const i=this.functions[t];return this.functions.splice(t,1),i}return null}removeExternalProject(e){const t=this.projects.findIndex(i=>i.id===e.id);if(t>-1){const i=this.projects[t];return this.projects.splice(t,1),i}return null}removeGlobalEvent(e){const t=this.events.findIndex(i=>i.id===e.id);if(t>-1){const i=this.events[t];return this.events.splice(t,1),i}return null}removeTopLevelVariableDeclaration(e){if(e.type!==r.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(i=>i.id===e.id);if(t>-1){const i=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),i}return null}getEntryPoints(){return[...this.functions,...this.events,...this.entities.flatMap(t=>t.methods)]}getFunctionDeclaration(e){return this.functions.find(t=>t.id===e)||null}getConditions(){return[...this.conditions,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Me(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.functionCalls.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.conditions.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.operations.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.loops.reduce((t,i)=>{const a=z(i);return[...t,...a]},[]),...this.searches.reduce((t,i)=>{const a=z(i);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return S([...this.variableDeclarations,...this.getEntryPoints().reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,i)=>{const s=z(i).filter(o=>o.type===r.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(i=>{if(!i.declaration){const a=i.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(u=>u.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===w.PERSISTED_ENTITY)||null}};l(Z,"UUID",$m()),l(Z,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(Z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Z,"BASE_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,...Z.INMUTABLE_BASE_PROPERTIES]),l(Z,"MUTABLE_META_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,"x","y"]),l(Z,"INMUTABLE_META_PROPERTIES",[...Z.INMUTABLE_BASE_PROPERTIES]),l(Z,"META_PROPERTIES",[...Z.MUTABLE_META_PROPERTIES,...Z.INMUTABLE_META_PROPERTIES]),l(Z,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Z,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(Z,"UPSTREAM_PROPERTIES",[...Z.MUTABLE_UPSTREAM_PROPERTIES,...Z.INMUTABLE_UPSTREAM_PROPERTIES]),l(Z,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(Z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Z,"DOWNSTREAM_PROPERTIES",[...Z.MUTABLE_DOWNSTREAM_PROPERTIES,...Z.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Z,"PROPERTIES",[...Z.META_PROPERTIES,...Z.UPSTREAM_PROPERTIES,...Z.DOWNSTREAM_PROPERTIES]);let $=Z;class Uv extends _e{constructor(t){super($t,t);l(this,"id",Ie.Parallel);l(this,"name",Ie.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",$t);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");this.project=t,this.fixedArguments=$t.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=$t.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=$t.error?R($t.error,this.project):null}}class xv extends _e{constructor(t){super(ot,t);l(this,"id",ot.id);l(this,"name",ot.name);l(this,"description",ot.description);l(this,"version",ot.version);l(this,"autoexecutable",!1);l(this,"initialData",ot);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");this.project=t,this.fixedArguments=ot.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ot.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ot.error?R(ot.error,this.project):null}}class jv extends _e{constructor(t){super(tn,t);l(this,"id",Ie.Sequential);l(this,"name",Ie.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",tn);l(this,"type",r.ActionDescriptor);l(this,"fixedArguments",[]);l(this,"fixedReturns",[]);l(this,"error",null);l(this,"dynamicArgumentTypes",null);l(this,"dynamicReturnTypes",null);l(this,"project");this.project=t,this.fixedArguments=tn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=tn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=tn.error?R(tn.error,this.project):null}}function n3(n){const e=[new jv(n),new Uv(n),new xv(n),new _e(hi,n),new _e(Sr,n),new _e(xn,n),new _e(Ra,n),new _e(vo,n),new _e(Do,n),new _e(Po,n),new _e(ma,n),new _e(pi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class kv extends Ut{constructor(t){super(Be,t);l(this,"initialData");l(this,"id",w.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",w.PERSISTED_ENTITY);l(this,"description",Be.description);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",Be.abstract);l(this,"static",Be.static);l(this,"properties",[]);l(this,"methods",[]);l(this,"abstractMethods",[]);l(this,"extends",[]);l(this,"errors",[]);l(this,"project");this.initialData=Be,this.project=t,this.id=Be.id,this.version=Be.version,this.name=Be.name,this.static=Be.static,this.abstract=Be.abstract,this.properties=this.initialData.properties.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(i=>{const a=R(i,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}}function r3(n){const e=[new kv(n),new Ut(Sa,n),new Ut(bn,n),new Ut(jo,n),new Ut(Aa,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function i3(n){const e=[new Nt(F,n),new Nt(Fn,n),new Nt(Ce,n),new Nt(Xe,n),new Nt(Rn,n),new Nt(Ar,n),new Nt(fa,n),new Nt(Eo,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function a3(n){const e=[new _e(_a,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function s3(n){const e=[new _e(jn,n),new _e(Vo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function o3(n){const e=[new Er(Wo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function l3(n){const e=[new _e(kn,n),new _e(Cr,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const di={},ho={};async function c3(n,e={}){const t={...XR};return t.id=n.id,e.empty?{data:{id:n.id,type:r.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function qv(n){const e=new $(n);return i3(e),r3(e),n3(e),a3(e),s3(e),o3(e),l3(e),e.initChildren(),e}async function d3(n,e={}){try{if(n.id&&di[n.id])return di[n.id];if(n.id&&ho[n.id])return await ho[n.id],di[n.id];const t=c3(n,e);n.id&&(ho[n.id]=t);const i=await t;if(i.data){const a=qv(i.data);return di[n.id]=a,n.id&&delete ho[n.id],a}return null}catch(t){return console.error("Error fetching project",t),null}}function u3(n){return di[n.id]&&delete di[n.id],null}const p3="test_primitive_entities_export";d.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=hd,d.ActionDescriptorState=_e,d.ActionDescriptorValuesType=L,d.ActionInputMapState=d6,d.ActionOutputMapState=y6,d.AppendToListOperationInputIds=rp,d.AppendToListOperationOutputIds=ip,d.ArgumentDeclarationState=mr,d.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=dd,d.BUILT_IN_BASE_ENTITY_IDS=Ve,d.BUILT_IN_ENTITY_TYPES=Dr,d.BaseCanvasDraggableState=z9,d.BaseEntityNames=w,d.BaseState=Y9,d.BaseValueDescriptorIds=_o,d.BreakStatementState=li,d.BuiltInBaseEntityState=Ut,d.CALLABLE_ENTITIES_EXPLANATION=D6,d.CALLABLE_TYPES=En,d.CALLER_ENTITIES_EXPLANATION=tv,d.CALLER_TYPES=en,d.CALLS_UPDATE_EXPLANATION=$n,d.COMPARISON_CONDITIONS=em,d.CONDITIONS=bI,d.CUSTOM_ENTITY_OPERATIONS=Ey,d.CallableEntityClass=X9,d.CallerEntityClass=sd,d.ChildEntityState=Z9,d.ComparisonOperatorTypes=Ae,d.ConditionState=ur,d.ContinueStatementState=yt,d.CreateNewInputIds=Yp,d.CreateNewOutputIds=zp,d.CustomEntityState=Ir,d.DRAGGABLE_CALLABLE_TYPES=mo,d.DRAGGABLE_CALLER_TYPES=Bd,d.DRAGGABLE_ELEMENT_TYPES=To,d.DRAGGABLE_EXECUTABLE_TYPES=zv,d.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=fo,d.DataTypeCompatibilityTypes=wt,d.DataTypeParentChildRelation=qe,d.DataTypeState=ii,d.ENTITIES_WITH_VALLUES_EXPLANATION=eo,d.ENTITY_TYPES=Zv,d.ENTITY_WITH_LOGIC_SCOPE_TYPES=st,d.ENTITY_WITH_NAMES_TYPES=wd,d.ENTITY_WITH_VALUE_TYPES=Cd,d.ENTRY_POINT_ENTITIES_EXPLANATION=ca,d.ENTRY_POINT_TYPES=$e,d.EVENT_TYPES=Pr,d.EXECUTABLE_TYPES=Yv,d.EXECUTION_OPERATIONS=Hp,d.EntityError=Xn,d.EntityErrorSeverity=f,d.EntityGenerationError=E,d.EntityGenerationErrorCode=y,d.EntityInstanceErrorCode=M,d.EntityOperations=Ze,d.EntityType=r,d.EntityWithLogicScopeClass=t6,d.EntityWithValueClass=e6,d.EntryPointEntityClass=Q9,d.ExecutionOperations=Ie,d.FunctionCallState=Rr,d.FunctionDeclarationState=lr,d.GLOBAL_EVENT_DECLARATIONS=gI,d.GetLastInListOperationInputIds=Ju,d.GetLastInListOperationOutputIds=Wu,d.GlobalEventNames=Kt,d.GlobalEventState=ai,d.HTTPOperations=Ye,d.HTTP_OPERATIONS=Qy,d.InputMapState=hn,d.InstalledProjectState=fr,d.InternalCallState=si,d.JoinListOperationInputIds=uu,d.JoinListOperationOutputIds=pu,d.JoinStringOperationInputIds=Xd,d.JoinStringOperationOutputIds=Qd,d.LIST_OPERATIONS=Tp,d.ListOperations=j,d.LoopState=dr,d.LoopTypes=je,d.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Vn,d.NUMBER_OPERATIONS=Zd,d.NumberAdditionOperationInputIds=Ld,d.NumberAdditionOperationOutputIds=Gd,d.NumberOperations=at,d.OPERATION_DECLARATIONS=Qv,d.OperationState=cr,d.OutputMapParentChildRelation=Od,d.OutputMapState=fn,d.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=to,d.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Nn,d.PASS_THROUGH_CALLABLE_TYPES=Ne,d.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=yd,d.ParallelExecutionOperation=Uv,d.ParallelExecutionOperationInputIds=Ep,d.ParallelExecutionOperationOutputIds=Rp,d.PassThroughCallableEntityClass=K9,d.PersistedEntity=kv,d.PersistedEntityMethods=vt,d.PrimitiveEntityState=Nt,d.PrimitiveTypes=g,d.PrimitiveValueState=oi,d.ProjectState=$,d.PropertyState=or,d.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=A6,d.ReturnDeclarationState=Ot,d.ReturnStatementState=Tr,d.STANDALONE_CONDITIONS=Yf,d.STRING_OPERATIONS=du,d.ScopeCompatibilityType=yo,d.SearchState=hr,d.SequentialExecutionOperation=jv,d.SequentialExecutionOperationInputIds=Vp,d.SequentialExecutionOperationOutputIds=Lp,d.SharedEntityErrorCode=v,d.SharedStateFunctionality=Qg,d.SplitListOperationInputIds=Su,d.SplitListOperationOutputIds=Ou,d.StandaloneOperatorTypes=Ct,d.StringOperations=ve,d.TERMINATION_TYPES=Oe,d.USER_MANAGED_ENTITY_TYPES=Xv,d.UserManagedEntityStateFunctionality=H9,d.VALUE_READING_ENTITIES_EXPLANATION=pd,d.VALUE_READING_TYPES=Tn,d.VALUE_WRITING_ENTITIES_EXPLANATION=nv,d.VALUE_WRITING_TYPES=Se,d.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=ud,d.VARIABLE_TYPES=Fe,d.ValidationInputIds=iy,d.ValidationOutputIds=ay,d.ValueAutogenerationType=xe,d.ValueDescriptorParentChildRelation=O,d.ValueDescriptorState=Er,d.ValueReadingEntityClass=oa,d.ValueWritingEntityClass=la,d.VariableDeclarationState=pr,d.VariableInputMapState=c6,d.VariableInstanceState=yr,d.VariableOutputMapState=p6,d.WaitOperation=xv,d.WaitOperationInputIds=Cp,d.WaitOperationOutputIds=Bp,d._VALUE_READING_TYPES=Wv,d._VALUE_WRITING_TYPES=Hv,d.appendToListOperation=Ra,d.appendToListOperationElementToAppendArgument=So,d.appendToListOperationElementToAppendArgumentParentRef=pp,d.appendToListOperationElementToAppendArgumentRef=op,d.appendToListOperationError=mp,d.appendToListOperationErrorParentRef=fp,d.appendToListOperationListArgument=Ao,d.appendToListOperationListArgumentParentRef=up,d.appendToListOperationListArgumentRef=ap,d.appendToListOperationListDataType=sp,d.appendToListOperationResultListDataType=dp,d.appendToListOperationResultListReturn=hp,d.appendToListOperationResultListReturnParentRef=yp,d.appendToListOperationResultListReturnRef=cp,d.appendToListOperationSecondListDataType=lp,d.asGenerationActionExample=Qt,d.baseHttpRequestFunctionDeclaration=hi,d.baseHttpRequestFunctionDeclarationErrorValueDescriptor=$o,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=Xy,d.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=Zy,d.baseHttpRequestFunctionDeclarationRef=Wy,d.baseHttpRequestFunctionDeclarationRefEight=Yy,d.baseHttpRequestFunctionDeclarationRefFive=qy,d.baseHttpRequestFunctionDeclarationRefFour=ky,d.baseHttpRequestFunctionDeclarationRefNine=zy,d.baseHttpRequestFunctionDeclarationRefSeven=Hy,d.baseHttpRequestFunctionDeclarationRefSix=Jy,d.baseHttpRequestFunctionDeclarationRefThree=jy,d.baseHttpRequestFunctionDeclarationRefTwo=xy,d.booleanPrototype=Fn,d.capitalizeFirstLetter=Js,d.checkAreCustomEntitiesCompatibleAsDataType=Vg,d.checkAreDataTypesCompatible=Ws,d.checkArePropertiesCompatibleAsDataType=$g,d.checkIsBranchDependentButNotDirectlyOnBranch=ua,d.checkIsBranchDependentOnBranch=$6,d.checkIsCallableEntityReachable=Sd,d.checkIsCanvasEntity=Z6,d.checkIsDetachedBranch=Mv,d.checkIsDetachedBranchShallow=Dd,d.checkIsGlobalVariable=z6,d.checkIsGloballyDeclared=Pd,d.checkIsMethod=Vv,d.checkIsNestedScope=po,d.checkScopeCompatibility=pa,d.createEntityError=H,d.createNewInstanceOperation=Sr,d.createNewInstanceOperationEntityToInstanciateArgument=Kp,d.createNewInstanceOperationEntityToInstanciateArgumentRef=Zp,d.createNewInstanceOperationEntityToInstanciateDataType=Xp,d.createNewInstanceOperationError=ry,d.createNewInstanceOperationErrorParentRef=ny,d.createNewInstanceOperationOutputEntityDeclaration=ty,d.createNewInstanceOperationOutputEntityDeclarationParentRef=ey,d.createNewInstanceOperationRef=Qp,d.createSemanticId=Xt,d.createStateFromGenerationTargetType=t3,d.createStateFromType=ha,d.createStateFromTypeAndSubscribe=R,d.cronJobBuiltInBaseEntity=jo,d.cronJobBuiltInBaseEntityExpressionProperty=qf,d.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=TI,d.cronJobBuiltInBaseEntityExpressionPropertyRef=jf,d.cronJobBuiltInBaseEntityRef=kf,d.cronJobTriggeredFunctionDeclarationBlueprint=xo,d.cronJobTriggeredFunctionDeclarationBlueprintParentRef=Uf,d.customEntityToZodSchema=Em,d.dataTypeCompatibilityToErrorExplanation=dv,d.datePrototype=Ar,d.dateValueAutogenerationSchema=Wl,d.deletePersistedEntityMethod=Uo,d.deletePersistedEntityMethodParentRef=Ef,d.deleteRootProject=u3,d.endpointBuiltInBaseEntity=Sa,d.endpointBuiltInBaseEntityRef=Rh,d.endpointBuiltInBaseEntityRefFour=lf,d.endpointBuiltInBaseEntityRefThree=Oh,d.endpointBuiltInBaseEntityRefTwo=Ph,d.endpointBuiltInCorsProperty=bh,d.endpointBuiltInCorsPropertyDataType=Eh,d.endpointBuiltInCorsPropertyDataTypeRef=mh,d.endpointBuiltInCorsPropertyRef=Th,d.endpointBuiltInMethodProperty=Go,d.endpointBuiltInMethodPropertyDataType=Sh,d.endpointBuiltInMethodPropertyDataTypeRef=Dh,d.endpointBuiltInMethodPropertyRef=Ah,d.endpointBuiltInPathProperty=Lo,d.endpointBuiltInPathPropertyDataType=Ih,d.endpointBuiltInPathPropertyDataTypeRef=gh,d.endpointBuiltInPathPropertyRef=vh,d.endpointPathParamsArgumentDeclaration=kh,d.endpointPathParamsArgumentDeclarationRef=Gh,d.endpointPathParamsVariableDataType=Fh,d.endpointPathParamsVariableDataTypeRef=Lh,d.endpointReachedTriggerActionDescriptor=Fo,d.endpointReachedTriggerActionDescriptorRef=Uh,d.endpointReachedTriggerActionDescriptorRefFour=Wh,d.endpointReachedTriggerActionDescriptorRefThree=qh,d.endpointReachedTriggerActionDescriptorRefTwo=jh,d.endpointRequestBodyArgumentDeclaration=Hh,d.endpointRequestBodyArgumentDeclarationRef=_h,d.endpointRequestBodyVariableDataType=Mh,d.endpointRequestHeadersArgumentDeclaration=xh,d.endpointRequestHeadersArgumentDeclarationRef=Bh,d.endpointRequestHeadersVariableDataType=wh,d.endpointRequestHeadersVariableDataTypeRef=Ch,d.endpointRequestQueryParamsArgumentDeclaration=Jh,d.endpointRequestQueryParamsArgumentDeclarationRef=$h,d.endpointRequestQueryParamsVariableDataType=Vh,d.endpointRequestQueryParamsVariableDataTypeRef=Nh,d.endpointResponseBodyDataType=af,d.endpointResponseBodyReturnDeclaration=of,d.endpointResponseBodyReturnDeclarationRef=rf,d.endpointResponseCodeDataType=zh,d.endpointResponseCodeReturnDeclaration=Xh,d.endpointResponseCodeReturnDeclarationRef=Yh,d.endpointResponseHeadersDataType=ef,d.endpointResponseHeadersDataTypeRef=Qh,d.endpointResponseHeadersReturnDeclaration=nf,d.endpointResponseHeadersReturnDeclarationRef=Kh,d.endpointReturnStatementRef=Zh,d.endpointReturnStatementRefThree=sf,d.endpointReturnStatementRefTwo=tf,d.enumOptionsProperty=Vd,d.enumOptionsPropertyDataType=Nd,d.enumOptionsPropertyDataTypeRef=_d,d.enumOptionsPropertyRef=Md,d.enumPrototype=Rn,d.enumPrototypeRef=$d,d.executionBuiltInEntity=qo,d.executionBuiltInEntityAbortMethod=ko,d.executionBuiltInEntityAbortMethodParentRef=Jf,d.filterOutDuplicateEntities=S,d.filterOutDuplicateErrors=HF,d.findReferenceToSelfInList=Pv,d.findReferencesToSelfInProject=k6,d.flattenCalls=br,d.flattenCanvasAncestorsUntil=so,d.flattenCustomEntityExtensionAndImplementationTypes=Cv,d.flattenCustomEntityExtensionTypes=co,d.flattenCustomEntityExtensions=vd,d.flattenCustomEntityImplementations=Id,d.flattenCustomEntityImplementionTypes=lo,d.flattenDerivedCanvasEntities=gt,d.flattenDetachedBranch=$v,d.flattenElementCalls=Me,d.flattenProjectElements=Iv,d.flattenRelatedCanvasElementsOnTheLeft=Ov,d.flattenRelatedCanvasElementsOnTheRight=Sv,d.flattenVariableReads=vv,d.flattenVariableWrites=gv,d.flattenVariables=z,d.fromZodParseToEntityGenerationErrors=od,d.generate=ED,d.generateActionExample=S6,d.generateExecutionDataType=Lg,d.generateMutablePropertiesExplanation=Xs,d.generateRandomBoolean=Jm,d.generateRandomDate=vm,d.generateRandomDateAfter=Rm,d.generateRandomDateBefore=bm,d.generateRandomDateBetweenRange=gm,d.generateRandomNumber=Um,d.generateRandomNumberAfter=Lm,d.generateRandomNumberBefore=Gm,d.generateRandomNumberBetweenRange=Fm,d.generateRandomText=qm,d.generateRandomTextAfter=xm,d.generateRandomTextBefore=jm,d.generateRandomTextBetweenRange=km,d.generateUniqueUUID=Vm,d.getAllActionDescriptorsForConditions=io,d.getAllActionDescriptorsForGlobalEvents=no,d.getAllActionDescriptorsForLoops=ro,d.getAllActionDescriptorsForOperations=w6,d.getAllGloballyDeclaredFunctionDeclarationsExplanation=ov,d.getBaseBuiltInEntities=Gn,d.getBaseSchemaBasedOnType=Kg,d.getBuiltInEntityOwner=vr,d.getCallableEntityReferenceSchema=ke,d.getCallableEntityTypeSchema=vb,d.getCallerEntityReferenceSchema=QU,d.getCallerEntityTypeSchema=XU,d.getCalls=Td,d.getCanvasEntitiesDerivedFromInternalCalls=Av,d.getCanvasEntitiesDerivedFromWrites=ci,d.getCanvasEntityDerivedFromValueReadingEntity=gd,d.getCanvasEntityReferenceSchema=fx,d.getCanvasEntityTypeSchema=hx,d.getChildrenEntityWithValues=L6,d.getCommonAncestor=md,d.getCommonChildren=yv,d.getDeclaration=Zc,d.getDeepestScope=Fv,d.getDraggableCallableEntityReferenceSchema=Pb,d.getDraggableCallableEntityTypeSchema=Ib,d.getDraggableCallerEntityReferenceSchema=ex,d.getDraggableCallerEntityTypeSchema=KU,d.getDraggableExecutableEntityReferenceSchema=ix,d.getDraggableExecutableEntityTypeSchema=rx,d.getDraggablePassThroughCallableEntityReferenceSchema=Ls,d.getDraggablePassThroughCallableEntityTypeSchema=Vs,d.getDraggablePlayableEntityReferenceSchema=cx,d.getDraggablePlayableEntityTypeSchema=lx,d.getEntityArgumentDeclarations=Rd,d.getEntityInputMaps=Dv,d.getEntityOutputMaps=W6,d.getEntityReferenceSchema=yx,d.getEntityReturnDeclarations=bd,d.getEntityTypeSchema=px,d.getEntityWithLogicScopeReferenceSchema=un,d.getEntityWithLogicScopeTypeSchema=ax,d.getEntityWithValueReferenceSchema=gb,d.getEntityWithValueTypeSchema=ZU,d.getEntryPointEntityReferenceSchema=Ue,d.getEntryPointEntityTypeSchema=wn,d.getEventEntityReferenceSchema=Ns,d.getEventEntityTypeSchema=Ms,d.getExecutableEntityReferenceSchema=nx,d.getExecutableEntityTypeSchema=tx,d.getExtendedBuiltInEntity=H6,d.getExtendedCustomEntity=wv,d.getGenerationTargetSchemaBasedOnType=ev,d.getHeadIfPartOfDetachedBranch=Nv,d.getHighestScope=Gv,d.getImplementedBuiltInEntity=Y6,d.getIsInteractive=_v,d.getLastInListOperation=Do,d.getLastInListOperationError=np,d.getLastInListOperationErrorParentRef=tp,d.getLastInListOperationInputListArgument=Qu,d.getLastInListOperationInputListArgumentParentRef=Xu,d.getLastInListOperationInputListArgumentRef=Hu,d.getLastInListOperationInputListDataType=Yu,d.getLastInListOperationOutputElementDataType=Zu,d.getLastInListOperationOutputElementReturn=ep,d.getLastInListOperationOutputElementReturnParentRef=Ku,d.getLastInListOperationOutputElementReturnRef=zu,d.getLinkedEntitiesFromArgumentDeclaration=j6,d.getLowestPersistedEntityImplementation=Bv,d.getParentCanvasEntities=_t,d.getParentCanvasEntity=He,d.getParentEntryPoint=V6,d.getPassThroughCallableEntityReferenceSchema=ye,d.getPassThroughCallableEntityTypeSchema=$s,d.getPlayableEntityReferenceSchema=ox,d.getPlayableEntityTypeSchema=sx,d.getProject=d3,d.getPrototypeByType=uo,d.getReferenceEntityId=D,d.getReferencedEntitiesStateOrErrors=Ks,d.getReferencedEntityStateOrErrors=ld,d.getRelatedCanvasElementsOnTheLeft=gr,d.getRelatedCanvasElementsOnTheRight=Ln,d.getRootEntryPointScopeOwner=Ad,d.getScopeOwner=ht,d.getTerminationReferenceSchema=ux,d.getTerminationTypeSchema=dx,d.getUsedArgFromDeclaration=q6,d.getUsedReturnFromDeclaration=J6,d.getValueReadingEntityReferenceSchema=bb,d.getValueReadingEntityTypeSchema=dn,d.getValueWritingEntityReferenceSchema=zU,d.getValueWritingEntityTypeSchema=Xi,d.getVariableFromInputMapping=fv,d.getVariableFromReturnVariablePointer=Ev,d.getVariableReferenceSchema=Bn,d.getVariableTypeSchema=er,d.getVariablesFromArgumentDeclarations=oo,d.getVariablesFromInputMaps=mv,d.getVariablesFromOutputMapping=Rv,d.getVariablesFromOutputMaps=bv,d.getVariablesFromReturnDeclarations=Tv,d.getVariablesInSameOrHigherScope=Xc,d.getWrites=Ed,d.groupCallsBasedOnParallelizableExecution=F6,d.handleAfterEntityImplementationSideEffects=pv,d.handleBeforeEntityImplementationSideEffects=uv,d.httpRequestBodyArgument=Ia,d.httpRequestBodyArgumentRef=wy,d.httpRequestBodyDataType=_y,d.httpRequestHeadersArgument=va,d.httpRequestHeadersArgumentRef=Cy,d.httpRequestHeadersDataType=By,d.httpRequestMethodArgument=ba,d.httpRequestMethodArgumentRef=Sy,d.httpRequestMethodDataType=Oy,d.httpRequestMethodDataTypeRef=Dy,d.httpRequestQueryParamsArgument=Mo,d.httpRequestQueryParamsArgumentRef=Iy,d.httpRequestQueryParamsDataType=Py,d.httpRequestVariableURLArgument=ga,d.httpRequestVariableURLArgumentRef=gy,d.httpRequestVariableURLDataType=vy,d.httpRequestVariableURLDataTypeRef=Ry,d.httpResponseBodyReturnDataType=Uy,d.httpResponseBodyReturnDataTypeRef=Gy,d.httpResponseBodyReturnReturn=yi,d.httpResponseBodyReturnReturnRef=Fy,d.httpResponseCodeDataType=Ny,d.httpResponseCodeReturn=No,d.httpResponseCodeReturnRef=My,d.httpResponseHeadersDataType=Ly,d.httpResponseHeadersDataTypeRef=$y,d.httpResponseHeadersReturn=Pa,d.httpResponseHeadersReturnRef=Vy,d.implement=ao,d.inferArgumentDeclarationDataType=Gg,d.inferDataType=Hs,d.inferInputMapDataType=Fg,d.inferOutputMapDataType=jg,d.inferVariableDeclarationDataType=xg,d.inferVariableInstanceDataType=Ug,d.initProject=qv,d.iterateOverListActionDescriptor=jn,d.iterateOverListActionDescriptorListArgumentDeclaration=ah,d.iterateOverListActionDescriptorListArgumentDeclarationDataType=rh,d.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=nh,d.iterateOverListActionDescriptorListArgumentDeclarationParentRef=ih,d.iterateOverListActionDescriptorReturnDeclaration=th,d.iterateOverListActionDescriptorReturnDeclarationParentRef=eh,d.joinListOperation=vo,d.joinListOperationError=Au,d.joinListOperationErrorParentRef=Du,d.joinListOperationFirstListArgument=bu,d.joinListOperationFirstListArgumentParentRef=Ru,d.joinListOperationFirstListArgumentRef=yu,d.joinListOperationFirstListDataType=hu,d.joinListOperationResultListDataType=Eu,d.joinListOperationResultListReturn=Pu,d.joinListOperationResultListReturnParentRef=Iu,d.joinListOperationResultListReturnRef=Tu,d.joinListOperationSecondListArgument=vu,d.joinListOperationSecondListArgumentParentRef=gu,d.joinListOperationSecondListArgumentRef=fu,d.joinListOperationSecondListDataType=mu,d.joinListWithLastSeparator=N,d.joinStringOperation=pi,d.joinStringOperationError=cu,d.joinStringOperationErrorParentRef=lu,d.joinStringOperationFirstStringArgument=Ta,d.joinStringOperationFirstStringArgumentParentRef=au,d.joinStringOperationFirstStringArgumentRef=Kd,d.joinStringOperationFirstStringDataType=eu,d.joinStringOperationResultStringDataType=iu,d.joinStringOperationResultStringReturn=ui,d.joinStringOperationResultStringReturnParentRef=ou,d.joinStringOperationResultStringReturnRef=ru,d.joinStringOperationSecondStringArgument=Ea,d.joinStringOperationSecondStringArgumentParentRef=su,d.joinStringOperationSecondStringArgumentRef=tu,d.joinStringOperationSecondStringDataType=nu,d.jsonPrototype=Eo,d.keyValueParamBuiltInBaseEntity=Aa,d.keyValueParamBuiltInBaseEntityNameProperty=ph,d.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=eI,d.keyValueParamBuiltInBaseEntityNamePropertyParentRef=uh,d.keyValueParamBuiltInBaseEntityNamePropertyRef=dh,d.keyValueParamBuiltInBaseEntityValueProperty=fh,d.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=nI,d.keyValueParamBuiltInBaseEntityValuePropertyParentRef=hh,d.keyValueParamBuiltInBaseEntityValuePropertyRef=yh,d.lowercaseFirstLetter=Ng,d.manualFlowActionDescriptor=Vo,d.manualFlowActionDescriptorDeclarationReturnDeclaration=ch,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=oh,d.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=sh,d.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=lh,d.mapActionDescriptorToTypeItRepresents=X6,d.mergeEntityErrorsList=YF,d.mergeListOfEntities=Lv,d.methodDefaultValue=Ay,d.mockClientProject=XR,d.moreThanOrEqualCondition=Cr,d.moreThanOrEqualConditionLeftHandArgument=Xf,d.moreThanOrEqualConditionLeftHandArgumentParentRef=Zf,d.moreThanOrEqualConditionRightHandArgument=Kf,d.moreThanOrEqualConditionRightHandArgumentParentRef=Qf,d.notEmptyCondition=kn,d.notEmptyConditionArgument=Hf,d.notEmptyConditionRef=Wf,d.numberAdditionOperation=ma,d.numberAdditionOperationError=zd,d.numberAdditionOperationErrorParentRef=Yd,d.numberAdditionOperationFirstNumberArgument=Ro,d.numberAdditionOperationFirstNumberArgumentRef=Fd,d.numberAdditionOperationFirstNumberDataType=Ud,d.numberAdditionOperationRef=Jd,d.numberAdditionOperationRefThree=Hd,d.numberAdditionOperationRefTwo=Wd,d.numberAdditionOperationResultNumberDataType=qd,d.numberAdditionOperationResultNumberReturn=go,d.numberAdditionOperationResultNumberReturnRef=kd,d.numberAdditionOperationSecondNumberArgument=bo,d.numberAdditionOperationSecondNumberArgumentRef=xd,d.numberAdditionOperationSecondNumberDataType=jd,d.numberPrototype=Ce,d.numberValueAutogenerationSchema=Jl,d.parallelExecutionOperation=$t,d.parallelExecutionOperationError=Op,d.parallelExecutionOperationErrorParentRef=Sp,d.parallelExecutionOperationListOfExecutionResultsDataType=Pp,d.parallelExecutionOperationListOfExecutionResultsReturn=Co,d.parallelExecutionOperationListOfExecutionResultsReturnRef=Ip,d.parallelExecutionOperationListOfFunctionsArgument=Oo,d.parallelExecutionOperationListOfFunctionsArgumentDatatype=vp,d.parallelExecutionOperationListOfFunctionsArgumentRef=gp,d.parallelExecutionOperationListOfFunctionsBlueprint=bp,d.parallelExecutionOperationRef=Dp,d.parallelExecutionOperationRefThree=Ap,d.persistedBuiltInBaseEntity=Be,d.persistedBuiltInBaseEntityCreatedAtProperty=$f,d.persistedBuiltInBaseEntityCreatedAtPropertyDataType=Mf,d.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=fI,d.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=Nf,d.persistedBuiltInBaseEntityCreatedAtPropertyRef=_f,d.persistedBuiltInBaseEntityDatabaseProperty=mi,d.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=uI,d.persistedBuiltInBaseEntityDatabasePropertyParentRef=If,d.persistedBuiltInBaseEntityDatabasePropertyRef=vf,d.persistedBuiltInBaseEntityDeletedAtProperty=wf,d.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Cf,d.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=hI,d.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Bf,d.persistedBuiltInBaseEntityDeletedAtPropertyRef=Of,d.persistedBuiltInBaseEntityIdentifierProperty=Sf,d.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=Pf,d.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Af,d.persistedBuiltInBaseEntityIdentifierPropertyRef=Df,d.persistedBuiltInBaseEntityUpdatedAtProperty=Ff,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=Lf,d.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=mI,d.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Gf,d.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Vf,d.processOutputGlobalValueDescriptorDataType=nm,d.processOutputGlobalValueDescriptorReturn=Wo,d.processOutputGlobalValueDescriptorReturnRef=tm,d.projectPublicationCompletedGlobalEvent=_a,d.propertyToZodSchema=Tm,d.relationalDatabaseBuiltInBaseEntity=bn,d.relationalDatabaseBuiltInBaseEntityDefaultProperty=Tf,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=ff,d.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=mf,d.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Oa,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=cf,d.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=df,d.relationalDatabaseBuiltInBaseEntityMinSizeProperty=wa,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=yf,d.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=hf,d.relationalDatabaseBuiltInBaseEntityPasswordProperty=Ba,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=oI,d.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=pf,d.relationalDatabaseBuiltInBaseEntityRef=Or,d.relationalDatabaseBuiltInBaseEntityUsernameProperty=Ca,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=aI,d.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=uf,d.resolveActionDescriptorName=Xg,d.resolveBaseEntityName=Yg,d.resolveBuiltInBaseEntityDataTypeLabel=Qc,d.resolveConditionOperatorLabel=zs,d.resolveCustomEntityDataTypeLabel=Kc,d.resolveDataType=zc,d.resolveDataTypeLabel=Jg,d.resolveEntityDataTypeLabel=Hg,d.resolveEntityName=A,d.resolveFirstCallsSecond=U6,d.resolveFirstWritesSecond=x6,d.resolvePrimitiveEntityName=Zg,d.resolvePropertyDataTypeLabel=Wg,d.resolveSearchName=zg,d.resolveVariableDataTypeLabel=_9,d.resolveVariableDeclarationDataTypeLabel=sr,d.resolveVariableInstanceDataTypeLabel=qg,d.resolveVariableScope=C9,d.sequentialExecutionOperation=tn,d.sequentialExecutionOperationError=Wp,d.sequentialExecutionOperationErrorParentRef=Jp,d.sequentialExecutionOperationListOfExecutionResultsDataType=jp,d.sequentialExecutionOperationListOfExecutionResultsReturn=wo,d.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=qp,d.sequentialExecutionOperationListOfExecutionResultsReturnRef=xp,d.sequentialExecutionOperationListOfFunctionsArgument=Bo,d.sequentialExecutionOperationListOfFunctionsArgumentDatatype=Up,d.sequentialExecutionOperationListOfFunctionsArgumentParentRef=kp,d.sequentialExecutionOperationListOfFunctionsArgumentRef=Fp,d.sequentialExecutionOperationListOfFunctionsBlueprint=Gp,d.softDeletePersistedEntityMethod=bf,d.softDeletePersistedEntityMethodParentRef=Rf,d.sortCallsBasedOnExecutionDependencies=hv,d.sortChildrenEntitiesBasedOnExecutionDependencies=G6,d.splitListOperation=Po,d.splitListOperationError=qu,d.splitListOperationErrorParentRef=ku,d.splitListOperationFirstOutputListDataType=Mu,d.splitListOperationFirstOutputListReturn=Fu,d.splitListOperationFirstOutputListReturnParentRef=Gu,d.splitListOperationFirstOutputListReturnRef=Io,d.splitListOperationInputListArgument=$u,d.splitListOperationInputListArgumentParentRef=Nu,d.splitListOperationInputListArgumentRef=Cu,d.splitListOperationInputListDataType=Bu,d.splitListOperationSecondOutputListDataType=Uu,d.splitListOperationSecondOutputListReturn=ju,d.splitListOperationSecondOutputListReturnParentRef=xu,d.splitListOperationSplitIndexArgument=Lu,d.splitListOperationSplitIndexArgumentParentRef=Vu,d.splitListOperationSplitIndexArgumentRef=wu,d.splitListOperationSplitIndexDataType=_u,d.stringPrototype=F,d.stringValueAutogenerationSchema=ql,d.suggestNewIdForEntity=ad,d.test_primitive_entities_export=p3,d.toCamelCase=B9,d.toEntityState=Mt,d.toKebabCase=kg,d.toLowerCaseKebabCase=Ys,d.toPascalCase=w9,d.untypedObjectPrototype=Xe,d.updateErrorsList=X,d.updateValueReader=ya,d.urlDefaultValue=by,d.uuidPrototype=fa,d.validateArgumentDeclarationName=rd,d.validateCalledByErrorIdInAction=C6,d.validateCalledByIdInAction=O6,d.validateCallers=sv,d.validateConditionEntityDeclaration=_6,d.validateCustomEntityName=Zs,d.validateDataOperation=xn,d.validateDataOperationDataToValidateArgument=cy,d.validateDataOperationDataToValidateArgumentParentRef=ly,d.validateDataOperationDataToValidateArgumentRef=sy,d.validateDataOperationDataToValidateDataType=oy,d.validateDataOperationEntityToMatchTypeArgument=yy,d.validateDataOperationEntityToMatchTypeArgumentParentRef=py,d.validateDataOperationEntityToMatchTypeArgumentRef=dy,d.validateDataOperationEntityToMatchTypeDataType=uy,d.validateDataOperationError=Ty,d.validateDataOperationErrorParentRef=my,d.validateDataOperationOutputEntityDeclaration=fy,d.validateDataOperationOutputEntityDeclarationParentRef=hy,d.validateEntryCaller=av,d.validateErrorCaller=iv,d.validateFunctionCallDeclaration=lv,d.validateFunctionDeclarationName=ed,d.validateGeneratedEntityParentIsNotBuiltInEntity=P6,d.validateGeneration=v6,d.validateGenerationTarget=Pe,d.validateGenerationUpdate=I6,d.validateLoopEntityDeclaration=M6,d.validateName=M9,d.validateOperationEntityDeclaration=cv,d.validatePropertyName=nd,d.validateReachability=mn,d.validateReadsValueInActionPayload=B6,d.validateReferenceObject=Qs,d.validateReferenceToOne=cd,d.validateReferences=Ge,d.validateReturnDeclarationName=id,d.validateSuccessCaller=rv,d.validateValueReaderGenerationUpdate=da,d.validateValueWritter=fd,d.validateVariableDeclarationName=td,d.valueAutogenerationCurrentDateAndTimeSchema=KR,d.valueAutogenerationGenericSchema=Es,d.valueAutogenerationOptions=Hl,d.valueAutogenerationOptionsSchema=QR,d.valueAutogenerationRandomBooleanSchema=kl,d.valueAutogenerationRandomDateBetweenSchema=lb,d.valueAutogenerationRandomDateFromSchema=sb,d.valueAutogenerationRandomDateSchema=gs,d.valueAutogenerationRandomDateUntilSchema=ob,d.valueAutogenerationRandomNumberBetweenSchema=nb,d.valueAutogenerationRandomNumberFromSchema=eb,d.valueAutogenerationRandomNumberSchema=Rs,d.valueAutogenerationRandomNumberUntilSchema=tb,d.valueAutogenerationRandomSchema=Wi,d.valueAutogenerationRandomTextBetweenSchema=ab,d.valueAutogenerationRandomTextFromSchema=rb,d.valueAutogenerationRandomTextSchema=bs,d.valueAutogenerationRandomTextUntilSchema=ib,d.valueAutogenerationRangeValueTypesSchema=Ji,d.valueAutogenerationUniqueSchema=jl,d.waitOperation=ot,d.waitOperationMillisecondsNumberArgument=Un,d.waitOperationMillisecondsNumberArgumentRef=wp,d.waitOperationMillisecondsNumberDataType=_p,d.waitOperationOperationError=$p,d.waitOperationOperationErrorParentRef=Np,d.waitOperationRef=Mp,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
@@ -16,5 +16,4 @@ export declare class ParallelExecutionOperation extends ActionDescriptorState {
16
16
  readonly dynamicReturnTypes: DataTypeState | null;
17
17
  project: ProjectState;
18
18
  constructor(parentProjectState: ProjectState);
19
- implementation: () => Promise<void>;
20
19
  }
@@ -1,6 +1,5 @@
1
1
  import { EntityType, IActionDescriptorTransfer, ExecutionOperations, IActionDescriptor } from '../../../../definitions';
2
2
  import { ActionDescriptorState } from '../../../state/action-descriptor';
3
- import { FunctionDeclarationState } from '../../../state/function-declaration';
4
3
  import { ValueDescriptorState, ProjectState, DataTypeState } from '../../../state';
5
4
 
6
5
  export declare class SequentialExecutionOperation extends ActionDescriptorState {
@@ -18,5 +17,4 @@ export declare class SequentialExecutionOperation extends ActionDescriptorState
18
17
  readonly dynamicReturnTypes: DataTypeState | null;
19
18
  project: ProjectState;
20
19
  constructor(parentProjectState: ProjectState);
21
- implementation: (_?: [FunctionDeclarationState[]]) => Promise<any[]>;
22
20
  }
@@ -16,5 +16,4 @@ export declare class WaitOperation extends ActionDescriptorState {
16
16
  readonly dynamicReturnTypes: DataTypeState | null;
17
17
  project: ProjectState;
18
18
  constructor(parentProjectState: ProjectState);
19
- implementation: (inputs?: [number]) => Promise<any[]>;
20
19
  }
@@ -13,6 +13,10 @@ import { LoopState } from '../loop';
13
13
  import { OperationState } from '../operation';
14
14
  import { ConditionState } from '../condition';
15
15
 
16
+ export interface IPrimitiveExecutionResult {
17
+ value: 'success' | 'error';
18
+ results: any[];
19
+ }
16
20
  export declare class ActionDescriptorState implements IActionDescriptor, UserManagedEntityStateFunctionality, BaseState, ChildEntityState {
17
21
  initialData: IActionDescriptorTransfer | IActionDescriptor;
18
22
  readonly id: EntityId;
@@ -27,7 +31,7 @@ export declare class ActionDescriptorState implements IActionDescriptor, UserMan
27
31
  error: ValueDescriptorState | null;
28
32
  dynamicArgumentTypes: DataTypeState | null;
29
33
  dynamicReturnTypes: DataTypeState | null;
30
- implementation: Function | null;
34
+ implementation: ((...inputs: any[]) => IPrimitiveExecutionResult | Promise<IPrimitiveExecutionResult>) | null;
31
35
  parent: CustomEntityState | PrimitiveEntityState | BuiltInBaseEntityState | DataTypeState | null;
32
36
  errors: EntityError[];
33
37
  project: ProjectState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyx-code/project-logic-tree",
3
- "version": "0.0.591",
3
+ "version": "0.0.593",
4
4
  "author": "Sergio Herrero",
5
5
  "license": "UNLICENSED",
6
6
  "description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",