@elyx-code/project-logic-tree 0.0.6002 → 0.0.6004
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 +13 -16
- package/dist/index.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22748,7 +22748,8 @@ Please consider that any updates might affect the overlap with the signature of
|
|
|
22748
22748
|
calledBySuccess: t.calledBySuccess || [],
|
|
22749
22749
|
calledByError: t.calledByError || [],
|
|
22750
22750
|
calledByEntry: t.calledByEntry || [],
|
|
22751
|
-
|
|
22751
|
+
// @ts-ignore This is because using the correct 'toJSON' method would recursively call the same method in other entities. Which during load, might not yet be available
|
|
22752
|
+
declaration: this.toShallowJSON(),
|
|
22752
22753
|
index: e.internalCalls.length
|
|
22753
22754
|
}, a = E(
|
|
22754
22755
|
i,
|
|
@@ -40775,22 +40776,18 @@ function a9(n) {
|
|
|
40775
40776
|
return K6(e), Q6(e), Z6(e), e9(e), t9(e), n9(e), r9(e), e.initChildren(), e;
|
|
40776
40777
|
}
|
|
40777
40778
|
async function J3(n, e = {}) {
|
|
40778
|
-
|
|
40779
|
-
|
|
40780
|
-
|
|
40781
|
-
|
|
40782
|
-
|
|
40783
|
-
|
|
40784
|
-
|
|
40785
|
-
|
|
40786
|
-
|
|
40787
|
-
|
|
40788
|
-
return ar[n.id] = a, n.id && delete ta[n.id], a;
|
|
40789
|
-
}
|
|
40790
|
-
return null;
|
|
40791
|
-
} catch (t) {
|
|
40792
|
-
return console.error("Error fetching project: ", t), null;
|
|
40779
|
+
if (n.id && ar[n.id])
|
|
40780
|
+
return ar[n.id];
|
|
40781
|
+
if (n.id && ta[n.id])
|
|
40782
|
+
return await ta[n.id], ar[n.id];
|
|
40783
|
+
const t = i9(n, e);
|
|
40784
|
+
n.id && (ta[n.id] = t);
|
|
40785
|
+
const i = await t;
|
|
40786
|
+
if (i.data) {
|
|
40787
|
+
const a = a9(i.data);
|
|
40788
|
+
return ar[n.id] = a, n.id && delete ta[n.id], a;
|
|
40793
40789
|
}
|
|
40790
|
+
return null;
|
|
40794
40791
|
}
|
|
40795
40792
|
function W3(n) {
|
|
40796
40793
|
return ar[n.id] && delete ar[n.id], null;
|
package/dist/index.umd.cjs
CHANGED
|
@@ -29,7 +29,7 @@ If you want to implement a new method, you can create a new 'function-declaratio
|
|
|
29
29
|
If you want to modify the existing implementation, you can update the existing method instead, but it will have to match the same base ${r.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}))}}else if(d&&d.type===r.Loop){const m=d.body;m&&((T=m.implements)==null?void 0:T.id)===i.implements&&a.push(new E({id:`${i.id}--${g.MethodOverwrite}`,code:g.MethodOverwrite,severity:f.Error,message:`The '${r.FunctionDeclaration}' with id "${i.id}" is being added as the 'body' of the ${r.Loop} with id "${d.id}", but the loop already has a function-declaration body. A loop can only have one function-declaration body at a time. You can edit the existing body instead, but it will have to match the same base signature, otherwise the implementation will have a validation error.`,issue:null}))}const p=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),h=p?Ir(p):null;return h&&a.push(new E({id:`${e.id}--${y.BuiltInEntityParent}`,code:y.BuiltInEntityParent,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${A(h,t)}" with id '${h.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null})),a.push(...s.errors,...o,...Ae(i)),{errors:a,modifiedData:i}}validateGeneratedUpdate(e){const t=[];return e.parent&&(this.parent.type===r.Project?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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
30
30
|
This is likely an incorrect strategy because this is a globally declared '${this.type}' entity which can only have the root project as its parent.`,issue:null})):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, as it would mean moving the '${this.type}' entity to another parent entity.
|
|
31
31
|
This is likely an incorrect strategy because this function declaration is a method, since it belongs to a '${this.parent.type}' entity, either the '${this.type}' entity doesn't need to be updated or it should be deleted and a new one created in the desired parent.
|
|
32
|
-
Please consider that any updates might affect the overlap with the signature of the parent entity's action descriptors.`,issue:null}))),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===r.CustomEntity?this.parent.addMethod(this):this.parent.type===r.Loop&&this.parent.setBody(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.indexOf(e);return t!==-1&&this.inputs.splice(t,1),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.implements&&(this.implements=R(this.initialData.implements,this.project)),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.description=e.description||this.description,this.private=e.private||this.private,this.index=e.index||this.index,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,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}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),It(this).forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),{affected:O(i),removed:O(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),It(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:O(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=It(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=It(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,x:this.x,y:this.y,collapsed:this.collapsed,private:this.private,parent:this.parent.toReference(),calls:this.calls.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),implements:((e=this.implements)==null?void 0:e.toJSON())||null,returnStatements:this.returnStatements.map(t=>t.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,collapsed:this.collapsed,private:this.private,x:this.x,y:this.y,inputs:this.inputs.map(t=>t.toReference()),calls:this.calls.map(t=>t.toReference()),returnStatements:this.returnStatements.map(t=>t.toReference()),implements:((e=this.implements)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;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,private:this.private,implements:((t=this.implements)==null?void 0:t.id)||null,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=i9(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=It(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new K(this.toJSON(),this.project)}getVariableInstances(){return Z(this).filter(i=>i.type===r.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const i={id:t.id||$.UUID.uuid(),version:t.version||1,type:r.FunctionCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toJSON(),x:0,y:0},a=R(i,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}createInternalCall(e,t={}){const i={id:t.id||$.UUID.uuid(),version:t.version||1,type:r.InternalCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toJSON(),index:e.internalCalls.length},a=R(i,this.project);return a.setParent(e),a.initChildren(),a}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(K,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),l(K,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(K,"BASE_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,...K.INMUTABLE_BASE_PROPERTIES]),l(K,"MUTABLE_META_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),l(K,"INMUTABLE_META_PROPERTIES",[...K.INMUTABLE_BASE_PROPERTIES]),l(K,"META_PROPERTIES",[...K.MUTABLE_META_PROPERTIES,...K.INMUTABLE_META_PROPERTIES]),l(K,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(K,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(K,"UPSTREAM_PROPERTIES",[...K.MUTABLE_UPSTREAM_PROPERTIES,...K.INMUATABLE_UPSTREAM_PROPERTIES]),l(K,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(K,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),l(K,"DOWNSTREAM_PROPERTIES",[...K.MUTABLE_DOWNSTREAM_PROPERTIES,...K.INMUATABLE_DOWNSTREAM_PROPERTIES]),l(K,"PROPERTIES",[...K.META_PROPERTIES,...K.UPSTREAM_PROPERTIES,...K.DOWNSTREAM_PROPERTIES]);let dr=K;function o9(n){const e=zU(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.entity&&n.andChildrenGroup||n.entity&&n.orChildrenGroup||n.andChildrenGroup&&n.orChildrenGroup){const s=j({id:n.id+"--"+S.InvalidPropertiesCombination,message:`Data type with id "${n.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:f.Error,code:S.InvalidPropertiesCombination,entity:n});a.push(s.error)}return X(n.errors,a)}function l9(n,e){const t=[],i=[r.CustomEntity,r.ActionDescriptor,r.Property,r.ArgumentDeclaration,r.ReturnDeclaration,r.VariableDeclaration,r.ValueDescriptor,r.DataType],a=`'${N(i,"', '","' or '")}'`;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 s=e.get(n.parent);s?i.includes(s.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 ${a}.`,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}))}else t.push(new E({id:`${n.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a 'data-type' entity must be a reference to an entity of type ${a}.`,issue:null}));if(n.entity){if(n.id===n.entity)return t.push(new E({id:`${n.id}--${n.entity}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'entity'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;const s=e.get(n.entity);s?[r.CustomEntity,r.PrimitiveEntity,r.ActionDescriptor,r.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${n.id}--${n.entity}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'entity' reference that isn't pointing to an entity of type 'custom-entity', 'primitive-entity', 'action-descriptor' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${n.entity}--${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.entity}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return t}const fe=class fe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"isNullable");l(this,"isList");l(this,"constant");l(this,"asType");l(this,"type",r.DataType);l(this,"options");l(this,"parentRelationType");l(this,"defaultValue",null);l(this,"entity",null);l(this,"andChildrenGroup");l(this,"orChildrenGroup");l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"inferred",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.isNullable=e.isNullable,this.isList=e.isList,this.constant=e.constant,this.asType=e.asType,this.options=e.options,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,defaultValue:null,entity:s,asType:e.asType,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var p;let i=JSON.parse(JSON.stringify(e));const a=[],s=l9(i,t);if(a.push(...s,...Ae(i)),i.entity){const h=t.get(i.entity);if(h.type===r.CustomEntity){const m=Un(h).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${N(m.map(I=>I.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${i.entity}' at 'entity'. The entity extends or implements non-interactive built-in-base-entity ${b}.
|
|
32
|
+
Please consider that any updates might affect the overlap with the signature of the parent entity's action descriptors.`,issue:null}))),{errors:t,modifiedData:e}}addSelfToProject(){return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===r.CustomEntity?this.parent.addMethod(this):this.parent.type===r.Loop&&this.parent.setBody(this),this}replaceDetachedChild(e,t){const i=this.detachedChildren.indexOf(e);return i!==-1&&(this.detachedChildren[i]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.indexOf(e);return t!==-1&&this.inputs.splice(t,1),this}setParent(e){return this.parent=e,this}addCall(e){return this.calls.includes(e)||this.calls.push(e),this}removeCall(e){const t=this.calls.indexOf(e);return t!==-1&&this.calls.splice(t,1),this}initChildren(){return this.initialized?this:(this.initialized=!0,this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.calls=this.initialData.calls.map(e=>{const t=R(e,this.project);return t.addEntryCaller(this),[r.BreakStatement,r.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==r.InternalCall&&(t.setParent(this),t.initChildren()),t}),this.returnStatements=this.initialData.returnStatements.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.implements&&(this.implements=R(this.initialData.implements,this.project)),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.description=e.description||this.description,this.private=e.private||this.private,this.index=e.index||this.index,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,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}){const i=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),It(this).forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),{affected:O(i),removed:O(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputs.forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),It(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:O(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=It(this);return[this,...this.inputs.flatMap(a=>a.toFlat(e)),...this.calls.flatMap(a=>a.toFlat(e)),...this.returnStatements.flatMap(a=>a.toFlat(e)),...this.implements?this.implements.toFlat(e):[],...t.flatMap(a=>a.toFlat(e))]}toFlatIds(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=It(this);return[this.id,...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.calls.flatMap(a=>a.toFlatIds(e)),...this.returnStatements.flatMap(a=>a.toFlatIds(e)),...this.implements?this.implements.toFlatIds(e):[],...t.flatMap(a=>a.toFlatIds(e))]}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,x:this.x,y:this.y,collapsed:this.collapsed,private:this.private,parent:this.parent.toReference(),calls:this.calls.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),implements:((e=this.implements)==null?void 0:e.toJSON())||null,returnStatements:this.returnStatements.map(t=>t.toJSON())}}toReference(){return{id:this.id+"--"+$.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,collapsed:this.collapsed,private:this.private,x:this.x,y:this.y,inputs:this.inputs.map(t=>t.toReference()),calls:this.calls.map(t=>t.toReference()),returnStatements:this.returnStatements.map(t=>t.toReference()),implements:((e=this.implements)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(i=>i.toFlatJSON(e)),...this.calls.flatMap(i=>i.toFlatJSON(e)),...this.returnStatements.flatMap(i=>i.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;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,private:this.private,implements:((t=this.implements)==null?void 0:t.id)||null,parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(i=>i.toFlatGenerationTarget(e)),...this.calls.flatMap(i=>i.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(i=>i.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.calls.forEach(e=>e.clearErrors()),this.returnStatements.forEach(e=>e.clearErrors()),this}validate(){const e=i9(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=It(this);return[...this.errors,...this.inputs.flatMap(i=>i.getErrors()),...e.flatMap(i=>i.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new K(this.toJSON(),this.project)}getVariableInstances(){return Z(this).filter(i=>i.type===r.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const i={id:t.id||$.UUID.uuid(),version:t.version||1,type:r.FunctionCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toJSON(),x:0,y:0},a=R(i,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}createInternalCall(e,t={}){const i={id:t.id||$.UUID.uuid(),version:t.version||1,type:r.InternalCall,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],error:t.error||null,process:t.process||null,calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],calledByEntry:t.calledByEntry||[],declaration:this.toShallowJSON(),index:e.internalCalls.length},a=R(i,this.project);return a.setParent(e),a.initChildren(),a}addReturnStatement(e){return this.returnStatements.includes(e)||this.returnStatements.push(e),this}removeReturnStatement(e){const t=this.returnStatements.indexOf(e);return t!==-1&&this.returnStatements.splice(t,1),this}};l(K,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),l(K,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),l(K,"BASE_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,...K.INMUTABLE_BASE_PROPERTIES]),l(K,"MUTABLE_META_PROPERTIES",[...K.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),l(K,"INMUTABLE_META_PROPERTIES",[...K.INMUTABLE_BASE_PROPERTIES]),l(K,"META_PROPERTIES",[...K.MUTABLE_META_PROPERTIES,...K.INMUTABLE_META_PROPERTIES]),l(K,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(K,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),l(K,"UPSTREAM_PROPERTIES",[...K.MUTABLE_UPSTREAM_PROPERTIES,...K.INMUATABLE_UPSTREAM_PROPERTIES]),l(K,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),l(K,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),l(K,"DOWNSTREAM_PROPERTIES",[...K.MUTABLE_DOWNSTREAM_PROPERTIES,...K.INMUATABLE_DOWNSTREAM_PROPERTIES]),l(K,"PROPERTIES",[...K.META_PROPERTIES,...K.UPSTREAM_PROPERTIES,...K.DOWNSTREAM_PROPERTIES]);let dr=K;function o9(n){const e=zU(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.entity&&n.andChildrenGroup||n.entity&&n.orChildrenGroup||n.andChildrenGroup&&n.orChildrenGroup){const s=j({id:n.id+"--"+S.InvalidPropertiesCombination,message:`Data type with id "${n.id}" has invalid properties combination. Only one of the following properties can be present at the time: 'entity', 'andChildrenGroup' or 'orChildrenGroup'`,issue:null,severity:f.Error,code:S.InvalidPropertiesCombination,entity:n});a.push(s.error)}return X(n.errors,a)}function l9(n,e){const t=[],i=[r.CustomEntity,r.ActionDescriptor,r.Property,r.ArgumentDeclaration,r.ReturnDeclaration,r.VariableDeclaration,r.ValueDescriptor,r.DataType],a=`'${N(i,"', '","' or '")}'`;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 s=e.get(n.parent);s?i.includes(s.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 ${a}.`,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}))}else t.push(new E({id:`${n.id}--${g.InvalidObjectStructure}`,code:g.InvalidObjectStructure,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a 'data-type' entity must be a reference to an entity of type ${a}.`,issue:null}));if(n.entity){if(n.id===n.entity)return t.push(new E({id:`${n.id}--${n.entity}--${y.SelfReference}`,code:y.SelfReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'entity'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;const s=e.get(n.entity);s?[r.CustomEntity,r.PrimitiveEntity,r.ActionDescriptor,r.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${n.id}--${n.entity}--${y.InvalidImplementsReference}`,code:y.InvalidImplementsReference,severity:f.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'entity' reference that isn't pointing to an entity of type 'custom-entity', 'primitive-entity', 'action-descriptor' or 'built-in-base-entity'.`,issue:null})):t.push(new E({id:`${n.id}--${n.entity}--${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.entity}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}return t}const fe=class fe{constructor(e,t){l(this,"initialData");l(this,"id");l(this,"version");l(this,"isNullable");l(this,"isList");l(this,"constant");l(this,"asType");l(this,"type",r.DataType);l(this,"options");l(this,"parentRelationType");l(this,"defaultValue",null);l(this,"entity",null);l(this,"andChildrenGroup");l(this,"orChildrenGroup");l(this,"project");l(this,"errors",[]);l(this,"parent");l(this,"initialized",!1);l(this,"inferred",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.isNullable=e.isNullable,this.isList=e.isList,this.constant=e.constant,this.asType=e.asType,this.options=e.options,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const i=D(e.parent),a=t.get(i);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:r.DataType,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:e.parentRelationType,isList:e.isList,isNullable:e.isNullable,constant:e.constant,defaultValue:null,entity:s,asType:e.asType,parent:a},d=R(o,t);return d.setParent(a),d.initChildren(),d}static validateGenerationTarget(e,t){var p;let i=JSON.parse(JSON.stringify(e));const a=[],s=l9(i,t);if(a.push(...s,...Ae(i)),i.entity){const h=t.get(i.entity);if(h.type===r.CustomEntity){const m=Un(h).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${N(m.map(I=>I.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${y.NonInteractiveEntityReferenced}`,code:y.NonInteractiveEntityReferenced,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${i.entity}' at 'entity'. The entity extends or implements non-interactive built-in-base-entity ${b}.
|
|
33
33
|
${Gn}`,issue:null}))}}}const o=i.parent&&t.get(i.parent)||t.getBuiltIn(i.parent),d=o?Ir(o):null;if(d)a.push(new E({id:`${e.id}--${y.BuiltInEntityParent}`,code:y.BuiltInEntityParent,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${A(d,t)}" with id '${d.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null}));else if(o){const h=o.type,T=[r.Property,r.VariableDeclaration,r.ArgumentDeclaration,r.ReturnDeclaration,r.ValueDescriptor];if(T.includes(h)&&(i.parentRelationType&&a.push(new E({id:`${e.id}--${y.InvalidParentRelationType}`,code:y.InvalidParentRelationType,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot have a 'parentRelationType' property set of type '${h}'.
|
|
34
34
|
The entitities of type '${N(T,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property so no 'parentRelationType' is needed.`,issue:null})),o.dataType)){const m=(p=o.dataType)==null?void 0:p.id;a.push(new E({id:`${e.id}--${y.NewEntityWouldOverriteExisting}`,code:y.NewEntityWouldOverriteExisting,severity:f.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot be added as a child to the entity with id '${i.parent}' and type '${h}', because it already has a 'data-type' child with id '${m}'.
|
|
35
35
|
The entitities of type '${N(T,"', '","' and '")}' can only have one 'data-type' child under the 'dataType' property. You can inspect the existing data-type entity with the 'describe_entity' action. Like so:
|
|
@@ -370,4 +370,4 @@ If an entity is called by another, they must be in the same scope, which means t
|
|
|
370
370
|
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=Od(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 d=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:$.UUID.uuid(),type:r.OutputMap,version:1,declaration:s,index:d,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:d}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}if(this.inputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.outputs.forEach(o=>{const{affected:d,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});i.push(...d),a.push(...p)}),this.error){const{affected:o,removed:d}=this.error.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}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:O(i),removed:O(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:O(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=n3(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 gr=ge;function Rv(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(T=>!!T.implements.find(m=>m.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(T=>!!T.properties.find(m=>{var b;return m.implements&&m.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((b=m.getDefaultValue())==null?void 0:b.value)===!0}))){const m=a[0].properties.find(I=>I.implements&&I.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),b=(e=m==null?void 0:m.dataType)==null?void 0:e.defaultValue;if(b)b.value=!0;else if(m!=null&&m.dataType){const I=(t=m==null?void 0:m.dataType)==null?void 0:t.id.split("-id")[0],B=R({id:I+"-default-value-id",version:1,type:r.PrimitiveValue,name:v.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:m==null?void 0:m.dataType.toReference()},n.project);return B.setParent(m==null?void 0:m.dataType),B.initChildren(),B.addSelfToProject(),{newEntities:[B]}}return{newEntities:[]}}const o=n.project.get(Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),d=lo(o,"Main database");if(d.errors.length>0)return{newEntities:[]};const p=d.implemented.properties.find(T=>T.implements&&T.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 T=p==null?void 0:p.dataType.id.split("-id")[0],m=R({id:T+"-default-value-id",version:1,type:r.PrimitiveValue,name:v.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:p==null?void 0:p.dataType.toReference()},n.project);m.setParent(p==null?void 0:p.dataType),m.initChildren(),m.addSelfToProject()}return{newEntities:[d.implemented]}}}return{newEntities:[]}}function bv(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 T;return h.implements&&h.implements.id===Ve["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((T=h.getDefaultValue())==null?void 0:T.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),d=(i=o==null?void 0:o.dataType)==null?void 0:i.defaultValue;if(o&&(o!=null&&o.dataType)&&!d){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:v.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 lo(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},d=Ks(o,n.project);if(d.length>0)return{errors:d,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=Rv(n),h=R(o,n.project);h.setParent(n.project),h.initChildren();const T=n.properties.map(I=>{const B=s+"-"+Xt(A(I,n.project),r.Property,n.project),G=I.clone(h,B);return G.abstract=!1,G.implements=I,G.setParent(h),h.addProperty(G),G}),m=n.abstractMethods.map(I=>{const B=s+Xt(I.name,r.FunctionDeclaration,n.project),G=I.implementAsFunctionDeclaration(B),q={id:B+"-parent-ref-id",type:r.GenericReference,entityId:i,entityType:r.CustomEntity},jt={...G,implements:I,parent:q},Le=R(jt,n.project);return h.addMethod(Le),Le.setParent(h),Le.initChildren(),Le.implements=I,Le});o.properties=T,o.methods=m;const b=bv(h);return{implemented:h,errors:[],entitiesChanges:{new:[h,...p.newEntities,...b.newEntities],updated:[h],deleted:[]}}}function co(n,e){const t=vr(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=co(s,e);return o.last&&(i=o.last),[s,...o.list]}),last:i}}function gv(n,e,t=new Set){const i=Fn(n),a=Fn(e),s=i.filter(p=>!a.includes(p)),o=i.filter(p=>a.includes(p)),d=s.reduce((p,h)=>t.has(h.id)?p:(t.add(h.id),O([...p,...gv(h,e,t)])),[]);return O([...o,...d])}function pa(n,e){const t=co(n,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function r3(n,e){return!!co(n,e).last}function i3(n){if(Me.includes(n.type))return n;if([...Rn,r.VariableDeclaration].includes(n.type)){const e=n.parent;return Me.includes(e.type)?e:null}return null}function Pd(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 Pd(t,i)}function He(n){if(bo.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 a3(n){return n.type===r.VariableDeclaration?[n]:we.includes(n.type)?[...n.inputs,...n.outputs||[]]:n.type===r.ReturnStatement?n.outputs:Ar.includes(n.type)||n.type===r.FunctionDeclaration?n.inputs:[]}function s3(n){const e=Fn(n),t=[],i=[];Gd.includes(n.type)&&t.push(...Dd(n));const a=e.filter(s=>{const o=t.includes(s);return o?!1:Rn.includes(s.type)&&!o?(i.push(s),!1):!0});return t.sort((s,o)=>pa(o,s)?-1:0),i.sort((s,o)=>pa(o,s)?-1:0),[...t,...i,...a]}function vv(n){return[...n].sort((e,t)=>pa(t,e)?-1:0)}function o3(n){const e=vv(n),t=[];return e.forEach(i=>{const a=t[t.length-1];if(a){const s=a[a.length-1];pa(i,s)?t.push([i]):a.push(i)}else t.push([i])}),t}function ht(n){const e=n.map(t=>He(t));return O(e)}function Dd(n){return we.includes(n.type)?[...ht(n.successCalls),...ht(n.errorCalls)]:Me.includes(n.type)?ht(n.calls):[]}function l3(n,e){return Dd(n).includes(e)}function Ad(n){return n.writesValues||[]}function c3(n,e){return Ad(n).includes(e)}function Iv(n){var e;return Fe.includes((e=n==null?void 0:n.readsValue)==null?void 0:e.type)?n.readsValue:null}function d3(n){return n.writesValues}function Pv(n=[]){return n.map(Iv).filter(e=>!!e)}function uo(n=[]){return n.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function Dv(n=[]){return n.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function Av(n){return Fe.includes(n.type)?n:null}function Sv(n){return n.writesValues.map(Av).filter(e=>!!e)}function Ov(n=[]){return n.reduce((e,t)=>t.type===r.OutputMap?[...e,...Sv(t)]:e,[])}function Ie(n){return we.includes(n.type)?[...Kt(ht(n.successCalls)),...Kt(ht(n.errorCalls))]:Me.includes(n.type)?Kt(ht(n.calls)):[]}function u3(n){return we.includes(n.type)?[...Kt(ht(n.successCalls)),...Kt(ht(n.errorCalls))]:Me.includes(n.type)?Kt(ht(n.calls)):[]}function Cv(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 Bv(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 Dv(n.outputs).reduce((i,a)=>[...i,...Z(a,e)],[]);if(n.type===r.FunctionCall||n.type===r.Operation||n.type===r.Condition)return[...Ie(n).reduce((s,o)=>{const d=He(o);return[...s,...Z(d||o,e)]},[]),...Pv(n.inputs),...Ov(n.outputs)].reduce((s,o)=>[...s,...Z(o,e)],[]);if(Ar.includes(n.type)){const t=uo(n.inputs),a=Ie(n).reduce((s,o)=>{const d=He(o);return[...s,...Z(d||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Z(o,e)],[])}if(n.type===r.FunctionDeclaration){const t=[...uo(n.inputs)],a=Ie(n).reduce((s,o)=>{const d=He(o);return[...s,...Z(d||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...Z(o)],[])}if(Fe.includes(n.type)){e.add(n.id);const i=Ie(n).reduce((a,s)=>{const o=He(s);return[...a,...Z(o||s,e)]},[]);return[n,...i,...Bv(n,e),...Cv(n,e)]}return[]}function It(n,e=new Set){return e.has(n.id)?[]:(e.add(n.id),[...Fn(n).reduce((a,s)=>[...a,s,...It(s,e)],[])])}function Kt(n){return n.reduce((e,t)=>t.type===r.ReturnStatement||t.type===r.ContinueStatement||t.type===r.BreakStatement?[...e,t]:[...e,t,...Ie(t)],[])}function wv(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,...uo(h.inputs),...Kt(ht(h.calls)),...h.returnStatements],[]),o=n.functions.reduce((p,h)=>[...p,...Kt(ht(h.calls)),...h.returnStatements],[]),d=n.events.reduce((p,h)=>[...p,...Kt(ht(h.calls)),...h.returnStatements],[]);return[...t,...i,...a,...s,...o,...d]}function _v(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 we.includes(n.type)?Mv(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 p3(n){const e=wv(n.project);return _v(n,e)}function vr(n){const e=[];if(Rn.includes(n.type)){n.calledBy.forEach(a=>{const s=He(a);s&&e.push(s)});const i=[...n.inputs||[],...n.outputs||[]].map(a=>Cd(a)).filter(a=>a!==null);e.push(...O(i))}if(Fe.includes(n.type)){const t=Cd(n);t&&e.push(t)}return O(e)}function Sd(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||Ar.includes(n.type)?n.inputs:n.type===r.Search?n.inputsDeclarations:[]}function y3(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 Mv(n){return we.includes(n.type)?n.inputs:[]}function Od(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:Ce.includes(n.type)?n.outputs:[]}function h3(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 f3(n){return n.type===r.Condition?[]:we.includes(n.type)?n.outputs:[]}function Cd(n){const e=n.readsValue;return e?He(e):null}function Nv(n){const e=n.internalCalls||[];return O(ht(O(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function ui(n){const e=Ad(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 O(n){const e=new Set;return n.filter(t=>!t||e.has(t.id)?!1:(e.add(t.id),!0))}function Fn(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?[]:Fn(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(Ar.includes(n.type)){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ui(s)).flat(),a=n.calls.map(s=>He(s));t.push(...O(i),...a)}if(we.includes(n.type)&&n.type!==r.Condition){const i=n==null?void 0:n.outputs.map(o=>ui(o)).flat(),a=n.successCalls.map(o=>He(o)),s=n.errorCalls.map(o=>He(o));t.push(...O(i),...a,...s)}if(Fe.includes(n.type)){const i=ui(n),a=Nv(n);t.push(...i,...a)}if(n.type===r.Loop){const i=n.outputs.map(o=>ui(o)).flat();if(n.body){const o=Fn(n.body,e);t.push(...o)}const a=n.errorCalls.map(o=>He(o)),s=n.successCalls.map(o=>He(o));t.push(...O(i),...s,...a)}if(n.type===r.FunctionDeclaration){if(n.collapsed&&e)return[];const i=n.inputs.map(s=>ui(s)).flat(),a=n.calls.map(s=>He(s));t.push(...O(i),...a)}return O(t)}function $v(n,e=!1){const t=Fn(n,e),i=[...t,...t.reduce((a,s)=>[...a,...$v(s,e)],[])];return O(i)}function Vv(n){const e=vr(n),t=[...e,...e.reduce((i,a)=>[...i,...Vv(a)],[])];return O(t)}function po(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...po(t),...yo(t)]:[...e,t.name],[])}function yo(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,r.CustomEntity,...yo(t),...po(t)]:[...e,t.name],[])}function Bd(n){return n.extends.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...Bd(t),...wd(t)]:[...e,t],[])}function wd(n){return n.implements.reduce((e,t)=>t.type===r.CustomEntity?[...e,t,...wd(t),...Bd(t)]:[...e,t],[])}function Lv(n){return[...yo(n),...po(n)].filter((t,i,a)=>a.indexOf(t)===i)}function Gv(n){return n.implements.length===0&&n.extends.length===0?null:n.implements.find(i=>i.type===r.BuiltInBaseEntity&&i.name===_.PERSISTED_ENTITY)?n:[...n.implements,...n.extends].reduce((i,a)=>{if(a.type===r.CustomEntity){const s=Gv(a);if(s)return s}return i},null)}function m3(n){const e=n.extends.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function T3(n){const e=n.implements.find(t=>t.type===r.BuiltInBaseEntity);return e&&e.type===r.BuiltInBaseEntity?e:null}function Fv(n){const e=n.extends.find(t=>t.type===r.CustomEntity);return e&&e.type===r.CustomEntity?e:null}function Un(n){const e=[...n.implements,...n.extends].reduce((t,i)=>i.type===r.BuiltInBaseEntity?[...t,i]:i.type===r.CustomEntity?[...t,...Un(i)]:t,[]);return O(e)}function _d(n){return n.type===r.PrimitiveEntity?!0:n.type===r.BuiltInBaseEntity?n.interactive:!Un(n).find(i=>!i.interactive)}function E3(n){return n.parent===n.project&&n.project.variableDeclarations.includes(n)}function Md(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 Uv(n){if([...Me,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||Md(n))return!1;const e=vr(n);return e.length===0?!0:e.some(t=>Uv(t))}function Nd(n){return[...Me,r.CustomEntity,r.InstalledProject,r.Project].includes(n.type)||Md(n)?!1:vr(n).length===0}function xv(n,e=0){if(Nd(n)){const t=vr(n);return t.length===0?n:t.map(a=>xv(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function jv(n){const e=[];if(Nd(n))e.push(n);else return[];return vr(n).forEach(i=>{e.push(...jv(i))}),e}function kv(n){return n.type===r.FunctionDeclaration&&n.parent!==n.project&&!![r.CustomEntity,r.Loop,r.InstalledProject].includes(n.parent.type)}function qv(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 ho(n){switch(n){case r.CustomEntity:return Pr;case r.FunctionDeclaration:return dr;case r.VariableDeclaration:return hr;case r.VariableInstance:return fr;case r.FunctionCall:return gr;case r.Operation:return ur;case r.Condition:return yr;case r.ReturnStatement:return Rr;case r.Loop:return pr;case r.Search:return mr;case r.InputMap:return mn;case r.OutputMap:return Tn;case r.ArgumentDeclaration:return Er;case r.ReturnDeclaration:return Ct;case r.Property:return cr;case r.InstalledProject:return Tr;case r.Project:return $;case r.BuiltInBaseEntity:return $t;default:return null}}function ft(n,e){if(st.includes(n.type))return n;if(Sr.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?ft(a,e):null}else return t===e?e:ft(t,e)}function $d(n,e){if(Sr.includes(n.type)||e.getAllBuiltInIds().includes(n.id))return null;const i=Nt(n.parent,e);return i?i===e?st.includes(n.type)?n:null:i.type===r.CustomEntity?n:$d(i,e):null}function fo(n,e,t){if(n===e||e===t||n===t)return!1;const i=ft(e.parent,t);return i===n?!0:fo(i,e,t)}var mo=(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))(mo||{});function ya(n,e,t){const i=ft(n,t),a=ft(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(fo(i,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:i};if(fo(a,i,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const d=Pd(i,a);return d===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:d}:d?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:ft(d,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function Jv(n,e,t){const i=ya(n,e,t);if(!i.compatible||i.type!=="same-both-local")return null;if(n===e)return n;let a=ft(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=ft(a.parent,t)}let s=ft(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=ft(s.parent,t)}return null}function Wv(n){return n.length===0?null:n.length===1?n[0]:n.reduce((t,i)=>{const a=Jv(t,i,i.project);return!a||a===i?t:i},n[0])}function Nt(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 Ir(n){if(Sr.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:Ir(t)}function ha(n,e){var t;if(n.readsValue){const i=Nt(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 fa(n){const e=[];function t(s,o){return e.some(d=>d.blockedByCaller===s&&d.blockedByCalling===o)}function i(s,o){t(s,o)||e.push({blockedByCaller:s,blockedByCalling:o})}const a=$d(n,n.project);return n.calledBySuccess.forEach(s=>{[...s.successCalls||[]].forEach(p=>{Ce.includes(p.type)&&p!==n&&(Ie(n).find(m=>m===p)||i(s,p))});let d;if(we.includes(s.type)&&(d=s),d){const p=fa(d);p.reachable||Ie(n).find(m=>m===s)||p.blocks.forEach(m=>{i(s,m.blockedByCalling)})}}),n.calledByError.forEach(s=>{[...s.errorCalls||[]].forEach(p=>{Ce.includes(p.type)&&p!==n&&(Ie(n).find(m=>m===p)||i(s,p))});let d;if(we.includes(s.type)&&(d=s),d){const p=fa(d);p.reachable||Ie(n).find(m=>m===s)||p.blocks.forEach(m=>{i(s,m.blockedByCalling)})}}),n.calledByEntry.forEach(s=>{if([...s.calls||[]].forEach(p=>{Ce.includes(p.type)&&p!==n&&(Ie(n).find(m=>m===p)||i(s,p))}),s===a)return;let d;if(s.type===r.FunctionDeclaration){const p=He(s);if(p.type===r.CustomEntity)return;p.type===r.Loop&&(d=p)}if(d){const p=fa(d);p.reachable||p.blocks.forEach(h=>{i(s,h.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function R3(n){return bo.includes(n.type)?n.type===r.FunctionDeclaration?!kv(n):!0:!1}function b3(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 g3(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}--${g.InvalidObjectStructure}`,code:g.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},d=R(o,t);return d.setParent(i),d.initChildren(),d}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[],s=g3(i,t),o=Ks(i,t);a.push(...s,...o,...Ae(i));const d=i.parent?t.get(i.parent):null;if(d&&d.type===r.DataType){const p=d;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.
|
|
371
371
|
You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
|
|
372
372
|
${Qt({describe_entity:p.entity.id})}
|
|
373
|
-
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 O([...this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]),...this.implements.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=>{n8(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)}),r8(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),d=R(o,this.project);if(d.suggestion=!0,d.setParent(this),d.initChildren(),d.inputs.forEach(p=>{p.suggestion=!0}),d.returnStatements.length){const p=d.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(d)})}),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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.methods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),{affected:O(i),removed:O(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:O(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=t8(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 lo(this,e,t)}getAllInteractiveMethods(){const e=this.implements.filter(i=>i.type===r.CustomEntity||i.type===r.BuiltInBaseEntity&&i.interactive);return[...this.methods,...this.extends.flatMap(i=>i.getAllInteractiveMethods()),...e.flatMap(i=>i.getAllInteractiveMethods())]}};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 Pr=pe;function v3(n){const e=_4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class $t{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 O(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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=v3(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 $t(this.toJSON(),this.project)}implement(e,t){return lo(this,e,t)}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(i=>i.type===r.BuiltInBaseEntity&&i.interactive||i.type===r.PrimitiveEntity).forEach(i=>{i instanceof $t&&e.push(...i.getAllInteractiveMethods())})),e}}function I3(n){const e=I4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Vt{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})}get extendedProperties(){return O(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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=I3(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 Vt(this.toJSON(),this.project)}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(i=>i.type===r.BuiltInBaseEntity&&i.interactive||i.type===r.PrimitiveEntity).forEach(i=>{i instanceof $t&&e.push(...i.getAllInteractiveMethods())}),e}}function ma(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case r.PrimitiveValue:return t||new ci(n,e);case r.CustomEntity:return t||new Pr(n,e);case r.PrimitiveEntity:return t||new Vt(n,e);case r.FunctionDeclaration:return t||new dr(n,e);case r.GlobalEvent:return t||new oi(n,e);case r.DataType:return t||new si(n,e);case r.Property:return t||new cr(n,e);case r.FunctionCall:return t||new gr(n,e);case r.Condition:return t||new yr(n,e);case r.Operation:return t||new ur(n,e);case r.VariableDeclaration:return t||new hr(n,e);case r.VariableInstance:return t||new fr(n,e);case r.OutputMap:return t||new Tn(n,e);case r.ReturnDeclaration:return t||new Ct(n,e);case r.ArgumentDeclaration:return t||new Er(n,e);case r.InputMap:return t||new mn(n,e);case r.Project:return t||new $(n);case r.InstalledProject:return t||new Tr(n,e);case r.ActionDescriptor:return t||new $e(n,e);case r.ReturnStatement:return t||new Rr(n,e);case r.Loop:return t||new pr(n,e);case r.Search:return t||new mr(n,e);case r.ValueDescriptor:return t||new br(n,e);case r.BuiltInBaseEntity:return t||new $t(n,e);case r.InternalCall:return t||new li(n,e);case r.ContinueStatement:return t||new yt(n,e);case r.BreakStatement:return t||new di(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=ma(n,e);return t.subscribe(),t}function P3(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case r.PrimitiveValue:return ci.fromGenerationTarget(n,e);case r.CustomEntity:return Pr.fromGenerationTarget(n,e);case r.FunctionDeclaration:return dr.fromGenerationTarget(n,e);case r.GlobalEvent:return oi.fromGenerationTarget(n,e);case r.DataType:return si.fromGenerationTarget(n,e);case r.Property:return cr.fromGenerationTarget(n,e);case r.FunctionCall:return gr.fromGenerationTarget(n,e);case r.Condition:return yr.fromGenerationTarget(n,e);case r.Operation:return ur.fromGenerationTarget(n,e);case r.VariableDeclaration:return hr.fromGenerationTarget(n,e);case r.VariableInstance:return fr.fromGenerationTarget(n,e);case r.OutputMap:return Tn.fromGenerationTarget(n,e);case r.ReturnDeclaration:return Ct.fromGenerationTarget(n,e);case r.ArgumentDeclaration:return Er.fromGenerationTarget(n,e);case r.InputMap:return mn.fromGenerationTarget(n,e);case r.InstalledProject:return Tr.fromGenerationTarget(n,e);case r.ReturnStatement:return Rr.fromGenerationTarget(n,e);case r.Loop:return pr.fromGenerationTarget(n,e);case r.Search:return mr.fromGenerationTarget(n,e);case r.ActionDescriptor:return $e.fromGenerationTarget(n,e);case r.ValueDescriptor:return br.fromGenerationTarget(n,e);case r.InternalCall:return li.fromGenerationTarget(n,e);case r.ContinueStatement:return yt.fromGenerationTarget(n,e);case r.BreakStatement:return di.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const Y=class Y{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;try{Y.UUID||(Y.UUID=as==null?void 0:as())}catch(t){console.error("Error initializing UUID module",t),Y.UUID={uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:i=>i}}}static injectUUIDModule(e){Y.UUID=e}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Ae(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+"--"+Y.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=zx(),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 Y(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=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Ie(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 O([...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(d=>d.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===_.PERSISTED_ENTITY)||null}};l(Y,"UUID",{uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),l(Y,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(Y,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Y,"BASE_PROPERTIES",[...Y.MUTABLE_BASE_PROPERTIES,...Y.INMUTABLE_BASE_PROPERTIES]),l(Y,"MUTABLE_META_PROPERTIES",[...Y.MUTABLE_BASE_PROPERTIES,"x","y"]),l(Y,"INMUTABLE_META_PROPERTIES",[...Y.INMUTABLE_BASE_PROPERTIES]),l(Y,"META_PROPERTIES",[...Y.MUTABLE_META_PROPERTIES,...Y.INMUTABLE_META_PROPERTIES]),l(Y,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Y,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(Y,"UPSTREAM_PROPERTIES",[...Y.MUTABLE_UPSTREAM_PROPERTIES,...Y.INMUTABLE_UPSTREAM_PROPERTIES]),l(Y,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(Y,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Y,"DOWNSTREAM_PROPERTIES",[...Y.MUTABLE_DOWNSTREAM_PROPERTIES,...Y.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Y,"PROPERTIES",[...Y.META_PROPERTIES,...Y.UPSTREAM_PROPERTIES,...Y.DOWNSTREAM_PROPERTIES]);let $=Y;class Hv extends $e{constructor(t){super(Lt,t);l(this,"id",Pe.Parallel);l(this,"name",Pe.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",Lt);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=Lt.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=Lt.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Lt.error?R(Lt.error,this.project):null}}class Yv 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 zv extends $e{constructor(t){super(rn,t);l(this,"id",Pe.Sequential);l(this,"name",Pe.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",rn);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=rn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=rn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=rn.error?R(rn.error,this.project):null}}function D3(n){const e=[new zv(n),new Hv(n),new Yv(n),new $e(fi,n),new $e(Or,n),new $e(kn,n),new $e(ga,n),new $e(Do,n),new $e(Oo,n),new $e(So,n),new $e(Ea,n),new $e(yi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class Zv extends $t{constructor(t){super(_e,t);l(this,"initialData");l(this,"id",_.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",_.PERSISTED_ENTITY);l(this,"description",_e.description);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",_e.abstract);l(this,"static",_e.static);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}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}}function A3(n){const e=[new Zv(n),new $t(Ca,n),new $t(vn,n),new $t(Ho,n),new $t(Oa,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function S3(n){const e=[new Vt(F,n),new Vt(bn,n),new Vt(De,n),new Vt(Xe,n),new Vt(gn,n),new Vt(nn,n),new Vt(Ta,n),new Vt(go,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function O3(n){const e=[new $e(Na,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function C3(n){const e=[new $e(qn,n),new $e(Fo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function B3(n){const e=[new br(Xo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function w3(n){const e=[new $e(Jn,n),new $e(Br,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const Dr={},To={};async function _3(n,e={}){const t={...ab};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 Xv(n){const e=new $(n);return S3(e),A3(e),D3(e),O3(e),C3(e),B3(e),w3(e),e.initChildren(),e}async function M3(n,e={}){try{if(n.id&&Dr[n.id])return Dr[n.id];if(n.id&&To[n.id])return await To[n.id],Dr[n.id];const t=_3(n,e);n.id&&(To[n.id]=t);const i=await t;if(i.data){const a=Xv(i.data);return Dr[n.id]=a,n.id&&delete To[n.id],a}return null}catch(t){return console.error("Error fetching project: ",t),null}}function N3(n){return Dr[n.id]&&delete Dr[n.id],null}const $3="test_primitive_entities_export";u.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=gd,u.ActionDescriptorState=$e,u.ActionDescriptorValuesType=L,u.ActionInputMapState=_9,u.ActionOutputMapState=$9,u.AppendToListOperationInputIds=up,u.AppendToListOperationOutputIds=pp,u.ArgumentDeclarationState=Er,u.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=Td,u.BUILT_IN_BASE_ENTITY_IDS=Ve,u.BUILT_IN_ENTITY_TYPES=Sr,u.BaseCanvasDraggableState=m9,u.BaseEntityNames=_,u.BaseState=f9,u.BaseValueDescriptorIds=$o,u.BreakStatementState=di,u.BuiltInBaseEntityState=$t,u.CACHED_PROJECTS_BY_ID=Dr,u.CALLABLE_ENTITIES_EXPLANATION=H9,u.CALLABLE_TYPES=Rn,u.CALLER_ENTITIES_EXPLANATION=cv,u.CALLER_TYPES=tn,u.CALLS_UPDATE_EXPLANATION=Ln,u.COMPARISON_CONDITIONS=dm,u.CONDITIONS=OI,u.CUSTOM_ENTITY_OPERATIONS=Ay,u.CallableEntityClass=E9,u.CallerEntityClass=yd,u.ChildEntityState=T9,u.ComparisonOperatorTypes=Oe,u.ConditionState=yr,u.ContinueStatementState=yt,u.CreateNewInputIds=ny,u.CreateNewOutputIds=ry,u.CustomEntityState=Pr,u.DRAGGABLE_CALLABLE_TYPES=Ro,u.DRAGGABLE_CALLER_TYPES=Gd,u.DRAGGABLE_ELEMENT_TYPES=bo,u.DRAGGABLE_EXECUTABLE_TYPES=nI,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=Eo,u.DataTypeCompatibilityTypes=Mt,u.DataTypeParentChildRelation=qe,u.DataTypeState=si,u.ENTITIES_WITH_VALLUES_EXPLANATION=ro,u.ENTITY_TYPES=rI,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=st,u.ENTITY_WITH_NAMES_TYPES=Fd,u.ENTITY_WITH_VALUE_TYPES=Ld,u.ENTRY_POINT_ENTITIES_EXPLANATION=da,u.ENTRY_POINT_TYPES=Me,u.EVENT_TYPES=Ar,u.EXECUTABLE_TYPES=tI,u.EXECUTION_OPERATIONS=ty,u.EntityError=Kn,u.EntityErrorSeverity=f,u.EntityGenerationError=E,u.EntityGenerationErrorCode=y,u.EntityInstanceErrorCode=S,u.EntityOperations=Ze,u.EntityType=r,u.EntityWithLogicScopeClass=v9,u.EntityWithValueClass=g9,u.EntryPointEntityClass=R9,u.ExecutionOperations=Pe,u.FunctionCallState=gr,u.FunctionDeclarationState=dr,u.GLOBAL_EVENT_DECLARATIONS=CI,u.GetLastInListOperationInputIds=Ku,u.GetLastInListOperationOutputIds=ep,u.GlobalEventNames=en,u.GlobalEventState=oi,u.HTTPOperations=Ye,u.HTTP_OPERATIONS=sh,u.InputMapState=mn,u.InstalledProjectState=Tr,u.InternalCallState=li,u.JoinListOperationInputIds=Ru,u.JoinListOperationOutputIds=bu,u.JoinStringOperationInputIds=au,u.JoinStringOperationOutputIds=su,u.LIST_OPERATIONS=Dp,u.ListOperations=k,u.LoopState=pr,u.LoopTypes=je,u.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Gn,u.NUMBER_OPERATIONS=iu,u.NumberAdditionOperationInputIds=Jd,u.NumberAdditionOperationOutputIds=Wd,u.NumberOperations=at,u.OPERATION_DECLARATIONS=aI,u.OperationState=ur,u.OutputMapParentChildRelation=Vd,u.OutputMapState=Tn,u.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=io,u.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Vn,u.PASS_THROUGH_CALLABLE_TYPES=we,u.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=bd,u.ParallelExecutionOperation=Hv,u.ParallelExecutionOperationInputIds=Ap,u.ParallelExecutionOperationOutputIds=Sp,u.PassThroughCallableEntityClass=b9,u.PersistedEntity=Zv,u.PersistedEntityMethods=Pt,u.PrimitiveEntityState=Vt,u.PrimitiveTypes=v,u.PrimitiveValueState=ci,u.ProjectState=$,u.PropertyState=cr,u.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=Y9,u.ReturnDeclarationState=Ct,u.ReturnStatementState=Rr,u.STANDALONE_CONDITIONS=im,u.STRING_OPERATIONS=Eu,u.ScopeCompatibilityType=mo,u.SearchState=mr,u.SequentialExecutionOperation=zv,u.SequentialExecutionOperationInputIds=qp,u.SequentialExecutionOperationOutputIds=Jp,u.SharedEntityErrorCode=g,u.SharedStateFunctionality=sv,u.SplitListOperationInputIds=$u,u.SplitListOperationOutputIds=Vu,u.StandaloneOperatorTypes=Bt,u.StringOperations=ve,u.TERMINATION_TYPES=Ce,u.USER_MANAGED_ENTITY_TYPES=iI,u.UserManagedEntityStateFunctionality=h9,u.VALUE_READING_ENTITIES_EXPLANATION=Rd,u.VALUE_READING_TYPES=xn,u.VALUE_WRITING_ENTITIES_EXPLANATION=dv,u.VALUE_WRITING_TYPES=Be,u.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=Ed,u.VARIABLE_TYPES=Fe,u.ValidationInputIds=py,u.ValidationOutputIds=yy,u.ValueAutogenerationType=xe,u.ValueDescriptorParentChildRelation=C,u.ValueDescriptorState=br,u.ValueReadingEntityClass=la,u.ValueWritingEntityClass=ca,u.VariableDeclarationState=hr,u.VariableInputMapState=w9,u.VariableInstanceState=fr,u.VariableOutputMapState=N9,u.WaitOperation=Yv,u.WaitOperationInputIds=Lp,u.WaitOperationOutputIds=Gp,u._VALUE_READING_TYPES=Kv,u._VALUE_WRITING_TYPES=eI,u.appendToListOperation=ga,u.appendToListOperationElementToAppendArgument=Bo,u.appendToListOperationElementToAppendArgumentParentRef=bp,u.appendToListOperationElementToAppendArgumentRef=fp,u.appendToListOperationError=Pp,u.appendToListOperationErrorParentRef=Ip,u.appendToListOperationListArgument=Co,u.appendToListOperationListArgumentParentRef=Rp,u.appendToListOperationListArgumentRef=yp,u.appendToListOperationListDataType=hp,u.appendToListOperationResultListDataType=Ep,u.appendToListOperationResultListReturn=vp,u.appendToListOperationResultListReturnParentRef=gp,u.appendToListOperationResultListReturnRef=Tp,u.appendToListOperationSecondListDataType=mp,u.asGenerationActionExample=Qt,u.baseHttpRequestFunctionDeclaration=fi,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=Go,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=ah,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=ih,u.baseHttpRequestFunctionDeclarationRef=eh,u.baseHttpRequestFunctionDeclarationRefEight=nh,u.baseHttpRequestFunctionDeclarationRefFive=Qy,u.baseHttpRequestFunctionDeclarationRefFour=Xy,u.baseHttpRequestFunctionDeclarationRefNine=rh,u.baseHttpRequestFunctionDeclarationRefSeven=th,u.baseHttpRequestFunctionDeclarationRefSix=Ky,u.baseHttpRequestFunctionDeclarationRefThree=Zy,u.baseHttpRequestFunctionDeclarationRefTwo=zy,u.booleanPrototype=bn,u.capitalizeFirstLetter=Hs,u.checkAreCustomEntitiesCompatibleAsDataType=qg,u.checkAreDataTypesCompatible=Ys,u.checkArePropertiesCompatibleAsDataType=kg,u.checkIsBranchDependentButNotDirectlyOnBranch=pa,u.checkIsBranchDependentOnBranch=r3,u.checkIsCallableEntityReachable=fa,u.checkIsCanvasEntity=R3,u.checkIsDetachedBranch=Uv,u.checkIsDetachedBranchShallow=Nd,u.checkIsGlobalVariable=E3,u.checkIsGloballyDeclared=Md,u.checkIsMethod=kv,u.checkIsNestedScope=fo,u.checkScopeCompatibility=ya,u.createEntityError=j,u.createNewInstanceOperation=Or,u.createNewInstanceOperationEntityToInstanciateArgument=oy,u.createNewInstanceOperationEntityToInstanciateArgumentRef=iy,u.createNewInstanceOperationEntityToInstanciateDataType=ay,u.createNewInstanceOperationError=uy,u.createNewInstanceOperationErrorParentRef=dy,u.createNewInstanceOperationOutputEntityDeclaration=cy,u.createNewInstanceOperationOutputEntityDeclarationParentRef=ly,u.createNewInstanceOperationRef=sy,u.createSemanticId=Xt,u.createStateFromGenerationTargetType=P3,u.createStateFromType=ma,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=Ho,u.cronJobBuiltInBaseEntityExpressionProperty=em,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=DI,u.cronJobBuiltInBaseEntityExpressionPropertyRef=Qf,u.cronJobBuiltInBaseEntityRef=Kf,u.cronJobTriggeredFunctionDeclarationBlueprint=Wo,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=Zf,u.customEntityToZodSchema=Om,u.dataTypeCompatibilityToErrorExplanation=Ev,u.datePrototype=nn,u.dateValueAutogenerationSchema=ec,u.deletePersistedEntityMethod=Jo,u.deletePersistedEntityMethodParentRef=Of,u.deleteRootProject=N3,u.endpointBuiltInBaseEntity=Ca,u.endpointBuiltInBaseEntityRef=Sh,u.endpointBuiltInBaseEntityRefFour=mf,u.endpointBuiltInBaseEntityRefThree=Vh,u.endpointBuiltInBaseEntityRefTwo=_h,u.endpointBuiltInCorsProperty=Oh,u.endpointBuiltInCorsPropertyDataType=Ah,u.endpointBuiltInCorsPropertyDataTypeRef=Ph,u.endpointBuiltInCorsPropertyRef=Dh,u.endpointBuiltInMethodProperty=xo,u.endpointBuiltInMethodPropertyDataType=$h,u.endpointBuiltInMethodPropertyDataTypeRef=Mh,u.endpointBuiltInMethodPropertyRef=Nh,u.endpointBuiltInPathProperty=Uo,u.endpointBuiltInPathPropertyDataType=wh,u.endpointBuiltInPathPropertyDataTypeRef=Ch,u.endpointBuiltInPathPropertyRef=Bh,u.endpointPathParamsArgumentDeclaration=Xh,u.endpointPathParamsArgumentDeclarationRef=Wh,u.endpointPathParamsVariableDataType=Hh,u.endpointPathParamsVariableDataTypeRef=Jh,u.endpointReachedTriggerActionDescriptor=jo,u.endpointReachedTriggerActionDescriptorRef=Yh,u.endpointReachedTriggerActionDescriptorRefFour=ef,u.endpointReachedTriggerActionDescriptorRefThree=Qh,u.endpointReachedTriggerActionDescriptorRefTwo=Zh,u.endpointRequestBodyArgumentDeclaration=tf,u.endpointRequestBodyArgumentDeclarationRef=Uh,u.endpointRequestBodyVariableDataType=xh,u.endpointRequestHeadersArgumentDeclaration=zh,u.endpointRequestHeadersArgumentDeclarationRef=Gh,u.endpointRequestHeadersVariableDataType=Fh,u.endpointRequestHeadersVariableDataTypeRef=Lh,u.endpointRequestQueryParamsArgumentDeclaration=Kh,u.endpointRequestQueryParamsArgumentDeclarationRef=kh,u.endpointRequestQueryParamsVariableDataType=qh,u.endpointRequestQueryParamsVariableDataTypeRef=jh,u.endpointResponseBodyDataType=yf,u.endpointResponseBodyReturnDeclaration=ff,u.endpointResponseBodyReturnDeclarationRef=pf,u.endpointResponseCodeDataType=rf,u.endpointResponseCodeReturnDeclaration=sf,u.endpointResponseCodeReturnDeclarationRef=nf,u.endpointResponseHeadersDataType=cf,u.endpointResponseHeadersDataTypeRef=of,u.endpointResponseHeadersReturnDeclaration=uf,u.endpointResponseHeadersReturnDeclarationRef=lf,u.endpointReturnStatementRef=af,u.endpointReturnStatementRefThree=hf,u.endpointReturnStatementRefTwo=df,u.enumOptionsProperty=qd,u.enumOptionsPropertyDataType=jd,u.enumOptionsPropertyDataTypeRef=Ud,u.enumOptionsPropertyRef=xd,u.enumPrototype=gn,u.enumPrototypeRef=kd,u.executionBuiltInEntity=zo,u.executionBuiltInEntityAbortMethod=Yo,u.executionBuiltInEntityAbortMethodParentRef=tm,u.filterOutDuplicateEntities=O,u.filterOutDuplicateErrors=h4,u.findReferenceToSelfInList=_v,u.findReferencesToSelfInProject=p3,u.flattenCalls=Kt,u.flattenCanvasAncestorsUntil=co,u.flattenCustomEntityExtensionAndImplementationTypes=Lv,u.flattenCustomEntityExtensionTypes=yo,u.flattenCustomEntityExtensions=Bd,u.flattenCustomEntityImplementations=wd,u.flattenCustomEntityImplementionTypes=po,u.flattenDerivedCanvasEntities=It,u.flattenDetachedBranch=jv,u.flattenElementCalls=Ie,u.flattenElementCallsOnTheSameScope=u3,u.flattenProjectElements=wv,u.flattenRelatedCanvasElementsOnTheLeft=Vv,u.flattenRelatedCanvasElementsOnTheRight=$v,u.flattenVariableReads=Bv,u.flattenVariableWrites=Cv,u.flattenVariables=Z,u.fromZodParseToEntityGenerationErrors=hd,u.generate=DD,u.generateActionExample=z9,u.generateExecutionDataType=Jg,u.generateMutablePropertiesExplanation=eo,u.generateRandomBoolean=eT,u.generateRandomDate=_m,u.generateRandomDateAfter=Cm,u.generateRandomDateBefore=Bm,u.generateRandomDateBetweenRange=wm,u.generateRandomNumber=zm,u.generateRandomNumberAfter=Wm,u.generateRandomNumberBefore=Hm,u.generateRandomNumberBetweenRange=Ym,u.generateRandomText=Km,u.generateRandomTextAfter=Zm,u.generateRandomTextBefore=Xm,u.generateRandomTextBetweenRange=Qm,u.generateUniqueUUID=Jm,u.getAllActionDescriptorsForConditions=oo,u.getAllActionDescriptorsForGlobalEvents=ao,u.getAllActionDescriptorsForLoops=so,u.getAllActionDescriptorsForOperations=K9,u.getAllGloballyDeclaredFunctionDeclarationsExplanation=fv,u.getBaseBuiltInEntities=Un,u.getBaseSchemaBasedOnType=ov,u.getBuiltInEntityOwner=Ir,u.getCallableEntityReferenceSchema=ke,u.getCallableEntityTypeSchema=Bb,u.getCallerEntityReferenceSchema=Rx,u.getCallerEntityTypeSchema=Ex,u.getCalls=Dd,u.getCanvasEntitiesDerivedFromInternalCalls=Nv,u.getCanvasEntitiesDerivedFromWrites=ui,u.getCanvasEntityDerivedFromValueReadingEntity=Cd,u.getCanvasEntityReferenceSchema=Vx,u.getCanvasEntityTypeSchema=$x,u.getChildrenEntityWithValues=a3,u.getCommonAncestor=Pd,u.getCommonChildren=gv,u.getDeclaration=rd,u.getDeepestScope=Wv,u.getDraggableCallableEntityReferenceSchema=_b,u.getDraggableCallableEntityTypeSchema=wb,u.getDraggableCallerEntityReferenceSchema=gx,u.getDraggableCallerEntityTypeSchema=bx,u.getDraggableExecutableEntityReferenceSchema=Dx,u.getDraggableExecutableEntityTypeSchema=Px,u.getDraggablePassThroughCallableEntityReferenceSchema=Fs,u.getDraggablePassThroughCallableEntityTypeSchema=Gs,u.getDraggablePlayableEntityReferenceSchema=Bx,u.getDraggablePlayableEntityTypeSchema=Cx,u.getEntityArgumentDeclarations=Sd,u.getEntityInputMaps=Mv,u.getEntityOutputMaps=f3,u.getEntityReferenceSchema=Nx,u.getEntityReturnDeclarations=Od,u.getEntityTypeSchema=Mx,u.getEntityWithLogicScopeReferenceSchema=yn,u.getEntityWithLogicScopeTypeSchema=Ax,u.getEntityWithValueReferenceSchema=Cb,u.getEntityWithValueTypeSchema=Tx,u.getEntryPointEntityReferenceSchema=Ue,u.getEntryPointEntityTypeSchema=Mn,u.getEventEntityReferenceSchema=Vs,u.getEventEntityTypeSchema=$s,u.getExecutableEntityReferenceSchema=Ix,u.getExecutableEntityTypeSchema=vx,u.getExtendedBuiltInEntity=m3,u.getExtendedCustomEntity=Fv,u.getGenerationTargetSchemaBasedOnType=lv,u.getHeadIfPartOfDetachedBranch=xv,u.getHighestScope=Jv,u.getImplementedBuiltInEntity=T3,u.getIsInteractive=_d,u.getLastInListOperation=Oo,u.getLastInListOperationError=dp,u.getLastInListOperationErrorParentRef=cp,u.getLastInListOperationInputListArgument=sp,u.getLastInListOperationInputListArgumentParentRef=ap,u.getLastInListOperationInputListArgumentRef=tp,u.getLastInListOperationInputListDataType=np,u.getLastInListOperationOutputElementDataType=ip,u.getLastInListOperationOutputElementReturn=lp,u.getLastInListOperationOutputElementReturnParentRef=op,u.getLastInListOperationOutputElementReturnRef=rp,u.getLinkedEntitiesFromArgumentDeclaration=d3,u.getLowestPersistedEntityImplementation=Gv,u.getParentCanvasEntities=ht,u.getParentCanvasEntity=He,u.getParentEntryPoint=i3,u.getPassThroughCallableEntityReferenceSchema=ye,u.getPassThroughCallableEntityTypeSchema=Ls,u.getPlayableEntityReferenceSchema=Ox,u.getPlayableEntityTypeSchema=Sx,u.getProject=M3,u.getPrototypeByType=ho,u.getReferenceEntityId=D,u.getReferencedEntitiesStateOrErrors=no,u.getReferencedEntityStateOrErrors=fd,u.getRelatedCanvasElementsOnTheLeft=vr,u.getRelatedCanvasElementsOnTheRight=Fn,u.getRootEntryPointScopeOwner=$d,u.getScopeOwner=ft,u.getTerminationReferenceSchema=_x,u.getTerminationTypeSchema=wx,u.getUsedArgFromDeclaration=y3,u.getUsedReturnFromDeclaration=h3,u.getValueReadingEntityReferenceSchema=Ob,u.getValueReadingEntityTypeSchema=pn,u.getValueWritingEntityReferenceSchema=mx,u.getValueWritingEntityTypeSchema=Qi,u.getVariableFromInputMapping=Iv,u.getVariableFromReturnVariablePointer=Av,u.getVariableReferenceSchema=_n,u.getVariableTypeSchema=nr,u.getVariablesFromArgumentDeclarations=uo,u.getVariablesFromInputMaps=Pv,u.getVariablesFromOutputMapping=Sv,u.getVariablesFromOutputMaps=Ov,u.getVariablesFromReturnDeclarations=Dv,u.getVariablesInSameOrHigherScope=id,u.getWrites=Ad,u.groupCallsBasedOnParallelizableExecution=o3,u.handleAfterEntityImplementationSideEffects=bv,u.handleBeforeEntityImplementationSideEffects=Rv,u.httpRequestBodyArgument=Da,u.httpRequestBodyArgumentRef=Fy,u.httpRequestBodyDataType=Uy,u.httpRequestHeadersArgument=Pa,u.httpRequestHeadersArgumentRef=Ly,u.httpRequestHeadersDataType=Gy,u.httpRequestMethodArgument=va,u.httpRequestMethodArgumentRef=$y,u.httpRequestMethodDataType=Vy,u.httpRequestMethodDataTypeRef=My,u.httpRequestQueryParamsArgument=Vo,u.httpRequestQueryParamsArgumentRef=wy,u.httpRequestQueryParamsDataType=_y,u.httpRequestVariableURLArgument=Ia,u.httpRequestVariableURLArgumentRef=Cy,u.httpRequestVariableURLDataType=By,u.httpRequestVariableURLDataTypeRef=Sy,u.httpResponseBodyReturnDataType=Yy,u.httpResponseBodyReturnDataTypeRef=Wy,u.httpResponseBodyReturnReturn=hi,u.httpResponseBodyReturnReturnRef=Hy,u.httpResponseCodeDataType=jy,u.httpResponseCodeReturn=Lo,u.httpResponseCodeReturnRef=xy,u.httpResponseHeadersDataType=Jy,u.httpResponseHeadersDataTypeRef=ky,u.httpResponseHeadersReturn=Aa,u.httpResponseHeadersReturnRef=qy,u.implement=lo,u.inferArgumentDeclarationDataType=Wg,u.inferDataType=zs,u.inferInputMapDataType=Hg,u.inferOutputMapDataType=Zg,u.inferVariableDeclarationDataType=zg,u.inferVariableInstanceDataType=Yg,u.initProject=Xv,u.iterateOverListActionDescriptor=qn,u.iterateOverListActionDescriptorListArgumentDeclaration=yh,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=uh,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=dh,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=ph,u.iterateOverListActionDescriptorReturnDeclaration=ch,u.iterateOverListActionDescriptorReturnDeclarationParentRef=lh,u.joinListOperation=Do,u.joinListOperationError=Nu,u.joinListOperationErrorParentRef=Mu,u.joinListOperationFirstListArgument=Ou,u.joinListOperationFirstListArgumentParentRef=Su,u.joinListOperationFirstListArgumentRef=gu,u.joinListOperationFirstListDataType=vu,u.joinListOperationResultListDataType=Au,u.joinListOperationResultListReturn=_u,u.joinListOperationResultListReturnParentRef=wu,u.joinListOperationResultListReturnRef=Du,u.joinListOperationSecondListArgument=Bu,u.joinListOperationSecondListArgumentParentRef=Cu,u.joinListOperationSecondListArgumentRef=Iu,u.joinListOperationSecondListDataType=Pu,u.joinListWithLastSeparator=N,u.joinStringOperation=yi,u.joinStringOperationError=Tu,u.joinStringOperationErrorParentRef=mu,u.joinStringOperationFirstStringArgument=Ra,u.joinStringOperationFirstStringArgumentParentRef=yu,u.joinStringOperationFirstStringArgumentRef=ou,u.joinStringOperationFirstStringDataType=lu,u.joinStringOperationResultStringDataType=pu,u.joinStringOperationResultStringReturn=pi,u.joinStringOperationResultStringReturnParentRef=fu,u.joinStringOperationResultStringReturnRef=uu,u.joinStringOperationSecondStringArgument=ba,u.joinStringOperationSecondStringArgumentParentRef=hu,u.joinStringOperationSecondStringArgumentRef=cu,u.joinStringOperationSecondStringDataType=du,u.jsonPrototype=go,u.keyValueParamBuiltInBaseEntity=Oa,u.keyValueParamBuiltInBaseEntityNameProperty=bh,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=oI,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=Rh,u.keyValueParamBuiltInBaseEntityNamePropertyRef=Eh,u.keyValueParamBuiltInBaseEntityValueProperty=Ih,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=cI,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=vh,u.keyValueParamBuiltInBaseEntityValuePropertyRef=gh,u.lowercaseFirstLetter=jg,u.manualFlowActionDescriptor=Fo,u.manualFlowActionDescriptorDeclarationReturnDeclaration=Th,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=fh,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=hh,u.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=mh,u.mapActionDescriptorToTypeItRepresents=b3,u.mergeEntityErrorsList=f4,u.mergeListOfEntities=qv,u.methodDefaultValue=Ny,u.mockClientProject=ab,u.moreThanOrEqualCondition=Br,u.moreThanOrEqualConditionLeftHandArgument=om,u.moreThanOrEqualConditionLeftHandArgumentParentRef=sm,u.moreThanOrEqualConditionRightHandArgument=cm,u.moreThanOrEqualConditionRightHandArgumentParentRef=lm,u.notEmptyCondition=Jn,u.notEmptyConditionArgument=rm,u.notEmptyConditionRef=nm,u.numberAdditionOperation=Ea,u.numberAdditionOperationError=ru,u.numberAdditionOperationErrorParentRef=nu,u.numberAdditionOperationFirstNumberArgument=vo,u.numberAdditionOperationFirstNumberArgumentRef=Hd,u.numberAdditionOperationFirstNumberDataType=Yd,u.numberAdditionOperationRef=Kd,u.numberAdditionOperationRefThree=tu,u.numberAdditionOperationRefTwo=eu,u.numberAdditionOperationResultNumberDataType=Qd,u.numberAdditionOperationResultNumberReturn=Po,u.numberAdditionOperationResultNumberReturnRef=Xd,u.numberAdditionOperationSecondNumberArgument=Io,u.numberAdditionOperationSecondNumberArgumentRef=zd,u.numberAdditionOperationSecondNumberDataType=Zd,u.numberPrototype=De,u.numberValueAutogenerationSchema=Kl,u.parallelExecutionOperation=Lt,u.parallelExecutionOperationError=Vp,u.parallelExecutionOperationErrorParentRef=$p,u.parallelExecutionOperationListOfExecutionResultsDataType=_p,u.parallelExecutionOperationListOfExecutionResultsReturn=_o,u.parallelExecutionOperationListOfExecutionResultsReturnRef=wp,u.parallelExecutionOperationListOfFunctionsArgument=wo,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=Bp,u.parallelExecutionOperationListOfFunctionsArgumentRef=Cp,u.parallelExecutionOperationListOfFunctionsBlueprint=Op,u.parallelExecutionOperationRef=Mp,u.parallelExecutionOperationRefThree=Np,u.persistedBuiltInBaseEntity=_e,u.persistedBuiltInBaseEntityCreatedAtProperty=Jf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=kf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=II,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=qf,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=jf,u.persistedBuiltInBaseEntityDatabaseProperty=Ti,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=RI,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=Mf,u.persistedBuiltInBaseEntityDatabasePropertyRef=_f,u.persistedBuiltInBaseEntityDeletedAtProperty=xf,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Ff,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=vI,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Uf,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=Gf,u.persistedBuiltInBaseEntityIdentifierProperty=Lf,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=Nf,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Vf,u.persistedBuiltInBaseEntityIdentifierPropertyRef=$f,u.persistedBuiltInBaseEntityUpdatedAtProperty=zf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=Hf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=PI,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Yf,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Wf,u.processOutputGlobalValueDescriptorDataType=pm,u.processOutputGlobalValueDescriptorReturn=Xo,u.processOutputGlobalValueDescriptorReturnRef=um,u.projectPublicationCompletedGlobalEvent=Na,u.propertyToZodSchema=Sm,u.relationalDatabaseBuiltInBaseEntity=vn,u.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=qo,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=Af,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=Sf,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=Df,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=ko,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=If,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=Pf,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Ba,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=Tf,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=Ef,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Ma,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=gf,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=vf,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=_a,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=hI,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=bf,u.relationalDatabaseBuiltInBaseEntityRef=Cr,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=wa,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=pI,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=Rf,u.resolveActionDescriptorName=av,u.resolveBaseEntityName=nv,u.resolveBuiltInBaseEntityDataTypeLabel=ad,u.resolveConditionOperatorLabel=Qs,u.resolveCustomEntityDataTypeLabel=sd,u.resolveDataType=Zs,u.resolveDataTypeLabel=Kg,u.resolveEntityDataTypeLabel=tv,u.resolveEntityName=A,u.resolveFirstCallsSecond=l3,u.resolveFirstWritesSecond=c3,u.resolvePrimitiveEntityName=iv,u.resolvePropertyDataTypeLabel=ev,u.resolveSearchName=rv,u.resolveVariableDataTypeLabel=K6,u.resolveVariableDeclarationDataTypeLabel=lr,u.resolveVariableInstanceDataTypeLabel=Qg,u.resolveVariableScope=Z6,u.sequentialExecutionOperation=rn,u.sequentialExecutionOperationError=ey,u.sequentialExecutionOperationErrorParentRef=Kp,u.sequentialExecutionOperationListOfExecutionResultsDataType=Zp,u.sequentialExecutionOperationListOfExecutionResultsReturn=No,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Qp,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=zp,u.sequentialExecutionOperationListOfFunctionsArgument=Mo,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=Yp,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Xp,u.sequentialExecutionOperationListOfFunctionsArgumentRef=Hp,u.sequentialExecutionOperationListOfFunctionsBlueprint=Wp,u.softDeletePersistedEntityMethod=Bf,u.softDeletePersistedEntityMethodParentRef=Cf,u.sortCallsBasedOnExecutionDependencies=vv,u.sortChildrenEntitiesBasedOnExecutionDependencies=s3,u.splitListOperation=So,u.splitListOperationError=Qu,u.splitListOperationErrorParentRef=Xu,u.splitListOperationFirstOutputListDataType=xu,u.splitListOperationFirstOutputListReturn=Hu,u.splitListOperationFirstOutputListReturnParentRef=Wu,u.splitListOperationFirstOutputListReturnRef=Ao,u.splitListOperationInputListArgument=ku,u.splitListOperationInputListArgumentParentRef=ju,u.splitListOperationInputListArgumentRef=Lu,u.splitListOperationInputListDataType=Gu,u.splitListOperationSecondOutputListDataType=Yu,u.splitListOperationSecondOutputListReturn=Zu,u.splitListOperationSecondOutputListReturnParentRef=zu,u.splitListOperationSplitIndexArgument=Ju,u.splitListOperationSplitIndexArgumentParentRef=qu,u.splitListOperationSplitIndexArgumentRef=Fu,u.splitListOperationSplitIndexDataType=Uu,u.stringPrototype=F,u.stringValueAutogenerationSchema=Ql,u.suggestNewIdForEntity=pd,u.test_primitive_entities_export=$3,u.toCamelCase=X6,u.toEntityState=Nt,u.toKebabCase=Xg,u.toLowerCaseKebabCase=Xs,u.toPascalCase=Q6,u.untypedObjectPrototype=Xe,u.updateErrorsList=X,u.updateValueReader=ha,u.urlDefaultValue=Oy,u.uuidPrototype=Ta,u.validateArgumentDeclarationName=dd,u.validateCalledByErrorIdInAction=X9,u.validateCalledByIdInAction=Z9,u.validateCallers=hv,u.validateConditionEntityDeclaration=e3,u.validateCustomEntityName=Ks,u.validateDataOperation=kn,u.validateDataOperationDataToValidateArgument=Ty,u.validateDataOperationDataToValidateArgumentParentRef=my,u.validateDataOperationDataToValidateArgumentRef=hy,u.validateDataOperationDataToValidateDataType=fy,u.validateDataOperationEntityToMatchTypeArgument=gy,u.validateDataOperationEntityToMatchTypeArgumentParentRef=by,u.validateDataOperationEntityToMatchTypeArgumentRef=Ey,u.validateDataOperationEntityToMatchTypeDataType=Ry,u.validateDataOperationError=Dy,u.validateDataOperationErrorParentRef=Py,u.validateDataOperationOutputEntityDeclaration=Iy,u.validateDataOperationOutputEntityDeclarationParentRef=vy,u.validateEntryCaller=yv,u.validateErrorCaller=pv,u.validateFunctionCallDeclaration=mv,u.validateFunctionDeclarationName=od,u.validateGeneratedEntityParentIsNotBuiltInEntity=W9,u.validateGeneration=q9,u.validateGenerationTarget=Ae,u.validateGenerationUpdate=J9,u.validateLoopEntityDeclaration=t3,u.validateName=e9,u.validateOperationEntityDeclaration=Tv,u.validatePropertyName=cd,u.validateReachability=En,u.validateReadsValueInActionPayload=Q9,u.validateReferenceObject=to,u.validateReferenceToOne=md,u.validateReferences=Ge,u.validateReturnDeclarationName=ud,u.validateSuccessCaller=uv,u.validateValueReaderGenerationUpdate=ua,u.validateValueWritter=vd,u.validateVariableDeclarationName=ld,u.validateVariableInternalCallUse=Id,u.valueAutogenerationCurrentDateAndTimeSchema=ob,u.valueAutogenerationGenericSchema=bs,u.valueAutogenerationOptions=tc,u.valueAutogenerationOptionsSchema=sb,u.valueAutogenerationRandomBooleanSchema=Xl,u.valueAutogenerationRandomDateBetweenSchema=mb,u.valueAutogenerationRandomDateFromSchema=hb,u.valueAutogenerationRandomDateSchema=Is,u.valueAutogenerationRandomDateUntilSchema=fb,u.valueAutogenerationRandomNumberBetweenSchema=db,u.valueAutogenerationRandomNumberFromSchema=lb,u.valueAutogenerationRandomNumberSchema=gs,u.valueAutogenerationRandomNumberUntilSchema=cb,u.valueAutogenerationRandomSchema=Hi,u.valueAutogenerationRandomTextBetweenSchema=yb,u.valueAutogenerationRandomTextFromSchema=ub,u.valueAutogenerationRandomTextSchema=vs,u.valueAutogenerationRandomTextUntilSchema=pb,u.valueAutogenerationRangeValueTypesSchema=Wi,u.valueAutogenerationUniqueSchema=Zl,u.waitOperation=ot,u.waitOperationMillisecondsNumberArgument=jn,u.waitOperationMillisecondsNumberArgumentRef=Fp,u.waitOperationMillisecondsNumberDataType=Up,u.waitOperationOperationError=kp,u.waitOperationOperationErrorParentRef=jp,u.waitOperationRef=xp,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
373
|
+
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 O([...this.extends.reduce((e,t)=>[...[...t.properties,...t.extendedProperties].filter(a=>!a.abstract),...e],[]),...this.implements.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=>{n8(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)}),r8(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),d=R(o,this.project);if(d.suggestion=!0,d.setParent(this),d.initChildren(),d.inputs.forEach(p=>{p.suggestion=!0}),d.returnStatements.length){const p=d.returnStatements[0];p.suggestion=!0,p.outputs.forEach(h=>{h.suggestion=!0})}this.addSuggestedMethod(d)})}),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:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.methods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:d}=s.remove({ignoreUpstream:!0,seenEntities:t});i.push(...o),a.push(...d)}),{affected:O(i),removed:O(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:O(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=t8(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 lo(this,e,t)}getAllInteractiveMethods(){const e=this.implements.filter(i=>i.type===r.CustomEntity||i.type===r.BuiltInBaseEntity&&i.interactive);return[...this.methods,...this.extends.flatMap(i=>i.getAllInteractiveMethods()),...e.flatMap(i=>i.getAllInteractiveMethods())]}};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 Pr=pe;function v3(n){const e=_4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class $t{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 O(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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=v3(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 $t(this.toJSON(),this.project)}implement(e,t){return lo(this,e,t)}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(i=>i.type===r.BuiltInBaseEntity&&i.interactive||i.type===r.PrimitiveEntity).forEach(i=>{i instanceof $t&&e.push(...i.getAllInteractiveMethods())})),e}}function I3(n){const e=I4(),t=n.toJSON();e.safeParse(t).success;const a=[];return X(n.errors,a)}class Vt{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})}get extendedProperties(){return O(this.extends.reduce((e,t)=>{const i=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...i]},[]))}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=I3(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 Vt(this.toJSON(),this.project)}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(i=>i.type===r.BuiltInBaseEntity&&i.interactive||i.type===r.PrimitiveEntity).forEach(i=>{i instanceof $t&&e.push(...i.getAllInteractiveMethods())}),e}}function ma(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case r.PrimitiveValue:return t||new ci(n,e);case r.CustomEntity:return t||new Pr(n,e);case r.PrimitiveEntity:return t||new Vt(n,e);case r.FunctionDeclaration:return t||new dr(n,e);case r.GlobalEvent:return t||new oi(n,e);case r.DataType:return t||new si(n,e);case r.Property:return t||new cr(n,e);case r.FunctionCall:return t||new gr(n,e);case r.Condition:return t||new yr(n,e);case r.Operation:return t||new ur(n,e);case r.VariableDeclaration:return t||new hr(n,e);case r.VariableInstance:return t||new fr(n,e);case r.OutputMap:return t||new Tn(n,e);case r.ReturnDeclaration:return t||new Ct(n,e);case r.ArgumentDeclaration:return t||new Er(n,e);case r.InputMap:return t||new mn(n,e);case r.Project:return t||new $(n);case r.InstalledProject:return t||new Tr(n,e);case r.ActionDescriptor:return t||new $e(n,e);case r.ReturnStatement:return t||new Rr(n,e);case r.Loop:return t||new pr(n,e);case r.Search:return t||new mr(n,e);case r.ValueDescriptor:return t||new br(n,e);case r.BuiltInBaseEntity:return t||new $t(n,e);case r.InternalCall:return t||new li(n,e);case r.ContinueStatement:return t||new yt(n,e);case r.BreakStatement:return t||new di(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=ma(n,e);return t.subscribe(),t}function P3(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case r.PrimitiveValue:return ci.fromGenerationTarget(n,e);case r.CustomEntity:return Pr.fromGenerationTarget(n,e);case r.FunctionDeclaration:return dr.fromGenerationTarget(n,e);case r.GlobalEvent:return oi.fromGenerationTarget(n,e);case r.DataType:return si.fromGenerationTarget(n,e);case r.Property:return cr.fromGenerationTarget(n,e);case r.FunctionCall:return gr.fromGenerationTarget(n,e);case r.Condition:return yr.fromGenerationTarget(n,e);case r.Operation:return ur.fromGenerationTarget(n,e);case r.VariableDeclaration:return hr.fromGenerationTarget(n,e);case r.VariableInstance:return fr.fromGenerationTarget(n,e);case r.OutputMap:return Tn.fromGenerationTarget(n,e);case r.ReturnDeclaration:return Ct.fromGenerationTarget(n,e);case r.ArgumentDeclaration:return Er.fromGenerationTarget(n,e);case r.InputMap:return mn.fromGenerationTarget(n,e);case r.InstalledProject:return Tr.fromGenerationTarget(n,e);case r.ReturnStatement:return Rr.fromGenerationTarget(n,e);case r.Loop:return pr.fromGenerationTarget(n,e);case r.Search:return mr.fromGenerationTarget(n,e);case r.ActionDescriptor:return $e.fromGenerationTarget(n,e);case r.ValueDescriptor:return br.fromGenerationTarget(n,e);case r.InternalCall:return li.fromGenerationTarget(n,e);case r.ContinueStatement:return yt.fromGenerationTarget(n,e);case r.BreakStatement:return di.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const Y=class Y{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;try{Y.UUID||(Y.UUID=as==null?void 0:as())}catch(t){console.error("Error initializing UUID module",t),Y.UUID={uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:i=>i}}}static injectUUIDModule(e){Y.UUID=e}static validateGenerationTarget(e,t){let i=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Ae(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+"--"+Y.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=zx(),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 Y(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=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.operations.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.loops.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[]),...this.searches.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.functionCalls.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.conditions.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.loops.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[]),...this.searches.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.conditions.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.operations.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.loops.reduce((t,i)=>{const a=Ie(i);return[...t,...a.filter(s=>s.type===r.FunctionCall)]},[]),...this.searches.reduce((t,i)=>{const a=Ie(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 O([...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(d=>d.id===s);o&&i.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===_.PERSISTED_ENTITY)||null}};l(Y,"UUID",{uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),l(Y,"MUTABLE_BASE_PROPERTIES",["name","description"]),l(Y,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),l(Y,"BASE_PROPERTIES",[...Y.MUTABLE_BASE_PROPERTIES,...Y.INMUTABLE_BASE_PROPERTIES]),l(Y,"MUTABLE_META_PROPERTIES",[...Y.MUTABLE_BASE_PROPERTIES,"x","y"]),l(Y,"INMUTABLE_META_PROPERTIES",[...Y.INMUTABLE_BASE_PROPERTIES]),l(Y,"META_PROPERTIES",[...Y.MUTABLE_META_PROPERTIES,...Y.INMUTABLE_META_PROPERTIES]),l(Y,"MUTABLE_UPSTREAM_PROPERTIES",[]),l(Y,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),l(Y,"UPSTREAM_PROPERTIES",[...Y.MUTABLE_UPSTREAM_PROPERTIES,...Y.INMUTABLE_UPSTREAM_PROPERTIES]),l(Y,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),l(Y,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),l(Y,"DOWNSTREAM_PROPERTIES",[...Y.MUTABLE_DOWNSTREAM_PROPERTIES,...Y.INMUTABLE_DOWNSTREAM_PROPERTIES]),l(Y,"PROPERTIES",[...Y.META_PROPERTIES,...Y.UPSTREAM_PROPERTIES,...Y.DOWNSTREAM_PROPERTIES]);let $=Y;class Hv extends $e{constructor(t){super(Lt,t);l(this,"id",Pe.Parallel);l(this,"name",Pe.Parallel);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",Lt);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=Lt.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=Lt.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Lt.error?R(Lt.error,this.project):null}}class Yv 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 zv extends $e{constructor(t){super(rn,t);l(this,"id",Pe.Sequential);l(this,"name",Pe.Sequential);l(this,"description","Execute a list of actions one after the other");l(this,"version",1);l(this,"autoexecutable",!0);l(this,"initialData",rn);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=rn.fixedArguments.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=rn.fixedReturns.map(i=>{const a=R(i,this.project);return a.setParent(this),a.initChildren(),a}),this.error=rn.error?R(rn.error,this.project):null}}function D3(n){const e=[new zv(n),new Hv(n),new Yv(n),new $e(fi,n),new $e(Or,n),new $e(kn,n),new $e(ga,n),new $e(Do,n),new $e(Oo,n),new $e(So,n),new $e(Ea,n),new $e(yi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class Zv extends $t{constructor(t){super(_e,t);l(this,"initialData");l(this,"id",_.PERSISTED_ENTITY);l(this,"version",1);l(this,"name",_.PERSISTED_ENTITY);l(this,"description",_e.description);l(this,"type",r.BuiltInBaseEntity);l(this,"abstract",_e.abstract);l(this,"static",_e.static);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}),this.extends=this.initialData.extends.map(i=>R(i,this.project))}}function A3(n){const e=[new Zv(n),new $t(Ca,n),new $t(vn,n),new $t(Ho,n),new $t(Oa,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function S3(n){const e=[new Vt(F,n),new Vt(bn,n),new Vt(De,n),new Vt(Xe,n),new Vt(gn,n),new Vt(nn,n),new Vt(Ta,n),new Vt(go,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function O3(n){const e=[new $e(Na,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function C3(n){const e=[new $e(qn,n),new $e(Fo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function B3(n){const e=[new br(Xo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function w3(n){const e=[new $e(Jn,n),new $e(Br,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const Dr={},To={};async function _3(n,e={}){const t={...ab};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 Xv(n){const e=new $(n);return S3(e),A3(e),D3(e),O3(e),C3(e),B3(e),w3(e),e.initChildren(),e}async function M3(n,e={}){if(n.id&&Dr[n.id])return Dr[n.id];if(n.id&&To[n.id])return await To[n.id],Dr[n.id];const t=_3(n,e);n.id&&(To[n.id]=t);const i=await t;if(i.data){const a=Xv(i.data);return Dr[n.id]=a,n.id&&delete To[n.id],a}return null}function N3(n){return Dr[n.id]&&delete Dr[n.id],null}const $3="test_primitive_entities_export";u.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=gd,u.ActionDescriptorState=$e,u.ActionDescriptorValuesType=L,u.ActionInputMapState=_9,u.ActionOutputMapState=$9,u.AppendToListOperationInputIds=up,u.AppendToListOperationOutputIds=pp,u.ArgumentDeclarationState=Er,u.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=Td,u.BUILT_IN_BASE_ENTITY_IDS=Ve,u.BUILT_IN_ENTITY_TYPES=Sr,u.BaseCanvasDraggableState=m9,u.BaseEntityNames=_,u.BaseState=f9,u.BaseValueDescriptorIds=$o,u.BreakStatementState=di,u.BuiltInBaseEntityState=$t,u.CACHED_PROJECTS_BY_ID=Dr,u.CALLABLE_ENTITIES_EXPLANATION=H9,u.CALLABLE_TYPES=Rn,u.CALLER_ENTITIES_EXPLANATION=cv,u.CALLER_TYPES=tn,u.CALLS_UPDATE_EXPLANATION=Ln,u.COMPARISON_CONDITIONS=dm,u.CONDITIONS=OI,u.CUSTOM_ENTITY_OPERATIONS=Ay,u.CallableEntityClass=E9,u.CallerEntityClass=yd,u.ChildEntityState=T9,u.ComparisonOperatorTypes=Oe,u.ConditionState=yr,u.ContinueStatementState=yt,u.CreateNewInputIds=ny,u.CreateNewOutputIds=ry,u.CustomEntityState=Pr,u.DRAGGABLE_CALLABLE_TYPES=Ro,u.DRAGGABLE_CALLER_TYPES=Gd,u.DRAGGABLE_ELEMENT_TYPES=bo,u.DRAGGABLE_EXECUTABLE_TYPES=nI,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=Eo,u.DataTypeCompatibilityTypes=Mt,u.DataTypeParentChildRelation=qe,u.DataTypeState=si,u.ENTITIES_WITH_VALLUES_EXPLANATION=ro,u.ENTITY_TYPES=rI,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=st,u.ENTITY_WITH_NAMES_TYPES=Fd,u.ENTITY_WITH_VALUE_TYPES=Ld,u.ENTRY_POINT_ENTITIES_EXPLANATION=da,u.ENTRY_POINT_TYPES=Me,u.EVENT_TYPES=Ar,u.EXECUTABLE_TYPES=tI,u.EXECUTION_OPERATIONS=ty,u.EntityError=Kn,u.EntityErrorSeverity=f,u.EntityGenerationError=E,u.EntityGenerationErrorCode=y,u.EntityInstanceErrorCode=S,u.EntityOperations=Ze,u.EntityType=r,u.EntityWithLogicScopeClass=v9,u.EntityWithValueClass=g9,u.EntryPointEntityClass=R9,u.ExecutionOperations=Pe,u.FunctionCallState=gr,u.FunctionDeclarationState=dr,u.GLOBAL_EVENT_DECLARATIONS=CI,u.GetLastInListOperationInputIds=Ku,u.GetLastInListOperationOutputIds=ep,u.GlobalEventNames=en,u.GlobalEventState=oi,u.HTTPOperations=Ye,u.HTTP_OPERATIONS=sh,u.InputMapState=mn,u.InstalledProjectState=Tr,u.InternalCallState=li,u.JoinListOperationInputIds=Ru,u.JoinListOperationOutputIds=bu,u.JoinStringOperationInputIds=au,u.JoinStringOperationOutputIds=su,u.LIST_OPERATIONS=Dp,u.ListOperations=k,u.LoopState=pr,u.LoopTypes=je,u.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=Gn,u.NUMBER_OPERATIONS=iu,u.NumberAdditionOperationInputIds=Jd,u.NumberAdditionOperationOutputIds=Wd,u.NumberOperations=at,u.OPERATION_DECLARATIONS=aI,u.OperationState=ur,u.OutputMapParentChildRelation=Vd,u.OutputMapState=Tn,u.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=io,u.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Vn,u.PASS_THROUGH_CALLABLE_TYPES=we,u.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=bd,u.ParallelExecutionOperation=Hv,u.ParallelExecutionOperationInputIds=Ap,u.ParallelExecutionOperationOutputIds=Sp,u.PassThroughCallableEntityClass=b9,u.PersistedEntity=Zv,u.PersistedEntityMethods=Pt,u.PrimitiveEntityState=Vt,u.PrimitiveTypes=v,u.PrimitiveValueState=ci,u.ProjectState=$,u.PropertyState=cr,u.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=Y9,u.ReturnDeclarationState=Ct,u.ReturnStatementState=Rr,u.STANDALONE_CONDITIONS=im,u.STRING_OPERATIONS=Eu,u.ScopeCompatibilityType=mo,u.SearchState=mr,u.SequentialExecutionOperation=zv,u.SequentialExecutionOperationInputIds=qp,u.SequentialExecutionOperationOutputIds=Jp,u.SharedEntityErrorCode=g,u.SharedStateFunctionality=sv,u.SplitListOperationInputIds=$u,u.SplitListOperationOutputIds=Vu,u.StandaloneOperatorTypes=Bt,u.StringOperations=ve,u.TERMINATION_TYPES=Ce,u.USER_MANAGED_ENTITY_TYPES=iI,u.UserManagedEntityStateFunctionality=h9,u.VALUE_READING_ENTITIES_EXPLANATION=Rd,u.VALUE_READING_TYPES=xn,u.VALUE_WRITING_ENTITIES_EXPLANATION=dv,u.VALUE_WRITING_TYPES=Be,u.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=Ed,u.VARIABLE_TYPES=Fe,u.ValidationInputIds=py,u.ValidationOutputIds=yy,u.ValueAutogenerationType=xe,u.ValueDescriptorParentChildRelation=C,u.ValueDescriptorState=br,u.ValueReadingEntityClass=la,u.ValueWritingEntityClass=ca,u.VariableDeclarationState=hr,u.VariableInputMapState=w9,u.VariableInstanceState=fr,u.VariableOutputMapState=N9,u.WaitOperation=Yv,u.WaitOperationInputIds=Lp,u.WaitOperationOutputIds=Gp,u._VALUE_READING_TYPES=Kv,u._VALUE_WRITING_TYPES=eI,u.appendToListOperation=ga,u.appendToListOperationElementToAppendArgument=Bo,u.appendToListOperationElementToAppendArgumentParentRef=bp,u.appendToListOperationElementToAppendArgumentRef=fp,u.appendToListOperationError=Pp,u.appendToListOperationErrorParentRef=Ip,u.appendToListOperationListArgument=Co,u.appendToListOperationListArgumentParentRef=Rp,u.appendToListOperationListArgumentRef=yp,u.appendToListOperationListDataType=hp,u.appendToListOperationResultListDataType=Ep,u.appendToListOperationResultListReturn=vp,u.appendToListOperationResultListReturnParentRef=gp,u.appendToListOperationResultListReturnRef=Tp,u.appendToListOperationSecondListDataType=mp,u.asGenerationActionExample=Qt,u.baseHttpRequestFunctionDeclaration=fi,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=Go,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=ah,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=ih,u.baseHttpRequestFunctionDeclarationRef=eh,u.baseHttpRequestFunctionDeclarationRefEight=nh,u.baseHttpRequestFunctionDeclarationRefFive=Qy,u.baseHttpRequestFunctionDeclarationRefFour=Xy,u.baseHttpRequestFunctionDeclarationRefNine=rh,u.baseHttpRequestFunctionDeclarationRefSeven=th,u.baseHttpRequestFunctionDeclarationRefSix=Ky,u.baseHttpRequestFunctionDeclarationRefThree=Zy,u.baseHttpRequestFunctionDeclarationRefTwo=zy,u.booleanPrototype=bn,u.capitalizeFirstLetter=Hs,u.checkAreCustomEntitiesCompatibleAsDataType=qg,u.checkAreDataTypesCompatible=Ys,u.checkArePropertiesCompatibleAsDataType=kg,u.checkIsBranchDependentButNotDirectlyOnBranch=pa,u.checkIsBranchDependentOnBranch=r3,u.checkIsCallableEntityReachable=fa,u.checkIsCanvasEntity=R3,u.checkIsDetachedBranch=Uv,u.checkIsDetachedBranchShallow=Nd,u.checkIsGlobalVariable=E3,u.checkIsGloballyDeclared=Md,u.checkIsMethod=kv,u.checkIsNestedScope=fo,u.checkScopeCompatibility=ya,u.createEntityError=j,u.createNewInstanceOperation=Or,u.createNewInstanceOperationEntityToInstanciateArgument=oy,u.createNewInstanceOperationEntityToInstanciateArgumentRef=iy,u.createNewInstanceOperationEntityToInstanciateDataType=ay,u.createNewInstanceOperationError=uy,u.createNewInstanceOperationErrorParentRef=dy,u.createNewInstanceOperationOutputEntityDeclaration=cy,u.createNewInstanceOperationOutputEntityDeclarationParentRef=ly,u.createNewInstanceOperationRef=sy,u.createSemanticId=Xt,u.createStateFromGenerationTargetType=P3,u.createStateFromType=ma,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=Ho,u.cronJobBuiltInBaseEntityExpressionProperty=em,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=DI,u.cronJobBuiltInBaseEntityExpressionPropertyRef=Qf,u.cronJobBuiltInBaseEntityRef=Kf,u.cronJobTriggeredFunctionDeclarationBlueprint=Wo,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=Zf,u.customEntityToZodSchema=Om,u.dataTypeCompatibilityToErrorExplanation=Ev,u.datePrototype=nn,u.dateValueAutogenerationSchema=ec,u.deletePersistedEntityMethod=Jo,u.deletePersistedEntityMethodParentRef=Of,u.deleteRootProject=N3,u.endpointBuiltInBaseEntity=Ca,u.endpointBuiltInBaseEntityRef=Sh,u.endpointBuiltInBaseEntityRefFour=mf,u.endpointBuiltInBaseEntityRefThree=Vh,u.endpointBuiltInBaseEntityRefTwo=_h,u.endpointBuiltInCorsProperty=Oh,u.endpointBuiltInCorsPropertyDataType=Ah,u.endpointBuiltInCorsPropertyDataTypeRef=Ph,u.endpointBuiltInCorsPropertyRef=Dh,u.endpointBuiltInMethodProperty=xo,u.endpointBuiltInMethodPropertyDataType=$h,u.endpointBuiltInMethodPropertyDataTypeRef=Mh,u.endpointBuiltInMethodPropertyRef=Nh,u.endpointBuiltInPathProperty=Uo,u.endpointBuiltInPathPropertyDataType=wh,u.endpointBuiltInPathPropertyDataTypeRef=Ch,u.endpointBuiltInPathPropertyRef=Bh,u.endpointPathParamsArgumentDeclaration=Xh,u.endpointPathParamsArgumentDeclarationRef=Wh,u.endpointPathParamsVariableDataType=Hh,u.endpointPathParamsVariableDataTypeRef=Jh,u.endpointReachedTriggerActionDescriptor=jo,u.endpointReachedTriggerActionDescriptorRef=Yh,u.endpointReachedTriggerActionDescriptorRefFour=ef,u.endpointReachedTriggerActionDescriptorRefThree=Qh,u.endpointReachedTriggerActionDescriptorRefTwo=Zh,u.endpointRequestBodyArgumentDeclaration=tf,u.endpointRequestBodyArgumentDeclarationRef=Uh,u.endpointRequestBodyVariableDataType=xh,u.endpointRequestHeadersArgumentDeclaration=zh,u.endpointRequestHeadersArgumentDeclarationRef=Gh,u.endpointRequestHeadersVariableDataType=Fh,u.endpointRequestHeadersVariableDataTypeRef=Lh,u.endpointRequestQueryParamsArgumentDeclaration=Kh,u.endpointRequestQueryParamsArgumentDeclarationRef=kh,u.endpointRequestQueryParamsVariableDataType=qh,u.endpointRequestQueryParamsVariableDataTypeRef=jh,u.endpointResponseBodyDataType=yf,u.endpointResponseBodyReturnDeclaration=ff,u.endpointResponseBodyReturnDeclarationRef=pf,u.endpointResponseCodeDataType=rf,u.endpointResponseCodeReturnDeclaration=sf,u.endpointResponseCodeReturnDeclarationRef=nf,u.endpointResponseHeadersDataType=cf,u.endpointResponseHeadersDataTypeRef=of,u.endpointResponseHeadersReturnDeclaration=uf,u.endpointResponseHeadersReturnDeclarationRef=lf,u.endpointReturnStatementRef=af,u.endpointReturnStatementRefThree=hf,u.endpointReturnStatementRefTwo=df,u.enumOptionsProperty=qd,u.enumOptionsPropertyDataType=jd,u.enumOptionsPropertyDataTypeRef=Ud,u.enumOptionsPropertyRef=xd,u.enumPrototype=gn,u.enumPrototypeRef=kd,u.executionBuiltInEntity=zo,u.executionBuiltInEntityAbortMethod=Yo,u.executionBuiltInEntityAbortMethodParentRef=tm,u.filterOutDuplicateEntities=O,u.filterOutDuplicateErrors=h4,u.findReferenceToSelfInList=_v,u.findReferencesToSelfInProject=p3,u.flattenCalls=Kt,u.flattenCanvasAncestorsUntil=co,u.flattenCustomEntityExtensionAndImplementationTypes=Lv,u.flattenCustomEntityExtensionTypes=yo,u.flattenCustomEntityExtensions=Bd,u.flattenCustomEntityImplementations=wd,u.flattenCustomEntityImplementionTypes=po,u.flattenDerivedCanvasEntities=It,u.flattenDetachedBranch=jv,u.flattenElementCalls=Ie,u.flattenElementCallsOnTheSameScope=u3,u.flattenProjectElements=wv,u.flattenRelatedCanvasElementsOnTheLeft=Vv,u.flattenRelatedCanvasElementsOnTheRight=$v,u.flattenVariableReads=Bv,u.flattenVariableWrites=Cv,u.flattenVariables=Z,u.fromZodParseToEntityGenerationErrors=hd,u.generate=DD,u.generateActionExample=z9,u.generateExecutionDataType=Jg,u.generateMutablePropertiesExplanation=eo,u.generateRandomBoolean=eT,u.generateRandomDate=_m,u.generateRandomDateAfter=Cm,u.generateRandomDateBefore=Bm,u.generateRandomDateBetweenRange=wm,u.generateRandomNumber=zm,u.generateRandomNumberAfter=Wm,u.generateRandomNumberBefore=Hm,u.generateRandomNumberBetweenRange=Ym,u.generateRandomText=Km,u.generateRandomTextAfter=Zm,u.generateRandomTextBefore=Xm,u.generateRandomTextBetweenRange=Qm,u.generateUniqueUUID=Jm,u.getAllActionDescriptorsForConditions=oo,u.getAllActionDescriptorsForGlobalEvents=ao,u.getAllActionDescriptorsForLoops=so,u.getAllActionDescriptorsForOperations=K9,u.getAllGloballyDeclaredFunctionDeclarationsExplanation=fv,u.getBaseBuiltInEntities=Un,u.getBaseSchemaBasedOnType=ov,u.getBuiltInEntityOwner=Ir,u.getCallableEntityReferenceSchema=ke,u.getCallableEntityTypeSchema=Bb,u.getCallerEntityReferenceSchema=Rx,u.getCallerEntityTypeSchema=Ex,u.getCalls=Dd,u.getCanvasEntitiesDerivedFromInternalCalls=Nv,u.getCanvasEntitiesDerivedFromWrites=ui,u.getCanvasEntityDerivedFromValueReadingEntity=Cd,u.getCanvasEntityReferenceSchema=Vx,u.getCanvasEntityTypeSchema=$x,u.getChildrenEntityWithValues=a3,u.getCommonAncestor=Pd,u.getCommonChildren=gv,u.getDeclaration=rd,u.getDeepestScope=Wv,u.getDraggableCallableEntityReferenceSchema=_b,u.getDraggableCallableEntityTypeSchema=wb,u.getDraggableCallerEntityReferenceSchema=gx,u.getDraggableCallerEntityTypeSchema=bx,u.getDraggableExecutableEntityReferenceSchema=Dx,u.getDraggableExecutableEntityTypeSchema=Px,u.getDraggablePassThroughCallableEntityReferenceSchema=Fs,u.getDraggablePassThroughCallableEntityTypeSchema=Gs,u.getDraggablePlayableEntityReferenceSchema=Bx,u.getDraggablePlayableEntityTypeSchema=Cx,u.getEntityArgumentDeclarations=Sd,u.getEntityInputMaps=Mv,u.getEntityOutputMaps=f3,u.getEntityReferenceSchema=Nx,u.getEntityReturnDeclarations=Od,u.getEntityTypeSchema=Mx,u.getEntityWithLogicScopeReferenceSchema=yn,u.getEntityWithLogicScopeTypeSchema=Ax,u.getEntityWithValueReferenceSchema=Cb,u.getEntityWithValueTypeSchema=Tx,u.getEntryPointEntityReferenceSchema=Ue,u.getEntryPointEntityTypeSchema=Mn,u.getEventEntityReferenceSchema=Vs,u.getEventEntityTypeSchema=$s,u.getExecutableEntityReferenceSchema=Ix,u.getExecutableEntityTypeSchema=vx,u.getExtendedBuiltInEntity=m3,u.getExtendedCustomEntity=Fv,u.getGenerationTargetSchemaBasedOnType=lv,u.getHeadIfPartOfDetachedBranch=xv,u.getHighestScope=Jv,u.getImplementedBuiltInEntity=T3,u.getIsInteractive=_d,u.getLastInListOperation=Oo,u.getLastInListOperationError=dp,u.getLastInListOperationErrorParentRef=cp,u.getLastInListOperationInputListArgument=sp,u.getLastInListOperationInputListArgumentParentRef=ap,u.getLastInListOperationInputListArgumentRef=tp,u.getLastInListOperationInputListDataType=np,u.getLastInListOperationOutputElementDataType=ip,u.getLastInListOperationOutputElementReturn=lp,u.getLastInListOperationOutputElementReturnParentRef=op,u.getLastInListOperationOutputElementReturnRef=rp,u.getLinkedEntitiesFromArgumentDeclaration=d3,u.getLowestPersistedEntityImplementation=Gv,u.getParentCanvasEntities=ht,u.getParentCanvasEntity=He,u.getParentEntryPoint=i3,u.getPassThroughCallableEntityReferenceSchema=ye,u.getPassThroughCallableEntityTypeSchema=Ls,u.getPlayableEntityReferenceSchema=Ox,u.getPlayableEntityTypeSchema=Sx,u.getProject=M3,u.getPrototypeByType=ho,u.getReferenceEntityId=D,u.getReferencedEntitiesStateOrErrors=no,u.getReferencedEntityStateOrErrors=fd,u.getRelatedCanvasElementsOnTheLeft=vr,u.getRelatedCanvasElementsOnTheRight=Fn,u.getRootEntryPointScopeOwner=$d,u.getScopeOwner=ft,u.getTerminationReferenceSchema=_x,u.getTerminationTypeSchema=wx,u.getUsedArgFromDeclaration=y3,u.getUsedReturnFromDeclaration=h3,u.getValueReadingEntityReferenceSchema=Ob,u.getValueReadingEntityTypeSchema=pn,u.getValueWritingEntityReferenceSchema=mx,u.getValueWritingEntityTypeSchema=Qi,u.getVariableFromInputMapping=Iv,u.getVariableFromReturnVariablePointer=Av,u.getVariableReferenceSchema=_n,u.getVariableTypeSchema=nr,u.getVariablesFromArgumentDeclarations=uo,u.getVariablesFromInputMaps=Pv,u.getVariablesFromOutputMapping=Sv,u.getVariablesFromOutputMaps=Ov,u.getVariablesFromReturnDeclarations=Dv,u.getVariablesInSameOrHigherScope=id,u.getWrites=Ad,u.groupCallsBasedOnParallelizableExecution=o3,u.handleAfterEntityImplementationSideEffects=bv,u.handleBeforeEntityImplementationSideEffects=Rv,u.httpRequestBodyArgument=Da,u.httpRequestBodyArgumentRef=Fy,u.httpRequestBodyDataType=Uy,u.httpRequestHeadersArgument=Pa,u.httpRequestHeadersArgumentRef=Ly,u.httpRequestHeadersDataType=Gy,u.httpRequestMethodArgument=va,u.httpRequestMethodArgumentRef=$y,u.httpRequestMethodDataType=Vy,u.httpRequestMethodDataTypeRef=My,u.httpRequestQueryParamsArgument=Vo,u.httpRequestQueryParamsArgumentRef=wy,u.httpRequestQueryParamsDataType=_y,u.httpRequestVariableURLArgument=Ia,u.httpRequestVariableURLArgumentRef=Cy,u.httpRequestVariableURLDataType=By,u.httpRequestVariableURLDataTypeRef=Sy,u.httpResponseBodyReturnDataType=Yy,u.httpResponseBodyReturnDataTypeRef=Wy,u.httpResponseBodyReturnReturn=hi,u.httpResponseBodyReturnReturnRef=Hy,u.httpResponseCodeDataType=jy,u.httpResponseCodeReturn=Lo,u.httpResponseCodeReturnRef=xy,u.httpResponseHeadersDataType=Jy,u.httpResponseHeadersDataTypeRef=ky,u.httpResponseHeadersReturn=Aa,u.httpResponseHeadersReturnRef=qy,u.implement=lo,u.inferArgumentDeclarationDataType=Wg,u.inferDataType=zs,u.inferInputMapDataType=Hg,u.inferOutputMapDataType=Zg,u.inferVariableDeclarationDataType=zg,u.inferVariableInstanceDataType=Yg,u.initProject=Xv,u.iterateOverListActionDescriptor=qn,u.iterateOverListActionDescriptorListArgumentDeclaration=yh,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=uh,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=dh,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=ph,u.iterateOverListActionDescriptorReturnDeclaration=ch,u.iterateOverListActionDescriptorReturnDeclarationParentRef=lh,u.joinListOperation=Do,u.joinListOperationError=Nu,u.joinListOperationErrorParentRef=Mu,u.joinListOperationFirstListArgument=Ou,u.joinListOperationFirstListArgumentParentRef=Su,u.joinListOperationFirstListArgumentRef=gu,u.joinListOperationFirstListDataType=vu,u.joinListOperationResultListDataType=Au,u.joinListOperationResultListReturn=_u,u.joinListOperationResultListReturnParentRef=wu,u.joinListOperationResultListReturnRef=Du,u.joinListOperationSecondListArgument=Bu,u.joinListOperationSecondListArgumentParentRef=Cu,u.joinListOperationSecondListArgumentRef=Iu,u.joinListOperationSecondListDataType=Pu,u.joinListWithLastSeparator=N,u.joinStringOperation=yi,u.joinStringOperationError=Tu,u.joinStringOperationErrorParentRef=mu,u.joinStringOperationFirstStringArgument=Ra,u.joinStringOperationFirstStringArgumentParentRef=yu,u.joinStringOperationFirstStringArgumentRef=ou,u.joinStringOperationFirstStringDataType=lu,u.joinStringOperationResultStringDataType=pu,u.joinStringOperationResultStringReturn=pi,u.joinStringOperationResultStringReturnParentRef=fu,u.joinStringOperationResultStringReturnRef=uu,u.joinStringOperationSecondStringArgument=ba,u.joinStringOperationSecondStringArgumentParentRef=hu,u.joinStringOperationSecondStringArgumentRef=cu,u.joinStringOperationSecondStringDataType=du,u.jsonPrototype=go,u.keyValueParamBuiltInBaseEntity=Oa,u.keyValueParamBuiltInBaseEntityNameProperty=bh,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=oI,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=Rh,u.keyValueParamBuiltInBaseEntityNamePropertyRef=Eh,u.keyValueParamBuiltInBaseEntityValueProperty=Ih,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=cI,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=vh,u.keyValueParamBuiltInBaseEntityValuePropertyRef=gh,u.lowercaseFirstLetter=jg,u.manualFlowActionDescriptor=Fo,u.manualFlowActionDescriptorDeclarationReturnDeclaration=Th,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=fh,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=hh,u.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=mh,u.mapActionDescriptorToTypeItRepresents=b3,u.mergeEntityErrorsList=f4,u.mergeListOfEntities=qv,u.methodDefaultValue=Ny,u.mockClientProject=ab,u.moreThanOrEqualCondition=Br,u.moreThanOrEqualConditionLeftHandArgument=om,u.moreThanOrEqualConditionLeftHandArgumentParentRef=sm,u.moreThanOrEqualConditionRightHandArgument=cm,u.moreThanOrEqualConditionRightHandArgumentParentRef=lm,u.notEmptyCondition=Jn,u.notEmptyConditionArgument=rm,u.notEmptyConditionRef=nm,u.numberAdditionOperation=Ea,u.numberAdditionOperationError=ru,u.numberAdditionOperationErrorParentRef=nu,u.numberAdditionOperationFirstNumberArgument=vo,u.numberAdditionOperationFirstNumberArgumentRef=Hd,u.numberAdditionOperationFirstNumberDataType=Yd,u.numberAdditionOperationRef=Kd,u.numberAdditionOperationRefThree=tu,u.numberAdditionOperationRefTwo=eu,u.numberAdditionOperationResultNumberDataType=Qd,u.numberAdditionOperationResultNumberReturn=Po,u.numberAdditionOperationResultNumberReturnRef=Xd,u.numberAdditionOperationSecondNumberArgument=Io,u.numberAdditionOperationSecondNumberArgumentRef=zd,u.numberAdditionOperationSecondNumberDataType=Zd,u.numberPrototype=De,u.numberValueAutogenerationSchema=Kl,u.parallelExecutionOperation=Lt,u.parallelExecutionOperationError=Vp,u.parallelExecutionOperationErrorParentRef=$p,u.parallelExecutionOperationListOfExecutionResultsDataType=_p,u.parallelExecutionOperationListOfExecutionResultsReturn=_o,u.parallelExecutionOperationListOfExecutionResultsReturnRef=wp,u.parallelExecutionOperationListOfFunctionsArgument=wo,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=Bp,u.parallelExecutionOperationListOfFunctionsArgumentRef=Cp,u.parallelExecutionOperationListOfFunctionsBlueprint=Op,u.parallelExecutionOperationRef=Mp,u.parallelExecutionOperationRefThree=Np,u.persistedBuiltInBaseEntity=_e,u.persistedBuiltInBaseEntityCreatedAtProperty=Jf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=kf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=II,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=qf,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=jf,u.persistedBuiltInBaseEntityDatabaseProperty=Ti,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=RI,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=Mf,u.persistedBuiltInBaseEntityDatabasePropertyRef=_f,u.persistedBuiltInBaseEntityDeletedAtProperty=xf,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=Ff,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=vI,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=Uf,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=Gf,u.persistedBuiltInBaseEntityIdentifierProperty=Lf,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=Nf,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Vf,u.persistedBuiltInBaseEntityIdentifierPropertyRef=$f,u.persistedBuiltInBaseEntityUpdatedAtProperty=zf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=Hf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=PI,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Yf,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Wf,u.processOutputGlobalValueDescriptorDataType=pm,u.processOutputGlobalValueDescriptorReturn=Xo,u.processOutputGlobalValueDescriptorReturnRef=um,u.projectPublicationCompletedGlobalEvent=Na,u.propertyToZodSchema=Sm,u.relationalDatabaseBuiltInBaseEntity=vn,u.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=qo,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=Af,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=Sf,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=Df,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=ko,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=If,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=Pf,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Ba,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=Tf,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=Ef,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Ma,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=gf,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=vf,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=_a,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=hI,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=bf,u.relationalDatabaseBuiltInBaseEntityRef=Cr,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=wa,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=pI,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=Rf,u.resolveActionDescriptorName=av,u.resolveBaseEntityName=nv,u.resolveBuiltInBaseEntityDataTypeLabel=ad,u.resolveConditionOperatorLabel=Qs,u.resolveCustomEntityDataTypeLabel=sd,u.resolveDataType=Zs,u.resolveDataTypeLabel=Kg,u.resolveEntityDataTypeLabel=tv,u.resolveEntityName=A,u.resolveFirstCallsSecond=l3,u.resolveFirstWritesSecond=c3,u.resolvePrimitiveEntityName=iv,u.resolvePropertyDataTypeLabel=ev,u.resolveSearchName=rv,u.resolveVariableDataTypeLabel=K6,u.resolveVariableDeclarationDataTypeLabel=lr,u.resolveVariableInstanceDataTypeLabel=Qg,u.resolveVariableScope=Z6,u.sequentialExecutionOperation=rn,u.sequentialExecutionOperationError=ey,u.sequentialExecutionOperationErrorParentRef=Kp,u.sequentialExecutionOperationListOfExecutionResultsDataType=Zp,u.sequentialExecutionOperationListOfExecutionResultsReturn=No,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=Qp,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=zp,u.sequentialExecutionOperationListOfFunctionsArgument=Mo,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=Yp,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Xp,u.sequentialExecutionOperationListOfFunctionsArgumentRef=Hp,u.sequentialExecutionOperationListOfFunctionsBlueprint=Wp,u.softDeletePersistedEntityMethod=Bf,u.softDeletePersistedEntityMethodParentRef=Cf,u.sortCallsBasedOnExecutionDependencies=vv,u.sortChildrenEntitiesBasedOnExecutionDependencies=s3,u.splitListOperation=So,u.splitListOperationError=Qu,u.splitListOperationErrorParentRef=Xu,u.splitListOperationFirstOutputListDataType=xu,u.splitListOperationFirstOutputListReturn=Hu,u.splitListOperationFirstOutputListReturnParentRef=Wu,u.splitListOperationFirstOutputListReturnRef=Ao,u.splitListOperationInputListArgument=ku,u.splitListOperationInputListArgumentParentRef=ju,u.splitListOperationInputListArgumentRef=Lu,u.splitListOperationInputListDataType=Gu,u.splitListOperationSecondOutputListDataType=Yu,u.splitListOperationSecondOutputListReturn=Zu,u.splitListOperationSecondOutputListReturnParentRef=zu,u.splitListOperationSplitIndexArgument=Ju,u.splitListOperationSplitIndexArgumentParentRef=qu,u.splitListOperationSplitIndexArgumentRef=Fu,u.splitListOperationSplitIndexDataType=Uu,u.stringPrototype=F,u.stringValueAutogenerationSchema=Ql,u.suggestNewIdForEntity=pd,u.test_primitive_entities_export=$3,u.toCamelCase=X6,u.toEntityState=Nt,u.toKebabCase=Xg,u.toLowerCaseKebabCase=Xs,u.toPascalCase=Q6,u.untypedObjectPrototype=Xe,u.updateErrorsList=X,u.updateValueReader=ha,u.urlDefaultValue=Oy,u.uuidPrototype=Ta,u.validateArgumentDeclarationName=dd,u.validateCalledByErrorIdInAction=X9,u.validateCalledByIdInAction=Z9,u.validateCallers=hv,u.validateConditionEntityDeclaration=e3,u.validateCustomEntityName=Ks,u.validateDataOperation=kn,u.validateDataOperationDataToValidateArgument=Ty,u.validateDataOperationDataToValidateArgumentParentRef=my,u.validateDataOperationDataToValidateArgumentRef=hy,u.validateDataOperationDataToValidateDataType=fy,u.validateDataOperationEntityToMatchTypeArgument=gy,u.validateDataOperationEntityToMatchTypeArgumentParentRef=by,u.validateDataOperationEntityToMatchTypeArgumentRef=Ey,u.validateDataOperationEntityToMatchTypeDataType=Ry,u.validateDataOperationError=Dy,u.validateDataOperationErrorParentRef=Py,u.validateDataOperationOutputEntityDeclaration=Iy,u.validateDataOperationOutputEntityDeclarationParentRef=vy,u.validateEntryCaller=yv,u.validateErrorCaller=pv,u.validateFunctionCallDeclaration=mv,u.validateFunctionDeclarationName=od,u.validateGeneratedEntityParentIsNotBuiltInEntity=W9,u.validateGeneration=q9,u.validateGenerationTarget=Ae,u.validateGenerationUpdate=J9,u.validateLoopEntityDeclaration=t3,u.validateName=e9,u.validateOperationEntityDeclaration=Tv,u.validatePropertyName=cd,u.validateReachability=En,u.validateReadsValueInActionPayload=Q9,u.validateReferenceObject=to,u.validateReferenceToOne=md,u.validateReferences=Ge,u.validateReturnDeclarationName=ud,u.validateSuccessCaller=uv,u.validateValueReaderGenerationUpdate=ua,u.validateValueWritter=vd,u.validateVariableDeclarationName=ld,u.validateVariableInternalCallUse=Id,u.valueAutogenerationCurrentDateAndTimeSchema=ob,u.valueAutogenerationGenericSchema=bs,u.valueAutogenerationOptions=tc,u.valueAutogenerationOptionsSchema=sb,u.valueAutogenerationRandomBooleanSchema=Xl,u.valueAutogenerationRandomDateBetweenSchema=mb,u.valueAutogenerationRandomDateFromSchema=hb,u.valueAutogenerationRandomDateSchema=Is,u.valueAutogenerationRandomDateUntilSchema=fb,u.valueAutogenerationRandomNumberBetweenSchema=db,u.valueAutogenerationRandomNumberFromSchema=lb,u.valueAutogenerationRandomNumberSchema=gs,u.valueAutogenerationRandomNumberUntilSchema=cb,u.valueAutogenerationRandomSchema=Hi,u.valueAutogenerationRandomTextBetweenSchema=yb,u.valueAutogenerationRandomTextFromSchema=ub,u.valueAutogenerationRandomTextSchema=vs,u.valueAutogenerationRandomTextUntilSchema=pb,u.valueAutogenerationRangeValueTypesSchema=Wi,u.valueAutogenerationUniqueSchema=Zl,u.waitOperation=ot,u.waitOperationMillisecondsNumberArgument=jn,u.waitOperationMillisecondsNumberArgumentRef=Fp,u.waitOperationMillisecondsNumberDataType=Up,u.waitOperationOperationError=kp,u.waitOperationOperationErrorParentRef=jp,u.waitOperationRef=xp,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyx-code/project-logic-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6004",
|
|
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",
|