@elyx-code/project-logic-tree 0.0.6023 → 0.0.6024
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 +719 -750
- package/dist/index.umd.cjs +78 -79
- package/dist/tree/state/loop/loop.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(u,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(u=typeof globalThis<"u"?globalThis:u||self,i(u["@elyx-code/project-logic-tree"]={}))})(this,function(u){"use strict";var Z3=Object.defineProperty;var X3=(u,i,N)=>i in u?Z3(u,i,{enumerable:!0,configurable:!0,writable:!0,value:N}):u[i]=N;var c=(u,i,N)=>(X3(u,typeof i!="symbol"?i+"":i,N),N);var i=(n=>(n.CustomEntity="custom-entity",n.BuiltInBaseEntity="built-in-base-entity",n.Project="project",n.InstalledProject="installed-project",n.GlobalEvent="global-event",n.DataType="data-type",n.FunctionCall="function-call",n.FunctionDeclaration="function-declaration",n.ActionDescriptor="action-descriptor",n.ValueDescriptor="value-descriptor",n.ArgumentDeclaration="argument-declaration",n.InputMap="input-map",n.ReturnStatement="return-statement",n.BreakStatement="break-statement",n.ContinueStatement="continue-statement",n.ReturnDeclaration="return-declaration",n.OutputMap="output-map",n.PrimitiveEntity="primitive-entity",n.PrimitiveValue="primitive-value",n.Property="property",n.Operation="operation",n.Condition="condition",n.VariableDeclaration="variable-declaration",n.VariableInstance="variable-instance",n.Search="search",n.Loop="loop",n.InternalCall="internal-call",n.GenericReference="generic-reference",n))(i||{}),N=(n=>(n.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",n.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",n.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",n.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",n.EXECUTION="BUILT_IN_EXECUTION_ENTITY",n.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",n))(N||{}),xe=(n=>(n.CurrentDateAndTime="current-date-and-time",n.Unique="unique",n.Random="random",n))(xe||{}),St=(n=>(n.DeletePersistedEntity="base-delete-persisted-entity",n.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",n.AbortExecution="base-abort-execution",n))(St||{}),F=(n=>(n.Fixed="fixed",n.None="none",n.Dynamic="dynamic",n))(F||{}),w=(n=>(n.FixedArguments="fixed-arguments",n.FixedReturns="fixed-returns",n.ReturnedError="returned-error",n.OngoingProcessExecution="ongoing-process-execution",n))(w||{}),D=(n=>(n.EntityTemplate="entity-template",n.ActionDescriptor="action-descriptor",n.String="string",n.Number="number",n.Boolean="boolean",n.Null="null",n.Enum="enum",n.JSON="json",n.Date="date",n.UUID="uuid",n.File="file",n))(D||{}),ot=(n=>(n.Addition="addition",n.Substraction="substraction",n.Multiplication="multiplication",n.Division="division",n.Remainder="remainder",n.Exponentiation="exponentiation",n))(ot||{}),Pe=(n=>(n.Join="string-join",n.Split="stringSsplit",n.DeleteLast="string-delete-last",n.DeleteFirst="string-delete-first",n.DeleteIndex="string-delete-index",n.AddIndex="string-add-index",n.ReplaceFirst="string-replace-first",n.ReplaceLast="string-replace-last",n.ReplaceIndex="string-replace-index",n.ReplaceSingleMatch="string-replace-single-match",n.ReplaceAllMatches="string-replace-all-matches",n.GetIndex="string-get-index",n.GetFirst="string-get-first",n.GetLast="string-get-last",n.Append="string-append",n.Prepend="string-prepend",n))(Pe||{}),k=(n=>(n.Join="list-join",n.Split="list-split",n.DeleteLast="list-delete-last",n.DeleteFirst="list-delete-first",n.DeleteIndex="list-delete-index",n.AddIndex="list-add-index",n.ReplaceFirst="list-replace-first",n.ReplaceLast="list-replace-last",n.ReplaceIndex="list-replace-index",n.ReplaceSingleMatch="list-replace-single-match",n.ReplaceAllMatches="list-replace-all-matches",n.GetIndex="list-get-index",n.GetFirst="list-get-first",n.GetLast="list-get-last",n.Append="list-append",n.Prepend="list-prepend",n))(k||{}),Ae=(n=>(n.Parallel="parallel",n.Sequential="sequential",n.Wait="wait",n))(Ae||{}),Qe=(n=>(n.CreateNewInstance="create-new-instance",n.Validate="validate",n))(Qe||{}),Ye=(n=>(n.HttpRequest="base-http-request",n))(Ye||{}),Be=(n=>(n.Equal="equal",n.NotEqual="not-equal",n.And="and",n.Or="or",n.LessThan="less-than",n.MoreThan="more-than",n.LessThanOrEqual="less-than-or-equal",n.MoreThanOrEqual="more-than-or-equal",n))(Be||{}),Nt=(n=>(n.Empty="empty",n.NotEmpty="not-empty",n))(Nt||{}),Q=(n=>(n.ManualFlow="manual-flow-loop",n.Counted="counted-loop",n.List="list-loop",n.ObjectKeys="object-keys-loop",n.ObjectValues="object-values-loop",n.String="string-loop",n))(Q||{}),qe=(n=>(n.OrDataTypeGroup="or-data-type-group",n.AndDataTypeGroup="and-data-type-group",n.DynamicArgumentTypes="dynamic-argument-types",n.DynamicReturnTypes="dynamic-return-types",n))(qe||{}),rn=(n=>(n.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",n))(rn||{}),Gd=(n=>(n.Error="error",n.Task="task",n.Return="return",n))(Gd||{});const Jn=[i.VariableDeclaration,i.VariableInstance,i.InputMap,i.ReturnDeclaration],nI=[i.VariableDeclaration,i.VariableInstance,i.InputMap,i.ReturnDeclaration],Me=[i.VariableDeclaration,i.VariableInstance,i.ArgumentDeclaration,i.OutputMap],rI=[i.VariableDeclaration,i.VariableInstance,i.ArgumentDeclaration,i.OutputMap],Fd=[...Jn,...Me],Fe=[i.VariableDeclaration,i.VariableInstance],wr=[i.GlobalEvent],Ne=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.InternalCall,i.Loop],bo=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.Loop],we=[i.FunctionDeclaration,...wr],gn=[...Ne,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],go=[...bo,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],an=[...Ne,...we],Ud=[...bo,...we],iI=[...gn,...we],aI=[...go,...we],lt=[...we,i.Loop],_e=[i.ReturnStatement,i.BreakStatement,i.ContinueStatement],sI=[i.CustomEntity,i.BuiltInBaseEntity,i.Project,i.InstalledProject,i.GlobalEvent,i.DataType,i.FunctionCall,i.FunctionDeclaration,i.ActionDescriptor,i.ValueDescriptor,i.ArgumentDeclaration,i.InputMap,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.ReturnDeclaration,i.OutputMap,i.PrimitiveEntity,i.PrimitiveValue,i.Property,i.Operation,i.Condition,i.VariableDeclaration,i.VariableInstance,i.Search,i.Loop,i.InternalCall],vo=[i.CustomEntity,i.GlobalEvent,i.FunctionDeclaration,i.FunctionCall,i.VariableDeclaration,i.VariableInstance,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.InstalledProject,i.Loop,i.Search],xd=[i.CustomEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor],_r=[i.BuiltInBaseEntity,i.PrimitiveEntity],oI=[i.CustomEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.GlobalEvent,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor,i.InputMap,i.OutputMap,i.FunctionCall,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.VariableInstance,i.PrimitiveValue,i.InternalCall],U={type:i.PrimitiveEntity,id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",description:"A string of characters.",version:1,name:D.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},vn={type:i.PrimitiveEntity,id:"f596545d-1565-4faa-9969-d95fa5edfea4",description:"A 'true' or 'false' value.",version:1,name:D.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Se={type:i.PrimitiveEntity,id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",description:"A number value.",version:1,name:D.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ke={type:i.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:D.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},jd={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:i.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:i.DataType},kd={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:i.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:i.Property},qd={id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:{id:"enum-options-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.JSON,autogeneration:null,value:[],valueAsType:null,parent:jd},parent:kd},Jd={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:i.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:i.PrimitiveEntity},Wd={hidden:!1,required:!0,id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",name:"Options",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:qd,description:"Options for the enum. Each option is a text value.",parent:Jd},In={type:i.PrimitiveEntity,id:"9542b8b4-2642-4eee-9db9-def7963a17a0",description:"A set of text options to choose from.",version:1,name:D.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[Wd],methods:[]},sn={type:i.PrimitiveEntity,id:"dc58f38b-d574-4956-aac6-32ce9529b937",description:"A date and time value.",version:1,name:D.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},va={type:i.PrimitiveEntity,id:"4a6234aa-c0f6-4731-b4dd-750388029226",description:"A unique identifier in the form of a 36-character string.",version:1,name:D.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[U],properties:[],methods:[]},Io={type:i.PrimitiveEntity,id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",description:"A complex data structure with any combination of properties with names and values.",version:1,name:D.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var Hd=(n=>(n.FirstInputNumber="number-addition-first-number-argument-declaration",n.SecondInputNumber="number-addition-second-number-argument-declaration",n))(Hd||{}),Yd=(n=>(n.ResultNumber="number-addition-result-number-return-delaration",n.Error="number-addition-error-return-delaration",n))(Yd||{});const zd={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:i.ValueDescriptor},Zd={id:"number-addition-first-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zd},Xd={type:i.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:i.ValueDescriptor},Qd={id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Xd},Kd={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:i.ValueDescriptor},eu={id:"b761acec-0755-4582-a68b-76267038bbe1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Kd},tu={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:ot.Addition,entityType:i.ActionDescriptor},Po={id:"number-addition-first-number-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:Zd,required:!0,parentRelationType:w.FixedArguments,index:0,parent:tu},nu={type:i.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:ot.Addition,entityType:i.ActionDescriptor},Do={id:"number-addition-second-number-argument-declaration",type:i.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:Qd,required:!0,parentRelationType:w.FixedArguments,index:1,parent:nu},ru={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:ot.Addition,entityType:i.ActionDescriptor},Ao={parentRelationType:w.FixedReturns,id:"number-addition-result-number-return-delaration",type:i.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:eu,required:!0,index:0,parent:ru},iu={type:i.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:ot.Addition,entityType:i.ActionDescriptor},au={parentRelationType:w.FixedReturns,id:"number-addition-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:iu},Ia={id:ot.Addition,type:i.ActionDescriptor,description:"Add two numbers together",version:1,name:ot.Addition,fixedArguments:[Po,Do],error:au,fixedReturns:[Ao],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},su={[ot.Addition]:Ia};var ou=(n=>(n.FirstInputString="join-string-first-string-argument-declaration",n.SecondInputString="join-string-second-string-argument-declaration",n))(ou||{}),lu=(n=>(n.ResultString="join-string-result-string-return-delaration",n.Error="join-string-error-return-delaration",n))(lu||{});const cu={type:i.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:i.ValueDescriptor},du={id:"join-string-first-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cu},uu={type:i.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:i.ValueDescriptor},pu={id:"join-string-second-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uu},yu={type:i.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:i.ValueDescriptor},hu={id:"join-string-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:yu},fu={type:i.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:Pe.Join,entityType:i.ActionDescriptor},Pa={id:"join-string-first-string-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",dataType:du,parentRelationType:w.FixedArguments,required:!0,index:0,parent:fu},mu={type:i.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:Pe.Join,entityType:i.ActionDescriptor},Da={id:"join-string-second-string-argument-declaration",type:i.ValueDescriptor,version:1,name:"Second value",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",dataType:pu,parentRelationType:w.FixedArguments,required:!0,index:1,parent:mu},Tu={type:i.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:Pe.Join,entityType:i.ActionDescriptor},fi={parentRelationType:w.FixedReturns,id:"join-string-result-string-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:hu,required:!0,index:0,parent:Tu},Eu={type:i.GenericReference,id:"join-string-operation-error-parent-ref",entityId:Pe.Join,entityType:i.ActionDescriptor},Ru={parentRelationType:w.FixedReturns,id:"join-string-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Eu},mi={id:Pe.Join,type:i.ActionDescriptor,version:1,name:Pe.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Pa,Da],fixedReturns:[fi],error:Ru,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},bu={[Pe.Join]:mi};var gu=(n=>(n.FirstInputList="join-list-first-list-argument-declaration",n.SecondInputList="join-list-second-list-argument-declaration",n))(gu||{}),vu=(n=>(n.ResultList="join-list-result-list-return-delaration",n.Error="join-list-error-return-delaration",n))(vu||{});const Iu={type:i.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:i.ValueDescriptor},Pu={id:"join-list-first-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Iu},Du={type:i.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:i.ValueDescriptor},Au={id:"join-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Du},Su={type:i.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:i.ValueDescriptor},Ou={id:"join-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Su},Cu={type:i.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},Bu={id:"join-list-first-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first list to join to the second one. Its values will be at the beginning of the resulting list.",dataType:Pu,parentRelationType:w.FixedArguments,required:!0,index:0,parent:Cu},wu={type:i.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},_u={id:"join-list-second-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"Second value",description:"The second list to join to the first one. Its values will be at the end of the resulting list.",dataType:Au,parentRelationType:w.FixedArguments,required:!0,index:1,parent:wu},Mu={type:i.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},Nu={parentRelationType:w.FixedReturns,id:"join-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:Ou,required:!0,index:0,parent:Mu},Vu={type:i.GenericReference,id:"join-list-operation-error-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},$u={parentRelationType:w.FixedReturns,id:"join-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Vu},So={id:k.Join,type:i.ActionDescriptor,version:1,name:k.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[Bu,_u],error:$u,fixedReturns:[Nu],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Lu=(n=>(n.InputList="list-to-split-argument-declaration",n.SplitIndex="split-list-index-argument-declaration",n))(Lu||{}),Gu=(n=>(n.FirstOutputList="split-list-first-output-list-return-delaration",n.SecondOutputList="split-list-second-output-list-return-delaration",n.Error="split-list-error-return-delaration",n))(Gu||{});const Fu={type:i.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:i.ValueDescriptor},Uu={id:"split-list-operation-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Fu},xu={type:i.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:i.ValueDescriptor},ju={id:"split-list-operation-split-index-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xu},Oo={type:i.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:i.ValueDescriptor},ku={id:"split-list-operation-first-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Oo},qu={type:i.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},Ju={id:"list-to-split-argument-declaration",type:i.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:Uu,parentRelationType:w.FixedArguments,required:!0,index:0,parent:qu},Wu={type:i.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},Hu={id:"split-list-index-argument-declaration",type:i.ValueDescriptor,version:1,name:"Split location",description:"The index at which to split the list. The value at this index will be the first value of the second list.",dataType:ju,parentRelationType:w.FixedArguments,required:!0,index:1,parent:Wu},Yu={type:i.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},zu={parentRelationType:w.FixedReturns,id:"split-list-first-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:ku,required:!0,index:0,parent:Yu},Zu={id:"split-list-operation-second-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Oo},Xu={type:i.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},Qu={parentRelationType:w.FixedReturns,id:"split-list-second-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:Zu,required:!0,index:0,parent:Xu},Ku={type:i.GenericReference,id:"split-list-operation-error-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},ep={parentRelationType:w.FixedReturns,id:"split-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Ku},Co={id:k.Split,type:i.ActionDescriptor,version:1,name:k.Split,description:"Splits a given list at the given index, and returns two lists, one with the values up to the index, and the other with the values after the index",fixedArguments:[Ju,Hu],fixedReturns:[zu,Qu],error:ep,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var tp=(n=>(n.InputList="get-last-in-list-input-list-argument-declaration",n))(tp||{}),np=(n=>(n.OutputElement="get-last-in-list-output-element-return-delaration",n.Error="get-last-in-list-error-return-delaration",n))(np||{});const rp={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:i.ValueDescriptor},ip={id:"get-last-in-list-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:rp},ap={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:i.ValueDescriptor},sp={id:"get-last-in-list-output-element-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ap},op={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:k.GetLast,entityType:i.ActionDescriptor},lp={id:"get-last-in-list-input-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:ip,parentRelationType:w.FixedArguments,required:!0,index:0,parent:op},cp={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:k.GetLast,entityType:i.ActionDescriptor},dp={parentRelationType:w.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:i.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:sp,required:!0,index:0,parent:cp},up={type:i.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:k.GetLast,entityType:i.ActionDescriptor},pp={parentRelationType:w.FixedReturns,id:"get-last-in-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:up},Bo={id:k.GetLast,type:i.ActionDescriptor,version:1,name:k.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[lp],fixedReturns:[dp],error:pp,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var yp=(n=>(n.List="append-to-list-lsit-argument-declaration",n.ElementToAppend="append-to-list-element-to-append-argument-declaration",n))(yp||{}),hp=(n=>(n.ResultList="append-to-list-result-list-return-delaration",n.Error="append-to-list-error-return-delaration",n))(hp||{});const fp={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:i.ValueDescriptor},mp={id:"append-to-list-lsit-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:fp},Tp={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:i.ValueDescriptor},Ep={id:"append-to-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Tp},Rp={type:i.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:i.ValueDescriptor},bp={id:"append-to-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Rp},gp={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},wo={id:"append-to-list-lsit-argument-declaration",type:i.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:mp,parentRelationType:w.FixedArguments,required:!0,index:0,parent:gp},vp={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},_o={id:"append-to-list-element-to-append-argument-declaration",type:i.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:Ep,parentRelationType:w.FixedArguments,required:!0,index:1,parent:vp},Ip={type:i.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},Pp={parentRelationType:w.FixedReturns,id:"append-to-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:bp,required:!0,index:0,parent:Ip},Dp={type:i.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},Ap={parentRelationType:w.FixedReturns,id:"append-to-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Dp},Aa={id:k.Append,type:i.ActionDescriptor,version:1,name:k.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[wo,_o],error:Ap,fixedReturns:[Pp],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Sp={[k.Join]:So,[k.Split]:Co,[k.GetLast]:Bo,[k.Append]:Aa};var Op=(n=>(n.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",n))(Op||{}),Cp=(n=>(n.ListOfExecutionResults="parallel-execution-result-return-delaration",n.Error="parallel-execution-error-return-delaration",n))(Cp||{});const Bp={id:"parallel-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:F.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:F.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},wp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:i.ValueDescriptor},_p={id:"parallel-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Bp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:wp},Mp={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:i.ValueDescriptor},Np={id:"b761acec-0755-4582-a68b-76267038bbe1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Mp},Vp={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ae.Parallel,entityType:i.ActionDescriptor},Mo={id:"parallel-execution-list-of-functions-argument-declaration",type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:_p,required:!0,index:0,parent:Vp,parentRelationType:w.FixedArguments},$p={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ae.Parallel,entityType:i.ActionDescriptor},No={id:"parallel-execution-result-return-delaration",type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:Np,required:!0,index:0,parent:$p,parentRelationType:w.FixedReturns},Lp={type:i.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ae.Parallel,entityType:i.ActionDescriptor},Gp={id:"parallel-execution-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Lp,parentRelationType:w.ReturnedError},xt={id:Ae.Parallel,type:i.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ae.Parallel,fixedArguments:[Mo],fixedReturns:[No],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:Gp,parent:null};var Fp=(n=>(n.MillisecondsNumber="wait-milliseconds-number-argument-declaration",n))(Fp||{}),Up=(n=>(n.Error="wait-operation-error-return-delaration",n))(Up||{});const xp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:i.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},jp={id:"wait-milliseconds-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xp},kp={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:i.ActionDescriptor,entityId:Ae.Wait},Wn={id:"wait-milliseconds-number-argument-declaration",type:i.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:jp,required:!0,index:0,parent:kp,parentRelationType:w.FixedArguments},qp={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ae.Wait,entityType:i.ActionDescriptor},Jp={id:"wait-operation-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:qp,parentRelationType:w.ReturnedError},ct={id:Ae.Wait,type:i.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ae.Wait,fixedArguments:[Wn],fixedReturns:[],error:Jp,argumentsType:F.Fixed,returnsType:F.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Wp=(n=>(n.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",n))(Wp||{}),Hp=(n=>(n.ListOfExecutionResults="sequential-execution-result-return-delaration",n.Error="sequential-execution-error-return-delaration",n))(Hp||{});const Yp={id:"sequential-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:F.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:F.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},zp={type:i.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:i.ValueDescriptor},Zp={id:"sequential-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:zp},Xp={type:i.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:i.ValueDescriptor},Qp={id:"sequential-execution-list-of-execution-results-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Xp},Kp={type:i.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ae.Sequential,entityType:i.ActionDescriptor},Vo={id:"sequential-execution-list-of-functions-argument-declaration",type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Zp,required:!0,index:0,parent:Kp,parentRelationType:w.FixedArguments},ey={type:i.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ae.Sequential,entityType:i.ActionDescriptor},$o={id:"sequential-execution-result-return-delaration",type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:Qp,required:!0,index:0,parent:ey,parentRelationType:w.FixedReturns},ty={type:i.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ae.Sequential,entityType:i.ActionDescriptor},ny={id:"sequential-execution-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ty,parentRelationType:w.ReturnedError},on={id:Ae.Sequential,type:i.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ae.Sequential,fixedArguments:[Vo],fixedReturns:[$o],error:ny,returnsType:F.Fixed,argumentsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},ry={[Ae.Parallel]:xt,[Ae.Wait]:ct,[Ae.Sequential]:on};var iy=(n=>(n.EntityToInstanciate="entity-to-instanciate-argument-declaration",n))(iy||{}),ay=(n=>(n.Error="create-new-instance-error-return-delaration",n))(ay||{});const sy={type:i.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},oy={id:"entity-to-instanciate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:sy},ly={type:i.GenericReference,id:"create-new-instance-operation-ref",entityType:i.ActionDescriptor,entityId:Qe.CreateNewInstance},cy={id:"entity-to-instanciate-argument-declaration",type:i.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:oy,required:!0,parentRelationType:w.FixedArguments,index:0,parent:ly},dy={type:i.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Qe.CreateNewInstance,entityType:i.ActionDescriptor},uy={parentRelationType:w.FixedReturns,id:"create-new-instance-output-entity-declaration",type:i.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:dy,required:!0,index:0},py={type:i.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Qe.CreateNewInstance,entityType:i.ActionDescriptor},yy={parentRelationType:w.FixedReturns,id:"create-new-instance-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:py},Mr={id:Qe.CreateNewInstance,type:i.ActionDescriptor,description:"Creates a new copy of a given entity, with the given values for each property, or default values if a value is not provided",version:1,name:Qe.CreateNewInstance,fixedArguments:[cy],fixedReturns:[uy],error:yy,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var hy=(n=>(n.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",n.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",n))(hy||{}),fy=(n=>(n.Error="validate-data-error-return-delaration",n.OutputEntity="validate-data-output-entity-declaration",n))(fy||{});const my={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},Ty={id:"validate-data-operation-data-to-validate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:my},Ey={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Qe.Validate},Ry={id:"validate-data-operation-data-to-validate-argument-declaration",type:i.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:Ty,required:!0,parentRelationType:w.FixedArguments,index:0,parent:Ey},by={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},gy={id:"validate-data-operation-entity-to-match-type-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:by},vy={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Qe.Validate},Iy={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:i.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:gy,required:!0,index:0,parentRelationType:w.FixedArguments,parent:vy},Py={type:i.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Qe.Validate,entityType:i.ActionDescriptor},Dy={id:"validate-data-output-entity-declaration",type:i.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:Py,required:!0,index:0,parentRelationType:w.FixedReturns},Ay={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Qe.Validate,entityType:i.ActionDescriptor},Sy={id:"validate-data-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Ay,parentRelationType:w.ReturnedError},Hn={id:Qe.Validate,type:i.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Qe.Validate,fixedArguments:[Iy,Ry],fixedReturns:[Dy],error:Sy,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Oy={[Qe.CreateNewInstance]:Mr,[Qe.Validate]:Hn};var Lo=(n=>(n.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",n))(Lo||{});const J={[i.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[i.BuiltInBaseEntity]:{[N.KEY_VALUE_PARAM]:{id:N.KEY_VALUE_PARAM},[N.HTTP_ENDPOINT]:{id:N.HTTP_ENDPOINT,properties:{method:"http-endpoint-built-in-method-property-id",path:"http-endpoint-built-in-path-property-id",cors:"http-endpoint-built-in-cors-property-id"}},[N.PERSISTED_ENTITY]:{id:N.PERSISTED_ENTITY,properties:{database:"persisted-built-in-base-entity-database-property-id",identifier:"persisted-built-in-base-entity-identifier-property-id"}},[N.RELATIONAL_DATABASE]:{id:N.RELATIONAL_DATABASE,properties:{identifier:"relational-database-built-in-base-entity-identifier-property-id",username:"relational-database-built-in-base-entity-username-property-id",password:"relational-database-built-in-base-entity-password-property-id",minSize:"relational-database-built-in-base-entity-min-size-property-id",default:"relational-database-built-in-base-entity-default-property-id",autoscaling:"relational-database-built-in-base-entity-autoscaling-property-id"}},[N.CRON_JOB]:{id:N.CRON_JOB,properties:{expression:"cron-job-built-in-base-entity-expression-property-id"}}},[i.Operation]:{[Pe.Join]:{id:Pe.Join,inputs:{first:"join-string-first-string-input-id",second:"join-string-second-string-input-id"},outputs:{result:"join-string-result-string-return-delaration-id",error:"join-string-error-return-delaration-id"}},[Ye.HttpRequest]:{id:Ye.HttpRequest,inputs:{url:"http-request-url-input-id",query:"http-request-query-input-id",method:"http-request-method-input-id",headers:"http-request-headers-input-id",body:"http-request-body-string-input-id"},outputs:{code:"http-response-code-return-delaration-id",body:"http-response-body-return-delaration-id",headers:"http-response-headers-return-delaration-id",error:"http-request-error-return-delaration-id"}}},[i.Loop]:{[Q.List]:{id:Q.List,inputs:{list:"iterate-over-list-loop-list-input-id"},outputs:{results:"iterate-over-list-loop-output-id"}},[Q.String]:{id:Q.String,inputs:{string:"iterate-over-string-loop-string-input-id"},outputs:{results:"iterate-over-string-loop-output-id"}},[Q.ObjectKeys]:{id:Q.ObjectKeys,inputs:{object:"iterate-over-object-keys-loop-object-input-id"},outputs:{results:"iterate-over-object-keys-loop-output-id"}},[Q.ObjectValues]:{id:Q.ObjectValues,inputs:{object:"iterate-over-object-values-loop-object-input-id"},outputs:{results:"iterate-over-object-values-loop-output-id"}},[Q.ManualFlow]:{id:Q.ManualFlow,inputs:{},outputs:{results:"manual-flow-loop-output-id"}},[Q.Counted]:{id:Q.Counted,inputs:{number:"iterate-over-counted-loop-number-input-id"},outputs:{results:"iterate-over-counted-loop-output-id"}}},[i.Condition]:{[Be.MoreThanOrEqual]:{id:Be.MoreThanOrEqual,inputs:{leftHand:"condition-more-than-or-equal-left-hand-input-id",rightHand:"condition-more-than-or-equal-right-hand-input-id"}},[Nt.NotEmpty]:{id:Nt.NotEmpty,inputs:{leftHand:"condition-not-empty-input-id"}}},[i.GlobalEvent]:{[rn.PROJECT_PUBLICATION_COMPLETED]:{id:rn.PROJECT_PUBLICATION_COMPLETED}}},Je=J[i.Operation]["base-http-request"],Cy={type:i.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:i.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},By={id:"http-request-url-default-value-id",type:i.PrimitiveValue,version:1,value:"https://some-url.com",name:D.String,valueAsType:null,parent:Cy,autogeneration:null},wy={type:i.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Je.inputs.url,entityType:i.ValueDescriptor},_y={id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:By,constant:!1,parent:wy},My={type:i.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Je.inputs.query,entityType:i.ValueDescriptor},Ny={id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:My},Vy={type:i.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:i.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},$y={id:"http-request-method-default-value-id",type:i.PrimitiveValue,version:1,value:"GET",name:D.Enum,valueAsType:null,parent:Vy,autogeneration:null},Ly={type:i.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Je.inputs.method,entityType:i.ValueDescriptor},Gy={id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,asType:!1,isNullable:!1,defaultValue:$y,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:Ly},Fy={type:i.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Je.inputs.headers,entityType:i.ValueDescriptor},Uy={id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Fy},xy={type:i.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Je.inputs.body,entityType:i.ValueDescriptor},jy={id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xy},ky={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:Je.outputs.code},qy={id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ky},Jy={type:i.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:i.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},Wy={type:i.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:i.ValueDescriptor,entityId:Je.outputs.headers},Hy={id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:i.PrimitiveValue,version:1,value:{},name:D.JSON,parent:Jy,valueAsType:null,autogeneration:null},constant:!1,parent:Wy},Yy={type:i.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:i.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},zy={type:i.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:i.ValueDescriptor,entityId:Je.outputs.body},Zy={id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:i.PrimitiveValue,version:1,value:{},name:D.JSON,parent:Yy,valueAsType:null,autogeneration:null},constant:!1,parent:zy},Xy={type:i.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Sa={id:Je.inputs.method,type:i.ValueDescriptor,description:"A single word that represents the type of request you want to make. For example: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, CUSTOM",version:1,name:"Method",dataType:Gy,required:!1,index:0,parentRelationType:w.FixedArguments,parent:Xy},Qy={type:i.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Oa={id:Je.inputs.url,type:i.ValueDescriptor,description:"The base domain, or address where the request is being sent to. For example: https://some-url.com",version:1,name:"URL",dataType:_y,required:!1,index:1,parentRelationType:w.FixedArguments,parent:Qy},Ky={type:i.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Go={id:Je.inputs.query,type:i.ValueDescriptor,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",version:1,name:"Query Params",dataType:Ny,required:!1,index:2,parentRelationType:w.FixedArguments,parent:Ky},eh={type:i.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Ca={id:Je.inputs.headers,type:i.ValueDescriptor,description:"A set of any properties, with names and values that represent metadata about the request, such as the server, date, content type, and more, that you want to send alongside your request data.",version:1,name:"Headers",dataType:Uy,required:!1,index:3,parent:eh,parentRelationType:w.FixedArguments},th={type:i.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Ba={id:Je.inputs.body,type:i.ValueDescriptor,description:"The main data payload of the request. This is the data that you want to send to the server. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:jy,required:!1,index:4,parentRelationType:w.FixedArguments,parent:th},nh={type:i.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Fo={id:Je.outputs.code,type:i.ValueDescriptor,description:'A standardized status code of the response. It is a 3-digit number that represents the response status. For example, 200 means "OK", 404 means "Not Found", and 500 means "Internal Server Error".',version:1,name:"Code",dataType:qy,required:!0,index:0,parentRelationType:w.FixedReturns,parent:nh},rh={type:i.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},wa={parentRelationType:w.FixedReturns,id:Je.outputs.headers,type:i.ValueDescriptor,description:"A set of any properties, with names and value that the server sent back to you. It represents metadata about the response, such as the server, date, content type, and more.",version:1,name:"Headers",dataType:Hy,required:!0,index:1,parent:rh},ih={type:i.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Ti={parentRelationType:w.FixedReturns,id:Je.outputs.body,type:i.ValueDescriptor,description:"The main data payload of the response. This is the data that the server sent back to you. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:Zy,required:!0,index:2,parent:ih},ah={type:i.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},sh={type:i.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:i.ValueDescriptor,entityId:Je.outputs.error},oh={id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:sh},Uo={parentRelationType:w.ReturnedError,id:Je.outputs.error,type:i.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:oh,required:!0,index:0,parent:ah},Ei={type:i.ActionDescriptor,id:Ye.HttpRequest,name:Ye.HttpRequest,description:"Make an HTTP request, out to the internet, to a given URL with the specified method, query parameters, headers, and body.",version:1,fixedArguments:[Sa,Oa,Go,Ca,Ba],fixedReturns:[Fo,wa,Ti],argumentsType:F.Fixed,returnsType:F.Fixed,error:Uo,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},lh={[Ye.HttpRequest]:Ei},lI={...bu,...su,...Sp,...ry,...Oy,...lh},ch=J[i.Loop]["list-loop"],dh={id:"iterate-over-list-loop-return-declaration-parent-ref-id",type:i.GenericReference,entityId:Q.List,entityType:i.ActionDescriptor},uh={id:ch.outputs.results,type:i.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:null,required:!0,index:0,parent:dh,parentRelationType:w.FixedReturns},ph={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:i.ArgumentDeclaration},yh={id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:ph},hh={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Q.List,entityType:i.ActionDescriptor},fh={id:ch.inputs.list,type:i.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:yh,index:0,parent:hh,parentRelationType:w.FixedArguments},Yn={id:Q.List,type:i.ActionDescriptor,version:1,name:Q.List,description:"Iterates over a list of entities",fixedArguments:[fh],fixedReturns:[uh],error:null,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},cI=J[i.Loop]["list-loop"],mh={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"manual-flow-loop-previous-iterations-results-declaration-id",entityType:i.ReturnDeclaration},Th={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:mh},Eh={id:"manual-flow-loop-previous-iterations-results-declaration-parent-ref-id",type:i.GenericReference,entityId:Q.ManualFlow,entityType:i.ActionDescriptor},Rh={id:cI.outputs.results,type:i.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:Th,required:!0,index:1,parentRelationType:w.FixedReturns,parent:Eh},xo={id:Q.ManualFlow,type:i.ActionDescriptor,version:1,name:Q.ManualFlow,description:"A loop that is manually controlled by the continue and break statements. It runs until the break statement is called, and it can skip to the next iteration with the continue statement.",fixedArguments:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[Rh],argumentsType:F.None,returnsType:F.Fixed,error:null,parent:null},_a=J[i.BuiltInBaseEntity][N.KEY_VALUE_PARAM],dI={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:i.DataType},bh={id:"key-value-param-built-in-base-entity-name-property-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:i.Property},uI={id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:null,parent:bh},gh={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:i.GenericReference,entityId:_a.id,entityType:i.BuiltInBaseEntity},vh={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:uI,description:"The name of the path parameter",parent:gh},pI={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:i.DataType},Ih={id:"key-value-param-built-in-base-entity-value-property-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:i.Property},yI={id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:null,parent:Ih},Ph={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:i.GenericReference,entityId:_a.id,entityType:i.BuiltInBaseEntity},Dh={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:yI,description:"The value of the path parameter",parent:Ph},Ma={id:_a.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:_a.id,type:i.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[vh,Dh],abstractMethods:[],methods:[],extends:[]},Ri=J[i.BuiltInBaseEntity][N.HTTP_ENDPOINT].properties,Ah={id:"endpointBuiltInCorsPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},Sh={id:"endpointBuiltInCorsPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Ri.cors},Oh={id:"endpointBuiltInCorsPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:["*"],parent:Ah,autogeneration:null,valueAsType:null},parent:Sh},Ch={id:"endpointBuiltInBaseEntityRef",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},Bh={hidden:!0,required:!0,id:Ri.cors,name:"Allowed origins",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:Oh,description:"The origins that are allowed to access this endpoint, use * for all origins, or http://example.com/* to be as specific as you need.",parent:Ch},wh={id:"endpointBuiltInPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointBuiltInPathPropertyDataType"},_h={id:"endpointBuiltInPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Ri.path},Mh={id:"endpointBuiltInPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.String,value:"/",parent:wh,autogeneration:null,valueAsType:null},parent:_h},Nh={id:"endpointBuiltInBaseEntityRefTwo",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},jo={hidden:!1,required:!0,id:Ri.path,name:"Path",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:Mh,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:Nh},Vh={id:"endpointBuiltInMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},$h={id:"endpointBuiltInMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"endpointBuiltInMethodProperty"},Lh={id:"endpointBuiltInMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:In,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,value:"GET",name:D.Enum,parent:Vh,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:$h},Gh={id:"endpointBuiltInBaseEntityRefThree",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},ko={hidden:!1,required:!0,id:Ri.method,name:"Method",version:1,type:i.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:Lh,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:Gh},Fh={id:"endpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointRequestHeadersVariableDataType"},Uh={id:"endpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},xh={id:"endpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:Fh,autogeneration:null,valueAsType:null},parent:Uh},jh={id:"endpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},kh={id:"endpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:jh},qh={id:"endpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},Jh={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},Wh={id:"endpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:Ma,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:[],parent:qh,autogeneration:null,valueAsType:null},parent:Jh},Hh={id:"endpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointPathParamsVariableDataType"},Yh={id:"endpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},zh={id:"endpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ma,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:[],parent:Hh,autogeneration:null,valueAsType:null},parent:Yh},Zh={id:"endpointReachedTriggerActionDescriptorRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Xh={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ValueDescriptor,name:"Request headers",dataType:xh,required:!0,index:0,parentRelationType:w.FixedArguments,parent:Zh},Qh={id:"endpointReachedTriggerActionDescriptorRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Kh={id:"endpointPathParamsArgumentDeclaration",type:i.ValueDescriptor,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",dataType:zh,required:!0,index:1,parentRelationType:w.FixedArguments,parent:Qh},ef={id:"endpointReachedTriggerActionDescriptorRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},tf={id:"endpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ValueDescriptor,name:"Request query params",dataType:Wh,required:!0,index:2,parentRelationType:w.FixedArguments,parent:ef},nf={id:"endpointReachedTriggerActionDescriptorRefFour",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},rf={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ValueDescriptor,name:"Request body",dataType:kh,index:3,required:!0,parentRelationType:w.FixedArguments,parent:nf},af={id:"endpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},sf={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:af},of={id:"endpointReturnStatementRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},lf={id:"endpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ValueDescriptor,name:"Response code",dataType:sf,required:!0,index:0,parentRelationType:w.FixedReturns,parent:of},cf={id:"endpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointResponseHeadersDataType"},df={id:"endpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},uf={id:"endpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:cf,autogeneration:null,valueAsType:null},parent:df},pf={id:"endpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},yf={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ValueDescriptor,name:"Response headers",dataType:uf,required:!1,index:1,parentRelationType:w.FixedReturns,parent:pf},hf={id:"endpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},ff={id:"endpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:hf},mf={id:"endpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},Tf={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ValueDescriptor,name:"Response body",dataType:ff,required:!1,index:2,parentRelationType:w.FixedReturns,parent:mf},Ef={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},qo={id:"endpointReachedTriggerActionDescriptor",type:i.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:F.Fixed,dynamicArgumentTypes:null,fixedArguments:[Xh,Kh,tf,rf],returnsType:F.Fixed,fixedReturns:[lf,yf,Tf],error:null,dynamicReturnTypes:null,parent:Ef},Na={id:N.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:N.HTTP_ENDPOINT,type:i.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[Bh,jo,ko],abstractMethods:[qo],extends:[],methods:[]},Vt=J[i.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,Rf={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:i.DataType},bf={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:i.GenericReference,entityId:Vt.properties.identifier,entityType:i.Property},hI={id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:null,parent:Rf,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:bf},Nr={id:"relational-database-built-in-base-entity-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Va={hidden:!1,required:!0,id:Vt.properties.identifier,name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:hI,description:"The name of the main database inside of the server instance where the data will be stored.",parent:Nr},fI={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:i.DataType},gf={id:"relational-database-built-in-base-entity-username-property-ref-id",type:i.GenericReference,entityId:Vt.properties.username,entityType:i.Property},mI={id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:i.DataType},autogeneration:null,valueAsType:null},parent:gf},$a={hidden:!1,required:!0,id:Vt.properties.username,name:"Username",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:mI,description:"The username that will be used to connect to the database.",parent:Nr},TI={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:i.DataType},vf={id:"relational-database-built-in-base-entity-password-property-ref-id",type:i.GenericReference,entityId:Vt.properties.password,entityType:i.Property},EI={id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:vf},La={hidden:!1,required:!0,id:Vt.properties.password,name:"Password",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:EI,description:"The password that will be used to connect to the database.",parent:Nr},If={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:i.DataType},Pf={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:i.GenericReference,entityId:Vt.properties.minSize,entityType:i.Property},RI={id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:6,parent:If,autogeneration:null,valueAsType:null},parent:Pf},Ga={hidden:!0,required:!0,id:Vt.properties.minSize,name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:RI,description:"The minimum size of the database in GB.",parent:Nr},Df={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:i.DataType},Af={id:"relational-database-built-in-base-entity-default-property-ref-id",type:i.GenericReference,entityId:Vt.properties.default,entityType:i.Property},bI={id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:vn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!1,parent:Df,autogeneration:null,valueAsType:null},parent:Af},Jo={hidden:!0,required:!0,id:Vt.properties.default,name:"Default",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:bI,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:Nr},Sf={id:"relational-database-built-in-base-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:Vt.properties.autoscaling,entityType:i.Property},Of={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",entityType:i.DataType},gI={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:vn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-autoscaling-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!1,parent:Of,autogeneration:null,valueAsType:null},parent:Sf},Cf={id:"relational-database-built-in-base-entity-autoscaling-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Wo={hidden:!0,required:!0,id:Vt.properties.autoscaling,name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:gI,description:"If true, this database will automatically scale up or down in memory size, based on the usage.",parent:Cf},Pn={id:N.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:N.RELATIONAL_DATABASE,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Va,$a,La,Ga,Jo,Wo],abstractMethods:[],methods:[],extends:[]},Bf={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:St.DeletePersistedEntity},Ho={type:i.FunctionDeclaration,id:St.DeletePersistedEntity,name:St.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:Bf,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},wf={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:St.SoftDeletePersistedEntity},_f={type:i.FunctionDeclaration,id:St.SoftDeletePersistedEntity,name:St.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:wf,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},Mf=J[i.BuiltInBaseEntity][N.PERSISTED_ENTITY].properties,vI={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:i.DataType},Nf={id:"persisted-built-in-base-entity-database-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:i.Property},II={id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Pn,asType:!1,defaultValue:null,parent:Nf},Vf={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},bi={hidden:!0,required:!0,id:Mf.database,name:"Database",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:II,description:"The database that the entity belongs to.",parent:Vf},$f={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:i.DataType},Lf={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:i.Property},PI={id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:va,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.UUID,value:null,parent:$f,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Lf},Gf={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Ff={hidden:!1,required:!0,id:Mf.identifier,name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:PI,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:Gf},DI={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:i.DataType},Uf={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:i.Property},xf={id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:sn,asType:!1,defaultValue:null,parent:Uf},jf={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},kf={hidden:!1,required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:xf,description:"The date and time when the entity was deleted.",parent:jf},AI={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:i.DataType},qf={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:i.Property},Jf={id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:sn,asType:!1,defaultValue:null,parent:qf},Wf={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Hf={hidden:!1,required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Jf,description:"The date and time when the entity was created.",parent:Wf},SI={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:i.DataType},Yf={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:i.Property},zf={id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:sn,asType:!1,defaultValue:null,parent:Yf},Zf={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Xf={hidden:!1,required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:i.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:zf,description:"The date and time when the entity was last updated.",parent:Zf},Ve={id:N.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:N.PERSISTED_ENTITY,type:i.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[bi,Ff,kf,Hf,Xf],methods:[Ho,_f],extends:[]},Qf={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},Yo={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:i.ActionDescriptor,argumentsType:F.None,returnsType:F.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:Qf},Kf=J[i.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,OI={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:i.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:i.DataType},em={id:"cron-job-built-in-base-entity-expression-property-ref",type:i.GenericReference,entityId:Kf.properties.expression,entityType:i.Property},CI={id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:em},tm={id:"cron-job-built-in-base-entity-ref",type:i.GenericReference,entityId:N.CRON_JOB,entityType:i.BuiltInBaseEntity},nm={hidden:!1,required:!0,id:Kf.properties.expression,name:"Cron expression",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:CI,description:"The cron-job expression that defines when the cron-job job should be triggered. The expression should be in the format of a cron-job expression.",parent:tm},zo={id:N.CRON_JOB,version:1,description:"This entity represents a scheduled trigger. The action on this entity will be executed one the time set by the cron-job expression is reached.",name:N.CRON_JOB,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[nm],methods:[],abstractMethods:[Yo],extends:[]},rm={type:i.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:i.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},Zo={id:"execution-built-in-entity-abort-method-id",type:i.FunctionDeclaration,version:1,name:St.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:rm},Xo={id:N.EXECUTION,type:i.BuiltInBaseEntity,version:1,name:N.EXECUTION,description:"A reference to an ongoing execution of any entity that can be called. Eg: Operations, custom trigger calls, etc.",static:!1,abstract:!1,interactive:!0,extends:[],properties:[],methods:[Zo],abstractMethods:[]},BI=J[i.Condition]["not-empty"],im={type:i.GenericReference,id:"not-empty-condition-ref",entityType:i.ActionDescriptor,entityId:Nt.NotEmpty},am={id:BI.inputs.leftHand,type:i.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:w.FixedArguments,index:0,parent:im},zn={type:i.ActionDescriptor,id:Nt.NotEmpty,version:1,name:Nt.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[am],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:F.Fixed,returnsType:F.None,error:null},sm={[Nt.NotEmpty]:zn},om=J[i.Condition]["more-than-or-equal"],lm={type:i.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Be.MoreThanOrEqual},cm={id:om.inputs.leftHand,type:i.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:w.FixedArguments,index:0,parent:lm},dm={type:i.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Be.MoreThanOrEqual},um={id:om.inputs.rightHand,type:i.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:w.FixedArguments,index:1,parent:dm},Vr={type:i.ActionDescriptor,id:Be.MoreThanOrEqual,version:1,name:Be.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[cm,um],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:F.Fixed,returnsType:F.None,error:null},pm={[Be.MoreThanOrEqual]:Vr},wI={...sm,...pm},Fa={type:i.ActionDescriptor,id:rn.PROJECT_PUBLICATION_COMPLETED,version:1,name:rn.PROJECT_PUBLICATION_COMPLETED,description:"The event that is triggered when the project has completed its publication and all its code and resurces are now deployed and ready to be used by the users",parent:null,fixedArguments:[],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:F.None,returnsType:F.None,error:null},_I={[rn.PROJECT_PUBLICATION_COMPLETED]:Fa},Qo=J[i.ValueDescriptor][Lo.ActionOngoingProcessOutputValue],ym={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:Qo.id},hm={id:Qo.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xo,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ym},Ko={id:Qo.id,type:i.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:hm,required:!0,index:0,parent:null,parentRelationType:w.OngoingProcessExecution};var X;(function(n){n.assertEqual=a=>a;function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},n.getValidEnumValues=a=>{const s=n.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of s)o[l]=a[l];return n.objectValues(o)},n.objectValues=a=>n.objectKeys(a).map(function(s){return a[s]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&s.push(o);return s},n.find=(a,s)=>{for(const o of a)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(X||(X={}));var el;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(el||(el={}));const V=X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dn=n=>{switch(typeof n){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(n)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(n)?V.array:n===null?V.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?V.promise:typeof Map<"u"&&n instanceof Map?V.map:typeof Set<"u"&&n instanceof Set?V.set:typeof Date<"u"&&n instanceof Date?V.date:V.object;default:return V.unknown}},S=X.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),MI=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Rt extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},a=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let l=r,p=0;for(;p<o.path.length;){const y=o.path[p];p===o.path.length-1?(l[y]=l[y]||{_errors:[]},l[y]._errors.push(t(o))):l[y]=l[y]||{_errors:[]},l=l[y],p++}}};return a(this),r}static assert(e){if(!(e instanceof Rt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,X.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Rt.create=n=>new Rt(n);const $r=(n,e)=>{let t;switch(n.code){case S.invalid_type:n.received===V.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case S.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,X.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:t=`Unrecognized key(s) in object: ${X.joinValues(n.keys,", ")}`;break;case S.invalid_union:t="Invalid input";break;case S.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${X.joinValues(n.options)}`;break;case S.invalid_enum_value:t=`Invalid enum value. Expected ${X.joinValues(n.options)}, received '${n.received}'`;break;case S.invalid_arguments:t="Invalid function arguments";break;case S.invalid_return_type:t="Invalid function return type";break;case S.invalid_date:t="Invalid date";break;case S.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:X.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case S.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case S.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case S.custom:t="Invalid input";break;case S.invalid_intersection_types:t="Intersection results could not be merged";break;case S.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case S.not_finite:t="Number must be finite";break;default:t=e.defaultError,X.assertNever(n)}return{message:t}};let fm=$r;function NI(n){fm=n}function Ua(){return fm}const xa=n=>{const{data:e,path:t,errorMaps:r,issueData:a}=n,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="";const p=r.filter(y=>!!y).slice().reverse();for(const y of p)l=y(o,{data:e,defaultError:l}).message;return{...a,path:s,message:l}},VI=[];function _(n,e){const t=Ua(),r=xa({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===$r?void 0:$r].filter(a=>!!a)});n.common.issues.push(r)}class et{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return j;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const s=await a.key,o=await a.value;r.push({key:s,value:o})}return et.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return j;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const j=Object.freeze({status:"aborted"}),Lr=n=>({status:"dirty",value:n}),dt=n=>({status:"valid",value:n}),tl=n=>n.status==="aborted",nl=n=>n.status==="dirty",gi=n=>n.status==="valid",vi=n=>typeof Promise<"u"&&n instanceof Promise;function ja(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function mm(n,e,t,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(n,t):a?a.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var G;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(G||(G={}));var Ii,Pi;class Wt{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Tm=(n,e)=>{if(gi(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Rt(n.common.issues);return this._error=t,this._error}}};function W(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{var p,y;const{message:f}=n;return o.code==="invalid_enum_value"?{message:f??l.defaultError}:typeof l.data>"u"?{message:(p=f??r)!==null&&p!==void 0?p:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(y=f??t)!==null&&y!==void 0?y:l.defaultError}},description:a}}class Y{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Dn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Dn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new et,ctx:{common:e.parent.common,data:e.data,parsedType:Dn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(vi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return Tm(a,s)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Dn(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(vi(a)?a:Promise.resolve(a));return Tm(r,s)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),l=()=>s.addIssue({code:S.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new qt({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Yt.create(this,this._def)}nullable(){return Cn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return xr.create(this,this._def)}or(e){return Oi.create([this,e],this._def)}and(e){return Ci.create(this,e,this._def)}transform(e){return new qt({...W(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ni({...W(this._def),innerType:this,defaultValue:t,typeName:x.ZodDefault})}brand(){return new al({typeName:x.ZodBranded,type:this,...W(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Vi({...W(this._def),innerType:this,catchValue:t,typeName:x.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return $i.create(this,e)}readonly(){return Li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $I=/^c[^\s-]{8,}$/i,LI=/^[0-9a-z]+$/,GI=/^[0-9A-HJKMNP-TV-Z]{26}$/,FI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,UI=/^[a-z0-9_-]{21}$/i,xI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let rl;const qI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,JI=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,WI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Em="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HI=new RegExp(`^${Em}$`);function Rm(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function YI(n){return new RegExp(`^${Rm(n)}$`)}function bm(n){let e=`${Em}T${Rm(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function zI(n,e){return!!((e==="v4"||!e)&&qI.test(n)||(e==="v6"||!e)&&JI.test(n))}class jt extends Y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){const s=this._getOrReturnCtx(e);return _(s,{code:S.invalid_type,expected:V.string,received:s.parsedType}),j}const r=new et;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),_(a,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),_(a,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,l=e.data.length<s.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?_(a,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&_(a,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")jI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"email",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")rl||(rl=new RegExp(kI,"u")),rl.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"emoji",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")FI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"uuid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")UI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"nanoid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")$I.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"cuid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")LI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"cuid2",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")GI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"ulid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),_(a,{validation:"url",code:S.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"regex",code:S.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),_(a,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),_(a,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),_(a,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?bm(s).test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{code:S.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?HI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{code:S.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?YI(s).test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{code:S.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?xI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"duration",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?zI(e.data,s.version)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"ip",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?WI.test(e.data)||(a=this._getOrReturnCtx(e,a),_(a,{validation:"base64",code:S.invalid_string,message:s.message}),r.dirty()):X.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:S.invalid_string,...G.errToObj(r)})}_addCheck(e){return new jt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}datetime(e){var t,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...G.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...G.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...G.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...G.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...G.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...G.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...G.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...G.errToObj(t)})}nonempty(e){return this.min(1,G.errToObj(e))}trim(){return new jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new jt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}jt.create=n=>{var e;return new jt({checks:[],typeName:x.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...W(n)})};function ZI(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,s=parseInt(n.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class An extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){const s=this._getOrReturnCtx(e);return _(s,{code:S.invalid_type,expected:V.number,received:s.parsedType}),j}let r;const a=new et;for(const s of this._def.checks)s.kind==="int"?X.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),_(r,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),_(r,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),_(r,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?ZI(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),_(r,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),_(r,{code:S.not_finite,message:s.message}),a.dirty()):X.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,G.toString(t))}gt(e,t){return this.setLimit("min",e,!1,G.toString(t))}lte(e,t){return this.setLimit("max",e,!0,G.toString(t))}lt(e,t){return this.setLimit("max",e,!1,G.toString(t))}setLimit(e,t,r,a){return new An({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:G.toString(a)}]})}_addCheck(e){return new An({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&X.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}An.create=n=>new An({checks:[],typeName:x.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...W(n)});class Sn extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==V.bigint){const s=this._getOrReturnCtx(e);return _(s,{code:S.invalid_type,expected:V.bigint,received:s.parsedType}),j}let r;const a=new et;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),_(r,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),_(r,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),_(r,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):X.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,G.toString(t))}gt(e,t){return this.setLimit("min",e,!1,G.toString(t))}lte(e,t){return this.setLimit("max",e,!0,G.toString(t))}lt(e,t){return this.setLimit("max",e,!1,G.toString(t))}setLimit(e,t,r,a){return new Sn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:G.toString(a)}]})}_addCheck(e){return new Sn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Sn.create=n=>{var e;return new Sn({checks:[],typeName:x.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...W(n)})};class Di extends Y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){const r=this._getOrReturnCtx(e);return _(r,{code:S.invalid_type,expected:V.boolean,received:r.parsedType}),j}return dt(e.data)}}Di.create=n=>new Di({typeName:x.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...W(n)});class Zn extends Y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){const s=this._getOrReturnCtx(e);return _(s,{code:S.invalid_type,expected:V.date,received:s.parsedType}),j}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return _(s,{code:S.invalid_date}),j}const r=new et;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),_(a,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),_(a,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):X.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Zn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:G.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Zn.create=n=>new Zn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:x.ZodDate,...W(n)});class ka extends Y{_parse(e){if(this._getType(e)!==V.symbol){const r=this._getOrReturnCtx(e);return _(r,{code:S.invalid_type,expected:V.symbol,received:r.parsedType}),j}return dt(e.data)}}ka.create=n=>new ka({typeName:x.ZodSymbol,...W(n)});class Ai extends Y{_parse(e){if(this._getType(e)!==V.undefined){const r=this._getOrReturnCtx(e);return _(r,{code:S.invalid_type,expected:V.undefined,received:r.parsedType}),j}return dt(e.data)}}Ai.create=n=>new Ai({typeName:x.ZodUndefined,...W(n)});class Si extends Y{_parse(e){if(this._getType(e)!==V.null){const r=this._getOrReturnCtx(e);return _(r,{code:S.invalid_type,expected:V.null,received:r.parsedType}),j}return dt(e.data)}}Si.create=n=>new Si({typeName:x.ZodNull,...W(n)});class Gr extends Y{constructor(){super(...arguments),this._any=!0}_parse(e){return dt(e.data)}}Gr.create=n=>new Gr({typeName:x.ZodAny,...W(n)});class Xn extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return dt(e.data)}}Xn.create=n=>new Xn({typeName:x.ZodUnknown,...W(n)});class ln extends Y{_parse(e){const t=this._getOrReturnCtx(e);return _(t,{code:S.invalid_type,expected:V.never,received:t.parsedType}),j}}ln.create=n=>new ln({typeName:x.ZodNever,...W(n)});class qa extends Y{_parse(e){if(this._getType(e)!==V.undefined){const r=this._getOrReturnCtx(e);return _(r,{code:S.invalid_type,expected:V.void,received:r.parsedType}),j}return dt(e.data)}}qa.create=n=>new qa({typeName:x.ZodVoid,...W(n)});class kt extends Y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==V.array)return _(t,{code:S.invalid_type,expected:V.array,received:t.parsedType}),j;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&(_(t,{code:o?S.too_big:S.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(_(t,{code:S.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(_(t,{code:S.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,l)=>a.type._parseAsync(new Wt(t,o,t.path,l)))).then(o=>et.mergeArray(r,o));const s=[...t.data].map((o,l)=>a.type._parseSync(new Wt(t,o,t.path,l)));return et.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new kt({...this._def,minLength:{value:e,message:G.toString(t)}})}max(e,t){return new kt({...this._def,maxLength:{value:e,message:G.toString(t)}})}length(e,t){return new kt({...this._def,exactLength:{value:e,message:G.toString(t)}})}nonempty(e){return this.min(1,e)}}kt.create=(n,e)=>new kt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...W(e)});function Fr(n){if(n instanceof Le){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Yt.create(Fr(r))}return new Le({...n._def,shape:()=>e})}else return n instanceof kt?new kt({...n._def,type:Fr(n.element)}):n instanceof Yt?Yt.create(Fr(n.unwrap())):n instanceof Cn?Cn.create(Fr(n.unwrap())):n instanceof Ht?Ht.create(n.items.map(e=>Fr(e))):n}class Le extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=X.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==V.object){const y=this._getOrReturnCtx(e);return _(y,{code:S.invalid_type,expected:V.object,received:y.parsedType}),j}const{status:r,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ln&&this._def.unknownKeys==="strip"))for(const y in a.data)o.includes(y)||l.push(y);const p=[];for(const y of o){const f=s[y],m=a.data[y];p.push({key:{status:"valid",value:y},value:f._parse(new Wt(a,m,a.path,y)),alwaysSet:y in a.data})}if(this._def.catchall instanceof ln){const y=this._def.unknownKeys;if(y==="passthrough")for(const f of l)p.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(y==="strict")l.length>0&&(_(a,{code:S.unrecognized_keys,keys:l}),r.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const f of l){const m=a.data[f];p.push({key:{status:"valid",value:f},value:y._parse(new Wt(a,m,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const y=[];for(const f of p){const m=await f.key,b=await f.value;y.push({key:m,value:b,alwaysSet:f.alwaysSet})}return y}).then(y=>et.mergeObjectSync(r,y)):et.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){return G.errToObj,new Le({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,s,o,l;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(l=G.errToObj(e).message)!==null&&l!==void 0?l:p}:{message:p}}}:{}})}strip(){return new Le({...this._def,unknownKeys:"strip"})}passthrough(){return new Le({...this._def,unknownKeys:"passthrough"})}extend(e){return new Le({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Le({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Le({...this._def,catchall:e})}pick(e){const t={};return X.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Le({...this._def,shape:()=>t})}omit(e){const t={};return X.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Le({...this._def,shape:()=>t})}deepPartial(){return Fr(this)}partial(e){const t={};return X.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}),new Le({...this._def,shape:()=>t})}required(e){const t={};return X.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Yt;)s=s._def.innerType;t[r]=s}}),new Le({...this._def,shape:()=>t})}keyof(){return gm(X.objectKeys(this.shape))}}Le.create=(n,e)=>new Le({shape:()=>n,unknownKeys:"strip",catchall:ln.create(),typeName:x.ZodObject,...W(e)}),Le.strictCreate=(n,e)=>new Le({shape:()=>n,unknownKeys:"strict",catchall:ln.create(),typeName:x.ZodObject,...W(e)}),Le.lazycreate=(n,e)=>new Le({shape:n,unknownKeys:"strip",catchall:ln.create(),typeName:x.ZodObject,...W(e)});class Oi extends Y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=s.map(l=>new Rt(l.ctx.common.issues));return _(t,{code:S.invalid_union,unionErrors:o}),j}if(t.common.async)return Promise.all(r.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let s;const o=[];for(const p of r){const y={...t,common:{...t.common,issues:[]},parent:null},f=p._parseSync({data:t.data,path:t.path,parent:y});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:y}),y.common.issues.length&&o.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(p=>new Rt(p));return _(t,{code:S.invalid_union,unionErrors:l}),j}}get options(){return this._def.options}}Oi.create=(n,e)=>new Oi({options:n,typeName:x.ZodUnion,...W(e)});const cn=n=>n instanceof wi?cn(n.schema):n instanceof qt?cn(n.innerType()):n instanceof _i?[n.value]:n instanceof On?n.options:n instanceof Mi?X.objectValues(n.enum):n instanceof Ni?cn(n._def.innerType):n instanceof Ai?[void 0]:n instanceof Si?[null]:n instanceof Yt?[void 0,...cn(n.unwrap())]:n instanceof Cn?[null,...cn(n.unwrap())]:n instanceof al||n instanceof Li?cn(n.unwrap()):n instanceof Vi?cn(n._def.innerType):[];class Ja extends Y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.object)return _(t,{code:S.invalid_type,expected:V.object,received:t.parsedType}),j;const r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(_(t,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const s of t){const o=cn(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,s)}}return new Ja({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...W(r)})}}function il(n,e){const t=Dn(n),r=Dn(e);if(n===e)return{valid:!0,data:n};if(t===V.object&&r===V.object){const a=X.objectKeys(e),s=X.objectKeys(n).filter(l=>a.indexOf(l)!==-1),o={...n,...e};for(const l of s){const p=il(n[l],e[l]);if(!p.valid)return{valid:!1};o[l]=p.data}return{valid:!0,data:o}}else if(t===V.array&&r===V.array){if(n.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<n.length;s++){const o=n[s],l=e[s],p=il(o,l);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===V.date&&r===V.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Ci extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(s,o)=>{if(tl(s)||tl(o))return j;const l=il(s.value,o.value);return l.valid?((nl(s)||nl(o))&&t.dirty(),{status:t.value,value:l.data}):(_(r,{code:S.invalid_intersection_types}),j)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ci.create=(n,e,t)=>new Ci({left:n,right:e,typeName:x.ZodIntersection,...W(t)});class Ht extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return _(r,{code:S.invalid_type,expected:V.array,received:r.parsedType}),j;if(r.data.length<this._def.items.length)return _(r,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&r.data.length>this._def.items.length&&(_(r,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((o,l)=>{const p=this._def.items[l]||this._def.rest;return p?p._parse(new Wt(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>et.mergeArray(t,o)):et.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Ht({...this._def,rest:e})}}Ht.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:n,typeName:x.ZodTuple,rest:null,...W(e)})};class Bi extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return _(r,{code:S.invalid_type,expected:V.object,received:r.parsedType}),j;const a=[],s=this._def.keyType,o=this._def.valueType;for(const l in r.data)a.push({key:s._parse(new Wt(r,l,r.path,l)),value:o._parse(new Wt(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?et.mergeObjectAsync(t,a):et.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof Y?new Bi({keyType:e,valueType:t,typeName:x.ZodRecord,...W(r)}):new Bi({keyType:jt.create(),valueType:e,typeName:x.ZodRecord,...W(t)})}}class Wa extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return _(r,{code:S.invalid_type,expected:V.map,received:r.parsedType}),j;const a=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([l,p],y)=>({key:a._parse(new Wt(r,l,r.path,[y,"key"])),value:s._parse(new Wt(r,p,r.path,[y,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const p of o){const y=await p.key,f=await p.value;if(y.status==="aborted"||f.status==="aborted")return j;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const p of o){const y=p.key,f=p.value;if(y.status==="aborted"||f.status==="aborted")return j;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}}}}Wa.create=(n,e,t)=>new Wa({valueType:e,keyType:n,typeName:x.ZodMap,...W(t)});class Qn extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return _(r,{code:S.invalid_type,expected:V.set,received:r.parsedType}),j;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(_(r,{code:S.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(_(r,{code:S.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(p){const y=new Set;for(const f of p){if(f.status==="aborted")return j;f.status==="dirty"&&t.dirty(),y.add(f.value)}return{status:t.value,value:y}}const l=[...r.data.values()].map((p,y)=>s._parse(new Wt(r,p,r.path,y)));return r.common.async?Promise.all(l).then(p=>o(p)):o(l)}min(e,t){return new Qn({...this._def,minSize:{value:e,message:G.toString(t)}})}max(e,t){return new Qn({...this._def,maxSize:{value:e,message:G.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Qn.create=(n,e)=>new Qn({valueType:n,minSize:null,maxSize:null,typeName:x.ZodSet,...W(e)});class Ur extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.function)return _(t,{code:S.invalid_type,expected:V.function,received:t.parsedType}),j;function r(l,p){return xa({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ua(),$r].filter(y=>!!y),issueData:{code:S.invalid_arguments,argumentsError:p}})}function a(l,p){return xa({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ua(),$r].filter(y=>!!y),issueData:{code:S.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof xr){const l=this;return dt(async function(...p){const y=new Rt([]),f=await l._def.args.parseAsync(p,s).catch(g=>{throw y.addIssue(r(p,g)),y}),m=await Reflect.apply(o,this,f);return await l._def.returns._def.type.parseAsync(m,s).catch(g=>{throw y.addIssue(a(m,g)),y})})}else{const l=this;return dt(function(...p){const y=l._def.args.safeParse(p,s);if(!y.success)throw new Rt([r(p,y.error)]);const f=Reflect.apply(o,this,y.data),m=l._def.returns.safeParse(f,s);if(!m.success)throw new Rt([a(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ur({...this._def,args:Ht.create(e).rest(Xn.create())})}returns(e){return new Ur({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Ur({args:e||Ht.create([]).rest(Xn.create()),returns:t||Xn.create(),typeName:x.ZodFunction,...W(r)})}}class wi extends Y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}wi.create=(n,e)=>new wi({getter:n,typeName:x.ZodLazy,...W(e)});class _i extends Y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return _(t,{received:t.data,code:S.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}_i.create=(n,e)=>new _i({value:n,typeName:x.ZodLiteral,...W(e)});function gm(n,e){return new On({values:n,typeName:x.ZodEnum,...W(e)})}class On extends Y{constructor(){super(...arguments),Ii.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return _(t,{expected:X.joinValues(r),received:t.parsedType,code:S.invalid_type}),j}if(ja(this,Ii,"f")||mm(this,Ii,new Set(this._def.values),"f"),!ja(this,Ii,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return _(t,{received:t.data,code:S.invalid_enum_value,options:r}),j}return dt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return On.create(e,{...this._def,...t})}exclude(e,t=this._def){return On.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}Ii=new WeakMap,On.create=gm;class Mi extends Y{constructor(){super(...arguments),Pi.set(this,void 0)}_parse(e){const t=X.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){const a=X.objectValues(t);return _(r,{expected:X.joinValues(a),received:r.parsedType,code:S.invalid_type}),j}if(ja(this,Pi,"f")||mm(this,Pi,new Set(X.getValidEnumValues(this._def.values)),"f"),!ja(this,Pi,"f").has(e.data)){const a=X.objectValues(t);return _(r,{received:r.data,code:S.invalid_enum_value,options:a}),j}return dt(e.data)}get enum(){return this._def.values}}Pi=new WeakMap,Mi.create=(n,e)=>new Mi({values:n,typeName:x.ZodNativeEnum,...W(e)});class xr extends Y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.promise&&t.common.async===!1)return _(t,{code:S.invalid_type,expected:V.promise,received:t.parsedType}),j;const r=t.parsedType===V.promise?t.data:Promise.resolve(t.data);return dt(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}xr.create=(n,e)=>new xr({type:n,typeName:x.ZodPromise,...W(e)});class qt extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{_(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async l=>{if(t.value==="aborted")return j;const p=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return p.status==="aborted"?j:p.status==="dirty"||t.value==="dirty"?Lr(p.value):p});{if(t.value==="aborted")return j;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?j:l.status==="dirty"||t.value==="dirty"?Lr(l.value):l}}if(a.type==="refinement"){const o=l=>{const p=a.refinement(l,s);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?j:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?j:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!gi(o))return o;const l=a.transform(o.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>gi(o)?Promise.resolve(a.transform(o.value,s)).then(l=>({status:t.value,value:l})):o);X.assertNever(a)}}qt.create=(n,e,t)=>new qt({schema:n,typeName:x.ZodEffects,effect:e,...W(t)}),qt.createWithPreprocess=(n,e,t)=>new qt({schema:e,effect:{type:"preprocess",transform:n},typeName:x.ZodEffects,...W(t)});class Yt extends Y{_parse(e){return this._getType(e)===V.undefined?dt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yt.create=(n,e)=>new Yt({innerType:n,typeName:x.ZodOptional,...W(e)});class Cn extends Y{_parse(e){return this._getType(e)===V.null?dt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cn.create=(n,e)=>new Cn({innerType:n,typeName:x.ZodNullable,...W(e)});class Ni extends Y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ni.create=(n,e)=>new Ni({innerType:n,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...W(e)});class Vi extends Y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vi(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Rt(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Rt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Vi.create=(n,e)=>new Vi({innerType:n,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...W(e)});class Ha extends Y{_parse(e){if(this._getType(e)!==V.nan){const r=this._getOrReturnCtx(e);return _(r,{code:S.invalid_type,expected:V.nan,received:r.parsedType}),j}return{status:"valid",value:e.data}}}Ha.create=n=>new Ha({typeName:x.ZodNaN,...W(n)});const XI=Symbol("zod_brand");class al extends Y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class $i extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?j:s.status==="dirty"?(t.dirty(),Lr(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?j:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new $i({in:e,out:t,typeName:x.ZodPipeline})}}class Li extends Y{_parse(e){const t=this._def.innerType._parse(e),r=a=>(gi(a)&&(a.value=Object.freeze(a.value)),a);return vi(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}Li.create=(n,e)=>new Li({innerType:n,typeName:x.ZodReadonly,...W(e)});function vm(n,e={},t){return n?Gr.create().superRefine((r,a)=>{var s,o;if(!n(r)){const l=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,p=(o=(s=l.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,y=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...y,fatal:p})}}):Gr.create()}const QI={object:Le.lazycreate};var x;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(x||(x={}));const KI=(n,e={message:`Input not instance of ${n.name}`})=>vm(t=>t instanceof n,e),Ya=jt.create,sl=An.create,eP=Ha.create,tP=Sn.create,ol=Di.create,Im=Zn.create,nP=ka.create,rP=Ai.create,Pm=Si.create,iP=Gr.create,za=Xn.create,aP=ln.create,sP=qa.create,oP=kt.create,Dm=Le.create,lP=Le.strictCreate,cP=Oi.create,dP=Ja.create,uP=Ci.create,pP=Ht.create,Am=Bi.create,yP=Wa.create,hP=Qn.create,fP=Ur.create,mP=wi.create,TP=_i.create,Sm=On.create,EP=Mi.create,RP=xr.create,Om=qt.create,bP=Yt.create,gP=Cn.create,vP=qt.createWithPreprocess,IP=$i.create;var d=Object.freeze({__proto__:null,defaultErrorMap:$r,setErrorMap:NI,getErrorMap:Ua,makeIssue:xa,EMPTY_PATH:VI,addIssueToContext:_,ParseStatus:et,INVALID:j,DIRTY:Lr,OK:dt,isAborted:tl,isDirty:nl,isValid:gi,isAsync:vi,get util(){return X},get objectUtil(){return el},ZodParsedType:V,getParsedType:Dn,ZodType:Y,datetimeRegex:bm,ZodString:jt,ZodNumber:An,ZodBigInt:Sn,ZodBoolean:Di,ZodDate:Zn,ZodSymbol:ka,ZodUndefined:Ai,ZodNull:Si,ZodAny:Gr,ZodUnknown:Xn,ZodNever:ln,ZodVoid:qa,ZodArray:kt,ZodObject:Le,ZodUnion:Oi,ZodDiscriminatedUnion:Ja,ZodIntersection:Ci,ZodTuple:Ht,ZodRecord:Bi,ZodMap:Wa,ZodSet:Qn,ZodFunction:Ur,ZodLazy:wi,ZodLiteral:_i,ZodEnum:On,ZodNativeEnum:Mi,ZodPromise:xr,ZodEffects:qt,ZodTransformer:qt,ZodOptional:Yt,ZodNullable:Cn,ZodDefault:Ni,ZodCatch:Vi,ZodNaN:Ha,BRAND:XI,ZodBranded:al,ZodPipeline:$i,ZodReadonly:Li,custom:vm,Schema:Y,ZodSchema:Y,late:QI,get ZodFirstPartyTypeKind(){return x},coerce:{string:n=>jt.create({...n,coerce:!0}),number:n=>An.create({...n,coerce:!0}),boolean:n=>Di.create({...n,coerce:!0}),bigint:n=>Sn.create({...n,coerce:!0}),date:n=>Zn.create({...n,coerce:!0})},any:iP,array:oP,bigint:tP,boolean:ol,date:Im,discriminatedUnion:dP,effect:Om,enum:Sm,function:fP,instanceof:KI,intersection:uP,lazy:mP,literal:TP,map:yP,nan:eP,nativeEnum:EP,never:aP,null:Pm,nullable:gP,number:sl,object:Dm,oboolean:()=>ol().optional(),onumber:()=>sl().optional(),optional:bP,ostring:()=>Ya().optional(),pipeline:IP,preprocess:vP,promise:RP,record:Am,set:hP,strictObject:lP,string:Ya,symbol:nP,transformer:Om,tuple:pP,undefined:rP,union:cP,unknown:za,void:sP,NEVER:j,ZodIssueCode:S,quotelessJson:MI,ZodError:Rt});function Cm(n){var a,s,o;if(!(n!=null&&n.dataType))return za();const e=n.dataType.isNullable||!1,t=n.dataType.isList||!1;let r=za();if(((a=n.dataType.entity)==null?void 0:a.type)===i.PrimitiveEntity)switch(n.dataType.entity.name){case D.String:r=Ya();break;case D.JSON:r=Am(za());break;case D.Number:r=sl();break;case D.Boolean:r=ol();break;case D.Date:r=Im();break;case D.Enum:{const l=n.dataType.options||[];if(l.length===0)throw new Error(`Enum property ${n.name} has no options`);r=Sm(l);break}case D.Null:r=Pm();break;case D.UUID:r=Ya().uuid();break}else if(((s=n.dataType.entity)==null?void 0:s.type)===i.CustomEntity)r=Bm(n.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=n.dataType.entity)==null?void 0:o.type}`);return e&&(r=r.nullable()),t&&(r=r.array()),r}function Bm(n){const e=Dm({});for(const t of n.properties){const r=Cm(t);e.shape[t.name]=r}return e}function wm(n){const e=n.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function _m(n){const e=n.rangeEnd;return new Date(Math.random()*e.getTime())}function Mm(n){const e=n.rangeStart,t=n.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function Nm(n){return n.rangeStart&&n.rangeEnd?Mm(n):n.rangeStart?wm(n):n.rangeEnd?_m(n):new Date}function PP(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vm={},Za={},Xa={};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=AP;let Qa;const DP=new Uint8Array(16);function AP(){if(!Qa&&(Qa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qa(DP)}var Bn={},Kn={},Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=void 0;var SP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Ka.default=SP,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.default=void 0;var OP=CP(Ka);function CP(n){return n&&n.__esModule?n:{default:n}}function BP(n){return typeof n=="string"&&OP.default.test(n)}var wP=BP;Kn.default=wP,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.default=void 0,Bn.unsafeStringify=$m;var _P=MP(Kn);function MP(n){return n&&n.__esModule?n:{default:n}}const ze=[];for(let n=0;n<256;++n)ze.push((n+256).toString(16).slice(1));function $m(n,e=0){return ze[n[e+0]]+ze[n[e+1]]+ze[n[e+2]]+ze[n[e+3]]+"-"+ze[n[e+4]]+ze[n[e+5]]+"-"+ze[n[e+6]]+ze[n[e+7]]+"-"+ze[n[e+8]]+ze[n[e+9]]+"-"+ze[n[e+10]]+ze[n[e+11]]+ze[n[e+12]]+ze[n[e+13]]+ze[n[e+14]]+ze[n[e+15]]}function NP(n,e=0){const t=$m(n,e);if(!(0,_P.default)(t))throw TypeError("Stringified UUID is invalid");return t}var VP=NP;Bn.default=VP,Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=void 0;var $P=GP(Xa),LP=Bn;function GP(n){return n&&n.__esModule?n:{default:n}}let Lm,ll,cl=0,dl=0;function FP(n,e,t){let r=e&&t||0;const a=e||new Array(16);n=n||{};let s=n.node||Lm,o=n.clockseq!==void 0?n.clockseq:ll;if(s==null||o==null){const b=n.random||(n.rng||$P.default)();s==null&&(s=Lm=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),o==null&&(o=ll=(b[6]<<8|b[7])&16383)}let l=n.msecs!==void 0?n.msecs:Date.now(),p=n.nsecs!==void 0?n.nsecs:dl+1;const y=l-cl+(p-dl)/1e4;if(y<0&&n.clockseq===void 0&&(o=o+1&16383),(y<0||l>cl)&&n.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");cl=l,dl=p,ll=o,l+=122192928e5;const f=((l&268435455)*1e4+p)%4294967296;a[r++]=f>>>24&255,a[r++]=f>>>16&255,a[r++]=f>>>8&255,a[r++]=f&255;const m=l/4294967296*1e4&268435455;a[r++]=m>>>8&255,a[r++]=m&255,a[r++]=m>>>24&15|16,a[r++]=m>>>16&255,a[r++]=o>>>8|128,a[r++]=o&255;for(let b=0;b<6;++b)a[r+b]=s[b];return e||(0,LP.unsafeStringify)(a)}var UP=FP;Za.default=UP;var es={},wn={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var xP=jP(Kn);function jP(n){return n&&n.__esModule?n:{default:n}}function kP(n){if(!(0,xP.default)(n))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var qP=kP;Gi.default=qP,Object.defineProperty(wn,"__esModule",{value:!0}),wn.URL=wn.DNS=void 0,wn.default=zP;var JP=Bn,WP=HP(Gi);function HP(n){return n&&n.__esModule?n:{default:n}}function YP(n){n=unescape(encodeURIComponent(n));const e=[];for(let t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}const Gm="6ba7b810-9dad-11d1-80b4-00c04fd430c8";wn.DNS=Gm;const Fm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";wn.URL=Fm;function zP(n,e,t){function r(a,s,o,l){var p;if(typeof a=="string"&&(a=YP(a)),typeof s=="string"&&(s=(0,WP.default)(s)),((p=s)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let y=new Uint8Array(16+a.length);if(y.set(s),y.set(a,s.length),y=t(y),y[6]=y[6]&15|e,y[8]=y[8]&63|128,o){l=l||0;for(let f=0;f<16;++f)o[l+f]=y[f];return o}return(0,JP.unsafeStringify)(y)}try{r.name=n}catch{}return r.DNS=Gm,r.URL=Fm,r}var ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=void 0;function ZP(n){if(typeof n=="string"){const e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return XP(QP(KP(n),n.length*8))}function XP(n){const e=[],t=n.length*32,r="0123456789abcdef";for(let a=0;a<t;a+=8){const s=n[a>>5]>>>a%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);e.push(o)}return e}function Um(n){return(n+64>>>9<<4)+14+1}function QP(n,e){n[e>>5]|=128<<e%32,n[Um(e)-1]=e;let t=1732584193,r=-271733879,a=-1732584194,s=271733878;for(let o=0;o<n.length;o+=16){const l=t,p=r,y=a,f=s;t=tt(t,r,a,s,n[o],7,-680876936),s=tt(s,t,r,a,n[o+1],12,-389564586),a=tt(a,s,t,r,n[o+2],17,606105819),r=tt(r,a,s,t,n[o+3],22,-1044525330),t=tt(t,r,a,s,n[o+4],7,-176418897),s=tt(s,t,r,a,n[o+5],12,1200080426),a=tt(a,s,t,r,n[o+6],17,-1473231341),r=tt(r,a,s,t,n[o+7],22,-45705983),t=tt(t,r,a,s,n[o+8],7,1770035416),s=tt(s,t,r,a,n[o+9],12,-1958414417),a=tt(a,s,t,r,n[o+10],17,-42063),r=tt(r,a,s,t,n[o+11],22,-1990404162),t=tt(t,r,a,s,n[o+12],7,1804603682),s=tt(s,t,r,a,n[o+13],12,-40341101),a=tt(a,s,t,r,n[o+14],17,-1502002290),r=tt(r,a,s,t,n[o+15],22,1236535329),t=nt(t,r,a,s,n[o+1],5,-165796510),s=nt(s,t,r,a,n[o+6],9,-1069501632),a=nt(a,s,t,r,n[o+11],14,643717713),r=nt(r,a,s,t,n[o],20,-373897302),t=nt(t,r,a,s,n[o+5],5,-701558691),s=nt(s,t,r,a,n[o+10],9,38016083),a=nt(a,s,t,r,n[o+15],14,-660478335),r=nt(r,a,s,t,n[o+4],20,-405537848),t=nt(t,r,a,s,n[o+9],5,568446438),s=nt(s,t,r,a,n[o+14],9,-1019803690),a=nt(a,s,t,r,n[o+3],14,-187363961),r=nt(r,a,s,t,n[o+8],20,1163531501),t=nt(t,r,a,s,n[o+13],5,-1444681467),s=nt(s,t,r,a,n[o+2],9,-51403784),a=nt(a,s,t,r,n[o+7],14,1735328473),r=nt(r,a,s,t,n[o+12],20,-1926607734),t=rt(t,r,a,s,n[o+5],4,-378558),s=rt(s,t,r,a,n[o+8],11,-2022574463),a=rt(a,s,t,r,n[o+11],16,1839030562),r=rt(r,a,s,t,n[o+14],23,-35309556),t=rt(t,r,a,s,n[o+1],4,-1530992060),s=rt(s,t,r,a,n[o+4],11,1272893353),a=rt(a,s,t,r,n[o+7],16,-155497632),r=rt(r,a,s,t,n[o+10],23,-1094730640),t=rt(t,r,a,s,n[o+13],4,681279174),s=rt(s,t,r,a,n[o],11,-358537222),a=rt(a,s,t,r,n[o+3],16,-722521979),r=rt(r,a,s,t,n[o+6],23,76029189),t=rt(t,r,a,s,n[o+9],4,-640364487),s=rt(s,t,r,a,n[o+12],11,-421815835),a=rt(a,s,t,r,n[o+15],16,530742520),r=rt(r,a,s,t,n[o+2],23,-995338651),t=it(t,r,a,s,n[o],6,-198630844),s=it(s,t,r,a,n[o+7],10,1126891415),a=it(a,s,t,r,n[o+14],15,-1416354905),r=it(r,a,s,t,n[o+5],21,-57434055),t=it(t,r,a,s,n[o+12],6,1700485571),s=it(s,t,r,a,n[o+3],10,-1894986606),a=it(a,s,t,r,n[o+10],15,-1051523),r=it(r,a,s,t,n[o+1],21,-2054922799),t=it(t,r,a,s,n[o+8],6,1873313359),s=it(s,t,r,a,n[o+15],10,-30611744),a=it(a,s,t,r,n[o+6],15,-1560198380),r=it(r,a,s,t,n[o+13],21,1309151649),t=it(t,r,a,s,n[o+4],6,-145523070),s=it(s,t,r,a,n[o+11],10,-1120210379),a=it(a,s,t,r,n[o+2],15,718787259),r=it(r,a,s,t,n[o+9],21,-343485551),t=_n(t,l),r=_n(r,p),a=_n(a,y),s=_n(s,f)}return[t,r,a,s]}function KP(n){if(n.length===0)return[];const e=n.length*8,t=new Uint32Array(Um(e));for(let r=0;r<e;r+=8)t[r>>5]|=(n[r/8]&255)<<r%32;return t}function _n(n,e){const t=(n&65535)+(e&65535);return(n>>16)+(e>>16)+(t>>16)<<16|t&65535}function eD(n,e){return n<<e|n>>>32-e}function ns(n,e,t,r,a,s){return _n(eD(_n(_n(e,n),_n(r,s)),a),t)}function tt(n,e,t,r,a,s,o){return ns(e&t|~e&r,n,e,a,s,o)}function nt(n,e,t,r,a,s,o){return ns(e&r|t&~r,n,e,a,s,o)}function rt(n,e,t,r,a,s,o){return ns(e^t^r,n,e,a,s,o)}function it(n,e,t,r,a,s,o){return ns(t^(e|~r),n,e,a,s,o)}var tD=ZP;ts.default=tD,Object.defineProperty(es,"__esModule",{value:!0}),es.default=void 0;var nD=xm(wn),rD=xm(ts);function xm(n){return n&&n.__esModule?n:{default:n}}var iD=(0,nD.default)("v3",48,rD.default);es.default=iD;var rs={},is={};Object.defineProperty(is,"__esModule",{value:!0}),is.default=void 0;var aD={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};is.default=aD,Object.defineProperty(rs,"__esModule",{value:!0}),rs.default=void 0;var jm=km(is),sD=km(Xa),oD=Bn;function km(n){return n&&n.__esModule?n:{default:n}}function lD(n,e,t){if(jm.default.randomUUID&&!e&&!n)return jm.default.randomUUID();n=n||{};const r=n.random||(n.rng||sD.default)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=r[a];return e}return(0,oD.unsafeStringify)(r)}var cD=lD;rs.default=cD;var as={},ss={};Object.defineProperty(ss,"__esModule",{value:!0}),ss.default=void 0;function dD(n,e,t,r){switch(n){case 0:return e&t^~e&r;case 1:return e^t^r;case 2:return e&t^e&r^t&r;case 3:return e^t^r}}function ul(n,e){return n<<e|n>>>32-e}function uD(n){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){const o=unescape(encodeURIComponent(n));n=[];for(let l=0;l<o.length;++l)n.push(o.charCodeAt(l))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);const r=n.length/4+2,a=Math.ceil(r/16),s=new Array(a);for(let o=0;o<a;++o){const l=new Uint32Array(16);for(let p=0;p<16;++p)l[p]=n[o*64+p*4]<<24|n[o*64+p*4+1]<<16|n[o*64+p*4+2]<<8|n[o*64+p*4+3];s[o]=l}s[a-1][14]=(n.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(n.length-1)*8&4294967295;for(let o=0;o<a;++o){const l=new Uint32Array(80);for(let g=0;g<16;++g)l[g]=s[o][g];for(let g=16;g<80;++g)l[g]=ul(l[g-3]^l[g-8]^l[g-14]^l[g-16],1);let p=t[0],y=t[1],f=t[2],m=t[3],b=t[4];for(let g=0;g<80;++g){const A=Math.floor(g/20),C=ul(p,5)+dD(A,y,f,m)+b+e[A]+l[g]>>>0;b=m,m=f,f=ul(y,30)>>>0,y=p,p=C}t[0]=t[0]+p>>>0,t[1]=t[1]+y>>>0,t[2]=t[2]+f>>>0,t[3]=t[3]+m>>>0,t[4]=t[4]+b>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var pD=uD;ss.default=pD,Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var yD=qm(wn),hD=qm(ss);function qm(n){return n&&n.__esModule?n:{default:n}}var fD=(0,yD.default)("v5",80,hD.default);as.default=fD;var os={};Object.defineProperty(os,"__esModule",{value:!0}),os.default=void 0;var mD="00000000-0000-0000-0000-000000000000";os.default=mD;var ls={};Object.defineProperty(ls,"__esModule",{value:!0}),ls.default=void 0;var TD=ED(Kn);function ED(n){return n&&n.__esModule?n:{default:n}}function RD(n){if(!(0,TD.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}var bD=RD;ls.default=bD,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"version",{enumerable:!0,get:function(){return o.default}});var e=f(Za),t=f(es),r=f(rs),a=f(as),s=f(os),o=f(ls),l=f(Kn),p=f(Bn),y=f(Gi);function f(m){return m&&m.__esModule?m:{default:m}}}(Vm);function pl(n,e){if(!n||!e||!n.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=n,this.dstAlphabet=e}pl.prototype.convert=function(n){var e,t,r,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,l=n.length,p=typeof n=="string"?"":[];if(!this.isValid(n))throw new Error('Number "'+n+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return n;for(e=0;e<l;e++)a[e]=this.srcAlphabet.indexOf(n[e]);do{for(t=0,r=0,e=0;e<l;e++)t=t*s+a[e],t>=o?(a[r++]=parseInt(t/o,10),t=t%o):r>0&&(a[r++]=0);l=r,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(r!==0);return p},pl.prototype.isValid=function(n){for(var e=0;e<n.length;++e)if(this.srcAlphabet.indexOf(n[e])===-1)return!1;return!0};var gD=pl,vD=gD;function Fi(n,e){var t=new vD(n,e);return function(r){return t.convert(r)}}Fi.BIN="01",Fi.OCT="01234567",Fi.DEC="0123456789",Fi.HEX="0123456789abcdef";var ID=Fi;const{v4:yl,validate:PD}=Vm,cs=ID,hl={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},DD={consistentLength:!0};let fl;const Jm=(n,e,t)=>{const r=e(n.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?r:r.padStart(t.shortIdLength,t.paddingChar)},Wm=(n,e)=>{const r=e(n).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[r[1],r[2],r[3],r[4],r[5]].join("-")},AD=n=>Math.ceil(Math.log(2**128)/Math.log(n));var SD=(()=>{const n=(e,t)=>{const r=e||hl.flickrBase58,a={...DD,...t};if([...new Set(Array.from(r))].length!==r.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=AD(r.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:r[0]},l=cs(cs.HEX,r),p=cs(r,cs.HEX),y=()=>Jm(yl(),l,o),m={alphabet:r,fromUUID:b=>Jm(b,l,o),maxLength:s,generate:y,new:y,toUUID:b=>Wm(b,p),uuid:yl,validate:(b,g=!1)=>{if(!b||typeof b!="string")return!1;const A=a.consistentLength?b.length===s:b.length<=s,C=b.split("").every($=>r.includes($));return g===!1?A&&C:A&&C&&PD(Wm(b,p))}};return Object.freeze(m),m};return n.constants=hl,n.uuid=yl,n.generate=()=>(fl||(fl=n(hl.flickrBase58).generate),fl()),n})();const ds=PP(SD);function Hm(){return ds().uuid()}function Ym(n){return n.rangeStart+Math.random()}function zm(n){const e=n.rangeEnd;return Math.random()*e}function Zm(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random()*(t-e)+e}function Xm(n){return n.rangeStart&&n.rangeEnd?Zm(n):n.rangeStart?Ym(n):n.rangeEnd?zm(n):Math.random()}function Qm(n){const e=n.rangeStart;return Math.random().toString(36).substring(e)}function Km(n){const e=n.rangeEnd;return Math.random().toString(36).substring(0,e)}function eT(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random().toString(36).substring(e,t)}function tT(n){return n.rangeStart&&n.rangeEnd?eT(n):n.rangeStart?Qm(n):n.rangeEnd?Km(n):Math.random().toString(36)}function nT(n){return Math.random()>=.5}function OD(n){if(!n||!n.autogeneration)return null;switch(n.autogeneration.type){case xe.CurrentDateAndTime:if(n.name===D.Date)return new Date;case xe.Random:{if(n.name===D.Date)return Nm(n.autogeneration);if(n.name===D.Number)return Xm(n.autogeneration);if(n.name===D.String)return tT(n.autogeneration);if(n.name===D.Boolean)return nT(n.autogeneration)}case xe.Unique:if(n.name===D.UUID)return Hm();default:throw new Error(`Generating a ${n.autogeneration.type} value for a ${n.name} is not supported`)}}const H="e7eb5382-3d99-44fd-972a-b8b1e819f6be",ml="global-user-variable-id",rT="last-executed-timestamp-variable-id",CD={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:i.DataType},BD={id:"alternative-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:i.Property},wD={id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:null,parent:CD,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:BD},us={id:"alternative-relational-database-entity-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},_D={hidden:!1,required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:Va,static:!0,index:0,dataType:wD,description:"The name of the main database inside of the server instance where the data will be stored.",parent:us};i.GenericReference,i.DataType;const MD={id:"alternative-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:i.Property},ND={id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:MD},VD={hidden:!1,required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:$a,static:!0,index:1,dataType:ND,description:"The username that will be used to connect to the database.",parent:us};i.GenericReference,i.DataType;const $D={id:"alternative-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:i.Property},LD={id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:$D},GD={hidden:!1,required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:La,static:!0,index:2,dataType:LD,description:"The password that will be used to connect to the database.",parent:us},FD={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:i.DataType},UD={id:"alternative-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:i.Property},xD={id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:6,parent:FD,autogeneration:null,valueAsType:null},parent:UD},jD={hidden:!1,required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Ga,static:!0,index:3,dataType:xD,description:"The minimum size of the database in GB.",parent:us},kD={id:"alternative-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},iT={id:"alternative-relational-database-entity-id",type:i.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[_D,VD,GD,jD],methods:[],abstractMethods:[],extends:[],implements:[Pn],x:0,y:0,parent:kD},qD={id:"animal-prototype-database-property-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-id",entityType:i.Property},JD={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:i.DataType},WD={id:"animal-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Pn,asType:!1,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.EntityTemplate,valueAsType:iT,autogeneration:null,parent:JD},parent:qD},HD={id:"animal-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.CustomEntity},YD={hidden:!1,required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:bi,static:!0,index:0,dataType:WD,description:"The database that the entity belongs to.",parent:HD},zD={type:i.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:i.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},ZD={id:"c1930577-9e79-48a6-8905-be24611015c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zD},XD={type:i.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:i.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},QD={hidden:!1,required:!0,type:i.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",implements:null,static:!1,private:!1,index:0,dataType:ZD,abstract:!1,parent:XD},KD={type:i.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:i.Project,entityId:H},eA={type:i.CustomEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[YD,QD],methods:[],extends:[],implements:[Ve],x:0,y:0,parent:KD},tA={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:i.DataType},nA={id:"default-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:i.Property},rA={id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"main",parent:tA,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:nA},jr={id:"default-relational-database-entity-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},iA={hidden:!1,required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:Va,static:!0,index:0,dataType:rA,description:"The name of the main database inside of the server instance where the data will be stored.",parent:jr};i.GenericReference,i.DataType;const aA={id:"default-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:i.Property},sA={id:"default-relational-database-entity-username-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-data-type-id",entityType:i.DataType},oA={id:"default-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"default-relational-database-entity-username-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"root",parent:sA,autogeneration:null,valueAsType:null},parent:aA},lA={hidden:!1,required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:$a,static:!0,index:1,dataType:oA,description:"The username that will be used to connect to the database.",parent:jr};i.GenericReference,i.DataType;const cA={id:"default-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:i.Property},dA={id:"default-relational-database-entity-password-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-data-type-id",entityType:i.DataType},uA={id:"default-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"default-relational-database-entity-password-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"password",parent:dA,autogeneration:null,valueAsType:null},parent:cA},pA={hidden:!1,required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:La,static:!0,index:2,dataType:uA,description:"The password that will be used to connect to the database.",parent:jr},yA={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:i.DataType},hA={id:"default-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:i.Property},fA={id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:6,parent:yA,autogeneration:null,valueAsType:null},parent:hA},mA={hidden:!1,required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Ga,static:!0,index:3,dataType:fA,description:"The minimum size of the database in GB.",parent:jr},TA={id:"default-relational-database-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-data-type-id",entityType:i.DataType},EA={id:"default-relational-database-entity-default-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:i.Property},RA={id:"default-relational-database-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"default-relational-database-entity-default-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!0,parent:TA,autogeneration:null,valueAsType:null},parent:EA},bA={hidden:!0,required:!0,id:"default-relational-database-entity-default-property-id",name:"Default",version:1,type:i.Property,private:!1,abstract:!1,implements:Jo,static:!0,index:4,dataType:RA,description:"Whether this database is automatically picked by other entities as the default database.",parent:jr},gA={id:"default-relational-database-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-data-type-id",entityType:i.DataType},vA={id:"default-relational-database-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:i.Property},IA={id:"default-relational-database-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"default-relational-database-entity-autoscaling-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!0,parent:gA,autogeneration:null,valueAsType:null},parent:vA},PA={hidden:!1,required:!0,id:"default-relational-database-entity-autoscaling-property-id",name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!1,implements:Wo,static:!0,index:5,dataType:IA,description:"If true, this database will automatically scale up or down in memory size, based on the usage.s",parent:jr},DA={id:"default-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Tl={id:"default-relational-database-entity-id",type:i.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[bA,PA,iA,lA,pA,mA],methods:[],abstractMethods:[],extends:[],implements:[Pn],x:0,y:0,parent:DA},AA={id:"user-prototype-database-property-data-type-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:i.DataType},SA={id:"user-prototype-database-property-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-id",entityType:i.Property},OA={id:"user-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Pn,asType:!1,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.EntityTemplate,valueAsType:Tl,autogeneration:null,parent:AA},parent:SA},CA={id:"user-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.CustomEntity},BA={hidden:!1,required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:bi,static:!0,index:0,dataType:OA,description:"The database that the entity belongs to.",parent:CA},wA={type:i.GenericReference,id:"user-prototype-parent-ref-id",entityType:i.Project,entityId:H},El={type:i.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Ve],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[BA],methods:[],x:0,y:0,parent:wA},_A={type:i.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:i.Property,entityId:"person-date-of-birth-property-id"},MA={id:"person-date-of-birth-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:sn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:_A},NA={type:i.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:i.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},VA={hidden:!1,required:!0,type:i.Property,id:"person-date-of-birth-property-id",version:1,name:"Date of birth",description:"The date of birth of the person",implements:null,private:!1,static:!1,index:0,dataType:MA,abstract:!1,parent:NA},$A={type:i.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:i.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},LA={id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:$A},GA={type:i.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:i.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},FA={hidden:!1,required:!0,type:i.Property,id:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7",version:1,name:"Name",description:"The name of the person",implements:null,private:!1,static:!1,index:0,dataType:LA,abstract:!1,parent:GA},UA={type:i.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:i.Project,entityId:H},ut={type:i.CustomEntity,id:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416",version:1,name:"Person",description:"A entity to store more information about a person than the user entity does, to split the responsibilities and keep it the logic clean.",properties:[FA,VA],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[El],x:0,y:0,parent:UA},xA={type:i.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},jA={type:i.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:i.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},kA={type:i.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},qA={type:i.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:i.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},JA={id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qA},Rl={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:i.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:JA,readsValue:kA,required:!0,index:0,parent:jA},WA={type:i.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},HA={type:i.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},aT={type:i.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[Rl],calledByError:[],calledByEntry:[WA],calledBySuccess:[],throws:null,x:0,y:0,parent:HA},YA={type:i.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},zA={id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YA},sT={id:"500dee3a-3435-4453-9699-0d053f646523",type:i.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:zA,required:!0,writesValues:[Rl],index:0,parent:xA},ZA={type:i.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},oT={type:i.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[sT],calls:[aT],returnStatements:[aT],index:0,collapsed:!1,private:!1,x:0,y:0,parent:ZA},XA={type:i.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:i.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},QA={id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:XA},KA={type:i.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:i.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},eS={type:i.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},tS={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:i.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:QA,readsValue:KA,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:eS},nS={type:i.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},rS={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:i.OutputMap,version:1,declaration:Rl,writesValues:[tS],index:0,parent:nS},iS={type:i.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},aS={type:i.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},sS={type:i.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},oS={id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sS},lS={type:i.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},cS={type:i.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},dS={type:i.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},uS={type:i.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},lT={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:i.InputMap,version:1,declaration:sT,name:null,description:null,readsValue:uS,dynamicArguments:[],defaultValue:null,index:0,parent:dS},pS={type:i.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:oS,readsValue:lS,writesValues:[lT],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:cS},yS={type:i.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:oT,inputs:[lT],outputs:[rS],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[iS],calledBySuccess:[],parent:aS,error:null,x:0,y:0},hS={type:i.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},fS={id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:hS},mS={type:i.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},TS={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:i.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:fS,required:!0,index:0,writesValues:[pS],parent:mS},ES={type:i.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},RS={type:i.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[TS],collapsed:!0,returnStatements:[],calls:[yS],private:!1,index:0,implements:null,x:0,y:0,parent:ES},bS={type:i.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:i.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},gS={id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:bS},vS={type:i.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},cT={hidden:!1,required:!0,type:i.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:gS,abstract:!1,parent:vS},IS={type:i.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:i.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},PS={id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:IS},DS={type:i.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},dT={hidden:!1,required:!0,type:i.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:PS,implements:null,static:!1,private:!0,abstract:!1,parent:DS},AS={type:i.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:i.Project,entityId:H},kr={type:i.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[cT,dT],methods:[oT,RS],extends:[],implements:[Ve],x:0,y:0,parent:AS},Ui="bitcoin-api-response-id",uT="time-property-id",pT="disclamer-property-id",yT="chart-name-property-id",hT="bpi-property-id",ps="bpi-entity-id",fT="usd-property-id",mT="gbp-property-id",TT="eur-property-id",qr="currency-entity-id",ET="currency-code-property-id",RT="currency-symbol-property-id",bT="currency-rate-property-id",gT="currency-description-property-id",vT="currency-rate-number-property-id",SS={type:i.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:i.Property,entityId:ET},OS={id:"code-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:SS},CS={type:i.GenericReference,id:"code-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},BS={hidden:!1,required:!0,type:i.Property,id:ET,version:1,name:"code",description:null,dataType:OS,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:CS},wS={type:i.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:i.Property,entityId:RT},_S={id:"symbol-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["$","£","€"],constant:!1,parent:wS},MS={type:i.GenericReference,id:"symbol-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},NS={hidden:!1,required:!0,type:i.Property,id:RT,version:1,name:"symbol",description:null,index:0,dataType:_S,implements:null,static:!1,private:!1,abstract:!1,parent:MS},VS={type:i.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:i.Property,entityId:bT},$S={id:"rate-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:VS},LS={type:i.GenericReference,id:"rate-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},GS={hidden:!1,required:!0,type:i.Property,id:bT,version:1,name:"rate",description:null,index:0,dataType:$S,implements:null,static:!1,private:!1,abstract:!1,parent:LS},FS={type:i.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:i.Property,entityId:gT},US={id:"description-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FS},xS={type:i.GenericReference,id:"description-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},jS={hidden:!1,required:!0,type:i.Property,id:gT,version:1,name:"description",description:null,dataType:US,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:xS},kS={type:i.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:i.Property,entityId:vT},qS={id:"rate-number-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kS},JS={type:i.GenericReference,id:"rate-number-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},WS={hidden:!1,required:!0,type:i.Property,id:vT,version:1,name:"rate_float",description:null,dataType:qS,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:JS},HS={type:i.GenericReference,id:"currency-prototype-parent-ref-id",entityType:i.Project,entityId:H},ys={type:i.CustomEntity,id:qr,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[BS,NS,GS,jS,WS],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:HS},YS={type:i.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:i.Property,entityId:fT},zS={id:"usd-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ys,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YS},ZS={type:i.GenericReference,id:"usd-property-parent-ref-id",entityType:i.CustomEntity,entityId:ps},XS={hidden:!1,required:!0,id:fT,type:i.Property,version:1,name:"USD",description:null,index:0,dataType:zS,implements:null,static:!1,private:!1,abstract:!1,parent:ZS},QS={type:i.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:i.Property,entityId:mT},KS={id:"gbp-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ys,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:QS},eO={type:i.GenericReference,id:"gbp-property-parent-ref-id",entityType:i.CustomEntity,entityId:ps},tO={hidden:!1,required:!0,id:mT,type:i.Property,version:1,name:"GBP",description:null,index:0,dataType:KS,implements:null,static:!1,private:!1,abstract:!1,parent:eO},nO={type:i.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:i.Property,entityId:TT},rO={id:"eur-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ys,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:nO},iO={type:i.GenericReference,id:"eur-property-parent-ref-id",entityType:i.CustomEntity,entityId:ps},aO={hidden:!1,required:!0,id:TT,type:i.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:rO,private:!1,abstract:!1,parent:iO},sO={type:i.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:i.Project,entityId:H},IT={type:i.CustomEntity,id:ps,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[XS,tO,aO],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:sO},oO={type:i.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:i.Property,entityId:uT},lO={id:"time-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Io,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:oO},cO={type:i.GenericReference,id:"time-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},dO={hidden:!1,required:!0,type:i.Property,id:uT,version:1,name:"time",description:null,index:0,dataType:lO,implements:null,static:!1,private:!1,abstract:!1,parent:cO},uO={type:i.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:i.Property,entityId:pT},pO={id:"disclamer-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uO},yO={type:i.GenericReference,id:"disclamer-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},hO={hidden:!1,required:!0,type:i.Property,id:pT,version:1,name:"disclamer",description:null,index:0,dataType:pO,implements:null,static:!1,private:!1,abstract:!1,parent:yO},fO={type:i.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:i.Property,entityId:yT},mO={id:"chart-name-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:fO},TO={type:i.GenericReference,id:"chart-name-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},EO={hidden:!1,required:!0,type:i.Property,id:yT,version:1,name:"chartName",description:null,index:0,dataType:mO,implements:null,static:!1,private:!1,abstract:!1,parent:TO},RO={type:i.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:i.Property,entityId:hT},bO={id:"bpi-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:IT,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:RO},gO={type:i.GenericReference,id:"bpi-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},vO={hidden:!1,required:!0,type:i.Property,id:hT,version:1,name:"bpi",description:null,implements:null,index:0,dataType:bO,static:!1,private:!1,abstract:!1,parent:gO},IO={type:i.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:i.Project,entityId:H},PT={type:i.CustomEntity,id:Ui,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[dO,hO,EO,vO],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:IO},PO={type:i.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},DO={id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:PO},AO={type:i.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:i.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},SO={type:i.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:i.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},OO={id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SO},CO={type:i.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},DT={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",dataType:OO,readsValue:CO,required:!0,index:0,parent:AO},BO={type:i.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},wO={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:i.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,dataType:DO,writesValues:[DT],required:!0,index:0,parent:BO},_O={type:i.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},MO={type:i.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},NO={type:i.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},AT={type:i.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[DT],calledByError:[],calledByEntry:[MO],calledBySuccess:[],throws:null,x:0,y:0,parent:NO},VO={type:i.FunctionDeclaration,id:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4",version:1,name:"Change owner of company",description:"Change the owner of the company to a new person",inputs:[wO],calls:[AT],index:0,collapsed:!1,implements:null,returnStatements:[AT],private:!1,x:0,y:0,parent:_O},$O={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},LO={type:i.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},GO={type:i.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:i.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},FO={type:i.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},UO={type:i.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:i.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},xO={id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:UO},bl={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:i.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:xO,readsValue:FO,required:!0,index:0,parent:GO},jO={type:i.GenericReference,id:"gov-company-registry-return-statement-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},gl={type:i.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[bl],calledByError:[],calledByEntry:[],calledBySuccess:[$O,jO],throws:null,x:0,y:0,parent:LO},kO={type:i.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},qO={type:i.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},ST={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:Go,name:null,description:null,dynamicArguments:[],readsValue:qO,defaultValue:null,parent:kO,index:2},JO={type:i.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},WO={id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:JO},HO={type:i.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},YO={type:i.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:i.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},zO={type:i.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:i.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},OT={type:i.VariableDeclaration,id:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a",version:1,name:"Is name registered",description:"Whether the company name is registered with the government company registry",dataType:WO,readsValue:YO,writesValues:[bl],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[zO],successCalls:[gl],errorCalls:[],internalCalls:[],x:0,y:0,parent:HO},ZO={type:i.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:i.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},XO={type:i.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},QO={type:i.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:Oa,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:i.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:D.String,valueAsType:null,parent:ZO,autogeneration:null},index:1,dynamicArguments:[],parent:XO},KO={type:i.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},eC={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:i.OutputMap,version:1,declaration:Ti,index:2,writesValues:[OT],parent:KO},tC={type:i.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},nC={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:i.InputMap,version:1,declaration:Sa,name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:null,parent:tC},rC={type:i.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},iC={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:i.InputMap,version:1,name:null,description:null,declaration:Ca,dynamicArguments:[],index:3,readsValue:null,defaultValue:null,parent:rC},aC={type:i.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},sC={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:i.InputMap,version:1,declaration:Ba,name:null,description:null,dynamicArguments:[],readsValue:null,index:4,defaultValue:null,parent:aC},oC={type:i.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},lC={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:i.OutputMap,version:1,declaration:wa,index:1,writesValues:[],parent:oC},cC={type:i.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},dC={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:i.OutputMap,version:1,declaration:Ti,index:0,writesValues:[],parent:cC},uC={type:i.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},pC={type:i.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},yC={type:i.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},hC={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},fC={type:i.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:i.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},mC={id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:fC},TC={type:i.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:i.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},CT={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:i.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:mC,required:!0,readsValue:null,index:0,parent:TC},EC={type:i.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[hC],throws:CT,x:0,y:0,parent:yC},RC={type:i.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},bC={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:i.OutputMap,declaration:Uo,version:1,writesValues:[CT],index:0,parent:RC},gC={type:i.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Ei,inputs:[nC,QO,ST,iC,sC],outputs:[dC,lC,eC],process:null,calledByError:[],calledByEntry:[uC],calledBySuccess:[],successCalls:[gl,OT],errorCalls:[EC],error:bC,dynamicArguments:[],x:0,y:0,parent:pC},vC={type:i.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:i.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},IC={type:i.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},PC={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:Pa,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:i.PrimitiveValue,version:1,value:"?name=",name:D.String,parent:vC,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:IC},DC={type:i.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},AC={type:i.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},SC={type:i.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},OC={id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SC},CC={type:i.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:i.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},BC={type:i.GenericReference,id:"assembled-query-string-called-by-ref",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},BT={type:i.VariableDeclaration,id:"83e12ebb-c958-4dee-b750-8ab9930f0f4e",version:1,name:"Query string",description:"The final, assembled query string that will be used in the HTTP request to the government company registry",dataType:OC,readsValue:CC,writesValues:[ST],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[BC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:AC},wC={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:i.OutputMap,version:1,writesValues:[BT],declaration:fi,index:0,parent:DC},_C={type:i.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},MC={type:i.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},NC={type:i.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:i.ArgumentDeclaration},VC={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},wT={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:i.InputMap,declaration:Da,name:null,description:null,readsValue:NC,dynamicArguments:[],defaultValue:null,index:1,parent:VC},$C={type:i.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:mi,version:1,inputs:[PC,wT],outputs:[wC],process:null,calledByError:[],calledByEntry:[_C],calledBySuccess:[],dynamicArguments:[],successCalls:[BT],errorCalls:[],error:null,x:0,y:0,parent:MC},LC={type:i.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:i.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},GC={id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LC},FC={type:i.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},_T={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:i.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:GC,required:!1,writesValues:[wT],index:0,parent:FC},UC={type:i.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:i.Project,entityId:H},MT={type:i.FunctionDeclaration,id:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d",version:1,name:"Check Gov Company Registry availability",description:"Check whether the company name is already registered in the government company registry, or it is available for a new company to use.",inputs:[_T],calls:[$C,gC],returnStatements:[gl],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:UC},xC={type:i.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},jC={type:i.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},kC={type:i.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},qC={type:i.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},NT={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:i.InputMap,declaration:_T,name:null,description:null,readsValue:kC,dynamicArguments:[],defaultValue:null,index:0,parent:qC},JC={type:i.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},WC={type:i.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:i.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},HC={id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WC},YC={type:i.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:i.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},zC={type:i.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},ZC={type:i.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},VT={type:i.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:HC,readsValue:YC,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[ZC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:zC},XC={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.OutputMap,version:1,declaration:bl,writesValues:[VT],index:0,parent:JC},QC={type:i.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:MT,inputs:[NT],outputs:[XC],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[xC],successCalls:[VT],errorCalls:[],error:null,x:0,y:0,parent:jC},KC={type:i.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},eB={type:i.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},tB={type:i.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},nB={type:i.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},$T={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:i.InputMap,declaration:zn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:tB,defaultValue:null,index:0,parent:nB},rB={type:i.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:zn,inputs:[$T],calledByError:[],calledByEntry:[KC],calledBySuccess:[],successCalls:[QC],errorCalls:[],x:0,y:0,parent:eB},iB={type:i.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},aB={type:i.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:i.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},sB={id:"d64152ea-831f-4426-9506-a39bfa170513",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aB},oB={type:i.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},lB={type:i.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},cB={type:i.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},LT={type:i.VariableDeclaration,id:"9c928995-0dd5-4f97-9962-56b343bc8a45",version:1,name:"New bank account",description:"The new entity value representing the new bank account of the company",dataType:sB,readsValue:lB,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[cB],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:oB},dB={type:i.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},uB={id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:dB},pB={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:i.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:uB,required:!0,index:1,writesValues:[LT],parent:iB},yB={type:i.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},hB={type:i.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},fB={type:i.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},mB={id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:fB},TB={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:i.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:mB,required:!0,index:0,writesValues:[$T,NT],parent:hB},EB={type:i.FunctionDeclaration,id:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84",version:1,name:"Company changed event",description:"The event that is triggered when a company is changed",returnStatements:[],collapsed:!1,inputs:[TB,pB],calls:[rB,LT],index:1,private:!1,implements:null,x:0,y:0,parent:yB},RB={type:i.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},bB={type:i.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-manager-property-id"},gB={id:"employee-manager-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:RB,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:bB},vB={type:i.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},IB={hidden:!1,required:!0,type:i.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,dataType:gB,abstract:!1,parent:vB},PB={type:i.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-start-date-property-id"},DB={id:"employee-start-date-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:sn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:PB},AB={type:i.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},SB={hidden:!1,required:!0,type:i.Property,id:"employee-start-date-property-id",version:1,name:"Start date",description:"The date the employee started working in the company",index:0,private:!1,static:!1,implements:null,dataType:DB,abstract:!1,parent:AB},OB={type:i.GenericReference,id:"employee-department-property-ref-id",entityType:i.Property,entityId:"employee-department-property-id"},CB={id:"employee-department-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:OB},BB={type:i.GenericReference,id:"employee-department-property-parent-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},wB={hidden:!1,required:!0,type:i.Property,id:"employee-department-property-id",version:1,name:"Department",description:"The department the employee works in, from a list of departments in the company",index:0,implements:null,static:!1,private:!1,dataType:CB,abstract:!1,parent:BB},_B={type:i.GenericReference,id:"employee-prototype-parent-ref-id",entityType:i.Project,entityId:H},Ot={type:i.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[wB,SB,IB],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[ut],x:0,y:0,parent:_B},MB={type:i.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:i.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},NB={id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:MB},VB={type:i.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},$B={hidden:!1,required:!0,type:i.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,implements:null,dataType:NB,abstract:!1,parent:VB},LB={type:i.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:i.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},GB={id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kr,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LB},FB={type:i.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},vl={hidden:!1,required:!0,type:i.Property,id:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",version:1,name:"Bank account",description:"The bank account of the company",index:1,implements:null,static:!1,private:!1,dataType:GB,abstract:!1,parent:FB},UB={type:i.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:i.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},xB={id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:UB},jB={type:i.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},kB={hidden:!1,required:!0,type:i.Property,id:"19a31727-1fba-40a5-be25-18e0f149d5cb",version:1,name:"Company Owner",description:"The person that owns the company",index:2,static:!1,implements:null,dataType:xB,private:!0,abstract:!1,parent:jB},qB={type:i.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:i.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},JB={id:"ad44250b-40c2-48f7-a480-381fa938f562",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ot,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qB},WB={type:i.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},HB={hidden:!1,required:!0,type:i.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:JB,implements:null,private:!0,static:!1,abstract:!1,parent:WB},YB={type:i.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:i.Project,entityId:H},bt={type:i.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[$B,vl,kB,HB],static:!1,abstract:!1,abstractMethods:[],methods:[VO,EB],extends:[],implements:[Ve],x:0,y:0,parent:YB},zB={type:i.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:i.Project,entityId:H},Il={type:i.FunctionDeclaration,id:"0f89260c-8c58-4639-8629-d9ea5ab40ba7",version:1,name:"Show popup",description:null,inputs:[],calls:[],returnStatements:[],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:zB};i.GenericReference,i.DataType;const ZB={id:"cron-job-entity-expression-property-ref-id",type:i.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:i.Property},XB={id:"cron-job-entity-expression-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:ZB},QB={id:"cron-job-entity-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.CustomEntity},KB={hidden:!1,required:!0,id:"cron-job-entity-expression-property-id",type:i.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:XB,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:QB},ew={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:i.GenericReference,entityId:"show-popup-func-decl-id",entityType:i.FunctionDeclaration},tw={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:i.FunctionDeclaration},nw={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:i.FunctionCall,declaration:Il,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[ew],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:tw},rw={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.CustomEntity},iw={id:"cron-job-entity-trigger-func-decl-id",version:1,type:i.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:Yo,calls:[nw],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:rw},aw={id:"cron-job-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},sw={id:"cron-job-entity-id",version:1,type:i.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[KB],static:!0,abstract:!1,abstractMethods:[],extends:[zo],implements:[],methods:[iw],x:0,y:0,parent:aw},ow={type:i.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:i.Project,entityId:H},lw={type:i.CustomEntity,id:"6f0908c2-09c6-4a8b-8f43-d2467fe6fb39",version:1,name:"Get bank all bank accounts",description:null,properties:[],static:!0,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[Na],x:0,y:0,parent:ow},GT="f558fbf8-67de-4545-9804-6ae621e0b2d4",cw={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},dw={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},uw={id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:cw,autogeneration:null,valueAsType:null},parent:dw},pw={id:"getCompanyByIdEndpointReachedEntityEventRef",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},yw={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},hw={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},fw={id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:yw,autogeneration:null,valueAsType:null},parent:hw},mw={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:fw,required:!0,index:0,parent:pw},Tw={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},Ew={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:i.ArgumentDeclaration,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",writesValues:[],dataType:uw,required:!0,index:1,parent:Tw},Rw={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},bw={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},gw={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},vw={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:U,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:bw,autogeneration:null,valueAsType:null},parent:gw},Iw={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:vw,required:!0,index:2,parent:Rw},Pw={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},Dw={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},Aw={id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:Dw},Sw={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:Aw,index:3,required:!0,parent:Pw},Ow={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},Cw={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Ow},Bw={id:"getCompanyByIdEndpointReturnStatementRef",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},ww={isError:!1,id:"getCompanyByIdEndpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ReturnDeclaration,name:"Response code",dataType:Cw,readsValue:null,required:!0,index:0,parent:Bw},_w={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},Mw={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},Nw={id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:_w,autogeneration:null,valueAsType:null},parent:Mw},Vw={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},$w={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ReturnDeclaration,name:"Response headers",dataType:Nw,readsValue:null,required:!0,index:1,parent:Vw},Lw={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},Gw={id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:Lw},Fw={id:"getCompanyByIdEndpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},Uw={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ReturnDeclaration,name:"Response body",dataType:Gw,readsValue:null,required:!0,index:2,parent:Fw},xw={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:i.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:i.FunctionDeclaration},jw={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},kw={id:"getCompanyByIdEndpointReturnStatement",type:i.ReturnStatement,version:1,outputs:[ww,$w,Uw],calledByError:[],calledByEntry:[xw],calledBySuccess:[],throws:null,x:0,y:0,parent:jw},qw={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:GT},Jw={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:i.FunctionDeclaration,inputs:[mw,Ew,Iw,Sw],returnStatements:[kw],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:qo,index:0,private:!1,x:0,y:0,parent:qw},Ww={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},Hw={id:"getCompanyByIdEndpointPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointPathProperty"},Yw={id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.String,value:"/company/{id}",parent:Ww,valueAsType:null,autogeneration:null},parent:Hw},zw={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},Zw={hidden:!1,required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:jo,dataType:Yw,index:1,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:zw},Xw={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},Qw={id:"getCompanyByIdEndpointMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointMethodProperty"},Kw={id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:In,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,value:"GET",name:D.Enum,parent:Xw,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Qw},e_={id:"getCompanyByIdEndpointBaseEntityRefThree",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},t_={hidden:!1,required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:ko,index:0,dataType:Kw,description:null,parent:e_},n_={type:i.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:i.Project,entityId:H},r_={type:i.CustomEntity,id:GT,version:1,name:"Get given company data by id",description:null,properties:[Zw,t_],methods:[Jw],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[Na],x:0,y:0,parent:n_},i_={id:"product-prototype-database-property-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-id",entityType:i.Property},a_={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:i.DataType},s_={id:"product-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Pn,asType:!1,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.EntityTemplate,valueAsType:Tl,autogeneration:null,parent:a_},parent:i_},o_={id:"product-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.CustomEntity},l_={hidden:!1,required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:bi,static:!0,index:0,dataType:s_,description:"The database that the entity belongs to.",parent:o_},c_={type:i.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:i.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},d_={id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:c_},u_={type:i.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:i.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},p_={hidden:!1,required:!0,type:i.Property,id:"d519c26a-15b8-40d8-ad09-13fa9342e9ba",version:1,name:"Name",description:"The name of the product",index:0,implements:null,static:!1,private:!1,dataType:d_,abstract:!1,parent:u_},y_={type:i.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:i.Project,entityId:H},h_={type:i.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Ve],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[l_,p_],methods:[],x:0,y:0,parent:y_},xi="project-loaded-event-id",zt="get-bitcoin-price-http-call-operation-id",FT="get-bitcoin-price-http-call-response-body-id",hs="validate-bitcoin-price-response-operation-ids",f_={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:FT},m_={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:i.Operation,entityId:hs},UT={id:"validate-bitcoin-data-to-validate-input-map-id",type:i.InputMap,version:1,declaration:Hn.fixedArguments[1],name:null,description:null,readsValue:f_,defaultValue:null,dynamicArguments:[],index:0,parent:m_},T_={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},E_={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:i.Operation,entityId:hs},R_={id:"validate-bitcoin-type-to-match-input-map-id",type:i.InputMap,version:1,declaration:Hn.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:i.PrimitiveValue,version:1,name:D.EntityTemplate,valueAsType:PT,value:null,parent:T_,autogeneration:null},dynamicArguments:[],index:0,parent:E_},b_={type:i.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:i.Operation,entityId:hs},g_={id:"validate-bitcoin-validated-entity-output-map-id",type:i.OutputMap,version:1,declaration:Hn.fixedReturns[0],writesValues:[],index:0,parent:b_},v_={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:i.GlobalEvent,entityId:xi},I_={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:i.Operation,entityId:zt},P_={type:i.Operation,id:hs,version:1,declaration:Hn,inputs:[R_,UT],outputs:[g_],process:null,dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[I_],parent:v_},D_={type:i.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:i.FunctionCall,entityId:zt},A_={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:i.InputMap,declaration:Sa,name:null,description:null,readsValue:null,defaultValue:null,dynamicArguments:[],index:0,parent:D_},S_={type:i.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:i.FunctionCall,entityId:zt},O_={type:i.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:i.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},C_={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:i.InputMap,declaration:Oa,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:i.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:D.String,parent:O_,valueAsType:null,autogeneration:null},index:1,dynamicArguments:[],parent:S_},B_={type:i.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:i.FunctionCall,entityId:zt},w_={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:i.InputMap,declaration:Ca,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:2,parent:B_},__={type:i.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:i.FunctionCall,entityId:zt},M_={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:i.InputMap,declaration:Ba,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:3,parent:__},N_={type:i.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:i.FunctionCall,entityId:zt},V_={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:i.OutputMap,declaration:wa,writesValues:[],index:1,parent:N_},$_={type:i.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:i.FunctionCall,entityId:zt},L_={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:i.OutputMap,declaration:Fo,writesValues:[],index:0,parent:$_},G_={type:i.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:i.FunctionCall,entityId:zt},F_={id:FT,type:i.OutputMap,version:1,declaration:Ti,writesValues:[UT],index:2,parent:G_},U_={type:i.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:i.FunctionDeclaration,entityId:zt},x_={type:i.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:i.GlobalEvent,entityId:xi},j_={type:i.Operation,id:zt,version:1,declaration:Ei,inputs:[A_,C_,w_,M_],outputs:[L_,V_,F_],process:null,parent:x_,calledByError:[],calledByEntry:[U_],calledBySuccess:[],dynamicArguments:[],successCalls:[P_],errorCalls:[],error:null,x:0,y:0},k_={type:i.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:i.GlobalEvent,entityId:xi},q_={type:i.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:i.GlobalEvent,entityId:xi},J_={process:null,type:i.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:Il,inputs:[],outputs:[],calledByError:[],calledByEntry:[k_],calledBySuccess:[],parent:q_,successCalls:[],errorCalls:[],error:null,x:0,y:0},W_={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:i.GenericReference,entityType:i.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},H_={type:i.GlobalEvent,id:xi,version:1,name:rn.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:Fa,parent:W_,inputs:[],calls:[J_,j_],x:0,y:0},$t="abort-execution-func-declaration-id",ji="abort-execution-func-exec-var-declaration-id",fs="abort-execution-func-small-wait-op-id",Pl="abort-execution-func-long-wait-op-id",xT="abort-execution-func-long-wait-process-output-id",jT="abort-execution-func-exec-var-instance-write-id",kT="abort-execution-func-long-wait-return-stmt-id",qT="abort-execution-func-small-wait-return-stmt-id",Y_="abort-execution-func-exec-var-instance-abort-call-id",Dl="abort-execution-func-exec-var-instance-abort-internal-call-id",JT="abort-execution-func-exec-second-wait-op-id",z_={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},Z_={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},X_={id:"short-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:Z_},constant:!1,parent:z_},Q_={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:qT},K_={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 1",description:"A random string that is returned by the function",dataType:X_,readsValue:null,required:!0,index:0,parent:Q_},eM={type:i.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:fs},tM={type:i.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:$t},WT={type:i.ReturnStatement,id:qT,version:1,outputs:[K_],calledByError:[],calledByEntry:[],calledBySuccess:[eM],throws:null,x:0,y:0,parent:tM},nM={type:i.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"second-wait-argument-map-id"},rM={type:i.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:JT},iM={id:"second-wait-argument-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:i.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:D.Number,parent:nM},index:0,parent:rM},aM={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:$t},sM={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.InternalCall,entityId:Dl},oM={id:JT,type:i.Operation,version:1,declaration:ct,inputs:[iM],dynamicArguments:[],outputs:[],process:null,successCalls:[WT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[sM],error:null,parent:aM},lM={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:i.VariableInstance,entityId:jT},cM={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:i.Operation,entityId:fs},dM={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:$t},uM={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:ji},pM={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:i.InternalCall,entityId:Dl},yM={id:Y_,type:i.VariableInstance,version:1,declaration:uM,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[pM],parent:dM},HT={id:Dl,type:i.InternalCall,version:1,inputs:[],outputs:[],declaration:Zo,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[lM,cM],successCalls:[oM],errorCalls:[],error:null,index:0,parent:yM},hM={type:i.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:$t},fM={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:ji},mM={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:i.FunctionDeclaration,entityId:$t},TM={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:ji},EM={type:i.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:i.OutputMap,entityId:xT},Al={id:jT,type:i.VariableInstance,version:1,declaration:TM,inputs:[],outputs:[],calledByError:[],calledByEntry:[mM],calledBySuccess:[fM],successCalls:[HT],errorCalls:[],x:0,y:0,readsValue:EM,writesValues:[],internalCalls:[],parent:hM},RM={type:i.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:ji};i.GenericReference,i.DataType;const bM={id:"abort-exec-func-var-decl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Xo,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:RM,defaultValue:null},gM={type:i.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:$t},vM={type:i.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:$t},IM={id:ji,type:i.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:bM,inputs:[],outputs:[],calledByError:[],calledByEntry:[vM],calledBySuccess:[],successCalls:[Al],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:gM},PM={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},DM={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},AM={id:"long-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:DM},constant:!1,parent:PM},SM={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:kT},OM={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 2",description:"A random string that is returned by the function",dataType:AM,readsValue:null,required:!0,index:0,parent:SM},CM={type:i.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:Pl},BM={type:i.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:$t},YT={type:i.ReturnStatement,id:kT,version:1,outputs:[OM],calledByError:[],calledByEntry:[],calledBySuccess:[CM],throws:null,x:0,y:0,parent:BM},wM={type:i.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"long-argument-map-id"},zT={type:i.GenericReference,id:"long-argument-map-parent-ref-id",entityType:i.Operation,entityId:Pl},_M={id:"long-argument-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:i.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:D.Number,parent:wM},index:0,parent:zT},MM={type:i.GenericReference,id:"long-parent-ref-id",entityType:i.FunctionDeclaration,entityId:$t},NM={type:i.GenericReference,id:"long-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:$t},VM={id:xT,type:i.OutputMap,version:1,declaration:Ko,writesValues:[Al],index:0,parent:zT},$M={id:Pl,type:i.Operation,version:1,declaration:ct,inputs:[_M],dynamicArguments:[],outputs:[],process:VM,successCalls:[YT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[NM],calledBySuccess:[],error:null,parent:MM},LM={type:i.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"small-wait-argument-map-id"},GM={type:i.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:fs},FM={id:"small-wait-argument-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:i.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:D.Number,parent:LM},index:0,parent:GM},UM={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:$t},xM={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:$t},jM={id:fs,type:i.Operation,version:1,declaration:ct,inputs:[FM],dynamicArguments:[],outputs:[],process:null,successCalls:[HT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[xM],calledBySuccess:[],error:null,parent:UM},kM={type:i.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:i.Project,entityId:H},ZT={id:"abort-execution-func-decl-id",type:i.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[YT,WT],calls:[jM,IM,Al,$M],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:kM},qM={type:i.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:i.Project,entityId:H},JM={id:"call-execution-abort-func-id",type:i.FunctionCall,version:1,declaration:ZT,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:qM},Sl="manual-hello-world-loop-func-decl-id",XT="manual-hello-world-loop-func-return-statement-id",Zt="manual-hello-world-loop-id",ki="manual-hello-world-loop-body-id",Ol="manual-hello-world-loop-break-statement-id",qi="manual-hello-world-loop-current-iteration-number-output-map-id",Cl="manual-hello-world-loop-previous-iterations-results-output-map-id",Bl="assembled-hello-world-text-output-id",QT="assembled-hello-world-list-output-id",Ji="iteration-number-is-equal-or-greater-than-10-condition-id",ms="join-hello-world-and-number-operation-id",Ts="append-string-to-list-operation-id",KT="hello-world-loop-output-map-id",WM={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:i.ReturnStatement,entityId:XT},HM={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:i.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},YM={id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:HM},zM={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:i.OutputMap,entityId:KT},eE={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:i.ReturnDeclaration,name:"Results",description:null,dataType:YM,readsValue:zM,required:!0,index:0,parent:WM},ZM={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:i.Loop,entityId:Zt},XM={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:i.FunctionDeclaration,entityId:Sl},tE={type:i.ReturnStatement,id:XT,version:1,outputs:[eE],calledByError:[],calledByEntry:[],calledBySuccess:[ZM],parent:XM,throws:null,x:0,y:0},QM={type:i.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:i.BreakStatement,entityId:Ol},KM={type:i.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:i.OutputMap,entityId:Bl},nE={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,dataType:null,readsValue:KM,required:!0,index:0,parent:QM},eN={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:qi},tN={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-ref-id",entityType:i.BreakStatement,entityId:Ol},rE={isError:!1,id:"hello-world-loop-break-statement-counter-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration counter",description:null,dataType:null,readsValue:eN,required:!0,index:1,parent:tN},nN={type:i.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:i.Condition,entityId:Ji},rN={type:i.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:i.Loop,entityId:Zt},iE={type:i.BreakStatement,id:Ol,version:1,outputs:[nE,rE],calledByError:[],calledByEntry:[],calledBySuccess:[nN],parent:rN,throws:null,x:0,y:0},iN={type:i.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:i.ContinueStatement,entityId:"hello-world-loop-continue-statement"},aN={type:i.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:i.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},sN={id:"hello-world-loop-continue-statement-output-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aN},oN={type:i.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:i.OutputMap,entityId:Bl},aE={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,dataType:sN,readsValue:oN,required:!0,index:0,parent:iN},lN={type:i.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:i.Condition,entityId:Ji},cN={type:i.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:i.Loop,entityId:Zt},sE={type:i.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[aE],calledBySuccess:[],calledByError:[lN],calledByEntry:[],parent:cN,throws:null,x:0,y:0};i.GenericReference,i.InputMap;const dN={type:i.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:i.Operation,entityId:Ts},uN={type:i.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Cl},oE={id:"append-string-to-list-base-string-map-id",type:i.InputMap,version:1,declaration:wo,name:null,description:null,readsValue:uN,defaultValue:null,dynamicArguments:[],index:0,parent:dN},pN={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:Ts},yN={id:QT,type:i.OutputMap,version:1,writesValues:[nE],declaration:fi,index:0,parent:pN},hN={type:i.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:i.Condition,entityId:Ji},fN={type:i.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:QT},mN={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:Ts},lE={id:"latest-string-to-add-input-map-id",version:1,type:i.InputMap,declaration:_o,name:null,description:null,readsValue:fN,dynamicArguments:[],defaultValue:null,index:1,parent:mN},TN={type:i.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Zt},EN={type:i.Operation,id:Ts,declaration:Aa,version:1,inputs:[oE,lE],outputs:[yN],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[hN],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:TN},RN={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:ki},bN={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:i.Loop,entityId:Zt},gN={type:i.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:qi},cE={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:i.Condition,entityId:Ji},vN={id:"current-iteration-number-to-check-map-id",version:1,type:i.InputMap,declaration:Vr.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:gN,index:1,defaultValue:null,parent:cE},IN={type:i.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"max-num-iterations-value-map-id"},PN={id:"max-num-iterations-value-map-id",version:1,type:i.InputMap,declaration:Vr.fixedArguments[1],name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:10,autogeneration:null,valueAsType:null,parent:IN},parent:cE},DN={type:i.Condition,id:Ji,version:1,declaration:Vr,inputs:[PN,vN],calledByError:[],calledByEntry:[RN],calledBySuccess:[],successCalls:[iE,EN],errorCalls:[sE],x:0,y:0,parent:bN},AN={type:i.GenericReference,id:"base-string-map-ref-id",entityType:i.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},SN={type:i.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:i.Operation,entityId:ms},ON={id:"join-hello-world-and-number-base-string-map-id",type:i.InputMap,version:1,declaration:Pa,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:i.PrimitiveValue,version:1,value:"Hello world ",name:D.String,parent:AN,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:SN},CN={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:ms},BN={id:Bl,type:i.OutputMap,version:1,writesValues:[lE,aE],declaration:fi,index:0,parent:CN},wN={type:i.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:ki},_N={type:i.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:qi},MN={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:ms},dE={id:"current-iteration-number-input-map-id",version:1,type:i.InputMap,declaration:Da,name:null,description:null,readsValue:_N,dynamicArguments:[],defaultValue:null,index:1,parent:MN},NN={type:i.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Zt},VN={type:i.Operation,id:ms,declaration:mi,version:1,inputs:[ON,dE],outputs:[BN],process:null,calledByError:[],calledByEntry:[wN],calledBySuccess:[],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:NN},$N={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:Cl,entityType:i.ArgumentDeclaration},LN={id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:$N},GN={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:i.GenericReference,entityId:ki,entityType:i.FunctionDeclaration},FN={id:Cl,type:i.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:LN,writesValues:[oE],index:1,parent:GN},UN={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:i.GenericReference,entityId:ki,entityType:i.FunctionDeclaration},xN={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:qi,entityType:i.ArgumentDeclaration};i.DataType;const jN={id:qi,type:i.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,dataType:null,writesValues:[dE,rE],index:0,parent:UN},kN={id:"manual-flow-loop-body-parent-ref-id",type:i.GenericReference,entityId:Zt,entityType:i.Loop},qN={id:ki,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[jN,FN],calls:[DN,VN],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:kN},JN={type:i.GenericReference,id:"hello-world-loop-iteration-result-inline-output-declaration-parent-ref-id",entityType:i.Loop,entityId:Zt},uE={id:"hello-world-loop-iteration-result-inline-output-declaration-id",version:1,type:i.ValueDescriptor,name:"Iteration result",description:null,dataType:null,required:!0,index:0,parent:JN},WN={type:i.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:i.Loop,entityId:Zt},HN={type:i.OutputMap,id:KT,version:1,declaration:uE,writesValues:[eE],index:0,parent:WN},YN={id:"manual-hello-world-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},zN={id:"manual-hello-world-loop-called-by-ref-id",type:i.GenericReference,entityId:Sl,entityType:i.FunctionDeclaration},ZN={id:Zt,type:i.Loop,version:1,declaration:xo,inputs:[],outputsDeclarations:[uE],outputs:[HN],body:qN,successCalls:[tE],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[zN],calledBySuccess:[],breakStatements:[iE],continueStatements:[sE],x:0,y:0,parent:YN},XN={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},pE={type:i.FunctionDeclaration,id:Sl,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[ZN],returnStatements:[tE],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:XN},QN={type:i.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:i.Project,entityId:H},KN={id:"call-hello-world-loop-id",type:i.FunctionCall,version:1,declaration:pE,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:QN},dn="company-dto-function-declaration-id",wl="company-dto-func-declaration-argument-dcl-id",Xt="company-dto-function-company-variable-id",Mn="company-dto-function-company-dto-variable-id",Jr="iterate-over-employee-list-loop-id",yE="iterate-over-employee-list-loop-employee-dto-output-map-id",_l="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",Wi="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",hE="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",e0="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",fE="iterate-over-employee-list-continue-statement-id",Es="iterate-over-employee-list-loop-body-id",mE="company-dto-func-declaration-return-statement-id",TE="company-dto-func-declaration-return-decl-id",EE="company-dto-func-declaration-company-variable-id-output-map-id",RE="company-dto-func-declaration-company-variable-employess-output-map-id",bE="company-dto-func-declaration-company-variable-name-output-map-id",t0="company-dto-func-declaration-company-dto-variable-input-map-id",n0="company-dto-func-declaration-company-dto-variable-employess-input-map-id",r0="company-dto-func-declaration-company-dto-variable-name-input-map-id",Rs="company-dto-func-declaration-owner-variable-id",i0="company-dto-func-declaration-company-dto-variable-owner-input-map-id",gE="company-dto-func-declaration-company-variable-owner-output-map-id",vE="company-dto-func-declaration-owner-variable-id-output-map-id",bs="company-dto-func-declaration-bank-account-variable-id",a0="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",IE="company-dto-func-declaration-company-variable-bank-account-output-map-id",PE="company-dto-func-declaration-bank-account-variable-id-output-map-id",s0={type:i.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:TE},o0={id:"company-dto-func-returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:s0},l0={type:i.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:mE},c0={type:i.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:Mn},DE={isError:!1,id:TE,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:o0,readsValue:c0,required:!0,index:0,parent:l0},d0={type:i.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:Mn},u0={type:i.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn},Ml={type:i.ReturnStatement,id:mE,version:1,outputs:[DE],calledByError:[],calledByEntry:[],calledBySuccess:[d0],throws:null,x:0,y:0,parent:u0},p0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:vE},y0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Mn},AE={id:i0,type:i.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,dynamicArguments:[],index:5,readsValue:p0,parent:y0},h0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:PE},f0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Mn},SE={id:a0,type:i.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:h0,parent:f0},m0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:bE},T0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Mn},OE={id:r0,type:i.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:m0,parent:T0},E0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:yE},R0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Mn},CE={id:n0,type:i.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:E0,parent:R0},b0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:EE},g0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Mn},BE={id:t0,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,dynamicArguments:[],index:1,readsValue:b0,parent:g0},v0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn},I0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:bs},P0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:Rs},D0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:i.VariableDeclaration,entityId:Jr},Nl={id:Mn,type:i.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[I0,P0,D0],successCalls:[Ml],errorCalls:[],readsValue:null,writesValues:[DE],inputs:[BE,OE,SE,AE,CE],outputs:[],internalCalls:[],parent:v0,x:0,y:0},er="employee-dto-func-declaration-id",Vl="employee-dto-func-declaration-argument-dcl-id",wE="employee-dto-func-declaration-return-statement-id",_E="employee-dto-func-declaration-return-decl-id",tr="employee-dto-func-declaration-employee-variable-id",nr="employee-dto-func-declaration-employee-dto-variable-id",gs="employee-dto-func-declaration-manager-variable-id",ME="employee-dto-func-declaration-employee-variable-id-output-map-id",NE="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",VE="employee-dto-func-declaration-employee-variable-department-output-map-id",$E="employee-dto-func-declaration-employee-variable-manager-output-map-id",LE="employee-dto-func-declaration-manager-variable-id-output-map-id",A0="employee-dto-func-declaration-employee-dto-variable-input-map-id",S0="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",O0="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",C0="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",B0={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:_E},w0={id:"employee-dto-func-returned-employee-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:B0},_0={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:wE},M0={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:nr},GE={isError:!1,id:_E,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:w0,readsValue:M0,required:!0,index:0,parent:_0},N0={type:i.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:nr},V0={type:i.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er},$l={type:i.ReturnStatement,id:wE,version:1,outputs:[GE],calledByError:[],calledByEntry:[],calledBySuccess:[N0],throws:null,x:0,y:0,parent:V0},$0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:LE},L0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},FE={id:C0,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:$0,parent:L0},G0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:VE},F0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},UE={id:O0,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:G0,parent:F0},U0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:NE},x0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},xE={id:S0,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:U0,parent:x0},j0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:ME},k0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},jE={id:A0,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:j0,parent:k0},q0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er},J0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:gs},W0={id:nr,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[J0],successCalls:[$l],errorCalls:[],readsValue:null,writesValues:[GE],inputs:[jE,xE,UE,FE],outputs:[],internalCalls:[],parent:q0,x:0,y:0},H0={type:i.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:gs},Y0={id:LE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[FE],parent:H0},z0={type:i.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:gs},Z0={id:"employee-dto-func-manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ot,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:z0,defaultValue:null},X0={type:i.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:$E},Q0={type:i.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er};i.GenericReference,i.VariableDeclaration;const kE={id:gs,type:i.VariableDeclaration,version:1,name:"Manager",dataType:Z0,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[W0],errorCalls:[],readsValue:X0,writesValues:[],inputs:[],outputs:[Y0],internalCalls:[],parent:Q0,x:0,y:0},K0={type:i.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},e1={id:$E,type:i.OutputMap,version:1,declaration:Ot.properties[2],index:3,writesValues:[kE],parent:K0},t1={type:i.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},n1={id:VE,type:i.OutputMap,version:1,declaration:Ot.properties[0],index:2,writesValues:[UE],parent:t1},r1={type:i.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},i1={id:NE,type:i.OutputMap,version:1,declaration:ut.properties[1],index:1,writesValues:[xE],parent:r1},a1={type:i.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},s1={id:ME,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[jE],parent:a1},o1={type:i.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},l1={id:"employee-dto-func-employee-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ot,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:o1,defaultValue:null},c1={type:i.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er},d1={type:i.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Vl},u1={type:i.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:er},qE={id:tr,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:l1,description:"A variable holding a company employee",calledByError:[],calledByEntry:[u1],calledBySuccess:[],successCalls:[kE],errorCalls:[],readsValue:d1,writesValues:[],inputs:[],outputs:[s1,i1,n1,e1],internalCalls:[],parent:c1,x:0,y:0},p1={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:Vl,entityType:i.ArgumentDeclaration},y1={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:Ot,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:p1,defaultValue:null},h1={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:er,entityType:i.FunctionDeclaration},f1={type:i.ArgumentDeclaration,id:Vl,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,dataType:y1,index:0,writesValues:[qE],parent:h1},m1={type:i.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},Ll={type:i.FunctionDeclaration,id:er,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[f1],calls:[qE],implements:null,returnStatements:[$l],collapsed:!1,private:!1,x:0,y:0,parent:m1},T1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:hE,entityType:i.ReturnDeclaration},E1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Ot,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:T1},R1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.OutputMap},b1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:i.GenericReference,entityId:fE,entityType:i.ContinueStatement},JE={isError:!1,id:hE,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:R1,dataType:E1,required:!0,index:0,parent:b1},g1={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.FunctionCall},v1={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},WE={id:fE,type:i.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[g1],outputs:[JE],throws:null,x:0,y:0,parent:v1},I1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.FunctionCall},P1={id:e0,type:i.OutputMap,version:1,declaration:$l.outputs[0],writesValues:[JE],index:0,parent:I1},D1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:i.GenericReference,entityId:_l,entityType:i.ArgumentDeclaration},A1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.FunctionCall},HE={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Ll.inputs[0],readsValue:D1,index:0,defaultValue:null,dynamicArguments:[],parent:A1},S1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:i.GenericReference,entityId:Es,entityType:i.FunctionDeclaration},O1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:i.GenericReference,entityId:Es,entityType:i.FunctionDeclaration},C1={id:Wi,type:i.FunctionCall,version:1,declaration:Ll,inputs:[HE],process:null,outputs:[P1],calledByError:[],calledByEntry:[S1],calledBySuccess:[],successCalls:[WE],errorCalls:[],error:null,x:0,y:0,parent:O1},B1={type:i.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:_l,entityType:i.ArgumentDeclaration},w1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:Ot,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:B1},_1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Es,entityType:i.FunctionDeclaration},M1={id:_l,type:i.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:w1,required:!0,index:0,writesValues:[HE],parent:_1},N1={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},V1={id:Es,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[M1],calls:[C1],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:N1},$1={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},L1={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:i.GenericReference,entityId:RE,entityType:i.OutputMap},YE={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Yn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:L1,index:0,parent:$1},G1={id:"iterate-over-employee-list-loop-parent-ref-id",type:i.GenericReference,entityId:dn,entityType:i.FunctionDeclaration},F1={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},U1={id:yE,type:i.OutputMap,version:1,declaration:Yn.fixedReturns[0],writesValues:[CE],index:0,parent:F1},x1={type:i.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Xt},j1={id:Jr,type:i.Loop,version:1,declaration:Yn,inputs:[YE],successCalls:[Nl],errorCalls:[],outputsDeclarations:[],outputs:[U1],body:V1,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[x1],breakStatements:[],continueStatements:[WE],error:null,x:0,y:0,parent:G1},k1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:bs},q1={id:PE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[SE],parent:k1},J1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:bs},W1={id:"company-dto-func-bank-account-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:J1,defaultValue:null},H1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:IE},Y1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn};i.GenericReference,i.VariableDeclaration;const zE={id:bs,type:i.VariableDeclaration,version:1,name:"Bank account",dataType:W1,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Nl],errorCalls:[],readsValue:H1,writesValues:[],inputs:[],outputs:[q1],internalCalls:[],parent:Y1,x:0,y:0},z1={type:i.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Rs},Z1={id:vE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[AE],parent:z1},X1={type:i.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Rs},Q1={id:"company-dto-func-owner-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:X1,defaultValue:null},K1={type:i.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:gE},eV={type:i.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn};i.GenericReference,i.VariableDeclaration;const ZE={id:Rs,type:i.VariableDeclaration,version:1,name:"Owner",dataType:Q1,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Nl],errorCalls:[],readsValue:K1,writesValues:[],inputs:[],outputs:[Z1],internalCalls:[],parent:eV,x:0,y:0},tV={type:i.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},nV={id:gE,type:i.OutputMap,version:1,declaration:bt.properties[2],index:4,writesValues:[ZE],parent:tV},rV={type:i.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},iV={id:IE,type:i.OutputMap,version:1,declaration:bt.properties[2],index:3,writesValues:[zE],parent:rV},aV={type:i.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},sV={id:bE,type:i.OutputMap,version:1,declaration:bt.properties[0],index:2,writesValues:[OE],parent:aV},oV={type:i.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},lV={id:RE,type:i.OutputMap,version:1,declaration:bt.properties[3],index:1,writesValues:[YE],parent:oV},cV={type:i.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},dV={id:EE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[BE],parent:cV},uV={type:i.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},pV={id:"company-dto-func-company-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:uV,defaultValue:null},yV={type:i.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn},hV={type:i.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:wl},fV={type:i.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:dn},XE={id:Xt,type:i.VariableDeclaration,version:1,name:"Company",dataType:pV,description:"A variable holding a company",calledByError:[],calledByEntry:[fV],calledBySuccess:[],successCalls:[zE,ZE,j1],errorCalls:[],readsValue:hV,writesValues:[],inputs:[],outputs:[dV,lV,sV,iV,nV],internalCalls:[],parent:yV,x:0,y:0},mV={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:wl,entityType:i.ArgumentDeclaration},TV={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:bt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:mV,defaultValue:null},EV={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:dn,entityType:i.FunctionDeclaration},RV={type:i.ArgumentDeclaration,id:wl,version:1,name:"Company",description:"The company to create a DTO for",required:!0,dataType:TV,index:0,writesValues:[XE],parent:EV},bV={type:i.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},Gl={type:i.FunctionDeclaration,id:dn,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[RV],calls:[XE],implements:null,index:null,returnStatements:[Ml],collapsed:!1,private:!1,x:0,y:0,parent:bV},Hi="exec-in-parallel-operation-call-id",Yi="exec-sequentially-operation-call-id",pt="concurrency-and-wait-function-declaration-id",QE="concurrency-and-wait-return-statement-id",KE="concurrency-and-wait-return-declaration-id",Fl="exec-in-parallel-argument-map-id",eR="exec-sequentially-argument-map-id",Ul="wait-for-2-seconds-operation-id",tR="wait-for-2-seconds-argument-map-id",xl="map-company-dto-function-call-id",nR="map-company-dto-function-call-company-dto-output-map-id",zi="company-dto-variable-one-id",jl="company-dto-variable-one-instance-id",gV="company-dto-variable-two-id",vV={type:i.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:KE},IV={id:"returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vV},PV={type:i.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:QE},DV={type:i.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:zi},rR={isError:!1,id:KE,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:IV,readsValue:DV,required:!0,index:0,parent:PV},AV={type:i.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:Ul},SV={type:i.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},iR={type:i.ReturnStatement,id:QE,version:1,outputs:[rR],calledByError:[],calledByEntry:[],calledBySuccess:[AV],throws:null,x:0,y:0,parent:SV},OV={type:i.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:i.VariableInstance,entityId:jl},CV={type:i.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:i.VariableInstance,entityId:jl},BV={type:i.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},aR={id:gV,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[OV],internalCalls:[],writesValues:[rR],readsValue:CV,x:0,y:0,parent:BV},wV={type:i.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:i.VariableDeclaration,entityId:zi},_V={type:i.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:zi},MV={type:i.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},NV={type:i.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:zi},sR={id:jl,type:i.VariableInstance,version:1,declaration:NV,inputs:[],outputs:[],successCalls:[aR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[wV],internalCalls:[],writesValues:[aR],readsValue:_V,x:0,y:0,parent:MV},VV={type:i.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:i.FunctionCall,entityId:xl},$V={type:i.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:i.OutputMap,entityId:nR},LV={type:i.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},oR={id:zi,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[sR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[VV],internalCalls:[],writesValues:[sR],readsValue:$V,x:0,y:0,parent:LV},lR={type:i.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:i.FunctionCall,entityId:xl},GV={id:"map-company-dto-function-call-company-input-map-id",type:i.InputMap,version:1,declaration:Gl.inputs[0],name:null,description:null,defaultValue:null,dynamicArguments:[],index:0,readsValue:null,parent:lR},FV={id:nR,type:i.OutputMap,version:1,declaration:Ml.outputs[0],writesValues:[oR],index:0,parent:lR},UV={id:"map-company-dto-function-call-called-by-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:pt},xV={id:"map-company-dto-function-call-parent-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:pt},jV={id:xl,type:i.FunctionCall,version:1,declaration:Gl,successCalls:[oR],process:null,errorCalls:[],inputs:[GV],outputs:[FV],calledByError:[],calledByEntry:[UV],calledBySuccess:[],parent:xV,x:0,y:0,error:null},kV={type:i.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:rT},qV={type:i.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:i.DataType,entityId:"last-timestamp-variable-datatype-id"},JV={id:"last-timestamp-variable-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:sn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:kV,defaultValue:{id:"last-timestamp-variable-default-value-id",type:i.PrimitiveValue,version:1,name:D.Date,value:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:qV,valueAsType:null}},WV={type:i.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:i.Project,entityId:H},kl={id:rT,type:i.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:JV,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:WV},HV={type:i.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:tR},YV={type:i.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:i.Operation,entityId:Ul},zV={id:tR,type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:i.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:D.Number,parent:HV},index:0,parent:YV},ZV={type:i.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},XV={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Yi},QV={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:i.FunctionDeclaration,entityId:Hi},cR={id:Ul,type:i.Operation,version:1,declaration:xt,inputs:[zV],dynamicArguments:[],outputs:[],process:null,successCalls:[iR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[XV,QV],calledBySuccess:[],error:null,parent:ZV},KV={type:i.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"wait-for-random-amount-input-map-id"},e$={type:i.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:i.Operation,entityId:"wait-for-random-amount-id"},t$={id:"wait-for-random-amount-input-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:i.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:xe.Random,rangeStart:1e3,rangeEnd:4e3},name:D.Number,parent:KV},index:0,parent:e$},n$={type:i.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:i.Project,entityId:H},Wr={id:"wait-for-random-amount-id",type:i.Operation,version:1,declaration:xt,inputs:[t$],dynamicArguments:[],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:n$},dR="list-of-functions-variable-id",r$={type:i.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:dR},i$={id:"list-of-functions-variable-action-descriptor-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:F.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:F.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},a$={type:i.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:i.DataType,entityId:"list-of-functions-variable-data-type-id"},s$={id:"list-of-functions-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:i$,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.ActionDescriptor,value:null,valueAsType:[Wr,Wr,Wr,Wr,Wr],autogeneration:null,parent:a$},constant:!1,parent:r$},o$={type:i.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt};i.GenericReference,i.InputMap;const l$={type:i.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:i.InputMap,entityId:eR},c$={type:i.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:i.InputMap,entityId:Fl},uR={id:dR,type:i.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:s$,parent:o$,readsValue:null,writesValues:[l$,c$],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},d$={type:i.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:i.Operation,entityId:Hi},u$={type:i.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},p$={type:i.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-in-parallel-return-map-id"},y$={type:i.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:i.Operation,entityId:Hi},pR={id:"exec-in-parallel-result-variable-id",type:i.VariableInstance,version:1,declaration:kl,readsValue:p$,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[y$],successCalls:[],errorCalls:[],internalCalls:[],parent:u$,x:0,y:0},h$={id:"exec-in-parallel-return-map-id",type:i.OutputMap,version:1,declaration:No,writesValues:[pR],index:0,parent:d$},f$={type:i.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:i.Operation,entityId:Hi},m$={id:Fl,type:i.InputMap,version:1,declaration:Mo,name:null,description:null,dynamicArguments:[],readsValue:uR,defaultValue:null,index:0,parent:f$},T$={type:i.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},E$={type:i.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:pt},R$={process:null,id:Hi,type:i.Operation,version:1,declaration:xt,inputs:[m$],dynamicArguments:[],outputs:[h$],successCalls:[cR,pR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[E$],calledBySuccess:[],error:null,parent:T$},b$={type:i.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:i.Operation,entityId:Yi},g$={type:i.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},v$={type:i.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-sequentially-return-map-id"},I$={type:i.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:i.Operation,entityId:Yi},yR={id:"exec-sequentially-result-variable-id",type:i.VariableInstance,version:1,declaration:kl,readsValue:v$,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[I$],successCalls:[],errorCalls:[],internalCalls:[],parent:g$,x:0,y:0},P$={id:"exec-sequentially-return-map-id",type:i.OutputMap,version:1,declaration:$o,writesValues:[yR],index:0,parent:b$},D$={type:i.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:i.Operation,entityId:Yi},A$={id:eR,type:i.InputMap,version:1,declaration:Vo,name:null,description:null,dynamicArguments:[],readsValue:uR,defaultValue:null,index:0,parent:D$},S$={type:i.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},O$={type:i.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:pt},C$={id:Yi,type:i.Operation,version:1,declaration:on,inputs:[A$],process:null,dynamicArguments:[],outputs:[P$],successCalls:[cR,yR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[O$],calledBySuccess:[],error:null,parent:S$},B$={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},w$={type:i.FunctionDeclaration,id:pt,version:1,name:"Execute with concurrency and wait",description:"Executes a hardcoded list of actions in parallel and waits for some time before ending the logic with some unrelated data payload as the result.",inputs:[],calls:[C$,R$,jV],returnStatements:[iR],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:B$},_$={type:i.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:i.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},M$={id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:bt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_$},N$={type:i.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:i.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},V$={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",dataType:M$,readsValue:null,required:!0,index:0,parent:N$},$$={type:i.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},L$={type:i.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},hR={type:i.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[V$],calledByError:[],calledByEntry:[L$],calledBySuccess:[],throws:null,x:0,y:0,parent:$$},G$={type:i.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:i.Project,entityId:H},F$={type:i.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[hR],index:null,implements:null,returnStatements:[hR],collapsed:!1,private:!1,x:0,y:0,parent:G$},ql="get-current-date-and-time-func-decl-id",fR="get-current-date-and-time-return-statement-id",mR="get-current-date-and-time-return-declaration-id",TR="get-current-date-and-time-return-declaration-data-type-id",U$={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:i.DataType,entityId:TR},x$={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:mR},j$={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:TR,version:1,entity:sn,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.Date,valueAsType:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:U$},constant:!1,parent:x$},k$={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:i.ReturnStatement,entityId:fR};i.ReturnDeclaration;const q$={type:i.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:ql},J$={type:i.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:ql};i.ReturnStatement;const W$={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},H$={type:i.FunctionDeclaration,id:ql,version:1,name:"Get current date and time",description:"Generates and returns the current date and time at the time of the execution",inputs:[],calls:[],returnStatements:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:W$},ER="do-math-return-statement-id",RR="do-math-return-declaration-id",Y$={type:i.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:i.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},z$={id:"do-math-func-var-to-return-one-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Y$},Z$={type:i.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},X$={type:i.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:i.ReturnDeclaration,entityId:RR},Q$={type:i.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:z$,readsValue:null,writesValues:[X$],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:Z$},K$={type:i.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:i.ReturnStatement,entityId:ER},eL={type:i.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:i.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},tL={id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:eL},nL={isError:!1,id:RR,version:1,type:i.ReturnDeclaration,name:"Result",description:null,dataType:tL,readsValue:Q$,required:!0,index:0,parent:K$},rL={type:i.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},iL={type:i.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},bR={type:i.ReturnStatement,id:ER,version:1,outputs:[nL],calledByError:[],calledByEntry:[],calledBySuccess:[rL],parent:iL,throws:null,x:0,y:0},aL={type:i.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:i.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},sL={id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aL},oL={type:i.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},lL={type:i.GenericReference,id:"do-math-func-return-one-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},cL={type:i.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},gR={type:i.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:sL,description:null,readsValue:cL,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[lL],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:oL},dL={type:i.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},uL={type:i.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},pL={type:i.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:i.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},yL={id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:pL},hL={type:i.GenericReference,id:"do-math-func-return-two-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},vR={type:i.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[hL],successCalls:[],errorCalls:[],dataType:yL,readsValue:uL,writesValues:[],internalCalls:[],parent:dL,x:0,y:0},IR={type:i.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},fL={type:i.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},mL={type:i.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},TL={type:i.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:i.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},PR={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:i.InputMap,declaration:Po,name:null,description:null,dynamicArguments:[],readsValue:TL,defaultValue:null,index:0,parent:mL},EL={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:i.OutputMap,version:1,declaration:Ao,writesValues:[gR,vR],index:0,parent:fL},RL={type:i.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},bL={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:i.GenericReference,entityType:i.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},DR={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:i.InputMap,declaration:Do,name:null,description:null,dynamicArguments:[],readsValue:bL,defaultValue:null,index:1,parent:RL},gL={type:i.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:Ia,version:1,inputs:[PR,DR],dynamicArguments:[],outputs:[EL],calledByError:[],calledByEntry:[IR],calledBySuccess:[],process:null,successCalls:[bR,gR,vR],errorCalls:[],parent:IR,error:null,x:0,y:0},vL={type:i.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:i.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},IL={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:i.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:i.ArgumentDeclaration},AR={id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:i.PrimitiveValue,version:1,value:1,name:D.Number,parent:vL,valueAsType:null,autogeneration:null},constant:!1,parent:IL},PL={type:i.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:i.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},DL={type:i.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},AL={type:i.GenericReference,id:"do-math-func-var-called-by-ref",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},SR={type:i.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:AR,inputs:[],outputs:[],calledByError:[],calledByEntry:[AL],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:PL,writesValues:[DR],internalCalls:[],x:0,y:0,parent:DL},SL={entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:i.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},OL={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:i.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:AR,writesValues:[SR],required:!0,index:1,parent:SL},CL={type:i.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:i.Project,entityId:H},BL={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},wL={type:i.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:i.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},_L={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:i.ArgumentDeclaration},ML={id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:i.PrimitiveValue,version:1,value:5,name:D.Number,parent:wL,valueAsType:null,autogeneration:null},constant:!1,parent:_L},NL={id:"d8895765-f705-457e-85fa-25d130926769",type:i.ArgumentDeclaration,version:1,name:"N",dataType:ML,description:"The number to add",writesValues:[PR],required:!0,index:0,parent:BL},VL={type:i.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[NL,OL],calls:[gL,SR],implements:null,index:null,collapsed:!1,returnStatements:[bR],private:!1,x:0,y:0,parent:CL},gt="replace-bank-account-in-company-func-declaration-id",Jl="company-entity-to-modify-arg-declaration-id",$L="account-number-to-create-arg-decl-id",Hr="company-variable-id",Yr="search-person-by-id-id",OR="new-bank-account-owner-arg-decl-id",CR="search-person-by-id-output-declaration-id",Wl="search-person-by-id-output-entity-map-id",vs="person-not-empty-condition-id",Is="create-new-bank-account-instance-operation-id",BR="create-new-bank-account-instance-operation-output-entity-map-id",wR="company-bank-account-output-map-id",Hl="old-bank-account-var-declaration-id",_R="old-bank-account-var-instance-id",MR="company-variable-instance-id",Yl="delete-bank-account-internal-call-id",LL={type:i.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:gt},GL={type:i.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:i.InternalCall,entityId:Yl},FL={type:i.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Hr},UL={type:i.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:MR},xL={type:i.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:BR},NR={type:i.InputMap,id:"bank-account-input-map-id",version:1,readsValue:xL,declaration:vl,name:null,description:null,index:0,defaultValue:null,dynamicArguments:[],parent:UL},jL={type:i.VariableInstance,id:MR,version:1,declaration:FL,inputs:[NR],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[GL],successCalls:[],errorCalls:[],internalCalls:[],parent:LL,readsValue:null,writesValues:[],x:0,y:0},kL={type:i.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Hr},qL={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:kr,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:kL},JL={type:i.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:wR},WL={type:i.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:gt},HL={type:i.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Hr},YL={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:i.Operation,entityId:Is};i.GenericReference,i.VariableInstance;const zL={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:Hl},ZL={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-decl-ref-id",entityType:i.VariableDeclaration,entityId:Hl},XL={type:i.GenericReference,id:"bank-account-variable-parent-ref-two-id",entityType:i.FunctionDeclaration,entityId:gt},QL={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-internal-call-ref-id",entityType:i.InternalCall,entityId:Yl},KL={type:i.VariableInstance,id:_R,version:1,declaration:ZL,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],internalCalls:[QL],errorCalls:[],parent:XL,readsValue:null,writesValues:[],x:0,y:0},VR={process:null,type:i.InternalCall,id:Yl,version:1,declaration:Ho,index:0,successCalls:[jL],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[YL,zL],parent:KL},$R={type:i.VariableDeclaration,id:Hl,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:qL,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[HL],successCalls:[VR],internalCalls:[],errorCalls:[],parent:WL,readsValue:JL,writesValues:[],x:0,y:0},eG={type:i.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Hr},tG={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:bt,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:eG},nG={type:i.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Jl},rG={type:i.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:i.FunctionDeclaration,entityId:gt},iG={type:i.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:gt},aG={type:i.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Hr},sG={id:wR,version:1,type:i.OutputMap,declaration:vl,index:0,parent:aG,writesValues:[$R]},LR={type:i.VariableDeclaration,id:Hr,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:tG,inputs:[],outputs:[sG],calledByError:[],calledByEntry:[iG],calledBySuccess:[],successCalls:[$R],errorCalls:[],parent:rG,internalCalls:[],readsValue:nG,writesValues:[],x:0,y:0},oG={type:i.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:i.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},lG={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.OutputMap,entityId:Wl},GR={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:i.InputMap,declaration:dT,name:null,description:null,dynamicArguments:[],readsValue:lG,index:1,defaultValue:null,parent:oG},cG={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:$L},dG={type:i.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:i.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},FR={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:i.InputMap,declaration:cT,name:null,description:null,dynamicArguments:[],readsValue:cG,defaultValue:null,index:0,parent:dG},uG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:i.Operation,entityId:Is},pG={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:i.InputMap,declaration:Mr.fixedArguments[0],name:null,description:null,dynamicArguments:[FR,GR],index:0,readsValue:null,defaultValue:{type:i.PrimitiveValue,name:D.EntityTemplate,value:null,valueAsType:kr,autogeneration:null},parent:uG},yG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:i.Operation,entityId:Is},hG={id:BR,version:1,type:i.OutputMap,declaration:Mr.fixedReturns[0],index:0,writesValues:[NR],parent:yG},fG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.Condition,entityId:vs},mG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:i.FunctionDeclaration,entityId:gt},TG={process:null,id:Is,type:i.Operation,version:1,declaration:Mr,inputs:[pG],dynamicArguments:[],error:null,outputs:[hG],successCalls:[VR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[fG],parent:mG,x:0,y:0},EG={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:i.DataType},RG={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:i.ReturnDeclaration};i.DataType,i.PrimitiveValue,D.String;const bG={id:"person-not-found-thrown-error-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:i.ReturnStatement},gG={isError:!0,id:"person-not-found-thrown-error-id",type:i.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:bG,required:!0,index:0,readsValue:null},vG={id:"person-not-found-error-return-statement-called-by-ref-id",type:i.GenericReference,entityId:vs,entityType:i.Condition},IG={id:"person-not-found-error-return-statement-parent-ref-id",type:i.GenericReference,entityId:gt,entityType:i.FunctionDeclaration},PG={id:"person-not-found-error-return-statement-id",type:i.ReturnStatement,version:1,throws:gG,outputs:[],calledBySuccess:[],calledByError:[vG],calledByEntry:[],x:0,y:0,parent:IG},DG={type:i.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:i.Search,entityId:Yr},AG={type:i.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:i.FunctionDeclaration,entityId:gt},SG={type:i.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Wl},OG={type:i.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:i.Condition,entityId:vs},UR={id:"person-entity-to-check-map-id",version:1,type:i.InputMap,declaration:zn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:SG,index:0,defaultValue:null,parent:OG},CG={type:i.Condition,id:vs,version:1,declaration:zn,inputs:[UR],calledByError:[],calledByEntry:[],calledBySuccess:[DG],successCalls:[TG],errorCalls:[PG],x:0,y:0,parent:AG},BG={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:i.ValueDescriptor,entityId:CR},wG={id:"search-person-by-id-output-entity-declaration-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:ut,defaultValue:null,parent:BG},_G={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:i.Search,entityId:Yr},xR={id:CR,type:i.ValueDescriptor,version:1,dataType:wG,name:"Found person",description:"The person entity that was found",parent:_G,required:!0,index:0},MG={type:i.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:i.Search,entityId:Yr},NG={type:i.OutputMap,id:Wl,version:1,declaration:xR,parent:MG,writesValues:[UR,GR],index:0},VG={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:i.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:i.ArgumentDeclaration};i.DataType;const $G={type:i.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:i.Search,entityId:Yr},jR={id:"search-person-by-id-input-declaration-id",type:i.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",index:0,required:!0,parent:$G,writesValues:[]},LG={type:i.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:i.Search,entityId:Yr},GG={id:"search-person-by-id-input-map-reads-value-ref-id",type:i.GenericReference,entityId:OR,entityType:i.ArgumentDeclaration},kR={type:i.InputMap,id:"search-person-by-id-input-map",version:1,declaration:jR,name:null,description:null,readsValue:GG,defaultValue:null,parent:LG,dynamicArguments:[],index:0},FG={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},UG={type:i.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:i.FunctionDeclaration,entityId:gt},xG={type:i.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:gt},jG={type:i.Search,id:Yr,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:FG,inputsDeclarations:[jR],inputs:[kR],outputsDeclarations:[xR],outputs:[NG],calledByError:[],calledByEntry:[xG],calledBySuccess:[],error:null,successCalls:[CG],errorCalls:[],parent:UG,x:0,y:0};i.GenericReference,i.DataType;const kG={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:"account-number-to-create-arg-decl-id",entityType:i.ArgumentDeclaration},qG={id:"account-number-to-create-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:kG},JG={entityType:i.FunctionDeclaration,entityId:gt,type:i.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},WG={id:"account-number-to-create-arg-decl-id",type:i.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:qG,writesValues:[FR],required:!0,index:1,parent:JG};i.GenericReference,i.DataType;const HG={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:i.ArgumentDeclaration},YG={id:"new-bank-account-owner-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:va,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:HG},zG={entityType:i.FunctionDeclaration,entityId:gt,type:i.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},ZG={id:OR,type:i.ArgumentDeclaration,version:1,name:"New account owner ID",description:"If it has changed, this is the new person entity, that owns of the bank account",dataType:YG,writesValues:[kR],required:!1,index:1,parent:zG},XG={type:i.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:i.Project,entityId:H},QG={type:i.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:i.FunctionDeclaration,entityId:gt};i.GenericReference,i.DataType;const KG={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:Jl,entityType:i.ArgumentDeclaration},eF={id:"company-entity-to-modify-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:KG},tF={id:Jl,type:i.ArgumentDeclaration,version:1,name:"Company",dataType:eF,description:"The company to replace the bank account for",writesValues:[LR],required:!0,index:0,parent:QG},nF={type:i.FunctionDeclaration,id:gt,version:1,name:"Replace bank account",description:"This action takes an existing company and data to create a new bank account entity. It then creates a bank account, deletes the old one, and updates the company with the new bank account",inputs:[tF,WG,ZG],index:null,implements:null,calls:[jG,LR],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:XG},rF={type:i.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},iF={type:i.FunctionDeclaration,version:1,id:"6bedb217-f844-4332-af72-9626b2a32511",name:"Some library main function",description:null,inputs:[],calls:[],implements:null,collapsed:!0,index:null,returnStatements:[],private:!1,parent:rF,x:0,y:0},aF={type:i.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:i.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},sF={type:i.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},oF={type:i.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[iF],events:[],implements:sF,parent:aF,x:0,y:0},zl="iterate-over-list-loop-id",qR="iterate-over-list-loop-body-id",JR="iterate-over-list-loop-body-current-iteration-argument-declaration-id",lF={type:i.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:JR,entityType:i.ArgumentDeclaration},cF={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:lF},dF={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:qR,entityType:i.FunctionDeclaration},uF={id:JR,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:cF,required:!0,index:0,writesValues:[],parent:dF},pF={id:"iterate-over-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:zl,entityType:i.Loop},yF={id:qR,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[uF],calls:[],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:pF},hF={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:zl,entityType:i.Loop},fF={id:"iterate-over-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Yn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:null,index:0,parent:hF},mF={id:"iterate-over-list-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},TF={id:zl,type:i.Loop,version:1,declaration:Yn,inputs:[fF],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:yF,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:mF};var Zl=(n=>(n.EQ="eq",n.NEQ="neq",n.GT="gt",n.GTE="gte",n.LT="lt",n.LTE="lte",n.LIKE="like",n.ILIKE="ilike",n))(Zl||{}),WR=(n=>(n.COUNT="count",n.SUM="sum",n.AVG="avg",n.MIN="min",n.MAX="max",n))(WR||{});const EF={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:WR.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:Zl.NEQ,value:null}]},where:[{name:"employee_count",operation:Zl.GT,value:1}]},RF={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},bF={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},HR={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:i.ValueDescriptor,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,required:!0,index:0,parent:bF},gF={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},vF={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:i.OutputMap,version:1,declaration:HR,writesValues:[],index:0,parent:gF},IF={id:"find-companies-with-multiple-employees-and-bank-account",type:i.Search,version:1,name:"Find companies with multiple employees and a bank account",description:"This search statement finds companies with multiple employees and an existing bank account",inputsDeclarations:[],outputsDeclarations:[HR],inputs:[],outputs:[vF],query:EF,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:RF},zr="random-company-employee-test-variable-id",Xl="manager-global-variable-id",YR="global-user-instance-id",rr="employee-mapped-dto-variable-id",Ql="employee-mapped-dto-variable-instance-id",zR="random-employee-id-output-map-id",ZR="random-employee-birth-date-output-map-id",XR="random-employee-department-output-map-id",QR="random-employee-manager-output-map-id",KR="manager-global-id-output-map-id",eb="global-user-instance-id-output-map-id",PF="employee-mapped-dto-requester-id-input-map-id",tb="employee-mapped-dto-now-timestamp-input-map-id",DF="employee-mapped-dto-id-input-map-id",AF="employee-mapped-dto-birth-date-input-map-id",SF="employee-mapped-dto-department-input-map-id",OF="employee-mapped-dto-manager-input-map-id",CF={type:i.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:KR},BF={type:i.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},nb={id:OF,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:CF,parent:BF},wF={type:i.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:XR},_F={type:i.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},rb={id:SF,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:wF,parent:_F},MF={type:i.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:ZR},NF={type:i.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},ib={id:AF,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:MF,parent:NF},VF={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:zR},$F={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},ab={id:DF,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:VF,parent:$F},LF={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:eb},GF={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},sb={id:PF,type:i.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,dynamicArguments:[],index:0,readsValue:LF,parent:GF},FF={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xl},UF={id:KR,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[nb],parent:FF},xF={type:i.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xl},jF={id:"manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ot,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:xF,defaultValue:null},kF={type:i.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:QR},qF={type:i.GenericReference,id:"manager-variable-parent-ref-id",entityType:i.Project,entityId:H},ob={id:Xl,type:i.VariableDeclaration,version:1,name:"Manager",dataType:jF,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:kF,writesValues:[],inputs:[],outputs:[UF],internalCalls:[],parent:qF,x:0,y:0},JF={type:i.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},WF={id:QR,type:i.OutputMap,version:1,declaration:Ot.properties[2],index:3,writesValues:[ob],parent:JF},HF={type:i.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},YF={id:XR,type:i.OutputMap,version:1,declaration:Ot.properties[0],index:2,writesValues:[rb],parent:HF},zF={type:i.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},ZF={id:ZR,type:i.OutputMap,version:1,declaration:ut.properties[1],index:1,writesValues:[ib],parent:zF},XF={type:i.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},QF={id:zR,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[ab],parent:XF},KF={type:i.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},e4={id:"random-company-employee-test-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ot,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:KF,defaultValue:null},t4={type:i.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:i.Project,entityId:H},n4={id:zr,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:e4,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[QF,ZF,YF,WF],internalCalls:[],parent:t4,x:0,y:0},r4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:tb},i4={type:i.PrimitiveValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:D.Date,version:1,valueAsType:null,value:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:r4},a4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:Ql},s4={id:tb,type:i.InputMap,version:1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:i4,dynamicArguments:[],index:5,readsValue:null,parent:a4},o4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",entityType:i.VariableDeclaration,entityId:rr},l4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:Ql},c4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},d4={id:Ql,type:i.VariableInstance,version:1,declaration:o4,calledByError:[],calledByEntry:[],calledBySuccess:[l4],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[s4],outputs:[],internalCalls:[],parent:c4,x:0,y:0},u4={type:i.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:i.Project,entityId:H},p4={id:rr,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[d4],errorCalls:[],readsValue:null,writesValues:[],inputs:[sb,ab,ib,rb,nb],outputs:[],internalCalls:[],parent:u4,x:0,y:0},y4={type:i.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:i.VariableDeclaration,entityId:ml},h4={id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:El,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:y4,defaultValue:null},f4={type:i.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:i.Project,entityId:H},lb={id:ml,type:i.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:h4,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:f4},m4={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableInstance,entityId:YR},T4={id:eb,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[sb],parent:m4},E4={type:i.GenericReference,id:"global-user-instance-parent-ref-id",entityType:i.Project,entityId:H},R4={id:YR,type:i.VariableInstance,version:1,declaration:lb,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[T4],internalCalls:[],parent:E4,x:0,y:0},b4={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:ml},g4={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:i.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},v4={id:"is-test-environment-variable-dcl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:vn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:b4,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:D.Boolean,version:1,value:null,type:i.PrimitiveValue,autogeneration:{type:xe.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:g4}},I4={type:i.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:i.Project,entityId:H},cb={id:"is-test-environment-variable-dcl-id",type:i.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:v4,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:I4},P4={type:i.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},D4={id:"is-test-environment-variable-instance-id",type:i.VariableInstance,version:1,declaration:cb,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:P4,x:0,y:0},db={type:i.Project,id:H,version:1,name:"Mocked project to compile",description:"This project is used to test all sorts of features and edge cases. It is not meant to be used in production. Or to have any functionality that makes sense",projects:[oF],entities:[Tl,El,ut,h_,Ot,ys,IT,PT,kr,lw,bt,r_,iT,eA,sw],functions:[w$,ZT,Ll,F$,H$,pE,Gl,Il,nF,MT,VL],events:[H_],variableDeclarations:[cb,lb,kl,n4,ob,p4],variableInstances:[D4,R4],conditions:[],operations:[Wr],functionCalls:[JM,KN],loops:[TF],searches:[IF]};var T=(n=>(n.Error="error",n.Warning="warning",n))(T||{}),I=(n=>(n.InvalidObjectStructure="invalid-object-structure",n.NameNotUniqueInScope="name-not-unique-in-scope",n.EmptyName="empty-name",n.MissingCaller="missing-caller",n.PropertyOverwrite="property-overwrite",n.MethodOverwrite="method-overwrite",n.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",n.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",n.UnreachableEntity="unreachable-entity",n.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",n.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",n.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",n.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",n.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",n))(I||{}),h=(n=>(n.RootReference="root-reference",n.ReferencedEntityNotFound="referenced-entity-not-found",n.EntityIdNotUnique="entity-id-not-unique",n.BuiltInEntityGenerated="built-in-entity-generated",n.BuiltInEntityUpdated="built-in-entity-updated",n.BuiltInEntityDeleted="built-in-entity-deleted",n.UnknownEntityType="unknown-entity-type",n.MissingTypeProperty="missing-type-property",n.MissingIdProperty="missing-id-property",n.BuiltInEntityParent="built-in-entity-parent",n.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",n.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",n.RecommendedImplementOperationAction="recommended-implement-operation-action",n.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",n.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",n.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",n.RecommendedImplementConditionAction="recommended-implement-condition-action",n.InvalidReferenceObjectStructure="invalid-reference-object-structure",n.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",n.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",n.InvalidParentReference="invalid-parent-reference",n.InvalidImplementsReference="invalid-implements-reference",n.InvalidExtendsReference="invalid-extends-reference",n.InvalidGenerationActionPayload="invalid-generation-action-payload",n.InvalidReference="invalid-reference",n.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",n.InvalidUpdateEntityOperation="invalid-update-entity-operation",n.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",n.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",n.UnrecognizedProperty="unrecognized-property",n.SelfReference="self-reference",n.DuplicateReference="duplicate-reference",n.CallerWithIncompatibleScope="caller-with-incompatible-scope",n.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",n.InvalidInputMapDeclaration="invalid-input-map-declaration",n.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",n.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",n.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",n.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",n.OutputOverwrite="output-overwrite",n.InputOverwrite="input-overwrite",n.IncompatibleScope="incompatible-scope",n.InvalidParentUpdate="invalid-parent-update",n.NonInteractiveEntityReferenced="non-interactive-entity-referenced",n.InvalidParentRelationType="invalid-parent-relation-type",n))(h||{}),B=(n=>(n.ScopeWithoutLogic="scope-without-logic",n.ExtendingAbstractEntity="extending-abstract-entity",n.ImplementingNonAbstractEntity="implementing-non-abstract-entity",n.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",n.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",n.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",n.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",n.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",n.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",n.IncorrectEntityImplementation="incorrect-entity-implementation",n.IncorrectMethodImplementation="incorrect-method-implementation",n.IncorrectPropertyImplementation="incorrect-property-implementation",n.PropertyImplementsNonAbstact="property-implements-non-abstract",n.NonStaticPropertyImplementsStatic="non-static-property-implements-static",n.StaticPropertyImplementsNonStatic="static-property-implements-non-static",n.PropertyImplementsIncompatibleType="property-implements-incompatible-type",n.MissingPropertyImplementation="missing-property-implementation",n.MissingMethodImplementation="missing-method-implementation",n.NoProperties="no-properties",n.ReadingFromIncompatibleType="reading-from-incompatible-type",n.WritingToIncompatibleType="writing-to-incompatible-type",n.InvalidPropertiesCombination="invalid-properties-combination",n.DisconnectedCallableEntity="disconnected-callable-entity",n.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",n.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",n.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",n.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",n.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",n.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",n))(B||{});class E{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code}toEntityError(e){return this.code in I?new ir({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class ir{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");c(this,"entity");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code,this.entity=e.entity}clone(){return new ir({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function A4(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function q(n){const e=n.entity.errors.find(r=>r.id===n.id);return e?{new:!1,error:e}:{new:!0,error:new ir(n)}}function S4(n,e){const t=new Map;return n.forEach(r=>{t.set(r.id,r)}),e.forEach(r=>{t.set(r.id,r)}),Array.from(t.values())}function ee(n,e){const t=[];return e.forEach(r=>{const a=n.find(s=>s.id===r.id);a?t.push(a):t.push(r)}),t}const Zi=d.union([d.string(),d.number(),d.boolean(),d.date()]),ub=d.enum([xe.CurrentDateAndTime,xe.Random,xe.Unique]),Ps=d.object({type:ub,rangeStart:Zi.nullable(),rangeEnd:Zi.nullable()}),Xi=Ps.extend({type:d.literal(xe.Random),rangeStart:Zi,rangeEnd:Zi}),Kl=Ps.extend({type:d.literal(xe.Unique),rangeStart:d.null(),rangeEnd:d.null()}),pb=Ps.extend({type:d.literal(xe.CurrentDateAndTime),rangeStart:d.null(),rangeEnd:d.null()}),Ds=Xi.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),yb=Ds.extend({rangeStart:d.number(),rangeEnd:d.null()}),hb=Ds.extend({rangeStart:d.null(),rangeEnd:d.number()}),fb=Ds.extend({rangeStart:d.number(),rangeEnd:d.number()}),As=Xi.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),mb=As.extend({rangeStart:d.number(),rangeEnd:d.null()}),Tb=As.extend({rangeStart:d.null(),rangeEnd:d.number()}),Eb=As.extend({rangeStart:d.number(),rangeEnd:d.number()}),Ss=Xi.extend({rangeStart:d.date().nullable(),rangeEnd:d.date().nullable()}),Rb=Ss.extend({rangeStart:d.date(),rangeEnd:d.null()}),bb=Ss.extend({rangeStart:d.null(),rangeEnd:d.date()}),gb=Ss.extend({rangeStart:d.date(),rangeEnd:d.date()}),ec=Xi.extend({rangeStart:d.null(),rangeEnd:d.null()}),tc=d.union([mb,Tb,Eb]),nc=d.union([yb,hb,fb]),rc=d.union([Rb,bb,gb,pb]),ic=d.union([tc,nc,rc,Kl,ec]);function Qi(){return d.union([d.object({type:d.literal(i.ValueDescriptor)}),d.record(d.string(),d.any())])}function vb(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ValueDescriptor)})}function ac(){return d.object({id:d.string(),type:d.literal(i.ValueDescriptor),name:d.string(),required:d.boolean()})}function O4(){return ac().merge(d.object({version:d.number(),index:d.number()}))}function C4(){return ac().merge(d.object({}))}function B4(){return d.object({dataType:yn(),parent:Nn()})}function w4(){return O4().merge(B4())}function Os(){return d.union([d.object({type:d.literal(i.PrimitiveEntity)}),d.record(d.string(),d.any())])}function Cs(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.PrimitiveEntity)})}function Bs(){return d.object({id:d.string(),type:d.literal(i.PrimitiveEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function _4(){return Bs().merge(d.object({version:d.number()}))}function M4(){return Bs().merge(d.object({}))}function N4(){return d.object({properties:d.array(ar()),methods:d.array(Bt()),abstractMethods:d.array(Qt()),extends:d.array(d.union([Os(),Zr()]))})}function V4(){return _4().merge(N4())}function ar(){return d.union([d.object({type:d.literal(i.Property)}),d.record(d.string(),d.any())])}function Ib(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Property)})}function sc(){return d.object({id:d.string(),type:d.literal(i.Property),name:d.string(),description:d.string().nullable(),private:d.boolean(),static:d.boolean(),required:d.boolean(),abstract:d.boolean()})}function $4(){return sc().merge(d.object({version:d.number(),index:d.number()}))}function L4(){return sc().merge(d.object({}))}function G4(){return d.object({dataType:yn(),implements:ar().nullable(),parent:d.union([cr(),Cs(),ws()])})}function F4(){return $4().merge(G4())}function U4(){return d.enum([N.CRON_JOB,N.EXECUTION,N.HTTP_ENDPOINT,N.PERSISTED_ENTITY,N.RELATIONAL_DATABASE])}function Zr(){return d.union([d.object({type:d.literal(i.BuiltInBaseEntity)}),d.record(d.string(),d.any())])}function ws(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.BuiltInBaseEntity)})}function oc(){return d.object({id:d.string(),version:d.number(),type:d.literal(i.BuiltInBaseEntity),name:U4(),description:d.string().nullable(),abstract:d.boolean(),static:d.boolean()})}function x4(){return oc()}function j4(){return oc().merge(d.object({}))}function k4(){return d.object({properties:d.array(ar()),methods:d.array(Bt()),abstractMethods:d.array(Qt()),extends:d.array(d.union([Zr(),Os()]))})}function q4(){return x4().merge(k4())}function Pb(){return d.enum([F.Dynamic,F.Fixed,F.None])}function Qt(){return d.union([d.object({type:d.literal(i.ActionDescriptor)}),d.record(d.string(),d.any())])}function Nn(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ActionDescriptor)})}function _s(){return d.object({id:d.string(),type:d.literal(i.ActionDescriptor),name:d.string(),description:d.string().nullable(),argumentsType:Pb(),returnsType:Pb()})}function J4(){return _s().merge(d.object({version:d.number()}))}function W4(){return _s().merge(d.object({}))}function H4(){return d.object({fixedArguments:d.array(Qi()),fixedReturns:d.array(Qi()),dynamicArgumentTypes:yn().nullable(),dynamicReturnTypes:yn().nullable(),parent:d.union([vt(),cr(),ws(),Cs()]).nullable()})}function Db(){return J4().merge(H4())}function Xr(){return d.union([d.object({type:d.literal(i.Loop)}),d.record(d.string(),d.any())])}function Kt(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Loop)})}function Ab(){return d.object({id:d.string(),type:d.literal(i.Loop)})}function Y4(){return Ab().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function z4(){return Ab().merge(d.object({declaration:d.union([d.string(),Bt()])}))}function Z4(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),declaration:Qt(),inputs:d.array(Ct()),outputs:d.array(yt()),outputsDeclarations:d.array(Qi()),successCalls:d.array(ke()),errorCalls:d.array(ke()),error:yt(),body:Bt(),parent:d.union([fn(),vt()]),breakStatements:d.array(ti()),continueStatements:d.array(Qr())})}function X4(){return Y4().merge(Z4())}function Qr(){return d.union([d.object({type:d.literal(i.ContinueStatement)}),d.record(d.string(),d.any())])}function Kr(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ContinueStatement)})}function lc(){return d.object({id:d.string(),type:d.literal(i.ContinueStatement)})}function Q4(){return lc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function K4(){return lc().merge(d.object({}))}function eU(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),outputs:d.array(un()),throws:d.optional(un()),parent:Kt()})}function tU(){return Q4().merge(eU())}function sr(){return d.union([d.object({type:d.literal(i.ReturnStatement)}),d.record(d.string(),d.any())])}function ei(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ReturnStatement)})}function cc(){return d.object({id:d.string(),type:d.literal(i.ReturnStatement)})}function nU(){return cc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function rU(){return cc().merge(d.object({}))}function iU(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),outputs:d.array(un()),throws:d.optional(un()),parent:fn()})}function aU(){return nU().merge(iU())}function un(){return d.union([d.object({type:d.literal(i.ReturnDeclaration)}),d.record(d.string(),d.any())])}function Sb(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ReturnDeclaration)})}function dc(){return d.object({id:d.string(),type:d.literal(i.ReturnDeclaration),name:d.string(),description:d.string().nullable(),isError:d.boolean()})}function sU(){return dc().merge(d.object({version:d.number(),index:d.number()}))}function oU(){return dc().merge(d.object({}))}function lU(){return d.object({dataType:yn().nullable(),readsValue:ia().nullable(),parent:d.union([ei(),Nn(),pn(),Kr()])})}function cU(){return sU().merge(lU())}function ti(){return d.union([d.object({type:d.literal(i.BreakStatement)}),d.record(d.string(),d.any())])}function pn(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.BreakStatement)})}function uc(){return d.object({id:d.string(),type:d.literal(i.BreakStatement)})}function dU(){return uc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function uU(){return uc().merge(d.object({}))}function pU(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),outputs:d.array(un()),throws:d.optional(un()),parent:Kt()})}function yU(){return dU().merge(pU())}function yt(){return d.union([d.object({type:d.literal(i.OutputMap)}),d.record(d.string(),d.any())])}function pc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.OutputMap)})}function yc(){return d.object({id:d.string(),type:d.literal(i.OutputMap)})}function hU(){return yc().merge(d.object({version:d.number(),index:d.number()}))}function fU(){return yc().merge(d.object({}))}function mU(){return d.object({writesValues:d.array(hn()),declaration:d.union([un(),ar()]),parent:d.union([le(),Kt(),pn()])})}function TU(){return hU().merge(mU())}function ni(){return d.union([d.object({type:d.literal(i.FunctionCall)}),d.record(d.string(),d.any())])}function Ki(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.FunctionCall)})}function hc(){return d.object({id:d.string(),type:d.literal(i.FunctionCall)})}function EU(){return hc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function RU(){return hc().merge(d.object({}))}function bU(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),writesValues:d.array(hn()),declaration:Bt(),inputs:d.array(Ct()),outputs:d.array(yt()),error:d.optional(yt()),parent:d.union([fn(),vt()])})}function gU(){return EU().merge(bU())}function vU(){return d.enum([Be.Equal,Be.NotEqual,Be.MoreThan,Be.MoreThanOrEqual,Be.LessThan,Be.LessThanOrEqual,Be.And,Be.Or,Nt.Empty,Nt.NotEmpty])}function ea(){return d.union([d.object({type:d.literal(i.Condition)}),d.record(d.string(),d.any())])}function Ms(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Condition)})}function fc(){return d.object({id:d.string(),type:d.literal(i.Condition)})}function IU(){return fc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function PU(){return fc().merge(d.object({}))}function DU(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),leftValue:Ct(),rightValue:Ct().nullable(),operator:vU(),parent:d.union([fn(),vt()])})}function AU(){return IU().merge(DU())}function ta(){return d.union([d.object({type:d.literal(i.Search)}),d.record(d.string(),d.any())])}function na(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Search)})}function mc(){return d.object({id:d.string(),type:d.literal(i.Search),name:d.string(),query:d.any(),description:d.string().nullable()})}function SU(){return mc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function OU(){return mc().merge(d.object({}))}function CU(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),inputsDeclarations:d.array(lr()),inputs:d.array(Ct()),outputsDeclarations:d.array(Qi()),outputs:d.array(yt()),parent:d.union([fn(),vt()]),error:yt().nullable()})}function BU(){return SU().merge(CU())}function ra(){return d.union([d.object({type:d.literal(i.InternalCall)}),d.record(d.string(),d.any())])}function Tc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.InternalCall)})}function Ec(){return d.object({id:d.string(),type:d.literal(i.InternalCall),index:d.number()})}function wU(){return Ec().merge(d.object({version:d.number(),index:d.number()}))}function _U(){return Ec().merge(d.object({declaration:d.union([d.string(),Bt()])}))}function MU(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),writesValues:d.array(hn()),declaration:Bt(),inputs:d.array(Ct()),outputs:d.array(yt()),parent:Vn(),error:d.optional(yt())})}function NU(){return wU().merge(MU())}function Ct(){return d.union([d.object({type:d.literal(i.InputMap)}),d.record(d.string(),d.any())])}function Ns(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.InputMap)})}function Rc(){return d.object({id:d.string(),type:d.literal(i.InputMap),name:d.string().nullable().optional(),description:d.string().nullable().optional()})}function VU(){return Rc().merge(d.object({version:d.number(),index:d.number()}))}function $U(){return Rc().merge(d.object({}))}function LU(){return d.object({defaultValue:bc().nullable(),declaration:d.union([lr(),ar()]).nullable(),readsValue:ia().nullable(),parent:d.union([le(),Ns(),Kt(),pn()]),dynamicArguments:d.array(Ct())})}function GU(){return VU().merge(LU())}function ri(){return d.union([d.object({type:d.literal(i.Operation)}),d.record(d.string(),d.any())])}function ii(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Operation)})}function Vs(){return d.object({id:d.string(),type:d.literal(i.Operation)})}function FU(){return Vs().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function UU(){return Vs().merge(d.object({}))}function xU(){return Vs().merge(d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),writesValues:d.array(hn()),declaration:Qt(),inputs:d.array(Ct()),outputs:d.array(yt()),error:d.array(yt()),dynamicArguments:d.array(Ct()),parent:d.union([fn(),vt()])}))}function jU(){return FU().merge(xU())}function $s(){return d.union([d.string(),d.number(),d.boolean(),d.null(),d.date()])}function Ob(){return d.record(d.string(),$s())}function kU(){return d.array(d.union([$s(),Ob()]))}function Cb(){return d.union([$s(),Ob(),kU()])}function Bb(){return d.union([$s(),Cb()])}function wb(){return d.enum([D.String,D.Number,D.Boolean,D.Null,D.Date,D.JSON,D.Enum,D.File,D.UUID,D.EntityTemplate,D.ActionDescriptor])}function qU(){return d.union([cr(),ii(),aa()])}function JU(){return d.object({id:d.string(),name:wb(),type:d.literal(i.PrimitiveValue),value:Bb(),autogeneration:ic.nullable()})}function WU(){return JU().merge(d.object({}))}function Jt(){return d.object({id:d.string(),version:d.number(),name:wb(),type:d.literal(i.PrimitiveValue),value:Bb(),valueAsType:qU().nullable(),autogeneration:ic.nullable(),parent:d.union([gc(),Ns()])})}function HU(){return Jt().extend({name:d.literal(D.String),value:d.string(),autogeneration:tc.nullable()})}function YU(){return Jt().extend({name:d.literal(D.Number),value:d.number(),autogeneration:nc.nullable()})}function zU(){return Jt().extend({name:d.literal(D.Boolean),value:d.boolean(),autogeneration:ec.nullable()})}function ZU(){return Jt().extend({name:d.literal(D.Null),value:d.null(),autogeneration:d.null()})}function XU(){return Jt().extend({name:d.literal(D.Date),value:d.date(),autogeneration:rc.nullable()})}function QU(){return Jt().extend({name:d.literal(D.JSON),value:Cb(),autogeneration:d.null()})}function KU(){return Jt().extend({name:d.literal(D.Enum),value:d.string(),autogeneration:d.null()})}function ex(){return Jt().extend({name:d.literal(D.File),value:d.string(),autogeneration:d.null()})}function tx(){return Jt().extend({name:d.literal(D.UUID),value:d.string(),autogeneration:Kl.nullable()})}function nx(){return Jt().extend({name:d.literal(D.EntityTemplate),value:cr(),autogeneration:d.null()})}function rx(){return Jt().extend({name:d.literal(D.ActionDescriptor),value:aa(),autogeneration:d.null()})}function bc(){return d.union([HU(),YU(),zU(),ZU(),XU(),QU(),KU(),ex(),tx(),nx(),rx()])}function yn(){return d.union([d.object({type:d.literal(i.DataType)}),d.record(d.string(),d.any())])}function gc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.DataType)})}function vc(){return d.object({id:d.string(),type:d.literal(i.DataType),isNullable:d.boolean(),isList:d.boolean(),constant:d.boolean(),asType:d.boolean(),options:d.array(d.string()).optional()})}function ix(){return vc().merge(d.object({version:d.number()}))}function ax(){return vc().merge(d.object({}))}function sx(){return d.object({defaultValue:bc().nullable(),entity:d.union([ai(),Zr(),Os(),Qt()]).nullable(),parent:d.union([Ib(),Nb(),Nn(),vb()])})}function ox(){return ix().merge(sx())}function Ic(){return d.union([d.object({type:d.literal(i.VariableDeclaration)}),d.record(d.string(),d.any())])}function lx(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.VariableDeclaration)})}function Pc(){return d.object({id:d.string(),type:d.literal(i.VariableDeclaration),name:d.string(),description:d.string().nullable()})}function cx(){return Pc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function dx(){return Pc().merge(d.object({}))}function ux(){return d.object({dataType:yn().nullable(),readsValue:ia().nullable(),writesValues:d.array(hn()),inputs:d.array(Ct()),outputs:d.array(yt()),successCalls:d.array(ke()),errorCalls:d.array(ke()),internalCalls:d.array(ra()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),parent:d.union([fn(),vt()])})}function px(){return cx().merge(ux())}function _b(){return d.union([d.object({type:d.literal(i.VariableInstance)}),d.record(d.string(),d.any())])}function yx(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.VariableInstance)})}function Dc(){return d.object({id:d.string(),type:d.literal(i.VariableInstance)})}function hx(){return Dc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function fx(){return Dc().merge(d.object({}))}function mx(){return d.object({declaration:Ic(),dataType:yn().nullable(),readsValue:ia().nullable(),writesValues:d.array(hn()),inputs:d.array(Ct()),outputs:d.array(yt()),successCalls:d.array(ke()),errorCalls:d.array(ke()),internalCalls:d.array(ra()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),parent:d.union([fn(),vt()])})}function Tx(){return hx().merge(mx())}function Ac(){return d.union([d.object({type:d.literal(i.InstalledProject)}),d.record(d.string(),d.any())])}function Ls(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.InstalledProject)})}function Ex(){return d.object({id:d.string(),type:d.literal(i.InstalledProject)})}function Rx(){return d.object({version:d.number(),x:d.number(),y:d.number()})}function bx(){return d.object({})}function gx(){return d.object({implements:vt(),description:d.string().nullable(),functions:d.array(Bt()),events:d.array(Sc()),parent:vt()})}function vx(){return Rx().merge(gx())}function Sc(){return d.union([d.object({type:d.literal(i.GlobalEvent)}),d.record(d.string(),d.any())])}function Ix(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.GlobalEvent)})}function Gs(){return d.object({id:d.string(),type:d.literal(i.GlobalEvent),name:d.string(),collapsed:d.boolean()})}function Px(){return Gs().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function Dx(){return Gs().merge(d.object({}))}function Ax(){return Gs().merge(d.object({returnStatements:d.array(sr()),implements:d.array(Db()),inputs:d.array(lr()),calls:d.array(ke()),parent:d.union([vt(),Ls()])}))}function Sx(){return Px().merge(Ax())}function or(){return d.union([Ic(),_b()])}function Vn(){return d.union([lx(),yx()])}function hn(){return d.union([or(),Ct(),un()])}function Mb(){return d.union([Vn(),Ns(),Sb()])}function ia(){return d.union([or(),lr(),yt(),ri(),ra(),ni()])}function Ox(){return d.union([Vn(),Oc(),pc(),ii(),Tc(),Ki()])}function Cx(){return d.union([lr(),yt(),hn()])}function Nb(){return d.union([Oc(),pc(),Mb()])}function Fs(){return Sc()}function Us(){return Ix()}function xs(){return d.union([ri(),ni(),ea(),ta(),or(),ra(),Xr()])}function le(){return d.union([ii(),Ki(),Ms(),na(),Vn(),Tc(),Kt()])}function js(){return d.union([ri(),ni(),ea(),ta(),or(),Xr()])}function ks(){return d.union([ii(),Ki(),Ms(),na(),Vn(),Kt()])}function Vb(){return d.union([xs(),sr(),ti(),Qr()])}function ke(){return d.union([le(),ei(),pn(),Kr()])}function $b(){return d.union([js(),sr(),ti(),Qr()])}function Lb(){return d.union([ks(),ei(),pn(),Kr()])}function $n(){return d.union([Bt(),Fs()])}function je(){return d.union([aa(),Us()])}function Bx(){return d.union([xs(),$n()])}function wx(){return d.union([le(),je()])}function _x(){return d.union([js(),$n()])}function Mx(){return d.union([ks(),je()])}function Nx(){return d.union([Vb(),$n()])}function Vx(){return d.union([ke(),je()])}function $x(){return d.union([$b(),$n()])}function Lx(){return d.union([Lb(),je()])}function Gx(){return d.union([$n(),Xr()])}function fn(){return d.union([je(),Kt()])}function Fx(){return d.union([xs(),$n()])}function Ux(){return d.union([le(),je()])}function xx(){return d.union([js(),$n()])}function jx(){return d.union([ks(),je()])}function kx(){return d.union([sr(),ti(),Qr()])}function qx(){return d.union([ei(),pn(),Kr()])}function Jx(){return d.union([Zr(),r8(),Ac(),ai(),Bt(),Fs(),or(),Ct(),yt(),ea(),ri(),ni(),un(),lr(),Os(),yn(),ar(),Qt(),sr(),Qr(),ti(),Xr(),ta(),Qt(),Qt(),Qi(),ra()])}function Wx(){return d.union([ws(),vt(),Ls(),cr(),aa(),Us(),Vn(),Ns(),pc(),Ms(),ii(),Ki(),Sb(),Oc(),Cs(),gc(),Ib(),Nn(),ei(),Kr(),pn(),Kt(),na(),Nn(),Nn(),vb(),Tc()])}function Hx(){return d.union([Ac(),ai(),Bt(),Fs(),or(),ea(),ri(),ni(),sr(),Qr(),ti(),Xr(),ta()])}function Yx(){return d.union([Ls(),cr(),aa(),Us(),Vn(),Ms(),ii(),Ki(),ei(),Kr(),pn(),Kt(),na()])}function lr(){return d.union([d.object({type:d.literal(i.ArgumentDeclaration)}),d.record(d.string(),d.any())])}function Oc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ArgumentDeclaration)})}function Cc(){return d.object({id:d.string(),type:d.literal(i.ArgumentDeclaration)})}function zx(){return Cc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function Zx(){return Cc().merge(d.object({}))}function Xx(){return d.object({dataType:yn().nullable(),writesValues:d.array(hn()),parent:d.union([je(),Nn(),Nn(),na(),pn()])})}function Qx(){return zx().merge(Xx())}function Bt(){return d.union([d.object({type:d.literal(i.FunctionDeclaration)}),d.record(d.string(),d.any())])}function aa(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.FunctionDeclaration)})}function Bc(){return d.object({id:d.string(),type:d.literal(i.FunctionDeclaration),name:d.string(),description:d.string().nullable()})}function Kx(){return Bc().merge(d.object({version:d.number(),x:d.number(),y:d.number(),index:d.number().nullable()}))}function e8(){return Bc()}function t8(){return d.object({inputs:d.array(lr()),implements:Qt().nullable(),returnStatements:d.array(sr()),parent:d.union([vt(),Ls(),cr(),Kt(),ws(),Cs()])})}function n8(){return Kx().merge(t8())}function r8(){return d.union([d.object({type:d.literal(i.Project)}),d.record(d.string(),d.any())])}function vt(){return d.object({entityType:d.literal(i.Project),entityId:d.string(),id:d.string(),type:d.literal(i.GenericReference)})}function wc(){return d.object({id:d.string(),type:d.literal(i.Project),name:d.string(),description:d.string().nullable()})}function i8(){return wc().merge(d.object({version:d.number()}))}function a8(){return wc()}function s8(){return d.object({entities:d.array(ai()),functions:d.array(Bt()),events:d.array(Sc()),projects:d.array(Ac()),variableDeclarations:d.array(Ic()),variableInstances:d.array(_b()),conditions:d.array(ea()),operations:d.array(ri()),functionCalls:d.array(ni()),loops:d.array(Xr()),searches:d.array(ta())})}function o8(){return i8().merge(s8())}function ai(){return d.union([d.object({type:d.literal(i.CustomEntity)}),d.record(d.string(),d.any())])}function cr(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.CustomEntity)})}function _c(){return d.object({id:d.string(),type:d.literal(i.CustomEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function l8(){return _c().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function c8(){return _c().merge(d.object({}))}function d8(){return d.union([vt(),gc()])}function u8(){return d.object({properties:d.array(ar()),methods:d.array(Bt()),abstractMethods:d.array(Qt()),extends:d.array(d.union([ai(),Zr()])),implements:d.array(d.union([ai(),Zr()])),parent:d8()})}function p8(){return l8().merge(u8())}function y8(n){const e=p8(),t=n.toJSON();e.safeParse(t).success;const a=n.implements.flatMap(f=>m8(n,f)),s=n.extends.flatMap(f=>T8(n,f)),o=R8(n),l=E8(n);n.methods.flatMap(f=>f.validate());const p=[...a,...s,...o,...l];return ee(n.errors,p)}function h8(n,e){const t=e.properties.filter(s=>s.abstract),r=[];let a=[...n.properties];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):r.push(s)}),r}function f8(n,e){const t=e.abstractMethods,r=[];let a=[...n.methods];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):r.push(s)}),r}function m8(n,e){const t=[];if(!e.abstract){const f=q({id:n.id+"--"+B.ImplementingNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:B.ImplementingNonAbstractEntity,entity:n});return t.push(f.error),t}const r=e.properties.filter(f=>f.abstract),a=[];let s=[...n.properties];r.forEach(f=>{const m=s.find(b=>{var g;return((g=b.implements)==null?void 0:g.id)===f.id});m?s=s.filter(b=>b.id!==m.id):a.push(f)}),a.length&&a.forEach(f=>{const m=q({id:n.id+"--"+B.MissingPropertyImplementation+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:T.Error,code:B.MissingPropertyImplementation,entity:n});t.push(m.error)});const o=[];let l=[...n.methods];e.abstractMethods.forEach(f=>{const m=l.find(b=>{var g;return((g=b.implements)==null?void 0:g.id)===f.id});m?l=l.filter(b=>b.id!==m.id):o.push(f)}),o.length&&o.forEach(f=>{const m=q({id:n.id+"--"+B.MissingMethodImplementation+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:T.Error,code:B.MissingMethodImplementation,entity:n});t.push(m.error)});const p=[];e.properties.forEach(f=>{const m=s.find(b=>b.name===f.name);m&&p.push([m,f])}),p.length&&p.forEach(([f])=>{const m=q({id:n.id+"--"+I.PropertyOverwrite+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.PropertyOverwrite,entity:n});t.push(m.error)});const y=[];return e.methods.forEach(f=>{const m=l.find(b=>b.name===f.name);m&&y.push([m,f])}),y.length&&y.forEach(([f])=>{const m=q({id:n.id+"--"+I.MethodOverwrite+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.MethodOverwrite,entity:n});t.push(m.error)}),t}function T8(n,e){const t=[],r=[];if(e.abstract){const s=q({id:n.id+"--"+B.ExtendingAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:B.ExtendingAbstractEntity,entity:n});return t.push(s.error),t}n.properties.forEach(s=>{var l;const o=e.properties.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&r.push(s)}),r.length&&r.forEach(s=>{const o=q({id:n.id+"--"+I.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.PropertyOverwrite,entity:n});t.push(o.error)});const a=[];return n.methods.forEach(s=>{var l;const o=e.methods.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=q({id:n.id+"--"+I.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.MethodOverwrite,entity:n});t.push(o.error)}),t}function E8(n){const e=[];if(!n.properties.length){const t=q({id:n.id+"--"+B.NoProperties,message:"No properties implemented",issue:null,severity:T.Warning,code:B.NoProperties,entity:n});e.push(t.error)}return n.properties.forEach(t=>{t.validate()}),e}function R8(n){const e=[];if(n.abstract){if(n.methods.length){const t=q({id:n.id+"--"+B.AbstractEntityWithNonAbstractMethods,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:T.Error,code:B.AbstractEntityWithNonAbstractMethods,entity:n});e.push(t.error)}if(n.properties.some(t=>!t.abstract)){const t=q({id:n.id+"--"+B.AbstractEntityWithNonAbstractProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:T.Error,code:B.AbstractEntityWithNonAbstractProperties,entity:n});e.push(t.error),n.properties.forEach(r=>{if(!r.abstract){const a=q({id:n.id+"--"+B.StaticEntityWithNonStaticProperties+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${n.name}" with id "${n.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:T.Error,code:B.StaticEntityWithNonStaticProperties,entity:n});e.push(a.error)}})}}else{if(n.abstractMethods.length){const t=q({id:n.id+"--"+B.AbstractPropertyInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract methods`,issue:null,severity:T.Error,code:B.AbstractPropertyInNonAbstractEntity,entity:n});e.push(t.error)}if(n.properties.some(t=>t.abstract)){const t=q({id:n.id+"--"+B.AbstractMethodInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract properties`,issue:null,severity:T.Error,code:B.AbstractMethodInNonAbstractEntity,entity:n});e.push(t.error),n.properties.forEach(r=>{if(r.abstract){const a=q({id:n.id+"--"+B.AbstractMethodInNonAbstractEntity+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${n.name}" with id "${n.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:T.Error,code:B.AbstractMethodInNonAbstractEntity,entity:n});e.push(a.error)}})}}if(n.static&&n.properties.some(t=>!t.static)){const t=q({id:n.id+"--"+B.StaticEntityWithNonStaticProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as static but has non-static properties`,issue:null,severity:T.Error,code:B.StaticEntityWithNonStaticProperties,entity:n});e.push(t.error),n.properties.forEach(r=>{if(!r.static){const a=q({id:n.id+"--"+B.NonStaticPropertyInStaticEntity+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${n.name}" with id "${n.id}" is not marked as static but the entity is marked as static`,issue:null,severity:T.Error,code:B.NonStaticPropertyInStaticEntity,entity:n});e.push(a.error)}})}return e}function b8(n){return n instanceof Error&&n.name==="ZodError"&&"issues"in n&&Array.isArray(n.issues)}var g8=class extends Error{constructor(e,t){super(e,t);c(this,"name");c(this,"details");this.name="ZodValidationError",this.details=v8(t)}toString(){return this.message}};function v8(n){if(n){const e=n.cause;if(b8(e))return e.issues}return[]}var I8="; ",Gb="Validation error",P8=": ",D8=", or ";function A8(n,e,t){return e!==null?n.length>0?[e,n].join(t):e:n.length>0?n:Gb}var S8=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function O8(n){return n.length===1?n[0].toString():n.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+C8(t)+'"]';if(!S8.test(t))return e+'["'+t+'"]';const r=e.length===0?"":".";return e+r+t},"")}function C8(n){return n.replace(/"/g,'\\"')}function B8(n){return n.length!==0}function qs(n){const{issue:e,issueSeparator:t,unionSeparator:r,includePath:a}=n;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const l=o.issues.map(p=>qs({issue:p,issueSeparator:t,unionSeparator:r,includePath:a})).join(t);return s.includes(l)||s.push(l),s},[]).join(r);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>qs({issue:s,issueSeparator:t,unionSeparator:r,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>qs({issue:s,issueSeparator:t,unionSeparator:r,includePath:a}))].join(t);if(a&&B8(e.path)){if(e.path.length===1){const s=e.path[0];if(typeof s=="number")return`${e.message} at index ${s}`}return`${e.message} at "${O8(e.path)}"`}return e.message}function w8(n,e={}){const{issueSeparator:t=I8,unionSeparator:r=D8,prefixSeparator:a=P8,prefix:s=Gb,includePath:o=!0}=e,l=qs({issue:n,issueSeparator:t,unionSeparator:r,includePath:o}),p=A8(l,s,a);return new g8(p,{cause:new Rt([n])})}var Fb="1.13.7",Ub=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Js=Array.prototype,Mc=Object.prototype,xb=typeof Symbol<"u"?Symbol.prototype:null,_8=Js.push,sa=Js.slice,oa=Mc.toString,M8=Mc.hasOwnProperty,jb=typeof ArrayBuffer<"u",N8=typeof DataView<"u",V8=Array.isArray,kb=Object.keys,qb=Object.create,Jb=jb&&ArrayBuffer.isView,$8=isNaN,L8=isFinite,Wb=!{toString:null}.propertyIsEnumerable("toString"),Hb=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G8=Math.pow(2,53)-1;function It(n,e){return e=e==null?n.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),r=Array(t),a=0;a<t;a++)r[a]=arguments[a+e];switch(e){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r);case 2:return n.call(this,arguments[0],arguments[1],r)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=r,n.apply(this,s)}}function Ln(n){var e=typeof n;return e==="function"||e==="object"&&!!n}function F8(n){return n===null}function Yb(n){return n===void 0}function zb(n){return n===!0||n===!1||oa.call(n)==="[object Boolean]"}function U8(n){return!!(n&&n.nodeType===1)}function at(n){var e="[object "+n+"]";return function(t){return oa.call(t)===e}}const Nc=at("String"),Zb=at("Number"),x8=at("Date"),j8=at("RegExp"),k8=at("Error"),Xb=at("Symbol"),Qb=at("ArrayBuffer");var Kb=at("Function"),q8=Ub.document&&Ub.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof q8!="function"&&(Kb=function(n){return typeof n=="function"||!1});const ht=Kb,eg=at("Object");var tg=N8&&(!/\[native code\]/.test(String(DataView))||eg(new DataView(new ArrayBuffer(8)))),Vc=typeof Map<"u"&&eg(new Map),J8=at("DataView");function W8(n){return n!=null&&ht(n.getInt8)&&Qb(n.buffer)}const Ws=tg?W8:J8,dr=V8||at("Array");function Gn(n,e){return n!=null&&M8.call(n,e)}var $c=at("Arguments");(function(){$c(arguments)||($c=function(n){return Gn(n,"callee")})})();const Lc=$c;function H8(n){return!Xb(n)&&L8(n)&&!isNaN(parseFloat(n))}function ng(n){return Zb(n)&&$8(n)}function rg(n){return function(){return n}}function ig(n){return function(e){var t=n(e);return typeof t=="number"&&t>=0&&t<=G8}}function ag(n){return function(e){return e==null?void 0:e[n]}}const Hs=ag("byteLength"),Y8=ig(Hs);var z8=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function Z8(n){return Jb?Jb(n)&&!Ws(n):Y8(n)&&z8.test(oa.call(n))}const sg=jb?Z8:rg(!1),Pt=ag("length");function X8(n){for(var e={},t=n.length,r=0;r<t;++r)e[n[r]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,n.push(a)}}}function og(n,e){e=X8(e);var t=Hb.length,r=n.constructor,a=ht(r)&&r.prototype||Mc,s="constructor";for(Gn(n,s)&&!e.contains(s)&&e.push(s);t--;)s=Hb[t],s in n&&n[s]!==a[s]&&!e.contains(s)&&e.push(s)}function We(n){if(!Ln(n))return[];if(kb)return kb(n);var e=[];for(var t in n)Gn(n,t)&&e.push(t);return Wb&&og(n,e),e}function la(n){if(n==null)return!0;var e=Pt(n);return typeof e=="number"&&(dr(n)||Nc(n)||Lc(n))?e===0:Pt(We(n))===0}function lg(n,e){var t=We(e),r=t.length;if(n==null)return!r;for(var a=Object(n),s=0;s<r;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function te(n){if(n instanceof te)return n;if(!(this instanceof te))return new te(n);this._wrapped=n}te.VERSION=Fb,te.prototype.value=function(){return this._wrapped},te.prototype.valueOf=te.prototype.toJSON=te.prototype.value,te.prototype.toString=function(){return String(this._wrapped)};function cg(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,Hs(n))}var dg="[object DataView]";function Gc(n,e,t,r){if(n===e)return n!==0||1/n===1/e;if(n==null||e==null)return!1;if(n!==n)return e!==e;var a=typeof n;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:ug(n,e,t,r)}function ug(n,e,t,r){n instanceof te&&(n=n._wrapped),e instanceof te&&(e=e._wrapped);var a=oa.call(n);if(a!==oa.call(e))return!1;if(tg&&a=="[object Object]"&&Ws(n)){if(!Ws(e))return!1;a=dg}switch(a){case"[object RegExp]":case"[object String]":return""+n==""+e;case"[object Number]":return+n!=+n?+e!=+e:+n==0?1/+n===1/e:+n==+e;case"[object Date]":case"[object Boolean]":return+n==+e;case"[object Symbol]":return xb.valueOf.call(n)===xb.valueOf.call(e);case"[object ArrayBuffer]":case dg:return ug(cg(n),cg(e),t,r)}var s=a==="[object Array]";if(!s&&sg(n)){var o=Hs(n);if(o!==Hs(e))return!1;if(n.buffer===e.buffer&&n.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof n!="object"||typeof e!="object")return!1;var l=n.constructor,p=e.constructor;if(l!==p&&!(ht(l)&&l instanceof l&&ht(p)&&p instanceof p)&&"constructor"in n&&"constructor"in e)return!1}t=t||[],r=r||[];for(var y=t.length;y--;)if(t[y]===n)return r[y]===e;if(t.push(n),r.push(e),s){if(y=n.length,y!==e.length)return!1;for(;y--;)if(!Gc(n[y],e[y],t,r))return!1}else{var f=We(n),m;if(y=f.length,We(e).length!==y)return!1;for(;y--;)if(m=f[y],!(Gn(e,m)&&Gc(n[m],e[m],t,r)))return!1}return t.pop(),r.pop(),!0}function Q8(n,e){return Gc(n,e)}function ca(n){if(!Ln(n))return[];var e=[];for(var t in n)e.push(t);return Wb&&og(n,e),e}function Fc(n){var e=Pt(n);return function(t){if(t==null)return!1;var r=ca(t);if(Pt(r))return!1;for(var a=0;a<e;a++)if(!ht(t[n[a]]))return!1;return n!==hg||!ht(t[Uc])}}var Uc="forEach",pg="has",xc=["clear","delete"],yg=["get",pg,"set"],K8=xc.concat(Uc,yg),hg=xc.concat(yg),e6=["add"].concat(xc,Uc,pg);const t6=Vc?Fc(K8):at("Map"),n6=Vc?Fc(hg):at("WeakMap"),r6=Vc?Fc(e6):at("Set"),i6=at("WeakSet");function si(n){for(var e=We(n),t=e.length,r=Array(t),a=0;a<t;a++)r[a]=n[e[a]];return r}function a6(n){for(var e=We(n),t=e.length,r=Array(t),a=0;a<t;a++)r[a]=[e[a],n[e[a]]];return r}function fg(n){for(var e={},t=We(n),r=0,a=t.length;r<a;r++)e[n[t[r]]]=t[r];return e}function jc(n){var e=[];for(var t in n)ht(n[t])&&e.push(t);return e.sort()}function kc(n,e){return function(t){var r=arguments.length;if(e&&(t=Object(t)),r<2||t==null)return t;for(var a=1;a<r;a++)for(var s=arguments[a],o=n(s),l=o.length,p=0;p<l;p++){var y=o[p];(!e||t[y]===void 0)&&(t[y]=s[y])}return t}}const mg=kc(ca),Ys=kc(We),Tg=kc(ca,!0);function s6(){return function(){}}function Eg(n){if(!Ln(n))return{};if(qb)return qb(n);var e=s6();e.prototype=n;var t=new e;return e.prototype=null,t}function o6(n,e){var t=Eg(n);return e&&Ys(t,e),t}function l6(n){return Ln(n)?dr(n)?n.slice():mg({},n):n}function c6(n,e){return e(n),n}function Rg(n){return dr(n)?n:[n]}te.toPath=Rg;function da(n){return te.toPath(n)}function qc(n,e){for(var t=e.length,r=0;r<t;r++){if(n==null)return;n=n[e[r]]}return t?n:void 0}function bg(n,e,t){var r=qc(n,da(e));return Yb(r)?t:r}function d6(n,e){e=da(e);for(var t=e.length,r=0;r<t;r++){var a=e[r];if(!Gn(n,a))return!1;n=n[a]}return!!t}function Jc(n){return n}function ua(n){return n=Ys({},n),function(e){return lg(e,n)}}function Wc(n){return n=da(n),function(e){return qc(e,n)}}function pa(n,e,t){if(e===void 0)return n;switch(t??3){case 1:return function(r){return n.call(e,r)};case 3:return function(r,a,s){return n.call(e,r,a,s)};case 4:return function(r,a,s,o){return n.call(e,r,a,s,o)}}return function(){return n.apply(e,arguments)}}function gg(n,e,t){return n==null?Jc:ht(n)?pa(n,e,t):Ln(n)&&!dr(n)?ua(n):Wc(n)}function Hc(n,e){return gg(n,e,1/0)}te.iteratee=Hc;function Dt(n,e,t){return te.iteratee!==Hc?te.iteratee(n,e):gg(n,e,t)}function u6(n,e,t){e=Dt(e,t);for(var r=We(n),a=r.length,s={},o=0;o<a;o++){var l=r[o];s[l]=e(n[l],l,n)}return s}function vg(){}function p6(n){return n==null?vg:function(e){return bg(n,e)}}function y6(n,e,t){var r=Array(Math.max(0,n));e=pa(e,t,1);for(var a=0;a<n;a++)r[a]=e(a);return r}function Yc(n,e){return e==null&&(e=n,n=0),n+Math.floor(Math.random()*(e-n+1))}const ya=Date.now||function(){return new Date().getTime()};function Ig(n){var e=function(s){return n[s]},t="(?:"+We(n).join("|")+")",r=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,r.test(s)?s.replace(a,e):s}}const Pg={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},h6=Ig(Pg),f6=fg(Pg),m6=Ig(f6),T6=te.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var zc=/(.)^/,E6={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},R6=/\\|'|\r|\n|\u2028|\u2029/g;function b6(n){return"\\"+E6[n]}var g6=/^\s*(\w|\$)+\s*$/;function v6(n,e,t){!e&&t&&(e=t),e=Tg({},e,te.templateSettings);var r=RegExp([(e.escape||zc).source,(e.interpolate||zc).source,(e.evaluate||zc).source].join("|")+"|$","g"),a=0,s="__p+='";n.replace(r,function(y,f,m,b,g){return s+=n.slice(a,g).replace(R6,b6),a=g+y.length,f?s+=`'+
|
|
1
|
+
(function(u,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(u=typeof globalThis<"u"?globalThis:u||self,i(u["@elyx-code/project-logic-tree"]={}))})(this,function(u){"use strict";var Z3=Object.defineProperty;var X3=(u,i,N)=>i in u?Z3(u,i,{enumerable:!0,configurable:!0,writable:!0,value:N}):u[i]=N;var c=(u,i,N)=>(X3(u,typeof i!="symbol"?i+"":i,N),N);var i=(n=>(n.CustomEntity="custom-entity",n.BuiltInBaseEntity="built-in-base-entity",n.Project="project",n.InstalledProject="installed-project",n.GlobalEvent="global-event",n.DataType="data-type",n.FunctionCall="function-call",n.FunctionDeclaration="function-declaration",n.ActionDescriptor="action-descriptor",n.ValueDescriptor="value-descriptor",n.ArgumentDeclaration="argument-declaration",n.InputMap="input-map",n.ReturnStatement="return-statement",n.BreakStatement="break-statement",n.ContinueStatement="continue-statement",n.ReturnDeclaration="return-declaration",n.OutputMap="output-map",n.PrimitiveEntity="primitive-entity",n.PrimitiveValue="primitive-value",n.Property="property",n.Operation="operation",n.Condition="condition",n.VariableDeclaration="variable-declaration",n.VariableInstance="variable-instance",n.Search="search",n.Loop="loop",n.InternalCall="internal-call",n.GenericReference="generic-reference",n))(i||{}),N=(n=>(n.HTTP_ENDPOINT="BUILT_IN_HTTP_ENDPOINT_ENTITY",n.RELATIONAL_DATABASE="BUILT_IN_RELATIONAL_DATABASE_ENTITY",n.PERSISTED_ENTITY="BUILT_IN_PERSISTED_ENTITY_ENTITY",n.CRON_JOB="BUILT_IN_CRON_JOB_ENTITY",n.EXECUTION="BUILT_IN_EXECUTION_ENTITY",n.KEY_VALUE_PARAM="BUILT_IN_KEY_VALUE_PARAM_ENTITY",n))(N||{}),xe=(n=>(n.CurrentDateAndTime="current-date-and-time",n.Unique="unique",n.Random="random",n))(xe||{}),At=(n=>(n.DeletePersistedEntity="base-delete-persisted-entity",n.SoftDeletePersistedEntity="base-soft-delete-persisted-entity",n.AbortExecution="base-abort-execution",n))(At||{}),F=(n=>(n.Fixed="fixed",n.None="none",n.Dynamic="dynamic",n))(F||{}),w=(n=>(n.FixedArguments="fixed-arguments",n.FixedReturns="fixed-returns",n.ReturnedError="returned-error",n.OngoingProcessExecution="ongoing-process-execution",n))(w||{}),D=(n=>(n.EntityTemplate="entity-template",n.ActionDescriptor="action-descriptor",n.String="string",n.Number="number",n.Boolean="boolean",n.Null="null",n.Enum="enum",n.JSON="json",n.Date="date",n.UUID="uuid",n.File="file",n))(D||{}),ot=(n=>(n.Addition="addition",n.Substraction="substraction",n.Multiplication="multiplication",n.Division="division",n.Remainder="remainder",n.Exponentiation="exponentiation",n))(ot||{}),De=(n=>(n.Join="string-join",n.Split="stringSsplit",n.DeleteLast="string-delete-last",n.DeleteFirst="string-delete-first",n.DeleteIndex="string-delete-index",n.AddIndex="string-add-index",n.ReplaceFirst="string-replace-first",n.ReplaceLast="string-replace-last",n.ReplaceIndex="string-replace-index",n.ReplaceSingleMatch="string-replace-single-match",n.ReplaceAllMatches="string-replace-all-matches",n.GetIndex="string-get-index",n.GetFirst="string-get-first",n.GetLast="string-get-last",n.Append="string-append",n.Prepend="string-prepend",n))(De||{}),k=(n=>(n.Join="list-join",n.Split="list-split",n.DeleteLast="list-delete-last",n.DeleteFirst="list-delete-first",n.DeleteIndex="list-delete-index",n.AddIndex="list-add-index",n.ReplaceFirst="list-replace-first",n.ReplaceLast="list-replace-last",n.ReplaceIndex="list-replace-index",n.ReplaceSingleMatch="list-replace-single-match",n.ReplaceAllMatches="list-replace-all-matches",n.GetIndex="list-get-index",n.GetFirst="list-get-first",n.GetLast="list-get-last",n.Append="list-append",n.Prepend="list-prepend",n))(k||{}),Ae=(n=>(n.Parallel="parallel",n.Sequential="sequential",n.Wait="wait",n))(Ae||{}),Qe=(n=>(n.CreateNewInstance="create-new-instance",n.Validate="validate",n))(Qe||{}),Ye=(n=>(n.HttpRequest="base-http-request",n))(Ye||{}),Be=(n=>(n.Equal="equal",n.NotEqual="not-equal",n.And="and",n.Or="or",n.LessThan="less-than",n.MoreThan="more-than",n.LessThanOrEqual="less-than-or-equal",n.MoreThanOrEqual="more-than-or-equal",n))(Be||{}),_t=(n=>(n.Empty="empty",n.NotEmpty="not-empty",n))(_t||{}),Q=(n=>(n.ManualFlow="manual-flow-loop",n.Counted="counted-loop",n.List="list-loop",n.ObjectKeys="object-keys-loop",n.ObjectValues="object-values-loop",n.String="string-loop",n))(Q||{}),qe=(n=>(n.OrDataTypeGroup="or-data-type-group",n.AndDataTypeGroup="and-data-type-group",n.DynamicArgumentTypes="dynamic-argument-types",n.DynamicReturnTypes="dynamic-return-types",n))(qe||{}),rn=(n=>(n.PROJECT_PUBLICATION_COMPLETED="GLOBAL_EVENT_PROJECT_PUBLICATION_COMPLETED",n))(rn||{}),Gd=(n=>(n.Error="error",n.Task="task",n.Return="return",n))(Gd||{});const Jn=[i.VariableDeclaration,i.VariableInstance,i.InputMap,i.ReturnDeclaration],nI=[i.VariableDeclaration,i.VariableInstance,i.InputMap,i.ReturnDeclaration],_e=[i.VariableDeclaration,i.VariableInstance,i.ArgumentDeclaration,i.OutputMap],rI=[i.VariableDeclaration,i.VariableInstance,i.ArgumentDeclaration,i.OutputMap],Fd=[...Jn,..._e],Fe=[i.VariableDeclaration,i.VariableInstance],wr=[i.GlobalEvent],Ne=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.InternalCall,i.Loop],bo=[i.Operation,i.FunctionCall,i.Condition,i.Search,i.VariableDeclaration,i.VariableInstance,i.Loop],we=[i.FunctionDeclaration,...wr],gn=[...Ne,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],go=[...bo,i.ReturnStatement,i.BreakStatement,i.ContinueStatement],an=[...Ne,...we],Ud=[...bo,...we],iI=[...gn,...we],aI=[...go,...we],lt=[...we,i.Loop],Me=[i.ReturnStatement,i.BreakStatement,i.ContinueStatement],sI=[i.CustomEntity,i.BuiltInBaseEntity,i.Project,i.InstalledProject,i.GlobalEvent,i.DataType,i.FunctionCall,i.FunctionDeclaration,i.ActionDescriptor,i.ValueDescriptor,i.ArgumentDeclaration,i.InputMap,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.ReturnDeclaration,i.OutputMap,i.PrimitiveEntity,i.PrimitiveValue,i.Property,i.Operation,i.Condition,i.VariableDeclaration,i.VariableInstance,i.Search,i.Loop,i.InternalCall],vo=[i.CustomEntity,i.GlobalEvent,i.FunctionDeclaration,i.FunctionCall,i.VariableDeclaration,i.VariableInstance,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.InstalledProject,i.Loop,i.Search],xd=[i.CustomEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor],Mr=[i.BuiltInBaseEntity,i.PrimitiveEntity],oI=[i.CustomEntity,i.FunctionDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.Property,i.VariableDeclaration,i.GlobalEvent,i.Search,i.Project,i.InstalledProject,i.ActionDescriptor,i.ValueDescriptor,i.InputMap,i.OutputMap,i.FunctionCall,i.Operation,i.Condition,i.ReturnStatement,i.BreakStatement,i.ContinueStatement,i.VariableInstance,i.PrimitiveValue,i.InternalCall],U={type:i.PrimitiveEntity,id:"8b5fbe15-4c2b-48c0-9fd8-e5efbe3978dc",description:"A string of characters.",version:1,name:D.String,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},vn={type:i.PrimitiveEntity,id:"f596545d-1565-4faa-9969-d95fa5edfea4",description:"A 'true' or 'false' value.",version:1,name:D.Boolean,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Se={type:i.PrimitiveEntity,id:"ecb84c29-6153-4b82-86a5-fce2b5f92002",description:"A number value.",version:1,name:D.Number,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},Ke={type:i.PrimitiveEntity,id:"730e8ea9-8498-439a-9001-b07de55aaa7d",description:"A complex data structure with any combination of properties with names and values.",version:1,name:D.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},jd={id:"c2f52f01-8f2e-490e-8083-72289c8189c1",type:i.GenericReference,entityId:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",entityType:i.DataType},kd={id:"4e803941-2e6a-4227-b803-b8877c0d7fee",type:i.GenericReference,entityId:"00ccfcae-2104-45ef-bf6c-50ddccd74286",entityType:i.Property},qd={id:"7dd59b70-f97b-43a7-a051-fde1842ce5d6",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:{id:"enum-options-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.JSON,autogeneration:null,value:[],valueAsType:null,parent:jd},parent:kd},Jd={id:"a2983c4c-0286-4ef1-8b5c-5a52904d3200",type:i.GenericReference,entityId:"9542b8b4-2642-4eee-9db9-def7963a17a0",entityType:i.PrimitiveEntity},Wd={hidden:!1,required:!0,id:"00ccfcae-2104-45ef-bf6c-50ddccd74286",name:"Options",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:qd,description:"Options for the enum. Each option is a text value.",parent:Jd},In={type:i.PrimitiveEntity,id:"9542b8b4-2642-4eee-9db9-def7963a17a0",description:"A set of text options to choose from.",version:1,name:D.Enum,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[Wd],methods:[]},sn={type:i.PrimitiveEntity,id:"dc58f38b-d574-4956-aac6-32ce9529b937",description:"A date and time value.",version:1,name:D.Date,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]},va={type:i.PrimitiveEntity,id:"4a6234aa-c0f6-4731-b4dd-750388029226",description:"A unique identifier in the form of a 36-character string.",version:1,name:D.UUID,static:!1,abstract:!1,abstractMethods:[],extends:[U],properties:[],methods:[]},Io={type:i.PrimitiveEntity,id:"b6f3c3c4-9c3d-4f9d-9e9e-1c0f6a3c8c6b",description:"A complex data structure with any combination of properties with names and values.",version:1,name:D.JSON,static:!1,abstract:!1,abstractMethods:[],extends:[],properties:[],methods:[]};var Hd=(n=>(n.FirstInputNumber="number-addition-first-number-argument-declaration",n.SecondInputNumber="number-addition-second-number-argument-declaration",n))(Hd||{}),Yd=(n=>(n.ResultNumber="number-addition-result-number-return-delaration",n.Error="number-addition-error-return-delaration",n))(Yd||{});const zd={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"number-addition-first-number-argument-declaration",entityType:i.ValueDescriptor},Zd={id:"number-addition-first-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zd},Xd={type:i.GenericReference,id:"9f486db2-a983-4293-9eef-81d4fc8d2d3e",entityId:"number-addition-second-number-argument-declaration",entityType:i.ValueDescriptor},Qd={id:"1d4abe83-3e87-4f74-99be-c1fd8c2f8d2d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Xd},Kd={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"number-addition-result-number-return-delaration",entityType:i.ValueDescriptor},eu={id:"b761acec-0755-4582-a68b-76267038bbe1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Kd},tu={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:ot.Addition,entityType:i.ActionDescriptor},Do={id:"number-addition-first-number-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first number to add",dataType:Zd,required:!0,parentRelationType:w.FixedArguments,index:0,parent:tu},nu={type:i.GenericReference,id:"c5015128-4a65-462c-9da0-1c86e83ef897",entityId:ot.Addition,entityType:i.ActionDescriptor},Po={id:"number-addition-second-number-argument-declaration",type:i.ValueDescriptor,description:"The second number to add",version:1,name:"Second value",dataType:Qd,required:!0,parentRelationType:w.FixedArguments,index:1,parent:nu},ru={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:ot.Addition,entityType:i.ActionDescriptor},Ao={parentRelationType:w.FixedReturns,id:"number-addition-result-number-return-delaration",type:i.ValueDescriptor,description:"The result number of the addition",version:1,name:"Result",dataType:eu,required:!0,index:0,parent:ru},iu={type:i.GenericReference,id:"number-addition-operation-error-parent-ref",entityId:ot.Addition,entityType:i.ActionDescriptor},au={parentRelationType:w.FixedReturns,id:"number-addition-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:iu},Ia={id:ot.Addition,type:i.ActionDescriptor,description:"Add two numbers together",version:1,name:ot.Addition,fixedArguments:[Do,Po],error:au,fixedReturns:[Ao],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},su={[ot.Addition]:Ia};var ou=(n=>(n.FirstInputString="join-string-first-string-argument-declaration",n.SecondInputString="join-string-second-string-argument-declaration",n))(ou||{}),lu=(n=>(n.ResultString="join-string-result-string-return-delaration",n.Error="join-string-error-return-delaration",n))(lu||{});const cu={type:i.GenericReference,id:"join-string-first-string-argument-declaration",entityId:"join-string-first-string-argument-declaration",entityType:i.ValueDescriptor},du={id:"join-string-first-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cu},uu={type:i.GenericReference,id:"join-string-second-string-argument-declaration",entityId:"join-string-second-string-argument-declaration",entityType:i.ValueDescriptor},pu={id:"join-string-second-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uu},yu={type:i.GenericReference,id:"join-string-result-string-return-delaration",entityId:"join-string-result-string-return-delaration",entityType:i.ValueDescriptor},hu={id:"join-string-result-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:yu},fu={type:i.GenericReference,id:"join-string-operation-first-string-argument-parent-ref",entityId:De.Join,entityType:i.ActionDescriptor},Da={id:"join-string-first-string-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first text to join to the second one. Its value will be at the beginning of the resulting text.",dataType:du,parentRelationType:w.FixedArguments,required:!0,index:0,parent:fu},mu={type:i.GenericReference,id:"join-string-operation-second-string-argument-parent-ref",entityId:De.Join,entityType:i.ActionDescriptor},Pa={id:"join-string-second-string-argument-declaration",type:i.ValueDescriptor,version:1,name:"Second value",description:"The second text to join to the first one. Its value will be at the end of the resulting text.",dataType:pu,parentRelationType:w.FixedArguments,required:!0,index:1,parent:mu},Tu={type:i.GenericReference,id:"join-string-operation-result-string-return-parent-ref",entityId:De.Join,entityType:i.ActionDescriptor},fi={parentRelationType:w.FixedReturns,id:"join-string-result-string-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting text value.",dataType:hu,required:!0,index:0,parent:Tu},Eu={type:i.GenericReference,id:"join-string-operation-error-parent-ref",entityId:De.Join,entityType:i.ActionDescriptor},Ru={parentRelationType:w.FixedReturns,id:"join-string-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Eu},mi={id:De.Join,type:i.ActionDescriptor,version:1,name:De.Join,description:"Join two text together, to form a single resulting text value.",fixedArguments:[Da,Pa],fixedReturns:[fi],error:Ru,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},bu={[De.Join]:mi};var gu=(n=>(n.FirstInputList="join-list-first-list-argument-declaration",n.SecondInputList="join-list-second-list-argument-declaration",n))(gu||{}),vu=(n=>(n.ResultList="join-list-result-list-return-delaration",n.Error="join-list-error-return-delaration",n))(vu||{});const Iu={type:i.GenericReference,id:"join-list-operation-first-list-argument-ref",entityId:"join-list-first-list-argument-declaration",entityType:i.ValueDescriptor},Du={id:"join-list-first-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Iu},Pu={type:i.GenericReference,id:"join-list-operation-second-list-argument-ref",entityId:"join-list-second-list-argument-declaration",entityType:i.ValueDescriptor},Au={id:"join-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Pu},Su={type:i.GenericReference,id:"join-list-operation-result-list-return-ref",entityId:"join-list-result-list-return-delaration",entityType:i.ValueDescriptor},Ou={id:"join-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Su},Cu={type:i.GenericReference,id:"join-list-operation-first-list-argument-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},Bu={id:"join-list-first-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"First value",description:"The first list to join to the second one. Its values will be at the beginning of the resulting list.",dataType:Du,parentRelationType:w.FixedArguments,required:!0,index:0,parent:Cu},wu={type:i.GenericReference,id:"join-list-operation-second-list-argument-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},Mu={id:"join-list-second-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"Second value",description:"The second list to join to the first one. Its values will be at the end of the resulting list.",dataType:Au,parentRelationType:w.FixedArguments,required:!0,index:1,parent:wu},_u={type:i.GenericReference,id:"join-list-operation-result-list-return-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},Nu={parentRelationType:w.FixedReturns,id:"join-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:Ou,required:!0,index:0,parent:_u},Vu={type:i.GenericReference,id:"join-list-operation-error-parent-ref",entityId:k.Join,entityType:i.ActionDescriptor},$u={parentRelationType:w.FixedReturns,id:"join-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Vu},So={id:k.Join,type:i.ActionDescriptor,version:1,name:k.Join,description:"Join two lists together, to form a single resulting list value.",fixedArguments:[Bu,Mu],error:$u,fixedReturns:[Nu],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Lu=(n=>(n.InputList="list-to-split-argument-declaration",n.SplitIndex="split-list-index-argument-declaration",n))(Lu||{}),Gu=(n=>(n.FirstOutputList="split-list-first-output-list-return-delaration",n.SecondOutputList="split-list-second-output-list-return-delaration",n.Error="split-list-error-return-delaration",n))(Gu||{});const Fu={type:i.GenericReference,id:"split-list-operation-input-list-argument-ref",entityId:"list-to-split-argument-declaration",entityType:i.ValueDescriptor},Uu={id:"split-list-operation-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Fu},xu={type:i.GenericReference,id:"split-list-operation-split-index-argument-ref",entityId:"split-list-index-argument-declaration",entityType:i.ValueDescriptor},ju={id:"split-list-operation-split-index-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xu},Oo={type:i.GenericReference,id:"split-list-operation-first-output-list-return-ref",entityId:"split-list-first-output-list-return-delaration",entityType:i.ValueDescriptor},ku={id:"split-list-operation-first-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Oo},qu={type:i.GenericReference,id:"split-list-operation-input-list-argument-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},Ju={id:"list-to-split-argument-declaration",type:i.ValueDescriptor,version:1,name:"List to split",description:"The list to split at the given index",dataType:Uu,parentRelationType:w.FixedArguments,required:!0,index:0,parent:qu},Wu={type:i.GenericReference,id:"split-list-operation-split-index-argument-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},Hu={id:"split-list-index-argument-declaration",type:i.ValueDescriptor,version:1,name:"Split location",description:"The index at which to split the list. The value at this index will be the first value of the second list.",dataType:ju,parentRelationType:w.FixedArguments,required:!0,index:1,parent:Wu},Yu={type:i.GenericReference,id:"split-list-operation-first-output-list-return-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},zu={parentRelationType:w.FixedReturns,id:"split-list-first-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"First list",description:"The list of values up to the split index",dataType:ku,required:!0,index:0,parent:Yu},Zu={id:"split-list-operation-second-output-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Oo},Xu={type:i.GenericReference,id:"split-list-operation-second-output-list-return-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},Qu={parentRelationType:w.FixedReturns,id:"split-list-second-output-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Second list",description:"The list of values up to the split index",dataType:Zu,required:!0,index:0,parent:Xu},Ku={type:i.GenericReference,id:"split-list-operation-error-parent-ref",entityId:k.Split,entityType:i.ActionDescriptor},ep={parentRelationType:w.FixedReturns,id:"split-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Ku},Co={id:k.Split,type:i.ActionDescriptor,version:1,name:k.Split,description:"Splits a given list at the given index, and returns two lists, one with the values up to the index, and the other with the values after the index",fixedArguments:[Ju,Hu],fixedReturns:[zu,Qu],error:ep,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var tp=(n=>(n.InputList="get-last-in-list-input-list-argument-declaration",n))(tp||{}),np=(n=>(n.OutputElement="get-last-in-list-output-element-return-delaration",n.Error="get-last-in-list-error-return-delaration",n))(np||{});const rp={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-ref",entityId:"get-last-in-list-input-list-argument-declaration",entityType:i.ValueDescriptor},ip={id:"get-last-in-list-input-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:rp},ap={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-ref",entityId:"get-last-in-list-output-element-return-delaration",entityType:i.ValueDescriptor},sp={id:"get-last-in-list-output-element-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:ap},op={type:i.GenericReference,id:"get-last-in-list-operation-input-list-argument-parent-ref",entityId:k.GetLast,entityType:i.ActionDescriptor},lp={id:"get-last-in-list-input-list-argument-declaration",type:i.ValueDescriptor,version:1,name:"List",description:"The list to get the last element from.",dataType:ip,parentRelationType:w.FixedArguments,required:!0,index:0,parent:op},cp={type:i.GenericReference,id:"get-last-in-list-operation-output-element-return-parent-ref",entityId:k.GetLast,entityType:i.ActionDescriptor},dp={parentRelationType:w.FixedReturns,id:"get-last-in-list-output-element-return-delaration",type:i.ValueDescriptor,version:1,name:"Last element",description:"The last element of the given list.",dataType:sp,required:!0,index:0,parent:cp},up={type:i.GenericReference,id:"get-last-in-list-operation-error-parent-ref",entityId:k.GetLast,entityType:i.ActionDescriptor},pp={parentRelationType:w.FixedReturns,id:"get-last-in-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:up},Bo={id:k.GetLast,type:i.ActionDescriptor,version:1,name:k.GetLast,description:"Outputs the last element of a given list.",fixedArguments:[lp],fixedReturns:[dp],error:pp,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var yp=(n=>(n.List="append-to-list-lsit-argument-declaration",n.ElementToAppend="append-to-list-element-to-append-argument-declaration",n))(yp||{}),hp=(n=>(n.ResultList="append-to-list-result-list-return-delaration",n.Error="append-to-list-error-return-delaration",n))(hp||{});const fp={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-ref",entityId:"append-to-list-lsit-argument-declaration",entityType:i.ValueDescriptor},mp={id:"append-to-list-lsit-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:fp},Tp={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-ref",entityId:"append-to-list-element-to-append-argument-declaration",entityType:i.ValueDescriptor},Ep={id:"append-to-list-second-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Tp},Rp={type:i.GenericReference,id:"append-to-list-operation-result-list-return-ref",entityId:"append-to-list-result-list-return-delaration",entityType:i.ValueDescriptor},bp={id:"append-to-list-result-list-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Rp},gp={type:i.GenericReference,id:"append-to-list-operation-lsit-argument-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},wo={id:"append-to-list-lsit-argument-declaration",type:i.ValueDescriptor,version:1,name:"List value",description:"The list to which the element will be appended",dataType:mp,parentRelationType:w.FixedArguments,required:!0,index:0,parent:gp},vp={type:i.GenericReference,id:"append-to-list-operation-second-list-argument-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},Mo={id:"append-to-list-element-to-append-argument-declaration",type:i.ValueDescriptor,version:1,name:"Element",description:"The element that will be added at the end of the list",dataType:Ep,parentRelationType:w.FixedArguments,required:!0,index:1,parent:vp},Ip={type:i.GenericReference,id:"append-to-list-operation-result-list-return-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},Dp={parentRelationType:w.FixedReturns,id:"append-to-list-result-list-return-delaration",type:i.ValueDescriptor,version:1,name:"Result",description:"The resulting list value.",dataType:bp,required:!0,index:0,parent:Ip},Pp={type:i.GenericReference,id:"append-to-list-operation-error-parent-ref",entityId:k.Append,entityType:i.ActionDescriptor},Ap={parentRelationType:w.FixedReturns,id:"append-to-list-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Pp},Aa={id:k.Append,type:i.ActionDescriptor,version:1,name:k.Append,description:"Adds a given element to the end of a list value.",fixedArguments:[wo,Mo],error:Ap,fixedReturns:[Dp],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Sp={[k.Join]:So,[k.Split]:Co,[k.GetLast]:Bo,[k.Append]:Aa};var Op=(n=>(n.ListOfFunctions="parallel-execution-list-of-functions-argument-declaration",n))(Op||{}),Cp=(n=>(n.ListOfExecutionResults="parallel-execution-result-return-delaration",n.Error="parallel-execution-error-return-delaration",n))(Cp||{});const Bp={id:"parallel-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:F.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:F.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},wp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityId:"parallel-execution-list-of-functions-argument-declaration",entityType:i.ValueDescriptor},Mp={id:"parallel-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Bp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:wp},_p={type:i.GenericReference,id:"da5e9fe9-f18a-49e3-98e5-c1bf7b9b3153",entityId:"parallel-execution-result-return-delaration",entityType:i.ValueDescriptor},Np={id:"b761acec-0755-4582-a68b-76267038bbe1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:_p},Vp={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityId:Ae.Parallel,entityType:i.ActionDescriptor},_o={id:"parallel-execution-list-of-functions-argument-declaration",type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Mp,required:!0,index:0,parent:Vp,parentRelationType:w.FixedArguments},$p={type:i.GenericReference,id:"caac2bc7-c23c-4f01-9581-a515c2e4637f",entityId:Ae.Parallel,entityType:i.ActionDescriptor},No={id:"parallel-execution-result-return-delaration",type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:Np,required:!0,index:0,parent:$p,parentRelationType:w.FixedReturns},Lp={type:i.GenericReference,id:"parallel-execution-operation-error-parent-ref",entityId:Ae.Parallel,entityType:i.ActionDescriptor},Gp={id:"parallel-execution-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Lp,parentRelationType:w.ReturnedError},Ut={id:Ae.Parallel,type:i.ActionDescriptor,description:"Execute a list of actions in parallel",version:1,name:Ae.Parallel,fixedArguments:[_o],fixedReturns:[No],argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,error:Gp,parent:null};var Fp=(n=>(n.MillisecondsNumber="wait-milliseconds-number-argument-declaration",n))(Fp||{}),Up=(n=>(n.Error="wait-operation-error-return-delaration",n))(Up||{});const xp={type:i.GenericReference,id:"3bd4aeb2-e3b7-4120-b289-011ebb03dba5",entityType:i.ValueDescriptor,entityId:"wait-milliseconds-number-argument-declaration"},jp={id:"wait-milliseconds-number-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xp},kp={type:i.GenericReference,id:"a6c14305-d4f7-43ae-9d5e-b7dbacdc830a",entityType:i.ActionDescriptor,entityId:Ae.Wait},Wn={id:"wait-milliseconds-number-argument-declaration",type:i.ValueDescriptor,version:1,name:"Milliseconds to wait",description:"The amount of milliseconds to wait before calling the next entity",dataType:jp,required:!0,index:0,parent:kp,parentRelationType:w.FixedArguments},qp={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Ae.Wait,entityType:i.ActionDescriptor},Jp={id:"wait-operation-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:qp,parentRelationType:w.ReturnedError},ct={id:Ae.Wait,type:i.ActionDescriptor,description:"Wait for the given amount of milliseconds before calling the next entity",version:1,name:Ae.Wait,fixedArguments:[Wn],fixedReturns:[],error:Jp,argumentsType:F.Fixed,returnsType:F.None,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var Wp=(n=>(n.ListOfFunctions="sequential-execution-list-of-functions-argument-declaration",n))(Wp||{}),Hp=(n=>(n.ListOfExecutionResults="sequential-execution-result-return-delaration",n.Error="sequential-execution-error-return-delaration",n))(Hp||{});const Yp={id:"sequential-execution-list-of-functions-blueprint-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:F.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:F.Dynamic,dynamicReturnTypes:null,fixedReturns:[],error:null,parent:null},zp={type:i.GenericReference,id:"parallel-execution-list-of-functions-argument-declaration-id",entityId:"sequential-execution-list-of-functions-argument-declaration",entityType:i.ValueDescriptor},Zp={id:"sequential-execution-list-of-functions-argument-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Yp,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:zp},Xp={type:i.GenericReference,id:"sequential-execution-list-of-execution-results-return-declaration-id",entityId:"sequential-execution-result-return-delaration",entityType:i.ValueDescriptor},Qp={id:"sequential-execution-list-of-execution-results-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!0,isNullable:!1,defaultValue:null,constant:!1,parent:Xp},Kp={type:i.GenericReference,id:"parallel-execution-operation-list-of-functions-argument-parent-ref",entityId:Ae.Sequential,entityType:i.ActionDescriptor},Vo={id:"sequential-execution-list-of-functions-argument-declaration",type:i.ValueDescriptor,version:1,name:"Actions to execute",description:"A value, of a list of actions to be executed in parallel",dataType:Zp,required:!0,index:0,parent:Kp,parentRelationType:w.FixedArguments},ey={type:i.GenericReference,id:"parallel-execution-operation-list-of-execution-results-return-parent-ref",entityId:Ae.Sequential,entityType:i.ActionDescriptor},$o={id:"sequential-execution-result-return-delaration",type:i.ValueDescriptor,version:1,name:"List of execution results",description:"Each execution result, in the same order as the input list of actions. One item on this list for each executed action.",dataType:Qp,required:!0,index:0,parent:ey,parentRelationType:w.FixedReturns},ty={type:i.GenericReference,id:"sequential-execution-operation-error-parent-ref",entityId:Ae.Sequential,entityType:i.ActionDescriptor},ny={id:"sequential-execution-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:ty,parentRelationType:w.ReturnedError},on={id:Ae.Sequential,type:i.ActionDescriptor,description:"Execute a list of actions one after the other",version:1,name:Ae.Sequential,fixedArguments:[Vo],fixedReturns:[$o],error:ny,returnsType:F.Fixed,argumentsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},ry={[Ae.Parallel]:Ut,[Ae.Wait]:ct,[Ae.Sequential]:on};var iy=(n=>(n.EntityToInstanciate="entity-to-instanciate-argument-declaration",n))(iy||{}),ay=(n=>(n.Error="create-new-instance-error-return-delaration",n))(ay||{});const sy={type:i.GenericReference,id:"entity-to-instanciate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"entity-to-instanciate-argument-declaration"},oy={id:"entity-to-instanciate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:sy},ly={type:i.GenericReference,id:"create-new-instance-operation-ref",entityType:i.ActionDescriptor,entityId:Qe.CreateNewInstance},cy={id:"entity-to-instanciate-argument-declaration",type:i.ValueDescriptor,version:1,name:"Entity to create a new copy of",description:"The entity of which a new copy will to be created",dataType:oy,required:!0,parentRelationType:w.FixedArguments,index:0,parent:ly},dy={type:i.GenericReference,id:"create-new-instance-output-entity-declaration-parent-ref",entityId:Qe.CreateNewInstance,entityType:i.ActionDescriptor},uy={parentRelationType:w.FixedReturns,id:"create-new-instance-output-entity-declaration",type:i.ValueDescriptor,version:1,dataType:null,name:"Created entity",description:"The entity that was created",parent:dy,required:!0,index:0},py={type:i.GenericReference,id:"create-new-instance-error-parent-ref",entityId:Qe.CreateNewInstance,entityType:i.ActionDescriptor},yy={parentRelationType:w.FixedReturns,id:"create-new-instance-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:py},_r={id:Qe.CreateNewInstance,type:i.ActionDescriptor,description:"Creates a new copy of a given entity, with the given values for each property, or default values if a value is not provided",version:1,name:Qe.CreateNewInstance,fixedArguments:[cy],fixedReturns:[uy],error:yy,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null};var hy=(n=>(n.EntityToMatchType="validate-data-operation-entity-to-match-type-argument-declaration",n.DataToValidate="validate-data-operation-data-to-validate-argument-declaration",n))(hy||{}),fy=(n=>(n.Error="validate-data-error-return-delaration",n.OutputEntity="validate-data-output-entity-declaration",n))(fy||{});const my={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"validate-data-operation-data-to-validate-argument-declaration"},Ty={id:"validate-data-operation-data-to-validate-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:my},Ey={type:i.GenericReference,id:"validate-data-operation-data-to-validate-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Qe.Validate},Ry={id:"validate-data-operation-data-to-validate-argument-declaration",type:i.ValueDescriptor,version:1,name:"Data to validate",description:"The value to validate against the given entity type",dataType:Ty,required:!0,parentRelationType:w.FixedArguments,index:0,parent:Ey},by={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-declaration-ref",entityType:i.ValueDescriptor,entityId:"validate-data-operation-entity-to-match-type-argument-declaration"},gy={id:"validate-data-operation-entity-to-match-type-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!0,isNullable:!1,defaultValue:null,constant:!1,parent:by},vy={type:i.GenericReference,id:"validate-data-operation-entity-to-match-type-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Qe.Validate},Iy={id:"validate-data-operation-entity-to-match-type-argument-declaration",type:i.ValueDescriptor,version:1,name:"Entity to match",description:"The entity to match the data against",dataType:gy,required:!0,index:0,parentRelationType:w.FixedArguments,parent:vy},Dy={type:i.GenericReference,id:"validate-data-operation-output-entity-declaration-parent-ref",entityId:Qe.Validate,entityType:i.ActionDescriptor},Py={id:"validate-data-output-entity-declaration",type:i.ValueDescriptor,version:1,dataType:null,name:"Output value",description:"A value with the type of the entity that was validated",parent:Dy,required:!0,index:0,parentRelationType:w.FixedReturns},Ay={type:i.GenericReference,id:"wait-operation-error-parent-ref",entityId:Qe.Validate,entityType:i.ActionDescriptor},Sy={id:"validate-data-error-return-delaration",type:i.ValueDescriptor,version:1,name:"Error",description:"An error that occurred during the operation.",dataType:null,required:!0,index:1,parent:Ay,parentRelationType:w.ReturnedError},Hn={id:Qe.Validate,type:i.ActionDescriptor,description:"Validates the given data to see if it matches the structure of a given type/entity",version:1,name:Qe.Validate,fixedArguments:[Iy,Ry],fixedReturns:[Py],error:Sy,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},Oy={[Qe.CreateNewInstance]:_r,[Qe.Validate]:Hn};var Lo=(n=>(n.ActionOngoingProcessOutputValue="action-ongoing-process-output-value-descriptor-id",n))(Lo||{});const J={[i.ValueDescriptor]:{"action-ongoing-process-output-value-descriptor-id":{id:"action-ongoing-process-output-value-descriptor-id",dataType:{id:"process-output-value-data-type-id"}}},[i.BuiltInBaseEntity]:{[N.KEY_VALUE_PARAM]:{id:N.KEY_VALUE_PARAM},[N.HTTP_ENDPOINT]:{id:N.HTTP_ENDPOINT,properties:{method:"http-endpoint-built-in-method-property-id",path:"http-endpoint-built-in-path-property-id",cors:"http-endpoint-built-in-cors-property-id"}},[N.PERSISTED_ENTITY]:{id:N.PERSISTED_ENTITY,properties:{database:"persisted-built-in-base-entity-database-property-id",identifier:"persisted-built-in-base-entity-identifier-property-id"}},[N.RELATIONAL_DATABASE]:{id:N.RELATIONAL_DATABASE,properties:{identifier:"relational-database-built-in-base-entity-identifier-property-id",username:"relational-database-built-in-base-entity-username-property-id",password:"relational-database-built-in-base-entity-password-property-id",minSize:"relational-database-built-in-base-entity-min-size-property-id",default:"relational-database-built-in-base-entity-default-property-id",autoscaling:"relational-database-built-in-base-entity-autoscaling-property-id"}},[N.CRON_JOB]:{id:N.CRON_JOB,properties:{expression:"cron-job-built-in-base-entity-expression-property-id"}}},[i.Operation]:{[De.Join]:{id:De.Join,inputs:{first:"join-string-first-string-input-id",second:"join-string-second-string-input-id"},outputs:{result:"join-string-result-string-return-delaration-id",error:"join-string-error-return-delaration-id"}},[Ye.HttpRequest]:{id:Ye.HttpRequest,inputs:{url:"http-request-url-input-id",query:"http-request-query-input-id",method:"http-request-method-input-id",headers:"http-request-headers-input-id",body:"http-request-body-string-input-id"},outputs:{code:"http-response-code-return-delaration-id",body:"http-response-body-return-delaration-id",headers:"http-response-headers-return-delaration-id",error:"http-request-error-return-delaration-id"}}},[i.Loop]:{[Q.List]:{id:Q.List,inputs:{list:"iterate-over-list-loop-list-input-id"},outputs:{results:"iterate-over-list-loop-output-id"}},[Q.String]:{id:Q.String,inputs:{string:"iterate-over-string-loop-string-input-id"},outputs:{results:"iterate-over-string-loop-output-id"}},[Q.ObjectKeys]:{id:Q.ObjectKeys,inputs:{object:"iterate-over-object-keys-loop-object-input-id"},outputs:{results:"iterate-over-object-keys-loop-output-id"}},[Q.ObjectValues]:{id:Q.ObjectValues,inputs:{object:"iterate-over-object-values-loop-object-input-id"},outputs:{results:"iterate-over-object-values-loop-output-id"}},[Q.ManualFlow]:{id:Q.ManualFlow,inputs:{},outputs:{results:"manual-flow-loop-output-id"}},[Q.Counted]:{id:Q.Counted,inputs:{number:"iterate-over-counted-loop-number-input-id"},outputs:{results:"iterate-over-counted-loop-output-id"}}},[i.Condition]:{[Be.MoreThanOrEqual]:{id:Be.MoreThanOrEqual,inputs:{leftHand:"condition-more-than-or-equal-left-hand-input-id",rightHand:"condition-more-than-or-equal-right-hand-input-id"}},[_t.NotEmpty]:{id:_t.NotEmpty,inputs:{leftHand:"condition-not-empty-input-id"}}},[i.GlobalEvent]:{[rn.PROJECT_PUBLICATION_COMPLETED]:{id:rn.PROJECT_PUBLICATION_COMPLETED}}},Je=J[i.Operation]["base-http-request"],Cy={type:i.GenericReference,id:"d87cf943-57e1-4d19-9f05-190fa8c8ebc4",entityType:i.DataType,entityId:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3"},By={id:"http-request-url-default-value-id",type:i.PrimitiveValue,version:1,value:"https://some-url.com",name:D.String,valueAsType:null,parent:Cy,autogeneration:null},wy={type:i.GenericReference,id:"aed50d73-eab5-42ce-b00e-7f5c45a9026f",entityId:Je.inputs.url,entityType:i.ValueDescriptor},My={id:"0deb4ef7-d739-4ddc-a4d6-50bd6fababe3",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:By,constant:!1,parent:wy},_y={type:i.GenericReference,id:"c3145af6-3387-464a-8887-272e483c856d",entityId:Je.inputs.query,entityType:i.ValueDescriptor},Ny={id:"2a5ba737-6335-4cc4-a2c0-16dca4052fac",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_y},Vy={type:i.GenericReference,id:"075556b7-e468-48f7-8485-7159eaf389b2",entityType:i.DataType,entityId:"6df7ec2b-5dbd-44af-896b-17b314e88560"},$y={id:"http-request-method-default-value-id",type:i.PrimitiveValue,version:1,value:"GET",name:D.Enum,valueAsType:null,parent:Vy,autogeneration:null},Ly={type:i.GenericReference,id:"aed647c8-a1b5-4cfc-9a3d-97887a567a80",entityId:Je.inputs.method,entityType:i.ValueDescriptor},Gy={id:"6df7ec2b-5dbd-44af-896b-17b314e88560",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,asType:!1,isNullable:!1,defaultValue:$y,options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],constant:!1,parent:Ly},Fy={type:i.GenericReference,id:"77203dfa-d2f6-4804-9556-e1cce46228f3",entityId:Je.inputs.headers,entityType:i.ValueDescriptor},Uy={id:"2c8a2a07-69c6-40ad-b5c9-f0dc4d5955ce",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Fy},xy={type:i.GenericReference,id:"03db68a0-7ab6-4c6a-85b6-f4b95ebb53ff",entityId:Je.inputs.body,entityType:i.ValueDescriptor},jy={id:"0397876c-ed54-4ee9-85a4-04fd16dad973",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:xy},ky={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:Je.outputs.code},qy={id:"45e6d0bc-0c0e-4059-a7a1-6bee925d73d0",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ky},Jy={type:i.GenericReference,id:"2baaa53a-9aef-4bd1-b06d-967c17b7b627",entityType:i.DataType,entityId:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe"},Wy={type:i.GenericReference,id:"69f34d6c-c686-4165-b6ff-70dae8e1778b",entityType:i.ValueDescriptor,entityId:Je.outputs.headers},Hy={id:"dac63bfa-640d-4f4e-ba0f-86c2401bcfbe",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-headers-default-value-id",type:i.PrimitiveValue,version:1,value:{},name:D.JSON,parent:Jy,valueAsType:null,autogeneration:null},constant:!1,parent:Wy},Yy={type:i.GenericReference,id:"744334e0-5135-4214-85d0-809437cb620b",entityType:i.DataType,entityId:"05fc1a5d-151a-479a-9c4e-4063f3456177"},zy={type:i.GenericReference,id:"0e0e20df-1a46-432c-ba01-fd96508a6a61",entityType:i.ValueDescriptor,entityId:Je.outputs.body},Zy={id:"05fc1a5d-151a-479a-9c4e-4063f3456177",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"http-response-body-default-value-id",type:i.PrimitiveValue,version:1,value:{},name:D.JSON,parent:Yy,valueAsType:null,autogeneration:null},constant:!1,parent:zy},Xy={type:i.GenericReference,id:"26911792-f707-4bf1-b6f7-03d04a84232c",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Sa={id:Je.inputs.method,type:i.ValueDescriptor,description:"A single word that represents the type of request you want to make. For example: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, CUSTOM",version:1,name:"Method",dataType:Gy,required:!1,index:0,parentRelationType:w.FixedArguments,parent:Xy},Qy={type:i.GenericReference,id:"eee0c501-0ae6-4448-b914-aada76d63163",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Oa={id:Je.inputs.url,type:i.ValueDescriptor,description:"The base domain, or address where the request is being sent to. For example: https://some-url.com",version:1,name:"URL",dataType:My,required:!1,index:1,parentRelationType:w.FixedArguments,parent:Qy},Ky={type:i.GenericReference,id:"670091a4-21b1-4223-ad4c-b6dada0aec49",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Go={id:Je.inputs.query,type:i.ValueDescriptor,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",version:1,name:"Query Params",dataType:Ny,required:!1,index:2,parentRelationType:w.FixedArguments,parent:Ky},eh={type:i.GenericReference,id:"85aad3eb-22fe-45f9-b68c-1dc7061f41e0",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Ca={id:Je.inputs.headers,type:i.ValueDescriptor,description:"A set of any properties, with names and values that represent metadata about the request, such as the server, date, content type, and more, that you want to send alongside your request data.",version:1,name:"Headers",dataType:Uy,required:!1,index:3,parent:eh,parentRelationType:w.FixedArguments},th={type:i.GenericReference,id:"c3e2a4af-9b84-4574-8b30-5044ffc51776",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Ba={id:Je.inputs.body,type:i.ValueDescriptor,description:"The main data payload of the request. This is the data that you want to send to the server. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:jy,required:!1,index:4,parentRelationType:w.FixedArguments,parent:th},nh={type:i.GenericReference,id:"92e04dc7-2145-4a31-908e-03810f7235e8",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Fo={id:Je.outputs.code,type:i.ValueDescriptor,description:'A standardized status code of the response. It is a 3-digit number that represents the response status. For example, 200 means "OK", 404 means "Not Found", and 500 means "Internal Server Error".',version:1,name:"Code",dataType:qy,required:!0,index:0,parentRelationType:w.FixedReturns,parent:nh},rh={type:i.GenericReference,id:"86aca556-bbf1-4679-9909-31db61b288e2",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},wa={parentRelationType:w.FixedReturns,id:Je.outputs.headers,type:i.ValueDescriptor,description:"A set of any properties, with names and value that the server sent back to you. It represents metadata about the response, such as the server, date, content type, and more.",version:1,name:"Headers",dataType:Hy,required:!0,index:1,parent:rh},ih={type:i.GenericReference,id:"ccf3d1be-04e4-4d03-99fd-5bc1e1919f90",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},Ti={parentRelationType:w.FixedReturns,id:Je.outputs.body,type:i.ValueDescriptor,description:"The main data payload of the response. This is the data that the server sent back to you. It could be anything, but it is usually a JSON data structure or a text value.",version:1,name:"Body",dataType:Zy,required:!0,index:2,parent:ih},ah={type:i.GenericReference,id:"21487ffc-82b9-473d-bc19-6e7d7c480ed7",entityType:i.ActionDescriptor,entityId:Ye.HttpRequest},sh={type:i.GenericReference,id:"ad69861b-32f7-4461-b7f7-aa84a82578d9",entityType:i.ValueDescriptor,entityId:Je.outputs.error},oh={id:"5da68b15-57bc-40c1-b79f-a9075e0f22c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,isList:!1,asType:!1,isNullable:!1,constant:!1,defaultValue:null,parent:sh},Uo={parentRelationType:w.ReturnedError,id:Je.outputs.error,type:i.ValueDescriptor,description:"Http request error, if any. Contains a payload describing what went wrong.",version:1,name:"Error",dataType:oh,required:!0,index:0,parent:ah},Ei={type:i.ActionDescriptor,id:Ye.HttpRequest,name:Ye.HttpRequest,description:"Make an HTTP request, out to the internet, to a given URL with the specified method, query parameters, headers, and body.",version:1,fixedArguments:[Sa,Oa,Go,Ca,Ba],fixedReturns:[Fo,wa,Ti],argumentsType:F.Fixed,returnsType:F.Fixed,error:Uo,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},lh={[Ye.HttpRequest]:Ei},lI={...bu,...su,...Sp,...ry,...Oy,...lh},ch=J[i.Loop]["list-loop"],dh={id:"iterate-over-list-loop-return-declaration-parent-ref-id",type:i.GenericReference,entityId:Q.List,entityType:i.ActionDescriptor},uh={id:ch.outputs.results,type:i.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:null,required:!0,index:0,parent:dh,parentRelationType:w.FixedReturns},ph={id:"iterate-over-list-loop-list-argument-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"iterate-over-list-loop-list-argument-declaration-id",entityType:i.ArgumentDeclaration},yh={id:"iterate-over-list-loop-list-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:ph},hh={id:"iterate-over-list-loop-list-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Q.List,entityType:i.ActionDescriptor},fh={id:ch.inputs.list,type:i.ValueDescriptor,version:1,name:"List",description:"The list to iterate over",required:!0,dataType:yh,index:0,parent:hh,parentRelationType:w.FixedArguments},Yn={id:Q.List,type:i.ActionDescriptor,version:1,name:Q.List,description:"Iterates over a list of entities",fixedArguments:[fh],fixedReturns:[uh],error:null,argumentsType:F.Fixed,returnsType:F.Fixed,dynamicArgumentTypes:null,dynamicReturnTypes:null,parent:null},cI=J[i.Loop]["list-loop"],mh={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:"manual-flow-loop-previous-iterations-results-declaration-id",entityType:i.ReturnDeclaration},Th={id:"manual-flow-loop-previous-iterations-results-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:mh},Eh={id:"manual-flow-loop-previous-iterations-results-declaration-parent-ref-id",type:i.GenericReference,entityId:Q.ManualFlow,entityType:i.ActionDescriptor},Rh={id:cI.outputs.results,type:i.ValueDescriptor,version:1,name:"Results",description:"List of results from the loop. One item in the list for each iteration of the loop.",dataType:Th,required:!0,index:1,parentRelationType:w.FixedReturns,parent:Eh},xo={id:Q.ManualFlow,type:i.ActionDescriptor,version:1,name:Q.ManualFlow,description:"A loop that is manually controlled by the continue and break statements. It runs until the break statement is called, and it can skip to the next iteration with the continue statement.",fixedArguments:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,fixedReturns:[Rh],argumentsType:F.None,returnsType:F.Fixed,error:null,parent:null},Ma=J[i.BuiltInBaseEntity][N.KEY_VALUE_PARAM],dI={id:"key-value-param-built-in-base-entity-name-property-data-type-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property-data-type",entityType:i.DataType},bh={id:"key-value-param-built-in-base-entity-name-property-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-name-property",entityType:i.Property},uI={id:"key-value-param-built-in-base-entity-name-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:null,parent:bh},gh={id:"key-value-param-built-in-base-entity-name-property-parent-ref",type:i.GenericReference,entityId:Ma.id,entityType:i.BuiltInBaseEntity},vh={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-name-property",name:"Parameter name",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:uI,description:"The name of the path parameter",parent:gh},pI={id:"key-value-param-built-in-base-entity-value-property-data-type-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property-data-type",entityType:i.DataType},Ih={id:"key-value-param-built-in-base-entity-value-property-ref",type:i.GenericReference,entityId:"key-value-param-built-in-base-entity-value-property",entityType:i.Property},yI={id:"key-value-param-built-in-base-entity-value-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:null,parent:Ih},Dh={id:"key-value-param-built-in-base-entity-value-property-parent-ref",type:i.GenericReference,entityId:Ma.id,entityType:i.BuiltInBaseEntity},Ph={hidden:!1,required:!0,id:"key-value-param-built-in-base-entity-value-property",name:"Parameter Value",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:1,dataType:yI,description:"The value of the path parameter",parent:Dh},_a={id:Ma.id,version:1,description:'An entity with a "name" and "value" property representing a breakdown of a key-value pair.',name:Ma.id,type:i.BuiltInBaseEntity,abstract:!1,static:!1,interactive:!0,properties:[vh,Ph],abstractMethods:[],methods:[],extends:[]},Ri=J[i.BuiltInBaseEntity][N.HTTP_ENDPOINT].properties,Ah={id:"endpointBuiltInCorsPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointBuiltInCorsPropertyDataType"},Sh={id:"endpointBuiltInCorsPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Ri.cors},Oh={id:"endpointBuiltInCorsPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"endpointBuiltInCorsPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:["*"],parent:Ah,autogeneration:null,valueAsType:null},parent:Sh},Ch={id:"endpointBuiltInBaseEntityRef",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},Bh={hidden:!0,required:!0,id:Ri.cors,name:"Allowed origins",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:Oh,description:"The origins that are allowed to access this endpoint, use * for all origins, or http://example.com/* to be as specific as you need.",parent:Ch},wh={id:"endpointBuiltInPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointBuiltInPathPropertyDataType"},Mh={id:"endpointBuiltInPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:Ri.path},_h={id:"endpointBuiltInPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"endpointBuiltInPathPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.String,value:"/",parent:wh,autogeneration:null,valueAsType:null},parent:Mh},Nh={id:"endpointBuiltInBaseEntityRefTwo",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},jo={hidden:!1,required:!0,id:Ri.path,name:"Path",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:1,dataType:_h,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:Nh},Vh={id:"endpointBuiltInMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointBuiltInMethodPropertyDataType"},$h={id:"endpointBuiltInMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"endpointBuiltInMethodProperty"},Lh={id:"endpointBuiltInMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:In,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"endpointBuiltInMethodPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,value:"GET",name:D.Enum,parent:Vh,autogeneration:null,valueAsType:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:$h},Gh={id:"endpointBuiltInBaseEntityRefThree",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},ko={hidden:!1,required:!0,id:Ri.method,name:"Method",version:1,type:i.Property,private:!1,index:2,implements:null,abstract:!0,static:!0,dataType:Lh,description:"The HTTP method that this endpoint will respond to, for example GET, POST, PUT, DELETE, etc.",parent:Gh},Fh={id:"endpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointRequestHeadersVariableDataType"},Uh={id:"endpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestHeadersArgumentDeclaration"},xh={id:"endpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"endpointRequestHeadersVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:Fh,autogeneration:null,valueAsType:null},parent:Uh},jh={id:"endpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestBodyArgumentDeclaration"},kh={id:"endpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:jh},qh={id:"endpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointRequestQueryParamsVariableDataType"},Jh={id:"endpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointRequestQueryParamsArgumentDeclaration"},Wh={id:"endpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:_a,defaultValue:{id:"endpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:[],parent:qh,autogeneration:null,valueAsType:null},parent:Jh},Hh={id:"endpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointPathParamsVariableDataType"},Yh={id:"endpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"endpointPathParamsArgumentDeclaration"},zh={id:"endpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:_a,asType:!1,defaultValue:{id:"endpointPathParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:[],parent:Hh,autogeneration:null,valueAsType:null},parent:Yh},Zh={id:"endpointReachedTriggerActionDescriptorRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Xh={id:"endpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ValueDescriptor,name:"Request headers",dataType:xh,required:!0,index:0,parentRelationType:w.FixedArguments,parent:Zh},Qh={id:"endpointReachedTriggerActionDescriptorRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},Kh={id:"endpointPathParamsArgumentDeclaration",type:i.ValueDescriptor,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",dataType:zh,required:!0,index:1,parentRelationType:w.FixedArguments,parent:Qh},ef={id:"endpointReachedTriggerActionDescriptorRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},tf={id:"endpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ValueDescriptor,name:"Request query params",dataType:Wh,required:!0,index:2,parentRelationType:w.FixedArguments,parent:ef},nf={id:"endpointReachedTriggerActionDescriptorRefFour",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReachedTriggerActionDescriptor"},rf={id:"endpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ValueDescriptor,name:"Request body",dataType:kh,index:3,required:!0,parentRelationType:w.FixedArguments,parent:nf},af={id:"endpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseCodeReturnDeclaration"},sf={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:af},of={id:"endpointReturnStatementRef",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},lf={id:"endpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ValueDescriptor,name:"Response code",dataType:sf,required:!0,index:0,parentRelationType:w.FixedReturns,parent:of},cf={id:"endpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"endpointResponseHeadersDataType"},df={id:"endpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseHeadersReturnDeclaration"},uf={id:"endpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"endpointResponseHeadersDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:cf,autogeneration:null,valueAsType:null},parent:df},pf={id:"endpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},yf={id:"endpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ValueDescriptor,name:"Response headers",dataType:uf,required:!1,index:1,parentRelationType:w.FixedReturns,parent:pf},hf={id:"endpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"endpointResponseBodyReturnDeclaration"},ff={id:"endpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:hf},mf={id:"endpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ActionDescriptor,entityId:"endpointReturnStatement"},Tf={id:"endpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ValueDescriptor,name:"Response body",dataType:ff,required:!1,index:2,parentRelationType:w.FixedReturns,parent:mf},Ef={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},qo={id:"endpointReachedTriggerActionDescriptor",type:i.ActionDescriptor,version:1,name:"Endpoint reached",description:"Fired when the endpoint is reached.",argumentsType:F.Fixed,dynamicArgumentTypes:null,fixedArguments:[Xh,Kh,tf,rf],returnsType:F.Fixed,fixedReturns:[lf,yf,Tf],error:null,dynamicReturnTypes:null,parent:Ef},Na={id:N.HTTP_ENDPOINT,version:1,description:"An HTTP endpoint that can be reached by a client from the internet.",name:N.HTTP_ENDPOINT,type:i.BuiltInBaseEntity,interactive:!1,abstract:!0,static:!0,properties:[Bh,jo,ko],abstractMethods:[qo],extends:[],methods:[]},Nt=J[i.BuiltInBaseEntity].BUILT_IN_RELATIONAL_DATABASE_ENTITY,Rf={id:"relational-database-built-in-base-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-identifier-property-data-type-id",entityType:i.DataType},bf={id:"relational-database-built-in-base-entity-identifier-property-ref-id",type:i.GenericReference,entityId:Nt.properties.identifier,entityType:i.Property},hI={id:"relational-database-built-in-base-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-identifier-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:null,parent:Rf,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:bf},Nr={id:"relational-database-built-in-base-entity-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Va={hidden:!1,required:!0,id:Nt.properties.identifier,name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:0,dataType:hI,description:"The name of the main database inside of the server instance where the data will be stored.",parent:Nr},fI={id:"relational-database-built-in-base-entity-username-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-idd",entityType:i.DataType},gf={id:"relational-database-built-in-base-entity-username-property-ref-id",type:i.GenericReference,entityId:Nt.properties.username,entityType:i.Property},mI={id:"relational-database-built-in-base-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-username-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"postgres",parent:{id:"relational-database-built-in-base-entity-username-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-username-property-data-type-id",entityType:i.DataType},autogeneration:null,valueAsType:null},parent:gf},$a={hidden:!1,required:!0,id:Nt.properties.username,name:"Username",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:1,dataType:mI,description:"The username that will be used to connect to the database.",parent:Nr},TI={id:"relational-database-built-in-base-entity-password-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-password-property-data-type-id",entityType:i.DataType},vf={id:"relational-database-built-in-base-entity-password-property-ref-id",type:i.GenericReference,entityId:Nt.properties.password,entityType:i.Property},EI={id:"relational-database-built-in-base-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:vf},La={hidden:!1,required:!0,id:Nt.properties.password,name:"Password",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:2,dataType:EI,description:"The password that will be used to connect to the database.",parent:Nr},If={id:"relational-database-built-in-base-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-min-size-property-data-type-id",entityType:i.DataType},Df={id:"relational-database-built-in-base-entity-min-size-property-ref-id",type:i.GenericReference,entityId:Nt.properties.minSize,entityType:i.Property},RI={id:"relational-database-built-in-base-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-min-size-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:6,parent:If,autogeneration:null,valueAsType:null},parent:Df},Ga={hidden:!0,required:!0,id:Nt.properties.minSize,name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:3,dataType:RI,description:"The minimum size of the database in GB.",parent:Nr},Pf={id:"relational-database-built-in-base-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-default-property-data-type-id",entityType:i.DataType},Af={id:"relational-database-built-in-base-entity-default-property-ref-id",type:i.GenericReference,entityId:Nt.properties.default,entityType:i.Property},bI={id:"relational-database-built-in-base-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:vn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-default-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!1,parent:Pf,autogeneration:null,valueAsType:null},parent:Af},Jo={hidden:!0,required:!0,id:Nt.properties.default,name:"Default",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:bI,description:"If true, this database will be the default database for the server instance and all the new entities.",parent:Nr},Sf={id:"relational-database-built-in-base-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:Nt.properties.autoscaling,entityType:i.Property},Of={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",entityType:i.DataType},gI={id:"relational-database-built-in-base-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:vn,asType:!1,defaultValue:{id:"relational-database-built-in-base-entity-autoscaling-property-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!1,parent:Of,autogeneration:null,valueAsType:null},parent:Sf},Cf={id:"relational-database-built-in-base-entity-autoscaling-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Wo={hidden:!0,required:!0,id:Nt.properties.autoscaling,name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!0,static:!0,implements:null,index:4,dataType:gI,description:"If true, this database will automatically scale up or down in memory size, based on the usage.",parent:Cf},Dn={id:N.RELATIONAL_DATABASE,version:1,description:"This entity provisions a relational database in the cloud.",name:N.RELATIONAL_DATABASE,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[Va,$a,La,Ga,Jo,Wo],abstractMethods:[],methods:[],extends:[]},Bf={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:At.DeletePersistedEntity},Ho={type:i.FunctionDeclaration,id:At.DeletePersistedEntity,name:At.DeletePersistedEntity,description:"Permanently deletes the current copy of an entity from the database",version:1,parent:Bf,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},wf={type:i.GenericReference,entityId:"persisted-built-in-base-entity-ref-id",entityType:i.BuiltInBaseEntity,id:At.SoftDeletePersistedEntity},Mf={type:i.FunctionDeclaration,id:At.SoftDeletePersistedEntity,name:At.SoftDeletePersistedEntity,description:"Designates the entity as deleted, but does not remove it from the database.",version:1,parent:wf,inputs:[],calls:[],implements:null,collapsed:!1,returnStatements:[],index:0,private:!1,x:0,y:0},_f=J[i.BuiltInBaseEntity][N.PERSISTED_ENTITY].properties,vI={id:"persisted-built-in-base-entity-database-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-data-type-id",entityType:i.DataType},Nf={id:"persisted-built-in-base-entity-database-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-database-property-id",entityType:i.Property},II={id:"persisted-built-in-base-entity-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Dn,asType:!1,defaultValue:null,parent:Nf},Vf={id:"persisted-built-in-base-entity-database-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},bi={hidden:!0,required:!0,id:_f.database,name:"Database",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:II,description:"The database that the entity belongs to.",parent:Vf},$f={id:"persisted-built-in-base-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-data-type-id",entityType:i.DataType},Lf={id:"persisted-built-in-base-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-identifier-property-id",entityType:i.Property},DI={id:"persisted-built-in-base-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:va,asType:!1,defaultValue:{id:"persisted-built-in-base-entity-identifier-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.UUID,value:null,parent:$f,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:Lf},Gf={id:"persisted-built-in-base-entity-identifier-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Ff={hidden:!1,required:!0,id:_f.identifier,name:"Identifier",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:DI,description:"Auto-generated unique identifier for the entity, can be used to identify the entity among other entities of the same type.",parent:Gf},PI={id:"persisted-built-in-base-entity-deleted-at-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-data-type-id",entityType:i.DataType},Uf={id:"persisted-built-in-base-entity-deleted-at-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-deleted-at-property-id",entityType:i.Property},xf={id:"persisted-built-in-base-entity-deleted-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!0,constant:!1,entity:sn,asType:!1,defaultValue:null,parent:Uf},jf={id:"persisted-built-in-base-entity-deleted-at-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},kf={hidden:!1,required:!0,id:"persisted-built-in-base-entity-deleted-at-property-id",name:"Deleted at",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:xf,description:"The date and time when the entity was deleted.",parent:jf},AI={id:"persisted-built-in-base-entity-created-at-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-data-type-id",entityType:i.DataType},qf={id:"persisted-built-in-base-entity-created-at-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-created-at-property-id",entityType:i.Property},Jf={id:"persisted-built-in-base-entity-created-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:sn,asType:!1,defaultValue:null,parent:qf},Wf={id:"persisted-built-in-base-entity-created-at-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Hf={hidden:!1,required:!0,id:"persisted-built-in-base-entity-created-at-property-id",name:"Created at",version:1,type:i.Property,private:!1,abstract:!1,implements:null,static:!1,index:0,dataType:Jf,description:"The date and time when the entity was created.",parent:Wf},SI={id:"persisted-built-in-base-entity-updated-at-property-data-type-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-data-type-id",entityType:i.DataType},Yf={id:"persisted-built-in-base-entity-updated-at-property-ref-id",type:i.GenericReference,entityId:"persisted-built-in-base-entity-updated-at-property-id",entityType:i.Property},zf={id:"persisted-built-in-base-entity-updated-at-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:sn,asType:!1,defaultValue:null,parent:Yf},Zf={id:"persisted-built-in-base-entity-updated-at-property-parent-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},Xf={hidden:!1,required:!0,id:"persisted-built-in-base-entity-updated-at-property-id",name:"Updated at",version:1,type:i.Property,private:!1,implements:null,abstract:!1,static:!1,index:0,dataType:zf,description:"The date and time when the entity was last updated.",parent:Zf},Ve={id:N.PERSISTED_ENTITY,version:1,description:"An entity that is permanently stored in the database and can be accessed at any point.",name:N.PERSISTED_ENTITY,type:i.BuiltInBaseEntity,abstract:!0,static:!1,interactive:!0,abstractMethods:[],properties:[bi,Ff,kf,Hf,Xf],methods:[Ho,Mf],extends:[]},Qf={id:"cron-job-triggered-function-declaration-blueprint-parent-ref-id",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},Yo={id:"cron-job-triggered-function-declaration-blueprint-id",name:"Cron job triggered",version:1,type:i.ActionDescriptor,argumentsType:F.None,returnsType:F.None,description:"Executed when the cron job is triggered",fixedArguments:[],dynamicArgumentTypes:null,error:null,fixedReturns:[],dynamicReturnTypes:null,parent:Qf},Kf=J[i.BuiltInBaseEntity].BUILT_IN_CRON_JOB_ENTITY,OI={id:"cron-job-built-in-base-entity-expression-property-data-type-ref",type:i.GenericReference,entityId:"cron-job-built-in-base-entity-expression-property-data-type",entityType:i.DataType},em={id:"cron-job-built-in-base-entity-expression-property-ref",type:i.GenericReference,entityId:Kf.properties.expression,entityType:i.Property},CI={id:"cron-job-built-in-base-entity-expression-property-data-type",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:em},tm={id:"cron-job-built-in-base-entity-ref",type:i.GenericReference,entityId:N.CRON_JOB,entityType:i.BuiltInBaseEntity},nm={hidden:!1,required:!0,id:Kf.properties.expression,name:"Cron expression",version:1,type:i.Property,private:!1,abstract:!0,implements:null,static:!0,index:0,dataType:CI,description:"The cron-job expression that defines when the cron-job job should be triggered. The expression should be in the format of a cron-job expression.",parent:tm},zo={id:N.CRON_JOB,version:1,description:"This entity represents a scheduled trigger. The action on this entity will be executed one the time set by the cron-job expression is reached.",name:N.CRON_JOB,type:i.BuiltInBaseEntity,abstract:!0,static:!0,interactive:!1,properties:[nm],methods:[],abstractMethods:[Yo],extends:[]},rm={type:i.GenericReference,id:"execution-built-in-entity-abort-method-parent-ref-id",entityType:i.BuiltInBaseEntity,entityId:"execution-built-in-entity-id"},Zo={id:"execution-built-in-entity-abort-method-id",type:i.FunctionDeclaration,version:1,name:At.AbortExecution,description:"Aborts the execution of the entity",inputs:[],returnStatements:[],calls:[],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:rm},Xo={id:N.EXECUTION,type:i.BuiltInBaseEntity,version:1,name:N.EXECUTION,description:"A reference to an ongoing execution of any entity that can be called. Eg: Operations, custom trigger calls, etc.",static:!1,abstract:!1,interactive:!0,extends:[],properties:[],methods:[Zo],abstractMethods:[]},BI=J[i.Condition]["not-empty"],im={type:i.GenericReference,id:"not-empty-condition-ref",entityType:i.ActionDescriptor,entityId:_t.NotEmpty},am={id:BI.inputs.leftHand,type:i.ValueDescriptor,version:1,name:"Value",description:"The value to check if it is not empty",dataType:null,required:!0,parentRelationType:w.FixedArguments,index:0,parent:im},zn={type:i.ActionDescriptor,id:_t.NotEmpty,version:1,name:_t.NotEmpty,description:"Checks if the value is not empty",parent:null,fixedArguments:[am],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:F.Fixed,returnsType:F.None,error:null},sm={[_t.NotEmpty]:zn},om=J[i.Condition]["more-than-or-equal"],lm={type:i.GenericReference,id:"more-than-or-equal-condition-left-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Be.MoreThanOrEqual},cm={id:om.inputs.leftHand,type:i.ValueDescriptor,version:1,name:"First value",description:"The first value to compare",dataType:null,required:!0,parentRelationType:w.FixedArguments,index:0,parent:lm},dm={type:i.GenericReference,id:"more-than-or-equal-condition-right-hand-argument-parent-ref",entityType:i.ActionDescriptor,entityId:Be.MoreThanOrEqual},um={id:om.inputs.rightHand,type:i.ValueDescriptor,version:1,name:"Second value",description:"The second value to compare",dataType:null,required:!0,parentRelationType:w.FixedArguments,index:1,parent:dm},Vr={type:i.ActionDescriptor,id:Be.MoreThanOrEqual,version:1,name:Be.MoreThanOrEqual,description:"Checks if the value is not empty",parent:null,fixedArguments:[cm,um],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:F.Fixed,returnsType:F.None,error:null},pm={[Be.MoreThanOrEqual]:Vr},wI={...sm,...pm},Fa={type:i.ActionDescriptor,id:rn.PROJECT_PUBLICATION_COMPLETED,version:1,name:rn.PROJECT_PUBLICATION_COMPLETED,description:"The event that is triggered when the project has completed its publication and all its code and resurces are now deployed and ready to be used by the users",parent:null,fixedArguments:[],fixedReturns:[],dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:F.None,returnsType:F.None,error:null},MI={[rn.PROJECT_PUBLICATION_COMPLETED]:Fa},Qo=J[i.ValueDescriptor][Lo.ActionOngoingProcessOutputValue],ym={type:i.GenericReference,id:"182f767f-50e8-4394-ba5f-43e78c232733",entityType:i.ValueDescriptor,entityId:Qo.id},hm={id:Qo.dataType.id,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Xo,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:ym},Ko={id:Qo.id,type:i.ValueDescriptor,description:"A value that represents the ongoing process of the parent action",version:1,name:"Process",dataType:hm,required:!0,index:0,parent:null,parentRelationType:w.OngoingProcessExecution};var X;(function(n){n.assertEqual=a=>a;function e(a){}n.assertIs=e;function t(a){throw new Error}n.assertNever=t,n.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},n.getValidEnumValues=a=>{const s=n.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of s)o[l]=a[l];return n.objectValues(o)},n.objectValues=a=>n.objectKeys(a).map(function(s){return a[s]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&s.push(o);return s},n.find=(a,s)=>{for(const o of a)if(s(o))return o},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,s=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(X||(X={}));var el;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(el||(el={}));const V=X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pn=n=>{switch(typeof n){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(n)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(n)?V.array:n===null?V.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?V.promise:typeof Map<"u"&&n instanceof Map?V.map:typeof Set<"u"&&n instanceof Set?V.set:typeof Date<"u"&&n instanceof Date?V.date:V.object;default:return V.unknown}},S=X.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_I=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class Et extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},a=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let l=r,p=0;for(;p<o.path.length;){const y=o.path[p];p===o.path.length-1?(l[y]=l[y]||{_errors:[]},l[y]._errors.push(t(o))):l[y]=l[y]||{_errors:[]},l=l[y],p++}}};return a(this),r}static assert(e){if(!(e instanceof Et))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,X.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}Et.create=n=>new Et(n);const $r=(n,e)=>{let t;switch(n.code){case S.invalid_type:n.received===V.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case S.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,X.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:t=`Unrecognized key(s) in object: ${X.joinValues(n.keys,", ")}`;break;case S.invalid_union:t="Invalid input";break;case S.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${X.joinValues(n.options)}`;break;case S.invalid_enum_value:t=`Invalid enum value. Expected ${X.joinValues(n.options)}, received '${n.received}'`;break;case S.invalid_arguments:t="Invalid function arguments";break;case S.invalid_return_type:t="Invalid function return type";break;case S.invalid_date:t="Invalid date";break;case S.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:X.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case S.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case S.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case S.custom:t="Invalid input";break;case S.invalid_intersection_types:t="Intersection results could not be merged";break;case S.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case S.not_finite:t="Number must be finite";break;default:t=e.defaultError,X.assertNever(n)}return{message:t}};let fm=$r;function NI(n){fm=n}function Ua(){return fm}const xa=n=>{const{data:e,path:t,errorMaps:r,issueData:a}=n,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="";const p=r.filter(y=>!!y).slice().reverse();for(const y of p)l=y(o,{data:e,defaultError:l}).message;return{...a,path:s,message:l}},VI=[];function M(n,e){const t=Ua(),r=xa({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===$r?void 0:$r].filter(a=>!!a)});n.common.issues.push(r)}class et{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return j;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const s=await a.key,o=await a.value;r.push({key:s,value:o})}return et.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return j;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}}const j=Object.freeze({status:"aborted"}),Lr=n=>({status:"dirty",value:n}),dt=n=>({status:"valid",value:n}),tl=n=>n.status==="aborted",nl=n=>n.status==="dirty",gi=n=>n.status==="valid",vi=n=>typeof Promise<"u"&&n instanceof Promise;function ja(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function mm(n,e,t,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!a:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(n,t):a?a.value=t:e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var G;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(G||(G={}));var Ii,Di;class Wt{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Tm=(n,e)=>{if(gi(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Et(n.common.issues);return this._error=t,this._error}}};function W(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{var p,y;const{message:f}=n;return o.code==="invalid_enum_value"?{message:f??l.defaultError}:typeof l.data>"u"?{message:(p=f??r)!==null&&p!==void 0?p:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(y=f??t)!==null&&y!==void 0?y:l.defaultError}},description:a}}class Y{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Pn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new et,ctx:{common:e.parent.common,data:e.data,parsedType:Pn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(vi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return Tm(a,s)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pn(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(vi(a)?a:Promise.resolve(a));return Tm(r,s)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),l=()=>s.addIssue({code:S.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(p=>p?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new kt({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Yt.create(this,this._def)}nullable(){return Cn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return xr.create(this,this._def)}or(e){return Oi.create([this,e],this._def)}and(e){return Ci.create(this,e,this._def)}transform(e){return new kt({...W(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ni({...W(this._def),innerType:this,defaultValue:t,typeName:x.ZodDefault})}brand(){return new al({typeName:x.ZodBranded,type:this,...W(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Vi({...W(this._def),innerType:this,catchValue:t,typeName:x.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return $i.create(this,e)}readonly(){return Li.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $I=/^c[^\s-]{8,}$/i,LI=/^[0-9a-z]+$/,GI=/^[0-9A-HJKMNP-TV-Z]{26}$/,FI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,UI=/^[a-z0-9_-]{21}$/i,xI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,jI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let rl;const qI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,JI=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,WI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Em="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HI=new RegExp(`^${Em}$`);function Rm(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function YI(n){return new RegExp(`^${Rm(n)}$`)}function bm(n){let e=`${Em}T${Rm(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function zI(n,e){return!!((e==="v4"||!e)&&qI.test(n)||(e==="v6"||!e)&&JI.test(n))}class xt extends Y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){const s=this._getOrReturnCtx(e);return M(s,{code:S.invalid_type,expected:V.string,received:s.parsedType}),j}const r=new et;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),M(a,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),M(a,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,l=e.data.length<s.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?M(a,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&M(a,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")jI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"email",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")rl||(rl=new RegExp(kI,"u")),rl.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"emoji",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")FI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"uuid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")UI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"nanoid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")$I.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"cuid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")LI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"cuid2",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")GI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"ulid",code:S.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),M(a,{validation:"url",code:S.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"regex",code:S.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),M(a,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),M(a,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),M(a,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?bm(s).test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{code:S.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?HI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{code:S.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?YI(s).test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{code:S.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?xI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"duration",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?zI(e.data,s.version)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"ip",code:S.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?WI.test(e.data)||(a=this._getOrReturnCtx(e,a),M(a,{validation:"base64",code:S.invalid_string,message:s.message}),r.dirty()):X.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:S.invalid_string,...G.errToObj(r)})}_addCheck(e){return new xt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}datetime(e){var t,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...G.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...G.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...G.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...G.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...G.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...G.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...G.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...G.errToObj(t)})}nonempty(e){return this.min(1,G.errToObj(e))}trim(){return new xt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}xt.create=n=>{var e;return new xt({checks:[],typeName:x.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...W(n)})};function ZI(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,s=parseInt(n.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class An extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){const s=this._getOrReturnCtx(e);return M(s,{code:S.invalid_type,expected:V.number,received:s.parsedType}),j}let r;const a=new et;for(const s of this._def.checks)s.kind==="int"?X.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?ZI(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),M(r,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),M(r,{code:S.not_finite,message:s.message}),a.dirty()):X.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,G.toString(t))}gt(e,t){return this.setLimit("min",e,!1,G.toString(t))}lte(e,t){return this.setLimit("max",e,!0,G.toString(t))}lt(e,t){return this.setLimit("max",e,!1,G.toString(t))}setLimit(e,t,r,a){return new An({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:G.toString(a)}]})}_addCheck(e){return new An({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&X.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}An.create=n=>new An({checks:[],typeName:x.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...W(n)});class Sn extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==V.bigint){const s=this._getOrReturnCtx(e);return M(s,{code:S.invalid_type,expected:V.bigint,received:s.parsedType}),j}let r;const a=new et;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),M(r,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),M(r,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):X.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,G.toString(t))}gt(e,t){return this.setLimit("min",e,!1,G.toString(t))}lte(e,t){return this.setLimit("max",e,!0,G.toString(t))}lt(e,t){return this.setLimit("max",e,!1,G.toString(t))}setLimit(e,t,r,a){return new Sn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:G.toString(a)}]})}_addCheck(e){return new Sn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Sn.create=n=>{var e;return new Sn({checks:[],typeName:x.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...W(n)})};class Pi extends Y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){const r=this._getOrReturnCtx(e);return M(r,{code:S.invalid_type,expected:V.boolean,received:r.parsedType}),j}return dt(e.data)}}Pi.create=n=>new Pi({typeName:x.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...W(n)});class Zn extends Y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){const s=this._getOrReturnCtx(e);return M(s,{code:S.invalid_type,expected:V.date,received:s.parsedType}),j}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return M(s,{code:S.invalid_date}),j}const r=new et;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),M(a,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),M(a,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):X.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Zn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:G.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Zn.create=n=>new Zn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:x.ZodDate,...W(n)});class ka extends Y{_parse(e){if(this._getType(e)!==V.symbol){const r=this._getOrReturnCtx(e);return M(r,{code:S.invalid_type,expected:V.symbol,received:r.parsedType}),j}return dt(e.data)}}ka.create=n=>new ka({typeName:x.ZodSymbol,...W(n)});class Ai extends Y{_parse(e){if(this._getType(e)!==V.undefined){const r=this._getOrReturnCtx(e);return M(r,{code:S.invalid_type,expected:V.undefined,received:r.parsedType}),j}return dt(e.data)}}Ai.create=n=>new Ai({typeName:x.ZodUndefined,...W(n)});class Si extends Y{_parse(e){if(this._getType(e)!==V.null){const r=this._getOrReturnCtx(e);return M(r,{code:S.invalid_type,expected:V.null,received:r.parsedType}),j}return dt(e.data)}}Si.create=n=>new Si({typeName:x.ZodNull,...W(n)});class Gr extends Y{constructor(){super(...arguments),this._any=!0}_parse(e){return dt(e.data)}}Gr.create=n=>new Gr({typeName:x.ZodAny,...W(n)});class Xn extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return dt(e.data)}}Xn.create=n=>new Xn({typeName:x.ZodUnknown,...W(n)});class ln extends Y{_parse(e){const t=this._getOrReturnCtx(e);return M(t,{code:S.invalid_type,expected:V.never,received:t.parsedType}),j}}ln.create=n=>new ln({typeName:x.ZodNever,...W(n)});class qa extends Y{_parse(e){if(this._getType(e)!==V.undefined){const r=this._getOrReturnCtx(e);return M(r,{code:S.invalid_type,expected:V.void,received:r.parsedType}),j}return dt(e.data)}}qa.create=n=>new qa({typeName:x.ZodVoid,...W(n)});class jt extends Y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==V.array)return M(t,{code:S.invalid_type,expected:V.array,received:t.parsedType}),j;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,l=t.data.length<a.exactLength.value;(o||l)&&(M(t,{code:o?S.too_big:S.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(M(t,{code:S.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(M(t,{code:S.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,l)=>a.type._parseAsync(new Wt(t,o,t.path,l)))).then(o=>et.mergeArray(r,o));const s=[...t.data].map((o,l)=>a.type._parseSync(new Wt(t,o,t.path,l)));return et.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new jt({...this._def,minLength:{value:e,message:G.toString(t)}})}max(e,t){return new jt({...this._def,maxLength:{value:e,message:G.toString(t)}})}length(e,t){return new jt({...this._def,exactLength:{value:e,message:G.toString(t)}})}nonempty(e){return this.min(1,e)}}jt.create=(n,e)=>new jt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...W(e)});function Fr(n){if(n instanceof Le){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Yt.create(Fr(r))}return new Le({...n._def,shape:()=>e})}else return n instanceof jt?new jt({...n._def,type:Fr(n.element)}):n instanceof Yt?Yt.create(Fr(n.unwrap())):n instanceof Cn?Cn.create(Fr(n.unwrap())):n instanceof Ht?Ht.create(n.items.map(e=>Fr(e))):n}class Le extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=X.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==V.object){const y=this._getOrReturnCtx(e);return M(y,{code:S.invalid_type,expected:V.object,received:y.parsedType}),j}const{status:r,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ln&&this._def.unknownKeys==="strip"))for(const y in a.data)o.includes(y)||l.push(y);const p=[];for(const y of o){const f=s[y],m=a.data[y];p.push({key:{status:"valid",value:y},value:f._parse(new Wt(a,m,a.path,y)),alwaysSet:y in a.data})}if(this._def.catchall instanceof ln){const y=this._def.unknownKeys;if(y==="passthrough")for(const f of l)p.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}});else if(y==="strict")l.length>0&&(M(a,{code:S.unrecognized_keys,keys:l}),r.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const f of l){const m=a.data[f];p.push({key:{status:"valid",value:f},value:y._parse(new Wt(a,m,a.path,f)),alwaysSet:f in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const y=[];for(const f of p){const m=await f.key,b=await f.value;y.push({key:m,value:b,alwaysSet:f.alwaysSet})}return y}).then(y=>et.mergeObjectSync(r,y)):et.mergeObjectSync(r,p)}get shape(){return this._def.shape()}strict(e){return G.errToObj,new Le({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,s,o,l;const p=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(l=G.errToObj(e).message)!==null&&l!==void 0?l:p}:{message:p}}}:{}})}strip(){return new Le({...this._def,unknownKeys:"strip"})}passthrough(){return new Le({...this._def,unknownKeys:"passthrough"})}extend(e){return new Le({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Le({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Le({...this._def,catchall:e})}pick(e){const t={};return X.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Le({...this._def,shape:()=>t})}omit(e){const t={};return X.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Le({...this._def,shape:()=>t})}deepPartial(){return Fr(this)}partial(e){const t={};return X.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}),new Le({...this._def,shape:()=>t})}required(e){const t={};return X.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Yt;)s=s._def.innerType;t[r]=s}}),new Le({...this._def,shape:()=>t})}keyof(){return gm(X.objectKeys(this.shape))}}Le.create=(n,e)=>new Le({shape:()=>n,unknownKeys:"strip",catchall:ln.create(),typeName:x.ZodObject,...W(e)}),Le.strictCreate=(n,e)=>new Le({shape:()=>n,unknownKeys:"strict",catchall:ln.create(),typeName:x.ZodObject,...W(e)}),Le.lazycreate=(n,e)=>new Le({shape:n,unknownKeys:"strip",catchall:ln.create(),typeName:x.ZodObject,...W(e)});class Oi extends Y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;const o=s.map(l=>new Et(l.ctx.common.issues));return M(t,{code:S.invalid_union,unionErrors:o}),j}if(t.common.async)return Promise.all(r.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let s;const o=[];for(const p of r){const y={...t,common:{...t.common,issues:[]},parent:null},f=p._parseSync({data:t.data,path:t.path,parent:y});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:y}),y.common.issues.length&&o.push(y.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(p=>new Et(p));return M(t,{code:S.invalid_union,unionErrors:l}),j}}get options(){return this._def.options}}Oi.create=(n,e)=>new Oi({options:n,typeName:x.ZodUnion,...W(e)});const cn=n=>n instanceof wi?cn(n.schema):n instanceof kt?cn(n.innerType()):n instanceof Mi?[n.value]:n instanceof On?n.options:n instanceof _i?X.objectValues(n.enum):n instanceof Ni?cn(n._def.innerType):n instanceof Ai?[void 0]:n instanceof Si?[null]:n instanceof Yt?[void 0,...cn(n.unwrap())]:n instanceof Cn?[null,...cn(n.unwrap())]:n instanceof al||n instanceof Li?cn(n.unwrap()):n instanceof Vi?cn(n._def.innerType):[];class Ja extends Y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.object)return M(t,{code:S.invalid_type,expected:V.object,received:t.parsedType}),j;const r=this.discriminator,a=t.data[r],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(M(t,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const a=new Map;for(const s of t){const o=cn(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,s)}}return new Ja({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...W(r)})}}function il(n,e){const t=Pn(n),r=Pn(e);if(n===e)return{valid:!0,data:n};if(t===V.object&&r===V.object){const a=X.objectKeys(e),s=X.objectKeys(n).filter(l=>a.indexOf(l)!==-1),o={...n,...e};for(const l of s){const p=il(n[l],e[l]);if(!p.valid)return{valid:!1};o[l]=p.data}return{valid:!0,data:o}}else if(t===V.array&&r===V.array){if(n.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<n.length;s++){const o=n[s],l=e[s],p=il(o,l);if(!p.valid)return{valid:!1};a.push(p.data)}return{valid:!0,data:a}}else return t===V.date&&r===V.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Ci extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(s,o)=>{if(tl(s)||tl(o))return j;const l=il(s.value,o.value);return l.valid?((nl(s)||nl(o))&&t.dirty(),{status:t.value,value:l.data}):(M(r,{code:S.invalid_intersection_types}),j)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>a(s,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ci.create=(n,e,t)=>new Ci({left:n,right:e,typeName:x.ZodIntersection,...W(t)});class Ht extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.array)return M(r,{code:S.invalid_type,expected:V.array,received:r.parsedType}),j;if(r.data.length<this._def.items.length)return M(r,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&r.data.length>this._def.items.length&&(M(r,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((o,l)=>{const p=this._def.items[l]||this._def.rest;return p?p._parse(new Wt(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>et.mergeArray(t,o)):et.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Ht({...this._def,rest:e})}}Ht.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:n,typeName:x.ZodTuple,rest:null,...W(e)})};class Bi extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return M(r,{code:S.invalid_type,expected:V.object,received:r.parsedType}),j;const a=[],s=this._def.keyType,o=this._def.valueType;for(const l in r.data)a.push({key:s._parse(new Wt(r,l,r.path,l)),value:o._parse(new Wt(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?et.mergeObjectAsync(t,a):et.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof Y?new Bi({keyType:e,valueType:t,typeName:x.ZodRecord,...W(r)}):new Bi({keyType:xt.create(),valueType:e,typeName:x.ZodRecord,...W(t)})}}class Wa extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.map)return M(r,{code:S.invalid_type,expected:V.map,received:r.parsedType}),j;const a=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([l,p],y)=>({key:a._parse(new Wt(r,l,r.path,[y,"key"])),value:s._parse(new Wt(r,p,r.path,[y,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const p of o){const y=await p.key,f=await p.value;if(y.status==="aborted"||f.status==="aborted")return j;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}})}else{const l=new Map;for(const p of o){const y=p.key,f=p.value;if(y.status==="aborted"||f.status==="aborted")return j;(y.status==="dirty"||f.status==="dirty")&&t.dirty(),l.set(y.value,f.value)}return{status:t.value,value:l}}}}Wa.create=(n,e,t)=>new Wa({valueType:e,keyType:n,typeName:x.ZodMap,...W(t)});class Qn extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==V.set)return M(r,{code:S.invalid_type,expected:V.set,received:r.parsedType}),j;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(M(r,{code:S.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(M(r,{code:S.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(p){const y=new Set;for(const f of p){if(f.status==="aborted")return j;f.status==="dirty"&&t.dirty(),y.add(f.value)}return{status:t.value,value:y}}const l=[...r.data.values()].map((p,y)=>s._parse(new Wt(r,p,r.path,y)));return r.common.async?Promise.all(l).then(p=>o(p)):o(l)}min(e,t){return new Qn({...this._def,minSize:{value:e,message:G.toString(t)}})}max(e,t){return new Qn({...this._def,maxSize:{value:e,message:G.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Qn.create=(n,e)=>new Qn({valueType:n,minSize:null,maxSize:null,typeName:x.ZodSet,...W(e)});class Ur extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.function)return M(t,{code:S.invalid_type,expected:V.function,received:t.parsedType}),j;function r(l,p){return xa({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ua(),$r].filter(y=>!!y),issueData:{code:S.invalid_arguments,argumentsError:p}})}function a(l,p){return xa({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ua(),$r].filter(y=>!!y),issueData:{code:S.invalid_return_type,returnTypeError:p}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof xr){const l=this;return dt(async function(...p){const y=new Et([]),f=await l._def.args.parseAsync(p,s).catch(g=>{throw y.addIssue(r(p,g)),y}),m=await Reflect.apply(o,this,f);return await l._def.returns._def.type.parseAsync(m,s).catch(g=>{throw y.addIssue(a(m,g)),y})})}else{const l=this;return dt(function(...p){const y=l._def.args.safeParse(p,s);if(!y.success)throw new Et([r(p,y.error)]);const f=Reflect.apply(o,this,y.data),m=l._def.returns.safeParse(f,s);if(!m.success)throw new Et([a(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ur({...this._def,args:Ht.create(e).rest(Xn.create())})}returns(e){return new Ur({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Ur({args:e||Ht.create([]).rest(Xn.create()),returns:t||Xn.create(),typeName:x.ZodFunction,...W(r)})}}class wi extends Y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}wi.create=(n,e)=>new wi({getter:n,typeName:x.ZodLazy,...W(e)});class Mi extends Y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return M(t,{received:t.data,code:S.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}Mi.create=(n,e)=>new Mi({value:n,typeName:x.ZodLiteral,...W(e)});function gm(n,e){return new On({values:n,typeName:x.ZodEnum,...W(e)})}class On extends Y{constructor(){super(...arguments),Ii.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return M(t,{expected:X.joinValues(r),received:t.parsedType,code:S.invalid_type}),j}if(ja(this,Ii,"f")||mm(this,Ii,new Set(this._def.values),"f"),!ja(this,Ii,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return M(t,{received:t.data,code:S.invalid_enum_value,options:r}),j}return dt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return On.create(e,{...this._def,...t})}exclude(e,t=this._def){return On.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}Ii=new WeakMap,On.create=gm;class _i extends Y{constructor(){super(...arguments),Di.set(this,void 0)}_parse(e){const t=X.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==V.string&&r.parsedType!==V.number){const a=X.objectValues(t);return M(r,{expected:X.joinValues(a),received:r.parsedType,code:S.invalid_type}),j}if(ja(this,Di,"f")||mm(this,Di,new Set(X.getValidEnumValues(this._def.values)),"f"),!ja(this,Di,"f").has(e.data)){const a=X.objectValues(t);return M(r,{received:r.data,code:S.invalid_enum_value,options:a}),j}return dt(e.data)}get enum(){return this._def.values}}Di=new WeakMap,_i.create=(n,e)=>new _i({values:n,typeName:x.ZodNativeEnum,...W(e)});class xr extends Y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==V.promise&&t.common.async===!1)return M(t,{code:S.invalid_type,expected:V.promise,received:t.parsedType}),j;const r=t.parsedType===V.promise?t.data:Promise.resolve(t.data);return dt(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}xr.create=(n,e)=>new xr({type:n,typeName:x.ZodPromise,...W(e)});class kt extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{M(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async l=>{if(t.value==="aborted")return j;const p=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return p.status==="aborted"?j:p.status==="dirty"||t.value==="dirty"?Lr(p.value):p});{if(t.value==="aborted")return j;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?j:l.status==="dirty"||t.value==="dirty"?Lr(l.value):l}}if(a.type==="refinement"){const o=l=>{const p=a.refinement(l,s);if(r.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?j:(l.status==="dirty"&&t.dirty(),o(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?j:(l.status==="dirty"&&t.dirty(),o(l.value).then(()=>({status:t.value,value:l.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!gi(o))return o;const l=a.transform(o.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>gi(o)?Promise.resolve(a.transform(o.value,s)).then(l=>({status:t.value,value:l})):o);X.assertNever(a)}}kt.create=(n,e,t)=>new kt({schema:n,typeName:x.ZodEffects,effect:e,...W(t)}),kt.createWithPreprocess=(n,e,t)=>new kt({schema:e,effect:{type:"preprocess",transform:n},typeName:x.ZodEffects,...W(t)});class Yt extends Y{_parse(e){return this._getType(e)===V.undefined?dt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yt.create=(n,e)=>new Yt({innerType:n,typeName:x.ZodOptional,...W(e)});class Cn extends Y{_parse(e){return this._getType(e)===V.null?dt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cn.create=(n,e)=>new Cn({innerType:n,typeName:x.ZodNullable,...W(e)});class Ni extends Y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===V.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ni.create=(n,e)=>new Ni({innerType:n,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...W(e)});class Vi extends Y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vi(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Et(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Et(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Vi.create=(n,e)=>new Vi({innerType:n,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...W(e)});class Ha extends Y{_parse(e){if(this._getType(e)!==V.nan){const r=this._getOrReturnCtx(e);return M(r,{code:S.invalid_type,expected:V.nan,received:r.parsedType}),j}return{status:"valid",value:e.data}}}Ha.create=n=>new Ha({typeName:x.ZodNaN,...W(n)});const XI=Symbol("zod_brand");class al extends Y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class $i extends Y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?j:s.status==="dirty"?(t.dirty(),Lr(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?j:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new $i({in:e,out:t,typeName:x.ZodPipeline})}}class Li extends Y{_parse(e){const t=this._def.innerType._parse(e),r=a=>(gi(a)&&(a.value=Object.freeze(a.value)),a);return vi(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}Li.create=(n,e)=>new Li({innerType:n,typeName:x.ZodReadonly,...W(e)});function vm(n,e={},t){return n?Gr.create().superRefine((r,a)=>{var s,o;if(!n(r)){const l=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,p=(o=(s=l.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,y=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...y,fatal:p})}}):Gr.create()}const QI={object:Le.lazycreate};var x;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(x||(x={}));const KI=(n,e={message:`Input not instance of ${n.name}`})=>vm(t=>t instanceof n,e),Ya=xt.create,sl=An.create,eD=Ha.create,tD=Sn.create,ol=Pi.create,Im=Zn.create,nD=ka.create,rD=Ai.create,Dm=Si.create,iD=Gr.create,za=Xn.create,aD=ln.create,sD=qa.create,oD=jt.create,Pm=Le.create,lD=Le.strictCreate,cD=Oi.create,dD=Ja.create,uD=Ci.create,pD=Ht.create,Am=Bi.create,yD=Wa.create,hD=Qn.create,fD=Ur.create,mD=wi.create,TD=Mi.create,Sm=On.create,ED=_i.create,RD=xr.create,Om=kt.create,bD=Yt.create,gD=Cn.create,vD=kt.createWithPreprocess,ID=$i.create;var d=Object.freeze({__proto__:null,defaultErrorMap:$r,setErrorMap:NI,getErrorMap:Ua,makeIssue:xa,EMPTY_PATH:VI,addIssueToContext:M,ParseStatus:et,INVALID:j,DIRTY:Lr,OK:dt,isAborted:tl,isDirty:nl,isValid:gi,isAsync:vi,get util(){return X},get objectUtil(){return el},ZodParsedType:V,getParsedType:Pn,ZodType:Y,datetimeRegex:bm,ZodString:xt,ZodNumber:An,ZodBigInt:Sn,ZodBoolean:Pi,ZodDate:Zn,ZodSymbol:ka,ZodUndefined:Ai,ZodNull:Si,ZodAny:Gr,ZodUnknown:Xn,ZodNever:ln,ZodVoid:qa,ZodArray:jt,ZodObject:Le,ZodUnion:Oi,ZodDiscriminatedUnion:Ja,ZodIntersection:Ci,ZodTuple:Ht,ZodRecord:Bi,ZodMap:Wa,ZodSet:Qn,ZodFunction:Ur,ZodLazy:wi,ZodLiteral:Mi,ZodEnum:On,ZodNativeEnum:_i,ZodPromise:xr,ZodEffects:kt,ZodTransformer:kt,ZodOptional:Yt,ZodNullable:Cn,ZodDefault:Ni,ZodCatch:Vi,ZodNaN:Ha,BRAND:XI,ZodBranded:al,ZodPipeline:$i,ZodReadonly:Li,custom:vm,Schema:Y,ZodSchema:Y,late:QI,get ZodFirstPartyTypeKind(){return x},coerce:{string:n=>xt.create({...n,coerce:!0}),number:n=>An.create({...n,coerce:!0}),boolean:n=>Pi.create({...n,coerce:!0}),bigint:n=>Sn.create({...n,coerce:!0}),date:n=>Zn.create({...n,coerce:!0})},any:iD,array:oD,bigint:tD,boolean:ol,date:Im,discriminatedUnion:dD,effect:Om,enum:Sm,function:fD,instanceof:KI,intersection:uD,lazy:mD,literal:TD,map:yD,nan:eD,nativeEnum:ED,never:aD,null:Dm,nullable:gD,number:sl,object:Pm,oboolean:()=>ol().optional(),onumber:()=>sl().optional(),optional:bD,ostring:()=>Ya().optional(),pipeline:ID,preprocess:vD,promise:RD,record:Am,set:hD,strictObject:lD,string:Ya,symbol:nD,transformer:Om,tuple:pD,undefined:rD,union:cD,unknown:za,void:sD,NEVER:j,ZodIssueCode:S,quotelessJson:_I,ZodError:Et});function Cm(n){var a,s,o;if(!(n!=null&&n.dataType))return za();const e=n.dataType.isNullable||!1,t=n.dataType.isList||!1;let r=za();if(((a=n.dataType.entity)==null?void 0:a.type)===i.PrimitiveEntity)switch(n.dataType.entity.name){case D.String:r=Ya();break;case D.JSON:r=Am(za());break;case D.Number:r=sl();break;case D.Boolean:r=ol();break;case D.Date:r=Im();break;case D.Enum:{const l=n.dataType.options||[];if(l.length===0)throw new Error(`Enum property ${n.name} has no options`);r=Sm(l);break}case D.Null:r=Dm();break;case D.UUID:r=Ya().uuid();break}else if(((s=n.dataType.entity)==null?void 0:s.type)===i.CustomEntity)r=Bm(n.dataType.entity);else throw new Error(`Unsupported data type validation: ${(o=n.dataType.entity)==null?void 0:o.type}`);return e&&(r=r.nullable()),t&&(r=r.array()),r}function Bm(n){const e=Pm({});for(const t of n.properties){const r=Cm(t);e.shape[t.name]=r}return e}function wm(n){const e=n.rangeStart;return new Date(e.getTime()+Math.random()*(Date.now()-e.getTime()))}function Mm(n){const e=n.rangeEnd;return new Date(Math.random()*e.getTime())}function _m(n){const e=n.rangeStart,t=n.rangeEnd;return new Date(e.getTime()+Math.random()*(t.getTime()-e.getTime()))}function Nm(n){return n.rangeStart&&n.rangeEnd?_m(n):n.rangeStart?wm(n):n.rangeEnd?Mm(n):new Date}function DD(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vm={},Za={},Xa={};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=AD;let Qa;const PD=new Uint8Array(16);function AD(){if(!Qa&&(Qa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qa(PD)}var Bn={},Kn={},Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=void 0;var SD=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Ka.default=SD,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.default=void 0;var OD=CD(Ka);function CD(n){return n&&n.__esModule?n:{default:n}}function BD(n){return typeof n=="string"&&OD.default.test(n)}var wD=BD;Kn.default=wD,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.default=void 0,Bn.unsafeStringify=$m;var MD=_D(Kn);function _D(n){return n&&n.__esModule?n:{default:n}}const ze=[];for(let n=0;n<256;++n)ze.push((n+256).toString(16).slice(1));function $m(n,e=0){return ze[n[e+0]]+ze[n[e+1]]+ze[n[e+2]]+ze[n[e+3]]+"-"+ze[n[e+4]]+ze[n[e+5]]+"-"+ze[n[e+6]]+ze[n[e+7]]+"-"+ze[n[e+8]]+ze[n[e+9]]+"-"+ze[n[e+10]]+ze[n[e+11]]+ze[n[e+12]]+ze[n[e+13]]+ze[n[e+14]]+ze[n[e+15]]}function ND(n,e=0){const t=$m(n,e);if(!(0,MD.default)(t))throw TypeError("Stringified UUID is invalid");return t}var VD=ND;Bn.default=VD,Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=void 0;var $D=GD(Xa),LD=Bn;function GD(n){return n&&n.__esModule?n:{default:n}}let Lm,ll,cl=0,dl=0;function FD(n,e,t){let r=e&&t||0;const a=e||new Array(16);n=n||{};let s=n.node||Lm,o=n.clockseq!==void 0?n.clockseq:ll;if(s==null||o==null){const b=n.random||(n.rng||$D.default)();s==null&&(s=Lm=[b[0]|1,b[1],b[2],b[3],b[4],b[5]]),o==null&&(o=ll=(b[6]<<8|b[7])&16383)}let l=n.msecs!==void 0?n.msecs:Date.now(),p=n.nsecs!==void 0?n.nsecs:dl+1;const y=l-cl+(p-dl)/1e4;if(y<0&&n.clockseq===void 0&&(o=o+1&16383),(y<0||l>cl)&&n.nsecs===void 0&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");cl=l,dl=p,ll=o,l+=122192928e5;const f=((l&268435455)*1e4+p)%4294967296;a[r++]=f>>>24&255,a[r++]=f>>>16&255,a[r++]=f>>>8&255,a[r++]=f&255;const m=l/4294967296*1e4&268435455;a[r++]=m>>>8&255,a[r++]=m&255,a[r++]=m>>>24&15|16,a[r++]=m>>>16&255,a[r++]=o>>>8|128,a[r++]=o&255;for(let b=0;b<6;++b)a[r+b]=s[b];return e||(0,LD.unsafeStringify)(a)}var UD=FD;Za.default=UD;var es={},wn={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.default=void 0;var xD=jD(Kn);function jD(n){return n&&n.__esModule?n:{default:n}}function kD(n){if(!(0,xD.default)(n))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var qD=kD;Gi.default=qD,Object.defineProperty(wn,"__esModule",{value:!0}),wn.URL=wn.DNS=void 0,wn.default=zD;var JD=Bn,WD=HD(Gi);function HD(n){return n&&n.__esModule?n:{default:n}}function YD(n){n=unescape(encodeURIComponent(n));const e=[];for(let t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}const Gm="6ba7b810-9dad-11d1-80b4-00c04fd430c8";wn.DNS=Gm;const Fm="6ba7b811-9dad-11d1-80b4-00c04fd430c8";wn.URL=Fm;function zD(n,e,t){function r(a,s,o,l){var p;if(typeof a=="string"&&(a=YD(a)),typeof s=="string"&&(s=(0,WD.default)(s)),((p=s)===null||p===void 0?void 0:p.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let y=new Uint8Array(16+a.length);if(y.set(s),y.set(a,s.length),y=t(y),y[6]=y[6]&15|e,y[8]=y[8]&63|128,o){l=l||0;for(let f=0;f<16;++f)o[l+f]=y[f];return o}return(0,JD.unsafeStringify)(y)}try{r.name=n}catch{}return r.DNS=Gm,r.URL=Fm,r}var ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.default=void 0;function ZD(n){if(typeof n=="string"){const e=unescape(encodeURIComponent(n));n=new Uint8Array(e.length);for(let t=0;t<e.length;++t)n[t]=e.charCodeAt(t)}return XD(QD(KD(n),n.length*8))}function XD(n){const e=[],t=n.length*32,r="0123456789abcdef";for(let a=0;a<t;a+=8){const s=n[a>>5]>>>a%32&255,o=parseInt(r.charAt(s>>>4&15)+r.charAt(s&15),16);e.push(o)}return e}function Um(n){return(n+64>>>9<<4)+14+1}function QD(n,e){n[e>>5]|=128<<e%32,n[Um(e)-1]=e;let t=1732584193,r=-271733879,a=-1732584194,s=271733878;for(let o=0;o<n.length;o+=16){const l=t,p=r,y=a,f=s;t=tt(t,r,a,s,n[o],7,-680876936),s=tt(s,t,r,a,n[o+1],12,-389564586),a=tt(a,s,t,r,n[o+2],17,606105819),r=tt(r,a,s,t,n[o+3],22,-1044525330),t=tt(t,r,a,s,n[o+4],7,-176418897),s=tt(s,t,r,a,n[o+5],12,1200080426),a=tt(a,s,t,r,n[o+6],17,-1473231341),r=tt(r,a,s,t,n[o+7],22,-45705983),t=tt(t,r,a,s,n[o+8],7,1770035416),s=tt(s,t,r,a,n[o+9],12,-1958414417),a=tt(a,s,t,r,n[o+10],17,-42063),r=tt(r,a,s,t,n[o+11],22,-1990404162),t=tt(t,r,a,s,n[o+12],7,1804603682),s=tt(s,t,r,a,n[o+13],12,-40341101),a=tt(a,s,t,r,n[o+14],17,-1502002290),r=tt(r,a,s,t,n[o+15],22,1236535329),t=nt(t,r,a,s,n[o+1],5,-165796510),s=nt(s,t,r,a,n[o+6],9,-1069501632),a=nt(a,s,t,r,n[o+11],14,643717713),r=nt(r,a,s,t,n[o],20,-373897302),t=nt(t,r,a,s,n[o+5],5,-701558691),s=nt(s,t,r,a,n[o+10],9,38016083),a=nt(a,s,t,r,n[o+15],14,-660478335),r=nt(r,a,s,t,n[o+4],20,-405537848),t=nt(t,r,a,s,n[o+9],5,568446438),s=nt(s,t,r,a,n[o+14],9,-1019803690),a=nt(a,s,t,r,n[o+3],14,-187363961),r=nt(r,a,s,t,n[o+8],20,1163531501),t=nt(t,r,a,s,n[o+13],5,-1444681467),s=nt(s,t,r,a,n[o+2],9,-51403784),a=nt(a,s,t,r,n[o+7],14,1735328473),r=nt(r,a,s,t,n[o+12],20,-1926607734),t=rt(t,r,a,s,n[o+5],4,-378558),s=rt(s,t,r,a,n[o+8],11,-2022574463),a=rt(a,s,t,r,n[o+11],16,1839030562),r=rt(r,a,s,t,n[o+14],23,-35309556),t=rt(t,r,a,s,n[o+1],4,-1530992060),s=rt(s,t,r,a,n[o+4],11,1272893353),a=rt(a,s,t,r,n[o+7],16,-155497632),r=rt(r,a,s,t,n[o+10],23,-1094730640),t=rt(t,r,a,s,n[o+13],4,681279174),s=rt(s,t,r,a,n[o],11,-358537222),a=rt(a,s,t,r,n[o+3],16,-722521979),r=rt(r,a,s,t,n[o+6],23,76029189),t=rt(t,r,a,s,n[o+9],4,-640364487),s=rt(s,t,r,a,n[o+12],11,-421815835),a=rt(a,s,t,r,n[o+15],16,530742520),r=rt(r,a,s,t,n[o+2],23,-995338651),t=it(t,r,a,s,n[o],6,-198630844),s=it(s,t,r,a,n[o+7],10,1126891415),a=it(a,s,t,r,n[o+14],15,-1416354905),r=it(r,a,s,t,n[o+5],21,-57434055),t=it(t,r,a,s,n[o+12],6,1700485571),s=it(s,t,r,a,n[o+3],10,-1894986606),a=it(a,s,t,r,n[o+10],15,-1051523),r=it(r,a,s,t,n[o+1],21,-2054922799),t=it(t,r,a,s,n[o+8],6,1873313359),s=it(s,t,r,a,n[o+15],10,-30611744),a=it(a,s,t,r,n[o+6],15,-1560198380),r=it(r,a,s,t,n[o+13],21,1309151649),t=it(t,r,a,s,n[o+4],6,-145523070),s=it(s,t,r,a,n[o+11],10,-1120210379),a=it(a,s,t,r,n[o+2],15,718787259),r=it(r,a,s,t,n[o+9],21,-343485551),t=Mn(t,l),r=Mn(r,p),a=Mn(a,y),s=Mn(s,f)}return[t,r,a,s]}function KD(n){if(n.length===0)return[];const e=n.length*8,t=new Uint32Array(Um(e));for(let r=0;r<e;r+=8)t[r>>5]|=(n[r/8]&255)<<r%32;return t}function Mn(n,e){const t=(n&65535)+(e&65535);return(n>>16)+(e>>16)+(t>>16)<<16|t&65535}function eP(n,e){return n<<e|n>>>32-e}function ns(n,e,t,r,a,s){return Mn(eP(Mn(Mn(e,n),Mn(r,s)),a),t)}function tt(n,e,t,r,a,s,o){return ns(e&t|~e&r,n,e,a,s,o)}function nt(n,e,t,r,a,s,o){return ns(e&r|t&~r,n,e,a,s,o)}function rt(n,e,t,r,a,s,o){return ns(e^t^r,n,e,a,s,o)}function it(n,e,t,r,a,s,o){return ns(t^(e|~r),n,e,a,s,o)}var tP=ZD;ts.default=tP,Object.defineProperty(es,"__esModule",{value:!0}),es.default=void 0;var nP=xm(wn),rP=xm(ts);function xm(n){return n&&n.__esModule?n:{default:n}}var iP=(0,nP.default)("v3",48,rP.default);es.default=iP;var rs={},is={};Object.defineProperty(is,"__esModule",{value:!0}),is.default=void 0;var aP={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};is.default=aP,Object.defineProperty(rs,"__esModule",{value:!0}),rs.default=void 0;var jm=km(is),sP=km(Xa),oP=Bn;function km(n){return n&&n.__esModule?n:{default:n}}function lP(n,e,t){if(jm.default.randomUUID&&!e&&!n)return jm.default.randomUUID();n=n||{};const r=n.random||(n.rng||sP.default)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=r[a];return e}return(0,oP.unsafeStringify)(r)}var cP=lP;rs.default=cP;var as={},ss={};Object.defineProperty(ss,"__esModule",{value:!0}),ss.default=void 0;function dP(n,e,t,r){switch(n){case 0:return e&t^~e&r;case 1:return e^t^r;case 2:return e&t^e&r^t&r;case 3:return e^t^r}}function ul(n,e){return n<<e|n>>>32-e}function uP(n){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof n=="string"){const o=unescape(encodeURIComponent(n));n=[];for(let l=0;l<o.length;++l)n.push(o.charCodeAt(l))}else Array.isArray(n)||(n=Array.prototype.slice.call(n));n.push(128);const r=n.length/4+2,a=Math.ceil(r/16),s=new Array(a);for(let o=0;o<a;++o){const l=new Uint32Array(16);for(let p=0;p<16;++p)l[p]=n[o*64+p*4]<<24|n[o*64+p*4+1]<<16|n[o*64+p*4+2]<<8|n[o*64+p*4+3];s[o]=l}s[a-1][14]=(n.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(n.length-1)*8&4294967295;for(let o=0;o<a;++o){const l=new Uint32Array(80);for(let g=0;g<16;++g)l[g]=s[o][g];for(let g=16;g<80;++g)l[g]=ul(l[g-3]^l[g-8]^l[g-14]^l[g-16],1);let p=t[0],y=t[1],f=t[2],m=t[3],b=t[4];for(let g=0;g<80;++g){const A=Math.floor(g/20),C=ul(p,5)+dP(A,y,f,m)+b+e[A]+l[g]>>>0;b=m,m=f,f=ul(y,30)>>>0,y=p,p=C}t[0]=t[0]+p>>>0,t[1]=t[1]+y>>>0,t[2]=t[2]+f>>>0,t[3]=t[3]+m>>>0,t[4]=t[4]+b>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,t[0]&255,t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,t[1]&255,t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,t[2]&255,t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,t[3]&255,t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,t[4]&255]}var pP=uP;ss.default=pP,Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var yP=qm(wn),hP=qm(ss);function qm(n){return n&&n.__esModule?n:{default:n}}var fP=(0,yP.default)("v5",80,hP.default);as.default=fP;var os={};Object.defineProperty(os,"__esModule",{value:!0}),os.default=void 0;var mP="00000000-0000-0000-0000-000000000000";os.default=mP;var ls={};Object.defineProperty(ls,"__esModule",{value:!0}),ls.default=void 0;var TP=EP(Kn);function EP(n){return n&&n.__esModule?n:{default:n}}function RP(n){if(!(0,TP.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}var bP=RP;ls.default=bP,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"version",{enumerable:!0,get:function(){return o.default}});var e=f(Za),t=f(es),r=f(rs),a=f(as),s=f(os),o=f(ls),l=f(Kn),p=f(Bn),y=f(Gi);function f(m){return m&&m.__esModule?m:{default:m}}}(Vm);function pl(n,e){if(!n||!e||!n.length||!e.length)throw new Error("Bad alphabet");this.srcAlphabet=n,this.dstAlphabet=e}pl.prototype.convert=function(n){var e,t,r,a={},s=this.srcAlphabet.length,o=this.dstAlphabet.length,l=n.length,p=typeof n=="string"?"":[];if(!this.isValid(n))throw new Error('Number "'+n+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return n;for(e=0;e<l;e++)a[e]=this.srcAlphabet.indexOf(n[e]);do{for(t=0,r=0,e=0;e<l;e++)t=t*s+a[e],t>=o?(a[r++]=parseInt(t/o,10),t=t%o):r>0&&(a[r++]=0);l=r,p=this.dstAlphabet.slice(t,t+1).concat(p)}while(r!==0);return p},pl.prototype.isValid=function(n){for(var e=0;e<n.length;++e)if(this.srcAlphabet.indexOf(n[e])===-1)return!1;return!0};var gP=pl,vP=gP;function Fi(n,e){var t=new vP(n,e);return function(r){return t.convert(r)}}Fi.BIN="01",Fi.OCT="01234567",Fi.DEC="0123456789",Fi.HEX="0123456789abcdef";var IP=Fi;const{v4:yl,validate:DP}=Vm,cs=IP,hl={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},PP={consistentLength:!0};let fl;const Jm=(n,e,t)=>{const r=e(n.toLowerCase().replace(/-/g,""));return!t||!t.consistentLength?r:r.padStart(t.shortIdLength,t.paddingChar)},Wm=(n,e)=>{const r=e(n).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[r[1],r[2],r[3],r[4],r[5]].join("-")},AP=n=>Math.ceil(Math.log(2**128)/Math.log(n));var SP=(()=>{const n=(e,t)=>{const r=e||hl.flickrBase58,a={...PP,...t};if([...new Set(Array.from(r))].length!==r.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const s=AP(r.length),o={shortIdLength:s,consistentLength:a.consistentLength,paddingChar:r[0]},l=cs(cs.HEX,r),p=cs(r,cs.HEX),y=()=>Jm(yl(),l,o),m={alphabet:r,fromUUID:b=>Jm(b,l,o),maxLength:s,generate:y,new:y,toUUID:b=>Wm(b,p),uuid:yl,validate:(b,g=!1)=>{if(!b||typeof b!="string")return!1;const A=a.consistentLength?b.length===s:b.length<=s,C=b.split("").every($=>r.includes($));return g===!1?A&&C:A&&C&&DP(Wm(b,p))}};return Object.freeze(m),m};return n.constants=hl,n.uuid=yl,n.generate=()=>(fl||(fl=n(hl.flickrBase58).generate),fl()),n})();const ds=DD(SP);function Hm(){return ds().uuid()}function Ym(n){return n.rangeStart+Math.random()}function zm(n){const e=n.rangeEnd;return Math.random()*e}function Zm(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random()*(t-e)+e}function Xm(n){return n.rangeStart&&n.rangeEnd?Zm(n):n.rangeStart?Ym(n):n.rangeEnd?zm(n):Math.random()}function Qm(n){const e=n.rangeStart;return Math.random().toString(36).substring(e)}function Km(n){const e=n.rangeEnd;return Math.random().toString(36).substring(0,e)}function eT(n){const e=n.rangeStart,t=n.rangeEnd;return Math.random().toString(36).substring(e,t)}function tT(n){return n.rangeStart&&n.rangeEnd?eT(n):n.rangeStart?Qm(n):n.rangeEnd?Km(n):Math.random().toString(36)}function nT(n){return Math.random()>=.5}function OP(n){if(!n||!n.autogeneration)return null;switch(n.autogeneration.type){case xe.CurrentDateAndTime:if(n.name===D.Date)return new Date;case xe.Random:{if(n.name===D.Date)return Nm(n.autogeneration);if(n.name===D.Number)return Xm(n.autogeneration);if(n.name===D.String)return tT(n.autogeneration);if(n.name===D.Boolean)return nT(n.autogeneration)}case xe.Unique:if(n.name===D.UUID)return Hm();default:throw new Error(`Generating a ${n.autogeneration.type} value for a ${n.name} is not supported`)}}const H="e7eb5382-3d99-44fd-972a-b8b1e819f6be",ml="global-user-variable-id",rT="last-executed-timestamp-variable-id",CP={id:"alternative-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-data-type-id",entityType:i.DataType},BP={id:"alternative-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-identifier-property-id",entityType:i.Property},wP={id:"alternative-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"alternative-relational-database-entity-identifier-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:null,parent:CP,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:BP},us={id:"alternative-relational-database-entity-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},MP={hidden:!1,required:!0,id:"alternative-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:Va,static:!0,index:0,dataType:wP,description:"The name of the main database inside of the server instance where the data will be stored.",parent:us};i.GenericReference,i.DataType;const _P={id:"alternative-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-username-property-id",entityType:i.Property},NP={id:"alternative-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:_P},VP={hidden:!1,required:!0,id:"alternative-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:$a,static:!0,index:1,dataType:NP,description:"The username that will be used to connect to the database.",parent:us};i.GenericReference,i.DataType;const $P={id:"alternative-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-password-property-id",entityType:i.Property},LP={id:"alternative-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:$P},GP={hidden:!1,required:!0,id:"alternative-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:La,static:!0,index:2,dataType:LP,description:"The password that will be used to connect to the database.",parent:us},FP={id:"alternative-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-data-type-id",entityType:i.DataType},UP={id:"alternative-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"alternative-relational-database-entity-min-size-property-id",entityType:i.Property},xP={id:"alternative-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"alternative-relational-database-entity-min-size-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:6,parent:FP,autogeneration:null,valueAsType:null},parent:UP},jP={hidden:!1,required:!0,id:"alternative-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Ga,static:!0,index:3,dataType:xP,description:"The minimum size of the database in GB.",parent:us},kP={id:"alternative-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},iT={id:"alternative-relational-database-entity-id",type:i.CustomEntity,version:1,name:"Alternative relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[MP,VP,GP,jP],methods:[],abstractMethods:[],extends:[],implements:[Dn],x:0,y:0,parent:kP},qP={id:"animal-prototype-database-property-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-id",entityType:i.Property},JP={id:"animal-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"animal-prototype-database-property-data-type-default-value-id",entityType:i.DataType},WP={id:"animal-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Dn,asType:!1,defaultValue:{id:"animal-prototype-database-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.EntityTemplate,valueAsType:iT,autogeneration:null,parent:JP},parent:qP},HP={id:"animal-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.CustomEntity},YP={hidden:!1,required:!0,id:"animal-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:bi,static:!0,index:0,dataType:WP,description:"The database that the entity belongs to.",parent:HP},zP={type:i.GenericReference,id:"291e4d4f-01d8-40a0-90dc-5f1ac6636e9b",entityType:i.Property,entityId:"5cb617b0-92be-4dbe-a007-49093368d94f"},ZP={id:"c1930577-9e79-48a6-8905-be24611015c1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:zP},XP={type:i.GenericReference,id:"e2b9e456-f2b3-4dc7-85a2-fbb68ed0c9c7",entityType:i.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},QP={hidden:!1,required:!0,type:i.Property,id:"5cb617b0-92be-4dbe-a007-49093368d94f",version:1,name:"Name",description:"The name of the animal",implements:null,static:!1,private:!1,index:0,dataType:ZP,abstract:!1,parent:XP},KP={type:i.GenericReference,id:"abc565de-4c83-4936-bc48-4013bef213b8",entityType:i.Project,entityId:H},eA={type:i.CustomEntity,id:"83eaa847-e62b-4192-84fb-3d8d6f5ea970",version:1,name:"Animal",description:"A living creature that is not human",abstract:!1,static:!1,abstractMethods:[],properties:[YP,QP],methods:[],extends:[],implements:[Ve],x:0,y:0,parent:KP},tA={id:"default-relational-database-entity-identifier-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-data-type-id",entityType:i.DataType},nA={id:"default-relational-database-entity-identifier-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-identifier-property-id",entityType:i.Property},rA={id:"default-relational-database-entity-identifier-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"default-relational-database-entity-identifier-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"main",parent:tA,autogeneration:{type:xe.Unique,rangeStart:null,rangeEnd:null},valueAsType:null},parent:nA},jr={id:"default-relational-database-entity-ref-id",type:i.GenericReference,entityId:N.PERSISTED_ENTITY,entityType:i.BuiltInBaseEntity},iA={hidden:!1,required:!0,id:"default-relational-database-entity-identifier-property-id",name:"Identifier name",version:1,type:i.Property,private:!1,abstract:!1,implements:Va,static:!0,index:0,dataType:rA,description:"The name of the main database inside of the server instance where the data will be stored.",parent:jr};i.GenericReference,i.DataType;const aA={id:"default-relational-database-entity-username-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-id",entityType:i.Property},sA={id:"default-relational-database-entity-username-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-username-property-data-type-id",entityType:i.DataType},oA={id:"default-relational-database-entity-username-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"default-relational-database-entity-username-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"root",parent:sA,autogeneration:null,valueAsType:null},parent:aA},lA={hidden:!1,required:!0,id:"default-relational-database-entity-username-property-id",name:"Username",version:1,type:i.Property,private:!1,abstract:!1,implements:$a,static:!0,index:1,dataType:oA,description:"The username that will be used to connect to the database.",parent:jr};i.GenericReference,i.DataType;const cA={id:"default-relational-database-entity-password-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-id",entityType:i.Property},dA={id:"default-relational-database-entity-password-property-default-value-parent-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-password-property-data-type-id",entityType:i.DataType},uA={id:"default-relational-database-entity-password-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"default-relational-database-entity-password-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"password",parent:dA,autogeneration:null,valueAsType:null},parent:cA},pA={hidden:!1,required:!0,id:"default-relational-database-entity-password-property-id",name:"Password",version:1,type:i.Property,private:!1,abstract:!1,implements:La,static:!0,index:2,dataType:uA,description:"The password that will be used to connect to the database.",parent:jr},yA={id:"default-relational-database-entity-min-size-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-data-type-id",entityType:i.DataType},hA={id:"default-relational-database-entity-min-size-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-min-size-property-id",entityType:i.Property},fA={id:"default-relational-database-entity-min-size-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"default-relational-database-entity-min-size-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:6,parent:yA,autogeneration:null,valueAsType:null},parent:hA},mA={hidden:!1,required:!0,id:"default-relational-database-entity-min-size-property-id",name:"Minimum GB size",version:1,type:i.Property,private:!1,abstract:!1,implements:Ga,static:!0,index:3,dataType:fA,description:"The minimum size of the database in GB.",parent:jr},TA={id:"default-relational-database-entity-default-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-data-type-id",entityType:i.DataType},EA={id:"default-relational-database-entity-default-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-default-property-id",entityType:i.Property},RA={id:"default-relational-database-entity-default-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"default-relational-database-entity-default-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!0,parent:TA,autogeneration:null,valueAsType:null},parent:EA},bA={hidden:!0,required:!0,id:"default-relational-database-entity-default-property-id",name:"Default",version:1,type:i.Property,private:!1,abstract:!1,implements:Jo,static:!0,index:4,dataType:RA,description:"Whether this database is automatically picked by other entities as the default database.",parent:jr},gA={id:"default-relational-database-entity-autoscaling-property-data-type-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-data-type-id",entityType:i.DataType},vA={id:"default-relational-database-entity-autoscaling-property-ref-id",type:i.GenericReference,entityId:"default-relational-database-entity-autoscaling-property-id",entityType:i.Property},IA={id:"default-relational-database-entity-autoscaling-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:Se,asType:!1,defaultValue:{id:"default-relational-database-entity-autoscaling-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.Boolean,value:!0,parent:gA,autogeneration:null,valueAsType:null},parent:vA},DA={hidden:!1,required:!0,id:"default-relational-database-entity-autoscaling-property-id",name:"Auto-scaling",version:1,type:i.Property,private:!1,abstract:!1,implements:Wo,static:!0,index:5,dataType:IA,description:"If true, this database will automatically scale up or down in memory size, based on the usage.s",parent:jr},PA={id:"default-relational-database-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},Tl={id:"default-relational-database-entity-id",type:i.CustomEntity,version:1,name:"Relational Database",description:"A database that permanently stores the persisted entities attached to it.",abstract:!1,static:!0,properties:[bA,DA,iA,lA,pA,mA],methods:[],abstractMethods:[],extends:[],implements:[Dn],x:0,y:0,parent:PA},AA={id:"user-prototype-database-property-data-type-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-data-type-id",entityType:i.DataType},SA={id:"user-prototype-database-property-ref-id",type:i.GenericReference,entityId:"user-prototype-database-property-id",entityType:i.Property},OA={id:"user-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Dn,asType:!1,defaultValue:{id:"user-prototype-database-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.EntityTemplate,valueAsType:Tl,autogeneration:null,parent:AA},parent:SA},CA={id:"user-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.CustomEntity},BA={hidden:!1,required:!0,id:"user-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:bi,static:!0,index:0,dataType:OA,description:"The database that the entity belongs to.",parent:CA},wA={type:i.GenericReference,id:"user-prototype-parent-ref-id",entityType:i.Project,entityId:H},El={type:i.CustomEntity,id:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",version:1,name:"User",description:"A user of the application",implements:[Ve],abstract:!1,static:!1,abstractMethods:[],extends:[],properties:[BA],methods:[],x:0,y:0,parent:wA},MA={type:i.GenericReference,id:"person-date-of-birth-property-data-type-parent-ref-id",entityType:i.Property,entityId:"person-date-of-birth-property-id"},_A={id:"person-date-of-birth-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:sn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:MA},NA={type:i.GenericReference,id:"person-date-of-birth-property-parent-ref-id",entityType:i.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},VA={hidden:!1,required:!0,type:i.Property,id:"person-date-of-birth-property-id",version:1,name:"Date of birth",description:"The date of birth of the person",implements:null,private:!1,static:!1,index:0,dataType:_A,abstract:!1,parent:NA},$A={type:i.GenericReference,id:"a2867827-2f8e-4c25-b18b-d91857d7f24e",entityType:i.Property,entityId:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7"},LA={id:"1d49f41b-17b9-4f48-87aa-3ce43498e5a9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:$A},GA={type:i.GenericReference,id:"01cbe760-40a9-4f49-8e3d-194d2f57cb1e",entityType:i.CustomEntity,entityId:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},FA={hidden:!1,required:!0,type:i.Property,id:"cacfec92-46c3-4fca-a1d9-fd1ba94d78c7",version:1,name:"Name",description:"The name of the person",implements:null,private:!1,static:!1,index:0,dataType:LA,abstract:!1,parent:GA},UA={type:i.GenericReference,id:"3542b22a-3a2f-41c6-876e-24c885572498",entityType:i.Project,entityId:H},ut={type:i.CustomEntity,id:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416",version:1,name:"Person",description:"A entity to store more information about a person than the user entity does, to split the responsibilities and keep it the logic clean.",properties:[FA,VA],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[El],x:0,y:0,parent:UA},xA={type:i.GenericReference,id:"b59c80b7-b2e9-41e9-abcd-7c5652835efc",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},jA={type:i.GenericReference,id:"1190b5a2-f25e-46db-884d-8a3dd1a44d94",entityType:i.ReturnStatement,entityId:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e"},kA={type:i.GenericReference,id:"36c63126-7814-496f-a6cc-48662c2aabae",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},qA={type:i.GenericReference,id:"c567e55d-ec12-4e4e-958e-f07522892b4b",entityType:i.ReturnDeclaration,entityId:"9e070523-7e07-4100-8637-960a187f5f14"},JA={id:"3973c5a1-f0d8-49a0-a9a9-a0009bf3f0d8",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qA},Rl={isError:!1,id:"9e070523-7e07-4100-8637-960a187f5f14",type:i.ReturnDeclaration,version:1,name:"Output Account Owner",description:null,dataType:JA,readsValue:kA,required:!0,index:0,parent:jA},WA={type:i.GenericReference,id:"567d923c-20da-4c1e-956d-962ea30c6d0b",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},HA={type:i.GenericReference,id:"da85e620-59f3-42ab-88c8-b38d33c2c833",entityType:i.FunctionDeclaration,entityId:"36f29f96-c001-4b9a-b49c-83eff406a060"},aT={type:i.ReturnStatement,id:"3ebc4342-c9e8-42e7-a61c-7937081e1d2e",version:1,outputs:[Rl],calledByError:[],calledByEntry:[WA],calledBySuccess:[],throws:null,x:0,y:0,parent:HA},YA={type:i.GenericReference,id:"1c806bb7-4c25-4bad-963b-93dfbb7c8304",entityType:i.ArgumentDeclaration,entityId:"500dee3a-3435-4453-9699-0d053f646523"},zA={id:"d90fcc18-642b-433c-8fcb-4094b9031cd5",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YA},sT={id:"500dee3a-3435-4453-9699-0d053f646523",type:i.ArgumentDeclaration,version:1,name:"New Account Owner",description:null,dataType:zA,required:!0,writesValues:[Rl],index:0,parent:xA},ZA={type:i.GenericReference,id:"83dceb60-f3c4-4085-824c-85f2003bfd27",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},oT={type:i.FunctionDeclaration,id:"36f29f96-c001-4b9a-b49c-83eff406a060",version:1,name:"Change owner of bank account",description:null,implements:null,inputs:[sT],calls:[aT],returnStatements:[aT],index:0,collapsed:!1,private:!1,x:0,y:0,parent:ZA},XA={type:i.GenericReference,id:"adbaf302-ffa9-49b6-a3c6-83f9a75068e3",entityType:i.VariableDeclaration,entityId:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b"},QA={id:"79ee04aa-1ba4-4ae9-a406-ed45e5b03f7f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:XA},KA={type:i.GenericReference,id:"55e212d1-f0ec-4bb6-acbe-60f741367daf",entityType:i.OutputMap,entityId:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4"},eS={type:i.GenericReference,id:"944e1171-3d9b-4559-9386-1d4974b15962",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},tS={id:"8e36a476-766e-4cc2-a8a7-27a07dfb5a4b",type:i.VariableDeclaration,version:1,name:"Output Account Owner",description:null,dataType:QA,readsValue:KA,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:eS},nS={type:i.GenericReference,id:"b89ebc83-52cf-4447-a5ae-62241f713079",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},rS={id:"dc9ddb8f-02a0-4a43-aea6-270ec7b7f8a4",type:i.OutputMap,version:1,declaration:Rl,writesValues:[tS],index:0,parent:nS},iS={type:i.GenericReference,id:"c1b9e125-1aad-48b7-9687-95c57a6bc10d",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},aS={type:i.GenericReference,id:"d2deaa02-e164-4425-905c-6dee47eb4eac",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},sS={type:i.GenericReference,id:"1109a655-ac62-4110-a933-42a72106f4f0",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},oS={id:"7d9a1307-512e-42ec-9797-2f7229796b97",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:sS},lS={type:i.GenericReference,id:"bb61ebf7-57b3-4d14-905d-82ec907205b5",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},cS={type:i.GenericReference,id:"6b8c7bf2-9fc8-4ea4-9ec0-f41679d513b1",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},dS={type:i.GenericReference,id:"6163d1a1-7a94-49b1-95bb-aecd8d6d335c",entityType:i.FunctionCall,entityId:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e"},uS={type:i.GenericReference,id:"1f900f62-4bd2-4246-94aa-b8f5aad384fd",entityType:i.VariableDeclaration,entityId:"8bea6986-8da2-487b-905d-2fb962db6728"},lT={id:"be8538be-e6f9-4b94-9314-a546003ebaa0",type:i.InputMap,version:1,declaration:sT,name:null,description:null,readsValue:uS,dynamicArguments:[],defaultValue:null,index:0,parent:dS},pS={type:i.VariableDeclaration,id:"8bea6986-8da2-487b-905d-2fb962db6728",version:1,name:"Changed Account Owner",description:null,dataType:oS,readsValue:lS,writesValues:[lT],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:cS},yS={type:i.FunctionCall,id:"78f6dba8-bed8-44cd-8b0f-6dcc787d1e1e",version:1,declaration:oT,inputs:[lT],outputs:[rS],process:null,successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[iS],calledBySuccess:[],parent:aS,error:null,x:0,y:0},hS={type:i.GenericReference,id:"2d47aba1-a918-46a7-8db7-78809928654a",entityType:i.ArgumentDeclaration,entityId:"38f6b236-98ac-47b0-ab9c-d2f9610137b9"},fS={id:"5583766c-e9a5-484c-8f43-f4b0a6a1876c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:hS},mS={type:i.GenericReference,id:"3e2a81e4-55b2-49f5-94eb-39135e95c3d7",entityType:i.FunctionDeclaration,entityId:"15ee556d-681f-47de-a31f-16d4ba73cc4e"},TS={id:"38f6b236-98ac-47b0-ab9c-d2f9610137b9",type:i.ArgumentDeclaration,version:1,description:null,name:"New Company Owner",dataType:fS,required:!0,index:0,writesValues:[pS],parent:mS},ES={type:i.GenericReference,id:"30291b01-1b94-4d03-b434-dec122c2bc7d",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},RS={type:i.FunctionDeclaration,id:"15ee556d-681f-47de-a31f-16d4ba73cc4e",version:1,description:null,name:"Change Account Owner",inputs:[TS],collapsed:!0,returnStatements:[],calls:[yS],private:!1,index:0,implements:null,x:0,y:0,parent:ES},bS={type:i.GenericReference,id:"72c7ac0a-886e-4e10-b7ed-2f5a819a0233",entityType:i.Property,entityId:"b8f4656a-2b77-43ab-af51-7c32ddede044"},gS={id:"c09dd282-73f6-4077-a467-b66db20b9fc6",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:bS},vS={type:i.GenericReference,id:"8a950024-512c-4580-81db-a705410aeb99",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},cT={hidden:!1,required:!0,type:i.Property,id:"b8f4656a-2b77-43ab-af51-7c32ddede044",version:1,name:"Account number",description:null,private:!0,implements:null,static:!1,index:0,dataType:gS,abstract:!1,parent:vS},IS={type:i.GenericReference,id:"b6704b6c-c3bd-49d0-8ebc-82d03e726cbb",entityType:i.Property,entityId:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea"},DS={id:"c03e0b0a-88ab-401a-8833-4806738bdc37",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:IS},PS={type:i.GenericReference,id:"1ef999a7-e9ed-406a-866e-e58277fc985b",entityType:i.CustomEntity,entityId:"506946aa-30da-48e6-918f-ffd9eac58813"},dT={hidden:!1,required:!0,type:i.Property,id:"733d06a6-b8c5-44f3-a1f7-a8c9bd9e44ea",version:1,description:null,name:"Account Owner",index:1,dataType:DS,implements:null,static:!1,private:!0,abstract:!1,parent:PS},AS={type:i.GenericReference,id:"d41d7f41-98b8-4f67-be92-c349fdda5156",entityType:i.Project,entityId:H},kr={type:i.CustomEntity,id:"506946aa-30da-48e6-918f-ffd9eac58813",version:1,name:"Bank Account",description:null,abstract:!1,static:!1,abstractMethods:[],properties:[cT,dT],methods:[oT,RS],extends:[],implements:[Ve],x:0,y:0,parent:AS},Ui="bitcoin-api-response-id",uT="time-property-id",pT="disclamer-property-id",yT="chart-name-property-id",hT="bpi-property-id",ps="bpi-entity-id",fT="usd-property-id",mT="gbp-property-id",TT="eur-property-id",qr="currency-entity-id",ET="currency-code-property-id",RT="currency-symbol-property-id",bT="currency-rate-property-id",gT="currency-description-property-id",vT="currency-rate-number-property-id",SS={type:i.GenericReference,id:"code-property-data-type-parent-ref-id",entityType:i.Property,entityId:ET},OS={id:"code-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["USD","GBP","EUR"],constant:!1,parent:SS},CS={type:i.GenericReference,id:"code-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},BS={hidden:!1,required:!0,type:i.Property,id:ET,version:1,name:"code",description:null,dataType:OS,index:0,implements:null,static:!1,private:!1,abstract:!1,parent:CS},wS={type:i.GenericReference,id:"symbol-property-data-type-parent-ref-id",entityType:i.Property,entityId:RT},MS={id:"symbol-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,asType:!1,isNullable:!1,defaultValue:null,options:["$","£","€"],constant:!1,parent:wS},_S={type:i.GenericReference,id:"symbol-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},NS={hidden:!1,required:!0,type:i.Property,id:RT,version:1,name:"symbol",description:null,index:0,dataType:MS,implements:null,static:!1,private:!1,abstract:!1,parent:_S},VS={type:i.GenericReference,id:"rate-property-data-type-parent-ref-id",entityType:i.Property,entityId:bT},$S={id:"rate-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:VS},LS={type:i.GenericReference,id:"rate-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},GS={hidden:!1,required:!0,type:i.Property,id:bT,version:1,name:"rate",description:null,index:0,dataType:$S,implements:null,static:!1,private:!1,abstract:!1,parent:LS},FS={type:i.GenericReference,id:"description-property-data-type-parent-ref-id",entityType:i.Property,entityId:gT},US={id:"description-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:FS},xS={type:i.GenericReference,id:"description-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},jS={hidden:!1,required:!0,type:i.Property,id:gT,version:1,name:"description",description:null,dataType:US,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:xS},kS={type:i.GenericReference,id:"rate-number-property-data-type-parent-ref-id",entityType:i.Property,entityId:vT},qS={id:"rate-number-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:kS},JS={type:i.GenericReference,id:"rate-number-property-parent-ref-id",entityType:i.CustomEntity,entityId:qr},WS={hidden:!1,required:!0,type:i.Property,id:vT,version:1,name:"rate_float",description:null,dataType:qS,implements:null,static:!1,index:0,private:!1,abstract:!1,parent:JS},HS={type:i.GenericReference,id:"currency-prototype-parent-ref-id",entityType:i.Project,entityId:H},ys={type:i.CustomEntity,id:qr,version:1,name:"Currency",description:"This entity describes a currency in the Bitcoin Price Index.",properties:[BS,NS,GS,jS,WS],static:!1,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:HS},YS={type:i.GenericReference,id:"usd-property-data-type-parent-ref-id",entityType:i.Property,entityId:fT},zS={id:"usd-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ys,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:YS},ZS={type:i.GenericReference,id:"usd-property-parent-ref-id",entityType:i.CustomEntity,entityId:ps},XS={hidden:!1,required:!0,id:fT,type:i.Property,version:1,name:"USD",description:null,index:0,dataType:zS,implements:null,static:!1,private:!1,abstract:!1,parent:ZS},QS={type:i.GenericReference,id:"gbp-property-data-type-parent-ref-id",entityType:i.Property,entityId:mT},KS={id:"gbp-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ys,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:QS},eO={type:i.GenericReference,id:"gbp-property-parent-ref-id",entityType:i.CustomEntity,entityId:ps},tO={hidden:!1,required:!0,id:mT,type:i.Property,version:1,name:"GBP",description:null,index:0,dataType:KS,implements:null,static:!1,private:!1,abstract:!1,parent:eO},nO={type:i.GenericReference,id:"eur-property-data-type-parent-ref-id",entityType:i.Property,entityId:TT},rO={id:"eur-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ys,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:nO},iO={type:i.GenericReference,id:"eur-property-parent-ref-id",entityType:i.CustomEntity,entityId:ps},aO={hidden:!1,required:!0,id:TT,type:i.Property,version:1,name:"EUR",description:null,implements:null,static:!1,index:0,dataType:rO,private:!1,abstract:!1,parent:iO},sO={type:i.GenericReference,id:"bpi-prototype-parent-ref-id",entityType:i.Project,entityId:H},IT={type:i.CustomEntity,id:ps,version:1,name:"BPI",description:"The Bitcoin Price Index",properties:[XS,tO,aO],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:sO},oO={type:i.GenericReference,id:"time-property-data-type-parent-ref-id",entityType:i.Property,entityId:uT},lO={id:"time-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Io,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:oO},cO={type:i.GenericReference,id:"time-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},dO={hidden:!1,required:!0,type:i.Property,id:uT,version:1,name:"time",description:null,index:0,dataType:lO,implements:null,static:!1,private:!1,abstract:!1,parent:cO},uO={type:i.GenericReference,id:"disclamer-property-data-type-parent-ref-id",entityType:i.Property,entityId:pT},pO={id:"disclamer-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:uO},yO={type:i.GenericReference,id:"disclamer-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},hO={hidden:!1,required:!0,type:i.Property,id:pT,version:1,name:"disclamer",description:null,index:0,dataType:pO,implements:null,static:!1,private:!1,abstract:!1,parent:yO},fO={type:i.GenericReference,id:"chart-name-property-data-type-parent-ref-id",entityType:i.Property,entityId:yT},mO={id:"chart-name-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:fO},TO={type:i.GenericReference,id:"chart-name-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},EO={hidden:!1,required:!0,type:i.Property,id:yT,version:1,name:"chartName",description:null,index:0,dataType:mO,implements:null,static:!1,private:!1,abstract:!1,parent:TO},RO={type:i.GenericReference,id:"bpi-property-data-type-parent-ref-id",entityType:i.Property,entityId:hT},bO={id:"bpi-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:IT,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:RO},gO={type:i.GenericReference,id:"bpi-property-parent-ref-id",entityType:i.CustomEntity,entityId:Ui},vO={hidden:!1,required:!0,type:i.Property,id:hT,version:1,name:"bpi",description:null,implements:null,index:0,dataType:bO,static:!1,private:!1,abstract:!1,parent:gO},IO={type:i.GenericReference,id:"bitcoin-api-response-parent-ref-id",entityType:i.Project,entityId:H},DT={type:i.CustomEntity,id:Ui,version:1,name:"Bitcoin API Response type",description:"The type of the data structure response from the Bitcoin API call",properties:[dO,hO,EO,vO],abstract:!1,static:!1,abstractMethods:[],methods:[],extends:[],implements:[],x:0,y:0,parent:IO},DO={type:i.GenericReference,id:"eefa0147-f873-484b-b4f3-9e6493aab183",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},PO={id:"b9f35112-dcb2-4b7c-8fb9-f196b3fa37f9",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:DO},AO={type:i.GenericReference,id:"128770d6-5e3a-4aff-bca0-ad1f32ebefa8",entityType:i.ReturnStatement,entityId:"e4e05975-c277-471a-b869-f0aed316045c"},SO={type:i.GenericReference,id:"0be84bf9-6421-42b9-980f-6a03f30cb809",entityType:i.ReturnDeclaration,entityId:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},OO={id:"43daa02a-237b-4b7c-a6e9-2b8c167f6e22",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SO},CO={type:i.GenericReference,id:"ad380383-4a47-43da-968e-75a2d603b230",entityType:i.ArgumentDeclaration,entityId:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},PT={isError:!1,id:"a1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"New Company Owner",description:"The new owner of the company",dataType:OO,readsValue:CO,required:!0,index:0,parent:AO},BO={type:i.GenericReference,id:"4f24dc27-59a1-49bf-abcc-7d72b00926e4",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},wO={id:"f2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",type:i.ArgumentDeclaration,version:1,name:"New Company Owner",description:null,dataType:PO,writesValues:[PT],required:!0,index:0,parent:BO},MO={type:i.GenericReference,id:"5c9a02f0-d2cf-4efc-828e-467f33a74dd3",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},_O={type:i.GenericReference,id:"2ff8f3da-e0c5-4f0f-b688-2c051c588786",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},NO={type:i.GenericReference,id:"195ae28c-159b-42de-80b1-2ebb8be3619f",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},AT={type:i.ReturnStatement,id:"e4e05975-c277-471a-b869-f0aed316045c",version:1,outputs:[PT],calledByError:[],calledByEntry:[_O],calledBySuccess:[],throws:null,x:0,y:0,parent:NO},VO={type:i.FunctionDeclaration,id:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4",version:1,name:"Change owner of company",description:"Change the owner of the company to a new person",inputs:[wO],calls:[AT],index:0,collapsed:!1,implements:null,returnStatements:[AT],private:!1,x:0,y:0,parent:MO},$O={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},LO={type:i.GenericReference,id:"29c4e3e0-1b66-4075-b559-45b27c5cf356",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},GO={type:i.GenericReference,id:"b1289358-b185-455d-8f58-7791b15cd52a",entityType:i.ReturnStatement,entityId:"9690cd1d-ea35-4e83-823d-0c7310265fee"},FO={type:i.GenericReference,id:"d847bb49-8789-4550-bb2d-e2d551993b28",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},UO={type:i.GenericReference,id:"06535500-c37c-4915-8398-1d4e184fa5e7",entityType:i.ReturnDeclaration,entityId:"e7a35277-a0c4-46d5-aca2-bddd0c26e931"},xO={id:"d358dd91-35f7-4095-b728-3fb3c71dbc05",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:UO},bl={isError:!1,id:"e7a35277-a0c4-46d5-aca2-bddd0c26e931",type:i.ReturnDeclaration,version:1,name:"Is name registered",description:"Whether the company name is already registered",dataType:xO,readsValue:FO,required:!0,index:0,parent:GO},jO={type:i.GenericReference,id:"gov-company-registry-return-statement-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},gl={type:i.ReturnStatement,id:"9690cd1d-ea35-4e83-823d-0c7310265fee",version:1,outputs:[bl],calledByError:[],calledByEntry:[],calledBySuccess:[$O,jO],throws:null,x:0,y:0,parent:LO},kO={type:i.GenericReference,id:"b3126414-4c9b-495f-901e-59f5073c8d67",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},qO={type:i.GenericReference,id:"35115c48-618b-411b-a290-d746d22fdd10",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},ST={id:"a0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:Go,name:null,description:null,dynamicArguments:[],readsValue:qO,defaultValue:null,parent:kO,index:2},JO={type:i.GenericReference,id:"14f46eae-04a5-47d1-9c7f-28fb09b84d1d",entityType:i.VariableDeclaration,entityId:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a"},WO={id:"990bd5d1-07ea-4253-acc1-d03bedd22a38",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vn,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:JO},HO={type:i.GenericReference,id:"e4c3542a-8fb0-4b72-8d6e-3fdff812dd67",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},YO={type:i.GenericReference,id:"825f9f60-22a8-4cc6-9055-d7333f8e92f4",entityType:i.OutputMap,entityId:"8f30d787-9459-4d8d-98a2-b46fbc2006d5"},zO={type:i.GenericReference,id:"is-company-name-registered-var-called-by-ref",entityType:i.Operation,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},OT={type:i.VariableDeclaration,id:"e5a8b6d0-0e6f-4e9a-9b1e-8a2b5c7f0d5a",version:1,name:"Is name registered",description:"Whether the company name is registered with the government company registry",dataType:WO,readsValue:YO,writesValues:[bl],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[zO],successCalls:[gl],errorCalls:[],internalCalls:[],x:0,y:0,parent:HO},ZO={type:i.GenericReference,id:"1aba021e-48ef-44ac-93d0-eaecac5895da",entityType:i.InputMap,entityId:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a"},XO={type:i.GenericReference,id:"dffae7e0-0a5c-4c14-8ed2-8d680b4c4c86",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},QO={type:i.InputMap,id:"c3c8d6c1-3e0d-4e6c-9f9c-6b8c7d7f8e9a",version:1,declaration:Oa,name:null,description:null,readsValue:null,defaultValue:{id:"gov-http-request-url-argument-default-value-id",type:i.PrimitiveValue,version:1,value:"https://api.publicapis.org/entries",name:D.String,valueAsType:null,parent:ZO,autogeneration:null},index:1,dynamicArguments:[],parent:XO},KO={type:i.GenericReference,id:"64ae61f5-ace7-401b-926d-25f852daa60e",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},eC={id:"8f30d787-9459-4d8d-98a2-b46fbc2006d5",type:i.OutputMap,version:1,declaration:Ti,index:2,writesValues:[OT],parent:KO},tC={type:i.GenericReference,id:"62a1a086-caea-4270-9c9f-a1695503e745",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},nC={id:"48cf7654-8f3e-4fcd-abc6-740876c310a0",type:i.InputMap,version:1,declaration:Sa,name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:null,parent:tC},rC={type:i.GenericReference,id:"b0c9c79f-f525-428d-99e7-087d3237ad62",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},iC={id:"2c1dc406-4b71-4023-87b2-abede3a111d2",type:i.InputMap,version:1,name:null,description:null,declaration:Ca,dynamicArguments:[],index:3,readsValue:null,defaultValue:null,parent:rC},aC={type:i.GenericReference,id:"9887d6c9-d75b-4c97-b722-e2e60945ea20",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},sC={id:"3fef94b2-0278-43ae-b0c5-bc7083f0a111",type:i.InputMap,version:1,declaration:Ba,name:null,description:null,dynamicArguments:[],readsValue:null,index:4,defaultValue:null,parent:aC},oC={type:i.GenericReference,id:"561275b6-5056-45d8-bf7d-8abaa4645593",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},lC={id:"3efe20a7-4d63-411e-89ef-63e277f48d66",type:i.OutputMap,version:1,declaration:wa,index:1,writesValues:[],parent:oC},cC={type:i.GenericReference,id:"3170ccc2-13de-4bfc-802a-a643be41cd42",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},dC={id:"40d34323-d7e6-440a-8016-67c05a3b66dd",type:i.OutputMap,version:1,declaration:Ti,index:0,writesValues:[],parent:cC},uC={type:i.GenericReference,id:"7432fa82-f574-4c54-a8fa-4cc4376da3d5",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},pC={type:i.GenericReference,id:"8f518502-9eea-462c-8753-8bc3bf3e29a9",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},yC={type:i.GenericReference,id:"123b8f18-79d9-4166-a5f6-78ec4b461680",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},hC={type:i.GenericReference,id:"e691026f-6db0-43ec-93cd-805ae7d713e3",entityType:i.FunctionCall,entityId:"abb5d456-ee85-4800-bdd9-d409415f60d7"},fC={type:i.GenericReference,id:"a375eedf-4811-41aa-a998-4897c69c46b9",entityType:i.ReturnDeclaration,entityId:"024a9b77-c1cd-4b67-b3ba-1935046b590d"},mC={id:"767cc5ed-20ec-4fd1-89b1-c8d19daa87d1",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Ke,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:fC},TC={type:i.GenericReference,id:"e64b0c23-129d-4d74-8ab4-eec60e1e5b9b",entityType:i.ReturnStatement,entityId:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3"},CT={isError:!0,id:"024a9b77-c1cd-4b67-b3ba-1935046b590d",type:i.ReturnDeclaration,version:1,name:"Error",description:"The error that occurred during the HTTP request to the government company registry",dataType:mC,required:!0,readsValue:null,index:0,parent:TC},EC={type:i.ReturnStatement,id:"ea444a9e-6a5b-4138-b81f-0d5618c3c6f3",version:1,outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[hC],throws:CT,x:0,y:0,parent:yC},RC={type:i.GenericReference,id:"323814fb-9723-49ef-bbba-f882384f18e4",entityType:i.FunctionCall,entityId:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7"},bC={id:"2f63f7ba-0ff0-458a-92bc-65d1dd4df8c3",type:i.OutputMap,declaration:Uo,version:1,writesValues:[CT],index:0,parent:RC},gC={type:i.Operation,id:"4eb96d0b-025b-4ed1-ae34-0cebbb07f1e7",version:1,declaration:Ei,inputs:[nC,QO,ST,iC,sC],outputs:[dC,lC,eC],process:null,calledByError:[],calledByEntry:[uC],calledBySuccess:[],successCalls:[gl,OT],errorCalls:[EC],error:bC,dynamicArguments:[],x:0,y:0,parent:pC},vC={type:i.GenericReference,id:"597b8aa2-f6f2-4f7d-bbb9-b703d02de96a",entityType:i.InputMap,entityId:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a"},IC={type:i.GenericReference,id:"546d99b3-28c4-4186-93a0-ac53c1565e07",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},DC={id:"b0e7b4e5-2f5f-4d4c-8f5c-1e1f1e1a1b1a",type:i.InputMap,version:1,declaration:Da,name:null,description:null,readsValue:null,defaultValue:{id:"base-query-string-map-default-value-id",type:i.PrimitiveValue,version:1,value:"?name=",name:D.String,parent:vC,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:IC},PC={type:i.GenericReference,id:"6a56fb22-82e1-47c9-bf85-41c4e5986c74",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},AC={type:i.GenericReference,id:"191c6a6d-9bcb-441e-bf98-de0da96f5f3a",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},SC={type:i.GenericReference,id:"d8fcbb76-dae2-40cf-847a-02364721b387",entityType:i.VariableDeclaration,entityId:"83e12ebb-c958-4dee-b750-8ab9930f0f4e"},OC={id:"6a70c42b-024a-47c6-8a9d-af52be9c9b9a",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:SC},CC={type:i.GenericReference,id:"2282e2c0-ed9e-4c7b-86fc-1a364fa0fdb8",entityType:i.OutputMap,entityId:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5"},BC={type:i.GenericReference,id:"assembled-query-string-called-by-ref",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},BT={type:i.VariableDeclaration,id:"83e12ebb-c958-4dee-b750-8ab9930f0f4e",version:1,name:"Query string",description:"The final, assembled query string that will be used in the HTTP request to the government company registry",dataType:OC,readsValue:CC,writesValues:[ST],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[BC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:AC},wC={id:"f6c22cf8-63e4-4b2d-b649-b5ab884cf9a5",type:i.OutputMap,version:1,writesValues:[BT],declaration:fi,index:0,parent:PC},MC={type:i.GenericReference,id:"a1b48e7c-0301-4747-b4dd-b5af79956f7f",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},_C={type:i.GenericReference,id:"487c9235-be95-4c96-b9b5-2714b374a277",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},NC={type:i.GenericReference,id:"f6471f4f-b269-46fa-80ec-885e87a449c2",entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69",entityType:i.ArgumentDeclaration},VC={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:"8f2094c0-e27e-465e-9280-112da0de9019"},wT={id:"08f36e2b-bad2-425c-8129-93560bec8488",version:1,type:i.InputMap,declaration:Pa,name:null,description:null,readsValue:NC,dynamicArguments:[],defaultValue:null,index:1,parent:VC},$C={type:i.Operation,id:"8f2094c0-e27e-465e-9280-112da0de9019",declaration:mi,version:1,inputs:[DC,wT],outputs:[wC],process:null,calledByError:[],calledByEntry:[MC],calledBySuccess:[],dynamicArguments:[],successCalls:[BT],errorCalls:[],error:null,x:0,y:0,parent:_C},LC={type:i.GenericReference,id:"c2e0e9b4-aa46-4974-bf8a-886b737b12fb",entityType:i.ArgumentDeclaration,entityId:"a4106e8e-ec4f-4633-a636-09ae73135f69"},GC={id:"a4279518-3bf3-44b7-a2ac-65142ca37f1c",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LC},FC={type:i.GenericReference,id:"dc273f24-164b-4943-82f9-589b237141e2",entityType:i.FunctionDeclaration,entityId:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d"},MT={id:"a4106e8e-ec4f-4633-a636-09ae73135f69",type:i.ArgumentDeclaration,version:1,name:"Company Name to check",description:"The name of the company to check in the government registry",dataType:GC,required:!1,writesValues:[wT],index:0,parent:FC},UC={type:i.GenericReference,id:"2178a10c-1cc0-4dad-97c3-0941be6c9738",entityType:i.Project,entityId:H},_T={type:i.FunctionDeclaration,id:"e0f6e8a7-6e4b-4d0e-8a1a-6b4c1b0b7e9d",version:1,name:"Check Gov Company Registry availability",description:"Check whether the company name is already registered in the government company registry, or it is available for a new company to use.",inputs:[MT],calls:[$C,gC],returnStatements:[gl],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:UC},xC={type:i.GenericReference,id:"4d66c53c-f0f7-496a-9955-1e6c8533c5e0",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},jC={type:i.GenericReference,id:"6fa0c8e0-d104-4b4d-a035-d4f6e0c49f09",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},kC={type:i.GenericReference,id:"146408d5-5336-4877-941a-777dd5871926",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},qC={type:i.GenericReference,id:"34ae8f8c-548d-4654-984a-6f36affdaf49",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},NT={id:"69b1215d-9ebf-4274-b9cb-d4a5888f5122",version:1,type:i.InputMap,declaration:MT,name:null,description:null,readsValue:kC,dynamicArguments:[],defaultValue:null,index:0,parent:qC},JC={type:i.GenericReference,id:"07540a94-dda1-40b3-8452-f209bdc87b88",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},WC={type:i.GenericReference,id:"eaddf12a-a995-429e-90a0-13bf06efeb28",entityType:i.VariableDeclaration,entityId:"faaf3bf6-917d-40d7-aee6-5164f6646c4b"},HC={id:"7fdaf943-3ffb-48e0-b766-b86cc24090cf",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:vn,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:WC},YC={type:i.GenericReference,id:"030fb5c5-af4d-4c85-8cf0-e99edd50d2bd",entityType:i.OutputMap,entityId:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},zC={type:i.GenericReference,id:"a8b618e9-c68c-48c1-8bd6-ef47c87d699e",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},ZC={type:i.GenericReference,id:"is-company-name-valid-var-called-by-ref",entityType:i.FunctionCall,entityId:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a"},VT={type:i.VariableDeclaration,id:"faaf3bf6-917d-40d7-aee6-5164f6646c4b",version:1,name:"Is name valid",description:"Whether the company name is valid",dataType:HC,readsValue:YC,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[ZC],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:zC},XC={id:"c1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.OutputMap,version:1,declaration:bl,writesValues:[VT],index:0,parent:JC},QC={type:i.FunctionCall,id:"d2c2c3b0-5f3c-4d0d-9e4c-2d5a2c1f1e2a",version:1,declaration:_T,inputs:[NT],outputs:[XC],calledByError:[],calledByEntry:[],process:null,calledBySuccess:[xC],successCalls:[VT],errorCalls:[],error:null,x:0,y:0,parent:jC},KC={type:i.GenericReference,id:"9d0b87b4-bfed-4e02-9e84-6831c21feae2",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},eB={type:i.GenericReference,id:"74345f4f-e80d-48be-adff-d12fcea25bec",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},tB={type:i.GenericReference,id:"b39279ea-969a-4efb-a9ec-353bfd13db65",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},nB={type:i.GenericReference,id:"549db613-f225-4c5b-9634-7d096717f0ff",entityType:i.Condition,entityId:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b"},$T={id:"358e242c-7448-442e-ab8b-fd7fa119ea71",version:1,type:i.InputMap,declaration:zn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:tB,defaultValue:null,index:0,parent:nB},rB={type:i.Condition,id:"a8f4b0f2-5e5e-4e8f-9d7b-1b5b9b6e9a4b",version:1,declaration:zn,inputs:[$T],calledByError:[],calledByEntry:[KC],calledBySuccess:[],successCalls:[QC],errorCalls:[],x:0,y:0,parent:eB},iB={type:i.GenericReference,id:"43ba1e25-f805-488f-8ae8-c58bb6215b2f",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},aB={type:i.GenericReference,id:"eb091bed-507f-4a1e-93b5-7cd2fccfe002",entityType:i.VariableDeclaration,entityId:"9c928995-0dd5-4f97-9962-56b343bc8a45"},sB={id:"d64152ea-831f-4426-9506-a39bfa170513",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aB},oB={type:i.GenericReference,id:"7e79c29f-f7bd-441a-a77e-c627604dae94",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},lB={type:i.GenericReference,id:"8995ce5f-d5cf-4341-a8b1-5c046cc78b89",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},cB={type:i.GenericReference,id:"new-company-bank-account-var-decl-1-called-by-ref",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},LT={type:i.VariableDeclaration,id:"9c928995-0dd5-4f97-9962-56b343bc8a45",version:1,name:"New bank account",description:"The new entity value representing the new bank account of the company",dataType:sB,readsValue:lB,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[cB],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:oB},dB={type:i.GenericReference,id:"9a4887bf-d50d-43e4-bdd5-a5262f65f04b",entityType:i.ArgumentDeclaration,entityId:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071"},uB={id:"ae148c06-3143-49e9-9614-c3aca3f6fa7b",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kr,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:dB},pB={id:"7ed0f7bb-2df0-44e2-b0b3-0709dcca8071",type:i.ArgumentDeclaration,version:1,name:"New bank account",description:"The new bank account of the company",dataType:uB,required:!0,index:1,writesValues:[LT],parent:iB},yB={type:i.GenericReference,id:"caec9cf8-3133-48d4-a390-114fa71b2933",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},hB={type:i.GenericReference,id:"cebcbad8-ca87-4c4b-be8a-312293d49892",entityType:i.FunctionDeclaration,entityId:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84"},fB={type:i.GenericReference,id:"7b8ccfe5-f9cd-4776-a19b-80c689bbe3df",entityType:i.ArgumentDeclaration,entityId:"c6cf620c-1eee-4919-8578-1a0b6c088551"},mB={id:"2a6b4703-ac8d-4d25-8abd-48a115577fec",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:fB},TB={id:"c6cf620c-1eee-4919-8578-1a0b6c088551",type:i.ArgumentDeclaration,version:1,name:"New company name",description:null,dataType:mB,required:!0,index:0,writesValues:[$T,NT],parent:hB},EB={type:i.FunctionDeclaration,id:"183fd975-a5d3-4dff-8d6a-c62f5a4d5a84",version:1,name:"Company changed event",description:"The event that is triggered when a company is changed",returnStatements:[],collapsed:!1,inputs:[TB,pB],calls:[rB,LT],index:1,private:!1,implements:null,x:0,y:0,parent:yB},RB={type:i.GenericReference,id:"employee-manager-property-data-type-entity-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},bB={type:i.GenericReference,id:"employee-manager-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-manager-property-id"},gB={id:"employee-manager-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:RB,isList:!1,isNullable:!0,asType:!1,defaultValue:null,constant:!1,parent:bB},vB={type:i.GenericReference,id:"employee-manager-property-parent-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},IB={hidden:!1,required:!0,type:i.Property,id:"employee-manager-property-id",version:1,name:"Manager",description:"The manager of the employee",index:0,implements:null,private:!1,static:!1,dataType:gB,abstract:!1,parent:vB},DB={type:i.GenericReference,id:"employee-start-date-property-data-type-parent-ref-id",entityType:i.Property,entityId:"employee-start-date-property-id"},PB={id:"employee-start-date-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:sn,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:DB},AB={type:i.GenericReference,id:"employee-start-date-property-parent-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},SB={hidden:!1,required:!0,type:i.Property,id:"employee-start-date-property-id",version:1,name:"Start date",description:"The date the employee started working in the company",index:0,private:!1,static:!1,implements:null,dataType:PB,abstract:!1,parent:AB},OB={type:i.GenericReference,id:"employee-department-property-ref-id",entityType:i.Property,entityId:"employee-department-property-id"},CB={id:"employee-department-property-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:In,isList:!1,isNullable:!1,asType:!1,options:["Human Resources","Finance","IT","Sales","Marketing","Customer Service","Logistics","Product"],defaultValue:null,constant:!1,parent:OB},BB={type:i.GenericReference,id:"employee-department-property-parent-ref-id",entityType:i.CustomEntity,entityId:"employee-entity-id"},wB={hidden:!1,required:!0,type:i.Property,id:"employee-department-property-id",version:1,name:"Department",description:"The department the employee works in, from a list of departments in the company",index:0,implements:null,static:!1,private:!1,dataType:CB,abstract:!1,parent:BB},MB={type:i.GenericReference,id:"employee-prototype-parent-ref-id",entityType:i.Project,entityId:H},St={type:i.CustomEntity,id:"employee-entity-id",version:1,name:"Employee",description:"A entity that represents an employee in the company",properties:[wB,SB,IB],abstract:!1,static:!1,abstractMethods:[],methods:[],implements:[],extends:[ut],x:0,y:0,parent:MB},_B={type:i.GenericReference,id:"dec8fbfe-9124-41fd-9f1c-5b2f07cfd6ba",entityType:i.Property,entityId:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd"},NB={id:"bc0b8979-6c43-4d47-a712-6742b89e3c00",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:_B},VB={type:i.GenericReference,id:"4f8c0a05-466e-4672-b4c4-6bd408c0be9a",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},$B={hidden:!1,required:!0,type:i.Property,id:"4f52d044-f3dd-4bdf-927e-637c3b92e8bd",version:1,name:"Company Name",private:!1,static:!1,description:"The name of the company",index:0,implements:null,dataType:NB,abstract:!1,parent:VB},LB={type:i.GenericReference,id:"95173fe0-a6e6-443c-94f3-f7c5cf171fcf",entityType:i.Property,entityId:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"},GB={id:"ddbb6f5c-0cf4-41fb-83b3-b6c47c0e338d",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:kr,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:LB},FB={type:i.GenericReference,id:"6a9a0b72-a05d-4169-b3f3-5afb01e8d0df",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},vl={hidden:!1,required:!0,type:i.Property,id:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",version:1,name:"Bank account",description:"The bank account of the company",index:1,implements:null,static:!1,private:!1,dataType:GB,abstract:!1,parent:FB},UB={type:i.GenericReference,id:"62892cc6-d227-4088-90d3-ae7c15ed4af4",entityType:i.Property,entityId:"19a31727-1fba-40a5-be25-18e0f149d5cb"},xB={id:"1f7629df-dc29-4c89-8369-c6d043e97a9e",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:ut,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:UB},jB={type:i.GenericReference,id:"89384206-fd5a-4f0a-849c-f777473e5773",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},kB={hidden:!1,required:!0,type:i.Property,id:"19a31727-1fba-40a5-be25-18e0f149d5cb",version:1,name:"Company Owner",description:"The person that owns the company",index:2,static:!1,implements:null,dataType:xB,private:!0,abstract:!1,parent:jB},qB={type:i.GenericReference,id:"4d2ffb6c-5f38-436e-8339-fb9878ac2b5e",entityType:i.Property,entityId:"f8310850-a87e-405c-b182-4f1d5fa49240"},JB={id:"ad44250b-40c2-48f7-a480-381fa938f562",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:St,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:qB},WB={type:i.GenericReference,id:"aa5d4eee-6fac-4e72-bf21-9c8750024541",entityType:i.CustomEntity,entityId:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},HB={hidden:!1,required:!0,type:i.Property,id:"f8310850-a87e-405c-b182-4f1d5fa49240",version:1,name:"Employees",description:null,index:3,dataType:JB,implements:null,private:!0,static:!1,abstract:!1,parent:WB},YB={type:i.GenericReference,id:"e3c03b6b-2ea0-4d99-865d-5e6a348672d0",entityType:i.Project,entityId:H},Rt={type:i.CustomEntity,id:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d",version:1,name:"Company",description:null,properties:[$B,vl,kB,HB],static:!1,abstract:!1,abstractMethods:[],methods:[VO,EB],extends:[],implements:[Ve],x:0,y:0,parent:YB},zB={type:i.GenericReference,id:"ffcad334-138d-4b67-8fb3-5f0e6f5fefbd",entityType:i.Project,entityId:H},Il={type:i.FunctionDeclaration,id:"0f89260c-8c58-4639-8629-d9ea5ab40ba7",version:1,name:"Show popup",description:null,inputs:[],calls:[],returnStatements:[],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:zB};i.GenericReference,i.DataType;const ZB={id:"cron-job-entity-expression-property-ref-id",type:i.GenericReference,entityId:"cron-job-entity-expression-property-id",entityType:i.Property},XB={id:"cron-job-entity-expression-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:null,parent:ZB},QB={id:"cron-job-entity-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.CustomEntity},KB={hidden:!1,required:!0,id:"cron-job-entity-expression-property-id",type:i.Property,version:1,name:"Cron expression",description:"The cron expression that defines when the cron job should be triggered",dataType:XB,implements:null,static:!0,private:!1,abstract:!1,index:0,parent:QB},ew={id:"cron-job-entity-trigger-show-popup-func-call-called-by-ref-one-id",type:i.GenericReference,entityId:"show-popup-func-decl-id",entityType:i.FunctionDeclaration},tw={id:"cron-job-entity-trigger-show-popup-func-call-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-trigger-func-decl-id",entityType:i.FunctionDeclaration},nw={id:"cron-job-entity-trigger-show-popup-func-call-id",version:1,type:i.FunctionCall,declaration:Il,inputs:[],outputs:[],process:null,successCalls:[],calledByError:[],calledByEntry:[ew],calledBySuccess:[],errorCalls:[],error:null,x:0,y:0,parent:tw},rw={id:"cron-job-entity-trigger-func-decl-parent-ref-id",type:i.GenericReference,entityId:"cron-job-entity-id",entityType:i.CustomEntity},iw={id:"cron-job-entity-trigger-func-decl-id",version:1,type:i.FunctionDeclaration,name:"Scheduled trigger",description:"The function that is called when the cron job is triggered",inputs:[],private:!1,implements:Yo,calls:[nw],collapsed:!1,returnStatements:[],index:0,x:0,y:0,parent:rw},aw={id:"cron-job-entity-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},sw={id:"cron-job-entity-id",version:1,type:i.CustomEntity,name:"Run at 12pm on Christmas day",description:"A cron job that runs at 12pm on Christmas day",properties:[KB],static:!0,abstract:!1,abstractMethods:[],extends:[zo],implements:[],methods:[iw],x:0,y:0,parent:aw},ow={type:i.GenericReference,id:"52dbd85c-48b1-462a-8205-2437d6fb1cb4",entityType:i.Project,entityId:H},lw={type:i.CustomEntity,id:"6f0908c2-09c6-4a8b-8f43-d2467fe6fb39",version:1,name:"Get bank all bank accounts",description:null,properties:[],static:!0,abstract:!1,abstractMethods:[],methods:[],extends:[],implements:[Na],x:0,y:0,parent:ow},GT="f558fbf8-67de-4545-9804-6ae621e0b2d4",cw={id:"getCompanyByIdEndpointPathParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointPathParamsVariableDataType"},dw={id:"getCompanyByIdEndpointPathParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointPathParamsArgumentDeclaration"},uw={id:"getCompanyByIdEndpointPathParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:U,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:cw,autogeneration:null,valueAsType:null},parent:dw},pw={id:"getCompanyByIdEndpointReachedEntityEventRef",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},yw={id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointRequestHeadersVariableDataType"},hw={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration"},fw={id:"getCompanyByIdEndpointRequestHeadersVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"getCompanyByIdEndpointRequestHeadersVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:yw,autogeneration:null,valueAsType:null},parent:hw},mw={id:"getCompanyByIdEndpointRequestHeadersArgumentDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request headers",dataType:fw,required:!0,index:0,parent:pw},Tw={id:"getCompanyByIdEndpointReachedEntityEventRefTwo",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},Ew={id:"getCompanyByIdEndpointPathParamsArgumentDeclaration",type:i.ArgumentDeclaration,description:"A standarized text, without spaces that is added at the end of the domain and routes the request to a specific resource within the target server. For example: /api/users/123, /api/users/123/:name, /api/users/123/:name/:age.",version:1,name:"Path parameters",writesValues:[],dataType:uw,required:!0,index:1,parent:Tw},Rw={id:"getCompanyByIdEndpointReachedEntityEventRefThree",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},bw={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointRequestQueryParamsVariableDataType"},gw={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration"},vw={id:"getCompanyByIdEndpointRequestQueryParamsVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,asType:!1,entity:U,defaultValue:{id:"getCompanyByIdEndpointRequestQueryParamsVariableDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:bw,autogeneration:null,valueAsType:null},parent:gw},Iw={id:"getCompanyByIdEndpointRequestQueryParamsArgumentDeclaration",version:1,description:"A text with standarized format, without spaces that is added at the end of the URL path, after the ? character. It contains data that might be used to process the request. For example: /api/users?name=John&age=30",type:i.ArgumentDeclaration,writesValues:[],name:"Request query params",dataType:vw,required:!0,index:2,parent:Rw},Dw={id:"getCompanyByIdEndpointReachedEntityEventRefFour",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},Pw={id:"getCompanyByIdEndpointRequestBodyArgumentDeclarationRef",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:"getCompanyByIdEndpointRequestBodyArgumentDeclaration"},Aw={id:"getCompanyByIdEndpointRequestBodyVariableDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:Pw},Sw={id:"getCompanyByIdEndpointRequestBodyArgumentDeclaration",version:1,description:"The main data payload of the request.",type:i.ArgumentDeclaration,writesValues:[],name:"Request body",dataType:Aw,index:3,required:!0,parent:Dw},Ow={id:"getCompanyByIdEndpointResponseCodeReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseCodeReturnDeclaration"},Cw={id:"9ba575b0-6f8e-436d-a3de-3b843622aa17",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Ow},Bw={id:"getCompanyByIdEndpointReturnStatementRef",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},ww={isError:!1,id:"getCompanyByIdEndpointResponseCodeReturnDeclaration",version:1,description:"A standarized number that represents the status of the response. 200 for OK, 404 for not found, 500 for server error, etc.",type:i.ReturnDeclaration,name:"Response code",dataType:Cw,readsValue:null,required:!0,index:0,parent:Bw},Mw={id:"getCompanyByIdEndpointResponseHeadersDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointResponseHeadersDataType"},_w={id:"getCompanyByIdEndpointResponseHeadersReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseHeadersReturnDeclaration"},Nw={id:"getCompanyByIdEndpointResponseHeadersDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!0,isNullable:!1,constant:!1,entity:Ke,asType:!1,defaultValue:{id:"getCompanyByIdEndpointResponseHeadersDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.JSON,value:{},parent:Mw,autogeneration:null,valueAsType:null},parent:_w},Vw={id:"getCompanyByIdEndpointReturnStatementRefTwo",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},$w={isError:!1,id:"getCompanyByIdEndpointResponseHeadersReturnDeclaration",version:1,description:"A set of any properties, with names and value that transmit metadata about the response.",type:i.ReturnDeclaration,name:"Response headers",dataType:Nw,readsValue:null,required:!0,index:1,parent:Vw},Lw={id:"getCompanyByIdEndpointResponseBodyReturnDeclarationRef",type:i.GenericReference,entityType:i.ReturnDeclaration,entityId:"getCompanyByIdEndpointResponseBodyReturnDeclaration"},Gw={id:"getCompanyByIdEndpointResponseBodyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,asType:!1,constant:!1,entity:Ke,defaultValue:null,parent:Lw},Fw={id:"getCompanyByIdEndpointReturnStatementRefThree",type:i.GenericReference,entityType:i.ReturnStatement,entityId:"getCompanyByIdEndpointReturnStatement"},Uw={isError:!1,id:"getCompanyByIdEndpointResponseBodyReturnDeclaration",version:1,description:"The main data payload of the response.",type:i.ReturnDeclaration,name:"Response body",dataType:Gw,readsValue:null,required:!0,index:2,parent:Fw},xw={id:"getCompanyByIdEndpointReturnStatementCallerRef",type:i.GenericReference,entityId:"getCompanyByIdEndpointReachedEntityEvent",entityType:i.FunctionDeclaration},jw={id:"getCompanyByIdEndpointReachedEntityEventRefFive",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"getCompanyByIdEndpointReachedEntityEvent"},kw={id:"getCompanyByIdEndpointReturnStatement",type:i.ReturnStatement,version:1,outputs:[ww,$w,Uw],calledByError:[],calledByEntry:[xw],calledBySuccess:[],throws:null,x:0,y:0,parent:jw},qw={id:"endpointBuiltInBaseEntityRefFour",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:GT},Jw={id:"getCompanyByIdEndpointReachedEntityEvent",name:"Endpoint reached",version:1,type:i.FunctionDeclaration,inputs:[mw,Ew,Iw,Sw],returnStatements:[kw],description:"Fired when the endpoint is reached.",calls:[],collapsed:!1,implements:qo,index:0,private:!1,x:0,y:0,parent:qw},Ww={id:"getCompanyByIdEndpointPathPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointPathPropertyDataType"},Hw={id:"getCompanyByIdEndpointPathPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointPathProperty"},Yw={id:"getCompanyByIdEndpointPathPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!0,entity:U,asType:!1,defaultValue:{id:"getCompanyByIdEndpointPathPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,name:D.String,value:"/company/{id}",parent:Ww,valueAsType:null,autogeneration:null},parent:Hw},zw={id:"getCompanyByIdEndpointBaseEntityRefTwo",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},Zw={hidden:!1,required:!0,id:"getCompanyByIdEndpointPathProperty",name:"Path",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:jo,dataType:Yw,index:1,description:"Path to the endpoint, for example /api/users, or /api/users/{id}, or /api/users/{id}/:name. The path can contain parameters, which are defined by curly braces, and will be passed to the endpoint event as variables with the same name.",parent:zw},Xw={id:"getCompanyByIdEndpointMethodPropertyDataTypeRef",type:i.GenericReference,entityType:i.DataType,entityId:"getCompanyByIdEndpointMethodPropertyDataType"},Qw={id:"getCompanyByIdEndpointMethodPropertyRef",type:i.GenericReference,entityType:i.Property,entityId:"getCompanyByIdEndpointMethodProperty"},Kw={id:"getCompanyByIdEndpointMethodPropertyDataType",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:In,isList:!0,isNullable:!1,constant:!0,asType:!1,defaultValue:{id:"getCompanyByIdEndpointMethodPropertyDataTypeDefaultValueId",type:i.PrimitiveValue,version:1,value:"GET",name:D.Enum,parent:Xw,valueAsType:null,autogeneration:null},options:["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD","TRACE","CONNECT","CUSTOM"],parent:Qw},eM={id:"getCompanyByIdEndpointBaseEntityRefThree",type:i.GenericReference,entityType:i.BuiltInBaseEntity,entityId:N.HTTP_ENDPOINT},tM={hidden:!1,required:!0,id:"getCompanyByIdEndpointMethodProperty",name:"Method",version:1,type:i.Property,private:!1,abstract:!1,static:!0,implements:ko,index:0,dataType:Kw,description:null,parent:eM},nM={type:i.GenericReference,id:"6a905153-8aa8-4424-bd7b-6415731a2725",entityType:i.Project,entityId:H},rM={type:i.CustomEntity,id:GT,version:1,name:"Get given company data by id",description:null,properties:[Zw,tM],methods:[Jw],static:!0,abstract:!1,abstractMethods:[],extends:[],implements:[Na],x:0,y:0,parent:nM},iM={id:"product-prototype-database-property-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-id",entityType:i.Property},aM={id:"product-prototype-database-property-data-type-default-value-parent-ref-id",type:i.GenericReference,entityId:"product-prototype-database-property-data-type-default-value-id",entityType:i.DataType},sM={id:"product-prototype-database-property-data-type-id",version:1,type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,isList:!1,isNullable:!1,constant:!1,entity:Dn,asType:!1,defaultValue:{id:"product-prototype-database-property-data-type-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.EntityTemplate,valueAsType:Tl,autogeneration:null,parent:aM},parent:iM},oM={id:"product-prototype-database-property-parent-ref-id",type:i.GenericReference,entityId:"de67fc84-3719-46fd-9ab4-3fca3a3cc50d",entityType:i.CustomEntity},lM={hidden:!1,required:!0,id:"product-prototype-database-property-id",name:"Database",version:1,type:i.Property,private:!1,abstract:!1,implements:bi,static:!0,index:0,dataType:sM,description:"The database that the entity belongs to.",parent:oM},cM={type:i.GenericReference,id:"13a4045e-dcb0-4159-8d33-10a646078b5a",entityType:i.Property,entityId:"d519c26a-15b8-40d8-ad09-13fa9342e9ba"},dM={id:"7449779e-1d4e-409c-81c6-4b611336ed18",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:cM},uM={type:i.GenericReference,id:"0969562f-d836-406f-8b48-dd9d417fbe72",entityType:i.CustomEntity,entityId:"a2d0ec83-72ce-4f54-b059-a39e018fa86c"},pM={hidden:!1,required:!0,type:i.Property,id:"d519c26a-15b8-40d8-ad09-13fa9342e9ba",version:1,name:"Name",description:"The name of the product",index:0,implements:null,static:!1,private:!1,dataType:dM,abstract:!1,parent:uM},yM={type:i.GenericReference,id:"833a5425-7bd0-41dd-9e97-e018acce9592",entityType:i.Project,entityId:H},hM={type:i.CustomEntity,id:"a2d0ec83-72ce-4f54-b059-a39e018fa86c",version:1,name:"Product",description:"A product that can be sold",implements:[Ve],extends:[],abstract:!1,static:!1,abstractMethods:[],properties:[lM,pM],methods:[],x:0,y:0,parent:yM},xi="project-loaded-event-id",zt="get-bitcoin-price-http-call-operation-id",FT="get-bitcoin-price-http-call-response-body-id",hs="validate-bitcoin-price-response-operation-ids",fM={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:FT},mM={type:i.GenericReference,id:"validate-bitcoin-data-to-validate-input-map-parent-ref-id",entityType:i.Operation,entityId:hs},UT={id:"validate-bitcoin-data-to-validate-input-map-id",type:i.InputMap,version:1,declaration:Hn.fixedArguments[1],name:null,description:null,readsValue:fM,defaultValue:null,dynamicArguments:[],index:0,parent:mM},TM={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"validate-bitcoin-type-to-match-input-map-id"},EM={type:i.GenericReference,id:"validate-bitcoin-type-to-match-input-map-parent-ref-id",entityType:i.Operation,entityId:hs},RM={id:"validate-bitcoin-type-to-match-input-map-id",type:i.InputMap,version:1,declaration:Hn.fixedArguments[0],name:null,description:null,readsValue:null,defaultValue:{id:"validate-bitcoin-type-to-match-input-map-default-value-id",type:i.PrimitiveValue,version:1,name:D.EntityTemplate,valueAsType:DT,value:null,parent:TM,autogeneration:null},dynamicArguments:[],index:0,parent:EM},bM={type:i.GenericReference,id:"validate-bitcoin-validated-entity-output-map-parent-ref-id",entityType:i.Operation,entityId:hs},gM={id:"validate-bitcoin-validated-entity-output-map-id",type:i.OutputMap,version:1,declaration:Hn.fixedReturns[0],writesValues:[],index:0,parent:bM},vM={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-parent-ref-id",entityType:i.GlobalEvent,entityId:xi},IM={type:i.GenericReference,id:"validate-bitcoin-price-response-operation-called-by-ref-id",entityType:i.Operation,entityId:zt},DM={type:i.Operation,id:hs,version:1,declaration:Hn,inputs:[RM,UT],outputs:[gM],process:null,dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[IM],parent:vM},PM={type:i.GenericReference,id:"96edb661-3f36-406c-8921-f1679dd796a3",entityType:i.FunctionCall,entityId:zt},AM={id:"c93e1393-9b5e-4de2-b8da-7eae647d715a",version:1,type:i.InputMap,declaration:Sa,name:null,description:null,readsValue:null,defaultValue:null,dynamicArguments:[],index:0,parent:PM},SM={type:i.GenericReference,id:"40312b28-71b8-4b01-a654-58b87191939d",entityType:i.FunctionCall,entityId:zt},OM={type:i.GenericReference,id:"6ea96c7d-02a7-4971-82ad-2f32a0fec8b4",entityType:i.InputMap,entityId:"9f21cbac-5a83-4983-8923-9224ffd3ba9f"},CM={id:"9f21cbac-5a83-4983-8923-9224ffd3ba9f",version:1,type:i.InputMap,declaration:Oa,name:null,description:null,readsValue:null,defaultValue:{id:"get-bitcoin-price-http-request-url-argument-default-value-id",type:i.PrimitiveValue,version:1,value:"https://api.coindesk.com/v1/bpi/currentprice.json",name:D.String,parent:OM,valueAsType:null,autogeneration:null},index:1,dynamicArguments:[],parent:SM},BM={type:i.GenericReference,id:"2610bf4a-c8a2-4746-b6cc-eb15f7fa8e9c",entityType:i.FunctionCall,entityId:zt},wM={id:"ffb3cd9d-c955-4104-bc7b-299120fe4ede",version:1,type:i.InputMap,declaration:Ca,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:2,parent:BM},MM={type:i.GenericReference,id:"bfd29a6a-671a-448c-9f2f-f8c7e4ad8349",entityType:i.FunctionCall,entityId:zt},_M={id:"412bf1f3-1a8e-4665-a95f-82117540e34e",version:1,type:i.InputMap,declaration:Ba,name:null,description:null,readsValue:null,dynamicArguments:[],defaultValue:null,index:3,parent:MM},NM={type:i.GenericReference,id:"616a15f3-c224-4b11-b95c-63314edef409",entityType:i.FunctionCall,entityId:zt},VM={id:"4dd4651c-02e4-45f1-b50f-824f3bcb1648",version:1,type:i.OutputMap,declaration:wa,writesValues:[],index:1,parent:NM},$M={type:i.GenericReference,id:"28793b68-4d7e-4826-aee1-f201a3499faf",entityType:i.FunctionCall,entityId:zt},LM={id:"94fe9d35-4dd4-4729-a50c-5283ccd7e661",version:1,type:i.OutputMap,declaration:Fo,writesValues:[],index:0,parent:$M},GM={type:i.GenericReference,id:"f13e04b2-49b4-4c69-85b8-cbbafafa3524",entityType:i.FunctionCall,entityId:zt},FM={id:FT,type:i.OutputMap,version:1,declaration:Ti,writesValues:[UT],index:2,parent:GM},UM={type:i.GenericReference,id:"6148d6d0-caaa-45fc-b601-ff2493dfc60f",entityType:i.FunctionDeclaration,entityId:zt},xM={type:i.GenericReference,id:"b115f084-807b-44b3-ae01-b69cc342f761",entityType:i.GlobalEvent,entityId:xi},jM={type:i.Operation,id:zt,version:1,declaration:Ei,inputs:[AM,CM,wM,_M],outputs:[LM,VM,FM],process:null,parent:xM,calledByError:[],calledByEntry:[UM],calledBySuccess:[],dynamicArguments:[],successCalls:[DM],errorCalls:[],error:null,x:0,y:0},kM={type:i.GenericReference,id:"24e76019-3f94-475b-91ce-297f76bbc224",entityType:i.GlobalEvent,entityId:xi},qM={type:i.GenericReference,id:"0eac8e29-cdf2-42f8-8ea7-ad76d4d79abe",entityType:i.GlobalEvent,entityId:xi},JM={process:null,type:i.FunctionCall,id:"2d2e7593-bfbf-457c-a607-5fce18eef457",version:1,declaration:Il,inputs:[],outputs:[],calledByError:[],calledByEntry:[kM],calledBySuccess:[],parent:qM,successCalls:[],errorCalls:[],error:null,x:0,y:0},WM={id:"793b5999-a9da-47fb-9665-0c17ebc6d5c9",type:i.GenericReference,entityType:i.Project,entityId:"2e7eb5382-3d99-44fd-972a-b8b1e819f6be"},HM={type:i.GlobalEvent,id:xi,version:1,name:rn.PROJECT_PUBLICATION_COMPLETED,returnStatements:[],collapsed:!1,implements:Fa,parent:WM,inputs:[],calls:[JM,jM],x:0,y:0},Vt="abort-execution-func-declaration-id",ji="abort-execution-func-exec-var-declaration-id",fs="abort-execution-func-small-wait-op-id",Dl="abort-execution-func-long-wait-op-id",xT="abort-execution-func-long-wait-process-output-id",jT="abort-execution-func-exec-var-instance-write-id",kT="abort-execution-func-long-wait-return-stmt-id",qT="abort-execution-func-small-wait-return-stmt-id",YM="abort-execution-func-exec-var-instance-abort-call-id",Pl="abort-execution-func-exec-var-instance-abort-internal-call-id",JT="abort-execution-func-exec-second-wait-op-id",zM={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"short-wait-return-statement-returned-hello-string-id"},ZM={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.DataType,entityId:"short-wait-return-statement-returned-hello-string-data-type-id"},XM={id:"short-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"short-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"Hello 2",autogeneration:null,valueAsType:null,parent:ZM},constant:!1,parent:zM},QM={type:i.GenericReference,id:"short-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:qT},KM={isError:!1,id:"short-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 1",description:"A random string that is returned by the function",dataType:XM,readsValue:null,required:!0,index:0,parent:QM},e_={type:i.GenericReference,id:"short-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:fs},t_={type:i.GenericReference,id:"short-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},WT={type:i.ReturnStatement,id:qT,version:1,outputs:[KM],calledByError:[],calledByEntry:[],calledBySuccess:[e_],throws:null,x:0,y:0,parent:t_},n_={type:i.GenericReference,id:"second-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"second-wait-argument-map-id"},r_={type:i.GenericReference,id:"second-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:JT},i_={id:"second-wait-argument-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"second-wait-argument-default-value-id",type:i.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:D.Number,parent:n_},index:0,parent:r_},a_={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},s_={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.InternalCall,entityId:Pl},o_={id:JT,type:i.Operation,version:1,declaration:ct,inputs:[i_],dynamicArguments:[],outputs:[],process:null,successCalls:[WT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[s_],error:null,parent:a_},l_={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-one-id",entityType:i.VariableInstance,entityId:jT},c_={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-abort-internal-call-called-by-ref-two-id",entityType:i.Operation,entityId:fs},d_={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},u_={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:ji},p_={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-internal-call-ref-one-id",entityType:i.InternalCall,entityId:Pl},y_={id:YM,type:i.VariableInstance,version:1,declaration:u_,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[p_],parent:d_},HT={id:Pl,type:i.InternalCall,version:1,inputs:[],outputs:[],declaration:Zo,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[l_,c_],successCalls:[o_],errorCalls:[],error:null,index:0,parent:y_},h_={type:i.GenericReference,id:"abort-exec-func-var-write-instance-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},f_={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:ji},m_={type:i.GenericReference,id:"abort-exec-func-var-write-instance-called-by-ref-two-id",entityType:i.FunctionDeclaration,entityId:Vt},T_={type:i.GenericReference,id:"abort-exec-func-abort-call-var-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:ji},E_={type:i.GenericReference,id:"abort-exec-func-var-write-instance-reads-value-ref-id",entityType:i.OutputMap,entityId:xT},Al={id:jT,type:i.VariableInstance,version:1,declaration:T_,inputs:[],outputs:[],calledByError:[],calledByEntry:[m_],calledBySuccess:[f_],successCalls:[HT],errorCalls:[],x:0,y:0,readsValue:E_,writesValues:[],internalCalls:[],parent:h_},R_={type:i.GenericReference,id:"abort-exec-func-var-decl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:ji};i.GenericReference,i.DataType;const b_={id:"abort-exec-func-var-decl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:Xo,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:R_,defaultValue:null},g_={type:i.GenericReference,id:"abort-exec-func-var-decl-main-project-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},v_={type:i.GenericReference,id:"abort-exec-func-var-decl-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Vt},I_={id:ji,type:i.VariableDeclaration,version:1,name:"Execution in progress",description:"A variable that holds an ongoing execution to abort it if needed",dataType:b_,inputs:[],outputs:[],calledByError:[],calledByEntry:[v_],calledBySuccess:[],successCalls:[Al],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:g_},D_={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:"long-wait-return-statement-returned-hello-string-id"},P_={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-data-type-default-value-parent-ref-id",entityType:i.DataType,entityId:"long-wait-return-statement-returned-hello-string-data-type-id"},A_={id:"long-wait-return-statement-returned-hello-string-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"long-wait-return-statement-returned-hello-string-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.String,value:"Hello 1",autogeneration:null,valueAsType:null,parent:P_},constant:!1,parent:D_},S_={type:i.GenericReference,id:"long-wait-return-statement-returned-hello-string-parent-ref-id",entityType:i.ReturnStatement,entityId:kT},O_={isError:!1,id:"long-wait-return-statement-returned-hello-string-id",type:i.ReturnDeclaration,version:1,name:"Return 2",description:"A random string that is returned by the function",dataType:A_,readsValue:null,required:!0,index:0,parent:S_},C_={type:i.GenericReference,id:"long-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:Dl},B_={type:i.GenericReference,id:"long-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},YT={type:i.ReturnStatement,id:kT,version:1,outputs:[O_],calledByError:[],calledByEntry:[],calledBySuccess:[C_],throws:null,x:0,y:0,parent:B_},w_={type:i.GenericReference,id:"long-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"long-argument-map-id"},zT={type:i.GenericReference,id:"long-argument-map-parent-ref-id",entityType:i.Operation,entityId:Dl},M_={id:"long-argument-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"long-argument-default-value-id",type:i.PrimitiveValue,version:1,value:1500,valueAsType:null,autogeneration:null,name:D.Number,parent:w_},index:0,parent:zT},__={type:i.GenericReference,id:"long-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},N_={type:i.GenericReference,id:"long-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Vt},V_={id:xT,type:i.OutputMap,version:1,declaration:Ko,writesValues:[Al],index:0,parent:zT},$_={id:Dl,type:i.Operation,version:1,declaration:ct,inputs:[M_],dynamicArguments:[],outputs:[],process:V_,successCalls:[YT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[N_],calledBySuccess:[],error:null,parent:__},L_={type:i.GenericReference,id:"small-wait-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"small-wait-argument-map-id"},G_={type:i.GenericReference,id:"small-wait-argument-map-parent-ref-id",entityType:i.Operation,entityId:fs},F_={id:"small-wait-argument-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"small-wait-argument-default-value-id",type:i.PrimitiveValue,version:1,value:500,valueAsType:null,autogeneration:null,name:D.Number,parent:L_},index:0,parent:G_},U_={type:i.GenericReference,id:"small-wait-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Vt},x_={type:i.GenericReference,id:"small-wait-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Vt},j_={id:fs,type:i.Operation,version:1,declaration:ct,inputs:[F_],dynamicArguments:[],outputs:[],process:null,successCalls:[HT],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[x_],calledBySuccess:[],error:null,parent:U_},k_={type:i.GenericReference,id:"abort-execution-func-decl-parent-ref-id",entityType:i.Project,entityId:H},ZT={id:"abort-execution-func-decl-id",type:i.FunctionDeclaration,version:1,name:"Test aborting execution",description:"Executes a wait and then aborts the execution of that wait",inputs:[],returnStatements:[YT,WT],calls:[j_,I_,Al,$_],implements:null,private:!1,collapsed:!1,index:null,x:0,y:0,parent:k_},q_={type:i.GenericReference,id:"call-execution-abort-func-parent-ref-id",entityType:i.Project,entityId:H},J_={id:"call-execution-abort-func-id",type:i.FunctionCall,version:1,declaration:ZT,inputs:[],process:null,outputs:[],successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:q_},Sl="manual-hello-world-loop-func-decl-id",XT="manual-hello-world-loop-func-return-statement-id",Zt="manual-hello-world-loop-id",ki="manual-hello-world-loop-body-id",Ol="manual-hello-world-loop-break-statement-id",qi="manual-hello-world-loop-current-iteration-number-output-map-id",Cl="manual-hello-world-loop-previous-iterations-results-output-map-id",Bl="assembled-hello-world-text-output-id",QT="assembled-hello-world-list-output-id",Ji="iteration-number-is-equal-or-greater-than-10-condition-id",ms="join-hello-world-and-number-operation-id",Ts="append-string-to-list-operation-id",KT="hello-world-loop-output-map-id",W_={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-parent-ref",entityType:i.ReturnStatement,entityId:XT},H_={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-data-type-parent-ref",entityType:i.ReturnDeclaration,entityId:"manual-hello-world-loop-function-declaration-output-declaration"},Y_={id:"manual-hello-world-loop-function-declaration-output-declaration-data-type",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!0,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:H_},z_={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-output-declaration-reads-value-ref",entityType:i.OutputMap,entityId:KT},eE={isError:!1,id:"manual-hello-world-loop-function-declaration-output-declaration",version:1,type:i.ReturnDeclaration,name:"Results",description:null,dataType:Y_,readsValue:z_,required:!0,index:0,parent:W_},Z_={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-return-statement-called-by-ref",entityType:i.Loop,entityId:Zt},X_={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref",entityType:i.FunctionDeclaration,entityId:Sl},tE={type:i.ReturnStatement,id:XT,version:1,outputs:[eE],calledByError:[],calledByEntry:[],calledBySuccess:[Z_],parent:X_,throws:null,x:0,y:0},Q_={type:i.GenericReference,id:"hello-world-loop-break-statement-ref-id",entityType:i.BreakStatement,entityId:Ol},K_={type:i.GenericReference,id:"hello-world-loop-break-statement-reads-value-ref-id",entityType:i.OutputMap,entityId:Bl},nE={isError:!1,id:"hello-world-loop-break-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,dataType:null,readsValue:K_,required:!0,index:0,parent:Q_},eN={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:qi},tN={type:i.GenericReference,id:"hello-world-loop-break-statement-counter-ref-id",entityType:i.BreakStatement,entityId:Ol},rE={isError:!1,id:"hello-world-loop-break-statement-counter-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration counter",description:null,dataType:null,readsValue:eN,required:!0,index:1,parent:tN},nN={type:i.GenericReference,id:"hello-world-loop-break-statement-called-by-ref-id",entityType:i.Condition,entityId:Ji},rN={type:i.GenericReference,id:"hello-world-loop-break-statement-parent-ref-id",entityType:i.Loop,entityId:Zt},iE={type:i.BreakStatement,id:Ol,version:1,outputs:[nE,rE],calledByError:[],calledByEntry:[],calledBySuccess:[nN],parent:rN,throws:null,x:0,y:0},iN={type:i.GenericReference,id:"hello-world-loop-continue-statement-ref-id",entityType:i.ContinueStatement,entityId:"hello-world-loop-continue-statement"},aN={type:i.GenericReference,id:"hello-world-loop-continue-statement-output-data-type-ref-id",entityType:i.ReturnDeclaration,entityId:"hello-world-loop-continue-statement-output-id"},sN={id:"hello-world-loop-continue-statement-output-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:null,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aN},oN={type:i.GenericReference,id:"hello-world-loop-continue-statement-reads-value-ref-id",entityType:i.OutputMap,entityId:Bl},aE={isError:!1,id:"hello-world-loop-continue-statement-output-id",version:1,type:i.ReturnDeclaration,name:"Iteration result",description:null,dataType:sN,readsValue:oN,required:!0,index:0,parent:iN},lN={type:i.GenericReference,id:"hello-world-loop-continue-statement-called-by-ref-id",entityType:i.Condition,entityId:Ji},cN={type:i.GenericReference,id:"hello-world-loop-continue-statement-parent-ref-id",entityType:i.Loop,entityId:Zt},sE={type:i.ContinueStatement,id:"hello-world-loop-continue-statement",version:1,outputs:[aE],calledBySuccess:[],calledByError:[lN],calledByEntry:[],parent:cN,throws:null,x:0,y:0};i.GenericReference,i.InputMap;const dN={type:i.GenericReference,id:"append-string-to-list-base-string-map-parent-ref-id",entityType:i.Operation,entityId:Ts},uN={type:i.GenericReference,id:"base-string-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Cl},oE={id:"append-string-to-list-base-string-map-id",type:i.InputMap,version:1,declaration:wo,name:null,description:null,readsValue:uN,defaultValue:null,dynamicArguments:[],index:0,parent:dN},pN={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:Ts},yN={id:QT,type:i.OutputMap,version:1,writesValues:[nE],declaration:fi,index:0,parent:pN},hN={type:i.GenericReference,id:"append-string-to-list-called-by-ref-id",entityType:i.Condition,entityId:Ji},fN={type:i.GenericReference,id:"latest-string-to-add-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:QT},mN={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:Ts},lE={id:"latest-string-to-add-input-map-id",version:1,type:i.InputMap,declaration:Mo,name:null,description:null,readsValue:fN,dynamicArguments:[],defaultValue:null,index:1,parent:mN},TN={type:i.GenericReference,id:"append-string-to-list-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Zt},EN={type:i.Operation,id:Ts,declaration:Aa,version:1,inputs:[oE,lE],outputs:[yN],calledByError:[],process:null,calledByEntry:[],calledBySuccess:[hN],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:TN},RN={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:ki},bN={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-parent-ref-id",entityType:i.Loop,entityId:Zt},gN={type:i.GenericReference,id:"current-iteration-number-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:qi},cE={type:i.GenericReference,id:"iteration-number-is-equal-or-greater-than-10-condition-ref-two-id",entityType:i.Condition,entityId:Ji},vN={id:"current-iteration-number-to-check-map-id",version:1,type:i.InputMap,declaration:Vr.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:gN,index:1,defaultValue:null,parent:cE},IN={type:i.GenericReference,id:"max-num-iterations-value-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:"max-num-iterations-value-map-id"},DN={id:"max-num-iterations-value-map-id",version:1,type:i.InputMap,declaration:Vr.fixedArguments[1],name:null,description:null,dynamicArguments:[],readsValue:null,index:0,defaultValue:{id:"max-num-iterations-value-map-default-value-id",type:i.PrimitiveValue,version:1,name:D.Number,value:10,autogeneration:null,valueAsType:null,parent:IN},parent:cE},PN={type:i.Condition,id:Ji,version:1,declaration:Vr,inputs:[DN,vN],calledByError:[],calledByEntry:[RN],calledBySuccess:[],successCalls:[iE,EN],errorCalls:[sE],x:0,y:0,parent:bN},AN={type:i.GenericReference,id:"base-string-map-ref-id",entityType:i.InputMap,entityId:"join-hello-world-and-number-base-string-map-id"},SN={type:i.GenericReference,id:"join-hello-world-and-number-base-string-map-parent-ref-id",entityType:i.Operation,entityId:ms},ON={id:"join-hello-world-and-number-base-string-map-id",type:i.InputMap,version:1,declaration:Da,name:null,description:null,readsValue:null,defaultValue:{id:"join-hello-world-and-number-base-string-map-default-value-id",type:i.PrimitiveValue,version:1,value:"Hello world ",name:D.String,parent:AN,valueAsType:null,autogeneration:null},dynamicArguments:[],index:0,parent:SN},CN={type:i.GenericReference,id:"assembly-string-map-parent-ref-id",entityType:i.Operation,entityId:ms},BN={id:Bl,type:i.OutputMap,version:1,writesValues:[lE,aE],declaration:fi,index:0,parent:CN},wN={type:i.GenericReference,id:"join-hello-world-and-number-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:ki},MN={type:i.GenericReference,id:"current-iteration-number-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:qi},_N={type:i.GenericReference,id:"62b4afb0-6c21-4b0f-abd3-cebef7b17c28",entityType:i.Operation,entityId:ms},dE={id:"current-iteration-number-input-map-id",version:1,type:i.InputMap,declaration:Pa,name:null,description:null,readsValue:MN,dynamicArguments:[],defaultValue:null,index:1,parent:_N},NN={type:i.GenericReference,id:"join-hello-world-and-number-parent-ref-id",entityType:i.FunctionDeclaration,entityId:Zt},VN={type:i.Operation,id:ms,declaration:mi,version:1,inputs:[ON,dE],outputs:[BN],process:null,calledByError:[],calledByEntry:[wN],calledBySuccess:[],dynamicArguments:[],successCalls:[],errorCalls:[],error:null,x:0,y:0,parent:NN},$N={id:"manual-hello-world-loop-iterations-results-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:Cl,entityType:i.ArgumentDeclaration},LN={id:"manual-hello-world-loop-iterations-results-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!0,isNullable:!1,constant:!1,entity:null,asType:!1,defaultValue:null,parent:$N},GN={id:"manual-hello-world-loop-previous-iterations-results-output-map-parent-ref-id",type:i.GenericReference,entityId:ki,entityType:i.FunctionDeclaration},FN={id:Cl,type:i.ArgumentDeclaration,version:1,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",required:!0,dataType:LN,writesValues:[oE],index:1,parent:GN},UN={id:"manual-hello-world-loop-current-iteration-number-output-map-parent-ref-id",type:i.GenericReference,entityId:ki,entityType:i.FunctionDeclaration},xN={id:"manual-flow-loop-current-iteration-number-declaration-data-type-parent-ref-id",type:i.GenericReference,entityId:qi,entityType:i.ArgumentDeclaration};i.DataType;const jN={id:qi,type:i.ArgumentDeclaration,version:1,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",required:!0,dataType:null,writesValues:[dE,rE],index:0,parent:UN},kN={id:"manual-flow-loop-body-parent-ref-id",type:i.GenericReference,entityId:Zt,entityType:i.Loop},qN={id:ki,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called multiple times, once for each iteration of the loop.",inputs:[jN,FN],calls:[PN,VN],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:kN},JN={type:i.GenericReference,id:"hello-world-loop-iteration-result-inline-output-declaration-parent-ref-id",entityType:i.Loop,entityId:Zt},uE={id:"hello-world-loop-iteration-result-inline-output-declaration-id",version:1,type:i.ValueDescriptor,name:"Iteration result",description:null,dataType:null,required:!0,index:0,parent:JN},WN={type:i.GenericReference,id:"hello-world-loop-break-statement-output-map-parent-ref-id",entityType:i.Loop,entityId:Zt},HN={type:i.OutputMap,id:KT,version:1,declaration:uE,writesValues:[eE],index:0,parent:WN},YN={id:"manual-hello-world-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},zN={id:"manual-hello-world-loop-called-by-ref-id",type:i.GenericReference,entityId:Sl,entityType:i.FunctionDeclaration},ZN={id:Zt,type:i.Loop,version:1,declaration:xo,inputs:[],outputsDeclarations:[uE],outputs:[HN],body:qN,successCalls:[tE],errorCalls:[],process:null,error:null,calledByError:[],calledByEntry:[zN],calledBySuccess:[],breakStatements:[iE],continueStatements:[sE],x:0,y:0,parent:YN},XN={type:i.GenericReference,id:"manual-hello-world-loop-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},pE={type:i.FunctionDeclaration,id:Sl,version:1,name:"Manual hello world loop",description:null,inputs:[],calls:[ZN],returnStatements:[tE],implements:null,collapsed:!1,private:!1,index:null,x:0,y:0,parent:XN},QN={type:i.GenericReference,id:"call-hello-world-loop-parent-ref-id",entityType:i.Project,entityId:H},KN={id:"call-hello-world-loop-id",type:i.FunctionCall,version:1,declaration:pE,inputs:[],outputs:[],process:null,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:QN},dn="company-dto-function-declaration-id",wl="company-dto-func-declaration-argument-dcl-id",Xt="company-dto-function-company-variable-id",_n="company-dto-function-company-dto-variable-id",Jr="iterate-over-employee-list-loop-id",yE="iterate-over-employee-list-loop-employee-dto-output-map-id",Ml="iterate-over-employee-list-loop-body-current-employee-argument-declaration-id",Wi="iterate-over-employee-list-loop-body-map-employee-dto-function-call-id",hE="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id",e0="iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-id",fE="iterate-over-employee-list-continue-statement-id",Es="iterate-over-employee-list-loop-body-id",mE="company-dto-func-declaration-return-statement-id",TE="company-dto-func-declaration-return-decl-id",EE="company-dto-func-declaration-company-variable-id-output-map-id",RE="company-dto-func-declaration-company-variable-employess-output-map-id",bE="company-dto-func-declaration-company-variable-name-output-map-id",t0="company-dto-func-declaration-company-dto-variable-input-map-id",n0="company-dto-func-declaration-company-dto-variable-employess-input-map-id",r0="company-dto-func-declaration-company-dto-variable-name-input-map-id",Rs="company-dto-func-declaration-owner-variable-id",i0="company-dto-func-declaration-company-dto-variable-owner-input-map-id",gE="company-dto-func-declaration-company-variable-owner-output-map-id",vE="company-dto-func-declaration-owner-variable-id-output-map-id",bs="company-dto-func-declaration-bank-account-variable-id",a0="company-dto-func-declaration-company-dto-variable-bank-account-input-map-id",IE="company-dto-func-declaration-company-variable-bank-account-output-map-id",DE="company-dto-func-declaration-bank-account-variable-id-output-map-id",s0={type:i.GenericReference,id:"company-dto-func-returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:TE},o0={id:"company-dto-func-returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:s0},l0={type:i.GenericReference,id:"company-dto-func-returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:mE},c0={type:i.GenericReference,id:"company-dto-func-returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:_n},PE={isError:!1,id:TE,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:o0,readsValue:c0,required:!0,index:0,parent:l0},d0={type:i.GenericReference,id:"company-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:_n},u0={type:i.GenericReference,id:"company-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn},_l={type:i.ReturnStatement,id:mE,version:1,outputs:[PE],calledByError:[],calledByEntry:[],calledBySuccess:[d0],throws:null,x:0,y:0,parent:u0},p0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:vE},y0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:_n},AE={id:i0,type:i.InputMap,version:1,declaration:null,name:"owner_id",description:null,defaultValue:null,dynamicArguments:[],index:5,readsValue:p0,parent:y0},h0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:DE},f0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:_n},SE={id:a0,type:i.InputMap,version:1,declaration:null,name:"bank_account_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:h0,parent:f0},m0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:bE},T0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:_n},OE={id:r0,type:i.InputMap,version:1,declaration:null,name:"name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:m0,parent:T0},E0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:yE},R0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:_n},CE={id:n0,type:i.InputMap,version:1,declaration:null,name:"employees",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:E0,parent:R0},b0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:EE},g0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:_n},BE={id:t0,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the company",defaultValue:null,dynamicArguments:[],index:1,readsValue:b0,parent:g0},v0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn},I0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-one-id",entityType:i.VariableDeclaration,entityId:bs},D0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:Rs},P0={type:i.GenericReference,id:"company-dto-func-company-dto-variable-called-by-ref-three-id",entityType:i.VariableDeclaration,entityId:Jr},Nl={id:_n,type:i.VariableDeclaration,version:1,name:"Company DTO",dataType:null,description:"A variable holding the data of a mapped company DTO",calledByError:[],calledByEntry:[],calledBySuccess:[I0,D0,P0],successCalls:[_l],errorCalls:[],readsValue:null,writesValues:[PE],inputs:[BE,OE,SE,AE,CE],outputs:[],internalCalls:[],parent:v0,x:0,y:0},er="employee-dto-func-declaration-id",Vl="employee-dto-func-declaration-argument-dcl-id",wE="employee-dto-func-declaration-return-statement-id",ME="employee-dto-func-declaration-return-decl-id",tr="employee-dto-func-declaration-employee-variable-id",nr="employee-dto-func-declaration-employee-dto-variable-id",gs="employee-dto-func-declaration-manager-variable-id",_E="employee-dto-func-declaration-employee-variable-id-output-map-id",NE="employee-dto-func-declaration-employee-variable-birth-date-output-map-id",VE="employee-dto-func-declaration-employee-variable-department-output-map-id",$E="employee-dto-func-declaration-employee-variable-manager-output-map-id",LE="employee-dto-func-declaration-manager-variable-id-output-map-id",A0="employee-dto-func-declaration-employee-dto-variable-input-map-id",S0="employee-dto-func-declaration-employee-dto-variable-birth-date-input-map-id",O0="employee-dto-func-declaration-employee-dto-variable-department-input-map-id",C0="employee-dto-func-declaration-employee-dto-variable-manager-input-map-id",B0={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:ME},w0={id:"employee-dto-func-returned-employee-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:B0},M0={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:wE},_0={type:i.GenericReference,id:"employee-dto-func-returned-employee-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:nr},GE={isError:!1,id:ME,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"Output the employee data in the format that it will be sent through an HTTP request.",dataType:w0,readsValue:_0,required:!0,index:0,parent:M0},N0={type:i.GenericReference,id:"employee-dto-func-return-statement-called-by-ref-id",entityType:i.Operation,entityId:nr},V0={type:i.GenericReference,id:"employee-dto-func-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er},$l={type:i.ReturnStatement,id:wE,version:1,outputs:[GE],calledByError:[],calledByEntry:[],calledBySuccess:[N0],throws:null,x:0,y:0,parent:V0},$0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:LE},L0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},FE={id:C0,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:$0,parent:L0},G0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:VE},F0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},UE={id:O0,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:G0,parent:F0},U0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:NE},x0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},xE={id:S0,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:U0,parent:x0},j0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:_E},k0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:nr},jE={id:A0,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:j0,parent:k0},q0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er},J0={type:i.GenericReference,id:"employee-dto-func-employee-dto-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:gs},W0={id:nr,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[J0],successCalls:[$l],errorCalls:[],readsValue:null,writesValues:[GE],inputs:[jE,xE,UE,FE],outputs:[],internalCalls:[],parent:q0,x:0,y:0},H0={type:i.GenericReference,id:"employee-dto-func-manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:gs},Y0={id:LE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[FE],parent:H0},z0={type:i.GenericReference,id:"employee-dto-func-manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:gs},Z0={id:"employee-dto-func-manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:St,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:z0,defaultValue:null},X0={type:i.GenericReference,id:"employee-dto-func-manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:$E},Q0={type:i.GenericReference,id:"employee-dto-func-manager-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er};i.GenericReference,i.VariableDeclaration;const kE={id:gs,type:i.VariableDeclaration,version:1,name:"Manager",dataType:Z0,description:"A variable holding an inherited manager",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[W0],errorCalls:[],readsValue:X0,writesValues:[],inputs:[],outputs:[Y0],internalCalls:[],parent:Q0,x:0,y:0},K0={type:i.GenericReference,id:"employee-dto-func-employee-variable-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},e1={id:$E,type:i.OutputMap,version:1,declaration:St.properties[2],index:3,writesValues:[kE],parent:K0},t1={type:i.GenericReference,id:"employee-dto-func-employee-variable-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},n1={id:VE,type:i.OutputMap,version:1,declaration:St.properties[0],index:2,writesValues:[UE],parent:t1},r1={type:i.GenericReference,id:"employee-dto-func-employee-variable-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},i1={id:NE,type:i.OutputMap,version:1,declaration:ut.properties[1],index:1,writesValues:[xE],parent:r1},a1={type:i.GenericReference,id:"employee-dto-func-employee-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},s1={id:_E,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[jE],parent:a1},o1={type:i.GenericReference,id:"employee-dto-func-employee-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:tr},l1={id:"employee-dto-func-employee-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:St,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:o1,defaultValue:null},c1={type:i.GenericReference,id:"employee-dto-func-employee-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:er},d1={type:i.GenericReference,id:"employee-dto-func-employee-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Vl},u1={type:i.GenericReference,id:"employee-dto-func-employee-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:er},qE={id:tr,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:l1,description:"A variable holding a company employee",calledByError:[],calledByEntry:[u1],calledBySuccess:[],successCalls:[kE],errorCalls:[],readsValue:d1,writesValues:[],inputs:[],outputs:[s1,i1,n1,e1],internalCalls:[],parent:c1,x:0,y:0},p1={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-data-type-parent-ref-id",entityId:Vl,entityType:i.ArgumentDeclaration},y1={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"employee-dto-func-declaration-employee-input-declaration-data-type-id",version:1,entity:St,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:p1,defaultValue:null},h1={type:i.GenericReference,id:"employee-dto-func-declaration-employee-input-declaration-parent-ref-id",entityId:er,entityType:i.FunctionDeclaration},f1={type:i.ArgumentDeclaration,id:Vl,version:1,name:"Employee",description:"The employee to create a DTO for",required:!0,dataType:y1,index:0,writesValues:[qE],parent:h1},m1={type:i.GenericReference,id:"employee-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},Ll={type:i.FunctionDeclaration,id:er,version:1,name:"Employee DTO",description:"Takes a employee and returns a DTO of that employee",index:null,inputs:[f1],calls:[qE],implements:null,returnStatements:[$l],collapsed:!1,private:!1,x:0,y:0,parent:m1},T1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:hE,entityType:i.ReturnDeclaration},E1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:St,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:T1},R1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-reads-value-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.OutputMap},b1={id:"iterate-over-employee-list-continue-statement-employee-dto-output-decl-parent-ref-id",type:i.GenericReference,entityId:fE,entityType:i.ContinueStatement},JE={isError:!1,id:hE,type:i.ReturnDeclaration,version:1,name:"Employee DTO",description:"The DTO of the employee entity.",readsValue:R1,dataType:E1,required:!0,index:0,parent:b1},g1={id:"iterate-over-employee-list-continue-statement-called-by-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.FunctionCall},v1={id:"iterate-over-employee-list-continue-statement-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},WE={id:fE,type:i.ContinueStatement,version:1,calledByError:[],calledByEntry:[],calledBySuccess:[g1],outputs:[JE],throws:null,x:0,y:0,parent:v1},I1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.FunctionCall},D1={id:e0,type:i.OutputMap,version:1,declaration:$l.outputs[0],writesValues:[JE],index:0,parent:I1},P1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-reads-value-ref-id",type:i.GenericReference,entityId:Ml,entityType:i.ArgumentDeclaration},A1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-parent-ref-id",type:i.GenericReference,entityId:Wi,entityType:i.FunctionCall},HE={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-employee-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Ll.inputs[0],readsValue:P1,index:0,defaultValue:null,dynamicArguments:[],parent:A1},S1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-called-by-ref-id",type:i.GenericReference,entityId:Es,entityType:i.FunctionDeclaration},O1={id:"iterate-over-employee-list-loop-body-map-employee-dto-function-call-parent-ref-id",type:i.GenericReference,entityId:Es,entityType:i.FunctionDeclaration},C1={id:Wi,type:i.FunctionCall,version:1,declaration:Ll,inputs:[HE],process:null,outputs:[D1],calledByError:[],calledByEntry:[S1],calledBySuccess:[],successCalls:[WE],errorCalls:[],error:null,x:0,y:0,parent:O1},B1={type:i.GenericReference,id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-parent-ref-id",entityId:Ml,entityType:i.ArgumentDeclaration},w1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:St,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:B1},M1={id:"iterate-over-employee-list-loop-body-current-employee-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:Es,entityType:i.FunctionDeclaration},_1={id:Ml,type:i.ArgumentDeclaration,version:1,name:"Current employee",description:"The current employee entity being processed.",dataType:w1,required:!0,index:0,writesValues:[HE],parent:M1},N1={id:"iterate-over-employee-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},V1={id:Es,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[_1],calls:[C1],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:N1},$1={id:"iterate-over-employee-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},L1={id:"iterate-over-employee-list-loop-iteration-list-input-map-reads-value-ref-id",type:i.GenericReference,entityId:RE,entityType:i.OutputMap},YE={id:"iterate-over-employee-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Yn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:L1,index:0,parent:$1},G1={id:"iterate-over-employee-list-loop-parent-ref-id",type:i.GenericReference,entityId:dn,entityType:i.FunctionDeclaration},F1={id:"iterate-over-employee-list-loop-employee-dto-output-map-parent-ref-id",type:i.GenericReference,entityId:Jr,entityType:i.Loop},U1={id:yE,type:i.OutputMap,version:1,declaration:Yn.fixedReturns[0],writesValues:[CE],index:0,parent:F1},x1={type:i.GenericReference,id:"iterate-over-employee-list-loop-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Xt},j1={id:Jr,type:i.Loop,version:1,declaration:Yn,inputs:[YE],successCalls:[Nl],errorCalls:[],outputsDeclarations:[],outputs:[U1],body:V1,process:null,calledByError:[],calledByEntry:[],calledBySuccess:[x1],breakStatements:[],continueStatements:[WE],error:null,x:0,y:0,parent:G1},k1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:bs},q1={id:DE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[SE],parent:k1},J1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:bs},W1={id:"company-dto-func-bank-account-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:J1,defaultValue:null},H1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:IE},Y1={type:i.GenericReference,id:"company-dto-func-bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn};i.GenericReference,i.VariableDeclaration;const zE={id:bs,type:i.VariableDeclaration,version:1,name:"Bank account",dataType:W1,description:"A variable holding an inherited bank account",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Nl],errorCalls:[],readsValue:H1,writesValues:[],inputs:[],outputs:[q1],internalCalls:[],parent:Y1,x:0,y:0},z1={type:i.GenericReference,id:"company-dto-func-owner-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Rs},Z1={id:vE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[AE],parent:z1},X1={type:i.GenericReference,id:"company-dto-func-owner-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Rs},Q1={id:"company-dto-func-owner-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:X1,defaultValue:null},K1={type:i.GenericReference,id:"company-dto-func-owner-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:gE},eV={type:i.GenericReference,id:"company-dto-func-owner-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn};i.GenericReference,i.VariableDeclaration;const ZE={id:Rs,type:i.VariableDeclaration,version:1,name:"Owner",dataType:Q1,description:"A variable holding an inherited owner",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[Nl],errorCalls:[],readsValue:K1,writesValues:[],inputs:[],outputs:[Z1],internalCalls:[],parent:eV,x:0,y:0},tV={type:i.GenericReference,id:"company-dto-func-company-variable-owner-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},nV={id:gE,type:i.OutputMap,version:1,declaration:Rt.properties[2],index:4,writesValues:[ZE],parent:tV},rV={type:i.GenericReference,id:"company-dto-func-company-variable-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},iV={id:IE,type:i.OutputMap,version:1,declaration:Rt.properties[2],index:3,writesValues:[zE],parent:rV},aV={type:i.GenericReference,id:"company-dto-func-company-variable-name-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},sV={id:bE,type:i.OutputMap,version:1,declaration:Rt.properties[0],index:2,writesValues:[OE],parent:aV},oV={type:i.GenericReference,id:"company-dto-func-company-variable-employess-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},lV={id:RE,type:i.OutputMap,version:1,declaration:Rt.properties[3],index:1,writesValues:[YE],parent:oV},cV={type:i.GenericReference,id:"company-dto-func-company-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},dV={id:EE,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[BE],parent:cV},uV={type:i.GenericReference,id:"company-dto-func-company-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xt},pV={id:"company-dto-func-company-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:uV,defaultValue:null},yV={type:i.GenericReference,id:"company-dto-func-company-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:dn},hV={type:i.GenericReference,id:"company-dto-func-company-variable-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:wl},fV={type:i.GenericReference,id:"company-dto-func-company-variable-called-by-id",entityType:i.FunctionDeclaration,entityId:dn},XE={id:Xt,type:i.VariableDeclaration,version:1,name:"Company",dataType:pV,description:"A variable holding a company",calledByError:[],calledByEntry:[fV],calledBySuccess:[],successCalls:[zE,ZE,j1],errorCalls:[],readsValue:hV,writesValues:[],inputs:[],outputs:[dV,lV,sV,iV,nV],internalCalls:[],parent:yV,x:0,y:0},mV={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-data-type-parent-ref-id",entityId:wl,entityType:i.ArgumentDeclaration},TV={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-dto-func-declaration-company-input-declaration-data-type-id",version:1,entity:Rt,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:mV,defaultValue:null},EV={type:i.GenericReference,id:"company-dto-func-declaration-company-input-declaration-parent-ref-id",entityId:dn,entityType:i.FunctionDeclaration},RV={type:i.ArgumentDeclaration,id:wl,version:1,name:"Company",description:"The company to create a DTO for",required:!0,dataType:TV,index:0,writesValues:[XE],parent:EV},bV={type:i.GenericReference,id:"company-dto-function-declaration-parent-ref-id",entityType:i.Project,entityId:H},Gl={type:i.FunctionDeclaration,id:dn,version:1,name:"Company DTO",description:"Takes a company and returns a DTO of that company",inputs:[RV],calls:[XE],implements:null,index:null,returnStatements:[_l],collapsed:!1,private:!1,x:0,y:0,parent:bV},Hi="exec-in-parallel-operation-call-id",Yi="exec-sequentially-operation-call-id",pt="concurrency-and-wait-function-declaration-id",QE="concurrency-and-wait-return-statement-id",KE="concurrency-and-wait-return-declaration-id",Fl="exec-in-parallel-argument-map-id",eR="exec-sequentially-argument-map-id",Ul="wait-for-2-seconds-operation-id",tR="wait-for-2-seconds-argument-map-id",xl="map-company-dto-function-call-id",nR="map-company-dto-function-call-company-dto-output-map-id",zi="company-dto-variable-one-id",jl="company-dto-variable-one-instance-id",gV="company-dto-variable-two-id",vV={type:i.GenericReference,id:"returned-company-dto-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:KE},IV={id:"returned-company-dto-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:vV},DV={type:i.GenericReference,id:"returned-company-dto-parent-ref-id",entityType:i.ReturnStatement,entityId:QE},PV={type:i.GenericReference,id:"returned-company-dto-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:zi},rR={isError:!1,id:KE,type:i.ReturnDeclaration,version:1,name:"Company DTO",description:"Output the company data in the format that it will be sent through an HTTP request.",dataType:IV,readsValue:PV,required:!0,index:0,parent:DV},AV={type:i.GenericReference,id:"concurrency-and-wait-return-statement-called-by-ref-id",entityType:i.Operation,entityId:Ul},SV={type:i.GenericReference,id:"concurrency-and-wait-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},iR={type:i.ReturnStatement,id:QE,version:1,outputs:[rR],calledByError:[],calledByEntry:[],calledBySuccess:[AV],throws:null,x:0,y:0,parent:SV},OV={type:i.GenericReference,id:"company-dto-variable-two-called-by-ref-id",entityType:i.VariableInstance,entityId:jl},CV={type:i.GenericReference,id:"company-dto-variable-two-reads-value-ref-id",entityType:i.VariableInstance,entityId:jl},BV={type:i.GenericReference,id:"company-dto-variable-two-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},aR={id:gV,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[OV],internalCalls:[],writesValues:[rR],readsValue:CV,x:0,y:0,parent:BV},wV={type:i.GenericReference,id:"company-dto-variable-one-instance-called-by-ref-id",entityType:i.VariableDeclaration,entityId:zi},MV={type:i.GenericReference,id:"company-dto-variable-one-instance-reads-value-ref-id",entityType:i.VariableDeclaration,entityId:zi},_V={type:i.GenericReference,id:"company-dto-variable-one-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},NV={type:i.GenericReference,id:"company-dto-variable-one-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:zi},sR={id:jl,type:i.VariableInstance,version:1,declaration:NV,inputs:[],outputs:[],successCalls:[aR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[wV],internalCalls:[],writesValues:[aR],readsValue:MV,x:0,y:0,parent:_V},VV={type:i.GenericReference,id:"company-dto-variable-one-called-by-ref-id",entityType:i.FunctionCall,entityId:xl},$V={type:i.GenericReference,id:"company-dto-variable-one-reads-value-ref-id",entityType:i.OutputMap,entityId:nR},LV={type:i.GenericReference,id:"company-dto-variable-one-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},oR={id:zi,type:i.VariableDeclaration,version:1,name:"Company DTO",description:null,dataType:null,inputs:[],outputs:[],successCalls:[sR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[VV],internalCalls:[],writesValues:[sR],readsValue:$V,x:0,y:0,parent:LV},lR={type:i.GenericReference,id:"map-company-dto-function-call-company-input-map-parent-ref-id",entityType:i.FunctionCall,entityId:xl},GV={id:"map-company-dto-function-call-company-input-map-id",type:i.InputMap,version:1,declaration:Gl.inputs[0],name:null,description:null,defaultValue:null,dynamicArguments:[],index:0,readsValue:null,parent:lR},FV={id:nR,type:i.OutputMap,version:1,declaration:_l.outputs[0],writesValues:[oR],index:0,parent:lR},UV={id:"map-company-dto-function-call-called-by-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:pt},xV={id:"map-company-dto-function-call-parent-ref-id",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:pt},jV={id:xl,type:i.FunctionCall,version:1,declaration:Gl,successCalls:[oR],process:null,errorCalls:[],inputs:[GV],outputs:[FV],calledByError:[],calledByEntry:[UV],calledBySuccess:[],parent:xV,x:0,y:0,error:null},kV={type:i.GenericReference,id:"last-timestamp-variable-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:rT},qV={type:i.GenericReference,id:"last-timestamp-variable-default-value-parent-ref-id",entityType:i.DataType,entityId:"last-timestamp-variable-datatype-id"},JV={id:"last-timestamp-variable-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:sn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:kV,defaultValue:{id:"last-timestamp-variable-default-value-id",type:i.PrimitiveValue,version:1,name:D.Date,value:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:qV,valueAsType:null}},WV={type:i.GenericReference,id:"last-timestamp-variable-main-project-ref-id",entityType:i.Project,entityId:H},kl={id:rT,type:i.VariableDeclaration,version:1,name:"Last registered current time",description:"A test variable that holds the last current date and time that was registered.",dataType:JV,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:WV},HV={type:i.GenericReference,id:"wait-for-2-seconds-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:tR},YV={type:i.GenericReference,id:"wait-for-2-seconds-argument-map-parent-ref-id",entityType:i.Operation,entityId:Ul},zV={id:tR,type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-2-seconds-argument-default-value-id",type:i.PrimitiveValue,version:1,value:2e3,valueAsType:null,autogeneration:null,name:D.Number,parent:HV},index:0,parent:YV},ZV={type:i.GenericReference,id:"wait-for-2-seconds-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},XV={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-one-id",entityType:i.FunctionDeclaration,entityId:Yi},QV={type:i.GenericReference,id:"wait-for-2-seconds-called-by-ref-two-id",entityType:i.FunctionDeclaration,entityId:Hi},cR={id:Ul,type:i.Operation,version:1,declaration:Ut,inputs:[zV],dynamicArguments:[],outputs:[],process:null,successCalls:[iR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[XV,QV],calledBySuccess:[],error:null,parent:ZV},KV={type:i.GenericReference,id:"wait-for-random-amount-argument-default-value-parent-ref-id",entityType:i.InputMap,entityId:"wait-for-random-amount-input-map-id"},e$={type:i.GenericReference,id:"wait-for-random-amount-argument-map-parent-ref-id",entityType:i.Operation,entityId:"wait-for-random-amount-id"},t$={id:"wait-for-random-amount-input-map-id",type:i.InputMap,version:1,declaration:Wn,name:null,description:null,dynamicArguments:[],readsValue:null,defaultValue:{id:"wait-for-random-amount-argument-default-value-id",type:i.PrimitiveValue,version:1,value:null,valueAsType:null,autogeneration:{type:xe.Random,rangeStart:1e3,rangeEnd:4e3},name:D.Number,parent:KV},index:0,parent:e$},n$={type:i.GenericReference,id:"wait-for-random-amount-parent-ref-id",entityType:i.Project,entityId:H},Wr={id:"wait-for-random-amount-id",type:i.Operation,version:1,declaration:Ut,inputs:[t$],dynamicArguments:[],process:null,outputs:[],successCalls:[],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[],calledBySuccess:[],error:null,parent:n$},dR="list-of-functions-variable-id",r$={type:i.GenericReference,id:"list-of-functions-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:dR},i$={id:"list-of-functions-variable-action-descriptor-id",type:i.ActionDescriptor,version:1,name:"Action to execute",description:"An action of any type, to be executed. It can contain any number of inputs and outputs.",argumentsType:F.Dynamic,dynamicArgumentTypes:null,fixedArguments:[],returnsType:F.Dynamic,error:null,dynamicReturnTypes:null,fixedReturns:[],parent:null},a$={type:i.GenericReference,id:"list-of-functions-variable-data-type-default-parent-ref-id",entityType:i.DataType,entityId:"list-of-functions-variable-data-type-id"},s$={id:"list-of-functions-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:i$,asType:!1,isList:!0,isNullable:!1,defaultValue:{id:"list-of-functions-variable-data-type-default-value-id",type:i.PrimitiveValue,version:1,name:D.ActionDescriptor,value:null,valueAsType:[Wr,Wr,Wr,Wr,Wr],autogeneration:null,parent:a$},constant:!1,parent:r$},o$={type:i.GenericReference,id:"list-of-functions-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt};i.GenericReference,i.InputMap;const l$={type:i.GenericReference,id:"list-of-functions-variable-writes-value-one-ref-id",entityType:i.InputMap,entityId:eR},c$={type:i.GenericReference,id:"list-of-functions-variable-writes-value-two-ref-id",entityType:i.InputMap,entityId:Fl},uR={id:dR,type:i.VariableDeclaration,version:1,name:"List of functions to execute",description:"A list of functions to be executed in parallel",dataType:s$,parent:o$,readsValue:null,writesValues:[l$,c$],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],inputs:[],outputs:[],internalCalls:[],x:0,y:0},d$={type:i.GenericReference,id:"exec-in-parallel-return-map-parent-ref-id",entityType:i.Operation,entityId:Hi},u$={type:i.GenericReference,id:"exec-in-parallel-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},p$={type:i.GenericReference,id:"exec-in-parallel-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-in-parallel-return-map-id"},y$={type:i.GenericReference,id:"exec-in-parallel-result-variable-called-by-ref-id",entityType:i.Operation,entityId:Hi},pR={id:"exec-in-parallel-result-variable-id",type:i.VariableInstance,version:1,declaration:kl,readsValue:p$,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[y$],successCalls:[],errorCalls:[],internalCalls:[],parent:u$,x:0,y:0},h$={id:"exec-in-parallel-return-map-id",type:i.OutputMap,version:1,declaration:No,writesValues:[pR],index:0,parent:d$},f$={type:i.GenericReference,id:"exec-in-parallel-argument-map-parent-ref-id",entityType:i.Operation,entityId:Hi},m$={id:Fl,type:i.InputMap,version:1,declaration:_o,name:null,description:null,dynamicArguments:[],readsValue:uR,defaultValue:null,index:0,parent:f$},T$={type:i.GenericReference,id:"exec-in-parallel-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},E$={type:i.GenericReference,id:"exec-in-parallel-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:pt},R$={process:null,id:Hi,type:i.Operation,version:1,declaration:Ut,inputs:[m$],dynamicArguments:[],outputs:[h$],successCalls:[cR,pR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[E$],calledBySuccess:[],error:null,parent:T$},b$={type:i.GenericReference,id:"exec-sequentially-return-map-parent-ref-id",entityType:i.Operation,entityId:Yi},g$={type:i.GenericReference,id:"exec-sequentially-result-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},v$={type:i.GenericReference,id:"exec-sequentially-result-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:"exec-sequentially-return-map-id"},I$={type:i.GenericReference,id:"exec-sequentially-result-variable-called-by-ref-id",entityType:i.Operation,entityId:Yi},yR={id:"exec-sequentially-result-variable-id",type:i.VariableInstance,version:1,declaration:kl,readsValue:v$,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[I$],successCalls:[],errorCalls:[],internalCalls:[],parent:g$,x:0,y:0},D$={id:"exec-sequentially-return-map-id",type:i.OutputMap,version:1,declaration:$o,writesValues:[yR],index:0,parent:b$},P$={type:i.GenericReference,id:"exec-sequentially-argument-map-parent-ref-id",entityType:i.Operation,entityId:Yi},A$={id:eR,type:i.InputMap,version:1,declaration:Vo,name:null,description:null,dynamicArguments:[],readsValue:uR,defaultValue:null,index:0,parent:P$},S$={type:i.GenericReference,id:"exec-sequentially-parent-ref-id",entityType:i.FunctionDeclaration,entityId:pt},O$={type:i.GenericReference,id:"exec-sequentially-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:pt},C$={id:Yi,type:i.Operation,version:1,declaration:on,inputs:[A$],process:null,dynamicArguments:[],outputs:[D$],successCalls:[cR,yR],errorCalls:[],x:0,y:0,calledByError:[],calledByEntry:[O$],calledBySuccess:[],error:null,parent:S$},B$={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},w$={type:i.FunctionDeclaration,id:pt,version:1,name:"Execute with concurrency and wait",description:"Executes a hardcoded list of actions in parallel and waits for some time before ending the logic with some unrelated data payload as the result.",inputs:[],calls:[C$,R$,jV],returnStatements:[iR],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:B$},M$={type:i.GenericReference,id:"3521f2c8-a5c0-419c-8808-4fc6a73d0b78",entityType:i.ReturnDeclaration,entityId:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b"},_$={id:"ce8b9a30-afe9-4d4f-879f-1677efca2c47",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Rt,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:M$},N$={type:i.GenericReference,id:"8ee66e38-b060-474e-a503-594063a8ec24",entityType:i.ReturnStatement,entityId:"40a23a98-d3b2-42b1-9652-b33779ad15aa"},V$={isError:!1,id:"e1ec31f0-25ca-42ac-a4c4-c9ec2255f55b",type:i.ReturnDeclaration,version:1,name:"Created company",description:"The new company that was created",dataType:_$,readsValue:null,required:!0,index:0,parent:N$},$$={type:i.GenericReference,id:"9cb3c1e4-7250-4be6-be2a-69c2dd366d6f",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},L$={type:i.GenericReference,id:"c065fcdd-e054-4f95-941c-7eaa65c35d04",entityType:i.FunctionDeclaration,entityId:"d683bfc1-a464-4810-8ec0-1dd8eaa0c3c4"},hR={type:i.ReturnStatement,id:"40a23a98-d3b2-42b1-9652-b33779ad15aa",version:1,outputs:[V$],calledByError:[],calledByEntry:[L$],calledBySuccess:[],throws:null,x:0,y:0,parent:$$},G$={type:i.GenericReference,id:"312ef836-9e40-4d57-b177-03b7145ed074",entityType:i.Project,entityId:H},F$={type:i.FunctionDeclaration,id:"5059c093-eda2-4efc-b7b4-aaaadd4d44de",version:1,name:"Create new company",description:null,inputs:[],calls:[hR],index:null,implements:null,returnStatements:[hR],collapsed:!1,private:!1,x:0,y:0,parent:G$},ql="get-current-date-and-time-func-decl-id",fR="get-current-date-and-time-return-statement-id",mR="get-current-date-and-time-return-declaration-id",TR="get-current-date-and-time-return-declaration-data-type-id",U$={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-value-parent-ref-id",entityType:i.DataType,entityId:TR},x$={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-data-type-parent-ref-id",entityType:i.ReturnDeclaration,entityId:mR},j$={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:TR,version:1,entity:sn,asType:!1,isList:!1,isNullable:!1,defaultValue:{id:"last-timestamp-variable-default-value-id",type:i.PrimitiveValue,version:1,value:null,name:D.Date,valueAsType:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:U$},constant:!1,parent:x$},k$={type:i.GenericReference,id:"get-current-date-and-time-return-declaration-parent-ref-id",entityType:i.ReturnStatement,entityId:fR};i.ReturnDeclaration;const q$={type:i.GenericReference,id:"get-current-date-and-time-return-statement-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:ql},J$={type:i.GenericReference,id:"get-current-date-and-time-return-statement-parent-ref-id",entityType:i.FunctionDeclaration,entityId:ql};i.ReturnStatement;const W$={type:i.GenericReference,id:"concurrency-and-wait-parent-ref-id",entityType:i.Project,entityId:H},H$={type:i.FunctionDeclaration,id:ql,version:1,name:"Get current date and time",description:"Generates and returns the current date and time at the time of the execution",inputs:[],calls:[],returnStatements:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:W$},ER="do-math-return-statement-id",RR="do-math-return-declaration-id",Y$={type:i.GenericReference,id:"do-math-func-var-to-return-one-ref-id",entityType:i.VariableDeclaration,entityId:"do-math-func-var-to-return-one-id"},z$={id:"do-math-func-var-to-return-one-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:Y$},Z$={type:i.GenericReference,id:"do-math-func-decl-ref-two-id",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},X$={type:i.GenericReference,id:"do-math-func-var-to-return-one-map-ref-id",entityType:i.ReturnDeclaration,entityId:RR},Q$={type:i.VariableDeclaration,id:"do-math-func-var-to-return-one-id",version:1,description:null,name:"Fixed result",dataType:z$,readsValue:null,writesValues:[X$],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:Z$},K$={type:i.GenericReference,id:"96ec244e-594b-45f7-802b-6dc3056920f6",entityType:i.ReturnStatement,entityId:ER},eL={type:i.GenericReference,id:"d120c0cc-9d13-4e45-90e2-4e1ee825ca46",entityType:i.ReturnDeclaration,entityId:"873a3556-4911-4141-b2a0-49c677b56fb4"},tL={id:"da91aa23-9985-49ac-a8bf-9d623ba1ba8f",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:eL},nL={isError:!1,id:RR,version:1,type:i.ReturnDeclaration,name:"Result",description:null,dataType:tL,readsValue:Q$,required:!0,index:0,parent:K$},rL={type:i.GenericReference,id:"57fd93e4-93a1-484e-82eb-4dd15d2d0e24",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},iL={type:i.GenericReference,id:"0a86e8d5-ab21-476e-a482-b928cbf351e3",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},bR={type:i.ReturnStatement,id:ER,version:1,outputs:[nL],calledByError:[],calledByEntry:[],calledBySuccess:[rL],parent:iL,throws:null,x:0,y:0},aL={type:i.GenericReference,id:"a2db26be-57f2-48e5-9769-cdbf0d95dc7c",entityType:i.VariableDeclaration,entityId:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a"},sL={id:"c3e9d5f0-204f-45f9-85f7-e1b56b468388",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,asType:!1,isList:!1,isNullable:!1,defaultValue:null,constant:!1,parent:aL},oL={type:i.GenericReference,id:"692122c5-610a-4504-90dd-f5a5202d116c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},lL={type:i.GenericReference,id:"do-math-func-return-one-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},cL={type:i.GenericReference,id:"6dceb501-be5b-4252-afb4-3c0d08abba33",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},gR={type:i.VariableDeclaration,id:"d0e9f1f3-7e9f-4e1f-8d8e-7b4b3e6c6a6a",version:1,name:"Result",dataType:sL,description:null,readsValue:cL,writesValues:[],inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[lL],successCalls:[],errorCalls:[],internalCalls:[],x:0,y:0,parent:oL},dL={type:i.GenericReference,id:"5440f523-af38-4981-8035-89d162fe8041",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},uL={type:i.GenericReference,id:"8c482c35-e674-4713-a1dd-63c3d13b611c",entityType:i.OutputMap,entityId:"64752080-ee0f-4cfe-9897-a0668f2b2aca"},pL={type:i.GenericReference,id:"c0a299cd-5869-4930-8cf0-90e3ceb8a903",entityType:i.VariableDeclaration,entityId:"46b2fe23-b417-4887-a35d-09b186679172"},yL={id:"51c0c1df-2ee3-41df-ae52-ac512d8cf795",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,asType:!1,isNullable:!1,defaultValue:null,constant:!1,parent:pL},hL={type:i.GenericReference,id:"do-math-func-return-two-called-by",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},vR={type:i.VariableDeclaration,id:"46b2fe23-b417-4887-a35d-09b186679172",version:1,name:"Total",description:null,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[hL],successCalls:[],errorCalls:[],dataType:yL,readsValue:uL,writesValues:[],internalCalls:[],parent:dL,x:0,y:0},IR={type:i.GenericReference,id:"6e4d776e-6af2-4321-b630-c78110fd677c",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},fL={type:i.GenericReference,id:"5b60955b-2486-40b6-bb24-ffd97ccd8902",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},mL={type:i.GenericReference,id:"1a49923f-bc6f-453f-a438-e74e5475c2a9",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},TL={type:i.GenericReference,id:"02bfde0a-b757-4072-9613-6e9c7c9a424a",entityType:i.ArgumentDeclaration,entityId:"d8895765-f705-457e-85fa-25d130926769"},DR={id:"928953b0-0e3f-4d8c-ae5a-84620b4b8c68",version:1,type:i.InputMap,declaration:Do,name:null,description:null,dynamicArguments:[],readsValue:TL,defaultValue:null,index:0,parent:mL},EL={id:"64752080-ee0f-4cfe-9897-a0668f2b2aca",type:i.OutputMap,version:1,declaration:Ao,writesValues:[gR,vR],index:0,parent:fL},RL={type:i.GenericReference,id:"d235a7f6-07ff-4f35-98d2-8f42dd59cf9f",entityType:i.Operation,entityId:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e"},bL={id:"8827e8e9-9381-4ad7-8f61-5419c23c9136",type:i.GenericReference,entityType:i.VariableDeclaration,entityId:"72a338d8-0183-4ca2-8760-227517854595"},PR={id:"a5525249-0eb5-472b-97bc-5e4cc0d75aee",version:1,type:i.InputMap,declaration:Po,name:null,description:null,dynamicArguments:[],readsValue:bL,defaultValue:null,index:1,parent:RL},gL={type:i.Operation,id:"e8c8c0a3-2e3e-4f6a-8e3d-8e0a0f9d7d8e",declaration:Ia,version:1,inputs:[DR,PR],dynamicArguments:[],outputs:[EL],calledByError:[],calledByEntry:[IR],calledBySuccess:[],process:null,successCalls:[bR,gR,vR],errorCalls:[],parent:IR,error:null,x:0,y:0},vL={type:i.GenericReference,id:"a2c40226-2270-4963-a865-c777ba79c551",entityType:i.DataType,entityId:"a350a9e9-25ee-477f-a83d-9e98ed2451662"},IL={id:"f47731b3-f278-4ab5-aeb2-24519c1119fb",type:i.GenericReference,entityId:"72a338d8-0183-4ca2-8760-227517854595",entityType:i.ArgumentDeclaration},AR={id:"a350a9e9-25ee-477f-a83d-9e98ed2451662",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-two-default-value-id",type:i.PrimitiveValue,version:1,value:1,name:D.Number,parent:vL,valueAsType:null,autogeneration:null},constant:!1,parent:IL},DL={type:i.GenericReference,id:"5f5d8dd0-7f3b-40cd-9f84-83d976887eaf",entityType:i.ArgumentDeclaration,entityId:"649bf0a4-6532-44aa-9818-a03d1c6564e9"},PL={type:i.GenericReference,id:"ca018d0f-a8b3-4c7e-a408-c8b372d04aff",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},AL={type:i.GenericReference,id:"do-math-func-var-called-by-ref",entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},SR={type:i.VariableDeclaration,id:"72a338d8-0183-4ca2-8760-227517854595",version:1,name:"Z",description:null,dataType:AR,inputs:[],outputs:[],calledByError:[],calledByEntry:[AL],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:DL,writesValues:[PR],internalCalls:[],x:0,y:0,parent:PL},SL={entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",type:i.GenericReference,id:"af0cf105-4075-425f-aecc-b25d3600fcc4"},OL={id:"649bf0a4-6532-44aa-9818-a03d1c6564e9",type:i.ArgumentDeclaration,version:1,name:"Z",description:"The number to add",dataType:AR,writesValues:[SR],required:!0,index:1,parent:SL},CL={type:i.GenericReference,id:"56953b5d-3e43-4dea-a62c-f3e868ba81bb",entityType:i.Project,entityId:H},BL={id:"868defc8-5c95-48ed-942d-257e8b9b9b00",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b"},wL={type:i.GenericReference,id:"35167664-a793-49f1-9eaf-fb57eac30897",entityType:i.DataType,entityId:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2"},ML={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:"d8895765-f705-457e-85fa-25d130926769",entityType:i.ArgumentDeclaration},_L={id:"55b12914-91b1-48b7-9a3e-9c5d0d2a2ec2",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,isNullable:!1,asType:!1,defaultValue:{id:"do-math-func-argument-one-default-value-id",type:i.PrimitiveValue,version:1,value:5,name:D.Number,parent:wL,valueAsType:null,autogeneration:null},constant:!1,parent:ML},NL={id:"d8895765-f705-457e-85fa-25d130926769",type:i.ArgumentDeclaration,version:1,name:"N",dataType:_L,description:"The number to add",writesValues:[DR],required:!0,index:0,parent:BL},VL={type:i.FunctionDeclaration,id:"b4c1d8d2-9c5e-4e0c-bd5e-3a6a0e4d2f0b",version:1,name:"Do math",description:"This function does math",inputs:[NL,OL],calls:[gL,SR],implements:null,index:null,collapsed:!1,returnStatements:[bR],private:!1,x:0,y:0,parent:CL},bt="replace-bank-account-in-company-func-declaration-id",Jl="company-entity-to-modify-arg-declaration-id",$L="account-number-to-create-arg-decl-id",Hr="company-variable-id",Yr="search-person-by-id-id",OR="new-bank-account-owner-arg-decl-id",CR="search-person-by-id-output-declaration-id",Wl="search-person-by-id-output-entity-map-id",vs="person-not-empty-condition-id",Is="create-new-bank-account-instance-operation-id",BR="create-new-bank-account-instance-operation-output-entity-map-id",wR="company-bank-account-output-map-id",Hl="old-bank-account-var-declaration-id",MR="old-bank-account-var-instance-id",_R="company-variable-instance-id",Yl="delete-bank-account-internal-call-id",LL={type:i.GenericReference,id:"company-variable-instance-parent-ref-id",entityType:i.FunctionDeclaration,entityId:bt},GL={type:i.GenericReference,id:"company-variable-instance-called-by-ref-id",entityType:i.InternalCall,entityId:Yl},FL={type:i.GenericReference,id:"company-variable-instance-declaration-ref-id",entityType:i.VariableDeclaration,entityId:Hr},UL={type:i.GenericReference,id:"bank-account-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:_R},xL={type:i.GenericReference,id:"bank-account-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:BR},NR={type:i.InputMap,id:"bank-account-input-map-id",version:1,readsValue:xL,declaration:vl,name:null,description:null,index:0,defaultValue:null,dynamicArguments:[],parent:UL},jL={type:i.VariableInstance,id:_R,version:1,declaration:FL,inputs:[NR],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[GL],successCalls:[],errorCalls:[],internalCalls:[],parent:LL,readsValue:null,writesValues:[],x:0,y:0},kL={type:i.GenericReference,id:"bank-account-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Hr},qL={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"bank-account-variable-data-type-id",version:1,entity:kr,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:kL},JL={type:i.GenericReference,id:"bank-account-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:wR},WL={type:i.GenericReference,id:"bank-account-variable-parent-ref-id",entityType:i.FunctionDeclaration,entityId:bt},HL={type:i.GenericReference,id:"bank-account-variable-called-by-ref-id",entityType:i.VariableDeclaration,entityId:Hr},YL={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-id",entityType:i.Operation,entityId:Is};i.GenericReference,i.VariableInstance;const zL={type:i.GenericReference,id:"delete-bank-account-internal-call-called-by-ref-two-id",entityType:i.VariableDeclaration,entityId:Hl},ZL={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-decl-ref-id",entityType:i.VariableDeclaration,entityId:Hl},XL={type:i.GenericReference,id:"bank-account-variable-parent-ref-two-id",entityType:i.FunctionDeclaration,entityId:bt},QL={type:i.GenericReference,id:"old-bank-account-variable-trigger-delete-internal-call-ref-id",entityType:i.InternalCall,entityId:Yl},KL={type:i.VariableInstance,id:MR,version:1,declaration:ZL,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],internalCalls:[QL],errorCalls:[],parent:XL,readsValue:null,writesValues:[],x:0,y:0},VR={process:null,type:i.InternalCall,id:Yl,version:1,declaration:Ho,index:0,successCalls:[jL],errorCalls:[],inputs:[],outputs:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[YL,zL],parent:KL},$R={type:i.VariableDeclaration,id:Hl,version:1,name:"Old bank account",description:"The existing bank account that needs to be replaced in the company entity",dataType:qL,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[HL],successCalls:[VR],internalCalls:[],errorCalls:[],parent:WL,readsValue:JL,writesValues:[],x:0,y:0},eG={type:i.GenericReference,id:"company-variable-declaration-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Hr},tG={type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,id:"company-variable-declaration-data-type-id",version:1,entity:Rt,asType:!1,isList:!1,isNullable:!1,constant:!1,defaultValue:null,parent:eG},nG={type:i.GenericReference,id:"company-variable-declaration-reads-value-ref-id",entityType:i.ArgumentDeclaration,entityId:Jl},rG={type:i.GenericReference,id:"company-variable-declaration-parent-ref-id",entityType:i.FunctionDeclaration,entityId:bt},iG={type:i.GenericReference,id:"company-variable-declaration-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:bt},aG={type:i.GenericReference,id:"company-bank-account-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Hr},sG={id:wR,version:1,type:i.OutputMap,declaration:vl,index:0,parent:aG,writesValues:[$R]},LR={type:i.VariableDeclaration,id:Hr,version:1,name:"Company",description:"The company entity that was passed as an argument to the parent function",dataType:tG,inputs:[],outputs:[sG],calledByError:[],calledByEntry:[iG],calledBySuccess:[],successCalls:[$R],errorCalls:[],parent:rG,internalCalls:[],readsValue:nG,writesValues:[],x:0,y:0},oG={type:i.GenericReference,id:"create-new-bank-account-account-owner-dynamic-input-map-parent-ref-id",entityType:i.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},lG={id:"create-new-bank-account-account-owner-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.OutputMap,entityId:Wl},GR={id:"create-new-bank-account-account-owner-dynamic-input-map-id",version:1,type:i.InputMap,declaration:dT,name:null,description:null,dynamicArguments:[],readsValue:lG,index:1,defaultValue:null,parent:oG},cG={id:"create-new-bank-account-account-number-dynamic-input-map-reads-value-ref-id",type:i.GenericReference,entityType:i.ArgumentDeclaration,entityId:$L},dG={type:i.GenericReference,id:"create-new-bank-account-account-number-dynamic-input-map-parent-ref-id",entityType:i.InputMap,entityId:"create-new-bank-account-instance-operation-entity-to-create-input-map-id"},FR={id:"create-new-bank-account-account-number-dynamic-input-map-id",version:1,type:i.InputMap,declaration:cT,name:null,description:null,dynamicArguments:[],readsValue:cG,defaultValue:null,index:0,parent:dG},uG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-entity-to-create-input-map-parent-ref-id",entityType:i.Operation,entityId:Is},pG={id:"create-new-bank-account-instance-operation-entity-to-create-input-map-id",version:1,type:i.InputMap,declaration:_r.fixedArguments[0],name:null,description:null,dynamicArguments:[FR,GR],index:0,readsValue:null,defaultValue:{type:i.PrimitiveValue,name:D.EntityTemplate,value:null,valueAsType:kr,autogeneration:null},parent:uG},yG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-output-entity-map-parent-ref-id",entityType:i.Operation,entityId:Is},hG={id:BR,version:1,type:i.OutputMap,declaration:_r.fixedReturns[0],index:0,writesValues:[NR],parent:yG},fG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-called-by-ref-id",entityType:i.Condition,entityId:vs},mG={type:i.GenericReference,id:"create-new-bank-account-instance-operation-parent-ref-id",entityType:i.FunctionDeclaration,entityId:bt},TG={process:null,id:Is,type:i.Operation,version:1,declaration:_r,inputs:[pG],dynamicArguments:[],error:null,outputs:[hG],successCalls:[VR],errorCalls:[],calledByError:[],calledByEntry:[],calledBySuccess:[fG],parent:mG,x:0,y:0},EG={id:"person-not-found-thrown-error-datatype-default-value-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-datatype-id",entityType:i.DataType},RG={id:"person-not-found-thrown-error-datatype-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-thrown-error-id",entityType:i.ReturnDeclaration};i.DataType,i.PrimitiveValue,D.String;const bG={id:"person-not-found-thrown-error-parent-ref-id",type:i.GenericReference,entityId:"person-not-found-error-return-statement-id",entityType:i.ReturnStatement},gG={isError:!0,id:"person-not-found-thrown-error-id",type:i.ReturnDeclaration,version:1,dataType:null,name:"Person not found error",description:"If the person entity was not found this error is outputted",parent:bG,required:!0,index:0,readsValue:null},vG={id:"person-not-found-error-return-statement-called-by-ref-id",type:i.GenericReference,entityId:vs,entityType:i.Condition},IG={id:"person-not-found-error-return-statement-parent-ref-id",type:i.GenericReference,entityId:bt,entityType:i.FunctionDeclaration},DG={id:"person-not-found-error-return-statement-id",type:i.ReturnStatement,version:1,throws:gG,outputs:[],calledBySuccess:[],calledByError:[vG],calledByEntry:[],x:0,y:0,parent:IG},PG={type:i.GenericReference,id:"person-not-empty-condition-called-by-ref-id",entityType:i.Search,entityId:Yr},AG={type:i.GenericReference,id:"person-not-empty-condition-parent-ref-id",entityType:i.FunctionDeclaration,entityId:bt},SG={type:i.GenericReference,id:"person-entity-to-check-map-reads-value-ref-id",entityType:i.OutputMap,entityId:Wl},OG={type:i.GenericReference,id:"person-not-empty-condition-ref-two-id",entityType:i.Condition,entityId:vs},UR={id:"person-entity-to-check-map-id",version:1,type:i.InputMap,declaration:zn.fixedArguments[0],name:null,description:null,dynamicArguments:[],readsValue:SG,index:0,defaultValue:null,parent:OG},CG={type:i.Condition,id:vs,version:1,declaration:zn,inputs:[UR],calledByError:[],calledByEntry:[],calledBySuccess:[PG],successCalls:[TG],errorCalls:[DG],x:0,y:0,parent:AG},BG={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-datatype-parent-ref-id",entityType:i.ValueDescriptor,entityId:CR},wG={id:"search-person-by-id-output-entity-declaration-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,isList:!1,constant:!1,asType:!1,isNullable:!1,entity:ut,defaultValue:null,parent:BG},MG={type:i.GenericReference,id:"search-person-by-id-output-entity-declaration-parent-ref-id",entityType:i.Search,entityId:Yr},xR={id:CR,type:i.ValueDescriptor,version:1,dataType:wG,name:"Found person",description:"The person entity that was found",parent:MG,required:!0,index:0},_G={type:i.GenericReference,id:"search-person-by-id-output-entity-map-parent-ref-id",entityType:i.Search,entityId:Yr},NG={type:i.OutputMap,id:Wl,version:1,declaration:xR,parent:_G,writesValues:[UR,GR],index:0},VG={id:"search-person-by-id-input-declaration-datatype-parent-ref-id",type:i.GenericReference,entityId:"search-person-by-id-input-declaration-id",entityType:i.ArgumentDeclaration};i.DataType;const $G={type:i.GenericReference,id:"search-person-by-id-input-declaration-parent-ref-id",entityType:i.Search,entityId:Yr},jR={id:"search-person-by-id-input-declaration-id",type:i.ArgumentDeclaration,version:1,dataType:null,name:"Person ID",description:"The unique identifier (ID) property of the person entity",index:0,required:!0,parent:$G,writesValues:[]},LG={type:i.GenericReference,id:"search-person-by-id-input-map-parent-ref-id",entityType:i.Search,entityId:Yr},GG={id:"search-person-by-id-input-map-reads-value-ref-id",type:i.GenericReference,entityId:OR,entityType:i.ArgumentDeclaration},kR={type:i.InputMap,id:"search-person-by-id-input-map",version:1,declaration:jR,name:null,description:null,readsValue:GG,defaultValue:null,parent:LG,dynamicArguments:[],index:0},FG={from:{name:"c9bc312a-10d3-48a7-9ab4-ea483a9e2416"},items:[{name:"*"}],where:[{name:"id",value:"{{dynamic_value_1}}"}]},UG={type:i.GenericReference,id:"search-person-by-id-parent-ref-id",entityType:i.FunctionDeclaration,entityId:bt},xG={type:i.GenericReference,id:"search-person-by-id-called-by-ref-id",entityType:i.FunctionDeclaration,entityId:bt},jG={type:i.Search,id:Yr,version:1,name:"Search person by ID",description:"Searches for a person entity given the UUID",query:FG,inputsDeclarations:[jR],inputs:[kR],outputsDeclarations:[xR],outputs:[NG],calledByError:[],calledByEntry:[xG],calledBySuccess:[],error:null,successCalls:[CG],errorCalls:[],parent:UG,x:0,y:0};i.GenericReference,i.DataType;const kG={id:"account-number-to-create-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:"account-number-to-create-arg-decl-id",entityType:i.ArgumentDeclaration},qG={id:"account-number-to-create-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:U,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:kG},JG={entityType:i.FunctionDeclaration,entityId:bt,type:i.GenericReference,id:"account-number-to-create-arg-decl-parent-ref-id"},WG={id:"account-number-to-create-arg-decl-id",type:i.ArgumentDeclaration,version:1,name:"Account number",description:"The account number of the new bank account entity",dataType:qG,writesValues:[FR],required:!0,index:1,parent:JG};i.GenericReference,i.DataType;const HG={id:"new-bank-account-owner-arg-decl-data-type-parent-ref-id",type:i.GenericReference,entityId:"new-bank-account-owner-arg-decl-id",entityType:i.ArgumentDeclaration},YG={id:"new-bank-account-owner-arg-decl-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:va,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:HG},zG={entityType:i.FunctionDeclaration,entityId:bt,type:i.GenericReference,id:"new-bank-account-owner-arg-decl-parent-ref-id"},ZG={id:OR,type:i.ArgumentDeclaration,version:1,name:"New account owner ID",description:"If it has changed, this is the new person entity, that owns of the bank account",dataType:YG,writesValues:[kR],required:!1,index:1,parent:zG},XG={type:i.GenericReference,id:"replace-bank-account-in-company-parent-ref",entityType:i.Project,entityId:H},QG={type:i.GenericReference,id:"company-entity-to-modify-parent-ref",entityType:i.FunctionDeclaration,entityId:bt};i.GenericReference,i.DataType;const KG={id:"d47ceef6-be6f-40f1-a7b3-c73c8d8a6c6a",type:i.GenericReference,entityId:Jl,entityType:i.ArgumentDeclaration},eF={id:"company-entity-to-modify-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:Se,isList:!1,isNullable:!1,asType:!1,defaultValue:null,constant:!1,parent:KG},tF={id:Jl,type:i.ArgumentDeclaration,version:1,name:"Company",dataType:eF,description:"The company to replace the bank account for",writesValues:[LR],required:!0,index:0,parent:QG},nF={type:i.FunctionDeclaration,id:bt,version:1,name:"Replace bank account",description:"This action takes an existing company and data to create a new bank account entity. It then creates a bank account, deletes the old one, and updates the company with the new bank account",inputs:[tF,WG,ZG],index:null,implements:null,calls:[jG,LR],collapsed:!1,returnStatements:[],private:!1,x:0,y:0,parent:XG},rF={type:i.GenericReference,id:"e0a937bd-3a85-4037-a973-916985b9f94b",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},iF={type:i.FunctionDeclaration,version:1,id:"6bedb217-f844-4332-af72-9626b2a32511",name:"Some library main function",description:null,inputs:[],calls:[],implements:null,collapsed:!0,index:null,returnStatements:[],private:!1,parent:rF,x:0,y:0},aF={type:i.GenericReference,id:"948e6869-ae5b-4914-bea0-b9f02ad6a014",entityType:i.Project,entityId:"23b23d8b-1929-4505-a350-745c8550e731"},sF={type:i.GenericReference,id:"f3d6f2c6-1b3e-4e9d-8c9d-5b5b9f0b8d9c",entityType:i.Project,entityId:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6"},oF={type:i.InstalledProject,version:1,id:"7268bc97-c0e6-4d88-b37e-d3241b5f77a6",name:"Third Party Installed Project",description:null,functions:[iF],events:[],implements:sF,parent:aF,x:0,y:0},zl="iterate-over-list-loop-id",qR="iterate-over-list-loop-body-id",JR="iterate-over-list-loop-body-current-iteration-argument-declaration-id",lF={type:i.GenericReference,id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-parent-ref-id",entityId:JR,entityType:i.ArgumentDeclaration},cF={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,defaultValue:null,entity:null,isList:!1,isNullable:!1,asType:!1,constant:!1,parent:lF},dF={id:"iterate-over-list-loop-body-current-iteration-argument-declaration-parent-ref-id",type:i.GenericReference,entityId:qR,entityType:i.FunctionDeclaration},uF={id:JR,type:i.ArgumentDeclaration,version:1,name:"Current value",description:"The current value being processed.",dataType:cF,required:!0,index:0,writesValues:[],parent:dF},pF={id:"iterate-over-list-loop-body-parent-ref-id",type:i.GenericReference,entityId:zl,entityType:i.Loop},yF={id:qR,type:i.FunctionDeclaration,version:1,name:"Iteration logic trigger",description:"This function is called once for each entity in the list.",inputs:[uF],calls:[],implements:null,collapsed:!1,returnStatements:[],private:!1,index:0,x:0,y:0,parent:pF},hF={id:"iterate-over-list-loop-iteration-list-input-map-parent-ref-id",type:i.GenericReference,entityId:zl,entityType:i.Loop},fF={id:"iterate-over-list-loop-iteration-list-input-map-id",type:i.InputMap,version:1,name:null,description:null,declaration:Yn.fixedArguments[0],defaultValue:null,dynamicArguments:[],readsValue:null,index:0,parent:hF},mF={id:"iterate-over-list-loop-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},TF={id:zl,type:i.Loop,version:1,declaration:Yn,inputs:[fF],successCalls:[],errorCalls:[],outputsDeclarations:[],outputs:[],process:null,body:yF,calledByError:[],calledByEntry:[],calledBySuccess:[],breakStatements:[],continueStatements:[],error:null,x:0,y:0,parent:mF};var Zl=(n=>(n.EQ="eq",n.NEQ="neq",n.GT="gt",n.GTE="gte",n.LT="lt",n.LTE="lte",n.LIKE="like",n.ILIKE="ilike",n))(Zl||{}),WR=(n=>(n.COUNT="count",n.SUM="sum",n.AVG="avg",n.MIN="min",n.MAX="max",n))(WR||{});const EF={from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:{from:{name:"ed3a6098-12ee-4632-a6dd-c2e6c542f66d"},items:[{function:{name:WR.COUNT,items:["f8310850-a87e-405c-b182-4f1d5fa49240"]},alias:"employee_count"}],where:[{name:"80c86e1b-caca-4ba5-9b1f-38f72d10e4a3",operation:Zl.NEQ,value:null}]},where:[{name:"employee_count",operation:Zl.GT,value:1}]},RF={id:"find-companies-with-multiple-employees-and-bank-account-search-parent-ref-id",type:i.GenericReference,entityId:H,entityType:i.Project},bF={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},HR={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-declaration-id",type:i.ValueDescriptor,version:1,name:"companies",description:"List of companies with multiple employees and an existing bank account",dataType:null,required:!0,index:0,parent:bF},gF={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-parent-ref-id",type:i.GenericReference,entityId:"find-companies-with-multiple-employees-and-bank-account",entityType:i.Search},vF={id:"find-companies-with-multiple-employees-and-bank-account-search-companies-list-output-id",type:i.OutputMap,version:1,declaration:HR,writesValues:[],index:0,parent:gF},IF={id:"find-companies-with-multiple-employees-and-bank-account",type:i.Search,version:1,name:"Find companies with multiple employees and a bank account",description:"This search statement finds companies with multiple employees and an existing bank account",inputsDeclarations:[],outputsDeclarations:[HR],inputs:[],outputs:[vF],query:EF,successCalls:[],errorCalls:[],error:null,calledByError:[],calledByEntry:[],calledBySuccess:[],x:0,y:0,parent:RF},zr="random-company-employee-test-variable-id",Xl="manager-global-variable-id",YR="global-user-instance-id",rr="employee-mapped-dto-variable-id",Ql="employee-mapped-dto-variable-instance-id",zR="random-employee-id-output-map-id",ZR="random-employee-birth-date-output-map-id",XR="random-employee-department-output-map-id",QR="random-employee-manager-output-map-id",KR="manager-global-id-output-map-id",eb="global-user-instance-id-output-map-id",DF="employee-mapped-dto-requester-id-input-map-id",tb="employee-mapped-dto-now-timestamp-input-map-id",PF="employee-mapped-dto-id-input-map-id",AF="employee-mapped-dto-birth-date-input-map-id",SF="employee-mapped-dto-department-input-map-id",OF="employee-mapped-dto-manager-input-map-id",CF={type:i.GenericReference,id:"employee-mapped-dto-manager-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:KR},BF={type:i.GenericReference,id:"employee-mapped-dto-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},nb={id:OF,type:i.InputMap,version:1,declaration:null,name:"manager_id",description:null,defaultValue:null,dynamicArguments:[],index:4,readsValue:CF,parent:BF},wF={type:i.GenericReference,id:"employee-mapped-dto-department-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:XR},MF={type:i.GenericReference,id:"employee-mapped-dto-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},rb={id:SF,type:i.InputMap,version:1,declaration:null,name:"department_name",description:null,defaultValue:null,dynamicArguments:[],index:3,readsValue:wF,parent:MF},_F={type:i.GenericReference,id:"employee-mapped-dto-birth-date-input-map-reads-value-ref-id",entityType:i.OutputMap,entityId:ZR},NF={type:i.GenericReference,id:"employee-mapped-dto-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},ib={id:AF,type:i.InputMap,version:1,declaration:null,name:"birth_date",description:null,defaultValue:null,dynamicArguments:[],index:2,readsValue:_F,parent:NF},VF={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:zR},$F={type:i.GenericReference,id:"employee-mapped-dto-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},ab={id:PF,type:i.InputMap,version:1,declaration:null,name:"id",description:"The ID of the employee",defaultValue:null,dynamicArguments:[],index:1,readsValue:VF,parent:$F},LF={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-reads-value-ref-id",entityType:i.OutputMap,entityId:eb},GF={type:i.GenericReference,id:"employee-mapped-dto-requester-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:rr},sb={id:DF,type:i.InputMap,version:1,declaration:null,name:"requester_id",description:"The ID of the current user making the request",defaultValue:null,dynamicArguments:[],index:0,readsValue:LF,parent:GF},FF={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xl},UF={id:KR,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[nb],parent:FF},xF={type:i.GenericReference,id:"manager-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:Xl},jF={id:"manager-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:St,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:xF,defaultValue:null},kF={type:i.GenericReference,id:"manager-variable-reads-value-ref-id",entityType:i.OutputMap,entityId:QR},qF={type:i.GenericReference,id:"manager-variable-parent-ref-id",entityType:i.Project,entityId:H},ob={id:Xl,type:i.VariableDeclaration,version:1,name:"Manager",dataType:jF,description:"A variable holding an inherited manager for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:kF,writesValues:[],inputs:[],outputs:[UF],internalCalls:[],parent:qF,x:0,y:0},JF={type:i.GenericReference,id:"random-company-employee-manager-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},WF={id:QR,type:i.OutputMap,version:1,declaration:St.properties[2],index:3,writesValues:[ob],parent:JF},HF={type:i.GenericReference,id:"random-company-employee-department-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},YF={id:XR,type:i.OutputMap,version:1,declaration:St.properties[0],index:2,writesValues:[rb],parent:HF},zF={type:i.GenericReference,id:"random-company-employee-birth-date-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},ZF={id:ZR,type:i.OutputMap,version:1,declaration:ut.properties[1],index:1,writesValues:[ib],parent:zF},XF={type:i.GenericReference,id:"random-company-employee-id-output-map-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},QF={id:zR,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[ab],parent:XF},KF={type:i.GenericReference,id:"random-company-employee-test-variable-data-type-parent-ref-id",entityType:i.VariableDeclaration,entityId:zr},e4={id:"random-company-employee-test-variable-data-type-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,version:1,entity:St,asType:!1,isList:!1,isNullable:!0,constant:!1,parent:KF,defaultValue:null},t4={type:i.GenericReference,id:"random-company-employee-test-variable-parent-ref-id",entityType:i.Project,entityId:H},n4={id:zr,type:i.VariableDeclaration,version:1,name:"Company employee",dataType:e4,description:"A variable holding a random company employee for testing purposes",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[QF,ZF,YF,WF],internalCalls:[],parent:t4,x:0,y:0},r4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-parent-ref-id",entityType:i.InputMap,entityId:tb},i4={type:i.PrimitiveValue,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-default-value-id",name:D.Date,version:1,valueAsType:null,value:null,autogeneration:{type:xe.CurrentDateAndTime,rangeStart:null,rangeEnd:null},parent:r4},a4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-now-timestamp-input-map-parent-ref-id",entityType:i.VariableInstance,entityId:Ql},s4={id:tb,type:i.InputMap,version:1,declaration:null,name:"now",description:"The current timestamp when the operation is executed",defaultValue:i4,dynamicArguments:[],index:5,readsValue:null,parent:a4},o4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-decl-ref-id",entityType:i.VariableDeclaration,entityId:rr},l4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-called-by-success-ref-id",entityType:i.VariableDeclaration,entityId:Ql},c4={type:i.GenericReference,id:"employee-mapped-dto-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},d4={id:Ql,type:i.VariableInstance,version:1,declaration:o4,calledByError:[],calledByEntry:[],calledBySuccess:[l4],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[s4],outputs:[],internalCalls:[],parent:c4,x:0,y:0},u4={type:i.GenericReference,id:"employee-mapped-dto-variable-parent-ref-id",entityType:i.Project,entityId:H},p4={id:rr,type:i.VariableDeclaration,version:1,name:"Employee DTO",dataType:null,description:"A variable holding the data of a mapped employee DTO",calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[d4],errorCalls:[],readsValue:null,writesValues:[],inputs:[sb,ab,ib,rb,nb],outputs:[],internalCalls:[],parent:u4,x:0,y:0},y4={type:i.GenericReference,id:"0e63e617-f9d3-42e8-bde0-1bb0b1df7034",entityType:i.VariableDeclaration,entityId:ml},h4={id:"e75645ce-d3df-4f07-a897-ae9ef4d917fd",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:El,version:1,asType:!1,isList:!1,isNullable:!1,constant:!1,parent:y4,defaultValue:null},f4={type:i.GenericReference,id:"e92a8ff5-3fef-4e0c-8d8f-92c930b2890b",entityType:i.Project,entityId:H},lb={id:ml,type:i.VariableDeclaration,version:1,name:"Current user",description:"The user that is currently logged in",dataType:h4,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:f4},m4={type:i.GenericReference,id:"manager-variable-id-output-map-parent-ref-id",entityType:i.VariableInstance,entityId:YR},T4={id:eb,type:i.OutputMap,version:1,declaration:Ve.properties[1],index:0,writesValues:[sb],parent:m4},E4={type:i.GenericReference,id:"global-user-instance-parent-ref-id",entityType:i.Project,entityId:H},R4={id:YR,type:i.VariableInstance,version:1,declaration:lb,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[T4],internalCalls:[],parent:E4,x:0,y:0},b4={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-parent-ref-id",entityType:i.VariableDeclaration,entityId:ml},g4={type:i.GenericReference,id:"is-test-environment-variable-dcl-datatype-default-value-parent-ref-id",entityType:i.DataType,entityId:"is-test-environment-variable-dcl-datatype-id"},v4={id:"is-test-environment-variable-dcl-datatype-id",type:i.DataType,andChildrenGroup:null,orChildrenGroup:null,entity:vn,version:1,asType:!1,isList:!1,isNullable:!1,constant:!0,parent:b4,defaultValue:{id:"is-test-environment-variable-dcl-datatype-default-value-id",name:D.Boolean,version:1,value:null,type:i.PrimitiveValue,autogeneration:{type:xe.Random,rangeStart:null,rangeEnd:null},valueAsType:null,parent:g4}},I4={type:i.GenericReference,id:"is-test-environment-variable-dcl-main-project-ref-id",entityType:i.Project,entityId:H},cb={id:"is-test-environment-variable-dcl-id",type:i.VariableDeclaration,version:1,name:"Is test envrioment",description:"Indicates whether the current environment is a test environment or not.",dataType:v4,inputs:[],outputs:[],calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],x:0,y:0,readsValue:null,writesValues:[],internalCalls:[],parent:I4},D4={type:i.GenericReference,id:"is-test-environment-variable-instance-parent-ref-id",entityType:i.Project,entityId:H},P4={id:"is-test-environment-variable-instance-id",type:i.VariableInstance,version:1,declaration:cb,calledByError:[],calledByEntry:[],calledBySuccess:[],successCalls:[],errorCalls:[],readsValue:null,writesValues:[],inputs:[],outputs:[],internalCalls:[],parent:D4,x:0,y:0},db={type:i.Project,id:H,version:1,name:"Mocked project to compile",description:"This project is used to test all sorts of features and edge cases. It is not meant to be used in production. Or to have any functionality that makes sense",projects:[oF],entities:[Tl,El,ut,hM,St,ys,IT,DT,kr,lw,Rt,rM,iT,eA,sw],functions:[w$,ZT,Ll,F$,H$,pE,Gl,Il,nF,_T,VL],events:[HM],variableDeclarations:[cb,lb,kl,n4,ob,p4],variableInstances:[P4,R4],conditions:[],operations:[Wr],functionCalls:[J_,KN],loops:[TF],searches:[IF]};var T=(n=>(n.Error="error",n.Warning="warning",n))(T||{}),I=(n=>(n.InvalidObjectStructure="invalid-object-structure",n.NameNotUniqueInScope="name-not-unique-in-scope",n.EmptyName="empty-name",n.MissingCaller="missing-caller",n.PropertyOverwrite="property-overwrite",n.MethodOverwrite="method-overwrite",n.NoOverlapWithImplementedSignature="no-overlap-with-implemented-signature",n.ReaderWriterIncompatibleDataType="reader-writer-incompatible-data-type",n.UnreachableEntity="unreachable-entity",n.InternalCallParentMissingDataType="internal-call-parent-missing-data-type",n.InternalCallParentDeclarationEntityInvalidType="internal-call-parent-declaration-entity-invalid-type",n.InternalCallDeclarationNotFoundInParentDatatypeEntity="internal-call-declaration-not-found-in-parent-datatype-entity",n.InternalCallDeclarationIsNotFunctionDeclaration="internal-call-declaration-is-not-function-declaration",n.InternalCallDeclarationNotInParentDatatypeEntity="internal-call-declaration-not-in-parent-datatype-entity",n))(I||{}),h=(n=>(n.RootReference="root-reference",n.ReferencedEntityNotFound="referenced-entity-not-found",n.EntityIdNotUnique="entity-id-not-unique",n.BuiltInEntityGenerated="built-in-entity-generated",n.BuiltInEntityUpdated="built-in-entity-updated",n.BuiltInEntityDeleted="built-in-entity-deleted",n.UnknownEntityType="unknown-entity-type",n.MissingTypeProperty="missing-type-property",n.MissingIdProperty="missing-id-property",n.BuiltInEntityParent="built-in-entity-parent",n.InvalidBuiltInEntityReference="invalid-built-in-entity-reference",n.RecommendedImplementAbstractEntityAction="recommended-implement-abstract-entity-action",n.RecommendedImplementOperationAction="recommended-implement-operation-action",n.RecommendedImplementFunctionCallAction="recommended-implement-function-call-action",n.RecommendedImplementVariableDeclarationAction="recommended-implement-variable-declaration-action",n.RecommendedImplementVariableInstanceAction="recommended-implement-variable-instance-action",n.RecommendedImplementConditionAction="recommended-implement-condition-action",n.InvalidReferenceObjectStructure="invalid-reference-object-structure",n.ContainsSingleButShouldBeReferenceList="contains-single-but-should-be-reference-list",n.ContainsListButShouldReferenceSingle="contains-list-but-should-reference-single",n.InvalidParentReference="invalid-parent-reference",n.InvalidImplementsReference="invalid-implements-reference",n.InvalidExtendsReference="invalid-extends-reference",n.InvalidGenerationActionPayload="invalid-generation-action-payload",n.InvalidReference="invalid-reference",n.InvalidInternalCallParentRelation="invalid-internal-call-parent-relation",n.InvalidUpdateEntityOperation="invalid-update-entity-operation",n.NewEntityWouldOverriteExisting="new-entity-would-overrite-existing",n.InvalidDownstreamPropertyOverride="invalid-downstream-property-override",n.UnrecognizedProperty="unrecognized-property",n.SelfReference="self-reference",n.DuplicateReference="duplicate-reference",n.CallerWithIncompatibleScope="caller-with-incompatible-scope",n.InvalidFunctionDeclarationForFunctionCall="invalid-function-declaration-for-function-call",n.InvalidInputMapDeclaration="invalid-input-map-declaration",n.InvalidActionDescriptorForOperation="invalid-action-descriptor-for-operation",n.InvalidActionDescriptorForCondition="invalid-action-descriptor-for-condition",n.InvalidActionDescriptorForLoop="invalid-action-descriptor-for-loop",n.InvalidInmutablePropertyOverride="invalid-inmutable-property-override",n.OutputOverwrite="output-overwrite",n.InputOverwrite="input-overwrite",n.IncompatibleScope="incompatible-scope",n.InvalidParentUpdate="invalid-parent-update",n.NonInteractiveEntityReferenced="non-interactive-entity-referenced",n.InvalidParentRelationType="invalid-parent-relation-type",n))(h||{}),B=(n=>(n.ScopeWithoutLogic="scope-without-logic",n.ExtendingAbstractEntity="extending-abstract-entity",n.ImplementingNonAbstractEntity="implementing-non-abstract-entity",n.AbstractEntityWithNonAbstractMethods="abstract-entity-with-non-abstract-methods",n.AbstractEntityWithNonAbstractProperties="abstract-entity-with-non-abstract-properties",n.StaticEntityWithNonStaticProperties="static-entity-with-non-static-properties",n.NonStaticPropertyInStaticEntity="non-static-property-in-static-entity",n.AbstractPropertyInNonAbstractEntity="abstract-property-in-non-abstract-entity",n.AbstractMethodInNonAbstractEntity="abstract-method-in-non-abstract-entity",n.IncorrectEntityImplementation="incorrect-entity-implementation",n.IncorrectMethodImplementation="incorrect-method-implementation",n.IncorrectPropertyImplementation="incorrect-property-implementation",n.PropertyImplementsNonAbstact="property-implements-non-abstract",n.NonStaticPropertyImplementsStatic="non-static-property-implements-static",n.StaticPropertyImplementsNonStatic="static-property-implements-non-static",n.PropertyImplementsIncompatibleType="property-implements-incompatible-type",n.MissingPropertyImplementation="missing-property-implementation",n.MissingMethodImplementation="missing-method-implementation",n.NoProperties="no-properties",n.ReadingFromIncompatibleType="reading-from-incompatible-type",n.WritingToIncompatibleType="writing-to-incompatible-type",n.InvalidPropertiesCombination="invalid-properties-combination",n.DisconnectedCallableEntity="disconnected-callable-entity",n.VariableReadsValueAndInternalCall="variable-reads-value-and-internal-call",n.VariableWritesValuesAndInternalCall="variable-writes-values-and-internal-call",n.VariableHasInputsAndInternalCall="variable-has-inputs-and-internal-calls",n.VariableHasOutputsAndInternalCall="variable-has-outputs-and-internal-call",n.VariableIsCalledAndHasInternalCall="variable-is-called-and-has-internal-call",n.VariableCallsOthersAndHasInternalCall="variable-calls-others-and-has-internal-call",n))(B||{});class E{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code}toEntityError(e){return this.code in I?new ir({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:e}):null}}class ir{constructor(e){c(this,"id");c(this,"message");c(this,"issue");c(this,"severity");c(this,"code");c(this,"entity");this.id=e.id,this.message=e.message,this.issue=e.issue,this.severity=e.severity,this.code=e.code,this.entity=e.entity}clone(){return new ir({id:this.id,message:this.message,issue:this.issue,severity:this.severity,code:this.code,entity:this.entity})}}function A4(n){const e=new Set;return n.filter(t=>e.has(t.id)?!1:(e.add(t.id),!0))}function q(n){const e=n.entity.errors.find(r=>r.id===n.id);return e?{new:!1,error:e}:{new:!0,error:new ir(n)}}function S4(n,e){const t=new Map;return n.forEach(r=>{t.set(r.id,r)}),e.forEach(r=>{t.set(r.id,r)}),Array.from(t.values())}function ee(n,e){const t=[];return e.forEach(r=>{const a=n.find(s=>s.id===r.id);a?t.push(a):t.push(r)}),t}const Zi=d.union([d.string(),d.number(),d.boolean(),d.date()]),ub=d.enum([xe.CurrentDateAndTime,xe.Random,xe.Unique]),Ds=d.object({type:ub,rangeStart:Zi.nullable(),rangeEnd:Zi.nullable()}),Xi=Ds.extend({type:d.literal(xe.Random),rangeStart:Zi,rangeEnd:Zi}),Kl=Ds.extend({type:d.literal(xe.Unique),rangeStart:d.null(),rangeEnd:d.null()}),pb=Ds.extend({type:d.literal(xe.CurrentDateAndTime),rangeStart:d.null(),rangeEnd:d.null()}),Ps=Xi.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),yb=Ps.extend({rangeStart:d.number(),rangeEnd:d.null()}),hb=Ps.extend({rangeStart:d.null(),rangeEnd:d.number()}),fb=Ps.extend({rangeStart:d.number(),rangeEnd:d.number()}),As=Xi.extend({rangeStart:d.number().nullable(),rangeEnd:d.number().nullable()}),mb=As.extend({rangeStart:d.number(),rangeEnd:d.null()}),Tb=As.extend({rangeStart:d.null(),rangeEnd:d.number()}),Eb=As.extend({rangeStart:d.number(),rangeEnd:d.number()}),Ss=Xi.extend({rangeStart:d.date().nullable(),rangeEnd:d.date().nullable()}),Rb=Ss.extend({rangeStart:d.date(),rangeEnd:d.null()}),bb=Ss.extend({rangeStart:d.null(),rangeEnd:d.date()}),gb=Ss.extend({rangeStart:d.date(),rangeEnd:d.date()}),ec=Xi.extend({rangeStart:d.null(),rangeEnd:d.null()}),tc=d.union([mb,Tb,Eb]),nc=d.union([yb,hb,fb]),rc=d.union([Rb,bb,gb,pb]),ic=d.union([tc,nc,rc,Kl,ec]);function Qi(){return d.union([d.object({type:d.literal(i.ValueDescriptor)}),d.record(d.string(),d.any())])}function vb(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ValueDescriptor)})}function ac(){return d.object({id:d.string(),type:d.literal(i.ValueDescriptor),name:d.string(),required:d.boolean()})}function O4(){return ac().merge(d.object({version:d.number(),index:d.number()}))}function C4(){return ac().merge(d.object({}))}function B4(){return d.object({dataType:yn(),parent:Nn()})}function w4(){return O4().merge(B4())}function Os(){return d.union([d.object({type:d.literal(i.PrimitiveEntity)}),d.record(d.string(),d.any())])}function Cs(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.PrimitiveEntity)})}function Bs(){return d.object({id:d.string(),type:d.literal(i.PrimitiveEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function M4(){return Bs().merge(d.object({version:d.number()}))}function _4(){return Bs().merge(d.object({}))}function N4(){return d.object({properties:d.array(ar()),methods:d.array(Ct()),abstractMethods:d.array(Qt()),extends:d.array(d.union([Os(),Zr()]))})}function V4(){return M4().merge(N4())}function ar(){return d.union([d.object({type:d.literal(i.Property)}),d.record(d.string(),d.any())])}function Ib(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Property)})}function sc(){return d.object({id:d.string(),type:d.literal(i.Property),name:d.string(),description:d.string().nullable(),private:d.boolean(),static:d.boolean(),required:d.boolean(),abstract:d.boolean()})}function $4(){return sc().merge(d.object({version:d.number(),index:d.number()}))}function L4(){return sc().merge(d.object({}))}function G4(){return d.object({dataType:yn(),implements:ar().nullable(),parent:d.union([cr(),Cs(),ws()])})}function F4(){return $4().merge(G4())}function U4(){return d.enum([N.CRON_JOB,N.EXECUTION,N.HTTP_ENDPOINT,N.PERSISTED_ENTITY,N.RELATIONAL_DATABASE])}function Zr(){return d.union([d.object({type:d.literal(i.BuiltInBaseEntity)}),d.record(d.string(),d.any())])}function ws(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.BuiltInBaseEntity)})}function oc(){return d.object({id:d.string(),version:d.number(),type:d.literal(i.BuiltInBaseEntity),name:U4(),description:d.string().nullable(),abstract:d.boolean(),static:d.boolean()})}function x4(){return oc()}function j4(){return oc().merge(d.object({}))}function k4(){return d.object({properties:d.array(ar()),methods:d.array(Ct()),abstractMethods:d.array(Qt()),extends:d.array(d.union([Zr(),Os()]))})}function q4(){return x4().merge(k4())}function Db(){return d.enum([F.Dynamic,F.Fixed,F.None])}function Qt(){return d.union([d.object({type:d.literal(i.ActionDescriptor)}),d.record(d.string(),d.any())])}function Nn(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ActionDescriptor)})}function Ms(){return d.object({id:d.string(),type:d.literal(i.ActionDescriptor),name:d.string(),description:d.string().nullable(),argumentsType:Db(),returnsType:Db()})}function J4(){return Ms().merge(d.object({version:d.number()}))}function W4(){return Ms().merge(d.object({}))}function H4(){return d.object({fixedArguments:d.array(Qi()),fixedReturns:d.array(Qi()),dynamicArgumentTypes:yn().nullable(),dynamicReturnTypes:yn().nullable(),parent:d.union([gt(),cr(),ws(),Cs()]).nullable()})}function Pb(){return J4().merge(H4())}function Xr(){return d.union([d.object({type:d.literal(i.Loop)}),d.record(d.string(),d.any())])}function Kt(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Loop)})}function Ab(){return d.object({id:d.string(),type:d.literal(i.Loop)})}function Y4(){return Ab().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function z4(){return Ab().merge(d.object({declaration:d.union([d.string(),Ct()])}))}function Z4(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),declaration:Qt(),inputs:d.array(Ot()),outputs:d.array(yt()),outputsDeclarations:d.array(Qi()),successCalls:d.array(ke()),errorCalls:d.array(ke()),error:yt(),body:Ct(),parent:d.union([fn(),gt()]),breakStatements:d.array(ti()),continueStatements:d.array(Qr())})}function X4(){return Y4().merge(Z4())}function Qr(){return d.union([d.object({type:d.literal(i.ContinueStatement)}),d.record(d.string(),d.any())])}function Kr(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ContinueStatement)})}function lc(){return d.object({id:d.string(),type:d.literal(i.ContinueStatement)})}function Q4(){return lc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function K4(){return lc().merge(d.object({}))}function eU(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),outputs:d.array(un()),throws:d.optional(un()),parent:Kt()})}function tU(){return Q4().merge(eU())}function sr(){return d.union([d.object({type:d.literal(i.ReturnStatement)}),d.record(d.string(),d.any())])}function ei(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ReturnStatement)})}function cc(){return d.object({id:d.string(),type:d.literal(i.ReturnStatement)})}function nU(){return cc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function rU(){return cc().merge(d.object({}))}function iU(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),outputs:d.array(un()),throws:d.optional(un()),parent:fn()})}function aU(){return nU().merge(iU())}function un(){return d.union([d.object({type:d.literal(i.ReturnDeclaration)}),d.record(d.string(),d.any())])}function Sb(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ReturnDeclaration)})}function dc(){return d.object({id:d.string(),type:d.literal(i.ReturnDeclaration),name:d.string(),description:d.string().nullable(),isError:d.boolean()})}function sU(){return dc().merge(d.object({version:d.number(),index:d.number()}))}function oU(){return dc().merge(d.object({}))}function lU(){return d.object({dataType:yn().nullable(),readsValue:ia().nullable(),parent:d.union([ei(),Nn(),pn(),Kr()])})}function cU(){return sU().merge(lU())}function ti(){return d.union([d.object({type:d.literal(i.BreakStatement)}),d.record(d.string(),d.any())])}function pn(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.BreakStatement)})}function uc(){return d.object({id:d.string(),type:d.literal(i.BreakStatement)})}function dU(){return uc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function uU(){return uc().merge(d.object({}))}function pU(){return d.object({calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),outputs:d.array(un()),throws:d.optional(un()),parent:Kt()})}function yU(){return dU().merge(pU())}function yt(){return d.union([d.object({type:d.literal(i.OutputMap)}),d.record(d.string(),d.any())])}function pc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.OutputMap)})}function yc(){return d.object({id:d.string(),type:d.literal(i.OutputMap)})}function hU(){return yc().merge(d.object({version:d.number(),index:d.number()}))}function fU(){return yc().merge(d.object({}))}function mU(){return d.object({writesValues:d.array(hn()),declaration:d.union([un(),ar()]),parent:d.union([le(),Kt(),pn()])})}function TU(){return hU().merge(mU())}function ni(){return d.union([d.object({type:d.literal(i.FunctionCall)}),d.record(d.string(),d.any())])}function Ki(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.FunctionCall)})}function hc(){return d.object({id:d.string(),type:d.literal(i.FunctionCall)})}function EU(){return hc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function RU(){return hc().merge(d.object({}))}function bU(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),writesValues:d.array(hn()),declaration:Ct(),inputs:d.array(Ot()),outputs:d.array(yt()),error:d.optional(yt()),parent:d.union([fn(),gt()])})}function gU(){return EU().merge(bU())}function vU(){return d.enum([Be.Equal,Be.NotEqual,Be.MoreThan,Be.MoreThanOrEqual,Be.LessThan,Be.LessThanOrEqual,Be.And,Be.Or,_t.Empty,_t.NotEmpty])}function ea(){return d.union([d.object({type:d.literal(i.Condition)}),d.record(d.string(),d.any())])}function _s(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Condition)})}function fc(){return d.object({id:d.string(),type:d.literal(i.Condition)})}function IU(){return fc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function DU(){return fc().merge(d.object({}))}function PU(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),leftValue:Ot(),rightValue:Ot().nullable(),operator:vU(),parent:d.union([fn(),gt()])})}function AU(){return IU().merge(PU())}function ta(){return d.union([d.object({type:d.literal(i.Search)}),d.record(d.string(),d.any())])}function na(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Search)})}function mc(){return d.object({id:d.string(),type:d.literal(i.Search),name:d.string(),query:d.any(),description:d.string().nullable()})}function SU(){return mc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function OU(){return mc().merge(d.object({}))}function CU(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),inputsDeclarations:d.array(lr()),inputs:d.array(Ot()),outputsDeclarations:d.array(Qi()),outputs:d.array(yt()),parent:d.union([fn(),gt()]),error:yt().nullable()})}function BU(){return SU().merge(CU())}function ra(){return d.union([d.object({type:d.literal(i.InternalCall)}),d.record(d.string(),d.any())])}function Tc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.InternalCall)})}function Ec(){return d.object({id:d.string(),type:d.literal(i.InternalCall),index:d.number()})}function wU(){return Ec().merge(d.object({version:d.number(),index:d.number()}))}function MU(){return Ec().merge(d.object({declaration:d.union([d.string(),Ct()])}))}function _U(){return d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),writesValues:d.array(hn()),declaration:Ct(),inputs:d.array(Ot()),outputs:d.array(yt()),parent:Vn(),error:d.optional(yt())})}function NU(){return wU().merge(_U())}function Ot(){return d.union([d.object({type:d.literal(i.InputMap)}),d.record(d.string(),d.any())])}function Ns(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.InputMap)})}function Rc(){return d.object({id:d.string(),type:d.literal(i.InputMap),name:d.string().nullable().optional(),description:d.string().nullable().optional()})}function VU(){return Rc().merge(d.object({version:d.number(),index:d.number()}))}function $U(){return Rc().merge(d.object({}))}function LU(){return d.object({defaultValue:bc().nullable(),declaration:d.union([lr(),ar()]).nullable(),readsValue:ia().nullable(),parent:d.union([le(),Ns(),Kt(),pn()]),dynamicArguments:d.array(Ot())})}function GU(){return VU().merge(LU())}function ri(){return d.union([d.object({type:d.literal(i.Operation)}),d.record(d.string(),d.any())])}function ii(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.Operation)})}function Vs(){return d.object({id:d.string(),type:d.literal(i.Operation)})}function FU(){return Vs().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function UU(){return Vs().merge(d.object({}))}function xU(){return Vs().merge(d.object({successCalls:d.array(ke()),errorCalls:d.array(ke()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),writesValues:d.array(hn()),declaration:Qt(),inputs:d.array(Ot()),outputs:d.array(yt()),error:d.array(yt()),dynamicArguments:d.array(Ot()),parent:d.union([fn(),gt()])}))}function jU(){return FU().merge(xU())}function $s(){return d.union([d.string(),d.number(),d.boolean(),d.null(),d.date()])}function Ob(){return d.record(d.string(),$s())}function kU(){return d.array(d.union([$s(),Ob()]))}function Cb(){return d.union([$s(),Ob(),kU()])}function Bb(){return d.union([$s(),Cb()])}function wb(){return d.enum([D.String,D.Number,D.Boolean,D.Null,D.Date,D.JSON,D.Enum,D.File,D.UUID,D.EntityTemplate,D.ActionDescriptor])}function qU(){return d.union([cr(),ii(),aa()])}function JU(){return d.object({id:d.string(),name:wb(),type:d.literal(i.PrimitiveValue),value:Bb(),autogeneration:ic.nullable()})}function WU(){return JU().merge(d.object({}))}function qt(){return d.object({id:d.string(),version:d.number(),name:wb(),type:d.literal(i.PrimitiveValue),value:Bb(),valueAsType:qU().nullable(),autogeneration:ic.nullable(),parent:d.union([gc(),Ns()])})}function HU(){return qt().extend({name:d.literal(D.String),value:d.string(),autogeneration:tc.nullable()})}function YU(){return qt().extend({name:d.literal(D.Number),value:d.number(),autogeneration:nc.nullable()})}function zU(){return qt().extend({name:d.literal(D.Boolean),value:d.boolean(),autogeneration:ec.nullable()})}function ZU(){return qt().extend({name:d.literal(D.Null),value:d.null(),autogeneration:d.null()})}function XU(){return qt().extend({name:d.literal(D.Date),value:d.date(),autogeneration:rc.nullable()})}function QU(){return qt().extend({name:d.literal(D.JSON),value:Cb(),autogeneration:d.null()})}function KU(){return qt().extend({name:d.literal(D.Enum),value:d.string(),autogeneration:d.null()})}function ex(){return qt().extend({name:d.literal(D.File),value:d.string(),autogeneration:d.null()})}function tx(){return qt().extend({name:d.literal(D.UUID),value:d.string(),autogeneration:Kl.nullable()})}function nx(){return qt().extend({name:d.literal(D.EntityTemplate),value:cr(),autogeneration:d.null()})}function rx(){return qt().extend({name:d.literal(D.ActionDescriptor),value:aa(),autogeneration:d.null()})}function bc(){return d.union([HU(),YU(),zU(),ZU(),XU(),QU(),KU(),ex(),tx(),nx(),rx()])}function yn(){return d.union([d.object({type:d.literal(i.DataType)}),d.record(d.string(),d.any())])}function gc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.DataType)})}function vc(){return d.object({id:d.string(),type:d.literal(i.DataType),isNullable:d.boolean(),isList:d.boolean(),constant:d.boolean(),asType:d.boolean(),options:d.array(d.string()).optional()})}function ix(){return vc().merge(d.object({version:d.number()}))}function ax(){return vc().merge(d.object({}))}function sx(){return d.object({defaultValue:bc().nullable(),entity:d.union([ai(),Zr(),Os(),Qt()]).nullable(),parent:d.union([Ib(),Nb(),Nn(),vb()])})}function ox(){return ix().merge(sx())}function Ic(){return d.union([d.object({type:d.literal(i.VariableDeclaration)}),d.record(d.string(),d.any())])}function lx(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.VariableDeclaration)})}function Dc(){return d.object({id:d.string(),type:d.literal(i.VariableDeclaration),name:d.string(),description:d.string().nullable()})}function cx(){return Dc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function dx(){return Dc().merge(d.object({}))}function ux(){return d.object({dataType:yn().nullable(),readsValue:ia().nullable(),writesValues:d.array(hn()),inputs:d.array(Ot()),outputs:d.array(yt()),successCalls:d.array(ke()),errorCalls:d.array(ke()),internalCalls:d.array(ra()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),parent:d.union([fn(),gt()])})}function px(){return cx().merge(ux())}function Mb(){return d.union([d.object({type:d.literal(i.VariableInstance)}),d.record(d.string(),d.any())])}function yx(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.VariableInstance)})}function Pc(){return d.object({id:d.string(),type:d.literal(i.VariableInstance)})}function hx(){return Pc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function fx(){return Pc().merge(d.object({}))}function mx(){return d.object({declaration:Ic(),dataType:yn().nullable(),readsValue:ia().nullable(),writesValues:d.array(hn()),inputs:d.array(Ot()),outputs:d.array(yt()),successCalls:d.array(ke()),errorCalls:d.array(ke()),internalCalls:d.array(ra()),calledBySuccess:d.array(le()),calledByError:d.array(le()),calledByEntry:d.array(je()),parent:d.union([fn(),gt()])})}function Tx(){return hx().merge(mx())}function Ac(){return d.union([d.object({type:d.literal(i.InstalledProject)}),d.record(d.string(),d.any())])}function Ls(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.InstalledProject)})}function Ex(){return d.object({id:d.string(),type:d.literal(i.InstalledProject)})}function Rx(){return d.object({version:d.number(),x:d.number(),y:d.number()})}function bx(){return d.object({})}function gx(){return d.object({implements:gt(),description:d.string().nullable(),functions:d.array(Ct()),events:d.array(Sc()),parent:gt()})}function vx(){return Rx().merge(gx())}function Sc(){return d.union([d.object({type:d.literal(i.GlobalEvent)}),d.record(d.string(),d.any())])}function Ix(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.GlobalEvent)})}function Gs(){return d.object({id:d.string(),type:d.literal(i.GlobalEvent),name:d.string(),collapsed:d.boolean()})}function Dx(){return Gs().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function Px(){return Gs().merge(d.object({}))}function Ax(){return Gs().merge(d.object({returnStatements:d.array(sr()),implements:d.array(Pb()),inputs:d.array(lr()),calls:d.array(ke()),parent:d.union([gt(),Ls()])}))}function Sx(){return Dx().merge(Ax())}function or(){return d.union([Ic(),Mb()])}function Vn(){return d.union([lx(),yx()])}function hn(){return d.union([or(),Ot(),un()])}function _b(){return d.union([Vn(),Ns(),Sb()])}function ia(){return d.union([or(),lr(),yt(),ri(),ra(),ni()])}function Ox(){return d.union([Vn(),Oc(),pc(),ii(),Tc(),Ki()])}function Cx(){return d.union([lr(),yt(),hn()])}function Nb(){return d.union([Oc(),pc(),_b()])}function Fs(){return Sc()}function Us(){return Ix()}function xs(){return d.union([ri(),ni(),ea(),ta(),or(),ra(),Xr()])}function le(){return d.union([ii(),Ki(),_s(),na(),Vn(),Tc(),Kt()])}function js(){return d.union([ri(),ni(),ea(),ta(),or(),Xr()])}function ks(){return d.union([ii(),Ki(),_s(),na(),Vn(),Kt()])}function Vb(){return d.union([xs(),sr(),ti(),Qr()])}function ke(){return d.union([le(),ei(),pn(),Kr()])}function $b(){return d.union([js(),sr(),ti(),Qr()])}function Lb(){return d.union([ks(),ei(),pn(),Kr()])}function $n(){return d.union([Ct(),Fs()])}function je(){return d.union([aa(),Us()])}function Bx(){return d.union([xs(),$n()])}function wx(){return d.union([le(),je()])}function Mx(){return d.union([js(),$n()])}function _x(){return d.union([ks(),je()])}function Nx(){return d.union([Vb(),$n()])}function Vx(){return d.union([ke(),je()])}function $x(){return d.union([$b(),$n()])}function Lx(){return d.union([Lb(),je()])}function Gx(){return d.union([$n(),Xr()])}function fn(){return d.union([je(),Kt()])}function Fx(){return d.union([xs(),$n()])}function Ux(){return d.union([le(),je()])}function xx(){return d.union([js(),$n()])}function jx(){return d.union([ks(),je()])}function kx(){return d.union([sr(),ti(),Qr()])}function qx(){return d.union([ei(),pn(),Kr()])}function Jx(){return d.union([Zr(),r8(),Ac(),ai(),Ct(),Fs(),or(),Ot(),yt(),ea(),ri(),ni(),un(),lr(),Os(),yn(),ar(),Qt(),sr(),Qr(),ti(),Xr(),ta(),Qt(),Qt(),Qi(),ra()])}function Wx(){return d.union([ws(),gt(),Ls(),cr(),aa(),Us(),Vn(),Ns(),pc(),_s(),ii(),Ki(),Sb(),Oc(),Cs(),gc(),Ib(),Nn(),ei(),Kr(),pn(),Kt(),na(),Nn(),Nn(),vb(),Tc()])}function Hx(){return d.union([Ac(),ai(),Ct(),Fs(),or(),ea(),ri(),ni(),sr(),Qr(),ti(),Xr(),ta()])}function Yx(){return d.union([Ls(),cr(),aa(),Us(),Vn(),_s(),ii(),Ki(),ei(),Kr(),pn(),Kt(),na()])}function lr(){return d.union([d.object({type:d.literal(i.ArgumentDeclaration)}),d.record(d.string(),d.any())])}function Oc(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.ArgumentDeclaration)})}function Cc(){return d.object({id:d.string(),type:d.literal(i.ArgumentDeclaration)})}function zx(){return Cc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function Zx(){return Cc().merge(d.object({}))}function Xx(){return d.object({dataType:yn().nullable(),writesValues:d.array(hn()),parent:d.union([je(),Nn(),Nn(),na(),pn()])})}function Qx(){return zx().merge(Xx())}function Ct(){return d.union([d.object({type:d.literal(i.FunctionDeclaration)}),d.record(d.string(),d.any())])}function aa(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.FunctionDeclaration)})}function Bc(){return d.object({id:d.string(),type:d.literal(i.FunctionDeclaration),name:d.string(),description:d.string().nullable()})}function Kx(){return Bc().merge(d.object({version:d.number(),x:d.number(),y:d.number(),index:d.number().nullable()}))}function e8(){return Bc()}function t8(){return d.object({inputs:d.array(lr()),implements:Qt().nullable(),returnStatements:d.array(sr()),parent:d.union([gt(),Ls(),cr(),Kt(),ws(),Cs()])})}function n8(){return Kx().merge(t8())}function r8(){return d.union([d.object({type:d.literal(i.Project)}),d.record(d.string(),d.any())])}function gt(){return d.object({entityType:d.literal(i.Project),entityId:d.string(),id:d.string(),type:d.literal(i.GenericReference)})}function wc(){return d.object({id:d.string(),type:d.literal(i.Project),name:d.string(),description:d.string().nullable()})}function i8(){return wc().merge(d.object({version:d.number()}))}function a8(){return wc()}function s8(){return d.object({entities:d.array(ai()),functions:d.array(Ct()),events:d.array(Sc()),projects:d.array(Ac()),variableDeclarations:d.array(Ic()),variableInstances:d.array(Mb()),conditions:d.array(ea()),operations:d.array(ri()),functionCalls:d.array(ni()),loops:d.array(Xr()),searches:d.array(ta())})}function o8(){return i8().merge(s8())}function ai(){return d.union([d.object({type:d.literal(i.CustomEntity)}),d.record(d.string(),d.any())])}function cr(){return d.object({id:d.string(),type:d.literal(i.GenericReference),entityId:d.string(),entityType:d.literal(i.CustomEntity)})}function Mc(){return d.object({id:d.string(),type:d.literal(i.CustomEntity),name:d.string(),description:d.string().nullable(),static:d.boolean(),abstract:d.boolean()})}function l8(){return Mc().merge(d.object({version:d.number(),x:d.number(),y:d.number()}))}function c8(){return Mc().merge(d.object({}))}function d8(){return d.union([gt(),gc()])}function u8(){return d.object({properties:d.array(ar()),methods:d.array(Ct()),abstractMethods:d.array(Qt()),extends:d.array(d.union([ai(),Zr()])),implements:d.array(d.union([ai(),Zr()])),parent:d8()})}function p8(){return l8().merge(u8())}function y8(n){const e=p8(),t=n.toJSON();e.safeParse(t).success;const a=n.implements.flatMap(f=>m8(n,f)),s=n.extends.flatMap(f=>T8(n,f)),o=R8(n),l=E8(n);n.methods.flatMap(f=>f.validate());const p=[...a,...s,...o,...l];return ee(n.errors,p)}function h8(n,e){const t=e.properties.filter(s=>s.abstract),r=[];let a=[...n.properties];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):r.push(s)}),r}function f8(n,e){const t=e.abstractMethods,r=[];let a=[...n.methods];return t.forEach(s=>{const o=a.find(l=>{var p;return((p=l.implements)==null?void 0:p.id)===s.id});o?a=a.filter(l=>l.id!==o.id):r.push(s)}),r}function m8(n,e){const t=[];if(!e.abstract){const f=q({id:n.id+"--"+B.ImplementingNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is implementing a non-abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:B.ImplementingNonAbstractEntity,entity:n});return t.push(f.error),t}const r=e.properties.filter(f=>f.abstract),a=[];let s=[...n.properties];r.forEach(f=>{const m=s.find(b=>{var g;return((g=b.implements)==null?void 0:g.id)===f.id});m?s=s.filter(b=>b.id!==m.id):a.push(f)}),a.length&&a.forEach(f=>{const m=q({id:n.id+"--"+B.MissingPropertyImplementation+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:T.Error,code:B.MissingPropertyImplementation,entity:n});t.push(m.error)});const o=[];let l=[...n.methods];e.abstractMethods.forEach(f=>{const m=l.find(b=>{var g;return((g=b.implements)==null?void 0:g.id)===f.id});m?l=l.filter(b=>b.id!==m.id):o.push(f)}),o.length&&o.forEach(f=>{const m=q({id:n.id+"--"+B.MissingMethodImplementation+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${e.name}" with id "${e.id}" is not implemented when entity "${n.name}" with id "${n.id}" implements it`,issue:null,severity:T.Error,code:B.MissingMethodImplementation,entity:n});t.push(m.error)});const p=[];e.properties.forEach(f=>{const m=s.find(b=>b.name===f.name);m&&p.push([m,f])}),p.length&&p.forEach(([f])=>{const m=q({id:n.id+"--"+I.PropertyOverwrite+"--"+f.id,message:`Property "${f.name}" with id "${f.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.PropertyOverwrite,entity:n});t.push(m.error)});const y=[];return e.methods.forEach(f=>{const m=l.find(b=>b.name===f.name);m&&y.push([m,f])}),y.length&&y.forEach(([f])=>{const m=q({id:n.id+"--"+I.MethodOverwrite+"--"+f.id,message:`Method "${f.name}" with id "${f.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the base entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.MethodOverwrite,entity:n});t.push(m.error)}),t}function T8(n,e){const t=[],r=[];if(e.abstract){const s=q({id:n.id+"--"+B.ExtendingAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is extending an abstract entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:B.ExtendingAbstractEntity,entity:n});return t.push(s.error),t}n.properties.forEach(s=>{var l;const o=e.properties.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&r.push(s)}),r.length&&r.forEach(s=>{const o=q({id:n.id+"--"+I.PropertyOverwrite,message:`Property "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the property with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.PropertyOverwrite,entity:n});t.push(o.error)});const a=[];return n.methods.forEach(s=>{var l;const o=e.methods.find(p=>p.name===s.name);((l=s.implements)==null?void 0:l.id)!==(o==null?void 0:o.id)&&o&&a.push(s)}),a.length&&a.forEach(s=>{const o=q({id:n.id+"--"+I.MethodOverwrite,message:`Method "${s.name}" with id "${s.id}" of entity "${n.name}" with id "${n.id}" overwrites the method with the same name from the extended entity "${e.name}" with id "${e.id}"`,issue:null,severity:T.Error,code:I.MethodOverwrite,entity:n});t.push(o.error)}),t}function E8(n){const e=[];if(!n.properties.length){const t=q({id:n.id+"--"+B.NoProperties,message:"No properties implemented",issue:null,severity:T.Warning,code:B.NoProperties,entity:n});e.push(t.error)}return n.properties.forEach(t=>{t.validate()}),e}function R8(n){const e=[];if(n.abstract){if(n.methods.length){const t=q({id:n.id+"--"+B.AbstractEntityWithNonAbstractMethods,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract methods`,issue:null,severity:T.Error,code:B.AbstractEntityWithNonAbstractMethods,entity:n});e.push(t.error)}if(n.properties.some(t=>!t.abstract)){const t=q({id:n.id+"--"+B.AbstractEntityWithNonAbstractProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as abstract but has non-abstract properties`,issue:null,severity:T.Error,code:B.AbstractEntityWithNonAbstractProperties,entity:n});e.push(t.error),n.properties.forEach(r=>{if(!r.abstract){const a=q({id:n.id+"--"+B.StaticEntityWithNonStaticProperties+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${n.name}" with id "${n.id}" is not marked as abstract but the entity is marked as abstract`,issue:null,severity:T.Error,code:B.StaticEntityWithNonStaticProperties,entity:n});e.push(a.error)}})}}else{if(n.abstractMethods.length){const t=q({id:n.id+"--"+B.AbstractPropertyInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract methods`,issue:null,severity:T.Error,code:B.AbstractPropertyInNonAbstractEntity,entity:n});e.push(t.error)}if(n.properties.some(t=>t.abstract)){const t=q({id:n.id+"--"+B.AbstractMethodInNonAbstractEntity,message:`Entity "${n.name}" with id "${n.id}" is not marked as abstract but has abstract properties`,issue:null,severity:T.Error,code:B.AbstractMethodInNonAbstractEntity,entity:n});e.push(t.error),n.properties.forEach(r=>{if(r.abstract){const a=q({id:n.id+"--"+B.AbstractMethodInNonAbstractEntity+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${n.name}" with id "${n.id}" is marked as abstract but the entity is not marked as abstract`,issue:null,severity:T.Error,code:B.AbstractMethodInNonAbstractEntity,entity:n});e.push(a.error)}})}}if(n.static&&n.properties.some(t=>!t.static)){const t=q({id:n.id+"--"+B.StaticEntityWithNonStaticProperties,message:`Entity "${n.name}" with id "${n.id}" is marked as static but has non-static properties`,issue:null,severity:T.Error,code:B.StaticEntityWithNonStaticProperties,entity:n});e.push(t.error),n.properties.forEach(r=>{if(!r.static){const a=q({id:n.id+"--"+B.NonStaticPropertyInStaticEntity+"--"+r.id,message:`Property "${r.name}" with id "${r.id}" of entity "${n.name}" with id "${n.id}" is not marked as static but the entity is marked as static`,issue:null,severity:T.Error,code:B.NonStaticPropertyInStaticEntity,entity:n});e.push(a.error)}})}return e}function b8(n){return n instanceof Error&&n.name==="ZodError"&&"issues"in n&&Array.isArray(n.issues)}var g8=class extends Error{constructor(e,t){super(e,t);c(this,"name");c(this,"details");this.name="ZodValidationError",this.details=v8(t)}toString(){return this.message}};function v8(n){if(n){const e=n.cause;if(b8(e))return e.issues}return[]}var I8="; ",Gb="Validation error",D8=": ",P8=", or ";function A8(n,e,t){return e!==null?n.length>0?[e,n].join(t):e:n.length>0?n:Gb}var S8=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function O8(n){return n.length===1?n[0].toString():n.reduce((e,t)=>{if(typeof t=="number")return e+"["+t.toString()+"]";if(t.includes('"'))return e+'["'+C8(t)+'"]';if(!S8.test(t))return e+'["'+t+'"]';const r=e.length===0?"":".";return e+r+t},"")}function C8(n){return n.replace(/"/g,'\\"')}function B8(n){return n.length!==0}function qs(n){const{issue:e,issueSeparator:t,unionSeparator:r,includePath:a}=n;if(e.code==="invalid_union")return e.unionErrors.reduce((s,o)=>{const l=o.issues.map(p=>qs({issue:p,issueSeparator:t,unionSeparator:r,includePath:a})).join(t);return s.includes(l)||s.push(l),s},[]).join(r);if(e.code==="invalid_arguments")return[e.message,...e.argumentsError.issues.map(s=>qs({issue:s,issueSeparator:t,unionSeparator:r,includePath:a}))].join(t);if(e.code==="invalid_return_type")return[e.message,...e.returnTypeError.issues.map(s=>qs({issue:s,issueSeparator:t,unionSeparator:r,includePath:a}))].join(t);if(a&&B8(e.path)){if(e.path.length===1){const s=e.path[0];if(typeof s=="number")return`${e.message} at index ${s}`}return`${e.message} at "${O8(e.path)}"`}return e.message}function w8(n,e={}){const{issueSeparator:t=I8,unionSeparator:r=P8,prefixSeparator:a=D8,prefix:s=Gb,includePath:o=!0}=e,l=qs({issue:n,issueSeparator:t,unionSeparator:r,includePath:o}),p=A8(l,s,a);return new g8(p,{cause:new Et([n])})}var Fb="1.13.7",Ub=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Js=Array.prototype,_c=Object.prototype,xb=typeof Symbol<"u"?Symbol.prototype:null,M8=Js.push,sa=Js.slice,oa=_c.toString,_8=_c.hasOwnProperty,jb=typeof ArrayBuffer<"u",N8=typeof DataView<"u",V8=Array.isArray,kb=Object.keys,qb=Object.create,Jb=jb&&ArrayBuffer.isView,$8=isNaN,L8=isFinite,Wb=!{toString:null}.propertyIsEnumerable("toString"),Hb=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G8=Math.pow(2,53)-1;function vt(n,e){return e=e==null?n.length-1:+e,function(){for(var t=Math.max(arguments.length-e,0),r=Array(t),a=0;a<t;a++)r[a]=arguments[a+e];switch(e){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r);case 2:return n.call(this,arguments[0],arguments[1],r)}var s=Array(e+1);for(a=0;a<e;a++)s[a]=arguments[a];return s[e]=r,n.apply(this,s)}}function Ln(n){var e=typeof n;return e==="function"||e==="object"&&!!n}function F8(n){return n===null}function Yb(n){return n===void 0}function zb(n){return n===!0||n===!1||oa.call(n)==="[object Boolean]"}function U8(n){return!!(n&&n.nodeType===1)}function at(n){var e="[object "+n+"]";return function(t){return oa.call(t)===e}}const Nc=at("String"),Zb=at("Number"),x8=at("Date"),j8=at("RegExp"),k8=at("Error"),Xb=at("Symbol"),Qb=at("ArrayBuffer");var Kb=at("Function"),q8=Ub.document&&Ub.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof q8!="function"&&(Kb=function(n){return typeof n=="function"||!1});const ht=Kb,eg=at("Object");var tg=N8&&(!/\[native code\]/.test(String(DataView))||eg(new DataView(new ArrayBuffer(8)))),Vc=typeof Map<"u"&&eg(new Map),J8=at("DataView");function W8(n){return n!=null&&ht(n.getInt8)&&Qb(n.buffer)}const Ws=tg?W8:J8,dr=V8||at("Array");function Gn(n,e){return n!=null&&_8.call(n,e)}var $c=at("Arguments");(function(){$c(arguments)||($c=function(n){return Gn(n,"callee")})})();const Lc=$c;function H8(n){return!Xb(n)&&L8(n)&&!isNaN(parseFloat(n))}function ng(n){return Zb(n)&&$8(n)}function rg(n){return function(){return n}}function ig(n){return function(e){var t=n(e);return typeof t=="number"&&t>=0&&t<=G8}}function ag(n){return function(e){return e==null?void 0:e[n]}}const Hs=ag("byteLength"),Y8=ig(Hs);var z8=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function Z8(n){return Jb?Jb(n)&&!Ws(n):Y8(n)&&z8.test(oa.call(n))}const sg=jb?Z8:rg(!1),It=ag("length");function X8(n){for(var e={},t=n.length,r=0;r<t;++r)e[n[r]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,n.push(a)}}}function og(n,e){e=X8(e);var t=Hb.length,r=n.constructor,a=ht(r)&&r.prototype||_c,s="constructor";for(Gn(n,s)&&!e.contains(s)&&e.push(s);t--;)s=Hb[t],s in n&&n[s]!==a[s]&&!e.contains(s)&&e.push(s)}function We(n){if(!Ln(n))return[];if(kb)return kb(n);var e=[];for(var t in n)Gn(n,t)&&e.push(t);return Wb&&og(n,e),e}function la(n){if(n==null)return!0;var e=It(n);return typeof e=="number"&&(dr(n)||Nc(n)||Lc(n))?e===0:It(We(n))===0}function lg(n,e){var t=We(e),r=t.length;if(n==null)return!r;for(var a=Object(n),s=0;s<r;s++){var o=t[s];if(e[o]!==a[o]||!(o in a))return!1}return!0}function te(n){if(n instanceof te)return n;if(!(this instanceof te))return new te(n);this._wrapped=n}te.VERSION=Fb,te.prototype.value=function(){return this._wrapped},te.prototype.valueOf=te.prototype.toJSON=te.prototype.value,te.prototype.toString=function(){return String(this._wrapped)};function cg(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,Hs(n))}var dg="[object DataView]";function Gc(n,e,t,r){if(n===e)return n!==0||1/n===1/e;if(n==null||e==null)return!1;if(n!==n)return e!==e;var a=typeof n;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:ug(n,e,t,r)}function ug(n,e,t,r){n instanceof te&&(n=n._wrapped),e instanceof te&&(e=e._wrapped);var a=oa.call(n);if(a!==oa.call(e))return!1;if(tg&&a=="[object Object]"&&Ws(n)){if(!Ws(e))return!1;a=dg}switch(a){case"[object RegExp]":case"[object String]":return""+n==""+e;case"[object Number]":return+n!=+n?+e!=+e:+n==0?1/+n===1/e:+n==+e;case"[object Date]":case"[object Boolean]":return+n==+e;case"[object Symbol]":return xb.valueOf.call(n)===xb.valueOf.call(e);case"[object ArrayBuffer]":case dg:return ug(cg(n),cg(e),t,r)}var s=a==="[object Array]";if(!s&&sg(n)){var o=Hs(n);if(o!==Hs(e))return!1;if(n.buffer===e.buffer&&n.byteOffset===e.byteOffset)return!0;s=!0}if(!s){if(typeof n!="object"||typeof e!="object")return!1;var l=n.constructor,p=e.constructor;if(l!==p&&!(ht(l)&&l instanceof l&&ht(p)&&p instanceof p)&&"constructor"in n&&"constructor"in e)return!1}t=t||[],r=r||[];for(var y=t.length;y--;)if(t[y]===n)return r[y]===e;if(t.push(n),r.push(e),s){if(y=n.length,y!==e.length)return!1;for(;y--;)if(!Gc(n[y],e[y],t,r))return!1}else{var f=We(n),m;if(y=f.length,We(e).length!==y)return!1;for(;y--;)if(m=f[y],!(Gn(e,m)&&Gc(n[m],e[m],t,r)))return!1}return t.pop(),r.pop(),!0}function Q8(n,e){return Gc(n,e)}function ca(n){if(!Ln(n))return[];var e=[];for(var t in n)e.push(t);return Wb&&og(n,e),e}function Fc(n){var e=It(n);return function(t){if(t==null)return!1;var r=ca(t);if(It(r))return!1;for(var a=0;a<e;a++)if(!ht(t[n[a]]))return!1;return n!==hg||!ht(t[Uc])}}var Uc="forEach",pg="has",xc=["clear","delete"],yg=["get",pg,"set"],K8=xc.concat(Uc,yg),hg=xc.concat(yg),e6=["add"].concat(xc,Uc,pg);const t6=Vc?Fc(K8):at("Map"),n6=Vc?Fc(hg):at("WeakMap"),r6=Vc?Fc(e6):at("Set"),i6=at("WeakSet");function si(n){for(var e=We(n),t=e.length,r=Array(t),a=0;a<t;a++)r[a]=n[e[a]];return r}function a6(n){for(var e=We(n),t=e.length,r=Array(t),a=0;a<t;a++)r[a]=[e[a],n[e[a]]];return r}function fg(n){for(var e={},t=We(n),r=0,a=t.length;r<a;r++)e[n[t[r]]]=t[r];return e}function jc(n){var e=[];for(var t in n)ht(n[t])&&e.push(t);return e.sort()}function kc(n,e){return function(t){var r=arguments.length;if(e&&(t=Object(t)),r<2||t==null)return t;for(var a=1;a<r;a++)for(var s=arguments[a],o=n(s),l=o.length,p=0;p<l;p++){var y=o[p];(!e||t[y]===void 0)&&(t[y]=s[y])}return t}}const mg=kc(ca),Ys=kc(We),Tg=kc(ca,!0);function s6(){return function(){}}function Eg(n){if(!Ln(n))return{};if(qb)return qb(n);var e=s6();e.prototype=n;var t=new e;return e.prototype=null,t}function o6(n,e){var t=Eg(n);return e&&Ys(t,e),t}function l6(n){return Ln(n)?dr(n)?n.slice():mg({},n):n}function c6(n,e){return e(n),n}function Rg(n){return dr(n)?n:[n]}te.toPath=Rg;function da(n){return te.toPath(n)}function qc(n,e){for(var t=e.length,r=0;r<t;r++){if(n==null)return;n=n[e[r]]}return t?n:void 0}function bg(n,e,t){var r=qc(n,da(e));return Yb(r)?t:r}function d6(n,e){e=da(e);for(var t=e.length,r=0;r<t;r++){var a=e[r];if(!Gn(n,a))return!1;n=n[a]}return!!t}function Jc(n){return n}function ua(n){return n=Ys({},n),function(e){return lg(e,n)}}function Wc(n){return n=da(n),function(e){return qc(e,n)}}function pa(n,e,t){if(e===void 0)return n;switch(t??3){case 1:return function(r){return n.call(e,r)};case 3:return function(r,a,s){return n.call(e,r,a,s)};case 4:return function(r,a,s,o){return n.call(e,r,a,s,o)}}return function(){return n.apply(e,arguments)}}function gg(n,e,t){return n==null?Jc:ht(n)?pa(n,e,t):Ln(n)&&!dr(n)?ua(n):Wc(n)}function Hc(n,e){return gg(n,e,1/0)}te.iteratee=Hc;function Dt(n,e,t){return te.iteratee!==Hc?te.iteratee(n,e):gg(n,e,t)}function u6(n,e,t){e=Dt(e,t);for(var r=We(n),a=r.length,s={},o=0;o<a;o++){var l=r[o];s[l]=e(n[l],l,n)}return s}function vg(){}function p6(n){return n==null?vg:function(e){return bg(n,e)}}function y6(n,e,t){var r=Array(Math.max(0,n));e=pa(e,t,1);for(var a=0;a<n;a++)r[a]=e(a);return r}function Yc(n,e){return e==null&&(e=n,n=0),n+Math.floor(Math.random()*(e-n+1))}const ya=Date.now||function(){return new Date().getTime()};function Ig(n){var e=function(s){return n[s]},t="(?:"+We(n).join("|")+")",r=RegExp(t),a=RegExp(t,"g");return function(s){return s=s==null?"":""+s,r.test(s)?s.replace(a,e):s}}const Dg={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},h6=Ig(Dg),f6=fg(Dg),m6=Ig(f6),T6=te.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var zc=/(.)^/,E6={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},R6=/\\|'|\r|\n|\u2028|\u2029/g;function b6(n){return"\\"+E6[n]}var g6=/^\s*(\w|\$)+\s*$/;function v6(n,e,t){!e&&t&&(e=t),e=Tg({},e,te.templateSettings);var r=RegExp([(e.escape||zc).source,(e.interpolate||zc).source,(e.evaluate||zc).source].join("|")+"|$","g"),a=0,s="__p+='";n.replace(r,function(y,f,m,b,g){return s+=n.slice(a,g).replace(R6,b6),a=g+y.length,f?s+=`'+
|
|
2
2
|
((__t=(`+f+`))==null?'':_.escape(__t))+
|
|
3
3
|
'`:m?s+=`'+
|
|
4
4
|
((__t=(`+m+`))==null?'':__t)+
|
|
@@ -10,16 +10,16 @@ __p+='`),y}),s+=`';
|
|
|
10
10
|
`,o="obj";s=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
|
|
11
11
|
`+s+`return __p;
|
|
12
12
|
`;var l;try{l=new Function(o,"_",s)}catch(y){throw y.source=s,y}var p=function(y){return l.call(this,y,te)};return p.source="function("+o+`){
|
|
13
|
-
`+s+"}",p}function I6(n,e,t){e=da(e);var r=e.length;if(!r)return ht(t)?t.call(n):t;for(var a=0;a<r;a++){var s=n==null?void 0:n[e[a]];s===void 0&&(s=t,a=r),n=ht(s)?s.call(n):s}return n}var P6=0;function D6(n){var e=++P6+"";return n?n+e:e}function A6(n){var e=te(n);return e._chain=!0,e}function Dg(n,e,t,r,a){if(!(r instanceof e))return n.apply(t,a);var s=Eg(n.prototype),o=n.apply(s,a);return Ln(o)?o:s}var oi=It(function(n,e){var t=oi.placeholder,r=function(){for(var a=0,s=e.length,o=Array(s),l=0;l<s;l++)o[l]=e[l]===t?arguments[a++]:e[l];for(;a<arguments.length;)o.push(arguments[a++]);return Dg(n,r,this,this,o)};return r});oi.placeholder=te;const Ag=It(function(n,e,t){if(!ht(n))throw new TypeError("Bind must be called on a function");var r=It(function(a){return Dg(n,r,e,this,t.concat(a))});return r}),wt=ig(Pt);function ur(n,e,t,r){if(r=r||[],!e&&e!==0)e=1/0;else if(e<=0)return r.concat(n);for(var a=r.length,s=0,o=Pt(n);s<o;s++){var l=n[s];if(wt(l)&&(dr(l)||Lc(l)))if(e>1)ur(l,e-1,t,r),a=r.length;else for(var p=0,y=l.length;p<y;)r[a++]=l[p++];else t||(r[a++]=l)}return r}const S6=It(function(n,e){e=ur(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var r=e[t];n[r]=Ag(n[r],n)}return n});function O6(n,e){var t=function(r){var a=t.cache,s=""+(e?e.apply(this,arguments):r);return Gn(a,s)||(a[s]=n.apply(this,arguments)),a[s]};return t.cache={},t}const Sg=It(function(n,e,t){return setTimeout(function(){return n.apply(null,t)},e)}),C6=oi(Sg,te,1);function B6(n,e,t){var r,a,s,o,l=0;t||(t={});var p=function(){l=t.leading===!1?0:ya(),r=null,o=n.apply(a,s),r||(a=s=null)},y=function(){var f=ya();!l&&t.leading===!1&&(l=f);var m=e-(f-l);return a=this,s=arguments,m<=0||m>e?(r&&(clearTimeout(r),r=null),l=f,o=n.apply(a,s),r||(a=s=null)):!r&&t.trailing!==!1&&(r=setTimeout(p,m)),o};return y.cancel=function(){clearTimeout(r),l=0,r=a=s=null},y}function w6(n,e,t){var r,a,s,o,l,p=function(){var f=ya()-a;e>f?r=setTimeout(p,e-f):(r=null,t||(o=n.apply(l,s)),r||(s=l=null))},y=It(function(f){return l=this,s=f,a=ya(),r||(r=setTimeout(p,e),t&&(o=n.apply(l,s))),o});return y.cancel=function(){clearTimeout(r),r=s=l=null},y}function _6(n,e){return oi(e,n)}function Zc(n){return function(){return!n.apply(this,arguments)}}function M6(){var n=arguments,e=n.length-1;return function(){for(var t=e,r=n[e].apply(this,arguments);t--;)r=n[t].call(this,r);return r}}function N6(n,e){return function(){if(--n<1)return e.apply(this,arguments)}}function Og(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}}const V6=oi(Og,2);function Cg(n,e,t){e=Dt(e,t);for(var r=We(n),a,s=0,o=r.length;s<o;s++)if(a=r[s],e(n[a],a,n))return a}function Bg(n){return function(e,t,r){t=Dt(t,r);for(var a=Pt(e),s=n>0?0:a-1;s>=0&&s<a;s+=n)if(t(e[s],s,e))return s;return-1}}const Xc=Bg(1),wg=Bg(-1);function _g(n,e,t,r){t=Dt(t,r,1);for(var a=t(e),s=0,o=Pt(n);s<o;){var l=Math.floor((s+o)/2);t(n[l])<a?s=l+1:o=l}return s}function Mg(n,e,t){return function(r,a,s){var o=0,l=Pt(r);if(typeof s=="number")n>0?o=s>=0?s:Math.max(s+l,o):l=s>=0?Math.min(s+1,l):s+l+1;else if(t&&s&&l)return s=t(r,a),r[s]===a?s:-1;if(a!==a)return s=e(sa.call(r,o,l),ng),s>=0?s+o:-1;for(s=n>0?o:l-1;s>=0&&s<l;s+=n)if(r[s]===a)return s;return-1}}const Ng=Mg(1,Xc,_g),$6=Mg(-1,wg);function Qc(n,e,t){var r=wt(n)?Xc:Cg,a=r(n,e,t);if(a!==void 0&&a!==-1)return n[a]}function L6(n,e){return Qc(n,ua(e))}function mn(n,e,t){e=pa(e,t);var r,a;if(wt(n))for(r=0,a=n.length;r<a;r++)e(n[r],r,n);else{var s=We(n);for(r=0,a=s.length;r<a;r++)e(n[s[r]],s[r],n)}return n}function pr(n,e,t){e=Dt(e,t);for(var r=!wt(n)&&We(n),a=(r||n).length,s=Array(a),o=0;o<a;o++){var l=r?r[o]:o;s[o]=e(n[l],l,n)}return s}function Vg(n){var e=function(t,r,a,s){var o=!wt(t)&&We(t),l=(o||t).length,p=n>0?0:l-1;for(s||(a=t[o?o[p]:p],p+=n);p>=0&&p<l;p+=n){var y=o?o[p]:p;a=r(a,t[y],y,t)}return a};return function(t,r,a,s){var o=arguments.length>=3;return e(t,pa(r,s,4),a,o)}}const Kc=Vg(1),$g=Vg(-1);function li(n,e,t){var r=[];return e=Dt(e,t),mn(n,function(a,s,o){e(a,s,o)&&r.push(a)}),r}function G6(n,e,t){return li(n,Zc(Dt(e)),t)}function Lg(n,e,t){e=Dt(e,t);for(var r=!wt(n)&&We(n),a=(r||n).length,s=0;s<a;s++){var o=r?r[s]:s;if(!e(n[o],o,n))return!1}return!0}function Gg(n,e,t){e=Dt(e,t);for(var r=!wt(n)&&We(n),a=(r||n).length,s=0;s<a;s++){var o=r?r[s]:s;if(e(n[o],o,n))return!0}return!1}function Tn(n,e,t,r){return wt(n)||(n=si(n)),(typeof t!="number"||r)&&(t=0),Ng(n,e,t)>=0}const F6=It(function(n,e,t){var r,a;return ht(e)?a=e:(e=da(e),r=e.slice(0,-1),e=e[e.length-1]),pr(n,function(s){var o=a;if(!o){if(r&&r.length&&(s=qc(s,r)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function ed(n,e){return pr(n,Wc(e))}function U6(n,e){return li(n,ua(e))}function Fg(n,e,t){var r=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=wt(n)?n:si(n);for(var l=0,p=n.length;l<p;l++)s=n[l],s!=null&&s>r&&(r=s)}else e=Dt(e,t),mn(n,function(y,f,m){o=e(y,f,m),(o>a||o===-1/0&&r===-1/0)&&(r=y,a=o)});return r}function x6(n,e,t){var r=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=wt(n)?n:si(n);for(var l=0,p=n.length;l<p;l++)s=n[l],s!=null&&s<r&&(r=s)}else e=Dt(e,t),mn(n,function(y,f,m){o=e(y,f,m),(o<a||o===1/0&&r===1/0)&&(r=y,a=o)});return r}var j6=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ug(n){return n?dr(n)?sa.call(n):Nc(n)?n.match(j6):wt(n)?pr(n,Jc):si(n):[]}function xg(n,e,t){if(e==null||t)return wt(n)||(n=si(n)),n[Yc(n.length-1)];var r=Ug(n),a=Pt(r);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var l=Yc(o,s),p=r[o];r[o]=r[l],r[l]=p}return r.slice(0,e)}function k6(n){return xg(n,1/0)}function q6(n,e,t){var r=0;return e=Dt(e,t),ed(pr(n,function(a,s,o){return{value:a,index:r++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,l=s.criteria;if(o!==l){if(o>l||o===void 0)return 1;if(o<l||l===void 0)return-1}return a.index-s.index}),"value")}function zs(n,e){return function(t,r,a){var s=e?[[],[]]:{};return r=Dt(r,a),mn(t,function(o,l){var p=r(o,l,t);n(s,o,p)}),s}}const J6=zs(function(n,e,t){Gn(n,t)?n[t].push(e):n[t]=[e]}),W6=zs(function(n,e,t){n[t]=e}),H6=zs(function(n,e,t){Gn(n,t)?n[t]++:n[t]=1}),Y6=zs(function(n,e,t){n[t?0:1].push(e)},!0);function z6(n){return n==null?0:wt(n)?n.length:We(n).length}function Z6(n,e,t){return e in t}const jg=It(function(n,e){var t={},r=e[0];if(n==null)return t;ht(r)?(e.length>1&&(r=pa(r,e[1])),e=ca(n)):(r=Z6,e=ur(e,!1,!1),n=Object(n));for(var a=0,s=e.length;a<s;a++){var o=e[a],l=n[o];r(l,o,n)&&(t[o]=l)}return t}),X6=It(function(n,e){var t=e[0],r;return ht(t)?(t=Zc(t),e.length>1&&(r=e[1])):(e=pr(ur(e,!1,!1),String),t=function(a,s){return!Tn(e,s)}),jg(n,t,r)});function kg(n,e,t){return sa.call(n,0,Math.max(0,n.length-(e==null||t?1:e)))}function td(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[0]:kg(n,n.length-e)}function Zs(n,e,t){return sa.call(n,e==null||t?1:e)}function Q6(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[n.length-1]:Zs(n,Math.max(0,n.length-e))}function K6(n){return li(n,Boolean)}function e9(n,e){return ur(n,e,!1)}const qg=It(function(n,e){return e=ur(e,!0,!0),li(n,function(t){return!Tn(e,t)})}),t9=It(function(n,e){return qg(n,e)});function nd(n,e,t,r){zb(e)||(r=t,t=e,e=!1),t!=null&&(t=Dt(t,r));for(var a=[],s=[],o=0,l=Pt(n);o<l;o++){var p=n[o],y=t?t(p,o,n):p;e&&!t?((!o||s!==y)&&a.push(p),s=y):t?Tn(s,y)||(s.push(y),a.push(p)):Tn(a,p)||a.push(p)}return a}const n9=It(function(n){return nd(ur(n,!0,!0))});function r9(n){for(var e=[],t=arguments.length,r=0,a=Pt(n);r<a;r++){var s=n[r];if(!Tn(e,s)){var o;for(o=1;o<t&&Tn(arguments[o],s);o++);o===t&&e.push(s)}}return e}function rd(n){for(var e=n&&Fg(n,Pt).length||0,t=Array(e),r=0;r<e;r++)t[r]=ed(n,r);return t}const i9=It(rd);function a9(n,e){for(var t={},r=0,a=Pt(n);r<a;r++)e?t[n[r]]=e[r]:t[n[r][0]]=n[r][1];return t}function s9(n,e,t){e==null&&(e=n||0,n=0),t||(t=e<n?-1:1);for(var r=Math.max(Math.ceil((e-n)/t),0),a=Array(r),s=0;s<r;s++,n+=t)a[s]=n;return a}function o9(n,e){if(e==null||e<1)return[];for(var t=[],r=0,a=n.length;r<a;)t.push(sa.call(n,r,r+=e));return t}function id(n,e){return n._chain?te(e).chain():e}function Jg(n){return mn(jc(n),function(e){var t=te[e]=n[e];te.prototype[e]=function(){var r=[this._wrapped];return _8.apply(r,arguments),id(this,t.apply(te,r))}}),te}mn(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=Js[n];te.prototype[n]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(n==="shift"||n==="splice")&&t.length===0&&delete t[0]),id(this,t)}}),mn(["concat","join","slice"],function(n){var e=Js[n];te.prototype[n]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),id(this,t)}});var Wg=Jg(Object.freeze(Object.defineProperty({__proto__:null,VERSION:Fb,after:N6,all:Lg,allKeys:ca,any:Gg,assign:Ys,before:Og,bind:Ag,bindAll:S6,chain:A6,chunk:o9,clone:l6,collect:pr,compact:K6,compose:M6,constant:rg,contains:Tn,countBy:H6,create:o6,debounce:w6,default:te,defaults:Tg,defer:C6,delay:Sg,detect:Qc,difference:qg,drop:Zs,each:mn,escape:h6,every:Lg,extend:mg,extendOwn:Ys,filter:li,find:Qc,findIndex:Xc,findKey:Cg,findLastIndex:wg,findWhere:L6,first:td,flatten:e9,foldl:Kc,foldr:$g,forEach:mn,functions:jc,get:bg,groupBy:J6,has:d6,head:td,identity:Jc,include:Tn,includes:Tn,indexBy:W6,indexOf:Ng,initial:kg,inject:Kc,intersection:r9,invert:fg,invoke:F6,isArguments:Lc,isArray:dr,isArrayBuffer:Qb,isBoolean:zb,isDataView:Ws,isDate:x8,isElement:U8,isEmpty:la,isEqual:Q8,isError:k8,isFinite:H8,isFunction:ht,isMap:t6,isMatch:lg,isNaN:ng,isNull:F8,isNumber:Zb,isObject:Ln,isRegExp:j8,isSet:r6,isString:Nc,isSymbol:Xb,isTypedArray:sg,isUndefined:Yb,isWeakMap:n6,isWeakSet:i6,iteratee:Hc,keys:We,last:Q6,lastIndexOf:$6,map:pr,mapObject:u6,matcher:ua,matches:ua,max:Fg,memoize:O6,methods:jc,min:x6,mixin:Jg,negate:Zc,noop:vg,now:ya,object:a9,omit:X6,once:V6,pairs:a6,partial:oi,partition:Y6,pick:jg,pluck:ed,property:Wc,propertyOf:p6,random:Yc,range:s9,reduce:Kc,reduceRight:$g,reject:G6,rest:Zs,restArguments:It,result:I6,sample:xg,select:li,shuffle:k6,size:z6,some:Gg,sortBy:q6,sortedIndex:_g,tail:Zs,take:td,tap:c6,template:v6,templateSettings:T6,throttle:B6,times:y6,toArray:Ug,toPath:Rg,transpose:rd,unescape:m6,union:n9,uniq:nd,unique:nd,uniqueId:D6,unzip:rd,values:si,where:U6,without:t9,wrap:_6,zip:i9},Symbol.toStringTag,{value:"Module"})));Wg._=Wg;function Xs(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Hg(n){return n.charAt(0).toLowerCase()+n.slice(1)}function Yg(n,e){if(n.type!==i.Property||e.type!==i.Property)throw new Error(`Expected property entities for comparison. But got ${n.type} and ${e.type}.`);return n===e||n.id===e.id?!0:n.name!==e.name||n.static!==e.static||n.abstract!==e.abstract?!1:ft(n.dataType,e.dataType).compatible}function zg(n,e){if(n.type!==i.CustomEntity||e.type!==i.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${n.type} and ${e.type}.`);if(n===e||n.id===e.id)return!0;if(n.properties.length!==e.properties.length)return!1;let t=[...e.properties];const r=[];for(let a=0;a<n.properties.length;a++){const s=n.properties[a];t.find(l=>{const p=Yg(s,l);return p&&(t=t.filter(y=>y.id!==l.id)),p})||r.push(s)}return!(r.length>0)}var Lt=(n=>(n.BothUnconstrained="both-unconstrained",n.AConstraintBUnconstrained="a-constraint-b-unconstrained",n.BConstraintAUnconstrained="b-constraint-a-unconstrained",n.Same="same",n.AIsListBIsNot="a-is-list-b-is-not",n.BIsListAIsNot="b-is-list-a-is-not",n.AIsNullableBIsNot="a-is-nullable-b-is-not",n.BIsNullableAIsNot="b-is-nullable-a-is-not",n.AIsTemplateBIsNot="a-is-template-b-is-not",n.BIsTemplateAIsNot="b-is-template-a-is-not",n.BothUntyped="both-untyped",n.AIsUntypedBIsNot="a-is-untyped-b-is-not",n.BIsUntypedAIsNot="b-is-untyped-a-is-not",n.TypeEntityMismatch="type-entity-mismatch",n.SameCustomEntities="same-custom-entities",n.CompatibleCustomEntities="compatible-custom-entities",n.IncompatibleCustomEntities="incompatible-custom-entities",n.SamePrimitiveEntities="same-primitive-entities",n.IncompatiblePrimitiveEntities="incompatible-primitive-entities",n.SameBuiltInBaseEntities="same-built-in-base-entities",n.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",n.CheckUnknown="check-unknown",n))(Lt||{});function ft(n,e){var t,r,a,s,o,l,p,y,f,m,b;if(n&&n.type!==i.DataType||e&&e.type!==i.DataType)throw new Error(`Expected data-type entities for comparison. But got ${n==null?void 0:n.type} and ${e==null?void 0:e.type}.`);if(n===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(n===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(n===e)return{compatible:!0,type:"same"};if(n.id===e.id)return{compatible:!0,type:"same"};if(n.isList!==e.isList)return{compatible:!1,type:n.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(n.isNullable!==e.isNullable)return{compatible:!1,type:n.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(n.asType!==e.asType)return{compatible:!1,type:n.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!n.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(n.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!n.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=n.entity)==null?void 0:t.type)!==((r=e.entity)==null?void 0:r.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=n.entity)==null?void 0:a.type)===i.CustomEntity){if(((s=n.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const g=zg(n.entity,e.entity);return{compatible:g,type:g?"compatible-custom-entities":"incompatible-custom-entities"}}return((l=n.entity)==null?void 0:l.type)===i.PrimitiveEntity?((p=n.entity)==null?void 0:p.id)===((y=e.entity)==null?void 0:y.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((f=n.entity)==null?void 0:f.type)===i.BuiltInBaseEntity?((m=n.entity)==null?void 0:m.id)===((b=e.entity)==null?void 0:b.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function l9(n){const e=n.project.builtInBaseEntities.find(a=>a.id===N.EXECUTION),t={id:n.id+"--infered-data-type",version:1,type:i.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},r=R(t,n.project);return r.inferred=!0,r.sync(t),r.setParent(n),r.entity=e,r}function Zg(n){return n.dataType?n.dataType:null}function Xg(n){var e;return(e=n.declaration)!=null&&e.dataType?n.declaration.dataType:n.readsValue?en(n.readsValue):null}function ad(n){return n.dataType&&!n.dataType.inferred&&n.dataType.isResolved()?n.dataType:n.readsValue?en(n.readsValue):null}function Qg(n){return en(n.declaration)}function Kg(n){return n.dataType&&!n.dataType.inferred?n.dataType:(n.dataType&&n.dataType.inferred,n.inferDataTypeAndSyncInstancesInputsAndOutputs(),n.dataType)}function ev(n){var e;return((e=n.declaration)==null?void 0:e.dataType)||null}function en(n){switch(n.type){case i.VariableDeclaration:return Kg(n);case i.ArgumentDeclaration:return Zg(n);case i.ReturnDeclaration:return ad(n);case i.VariableInstance:return Qg(n);case i.InputMap:return Xg(n);case i.OutputMap:return ev(n);default:throw new Error(`Cannot infer data type from entity of type ${n.type}.`)}}function Qs(n){switch(n.type){case i.ArgumentDeclaration:return n.getDataType();case i.InputMap:return n.getDataType();case i.VariableDeclaration:return n.getDataType();case i.VariableInstance:return n.getDataType();case i.OutputMap:return n.getDataType();case i.ReturnDeclaration:return n.getDataType();case i.Property:return n.getDataType();case i.ValueDescriptor:return n.getDataType();default:return null}}function O(n){if(n){let e=null;return typeof n=="string"?e=n:n.entityId?e=n.entityId:n.type!==i.GenericReference&&(e=n.id),e}return null}function yr(n){return n.declaration||n}function c9(n){return n.type===i.VariableDeclaration?n.parent===n.project?"global-declaration":"local-declaration":n.declaration.parent===n.project?"global-instance":"local-instance"}function sd(n,e){const t=[];if(n.type===i.Project)t.push(...n.variableDeclarations);else{const a=Tt(De(n)).filter(s=>s.type===i.VariableDeclaration);t.push(...a),n.parent&&(lt.includes(n.parent.type)||n.parent.type===i.Project)&&t.push(...sd(n.parent))}return t}function d9(n){return n.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,t){return t===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}function u9(n){return n.split(/\s+/).map(r=>r[0].toUpperCase()+r.slice(1).toLowerCase()).join("")}function tv(n){var e;return(e=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")}function Ks(n){return tv(n).toLowerCase()}function hr(n,e=!0){if(!(n!=null&&n.dataType))return"Any data type";if(!n.dataType.entity)return n.dataType.isList?"List of an unknown data type":"Unknown data type";if(n.dataType.entity.type===i.PrimitiveEntity){let t=n.dataType.entity.name;switch(n.dataType.entity.name){case D.String:t="Text";break;case D.JSON:t=e?"Any data structure":"Unknown data structure";break;default:t=n.dataType.entity.name;break}return n.dataType.isList?`List of ${t}s`:`${t.slice(0,1).toUpperCase()}${t.slice(1)}`}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function nv(n){return hr(n.declaration)}function p9(n){return n.type===i.VariableInstance?nv(n):hr(n)}function rv(n){if(!n)return"Any data type";if(!n.entity)return"Inherited";if(n.entity.type===i.PrimitiveEntity){const e=n.entity.name===D.String?"Text":n.entity.name;return n.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.entity.type===i.CustomEntity){const e=ld(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.entity.type===i.BuiltInBaseEntity){const e=od(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.isList?`List of ${n.entity.name} entities`:`${n.entity.name.slice(0,1).toUpperCase()+n.entity.name.slice(1)} entity`}function iv(n){if(!n.dataType)return"Any data type";if(!n.dataType.entity)return"Inherited";if(n.dataType.entity.type===i.PrimitiveEntity){const e=n.dataType.entity.name===D.String?"Text":n.dataType.entity.name;return n.dataType.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.dataType.entity.type===i.CustomEntity){const e=ld(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.dataType.entity.type===i.BuiltInBaseEntity){const e=od(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function av(n){switch(n.type){case i.Property:return iv(n);case i.VariableDeclaration:return hr(n);case i.ArgumentDeclaration:return hr(n,!1);case i.InputMap:{const e=n.declaration;return e?av(e):"Unknown data type"}case i.ReturnDeclaration:return hr(n,!1);case i.OutputMap:{const e=n.declaration;return hr(e,!1)}}return"Unknown data type"}function eo(n){switch(n.declaration.id){case Be.Equal:return"is equal to";case Be.NotEqual:return"is not equal to";case Be.MoreThan:return"is greater than";case Be.MoreThanOrEqual:return"is greater than or equal to";case Be.LessThan:return"is less than";case Be.LessThanOrEqual:return"is less than or equal to";case Be.And:return"and";case Be.Or:return"or";case Nt.Empty:return"is empty";case Nt.NotEmpty:return"is not empty"}}function sv(n){return n.includes(N.HTTP_ENDPOINT)?"HTTP endpoint":n.includes(N.PERSISTED_ENTITY)?"Persisted entity":n.includes(N.CRON_JOB)?"Scheduled execution":n.includes(N.RELATIONAL_DATABASE)?"Relational database":"Entity"}function od(n){switch(n.name){case N.HTTP_ENDPOINT:return"HTTP endpoint";case N.PERSISTED_ENTITY:return"Persisted entity";case N.CRON_JOB:return"Scheduled execution";case N.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function ld(n){const e=kv(n);if(!e){const t=xv(n);return t.includes(N.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(N.PERSISTED_ENTITY)?"Persisted entity":t.includes(N.CRON_JOB)?"Scheduled execution":t.includes(N.RELATIONAL_DATABASE)?"Relational database":P(n,n.project)+" entity"}return P(e,n.project)+" entity"}function ov(n){let e="Find ";return n.outputsDeclarations.forEach((t,r)=>{const a=Qs(t),s=Hg(a&&a.entity?P(a.entity,n.project):"unstructured data");r===0?e+=`${s} `:r===n.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function lv(n){switch(n.name){case D.String:return"Text";case D.Number:return"Number";case D.Boolean:return"Boolean";case D.JSON:return"Data structure";case D.UUID:return"Unique identifier";case D.Date:return"Date";case D.EntityTemplate:return"Entity as template";case D.Enum:return"Enumeration";case D.File:return"File";case D.Null:return"Empty";case D.ActionDescriptor:return"Action descriptor";default:return n.name}}function cv(n){switch(n.id){case Q.List:return"Loop over list items";case Q.ManualFlow:return"Manual flow control loop";case Q.ObjectKeys:return"Loop over object keys";case Q.ObjectValues:return"Loop over object values";case Q.Counted:return"Loop given number of times";case Q.String:return"Loop over text characters";case ot.Addition:return"Sum numbers";case ot.Substraction:return"Subtract numbers";case ot.Multiplication:return"Multiply numbers";case ot.Division:return"Divide numbers";case ot.Remainder:return"Get remainder of numbers";case ot.Exponentiation:return"Get exponent of numbers";case Pe.AddIndex:return"Add at index position";case Pe.DeleteFirst:return"Delete first character";case Pe.DeleteLast:return"Delete last character";case Pe.DeleteIndex:return"Delete at index position";case Pe.Join:return"Join texts";case Pe.ReplaceAllMatches:return"Replace all matches";case Pe.ReplaceFirst:return"Replace first match";case Pe.ReplaceLast:return"Replace last match";case Pe.Split:return"Split text";case Pe.ReplaceIndex:return"Replace at index position";case Pe.ReplaceSingleMatch:return"Replace single match";case Pe.GetFirst:return"Get first character";case Pe.GetLast:return"Get last character";case Pe.GetIndex:return"Get at index position";case Pe.Append:return"Add at the end";case Pe.Prepend:return"Add at the start";case Ae.Wait:return"Wait";case Ae.Parallel:return"Run in parallel";case Ae.Sequential:return"Run in sequence";case Ye.HttpRequest:return"HTTP request";case Qe.CreateNewInstance:return"Create new copy of entity";case k.AddIndex:return"Add item at index position";case k.DeleteFirst:return"Delete first item";case k.DeleteLast:return"Delete last item";case k.DeleteIndex:return"Delete item at index position";case k.Join:return"Join lists";case k.ReplaceAllMatches:return"Replace all matches";case k.ReplaceFirst:return"Replace first match";case k.ReplaceLast:return"Replace last match";case k.Split:return"Split list";case k.ReplaceIndex:return"Replace at index position";case k.ReplaceSingleMatch:return"Replace single match";case k.GetFirst:return"Get first item";case k.GetLast:return"Get last item";case k.GetIndex:return"Get item at index position";case k.Append:return"Add item at the end";case k.Prepend:return"Add item at the start";case rn.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(n.name.slice(0,1).toUpperCase()+n.name.slice(1)).replaceAll("-"," ")}}function P(n,e){var t;if(i.FunctionDeclaration===n.type){const r=n.name;if(Object.values(St).includes(r))switch(r){case St.AbortExecution:return"Abort execution";case St.DeletePersistedEntity:return"Delete persisted entity";case St.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Xs(n.type).replaceAll("-"," ")}return r}if(i.BuiltInBaseEntity===n.type)return sv([n.name]);if(xd.includes(n.type)&&n.type!==i.ActionDescriptor)return n.name;switch(n.type){case i.Search:return ov(n);case i.Operation:case i.InternalCall:case i.Loop:const r=Mt(n.declaration,e);return P(r,e);case i.ActionDescriptor:return cv(n);case i.BreakStatement:const a=Mt(n.parent,e);return`Stop loop ${P(a,e)}`;case i.ContinueStatement:const s=Mt(n.parent,e);return`Execute next iteration of ${P(s,e)}`;case i.FunctionCall:return Mt(n.declaration,e).name;case i.Condition:{const l=n;if((t=n.inputs)!=null&&t.length){const p=P(l.inputs[0],l.project);if(l.inputs[1]){const y=l.inputs[1].declaration.name;return`If ${p} ${eo(l)} ${y}`}return`If ${p} ${eo(l)}`}else return`If ${eo(l)}`}case i.ReturnStatement:{const l=Mt(n.parent,e);return`Output of ${P(l,e)}`}case i.InputMap:if(n.declaration){const l=Mt(n.declaration,e);return P(l,e)||""}else return n.name||"";case i.VariableInstance:{const l=Mt(n.declaration,e);return P(l,e)||""}case i.OutputMap:if(n.declaration){const l=Mt(n.declaration,e);return(l==null?void 0:l.name)||""}else return"";case i.PrimitiveEntity:case i.PrimitiveValue:return lv(n);default:return Xs(n.type).replaceAll("-"," ")}}function to(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${I.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:I.EmptyName,issue:null}));const r=e.entities.filter(a=>a.name===n.name);return r.length&&t.push(new E({id:`${n.id}--${I.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in the project. Entity with id "${r[0].id}" has the same name.
|
|
13
|
+
`+s+"}",p}function I6(n,e,t){e=da(e);var r=e.length;if(!r)return ht(t)?t.call(n):t;for(var a=0;a<r;a++){var s=n==null?void 0:n[e[a]];s===void 0&&(s=t,a=r),n=ht(s)?s.call(n):s}return n}var D6=0;function P6(n){var e=++D6+"";return n?n+e:e}function A6(n){var e=te(n);return e._chain=!0,e}function Pg(n,e,t,r,a){if(!(r instanceof e))return n.apply(t,a);var s=Eg(n.prototype),o=n.apply(s,a);return Ln(o)?o:s}var oi=vt(function(n,e){var t=oi.placeholder,r=function(){for(var a=0,s=e.length,o=Array(s),l=0;l<s;l++)o[l]=e[l]===t?arguments[a++]:e[l];for(;a<arguments.length;)o.push(arguments[a++]);return Pg(n,r,this,this,o)};return r});oi.placeholder=te;const Ag=vt(function(n,e,t){if(!ht(n))throw new TypeError("Bind must be called on a function");var r=vt(function(a){return Pg(n,r,e,this,t.concat(a))});return r}),Bt=ig(It);function ur(n,e,t,r){if(r=r||[],!e&&e!==0)e=1/0;else if(e<=0)return r.concat(n);for(var a=r.length,s=0,o=It(n);s<o;s++){var l=n[s];if(Bt(l)&&(dr(l)||Lc(l)))if(e>1)ur(l,e-1,t,r),a=r.length;else for(var p=0,y=l.length;p<y;)r[a++]=l[p++];else t||(r[a++]=l)}return r}const S6=vt(function(n,e){e=ur(e,!1,!1);var t=e.length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var r=e[t];n[r]=Ag(n[r],n)}return n});function O6(n,e){var t=function(r){var a=t.cache,s=""+(e?e.apply(this,arguments):r);return Gn(a,s)||(a[s]=n.apply(this,arguments)),a[s]};return t.cache={},t}const Sg=vt(function(n,e,t){return setTimeout(function(){return n.apply(null,t)},e)}),C6=oi(Sg,te,1);function B6(n,e,t){var r,a,s,o,l=0;t||(t={});var p=function(){l=t.leading===!1?0:ya(),r=null,o=n.apply(a,s),r||(a=s=null)},y=function(){var f=ya();!l&&t.leading===!1&&(l=f);var m=e-(f-l);return a=this,s=arguments,m<=0||m>e?(r&&(clearTimeout(r),r=null),l=f,o=n.apply(a,s),r||(a=s=null)):!r&&t.trailing!==!1&&(r=setTimeout(p,m)),o};return y.cancel=function(){clearTimeout(r),l=0,r=a=s=null},y}function w6(n,e,t){var r,a,s,o,l,p=function(){var f=ya()-a;e>f?r=setTimeout(p,e-f):(r=null,t||(o=n.apply(l,s)),r||(s=l=null))},y=vt(function(f){return l=this,s=f,a=ya(),r||(r=setTimeout(p,e),t&&(o=n.apply(l,s))),o});return y.cancel=function(){clearTimeout(r),r=s=l=null},y}function M6(n,e){return oi(e,n)}function Zc(n){return function(){return!n.apply(this,arguments)}}function _6(){var n=arguments,e=n.length-1;return function(){for(var t=e,r=n[e].apply(this,arguments);t--;)r=n[t].call(this,r);return r}}function N6(n,e){return function(){if(--n<1)return e.apply(this,arguments)}}function Og(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}}const V6=oi(Og,2);function Cg(n,e,t){e=Dt(e,t);for(var r=We(n),a,s=0,o=r.length;s<o;s++)if(a=r[s],e(n[a],a,n))return a}function Bg(n){return function(e,t,r){t=Dt(t,r);for(var a=It(e),s=n>0?0:a-1;s>=0&&s<a;s+=n)if(t(e[s],s,e))return s;return-1}}const Xc=Bg(1),wg=Bg(-1);function Mg(n,e,t,r){t=Dt(t,r,1);for(var a=t(e),s=0,o=It(n);s<o;){var l=Math.floor((s+o)/2);t(n[l])<a?s=l+1:o=l}return s}function _g(n,e,t){return function(r,a,s){var o=0,l=It(r);if(typeof s=="number")n>0?o=s>=0?s:Math.max(s+l,o):l=s>=0?Math.min(s+1,l):s+l+1;else if(t&&s&&l)return s=t(r,a),r[s]===a?s:-1;if(a!==a)return s=e(sa.call(r,o,l),ng),s>=0?s+o:-1;for(s=n>0?o:l-1;s>=0&&s<l;s+=n)if(r[s]===a)return s;return-1}}const Ng=_g(1,Xc,Mg),$6=_g(-1,wg);function Qc(n,e,t){var r=Bt(n)?Xc:Cg,a=r(n,e,t);if(a!==void 0&&a!==-1)return n[a]}function L6(n,e){return Qc(n,ua(e))}function mn(n,e,t){e=pa(e,t);var r,a;if(Bt(n))for(r=0,a=n.length;r<a;r++)e(n[r],r,n);else{var s=We(n);for(r=0,a=s.length;r<a;r++)e(n[s[r]],s[r],n)}return n}function pr(n,e,t){e=Dt(e,t);for(var r=!Bt(n)&&We(n),a=(r||n).length,s=Array(a),o=0;o<a;o++){var l=r?r[o]:o;s[o]=e(n[l],l,n)}return s}function Vg(n){var e=function(t,r,a,s){var o=!Bt(t)&&We(t),l=(o||t).length,p=n>0?0:l-1;for(s||(a=t[o?o[p]:p],p+=n);p>=0&&p<l;p+=n){var y=o?o[p]:p;a=r(a,t[y],y,t)}return a};return function(t,r,a,s){var o=arguments.length>=3;return e(t,pa(r,s,4),a,o)}}const Kc=Vg(1),$g=Vg(-1);function li(n,e,t){var r=[];return e=Dt(e,t),mn(n,function(a,s,o){e(a,s,o)&&r.push(a)}),r}function G6(n,e,t){return li(n,Zc(Dt(e)),t)}function Lg(n,e,t){e=Dt(e,t);for(var r=!Bt(n)&&We(n),a=(r||n).length,s=0;s<a;s++){var o=r?r[s]:s;if(!e(n[o],o,n))return!1}return!0}function Gg(n,e,t){e=Dt(e,t);for(var r=!Bt(n)&&We(n),a=(r||n).length,s=0;s<a;s++){var o=r?r[s]:s;if(e(n[o],o,n))return!0}return!1}function Tn(n,e,t,r){return Bt(n)||(n=si(n)),(typeof t!="number"||r)&&(t=0),Ng(n,e,t)>=0}const F6=vt(function(n,e,t){var r,a;return ht(e)?a=e:(e=da(e),r=e.slice(0,-1),e=e[e.length-1]),pr(n,function(s){var o=a;if(!o){if(r&&r.length&&(s=qc(s,r)),s==null)return;o=s[e]}return o==null?o:o.apply(s,t)})});function ed(n,e){return pr(n,Wc(e))}function U6(n,e){return li(n,ua(e))}function Fg(n,e,t){var r=-1/0,a=-1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=Bt(n)?n:si(n);for(var l=0,p=n.length;l<p;l++)s=n[l],s!=null&&s>r&&(r=s)}else e=Dt(e,t),mn(n,function(y,f,m){o=e(y,f,m),(o>a||o===-1/0&&r===-1/0)&&(r=y,a=o)});return r}function x6(n,e,t){var r=1/0,a=1/0,s,o;if(e==null||typeof e=="number"&&typeof n[0]!="object"&&n!=null){n=Bt(n)?n:si(n);for(var l=0,p=n.length;l<p;l++)s=n[l],s!=null&&s<r&&(r=s)}else e=Dt(e,t),mn(n,function(y,f,m){o=e(y,f,m),(o<a||o===1/0&&r===1/0)&&(r=y,a=o)});return r}var j6=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ug(n){return n?dr(n)?sa.call(n):Nc(n)?n.match(j6):Bt(n)?pr(n,Jc):si(n):[]}function xg(n,e,t){if(e==null||t)return Bt(n)||(n=si(n)),n[Yc(n.length-1)];var r=Ug(n),a=It(r);e=Math.max(Math.min(e,a),0);for(var s=a-1,o=0;o<e;o++){var l=Yc(o,s),p=r[o];r[o]=r[l],r[l]=p}return r.slice(0,e)}function k6(n){return xg(n,1/0)}function q6(n,e,t){var r=0;return e=Dt(e,t),ed(pr(n,function(a,s,o){return{value:a,index:r++,criteria:e(a,s,o)}}).sort(function(a,s){var o=a.criteria,l=s.criteria;if(o!==l){if(o>l||o===void 0)return 1;if(o<l||l===void 0)return-1}return a.index-s.index}),"value")}function zs(n,e){return function(t,r,a){var s=e?[[],[]]:{};return r=Dt(r,a),mn(t,function(o,l){var p=r(o,l,t);n(s,o,p)}),s}}const J6=zs(function(n,e,t){Gn(n,t)?n[t].push(e):n[t]=[e]}),W6=zs(function(n,e,t){n[t]=e}),H6=zs(function(n,e,t){Gn(n,t)?n[t]++:n[t]=1}),Y6=zs(function(n,e,t){n[t?0:1].push(e)},!0);function z6(n){return n==null?0:Bt(n)?n.length:We(n).length}function Z6(n,e,t){return e in t}const jg=vt(function(n,e){var t={},r=e[0];if(n==null)return t;ht(r)?(e.length>1&&(r=pa(r,e[1])),e=ca(n)):(r=Z6,e=ur(e,!1,!1),n=Object(n));for(var a=0,s=e.length;a<s;a++){var o=e[a],l=n[o];r(l,o,n)&&(t[o]=l)}return t}),X6=vt(function(n,e){var t=e[0],r;return ht(t)?(t=Zc(t),e.length>1&&(r=e[1])):(e=pr(ur(e,!1,!1),String),t=function(a,s){return!Tn(e,s)}),jg(n,t,r)});function kg(n,e,t){return sa.call(n,0,Math.max(0,n.length-(e==null||t?1:e)))}function td(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[0]:kg(n,n.length-e)}function Zs(n,e,t){return sa.call(n,e==null||t?1:e)}function Q6(n,e,t){return n==null||n.length<1?e==null||t?void 0:[]:e==null||t?n[n.length-1]:Zs(n,Math.max(0,n.length-e))}function K6(n){return li(n,Boolean)}function e9(n,e){return ur(n,e,!1)}const qg=vt(function(n,e){return e=ur(e,!0,!0),li(n,function(t){return!Tn(e,t)})}),t9=vt(function(n,e){return qg(n,e)});function nd(n,e,t,r){zb(e)||(r=t,t=e,e=!1),t!=null&&(t=Dt(t,r));for(var a=[],s=[],o=0,l=It(n);o<l;o++){var p=n[o],y=t?t(p,o,n):p;e&&!t?((!o||s!==y)&&a.push(p),s=y):t?Tn(s,y)||(s.push(y),a.push(p)):Tn(a,p)||a.push(p)}return a}const n9=vt(function(n){return nd(ur(n,!0,!0))});function r9(n){for(var e=[],t=arguments.length,r=0,a=It(n);r<a;r++){var s=n[r];if(!Tn(e,s)){var o;for(o=1;o<t&&Tn(arguments[o],s);o++);o===t&&e.push(s)}}return e}function rd(n){for(var e=n&&Fg(n,It).length||0,t=Array(e),r=0;r<e;r++)t[r]=ed(n,r);return t}const i9=vt(rd);function a9(n,e){for(var t={},r=0,a=It(n);r<a;r++)e?t[n[r]]=e[r]:t[n[r][0]]=n[r][1];return t}function s9(n,e,t){e==null&&(e=n||0,n=0),t||(t=e<n?-1:1);for(var r=Math.max(Math.ceil((e-n)/t),0),a=Array(r),s=0;s<r;s++,n+=t)a[s]=n;return a}function o9(n,e){if(e==null||e<1)return[];for(var t=[],r=0,a=n.length;r<a;)t.push(sa.call(n,r,r+=e));return t}function id(n,e){return n._chain?te(e).chain():e}function Jg(n){return mn(jc(n),function(e){var t=te[e]=n[e];te.prototype[e]=function(){var r=[this._wrapped];return M8.apply(r,arguments),id(this,t.apply(te,r))}}),te}mn(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=Js[n];te.prototype[n]=function(){var t=this._wrapped;return t!=null&&(e.apply(t,arguments),(n==="shift"||n==="splice")&&t.length===0&&delete t[0]),id(this,t)}}),mn(["concat","join","slice"],function(n){var e=Js[n];te.prototype[n]=function(){var t=this._wrapped;return t!=null&&(t=e.apply(t,arguments)),id(this,t)}});var Wg=Jg(Object.freeze(Object.defineProperty({__proto__:null,VERSION:Fb,after:N6,all:Lg,allKeys:ca,any:Gg,assign:Ys,before:Og,bind:Ag,bindAll:S6,chain:A6,chunk:o9,clone:l6,collect:pr,compact:K6,compose:_6,constant:rg,contains:Tn,countBy:H6,create:o6,debounce:w6,default:te,defaults:Tg,defer:C6,delay:Sg,detect:Qc,difference:qg,drop:Zs,each:mn,escape:h6,every:Lg,extend:mg,extendOwn:Ys,filter:li,find:Qc,findIndex:Xc,findKey:Cg,findLastIndex:wg,findWhere:L6,first:td,flatten:e9,foldl:Kc,foldr:$g,forEach:mn,functions:jc,get:bg,groupBy:J6,has:d6,head:td,identity:Jc,include:Tn,includes:Tn,indexBy:W6,indexOf:Ng,initial:kg,inject:Kc,intersection:r9,invert:fg,invoke:F6,isArguments:Lc,isArray:dr,isArrayBuffer:Qb,isBoolean:zb,isDataView:Ws,isDate:x8,isElement:U8,isEmpty:la,isEqual:Q8,isError:k8,isFinite:H8,isFunction:ht,isMap:t6,isMatch:lg,isNaN:ng,isNull:F8,isNumber:Zb,isObject:Ln,isRegExp:j8,isSet:r6,isString:Nc,isSymbol:Xb,isTypedArray:sg,isUndefined:Yb,isWeakMap:n6,isWeakSet:i6,iteratee:Hc,keys:We,last:Q6,lastIndexOf:$6,map:pr,mapObject:u6,matcher:ua,matches:ua,max:Fg,memoize:O6,methods:jc,min:x6,mixin:Jg,negate:Zc,noop:vg,now:ya,object:a9,omit:X6,once:V6,pairs:a6,partial:oi,partition:Y6,pick:jg,pluck:ed,property:Wc,propertyOf:p6,random:Yc,range:s9,reduce:Kc,reduceRight:$g,reject:G6,rest:Zs,restArguments:vt,result:I6,sample:xg,select:li,shuffle:k6,size:z6,some:Gg,sortBy:q6,sortedIndex:Mg,tail:Zs,take:td,tap:c6,template:v6,templateSettings:T6,throttle:B6,times:y6,toArray:Ug,toPath:Rg,transpose:rd,unescape:m6,union:n9,uniq:nd,unique:nd,uniqueId:P6,unzip:rd,values:si,where:U6,without:t9,wrap:M6,zip:i9},Symbol.toStringTag,{value:"Module"})));Wg._=Wg;function Xs(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Hg(n){return n.charAt(0).toLowerCase()+n.slice(1)}function Yg(n,e){if(n.type!==i.Property||e.type!==i.Property)throw new Error(`Expected property entities for comparison. But got ${n.type} and ${e.type}.`);return n===e||n.id===e.id?!0:n.name!==e.name||n.static!==e.static||n.abstract!==e.abstract?!1:Jt(n.dataType,e.dataType).compatible}function zg(n,e){if(n.type!==i.CustomEntity||e.type!==i.CustomEntity)throw new Error(`Expected custom entities for comparison. But got ${n.type} and ${e.type}.`);if(n===e||n.id===e.id)return!0;if(n.properties.length!==e.properties.length)return!1;let t=[...e.properties];const r=[];for(let a=0;a<n.properties.length;a++){const s=n.properties[a];t.find(l=>{const p=Yg(s,l);return p&&(t=t.filter(y=>y.id!==l.id)),p})||r.push(s)}return!(r.length>0)}var $t=(n=>(n.BothUnconstrained="both-unconstrained",n.AConstraintBUnconstrained="a-constraint-b-unconstrained",n.BConstraintAUnconstrained="b-constraint-a-unconstrained",n.Same="same",n.AIsListBIsNot="a-is-list-b-is-not",n.BIsListAIsNot="b-is-list-a-is-not",n.AIsNullableBIsNot="a-is-nullable-b-is-not",n.BIsNullableAIsNot="b-is-nullable-a-is-not",n.AIsTemplateBIsNot="a-is-template-b-is-not",n.BIsTemplateAIsNot="b-is-template-a-is-not",n.BothUntyped="both-untyped",n.AIsUntypedBIsNot="a-is-untyped-b-is-not",n.BIsUntypedAIsNot="b-is-untyped-a-is-not",n.TypeEntityMismatch="type-entity-mismatch",n.SameCustomEntities="same-custom-entities",n.CompatibleCustomEntities="compatible-custom-entities",n.IncompatibleCustomEntities="incompatible-custom-entities",n.SamePrimitiveEntities="same-primitive-entities",n.IncompatiblePrimitiveEntities="incompatible-primitive-entities",n.SameBuiltInBaseEntities="same-built-in-base-entities",n.IncompatibleBuiltInBaseEntities="incompatible-built-in-base-entities",n.CheckUnknown="check-unknown",n))($t||{});function Jt(n,e){var t,r,a,s,o,l,p,y,f,m,b;if(n&&n.type!==i.DataType||e&&e.type!==i.DataType)throw new Error(`Expected data-type entities for comparison. But got ${n==null?void 0:n.type} and ${e==null?void 0:e.type}.`);if(n===null&&e===null)return{compatible:!0,type:"both-unconstrained"};if(n===null)return{compatible:!0,type:"a-constraint-b-unconstrained"};if(e===null)return{compatible:!0,type:"b-constraint-a-unconstrained"};if(n===e)return{compatible:!0,type:"same"};if(n.id===e.id)return{compatible:!0,type:"same"};if(n.isList!==e.isList)return{compatible:!1,type:n.isList?"a-is-list-b-is-not":"b-is-list-a-is-not"};if(n.isNullable!==e.isNullable)return{compatible:!1,type:n.isNullable?"a-is-nullable-b-is-not":"b-is-nullable-a-is-not"};if(n.asType!==e.asType)return{compatible:!1,type:n.asType?"a-is-template-b-is-not":"b-is-template-a-is-not"};if(!n.entity&&e.entity)return{compatible:!0,type:"a-is-untyped-b-is-not"};if(n.entity&&!e.entity)return{compatible:!0,type:"b-is-untyped-a-is-not"};if(!n.entity&&!e.entity)return{compatible:!0,type:"both-untyped"};if(((t=n.entity)==null?void 0:t.type)!==((r=e.entity)==null?void 0:r.type))return{compatible:!1,type:"type-entity-mismatch"};if(((a=n.entity)==null?void 0:a.type)===i.CustomEntity){if(((s=n.entity)==null?void 0:s.id)===((o=e.entity)==null?void 0:o.id))return{compatible:!0,type:"same-custom-entities"};const g=zg(n.entity,e.entity);return{compatible:g,type:g?"compatible-custom-entities":"incompatible-custom-entities"}}return((l=n.entity)==null?void 0:l.type)===i.PrimitiveEntity?((p=n.entity)==null?void 0:p.id)===((y=e.entity)==null?void 0:y.id)?{compatible:!0,type:"same-primitive-entities"}:{compatible:!1,type:"incompatible-primitive-entities"}:((f=n.entity)==null?void 0:f.type)===i.BuiltInBaseEntity?((m=n.entity)==null?void 0:m.id)===((b=e.entity)==null?void 0:b.id)?{compatible:!0,type:"same-built-in-base-entities"}:{compatible:!1,type:"incompatible-built-in-base-entities"}:{compatible:!1,type:"check-unknown"}}function l9(n){const e=n.project.builtInBaseEntities.find(a=>a.id===N.EXECUTION),t={id:n.id+"--infered-data-type",version:1,type:i.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:null},r=R(t,n.project);return r.inferred=!0,r.sync(t),r.setParent(n),r.entity=e,r}function Zg(n){return n.dataType?n.dataType:null}function Xg(n){var e;return(e=n.declaration)!=null&&e.dataType?n.declaration.dataType:n.readsValue?en(n.readsValue):null}function ad(n){return n.dataType&&!n.dataType.inferred&&n.dataType.isResolved()?n.dataType:n.readsValue?en(n.readsValue):null}function Qg(n){return en(n.declaration)}function Kg(n){return n.dataType&&!n.dataType.inferred?n.dataType:(n.dataType&&n.dataType.inferred,n.inferDataTypeAndSyncInstancesInputsAndOutputs(),n.dataType)}function ev(n){var e;return((e=n.declaration)==null?void 0:e.dataType)||null}function en(n){switch(n.type){case i.VariableDeclaration:return Kg(n);case i.ArgumentDeclaration:return Zg(n);case i.ReturnDeclaration:return ad(n);case i.VariableInstance:return Qg(n);case i.InputMap:return Xg(n);case i.OutputMap:return ev(n);default:throw new Error(`Cannot infer data type from entity of type ${n.type}.`)}}function Qs(n){switch(n.type){case i.ArgumentDeclaration:return n.getDataType();case i.InputMap:return n.getDataType();case i.VariableDeclaration:return n.getDataType();case i.VariableInstance:return n.getDataType();case i.OutputMap:return n.getDataType();case i.ReturnDeclaration:return n.getDataType();case i.Property:return n.getDataType();case i.ValueDescriptor:return n.getDataType();default:return null}}function O(n){if(n){let e=null;return typeof n=="string"?e=n:n.entityId?e=n.entityId:n.type!==i.GenericReference&&(e=n.id),e}return null}function yr(n){return n.declaration||n}function c9(n){return n.type===i.VariableDeclaration?n.parent===n.project?"global-declaration":"local-declaration":n.declaration.parent===n.project?"global-instance":"local-instance"}function sd(n,e){const t=[];if(n.type===i.Project)t.push(...n.variableDeclarations);else{const a=mt(Pe(n)).filter(s=>s.type===i.VariableDeclaration);t.push(...a),n.parent&&(lt.includes(n.parent.type)||n.parent.type===i.Project)&&t.push(...sd(n.parent))}return t}function d9(n){return n.replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,t){return t===0?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}function u9(n){return n.split(/\s+/).map(r=>r[0].toUpperCase()+r.slice(1).toLowerCase()).join("")}function tv(n){var e;return(e=n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")}function Ks(n){return tv(n).toLowerCase()}function hr(n,e=!0){if(!(n!=null&&n.dataType))return"Any data type";if(!n.dataType.entity)return n.dataType.isList?"List of an unknown data type":"Unknown data type";if(n.dataType.entity.type===i.PrimitiveEntity){let t=n.dataType.entity.name;switch(n.dataType.entity.name){case D.String:t="Text";break;case D.JSON:t=e?"Any data structure":"Unknown data structure";break;default:t=n.dataType.entity.name;break}return n.dataType.isList?`List of ${t}s`:`${t.slice(0,1).toUpperCase()}${t.slice(1)}`}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function nv(n){return hr(n.declaration)}function p9(n){return n.type===i.VariableInstance?nv(n):hr(n)}function rv(n){if(!n)return"Any data type";if(!n.entity)return"Inherited";if(n.entity.type===i.PrimitiveEntity){const e=n.entity.name===D.String?"Text":n.entity.name;return n.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.entity.type===i.CustomEntity){const e=ld(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.entity.type===i.BuiltInBaseEntity){const e=od(n.entity);return n.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.isList?`List of ${n.entity.name} entities`:`${n.entity.name.slice(0,1).toUpperCase()+n.entity.name.slice(1)} entity`}function iv(n){if(!n.dataType)return"Any data type";if(!n.dataType.entity)return"Inherited";if(n.dataType.entity.type===i.PrimitiveEntity){const e=n.dataType.entity.name===D.String?"Text":n.dataType.entity.name;return n.dataType.isList?`List of ${e}s`:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}else if(n.dataType.entity.type===i.CustomEntity){const e=ld(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else if(n.dataType.entity.type===i.BuiltInBaseEntity){const e=od(n.dataType.entity);return n.dataType.isList?`List of ${e} entities`:e.slice(0,1).toUpperCase()+e.slice(1)}else return n.dataType.isList?`List of ${n.dataType.entity.name} entities`:`${n.dataType.entity.name.slice(0,1).toUpperCase()+n.dataType.entity.name.slice(1)} entity`}function av(n){switch(n.type){case i.Property:return iv(n);case i.VariableDeclaration:return hr(n);case i.ArgumentDeclaration:return hr(n,!1);case i.InputMap:{const e=n.declaration;return e?av(e):"Unknown data type"}case i.ReturnDeclaration:return hr(n,!1);case i.OutputMap:{const e=n.declaration;return hr(e,!1)}}return"Unknown data type"}function eo(n){switch(n.declaration.id){case Be.Equal:return"is equal to";case Be.NotEqual:return"is not equal to";case Be.MoreThan:return"is greater than";case Be.MoreThanOrEqual:return"is greater than or equal to";case Be.LessThan:return"is less than";case Be.LessThanOrEqual:return"is less than or equal to";case Be.And:return"and";case Be.Or:return"or";case _t.Empty:return"is empty";case _t.NotEmpty:return"is not empty"}}function sv(n){return n.includes(N.HTTP_ENDPOINT)?"HTTP endpoint":n.includes(N.PERSISTED_ENTITY)?"Persisted entity":n.includes(N.CRON_JOB)?"Scheduled execution":n.includes(N.RELATIONAL_DATABASE)?"Relational database":"Entity"}function od(n){switch(n.name){case N.HTTP_ENDPOINT:return"HTTP endpoint";case N.PERSISTED_ENTITY:return"Persisted entity";case N.CRON_JOB:return"Scheduled execution";case N.RELATIONAL_DATABASE:return"Relational database"}return"Entity"}function ld(n){const e=kv(n);if(!e){const t=xv(n);return t.includes(N.HTTP_ENDPOINT)?"HTTP endpoint":t.includes(N.PERSISTED_ENTITY)?"Persisted entity":t.includes(N.CRON_JOB)?"Scheduled execution":t.includes(N.RELATIONAL_DATABASE)?"Relational database":P(n,n.project)+" entity"}return P(e,n.project)+" entity"}function ov(n){let e="Find ";return n.outputsDeclarations.forEach((t,r)=>{const a=Qs(t),s=Hg(a&&a.entity?P(a.entity,n.project):"unstructured data");r===0?e+=`${s} `:r===n.outputsDeclarations.length-1?e+=`and ${s} `:e+=`, ${s} `}),e}function lv(n){switch(n.name){case D.String:return"Text";case D.Number:return"Number";case D.Boolean:return"Boolean";case D.JSON:return"Data structure";case D.UUID:return"Unique identifier";case D.Date:return"Date";case D.EntityTemplate:return"Entity as template";case D.Enum:return"Enumeration";case D.File:return"File";case D.Null:return"Empty";case D.ActionDescriptor:return"Action descriptor";default:return n.name}}function cv(n){switch(n.id){case Q.List:return"Loop over list items";case Q.ManualFlow:return"Manual flow control loop";case Q.ObjectKeys:return"Loop over object keys";case Q.ObjectValues:return"Loop over object values";case Q.Counted:return"Loop given number of times";case Q.String:return"Loop over text characters";case ot.Addition:return"Sum numbers";case ot.Substraction:return"Subtract numbers";case ot.Multiplication:return"Multiply numbers";case ot.Division:return"Divide numbers";case ot.Remainder:return"Get remainder of numbers";case ot.Exponentiation:return"Get exponent of numbers";case De.AddIndex:return"Add at index position";case De.DeleteFirst:return"Delete first character";case De.DeleteLast:return"Delete last character";case De.DeleteIndex:return"Delete at index position";case De.Join:return"Join texts";case De.ReplaceAllMatches:return"Replace all matches";case De.ReplaceFirst:return"Replace first match";case De.ReplaceLast:return"Replace last match";case De.Split:return"Split text";case De.ReplaceIndex:return"Replace at index position";case De.ReplaceSingleMatch:return"Replace single match";case De.GetFirst:return"Get first character";case De.GetLast:return"Get last character";case De.GetIndex:return"Get at index position";case De.Append:return"Add at the end";case De.Prepend:return"Add at the start";case Ae.Wait:return"Wait";case Ae.Parallel:return"Run in parallel";case Ae.Sequential:return"Run in sequence";case Ye.HttpRequest:return"HTTP request";case Qe.CreateNewInstance:return"Create new copy of entity";case k.AddIndex:return"Add item at index position";case k.DeleteFirst:return"Delete first item";case k.DeleteLast:return"Delete last item";case k.DeleteIndex:return"Delete item at index position";case k.Join:return"Join lists";case k.ReplaceAllMatches:return"Replace all matches";case k.ReplaceFirst:return"Replace first match";case k.ReplaceLast:return"Replace last match";case k.Split:return"Split list";case k.ReplaceIndex:return"Replace at index position";case k.ReplaceSingleMatch:return"Replace single match";case k.GetFirst:return"Get first item";case k.GetLast:return"Get last item";case k.GetIndex:return"Get item at index position";case k.Append:return"Add item at the end";case k.Prepend:return"Add item at the start";case rn.PROJECT_PUBLICATION_COMPLETED:return"Project publication completed";default:return(n.name.slice(0,1).toUpperCase()+n.name.slice(1)).replaceAll("-"," ")}}function P(n,e){var t;if(i.FunctionDeclaration===n.type){const r=n.name;if(Object.values(At).includes(r))switch(r){case At.AbortExecution:return"Abort execution";case At.DeletePersistedEntity:return"Delete persisted entity";case At.SoftDeletePersistedEntity:return"Soft delete persisted entity";default:return Xs(n.type).replaceAll("-"," ")}return r}if(i.BuiltInBaseEntity===n.type)return sv([n.name]);if(xd.includes(n.type)&&n.type!==i.ActionDescriptor)return n.name;switch(n.type){case i.Search:return ov(n);case i.Operation:case i.InternalCall:case i.Loop:const r=Mt(n.declaration,e);return P(r,e);case i.ActionDescriptor:return cv(n);case i.BreakStatement:const a=Mt(n.parent,e);return`Stop loop ${P(a,e)}`;case i.ContinueStatement:const s=Mt(n.parent,e);return`Execute next iteration of ${P(s,e)}`;case i.FunctionCall:return Mt(n.declaration,e).name;case i.Condition:{const l=n;if((t=n.inputs)!=null&&t.length){const p=P(l.inputs[0],l.project);if(l.inputs[1]){const y=l.inputs[1].declaration.name;return`If ${p} ${eo(l)} ${y}`}return`If ${p} ${eo(l)}`}else return`If ${eo(l)}`}case i.ReturnStatement:{const l=Mt(n.parent,e);return`Output of ${P(l,e)}`}case i.InputMap:if(n.declaration){const l=Mt(n.declaration,e);return P(l,e)||""}else return n.name||"";case i.VariableInstance:{const l=Mt(n.declaration,e);return P(l,e)||""}case i.OutputMap:if(n.declaration){const l=Mt(n.declaration,e);return(l==null?void 0:l.name)||""}else return"";case i.PrimitiveEntity:case i.PrimitiveValue:return lv(n);default:return Xs(n.type).replaceAll("-"," ")}}function to(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${I.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:I.EmptyName,issue:null}));const r=e.entities.filter(a=>a.name===n.name);return r.length&&t.push(new E({id:`${n.id}--${I.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in the project. Entity with id "${r[0].id}" has the same name.
|
|
14
14
|
Please provide a unique 'name' string.`,severity:T.Error,code:I.NameNotUniqueInScope,issue:null})),t}function cd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${I.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:I.EmptyName,issue:null}));const r=n.parent?O(n.parent):null;let a=e;r&&(a=e.get(r));const s=[];a.type===i.CustomEntity?s.push(...a.methods.map(l=>l)):a.type===i.Project?s.push(...a.functions.map(l=>l)):a.type===i.Loop?a.body&&s.push(a.body):a.type===i.InstalledProject&&s.push(...a.functions.map(l=>l));const o=s.filter(l=>l.name===n.name);return o.length&&t.push(new E({id:`${n.id}--${I.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in ${a.type===i.Project?"the globally declared project scope":"its parent entity"}. Entity with id "${o[0].id}" has the same name.
|
|
15
15
|
Please provide a unique 'name' string.`,severity:T.Error,code:I.NameNotUniqueInScope,issue:null})),t}function dd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${I.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:I.EmptyName,issue:null}));const r=n.parent&&Mt(n.parent,e)||e;if(!r)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The 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.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const s=sd(r).filter(o=>o.name===n.name);s.length&&t.push(new E({id:`${n.id}--${I.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique in its scope or higher scopes. Entity with id "${s[0].id}" has the same name.
|
|
16
16
|
Please provide a unique 'name' string.`,severity:T.Error,code:I.NameNotUniqueInScope,issue:null}))}return t}function ud(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${I.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:I.EmptyName,issue:null}));const r=O(n.parent);if(!r)t.push(new E({id:`${n.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(r);if(!a)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=a.properties.filter(l=>l.name===n.name);o.length&&t.push(new E({id:`${n.id}--${I.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all properties in the parent entity. Entity with id "${o[0].id}" has the same name.
|
|
17
17
|
Please provide a unique 'name' string.`,severity:T.Error,code:I.NameNotUniqueInScope,issue:null}))}}return t}function pd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${I.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:I.EmptyName,issue:null}));const r=O(n.parent);if(!r)t.push(new E({id:`${n.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(r);if(!a)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=Cd(a).filter(l=>l.name===n.name);o.length&&t.push(new E({id:`${n.id}--${I.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all inputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
|
|
18
18
|
Please provide a unique 'name' string.`,severity:T.Error,code:I.NameNotUniqueInScope,issue:null}))}}return t}function yd(n,e){const t=[];n.name||t.push(new E({id:`${n.id}--${I.EmptyName}`,message:`Entity with id "${n.id}" and type "${n.type}" has an empty name. Please provide a 'name' string.`,severity:T.Error,code:I.EmptyName,issue:null}));const r=O(n.parent);if(!r)t.push(new E({id:`${n.id}--parent-reference--${h.InvalidReferenceObjectStructure}`,message:`Reference object at 'parent' property for entity with id "${n.id}" and type "${n.type}" is not a valid reference. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));else{const a=e.get(r);if(!a)t.push(new E({id:`${n.id}--parent-reference--${h.ReferencedEntityNotFound}`,message:`The entity with id '${r}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null}));else{const o=Bd(a).filter(l=>l.name===n.name);o.length&&t.push(new E({id:`${n.id}--${I.NameNotUniqueInScope}`,message:`Entity with id "${n.id}" and type "${n.type}" has a name "${n.name}" that is not unique among all outputs declared in the parent entity. Entity with id "${o[0].id}" has the same name.
|
|
19
|
-
Please provide a unique 'name' string.`,severity:T.Error,code:I.NameNotUniqueInScope,issue:null}))}}return t}function y9(n,e){switch(n.type){case i.CustomEntity:return to(n,e);case i.FunctionDeclaration:return cd(n,e);case i.VariableDeclaration:return dd(n,e);case i.Property:return ud(n,e);case i.ArgumentDeclaration:return pd(n,e);case i.ReturnDeclaration:return yd(n,e);default:return[]}}function Ze(n,e,t){const a=`${Ks(n)}-${e}-id`;return t.instances[a]?
|
|
19
|
+
Please provide a unique 'name' string.`,severity:T.Error,code:I.NameNotUniqueInScope,issue:null}))}}return t}function y9(n,e){switch(n.type){case i.CustomEntity:return to(n,e);case i.FunctionDeclaration:return cd(n,e);case i.VariableDeclaration:return dd(n,e);case i.Property:return ud(n,e);case i.ArgumentDeclaration:return pd(n,e);case i.ReturnDeclaration:return yd(n,e);default:return[]}}function Ze(n,e,t){const a=`${Ks(n)}-${e}-id`;return t.instances[a]?_.UUID.uuid():a}function hd(n,e){let t="",r=null;if(n.parent){const s=e.get(n.parent);s&&(r=s)}let a="";return r&&(a=`${Ks(P(r,e))}-`),t=`${a}${Ks(P(n,e))}-id`,e.instances[t]?_.UUID.uuid():t}function h9(n){var o;const e=F4(),t=n.toJSON();e.safeParse(t).success;const a=f9(n);(o=n.dataType)==null||o.validate();const s=[...a];if(n.id==="80c86e1b-caca-4ba5-9b1f-38f72d10e4a3"){const l=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(l.error)}return s}function f9(n){const e=[];if(!n.implements)return e;const t=n.implements;if(!t.abstract){const a=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(t,n.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});e.push(a.error)}if(n.static&&!t.static){const a=q({id:`${n.id}--${B.NonStaticPropertyImplementsStatic}`,message:`Static property "${P(n,n.project)}" with id "${n.id}" implements a non-static property "${P(t,n.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:B.NonStaticPropertyImplementsStatic,entity:n});e.push(a.error)}if(!n.static&&t.static){const a=q({id:`${n.id}--${B.StaticPropertyImplementsNonStatic}`,message:`Non-static property "${P(n,n.project)}" with id "${n.id}" implements a static property "${P(t,n.project)}" with id "${t.id}".`,issue:null,severity:T.Error,code:B.StaticPropertyImplementsNonStatic,entity:n});e.push(a.error)}if(!Jt(n.dataType,t.dataType)){const a=q({id:`${n.id}--${B.PropertyImplementsIncompatibleType}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a property "${P(t,n.project)}" with id "${t.id}" that has an incompatible data type.`,issue:null,severity:T.Error,code:B.PropertyImplementsIncompatibleType,entity:n});e.push(a.error)}return ee(n.errors,e)}function m9(n,e){const t=[];if(n.parent){const a=e.get(n.parent);if(!a)t.push(new E({id:`${n.id}--${n.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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{const s=qn(a);if(s){const o=a!==s?`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${P(s,a.project)}) higher up in the tree.`:`The entity of type '${n.type}' with id '${n.id}' have 'parent' with id '${n.parent}' because it is a built-in entity of type ${s.type}.`;t.push(new E({id:`${n.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:o,issue:null}))}else if(![i.CustomEntity].includes(a.type))t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'custom-entity'.`,issue:null}));else{const l=kn(a).filter(p=>!p.interactive);if(l.length){let p=l.length>1?`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements multiple '${i.BuiltInBaseEntity}' entities that are non-interactive ("${L(l.map(y=>P(y,y.project)),'", "','" and "')}").`:`The entity of type '${n.type}' with id '${n.id}' can't be added to the 'parent' entity with id '${a.id}' because it extends or implements a '${i.BuiltInBaseEntity}' entity that is non-interactive ("${P(l[0],l[0].project)}").`;p+=`
|
|
20
20
|
${xn}`,t.push(new E({id:`${n.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:p,issue:null}))}else if(n.implements){const p=e.get(n.implements);if(n.id===n.implements)return t.push(new E({id:`${n.id}--${n.implements}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at 'implements'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null})),t;if(!p)t.push(new E({id:`${n.id}--${n.implements}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${n.implements}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}));else{const y=a.properties.find(f=>{var m;return((m=f.implements)==null?void 0:m.id)===n.implements});y?t.push(new E({id:`${n.id}--${I.PropertyOverwrite}`,code:I.PropertyOverwrite,severity:T.Error,message:`The property with id "${n.id}" is trying to implement the property with id "${n.implements}", but the parent entity already has a property with id '${y.id}' that implements the same base property.`,issue:null})):[i.Property].includes(p.type)?p.abstract||t.push(new E({id:`${n.id}--${n.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${n.implements}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'implements' reference that isn't pointing to an entity of type 'property'.`,issue:null}))}}}}}const r=Ue(n,{},e);return t.push(...r.errors),t}const ce=class ce{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"private");c(this,"abstract");c(this,"index");c(this,"static");c(this,"required");c(this,"type",i.Property);c(this,"hidden",!1);c(this,"dataType",null);c(this,"implements",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.abstract=e.abstract,this.index=e.index,this.static=e.static,this.required=e.required||!1,this.hidden=e.hidden||!1}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r);let s=null;if(e.implements){const p=O(e.implements);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:i.Property,index:a.properties.length,private:e.private,abstract:e.abstract,static:e.static,required:e.required||!1,hidden:!1,description:e.description,implements:s,dataType:null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=m9(r,t),o=ud(r,t);return a.push(...s,...o,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
21
21
|
This is likely an incorrect strategy, 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.`,issue:null})),(e.readsValue||e.writesValue)&&t.push(new E({id:`${this.id}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' is not a value reading or writing entity.
|
|
22
|
-
${ao}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.addProperty(this),e.push(this.parent),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType){const e=R(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return 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.abstract=e.abstract||this.abstract,this.private=e.private||this.private,this.index=e.index||this.index,this.static=e.static||this.static,this.required=e.required||this.required,this.hidden=e.hidden||this.hidden,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return e||this.parent.type===i.CustomEntity&&(this.parent.removeProperty(this),r.push(this.parent)),{affected:v(r),removed:v(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.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return this.parent.type===i.CustomEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,abstract:this.abstract,hidden:this.hidden,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,implements:((t=this.implements)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+
|
|
22
|
+
${ao}`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.addProperty(this),e.push(this.parent),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.dataType){const e=R(this.initialData.dataType,this.project);e.setParent(this),e.initChildren(),this.dataType=e}if(this.initialData.implements){const e=R(this.initialData.implements,this.project);this.implements=e}return 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.abstract=e.abstract||this.abstract,this.private=e.private||this.private,this.index=e.index||this.index,this.static=e.static||this.static,this.required=e.required||this.required,this.hidden=e.hidden||this.hidden,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return e||this.parent.type===i.CustomEntity&&(this.parent.removeProperty(this),r.push(this.parent)),{affected:v(r),removed:v(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.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return this.parent.type===i.CustomEntity&&(this.parent.addProperty(this),t.push(this.parent)),{affected:t,self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,static:this.static,abstract:this.abstract,hidden:this.hidden,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,implements:((t=this.implements)==null?void 0:t.toJSON())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,hidden:this.hidden,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,implements:((t=this.implements)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r,a;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[],...((a=this.implements)==null?void 0:a.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,private:this.private,required:this.required,abstract:this.abstract,static:this.static,implements:((e=this.implements)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.dataType)==null?void 0:r.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){return this.errors=h9(this),this.errors.length,{success:!0,error:null,data:null}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,r=!0){var f;const a=t||Ze(P(this,this.project),i.Property,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,l={hidden:!1,id:a,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,private:this.private,required:this.required,abstract:this.abstract,static:this.static,dataType:null,implements:null,parent:e||this.parent},p=Ft(l,this.project);r&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",r))||null;return y&&p.setDataType(y),p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return this.dataType}};c(ce,"MUTABLE_BASE_PROPERTIES",["name","description","private","abstract","static","required"]),c(ce,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ce,"BASE_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"MUTABLE_META_PROPERTIES",[...ce.MUTABLE_BASE_PROPERTIES,"index"]),c(ce,"INMUTABLE_META_PROPERTIES",[...ce.INMUTABLE_BASE_PROPERTIES]),c(ce,"META_PROPERTIES",[...ce.MUTABLE_META_PROPERTIES,...ce.INMUTABLE_META_PROPERTIES]),c(ce,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(ce,"UPSTREAM_PROPERTIES",[...ce.MUTABLE_UPSTREAM_PROPERTIES,...ce.INMUTABLE_UPSTREAM_PROPERTIES]),c(ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),c(ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ce,"DOWNSTREAM_PROPERTIES",[...ce.MUTABLE_DOWNSTREAM_PROPERTIES,...ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ce,"PROPERTIES",[...ce.META_PROPERTIES,...ce.UPSTREAM_PROPERTIES,...ce.DOWNSTREAM_PROPERTIES]);let fr=ce;function T9(n){const e=n8(),t=n.toJSON();e.safeParse(t).success;const a=E9(n),s=R9(n),o=Pt(n);n.inputs.forEach(p=>p.validate()),o.forEach(p=>p.validate());const l=[...a,...s];if(n.id==="getCompanyByIdEndpointReachedEntityEvent"){const p=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});l.push(p.error)}return ee(n.errors,l)}function E9(n){const e=[];if(!n.calls.length){const t=q({id:`${n.id}--${B.ScopeWithoutLogic}`,message:`Action "${P(n,n.project)}" with id "${n.id}" does not have any logic defined. So it doesn't do anything.`,issue:null,severity:T.Error,code:B.ScopeWithoutLogic,entity:n});e.push(t.error)}return ee(n.errors,e)}function R9(n){const e=[];return n.implements,ee(n.errors,e)}const de=class de{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"collapsed");c(this,"private");c(this,"index",null);c(this,"type",i.FunctionDeclaration);c(this,"implements",null);c(this,"inputs",[]);c(this,"returnStatements",[]);c(this,"calls",[]);c(this,"parent");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.private=e.private,this.collapsed=e.collapsed,this.x=e.x,this.y=e.y,this.index=e.index}static fromGenerationTarget(e,t){let r=t;if(e.parent){const l=O(e.parent);r=t.get(l)}let a=null;if(e.implements){const l=O(e.implements);a=t.get(l)}const s={id:e.id,version:1,name:e.name,type:i.FunctionDeclaration,index:r.type===i.CustomEntity?r.methods.length:null,description:e.description,collapsed:!1,private:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:r},o=R(s,t);return o.setParent(r),o.initChildren(),o}static validateGenerationTarget(e,t){var f;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.Project,i.InstalledProject,i.CustomEntity,i.Loop],optional:!0},implements:{list:!1,types:[i.ActionDescriptor],optional:!0}},t);r=s.modifiedData;const o=cd(r,t),l=r.parent?t.get(r.parent):null;if(l&&l.type===i.CustomEntity){const m=l,g=kn(m).filter(A=>!A.interactive);if(g.length){let A=g.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements multiple '${i.BuiltInBaseEntity}' entities that are non-interactive ("${L(g.map(C=>P(C,C.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${m.id}' because it extends or implements a '${i.BuiltInBaseEntity}' entity that is non-interactive ("${P(g[0],g[0].project)}").`;A+=`
|
|
23
23
|
${xn}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:A,issue:null}))}else{const A=m.methods.find(Xe=>{var $e;return(($e=Xe.implements)==null?void 0:$e.id)===r.implements});A&&a.push(new E({id:`${r.id}--${I.MethodOverwrite}`,code:I.MethodOverwrite,severity:T.Error,message:`The '${i.FunctionDeclaration}' with id "${r.id}" is trying to implement the '${i.ActionDescriptor}' with id "${r.implements}", but the parent custom-entity already has a ${i.FunctionDeclaration} with id '${A.id}' that implements the same base method.
|
|
24
24
|
A ${i.FunctionDeclaration} that has a parent of type '${i.CustomEntity}' is considered a method of that entity, and cannot implement the same '${i.ActionDescriptor}' more than once.
|
|
25
25
|
${i.ActionDescriptor} entities inside a ${i.CustomEntity} are considered abstract methods that can be implemented by ${i.FunctionDeclaration} entities inside the same parent.
|
|
@@ -29,39 +29,38 @@ 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 ${i.ActionDescriptor} signature, otherwise the implementation will have a validation error.`,issue:null}))}}else if(l&&l.type===i.Loop){const m=l.body;m&&((f=m.implements)==null?void 0:f.id)===r.implements&&a.push(new E({id:`${r.id}--${I.MethodOverwrite}`,code:I.MethodOverwrite,severity:T.Error,message:`The '${i.FunctionDeclaration}' with id "${r.id}" is being added as the 'body' of the ${i.Loop} with id "${l.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=r.parent&&t.get(r.parent)||t.getBuiltIn(r.parent),y=p?qn(p):null;return y&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${P(y,t)}" with id '${y.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,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&(this.parent.type===i.Project?t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this];return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===i.CustomEntity?(this.parent.addMethod(this),e.push(this.parent)):this.parent.type===i.Loop&&(this.parent.setBody(this),e.push(this.parent)),{affected:v(e),self:this}}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==i.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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),At(this).forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),{affected:v(r),removed:v(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)}),At(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:v(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=At(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=At(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+"--"+M.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.calls.flatMap(r=>r.toFlatJSON(e)),...this.returnStatements.flatMap(r=>r.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;const e=this.parent.type===i.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(r=>r.toFlatGenerationTarget(e)),...this.calls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(r=>r.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=T9(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=At(this);return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...e.flatMap(r=>r.getErrors())]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0,a=!1){var m;const s=this.toJSON(),o=t||Ze(P(this,this.project),i.FunctionDeclaration,this.project);s.inputs=[];const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const y=Ut(s,this.project);e?y.setParent(e):y.setParent(this.parent),r&&y.subscribe(),y.initChildren();const f=(m=this.inputs)==null?void 0:m.map((b,g)=>b.clone(this,p+"-argument-declaration-"+g+"-id",r));return y.inputs=f,y}getVariableInstances(){return K(this).filter(r=>r.type===i.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const r={id:t.id||M.UUID.uuid(),version:t.version||1,type:i.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(r,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}createInternalCall(e,t={}){const r={id:t.id||M.UUID.uuid(),version:t.version||1,type:i.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(r,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}};c(de,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),c(de,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),c(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),c(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),c(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),c(de,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(de,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUATABLE_UPSTREAM_PROPERTIES]),c(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),c(de,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),c(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUATABLE_DOWNSTREAM_PROPERTIES]),c(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let mr=de;function b9(n){const e=ox(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.entity&&n.andChildrenGroup||n.entity&&n.orChildrenGroup||n.andChildrenGroup&&n.orChildrenGroup){const s=q({id:n.id+"--"+B.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:T.Error,code:B.InvalidPropertiesCombination,entity:n});a.push(s.error)}return ee(n.errors,a)}function g9(n,e){const t=[],r=[i.CustomEntity,i.ActionDescriptor,i.Property,i.ArgumentDeclaration,i.ReturnDeclaration,i.VariableDeclaration,i.ValueDescriptor,i.DataType],a=`'${L(r,"', '","' or '")}'`;if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.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?r.includes(s.type)||t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.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}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.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}--${h.SelfReference}`,code:h.SelfReference,severity:T.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?[i.CustomEntity,i.PrimitiveEntity,i.ActionDescriptor,i.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${n.id}--${n.entity}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 ue=class ue{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"isNullable");c(this,"isList");c(this,"constant");c(this,"asType");c(this,"type",i.DataType);c(this,"options");c(this,"parentRelationType");c(this,"defaultValue",null);c(this,"entity",null);c(this,"andChildrenGroup");c(this,"orChildrenGroup");c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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 r=O(e.parent),a=t.get(r);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:i.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},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var p;let r=JSON.parse(JSON.stringify(e));const a=[],s=g9(r,t);if(a.push(...s,...Oe(r)),r.entity){const y=t.get(r.entity);if(y.type===i.CustomEntity){const m=kn(y).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${L(m.map(g=>g.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${r.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(){const e=[this];return this.parent===this.project?this.project.addFunctionDeclaration(this):this.parent.type===i.CustomEntity?(this.parent.addMethod(this),e.push(this.parent)):this.parent.type===i.Loop&&(this.parent.setBody(this),e.push(this.parent)),{affected:v(e),self:this}}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent),t.initChildren()):t.type!==i.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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),Pt(this).forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),{affected:v(r),removed:v(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)}),Pt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:v(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Pt(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=Pt(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:i.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(r=>r.toFlatJSON(e)),...this.calls.flatMap(r=>r.toFlatJSON(e)),...this.returnStatements.flatMap(r=>r.toFlatJSON(e)),...this.implements?this.implements.toFlatJSON(e):[]])}toGenerationTarget(){var t;const e=this.parent.type===i.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(r=>r.toFlatGenerationTarget(e)),...this.calls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(r=>r.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=T9(this);return this.errors=[...e],{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Pt(this);return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...e.flatMap(r=>r.getErrors())]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0,a=!1){var m;const s=this.toJSON(),o=t||Ze(P(this,this.project),i.FunctionDeclaration,this.project);s.inputs=[];const l=o.split("-id"),p=l[l.length-1||0]||o;s.id=o;const y=Ft(s,this.project);e?y.setParent(e):y.setParent(this.parent),r&&y.subscribe(),y.initChildren();const f=(m=this.inputs)==null?void 0:m.map((b,g)=>b.clone(this,p+"-argument-declaration-"+g+"-id",r));return y.inputs=f,y}getVariableInstances(){return K(this).filter(r=>r.type===i.VariableInstance)}getArgument(e){return this.inputs.find(t=>t.id===e)||null}createCall(e=this.project,t={}){const r={id:t.id||_.UUID.uuid(),version:t.version||1,type:i.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(r,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addFunctionCall(a),a}createInternalCall(e,t={}){const r={id:t.id||_.UUID.uuid(),version:t.version||1,type:i.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(r,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}};c(de,"MUTABLE_BASE_PROPERTIES",["name","description","private"]),c(de,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(de,"BASE_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,...de.INMUTABLE_BASE_PROPERTIES]),c(de,"MUTABLE_META_PROPERTIES",[...de.MUTABLE_BASE_PROPERTIES,"x","y","index","collapsed"]),c(de,"INMUTABLE_META_PROPERTIES",[...de.INMUTABLE_BASE_PROPERTIES]),c(de,"META_PROPERTIES",[...de.MUTABLE_META_PROPERTIES,...de.INMUTABLE_META_PROPERTIES]),c(de,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(de,"INMUATABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(de,"UPSTREAM_PROPERTIES",[...de.MUTABLE_UPSTREAM_PROPERTIES,...de.INMUATABLE_UPSTREAM_PROPERTIES]),c(de,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),c(de,"INMUATABLE_DOWNSTREAM_PROPERTIES",[]),c(de,"DOWNSTREAM_PROPERTIES",[...de.MUTABLE_DOWNSTREAM_PROPERTIES,...de.INMUATABLE_DOWNSTREAM_PROPERTIES]),c(de,"PROPERTIES",[...de.META_PROPERTIES,...de.UPSTREAM_PROPERTIES,...de.DOWNSTREAM_PROPERTIES]);let mr=de;function b9(n){const e=ox(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.entity&&n.andChildrenGroup||n.entity&&n.orChildrenGroup||n.andChildrenGroup&&n.orChildrenGroup){const s=q({id:n.id+"--"+B.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:T.Error,code:B.InvalidPropertiesCombination,entity:n});a.push(s.error)}return ee(n.errors,a)}function g9(n,e){const t=[],r=[i.CustomEntity,i.ActionDescriptor,i.Property,i.ArgumentDeclaration,i.ReturnDeclaration,i.VariableDeclaration,i.ValueDescriptor,i.DataType],a=`'${L(r,"', '","' or '")}'`;if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.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?r.includes(s.type)||t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.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}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.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}--${h.SelfReference}`,code:h.SelfReference,severity:T.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?[i.CustomEntity,i.PrimitiveEntity,i.ActionDescriptor,i.BuiltInBaseEntity].includes(s.type)||t.push(new E({id:`${n.id}--${n.entity}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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 ue=class ue{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"isNullable");c(this,"isList");c(this,"constant");c(this,"asType");c(this,"type",i.DataType);c(this,"options");c(this,"parentRelationType");c(this,"defaultValue",null);c(this,"entity",null);c(this,"andChildrenGroup");c(this,"orChildrenGroup");c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(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 r=O(e.parent),a=t.get(r);let s=null;e.entity&&(s=t.get(e.entity));const o={id:e.id,version:1,type:i.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},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var p;let r=JSON.parse(JSON.stringify(e));const a=[],s=g9(r,t);if(a.push(...s,...Oe(r)),r.entity){const y=t.get(r.entity);if(y.type===i.CustomEntity){const m=kn(y).filter(b=>!b.interactive);if(m.length){const b=m.length>1?`entities with ids '${L(m.map(g=>g.id),"', '","' and '")}'`:`entity with id '${m[0].id}'`;a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot reference 'custom-entity' with id '${r.entity}' at 'entity'. The entity extends or implements non-interactive built-in-base-entity ${b}.
|
|
33
33
|
${xn}`,issue:null}))}}}const o=r.parent&&t.get(r.parent)||t.getBuiltIn(r.parent),l=o?qn(o):null;if(l)a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', belongs to a built-in system entity "${P(l,t)}" with id '${l.id}', and therefore it cannot be created as it would affect a built in entity, which are inmutable.`,issue:null}));else if(o){const y=o.type,f=[i.Property,i.VariableDeclaration,i.ArgumentDeclaration,i.ReturnDeclaration,i.ValueDescriptor];if(f.includes(y)&&(r.parentRelationType&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot have a 'parentRelationType' property set of type '${y}'.
|
|
34
34
|
The entitities of type '${L(f,"', '","' 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}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', cannot be added as a child to the entity with id '${r.parent}' and type '${y}', because it already has a 'data-type' child with id '${m}'.
|
|
35
35
|
The entitities of type '${L(f,"', '","' 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:
|
|
36
36
|
${tn({describe_entity:m})}
|
|
37
|
-
Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}y===i.ActionDescriptor&&(!r.parentRelationType||!(r.parentRelationType===qe.DynamicArgumentTypes||r.parentRelationType===qe.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'dynamic-argument-types' or 'dynamic-return-types' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})),y===i.DataType&&(!r.parentRelationType||!(r.parentRelationType===qe.AndDataTypeGroup||r.parentRelationType===qe.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'or-data-type-group' or 'and-data-type-group' when being added as a child to an entity of type 'data-type'.`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.type===i.DataType?this.parentRelationType===qe.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===qe.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===i.ActionDescriptor?this.parentRelationType===qe.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),e.push(this.parent),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(r=>r.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(r=>r.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.entity)if(this.initialData.entity.type===i.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=e}else this.entity=R(this.initialData.entity,this.project);return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(e=>R(e,this.project))),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(e=>R(e,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.isNullable=e.isNullable||this.isNullable,this.isList=e.isList||this.isList,this.constant=e.constant||this.constant,this.asType=e.asType||this.asType,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}if(this.entity&&this.entity.type===i.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}if(!e){this.parent.type===i.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===i.DataType){if(this.parentRelationType===qe.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===i.ActionDescriptor){const o=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===qe.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();r.push(s)}return{affected:v(r),removed:v(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.defaultValue){const{affected:r}=this.defaultValue.restore({seenEntities:e});t.push(...r)}if(this.entity&&this.entity.type===i.CustomEntity&&this.entity.parent===this){const{affected:r}=this.entity.restore({seenEntities:e});t.push(...r)}if(this.parent.type===i.DataType){const r=this.parent;Array.isArray(r.andChildrenGroup)&&r.andChildrenGroup.push(this)}if(this.parent.type===i.DataType){const r=this.parent;this.parentRelationType===qe.AndDataTypeGroup?Array.isArray(r.andChildrenGroup)&&r.andChildrenGroup.push(this):this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(r.orChildrenGroup)&&r.orChildrenGroup.push(this)}else if(this.parent.type===i.ActionDescriptor){const r=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?r.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&r.setDynamicReturnTypes(this)}else{const r=this.parent;r.setDataType(this),t.push(r)}return{affected:t,self:this}}toFlat(e=new Set){var r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.andChildrenGroup)==null?void 0:r.flatMap(o=>o.toFlat(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlat(e)))||[],...((s=this.entity)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.andChildrenGroup)==null?void 0:r.flatMap(o=>o.toFlatIds(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatIds(e)))||[],...((s=this.entity)==null?void 0:s.toFlatIds(e))||[]])}toJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,asType:this.asType,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,parentRelationType:this.parentRelationType,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toJSON()))||null,orChildrenGroup:((r=this.orChildrenGroup)==null?void 0:r.map(s=>s.toJSON()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,isList:this.isList,isNullable:this.isNullable,options:this.options,constant:this.constant,asType:this.asType,parentRelationType:this.parentRelationType,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toReference()))||null,orChildrenGroup:((r=this.orChildrenGroup)==null?void 0:r.map(s=>s.toReference()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r,a,s,o;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.defaultValue)==null?void 0:r.toFlatJSON(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(l=>l.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(l=>l.toFlatJSON(e)))||[],...((o=this.entity)==null?void 0:o.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,parentRelationType:this.parentRelationType,asType:this.asType,entity:((e=this.entity)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.defaultValue)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==i.CustomEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,r,a;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.andChildrenGroup)==null||t.forEach(s=>s.clearErrors()),(r=this.orChildrenGroup)==null||r.forEach(s=>s.clearErrors()),this.inferred&&((a=this.entity)==null||a.clearErrors()),this}validate(){const e=b9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0){var b,g,A,C;const a=this.toJSON(),s=t||Ze(rv(this),i.DataType,this.project),o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e&&p.setParent(e),r&&p.subscribe(),p.initChildren();const y=(b=this.defaultValue)==null?void 0:b.clone(p,l+"-default-value-id",r);p.defaultValue=y||null;const f=(g=this.andChildrenGroup)==null?void 0:g.map(($,Xe)=>$.clone(this,l+"-and-group-data-type-"+Xe+"-id",r)),m=(A=this.orChildrenGroup)==null?void 0:A.map(($,Xe)=>$.clone(this,l+"-or-group-data-type-"+Xe+"-id",r));if(p.andChildrenGroup=f||null,p.orChildrenGroup=m||null,this.entity&&this.entity.type===i.CustomEntity&&((C=this.entity)==null?void 0:C.parent)===this){const $=this.entity.clone(p,l+"-inferred-entity-id",r);p.setEntity($)}else this.entity&&p.setEntity(this.entity);return p}merge(e){const t=[],r=[],a=[];return this.asType!==(e==null?void 0:e.asType)&&(this.sync({asType:e==null?void 0:e.asType}),t.push(this)),this.isNullable!==(e==null?void 0:e.isNullable)&&(this.sync({isNullable:e==null?void 0:e.isNullable}),t.push(this)),this.isList!==!(e!=null&&e.isList)&&(this.sync({isList:e==null?void 0:e.isList}),t.push(this)),this.constant!==(e==null?void 0:e.constant)&&(this.sync({constant:e==null?void 0:e.constant}),t.push(this)),e!=null&&e.inferred,{updated:v(t),added:v(r),removed:v(a),self:this}}addToAndGroup(e){return this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(e)||this.andChildrenGroup.push(e),this}addToOrGroup(e){return this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(e)||this.orChildrenGroup.push(e),this}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}setEntity(e){return this.entity=e,this}isResolved(){return[i.BuiltInBaseEntity,i.ActionDescriptor].includes(this.parent.type)||qn(this.parent)?!0:!(!this.entity&&(!this.andChildrenGroup||!this.andChildrenGroup.length)&&(!this.orChildrenGroup||!this.orChildrenGroup.length))}inferFromInputs(e){var t;if(!this.inferred)return this;if(!this.entity&&e.length){const r={id:this.id+"--infered-entity",type:i.CustomEntity,version:1,name:P(this,this.project),description:((t=this.parent)==null?void 0:t.description)||null,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:this.toReference()},a=R(r,this.project);a.sync(r),a.setParent(this),a.initChildren(),this.setEntity(a)}return this.entity&&this.entity.inferFromInputs(e),this}};c(ue,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),c(ue,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"inferred"]),c(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),c(ue,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),c(ue,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),c(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let ci=ue;function v9(n){var l;const e=jU(),t=n.toJSON();e.safeParse(t).success;const a=I9(n),s=bn(n),o=[...a,...s];if(n.id==="exec-sequentially-operation-call-id"){const p=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});o.push(p.error)}return n.outputs.forEach(p=>p.validate()),(l=n.error)==null||l.validate(),ee(n.errors,o)}function I9(n){const e=[];return n.inputs.forEach(t=>{t.validate()}),n.dynamicArguments.forEach(t=>{t.validate()}),ee(n.errors,e)}const ne=class ne{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Operation);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"dynamicArguments",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const m=O(e.parent);r=t.get(m)}const a=O(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=O(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=O(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=O(m);return t.get(b)}),y={id:e.id,version:1,type:i.Operation,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],dynamicArguments:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:r},f=R(y,t);return f.setParent(r),f.initChildren(),f}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);r=s.modifiedData,a.push(...s.errors,...Oe(r));const o=O(r.declaration);if(o){const l=gv(o,t);a.push(...l)}else{const l=`
|
|
37
|
+
Alternatively you can update the entity with 'update' action. Or replace it by first removing it and then creating a new one.`,issue:null}))}y===i.ActionDescriptor&&(!r.parentRelationType||!(r.parentRelationType===qe.DynamicArgumentTypes||r.parentRelationType===qe.DynamicReturnTypes))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'dynamic-argument-types' or 'dynamic-return-types' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})),y===i.DataType&&(!r.parentRelationType||!(r.parentRelationType===qe.AndDataTypeGroup||r.parentRelationType===qe.OrDataTypeGroup))&&a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either 'or-data-type-group' or 'and-data-type-group' when being added as a child to an entity of type 'data-type'.`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.type===i.DataType?this.parentRelationType===qe.AndDataTypeGroup?this.parent.addToAndGroup(this):this.parentRelationType===qe.OrDataTypeGroup&&this.parent.addToOrGroup(this):this.parent.type===i.ActionDescriptor?this.parentRelationType===qe.DynamicArgumentTypes?this.parent.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&this.parent.setDynamicReturnTypes(this):this.parent.setDataType(this),e.push(this.parent),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}removeChildGroup(e){if(this.andChildrenGroup){const t=this.andChildrenGroup.findIndex(r=>r.id===e.id);t!==-1&&this.andChildrenGroup.splice(t,1)}if(this.orChildrenGroup){const t=this.orChildrenGroup.findIndex(r=>r.id===e.id);t!==-1&&this.orChildrenGroup.splice(t,1)}return this}initChildren(){if(this.initialized)return this;if(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.entity)if(this.initialData.entity.type===i.GenericReference){const e=this.project.findSubscribedInstanceFromReference(this.initialData.entity);this.entity=e}else this.entity=R(this.initialData.entity,this.project);return this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(e=>R(e,this.project))),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(e=>R(e,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.isNullable=e.isNullable||this.isNullable,this.isList=e.isList||this.isList,this.constant=e.constant||this.constant,this.asType=e.asType||this.asType,this.options=e.options||this.options,this.parentRelationType=e.parentRelationType||this.parentRelationType,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.defaultValue){const{affected:s,removed:o}=this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}if(this.entity&&this.entity.type===i.CustomEntity&&this.entity.parent===this){const{affected:s,removed:o}=this.entity.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}if(!e){this.parent.type===i.DataType&&this.parent.removeChildGroup(this);const s=this.parent;if(s.type===i.DataType){if(this.parentRelationType===qe.AndDataTypeGroup){if(Array.isArray(s.andChildrenGroup)){const o=s.andChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.andChildrenGroup.splice(o,1)}}else if(this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(s.orChildrenGroup)){const o=s.orChildrenGroup.findIndex(l=>l.id===this.id);o!==-1&&s.orChildrenGroup.splice(o,1)}}else if(s.type===i.ActionDescriptor){const o=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?o.removeDynamicArgumentTypes():this.parentRelationType===qe.DynamicReturnTypes&&o.removeDynamicReturnTypes()}else this.parent.removeDataType();r.push(s)}return{affected:v(r),removed:v(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.defaultValue){const{affected:r}=this.defaultValue.restore({seenEntities:e});t.push(...r)}if(this.entity&&this.entity.type===i.CustomEntity&&this.entity.parent===this){const{affected:r}=this.entity.restore({seenEntities:e});t.push(...r)}if(this.parent.type===i.DataType){const r=this.parent;Array.isArray(r.andChildrenGroup)&&r.andChildrenGroup.push(this)}if(this.parent.type===i.DataType){const r=this.parent;this.parentRelationType===qe.AndDataTypeGroup?Array.isArray(r.andChildrenGroup)&&r.andChildrenGroup.push(this):this.parentRelationType===qe.OrDataTypeGroup&&Array.isArray(r.orChildrenGroup)&&r.orChildrenGroup.push(this)}else if(this.parent.type===i.ActionDescriptor){const r=this.parent;this.parentRelationType===qe.DynamicArgumentTypes?r.setDynamicArgumentTypes(this):this.parentRelationType===qe.DynamicReturnTypes&&r.setDynamicReturnTypes(this)}else{const r=this.parent;r.setDataType(this),t.push(r)}return{affected:t,self:this}}toFlat(e=new Set){var r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.andChildrenGroup)==null?void 0:r.flatMap(o=>o.toFlat(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlat(e)))||[],...((s=this.entity)==null?void 0:s.toFlat(e))||[]])}toFlatIds(e=new Set){var r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.andChildrenGroup)==null?void 0:r.flatMap(o=>o.toFlatIds(e)))||[],...((a=this.orChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatIds(e)))||[],...((s=this.entity)==null?void 0:s.toFlatIds(e))||[]])}toJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,asType:this.asType,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,parentRelationType:this.parentRelationType,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toJSON()))||null,orChildrenGroup:((r=this.orChildrenGroup)==null?void 0:r.map(s=>s.toJSON()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,isList:this.isList,isNullable:this.isNullable,options:this.options,constant:this.constant,asType:this.asType,parentRelationType:this.parentRelationType,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,andChildrenGroup:((t=this.andChildrenGroup)==null?void 0:t.map(s=>s.toReference()))||null,orChildrenGroup:((r=this.orChildrenGroup)==null?void 0:r.map(s=>s.toReference()))||null,entity:((a=this.entity)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r,a,s,o;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.defaultValue)==null?void 0:r.toFlatJSON(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(l=>l.toFlatJSON(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(l=>l.toFlatJSON(e)))||[],...((o=this.entity)==null?void 0:o.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,type:this.type,isNullable:this.isNullable,options:this.options,isList:this.isList,constant:this.constant,parentRelationType:this.parentRelationType,asType:this.asType,entity:((e=this.entity)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var r,a,s;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.defaultValue)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.andChildrenGroup)==null?void 0:a.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...((s=this.orChildrenGroup)==null?void 0:s.flatMap(o=>o.toFlatGenerationTarget(e)))||[],...this.entity&&this.entity.type==i.CustomEntity&&this.entity.parent===this&&this.entity.toFlatGenerationTarget(e)||[]])}clearErrors(){var e,t,r,a;return this.errors=[],(e=this.defaultValue)==null||e.clearErrors(),(t=this.andChildrenGroup)==null||t.forEach(s=>s.clearErrors()),(r=this.orChildrenGroup)==null||r.forEach(s=>s.clearErrors()),this.inferred&&((a=this.entity)==null||a.clearErrors()),this}validate(){const e=b9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0){var b,g,A,C;const a=this.toJSON(),s=t||Ze(rv(this),i.DataType,this.project),o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ft(a,this.project);e&&p.setParent(e),r&&p.subscribe(),p.initChildren();const y=(b=this.defaultValue)==null?void 0:b.clone(p,l+"-default-value-id",r);p.defaultValue=y||null;const f=(g=this.andChildrenGroup)==null?void 0:g.map(($,Xe)=>$.clone(this,l+"-and-group-data-type-"+Xe+"-id",r)),m=(A=this.orChildrenGroup)==null?void 0:A.map(($,Xe)=>$.clone(this,l+"-or-group-data-type-"+Xe+"-id",r));if(p.andChildrenGroup=f||null,p.orChildrenGroup=m||null,this.entity&&this.entity.type===i.CustomEntity&&((C=this.entity)==null?void 0:C.parent)===this){const $=this.entity.clone(p,l+"-inferred-entity-id",r);p.setEntity($)}else this.entity&&p.setEntity(this.entity);return p}merge(e){const t=[],r=[],a=[];return this.asType!==(e==null?void 0:e.asType)&&(this.sync({asType:e==null?void 0:e.asType}),t.push(this)),this.isNullable!==(e==null?void 0:e.isNullable)&&(this.sync({isNullable:e==null?void 0:e.isNullable}),t.push(this)),this.isList!==!(e!=null&&e.isList)&&(this.sync({isList:e==null?void 0:e.isList}),t.push(this)),this.constant!==(e==null?void 0:e.constant)&&(this.sync({constant:e==null?void 0:e.constant}),t.push(this)),e!=null&&e.inferred,{updated:v(t),added:v(r),removed:v(a),self:this}}addToAndGroup(e){return this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(e)||this.andChildrenGroup.push(e),this}addToOrGroup(e){return this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(e)||this.orChildrenGroup.push(e),this}getDefaultValue(){return this.defaultValue}setDefaultValue(e){return this.defaultValue=e,this}setEntity(e){return this.entity=e,this}isResolved(){return[i.BuiltInBaseEntity,i.ActionDescriptor].includes(this.parent.type)||qn(this.parent)?!0:!(!this.entity&&(!this.andChildrenGroup||!this.andChildrenGroup.length)&&(!this.orChildrenGroup||!this.orChildrenGroup.length))}inferFromInputs(e){var t;if(!this.inferred)return this;if(!this.entity&&e.length){const r={id:this.id+"--infered-entity",type:i.CustomEntity,version:1,name:P(this,this.project),description:((t=this.parent)==null?void 0:t.description)||null,static:!0,abstract:!1,properties:[],methods:[],extends:[],implements:[],abstractMethods:[],x:0,y:0,parent:this.toReference()},a=R(r,this.project);a.sync(r),a.setParent(this),a.initChildren(),this.setEntity(a)}return this.entity&&this.entity.inferFromInputs(e),this}};c(ue,"MUTABLE_BASE_PROPERTIES",["isNullable","isList","constant","asType","options","parentRelationType"]),c(ue,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(ue,"BASE_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"MUTABLE_META_PROPERTIES",[...ue.MUTABLE_BASE_PROPERTIES,"inferred"]),c(ue,"INMUTABLE_META_PROPERTIES",[...ue.INMUTABLE_BASE_PROPERTIES]),c(ue,"META_PROPERTIES",[...ue.MUTABLE_META_PROPERTIES,...ue.INMUTABLE_META_PROPERTIES]),c(ue,"MUTABLE_UPSTREAM_PROPERTIES",["entity","andChildrenGroup","orChildrenGroup","parent"]),c(ue,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(ue,"UPSTREAM_PROPERTIES",[...ue.MUTABLE_UPSTREAM_PROPERTIES,...ue.INMUTABLE_UPSTREAM_PROPERTIES]),c(ue,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue"]),c(ue,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ue,"DOWNSTREAM_PROPERTIES",[...ue.MUTABLE_DOWNSTREAM_PROPERTIES,...ue.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ue,"PROPERTIES",[...ue.META_PROPERTIES,...ue.UPSTREAM_PROPERTIES,...ue.DOWNSTREAM_PROPERTIES]);let ci=ue;function v9(n){var l;const e=jU(),t=n.toJSON();e.safeParse(t).success;const a=I9(n),s=bn(n),o=[...a,...s];if(n.id==="exec-sequentially-operation-call-id"){const p=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});o.push(p.error)}return n.outputs.forEach(p=>p.validate()),(l=n.error)==null||l.validate(),ee(n.errors,o)}function I9(n){const e=[];return n.inputs.forEach(t=>{t.validate()}),n.dynamicArguments.forEach(t=>{t.validate()}),ee(n.errors,e)}const ne=class ne{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Operation);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"dynamicArguments",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const m=O(e.parent);r=t.get(m)}const a=O(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=O(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=O(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=O(m);return t.get(b)}),y={id:e.id,version:1,type:i.Operation,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],dynamicArguments:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:r},f=R(y,t);return f.setParent(r),f.initChildren(),f}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);r=s.modifiedData,a.push(...s.errors,...Oe(r));const o=O(r.declaration);if(o){const l=gv(o,t);a.push(...l)}else{const l=`
|
|
38
38
|
All built-in 'action-descriptor' entity ids are:
|
|
39
39
|
- ${t.operationDeclarations.map(p=>`${p.id} (${P(p,t)})`).join(`
|
|
40
40
|
- `)}.
|
|
41
41
|
`;a.push(new E({id:`${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.Operation}" with id "${r.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'action-descriptor' entity.
|
|
42
42
|
References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${l}`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
43
43
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
44
|
-
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 t;const e=[this];return this.parent===this.project&&this.project.addOperation(this),(t=this.process)==null||t.writesValues.forEach(r=>{r.setValueWriter(this.process),e.push(r)}),this.successCalls.forEach(r=>{r.addSuccessCaller(this),e.push(r)}),this.errorCalls.forEach(r=>{r.addErrorCaller(this),e.push(r)}),this.calledBySuccess.forEach(r=>{r.addSuccessCall(this),e.push(r)}),this.calledByError.forEach(r=>{r.addErrorCall(this),e.push(r)}),this.calledByEntry.forEach(r=>{r.addCall(this),e.push(r)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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 r=[],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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:v(r),removed:v(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.dynamicArguments.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.dynamicArguments.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.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(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON(),dynamicArguments:this.dynamicArguments.map(r=>r.toJSON())}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.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()),dynamicArguments:this.dynamicArguments.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.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.dynamicArguments.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,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(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.dynamicArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),this.dynamicArguments.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=v9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.dynamicArguments.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 ne(this.toJSON(),this.project)}};c(ne,"MUTABLE_BASE_PROPERTIES",[]),c(ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ne,"BASE_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,...ne.INMUTABLE_BASE_PROPERTIES]),c(ne,"MUTABLE_META_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ne,"INMUTABLE_META_PROPERTIES",[...ne.INMUTABLE_BASE_PROPERTIES]),c(ne,"META_PROPERTIES",[...ne.MUTABLE_META_PROPERTIES,...ne.INMUTABLE_META_PROPERTIES]),c(ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(ne,"UPSTREAM_PROPERTIES",[...ne.MUTABLE_UPSTREAM_PROPERTIES,...ne.INMUTABLE_UPSTREAM_PROPERTIES]),c(ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error","dynamicArguments"]),c(ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ne,"DOWNSTREAM_PROPERTIES",[...ne.MUTABLE_DOWNSTREAM_PROPERTIES,...ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ne,"PROPERTIES",[...ne.META_PROPERTIES,...ne.UPSTREAM_PROPERTIES,...ne.DOWNSTREAM_PROPERTIES]);let Tr=ne;function P9(n){const e=Sx(),t=n.toJSON();e.safeParse(t).success;const a=At(n);n.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return ee(n.errors,s)}const re=class re{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"collapsed");c(this,"type",i.GlobalEvent);c(this,"inputs",[]);c(this,"calls",[]);c(this,"returnStatements",[]);c(this,"parent");c(this,"implements");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);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.collapsed=e.collapsed}static fromGenerationTarget(e,t){let r=t;if(e.parent){const l=O(e.parent);r=t.get(l)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:i.GlobalEvent,collapsed:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:r},o=R(s,t);return o.setParent(r),o.initChildren(),o}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{},t);if(r=s.modifiedData,a.push(...s.errors,...Oe(r)),!e.implements)a.push(new E({id:`${e.id}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'implements' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for 'global-event' entities.
|
|
44
|
+
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 t;const e=[this];return this.parent===this.project&&this.project.addOperation(this),(t=this.process)==null||t.writesValues.forEach(r=>{r.setValueWriter(this.process),e.push(r)}),this.successCalls.forEach(r=>{r.addSuccessCaller(this),e.push(r)}),this.errorCalls.forEach(r=>{r.addErrorCaller(this),e.push(r)}),this.calledBySuccess.forEach(r=>{r.addSuccessCall(this),e.push(r)}),this.calledByError.forEach(r=>{r.addErrorCall(this),e.push(r)}),this.calledByEntry.forEach(r=>{r.addCall(this),e.push(r)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?t.setParent(this.parent.parent):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),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 r=[],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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:v(r),removed:v(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.dynamicArguments.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.dynamicArguments.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.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(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON(),dynamicArguments:this.dynamicArguments.map(r=>r.toJSON())}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.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()),dynamicArguments:this.dynamicArguments.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.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.dynamicArguments.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,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(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.dynamicArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),this.dynamicArguments.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=v9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors()),...this.dynamicArguments.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 ne(this.toJSON(),this.project)}};c(ne,"MUTABLE_BASE_PROPERTIES",[]),c(ne,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ne,"BASE_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,...ne.INMUTABLE_BASE_PROPERTIES]),c(ne,"MUTABLE_META_PROPERTIES",[...ne.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ne,"INMUTABLE_META_PROPERTIES",[...ne.INMUTABLE_BASE_PROPERTIES]),c(ne,"META_PROPERTIES",[...ne.MUTABLE_META_PROPERTIES,...ne.INMUTABLE_META_PROPERTIES]),c(ne,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(ne,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(ne,"UPSTREAM_PROPERTIES",[...ne.MUTABLE_UPSTREAM_PROPERTIES,...ne.INMUTABLE_UPSTREAM_PROPERTIES]),c(ne,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error","dynamicArguments"]),c(ne,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ne,"DOWNSTREAM_PROPERTIES",[...ne.MUTABLE_DOWNSTREAM_PROPERTIES,...ne.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ne,"PROPERTIES",[...ne.META_PROPERTIES,...ne.UPSTREAM_PROPERTIES,...ne.DOWNSTREAM_PROPERTIES]);let Tr=ne;function D9(n){const e=Sx(),t=n.toJSON();e.safeParse(t).success;const a=Pt(n);n.inputs.forEach(o=>o.validate()),a.forEach(o=>o.validate());const s=[];return ee(n.errors,s)}const re=class re{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"collapsed");c(this,"type",i.GlobalEvent);c(this,"inputs",[]);c(this,"calls",[]);c(this,"returnStatements",[]);c(this,"parent");c(this,"implements");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);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.collapsed=e.collapsed}static fromGenerationTarget(e,t){let r=t;if(e.parent){const l=O(e.parent);r=t.get(l)}let a;e.implements&&(a=t.getBuiltIn(e.implements));const s={id:e.id,version:1,name:e.name,type:i.GlobalEvent,collapsed:!1,returnStatements:[],calls:[],inputs:[],implements:a,x:0,y:0,parent:r},o=R(s,t);return o.setParent(r),o.initChildren(),o}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{},t);if(r=s.modifiedData,a.push(...s.errors,...Oe(r)),!e.implements)a.push(new E({id:`${e.id}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'implements' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for 'global-event' entities.
|
|
45
45
|
${oo(t)}`,issue:null}));else if(!t.get(e.implements))a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't found in the project. The 'implements' property must point to one of the built-in action descriptors reserved for 'global-event' entities.
|
|
46
46
|
${oo(t)}`,issue:null}));else if(!t.globalEventActionDescriptors.find(p=>p.id===e.implements))a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that isn't pointing to an action descriptor reserved for 'global-event' entities.
|
|
47
47
|
${oo(t)}`,issue:null}));else{const p=t.events.find(y=>y.implements.id===e.implements);p&&a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'implements' property that points to an action descriptor that is already implemented by another global event with id '${p.id}' in the project. Each global event must implement a unique action descriptor.
|
|
48
|
-
You can attach new logic to the existing 'global-event' but creating a new callable entity that gets called by it.`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this];return this.project.addGlobalEvent(this),{affected:v(e),self:this}}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),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}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.findIndex(r=>r.id===e.id);return t>-1&&this.inputs.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),t.type!==i.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.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.x=e.x||this.x,this.y=e.y||this.y,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),
|
|
48
|
+
You can attach new logic to the existing 'global-event' but creating a new callable entity that gets called by it.`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this];return this.project.addGlobalEvent(this),{affected:v(e),self:this}}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),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}addInputDeclaration(e){return this.inputs.includes(e)||this.inputs.push(e),this}removeInputDeclaration(e){const t=this.inputs.findIndex(r=>r.id===e.id);return t>-1&&this.inputs.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),t.type!==i.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.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.x=e.x||this.x,this.y=e.y||this.y,this.collapsed=e.collapsed!==void 0?e.collapsed:this.collapsed,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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),Pt(this).forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),{affected:v(r),removed:v(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)}),Pt(this).forEach(a=>{const{affected:s}=a.restore({seenEntities:e});t.push(...s)}),{affected:v(t),self:this})}toFlat(e=new Set){if(e.has(this.id))return[];e.add(this.id);const t=Pt(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=Pt(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(){return{id:this.id,version:this.version,type:this.type,name:this.name,x:this.x,y:this.y,collapsed:this.collapsed,implements:this.implements.toJSON(),returnStatements:this.returnStatements.map(e=>e.toJSON()),inputs:this.inputs.map(e=>e.toJSON()),calls:this.calls.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,collapsed:this.collapsed,x:this.x,y:this.y,implements:this.implements.toReference(),inputs:this.inputs.map(e=>e.toReference()),calls:this.calls.map(e=>e.toReference()),returnStatements:this.returnStatements.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.calls.flatMap(r=>r.toFlatJSON(e)),...this.returnStatements.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.calls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.returnStatements.flatMap(r=>r.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=D9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){const e=Pt(this);return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...e.flatMap(r=>r.getErrors())]}getShallowErrors(){return this.errors}clone(){return new re(this.toJSON(),this.project)}getVariableInstances(){return K(this).filter(r=>r.type===i.VariableInstance)}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}};c(re,"MUTABLE_BASE_PROPERTIES",["description"]),c(re,"INMUTABLE_BASE_PROPERTIES",["id","version","name","type"]),c(re,"BASE_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,...re.INMUTABLE_BASE_PROPERTIES]),c(re,"MUTABLE_META_PROPERTIES",[...re.MUTABLE_BASE_PROPERTIES,"x","y","collapsed"]),c(re,"INMUTABLE_META_PROPERTIES",[...re.INMUTABLE_BASE_PROPERTIES]),c(re,"META_PROPERTIES",[...re.MUTABLE_META_PROPERTIES,...re.INMUTABLE_META_PROPERTIES]),c(re,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(re,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","implements"]),c(re,"UPSTREAM_PROPERTIES",[...re.MUTABLE_UPSTREAM_PROPERTIES,...re.INMUTABLE_UPSTREAM_PROPERTIES]),c(re,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","calls","returnStatements"]),c(re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(re,"DOWNSTREAM_PROPERTIES",[...re.MUTABLE_DOWNSTREAM_PROPERTIES,...re.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(re,"PROPERTIES",[...re.META_PROPERTIES,...re.UPSTREAM_PROPERTIES,...re.DOWNSTREAM_PROPERTIES]);let di=re;function P9(n){var o,l;const e=X4(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),(o=n.error)==null||o.validate(),(l=n.body)==null||l.validate();const s=[...bn(n)];return ee(n.errors,s)}const z=class z{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Loop);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"process",null);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"error",null);c(this,"breakStatements",[]);c(this,"continueStatements",[]);c(this,"outputsDeclarations",[]);c(this,"body");c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"parent");c(this,"detachedChildren",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const m=O(e.parent);r=t.get(m)}const a=O(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=O(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=O(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=O(m);return t.get(b)}),y={id:e.id,version:1,type:i.Loop,declaration:s,calledByEntry:o,calledBySuccess:l,calledByError:p,process:null,errorCalls:[],successCalls:[],inputs:[],outputs:[],body:null,breakStatements:[],continueStatements:[],outputsDeclarations:[],error:null,x:0,y:0,parent:r},f=R(y,t);return f.setParent(r),f.initChildren(),f}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0},declaration:{list:!1,types:[i.ActionDescriptor]}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${i.Condition}' entities.
|
|
49
49
|
${lo(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't found in the project. The 'declaration' property must point to one of the built-in action descriptors reserved for '${i.Condition}' entities.
|
|
50
50
|
${lo(t)}`,issue:null})):a.push(new E({id:`${e.id}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'declaration' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for '${i.Condition}' entities.
|
|
51
|
-
${lo(t)}`,issue:null})),{errors:a,modifiedData:r}}static fromReturnDeclarationToBodyArgumentDeclarationName(e){return`Previous iteration results of '${P(e,e.project)}'`}static fromReturnDeclarationToLoopOutputDeclarationName(e){return`Result list of '${P(e,e.project)}'`}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
51
|
+
${lo(t)}`,issue:null})),{errors:a,modifiedData:r}}static fromReturnDeclarationToBodyArgumentDeclarationName(e){return`Previous iteration results of '${P(e,e.project)}'`}static fromBodyArgumentDeclarationToReturnDeclarationName(e){const t=e.name.replace("Previous iteration results of '","");return t.slice(0,t.length-1)}static fromReturnDeclarationToLoopOutputDeclarationName(e){return`Result list of '${P(e,e.project)}'`}static fromLoopOutputDeclarationToReturnDeclarationName(e){const t=e.name.replace("Result list of '","");return t.slice(0,t.length-1)}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
52
52
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
53
|
-
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(){const e=[this];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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)}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(r=>r.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),this}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),this}setBody(e){return this.body=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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.body&&(this.body=R(this.initialData.body,this.project),this.body.setParent(this),this.body.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.syncChildren(),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.body.restore({seenEntities:e}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(r=>r.toFlat(e)),...this.breakStatements.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(r=>r.toFlatIds(e)),...this.breakStatements.flatMap(r=>r.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:((e=this.process)==null?void 0:e.toJSON())||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),outputsDeclarations:this.outputsDeclarations.map(r=>r.toJSON()),successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,body:this.body.toJSON(),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(r=>r.toJSON()),continueStatements:this.continueStatements.map(r=>r.toJSON())}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,body:((t=this.body)==null?void 0:t.toReference())||null,inputs:this.inputs.map(s=>s.toReference()),outputs:this.outputs.map(s=>s.toReference()),outputsDeclarations:this.outputsDeclarations.map(s=>s.toReference()),successCalls:this.successCalls.map(s=>s.toReference()),errorCalls:this.errorCalls.map(s=>s.toReference()),process:((r=this.process)==null?void 0:r.toReference())||null,calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),continueStatements:this.continueStatements.map(s=>s.toReference()),breakStatements:this.breakStatements.map(s=>s.toReference()),error:((a=this.error)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.body)==null?void 0:r.toFlatJSON(e))||[],...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.continueStatements.flatMap(a=>a.toFlatJSON(e)),...this.breakStatements.flatMap(a=>a.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[],...this.process?this.process.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,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){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.body)==null?void 0:r.toFlatGenerationTarget(e))||[],...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.continueStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.breakStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[],...this.process?this.process.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),this.continueStatements.forEach(r=>r.clearErrors()),this.breakStatements.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=D9(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.body?this.body.getErrors():[],...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new z(this.toJSON(),this.project)}getVariableInstances(){return this.body?K(this.body).filter(r=>r.type===i.VariableInstance):[]}addReturnStatement(e){return we.includes(this.parent.type)&&this.parent.addReturnStatement(e),this}removeReturnStatement(e){return we.includes(this.parent.type)&&this.parent.removeReturnStatement(e),this}addBreakStatement(e){return this.breakStatements.includes(e)||this.breakStatements.push(e),this}removeBreakStatement(e){const t=this.breakStatements.indexOf(e);return t!==-1&&this.breakStatements.splice(t,1),this}addContinueStatement(e){return this.continueStatements.includes(e)||this.continueStatements.push(e),this}removeContinueStatement(e){const t=this.continueStatements.indexOf(e);return t!==-1&&this.continueStatements.splice(t,1),this}getUniqueReturnDeclarations(){const e=[];return[...this.breakStatements,...this.continueStatements].forEach(r=>{r.outputs.forEach(s=>{e.find(l=>l===s||P(l,this.project)===P(s,this.project)&&ft(l.dataType,s.dataType))||e.push(s)})}),v(e)}syncTerminationStatements(){const e=[],t=[],r=[],a=this.getUniqueReturnDeclarations(),s=[...this.breakStatements,...this.continueStatements];return a.forEach((o,l)=>{o.index!==l&&(o.sync({index:l}),e.push(o))}),s.forEach(o=>{const l=o.outputs,p=a.filter(y=>!l.find(f=>P(y,this.project)===P(f,this.project)&&ft(y.dataType,f.dataType)));p.length&&e.push(o),p.forEach(y=>{const f=y.clone(o);f.addSelfToProject(),t.push(f)})}),{updated:v(e),added:v(t),removed:v(r),self:this}}syncBodyArgumentsDeclarations(){const e=[],t=[],r=[],a=this.getUniqueReturnDeclarations(),s=this.body.inputs;return a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let f=s.find(g=>P(g,this.project)===z.fromReturnDeclarationToBodyArgumentDeclarationName(l)&&ft(g.dataType,l.dataType));if(!f){const g=z.fromReturnDeclarationToBodyArgumentDeclarationName(l),A={id:M.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:g,description:`Aggretated list of all previously outputted values from each iteration by the output '${P(l,this.project)}'`,dataType:null,index:l.index,required:l.required,parent:this.body.toReference(),writesValues:[]},C=R(A,this.project);C.setParent(this.body),C.initChildren(),C.addSelfToProject(),t.push(C),f=C}f.index!==l.index&&(f.sync({index:l.index}),e.push(f));const m=f.getDataType();let b=m;if(p&&(!m||!ft(m,p))){if(!b){const g=p.clone(f);g.addSelfToProject(),b=g,t.push(g),e.push(f)}b.merge(p)}if(!p){const g={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,andChildrenGroup:[],orChildrenGroup:[],parent:f.toReference()},A=R(g,this.project);A.setParent(f),A.initChildren(),A.addSelfToProject();const C={id:M.UUID.uuid(),version:1,type:i.PrimitiveValue,name:D.JSON,autogeneration:null,valueAsType:null,value:[],parent:A.toReference()},$=R(C,this.project);$.setParent(A),$.initChildren(),$.addSelfToProject(),t.push($),t.push(A)}}),s.filter(l=>l.name==="Current iteration number"||l.name==="Current value"?!1:!a.find(y=>P(l,this.project)===z.fromReturnDeclarationToBodyArgumentDeclarationName(y)&&ft(l.dataType,y.dataType))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),r.push(...y)}),console.log("all arguments after delete: ",this.body.inputs.map(l=>l.id+" "+P(l,this.project))),{updated:v(e),added:v(t),removed:v(r),self:this}}syncOutputsDeclarations(){const e=[],t=[],r=[],a=this.getUniqueReturnDeclarations(),s=this.outputsDeclarations;return console.log("allOutputDeclarations BEFORE sync: ",s.map(l=>P(l,this.project))),a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let f=s.find(g=>P(g,this.project)===z.fromReturnDeclarationToLoopOutputDeclarationName(l)&&ft(g.dataType,l.dataType));if(!f){const g=z.fromReturnDeclarationToLoopOutputDeclarationName(l),A={id:M.UUID.uuid(),version:1,type:i.ValueDescriptor,name:g,description:`Aggretated list of all previously outputted values from each iteration by the output '${P(l,this.project)}'`,dataType:null,index:l.index,required:l.required,parent:this.toReference()},C=R(A,this.project);C.setParent(this),C.initChildren(),C.addSelfToProject(),t.push(C),f=C}f.index!==l.index&&(f.sync({index:l.index}),e.push(f));const m=f.getDataType();let b=m;if(p&&(!m||!ft(m,p))){if(!b){const g=p.clone(f);g.addSelfToProject(),b=g,t.push(g),e.push(f)}b.merge(p)}if(!p){const g={id:M.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,andChildrenGroup:[],orChildrenGroup:[],parent:f.toReference()},A=R(g,this.project);A.setParent(f),A.initChildren(),A.addSelfToProject();const C={id:M.UUID.uuid(),version:1,type:i.PrimitiveValue,name:D.JSON,autogeneration:null,valueAsType:null,value:[],parent:A.toReference()},$=R(C,this.project);$.setParent(A),$.initChildren(),$.addSelfToProject(),t.push($),t.push(A)}}),s.filter(l=>!a.find(y=>P(l,this.project)===z.fromReturnDeclarationToBodyArgumentDeclarationName(y)&&ft(l.dataType,y.dataType))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),r.push(...y)}),console.log("all outputs declarations after delete: ",this.outputsDeclarations.map(l=>l.id+" "+P(l,this.project))),{updated:v(e),added:v(t),removed:v(r),self:this}}syncOutputMaps(){const e=[],t=[],r=[],a=this.outputsDeclarations,s=this.outputs;this.id==="manual-hello-world-loop-id"&&console.log("allOutputMaps BEFORE sync: ",s.map(l=>P(l,this.project))),a.forEach(l=>{var f,m;let y=s.find(b=>{var g,A;return((g=b.declaration)==null?void 0:g.id)===l.id&&ft((A=b.declaration)==null?void 0:A.dataType,l.dataType)});if(y)(((f=y.declaration)==null?void 0:f.id)!==l.id||!ft((m=y.declaration)==null?void 0:m.dataType,l.dataType))&&(y.setDeclaration(l),e.push(y));else{const b={id:M.UUID.uuid(),version:1,type:i.OutputMap,index:l.index,declaration:l.toJSON(),writesValues:[],parent:this.toReference()},g=R(b,this.project);g.setParent(this),g.initChildren(),g.addSelfToProject(),t.push(g),y=g}y.index!==l.index&&(y.sync({index:l.index}),e.push(y))});const o=s.filter(l=>{const p=a.find(y=>{var f,m;return((f=l.declaration)==null?void 0:f.id)===y.id&&ft((m=l.declaration)==null?void 0:m.dataType,y.dataType)});return this.id==="manual-hello-world-loop-id"&&(p?console.log("found matching declaration: ",p.id+" "+P(p,this.project),`
|
|
54
|
-
output map: `,l.id+" "+P(l,this.project)):console.log("missing declaration for output map: ",l.id+" "+P(l,this.project))),!p});return this.id==="manual-hello-world-loop-id"&&console.log("output maps to remove: ",o.map(l=>l.id+" "+P(l,this.project))),o.forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),r.push(...y)}),this.id==="manual-hello-world-loop-id"&&console.log("allOutputMaps after sync: ",this.outputs.map(l=>l.id+" "+P(l,this.project))),{updated:v(e),added:v(t),removed:v(r),self:this}}syncInputs(){const e=[],t=[],r=[];switch(this.declaration.id){case Q.List:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["list-loop"].inputs.list?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["list-loop"].inputs.list){const s=this.project.get(J[i.Loop]["list-loop"].inputs.list);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["list-loop"].inputs.list),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.ManualFlow:{this.inputs.forEach(a=>{a.remove(),r.push(a)});break}case Q.Counted:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["counted-loop"].inputs.number?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["counted-loop"].inputs.number){const s=this.project.get(J[i.Loop]["counted-loop"].inputs.number);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["counted-loop"].inputs.number),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.ObjectKeys:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["object-keys-loop"].inputs.object?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["object-keys-loop"].inputs.object){const s=this.project.get(J[i.Loop]["object-keys-loop"].inputs.object);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["object-keys-loop"].inputs.object),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.ObjectValues:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["object-values-loop"].inputs.object?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["object-values-loop"].inputs.object){const s=this.project.get(J[i.Loop]["object-values-loop"].inputs.object);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["object-values-loop"].inputs.object),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.String:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["string-loop"].inputs.string?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["string-loop"].inputs.string){const s=this.project.get(J[i.Loop]["string-loop"].inputs.string);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["string-loop"].inputs.string),o={id:M.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}}return{updated:v(e),added:v(t),removed:v(r),self:this}}syncChildren(){const e=[],t=[],r=[],{updated:a,added:s,removed:o}=this.syncInputs();e.push(...a),t.push(...s),r.push(...o);const{updated:l,added:p,removed:y}=this.syncTerminationStatements();e.push(...l),t.push(...p),r.push(...y);const{updated:f,added:m,removed:b}=this.syncBodyArgumentsDeclarations();e.push(...f),t.push(...m),r.push(...b);const{updated:g,added:A,removed:C}=this.syncOutputsDeclarations();e.push(...g),t.push(...A),r.push(...C);const{updated:$,added:Xe,removed:$e}=this.syncOutputMaps();return e.push(...$),t.push(...Xe),r.push(...$e),{self:this,updated:v(e),added:v(t),removed:v(r)}}};c(z,"MUTABLE_BASE_PROPERTIES",[]),c(z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(z,"BASE_PROPERTIES",[...z.MUTABLE_BASE_PROPERTIES,...z.INMUTABLE_BASE_PROPERTIES]),c(z,"MUTABLE_META_PROPERTIES",[...z.MUTABLE_BASE_PROPERTIES,"x","y"]),c(z,"INMUTABLE_META_PROPERTIES",[...z.INMUTABLE_BASE_PROPERTIES]),c(z,"META_PROPERTIES",[...z.MUTABLE_META_PROPERTIES,...z.INMUTABLE_META_PROPERTIES]),c(z,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(z,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(z,"UPSTREAM_PROPERTIES",[...z.MUTABLE_UPSTREAM_PROPERTIES,...z.INMUTABLE_UPSTREAM_PROPERTIES]),c(z,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","outputsDeclarations","successCalls","errorCalls","error","breakStatements","continueStatements"]),c(z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(z,"DOWNSTREAM_PROPERTIES",[...z.MUTABLE_DOWNSTREAM_PROPERTIES,...z.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(z,"PROPERTIES",[...z.META_PROPERTIES,...z.UPSTREAM_PROPERTIES,...z.DOWNSTREAM_PROPERTIES]);let Er=z;function A9(n){const e=AU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate());const s=[...bn(n)];return ee(n.errors,s)}const pe=class pe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Condition);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"declaration");c(this,"inputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const f=O(e.parent);r=t.get(f)}const a=e.calledByEntry.map(f=>{const m=O(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=O(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=O(f);return t.get(m)});let l;if(e.declaration){const f=O(e.declaration);l=t.get(f)}const p={id:e.id,version:1,type:i.Condition,declaration:l,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:r},y=R(p,t);return y.setParent(r),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${i.Condition}' entities.
|
|
53
|
+
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(){const e=[this];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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)}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(r=>r.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),this}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),this}setBody(e){return this.body=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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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}replaceDetachedChild(e,t){const r=this.detachedChildren.indexOf(e);return r!==-1&&(this.detachedChildren[r]=t),this}subscribeDetachedChild(e){return this.detachedChildren.includes(e)||this.detachedChildren.push(e),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),this.initialData.body&&(this.body=R(this.initialData.body,this.project),this.body.setParent(this),this.body.initChildren()),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.syncChildren(),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.body.remove({ignoreUpstream:!0,seenEntities:t}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.body.restore({seenEntities:e}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.process?this.process.toFlat(e):[],...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.error?this.error.toFlat(e):[],...this.body?this.body.toFlat(e):[],...this.continueStatements.flatMap(r=>r.toFlat(e)),...this.breakStatements.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[],...this.body?this.body.toFlatIds(e):[],...this.continueStatements.flatMap(r=>r.toFlatIds(e)),...this.breakStatements.flatMap(r=>r.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:((e=this.process)==null?void 0:e.toJSON())||null,declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),outputsDeclarations:this.outputsDeclarations.map(r=>r.toJSON()),successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),error:((t=this.error)==null?void 0:t.toJSON())||null,body:this.body.toJSON(),parent:this.parent.toReference(),breakStatements:this.breakStatements.map(r=>r.toJSON()),continueStatements:this.continueStatements.map(r=>r.toJSON())}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,body:((t=this.body)==null?void 0:t.toReference())||null,inputs:this.inputs.map(s=>s.toReference()),outputs:this.outputs.map(s=>s.toReference()),outputsDeclarations:this.outputsDeclarations.map(s=>s.toReference()),successCalls:this.successCalls.map(s=>s.toReference()),errorCalls:this.errorCalls.map(s=>s.toReference()),process:((r=this.process)==null?void 0:r.toReference())||null,calledBySuccess:this.calledBySuccess.map(s=>s.toReference()),calledByError:this.calledByError.map(s=>s.toReference()),calledByEntry:this.calledByEntry.map(s=>s.toReference()),continueStatements:this.continueStatements.map(s=>s.toReference()),breakStatements:this.breakStatements.map(s=>s.toReference()),error:((a=this.error)==null?void 0:a.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.body)==null?void 0:r.toFlatJSON(e))||[],...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.continueStatements.flatMap(a=>a.toFlatJSON(e)),...this.breakStatements.flatMap(a=>a.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[],...this.process?this.process.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,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){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.body)==null?void 0:r.toFlatGenerationTarget(e))||[],...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.continueStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.breakStatements.flatMap(a=>a.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[],...this.process?this.process.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),this.continueStatements.forEach(r=>r.clearErrors()),this.breakStatements.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=P9(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.body?this.body.getErrors():[],...this.error?this.error.getErrors():[],...this.process?this.process.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new z(this.toJSON(),this.project)}getVariableInstances(){return this.body?K(this.body).filter(r=>r.type===i.VariableInstance):[]}addReturnStatement(e){return we.includes(this.parent.type)&&this.parent.addReturnStatement(e),this}removeReturnStatement(e){return we.includes(this.parent.type)&&this.parent.removeReturnStatement(e),this}addBreakStatement(e){return this.breakStatements.includes(e)||this.breakStatements.push(e),this}removeBreakStatement(e){const t=this.breakStatements.indexOf(e);return t!==-1&&this.breakStatements.splice(t,1),this}addContinueStatement(e){return this.continueStatements.includes(e)||this.continueStatements.push(e),this}removeContinueStatement(e){const t=this.continueStatements.indexOf(e);return t!==-1&&this.continueStatements.splice(t,1),this}getUniqueReturnDeclarations(){const e=[];return[...this.breakStatements,...this.continueStatements].forEach(r=>{r.outputs.forEach(s=>{e.find(l=>l===s||P(l,this.project)===P(s,this.project)&&Jt(l.dataType,s.dataType))||e.push(s)})}),v(e)}syncTerminationStatements(){const e=[],t=[],r=[],a=this.getUniqueReturnDeclarations(),s=[...this.breakStatements,...this.continueStatements];return a.forEach((o,l)=>{o.index!==l&&(o.sync({index:l}),e.push(o))}),s.forEach(o=>{const l=o.outputs,p=a.filter(y=>!l.find(f=>P(y,this.project)===P(f,this.project)&&Jt(y.dataType,f.dataType)));p.length&&e.push(o),p.forEach(y=>{const f=y.clone(o);f.addSelfToProject(),t.push(f)})}),{updated:v(e),added:v(t),removed:v(r),self:this}}syncBodyArgumentsDeclarations(){const e=[],t=[],r=[],a=this.getUniqueReturnDeclarations(),s=this.body.inputs;return a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let f=s.find(g=>P(g,this.project)===z.fromReturnDeclarationToBodyArgumentDeclarationName(l)&&Jt(g.dataType,l.dataType));if(!f){const g=z.fromReturnDeclarationToBodyArgumentDeclarationName(l),A={id:_.UUID.uuid(),version:1,type:i.ArgumentDeclaration,name:g,description:`Aggretated list of all previously outputted values from each iteration by the output '${P(l,this.project)}'`,dataType:null,index:l.index,required:l.required,parent:this.body.toReference(),writesValues:[]},C=R(A,this.project);C.setParent(this.body),C.initChildren(),C.addSelfToProject(),t.push(C),f=C}f.index!==l.index&&(f.sync({index:l.index}),e.push(f));const m=f.getDataType();let b=m;if(p)if(!m||!Jt(m,p)){if(!b){const g=p.clone(f);g.addSelfToProject(),b=g,t.push(g),e.push(f)}b.merge(p),b.sync({isList:!0})}else b.isList||(b.sync({isList:!0}),e.push(b));if(!p&&!b){const g={id:_.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,andChildrenGroup:[],orChildrenGroup:[],parent:f.toReference()},A=R(g,this.project);A.sync({isList:!0}),A.setParent(f),A.initChildren(),A.addSelfToProject();const C={id:_.UUID.uuid(),version:1,type:i.PrimitiveValue,name:D.JSON,autogeneration:null,valueAsType:null,value:[],parent:A.toReference()},$=R(C,this.project);$.setParent(A),$.initChildren(),$.addSelfToProject(),t.push($),t.push(A)}}),s.filter(l=>l.name==="Current iteration number"||l.name==="Current value"?!1:!a.find(y=>P(l,this.project)===z.fromReturnDeclarationToBodyArgumentDeclarationName(y))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),r.push(...y)}),{updated:v(e),added:v(t),removed:v(r),self:this}}syncOutputsDeclarations(){const e=[],t=[],r=[],a=this.getUniqueReturnDeclarations(),s=this.outputsDeclarations;return a.forEach((l,p)=>{l.index!==p&&(l.sync({index:p}),e.push(l))}),a.forEach(l=>{const p=l.getDataType();let f=s.find(g=>P(g,this.project)===z.fromReturnDeclarationToLoopOutputDeclarationName(l)&&Jt(g.dataType,l.dataType));if(!f){const g=z.fromReturnDeclarationToLoopOutputDeclarationName(l),A={id:_.UUID.uuid(),version:1,type:i.ValueDescriptor,name:g,description:`Aggretated list of all previously outputted values from each iteration by the output '${P(l,this.project)}'`,dataType:null,index:l.index,required:l.required,parent:this.toReference()},C=R(A,this.project);C.setParent(this),C.initChildren(),C.addSelfToProject(),t.push(C),f=C}f.index!==l.index&&(f.sync({index:l.index}),e.push(f));let b=f.getDataType();if(p)if(!b||!Jt(b,p)){if(!b){const g=p.clone(f);g.addSelfToProject(),b=g,t.push(g),e.push(f)}b.merge(p),b.sync({isList:!0})}else b.isList||(b.sync({isList:!0}),e.push(b));if(!p&&!b){const g={id:_.UUID.uuid(),version:1,type:i.DataType,isList:!0,entity:null,isNullable:!1,constant:!1,defaultValue:null,asType:!1,andChildrenGroup:[],orChildrenGroup:[],parent:f.toReference()},A=R(g,this.project);A.sync({isList:!0}),A.setParent(f),A.initChildren(),A.addSelfToProject();const C={id:_.UUID.uuid(),version:1,type:i.PrimitiveValue,name:D.JSON,autogeneration:null,valueAsType:null,value:[],parent:A.toReference()},$=R(C,this.project);$.setParent(A),$.initChildren(),$.addSelfToProject(),t.push($),t.push(A)}}),s.filter(l=>!a.find(y=>P(l,this.project)===z.fromReturnDeclarationToLoopOutputDeclarationName(y))).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),r.push(...y)}),{updated:v(e),added:v(t),removed:v(r),self:this}}syncOutputMaps(){const e=[],t=[],r=[],a=this.outputsDeclarations,s=this.outputs;return a.forEach(l=>{var f;let y=s.find(m=>{var b,g;return((b=m.declaration)==null?void 0:b.id)===l.id&&Jt((g=m.declaration)==null?void 0:g.dataType,l.dataType)});if(y)((f=y.declaration)==null?void 0:f.id)!==l.id&&(y.setDeclaration(l),e.push(y));else{const m={id:_.UUID.uuid(),version:1,type:i.OutputMap,index:l.index,declaration:l.toJSON(),writesValues:[],parent:this.toReference()},b=R(m,this.project);b.setParent(this),b.initChildren(),b.addSelfToProject(),t.push(b),y=b}y.index!==l.index&&(y.sync({index:l.index}),e.push(y))}),s.filter(l=>!a.find(y=>{var f;return((f=l.declaration)==null?void 0:f.id)===y.id})).forEach(l=>{const{affected:p,removed:y}=l.remove({ignoreUpstream:!1,seenEntities:new Set});e.push(...p),r.push(...y)}),{updated:v(e),added:v(t),removed:v(r),self:this}}syncInputs(){const e=[],t=[],r=[];switch(this.declaration.id){case Q.List:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["list-loop"].inputs.list?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["list-loop"].inputs.list){const s=this.project.get(J[i.Loop]["list-loop"].inputs.list);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["list-loop"].inputs.list),o={id:_.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.ManualFlow:{this.inputs.forEach(a=>{a.remove(),r.push(a)});break}case Q.Counted:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["counted-loop"].inputs.number?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["counted-loop"].inputs.number){const s=this.project.get(J[i.Loop]["counted-loop"].inputs.number);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["counted-loop"].inputs.number),o={id:_.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.ObjectKeys:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["object-keys-loop"].inputs.object?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["object-keys-loop"].inputs.object){const s=this.project.get(J[i.Loop]["object-keys-loop"].inputs.object);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["object-keys-loop"].inputs.object),o={id:_.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.ObjectValues:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["object-values-loop"].inputs.object?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["object-values-loop"].inputs.object){const s=this.project.get(J[i.Loop]["object-values-loop"].inputs.object);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["object-values-loop"].inputs.object),o={id:_.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}case Q.String:{let a=null;if(this.inputs.forEach(s=>{var o;((o=s.declaration)==null?void 0:o.id)===J[i.Loop]["string-loop"].inputs.string?a=s:(s.remove(),r.push(s))}),a){if(a.declaration.id!==J[i.Loop]["string-loop"].inputs.string){const s=this.project.get(J[i.Loop]["string-loop"].inputs.string);a.setDeclaration(s),e.push(a)}}else{const s=this.project.get(J[i.Loop]["string-loop"].inputs.string),o={id:_.UUID.uuid(),version:1,type:i.InputMap,name:null,description:null,index:0,declaration:s.toJSON(),readsValue:null,defaultValue:null,dynamicArguments:[],parent:this.toReference()},l=R(o,this.project);l.initChildren(),l.setParent(this),l.addSelfToProject(),t.push(l)}break}}return{updated:v(e),added:v(t),removed:v(r),self:this}}syncChildren(){const e=[],t=[],r=[],{updated:a,added:s,removed:o}=this.syncInputs();e.push(...a),t.push(...s),r.push(...o);const{updated:l,added:p,removed:y}=this.syncTerminationStatements();e.push(...l),t.push(...p),r.push(...y);const{updated:f,added:m,removed:b}=this.syncBodyArgumentsDeclarations();e.push(...f),t.push(...m),r.push(...b);const{updated:g,added:A,removed:C}=this.syncOutputsDeclarations();e.push(...g),t.push(...A),r.push(...C);const{updated:$,added:Xe,removed:$e}=this.syncOutputMaps();return e.push(...$),t.push(...Xe),r.push(...$e),{self:this,updated:v(e),added:v(t),removed:v(r)}}};c(z,"MUTABLE_BASE_PROPERTIES",[]),c(z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(z,"BASE_PROPERTIES",[...z.MUTABLE_BASE_PROPERTIES,...z.INMUTABLE_BASE_PROPERTIES]),c(z,"MUTABLE_META_PROPERTIES",[...z.MUTABLE_BASE_PROPERTIES,"x","y"]),c(z,"INMUTABLE_META_PROPERTIES",[...z.INMUTABLE_BASE_PROPERTIES]),c(z,"META_PROPERTIES",[...z.MUTABLE_META_PROPERTIES,...z.INMUTABLE_META_PROPERTIES]),c(z,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(z,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(z,"UPSTREAM_PROPERTIES",[...z.MUTABLE_UPSTREAM_PROPERTIES,...z.INMUTABLE_UPSTREAM_PROPERTIES]),c(z,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","outputsDeclarations","successCalls","errorCalls","error","breakStatements","continueStatements"]),c(z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(z,"DOWNSTREAM_PROPERTIES",[...z.MUTABLE_DOWNSTREAM_PROPERTIES,...z.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(z,"PROPERTIES",[...z.META_PROPERTIES,...z.UPSTREAM_PROPERTIES,...z.DOWNSTREAM_PROPERTIES]);let Er=z;function A9(n){const e=AU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(o=>o.validate());const s=[...bn(n)];return ee(n.errors,s)}const pe=class pe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.Condition);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"declaration");c(this,"inputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const f=O(e.parent);r=t.get(f)}const a=e.calledByEntry.map(f=>{const m=O(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=O(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=O(f);return t.get(m)});let l;if(e.declaration){const f=O(e.declaration);l=t.get(f)}const p={id:e.id,version:1,type:i.Condition,declaration:l,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:r},y=R(p,t);return y.setParent(r),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),e.declaration?t.get(e.declaration)?t.conditionDeclarations.find(p=>p.id===e.declaration)||a.push(new E({id:`${e.id}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't pointing to an action descriptor reserved for '${i.Condition}' entities.
|
|
55
54
|
${co(t)}`,issue:null})):a.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' has an 'declaration' property that isn't found in the project. The 'declaration' property must point to one of the built-in action descriptors reserved for '${i.Condition}' entities.
|
|
56
55
|
${co(t)}`,issue:null})):a.push(new E({id:`${e.id}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type '${e.type}' with id '${e.id}' is missing the 'declaration' property. This property is required for a '${e.type}' entity and must point to one of the built-in action descriptors reserved for '${i.Condition}' entities.
|
|
57
56
|
${co(t)}`,issue:null})),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
58
|
-
If an entity is called by another, they must be in the same scope, which means they have the same parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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}removeOutput(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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)}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}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(r=>r.toFlat(e)),...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(e=>e.toJSON()),errorCalls:this.errorCalls.map(e=>e.toJSON()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),inputs:this.inputs.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(),inputs:this.inputs.map(e=>e.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()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this}validate(){const e=A9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new pe(this.toJSON(),this.project)}};c(pe,"MUTABLE_BASE_PROPERTIES",["operator"]),c(pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"MUTABLE_META_PROPERTIES",["x","y"]),c(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),c(pe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(pe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),c(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let Rr=pe;class dv{constructor(){c(this,"initialData")}}class S9{}class O9 extends dv{}class C9{}class B9{}class w9{}class fd{}class _9 extends fd{}class M9 extends fd{}class N9{}class ha{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==i.GenericReference)e.readsValue=R(e.initialData.readsValue,e.project);else if(e.initialData.readsValue&&e.initialData.readsValue.type===i.GenericReference){const t=Mt(e.initialData.readsValue,e.project);t&&(e.readsValue=t)}if(e.readsValue){if(Fe.includes(e.readsValue.type)){let t=e.parent;lt.includes(t.type)||(t=t.parent),e.readsValue.setParent(t),e.readsValue.initChildren(),t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):t.subscribeDetachedChild(e.readsValue)}e.readsValue.addValueReader(e)}return e.readsValue}}class fa{static initWritesValues(e,t){const r=e.initialData.writesValues.reduce((s,o)=>{if(o.type===i.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const l=R(o,e.project);return l.setValueWriter(e),Fe.includes(l.type)&&(l.setParent(t),l.initChildren()),[...s,l]},[]),a=[...e.writesValues];return e.writesValues=v([...a,...r]),e.writesValues}}class V9{}function $9(n){var l;const e=px(),t=n.toJSON();e.safeParse(t).success,(l=n.dataType)==null||l.validate(),n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),n.internalCalls.forEach(p=>p.validate());const s=[...bn(n)];if(n.id==="random-company-employee-test-variable-id"){const p=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(p.error)}if(n.id==="company-dto-variable-one-id"){const p=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(p.error)}const o=Dd(n);return s.push(...o),ee(n.errors,s)}const ie=class ie{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"dataType",null);c(this,"x");c(this,"y");c(this,"type",i.VariableDeclaration);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"parent");c(this,"variableInstances",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const f=O(e.parent);r=t.get(f)}const a=e.calledByEntry.map(f=>{const m=O(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=O(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=O(f);return t.get(m)});let l=null;if(e.readsValue){const f=O(e.readsValue);l=t.get(f)}const p={id:e.id,version:1,type:i.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:l,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:r},y=R(p,t);return y.setParent(r),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);r=s.modifiedData;const o=dd(r,t);return a.push(...s.errors,...o,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=Ta(r,this);return r=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
57
|
+
If an entity is called by another, they must be in the same scope, which means they have the same parent.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent===this.project&&this.project.addCondition(this),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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}removeOutput(e){return 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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){return this.initialized?this:(this.initialized=!0,this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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)}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}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.inputs.flatMap(r=>r.toFlat(e)),...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toJSON(),successCalls:this.successCalls.map(e=>e.toJSON()),errorCalls:this.errorCalls.map(e=>e.toJSON()),calledBySuccess:this.calledBySuccess.map(e=>e.toReference()),calledByError:this.calledByError.map(e=>e.toReference()),calledByEntry:this.calledByEntry.map(e=>e.toReference()),inputs:this.inputs.map(e=>e.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:this.declaration.toReference(),inputs:this.inputs.map(e=>e.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()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this}validate(){const e=A9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new pe(this.toJSON(),this.project)}};c(pe,"MUTABLE_BASE_PROPERTIES",["operator"]),c(pe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(pe,"BASE_PROPERTIES",[...pe.MUTABLE_BASE_PROPERTIES,...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"MUTABLE_META_PROPERTIES",["x","y"]),c(pe,"INMUTABLE_META_PROPERTIES",[...pe.INMUTABLE_BASE_PROPERTIES]),c(pe,"META_PROPERTIES",[...pe.MUTABLE_META_PROPERTIES,...pe.INMUTABLE_META_PROPERTIES]),c(pe,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(pe,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(pe,"UPSTREAM_PROPERTIES",[...pe.MUTABLE_UPSTREAM_PROPERTIES,...pe.INMUTABLE_UPSTREAM_PROPERTIES]),c(pe,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs"]),c(pe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(pe,"DOWNSTREAM_PROPERTIES",[...pe.MUTABLE_DOWNSTREAM_PROPERTIES,...pe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(pe,"PROPERTIES",[...pe.META_PROPERTIES,...pe.UPSTREAM_PROPERTIES,...pe.DOWNSTREAM_PROPERTIES]);let Rr=pe;class dv{constructor(){c(this,"initialData")}}class S9{}class O9 extends dv{}class C9{}class B9{}class w9{}class fd{}class M9 extends fd{}class _9 extends fd{}class N9{}class ha{static initReadsValue(e){if(e.initialData.readsValue&&e.initialData.readsValue.type!==i.GenericReference)e.readsValue=R(e.initialData.readsValue,e.project);else if(e.initialData.readsValue&&e.initialData.readsValue.type===i.GenericReference){const t=Mt(e.initialData.readsValue,e.project);t&&(e.readsValue=t)}if(e.readsValue){if(Fe.includes(e.readsValue.type)){let t=e.parent;lt.includes(t.type)||(t=t.parent),e.readsValue.setParent(t),e.readsValue.initChildren(),t.detachedChildren.includes(e)?t.replaceDetachedChild(e,e.readsValue):t.subscribeDetachedChild(e.readsValue)}e.readsValue.addValueReader(e)}return e.readsValue}}class fa{static initWritesValues(e,t){const r=e.initialData.writesValues.reduce((s,o)=>{if(o.type===i.GenericReference||e.writesValues.some(p=>p.id===o.id))return s;const l=R(o,e.project);return l.setValueWriter(e),Fe.includes(l.type)&&(l.setParent(t),l.initChildren()),[...s,l]},[]),a=[...e.writesValues];return e.writesValues=v([...a,...r]),e.writesValues}}class V9{}function $9(n){var l;const e=px(),t=n.toJSON();e.safeParse(t).success,(l=n.dataType)==null||l.validate(),n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),n.internalCalls.forEach(p=>p.validate());const s=[...bn(n)];if(n.id==="random-company-employee-test-variable-id"){const p=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(p.error)}if(n.id==="company-dto-variable-one-id"){const p=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(p.error)}const o=Pd(n);return s.push(...o),ee(n.errors,s)}const ie=class ie{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"dataType",null);c(this,"x");c(this,"y");c(this,"type",i.VariableDeclaration);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"parent");c(this,"variableInstances",[]);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const f=O(e.parent);r=t.get(f)}const a=e.calledByEntry.map(f=>{const m=O(f);return t.get(m)}),s=e.calledBySuccess.map(f=>{const m=O(f);return t.get(m)}),o=e.calledByError.map(f=>{const m=O(f);return t.get(m)});let l=null;if(e.readsValue){const f=O(e.readsValue);l=t.get(f)}const p={id:e.id,version:1,type:i.VariableDeclaration,name:e.name,description:e.description,calledByEntry:a,calledBySuccess:s,calledByError:o,dataType:null,errorCalls:[],successCalls:[],internalCalls:[],readsValue:l,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:r},y=R(p,t);return y.setParent(r),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);r=s.modifiedData;const o=dd(r,t);return a.push(...s.errors,...o,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=Ta(r,this);return r=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
59
58
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
60
59
|
Specifically for variables, their scope is also calculated from their value readers and value writters.
|
|
61
|
-
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){const e=[this];return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){return this.internalCalls.filter(e=>!e.calledBy.length)}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),fa.initWritesValues(this,this.parent),ha.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.initialData.inputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),this.initialData.internalCalls.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInternalCall(t),t}),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}subscribeInstance(e){return this.variableInstances.includes(e)?this:(this.variableInstances.push(e),this)}removeInstance(e){return this.variableInstances=this.variableInstances.filter(t=>t.id!==e.id),this}getMasterInputWithValueWritterFromAllInstances(e){return v([...this.inputs,...this.variableInstances.flatMap(a=>a.inputs)]).find(a=>P(a,this.project)===P(e,this.project)&&!!a.readsValue)||e}inferDataTypeAndSyncInstancesInputsAndOutputs(){var r,a;if(!this.dataType){const s=R({id:this.id+"--infered-data-type",version:1,type:i.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:this.toReference()},this.project);s.inferred=!0,s.setParent(this),s.initChildren(),this.setDataType(s)}if(this.readsValue){const s=(r=this.readsValue.getDataType())==null?void 0:r.clone(this);return s&&(s.inferred=!0,this.setDataType(s)),this}const e=v([...this.inputs,...this.variableInstances.flatMap(s=>s.inputs)]),t=[];return e.forEach(s=>{t.find(l=>P(l,this.project)===P(s,this.project))||t.push(s)}),t.length?((a=this.dataType)==null||a.inferFromInputs(t),this.dataType?(this.generateUnusedInputs(),this.generateUnusedOutputs(),this.variableInstances.forEach(s=>{s.generateUnusedInputs(),s.generateUnusedOutputs()}),this):this):this}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.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(a)}}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.internalCalls.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e)),...this.successCalls.flatMap(a=>a.toFlat(e)),...this.errorCalls.flatMap(a=>a.toFlat(e)),...this.inputs.flatMap(a=>a.toFlat(e)),...this.outputs.flatMap(a=>a.toFlat(e)),...this.internalCalls.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.toFlatIds(e)),...this.successCalls.flatMap(a=>a.toFlatIds(e)),...this.errorCalls.flatMap(a=>a.toFlatIds(e)),...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.outputs.flatMap(a=>a.toFlatIds(e)),...this.internalCalls.flatMap(a=>a.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toJSON()),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),internalCalls:this.internalCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toReference()),inputs:this.inputs.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toReference()),successCalls:this.successCalls.map(r=>r.toReference()),errorCalls:this.errorCalls.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),internalCalls:this.internalCalls.map(r=>r.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,name:this.name,description:this.description,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.dataType)==null?void 0:r.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),this.internalCalls.forEach(t=>t.clearErrors()),(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=$9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,r;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((r=this.readsValue)==null?void 0:r.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ie(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const r={id:t.id||M.UUID.uuid(),version:t.version||1,type:i.VariableInstance,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],writesValues:t.writesValues||[],internalCalls:t.internalCalls||[],readsValue:t.readsValue||null,calledByEntry:t.calledByEntry||[],calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],declaration:this.toJSON(),x:0,y:0},a=R(r,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addVariableInstance(a),a}generateUnusedInputs(){if(this.dataType)if(this.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type)){const e=[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>P(y,this.project)===P(s,this.project));if(!o)return;const l=this.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=en(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:M.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>P(l,this.project)===P(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties].filter(r=>!this.outputs.find(a=>a.declaration===r)).map(r=>{const a={id:M.UUID.uuid(),version:1,type:i.OutputMap,parent:this.toReference(),declaration:r,index:r.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.dataType)if(this.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.getAllInteractiveMethods()].filter(r=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===r.id})).map(r=>{const a=r.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this.dataType||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(ie,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(ie,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ie,"BASE_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,...ie.INMUTABLE_BASE_PROPERTIES]),c(ie,"MUTABLE_META_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ie,"INMUTABLE_META_PROPERTIES",[...ie.INMUTABLE_BASE_PROPERTIES]),c(ie,"META_PROPERTIES",[...ie.MUTABLE_META_PROPERTIES,...ie.INMUTABLE_META_PROPERTIES]),c(ie,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(ie,"UPSTREAM_PROPERTIES",[...ie.MUTABLE_UPSTREAM_PROPERTIES,...ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ie,"DOWNSTREAM_PROPERTIES",[...ie.MUTABLE_DOWNSTREAM_PROPERTIES,...ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ie,"PROPERTIES",[...ie.META_PROPERTIES,...ie.UPSTREAM_PROPERTIES,...ie.DOWNSTREAM_PROPERTIES]);let br=ie;function L9(n){const e=Tx(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(l=>l.validate()),n.outputs.forEach(l=>l.validate()),n.internalCalls.forEach(l=>l.validate());const s=[...bn(n)];if(n.id==="exec-sequentially-result-variable-id"){const l=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(l.error)}const o=Dd(n);return s.push(...o),ee(n.errors,s)}const ae=class ae{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.VariableInstance);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const b=O(e.parent);r=t.get(b)}const a=O(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const g=O(b);return t.get(g)}),l=e.calledBySuccess.map(b=>{const g=O(b);return t.get(g)}),p=e.calledByError.map(b=>{const g=O(b);return t.get(g)});let y=null;if(e.readsValue){const b=O(e.readsValue);y=t.get(b)}const f={id:e.id,version:1,type:i.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:y,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:r},m=R(f,t);return m.setParent(r),m.initChildren(),m}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0},declaration:{list:!1,types:[i.VariableDeclaration]}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=Ta(r,this);return r=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
60
|
+
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){const e=[this];return this.parent===this.project&&this.project.addVariableDeclaration(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){return this.internalCalls.filter(e=>!e.calledBy.length)}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),fa.initWritesValues(this,this.parent),ha.initReadsValue(this),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.initialData.inputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInput(t),t}),this.initialData.outputs.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addOutput(t),t}),this.initialData.internalCalls.forEach(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),this.addInternalCall(t),t}),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}subscribeInstance(e){return this.variableInstances.includes(e)?this:(this.variableInstances.push(e),this)}removeInstance(e){return this.variableInstances=this.variableInstances.filter(t=>t.id!==e.id),this}getMasterInputWithValueWritterFromAllInstances(e){return v([...this.inputs,...this.variableInstances.flatMap(a=>a.inputs)]).find(a=>P(a,this.project)===P(e,this.project)&&!!a.readsValue)||e}inferDataTypeAndSyncInstancesInputsAndOutputs(){var r,a;if(!this.dataType){const s=R({id:this.id+"--infered-data-type",version:1,type:i.DataType,isList:!1,isNullable:!1,andChildrenGroup:null,orChildrenGroup:null,asType:!1,entity:null,constant:!1,defaultValue:null,parent:this.toReference()},this.project);s.inferred=!0,s.setParent(this),s.initChildren(),this.setDataType(s)}if(this.readsValue){const s=(r=this.readsValue.getDataType())==null?void 0:r.clone(this);return s&&(s.inferred=!0,this.setDataType(s)),this}const e=v([...this.inputs,...this.variableInstances.flatMap(s=>s.inputs)]),t=[];return e.forEach(s=>{t.find(l=>P(l,this.project)===P(s,this.project))||t.push(s)}),t.length?((a=this.dataType)==null||a.inferFromInputs(t),this.dataType?(this.generateUnusedInputs(),this.generateUnusedOutputs(),this.variableInstances.forEach(s=>{s.generateUnusedInputs(),s.generateUnusedOutputs()}),this):this):this}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.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(a)}}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];if(this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.internalCalls.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[],...this.writesValues.flatMap(a=>a.toFlat(e)),...this.successCalls.flatMap(a=>a.toFlat(e)),...this.errorCalls.flatMap(a=>a.toFlat(e)),...this.inputs.flatMap(a=>a.toFlat(e)),...this.outputs.flatMap(a=>a.toFlat(e)),...this.internalCalls.flatMap(a=>a.toFlat(e))])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[],...this.writesValues.flatMap(a=>a.toFlatIds(e)),...this.successCalls.flatMap(a=>a.toFlatIds(e)),...this.errorCalls.flatMap(a=>a.toFlatIds(e)),...this.inputs.flatMap(a=>a.toFlatIds(e)),...this.outputs.flatMap(a=>a.toFlatIds(e)),...this.internalCalls.flatMap(a=>a.toFlatIds(e))])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toJSON()),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),internalCalls:this.internalCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toReference()),inputs:this.inputs.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toReference()),successCalls:this.successCalls.map(r=>r.toReference()),errorCalls:this.errorCalls.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),internalCalls:this.internalCalls.map(r=>r.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,name:this.name,description:this.description,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.dataType)==null?void 0:r.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...this.successCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(a=>a.toFlatGenerationTarget(e)),...this.inputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.outputs.flatMap(a=>a.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(a=>a.toFlatGenerationTarget(e))])}clearErrors(){var e;return this.errors=[],this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),this.internalCalls.forEach(t=>t.clearErrors()),(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=$9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t,r;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[],...this.inputs.flatMap(a=>a.getErrors()),...this.internalCalls.flatMap(a=>a.getErrors()),...this.outputs.flatMap(a=>a.getErrors()),...((r=this.readsValue)==null?void 0:r.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e){return new ie(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}createInstance(e=this.project,t={}){const r={id:t.id||_.UUID.uuid(),version:t.version||1,type:i.VariableInstance,parent:e.toReference(),successCalls:t.successCalls||[],errorCalls:t.errorCalls||[],inputs:t.inputs||[],outputs:t.outputs||[],writesValues:t.writesValues||[],internalCalls:t.internalCalls||[],readsValue:t.readsValue||null,calledByEntry:t.calledByEntry||[],calledBySuccess:t.calledBySuccess||[],calledByError:t.calledByError||[],declaration:this.toJSON(),x:0,y:0},a=R(r,this.project);return a.setParent(e),a.initChildren(),e===this.project&&this.project.addVariableInstance(a),a}generateUnusedInputs(){if(this.dataType)if(this.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type)){const e=[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>P(y,this.project)===P(s,this.project));if(!o)return;const l=this.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=en(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:_.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>P(l,this.project)===P(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.dataType)if(this.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.properties,...this.dataType.entity.extendedProperties].filter(r=>!this.outputs.find(a=>a.declaration===r)).map(r=>{const a={id:_.UUID.uuid(),version:1,type:i.OutputMap,parent:this.toReference(),declaration:r,index:r.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.dataType)if(this.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.dataType.entity.type))return[...this.dataType.entity.getAllInteractiveMethods()].filter(r=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===r.id})).map(r=>{const a=r.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}getDataType(){return(!this.dataType||this.dataType.inferred)&&this.inferDataTypeAndSyncInstancesInputsAndOutputs(),this.dataType||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(ie,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(ie,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ie,"BASE_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,...ie.INMUTABLE_BASE_PROPERTIES]),c(ie,"MUTABLE_META_PROPERTIES",[...ie.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ie,"INMUTABLE_META_PROPERTIES",[...ie.INMUTABLE_BASE_PROPERTIES]),c(ie,"META_PROPERTIES",[...ie.MUTABLE_META_PROPERTIES,...ie.INMUTABLE_META_PROPERTIES]),c(ie,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(ie,"UPSTREAM_PROPERTIES",[...ie.MUTABLE_UPSTREAM_PROPERTIES,...ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ie,"DOWNSTREAM_PROPERTIES",[...ie.MUTABLE_DOWNSTREAM_PROPERTIES,...ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ie,"PROPERTIES",[...ie.META_PROPERTIES,...ie.UPSTREAM_PROPERTIES,...ie.DOWNSTREAM_PROPERTIES]);let br=ie;function L9(n){const e=Tx(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(l=>l.validate()),n.outputs.forEach(l=>l.validate()),n.internalCalls.forEach(l=>l.validate());const s=[...bn(n)];if(n.id==="exec-sequentially-result-variable-id"){const l=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(l.error)}const o=Pd(n);return s.push(...o),ee(n.errors,s)}const ae=class ae{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.VariableInstance);c(this,"writesValues",[]);c(this,"readsValue",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"internalCalls",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const b=O(e.parent);r=t.get(b)}const a=O(e.declaration),s=t.get(a),o=e.calledByEntry.map(b=>{const g=O(b);return t.get(g)}),l=e.calledBySuccess.map(b=>{const g=O(b);return t.get(g)}),p=e.calledByError.map(b=>{const g=O(b);return t.get(g)});let y=null;if(e.readsValue){const b=O(e.readsValue);y=t.get(b)}const f={id:e.id,version:1,type:i.VariableInstance,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],internalCalls:[],readsValue:y,inputs:[],outputs:[],writesValues:[],x:0,y:0,parent:r},m=R(f,t);return m.setParent(r),m.initChildren(),m}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0},declaration:{list:!1,types:[i.VariableDeclaration]}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=Ta(r,this);return r=a.modifiedData,t.push(...a.errors),e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
62
61
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
63
62
|
Specifically for variables, their scope is also calculated from their value readers and value writters.
|
|
64
|
-
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){const e=[this];return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){const e=this.usedInternalCalls;return this.internalCalls.filter(r=>!(e.find(o=>o.id===r.id)||e.find(o=>o.declaration===r.declaration)))}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}setParent(e){return this.parent=e,this}initChildren(){var e;if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===i.GenericReference){const t=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!t)return this;this.declaration=t}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return fa.initWritesValues(this,this.parent),ha.initReadsValue(this),this.initialData.inputs.forEach(t=>{const r=R(t,this.project);return r.setParent(this),r.initChildren(),this.addInput(r),r}),this.initialData.outputs.forEach(t=>{const r=R(t,this.project);return r.setParent(this),r.initChildren(),this.addOutput(r),r}),this.successCalls=this.initialData.successCalls.map(t=>{const r=R(t,this.project);return r.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(r.type)?(r.setParent(this.parent.parent),r.initChildren()):r.type!==i.InternalCall&&(r.setParent(this.parent),r.initChildren()),r}),this.errorCalls=this.initialData.errorCalls.map(t=>{const r=R(t,this.project);return r.addErrorCaller(this),[i.BreakStatement,i.ContinueStatement].includes(r.type)?(r.setParent(this.parent.parent),r.initChildren()):r.type!==i.InternalCall&&(r.setParent(this.parent),r.initChildren()),r}),this.internalCalls=this.initialData.internalCalls.reduce((t,r)=>{if(r.type===i.GenericReference){const a=this.project.findSubscribedInstanceFromReference(r);if(!a)return t;const s=a;return s.setParent(this),[...t,s]}else{const a=R(r,this.project);return a.setParent(this),a.initChildren(),[...t,a]}},[]),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),this.declaration.subscribeInstance(this),(!this.declaration.dataType||(e=this.declaration.dataType)!=null&&e.inferred)&&this.declaration.inferDataTypeAndSyncInstancesInputsAndOutputs(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),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.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),this.declaration.removeInstance(this),{affected:v(r),removed:v(a)})}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.internalCalls.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),this.declaration.subscribeInstance(this),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(r=>r.toFlat(e)),...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.internalCalls.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(r=>r.toFlatIds(e)),...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.internalCalls.flatMap(r=>r.toFlatIds(e))])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,declaration:this.declaration.toReference(),readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,writesValues:this.writesValues.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),internalCalls:this.internalCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toReference()),inputs:this.inputs.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toReference()),successCalls:this.successCalls.map(r=>r.toReference()),errorCalls:this.errorCalls.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),internalCalls:this.internalCalls.map(r=>r.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.declaration)==null?void 0:r.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var r,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.declaration)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.readsValue)==null?void 0:a.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(s=>s.toFlatGenerationTarget(e)),...this.successCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.inputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.outputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(s=>s.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.outputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this.internalCalls.forEach(e=>e.clearErrors()),this}validate(){const e=L9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...this.internalCalls.flatMap(r=>r.getErrors()),...this.outputs.flatMap(r=>r.getErrors()),...((t=this.readsValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new ae(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}setDeclaration(e){return this.declaration!==e&&(this.declaration=e),this}generateUnusedInputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type)){const e=[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>P(y,this.project)===P(s,this.project));if(!o)return;const l=this.declaration.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=en(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:M.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>P(l,this.project)===P(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties].filter(r=>!this.outputs.find(a=>a.declaration===r)).map(r=>{const a={id:M.UUID.uuid(),version:1,type:i.OutputMap,parent:this.toReference(),declaration:r,index:r.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.getAllInteractiveMethods()].filter(r=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===r.id})).map(r=>{const a=r.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(ae,"MUTABLE_BASE_PROPERTIES",[]),c(ae,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ae,"BASE_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,...ae.INMUTABLE_BASE_PROPERTIES]),c(ae,"MUTABLE_META_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ae,"INMUTABLE_META_PROPERTIES",[...ae.INMUTABLE_BASE_PROPERTIES]),c(ae,"META_PROPERTIES",[...ae.MUTABLE_META_PROPERTIES,...ae.INMUTABLE_META_PROPERTIES]),c(ae,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(ae,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(ae,"UPSTREAM_PROPERTIES",[...ae.MUTABLE_UPSTREAM_PROPERTIES,...ae.INMUTABLE_UPSTREAM_PROPERTIES]),c(ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ae,"DOWNSTREAM_PROPERTIES",[...ae.MUTABLE_DOWNSTREAM_PROPERTIES,...ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ae,"PROPERTIES",[...ae.META_PROPERTIES,...ae.UPSTREAM_PROPERTIES,...ae.DOWNSTREAM_PROPERTIES]);let gr=ae;function G9(n){var s;const e=cU(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return ee(n.errors,a)}const ye=class ye{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"isError");c(this,"type",i.ReturnDeclaration);c(this,"dataType",null);c(this,"readsValue",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.isError=e.isError}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r);let s=null;if(e.readsValue){const p=O(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:i.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,required:e.required,readsValue:s,dataType:null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l,p;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.ReturnStatement,i.Search,i.BreakStatement,i.ContinueStatement]}},t),o=yd(r,t);if(r=s.modifiedData,r.parent){const y=t.get(O(r.parent));if(y&&[i.BreakStatement,i.ContinueStatement].includes(y.type)){const f=y,m=f.parent,b=[...m.breakStatements.filter(A=>A.id!==y.id),...m.continueStatements.filter(A=>A.id!==y.id)];if(f.outputs.length)a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${r.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This '${f.type}' already has return declarations.
|
|
63
|
+
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its value readers, value writters, or callers.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){const e=[this];return this.parent===this.project&&this.project.addVariableInstance(this),this.readsValue&&(this.readsValue.addValueReader(this),e.push(this.readsValue)),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}get usedInputs(){return this.inputs.filter(e=>e.readsValue||e.dynamicArguments.length||e.defaultValue)}get unusedInputs(){return this.inputs.filter(e=>!e.readsValue&&!e.dynamicArguments.length&&!e.defaultValue)}get usedOutputs(){return this.outputs.filter(e=>e.writesValues.length)}get unusedOutputs(){return this.outputs.filter(e=>!e.writesValues.length)}get usedInternalCalls(){return this.internalCalls.filter(e=>!!e.calledBy.length)}get unusedInternalCalls(){const e=this.usedInternalCalls;return this.internalCalls.filter(r=>!(e.find(o=>o.id===r.id)||e.find(o=>o.declaration===r.declaration)))}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}setParent(e){return this.parent=e,this}initChildren(){var e;if(this.initialized)return this;if(this.initialized=!0,this.initialData.declaration.type===i.GenericReference){const t=this.project.findSubscribedInstanceFromReference(this.initialData.declaration);if(!t)return this;this.declaration=t}else this.declaration=R(this.initialData.declaration,this.project),this.declaration.setParent(this.parent),this.declaration.initChildren();return fa.initWritesValues(this,this.parent),ha.initReadsValue(this),this.initialData.inputs.forEach(t=>{const r=R(t,this.project);return r.setParent(this),r.initChildren(),this.addInput(r),r}),this.initialData.outputs.forEach(t=>{const r=R(t,this.project);return r.setParent(this),r.initChildren(),this.addOutput(r),r}),this.successCalls=this.initialData.successCalls.map(t=>{const r=R(t,this.project);return r.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(r.type)?(r.setParent(this.parent.parent),r.initChildren()):r.type!==i.InternalCall&&(r.setParent(this.parent),r.initChildren()),r}),this.errorCalls=this.initialData.errorCalls.map(t=>{const r=R(t,this.project);return r.addErrorCaller(this),[i.BreakStatement,i.ContinueStatement].includes(r.type)?(r.setParent(this.parent.parent),r.initChildren()):r.type!==i.InternalCall&&(r.setParent(this.parent),r.initChildren()),r}),this.internalCalls=this.initialData.internalCalls.reduce((t,r)=>{if(r.type===i.GenericReference){const a=this.project.findSubscribedInstanceFromReference(r);if(!a)return t;const s=a;return s.setParent(this),[...t,s]}else{const a=R(r,this.project);return a.setParent(this),a.initChildren(),[...t,a]}},[]),this.generateUnusedInputs(),this.generateUnusedOutputs(),this.generateUnusedInternalCalls(),this.declaration.subscribeInstance(this),(!this.declaration.dataType||(e=this.declaration.dataType)!=null&&e.inferred)&&this.declaration.inferDataTypeAndSyncInstancesInputsAndOutputs(),this}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,this}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),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.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.internalCalls.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),this.declaration.removeInstance(this),{affected:v(r),removed:v(a)})}restore({seenEntities:e}={seenEntities:new Set}){this.subscribe();const t=[];return this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.internalCalls.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),this.declaration.subscribeInstance(this),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(r=>r.toFlat(e)),...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.internalCalls.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(r=>r.toFlatIds(e)),...this.successCalls.flatMap(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.internalCalls.flatMap(r=>r.toFlatIds(e))])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,declaration:this.declaration.toReference(),readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,writesValues:this.writesValues.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),internalCalls:this.internalCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,declaration:((e=this.declaration)==null?void 0:e.toReference())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,writesValues:this.writesValues.map(r=>r.toReference()),inputs:this.inputs.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toReference()),successCalls:this.successCalls.map(r=>r.toReference()),errorCalls:this.errorCalls.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),internalCalls:this.internalCalls.map(r=>r.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.declaration)==null?void 0:r.toFlatJSON(e))||[],...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...this.successCalls.flatMap(a=>a.toFlatJSON(e)),...this.errorCalls.flatMap(a=>a.toFlatJSON(e)),...this.inputs.flatMap(a=>a.toFlatJSON(e)),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.internalCalls.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){var r,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.declaration)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.readsValue)==null?void 0:a.toFlatGenerationTarget(e))||[],...this.writesValues.flatMap(s=>s.toFlatGenerationTarget(e)),...this.successCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(s=>s.toFlatGenerationTarget(e)),...this.inputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.outputs.flatMap(s=>s.toFlatGenerationTarget(e)),...this.internalCalls.flatMap(s=>s.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.inputs.forEach(e=>e.clearErrors()),this.outputs.forEach(e=>e.clearErrors()),this.successCalls.forEach(e=>e.clearErrors()),this.errorCalls.forEach(e=>e.clearErrors()),this.internalCalls.forEach(e=>e.clearErrors()),this}validate(){const e=L9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...this.inputs.flatMap(r=>r.getErrors()),...this.internalCalls.flatMap(r=>r.getErrors()),...this.outputs.flatMap(r=>r.getErrors()),...((t=this.readsValue)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new ae(this.toJSON(),this.project)}addInternalCall(e){return this.internalCalls.find(t=>t===e)||this.internalCalls.push(e),this}setDeclaration(e){return this.declaration!==e&&(this.declaration=e),this}generateUnusedInputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type)){const e=[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties];e.filter(s=>!s.getDataType()).forEach(s=>{const o=this.inputs.find(y=>P(y,this.project)===P(s,this.project));if(!o)return;const l=this.declaration.getMasterInputWithValueWritterFromAllInstances(o);if(!l)return;const p=en(l);s.setDataType(p),o.setDeclaration(s)}),e.filter(s=>!this.inputs.find(o=>{var l;return((l=o.declaration)==null?void 0:l.id)===s.id})).forEach(s=>{const o={id:_.UUID.uuid(),version:1,type:i.InputMap,parent:this.toReference(),name:null,description:null,dynamicArguments:[],declaration:s,defaultValue:null,index:s.index,readsValue:null},l=R(o,this.project);return l.setParent(this),l.initChildren(),l.suggestion=!0,this.addInput(l),l}),this.inputs.filter(s=>!s.declaration).forEach(s=>{const o=e.find(l=>P(l,this.project)===P(s,this.project));o&&s.setDeclaration(o)})}}else return[];else return[];return[]}generateUnusedOutputs(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.properties,...this.declaration.dataType.entity.extendedProperties].filter(r=>!this.outputs.find(a=>a.declaration===r)).map(r=>{const a={id:_.UUID.uuid(),version:1,type:i.OutputMap,parent:this.toReference(),declaration:r,index:r.index,writesValues:[]},s=R(a,this.project);return s.setParent(this),s.initChildren(),s.suggestion=!0,this.addOutput(s),s})}else return[];else return[];return[]}generateUnusedInternalCalls(){if(this.declaration.dataType)if(this.declaration.dataType.entity){if([i.CustomEntity,i.PrimitiveEntity,i.BuiltInBaseEntity].includes(this.declaration.dataType.entity.type))return[...this.declaration.dataType.entity.getAllInteractiveMethods()].filter(r=>!this.internalCalls.find(s=>{var l,p,y,f,m;return(((l=s.declaration)==null?void 0:l.id)||((y=(p=s.initialData)==null?void 0:p.declaration)==null?void 0:y.entityId)||((m=(f=s.initialData)==null?void 0:f.declaration)==null?void 0:m.id))===r.id})).map(r=>{const a=r.createInternalCall(this);return a.suggestion=!0,this.addInternalCall(a),a})}else return[];else return[];return[]}getDataType(){var e;return((e=this.declaration)==null?void 0:e.getDataType())||null}getUnusedInputs(){return this.inputs.filter(e=>e.suggestion||!e.readsValue&&!e.defaultValue)}getUnusedOutputs(){return this.outputs.filter(e=>e.suggestion||!e.writesValues.length)}getUsedInputs(){return this.inputs.filter(e=>!e.suggestion&&(e.readsValue||e.defaultValue))}getUsedOutputs(){return this.outputs.filter(e=>!e.suggestion&&e.writesValues.length)}};c(ae,"MUTABLE_BASE_PROPERTIES",[]),c(ae,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ae,"BASE_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,...ae.INMUTABLE_BASE_PROPERTIES]),c(ae,"MUTABLE_META_PROPERTIES",[...ae.MUTABLE_BASE_PROPERTIES,"x","y"]),c(ae,"INMUTABLE_META_PROPERTIES",[...ae.INMUTABLE_BASE_PROPERTIES]),c(ae,"META_PROPERTIES",[...ae.MUTABLE_META_PROPERTIES,...ae.INMUTABLE_META_PROPERTIES]),c(ae,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","readsValue"]),c(ae,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(ae,"UPSTREAM_PROPERTIES",[...ae.MUTABLE_UPSTREAM_PROPERTIES,...ae.INMUTABLE_UPSTREAM_PROPERTIES]),c(ae,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","inputs","outputs","successCalls","errorCalls","internalCalls"]),c(ae,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ae,"DOWNSTREAM_PROPERTIES",[...ae.MUTABLE_DOWNSTREAM_PROPERTIES,...ae.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ae,"PROPERTIES",[...ae.META_PROPERTIES,...ae.UPSTREAM_PROPERTIES,...ae.DOWNSTREAM_PROPERTIES]);let gr=ae;function G9(n){var s;const e=cU(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="iterate-over-employee-list-continue-statement-employee-dto-output-decl-id"){const o=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return ee(n.errors,a)}const ye=class ye{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"isError");c(this,"type",i.ReturnDeclaration);c(this,"dataType",null);c(this,"readsValue",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required,this.isError=e.isError}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r);let s=null;if(e.readsValue){const p=O(e.readsValue);s=t.get(p)}const o={id:e.id,version:1,name:e.name,type:i.ReturnDeclaration,index:a.outputs.length,isError:!1,description:e.description,required:e.required,readsValue:s,dataType:null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l,p;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.ReturnStatement,i.Search,i.BreakStatement,i.ContinueStatement]}},t),o=yd(r,t);if(r=s.modifiedData,r.parent){const y=t.get(O(r.parent));if(y&&[i.BreakStatement,i.ContinueStatement].includes(y.type)){const f=y,m=f.parent,b=[...m.breakStatements.filter(A=>A.id!==y.id),...m.continueStatements.filter(A=>A.id!==y.id)];if(f.outputs.length)a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${r.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This '${f.type}' already has return declarations.
|
|
65
64
|
${Rd}`,issue:null}));else{const A=(p=(l=b[0])==null?void 0:l.outputs[0])==null?void 0:p.name;A!==r.name&&a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${r.id}' cannot be added to the parent entity of type '${f.type}' with id '${f.id}'. This new 'return-declaration' doesn't have the same name "${A}" as the return declarations on the other statements in the same scope.
|
|
66
65
|
${Rd}`,issue:null}))}}else if(y&&y.type===i.ReturnStatement){const f=y.parent;if(f&&we.includes(f.type)){const m=f.implements;if(m)if(m.returnsType===F.Fixed){const b=m.fixedReturns.find($e=>$e.name===r.name),g=m.fixedReturns.filter($e=>!y.outputs.find(tI=>tI.type===i.ReturnDeclaration&&tI.name===$e.name)),A=y.outputs.filter($e=>$e.type===i.ReturnDeclaration),C=A.find($e=>$e.name===r.name),$=A.length?`The parent entity already implements the following return declarations: ${L(A.map($e=>`'${$e.id}' (${$e.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented return declarations.",Xe=g.length?`The parent entity is still missing the following returns in the implementation: ${L(g.map($e=>`'${$e.id}' (${$e.name})`),", "," and ")}.`:"The parent entity has all the returns it needs implemented.";b?C&&a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${i.ActionDescriptor} with fixed outputs.
|
|
67
66
|
Adding a new return would make the implementation invalid. An return with the same name already exists in the parent entity.
|
|
@@ -71,9 +70,9 @@ Adding a new return would make the implementation invalid. There are no returns
|
|
|
71
70
|
${$}
|
|
72
71
|
${Xe}`,issue:null}))}else m.returnsType===F.Dynamic||m.returnsType===F.None&&a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ReturnDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${y.type}' with id '${y.id}' that implements a ${i.ActionDescriptor} with no outputs.
|
|
73
72
|
Adding a new return would make the implementation invalid.`,issue:null}))}}}return a.push(...s.errors,...o,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=Ta(r,this);return r=a.modifiedData,t.push(...a.errors),r.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
74
|
-
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){var t;const e=[this];return this.parent.addOutputDeclaration(this),e.push(this.parent),(t=this.readsValue)==null||t.addValueReader(this),this.readsValue&&e.push(this.readsValue),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),ha.initReadsValue(this),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this.isError=e.isError||this.isError,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:v(r),removed:v(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.dataType){const r=this.dataType.restore({seenEntities:e});t.push(...r.affected)}return{affected:[],self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+
|
|
73
|
+
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){var t;const e=[this];return this.parent.addOutputDeclaration(this),e.push(this.parent),(t=this.readsValue)==null||t.addValueReader(this),this.readsValue&&e.push(this.readsValue),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),ha.initReadsValue(this),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,this.isError=e.isError||this.isError,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:v(r),removed:v(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.dataType){const r=this.dataType.restore({seenEntities:e});t.push(...r.affected)}return{affected:[],self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,readsValue:((t=this.readsValue)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,isError:this.isError,readsValue:((e=this.readsValue)==null?void 0:e.toReference())||null,dataType:((t=this.dataType)==null?void 0:t.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,isError:this.isError,readsValue:(e=this.readsValue)==null?void 0:e.id,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var r,a;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...((r=this.readsValue)==null?void 0:r.toFlatGenerationTarget(e))||[],...((a=this.dataType)==null?void 0:a.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=G9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,r=!0){var f;const a=this.toJSON(),s=t||Ze(P(this,this.project),i.ReturnDeclaration,this.project);a.dataType=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ft(a,this.project);e?p.setParent(e):p.setParent(this.parent),r&&p.subscribe(),p.initChildren();const y=(f=this.dataType)==null?void 0:f.clone(p,l+"--data-type-id",r);return p.dataType=y||null,p}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}inferDataType(){const e=ad(this);if(e){const t=e.clone(this);t&&(t.inferred=!0,this.setDataType(t))}return this}getDataType(){var e;return(!this.dataType||!this.dataType.isResolved()||(e=this.dataType)!=null&&e.inferred)&&this.readsValue&&this.inferDataType(),this.dataType}};c(ye,"MUTABLE_BASE_PROPERTIES",["name","description","required","isError"]),c(ye,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(ye,"BASE_PROPERTIES",[...ye.MUTABLE_BASE_PROPERTIES,...ye.INMUTABLE_BASE_PROPERTIES]),c(ye,"MUTABLE_META_PROPERTIES",[...ye.MUTABLE_BASE_PROPERTIES,"index"]),c(ye,"INMUTABLE_META_PROPERTIES",[...ye.INMUTABLE_BASE_PROPERTIES]),c(ye,"META_PROPERTIES",[...ye.MUTABLE_META_PROPERTIES,...ye.INMUTABLE_META_PROPERTIES]),c(ye,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(ye,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","dataType"]),c(ye,"UPSTREAM_PROPERTIES",[...ye.MUTABLE_UPSTREAM_PROPERTIES,...ye.INMUTABLE_UPSTREAM_PROPERTIES]),c(ye,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ye,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ye,"DOWNSTREAM_PROPERTIES",[...ye.MUTABLE_DOWNSTREAM_PROPERTIES,...ye.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ye,"PROPERTIES",[...ye.META_PROPERTIES,...ye.UPSTREAM_PROPERTIES,...ye.DOWNSTREAM_PROPERTIES]);let wt=ye;function F9(n){var o;const e=BU(),t=n.toJSON();e.safeParse(t).success,n.inputsDeclarations.forEach(l=>l.validate()),n.inputs.forEach(l=>l.validate()),n.outputsDeclarations.forEach(l=>l.validate()),n.outputs.forEach(l=>l.validate()),(o=n.error)==null||o.validate();const s=[...bn(n)];if(n.id==="search-person-by-id-id"){const l=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});s.push(l.error)}return ee(n.errors,s)}const Ce=class Ce{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"query");c(this,"type",i.Search);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"inputsDeclarations",[]);c(this,"inputs",[]);c(this,"outputsDeclarations",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y,this.name=e.name,this.query=e.query,this.description=e.description}static fromGenerationTarget(e,t){let r=t;if(e.parent){const y=O(e.parent);r=t.get(y)}const a=e.calledByEntry.map(y=>{const f=O(y);return t.get(f)}),s=e.calledBySuccess.map(y=>{const f=O(y);return t.get(f)}),o=e.calledByError.map(y=>{const f=O(y);return t.get(f)}),l={id:e.id,version:1,type:i.Search,name:e.name,description:e.description,query:e.query,calledByEntry:a,calledBySuccess:s,calledByError:o,errorCalls:[],successCalls:[],inputsDeclarations:[],inputs:[],outputsDeclarations:[],outputs:[],error:null,x:0,y:0,parent:r},p=R(l,t);return p.setParent(r),p.initChildren(),p}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
75
74
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
76
|
-
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(){const e=[this];return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(a=>a.id===e.id);t>-1&&this.inputs.splice(t,1);const r=this.inputsDeclarations.findIndex(a=>a.id===e.declaration.id);return r>-1&&this.inputsDeclarations.splice(r,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addInputDeclaration(e){return this.inputsDeclarations.includes(e)?this:(this.inputsDeclarations.push(e),this)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(r=>r.id===e.id);return t>-1&&this.inputsDeclarations.splice(t,1),this}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(r=>r.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),this}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){return this.initialized?this:(this.initialized=!0,this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),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.name=e.name||this.name,this.query=e.query||this.query,this.description=e.description||this.description,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputsDeclarations.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.inputsDeclarations.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.outputsDeclarations.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputsDeclarations:this.inputsDeclarations.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputsDeclarations:this.outputsDeclarations.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),parent:this.parent.toReference(),error:((e=this.error)==null?void 0:e.toJSON())||null}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,query:this.query,x:this.x,y:this.y,inputs:this.inputs.map(e=>e.toReference()),inputsDeclarations:this.inputsDeclarations.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),outputsDeclarations:this.outputsDeclarations.map(e=>e.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(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,query:this.query,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.inputsDeclarations.forEach(t=>t.clearErrors()),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=F9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputsDeclarations.flatMap(t=>t.getErrors()),...this.inputs.flatMap(t=>t.getErrors()),...this.outputsDeclarations.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new Ce(this.toJSON(),this.project)}};c(Ce,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),c(Ce,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ce,"BASE_PROPERTIES",[...Ce.MUTABLE_BASE_PROPERTIES,...Ce.INMUTABLE_BASE_PROPERTIES]),c(Ce,"MUTABLE_META_PROPERTIES",[...Ce.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ce,"INMUTABLE_META_PROPERTIES",[...Ce.INMUTABLE_BASE_PROPERTIES]),c(Ce,"META_PROPERTIES",[...Ce.MUTABLE_META_PROPERTIES,...Ce.INMUTABLE_META_PROPERTIES]),c(Ce,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ce,"UPSTREAM_PROPERTIES",[...Ce.MUTABLE_UPSTREAM_PROPERTIES,...Ce.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),c(Ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ce,"DOWNSTREAM_PROPERTIES",[...Ce.MUTABLE_DOWNSTREAM_PROPERTIES,...Ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ce,"PROPERTIES",[..._t.META_PROPERTIES,..._t.UPSTREAM_PROPERTIES,..._t.DOWNSTREAM_PROPERTIES]);let vr=Ce;function U9(n){const e=vx(),t=n.toJSON();e.safeParse(t).success,n.functions.forEach(s=>s.validate()),n.events.forEach(s=>s.validate());const a=[];return ee(n.errors,a)}const he=class he{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"type",i.InstalledProject);c(this,"implements");c(this,"functions",[]);c(this,"events",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.implements=e.implements}static fromGenerationTarget(e,t){const r=t,a={id:e.id,version:1,name:e.name,type:i.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:i.Project,type:i.GenericReference,id:M.UUID.uuid()},x:0,y:0,parent:r},s=R(a,t);return s.setParent(r),s.initChildren(),s}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an installed project, must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return{affected:v([]),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.functions=this.initialData.functions.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return 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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.functions.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});r.push(...o),a.push(...l)}),this.events.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});r.push(...o),a.push(...l)}),{affected:[],removed:[]})}restore({seenEntities:e}={seenEntities:new Set}){return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.functions.forEach(t=>{t.restore({seenEntities:e})}),this.events.forEach(t=>{t.restore({seenEntities:e})}),{affected:[],self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.functions.flatMap(r=>r.toFlat(e)),...this.events.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(r=>r.toFlatIds(e)),...this.events.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,implements:this.implements,functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.functions.flatMap(r=>r.toFlatJSON(e)),...this.events.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.functions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.events.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=U9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new he(this.toJSON(),this.project)}};c(he,"MUTABLE_BASE_PROPERTIES",[]),c(he,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),c(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),c(he,"MUTABLE_META_PROPERTIES",["x","y"]),c(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),c(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),c(he,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(he,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),c(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),c(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),c(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let Ir=he;function x9(n){var l;const e=NU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),(l=n.error)==null||l.validate();const a=bn(n),s=j9(n),o=[...a,...s];return ee(n.errors,o)}function j9(n){const e=[],t=Qs(n.parent),r=t==null?void 0:t.entity;if(!r)e.push(q({id:`${n.id}--${I.InternalCallParentMissingDataType}`,code:I.InternalCallParentMissingDataType,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${n.declaration}".`,issue:null,entity:n}).error);else if(![i.CustomEntity,i.BuiltInBaseEntity,i.PrimitiveEntity].includes(r.type))e.push(q({id:`${n.id}--${I.InternalCallParentDeclarationEntityInvalidType}`,code:I.InternalCallParentDeclarationEntityInvalidType,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
|
|
75
|
+
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(){const e=[this];return this.parent===this.project&&this.project.addSearch(this),this.successCalls.forEach(t=>{t.addSuccessCaller(this),e.push(t)}),this.errorCalls.forEach(t=>{t.addErrorCaller(this),e.push(t)}),this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(a=>a.id===e.id);t>-1&&this.inputs.splice(t,1);const r=this.inputsDeclarations.findIndex(a=>a.id===e.declaration.id);return r>-1&&this.inputsDeclarations.splice(r,1),this}addInput(e){return this.inputs.includes(e)?this:(this.inputs.push(e),this)}addInputDeclaration(e){return this.inputsDeclarations.includes(e)?this:(this.inputsDeclarations.push(e),this)}removeInputDeclaration(e){const t=this.inputsDeclarations.findIndex(r=>r.id===e.id);return t>-1&&this.inputsDeclarations.splice(t,1),this}addOutputDeclaration(e){return this.outputsDeclarations.includes(e)?this:(this.outputsDeclarations.push(e),this)}removeOutputDeclaration(e){const t=this.outputsDeclarations.findIndex(r=>r.id===e.id);return t>-1&&this.outputsDeclarations.splice(t,1),this}addOutput(e){return this.outputs.includes(e)?this:(this.outputs.push(e),this)}removeOutput(e){const t=this.outputs.findIndex(r=>r.id===e.id);return t>-1&&this.outputs.splice(t,1),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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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(){return this.initialized?this:(this.initialized=!0,this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent),t.initChildren()),t}),this.inputsDeclarations=this.initialData.inputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.inputs=this.initialData.inputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputsDeclarations=this.initialData.outputsDeclarations.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),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.name=e.name||this.name,this.query=e.query||this.query,this.description=e.description||this.description,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.inputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.inputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.outputsDeclarations.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.error){const{affected:s,removed:o}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.successCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),this.errorCalls.forEach(s=>{r.push(s),s.removeCaller(this)}),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(a)}}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.inputsDeclarations.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputsDeclarations.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.inputsDeclarations.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.outputsDeclarations.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e;return{id:this.id,version:this.version,type:this.type,name:this.name,query:this.query,description:this.description,x:this.x,y:this.y,successCalls:this.successCalls.map(t=>t.toJSON()),errorCalls:this.errorCalls.map(t=>t.toJSON()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),inputsDeclarations:this.inputsDeclarations.map(t=>t.toJSON()),inputs:this.inputs.map(t=>t.toJSON()),outputsDeclarations:this.outputsDeclarations.map(t=>t.toJSON()),outputs:this.outputs.map(t=>t.toJSON()),parent:this.parent.toReference(),error:((e=this.error)==null?void 0:e.toJSON())||null}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,query:this.query,x:this.x,y:this.y,inputs:this.inputs.map(e=>e.toReference()),inputsDeclarations:this.inputsDeclarations.map(e=>e.toReference()),outputs:this.outputs.map(e=>e.toReference()),outputsDeclarations:this.outputsDeclarations.map(e=>e.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(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.Project?void 0:this.parent.id;return{id:this.id,name:this.name,description:this.description,type:this.type,query:this.query,calledByEntry:this.calledByEntry.map(t=>t.id),calledBySuccess:this.calledBySuccess.map(t=>t.id),calledByError:this.calledByError.map(t=>t.id),parent:e}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputsDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputsDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.inputsDeclarations.forEach(t=>t.clearErrors()),this.inputs.forEach(t=>t.clearErrors()),this.outputs.forEach(t=>t.clearErrors()),this.successCalls.forEach(t=>t.clearErrors()),this.errorCalls.forEach(t=>t.clearErrors()),(e=this.error)==null||e.clearErrors(),this}validate(){const e=F9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.inputsDeclarations.flatMap(t=>t.getErrors()),...this.inputs.flatMap(t=>t.getErrors()),...this.outputsDeclarations.flatMap(t=>t.getErrors()),...this.outputs.flatMap(t=>t.getErrors()),...this.error?this.error.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new Ce(this.toJSON(),this.project)}};c(Ce,"MUTABLE_BASE_PROPERTIES",["name","description","query"]),c(Ce,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Ce,"BASE_PROPERTIES",[...Ce.MUTABLE_BASE_PROPERTIES,...Ce.INMUTABLE_BASE_PROPERTIES]),c(Ce,"MUTABLE_META_PROPERTIES",[...Ce.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ce,"INMUTABLE_META_PROPERTIES",[...Ce.INMUTABLE_BASE_PROPERTIES]),c(Ce,"META_PROPERTIES",[...Ce.MUTABLE_META_PROPERTIES,...Ce.INMUTABLE_META_PROPERTIES]),c(Ce,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(Ce,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ce,"UPSTREAM_PROPERTIES",[...Ce.MUTABLE_UPSTREAM_PROPERTIES,...Ce.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ce,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","inputsDeclarations","inputs","outputsDeclarations","outputs","error"]),c(Ce,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ce,"DOWNSTREAM_PROPERTIES",[...Ce.MUTABLE_DOWNSTREAM_PROPERTIES,...Ce.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ce,"PROPERTIES",[...wt.META_PROPERTIES,...wt.UPSTREAM_PROPERTIES,...wt.DOWNSTREAM_PROPERTIES]);let vr=Ce;function U9(n){const e=vx(),t=n.toJSON();e.safeParse(t).success,n.functions.forEach(s=>s.validate()),n.events.forEach(s=>s.validate());const a=[];return ee(n.errors,a)}const he=class he{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"type",i.InstalledProject);c(this,"implements");c(this,"functions",[]);c(this,"events",[]);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.x=e.x,this.y=e.y,this.implements=e.implements}static fromGenerationTarget(e,t){const r=t,a={id:e.id,version:1,name:e.name,type:i.InstalledProject,description:e.description,functions:[],events:[],implements:{entityId:e.implements,entityType:i.Project,type:i.GenericReference,id:_.UUID.uuid()},x:0,y:0,parent:r},s=R(a,t);return s.setParent(r),s.initChildren(),s}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on an installed project, must be the root project as it is a globally declared entity.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){return{affected:v([]),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.functions=this.initialData.functions.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.events=this.initialData.events.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}sync(e){return 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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.functions.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});r.push(...o),a.push(...l)}),this.events.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!1,seenEntities:t});r.push(...o),a.push(...l)}),{affected:[],removed:[]})}restore({seenEntities:e}={seenEntities:new Set}){return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.functions.forEach(t=>{t.restore({seenEntities:e})}),this.events.forEach(t=>{t.restore({seenEntities:e})}),{affected:[],self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.functions.flatMap(r=>r.toFlat(e)),...this.events.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.functions.flatMap(r=>r.toFlatIds(e)),...this.events.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,implements:this.implements,functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),parent:this.parent.toReference(),x:this.x,y:this.y}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,x:this.x,y:this.y,implements:this.implements,functions:this.functions.map(e=>e.toReference()),events:this.events.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.functions.flatMap(r=>r.toFlatJSON(e)),...this.events.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,implements:this.implements.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.functions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.events.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this.functions.forEach(e=>e.clearErrors()),this.events.forEach(e=>e.clearErrors()),this}validate(){const e=U9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new he(this.toJSON(),this.project)}};c(he,"MUTABLE_BASE_PROPERTIES",[]),c(he,"INMUTABLE_BASE_PROPERTIES",["id","version","name","description","type"]),c(he,"BASE_PROPERTIES",[...he.MUTABLE_BASE_PROPERTIES,...he.INMUTABLE_BASE_PROPERTIES]),c(he,"MUTABLE_META_PROPERTIES",["x","y"]),c(he,"INMUTABLE_META_PROPERTIES",[...he.INMUTABLE_BASE_PROPERTIES]),c(he,"META_PROPERTIES",[...he.MUTABLE_META_PROPERTIES,...he.INMUTABLE_META_PROPERTIES]),c(he,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(he,"INMUTABLE_UPSTREAM_PROPERTIES",["implements","parent"]),c(he,"UPSTREAM_PROPERTIES",[...he.MUTABLE_UPSTREAM_PROPERTIES,...he.INMUTABLE_UPSTREAM_PROPERTIES]),c(he,"MUTABLE_DOWNSTREAM_PROPERTIES",["functions","events"]),c(he,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(he,"DOWNSTREAM_PROPERTIES",[...he.MUTABLE_DOWNSTREAM_PROPERTIES,...he.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(he,"PROPERTIES",[...he.META_PROPERTIES,...he.UPSTREAM_PROPERTIES,...he.DOWNSTREAM_PROPERTIES]);let Ir=he;function x9(n){var l;const e=NU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(p=>p.validate()),n.outputs.forEach(p=>p.validate()),(l=n.error)==null||l.validate();const a=bn(n),s=j9(n),o=[...a,...s];return ee(n.errors,o)}function j9(n){const e=[],t=Qs(n.parent),r=t==null?void 0:t.entity;if(!r)e.push(q({id:`${n.id}--${I.InternalCallParentMissingDataType}`,code:I.InternalCallParentMissingDataType,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) its id "${n.declaration}".`,issue:null,entity:n}).error);else if(![i.CustomEntity,i.BuiltInBaseEntity,i.PrimitiveEntity].includes(r.type))e.push(q({id:`${n.id}--${I.InternalCallParentDeclarationEntityInvalidType}`,code:I.InternalCallParentDeclarationEntityInvalidType,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", belongs to a variable whose data type 'entity' is not a custom entity, built-in base entity or primitive entity.
|
|
77
76
|
This variable's data-type has an 'entity' field that references an entity with id '${r.id}' and of type '${r.type}'.`,issue:null,entity:n}).error);else{const a=Nd(r),s=[];[i.CustomEntity,i.BuiltInBaseEntity,i.PrimitiveEntity].includes(r.type)&&s.push(...r.getAllInteractiveMethods());let o="";a?r.methods.length?o=`
|
|
78
77
|
All 'function-declaration' entities attached as methods to the parent data-type 'entity' field, available to be called as 'internal-calls' in this variable are:
|
|
79
78
|
- ${r.methods.map(y=>y.id).join(`
|
|
@@ -102,7 +101,7 @@ ${xn}`);const b=r.declaration;if(!t.get(b))a.push(new E({id:`${r.id}--${h.Refere
|
|
|
102
101
|
The declaration of the internal-call must be a 'function-declaration' entity which exists as a method in the entity of the data-type of the parent variable.${m}`,issue:null})):a.push(new E({id:`${r.id}--${I.InternalCallDeclarationNotFoundInParentDatatypeEntity}`,code:I.InternalCallDeclarationNotFoundInParentDatatypeEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", belongs to a variable whose data type entity doesn't contain its declaration method (function-declaration) with id "${r.declaration}".${m}`,issue:null}))}}(l.inputs.length||l.outputs.length||l.internalCalls.length)&&a.push(new E({id:`${r.id}--${h.InvalidInternalCallParentRelation}`,code:h.InvalidInternalCallParentRelation,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}", can only be added to a variable declaration or variable instance parent if the parent doesn't already have inputs, outputs or other internal calls.
|
|
103
102
|
If you need a new variable-instance for this, consider using the 'implement_variable_instance' generation action to create one and give it a caller.
|
|
104
103
|
The you can attach the new internal-call to it.`,issue:null}))}return a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
105
|
-
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var t;const e=[this];return this.parent.addInternalCall(this),e.push(this.parent),(t=this.process)==null||t.writesValues.forEach(r=>{r.setValueWriter(this.process),e.push(r)}),this.successCalls.forEach(r=>{r.addSuccessCaller(this),e.push(r)}),this.errorCalls.forEach(r=>{r.addErrorCaller(this),e.push(r)}),this.calledBySuccess.forEach(r=>{r.addSuccessCall(this),e.push(r)}),this.calledByError.forEach(r=>{r.addErrorCall(this),e.push(r)}),this.calledByEntry.forEach(r=>{r.addCall(this),e.push(r)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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.parent.type!==i.GenericReference){const e=R(this.initialData.parent,this.project);this.setParent(e),this.parent.initChildren(),this.parent.addInternalCall(this);const t=this.calledBy.find(r=>!!r.parent&<.includes(r.parent.type));if(t){const r=R(t.parent,this.project);this.parent.setParent(r)}else if(!t&&!this.parent.calledBy.length)throw new Error("Parent of internal call parent could not be resolved")}return this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent.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.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),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.index=e.index||this.index,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 r=[],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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:v(r),removed:v(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,index:this.index,successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,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.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.process?this.process.toFlatGenerationTarget(e):[],...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=x9(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 se(this.toJSON(),this.project)}};c(se,"MUTABLE_BASE_PROPERTIES",[]),c(se,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(se,"BASE_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,...se.INMUTABLE_BASE_PROPERTIES]),c(se,"MUTABLE_META_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,"index"]),c(se,"INMUTABLE_META_PROPERTIES",[...se.INMUTABLE_BASE_PROPERTIES]),c(se,"META_PROPERTIES",[...se.MUTABLE_META_PROPERTIES,...se.INMUTABLE_META_PROPERTIES]),c(se,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(se,"UPSTREAM_PROPERTIES",[...se.MUTABLE_UPSTREAM_PROPERTIES,...se.INMUTABLE_UPSTREAM_PROPERTIES]),c(se,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),c(se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(se,"DOWNSTREAM_PROPERTIES",[...se.MUTABLE_DOWNSTREAM_PROPERTIES,...se.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(se,"PROPERTIES",[...se.META_PROPERTIES,...se.UPSTREAM_PROPERTIES,...se.DOWNSTREAM_PROPERTIES]);let ui=se;function k9(n){const e=GU(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-argument-map-id"){const s=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return ee(n.errors,a)}const fe=class fe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"name",null);c(this,"description",null);c(this,"declaration",null);c(this,"type",i.InputMap);c(this,"defaultValue",null);c(this,"readsValue",null);c(this,"dynamicArguments",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name||null,this.description=e.description||null}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r);let s=null;if(e.declaration){const y=O(e.declaration);s=t.get(y)}let o=null;if(e.readsValue){const y=O(e.readsValue);o=t.get(y)}const l={id:e.id,version:1,name:e.name||null,type:i.InputMap,index:(a.inputs||a.dynamicArguments||[]).length,description:e.description||null,declaration:s,readsValue:o,dynamicArguments:[],defaultValue:null,parent:a},p=R(l,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var y;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...Ne,i.InputMap]}},t);r=s.modifiedData;const o=t.get(r.parent),l=r.declaration&&(t.get(r.declaration)||t.getBuiltIn(r.declaration)),p=((o==null?void 0:o.inputs)||[]).find(f=>{var m;return r.declaration&&((m=f.declaration)==null?void 0:m.id)===r.declaration});if(r.declaration?l?[i.Property,i.ArgumentDeclaration,i.ValueDescriptor].includes(l.type)?o&&l.type===i.ArgumentDeclaration&&![i.FunctionCall,i.Search,i.InternalCall].includes(o.type)?a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${i.InputMap}' with id '${r.id}' has a 'declaration' property pointing to an entity with type '${i.ArgumentDeclaration}' with id '${r.declaration}'.
|
|
104
|
+
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){var t;const e=[this];return this.parent.addInternalCall(this),e.push(this.parent),(t=this.process)==null||t.writesValues.forEach(r=>{r.setValueWriter(this.process),e.push(r)}),this.successCalls.forEach(r=>{r.addSuccessCaller(this),e.push(r)}),this.errorCalls.forEach(r=>{r.addErrorCaller(this),e.push(r)}),this.calledBySuccess.forEach(r=>{r.addSuccessCall(this),e.push(r)}),this.calledByError.forEach(r=>{r.addErrorCall(this),e.push(r)}),this.calledByEntry.forEach(r=>{r.addCall(this),e.push(r)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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.parent.type!==i.GenericReference){const e=R(this.initialData.parent,this.project);this.setParent(e),this.parent.initChildren(),this.parent.addInternalCall(this);const t=this.calledBy.find(r=>!!r.parent&<.includes(r.parent.type));if(t){const r=R(t.parent,this.project);this.parent.setParent(r)}else if(!t&&!this.parent.calledBy.length)throw new Error("Parent of internal call parent could not be resolved")}return this.declaration=R(this.initialData.declaration,this.project),this.successCalls=this.initialData.successCalls.map(e=>{const t=R(e,this.project);return t.addSuccessCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent.parent),t.initChildren()),t}),this.errorCalls=this.initialData.errorCalls.map(e=>{const t=R(e,this.project);return t.addErrorCaller(this),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent.parent),t.initChildren()):t.type!==i.InternalCall&&(t.setParent(this.parent.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.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.error&&(this.error=R(this.initialData.error,this.project),this.error.setParent(this),this.error.initChildren()),this.initialData.process&&(this.process=R(this.initialData.process,this.project),this.process.setParent(this),this.process.initChildren()),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.index=e.index||this.index,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 r=[],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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:v(r),removed:v(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.process?this.process.toFlatIds(e):[],...this.error?this.error.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,index:this.index,successCalls:this.successCalls.map(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,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.process?this.process.toFlatJSON(e):[],...this.successCalls.flatMap(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.calledBy.flatMap(r=>r.toFlatJSON(e)),...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.process?this.process.toFlatGenerationTarget(e):[],...this.successCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=x9(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 se(this.toJSON(),this.project)}};c(se,"MUTABLE_BASE_PROPERTIES",[]),c(se,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(se,"BASE_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,...se.INMUTABLE_BASE_PROPERTIES]),c(se,"MUTABLE_META_PROPERTIES",[...se.MUTABLE_BASE_PROPERTIES,"index"]),c(se,"INMUTABLE_META_PROPERTIES",[...se.INMUTABLE_BASE_PROPERTIES]),c(se,"META_PROPERTIES",[...se.MUTABLE_META_PROPERTIES,...se.INMUTABLE_META_PROPERTIES]),c(se,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(se,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(se,"UPSTREAM_PROPERTIES",[...se.MUTABLE_UPSTREAM_PROPERTIES,...se.INMUTABLE_UPSTREAM_PROPERTIES]),c(se,"MUTABLE_DOWNSTREAM_PROPERTIES",["inputs","outputs","writesValues","successCalls","errorCalls","error"]),c(se,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(se,"DOWNSTREAM_PROPERTIES",[...se.MUTABLE_DOWNSTREAM_PROPERTIES,...se.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(se,"PROPERTIES",[...se.META_PROPERTIES,...se.UPSTREAM_PROPERTIES,...se.DOWNSTREAM_PROPERTIES]);let ui=se;function k9(n){const e=GU(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-argument-map-id"){const s=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return ee(n.errors,a)}const fe=class fe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"name",null);c(this,"description",null);c(this,"declaration",null);c(this,"type",i.InputMap);c(this,"defaultValue",null);c(this,"readsValue",null);c(this,"dynamicArguments",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name||null,this.description=e.description||null}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r);let s=null;if(e.declaration){const y=O(e.declaration);s=t.get(y)}let o=null;if(e.readsValue){const y=O(e.readsValue);o=t.get(y)}const l={id:e.id,version:1,name:e.name||null,type:i.InputMap,index:(a.inputs||a.dynamicArguments||[]).length,description:e.description||null,declaration:s,readsValue:o,dynamicArguments:[],defaultValue:null,parent:a},p=R(l,t);return p.setParent(a),p.initChildren(),p}static validateGenerationTarget(e,t){var y;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...Ne,i.InputMap]}},t);r=s.modifiedData;const o=t.get(r.parent),l=r.declaration&&(t.get(r.declaration)||t.getBuiltIn(r.declaration)),p=((o==null?void 0:o.inputs)||[]).find(f=>{var m;return r.declaration&&((m=f.declaration)==null?void 0:m.id)===r.declaration});if(r.declaration?l?[i.Property,i.ArgumentDeclaration,i.ValueDescriptor].includes(l.type)?o&&l.type===i.ArgumentDeclaration&&![i.FunctionCall,i.Search,i.InternalCall].includes(o.type)?a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${i.InputMap}' with id '${r.id}' has a 'declaration' property pointing to an entity with type '${i.ArgumentDeclaration}' with id '${r.declaration}'.
|
|
106
105
|
The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
|
|
107
106
|
Only 'function-call', 'search' and 'internal-call' entities can have input-maps whose 'declaration' points to 'argument-declaration' entities.`,issue:null})):o&&l.type===i.Property&&!Fe.includes(o.type)?a.push(new E({id:`${r.id}--${h.InvalidInputMapDeclaration}`,code:h.InvalidInputMapDeclaration,severity:T.Error,message:`Entity of type '${i.InputMap}' with id '${r.id}' has a 'declaration' property pointing to an entity with type '${i.Property}' with id '${r.declaration}'.
|
|
108
107
|
The parent entity of type '${o.type}' with id '${o.id}' is not compatible with this type of declaration.
|
|
@@ -120,7 +119,7 @@ Input maps can only be added to variables which hold an entity with properties.`
|
|
|
120
119
|
The entity of the data-type has the following properties that can be reads as input maps, ids: '${L(g.properties.map(C=>C.id),"', '","' and '")}'`,issue:null})))}else if(Ne.filter(f=>Fe.includes(f)).includes(o.type)){const m=Cd(o),b=m.find(A=>A.id===r.declaration),g=`The parent entity has the following argument declarations that can be referenced by input-maps, ids: '${L(m.map(A=>A.id),"', '","' and '")}'`;b||a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.InputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent entity does not have an 'argument-declaration' with id '${r.declaration}'.
|
|
121
120
|
You can't add an input-map to an entity that doesn't have a matching 'argument-declaration'.
|
|
122
121
|
${g}`,issue:null}))}}return a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];let r=JSON.parse(JSON.stringify(e));const a=Ta(r,this);return r=a.modifiedData,t.push(...a.errors),r.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
123
|
-
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){var t,r;const e=[this];if(this.parent.addInput(this),e.push(this.parent),(t=this.readsValue)==null||t.addValueReader(this),this.readsValue&&e.push(this.readsValue),Fe.includes(this.parent.type)&&((r=this.parent.getDataType())!=null&&r.inferred)){const a=this.parent.type===i.VariableDeclaration?this.parent:this.parent.declaration;a.inferDataTypeAndSyncInstancesInputsAndOutputs(),e.push(a,...a.variableInstances)}return{affected:v(e),self:this}}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}removeInput(e){return this.dynamicArguments=this.dynamicArguments.filter(t=>t.id!==e.id),this}addInput(e){return this.dynamicArguments.includes(e)?this:this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),ha.initReadsValue(this),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.dynamicArguments.forEach(s=>{r.push(s),s.remove({ignoreUpstream:!0,seenEntities:t})}),this.defaultValue&&(r.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(r.push(this.parent),this.parent.removeInput(this)),{affected:r,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.dynamicArguments.forEach(r=>{t.push(r),r.restore({seenEntities:e})}),this.defaultValue&&(t.push(this.defaultValue),this.defaultValue.restore({seenEntities:e})),t.push(this.parent),this.parent.addInput(this),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dynamicArguments.flatMap(r=>r.toFlat(e)),...this.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dynamicArguments.flatMap(r=>r.toFlatIds(e)),...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(){var e,t,r;return{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,declaration:((t=this.declaration)==null?void 0:t.toJSON())||null,readsValue:((r=this.readsValue)==null?void 0:r.toReference())||null,parent:this.parent.toReference(),dynamicArguments:this.dynamicArguments.map(a=>a.toJSON())}}toReference(){return{id:this.id+"--"+
|
|
122
|
+
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:r}}addSelfToProject(){var t,r;const e=[this];if(this.parent.addInput(this),e.push(this.parent),(t=this.readsValue)==null||t.addValueReader(this),this.readsValue&&e.push(this.readsValue),Fe.includes(this.parent.type)&&((r=this.parent.getDataType())!=null&&r.inferred)){const a=this.parent.type===i.VariableDeclaration?this.parent:this.parent.declaration;a.inferDataTypeAndSyncInstancesInputsAndOutputs(),e.push(a,...a.variableInstances)}return{affected:v(e),self:this}}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}removeInput(e){return this.dynamicArguments=this.dynamicArguments.filter(t=>t.id!==e.id),this}addInput(e){return this.dynamicArguments.includes(e)?this:this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.defaultValue&&(this.defaultValue=R(this.initialData.defaultValue,this.project),this.defaultValue.setParent(this),this.defaultValue.initChildren()),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,this.project)),ha.initReadsValue(this),this.dynamicArguments=this.initialData.dynamicArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this)}setValueWriter(e){return this.readsValue=e,this}removeValueWriter(){return this.readsValue=null,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.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this}async load(){return this}async create(){return this}async update(e){return this.sync(e),ba(e,this),this}async delete(){return this}remove({ignoreUpstream:e,seenEntities:t}={ignoreUpstream:!1,seenEntities:new Set}){const r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.readsValue&&(r.push(this.readsValue),this.readsValue.removeValueReader(this)),this.dynamicArguments.forEach(s=>{r.push(s),s.remove({ignoreUpstream:!0,seenEntities:t})}),this.defaultValue&&(r.push(this.defaultValue),this.defaultValue.remove({ignoreUpstream:!0,seenEntities:t})),e||(r.push(this.parent),this.parent.removeInput(this)),{affected:r,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.readsValue&&(t.push(this.readsValue),this.readsValue.addValueReader(this)),this.dynamicArguments.forEach(r=>{t.push(r),r.restore({seenEntities:e})}),this.defaultValue&&(t.push(this.defaultValue),this.defaultValue.restore({seenEntities:e})),t.push(this.parent),this.parent.addInput(this),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dynamicArguments.flatMap(r=>r.toFlat(e)),...this.defaultValue?this.defaultValue.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dynamicArguments.flatMap(r=>r.toFlatIds(e)),...this.defaultValue?this.defaultValue.toFlatIds(e):[]])}toJSON(){var e,t,r;return{id:this.id,version:this.version,type:this.type,index:this.index,name:this.name,description:this.description,defaultValue:((e=this.defaultValue)==null?void 0:e.toJSON())||null,declaration:((t=this.declaration)==null?void 0:t.toJSON())||null,readsValue:((r=this.readsValue)==null?void 0:r.toReference())||null,parent:this.parent.toReference(),dynamicArguments:this.dynamicArguments.map(a=>a.toJSON())}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,defaultValue:((e=this.defaultValue)==null?void 0:e.toReference())||null,dynamicArguments:this.dynamicArguments.map(a=>a.toReference()),declaration:((t=this.declaration)==null?void 0:t.toReference())||null,readsValue:((r=this.readsValue)==null?void 0:r.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dynamicArguments.flatMap(r=>r.toFlatJSON(e)),...this.defaultValue?this.defaultValue.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name||void 0,description:this.description||void 0,type:this.type,declaration:((e=this.declaration)==null?void 0:e.id)||null,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dynamicArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.defaultValue?this.defaultValue.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.dynamicArguments.forEach(t=>t.clearErrors()),(e=this.defaultValue)==null||e.clearErrors(),this}validate(){const e=k9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dynamicArguments.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return this.defaultValue||((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}setDefaultValue(e){return this.defaultValue=e,this}clone(e=null,t=null,r=!0){var f;const a=this.toJSON(),s=t||Ze(P(this,this.project),i.InputMap,this.project);a.defaultValue=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ft(a,this.project);e?p.setParent(e):p.setParent(this.parent),r&&p.subscribe(),p.initChildren();const y=(f=this.defaultValue)==null?void 0:f.clone(p,l+"--default-value-id",r);return p.defaultValue=y||null,p}getDataType(){var t;if(Fe.includes(this.parent.type)){const r=yr(this.parent),a=r.getDataType();(!a||a.inferred)&&r.inferDataTypeAndSyncInstancesInputsAndOutputs()}const e=(t=this.declaration)==null?void 0:t.getDataType();if(!e){const r=en(this);if(r)return r}return e||null}};c(fe,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(fe,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(fe,"BASE_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"MUTABLE_META_PROPERTIES",[...fe.MUTABLE_BASE_PROPERTIES,"index"]),c(fe,"INMUTABLE_META_PROPERTIES",[...fe.INMUTABLE_BASE_PROPERTIES]),c(fe,"META_PROPERTIES",[...fe.MUTABLE_META_PROPERTIES,...fe.INMUTABLE_META_PROPERTIES]),c(fe,"MUTABLE_UPSTREAM_PROPERTIES",["readsValue"]),c(fe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(fe,"UPSTREAM_PROPERTIES",[...fe.MUTABLE_UPSTREAM_PROPERTIES,...fe.INMUTABLE_UPSTREAM_PROPERTIES]),c(fe,"MUTABLE_DOWNSTREAM_PROPERTIES",["defaultValue","dynamicArguments"]),c(fe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(fe,"DOWNSTREAM_PROPERTIES",[...fe.MUTABLE_DOWNSTREAM_PROPERTIES,...fe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(fe,"PROPERTIES",[...fe.META_PROPERTIES,...fe.UPSTREAM_PROPERTIES,...fe.DOWNSTREAM_PROPERTIES]);let En=fe;class q9 extends En{constructor(t,r){super(t,r);c(this,"declaration",null);c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}class J9 extends En{constructor(t,r){super(t,r);c(this,"name",null);c(this,"description",null);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}function W9(n){const e=TU(),t=n.toJSON();e.safeParse(t).success;const a=[];if(n.id==="exec-sequentially-return-map-id"){const s=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});a.push(s.error)}return ee(n.errors,a)}const oe=class oe{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"index");c(this,"type",i.OutputMap);c(this,"parentRelationType");c(this,"declaration");c(this,"writesValues",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r);let s;if(e.declaration){const p=O(e.declaration);s=t.get(p)}const o={id:e.id,version:1,type:i.OutputMap,index:(a.outputs||[]).length,declaration:s,writesValues:[],parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){var l;let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:Ne.filter(p=>p!==i.Condition)},declaration:{list:!1,types:[i.ReturnDeclaration,i.Property]}},t);r=s.modifiedData;const o=t.get(r.parent);if(o&&Ne.filter(p=>p!==i.Condition).includes(o.type)){const p=o.outputs.find(y=>y.declaration.id===O(r.declaration));if(p)a.push(new E({id:`${r.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${i.OutputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${p.id}' that points to the same base 'return-declaration'.
|
|
124
123
|
Any value reads can be done with that output-map instead.
|
|
125
124
|
You can't edit output-map entities as they need to match their return declarations, so you can only choose to read their outputted value if you need it.`,issue:null}));else{const y=t.get(r.declaration);if(y&&Fe.includes(o.type)){const f=yr(o),m=f.dataType,b=(l=f.dataType)==null?void 0:l.entity;m?b?b.type===i.ActionDescriptor?a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.OutputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The data type of the 'variable-declaration' is a 'action-descriptor' entity.
|
|
126
125
|
This means it can hold a function-call or operation as its value, to be executed programatically.
|
|
@@ -130,7 +129,7 @@ ${bd}`,issue:null})):a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSign
|
|
|
130
129
|
${bd}`,issue:null}))}else if(y){const f=o.outputs.find(m=>m.declaration.id===r.declaration);f&&a.push(new E({id:`${r.id}--${h.OutputOverwrite}`,code:h.OutputOverwrite,severity:T.Error,message:`Entity of type '${i.OutputMap}' with id '${r.id}' cannot be added to the parent entity of type '${o.type}' with id '${o.id}'. The parent already has an output-map with id '${f.id}' that points to the same declaration.
|
|
131
130
|
Any value reads can be done with that output-map instead.
|
|
132
131
|
You can't edit output-map entities as they need to match their return declarations, so you can only choose to read their outputted value if you need it.`,issue:null}))}}}return a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
133
|
-
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.addOutput(this),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),{affected:v(e),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,fa.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,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.index=e.index||this.index,this.parentRelationType=e.parentRelationType||this.parentRelationType,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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),e||(r.push(this.parent),this.parent.removeOutput(this)),{affected:r,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),t.push(this.parent),this.parent.addOutput(this),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,writesValues:this.writesValues.map(e=>e.toJSON()),declaration:this.declaration.toJSON(),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+
|
|
132
|
+
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.addOutput(this),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),{affected:v(e),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}setDeclaration(e){return this.declaration=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,fa.initWritesValues(this,this.parent.parent),this.initialData.declaration&&(this.declaration=R(this.initialData.declaration,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.index=e.index||this.index,this.parentRelationType=e.parentRelationType||this.parentRelationType,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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),e||(r.push(this.parent),this.parent.removeOutput(this)),{affected:r,removed:a})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),this.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),t.push(this.parent),this.parent.addOutput(this),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(r=>r.toFlatIds(e))])}toJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,writesValues:this.writesValues.map(e=>e.toJSON()),declaration:this.declaration.toJSON(),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,index:this.index,parentRelationType:this.parentRelationType,declaration:this.declaration.toReference(),writesValues:this.writesValues.map(e=>e.toReference()),parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){return{id:this.id,type:this.type,declaration:this.declaration.id,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(r=>r.toFlatGenerationTarget(e))])}clearErrors(){return this.errors=[],this}validate(){const e=W9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}getDefaultValue(){var e,t;return((t=(e=this.declaration)==null?void 0:e.dataType)==null?void 0:t.defaultValue)||null}clone(e){return new oe(this.toJSON(),this.project)}getDataType(){var t;return((t=this.declaration)==null?void 0:t.getDataType())||null}};c(oe,"MUTABLE_BASE_PROPERTIES",[]),c(oe,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(oe,"BASE_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,...oe.INMUTABLE_BASE_PROPERTIES]),c(oe,"MUTABLE_META_PROPERTIES",[...oe.MUTABLE_BASE_PROPERTIES,"index"]),c(oe,"INMUTABLE_META_PROPERTIES",[...oe.INMUTABLE_BASE_PROPERTIES]),c(oe,"META_PROPERTIES",[...oe.MUTABLE_META_PROPERTIES,...oe.INMUTABLE_META_PROPERTIES]),c(oe,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(oe,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration"]),c(oe,"UPSTREAM_PROPERTIES",[...oe.MUTABLE_UPSTREAM_PROPERTIES,...oe.INMUTABLE_UPSTREAM_PROPERTIES]),c(oe,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues"]),c(oe,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(oe,"DOWNSTREAM_PROPERTIES",[...oe.MUTABLE_DOWNSTREAM_PROPERTIES,...oe.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(oe,"PROPERTIES",[...oe.META_PROPERTIES,...oe.UPSTREAM_PROPERTIES,...oe.DOWNSTREAM_PROPERTIES]);let Rn=oe;class H9 extends Rn{constructor(t,r){super(t,r);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}class Y9 extends Rn{constructor(t,r){super(t,r);c(this,"declaration");c(this,"parent");c(this,"errors",[])}toJSON(){return super.toJSON()}}function z9(n){var s;const e=Qx(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];if(n.id==="company-dto-func-declaration-argument-dcl-id"){const o=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}if(n.id==="manual-hello-world-loop-current-iteration-number-output-map-id"){const o=q({id:`${n.id}--${B.PropertyImplementsNonAbstact}`,message:`Property "${P(n,n.project)}" with id "${n.id}" implements a non-abstract property "${P(n,n.project)}" with id "${n.id}".`,issue:null,severity:T.Error,code:B.PropertyImplementsNonAbstact,entity:n});a.push(o.error)}return ee(n.errors,a)}const me=class me{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"type",i.ArgumentDeclaration);c(this,"dataType",null);c(this,"writesValues",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.index=e.index,this.name=e.name,this.description=e.description,this.required=e.required}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r),s={id:e.id,version:1,name:e.name,type:i.ArgumentDeclaration,index:a.inputs.length,description:e.description,required:e.required,dataType:null,writesValues:[],parent:a},o=R(s,t);return o.setParent(a),o.initChildren(),o}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.FunctionDeclaration,i.Search,i.Condition]}},t);r=s.modifiedData;const o=pd(r,t);if(r.parent){const l=t.get(O(r.parent));if(l&&we.includes(l.type)){const p=l.implements;if(p)if(p.argumentsType===F.Fixed){const y=p.fixedArguments.find(C=>C.name===r.name),f=p.fixedArguments.filter(C=>!l.inputs.find(Xe=>Xe.type===i.ArgumentDeclaration&&Xe.name===C.name)),m=l.inputs.filter(C=>C.type===i.ArgumentDeclaration),b=m.find(C=>C.name===r.name),g=m.length?`The parent entity already implements the following arguments: ${L(m.map(C=>`'${C.id}' (${C.name})`),", "," and ")}.`:"The parent entity does not yet have any implemented arguments.",A=f.length?`The parent entity is still missing the following arguments in the implementation: ${L(f.map(C=>`'${C.id}' (${C.name})`),", "," and ")}.`:"The parent entity has all the arguments it needs implemented.";y?b&&a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ArgumentDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${i.ActionDescriptor} with fixed arguments.
|
|
134
133
|
Adding a new argument would make the implementation invalid. An argument with the same name already exists in the parent entity.
|
|
135
134
|
${g}
|
|
136
135
|
${A}`,issue:null})):a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ArgumentDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${i.ActionDescriptor} with fixed arguments.
|
|
@@ -138,7 +137,7 @@ Adding a new argument would make the implementation invalid. There are no argume
|
|
|
138
137
|
${g}
|
|
139
138
|
${A}`,issue:null}))}else p.argumentsType===F.Dynamic||p.argumentsType===F.None&&a.push(new E({id:`${r.id}--${I.NoOverlapWithImplementedSignature}`,code:I.NoOverlapWithImplementedSignature,severity:T.Error,message:`Entity of type '${i.ArgumentDeclaration}' with id '${r.id}' should not exist in a parent entity of type '${l.type}' with id '${l.id}' that implements a ${i.ActionDescriptor} with no arguments.
|
|
140
139
|
Adding a new argument would make the implementation invalid.`,issue:null}))}}return a.push(...s.errors,...o,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
141
|
-
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.addInputDeclaration(this),e.push(this.parent),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),{affected:v(e),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),fa.initWritesValues(this,this.parent),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.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),e||(r.push(this.parent),this.parent.removeInputDeclaration(this)),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:v(r),removed:v(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.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),t.push(this.parent),this.parent.addInputDeclaration(this),this.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return{affected:v(t),self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(a=>a.toFlat(e)),...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(a=>a.toFlatIds(e)),...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e;return{id:this.id,version:this.version,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,writesValues:this.writesValues.map(t=>t.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+
|
|
140
|
+
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.addInputDeclaration(this),e.push(this.parent),this.writesValues.forEach(t=>{t.setValueWriter(this),e.push(t)}),{affected:v(e),self:this}}addValueReader(e){return this.writesValues.includes(e)?this:(this.writesValues.push(e),this)}removeValueReader(e){return this.writesValues=this.writesValues.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),fa.initWritesValues(this,this.parent),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.index=e.index||this.index,this.name=e.name||this.name,this.description=e.description||this.description,this.required=e.required||this.required,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.writesValues.forEach(s=>{r.push(s),s.readsValue=null}),e||(r.push(this.parent),this.parent.removeInputDeclaration(this)),this.dataType){const s=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:v(r),removed:v(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.writesValues.forEach(r=>{t.push(r),r.setValueWriter(this)}),t.push(this.parent),this.parent.addInputDeclaration(this),this.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return{affected:v(t),self:this}}toFlat(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this,...this.writesValues.flatMap(a=>a.toFlat(e)),...((r=this.dataType)==null?void 0:r.toFlat(e))||[]])}toFlatIds(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.writesValues.flatMap(a=>a.toFlatIds(e)),...((r=this.dataType)==null?void 0:r.toFlatIds(e))||[]])}toJSON(){var e;return{id:this.id,version:this.version,name:this.name,type:this.type,index:this.index,description:this.description,required:this.required,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,writesValues:this.writesValues.map(t=>t.toJSON()),parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,name:this.name,description:this.description,type:this.type,index:this.index,required:this.required,writesValues:this.writesValues.map(t=>t.toReference()),dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.writesValues.flatMap(a=>a.toFlatJSON(e)),...((r=this.dataType)==null?void 0:r.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.writesValues.flatMap(a=>a.toFlatGenerationTarget(e)),...((r=this.dataType)==null?void 0:r.toFlatGenerationTarget(e))||[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=z9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){var t;return[...this.errors,...((t=this.dataType)==null?void 0:t.getErrors())||[]]}getShallowErrors(){return this.errors}getDefaultValue(){var e;return((e=this==null?void 0:this.dataType)==null?void 0:e.defaultValue)||null}clone(e=null,t=null,r=!0){var f;const a=this.toJSON(),s=t||Ze(P(this,this.project),i.ArgumentDeclaration,this.project);a.dataType=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ft(a,this.project);e?p.setParent(e):p.setParent(this.parent),r&&p.subscribe(),p.initChildren();const y=(f=this.dataType)==null?void 0:f.clone(p,l+"--data-type-id",r);return p.dataType=y||null,p}getDataType(){return this.dataType}setDataType(e){return this.dataType=e,this}removeDataType(){return this.dataType=null,this}};c(me,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),c(me,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(me,"BASE_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,...me.INMUTABLE_BASE_PROPERTIES]),c(me,"MUTABLE_META_PROPERTIES",[...me.MUTABLE_BASE_PROPERTIES,"index"]),c(me,"INMUTABLE_META_PROPERTIES",[...me.INMUTABLE_BASE_PROPERTIES]),c(me,"META_PROPERTIES",[...me.MUTABLE_META_PROPERTIES,...me.INMUTABLE_META_PROPERTIES]),c(me,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(me,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(me,"UPSTREAM_PROPERTIES",[...me.MUTABLE_UPSTREAM_PROPERTIES,...me.INMUTABLE_UPSTREAM_PROPERTIES]),c(me,"MUTABLE_DOWNSTREAM_PROPERTIES",["writesValues","dataType"]),c(me,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(me,"DOWNSTREAM_PROPERTIES",[...me.MUTABLE_DOWNSTREAM_PROPERTIES,...me.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(me,"PROPERTIES",[...me.META_PROPERTIES,...me.UPSTREAM_PROPERTIES,...me.DOWNSTREAM_PROPERTIES]);let Dr=me;function Z9(n){const e=bc(),t=n.toJSON();e.safeParse(t).success;const a=[];return ee(n.errors,a)}function X9(n,e){const t=[];if(n.parent)if(n.parent){const r=e.get(n.parent);r?[i.InputMap,i.DataType].includes(r.type)?r.type===i.DataType&&r.defaultValue&&t.push(new E({id:`${n.id}--${n.parent}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a 'parent' of type 'data-type' which already has an existing default value entity with id "${r.defaultValue.id}".
|
|
142
141
|
Data types can only have one 'primitive-value' entity as 'defaultValue'.
|
|
143
142
|
You can update the existing 'primitive-value' with the 'update' action, for example, like so:
|
|
144
143
|
\`\`\`json
|
|
@@ -151,35 +150,35 @@ You can update the existing 'primitive-value' with the 'update' action, for exam
|
|
|
151
150
|
}
|
|
152
151
|
}\`\`\`
|
|
153
152
|
Or 'delete' and then 'post' actions to replace it.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a parent reference that isn't pointing to an entity of type 'input-map' or 'data-type'.`,issue:null})):t.push(new E({id:`${n.id}--${n.parent}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null}));else return t.push(new E({id:`${n.id}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}" is missing a 'parent' reference. The 'parent' of a primitive value entity must be a reference to an entity of type 'input-map' or 'data-type'.`,issue:null})),t;if(n.valueAsType){const r=[],a=[],s=n.valueAsType;Array.isArray(s)?s.forEach(o=>{typeof o=="string"?a.push(o):r.push(o)}):typeof s=="string"?a.push(s):r.push(s),r.forEach(o=>{const l=ro(o);t.push(...l),l.length===0&&a.push(o.entityId)}),a.forEach(o=>{const l=e.get(o);l?[i.CustomEntity,i.BuiltInBaseEntity].includes(l.type)||t.push(new E({id:`${n.id}--${o}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has an 'valueAsType' reference that isn't pointing to an entity of type 'custom-entity', 'function-declaration' or 'operation'.`,issue:null})):t.push(new E({id:`${n.id}--${o}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${o}" 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 Te=class Te{constructor(e,t){c(this,"initialData");c(this,"type",i.PrimitiveValue);c(this,"id");c(this,"version");c(this,"name");c(this,"autogeneration",null);c(this,"value",null);c(this,"valueAsType",null);c(this,"errors",[]);c(this,"parent");c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.autogeneration=e.autogeneration,this.value=e.value}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r);let s=null;e.valueAsType&&(Array.isArray(e.valueAsType)?s=e.valueAsType.map(p=>t.get(p)||t.getBuiltIn(p)):s=t.get(e.valueAsType)||t.getBuiltIn(e.valueAsType));const o={id:e.id,version:1,type:i.PrimitiveValue,name:e.name,autogeneration:e.autogeneration,valueAsType:s,value:e.value||null,parent:a},l=R(o,t);return l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=X9(r,t);return a.push(...s,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
154
|
-
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.setDefaultValue(this),e.push(this.parent),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.valueAsType&&(Array.isArray(this.initialData.valueAsType)?this.valueAsType=this.initialData.valueAsType.map(e=>R(e,this.project)):this.valueAsType=R(this.initialData.valueAsType,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.subscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.autogeneration=e.autogeneration||this.autogeneration,e.value!==void 0&&(this.value=e.value),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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),{affected:v(r),removed:v(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlat(e)):this.valueAsType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlatIds(e)):this.valueAsType.toFlatIds(e):[]])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,autogeneration:this.autogeneration,value:this.value,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+
|
|
153
|
+
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent.setDefaultValue(this),e.push(this.parent),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.valueAsType&&(Array.isArray(this.initialData.valueAsType)?this.valueAsType=this.initialData.valueAsType.map(e=>R(e,this.project)):this.valueAsType=R(this.initialData.valueAsType,this.project)),this)}subscribe(){return this.project.subscribeInstance(this),this}unsubscribe(){return this.project.subscribeInstance(this),this}sync(e){return this.version=e.version||this.version,this.name=e.name||this.name,this.autogeneration=e.autogeneration||this.autogeneration,e.value!==void 0&&(this.value=e.value),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 r=[],a=[];return t.has(this.id)?{affected:[],removed:[]}:(t.add(this.id),a.push(this),this.unsubscribe(),{affected:v(r),removed:v(a)})}restore({seenEntities:e}={seenEntities:new Set}){const t=[];return e.has(this.id)?{affected:[],self:this}:(e.add(this.id),this.subscribe(),{affected:t,self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlat(e)):this.valueAsType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlatIds(e)):this.valueAsType.toFlatIds(e):[]])}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,autogeneration:this.autogeneration,value:this.value,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,parent:this.parent.toReference()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.toReference()):this.valueAsType.toReference():null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.toReference()}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlatJSON(e)):this.valueAsType.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,name:this.name,valueAsType:this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.map(e=>e.id):this.valueAsType.id:null,value:this.value,autogeneration:this.autogeneration,parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.valueAsType?Array.isArray(this.valueAsType)?this.valueAsType.flatMap(r=>r.toFlatGenerationTarget(e)):this.valueAsType.toFlatGenerationTarget(e):[]])}clearErrors(){return this.errors=[],this}validate(){const e=Z9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0){const a=this.toJSON(),s=t||Ze(this.name,i.PrimitiveValue,this.project);a.id=s;const o=Ft(a,this.project);return e&&o.setParent(e),r&&o.subscribe(),o}};c(Te,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value"]),c(Te,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Te,"BASE_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES,...Te.INMUTABLE_BASE_PROPERTIES]),c(Te,"MUTABLE_META_PROPERTIES",[...Te.MUTABLE_BASE_PROPERTIES]),c(Te,"INMUTABLE_META_PROPERTIES",[...Te.INMUTABLE_BASE_PROPERTIES]),c(Te,"META_PROPERTIES",[...Te.MUTABLE_META_PROPERTIES,...Te.INMUTABLE_META_PROPERTIES]),c(Te,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Te,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Te,"UPSTREAM_PROPERTIES",[...Te.MUTABLE_UPSTREAM_PROPERTIES,...Te.INMUTABLE_UPSTREAM_PROPERTIES]),c(Te,"MUTABLE_DOWNSTREAM_PROPERTIES",["valueAsType"]),c(Te,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Te,"DOWNSTREAM_PROPERTIES",[...Te.MUTABLE_DOWNSTREAM_PROPERTIES,...Te.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Te,"PROPERTIES",[...Te.META_PROPERTIES,...Te.UPSTREAM_PROPERTIES,...Te.DOWNSTREAM_PROPERTIES]);let pi=Te;function Q9(n){var s;const e=aU(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return ee(n.errors,a)}function K9(n){var s;const e=tU(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return ee(n.errors,a)}const Ee=class Ee{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.ContinueStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r),s=e.calledByEntry.map(f=>{const m=O(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=O(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=O(f);return t.get(m)}),p={id:e.id,version:1,type:i.ContinueStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.Loop]}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
155
154
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
156
155
|
You shouldn't have to manually update a 'parent' property.
|
|
157
|
-
Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.parent.addContinueStatement(this),e.push(this),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this.parent.addContinueStatement(this),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeContinueStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addContinueStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toJSON()),throws:((e=this.throws)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+
|
|
156
|
+
Specifically for continue statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.parent.addContinueStatement(this),e.push(this),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this.parent.addContinueStatement(this),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeContinueStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addContinueStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.calledBy.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.calledBy.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toJSON()),throws:((e=this.throws)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(t=>t.toReference()),calledBySuccess:this.calledBySuccess.map(t=>t.toReference()),calledByError:this.calledByError.map(t=>t.toReference()),calledByEntry:this.calledByEntry.map(t=>t.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:this.parent.toReference()}}toFlatJSON(e=new Set){var r;return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(a=>a.toFlatJSON(e)),...this.calledBy.flatMap(a=>a.toFlatJSON(e)),...((r=this.throws)==null?void 0:r.toFlatJSON(e))||[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=K9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new Ee(this.toJSON(),this.project)}};c(Ee,"MUTABLE_BASE_PROPERTIES",[]),c(Ee,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ee,"BASE_PROPERTIES",[...Ee.MUTABLE_BASE_PROPERTIES,...Ee.INMUTABLE_BASE_PROPERTIES]),c(Ee,"MUTABLE_META_PROPERTIES",["x","y"]),c(Ee,"INMUTABLE_META_PROPERTIES",[...Ee.INMUTABLE_BASE_PROPERTIES]),c(Ee,"META_PROPERTIES",[...Ee.MUTABLE_META_PROPERTIES,...Ee.INMUTABLE_META_PROPERTIES]),c(Ee,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Ee,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Ee,"UPSTREAM_PROPERTIES",[...Ee.MUTABLE_UPSTREAM_PROPERTIES,...Ee.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ee,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(Ee,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ee,"DOWNSTREAM_PROPERTIES",[...Ee.MUTABLE_DOWNSTREAM_PROPERTIES,...Ee.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ee,"PROPERTIES",[...Ee.META_PROPERTIES,...Ee.UPSTREAM_PROPERTIES,...Ee.DOWNSTREAM_PROPERTIES]);let ft=Ee;const st=class st{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.ReturnStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r),s=e.calledByEntry.map(f=>{const m=O(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=O(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=O(f);return t.get(m)}),p={id:e.id,version:1,type:i.ReturnStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:lt}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
158
157
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
159
158
|
You shouldn't have to manually update a 'parent' property.
|
|
160
|
-
Specifically for return statements the parent needs to always be the 'function-declaration' or 'global-event' that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.parent.addReturnStatement(this),e.push(this.parent),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this.parent.addReturnStatement(this),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeReturnStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addReturnStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toJSON()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+
|
|
159
|
+
Specifically for return statements the parent needs to always be the 'function-declaration' or 'global-event' that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.parent.addReturnStatement(this),e.push(this.parent),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this.parent.addReturnStatement(this),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeReturnStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addReturnStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),outputs:this.outputs.map(r=>r.toJSON()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=Q9(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(e){return new st(this.toJSON(),this.project)}};c(st,"MUTABLE_BASE_PROPERTIES",[]),c(st,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(st,"BASE_PROPERTIES",[...ft.MUTABLE_BASE_PROPERTIES,...ft.INMUTABLE_BASE_PROPERTIES]),c(st,"MUTABLE_META_PROPERTIES",["x","y"]),c(st,"INMUTABLE_META_PROPERTIES",[...ft.INMUTABLE_BASE_PROPERTIES]),c(st,"META_PROPERTIES",[...ft.MUTABLE_META_PROPERTIES,...ft.INMUTABLE_META_PROPERTIES]),c(st,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(st,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(st,"UPSTREAM_PROPERTIES",[...ft.MUTABLE_UPSTREAM_PROPERTIES,...ft.INMUTABLE_UPSTREAM_PROPERTIES]),c(st,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(st,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(st,"DOWNSTREAM_PROPERTIES",[...ft.MUTABLE_DOWNSTREAM_PROPERTIES,...ft.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(st,"PROPERTIES",[...wt.META_PROPERTIES,...wt.UPSTREAM_PROPERTIES,...wt.DOWNSTREAM_PROPERTIES]);let Pr=st;function e3(n){var s;const e=yU(),t=n.toJSON();e.safeParse(t).success,n.outputs.forEach(o=>o.validate()),(s=n.throws)==null||s.validate();const a=[];return ee(n.errors,a)}const Re=class Re{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.BreakStatement);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"throws",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestion",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){const r=O(e.parent),a=t.get(r),s=e.calledByEntry.map(f=>{const m=O(f);return t.get(m)}),o=e.calledBySuccess.map(f=>{const m=O(f);return t.get(m)}),l=e.calledByError.map(f=>{const m=O(f);return t.get(m)}),p={id:e.id,version:1,type:i.BreakStatement,x:0,y:0,outputs:[],calledBySuccess:o,calledByError:l,calledByEntry:s,throws:null,parent:a},y=R(p,t);return y.setParent(a),y.initChildren(),y}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.Loop]}},t);return r=s.modifiedData,a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
161
160
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
162
161
|
You shouldn't have to manually update a 'parent' property.
|
|
163
|
-
Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.parent.addBreakStatement(this),e.push(this.parent),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this.parent.addBreakStatement(this),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeBreakStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addBreakStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+
|
|
162
|
+
Specifically for break statements the parent needs to always be the 'loop' entity that contains it.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.calledByEntry.forEach(t=>{t.addCall(this),e.push(t)}),this.calledBySuccess.forEach(t=>{t.addSuccessCall(this),e.push(t)}),this.calledByError.forEach(t=>{t.addErrorCall(this),e.push(t)}),this.parent.addBreakStatement(this),e.push(this.parent),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}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}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}addOutputDeclaration(e){return this.outputs.find(t=>t.id===e.id)||this.outputs.push(e),this}removeOutputDeclaration(e){return this.outputs=this.outputs.filter(t=>t.id!==e.id),this}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.outputs=this.initialData.outputs.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.throws&&(this.throws=R(this.initialData.throws,this.project),this.throws.setParent(this),this.throws.initChildren()),this.parent.addBreakStatement(this),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}){const r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.outputs.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.throws){const{affected:s,removed:o}=this.throws.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return this.parent.removeBreakStatement(this),e||this.calledBy.forEach(s=>{r.push(s),s.removeCall(this)}),{affected:v(r),removed:v(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.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.throws){const{affected:r}=this.throws.restore({seenEntities:e});t.push(...r)}return this.parent.addBreakStatement(this),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.outputs.flatMap(r=>r.toFlat(e)),...this.throws?this.throws.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.outputs.flatMap(r=>r.toFlatIds(e)),...this.throws?this.throws.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),parent:((e=this.parent)==null?void 0:e.toReference())||null,throws:((t=this.throws)==null?void 0:t.toJSON())||null}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,x:this.x,y:this.y,outputs:this.outputs.map(r=>r.toReference()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),throws:((e=this.throws)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.throws?this.throws.toFlatJSON(e):[]])}toGenerationTarget(){return{id:this.id,type:this.type,calledByEntry:this.calledByEntry.map(e=>e.id),calledByError:this.calledByError.map(e=>e.id),calledBySuccess:this.calledBySuccess.map(e=>e.id),parent:this.parent.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.throws?this.throws.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],this.outputs.forEach(t=>t.clearErrors()),(e=this.throws)==null||e.clearErrors(),this}validate(){const e=e3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.outputs.flatMap(t=>t.getErrors()),...this.throws?this.throws.getErrors():[]]}getShallowErrors(){return this.errors}clone(e){return new Re(this.toJSON(),this.project)}};c(Re,"MUTABLE_BASE_PROPERTIES",[]),c(Re,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Re,"BASE_PROPERTIES",[...Re.MUTABLE_BASE_PROPERTIES,...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"MUTABLE_META_PROPERTIES",["x","y"]),c(Re,"INMUTABLE_META_PROPERTIES",[...Re.INMUTABLE_BASE_PROPERTIES]),c(Re,"META_PROPERTIES",[...Re.MUTABLE_META_PROPERTIES,...Re.INMUTABLE_META_PROPERTIES]),c(Re,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),c(Re,"INMUTABLE_UPSTREAM_PROPERTIES",[]),c(Re,"UPSTREAM_PROPERTIES",[...Re.MUTABLE_UPSTREAM_PROPERTIES,...Re.INMUTABLE_UPSTREAM_PROPERTIES]),c(Re,"MUTABLE_DOWNSTREAM_PROPERTIES",["outputs","throws"]),c(Re,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Re,"DOWNSTREAM_PROPERTIES",[...Re.MUTABLE_DOWNSTREAM_PROPERTIES,...Re.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Re,"PROPERTIES",[...Re.META_PROPERTIES,...Re.UPSTREAM_PROPERTIES,...Re.DOWNSTREAM_PROPERTIES]);let yi=Re;function t3(n){var s,o;const e=Pb(),t=n.toJSON();e.safeParse(t).success,n.fixedArguments.flatMap(l=>l.validate()),n.fixedReturns.flatMap(l=>l.validate()),(s=n.dynamicArgumentTypes)==null||s.validate(),(o=n.dynamicReturnTypes)==null||o.validate();const a=[];return ee(n.errors,a)}const be=class be{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"argumentsType");c(this,"returnsType");c(this,"type",i.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"implementation",null);c(this,"parent",null);c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.argumentsType=e.argumentsType,this.returnsType=e.returnsType}static fromGenerationTarget(e,t){let r=null;if(e.parent){const o=O(e.parent);r=t.get(o)}const a={id:e.id,version:1,name:e.name,type:i.ActionDescriptor,description:e.description,dynamicArgumentTypes:null,dynamicReturnTypes:null,argumentsType:e.argumentsType,returnsType:e.returnsType,fixedArguments:[],fixedReturns:[],error:null,parent:r},s=R(a,t);return r&&s.setParent(r),s.initChildren(),s}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.CustomEntity,i.DataType]}},t);r=s.modifiedData;const o=r.parent?t.get(r.parent):null;if(o&&o.type===i.CustomEntity){const l=o,y=kn(l).filter(f=>!f.interactive);if(y.length){let f=y.length>1?`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it extends or implements multiple '${i.BuiltInBaseEntity}' entities that are non-interactive ("${L(y.map(m=>P(m,m.project)),'", "','" and "')}").`:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it extends or implements a '${i.BuiltInBaseEntity}' entity that is non-interactive ("${P(y[0],y[0].project)}").`;f+=`
|
|
164
163
|
${xn}`,a.push(new E({id:`${e.id}--${h.NonInteractiveEntityReferenced}`,code:h.NonInteractiveEntityReferenced,severity:T.Error,message:f,issue:null}))}}else if(o&&o.type===i.DataType){const l=o;l.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' can't be added to the 'parent' entity with id '${l.id}' because it already has an 'entity' child. Data type entities can only have one 'entity' as children.
|
|
165
164
|
You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
|
|
166
165
|
${tn({describe_entity:l.entity.id})}
|
|
167
166
|
Alternatively you can update the parent data-type entity with 'update' action to remove the existing value of the field.`,issue:null}))}return a.push(...s.errors,...Oe(r)),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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.
|
|
168
|
-
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent?(this.parent.type===i.CustomEntity?(this.parent.addAbstractMethod(this),e.push(this.parent)):this.parent.type===i.DataType&&(this.parent.setEntity(this),e.push(this.parent)),{affected:v(e),self:this}):{affected:v(e),self:this}}setParent(e){return this.parent=e,this}setDynamicReturnTypes(e){return this.dynamicReturnTypes=e,this}setDynamicArgumentTypes(e){return this.dynamicArgumentTypes=e,this}removeDynamicArgumentTypes(){return this.dynamicArgumentTypes=null,this}removeDynamicReturnTypes(){return this.dynamicReturnTypes=null,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.fixedArguments=this.initialData.fixedArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.fixedReturns=this.initialData.fixedReturns.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.dynamicArgumentTypes&&(this.dynamicArgumentTypes=R(this.initialData.dynamicArgumentTypes,this.project),this.dynamicArgumentTypes.setParent(this),this.dynamicArgumentTypes.initChildren()),this.initialData.dynamicReturnTypes&&(this.dynamicReturnTypes=R(this.initialData.dynamicReturnTypes,this.project),this.dynamicReturnTypes.setParent(this),this.dynamicReturnTypes.initChildren()),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.argumentsType=e.argumentsType||this.argumentsType,this.returnsType=e.returnsType||this.returnsType,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.fixedArguments.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o.affected),a.push(...o.removed)}),this.fixedReturns.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o.affected),a.push(...o.removed)}),this.dynamicArgumentTypes){const s=this.dynamicArgumentTypes.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}if(this.dynamicReturnTypes){const s=this.dynamicReturnTypes.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}if(this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:v(r),removed:v(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.fixedArguments.forEach(r=>{const a=r.restore({seenEntities:e});t.push(...a.affected)}),this.fixedReturns.forEach(r=>{const a=r.restore({seenEntities:e});t.push(...a.affected)}),this.dynamicArgumentTypes){const r=this.dynamicArgumentTypes.restore({seenEntities:e});t.push(...r.affected)}if(this.dynamicReturnTypes){const r=this.dynamicReturnTypes.restore({seenEntities:e});t.push(...r.affected)}if(this.error){const r=this.error.restore({seenEntities:e});t.push(...r.affected)}return{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.fixedArguments.flatMap(r=>r.toFlat(e)),...this.fixedReturns.flatMap(r=>r.toFlat(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlat(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.fixedArguments.flatMap(r=>r.toFlatIds(e)),...this.fixedReturns.flatMap(r=>r.toFlatIds(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatIds(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatIds(e):[]])}toJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toJSON())||null,fixedArguments:this.fixedArguments.map(s=>s.toJSON()),fixedReturns:this.fixedReturns.map(s=>s.toJSON()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toJSON())||null,dynamicReturnTypes:((r=this.dynamicReturnTypes)==null?void 0:r.toJSON())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toReference())||null,fixedArguments:this.fixedArguments.map(s=>s.toReference()),fixedReturns:this.fixedReturns.map(s=>s.toReference()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toReference())||null,dynamicReturnTypes:((r=this.dynamicReturnTypes)==null?void 0:r.toReference())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.fixedArguments.flatMap(r=>r.toFlatJSON(e)),...this.fixedReturns.flatMap(r=>r.toFlatJSON(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatJSON(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,argumentsType:this.argumentsType,returnsType:this.returnsType,parent:((e=this.parent)==null?void 0:e.id)||void 0}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.fixedArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.fixedReturns.flatMap(r=>r.toFlatGenerationTarget(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatGenerationTarget(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatGenerationTarget(e):[]])}implementAsFunctionDeclaration(e){var s;const t=this.fixedArguments.map((o,l)=>{var y;const p={id:e+"--"+o.id+"--parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:i.ArgumentDeclaration,name:o.name,required:o.required,writesValues:[],description:o.description,index:l,dataType:((y=o.dataType)==null?void 0:y.toJSON())||null,parent:p}}),r=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((f,m)=>{var g;const b={id:e+"--return-statement--"+f.id+"--parent-ref",type:i.GenericReference,entityId:e,entityType:i.ReturnStatement};return{id:e+"--"+f.id,version:f.version,type:i.ReturnDeclaration,name:f.name,description:f.description,readsValue:null,required:f.required,isError:!1,index:m,dataType:((g=f.dataType)==null?void 0:g.toJSON())||null,parent:b}}),l={id:e+"--return-statement-parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},y={id:e+"--return-statement",version:this.version,type:i.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:l,x:0,y:0};r.push(y),a.push(y)}return{id:e,version:this.version,type:i.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:r,calls:a,collapsed:!1,private:!1,implements:this.toJSON(),index:0,parent:((s=this.parent)==null?void 0:s.toReference())||null,x:0,y:0}}implementAsLoop(e){const t=e||this.project,r=this.id+"--instance-"+M.UUID.fromUUID(M.UUID.uuid()),a={id:r,version:this.version,type:i.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],outputsDeclarations:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((l,p)=>{const f={id:l.toReference().id+"--input-map-id",version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Loop}};a.inputs.push(f)}),this.fixedReturns.forEach((l,p)=>{const f={id:l.toReference().id+"--output-map-id",version:this.version,type:i.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Loop}};a.outputs.push(f)});const s={id:r+"--body-function-declaration-id",version:this.version,type:i.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Loop}};s.inputs=[{id:M.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],index:0,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}},{id:M.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],index:1,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}}],a.body=s;const o=R(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const r=e||this.project,a=t||this.id+"--instance-"+M.UUID.fromUUID(M.UUID.uuid()),s={id:a,version:this.version,type:i.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,dynamicArguments:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:r.toReference()};if(this.fixedArguments.forEach((l,p)=>{const y={id:a+Ze(l.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.inputs.push(y)}),this.fixedReturns.forEach((l,p)=>{const y={id:a+Ze(l.name,i.OutputMap,this.project),version:this.version,type:i.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.outputs.push(y)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:i.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.error=p}const o=R(s,this.project);return o.setParent(r),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,r=this.id+"--instance-"+M.UUID.fromUUID(M.UUID.uuid()),a={id:r,version:this.version,type:i.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,l)=>{const p={id:r+Ze(o.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:l,dynamicArguments:[],parent:{id:M.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Condition}};a.inputs.push(p)});const s=R(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e,t,r;return this.errors=[],this.fixedArguments.forEach(a=>a.clearErrors()),this.fixedReturns.forEach(a=>a.clearErrors()),(e=this.dynamicArgumentTypes)==null||e.clearErrors(),(t=this.dynamicReturnTypes)==null||t.clearErrors(),(r=this.error)==null||r.clearErrors(),this}validate(){const e=t3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.fixedArguments.flatMap(t=>t.getErrors()),...this.fixedReturns.flatMap(t=>t.getErrors()),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.getErrors():[],...this.dynamicReturnTypes?this.dynamicReturnTypes.getErrors():[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0){var m,b;const a=this.toJSON(),s=t||Ze(P(this,this.project),i.ActionDescriptor,this.project);a.fixedArguments=[],a.fixedReturns=[],a.dynamicArgumentTypes=null,a.dynamicReturnTypes=null,a.error=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e?p.setParent(e):this.parent&&p.setParent(this.parent),r&&p.subscribe(),p.initChildren();const y=(m=this.fixedArguments)==null?void 0:m.map((g,A)=>g.clone(this,l+"-argument-value-descriptor-"+A+"-id",r));p.fixedArguments=y;const f=(b=this.fixedReturns)==null?void 0:b.map((g,A)=>g.clone(this,l+"-return-value-descriptor-"+A+"-id",r));return p.fixedReturns=f,this.dynamicArgumentTypes&&(p.dynamicArgumentTypes=this.dynamicArgumentTypes.clone(this,l+"-dynamic-argument-types-id",r)),this.dynamicReturnTypes&&(p.dynamicReturnTypes=this.dynamicReturnTypes.clone(this,l+"-dynamic-return-types-id",r)),this.error&&(p.error=this.error.clone(this,l+"-error-action-descriptor-id",r)),p}setDynamicArgumentsDataType(e){return this.dynamicArgumentTypes=e,this}setDynamicReturnsDataType(e){return this.dynamicReturnTypes=e,this}addFixedArgument(e){return this.fixedArguments.find(t=>t.id===e.id)||this.fixedArguments.push(e),this}removeFixedArgument(e){return this.fixedArguments=this.fixedArguments.filter(t=>t.id!==e.id),this}addFixedReturn(e){return this.fixedReturns.find(t=>t.id===e.id)||this.fixedReturns.push(e),this}removeFixedReturn(e){return this.fixedReturns=this.fixedReturns.filter(t=>t.id!==e.id),this}};c(be,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),c(be,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(be,"BASE_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,...be.INMUTABLE_BASE_PROPERTIES]),c(be,"MUTABLE_META_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES]),c(be,"INMUTABLE_META_PROPERTIES",[...be.INMUTABLE_BASE_PROPERTIES]),c(be,"META_PROPERTIES",[...be.MUTABLE_META_PROPERTIES,...be.INMUTABLE_META_PROPERTIES]),c(be,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(be,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(be,"UPSTREAM_PROPERTIES",[...be.MUTABLE_UPSTREAM_PROPERTIES,...be.INMUTABLE_UPSTREAM_PROPERTIES]),c(be,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),c(be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(be,"DOWNSTREAM_PROPERTIES",[...be.MUTABLE_DOWNSTREAM_PROPERTIES,...be.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(be,"PROPERTIES",[...be.META_PROPERTIES,...be.UPSTREAM_PROPERTIES,...be.DOWNSTREAM_PROPERTIES]);let Ge=be;function n3(n){var s;const e=w4(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];return ee(n.errors,a)}const ge=class ge{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"parentRelationType");c(this,"type",i.ValueDescriptor);c(this,"dataType",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.index=e.index,this.required=e.required,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const r=e.parent?O(e.parent):null,a=r?t.get(r):null,s=e.parentRelationType===w.FixedArguments?a==null?void 0:a.fixedArguments.length:a==null?void 0:a.fixedReturns.length,o={id:e.id,version:1,name:e.name,type:i.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},l=R(o,t);return a&&l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.ActionDescriptor]}},t);r=s.modifiedData,a.push(...s.errors,...Oe(r));const o=r.parent&&t.get(r.parent),l=o&&qn(o);return l&&l.type===i.ActionDescriptor&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${l.name}" of type '${l.type}' with id '${l.id}'.
|
|
167
|
+
This is likely an incorrect strategy, 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.`,issue:null})),{errors:t,modifiedData:e}}addSelfToProject(){const e=[this];return this.parent?(this.parent.type===i.CustomEntity?(this.parent.addAbstractMethod(this),e.push(this.parent)):this.parent.type===i.DataType&&(this.parent.setEntity(this),e.push(this.parent)),{affected:v(e),self:this}):{affected:v(e),self:this}}setParent(e){return this.parent=e,this}setDynamicReturnTypes(e){return this.dynamicReturnTypes=e,this}setDynamicArgumentTypes(e){return this.dynamicArgumentTypes=e,this}removeDynamicArgumentTypes(){return this.dynamicArgumentTypes=null,this}removeDynamicReturnTypes(){return this.dynamicReturnTypes=null,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.fixedArguments=this.initialData.fixedArguments.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.fixedReturns=this.initialData.fixedReturns.map(e=>{const t=R(e,this.project);return t.setParent(this),t.initChildren(),t}),this.initialData.dynamicArgumentTypes&&(this.dynamicArgumentTypes=R(this.initialData.dynamicArgumentTypes,this.project),this.dynamicArgumentTypes.setParent(this),this.dynamicArgumentTypes.initChildren()),this.initialData.dynamicReturnTypes&&(this.dynamicReturnTypes=R(this.initialData.dynamicReturnTypes,this.project),this.dynamicReturnTypes.setParent(this),this.dynamicReturnTypes.initChildren()),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.argumentsType=e.argumentsType||this.argumentsType,this.returnsType=e.returnsType||this.returnsType,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.fixedArguments.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o.affected),a.push(...o.removed)}),this.fixedReturns.forEach(s=>{const o=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o.affected),a.push(...o.removed)}),this.dynamicArgumentTypes){const s=this.dynamicArgumentTypes.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}if(this.dynamicReturnTypes){const s=this.dynamicReturnTypes.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}if(this.error){const s=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s.affected),a.push(...s.removed)}return{affected:v(r),removed:v(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.fixedArguments.forEach(r=>{const a=r.restore({seenEntities:e});t.push(...a.affected)}),this.fixedReturns.forEach(r=>{const a=r.restore({seenEntities:e});t.push(...a.affected)}),this.dynamicArgumentTypes){const r=this.dynamicArgumentTypes.restore({seenEntities:e});t.push(...r.affected)}if(this.dynamicReturnTypes){const r=this.dynamicReturnTypes.restore({seenEntities:e});t.push(...r.affected)}if(this.error){const r=this.error.restore({seenEntities:e});t.push(...r.affected)}return{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[...this.fixedArguments.flatMap(r=>r.toFlat(e)),...this.fixedReturns.flatMap(r=>r.toFlat(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlat(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.fixedArguments.flatMap(r=>r.toFlatIds(e)),...this.fixedReturns.flatMap(r=>r.toFlatIds(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatIds(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatIds(e):[]])}toJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toJSON())||null,fixedArguments:this.fixedArguments.map(s=>s.toJSON()),fixedReturns:this.fixedReturns.map(s=>s.toJSON()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toJSON())||null,dynamicReturnTypes:((r=this.dynamicReturnTypes)==null?void 0:r.toJSON())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t,r,a;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,argumentsType:this.argumentsType,returnsType:this.returnsType,error:((e=this.error)==null?void 0:e.toReference())||null,fixedArguments:this.fixedArguments.map(s=>s.toReference()),fixedReturns:this.fixedReturns.map(s=>s.toReference()),dynamicArgumentTypes:((t=this.dynamicArgumentTypes)==null?void 0:t.toReference())||null,dynamicReturnTypes:((r=this.dynamicReturnTypes)==null?void 0:r.toReference())||null,parent:((a=this.parent)==null?void 0:a.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.fixedArguments.flatMap(r=>r.toFlatJSON(e)),...this.fixedReturns.flatMap(r=>r.toFlatJSON(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatJSON(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,argumentsType:this.argumentsType,returnsType:this.returnsType,parent:((e=this.parent)==null?void 0:e.id)||void 0}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.fixedArguments.flatMap(r=>r.toFlatGenerationTarget(e)),...this.fixedReturns.flatMap(r=>r.toFlatGenerationTarget(e)),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.toFlatGenerationTarget(e):[],...this.dynamicReturnTypes?this.dynamicReturnTypes.toFlatGenerationTarget(e):[]])}implementAsFunctionDeclaration(e){var s;const t=this.fixedArguments.map((o,l)=>{var y;const p={id:e+"--"+o.id+"--parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e};return{id:e+"--"+o.id,version:o.version,type:i.ArgumentDeclaration,name:o.name,required:o.required,writesValues:[],description:o.description,index:l,dataType:((y=o.dataType)==null?void 0:y.toJSON())||null,parent:p}}),r=[],a=[];if(this.fixedReturns.length){const o=this.fixedReturns.map((f,m)=>{var g;const b={id:e+"--return-statement--"+f.id+"--parent-ref",type:i.GenericReference,entityId:e,entityType:i.ReturnStatement};return{id:e+"--"+f.id,version:f.version,type:i.ReturnDeclaration,name:f.name,description:f.description,readsValue:null,required:f.required,isError:!1,index:m,dataType:((g=f.dataType)==null?void 0:g.toJSON())||null,parent:b}}),l={id:e+"--return-statement-parent-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},p={id:e+"--return-statement-called-by-ref",type:i.GenericReference,entityType:i.FunctionDeclaration,entityId:e},y={id:e+"--return-statement",version:this.version,type:i.ReturnStatement,outputs:o,throws:null,calledBySuccess:[],calledByError:[],calledByEntry:[p],parent:l,x:0,y:0};r.push(y),a.push(y)}return{id:e,version:this.version,type:i.FunctionDeclaration,name:this.name,description:this.description,inputs:t,returnStatements:r,calls:a,collapsed:!1,private:!1,implements:this.toJSON(),index:0,parent:((s=this.parent)==null?void 0:s.toReference())||null,x:0,y:0}}implementAsLoop(e){const t=e||this.project,r=this.id+"--instance-"+_.UUID.fromUUID(_.UUID.uuid()),a={id:r,version:this.version,type:i.Loop,declaration:this.toJSON(),inputs:[],outputs:[],error:null,process:null,successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],breakStatements:[],continueStatements:[],outputsDeclarations:[],body:null,x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((l,p)=>{const f={id:l.toReference().id+"--input-map-id",version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:_.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Loop}};a.inputs.push(f)}),this.fixedReturns.forEach((l,p)=>{const f={id:l.toReference().id+"--output-map-id",version:this.version,type:i.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:_.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Loop}};a.outputs.push(f)});const s={id:r+"--body-function-declaration-id",version:this.version,type:i.FunctionDeclaration,name:"body",description:null,inputs:[],returnStatements:[],calls:[],implements:null,index:null,collapsed:!1,private:!1,x:0,y:0,parent:{id:_.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Loop}};s.inputs=[{id:_.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Current iteration number",description:"The number of the current iteration of the loop. Starts at 1.",dataType:null,required:!0,writesValues:[],index:0,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}},{id:_.UUID.uuid(),version:this.version,type:i.ArgumentDeclaration,name:"Previous iterations results",description:"The results of the previous iterations of the loop.",dataType:null,required:!0,writesValues:[],index:1,parent:{id:s.id,type:i.GenericReference,entityId:s.id,entityType:i.FunctionDeclaration}}],a.body=s;const o=R(a,this.project);return o.setParent(t),o.initChildren(),o}implementAsOperation(e,t){const r=e||this.project,a=t||this.id+"--instance-"+_.UUID.fromUUID(_.UUID.uuid()),s={id:a,version:this.version,type:i.Operation,declaration:this.toJSON(),inputs:[],outputs:[],error:null,successCalls:[],errorCalls:[],process:null,dynamicArguments:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:r.toReference()};if(this.fixedArguments.forEach((l,p)=>{const y={id:a+Ze(l.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:l,defaultValue:null,readsValue:null,index:p,dynamicArguments:[],parent:{id:_.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.inputs.push(y)}),this.fixedReturns.forEach((l,p)=>{const y={id:a+Ze(l.name,i.OutputMap,this.project),version:this.version,type:i.OutputMap,declaration:l,writesValues:[],index:p,parent:{id:_.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.outputs.push(y)}),this.error){const p={id:this.error.toReference().id+"--error-map",version:this.version,type:i.OutputMap,declaration:this.error,writesValues:[],index:-1,parent:{id:_.UUID.uuid(),type:i.GenericReference,entityId:a,entityType:i.Operation}};s.error=p}const o=R(s,this.project);return o.setParent(r),o.initChildren(),o}implementAsCondition(e){const t=e||this.project,r=this.id+"--instance-"+_.UUID.fromUUID(_.UUID.uuid()),a={id:r,version:this.version,type:i.Condition,declaration:this.toJSON(),operator:null,inputs:[],successCalls:[],errorCalls:[],calledByEntry:[],calledByError:[],calledBySuccess:[],x:0,y:0,parent:t.toReference()};this.fixedArguments.forEach((o,l)=>{const p={id:r+Ze(o.name,i.InputMap,this.project),version:this.version,type:i.InputMap,name:null,description:null,declaration:o,defaultValue:null,readsValue:null,index:l,dynamicArguments:[],parent:{id:_.UUID.uuid(),type:i.GenericReference,entityId:r,entityType:i.Condition}};a.inputs.push(p)});const s=R(a,this.project);return s.setParent(t),s.initChildren(),s}clearErrors(){var e,t,r;return this.errors=[],this.fixedArguments.forEach(a=>a.clearErrors()),this.fixedReturns.forEach(a=>a.clearErrors()),(e=this.dynamicArgumentTypes)==null||e.clearErrors(),(t=this.dynamicReturnTypes)==null||t.clearErrors(),(r=this.error)==null||r.clearErrors(),this}validate(){const e=t3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.fixedArguments.flatMap(t=>t.getErrors()),...this.fixedReturns.flatMap(t=>t.getErrors()),...this.dynamicArgumentTypes?this.dynamicArgumentTypes.getErrors():[],...this.dynamicReturnTypes?this.dynamicReturnTypes.getErrors():[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0){var m,b;const a=this.toJSON(),s=t||Ze(P(this,this.project),i.ActionDescriptor,this.project);a.fixedArguments=[],a.fixedReturns=[],a.dynamicArgumentTypes=null,a.dynamicReturnTypes=null,a.error=null;const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ft(a,this.project);e?p.setParent(e):this.parent&&p.setParent(this.parent),r&&p.subscribe(),p.initChildren();const y=(m=this.fixedArguments)==null?void 0:m.map((g,A)=>g.clone(this,l+"-argument-value-descriptor-"+A+"-id",r));p.fixedArguments=y;const f=(b=this.fixedReturns)==null?void 0:b.map((g,A)=>g.clone(this,l+"-return-value-descriptor-"+A+"-id",r));return p.fixedReturns=f,this.dynamicArgumentTypes&&(p.dynamicArgumentTypes=this.dynamicArgumentTypes.clone(this,l+"-dynamic-argument-types-id",r)),this.dynamicReturnTypes&&(p.dynamicReturnTypes=this.dynamicReturnTypes.clone(this,l+"-dynamic-return-types-id",r)),this.error&&(p.error=this.error.clone(this,l+"-error-action-descriptor-id",r)),p}setDynamicArgumentsDataType(e){return this.dynamicArgumentTypes=e,this}setDynamicReturnsDataType(e){return this.dynamicReturnTypes=e,this}addFixedArgument(e){return this.fixedArguments.find(t=>t.id===e.id)||this.fixedArguments.push(e),this}removeFixedArgument(e){return this.fixedArguments=this.fixedArguments.filter(t=>t.id!==e.id),this}addFixedReturn(e){return this.fixedReturns.find(t=>t.id===e.id)||this.fixedReturns.push(e),this}removeFixedReturn(e){return this.fixedReturns=this.fixedReturns.filter(t=>t.id!==e.id),this}};c(be,"MUTABLE_BASE_PROPERTIES",["name","description","argumentsType","returnsType"]),c(be,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(be,"BASE_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES,...be.INMUTABLE_BASE_PROPERTIES]),c(be,"MUTABLE_META_PROPERTIES",[...be.MUTABLE_BASE_PROPERTIES]),c(be,"INMUTABLE_META_PROPERTIES",[...be.INMUTABLE_BASE_PROPERTIES]),c(be,"META_PROPERTIES",[...be.MUTABLE_META_PROPERTIES,...be.INMUTABLE_META_PROPERTIES]),c(be,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(be,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(be,"UPSTREAM_PROPERTIES",[...be.MUTABLE_UPSTREAM_PROPERTIES,...be.INMUTABLE_UPSTREAM_PROPERTIES]),c(be,"MUTABLE_DOWNSTREAM_PROPERTIES",["dynamicArgumentTypes","dynamicReturnTypes","fixedArguments","fixedReturns"]),c(be,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(be,"DOWNSTREAM_PROPERTIES",[...be.MUTABLE_DOWNSTREAM_PROPERTIES,...be.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(be,"PROPERTIES",[...be.META_PROPERTIES,...be.UPSTREAM_PROPERTIES,...be.DOWNSTREAM_PROPERTIES]);let Ge=be;function n3(n){var s;const e=w4(),t=n.toJSON();e.safeParse(t).success,(s=n.dataType)==null||s.validate();const a=[];return ee(n.errors,a)}const ge=class ge{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"index");c(this,"required");c(this,"parentRelationType");c(this,"type",i.ValueDescriptor);c(this,"dataType",null);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.name=e.name,this.description=e.description,this.index=e.index,this.required=e.required,this.parentRelationType=e.parentRelationType}static fromGenerationTarget(e,t){const r=e.parent?O(e.parent):null,a=r?t.get(r):null,s=e.parentRelationType===w.FixedArguments?a==null?void 0:a.fixedArguments.length:a==null?void 0:a.fixedReturns.length,o={id:e.id,version:1,name:e.name,type:i.ValueDescriptor,index:s||0,description:e.description,required:e.required,parentRelationType:e.parentRelationType,dataType:null,parent:a},l=R(o,t);return a&&l.setParent(a),l.initChildren(),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[i.ActionDescriptor]}},t);r=s.modifiedData,a.push(...s.errors,...Oe(r));const o=r.parent&&t.get(r.parent),l=o&&qn(o);return l&&l.type===i.ActionDescriptor&&a.push(new E({id:`${e.id}--${h.BuiltInEntityParent}`,code:h.BuiltInEntityParent,severity:T.Error,message:`Entity of type "${e.type}" with id "${e.id}", has a parent that is a built-in entity "${l.name}" of type '${l.type}' with id '${l.id}'.
|
|
169
168
|
You can't modify system entities that are built-in.`,issue:null})),o&&o.type===i.ActionDescriptor&&(!r.parentRelationType||!(r.parentRelationType===w.FixedArguments||r.parentRelationType===w.FixedReturns||r.parentRelationType===w.ReturnedError)?a.push(new E({id:`${e.id}--${h.InvalidParentRelationType}`,code:h.InvalidParentRelationType,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', must have a 'parentRelationType' property set to either '${w.FixedArguments}', '${w.FixedReturns}', or '${w.ReturnedError}' when being added as a child to an entity of type 'action-descriptor'.`,issue:null})):r.parentRelationType===w.ReturnedError&&o.error&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.Error,message:`The entity with id '${e.id}' and type '${e.type}', is being added as an error value-descriptor to an entity of type 'action-descriptor' with id '${o.id}', which already has an error value descriptor with id '${o.error.id}'.
|
|
170
169
|
An action descriptor can only have one error value descriptor child.
|
|
171
170
|
Either remove the existing error value descriptor or update it with the 'update' action.
|
|
172
171
|
You can use the 'describe_entity' action to get more information about the existing error value descriptor like so:
|
|
173
|
-
${tn({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var t,r,a,s;const e=[this];return this.parentRelationType===w.FixedArguments?(r=(t=this.parent)==null?void 0:t.addFixedArgument)==null||r.call(t,this):this.parentRelationType===w.FixedReturns?(s=(a=this.parent)==null?void 0:a.addFixedReturn)==null||s.call(a,this):this.parentRelationType===w.ReturnedError&&this.parent&&(this.parent.error=this),this.parent&&([i.Search,i.Loop].includes(this.parent.type)&&this.parent.addOutputDeclaration(this),e.push(this.parent)),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),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.index=e.index||this.index,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return{affected:v(r),removed:v(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.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dataType?this.dataType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dataType?this.dataType.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+
|
|
172
|
+
${tn({describe_entity:o.error.id})}`,issue:null}))),{errors:a,modifiedData:r}}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){var t,r,a,s;const e=[this];return this.parentRelationType===w.FixedArguments?(r=(t=this.parent)==null?void 0:t.addFixedArgument)==null||r.call(t,this):this.parentRelationType===w.FixedReturns?(s=(a=this.parent)==null?void 0:a.addFixedReturn)==null||s.call(a,this):this.parentRelationType===w.ReturnedError&&this.parent&&(this.parent.error=this),this.parent&&([i.Search,i.Loop].includes(this.parent.type)&&this.parent.addOutputDeclaration(this),e.push(this.parent)),{affected:v(e),self:this}}setParent(e){return this.parent=e,this}initChildren(){return this.initialized?this:(this.initialized=!0,this.initialData.dataType&&(this.dataType=R(this.initialData.dataType,this.project),this.dataType.setParent(this),this.dataType.initChildren()),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.index=e.index||this.index,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 r=[],a=[];if(t.has(this.id))return{affected:[],removed:[]};if(t.add(this.id),a.push(this),this.unsubscribe(),this.dataType){const{affected:s,removed:o}=this.dataType.remove({ignoreUpstream:!0,seenEntities:t});r.push(...s),a.push(...o)}return{affected:v(r),removed:v(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.dataType){const{affected:r}=this.dataType.restore({seenEntities:e});t.push(...r)}return{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.dataType?this.dataType.toFlat(e):[]])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.dataType?this.dataType.toFlatIds(e):[]])}toJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toJSON())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.GenericReference,entityId:this.id,entityType:this.type}}toShallowJSON(){var e,t;return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,index:this.index,required:this.required,parentRelationType:this.parentRelationType,dataType:((e=this.dataType)==null?void 0:e.toReference())||null,parent:((t=this.parent)==null?void 0:t.toReference())||null}}toFlatJSON(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toShallowJSON(),...this.dataType?this.dataType.toFlatJSON(e):[]])}toGenerationTarget(){var e;return{id:this.id,name:this.name,description:this.description,type:this.type,required:this.required,parentRelationType:this.parentRelationType,parent:(e=this.parent)==null?void 0:e.id}}toFlatGenerationTarget(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.toGenerationTarget(),...this.dataType?this.dataType.toFlatGenerationTarget(e):[]])}clearErrors(){var e;return this.errors=[],(e=this.dataType)==null||e.clearErrors(),this}validate(){const e=n3(this);return this.errors=e,{success:!0,error:null,data:this.toJSON()}}getErrors(){return[...this.errors,...this.dataType?this.dataType.getErrors():[]]}getShallowErrors(){return this.errors}clone(e=null,t=null,r=!0){var f;const a=t||Ze(P(this,this.project),i.ValueDescriptor,this.project),s=a.split("-id"),o=s[s.length-1||0]||a,l=this.toJSON();l.id=a;const p=Ft(l,this.project);e&&p.setParent(e),r&&p.subscribe();const y=((f=this.dataType)==null?void 0:f.clone(p,o+"-data-type-id",r))||null;return y&&p.setDataType(y),p}getDataType(){return this.dataType||null}setDataType(e){return this.dataType=e,this}getDefaultValue(){var e;return((e=this.dataType)==null?void 0:e.defaultValue)||null}};c(ge,"MUTABLE_BASE_PROPERTIES",["name","description","required"]),c(ge,"INMUTABLE_BASE_PROPERTIES",["id","version","type","parentRelationType"]),c(ge,"BASE_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"MUTABLE_META_PROPERTIES",[...ge.MUTABLE_BASE_PROPERTIES,"index"]),c(ge,"INMUTABLE_META_PROPERTIES",[...ge.INMUTABLE_BASE_PROPERTIES]),c(ge,"META_PROPERTIES",[...ge.MUTABLE_META_PROPERTIES,...ge.INMUTABLE_META_PROPERTIES]),c(ge,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(ge,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(ge,"UPSTREAM_PROPERTIES",[...ge.MUTABLE_UPSTREAM_PROPERTIES,...ge.INMUTABLE_UPSTREAM_PROPERTIES]),c(ge,"MUTABLE_DOWNSTREAM_PROPERTIES",["dataType"]),c(ge,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ge,"DOWNSTREAM_PROPERTIES",[...ge.MUTABLE_DOWNSTREAM_PROPERTIES,...ge.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ge,"PROPERTIES",[...ge.META_PROPERTIES,...ge.UPSTREAM_PROPERTIES,...ge.DOWNSTREAM_PROPERTIES]);let Ar=ge;function r3(n,e){if(!n.type&&!n.id)return{errors:[new E({id:`last-generated-entity-payload--${h.MissingTypeProperty}`,message:"Last generated entity payload is missing a 'type' property.",severity:T.Error,code:h.MissingTypeProperty,issue:null}),new E({id:`last-generated-entity-payload--${h.MissingIdProperty}`,message:"Last generated entity payload is missing an 'id' property.",severity:T.Error,code:h.MissingIdProperty,issue:null})],modifiedData:null};if(n.type){if(!n.id)return{errors:[new E({id:`last-generated-entity-payload--${h.MissingIdProperty}`,message:`Last generated entity, with type "${n.type}" is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})],modifiedData:null}}else return{errors:[new E({id:`${n.id}--${h.MissingTypeProperty}`,message:`Entity with id "${n.id}" is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})],modifiedData:null};if(n.type===i.GenericReference)return{errors:[new E({id:`${n.id}--${h.RootReference}`,message:`Generic reference entity with id "${n.id}". A generic reference cannot be generated as a standalone entity. Only in the body of another entity.`,severity:T.Error,code:h.RootReference,issue:null})],modifiedData:null};const t=n,r=e.instances[t.id],a=e.builtInInstances[t.id];if(r&&!a&&t.type!==i.GenericReference){let s=`A previously generated entity with id "${t.id}" already exists in the project state.
|
|
174
173
|
Are you trying to update that entity?
|
|
175
174
|
If so, you should use the 'update' action for core mutable metadata properties, or 'delete' and then 'post' again to replace it.
|
|
176
|
-
If you are trying to create a new entity, please use a different id, for example: "${hd(t,e)}".`;return{errors:[new E({id:`duplicate--${t.id}--${h.EntityIdNotUnique}`,message:s,severity:T.Error,code:h.EntityIdNotUnique,issue:null})],modifiedData:n}}else if(r&&t.type!==i.GenericReference)return{errors:[new E({id:`${t.id}--${h.EntityIdNotUnique}`,message:`A built in entity with id "${t.id}" already exists. You cannot modify built in entities. If you are trying to create a new entity, please use a different id, for example: "${hd(t,e)}".`,severity:T.Error,code:h.EntityIdNotUnique,issue:null})],modifiedData:n};switch(t.type){case i.Project:return
|
|
175
|
+
If you are trying to create a new entity, please use a different id, for example: "${hd(t,e)}".`;return{errors:[new E({id:`duplicate--${t.id}--${h.EntityIdNotUnique}`,message:s,severity:T.Error,code:h.EntityIdNotUnique,issue:null})],modifiedData:n}}else if(r&&t.type!==i.GenericReference)return{errors:[new E({id:`${t.id}--${h.EntityIdNotUnique}`,message:`A built in entity with id "${t.id}" already exists. You cannot modify built in entities. If you are trying to create a new entity, please use a different id, for example: "${hd(t,e)}".`,severity:T.Error,code:h.EntityIdNotUnique,issue:null})],modifiedData:n};switch(t.type){case i.Project:return _.validateGenerationTarget(t,e);case i.CustomEntity:return Cr.validateGenerationTarget(t,e);case i.Property:return fr.validateGenerationTarget(t,e);case i.FunctionDeclaration:return mr.validateGenerationTarget(t,e);case i.DataType:return ci.validateGenerationTarget(t,e);case i.Operation:return Tr.validateGenerationTarget(t,e);case i.FunctionCall:return Sr.validateGenerationTarget(t,e);case i.VariableDeclaration:return br.validateGenerationTarget(t,e);case i.VariableInstance:return gr.validateGenerationTarget(t,e);case i.GlobalEvent:return di.validateGenerationTarget(t,e);case i.InputMap:return En.validateGenerationTarget(t,e);case i.OutputMap:return Rn.validateGenerationTarget(t,e);case i.ArgumentDeclaration:return Dr.validateGenerationTarget(t,e);case i.ReturnDeclaration:return wt.validateGenerationTarget(t,e);case i.Loop:return Er.validateGenerationTarget(t,e);case i.Condition:return Rr.validateGenerationTarget(t,e);case i.Search:return vr.validateGenerationTarget(t,e);case i.InstalledProject:return Ir.validateGenerationTarget(t,e);case i.InternalCall:return ui.validateGenerationTarget(t,e);case i.PrimitiveValue:return pi.validateGenerationTarget(t,e);case i.ReturnStatement:return Pr.validateGenerationTarget(t,e);case i.BreakStatement:return yi.validateGenerationTarget(t,e);case i.ContinueStatement:return ft.validateGenerationTarget(t,e);case i.ActionDescriptor:return Ge.validateGenerationTarget(t,e);case i.ValueDescriptor:return Ar.validateGenerationTarget(t,e);case i.BuiltInBaseEntity:case i.PrimitiveEntity:{const s="Did you mean to generate a",l={[i.BuiltInBaseEntity]:`${s} '${i.CustomEntity}' instead?`,[i.PrimitiveEntity]:`${s} '${i.CustomEntity}' instead?`}[t.type]||"";return{errors:[new E({id:`${t.id}--${h.BuiltInEntityGenerated}`,message:`Entity with id "${t.id} is of "${t.type}" type and should not be generated. Built in entities can only be referenced by user created entities.
|
|
177
176
|
${l}`,severity:T.Error,code:h.BuiltInEntityGenerated,issue:null})],modifiedData:n}}default:{const s=t;return{errors:[new E({id:`${s.id}--${h.UnknownEntityType}`,message:`Incorrect entity implementation for entity with id "${s.id}". Entity type "${s.type}" is not supported.`,severity:T.Error,code:h.UnknownEntityType,issue:null})],modifiedData:null}}}}function no(n){const e=mo(n.type),t=e.MUTABLE_BASE_PROPERTIES,r=e.MUTABLE_UPSTREAM_PROPERTIES;let a=`Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated values.
|
|
178
177
|
For entities of type "${n.type}", `;if(t.length>0?a+=`you can update the following metadata properties: '${L(t,"', '","' and '")}'. `:a+="there are no mutable metadata properties.",r.length>0){const s=t.length>0?`
|
|
179
178
|
You can also update the following upstream references: `:`
|
|
180
179
|
But can update the following upstream entity references: `;a+=`${s}'${L(r,"', '","' and '")}'.`}else a+=t.length>0?`
|
|
181
180
|
And there are no upstream references that can be updated.`:`
|
|
182
|
-
There are no upstream references that can be updated.`;return a}function i3(n,e){const t=[];let r=!1;if(
|
|
181
|
+
There are no upstream references that can be updated.`;return a}function i3(n,e){const t=[];let r=!1;if(Mr.includes(e.type)&&t.push(new E({id:`${e.id}--${h.BuiltInEntityGenerated}`,message:`Entity with id "${e.id} is of "${e.type}" type and should not be updated. Built in entities can only be referenced by user created entities.`,severity:T.Error,code:h.BuiltInEntityGenerated,issue:null})),n.id&&(t.push(new E({id:`last-action--${h.InvalidUpdateEntityOperation}`,code:h.InvalidUpdateEntityOperation,severity:T.Error,message:`The 'id' property cannot be updated in the 'update' action payload. The id of the entity is '${n.id}'. Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated 'id'.`,issue:null})),r=!0),n.type&&(t.push(new E({id:`last-action--${h.InvalidUpdateEntityOperation}`,code:h.InvalidUpdateEntityOperation,severity:T.Error,message:`The 'type' property cannot be updated in the 'update' action payload. The type of the entity is '${e.type}'. Only mutable core metadata properties can be updated, no nested entities or references. You can alternatively delete the entity and create a new one with the updated 'type'.`,issue:null})),r=!0),t.length)return{errors:t,modifiedData:null,messageAddition:""};if(we.includes(e.type)?n.calls&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calls" updated.
|
|
183
182
|
${Un}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})):Ne.includes(e.type)&&(n.successCalls&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "successCalls" updated.
|
|
184
183
|
${Un}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),n.errorCalls&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "errorCalls" updated.
|
|
185
184
|
${Un}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null}))),gn.includes(e.type)&&(n.calledBy&&t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "calledBy" updated.
|
|
@@ -190,15 +189,15 @@ ${Un}`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null}))),t
|
|
|
190
189
|
If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),r=!0)}),(a.DOWNSTREAM_PROPERTIES||[]).forEach($=>{n[$]&&!la(n[$])&&(t.push(new E({id:`${e.id}--${h.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${$}" set directly. It is a downstream property that points to a downstream nested entity.
|
|
191
190
|
All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
|
|
192
191
|
To modify '${$}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null})),r=!0)}),(a.INMUTABLE_UPSTREAM_PROPERTIES||[]).forEach($=>{n[$]&&!la(n[$])&&(t.push(new E({id:`${e.id}--${h.InvalidInmutablePropertyOverride}`,message:`Entity of type "${e.type}" with id "${e.id}" cannot have the property "${$}" updated. It is an inmutable property that is set only when the entity is created.
|
|
193
|
-
If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),r=!0)});const C=a.PROPERTIES||[];C.length>0&&Object.keys(n).forEach($=>{C.includes($)||t.push(new E({id:`${e.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${$}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:r?no(e):""};const s=uv(e),o=s==null?void 0:s.partial(),l=o==null?void 0:o.safeParse(n),p={...n,id:e.id,type:e.type},y=md(p,l);if(t.push(...y),t.length)return{errors:t,modifiedData:null,messageAddition:r?no(e):""};const m=e.validateGeneratedUpdate(n);return{errors:[...t,...m.errors],modifiedData:m.modifiedData,messageAddition:r?no(e):""}}function uv(n){switch(n.type){case i.PrimitiveValue:return Bs();case i.CustomEntity:return
|
|
192
|
+
If you need to update this property, you should delete the entity and create a new one with the updated value.`,severity:T.Error,code:h.InvalidInmutablePropertyOverride,issue:null})),r=!0)});const C=a.PROPERTIES||[];C.length>0&&Object.keys(n).forEach($=>{C.includes($)||t.push(new E({id:`${e.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${e.type}" with id "${e.id}" has an unrecognized property "${$}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}if(t.length)return{errors:t,modifiedData:null,messageAddition:r?no(e):""};const s=uv(e),o=s==null?void 0:s.partial(),l=o==null?void 0:o.safeParse(n),p={...n,id:e.id,type:e.type},y=md(p,l);if(t.push(...y),t.length)return{errors:t,modifiedData:null,messageAddition:r?no(e):""};const m=e.validateGeneratedUpdate(n);return{errors:[...t,...m.errors],modifiedData:m.modifiedData,messageAddition:r?no(e):""}}function uv(n){switch(n.type){case i.PrimitiveValue:return Bs();case i.CustomEntity:return Mc();case i.PrimitiveEntity:return Bs();case i.FunctionDeclaration:return Bc();case i.GlobalEvent:return Gs();case i.DataType:return vc();case i.Property:return sc();case i.FunctionCall:return hc();case i.Condition:return fc();case i.Operation:return Vs();case i.VariableDeclaration:return Dc();case i.VariableInstance:return Pc();case i.OutputMap:return yc();case i.ReturnDeclaration:return dc();case i.ArgumentDeclaration:return Cc();case i.InputMap:return Rc();case i.Project:return wc();case i.InstalledProject:return Ex();case i.ActionDescriptor:return Ms();case i.ReturnStatement:return cc();case i.Loop:return Ms();case i.Search:return mc();case i.ValueDescriptor:return ac();case i.BuiltInBaseEntity:return oc();case i.InternalCall:return Ec();case i.ContinueStatement:return lc();case i.BreakStatement:return uc();default:return null}}function pv(n){switch(n.type){case i.PrimitiveValue:return WU();case i.CustomEntity:return c8();case i.PrimitiveEntity:return _4();case i.FunctionDeclaration:return e8();case i.GlobalEvent:return Px();case i.DataType:return ax();case i.Property:return L4();case i.FunctionCall:return RU();case i.Condition:return DU();case i.Operation:return UU();case i.VariableDeclaration:return dx();case i.VariableInstance:return fx();case i.OutputMap:return fU();case i.ReturnDeclaration:return oU();case i.ArgumentDeclaration:return Zx();case i.InputMap:return $U();case i.Project:return a8();case i.InstalledProject:return bx();case i.ActionDescriptor:return W4();case i.ReturnStatement:return rU();case i.Loop:return z4();case i.Search:return OU();case i.ValueDescriptor:return C4();case i.BuiltInBaseEntity:return j4();case i.InternalCall:return MU();case i.ContinueStatement:return K4();case i.BreakStatement:return uU();default:return null}}function ro(n){const e=[];Ln(n)||e.push(new E({id:`${n}--${h.InvalidReferenceObjectStructure}`,message:`Reference object with id "${n}" is not an object. References should be objects with exactly 4 properties: 'entityId', 'entityType', 'id', and 'type'.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null}));const t=n.id||"reference-to--"+(n.entityId||"unknown"),r=`Reference object ${n.id?`with id "${n.id}"`:`to entity with id "${n.entityId}" and type "${n.entityType}"`}`;return n.entityId||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${r} is missing an 'entityId' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),n.entityType||e.push(new E({id:`${t}--${h.InvalidReferenceObjectStructure}`,message:`${r} is missing an 'entityType' property.`,severity:T.Error,code:h.InvalidReferenceObjectStructure,issue:null})),n.id||e.push(new E({id:`${t}--${h.MissingIdProperty}`,message:`${r} is missing an 'id' property.`,severity:T.Error,code:h.MissingIdProperty,issue:null})),n.type||e.push(new E({id:`${t}--${h.MissingTypeProperty}`,message:`${r} is missing a 'type' property.`,severity:T.Error,code:h.MissingTypeProperty,issue:null})),e}function md(n,e){return e.success?[]:e.error.issues.map(t=>new E({id:`${n.id}--${I.InvalidObjectStructure}`,message:`Entity of type "${n.type}" and with id "${n.id}", has an invalid structure: ${w8(t).toString().replace("Validation error: ","")}`,severity:T.Error,code:I.InvalidObjectStructure,issue:t}))}function Oe(n,e){const t=[],r=pv(n);if(r){const s=r.safeParse(n);t.push(...md(n,s))}const a=mo(n.type);if(a){(a.DOWNSTREAM_PROPERTIES||[]).forEach(l=>{n[l]&&!la(n[l])&&t.push(new E({id:`${n.id}--${h.InvalidDownstreamPropertyOverride}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the property "${l}" set directly. It is a downstream property that points to a downstream nested entity.
|
|
194
193
|
All downstream references are managed by the downstream entity. Entities only manage their own upstream references.
|
|
195
|
-
To modify '${l}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(n).forEach(l=>{o.includes(l)||t.push(new E({id:`${n.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${n.type}" with id "${n.id}" has an unrecognized property "${l}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}return t}function a3(n,e){const t=[];if(!n.parent)return t;const r=e.get(n.parent);return r?(
|
|
194
|
+
To modify '${l}', target the entity that it points to and its equivalent property.`,severity:T.Error,code:h.InvalidDownstreamPropertyOverride,issue:null}))});const o=a.PROPERTIES||[];o.length>0&&Object.keys(n).forEach(l=>{o.includes(l)||t.push(new E({id:`${n.id}--${h.UnrecognizedProperty}`,message:`Entity of type "${n.type}" with id "${n.id}" has an unrecognized property "${l}" that will be ignored.`,severity:T.Warning,code:h.UnrecognizedProperty,issue:null}))})}return t}function a3(n,e){const t=[];if(!n.parent)return t;const r=e.get(n.parent);return r?(Mr.includes(r==null?void 0:r.type)?t.push(new E({id:`${n.id}--${h.BuiltInEntityParent}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the parent with id "${r.id}", because it is a built in entity. Built in entities cannot be modified.`,severity:T.Error,code:h.BuiltInEntityParent,issue:null})):r.type===i.ActionDescriptor&&e.get(n.parent)&&t.push(new E({id:`${n.id}--${h.BuiltInEntityParent}`,message:`Entity of type "${n.type}" with id "${n.id}" cannot have the parent with id "${r.id}", because it is a built in entity. Built in entities cannot be modified. Action descriptors are only sometimes built in, other times they are managed by the user.`,severity:T.Error,code:h.BuiltInEntityParent,issue:null})),t):[]}function Td(n,e,t){const r=[],a=n[e.key];if(!a)return r.push(new E({id:`${n.id}--${e.key}--${I.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a reference to a "${e.key}" entity. The '${e.key}' property of a "${n.type}" entity can be ${L(e.types,", "," or ")}.`,severity:T.Error,code:I.InvalidObjectStructure,issue:null})),{entityState:null,errors:r};let s=null;if(typeof a=="string")s=a;else{const l=ro(a);r.push(...l),l.length===0&&(s=a.entityId)}if(!s)return{entityState:null,errors:r};if(n.id===s)return r.push(new E({id:`${n.id}--${s}--${h.SelfReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,severity:T.Error,code:h.SelfReference,issue:null})),{entityState:null,errors:r};const o=t.get(s)||t.getBuiltIn(s);return o?e.types.includes(o.type)||r.push(new E({id:`${n.id}--${s}--${h.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${s}" at '${e.key}' that isn't pointing to an entity of type '${L(e.types,"', '","' or '")}'.`,severity:T.Error,code:h.InvalidReference,issue:null})):r.push(new E({id:`${n.id}--${s}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${s}" at '${e.key}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:o,errors:r}}function io(n,e,t){const r=[],a=n[e];return a?Array.isArray(a)?{entities:a.map(o=>{let l=null;if(typeof o=="string")l=o;else{const y=ro(o);r.push(...y),y.length===0&&(l=o.entityId)}if(!l)return{entityState:null,errors:[new E({id:`${n.id}--${e}--${h.InvalidReference}`,message:`Entity of type "${n.type}" with id "${n.id}", has a missing reference at '${e}'. A reference needs to be a 'id' string of an existing entity in the project.`,severity:T.Error,code:h.InvalidReference,issue:null})]};const p=t.get(l)||t.getBuiltIn(l);return p?{entityState:p,errors:[]}:(r.push(new E({id:`${n.id}--${l}--${h.ReferencedEntityNotFound}`,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${l}" at '${e}' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,severity:T.Error,code:h.ReferencedEntityNotFound,issue:null})),{entityState:null,errors:r})}),errors:[]}:(r.push(new E({id:`${n.id}--${e}--${I.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" has an invalid structure for the "${e}" property. It should be an array of references.`,severity:T.Error,code:I.InvalidObjectStructure,issue:null})),{entities:[],errors:r}):(r.push(new E({id:`${n.id}--${e}--${I.InvalidObjectStructure}`,message:`Entity of type "${n.type}" with id "${n.id}" is missing a list of references to "${e}" entities.`,severity:T.Error,code:I.InvalidObjectStructure,issue:null})),{entities:[],errors:r})}function Ed(n,e,t){const r=[],a=Td(n,e,t);if(a.errors.length>0)return a.errors;if(a.entityState){const s=a.entityState;e.types.includes(s.type)||r.push(new E({id:`${n.id}--${s.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to "${e.key}" that isn't pointing to an entity of type '${L(e.types,"', '","' or '")}'.`,issue:null})),n.id===s.id&&r.push(new E({id:`${n.id}--${s.id}--${h.SelfReference}`,code:h.SelfReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to itself at '${e.key}'. This is not allowed. Change the reference string or the 'entityId' property of the reference object.`,issue:null}))}return r}function L(n,e,t){if(n.length===1)return n[0];if(n.length===2)return n.join(t);{const r=n.pop();return`${n.join(e)}${t}${r}`}}const Fn=`Pass-through callable entities are entities that need to be called by another caller, then they execute some internal logic and when finished, it can call other callable entities with the "calledBySuccess" property or "calledByError" property based on whether their internal execution was successful or an error ocurred respectively.
|
|
196
195
|
All pass-through callable entities are: ${L(Ne,", "," and ")}.`,ma=`Entry point entities are the entities which start the execution of a logic chain. They are ${L(we,", "," and ")}.They aren't explicitly called by any entities. Rather, they can be called implicitly by the system, or as a function-call somewhere else in the case of a function-declaration. `,yv=`Caller entities are entities that can call other entities. Regarless of whether they are entry-point entities or pass-through callable entities. All caller entity types are: ${L(an,", "," and ")}.`,s3=`Callable entities are entities that can be called by other entities. They can be called by an entry-point, a success caller, or an error caller.
|
|
197
196
|
All callable entity types are: ${L(gn,", "," and ")}.`,Un=`Caller to callee relationships can be updated with the 'add_caller' and 'remove_caller' generation action with the properties: 'callerEntityId', a 'calleeEntityId'. For adding a caller, you can optionally add a boolean property 'fromError' (if the caller calls when an error occured in its execution).
|
|
198
197
|
Either of these two actions will only affect the one relationship between the given caller and callee and ignore any others present in either entity.`,Rd=`Break and continue statements need to have exactly one 'return-declaration' entity each. It represents the result of the current iteration of the loop. It can have any name and have any 'data-type' but it needs to be identical among all statements in the same loop.
|
|
199
198
|
Meaning, if the return declaration in one 'break-statement' is named 'result' and has a 'data-type' of 'number', all other 'break-statements' and 'continue-statements' in the same loop need to have a 'return-declaration' with the same name and 'data-type'.`,o3=`Return statements need to be identical inside the same scope. For example if a 'return-statement' belongs to a function, with multiple branches of logic, leading to multiple 'return-statement' entities, all of them need to have the exact same amount of 'return-declaration' entities, sharing the same name and an equivalent 'data-type' entity.
|
|
200
199
|
Furthermore, some 'function-declarations' and all 'global-events' might be implementing a base 'action-descriptor' entity, which defines exactly the shape and number of the return declarations.`,bd=`A variable without a data type which reads an-untyped object value, or has object properties written into it as input-map writes, will infere its data-type. This means that a 'data-type' will be created, with an implicitly declared 'custom-entity' as its 'entity' property, defining the structure of the object.
|
|
201
|
-
This data type entity is what will define which properties are available to be read from the variable or any of its instances as 'output-map' entities.`,xn=`Entities of type '${i.BuiltInBaseEntity}' that have the 'interactive' property set to false cannot be used programmatically during runtime. They can't be used as data types or instanciated in variables. Their methods can't be called by the code, and are only called by the system in the background. Their properties' values are constant and set only once when declared. They also can't be extended with unrecognized properties or methods that aren't part of the base out-of-the-box entity.`,gd=`Entities that read values from other entities, can be connected with entities that write values to them. Value reading entity types are: '${L(Jn,"', '","' and '")}'.`,hv=`Entities that write values to other entities, can be connected with entities that read values from them. Value writing entity types are: '${L(
|
|
200
|
+
This data type entity is what will define which properties are available to be read from the variable or any of its instances as 'output-map' entities.`,xn=`Entities of type '${i.BuiltInBaseEntity}' that have the 'interactive' property set to false cannot be used programmatically during runtime. They can't be used as data types or instanciated in variables. Their methods can't be called by the code, and are only called by the system in the background. Their properties' values are constant and set only once when declared. They also can't be extended with unrecognized properties or methods that aren't part of the base out-of-the-box entity.`,gd=`Entities that read values from other entities, can be connected with entities that write values to them. Value reading entity types are: '${L(Jn,"', '","' and '")}'.`,hv=`Entities that write values to other entities, can be connected with entities that read values from them. Value writing entity types are: '${L(_e,"', '","' and '")}'.`,vd=`A property entity, is neither a value reading, or a value writting entity, but they are often confused with one.
|
|
202
201
|
A 'property' can have a default value through its nested 'data-type' entity.
|
|
203
202
|
The 'property' entity only represents the data field in the declaration, and it can't write or read values.
|
|
204
203
|
When a 'custom-entity' is instantiated as a variable, any writes or reads to its properties are done through 'input-map's and 'output-map's.`,ao=`Some entities can hold values during runtime, they often can be given a hardcoded "default value" either directly or on their declarations, and can be connected to other entities that write or read values to and from them. Entities that can hold values are: '${L(Fd,"', '","' and '")}'.
|
|
@@ -227,94 +226,94 @@ ${typeof n=="string"?n:JSON.stringify(n,null,2)}
|
|
|
227
226
|
}`;return tn(r)}default:return""}}function fv(n,e){const t=JSON.parse(JSON.stringify(n)),r=[];if(we.includes(e.type))r.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledBySuccess' with id "${e.id}".
|
|
228
227
|
Entry-point entities can only be referenced as 'calledByEntry'.
|
|
229
228
|
${ma}
|
|
230
|
-
We have moved the reference to 'calledByEntry' for you.`,issue:null})),t.calledByEntry.push(e.id),t.calledBySuccess=t.calledBySuccess.filter(a=>a!==e.id);else if(
|
|
229
|
+
We have moved the reference to 'calledByEntry' for you.`,issue:null})),t.calledByEntry.push(e.id),t.calledBySuccess=t.calledBySuccess.filter(a=>a!==e.id);else if(Me.includes(e.type)){const a=e.calledBy||[],s=a.length?`
|
|
231
230
|
|
|
232
231
|
This ${e.type} is called by ${L(a.map(o=>`${o.type} with id "${o.id}"`),", "," and ")} entities. You can reference ${a.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";r.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledBySuccess' with id "${e.id}".
|
|
233
232
|
${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
234
|
-
Termination entities are ${L(
|
|
233
|
+
Termination entities are ${L(Me,", "," and ")}.${s}`,issue:null}))}else if(!Ne.includes(e.type))r.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a pass-through callable entity.
|
|
235
234
|
${Fn}`,issue:null}));else if(!an.includes(e.type))return r.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledBySuccess' with id "${e.id}" that isn't a caller entity.
|
|
236
235
|
All caller entity types are: ${L(an,", "," and ")}.
|
|
237
236
|
For the 'calledBySuccess' property, you specifically need to reference a pass-through callable entity.
|
|
238
237
|
${Fn}`,issue:null})),{errors:r,modifiedData:t};return{errors:r,modifiedData:t}}function mv(n,e){const t=[];if(we.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to an entry-point entity at 'calledByError' with id "${e.id}".
|
|
239
238
|
Entry-point entities can only be referenced as 'calledByEntry'.
|
|
240
|
-
${ma}`,issue:null}));else if(
|
|
239
|
+
${ma}`,issue:null}));else if(Me.includes(e.type)){const r=e.calledBy||[],a=r.length?`
|
|
241
240
|
|
|
242
241
|
This ${e.type} is called by ${L(r.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${r.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledByError' with id "${e.id}".
|
|
243
242
|
${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
244
|
-
Termination entities are ${L(
|
|
243
|
+
Termination entities are ${L(Me,", "," and ")}.${a}`,issue:null}))}else if(!Ne.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a pass-through callable entity.
|
|
245
244
|
${Fn}`,issue:null}));else if(!an.includes(e.type))return t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByError' with id "${e.id}" that isn't a caller entity.
|
|
246
245
|
All caller entity types are: ${L(an,", "," and ")}.
|
|
247
246
|
For the 'calledByError' property, you specifically need to reference a pass-through callable entity.
|
|
248
|
-
${Fn}`,issue:null})),t;return t}function Tv(n,e){const t=[];if(
|
|
247
|
+
${Fn}`,issue:null})),t;return t}function Tv(n,e){const t=[];if(Me.includes(e.type)){const r=e.calledBy||[],a=r.length?`
|
|
249
248
|
|
|
250
249
|
This ${e.type} is called by ${L(r.map(s=>`${s.type} with id "${s.id}"`),", "," and ")} entities. You can reference ${r.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a '${e.type}' entity at 'calledByEntry' with id "${e.id}".
|
|
251
250
|
${e.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
252
|
-
Termination entities are ${L(
|
|
251
|
+
Termination entities are ${L(Me,", "," and ")}.${a}`,issue:null}))}else if(Ne.includes(e.type))t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that is a pass-through callable entity, not an entry-point entity.
|
|
253
252
|
${Fn}.
|
|
254
253
|
${ma}.
|
|
255
254
|
|
|
256
255
|
We have moved the reference to 'calledBySuccess' for you.`,issue:null}));else if(!an.includes(e.type))return t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity at 'calledByEntry' with id "${e.id}" that isn't a caller entity.
|
|
257
256
|
All caller entity types are: ${L(an,", "," and ")}.
|
|
258
257
|
For the 'calledByEntry' property, you specifically need to reference a pass-through callable entity.
|
|
259
|
-
${Fn}`,issue:null})),t;return t}function Ev(n,e){const t=[];let r=JSON.parse(JSON.stringify(n));if(gn.includes(r.type)){if(r.calledBySuccess){const s=io(r,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=fv(r,o.entityState);r=l.modifiedData,t.push(...l.errors)}):t.push(...s.errors)}if(r.calledByError){const s=io(r,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=mv(r,o.entityState);t.push(...l)}):t.push(...s.errors)}if(r.calledByEntry){const s=io(r,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=Tv(r,o.entityState);t.push(...l)}),t.push(...t)):t.push(...s.errors)}const a=[...r.calledBySuccess||[],...r.calledByError||[],...r.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new E({id:`${r.id}--${h.DuplicateReference}`,code:h.DuplicateReference,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=
|
|
260
|
-
The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(r.calledByError||[]).find(A=>A===m.id)?(m.errorCalls||[]).find($=>
|
|
261
|
-
The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(r.calledByEntry||[]).find(A=>A===m.id)&&(m.calls||[]).find($=>
|
|
262
|
-
The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),l.push({caller:m,scope:b})):p.push({caller:m,scope:b,errors:[new E({id:`${r.id}--${m.id}--${h.CallerWithIncompatibleScope}`,code:h.CallerWithIncompatibleScope,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that is in a different scope. The caller entity should be in the same scope or a higher valid scope. Or all callers should share the global project scope with the entity they call.`,issue:null})]});else if(!y)y=b;else{const{compatible:g}=Ra(y,b,e);g?(
|
|
263
|
-
The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(r.calledByError||[]).find(A=>A===m.id)?(m.errorCalls||[]).find($=>
|
|
264
|
-
The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(r.calledByEntry||[]).find(A=>A===m.id)&&(m.calls||[]).find($=>
|
|
258
|
+
${Fn}`,issue:null})),t;return t}function Ev(n,e){const t=[];let r=JSON.parse(JSON.stringify(n));if(gn.includes(r.type)){if(r.calledBySuccess){const s=io(r,"calledBySuccess",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=fv(r,o.entityState);r=l.modifiedData,t.push(...l.errors)}):t.push(...s.errors)}if(r.calledByError){const s=io(r,"calledByError",e);s.errors.length===0?s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=mv(r,o.entityState);t.push(...l)}):t.push(...s.errors)}if(r.calledByEntry){const s=io(r,"calledByEntry",e);s.errors.length===0?(s.entities.forEach(o=>{if(o.errors.length){t.push(...o.errors);return}const l=Tv(r,o.entityState);t.push(...l)}),t.push(...t)):t.push(...s.errors)}const a=[...r.calledBySuccess||[],...r.calledByError||[],...r.calledByEntry||[]];if(a.length){const s=[...new Set(a)];a.length!==s.length&&t.push(new E({id:`${r.id}--${h.DuplicateReference}`,code:h.DuplicateReference,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" has duplicate caller references. Each caller reference should be unique. Duplicate caller reference will be ignored.`,issue:null}));const o=Tt(r,e);r.type===i.ReturnStatement&&o&&!we.includes(o.type)?t.push(new E({id:`${r.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" has an explicitly set parent, but it isn't a '${L(we,"', '","' or '")}' entity. A return statement's parent should always be resolved to a function declaration or global event.${so}`,issue:null})):r.type===i.ContinueStatement&&o&&o.type!==i.Loop?t.push(new E({id:`${r.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" has an explicitly set parent, but it isn't a '${i.Loop}' entity. A continue statement's parent should always be resolved to a loop entity.${so}`,issue:null})):r.type===i.BreakStatement&&o&&o.type!==i.Loop&&t.push(new E({id:`${r.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" has an explicitly set parent, but it isn't a '${i.Loop}' entity. A break statement's parent should always be resolved to a loop entity.${so}`,issue:null}));const l=[],p=[];let y=null;if(s.forEach(f=>{const m=e.get(f);if(!m){t.push(new E({id:`${r.id}--${f}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a caller entity with id "${f}" that doesn't exist in the project.`,issue:null}));return}const b=Tt(m,e);if(o)Ra(o,b,e)?(Me.includes(r.type)&&((r.calledBySuccess||[]).find(A=>A===m.id)?(m.successCalls||[]).find($=>Me.includes($.type))&&t.push(new E({id:`${r.id}--${m.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
|
|
259
|
+
The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(r.calledByError||[]).find(A=>A===m.id)?(m.errorCalls||[]).find($=>Me.includes($.type))&&t.push(new E({id:`${r.id}--${m.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
|
|
260
|
+
The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(r.calledByEntry||[]).find(A=>A===m.id)&&(m.calls||[]).find($=>Me.includes($.type))&&t.push(new E({id:`${r.id}--${m.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
|
|
261
|
+
The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),l.push({caller:m,scope:b})):p.push({caller:m,scope:b,errors:[new E({id:`${r.id}--${m.id}--${h.CallerWithIncompatibleScope}`,code:h.CallerWithIncompatibleScope,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that is in a different scope. The caller entity should be in the same scope or a higher valid scope. Or all callers should share the global project scope with the entity they call.`,issue:null})]});else if(!y)y=b;else{const{compatible:g}=Ra(y,b,e);g?(Me.includes(r.type)&&((r.calledBySuccess||[]).find(A=>A===m.id)?(m.successCalls||[]).find($=>Me.includes($.type))&&t.push(new E({id:`${r.id}--${m.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
|
|
262
|
+
The new termination statement is redundant because both entities would be called from the same parent caller branch "successCalls", at the same time.`,issue:null})):(r.calledByError||[]).find(A=>A===m.id)?(m.errorCalls||[]).find($=>Me.includes($.type))&&t.push(new E({id:`${r.id}--${m.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
|
|
263
|
+
The new termination statement is redundant because both entities would be called from the same parent caller branch "errorCalls", at the same time.`,issue:null})):(r.calledByEntry||[]).find(A=>A===m.id)&&(m.calls||[]).find($=>Me.includes($.type))&&t.push(new E({id:`${r.id}--${m.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Error,message:`Entity of type "${r.type}" with id "${r.id}" is being called by an entity of type "${m.type}" with id "${m.id}" that already calls a termination statement.
|
|
265
264
|
The new termination statement is redundant because both entities would be called from the same parent caller branch (entry-point), at the same time.`,issue:null}))),l.push({caller:m,scope:b})):p.push({caller:m,scope:b,errors:[new E({id:`${r.id}--${m.id}--${h.CallerWithIncompatibleScope}`,code:h.CallerWithIncompatibleScope,severity:T.Warning,message:`Entity of type "${r.type}" with id "${r.id}" has multiple caller, but not all of them have compatible scopes. Caller of type "${m.type}" with id "${m.id}" is in a different scope than caller of type "${y.type}" with id "${y.id}". All callers should be in the same scope or a higher valid scope. Or all callers should share the global project scope.`,issue:null})]})}}),p.length)p.forEach(f=>{t.push(...f.errors)});else if(l.length&&!o&&go.includes(r.type)){const f=l.filter(m=>m.scope!==e);if(f.length){const m=zv(f.map(b=>b.scope));r.parent=m.id}else r.parent=e.id}}else{let s=`Entity of type "${r.type}" with id "${r.id}" isn't called by any other entity. Callable entities only get executed if they have a list of references from either 'calledByEntry', 'calledBySuccess' or 'calledByError'.
|
|
266
265
|
To add a caller, use the 'add_caller' action with the properties: 'callerEntityId', a 'calleeEntityId', and optionally a boolean 'fromError' (if the caller calls when an error occured in its execution).`;r.type===i.ReturnStatement?s+=`
|
|
267
266
|
Return statements need to have a caller when created, since their purpose is to terminate a call chain.`:r.type===i.ContinueStatement?s+=`
|
|
268
267
|
Continue statements need to have a caller when created, since they are used to skip the rest of the current iteration of a loop and can't be detached from a call chain.`:r.type===i.BreakStatement&&(s+=`
|
|
269
268
|
Break statements need to have a caller when created, since they are used to exit a loop and can't be detached from a call chain.`),s+=`
|
|
270
|
-
${yv}`,
|
|
271
|
-
It is recommended to have a caller reference already at the moment of creation in the payload of the generation action.`),t.push(new E({id:`${r.id}--${I.MissingCaller}`,code:I.MissingCaller,severity:
|
|
272
|
-
All value writting entity types are: ${L(
|
|
269
|
+
${yv}`,Me.includes(r.type)||(s+=`
|
|
270
|
+
It is recommended to have a caller reference already at the moment of creation in the payload of the generation action.`),t.push(new E({id:`${r.id}--${I.MissingCaller}`,code:I.MissingCaller,severity:Me.includes(r.type)?T.Error:T.Warning,message:s,issue:null}))}}return{errors:t,modifiedData:r}}function Dd(n,e){const t=[];if(e.type===i.PrimitiveValue){const o=e.parent;let l=!1;if(o.type===i.InputMap)t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
|
|
271
|
+
All value writting entity types are: ${L(_e,", "," and ")}.
|
|
273
272
|
|
|
274
|
-
This primitive-value entity belongs to an input map entity with id "${o.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(o.type===i.DataType){const p=o,y=p.parent;
|
|
275
|
-
All value writting entity types are: ${L(
|
|
273
|
+
This primitive-value entity belongs to an input map entity with id "${o.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(o.type===i.DataType){const p=o,y=p.parent;_e.includes(y.type)?t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
274
|
+
All value writting entity types are: ${L(_e,", "," and ")}.
|
|
276
275
|
|
|
277
276
|
This primitive-value entity belongs to a data type entity with id "${p.id}", which itself belongs to a ${y.type} entity with id "${y.id}". ${y.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):l=!0}l&&t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
278
|
-
All value writting entity types are: ${L(
|
|
279
|
-
All value writting entity types are: ${L(
|
|
277
|
+
All value writting entity types are: ${L(_e,", "," and ")}.`,issue:null}))}else if(e.type===i.DataType){const o=e.parent;_e.includes(o.type)?t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
278
|
+
All value writting entity types are: ${L(_e,", "," and ")}.
|
|
280
279
|
|
|
281
280
|
This data type entity belongs to a ${o.type} entity with id "${o.id}". ${o.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
282
|
-
All value writting entity types are: ${L(
|
|
283
|
-
All value writting entity types are: ${L(
|
|
281
|
+
All value writting entity types are: ${L(_e,", "," and ")}.`,issue:null}))}else _e.includes(e.type)||t.push(new E({id:`${n.id}--${e.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" that isn't a value writting entity.
|
|
282
|
+
All value writting entity types are: ${L(_e,", "," and ")}.`,issue:null}));const r=Tt(n,e.project),a=Tt(e,e.project);if(r){const s=Ra(r,e,e.project);if(!s.compatible){const{type:o}=s;let l="";const p=`But they are nested under different subscopes. The reader is in the scope of the '${r.type}' (${P(r,e.project)}) with id '${r.id}', and the writter is in the scope of the '${a.type}' (${P(a,e.project)}) with id '${a.id}'.`;o===Eo.ParallelInCommonParent?(l=`The reader and the writter entities are both in the scope of the '${s.commonAncestorScope.type}' (${P(s.commonAncestorScope,e.project)}) with id '${s.commonAncestorScope.id}'.`,l+=`
|
|
284
283
|
${p}`):o===Eo.ParallelInProject&&(l="The reader and the writter entities are both in separate scopes in the project that have no common ancestor.",l+=`
|
|
285
284
|
${p}`),l+=`
|
|
286
285
|
Two value holding entities need to be in the same scope or in scopes nested inside of eachother to be able to read and write to each other.`,t.push(new E({id:`${n.id}--${e.id}--${h.IncompatibleScope}`,code:h.IncompatibleScope,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", has a reference to a value writting entity at 'readsValue' with id "${e.id}" with an incompatible scope.
|
|
287
|
-
${l}`,issue:null}))}}return t}function Ue(n,e,t,r=!1){const a=[],s={...e};let o=JSON.parse(JSON.stringify(n));if(!r){if(Jn.includes(o.type)){if(o.readsValue){const y=Td(o,{key:"readsValue",types:
|
|
286
|
+
${l}`,issue:null}))}}return t}function Ue(n,e,t,r=!1){const a=[],s={...e};let o=JSON.parse(JSON.stringify(n));if(!r){if(Jn.includes(o.type)){if(o.readsValue){const y=Td(o,{key:"readsValue",types:_e},t);if(y.errors.length===0){const f=Dd(o,y.entityState);a.push(...f)}else a.push(...y.errors);delete s.readsValue}}else o.readsValue&&(_e.includes(o.type)?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${L(Jn,", "," and ")}.
|
|
288
287
|
${ao}`,issue:null})):i.Property===o.type?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${L(Jn,", "," and ")}.
|
|
289
288
|
${vd}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" has a 'readsValue' property that is only valid for entities of type: ${L(Jn,", "," and ")}.
|
|
290
|
-
${gd}`,issue:null})),delete s.readsValue);o.writesValues&&(
|
|
289
|
+
${gd}`,issue:null})),delete s.readsValue);o.writesValues&&(_e.includes(o.type)?a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
|
|
291
290
|
${Id}`,issue:null})):a.push(new E({id:`${o.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Warning,message:`Entity of type "${o.type}" with id "${o.id}" has a 'writesValues' property. This property is managed by the downstream entity, the value reader, and should not be present in the payload of the generation action.
|
|
292
291
|
${ao}
|
|
293
|
-
${Id}`,issue:null})),delete s.writesValues);const p=Ev(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const l=Object.entries(s);for(const[p,y]of l){const f=y.types,m=y.optional,b=o[p];if(!b){m||a.push(new E({id:`${o.id}--${p}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" is missing a reference to a "${p}" entity. The '${p}' property of a "${o.type}" entity can be ${L(f,", "," or ")}`,issue:null}));continue}if(y.list)if(Array.isArray(b))for(const g of b){const A=Ed(o,{key:p,types:f,optional:m},t);a.push(...A)}else{a.push(new E({id:`${o.id}--${p}--${h.ContainsSingleButShouldBeReferenceList}`,code:h.ContainsSingleButShouldBeReferenceList,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which is a list, but it isn't.`,issue:null}));continue}else if(Array.isArray(b)){a.push(new E({id:`${o.id}--${p}--${h.ContainsListButShouldReferenceSingle}`,code:h.ContainsListButShouldReferenceSingle,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which holds a single reference, but it is a list.`,issue:null}));continue}else{const g=Ed(o,{key:p,types:f,optional:m},t);a.push(...g)}}return{errors:a,modifiedData:o}}function c3(n,e,t="calledBy"){const r=[];if(!n)return[];const a=e.get(n);if(!a)return r.push(new E({id:`${n}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),r;if([...Ne,...we].includes(a.type))return[];if(
|
|
292
|
+
${Id}`,issue:null})),delete s.writesValues);const p=Ev(o,t);delete s.calledByError,delete s.calledBySuccess,delete s.calledByEntry,a.push(...p.errors),o=p.modifiedData}const l=Object.entries(s);for(const[p,y]of l){const f=y.types,m=y.optional,b=o[p];if(!b){m||a.push(new E({id:`${o.id}--${p}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}" is missing a reference to a "${p}" entity. The '${p}' property of a "${o.type}" entity can be ${L(f,", "," or ")}`,issue:null}));continue}if(y.list)if(Array.isArray(b))for(const g of b){const A=Ed(o,{key:p,types:f,optional:m},t);a.push(...A)}else{a.push(new E({id:`${o.id}--${p}--${h.ContainsSingleButShouldBeReferenceList}`,code:h.ContainsSingleButShouldBeReferenceList,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which is a list, but it isn't.`,issue:null}));continue}else if(Array.isArray(b)){a.push(new E({id:`${o.id}--${p}--${h.ContainsListButShouldReferenceSingle}`,code:h.ContainsListButShouldReferenceSingle,severity:T.Error,message:`Entity of type "${o.type}" with id "${o.id}", should have a property "${p}" which holds a single reference, but it is a list.`,issue:null}));continue}else{const g=Ed(o,{key:p,types:f,optional:m},t);a.push(...g)}}return{errors:a,modifiedData:o}}function c3(n,e,t="calledBy"){const r=[];if(!n)return[];const a=e.get(n);if(!a)return r.push(new E({id:`${n}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),r;if([...Ne,...we].includes(a.type))return[];if(Me.includes(a.type)){const s=a.calledBy||[],o=s.length?`
|
|
294
293
|
|
|
295
294
|
This ${a.type} is called by ${L(s.map(l=>`${l.type} with id "${l.id}"`),", "," and ")} entities. You can reference ${s.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";r.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}'.
|
|
296
295
|
${a.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
297
|
-
Termination entities are ${L(
|
|
298
|
-
All caller entity types are: ${L(an,", "," and ")}.`,issue:null}));return r}function d3(n,e,t="calledByError"){const r=[];if(!n)return[];const a=e.get(n);if(!a)return r.push(new E({id:`${n}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),r;if(Ne.includes(a.type))return[];if(
|
|
296
|
+
Termination entities are ${L(Me,", "," and ")}.${o}`,issue:null}))}else r.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
|
|
297
|
+
All caller entity types are: ${L(an,", "," and ")}.`,issue:null}));return r}function d3(n,e,t="calledByError"){const r=[];if(!n)return[];const a=e.get(n);if(!a)return r.push(new E({id:`${n}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity with id "${n}" referenced in '${t}' property not found in the project. Perhaps it should be created first? Perhaps it is the wrong ID?`,issue:null})),r;if(Ne.includes(a.type))return[];if(Me.includes(a.type)){const s=a.calledBy||[],o=s.length?`
|
|
299
298
|
|
|
300
299
|
This ${a.type} is called by ${L(s.map(l=>`${l.type} with id "${l.id}"`),", "," and ")} entities. You can reference ${s.length>1?"one of them":"it"} instead to execute this entity before the end of the logic.`:"";r.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}'.
|
|
301
300
|
${a.type} entities are the last entity to be executed in a logic chain, and they don't call any other entities.
|
|
302
|
-
Termination entities are ${L(
|
|
301
|
+
Termination entities are ${L(Me,", "," and ")}.${o}`,issue:null}))}else we.includes(a.type)?r.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is an entry-point entity and doesn't thrown errors.
|
|
303
302
|
${ma}`,issue:null})):r.push(new E({id:`last-action--${a.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity with id '${a.id}' referenced in '${t}' property is of type '${a.type}' which is not a valid caller entity type.
|
|
304
303
|
For any error branch caller, for the 'calledByError' property of an entity, you specifically need to reference a pass-through callable entity.
|
|
305
304
|
${Fn}`,issue:null}));return r}function u3(n,e){const t=[],r=e.get(n);if(!r)t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The 'readsValue' property references an entity with id '${n}' that was not found in the project. Perhaps it should be created? Perhaps the ID is incorrect?`,issue:null}));else if(r.type===i.PrimitiveValue){const s=r.parent;let o=!1;if(s.type===i.InputMap)t.push(new E({id:`last-action--${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`The 'readsValue' property references an entity with id "${r.id}" that is a primitive value entity. Primitive value entities aren't value writting entities.
|
|
306
|
-
All value writting entity types are: ${L(
|
|
305
|
+
All value writting entity types are: ${L(_e,", "," and ")}.
|
|
307
306
|
|
|
308
|
-
This primitive-value entity belongs to an input map entity with id "${s.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(s.type===i.DataType){const l=s,p=l.parent;
|
|
309
|
-
All value writting entity types are: ${L(
|
|
307
|
+
This primitive-value entity belongs to an input map entity with id "${s.id}". Input map entities are value writting entities. Is that what you meant to reference?`,issue:null}));else if(s.type===i.DataType){const l=s,p=l.parent;_e.includes(p.type)?t.push(new E({id:`last-action--${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`The 'readsValue' property references an entity with id "${r.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
308
|
+
All value writting entity types are: ${L(_e,", "," and ")}.
|
|
310
309
|
|
|
311
310
|
This primitive-value entity belongs to a data type entity with id "${l.id}", which itself belongs to a ${p.type} entity with id "${p.id}". ${p.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):o=!0}o&&t.push(new E({id:`last-action--${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`The 'readsValue' property references an entity with id "${r.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
312
|
-
All value writting entity types are: ${L(
|
|
313
|
-
All value writting entity types are: ${L(
|
|
311
|
+
All value writting entity types are: ${L(_e,", "," and ")}.`,issue:null}))}else if(r.type===i.DataType){const s=r.parent;_e.includes(s.type)?t.push(new E({id:`last-action--${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`The 'readsValue' property references an entity with id "${r.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
312
|
+
All value writting entity types are: ${L(_e,", "," and ")}.
|
|
314
313
|
|
|
315
314
|
This data type entity belongs to a ${s.type} entity with id "${s.id}". ${s.type} entities are value writting entities. Is that what you meant to reference?`,issue:null})):t.push(new E({id:`last-action--${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`The 'readsValue' property references an entity with id "${r.id}" that is a primitive value entity. Primitive value entities can't be referenced as value writting entities.
|
|
316
|
-
All value writting entity types are: ${L(
|
|
317
|
-
All value writting entity types are: ${L(
|
|
315
|
+
All value writting entity types are: ${L(_e,", "," and ")}.`,issue:null}))}else _e.includes(r.type)||t.push(new E({id:`last-action--${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`The 'readsValue' property references an entity with id "${r.id}" that isn't a value writting entity.
|
|
316
|
+
All value writting entity types are: ${L(_e,", "," and ")}.`,issue:null}));return t}function Rv(n){return n.functions.length?`All global 'function-declaration' entity ids are:
|
|
318
317
|
- ${n.functions.map(t=>`${t.id} (${P(t,n)})`).join(`
|
|
319
318
|
- `)}.`:"The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities."}function oo(n){return`All reserved action decriptor ids for '${i.GlobalEvent}' entities are:
|
|
320
319
|
- ${n.globalEventActionDescriptors.map(e=>`${e.id} (${P(e,n)})`).join(`
|
|
@@ -344,31 +343,31 @@ All built-in 'action-descriptor' entities that define 'condition' entity, are (I
|
|
|
344
343
|
`;return r?r.type===i.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForCondition}`,code:h.InvalidActionDescriptorForCondition,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):r.type===i.ActionDescriptor?e.conditionDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity but it isn't one of the allowed condition descriptors.${a}`,issue:null})):r.type!==i.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForCondition}`,code:h.InvalidActionDescriptorForCondition,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as conditions instances.${a}`,issue:null})):t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function h3(n,e){const t=[];if(!n)return[];const r=e.getBuiltIn(n),a=`
|
|
345
344
|
All built-in 'action-descriptor' entities that define 'loop' entity, are (IDs):
|
|
346
345
|
- ${e.loopDeclarations.map(s=>`${s.id} (${P(s,e)}).`).join(`
|
|
347
|
-
- `)}`;return r?r.type===i.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForLoop}`,code:h.InvalidActionDescriptorForLoop,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):r.type===i.ActionDescriptor?e.loopDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity but it isn't one of the allowed loop descriptors.${a}`,issue:null})):r.type!==i.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForLoop}`,code:h.InvalidActionDescriptorForLoop,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function vv(n,e,t){var p,y,f,m;if(t.compatible)return"";const r=`entity of type "${n.type}" with id "${n.id}"`,a=`entity with id "${n.id}"`,s=`entity of type "${e.type}" with id "${e.id}"`,o=`entity with id "${e.id}"`,l=Xs(`${r} and ${s} have incompatible data types and cannot be connected as value-reader and value-writter.`);return t.type
|
|
348
|
-
${a} is a list, but ${o} is not. A list can't be connected to a single value.`:t.type
|
|
349
|
-
${a} is not a list, but ${o} is. A single value can't be connected to a list.`:t.type
|
|
350
|
-
${a} is nullable, but ${o} is not. A nullable value can't be connected to a non-nullable value since an empty value might be incorrectly provided.`:t.type
|
|
351
|
-
${a} is not nullable, but ${o} is. A non-nullable value can't be connected to a nullable value since an empty value might be incorrectly provided.`:t.type
|
|
352
|
-
${a} is a template, but ${o} is not. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type
|
|
353
|
-
${a} is not a template, but ${o} is. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type
|
|
354
|
-
Their 'entity' property is of different types. They must be of the same type to be connected. For example, the 'entity' can be a '${i.CustomEntity}' or a '${i.PrimitiveEntity}'.`:t.type
|
|
355
|
-
Both point to custom entities, but they are not compatible to be connected. They must be either the same custom entity, or a custom entity that has equivalent shape, which includes the same properties all with compatible data types with the properties in the counterpart entity.`:t.type
|
|
356
|
-
${a} is of primitive type '${((p=n.getDataType())==null?void 0:p.entity).name}' and ${o} is of primitive type '${((y=e.getDataType())==null?void 0:y.entity).name}'. They must be of the same primitive type to be connected.`:t.type
|
|
357
|
-
Both point to a built-in-base-entity. But${a} is of built-in base type '${((f=n.getDataType())==null?void 0:f.entity).name}' and ${o} is of built-in base type '${((m=e.getDataType())==null?void 0:m.entity).name}'. They must be of the same built-in base type to be connected.`:l}function Ta(n,e){const t=[];if(n.readsValue){const r=e.project.get(O(n.readsValue));if(e.project.getBuiltIn(O(n.readsValue)))t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to a built-in entity with id '${n.readsValue}'. Only user-created entities can be referenced.`,issue:null}));else if(!r)t.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity was not found in the project state.`,issue:null}));else{const s=qn(r);if(s)t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${P(s,e.project)}) higher up in the tree.`,issue:null}));else{const o=
|
|
346
|
+
- `)}`;return r?r.type===i.FunctionDeclaration?t.push(new E({id:`last-action--${h.InvalidActionDescriptorForLoop}`,code:h.InvalidActionDescriptorForLoop,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):r.type===i.ActionDescriptor?e.loopDeclarations.find(o=>o.id===n)||t.push(new E({id:`last-action--${h.InvalidActionDescriptorForOperation}`,code:h.InvalidActionDescriptorForOperation,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity but it isn't one of the allowed loop descriptors.${a}`,issue:null})):r.type!==i.ActionDescriptor&&t.push(new E({id:`last-action--${h.InvalidActionDescriptorForLoop}`,code:h.InvalidActionDescriptorForLoop,severity:T.Error,message:`The entity with id '${n}' is of type '${r.type}' entity. Only 'action-descriptor' entities can be implemented as loops instances.${a}`,issue:null})):t.push(new E({id:`last-action--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity with id '${n}' that isn't yet found in the project.${a}`,issue:null})),t}function vv(n,e,t){var p,y,f,m;if(t.compatible)return"";const r=`entity of type "${n.type}" with id "${n.id}"`,a=`entity with id "${n.id}"`,s=`entity of type "${e.type}" with id "${e.id}"`,o=`entity with id "${e.id}"`,l=Xs(`${r} and ${s} have incompatible data types and cannot be connected as value-reader and value-writter.`);return t.type===$t.AIsListBIsNot?`${l}
|
|
347
|
+
${a} is a list, but ${o} is not. A list can't be connected to a single value.`:t.type===$t.BIsListAIsNot?`${l}
|
|
348
|
+
${a} is not a list, but ${o} is. A single value can't be connected to a list.`:t.type===$t.AIsNullableBIsNot?`${l}
|
|
349
|
+
${a} is nullable, but ${o} is not. A nullable value can't be connected to a non-nullable value since an empty value might be incorrectly provided.`:t.type===$t.BIsNullableAIsNot?`${l}
|
|
350
|
+
${a} is not nullable, but ${o} is. A non-nullable value can't be connected to a nullable value since an empty value might be incorrectly provided.`:t.type===$t.AIsTemplateBIsNot?`${l}
|
|
351
|
+
${a} is a template, but ${o} is not. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type===$t.BIsTemplateAIsNot?`${l}
|
|
352
|
+
${a} is not a template, but ${o} is. A data type that provides an entity as a "template" means that the value should be used as the type definition, or prototype of the entity, not as a specific instance of the entity.`:t.type===$t.TypeEntityMismatch?`${l}
|
|
353
|
+
Their 'entity' property is of different types. They must be of the same type to be connected. For example, the 'entity' can be a '${i.CustomEntity}' or a '${i.PrimitiveEntity}'.`:t.type===$t.IncompatibleCustomEntities?`${l}
|
|
354
|
+
Both point to custom entities, but they are not compatible to be connected. They must be either the same custom entity, or a custom entity that has equivalent shape, which includes the same properties all with compatible data types with the properties in the counterpart entity.`:t.type===$t.IncompatiblePrimitiveEntities?`${l}
|
|
355
|
+
${a} is of primitive type '${((p=n.getDataType())==null?void 0:p.entity).name}' and ${o} is of primitive type '${((y=e.getDataType())==null?void 0:y.entity).name}'. They must be of the same primitive type to be connected.`:t.type===$t.IncompatibleBuiltInBaseEntities?`${l}
|
|
356
|
+
Both point to a built-in-base-entity. But${a} is of built-in base type '${((f=n.getDataType())==null?void 0:f.entity).name}' and ${o} is of built-in base type '${((m=e.getDataType())==null?void 0:m.entity).name}'. They must be of the same built-in base type to be connected.`:l}function Ta(n,e){const t=[];if(n.readsValue){const r=e.project.get(O(n.readsValue));if(e.project.getBuiltIn(O(n.readsValue)))t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to a built-in entity with id '${n.readsValue}'. Only user-created entities can be referenced.`,issue:null}));else if(!r)t.push(new E({id:`${e.id}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity was not found in the project state.`,issue:null}));else{const s=qn(r);if(s)t.push(new E({id:`${e.id}--${h.InvalidBuiltInEntityReference}`,code:h.InvalidBuiltInEntityReference,severity:T.Error,message:`The entity of type '${e.type}' with id '${e.id}' cannot update 'readsValue' to entity with id '${n.readsValue}' because the entity belongs to a built-in '${s.type}' entity with id '${s.id}' (${P(s,e.project)}) higher up in the tree.`,issue:null}));else{const o=Dd({...e.toGenerationTarget(),...n},r);t.push(...o);const l=Jt(e.getDataType(),r.getDataType());l.compatible||t.push(new E({id:`${e.id}--${I.ReaderWriterIncompatibleDataType}`,code:I.ReaderWriterIncompatibleDataType,severity:T.Error,message:vv(e,r,l),issue:null}))}}}return{errors:t,modifiedData:n}}function bn(n){const e=[];if(n.parent===n.project)n.calledBy.length||e.push(new ir({id:`${n.id}--${B.DisconnectedCallableEntity}`,code:B.DisconnectedCallableEntity,severity:T.Warning,message:`This '${n.type}' entity "${P(n,n.project)}" with id "${n.id}" is globally declared and isn't called by any other entity.
|
|
358
357
|
Globally declared callable entities will not be part of any logic execution when the project is published.
|
|
359
358
|
To useful to the project when it is published, entities need to be called by a chain of logic that traces itself back to an entry point. Entry points can be either '${i.GlobalEvent}' or '${i.FunctionDeclaration}'.
|
|
360
359
|
The only use for declaring global callable entities is for a 'variable-declaration' entity to be available globally in the project's scope, since its instances can be used inside lower scopes.
|
|
361
360
|
Or for a logic that the user is going to manually test themselves by clicking on the user-interface.`,issue:null,entity:n}));else{const t=ga(n);if(!t.reachable){let r=`This '${n.type}' entity "${P(n,n.project)}" with id "${n.id}" is not reachable from the project's closest entry point '${t.entryPoint.type}' "${P(t.entryPoint,n.project)}".`;r+=`
|
|
362
361
|
This is because there are termination statements in the call chain before reaching this '${n.type}'.
|
|
363
362
|
If a caller entity calls a termination statement, it will always prevent all other calls from executing.`;let a=`
|
|
364
|
-
This '${n.type}' is blocked `;t.blocks.forEach((s,o)=>{const l=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${P(l,n.project)}" with id "${l.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new ir({id:`${n.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Warning,message:`${r}${a}`,issue:null,entity:n}))}}return ee(n.errors,e)}function
|
|
363
|
+
This '${n.type}' is blocked `;t.blocks.forEach((s,o)=>{const l=s.blockedByCaller,p=s.blockedByCalling;o===0?a+="by ":o===t.blocks.length-1&&(a+="and by "),a+=`its ancestor "${P(l,n.project)}" with id "${l.id}" that calls a '${p.type}' entity with id "${p.id}"`,o<t.blocks.length-1?a+=", ":a+="."}),e.push(new ir({id:`${n.id}--${I.UnreachableEntity}`,code:I.UnreachableEntity,severity:T.Warning,message:`${r}${a}`,issue:null,entity:n}))}}return ee(n.errors,e)}function Pd(n){const e=[];if(!n.internalCalls.length)return e;if(n.readsValue){const t=q({id:`${n.id}--${B.VariableReadsValueAndInternalCall}`,message:`Variable "${P(n,n.project)}" with id "${n.id}" reads a value. A variable with internal calls can't read a value.`,issue:null,severity:T.Error,code:B.VariableReadsValueAndInternalCall,entity:n});e.push(t.error)}if(n.writesValues.length){const t=q({id:`${n.id}--${B.VariableWritesValuesAndInternalCall}`,message:`Variable "${P(n,n.project)}" with id "${n.id}" writes values. A variable with internal calls can't write a value.`,issue:null,severity:T.Error,code:B.VariableWritesValuesAndInternalCall,entity:n});e.push(t.error)}if(n.getUsedInputs().length){const t=q({id:`${n.id}--${B.VariableHasInputsAndInternalCall}`,message:`Variable "${P(n,n.project)}" with id "${n.id}" has inputs. A variable with internal calls can't have inputs.`,issue:null,severity:T.Error,code:B.VariableHasInputsAndInternalCall,entity:n});e.push(t.error)}if(n.getUsedOutputs().length){const t=q({id:`${n.id}--${B.VariableHasOutputsAndInternalCall}`,message:`Variable "${P(n,n.project)}" with id "${n.id}" has outputs. A variable with internal calls can't have outputs.`,issue:null,severity:T.Error,code:B.VariableHasOutputsAndInternalCall,entity:n});e.push(t.error)}if(n.calledBy.length){const t=q({id:`${n.id}--${B.VariableIsCalledAndHasInternalCall}`,message:`Variable "${P(n,n.project)}" with id "${n.id}" is called by other entities. A variable with internal calls can't be called by other entities.`,issue:null,severity:T.Error,code:B.VariableIsCalledAndHasInternalCall,entity:n});e.push(t.error)}if([...n.successCalls,...n.errorCalls].length){const t=q({id:`${n.id}--${B.VariableCallsOthersAndHasInternalCall}`,message:`Variable "${P(n,n.project)}" with id "${n.id}" calls other entities. A variable with internal calls can't call other entities.`,issue:null,severity:T.Error,code:B.VariableCallsOthersAndHasInternalCall,entity:n});e.push(t.error)}return e}function f3(n){var o;const e=gU(),t=n.toJSON();e.safeParse(t).success,n.inputs.forEach(l=>l.validate()),n.outputs.forEach(l=>l.validate()),(o=n.error)==null||o.validate();const s=[...bn(n)];return ee(n.errors,s)}const ve=class ve{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"x");c(this,"y");c(this,"type",i.FunctionCall);c(this,"successCalls",[]);c(this,"errorCalls",[]);c(this,"process",null);c(this,"declaration");c(this,"inputs",[]);c(this,"outputs",[]);c(this,"calledBySuccess",[]);c(this,"calledByError",[]);c(this,"calledByEntry",[]);c(this,"error",null);c(this,"parent");c(this,"errors",[]);c(this,"project");c(this,"initialized",!1);this.initialData=e,this.project=t,this.id=e.id,this.version=e.version,this.x=e.x,this.y=e.y}static fromGenerationTarget(e,t){let r=t;if(e.parent){const m=O(e.parent);r=t.get(m)}const a=O(e.declaration),s=t.get(a),o=e.calledByEntry.map(m=>{const b=O(m);return t.get(b)}),l=e.calledBySuccess.map(m=>{const b=O(m);return t.get(b)}),p=e.calledByError.map(m=>{const b=O(m);return t.get(b)}),y={id:e.id,version:1,type:i.FunctionCall,declaration:s.toReference(),calledByEntry:o,calledBySuccess:l,calledByError:p,errorCalls:[],successCalls:[],inputs:[],outputs:[],process:null,error:null,x:0,y:0,parent:r},f=R(y,t);return f.setParent(r),f.initChildren(),f}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=Ue(r,{parent:{list:!1,types:[...lt,i.Project],optional:!0}},t);r=s.modifiedData,a.push(...s.errors,...Oe(r));const o=O(r.declaration);if(o){const l=bv(o,t);a.push(...l)}else{const l=t.functions.length?`
|
|
365
364
|
All global 'function-declaration' entity ids are:
|
|
366
365
|
- ${t.functions.map(p=>`${p.id} (${P(p,t)})`).join(`
|
|
367
366
|
- `)}.`:`
|
|
368
367
|
The project currently has no global 'function-declaration' entities that can be called as 'function-call' entities.`;a.push(new E({id:`${r.id}--${h.InvalidReference}`,code:h.InvalidReference,severity:T.Error,message:`Entity of type "${i.FunctionCall}" with id "${r.id}", has an invalid reference at the 'declaration' property. The 'declaration' property must be a valid reference to an 'function-declaration' entity.
|
|
369
368
|
References can either be an ID string or an object with exacly four properties: 'id', 'entityId', 'entityType', 'type'.${l}`,issue:null}))}return{errors:a,modifiedData:r}}validateGeneratedUpdate(e){const t=[];return e.parent&&t.push(new E({id:`${this.id}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.Error,message:`Entity of type '${this.type}' with id '${this.id}' cannot have the 'parent' property updated. The 'parent' on a callable entity, is its scope. It scope is auto-calculated implicitly by the its caller.
|
|
370
369
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
371
|
-
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 t;const e=[this];return this.parent===this.project&&this.project.addFunctionCall(this),(t=this.process)==null||t.writesValues.forEach(r=>{r.setValueWriter(this.process),e.push(r)}),this.successCalls.forEach(r=>{r.addSuccessCaller(this),e.push(r)}),this.errorCalls.forEach(r=>{r.addErrorCaller(this),e.push(r)}),this.calledBySuccess.forEach(r=>{r.addSuccessCall(this),e.push(r)}),this.calledByError.forEach(r=>{r.addErrorCall(this),e.push(r)}),this.calledByEntry.forEach(r=>{r.addCall(this),e.push(r)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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===i.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=O(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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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 r=Bd(this).filter(s=>!this.outputs.find(o=>o.declaration.id===s.id));r.sort((s,o)=>s.index-o.index);const a=r.map((s,o)=>{const l=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:M.UUID.uuid(),type:i.OutputMap,version:1,declaration:s,index:l,parent:this,writesValues:[]},y=R(p,this.project);return y.setParent(this),y.initChildren(),y});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 r=[],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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:v(r),removed:v(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.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(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.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(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=f3(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 ve(this.toJSON(),this.project)}};c(ve,"MUTABLE_BASE_PROPERTIES",[]),c(ve,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(ve,"BASE_PROPERTIES",[...ve.MUTABLE_BASE_PROPERTIES,...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"MUTABLE_META_PROPERTIES",["x","y"]),c(ve,"INMUTABLE_META_PROPERTIES",[...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"META_PROPERTIES",[...ve.MUTABLE_META_PROPERTIES,...ve.INMUTABLE_META_PROPERTIES]),c(ve,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(ve,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(ve,"UPSTREAM_PROPERTIES",[...ve.MUTABLE_UPSTREAM_PROPERTIES,...ve.INMUTABLE_UPSTREAM_PROPERTIES]),c(ve,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(ve,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ve,"DOWNSTREAM_PROPERTIES",[...ve.MUTABLE_DOWNSTREAM_PROPERTIES,...ve.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ve,"PROPERTIES",[...ve.META_PROPERTIES,...ve.UPSTREAM_PROPERTIES,...ve.DOWNSTREAM_PROPERTIES]);let Sr=ve;function Iv(n){var e,t,r;switch(n.id){case J["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=n.project.entities.filter(f=>!!f.implements.find(m=>m.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(f=>!!f.properties.find(m=>{var b;return m.implements&&m.implements.id===J["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(g=>g.implements&&g.implements.id===J["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 g=(t=m==null?void 0:m.dataType)==null?void 0:t.id.split("-id")[0],A=R({id:g+"-default-value-id",version:1,type:i.PrimitiveValue,name:D.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:m==null?void 0:m.dataType.toReference()},n.project);return A.setParent(m==null?void 0:m.dataType),A.initChildren(),A.addSelfToProject(),{newEntities:[A]}}return{newEntities:[]}}const o=n.project.get(J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),l=uo(o,"Main database");if(l.errors.length>0)return{newEntities:[]};const p=l.implemented.properties.find(f=>f.implements&&f.implements.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),y=(r=p==null?void 0:p.dataType)==null?void 0:r.defaultValue;if(y)y.value=!0;else if(p!=null&&p.dataType){const f=p==null?void 0:p.dataType.id.split("-id")[0],m=R({id:f+"-default-value-id",version:1,type:i.PrimitiveValue,name:D.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:[l.implemented]}}}return{newEntities:[]}}function Pv(n){return n.implements.filter(t=>t.type===i.BuiltInBaseEntity).map(t=>{var r;switch(t.id){case J["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=n.project.entities.filter(p=>p.implements.find(y=>y.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(y=>{var f;return y.implements&&y.implements.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((f=y.getDefaultValue())==null?void 0:f.value)===!0}));if(!s)return{newEntities:[]};const o=n.properties.find(p=>p.implements&&p.implements.id===J["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database),l=(r=o==null?void 0:o.dataType)==null?void 0:r.defaultValue;if(o&&(o!=null&&o.dataType)&&!l){const p=o==null?void 0:o.dataType.id.split("-id")[0],y=R({id:p+"-default-value-id",version:1,type:i.PrimitiveValue,name:D.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},n.project);return y.setParent(o==null?void 0:o.dataType),y.initChildren(),y.addSelfToProject(),{newEntities:[y]}}return{newEntities:[]}}}}),{newEntities:[]}}function uo(n,e,t){const r=t||Ze(e,i.CustomEntity,n.project),a=r.split("-id"),s=a[a.length-1||0]||r,o={id:r,version:1,name:e,type:i.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[n],x:0,y:0,parent:n.project},l=to(o,n.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=Iv(n),y=R(o,n.project);y.setParent(n.project),y.initChildren();const f=n.properties.map(g=>{const A=s+"-"+Ze(P(g,n.project),i.Property,n.project),C=g.clone(y,A);return C.abstract=!1,C.implements=g,C.setParent(y),y.addProperty(C),C}),m=n.abstractMethods.map(g=>{const A=s+Ze(g.name,i.FunctionDeclaration,n.project),C=g.implementAsFunctionDeclaration(A),$={id:A+"-parent-ref-id",type:i.GenericReference,entityId:r,entityType:i.CustomEntity},Xe={...C,implements:g,parent:$},$e=R(Xe,n.project);return y.addMethod($e),$e.setParent(y),$e.initChildren(),$e.implements=g,$e});o.properties=f,o.methods=m;const b=Pv(y);return{implemented:y,errors:[],entitiesChanges:{new:[y,...p.newEntities,...b.newEntities],updated:[y],deleted:[]}}}function po(n,e){const t=Or(n);if(t.length===0)return{list:[],last:null};let r=null;return{list:t.flatMap(s=>{if(s===e)return r=s,[s];const o=po(s,e);return o.last&&(r=o.last),[s,...o.list]}),last:r}}function Dv(n,e,t=new Set){const r=jn(n),a=jn(e),s=r.filter(p=>!a.includes(p)),o=r.filter(p=>a.includes(p)),l=s.reduce((p,y)=>t.has(y.id)?p:(t.add(y.id),v([...p,...Dv(y,e,t)])),[]);return v([...o,...l])}function Ea(n,e){const t=po(n,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function m3(n,e){return!!po(n,e).last}function T3(n){if(we.includes(n.type))return n;if([...gn,i.VariableDeclaration].includes(n.type)){const e=n.parent;return we.includes(e.type)?e:null}return null}function Ad(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===i.Project)return null}else return null;const r=e.parent;if(r){if(r===n)return n;if(r.type===i.Project)return null}else return null;return Ad(t,r)}function He(n){if(vo.includes(n.type)){if(n.type===i.FunctionDeclaration){const e=n.parent;if(e.type===i.CustomEntity)return e}return n}else{const e=n.parent;return e?He(e):null}}function E3(n){return n.type===i.VariableDeclaration?[n]:Ne.includes(n.type)?[...n.inputs,...n.outputs||[]]:n.type===i.ReturnStatement?n.outputs:wr.includes(n.type)||n.type===i.FunctionDeclaration?n.inputs:[]}function R3(n){const e=jn(n),t=[],r=[];Ud.includes(n.type)&&t.push(...Sd(n));const a=e.filter(s=>{const o=t.includes(s);return o?!1:gn.includes(s.type)&&!o?(r.push(s),!1):!0});return t.sort((s,o)=>Ea(o,s)?-1:0),r.sort((s,o)=>Ea(o,s)?-1:0),[...t,...r,...a]}function Av(n){return[...n].sort((e,t)=>Ea(t,e)?-1:0)}function b3(n){const e=Av(n),t=[];return e.forEach(r=>{const a=t[t.length-1];if(a){const s=a[a.length-1];Ea(r,s)?t.push([r]):a.push(r)}else t.push([r])}),t}function Tt(n){const e=n.map(t=>He(t));return v(e)}function Sd(n){return Ne.includes(n.type)?[...Tt(n.successCalls),...Tt(n.errorCalls)]:we.includes(n.type)?Tt(n.calls):[]}function g3(n,e){return Sd(n).includes(e)}function Od(n){return n.writesValues||[]}function v3(n,e){return Od(n).includes(e)}function Sv(n){var e;return Fe.includes((e=n==null?void 0:n.readsValue)==null?void 0:e.type)?n.readsValue:null}function I3(n){return n.writesValues}function Ov(n=[]){return n.map(Sv).filter(e=>!!e)}function yo(n=[]){return n.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function Cv(n=[]){return n.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function Bv(n){return Fe.includes(n.type)?n:null}function wv(n){return n.writesValues.map(Bv).filter(e=>!!e)}function _v(n=[]){return n.reduce((e,t)=>t.type===i.OutputMap?[...e,...wv(t)]:e,[])}function De(n){return Ne.includes(n.type)?[...nn(Tt(n.successCalls)),...nn(Tt(n.errorCalls))]:we.includes(n.type)?nn(Tt(n.calls)):[]}function P3(n){return Ne.includes(n.type)?[...nn(Tt(n.successCalls)),...nn(Tt(n.errorCalls))]:we.includes(n.type)?nn(Tt(n.calls)):[]}function Mv(n,e=new Set){return n.writesValues.filter(r=>Fe.includes(r.type)&&!e.has(r.id)).reduce((r,a)=>e.has(a.id)?r:[...r,...K(a,e)],[])}function Nv(n,e=new Set){var r;return(((r=n.readsValue)==null?void 0:r.writesValues)||[]).filter(a=>Fe.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...K(s,e)],[])}function K(n,e=new Set){if(e.has(n.id))return[];if(n.type===i.ReturnStatement)return Cv(n.outputs).reduce((r,a)=>[...r,...K(a,e)],[]);if(n.type===i.FunctionCall||n.type===i.Operation||n.type===i.Condition)return[...De(n).reduce((s,o)=>{const l=He(o);return[...s,...K(l||o,e)]},[]),...Ov(n.inputs),..._v(n.outputs)].reduce((s,o)=>[...s,...K(o,e)],[]);if(wr.includes(n.type)){const t=yo(n.inputs),a=De(n).reduce((s,o)=>{const l=He(o);return[...s,...K(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...K(o,e)],[])}if(n.type===i.FunctionDeclaration){const t=[...yo(n.inputs)],a=De(n).reduce((s,o)=>{const l=He(o);return[...s,...K(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...K(o)],[])}if(Fe.includes(n.type)){e.add(n.id);const r=De(n).reduce((a,s)=>{const o=He(s);return[...a,...K(o||s,e)]},[]);return[n,...r,...Nv(n,e),...Mv(n,e)]}return[]}function At(n,e=new Set){return e.has(n.id)?[]:(e.add(n.id),[...jn(n).reduce((a,s)=>[...a,s,...At(s,e)],[])])}function nn(n){return n.reduce((e,t)=>t.type===i.ReturnStatement||t.type===i.ContinueStatement||t.type===i.BreakStatement?[...e,t]:[...e,t,...De(t)],[])}function Vv(n){const e=n.entities||[],t=[...e,...n.functions||[],...n.events||[],...n.projects||[]],r=e.reduce((p,y)=>[...p,...y.properties],[]),a=e.reduce((p,y)=>[...p,...y.methods],[]),s=a.reduce((p,y)=>[...p,...yo(y.inputs),...nn(Tt(y.calls)),...y.returnStatements],[]),o=n.functions.reduce((p,y)=>[...p,...nn(Tt(y.calls)),...y.returnStatements],[]),l=n.events.reduce((p,y)=>[...p,...nn(Tt(y.calls)),...y.returnStatements],[]);return[...t,...r,...a,...s,...o,...l]}function $v(n,e){return e.filter(r=>{if(!r)return!1;switch(r.type){case i.FunctionCall:return r.inputs.find(a=>a.id===n.id)!==void 0||r.outputs.find(a=>a.id===n.id)!==void 0;case i.Condition:return r.successCalls.find(a=>a.id===n.id)!==void 0||r.errorCalls.find(a=>a.id===n.id)!==void 0||r.inputs.find(a=>a.id===n.id)!==void 0;case i.Operation:return r.outputs.find(a=>a.id===n.id)!==void 0;case i.VariableDeclaration:return Ne.includes(n.type)?Lv(n).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===r.id})!==void 0:!1;case i.CustomEntity:return r.properties.find(a=>a.id===n.id)!==void 0||r.methods.find(a=>a.id===n.id)!==void 0;case i.FunctionDeclaration:return r.inputs.find(a=>a.id===n.id)!==void 0||(r.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===n.id)!==void 0;default:return!1}})}function D3(n){const e=Vv(n.project);return $v(n,e)}function Or(n){const e=[];if(gn.includes(n.type)){n.calledBy.forEach(a=>{const s=He(a);s&&e.push(s)});const r=[...n.inputs||[],...n.outputs||[]].map(a=>wd(a)).filter(a=>a!==null);e.push(...v(r))}if(Fe.includes(n.type)){const t=wd(n);t&&e.push(t)}return v(e)}function Cd(n){return n.type===i.FunctionCall||n.type===i.InternalCall?n.declaration.inputs:[i.Operation,i.Condition,i.Loop].includes(n.type)?n.declaration.fixedArguments:n.type===i.FunctionDeclaration||wr.includes(n.type)?n.inputs:n.type===i.Search?n.inputsDeclarations:[]}function A3(n,e){return e.type===i.Condition?e.inputs.find(t=>t.declaration.id===n.id):e.type===i.FunctionCall||e.type===i.Operation?e.inputs.find(t=>t.declaration.id===n.id):null}function Lv(n){return Ne.includes(n.type)?n.inputs:[]}function Bd(n){var e;return n.type===i.FunctionCall?((e=n.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[i.Operation,i.Condition,i.Loop].includes(n.type)?n.declaration.fixedReturns:n.type===i.Search?n.outputsDeclarations:_e.includes(n.type)?n.outputs:[]}function S3(n,e){return e.type===i.Condition?null:e.type===i.FunctionCall||e.type===i.Operation?e.outputs.find(t=>t.declaration.id===n.id):null}function O3(n){return n.type===i.Condition?[]:Ne.includes(n.type)?n.outputs:[]}function wd(n){const e=n.readsValue;return e?He(e):null}function Gv(n){const e=n.internalCalls||[];return v(Tt(v(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function hi(n){const e=Od(n),t=[];return e.forEach(r=>{if(Fe.includes(r.type))t.push(r);else if(r.type===i.InputMap){const a=r.parent;if(a.type===i.InputMap){const s=a.parent;t.push(s)}else t.push(a)}else[i.ActionDescriptor].includes(r.parent.type)||t.push(r.parent)}),t}function v(n){const e=new Set;return n.filter(t=>!t||e.has(t.id)?!1:(e.add(t.id),!0))}function jn(n,e=!1){const t=[];if(n.type===i.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)||[]),lt.includes(n.type)&&t.push(...(n==null?void 0:n.detachedChildren)||[]),n.type===i.CustomEntity){const r=[...n.suggestedMethods,...n.methods].flatMap(a=>a.collapsed&&e?[]:jn(a));t.push(...r)}if(n.type===i.Condition){const r=n.successCalls.map(s=>He(s)),a=n.errorCalls.map(s=>He(s));t.push(...r,...a)}if(wr.includes(n.type)){if(n.collapsed&&e)return[];const r=n.inputs.map(s=>hi(s)).flat(),a=n.calls.map(s=>He(s));t.push(...v(r),...a)}if(Ne.includes(n.type)&&n.type!==i.Condition){const r=n==null?void 0:n.outputs.map(o=>hi(o)).flat(),a=n.successCalls.map(o=>He(o)),s=n.errorCalls.map(o=>He(o));t.push(...v(r),...a,...s)}if(Fe.includes(n.type)){const r=hi(n),a=Gv(n);t.push(...r,...a)}if(n.type===i.Loop){const r=n.outputs.map(o=>hi(o)).flat();if(n.body){const o=jn(n.body,e);t.push(...o)}const a=n.errorCalls.map(o=>He(o)),s=n.successCalls.map(o=>He(o));t.push(...v(r),...s,...a)}if(n.type===i.FunctionDeclaration){if(n.collapsed&&e)return[];const r=n.inputs.map(s=>hi(s)).flat(),a=n.calls.map(s=>He(s));t.push(...v(r),...a)}return v(t)}function Fv(n,e=!1){const t=jn(n,e),r=[...t,...t.reduce((a,s)=>[...a,...Fv(s,e)],[])];return v(r)}function Uv(n){const e=Or(n),t=[...e,...e.reduce((r,a)=>[...r,...Uv(a)],[])];return v(t)}function ho(n){return n.implements.reduce((e,t)=>t.type===i.CustomEntity?[...e,i.CustomEntity,...ho(t),...fo(t)]:[...e,t.name],[])}function fo(n){return n.extends.reduce((e,t)=>t.type===i.CustomEntity?[...e,i.CustomEntity,...fo(t),...ho(t)]:[...e,t.name],[])}function _d(n){return n.extends.reduce((e,t)=>t.type===i.CustomEntity?[...e,t,..._d(t),...Md(t)]:[...e,t],[])}function Md(n){return n.implements.reduce((e,t)=>t.type===i.CustomEntity?[...e,t,...Md(t),..._d(t)]:[...e,t],[])}function xv(n){return[...fo(n),...ho(n)].filter((t,r,a)=>a.indexOf(t)===r)}function jv(n){return n.implements.length===0&&n.extends.length===0?null:n.implements.find(r=>r.type===i.BuiltInBaseEntity&&r.name===N.PERSISTED_ENTITY)?n:[...n.implements,...n.extends].reduce((r,a)=>{if(a.type===i.CustomEntity){const s=jv(a);if(s)return s}return r},null)}function C3(n){const e=n.extends.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function B3(n){const e=n.implements.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function kv(n){const e=n.extends.find(t=>t.type===i.CustomEntity);return e&&e.type===i.CustomEntity?e:null}function kn(n){const e=[...n.implements,...n.extends].reduce((t,r)=>r.type===i.BuiltInBaseEntity?[...t,r]:r.type===i.CustomEntity?[...t,...kn(r)]:t,[]);return v(e)}function Nd(n){return n.type===i.PrimitiveEntity?!0:n.type===i.BuiltInBaseEntity?n.interactive:!kn(n).find(r=>!r.interactive)}function w3(n){return n.parent===n.project&&n.project.variableDeclarations.includes(n)}function Vd(n){return n.parent!==n.project?!1:i.VariableDeclaration===n.type?n.project.variableDeclarations.includes(n):i.VariableInstance===n.type?n.project.variableInstances.includes(n):i.FunctionCall===n.type?n.project.functionCalls.includes(n):i.Condition===n.type?n.project.conditions.includes(n):i.Operation===n.type?n.project.operations.includes(n):i.Loop===n.type?n.project.loops.includes(n):i.Search===n.type?n.project.searches.includes(n):!1}function qv(n){if([...we,i.CustomEntity,i.InstalledProject,i.Project].includes(n.type)||Vd(n))return!1;const e=Or(n);return e.length===0?!0:e.some(t=>qv(t))}function $d(n){return[...we,i.CustomEntity,i.InstalledProject,i.Project].includes(n.type)||Vd(n)?!1:Or(n).length===0}function Jv(n,e=0){if($d(n)){const t=Or(n);return t.length===0?n:t.map(a=>Jv(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function Wv(n){const e=[];if($d(n))e.push(n);else return[];return Or(n).forEach(r=>{e.push(...Wv(r))}),e}function Hv(n){return n.type===i.FunctionDeclaration&&n.parent!==n.project&&!![i.CustomEntity,i.Loop,i.InstalledProject].includes(n.parent.type)}function _3(n,e){const t=new Map;return n.forEach(r=>{t.set(r.id,r)}),e.forEach(r=>{t.set(r.id,r)}),Array.from(t.values())}function mo(n){switch(n){case i.CustomEntity:return Cr;case i.FunctionDeclaration:return mr;case i.VariableDeclaration:return br;case i.VariableInstance:return gr;case i.FunctionCall:return Sr;case i.Operation:return Tr;case i.Condition:return Rr;case i.ReturnStatement:return Dr;case i.Loop:return Er;case i.Search:return vr;case i.InputMap:return En;case i.OutputMap:return Rn;case i.ArgumentDeclaration:return Pr;case i.ReturnDeclaration:return _t;case i.Property:return fr;case i.InstalledProject:return Ir;case i.Project:return M;case i.BuiltInBaseEntity:return Gt;default:return null}}function Et(n,e){if(lt.includes(n.type))return n;if(_r.includes(n.type))return null;const t=n.parent;if(!t)return null;if(t.type===i.GenericReference){const r=O(t);if(!r)return null;const a=e.get(r);return a?Et(a,e):null}else return t===e?e:Et(t,e)}function Ld(n,e){if(_r.includes(n.type)||e.getAllBuiltInIds().includes(n.id))return null;const r=Mt(n.parent,e);return r?r===e?lt.includes(n.type)?n:null:r.type===i.CustomEntity?n:Ld(r,e):null}function To(n,e,t){if(n===e||e===t||n===t)return!1;const r=Et(e.parent,t);return r===n?!0:To(r,e,t)}var Eo=(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))(Eo||{});function Ra(n,e,t){const r=Et(n,t),a=Et(e,t);if(!r)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(r===a&&r.type!==i.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:r};if(r===a&&r.type===i.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:r};if(r.type===i.Project&&a.type!==i.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:r};if(r.type!==i.Project&&a.type===i.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(To(r,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:r};if(To(a,r,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=Ad(r,a);return l===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:l}:l?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:Et(l,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function Yv(n,e,t){const r=Ra(n,e,t);if(!r.compatible||r.type!=="same-both-local")return null;if(n===e)return n;let a=Et(n.parent,t);if(a){if(a===e)return e;if(a.type===i.Project)return n}else return n;for(;a;){if(a){if(a===e)return e;if(a.type===i.Project)return n}else return n;a=Et(a.parent,t)}let s=Et(e.parent,t);if(s){if(s===n)return n;if(s.type===i.Project)return e}else return e;for(;s;){if(s){if(s===n)return n;if(s.type===i.Project)return e}else return e;s=Et(s.parent,t)}return null}function zv(n){return n.length===0?null:n.length===1?n[0]:n.reduce((t,r)=>{const a=Yv(t,r,r.project);return!a||a===r?t:r},n[0])}function Mt(n,e){let t;return typeof n=="string"?t=n:n.type===i.GenericReference?t=O(n):t=n.id,t===e.id?e:e.get(t)}function qn(n){if(_r.includes(n.type))return n;if(n.type===i.Project)return null;if(n.project.getAllBuiltInIds().includes(n.id))return n;const t=n.parent;return!t||t.type===i.Project?null:qn(t)}function ba(n,e){var t;if(n.readsValue){const r=Mt(n.readsValue,e.project);e.setValueWriter(r),r.addValueReader(e)}else n.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function ga(n){const e=[];function t(s,o){return e.some(l=>l.blockedByCaller===s&&l.blockedByCalling===o)}function r(s,o){t(s,o)||e.push({blockedByCaller:s,blockedByCalling:o})}const a=Ld(n,n.project);return n.calledBySuccess.forEach(s=>{[...s.successCalls||[]].forEach(p=>{_e.includes(p.type)&&p!==n&&(De(n).find(m=>m===p)||r(s,p))});let l;if(Ne.includes(s.type)&&(l=s),l){const p=ga(l);p.reachable||De(n).find(m=>m===s)||p.blocks.forEach(m=>{r(s,m.blockedByCalling)})}}),n.calledByError.forEach(s=>{[...s.errorCalls||[]].forEach(p=>{_e.includes(p.type)&&p!==n&&(De(n).find(m=>m===p)||r(s,p))});let l;if(Ne.includes(s.type)&&(l=s),l){const p=ga(l);p.reachable||De(n).find(m=>m===s)||p.blocks.forEach(m=>{r(s,m.blockedByCalling)})}}),n.calledByEntry.forEach(s=>{if([...s.calls||[]].forEach(p=>{_e.includes(p.type)&&p!==n&&(De(n).find(m=>m===p)||r(s,p))}),s===a)return;let l;if(s.type===i.FunctionDeclaration){const p=He(s);if(p.type===i.CustomEntity)return;p.type===i.Loop&&(l=p)}if(l){const p=ga(l);p.reachable||p.blocks.forEach(y=>{r(s,y.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function M3(n){return vo.includes(n.type)?n.type===i.FunctionDeclaration?!Hv(n):!0:!1}function N3(n){if(i.ActionDescriptor===n.type){if(n.project.operationDeclarations.find(s=>s.id===n.id))return i.Operation;if(n.project.globalEventActionDescriptors.find(s=>s.id===n.id))return i.GlobalEvent;if(n.project.loopDeclarations.find(s=>s.id===n.id))return i.Loop;if(n.project.conditionDeclarations.find(s=>s.id===n.id))return i.Condition}return n.type}function V3(n,e){const t=[];if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.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 r=e.get(n.parent);r?[i.Project,i.DataType].includes(r.type)||t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.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}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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(r=>{if(n.id===r){t.push(new E({id:`${n.id}--${r}--${h.SelfReference}`,code:h.SelfReference,severity:T.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(r);a?[i.CustomEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${n.id}--${r}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${r}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${r}" 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}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.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(r=>{const a=e.get(r);a?[i.CustomEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${n.id}--${r}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.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}--${r}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.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}--${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${r}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}const Ie=class Ie{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"static");c(this,"abstract");c(this,"type",i.CustomEntity);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"implements",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestedProperties",[]);c(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 r=t;if(e.parent){const p=O(e.parent);r=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:i.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:r},l=R(o,t);return l.setParent(r),l.initChildren(),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=V3(r,t),o=to(r,t);a.push(...s,...o,...Oe(r));const l=r.parent?t.get(r.parent):null;if(l&&l.type===i.DataType){const p=l;p.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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.
|
|
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 t;const e=[this];return this.parent===this.project&&this.project.addFunctionCall(this),(t=this.process)==null||t.writesValues.forEach(r=>{r.setValueWriter(this.process),e.push(r)}),this.successCalls.forEach(r=>{r.addSuccessCaller(this),e.push(r)}),this.errorCalls.forEach(r=>{r.addErrorCaller(this),e.push(r)}),this.calledBySuccess.forEach(r=>{r.addSuccessCall(this),e.push(r)}),this.calledByError.forEach(r=>{r.addErrorCall(this),e.push(r)}),this.calledByEntry.forEach(r=>{r.addCall(this),e.push(r)}),{affected:v(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(e){const t=this.inputs.findIndex(r=>r.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(r=>r.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 r=this.errorCalls.findIndex(a=>a.id===e.id);return r>-1&&this.errorCalls.splice(r,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===i.FunctionDeclaration){const e=R(this.initialData.declaration,this.project);this.declaration=e}else{const e=O(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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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),[i.BreakStatement,i.ContinueStatement].includes(t.type)?(t.setParent(this.parent.parent),t.initChildren()):t.type!==i.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 r=Bd(this).filter(s=>!this.outputs.find(o=>o.declaration.id===s.id));r.sort((s,o)=>s.index-o.index);const a=r.map((s,o)=>{const l=e.includes(s.index)?this.outputs.length-1+o:s.index,p={id:_.UUID.uuid(),type:i.OutputMap,version:1,declaration:s,index:l,parent:this,writesValues:[]},y=R(p,this.project);return y.setParent(this),y.initChildren(),y});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 r=[],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:l}=(s=this.process)==null?void 0:s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}if(this.inputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.outputs.forEach(o=>{const{affected:l,removed:p}=o.remove({ignoreUpstream:!0,seenEntities:t});r.push(...l),a.push(...p)}),this.error){const{affected:o,removed:l}=this.error.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}return this.successCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),this.errorCalls.forEach(o=>{r.push(o),o.removeCaller(this)}),e||this.calledBy.forEach(o=>{r.push(o),o.removeCall(this)}),{affected:v(r),removed:v(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:r}=this.process.restore({seenEntities:e});t.push(...r)}return this.inputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.outputs.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.successCalls.forEach(r=>{t.push(r),r.addSuccessCaller(this)}),this.errorCalls.forEach(r=>{t.push(r),r.addErrorCaller(this)}),this.calledBySuccess.forEach(r=>{t.push(r),r.addSuccessCall(this)}),this.calledByError.forEach(r=>{t.push(r),r.addErrorCall(this)}),this.calledByEntry.forEach(r=>{t.push(r),r.addCall(this)}),{affected:v(t),self:this}}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.successCalls.flatMap(r=>r.toFlat(e)),...this.errorCalls.flatMap(r=>r.toFlat(e)),...this.inputs.flatMap(r=>r.toFlat(e)),...this.outputs.flatMap(r=>r.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(r=>r.toFlatIds(e)),...this.errorCalls.flatMap(r=>r.toFlatIds(e)),...this.inputs.flatMap(r=>r.toFlatIds(e)),...this.outputs.flatMap(r=>r.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(r=>r.toJSON()),errorCalls:this.errorCalls.map(r=>r.toJSON()),calledBySuccess:this.calledBySuccess.map(r=>r.toReference()),calledByError:this.calledByError.map(r=>r.toReference()),calledByEntry:this.calledByEntry.map(r=>r.toReference()),process:(e=this.process)==null?void 0:e.toJSON(),declaration:this.declaration.toJSON(),inputs:this.inputs.map(r=>r.toJSON()),outputs:this.outputs.map(r=>r.toJSON()),parent:this.parent.toReference(),error:(t=this.error)==null?void 0:t.toJSON()}}toReference(){return{id:this.id+"--"+_.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.errorCalls.flatMap(r=>r.toFlatJSON(e)),...this.inputs.flatMap(r=>r.toFlatJSON(e)),...this.outputs.flatMap(r=>r.toFlatJSON(e)),...this.process?this.process.toFlatJSON(e):[],...this.error?this.error.toFlatJSON(e):[]])}toGenerationTarget(){const e=this.parent.type===i.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(r=>r.toFlatGenerationTarget(e)),...this.errorCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.inputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.outputs.flatMap(r=>r.toFlatGenerationTarget(e)),...this.process?this.process.toFlatGenerationTarget(e):[],...this.error?this.error.toFlatGenerationTarget(e):[]])}clearErrors(){var e,t;return this.errors=[],this.inputs.forEach(r=>r.clearErrors()),this.outputs.forEach(r=>r.clearErrors()),this.successCalls.forEach(r=>r.clearErrors()),this.errorCalls.forEach(r=>r.clearErrors()),(e=this.process)==null||e.clearErrors(),(t=this.error)==null||t.clearErrors(),this}validate(){const e=f3(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 ve(this.toJSON(),this.project)}};c(ve,"MUTABLE_BASE_PROPERTIES",[]),c(ve,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(ve,"BASE_PROPERTIES",[...ve.MUTABLE_BASE_PROPERTIES,...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"MUTABLE_META_PROPERTIES",["x","y"]),c(ve,"INMUTABLE_META_PROPERTIES",[...ve.INMUTABLE_BASE_PROPERTIES]),c(ve,"META_PROPERTIES",[...ve.MUTABLE_META_PROPERTIES,...ve.INMUTABLE_META_PROPERTIES]),c(ve,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),c(ve,"INMUTABLE_UPSTREAM_PROPERTIES",["declaration","parent"]),c(ve,"UPSTREAM_PROPERTIES",[...ve.MUTABLE_UPSTREAM_PROPERTIES,...ve.INMUTABLE_UPSTREAM_PROPERTIES]),c(ve,"MUTABLE_DOWNSTREAM_PROPERTIES",["successCalls","errorCalls","writesValues","inputs","outputs","error"]),c(ve,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(ve,"DOWNSTREAM_PROPERTIES",[...ve.MUTABLE_DOWNSTREAM_PROPERTIES,...ve.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(ve,"PROPERTIES",[...ve.META_PROPERTIES,...ve.UPSTREAM_PROPERTIES,...ve.DOWNSTREAM_PROPERTIES]);let Sr=ve;function Iv(n){var e,t,r;switch(n.id){case J["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const a=n.project.entities.filter(f=>!!f.implements.find(m=>m.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));if(a.find(f=>!!f.properties.find(m=>{var b;return m.implements&&m.implements.id===J["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(g=>g.implements&&g.implements.id===J["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 g=(t=m==null?void 0:m.dataType)==null?void 0:t.id.split("-id")[0],A=R({id:g+"-default-value-id",version:1,type:i.PrimitiveValue,name:D.EntityTemplate,autogeneration:null,value:!0,valueAsType:null,parent:m==null?void 0:m.dataType.toReference()},n.project);return A.setParent(m==null?void 0:m.dataType),A.initChildren(),A.addSelfToProject(),{newEntities:[A]}}return{newEntities:[]}}const o=n.project.get(J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),l=uo(o,"Main database");if(l.errors.length>0)return{newEntities:[]};const p=l.implemented.properties.find(f=>f.implements&&f.implements.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default),y=(r=p==null?void 0:p.dataType)==null?void 0:r.defaultValue;if(y)y.value=!0;else if(p!=null&&p.dataType){const f=p==null?void 0:p.dataType.id.split("-id")[0],m=R({id:f+"-default-value-id",version:1,type:i.PrimitiveValue,name:D.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:[l.implemented]}}}return{newEntities:[]}}function Dv(n){return n.implements.filter(t=>t.type===i.BuiltInBaseEntity).map(t=>{var r;switch(t.id){case J["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const s=n.project.entities.filter(p=>p.implements.find(y=>y.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)).find(p=>!!p.properties.find(y=>{var f;return y.implements&&y.implements.id===J["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default&&((f=y.getDefaultValue())==null?void 0:f.value)===!0}));if(!s)return{newEntities:[]};const o=n.properties.find(p=>p.implements&&p.implements.id===J["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database),l=(r=o==null?void 0:o.dataType)==null?void 0:r.defaultValue;if(o&&(o!=null&&o.dataType)&&!l){const p=o==null?void 0:o.dataType.id.split("-id")[0],y=R({id:p+"-default-value-id",version:1,type:i.PrimitiveValue,name:D.EntityTemplate,autogeneration:null,value:null,valueAsType:s,parent:o==null?void 0:o.dataType.toReference()},n.project);return y.setParent(o==null?void 0:o.dataType),y.initChildren(),y.addSelfToProject(),{newEntities:[y]}}return{newEntities:[]}}}}),{newEntities:[]}}function uo(n,e,t){const r=t||Ze(e,i.CustomEntity,n.project),a=r.split("-id"),s=a[a.length-1||0]||r,o={id:r,version:1,name:e,type:i.CustomEntity,description:null,static:!1,abstract:!1,properties:[],methods:[],abstractMethods:[],extends:[],implements:[n],x:0,y:0,parent:n.project},l=to(o,n.project);if(l.length>0)return{errors:l,implemented:null,entitiesChanges:{new:[],updated:[],deleted:[]}};const p=Iv(n),y=R(o,n.project);y.setParent(n.project),y.initChildren();const f=n.properties.map(g=>{const A=s+"-"+Ze(P(g,n.project),i.Property,n.project),C=g.clone(y,A);return C.abstract=!1,C.implements=g,C.setParent(y),y.addProperty(C),C}),m=n.abstractMethods.map(g=>{const A=s+Ze(g.name,i.FunctionDeclaration,n.project),C=g.implementAsFunctionDeclaration(A),$={id:A+"-parent-ref-id",type:i.GenericReference,entityId:r,entityType:i.CustomEntity},Xe={...C,implements:g,parent:$},$e=R(Xe,n.project);return y.addMethod($e),$e.setParent(y),$e.initChildren(),$e.implements=g,$e});o.properties=f,o.methods=m;const b=Dv(y);return{implemented:y,errors:[],entitiesChanges:{new:[y,...p.newEntities,...b.newEntities],updated:[y],deleted:[]}}}function po(n,e){const t=Or(n);if(t.length===0)return{list:[],last:null};let r=null;return{list:t.flatMap(s=>{if(s===e)return r=s,[s];const o=po(s,e);return o.last&&(r=o.last),[s,...o.list]}),last:r}}function Pv(n,e,t=new Set){const r=jn(n),a=jn(e),s=r.filter(p=>!a.includes(p)),o=r.filter(p=>a.includes(p)),l=s.reduce((p,y)=>t.has(y.id)?p:(t.add(y.id),v([...p,...Pv(y,e,t)])),[]);return v([...o,...l])}function Ea(n,e){const t=po(n,e);return t.last===e&&t.list.length>0&&t.list[0]!==e}function m3(n,e){return!!po(n,e).last}function T3(n){if(we.includes(n.type))return n;if([...gn,i.VariableDeclaration].includes(n.type)){const e=n.parent;return we.includes(e.type)?e:null}return null}function Ad(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===i.Project)return null}else return null;const r=e.parent;if(r){if(r===n)return n;if(r.type===i.Project)return null}else return null;return Ad(t,r)}function He(n){if(vo.includes(n.type)){if(n.type===i.FunctionDeclaration){const e=n.parent;if(e.type===i.CustomEntity)return e}return n}else{const e=n.parent;return e?He(e):null}}function E3(n){return n.type===i.VariableDeclaration?[n]:Ne.includes(n.type)?[...n.inputs,...n.outputs||[]]:n.type===i.ReturnStatement?n.outputs:wr.includes(n.type)||n.type===i.FunctionDeclaration?n.inputs:[]}function R3(n){const e=jn(n),t=[],r=[];Ud.includes(n.type)&&t.push(...Sd(n));const a=e.filter(s=>{const o=t.includes(s);return o?!1:gn.includes(s.type)&&!o?(r.push(s),!1):!0});return t.sort((s,o)=>Ea(o,s)?-1:0),r.sort((s,o)=>Ea(o,s)?-1:0),[...t,...r,...a]}function Av(n){return[...n].sort((e,t)=>Ea(t,e)?-1:0)}function b3(n){const e=Av(n),t=[];return e.forEach(r=>{const a=t[t.length-1];if(a){const s=a[a.length-1];Ea(r,s)?t.push([r]):a.push(r)}else t.push([r])}),t}function mt(n){const e=n.map(t=>He(t));return v(e)}function Sd(n){return Ne.includes(n.type)?[...mt(n.successCalls),...mt(n.errorCalls)]:we.includes(n.type)?mt(n.calls):[]}function g3(n,e){return Sd(n).includes(e)}function Od(n){return n.writesValues||[]}function v3(n,e){return Od(n).includes(e)}function Sv(n){var e;return Fe.includes((e=n==null?void 0:n.readsValue)==null?void 0:e.type)?n.readsValue:null}function I3(n){return n.writesValues}function Ov(n=[]){return n.map(Sv).filter(e=>!!e)}function yo(n=[]){return n.map(e=>e.writesValues).flat().filter(e=>Fe.includes(e.type))}function Cv(n=[]){return n.map(e=>e.readsValue).filter(e=>!!e&&Fe.includes(e.type))}function Bv(n){return Fe.includes(n.type)?n:null}function wv(n){return n.writesValues.map(Bv).filter(e=>!!e)}function Mv(n=[]){return n.reduce((e,t)=>t.type===i.OutputMap?[...e,...wv(t)]:e,[])}function Pe(n){return Ne.includes(n.type)?[...nn(mt(n.successCalls)),...nn(mt(n.errorCalls))]:we.includes(n.type)?nn(mt(n.calls)):[]}function D3(n){return Ne.includes(n.type)?[...nn(mt(n.successCalls)),...nn(mt(n.errorCalls))]:we.includes(n.type)?nn(mt(n.calls)):[]}function _v(n,e=new Set){return n.writesValues.filter(r=>Fe.includes(r.type)&&!e.has(r.id)).reduce((r,a)=>e.has(a.id)?r:[...r,...K(a,e)],[])}function Nv(n,e=new Set){var r;return(((r=n.readsValue)==null?void 0:r.writesValues)||[]).filter(a=>Fe.includes(a.type)&&!e.has(a.id)).reduce((a,s)=>e.has(s.id)?a:[...a,...K(s,e)],[])}function K(n,e=new Set){if(e.has(n.id))return[];if(n.type===i.ReturnStatement)return Cv(n.outputs).reduce((r,a)=>[...r,...K(a,e)],[]);if(n.type===i.FunctionCall||n.type===i.Operation||n.type===i.Condition)return[...Pe(n).reduce((s,o)=>{const l=He(o);return[...s,...K(l||o,e)]},[]),...Ov(n.inputs),...Mv(n.outputs)].reduce((s,o)=>[...s,...K(o,e)],[]);if(wr.includes(n.type)){const t=yo(n.inputs),a=Pe(n).reduce((s,o)=>{const l=He(o);return[...s,...K(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...K(o,e)],[])}if(n.type===i.FunctionDeclaration){const t=[...yo(n.inputs)],a=Pe(n).reduce((s,o)=>{const l=He(o);return[...s,...K(l||o,e)]},[]);return t.push(...a),t.reduce((s,o)=>[...s,...K(o)],[])}if(Fe.includes(n.type)){e.add(n.id);const r=Pe(n).reduce((a,s)=>{const o=He(s);return[...a,...K(o||s,e)]},[]);return[n,...r,...Nv(n,e),..._v(n,e)]}return[]}function Pt(n,e=new Set){return e.has(n.id)?[]:(e.add(n.id),[...jn(n).reduce((a,s)=>[...a,s,...Pt(s,e)],[])])}function nn(n){return n.reduce((e,t)=>t.type===i.ReturnStatement||t.type===i.ContinueStatement||t.type===i.BreakStatement?[...e,t]:[...e,t,...Pe(t)],[])}function Vv(n){const e=n.entities||[],t=[...e,...n.functions||[],...n.events||[],...n.projects||[]],r=e.reduce((p,y)=>[...p,...y.properties],[]),a=e.reduce((p,y)=>[...p,...y.methods],[]),s=a.reduce((p,y)=>[...p,...yo(y.inputs),...nn(mt(y.calls)),...y.returnStatements],[]),o=n.functions.reduce((p,y)=>[...p,...nn(mt(y.calls)),...y.returnStatements],[]),l=n.events.reduce((p,y)=>[...p,...nn(mt(y.calls)),...y.returnStatements],[]);return[...t,...r,...a,...s,...o,...l]}function $v(n,e){return e.filter(r=>{if(!r)return!1;switch(r.type){case i.FunctionCall:return r.inputs.find(a=>a.id===n.id)!==void 0||r.outputs.find(a=>a.id===n.id)!==void 0;case i.Condition:return r.successCalls.find(a=>a.id===n.id)!==void 0||r.errorCalls.find(a=>a.id===n.id)!==void 0||r.inputs.find(a=>a.id===n.id)!==void 0;case i.Operation:return r.outputs.find(a=>a.id===n.id)!==void 0;case i.VariableDeclaration:return Ne.includes(n.type)?Lv(n).find(s=>{var o;return((o=s.readsValue)==null?void 0:o.id)===r.id})!==void 0:!1;case i.CustomEntity:return r.properties.find(a=>a.id===n.id)!==void 0||r.methods.find(a=>a.id===n.id)!==void 0;case i.FunctionDeclaration:return r.inputs.find(a=>a.id===n.id)!==void 0||(r.returnStatements.map(a=>a.outputs).flat()||[]).find(a=>a.id===n.id)!==void 0;default:return!1}})}function P3(n){const e=Vv(n.project);return $v(n,e)}function Or(n){const e=[];if(gn.includes(n.type)){n.calledBy.forEach(a=>{const s=He(a);s&&e.push(s)});const r=[...n.inputs||[],...n.outputs||[]].map(a=>wd(a)).filter(a=>a!==null);e.push(...v(r))}if(Fe.includes(n.type)){const t=wd(n);t&&e.push(t)}return v(e)}function Cd(n){return n.type===i.FunctionCall||n.type===i.InternalCall?n.declaration.inputs:[i.Operation,i.Condition,i.Loop].includes(n.type)?n.declaration.fixedArguments:n.type===i.FunctionDeclaration||wr.includes(n.type)?n.inputs:n.type===i.Search?n.inputsDeclarations:[]}function A3(n,e){return e.type===i.Condition?e.inputs.find(t=>t.declaration.id===n.id):e.type===i.FunctionCall||e.type===i.Operation?e.inputs.find(t=>t.declaration.id===n.id):null}function Lv(n){return Ne.includes(n.type)?n.inputs:[]}function Bd(n){var e;return n.type===i.FunctionCall?((e=n.declaration.returnStatements[0])==null?void 0:e.outputs)||[]:[i.Operation,i.Condition,i.Loop].includes(n.type)?n.declaration.fixedReturns:n.type===i.Search?n.outputsDeclarations:Me.includes(n.type)?n.outputs:[]}function S3(n,e){return e.type===i.Condition?null:e.type===i.FunctionCall||e.type===i.Operation?e.outputs.find(t=>t.declaration.id===n.id):null}function O3(n){return n.type===i.Condition?[]:Ne.includes(n.type)?n.outputs:[]}function wd(n){const e=n.readsValue;return e?He(e):null}function Gv(n){const e=n.internalCalls||[];return v(mt(v(e.flatMap(t=>[...t.successCalls,...t.errorCalls]))))}function hi(n){const e=Od(n),t=[];return e.forEach(r=>{if(Fe.includes(r.type))t.push(r);else if(r.type===i.InputMap){const a=r.parent;if(a.type===i.InputMap){const s=a.parent;t.push(s)}else t.push(a)}else[i.ActionDescriptor].includes(r.parent.type)||t.push(r.parent)}),t}function v(n){const e=new Set;return n.filter(t=>!t||e.has(t.id)?!1:(e.add(t.id),!0))}function jn(n,e=!1){const t=[];if(n.type===i.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)||[]),lt.includes(n.type)&&t.push(...(n==null?void 0:n.detachedChildren)||[]),n.type===i.CustomEntity){const r=[...n.suggestedMethods,...n.methods].flatMap(a=>a.collapsed&&e?[]:jn(a));t.push(...r)}if(n.type===i.Condition){const r=n.successCalls.map(s=>He(s)),a=n.errorCalls.map(s=>He(s));t.push(...r,...a)}if(wr.includes(n.type)){if(n.collapsed&&e)return[];const r=n.inputs.map(s=>hi(s)).flat(),a=n.calls.map(s=>He(s));t.push(...v(r),...a)}if(Ne.includes(n.type)&&n.type!==i.Condition){const r=n==null?void 0:n.outputs.map(o=>hi(o)).flat(),a=n.successCalls.map(o=>He(o)),s=n.errorCalls.map(o=>He(o));t.push(...v(r),...a,...s)}if(Fe.includes(n.type)){const r=hi(n),a=Gv(n);t.push(...r,...a)}if(n.type===i.Loop){const r=n.outputs.map(o=>hi(o)).flat();if(n.body){const o=jn(n.body,e);t.push(...o)}const a=n.errorCalls.map(o=>He(o)),s=n.successCalls.map(o=>He(o));t.push(...v(r),...s,...a)}if(n.type===i.FunctionDeclaration){if(n.collapsed&&e)return[];const r=n.inputs.map(s=>hi(s)).flat(),a=n.calls.map(s=>He(s));t.push(...v(r),...a)}return v(t)}function Fv(n,e=!1){const t=jn(n,e),r=[...t,...t.reduce((a,s)=>[...a,...Fv(s,e)],[])];return v(r)}function Uv(n){const e=Or(n),t=[...e,...e.reduce((r,a)=>[...r,...Uv(a)],[])];return v(t)}function ho(n){return n.implements.reduce((e,t)=>t.type===i.CustomEntity?[...e,i.CustomEntity,...ho(t),...fo(t)]:[...e,t.name],[])}function fo(n){return n.extends.reduce((e,t)=>t.type===i.CustomEntity?[...e,i.CustomEntity,...fo(t),...ho(t)]:[...e,t.name],[])}function Md(n){return n.extends.reduce((e,t)=>t.type===i.CustomEntity?[...e,t,...Md(t),..._d(t)]:[...e,t],[])}function _d(n){return n.implements.reduce((e,t)=>t.type===i.CustomEntity?[...e,t,..._d(t),...Md(t)]:[...e,t],[])}function xv(n){return[...fo(n),...ho(n)].filter((t,r,a)=>a.indexOf(t)===r)}function jv(n){return n.implements.length===0&&n.extends.length===0?null:n.implements.find(r=>r.type===i.BuiltInBaseEntity&&r.name===N.PERSISTED_ENTITY)?n:[...n.implements,...n.extends].reduce((r,a)=>{if(a.type===i.CustomEntity){const s=jv(a);if(s)return s}return r},null)}function C3(n){const e=n.extends.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function B3(n){const e=n.implements.find(t=>t.type===i.BuiltInBaseEntity);return e&&e.type===i.BuiltInBaseEntity?e:null}function kv(n){const e=n.extends.find(t=>t.type===i.CustomEntity);return e&&e.type===i.CustomEntity?e:null}function kn(n){const e=[...n.implements,...n.extends].reduce((t,r)=>r.type===i.BuiltInBaseEntity?[...t,r]:r.type===i.CustomEntity?[...t,...kn(r)]:t,[]);return v(e)}function Nd(n){return n.type===i.PrimitiveEntity?!0:n.type===i.BuiltInBaseEntity?n.interactive:!kn(n).find(r=>!r.interactive)}function w3(n){return n.parent===n.project&&n.project.variableDeclarations.includes(n)}function Vd(n){return n.parent!==n.project?!1:i.VariableDeclaration===n.type?n.project.variableDeclarations.includes(n):i.VariableInstance===n.type?n.project.variableInstances.includes(n):i.FunctionCall===n.type?n.project.functionCalls.includes(n):i.Condition===n.type?n.project.conditions.includes(n):i.Operation===n.type?n.project.operations.includes(n):i.Loop===n.type?n.project.loops.includes(n):i.Search===n.type?n.project.searches.includes(n):!1}function qv(n){if([...we,i.CustomEntity,i.InstalledProject,i.Project].includes(n.type)||Vd(n))return!1;const e=Or(n);return e.length===0?!0:e.some(t=>qv(t))}function $d(n){return[...we,i.CustomEntity,i.InstalledProject,i.Project].includes(n.type)||Vd(n)?!1:Or(n).length===0}function Jv(n,e=0){if($d(n)){const t=Or(n);return t.length===0?n:t.map(a=>Jv(a,e+1)).reduce((a,s)=>a?s&&s.x<a.x?s:a:s,null)}return null}function Wv(n){const e=[];if($d(n))e.push(n);else return[];return Or(n).forEach(r=>{e.push(...Wv(r))}),e}function Hv(n){return n.type===i.FunctionDeclaration&&n.parent!==n.project&&!![i.CustomEntity,i.Loop,i.InstalledProject].includes(n.parent.type)}function M3(n,e){const t=new Map;return n.forEach(r=>{t.set(r.id,r)}),e.forEach(r=>{t.set(r.id,r)}),Array.from(t.values())}function mo(n){switch(n){case i.CustomEntity:return Cr;case i.FunctionDeclaration:return mr;case i.VariableDeclaration:return br;case i.VariableInstance:return gr;case i.FunctionCall:return Sr;case i.Operation:return Tr;case i.Condition:return Rr;case i.ReturnStatement:return Pr;case i.Loop:return Er;case i.Search:return vr;case i.InputMap:return En;case i.OutputMap:return Rn;case i.ArgumentDeclaration:return Dr;case i.ReturnDeclaration:return wt;case i.Property:return fr;case i.InstalledProject:return Ir;case i.Project:return _;case i.BuiltInBaseEntity:return Lt;default:return null}}function Tt(n,e){if(lt.includes(n.type))return n;if(Mr.includes(n.type))return null;const t=n.parent;if(!t)return null;if(t.type===i.GenericReference){const r=O(t);if(!r)return null;const a=e.get(r);return a?Tt(a,e):null}else return t===e?e:Tt(t,e)}function Ld(n,e){if(Mr.includes(n.type)||e.getAllBuiltInIds().includes(n.id))return null;const r=Mt(n.parent,e);return r?r===e?lt.includes(n.type)?n:null:r.type===i.CustomEntity?n:Ld(r,e):null}function To(n,e,t){if(n===e||e===t||n===t)return!1;const r=Tt(e.parent,t);return r===n?!0:To(r,e,t)}var Eo=(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))(Eo||{});function Ra(n,e,t){const r=Tt(n,t),a=Tt(e,t);if(!r)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(r===a&&r.type!==i.Project)return{compatible:!0,type:"same-both-local",commonAncestorScope:r};if(r===a&&r.type===i.Project)return{compatible:!0,type:"same-both-global",commonAncestorScope:r};if(r.type===i.Project&&a.type!==i.Project)return{compatible:!1,type:"a-is-global-b-is-not",commonAncestorScope:r};if(r.type!==i.Project&&a.type===i.Project)return{compatible:!1,type:"b-is-global-a-is-not",commonAncestorScope:a};if(To(r,a,t))return{compatible:!0,type:"b-in-a",commonAncestorScope:r};if(To(a,r,t))return{compatible:!0,type:"a-in-b",commonAncestorScope:a};const l=Ad(r,a);return l===t?{compatible:!1,type:"parallel-in-project",commonAncestorScope:l}:l?{compatible:!1,type:"parallel-in-common-parent",commonAncestorScope:Tt(l,t)}:{compatible:!1,type:"parallel-in-project",commonAncestorScope:t}}function Yv(n,e,t){const r=Ra(n,e,t);if(!r.compatible||r.type!=="same-both-local")return null;if(n===e)return n;let a=Tt(n.parent,t);if(a){if(a===e)return e;if(a.type===i.Project)return n}else return n;for(;a;){if(a){if(a===e)return e;if(a.type===i.Project)return n}else return n;a=Tt(a.parent,t)}let s=Tt(e.parent,t);if(s){if(s===n)return n;if(s.type===i.Project)return e}else return e;for(;s;){if(s){if(s===n)return n;if(s.type===i.Project)return e}else return e;s=Tt(s.parent,t)}return null}function zv(n){return n.length===0?null:n.length===1?n[0]:n.reduce((t,r)=>{const a=Yv(t,r,r.project);return!a||a===r?t:r},n[0])}function Mt(n,e){let t;return typeof n=="string"?t=n:n.type===i.GenericReference?t=O(n):t=n.id,t===e.id?e:e.get(t)}function qn(n){if(Mr.includes(n.type))return n;if(n.type===i.Project)return null;if(n.project.getAllBuiltInIds().includes(n.id))return n;const t=n.parent;return!t||t.type===i.Project?null:qn(t)}function ba(n,e){var t;if(n.readsValue){const r=Mt(n.readsValue,e.project);e.setValueWriter(r),r.addValueReader(e)}else n.readsValue===null&&((t=e.readsValue)==null||t.removeValueReader(e),e.readsValue=null);return e}function ga(n){const e=[];function t(s,o){return e.some(l=>l.blockedByCaller===s&&l.blockedByCalling===o)}function r(s,o){t(s,o)||e.push({blockedByCaller:s,blockedByCalling:o})}const a=Ld(n,n.project);return n.calledBySuccess.forEach(s=>{[...s.successCalls||[]].forEach(p=>{Me.includes(p.type)&&p!==n&&(Pe(n).find(m=>m===p)||r(s,p))});let l;if(Ne.includes(s.type)&&(l=s),l){const p=ga(l);p.reachable||Pe(n).find(m=>m===s)||p.blocks.forEach(m=>{r(s,m.blockedByCalling)})}}),n.calledByError.forEach(s=>{[...s.errorCalls||[]].forEach(p=>{Me.includes(p.type)&&p!==n&&(Pe(n).find(m=>m===p)||r(s,p))});let l;if(Ne.includes(s.type)&&(l=s),l){const p=ga(l);p.reachable||Pe(n).find(m=>m===s)||p.blocks.forEach(m=>{r(s,m.blockedByCalling)})}}),n.calledByEntry.forEach(s=>{if([...s.calls||[]].forEach(p=>{Me.includes(p.type)&&p!==n&&(Pe(n).find(m=>m===p)||r(s,p))}),s===a)return;let l;if(s.type===i.FunctionDeclaration){const p=He(s);if(p.type===i.CustomEntity)return;p.type===i.Loop&&(l=p)}if(l){const p=ga(l);p.reachable||p.blocks.forEach(y=>{r(s,y.blockedByCalling)})}}),{reachable:e.length===0,entryPoint:a,blocks:e}}function _3(n){return vo.includes(n.type)?n.type===i.FunctionDeclaration?!Hv(n):!0:!1}function N3(n){if(i.ActionDescriptor===n.type){if(n.project.operationDeclarations.find(s=>s.id===n.id))return i.Operation;if(n.project.globalEventActionDescriptors.find(s=>s.id===n.id))return i.GlobalEvent;if(n.project.loopDeclarations.find(s=>s.id===n.id))return i.Loop;if(n.project.conditionDeclarations.find(s=>s.id===n.id))return i.Condition}return n.type}function V3(n,e){const t=[];if(n.parent)if(n.id===n.parent)t.push(new E({id:`${n.id}--${n.parent}--${h.SelfReference}`,code:h.SelfReference,severity:T.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 r=e.get(n.parent);r?[i.Project,i.DataType].includes(r.type)||t.push(new E({id:`${n.id}--${n.parent}--${h.InvalidParentReference}`,code:h.InvalidParentReference,severity:T.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}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.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(r=>{if(n.id===r){t.push(new E({id:`${n.id}--${r}--${h.SelfReference}`,code:h.SelfReference,severity:T.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(r);a?[i.CustomEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract||t.push(new E({id:`${n.id}--${r}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${r}--${h.InvalidImplementsReference}`,code:h.InvalidImplementsReference,severity:T.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}--${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${r}" 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}--${I.InvalidObjectStructure}`,code:I.InvalidObjectStructure,severity:T.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(r=>{const a=e.get(r);a?[i.CustomEntity,i.BuiltInBaseEntity].includes(a.type)?a.abstract&&t.push(new E({id:`${n.id}--${r}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.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}--${r}--${h.InvalidExtendsReference}`,code:h.InvalidExtendsReference,severity:T.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}--${r}--${h.ReferencedEntityNotFound}`,code:h.ReferencedEntityNotFound,severity:T.Error,message:`Entity of type "${n.type}" with id "${n.id}", is referencing an entity with id "${r}" that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`,issue:null}))}),t}const Ie=class Ie{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"x");c(this,"y");c(this,"static");c(this,"abstract");c(this,"type",i.CustomEntity);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"implements",[]);c(this,"project");c(this,"errors",[]);c(this,"parent");c(this,"initialized",!1);c(this,"suggestedProperties",[]);c(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 r=t;if(e.parent){const p=O(e.parent);r=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:i.CustomEntity,description:e.description,static:e.static,abstract:e.abstract,properties:[],methods:[],abstractMethods:[],extends:s,implements:a,x:0,y:0,parent:r},l=R(o,t);return l.setParent(r),l.initChildren(),l}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[],s=V3(r,t),o=to(r,t);a.push(...s,...o,...Oe(r));const l=r.parent?t.get(r.parent):null;if(l&&l.type===i.DataType){const p=l;p.entity&&a.push(new E({id:`${e.id}--${h.NewEntityWouldOverriteExisting}`,code:h.NewEntityWouldOverriteExisting,severity:T.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.
|
|
372
371
|
You can inspect the existing 'entity' field with the 'describe_entity' action. Like so:
|
|
373
372
|
${tn({describe_entity:p.entity.id})}
|
|
374
|
-
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:r}}get extendedProperties(){return v([...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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this];if(this.parent.type===i.DataType){const t=this.parent;t.entity=this,e.push(t)}else this.project.addCustomEntity(this);return{affected:v(e),self: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=>{h8(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)}),f8(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),l=R(o,this.project);if(l.suggestion=!0,l.setParent(this),l.initChildren(),l.inputs.forEach(p=>{p.suggestion=!0}),l.returnStatements.length){const p=l.returnStatements[0];p.suggestion=!0,p.outputs.forEach(y=>{y.suggestion=!0})}this.addSuggestedMethod(l)})}),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 r=[],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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.methods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),{affected:v(r),removed:v(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),{affected:v(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(r=>r.toFlat(e)),...this.implements.flatMap(r=>r.toFlat(e)),...this.properties.flatMap(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(r=>r.toFlatIds(e)),...this.implements.flatMap(r=>r.toFlatIds(e)),...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.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+"--"+M.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.toFlatJSON(e)),...this.implements.flatMap(r=>r.toFlatJSON(e)),...this.extends.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===i.CustomEntity).flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===i.CustomEntity).flatMap(r=>r.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=y8(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(e=null,t=null,r=!0){var b,g,A;const a=this.toJSON(),s=t||Ze(P(this,this.project),i.CustomEntity,this.project);a.properties=[],a.methods=[],a.abstractMethods=[];const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ut(a,this.project);e&&p.setParent(e),r&&p.subscribe(),p.initChildren();const y=(b=this.properties)==null?void 0:b.map((C,$)=>C.clone(this,l+"-property-"+$+"-id",r));p.properties=y;const f=(g=this.methods)==null?void 0:g.map((C,$)=>C.clone(this,l+"-method-"+$+"-id",r));p.methods=f;const m=(A=this.abstractMethods)==null?void 0:A.map((C,$)=>C.clone(this,l+"-abstract-method-"+$+"-id",r));return p.abstractMethods=m,p}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return uo(this,e,t)}getAllInteractiveMethods(){const e=this.implements.filter(r=>r.type===i.CustomEntity||r.type===i.BuiltInBaseEntity&&r.interactive);return v([...this.methods,...this.extends.flatMap(r=>r.getAllInteractiveMethods()),...e.flatMap(r=>r.getAllInteractiveMethods())])}inferFromInputs(e){if(this.parent.type!==i.DataType||!this.parent.inferred)return this;const t=[];e.forEach(s=>{t.find(l=>P(l,this.project)===P(s,this.project))||t.push(s)});const r=this.properties.filter(s=>!s.getDataType());t.forEach(s=>{const o=r.find(m=>P(m,this.project)===P(s,this.project));if(!o)return;const p=yr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),y=en(p),f=y==null?void 0:y.clone(o,o.id+"--data-type",!0);f&&o.setDataType(f),s.setDeclaration(o)});const a=[];return t.forEach(s=>{if(!s.declaration){a.push(s);return}}),a.length===0?this:(a.forEach(s=>{const o=this.properties.find(g=>P(g,this.project)===P(s,this.project));if(o){if(s.setDeclaration(o),!o.getDataType()){const A=yr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),C=en(A),$=C==null?void 0:C.clone(o,o.id+"--data-type",!0);$&&o.setDataType($)}return}const l={id:s.id+"--inferred-property",type:i.Property,version:1,name:P(s,this.project),description:s.description,static:!0,abstract:!1,private:!1,hidden:!1,required:!1,index:s.index,implements:null,dataType:null,parent:this.toReference()},p=R(l,this.project);p.setParent(this),p.initChildren();const f=yr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),m=en(f),b=m==null?void 0:m.clone(p,l.id+"--data-type",!0);return b&&p.setDataType(b),this.addProperty(p),s.setDeclaration(p),p}),this)}};c(Ie,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),c(Ie,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ie,"BASE_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"MUTABLE_META_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ie,"INMUTABLE_META_PROPERTIES",[...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"META_PROPERTIES",[...Ie.MUTABLE_META_PROPERTIES,...Ie.INMUTABLE_META_PROPERTIES]),c(Ie,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),c(Ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ie,"UPSTREAM_PROPERTIES",[...Ie.MUTABLE_UPSTREAM_PROPERTIES,...Ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),c(Ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ie,"DOWNSTREAM_PROPERTIES",[...Ie.MUTABLE_DOWNSTREAM_PROPERTIES,...Ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ie,"PROPERTIES",[...Ie.META_PROPERTIES,...Ie.UPSTREAM_PROPERTIES,...Ie.DOWNSTREAM_PROPERTIES]);let Cr=Ie;function $3(n){const e=q4(),t=n.toJSON();e.safeParse(t).success;const a=[];return ee(n.errors,a)}class Gt{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",i.BuiltInBaseEntity);c(this,"abstract",!1);c(this,"static");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"interactive",!1);c(this,"errors",[]);c(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(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(r=>R(r,this.project))}get extendedProperties(){return v(this.extends.reduce((e,t)=>{const r=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...r]},[]))}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(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e)),...this.extends.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.toFlatIds(e)),...this.extends.flatMap(r=>r.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+"--"+M.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.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=$3(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 Gt(this.toJSON(),this.project)}implement(e,t){return uo(this,e,t)}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(r=>r.type===i.BuiltInBaseEntity&&r.interactive||r.type===i.PrimitiveEntity).forEach(r=>{r instanceof Gt&&e.push(...r.getAllInteractiveMethods())})),v(e)}}function L3(n){const e=V4(),t=n.toJSON();e.safeParse(t).success;const a=[];return ee(n.errors,a)}class Ft{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",i.PrimitiveEntity);c(this,"static");c(this,"abstract");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(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(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.parent=this,a})}get extendedProperties(){return v(this.extends.reduce((e,t)=>{const r=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...r]},[]))}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(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.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+"--"+M.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.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=L3(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 Ft(this.toJSON(),this.project)}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(r=>r.type===i.BuiltInBaseEntity&&r.interactive||r.type===i.PrimitiveEntity).forEach(r=>{r instanceof Gt&&e.push(...r.getAllInteractiveMethods())}),v(e)}}function Ut(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case i.PrimitiveValue:return t||new pi(n,e);case i.CustomEntity:return t||new Cr(n,e);case i.PrimitiveEntity:return t||new Ft(n,e);case i.FunctionDeclaration:return t||new mr(n,e);case i.GlobalEvent:return t||new di(n,e);case i.DataType:return t||new ci(n,e);case i.Property:return t||new fr(n,e);case i.FunctionCall:return t||new Sr(n,e);case i.Condition:return t||new Rr(n,e);case i.Operation:return t||new Tr(n,e);case i.VariableDeclaration:return t||new br(n,e);case i.VariableInstance:return t||new gr(n,e);case i.OutputMap:return t||new Rn(n,e);case i.ReturnDeclaration:return t||new _t(n,e);case i.ArgumentDeclaration:return t||new Pr(n,e);case i.InputMap:return t||new En(n,e);case i.Project:return t||new M(n);case i.InstalledProject:return t||new Ir(n,e);case i.ActionDescriptor:return t||new Ge(n,e);case i.ReturnStatement:return t||new Dr(n,e);case i.Loop:return t||new Er(n,e);case i.Search:return t||new vr(n,e);case i.ValueDescriptor:return t||new Ar(n,e);case i.BuiltInBaseEntity:return t||new Gt(n,e);case i.InternalCall:return t||new ui(n,e);case i.ContinueStatement:return t||new mt(n,e);case i.BreakStatement:return t||new yi(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=Ut(n,e);return t.subscribe(),t}function G3(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case i.PrimitiveValue:return pi.fromGenerationTarget(n,e);case i.CustomEntity:return Cr.fromGenerationTarget(n,e);case i.FunctionDeclaration:return mr.fromGenerationTarget(n,e);case i.GlobalEvent:return di.fromGenerationTarget(n,e);case i.DataType:return ci.fromGenerationTarget(n,e);case i.Property:return fr.fromGenerationTarget(n,e);case i.FunctionCall:return Sr.fromGenerationTarget(n,e);case i.Condition:return Rr.fromGenerationTarget(n,e);case i.Operation:return Tr.fromGenerationTarget(n,e);case i.VariableDeclaration:return br.fromGenerationTarget(n,e);case i.VariableInstance:return gr.fromGenerationTarget(n,e);case i.OutputMap:return Rn.fromGenerationTarget(n,e);case i.ReturnDeclaration:return _t.fromGenerationTarget(n,e);case i.ArgumentDeclaration:return Pr.fromGenerationTarget(n,e);case i.InputMap:return En.fromGenerationTarget(n,e);case i.InstalledProject:return Ir.fromGenerationTarget(n,e);case i.ReturnStatement:return Dr.fromGenerationTarget(n,e);case i.Loop:return Er.fromGenerationTarget(n,e);case i.Search:return vr.fromGenerationTarget(n,e);case i.ActionDescriptor:return Ge.fromGenerationTarget(n,e);case i.ValueDescriptor:return Ar.fromGenerationTarget(n,e);case i.InternalCall:return ui.fromGenerationTarget(n,e);case i.ContinueStatement:return mt.fromGenerationTarget(n,e);case i.BreakStatement:return yi.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const Z=class Z{constructor(e){c(this,"initialData");c(this,"id");c(this,"version");c(this,"type",i.Project);c(this,"name",null);c(this,"description",null);c(this,"x");c(this,"y");c(this,"entities",[]);c(this,"projects",[]);c(this,"functions",[]);c(this,"events",[]);c(this,"variableDeclarations",[]);c(this,"variableInstances",[]);c(this,"conditions",[]);c(this,"operations",[]);c(this,"functionCalls",[]);c(this,"loops",[]);c(this,"searches",[]);c(this,"primitives",[]);c(this,"builtInBaseEntities",[]);c(this,"operationDeclarations",[]);c(this,"globalEventActionDescriptors",[]);c(this,"loopDeclarations",[]);c(this,"conditionDeclarations",[]);c(this,"valueDescriptors",[]);c(this,"dataTypes",[]);c(this,"project");c(this,"instances",{});c(this,"builtInInstances",{});c(this,"errors",[]);c(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{Z.UUID||(Z.UUID=ds==null?void 0:ds())}catch(t){console.error("Error initializing UUID module",t),Z.UUID={uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:r=>r}}}static injectUUIDModule(e){Z.UUID=e}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Oe(r)),{errors:a,modifiedData:r}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async r=>{await t.init(this),r(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return{affected:v([]),self: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(r=>r.toFlat(e)),...this.functions.flatMap(r=>r.toFlat(e)),...this.events.flatMap(r=>r.toFlat(e)),...this.projects.flatMap(r=>r.toFlat(e)),...this.variableDeclarations.flatMap(r=>r.toFlat(e)),...this.variableInstances.flatMap(r=>r.toFlat(e)),...this.conditions.flatMap(r=>r.toFlat(e)),...this.operations.flatMap(r=>r.toFlat(e)),...this.functionCalls.flatMap(r=>r.toFlat(e)),...this.loops.flatMap(r=>r.toFlat(e)),...this.searches.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+Z.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.functions.flatMap(r=>r.toFlatJSON(e)),...this.events.flatMap(r=>r.toFlatJSON(e)),...this.projects.flatMap(r=>r.toFlatJSON(e)),...this.variableDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.variableInstances.flatMap(r=>r.toFlatJSON(e)),...this.conditions.flatMap(r=>r.toFlatJSON(e)),...this.operations.flatMap(r=>r.toFlatJSON(e)),...this.functionCalls.flatMap(r=>r.toFlatJSON(e)),...this.loops.flatMap(r=>r.toFlatJSON(e)),...this.searches.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.functions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.events.flatMap(r=>r.toFlatGenerationTarget(e)),...this.projects.flatMap(r=>r.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(r=>r.toFlatGenerationTarget(e)),...this.conditions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.operations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.loops.flatMap(r=>r.toFlatGenerationTarget(e)),...this.searches.flatMap(r=>r.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=o8(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Z(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(r=>r.id===e.id);if(t>-1){const r=this.entities[t];return this.entities.splice(t,1),r}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(r=>r.id===e.id);if(t>-1){const r=this.functions[t];return this.functions.splice(t,1),r}return null}removeExternalProject(e){const t=this.projects.findIndex(r=>r.id===e.id);if(t>-1){const r=this.projects[t];return this.projects.splice(t,1),r}return null}removeGlobalEvent(e){const t=this.events.findIndex(r=>r.id===e.id);if(t>-1){const r=this.events[t];return this.events.splice(t,1),r}return null}removeTopLevelVariableDeclaration(e){if(e.type!==i.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(r=>r.id===e.id);if(t>-1){const r=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),r}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,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.functionCalls.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.operations.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.loops.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.searches.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.functionCalls.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.conditions.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.loops.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.searches.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.conditions.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.operations.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.loops.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.searches.reduce((t,r)=>{const a=De(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.functionCalls.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.conditions.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.operations.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.loops.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.searches.reduce((t,r)=>{const a=K(r);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return v([...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(r=>{if(!r.declaration){const a=r.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(l=>l.id===s);o&&r.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===N.PERSISTED_ENTITY)||null}};c(Z,"UUID",{uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),c(Z,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Z,"BASE_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"MUTABLE_META_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Z,"INMUTABLE_META_PROPERTIES",[...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"META_PROPERTIES",[...Z.MUTABLE_META_PROPERTIES,...Z.INMUTABLE_META_PROPERTIES]),c(Z,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Z,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),c(Z,"UPSTREAM_PROPERTIES",[...Z.MUTABLE_UPSTREAM_PROPERTIES,...Z.INMUTABLE_UPSTREAM_PROPERTIES]),c(Z,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),c(Z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Z,"DOWNSTREAM_PROPERTIES",[...Z.MUTABLE_DOWNSTREAM_PROPERTIES,...Z.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Z,"PROPERTIES",[...Z.META_PROPERTIES,...Z.UPSTREAM_PROPERTIES,...Z.DOWNSTREAM_PROPERTIES]);let M=Z;class Zv extends Ge{constructor(t){super(xt,t);c(this,"id",Ae.Parallel);c(this,"name",Ae.Parallel);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",xt);c(this,"type",i.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=xt.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=xt.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=xt.error?R(xt.error,this.project):null}}class Xv extends Ge{constructor(t){super(ct,t);c(this,"id",ct.id);c(this,"name",ct.name);c(this,"description",ct.description);c(this,"version",ct.version);c(this,"autoexecutable",!1);c(this,"initialData",ct);c(this,"type",i.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=ct.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ct.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ct.error?R(ct.error,this.project):null}}class Qv extends Ge{constructor(t){super(on,t);c(this,"id",Ae.Sequential);c(this,"name",Ae.Sequential);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",on);c(this,"type",i.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=on.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=on.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=on.error?R(on.error,this.project):null}}function F3(n){const e=[new Qv(n),new Zv(n),new Xv(n),new Ge(Ei,n),new Ge(Mr,n),new Ge(Hn,n),new Ge(Aa,n),new Ge(So,n),new Ge(Bo,n),new Ge(Co,n),new Ge(Ia,n),new Ge(mi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class Kv extends Gt{constructor(t){super(Ve,t);c(this,"initialData");c(this,"id",N.PERSISTED_ENTITY);c(this,"version",1);c(this,"name",N.PERSISTED_ENTITY);c(this,"description",Ve.description);c(this,"type",i.BuiltInBaseEntity);c(this,"abstract",Ve.abstract);c(this,"static",Ve.static);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(this,"project");this.initialData=Ve,this.project=t,this.id=Ve.id,this.version=Ve.version,this.name=Ve.name,this.static=Ve.static,this.abstract=Ve.abstract,this.properties=this.initialData.properties.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(r=>R(r,this.project))}}function U3(n){const e=[new Kv(n),new Gt(Na,n),new Gt(Pn,n),new Gt(zo,n),new Gt(Ma,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function x3(n){const e=[new Ft(U,n),new Ft(vn,n),new Ft(Se,n),new Ft(Ke,n),new Ft(In,n),new Ft(sn,n),new Ft(va,n),new Ft(Io,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function j3(n){const e=[new Ge(Fa,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function k3(n){const e=[new Ge(Yn,n),new Ge(xo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function q3(n){const e=[new Ar(Ko,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function J3(n){const e=[new Ge(zn,n),new Ge(Vr,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const Br={},Ro={};async function W3(n,e={}){const t={...db};return t.id=n.id,e.empty?{data:{id:n.id,type:i.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function eI(n){const e=new M(n);return x3(e),U3(e),F3(e),j3(e),k3(e),q3(e),J3(e),e.initChildren(),e}async function H3(n,e={}){if(n.id&&Br[n.id])return Br[n.id];if(n.id&&Ro[n.id])return await Ro[n.id],Br[n.id];const t=W3(n,e);n.id&&(Ro[n.id]=t);const r=await t;if(r.data){const a=eI(r.data);return Br[n.id]=a,n.id&&delete Ro[n.id],a}return null}function Y3(n){return Br[n.id]&&delete Br[n.id],null}const z3="test_primitive_entities_export";u.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=Id,u.ActionDescriptorState=Ge,u.ActionDescriptorValuesType=F,u.ActionInputMapState=J9,u.ActionOutputMapState=Y9,u.AppendToListOperationInputIds=yp,u.AppendToListOperationOutputIds=hp,u.ArgumentDeclarationState=Pr,u.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=Rd,u.BUILT_IN_BASE_ENTITY_IDS=J,u.BUILT_IN_ENTITY_TYPES=_r,u.BaseCanvasDraggableState=C9,u.BaseEntityNames=N,u.BaseState=O9,u.BaseValueDescriptorIds=Lo,u.BreakStatementState=yi,u.BuiltInBaseEntityState=Gt,u.CACHED_PROJECTS_BY_ID=Br,u.CALLABLE_ENTITIES_EXPLANATION=s3,u.CALLABLE_TYPES=gn,u.CALLER_ENTITIES_EXPLANATION=yv,u.CALLER_TYPES=an,u.CALLS_UPDATE_EXPLANATION=Un,u.COMPARISON_CONDITIONS=pm,u.CONDITIONS=wI,u.CUSTOM_ENTITY_OPERATIONS=Oy,u.CallableEntityClass=w9,u.CallerEntityClass=fd,u.ChildEntityState=B9,u.ComparisonOperatorTypes=Be,u.ConditionState=Rr,u.ContinueStatementState=mt,u.CreateNewInputIds=iy,u.CreateNewOutputIds=ay,u.CustomEntityState=Cr,u.DRAGGABLE_CALLABLE_TYPES=go,u.DRAGGABLE_CALLER_TYPES=Ud,u.DRAGGABLE_ELEMENT_TYPES=vo,u.DRAGGABLE_EXECUTABLE_TYPES=aI,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=bo,u.DataTypeCompatibilityTypes=Lt,u.DataTypeParentChildRelation=qe,u.DataTypeState=ci,u.ENTITIES_WITH_VALLUES_EXPLANATION=ao,u.ENTITY_TYPES=sI,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=lt,u.ENTITY_WITH_NAMES_TYPES=xd,u.ENTITY_WITH_VALUE_TYPES=Fd,u.ENTRY_POINT_ENTITIES_EXPLANATION=ma,u.ENTRY_POINT_TYPES=we,u.EVENT_TYPES=wr,u.EXECUTABLE_TYPES=iI,u.EXECUTION_OPERATIONS=ry,u.EntityError=ir,u.EntityErrorSeverity=T,u.EntityGenerationError=E,u.EntityGenerationErrorCode=h,u.EntityInstanceErrorCode=B,u.EntityOperations=Qe,u.EntityType=i,u.EntityWithLogicScopeClass=V9,u.EntityWithValueClass=N9,u.EntryPointEntityClass=_9,u.ExecutionOperations=Ae,u.FunctionCallState=Sr,u.FunctionDeclarationState=mr,u.GLOBAL_EVENT_DECLARATIONS=_I,u.GetLastInListOperationInputIds=tp,u.GetLastInListOperationOutputIds=np,u.GlobalEventNames=rn,u.GlobalEventState=di,u.HTTPOperations=Ye,u.HTTP_OPERATIONS=lh,u.InputMapState=En,u.InstalledProjectState=Ir,u.InternalCallState=ui,u.JoinListOperationInputIds=gu,u.JoinListOperationOutputIds=vu,u.JoinStringOperationInputIds=ou,u.JoinStringOperationOutputIds=lu,u.LIST_OPERATIONS=Sp,u.ListOperations=k,u.LoopState=Er,u.LoopTypes=Q,u.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=xn,u.NUMBER_OPERATIONS=su,u.NumberAdditionOperationInputIds=Hd,u.NumberAdditionOperationOutputIds=Yd,u.NumberOperations=ot,u.OPERATION_DECLARATIONS=lI,u.OperationState=Tr,u.OutputMapParentChildRelation=Gd,u.OutputMapState=Rn,u.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=so,u.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Fn,u.PASS_THROUGH_CALLABLE_TYPES=Ne,u.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=vd,u.ParallelExecutionOperation=Zv,u.ParallelExecutionOperationInputIds=Op,u.ParallelExecutionOperationOutputIds=Cp,u.PassThroughCallableEntityClass=M9,u.PersistedEntity=Kv,u.PersistedEntityMethods=St,u.PrimitiveEntityState=Ft,u.PrimitiveTypes=D,u.PrimitiveValueState=pi,u.ProjectState=M,u.PropertyState=fr,u.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=o3,u.ReturnDeclarationState=_t,u.ReturnStatementState=Dr,u.STANDALONE_CONDITIONS=sm,u.STRING_OPERATIONS=bu,u.ScopeCompatibilityType=Eo,u.SearchState=vr,u.SequentialExecutionOperation=Qv,u.SequentialExecutionOperationInputIds=Wp,u.SequentialExecutionOperationOutputIds=Hp,u.SharedEntityErrorCode=I,u.SharedStateFunctionality=dv,u.SplitListOperationInputIds=Lu,u.SplitListOperationOutputIds=Gu,u.StandaloneOperatorTypes=Nt,u.StringOperations=Pe,u.TERMINATION_TYPES=_e,u.USER_MANAGED_ENTITY_TYPES=oI,u.UserManagedEntityStateFunctionality=S9,u.VALUE_READING_ENTITIES_EXPLANATION=gd,u.VALUE_READING_TYPES=Jn,u.VALUE_WRITING_ENTITIES_EXPLANATION=hv,u.VALUE_WRITING_TYPES=Me,u.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=bd,u.VARIABLE_TYPES=Fe,u.ValidationInputIds=hy,u.ValidationOutputIds=fy,u.ValueAutogenerationType=xe,u.ValueDescriptorParentChildRelation=w,u.ValueDescriptorState=Ar,u.ValueReadingEntityClass=ha,u.ValueWritingEntityClass=fa,u.VariableDeclarationState=br,u.VariableInputMapState=q9,u.VariableInstanceState=gr,u.VariableOutputMapState=H9,u.WaitOperation=Xv,u.WaitOperationInputIds=Fp,u.WaitOperationOutputIds=Up,u._VALUE_READING_TYPES=nI,u._VALUE_WRITING_TYPES=rI,u.appendToListOperation=Aa,u.appendToListOperationElementToAppendArgument=_o,u.appendToListOperationElementToAppendArgumentParentRef=vp,u.appendToListOperationElementToAppendArgumentRef=Tp,u.appendToListOperationError=Ap,u.appendToListOperationErrorParentRef=Dp,u.appendToListOperationListArgument=wo,u.appendToListOperationListArgumentParentRef=gp,u.appendToListOperationListArgumentRef=fp,u.appendToListOperationListDataType=mp,u.appendToListOperationResultListDataType=bp,u.appendToListOperationResultListReturn=Pp,u.appendToListOperationResultListReturnParentRef=Ip,u.appendToListOperationResultListReturnRef=Rp,u.appendToListOperationSecondListDataType=Ep,u.asGenerationActionExample=tn,u.baseHttpRequestFunctionDeclaration=Ei,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=Uo,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=oh,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=sh,u.baseHttpRequestFunctionDeclarationRef=nh,u.baseHttpRequestFunctionDeclarationRefEight=ih,u.baseHttpRequestFunctionDeclarationRefFive=eh,u.baseHttpRequestFunctionDeclarationRefFour=Ky,u.baseHttpRequestFunctionDeclarationRefNine=ah,u.baseHttpRequestFunctionDeclarationRefSeven=rh,u.baseHttpRequestFunctionDeclarationRefSix=th,u.baseHttpRequestFunctionDeclarationRefThree=Qy,u.baseHttpRequestFunctionDeclarationRefTwo=Xy,u.booleanPrototype=vn,u.capitalizeFirstLetter=Xs,u.checkAreCustomEntitiesCompatibleAsDataType=zg,u.checkAreDataTypesCompatible=ft,u.checkArePropertiesCompatibleAsDataType=Yg,u.checkIsBranchDependentButNotDirectlyOnBranch=Ea,u.checkIsBranchDependentOnBranch=m3,u.checkIsCallableEntityReachable=ga,u.checkIsCanvasEntity=M3,u.checkIsDetachedBranch=qv,u.checkIsDetachedBranchShallow=$d,u.checkIsGlobalVariable=w3,u.checkIsGloballyDeclared=Vd,u.checkIsMethod=Hv,u.checkIsNestedScope=To,u.checkScopeCompatibility=Ra,u.createEntityError=q,u.createNewInstanceOperation=Mr,u.createNewInstanceOperationEntityToInstanciateArgument=cy,u.createNewInstanceOperationEntityToInstanciateArgumentRef=sy,u.createNewInstanceOperationEntityToInstanciateDataType=oy,u.createNewInstanceOperationError=yy,u.createNewInstanceOperationErrorParentRef=py,u.createNewInstanceOperationOutputEntityDeclaration=uy,u.createNewInstanceOperationOutputEntityDeclarationParentRef=dy,u.createNewInstanceOperationRef=ly,u.createSemanticId=Ze,u.createStateFromGenerationTargetType=G3,u.createStateFromType=Ut,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=zo,u.cronJobBuiltInBaseEntityExpressionProperty=nm,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=OI,u.cronJobBuiltInBaseEntityExpressionPropertyRef=em,u.cronJobBuiltInBaseEntityRef=tm,u.cronJobTriggeredFunctionDeclarationBlueprint=Yo,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=Qf,u.customEntityToZodSchema=Bm,u.dataTypeCompatibilityToErrorExplanation=vv,u.datePrototype=sn,u.dateValueAutogenerationSchema=rc,u.deletePersistedEntityMethod=Ho,u.deletePersistedEntityMethodParentRef=Bf,u.deleteRootProject=Y3,u.endpointBuiltInBaseEntity=Na,u.endpointBuiltInBaseEntityRef=Ch,u.endpointBuiltInBaseEntityRefFour=Ef,u.endpointBuiltInBaseEntityRefThree=Gh,u.endpointBuiltInBaseEntityRefTwo=Nh,u.endpointBuiltInCorsProperty=Bh,u.endpointBuiltInCorsPropertyDataType=Oh,u.endpointBuiltInCorsPropertyDataTypeRef=Ah,u.endpointBuiltInCorsPropertyRef=Sh,u.endpointBuiltInMethodProperty=ko,u.endpointBuiltInMethodPropertyDataType=Lh,u.endpointBuiltInMethodPropertyDataTypeRef=Vh,u.endpointBuiltInMethodPropertyRef=$h,u.endpointBuiltInPathProperty=jo,u.endpointBuiltInPathPropertyDataType=Mh,u.endpointBuiltInPathPropertyDataTypeRef=wh,u.endpointBuiltInPathPropertyRef=_h,u.endpointPathParamsArgumentDeclaration=Kh,u.endpointPathParamsArgumentDeclarationRef=Yh,u.endpointPathParamsVariableDataType=zh,u.endpointPathParamsVariableDataTypeRef=Hh,u.endpointReachedTriggerActionDescriptor=qo,u.endpointReachedTriggerActionDescriptorRef=Zh,u.endpointReachedTriggerActionDescriptorRefFour=nf,u.endpointReachedTriggerActionDescriptorRefThree=ef,u.endpointReachedTriggerActionDescriptorRefTwo=Qh,u.endpointRequestBodyArgumentDeclaration=rf,u.endpointRequestBodyArgumentDeclarationRef=jh,u.endpointRequestBodyVariableDataType=kh,u.endpointRequestHeadersArgumentDeclaration=Xh,u.endpointRequestHeadersArgumentDeclarationRef=Uh,u.endpointRequestHeadersVariableDataType=xh,u.endpointRequestHeadersVariableDataTypeRef=Fh,u.endpointRequestQueryParamsArgumentDeclaration=tf,u.endpointRequestQueryParamsArgumentDeclarationRef=Jh,u.endpointRequestQueryParamsVariableDataType=Wh,u.endpointRequestQueryParamsVariableDataTypeRef=qh,u.endpointResponseBodyDataType=ff,u.endpointResponseBodyReturnDeclaration=Tf,u.endpointResponseBodyReturnDeclarationRef=hf,u.endpointResponseCodeDataType=sf,u.endpointResponseCodeReturnDeclaration=lf,u.endpointResponseCodeReturnDeclarationRef=af,u.endpointResponseHeadersDataType=uf,u.endpointResponseHeadersDataTypeRef=cf,u.endpointResponseHeadersReturnDeclaration=yf,u.endpointResponseHeadersReturnDeclarationRef=df,u.endpointReturnStatementRef=of,u.endpointReturnStatementRefThree=mf,u.endpointReturnStatementRefTwo=pf,u.enumOptionsProperty=Wd,u.enumOptionsPropertyDataType=qd,u.enumOptionsPropertyDataTypeRef=jd,u.enumOptionsPropertyRef=kd,u.enumPrototype=In,u.enumPrototypeRef=Jd,u.executionBuiltInEntity=Xo,u.executionBuiltInEntityAbortMethod=Zo,u.executionBuiltInEntityAbortMethodParentRef=rm,u.filterOutDuplicateEntities=v,u.filterOutDuplicateErrors=A4,u.findReferenceToSelfInList=$v,u.findReferencesToSelfInProject=D3,u.flattenCalls=nn,u.flattenCanvasAncestorsUntil=po,u.flattenCustomEntityExtensionAndImplementationTypes=xv,u.flattenCustomEntityExtensionTypes=fo,u.flattenCustomEntityExtensions=_d,u.flattenCustomEntityImplementations=Md,u.flattenCustomEntityImplementionTypes=ho,u.flattenDerivedCanvasEntities=At,u.flattenDetachedBranch=Wv,u.flattenElementCalls=De,u.flattenElementCallsOnTheSameScope=P3,u.flattenProjectElements=Vv,u.flattenRelatedCanvasElementsOnTheLeft=Uv,u.flattenRelatedCanvasElementsOnTheRight=Fv,u.flattenVariableReads=Nv,u.flattenVariableWrites=Mv,u.flattenVariables=K,u.fromZodParseToEntityGenerationErrors=md,u.generate=OD,u.generateActionExample=l3,u.generateExecutionDataType=l9,u.generateMutablePropertiesExplanation=no,u.generateRandomBoolean=nT,u.generateRandomDate=Nm,u.generateRandomDateAfter=wm,u.generateRandomDateBefore=_m,u.generateRandomDateBetweenRange=Mm,u.generateRandomNumber=Xm,u.generateRandomNumberAfter=Ym,u.generateRandomNumberBefore=zm,u.generateRandomNumberBetweenRange=Zm,u.generateRandomText=tT,u.generateRandomTextAfter=Qm,u.generateRandomTextBefore=Km,u.generateRandomTextBetweenRange=eT,u.generateUniqueUUID=Hm,u.getAllActionDescriptorsForConditions=co,u.getAllActionDescriptorsForGlobalEvents=oo,u.getAllActionDescriptorsForLoops=lo,u.getAllActionDescriptorsForOperations=p3,u.getAllGloballyDeclaredFunctionDeclarationsExplanation=Rv,u.getBaseBuiltInEntities=kn,u.getBaseSchemaBasedOnType=uv,u.getBuiltInEntityOwner=qn,u.getCallableEntityReferenceSchema=ke,u.getCallableEntityTypeSchema=Vb,u.getCallerEntityReferenceSchema=wx,u.getCallerEntityTypeSchema=Bx,u.getCalls=Sd,u.getCanvasEntitiesDerivedFromInternalCalls=Gv,u.getCanvasEntitiesDerivedFromWrites=hi,u.getCanvasEntityDerivedFromValueReadingEntity=wd,u.getCanvasEntityReferenceSchema=Yx,u.getCanvasEntityTypeSchema=Hx,u.getChildrenEntityWithValues=E3,u.getCommonAncestor=Ad,u.getCommonChildren=Dv,u.getDeclaration=yr,u.getDeepestScope=zv,u.getDraggableCallableEntityReferenceSchema=Lb,u.getDraggableCallableEntityTypeSchema=$b,u.getDraggableCallerEntityReferenceSchema=Mx,u.getDraggableCallerEntityTypeSchema=_x,u.getDraggableExecutableEntityReferenceSchema=Lx,u.getDraggableExecutableEntityTypeSchema=$x,u.getDraggablePassThroughCallableEntityReferenceSchema=ks,u.getDraggablePassThroughCallableEntityTypeSchema=js,u.getDraggablePlayableEntityReferenceSchema=jx,u.getDraggablePlayableEntityTypeSchema=xx,u.getEntityArgumentDeclarations=Cd,u.getEntityInputMaps=Lv,u.getEntityOutputMaps=O3,u.getEntityReferenceSchema=Wx,u.getEntityReturnDeclarations=Bd,u.getEntityTypeSchema=Jx,u.getEntityWithLogicScopeReferenceSchema=fn,u.getEntityWithLogicScopeTypeSchema=Gx,u.getEntityWithValueReferenceSchema=Nb,u.getEntityWithValueTypeSchema=Cx,u.getEntryPointEntityReferenceSchema=je,u.getEntryPointEntityTypeSchema=$n,u.getEventEntityReferenceSchema=Us,u.getEventEntityTypeSchema=Fs,u.getExecutableEntityReferenceSchema=Vx,u.getExecutableEntityTypeSchema=Nx,u.getExtendedBuiltInEntity=C3,u.getExtendedCustomEntity=kv,u.getGenerationTargetSchemaBasedOnType=pv,u.getHeadIfPartOfDetachedBranch=Jv,u.getHighestScope=Yv,u.getImplementedBuiltInEntity=B3,u.getIsInteractive=Nd,u.getLastInListOperation=Bo,u.getLastInListOperationError=pp,u.getLastInListOperationErrorParentRef=up,u.getLastInListOperationInputListArgument=lp,u.getLastInListOperationInputListArgumentParentRef=op,u.getLastInListOperationInputListArgumentRef=rp,u.getLastInListOperationInputListDataType=ip,u.getLastInListOperationOutputElementDataType=sp,u.getLastInListOperationOutputElementReturn=dp,u.getLastInListOperationOutputElementReturnParentRef=cp,u.getLastInListOperationOutputElementReturnRef=ap,u.getLinkedEntitiesFromArgumentDeclaration=I3,u.getLowestPersistedEntityImplementation=jv,u.getParentCanvasEntities=Tt,u.getParentCanvasEntity=He,u.getParentEntryPoint=T3,u.getPassThroughCallableEntityReferenceSchema=le,u.getPassThroughCallableEntityTypeSchema=xs,u.getPlayableEntityReferenceSchema=Ux,u.getPlayableEntityTypeSchema=Fx,u.getProject=H3,u.getPrototypeByType=mo,u.getReferenceEntityId=O,u.getReferencedEntitiesStateOrErrors=io,u.getReferencedEntityStateOrErrors=Td,u.getRelatedCanvasElementsOnTheLeft=Or,u.getRelatedCanvasElementsOnTheRight=jn,u.getRootEntryPointScopeOwner=Ld,u.getScopeOwner=Et,u.getTerminationReferenceSchema=qx,u.getTerminationTypeSchema=kx,u.getUsedArgFromDeclaration=A3,u.getUsedReturnFromDeclaration=S3,u.getValueReadingEntityReferenceSchema=Mb,u.getValueReadingEntityTypeSchema=hn,u.getValueWritingEntityReferenceSchema=Ox,u.getValueWritingEntityTypeSchema=ia,u.getVariableFromInputMapping=Sv,u.getVariableFromReturnVariablePointer=Bv,u.getVariableReferenceSchema=Vn,u.getVariableTypeSchema=or,u.getVariablesFromArgumentDeclarations=yo,u.getVariablesFromInputMaps=Ov,u.getVariablesFromOutputMapping=wv,u.getVariablesFromOutputMaps=_v,u.getVariablesFromReturnDeclarations=Cv,u.getVariablesInSameOrHigherScope=sd,u.getWrites=Od,u.groupCallsBasedOnParallelizableExecution=b3,u.handleAfterEntityImplementationSideEffects=Pv,u.handleBeforeEntityImplementationSideEffects=Iv,u.httpRequestBodyArgument=Ba,u.httpRequestBodyArgumentRef=xy,u.httpRequestBodyDataType=jy,u.httpRequestHeadersArgument=Ca,u.httpRequestHeadersArgumentRef=Fy,u.httpRequestHeadersDataType=Uy,u.httpRequestMethodArgument=Sa,u.httpRequestMethodArgumentRef=Ly,u.httpRequestMethodDataType=Gy,u.httpRequestMethodDataTypeRef=Vy,u.httpRequestQueryParamsArgument=Go,u.httpRequestQueryParamsArgumentRef=My,u.httpRequestQueryParamsDataType=Ny,u.httpRequestVariableURLArgument=Oa,u.httpRequestVariableURLArgumentRef=wy,u.httpRequestVariableURLDataType=_y,u.httpRequestVariableURLDataTypeRef=Cy,u.httpResponseBodyReturnDataType=Zy,u.httpResponseBodyReturnDataTypeRef=Yy,u.httpResponseBodyReturnReturn=Ti,u.httpResponseBodyReturnReturnRef=zy,u.httpResponseCodeDataType=qy,u.httpResponseCodeReturn=Fo,u.httpResponseCodeReturnRef=ky,u.httpResponseHeadersDataType=Hy,u.httpResponseHeadersDataTypeRef=Jy,u.httpResponseHeadersReturn=wa,u.httpResponseHeadersReturnRef=Wy,u.implement=uo,u.inferArgumentDeclarationDataType=Zg,u.inferDataType=en,u.inferInputMapDataType=Xg,u.inferOutputMapDataType=ev,u.inferReturnDeclarationDataType=ad,u.inferVariableDeclarationDataType=Kg,u.inferVariableInstanceDataType=Qg,u.initProject=eI,u.iterateOverListActionDescriptor=Yn,u.iterateOverListActionDescriptorListArgumentDeclaration=fh,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=yh,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=ph,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=hh,u.iterateOverListActionDescriptorReturnDeclaration=uh,u.iterateOverListActionDescriptorReturnDeclarationParentRef=dh,u.joinListOperation=So,u.joinListOperationError=$u,u.joinListOperationErrorParentRef=Vu,u.joinListOperationFirstListArgument=Bu,u.joinListOperationFirstListArgumentParentRef=Cu,u.joinListOperationFirstListArgumentRef=Iu,u.joinListOperationFirstListDataType=Pu,u.joinListOperationResultListDataType=Ou,u.joinListOperationResultListReturn=Nu,u.joinListOperationResultListReturnParentRef=Mu,u.joinListOperationResultListReturnRef=Su,u.joinListOperationSecondListArgument=_u,u.joinListOperationSecondListArgumentParentRef=wu,u.joinListOperationSecondListArgumentRef=Du,u.joinListOperationSecondListDataType=Au,u.joinListWithLastSeparator=L,u.joinStringOperation=mi,u.joinStringOperationError=Ru,u.joinStringOperationErrorParentRef=Eu,u.joinStringOperationFirstStringArgument=Pa,u.joinStringOperationFirstStringArgumentParentRef=fu,u.joinStringOperationFirstStringArgumentRef=cu,u.joinStringOperationFirstStringDataType=du,u.joinStringOperationResultStringDataType=hu,u.joinStringOperationResultStringReturn=fi,u.joinStringOperationResultStringReturnParentRef=Tu,u.joinStringOperationResultStringReturnRef=yu,u.joinStringOperationSecondStringArgument=Da,u.joinStringOperationSecondStringArgumentParentRef=mu,u.joinStringOperationSecondStringArgumentRef=uu,u.joinStringOperationSecondStringDataType=pu,u.jsonPrototype=Io,u.keyValueParamBuiltInBaseEntity=Ma,u.keyValueParamBuiltInBaseEntityNameProperty=vh,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=dI,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=gh,u.keyValueParamBuiltInBaseEntityNamePropertyRef=bh,u.keyValueParamBuiltInBaseEntityValueProperty=Dh,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=pI,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=Ph,u.keyValueParamBuiltInBaseEntityValuePropertyRef=Ih,u.lowercaseFirstLetter=Hg,u.manualFlowActionDescriptor=xo,u.manualFlowActionDescriptorDeclarationReturnDeclaration=Rh,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=Th,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=mh,u.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=Eh,u.mapActionDescriptorToTypeItRepresents=N3,u.mergeEntityErrorsList=S4,u.mergeListOfEntities=_3,u.methodDefaultValue=$y,u.mockClientProject=db,u.moreThanOrEqualCondition=Vr,u.moreThanOrEqualConditionLeftHandArgument=cm,u.moreThanOrEqualConditionLeftHandArgumentParentRef=lm,u.moreThanOrEqualConditionRightHandArgument=um,u.moreThanOrEqualConditionRightHandArgumentParentRef=dm,u.notEmptyCondition=zn,u.notEmptyConditionArgument=am,u.notEmptyConditionRef=im,u.numberAdditionOperation=Ia,u.numberAdditionOperationError=au,u.numberAdditionOperationErrorParentRef=iu,u.numberAdditionOperationFirstNumberArgument=Po,u.numberAdditionOperationFirstNumberArgumentRef=zd,u.numberAdditionOperationFirstNumberDataType=Zd,u.numberAdditionOperationRef=tu,u.numberAdditionOperationRefThree=ru,u.numberAdditionOperationRefTwo=nu,u.numberAdditionOperationResultNumberDataType=eu,u.numberAdditionOperationResultNumberReturn=Ao,u.numberAdditionOperationResultNumberReturnRef=Kd,u.numberAdditionOperationSecondNumberArgument=Do,u.numberAdditionOperationSecondNumberArgumentRef=Xd,u.numberAdditionOperationSecondNumberDataType=Qd,u.numberPrototype=Se,u.numberValueAutogenerationSchema=nc,u.parallelExecutionOperation=xt,u.parallelExecutionOperationError=Gp,u.parallelExecutionOperationErrorParentRef=Lp,u.parallelExecutionOperationListOfExecutionResultsDataType=Np,u.parallelExecutionOperationListOfExecutionResultsReturn=No,u.parallelExecutionOperationListOfExecutionResultsReturnRef=Mp,u.parallelExecutionOperationListOfFunctionsArgument=Mo,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=_p,u.parallelExecutionOperationListOfFunctionsArgumentRef=wp,u.parallelExecutionOperationListOfFunctionsBlueprint=Bp,u.parallelExecutionOperationRef=Vp,u.parallelExecutionOperationRefThree=$p,u.persistedBuiltInBaseEntity=Ve,u.persistedBuiltInBaseEntityCreatedAtProperty=Hf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=Jf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=AI,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=Wf,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=qf,u.persistedBuiltInBaseEntityDatabaseProperty=bi,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=vI,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=Vf,u.persistedBuiltInBaseEntityDatabasePropertyRef=Nf,u.persistedBuiltInBaseEntityDeletedAtProperty=kf,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=xf,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=DI,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=jf,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=Uf,u.persistedBuiltInBaseEntityIdentifierProperty=Ff,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=$f,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Gf,u.persistedBuiltInBaseEntityIdentifierPropertyRef=Lf,u.persistedBuiltInBaseEntityUpdatedAtProperty=Xf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=zf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=SI,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Zf,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Yf,u.processOutputGlobalValueDescriptorDataType=hm,u.processOutputGlobalValueDescriptorReturn=Ko,u.processOutputGlobalValueDescriptorReturnRef=ym,u.projectPublicationCompletedGlobalEvent=Fa,u.propertyToZodSchema=Cm,u.relationalDatabaseBuiltInBaseEntity=Pn,u.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=Wo,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=Of,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=Cf,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=Sf,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=Jo,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=Df,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=Af,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Va,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=Rf,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=bf,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Ga,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=If,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=Pf,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=La,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=TI,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=vf,u.relationalDatabaseBuiltInBaseEntityRef=Nr,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=$a,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=fI,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=gf,u.resolveActionDescriptorName=cv,u.resolveBaseEntityName=sv,u.resolveBuiltInBaseEntityDataTypeLabel=od,u.resolveConditionOperatorLabel=eo,u.resolveCustomEntityDataTypeLabel=ld,u.resolveDataType=Qs,u.resolveDataTypeLabel=rv,u.resolveEntityDataTypeLabel=av,u.resolveEntityName=P,u.resolveFirstCallsSecond=g3,u.resolveFirstWritesSecond=v3,u.resolvePrimitiveEntityName=lv,u.resolvePropertyDataTypeLabel=iv,u.resolveSearchName=ov,u.resolveVariableDataTypeLabel=p9,u.resolveVariableDeclarationDataTypeLabel=hr,u.resolveVariableInstanceDataTypeLabel=nv,u.resolveVariableScope=c9,u.sequentialExecutionOperation=on,u.sequentialExecutionOperationError=ny,u.sequentialExecutionOperationErrorParentRef=ty,u.sequentialExecutionOperationListOfExecutionResultsDataType=Qp,u.sequentialExecutionOperationListOfExecutionResultsReturn=$o,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=ey,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=Xp,u.sequentialExecutionOperationListOfFunctionsArgument=Vo,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=Zp,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Kp,u.sequentialExecutionOperationListOfFunctionsArgumentRef=zp,u.sequentialExecutionOperationListOfFunctionsBlueprint=Yp,u.softDeletePersistedEntityMethod=_f,u.softDeletePersistedEntityMethodParentRef=wf,u.sortCallsBasedOnExecutionDependencies=Av,u.sortChildrenEntitiesBasedOnExecutionDependencies=R3,u.splitListOperation=Co,u.splitListOperationError=ep,u.splitListOperationErrorParentRef=Ku,u.splitListOperationFirstOutputListDataType=ku,u.splitListOperationFirstOutputListReturn=zu,u.splitListOperationFirstOutputListReturnParentRef=Yu,u.splitListOperationFirstOutputListReturnRef=Oo,u.splitListOperationInputListArgument=Ju,u.splitListOperationInputListArgumentParentRef=qu,u.splitListOperationInputListArgumentRef=Fu,u.splitListOperationInputListDataType=Uu,u.splitListOperationSecondOutputListDataType=Zu,u.splitListOperationSecondOutputListReturn=Qu,u.splitListOperationSecondOutputListReturnParentRef=Xu,u.splitListOperationSplitIndexArgument=Hu,u.splitListOperationSplitIndexArgumentParentRef=Wu,u.splitListOperationSplitIndexArgumentRef=xu,u.splitListOperationSplitIndexDataType=ju,u.stringPrototype=U,u.stringValueAutogenerationSchema=tc,u.suggestNewIdForEntity=hd,u.test_primitive_entities_export=z3,u.toCamelCase=d9,u.toEntityState=Mt,u.toKebabCase=tv,u.toLowerCaseKebabCase=Ks,u.toPascalCase=u9,u.untypedObjectPrototype=Ke,u.updateErrorsList=ee,u.updateValueReader=ba,u.urlDefaultValue=By,u.uuidPrototype=va,u.validateArgumentDeclarationName=pd,u.validateCalledByErrorIdInAction=d3,u.validateCalledByIdInAction=c3,u.validateCallers=Ev,u.validateConditionEntityDeclaration=y3,u.validateCustomEntityName=to,u.validateDataOperation=Hn,u.validateDataOperationDataToValidateArgument=Ry,u.validateDataOperationDataToValidateArgumentParentRef=Ey,u.validateDataOperationDataToValidateArgumentRef=my,u.validateDataOperationDataToValidateDataType=Ty,u.validateDataOperationEntityToMatchTypeArgument=Iy,u.validateDataOperationEntityToMatchTypeArgumentParentRef=vy,u.validateDataOperationEntityToMatchTypeArgumentRef=by,u.validateDataOperationEntityToMatchTypeDataType=gy,u.validateDataOperationError=Sy,u.validateDataOperationErrorParentRef=Ay,u.validateDataOperationOutputEntityDeclaration=Dy,u.validateDataOperationOutputEntityDeclarationParentRef=Py,u.validateEntryCaller=Tv,u.validateErrorCaller=mv,u.validateFunctionCallDeclaration=bv,u.validateFunctionDeclarationName=cd,u.validateGeneratedEntityParentIsNotBuiltInEntity=a3,u.validateGeneration=r3,u.validateGenerationTarget=Oe,u.validateGenerationUpdate=i3,u.validateLoopEntityDeclaration=h3,u.validateName=y9,u.validateOperationEntityDeclaration=gv,u.validatePropertyName=ud,u.validateReachability=bn,u.validateReadsValueInActionPayload=u3,u.validateReferenceObject=ro,u.validateReferenceToOne=Ed,u.validateReferences=Ue,u.validateReturnDeclarationName=yd,u.validateSuccessCaller=fv,u.validateValueReaderGenerationUpdate=Ta,u.validateValueWritter=Pd,u.validateVariableDeclarationName=dd,u.validateVariableInternalCallUse=Dd,u.valueAutogenerationCurrentDateAndTimeSchema=pb,u.valueAutogenerationGenericSchema=Ps,u.valueAutogenerationOptions=ic,u.valueAutogenerationOptionsSchema=ub,u.valueAutogenerationRandomBooleanSchema=ec,u.valueAutogenerationRandomDateBetweenSchema=gb,u.valueAutogenerationRandomDateFromSchema=Rb,u.valueAutogenerationRandomDateSchema=Ss,u.valueAutogenerationRandomDateUntilSchema=bb,u.valueAutogenerationRandomNumberBetweenSchema=fb,u.valueAutogenerationRandomNumberFromSchema=yb,u.valueAutogenerationRandomNumberSchema=Ds,u.valueAutogenerationRandomNumberUntilSchema=hb,u.valueAutogenerationRandomSchema=Xi,u.valueAutogenerationRandomTextBetweenSchema=Eb,u.valueAutogenerationRandomTextFromSchema=mb,u.valueAutogenerationRandomTextSchema=As,u.valueAutogenerationRandomTextUntilSchema=Tb,u.valueAutogenerationRangeValueTypesSchema=Zi,u.valueAutogenerationUniqueSchema=Kl,u.waitOperation=ct,u.waitOperationMillisecondsNumberArgument=Wn,u.waitOperationMillisecondsNumberArgumentRef=xp,u.waitOperationMillisecondsNumberDataType=jp,u.waitOperationOperationError=Jp,u.waitOperationOperationErrorParentRef=qp,u.waitOperationRef=kp,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:r}}get extendedProperties(){return v([...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}--${h.InvalidParentUpdate}`,code:h.InvalidParentUpdate,severity:T.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(){const e=[this];if(this.parent.type===i.DataType){const t=this.parent;t.entity=this,e.push(t)}else this.project.addCustomEntity(this);return{affected:v(e),self: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=>{h8(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)}),f8(this,e).forEach(a=>{const s=`_suggestion--parent--${this.id}--${a.id}`,o=a.implementAsFunctionDeclaration(s),l=R(o,this.project);if(l.suggestion=!0,l.setParent(this),l.initChildren(),l.inputs.forEach(p=>{p.suggestion=!0}),l.returnStatements.length){const p=l.returnStatements[0];p.suggestion=!0,p.outputs.forEach(y=>{y.suggestion=!0})}this.addSuggestedMethod(l)})}),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 r=[],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:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.methods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.abstractMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.suggestedProperties.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),this.suggestedMethods.forEach(s=>{const{affected:o,removed:l}=s.remove({ignoreUpstream:!0,seenEntities:t});r.push(...o),a.push(...l)}),{affected:v(r),removed:v(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(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.methods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.abstractMethods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.suggestedProperties.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),this.suggestedMethods.forEach(r=>{const{affected:a}=r.restore({seenEntities:e});t.push(...a)}),{affected:v(t),self:this})}toFlat(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this,...this.extends.flatMap(r=>r.toFlat(e)),...this.implements.flatMap(r=>r.toFlat(e)),...this.properties.flatMap(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.extends.flatMap(r=>r.toFlatIds(e)),...this.implements.flatMap(r=>r.toFlatIds(e)),...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.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:i.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(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.toFlatJSON(e)),...this.implements.flatMap(r=>r.toFlatJSON(e)),...this.extends.flatMap(r=>r.toFlatJSON(e))])}toGenerationTarget(){const e=this.parent.type===i.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===i.CustomEntity).flatMap(r=>r.toFlatGenerationTarget(e)),...this.implements.filter(r=>r.type===i.CustomEntity).flatMap(r=>r.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=y8(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(e=null,t=null,r=!0){var b,g,A;const a=this.toJSON(),s=t||Ze(P(this,this.project),i.CustomEntity,this.project);a.properties=[],a.methods=[],a.abstractMethods=[];const o=s.split("-id"),l=o[o.length-1||0]||s;a.id=s;const p=Ft(a,this.project);e&&p.setParent(e),r&&p.subscribe(),p.initChildren();const y=(b=this.properties)==null?void 0:b.map((C,$)=>C.clone(this,l+"-property-"+$+"-id",r));p.properties=y;const f=(g=this.methods)==null?void 0:g.map((C,$)=>C.clone(this,l+"-method-"+$+"-id",r));p.methods=f;const m=(A=this.abstractMethods)==null?void 0:A.map((C,$)=>C.clone(this,l+"-abstract-method-"+$+"-id",r));return p.abstractMethods=m,p}getFunctionDeclaration(e){return this.methods.find(t=>t.id===e)}implement(e,t){return uo(this,e,t)}getAllInteractiveMethods(){const e=this.implements.filter(r=>r.type===i.CustomEntity||r.type===i.BuiltInBaseEntity&&r.interactive);return v([...this.methods,...this.extends.flatMap(r=>r.getAllInteractiveMethods()),...e.flatMap(r=>r.getAllInteractiveMethods())])}inferFromInputs(e){if(this.parent.type!==i.DataType||!this.parent.inferred)return this;const t=[];e.forEach(s=>{t.find(l=>P(l,this.project)===P(s,this.project))||t.push(s)});const r=this.properties.filter(s=>!s.getDataType());t.forEach(s=>{const o=r.find(m=>P(m,this.project)===P(s,this.project));if(!o)return;const p=yr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),y=en(p),f=y==null?void 0:y.clone(o,o.id+"--data-type",!0);f&&o.setDataType(f),s.setDeclaration(o)});const a=[];return t.forEach(s=>{if(!s.declaration){a.push(s);return}}),a.length===0?this:(a.forEach(s=>{const o=this.properties.find(g=>P(g,this.project)===P(s,this.project));if(o){if(s.setDeclaration(o),!o.getDataType()){const A=yr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),C=en(A),$=C==null?void 0:C.clone(o,o.id+"--data-type",!0);$&&o.setDataType($)}return}const l={id:s.id+"--inferred-property",type:i.Property,version:1,name:P(s,this.project),description:s.description,static:!0,abstract:!1,private:!1,hidden:!1,required:!1,index:s.index,implements:null,dataType:null,parent:this.toReference()},p=R(l,this.project);p.setParent(this),p.initChildren();const f=yr(s.parent).getMasterInputWithValueWritterFromAllInstances(s),m=en(f),b=m==null?void 0:m.clone(p,l.id+"--data-type",!0);return b&&p.setDataType(b),this.addProperty(p),s.setDeclaration(p),p}),this)}};c(Ie,"MUTABLE_BASE_PROPERTIES",["name","description","static","abstract"]),c(Ie,"INMUTABLE_BASE_PROPERTIES",["id","version","type"]),c(Ie,"BASE_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"MUTABLE_META_PROPERTIES",[...Ie.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Ie,"INMUTABLE_META_PROPERTIES",[...Ie.INMUTABLE_BASE_PROPERTIES]),c(Ie,"META_PROPERTIES",[...Ie.MUTABLE_META_PROPERTIES,...Ie.INMUTABLE_META_PROPERTIES]),c(Ie,"MUTABLE_UPSTREAM_PROPERTIES",["extends","implements"]),c(Ie,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),c(Ie,"UPSTREAM_PROPERTIES",[...Ie.MUTABLE_UPSTREAM_PROPERTIES,...Ie.INMUTABLE_UPSTREAM_PROPERTIES]),c(Ie,"MUTABLE_DOWNSTREAM_PROPERTIES",["properties","methods","abstractMethods"]),c(Ie,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Ie,"DOWNSTREAM_PROPERTIES",[...Ie.MUTABLE_DOWNSTREAM_PROPERTIES,...Ie.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Ie,"PROPERTIES",[...Ie.META_PROPERTIES,...Ie.UPSTREAM_PROPERTIES,...Ie.DOWNSTREAM_PROPERTIES]);let Cr=Ie;function $3(n){const e=q4(),t=n.toJSON();e.safeParse(t).success;const a=[];return ee(n.errors,a)}class Lt{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",i.BuiltInBaseEntity);c(this,"abstract",!1);c(this,"static");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"interactive",!1);c(this,"errors",[]);c(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(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.extends=this.initialData.extends.map(r=>R(r,this.project))}get extendedProperties(){return v(this.extends.reduce((e,t)=>{const r=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...r]},[]))}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(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e)),...this.extends.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.toFlatIds(e)),...this.extends.flatMap(r=>r.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:i.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(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.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=$3(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 Lt(this.toJSON(),this.project)}implement(e,t){return uo(this,e,t)}getAllInteractiveMethods(){const e=[];return this.interactive&&(e.push(...this.methods),this.extends.filter(r=>r.type===i.BuiltInBaseEntity&&r.interactive||r.type===i.PrimitiveEntity).forEach(r=>{r instanceof Lt&&e.push(...r.getAllInteractiveMethods())})),v(e)}}function L3(n){const e=V4(),t=n.toJSON();e.safeParse(t).success;const a=[];return ee(n.errors,a)}class Gt{constructor(e,t){c(this,"initialData");c(this,"id");c(this,"version");c(this,"name");c(this,"description",null);c(this,"type",i.PrimitiveEntity);c(this,"static");c(this,"abstract");c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(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(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.parent=this,a})}get extendedProperties(){return v(this.extends.reduce((e,t)=>{const r=[...t.properties,...t.extendedProperties].filter(a=>!a.abstract);return[...e,...r]},[]))}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(r=>r.toFlat(e)),...this.methods.flatMap(r=>r.toFlat(e)),...this.abstractMethods.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),[this.id,...this.properties.flatMap(r=>r.toFlatIds(e)),...this.methods.flatMap(r=>r.toFlatIds(e)),...this.abstractMethods.flatMap(r=>r.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:i.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(r=>r.toFlatJSON(e)),...this.methods.flatMap(r=>r.toFlatJSON(e)),...this.abstractMethods.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.methods.flatMap(r=>r.toFlatGenerationTarget(e)),...this.abstractMethods.flatMap(r=>r.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=L3(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 Gt(this.toJSON(),this.project)}getAllInteractiveMethods(){const e=[];return e.push(...this.methods),this.extends.filter(r=>r.type===i.BuiltInBaseEntity&&r.interactive||r.type===i.PrimitiveEntity).forEach(r=>{r instanceof Lt&&e.push(...r.getAllInteractiveMethods())}),v(e)}}function Ft(n,e){if(!n)throw new Error("Entity is null");const t=e.findSubscribedInstance(n);switch(n.type){case i.PrimitiveValue:return t||new pi(n,e);case i.CustomEntity:return t||new Cr(n,e);case i.PrimitiveEntity:return t||new Gt(n,e);case i.FunctionDeclaration:return t||new mr(n,e);case i.GlobalEvent:return t||new di(n,e);case i.DataType:return t||new ci(n,e);case i.Property:return t||new fr(n,e);case i.FunctionCall:return t||new Sr(n,e);case i.Condition:return t||new Rr(n,e);case i.Operation:return t||new Tr(n,e);case i.VariableDeclaration:return t||new br(n,e);case i.VariableInstance:return t||new gr(n,e);case i.OutputMap:return t||new Rn(n,e);case i.ReturnDeclaration:return t||new wt(n,e);case i.ArgumentDeclaration:return t||new Dr(n,e);case i.InputMap:return t||new En(n,e);case i.Project:return t||new _(n);case i.InstalledProject:return t||new Ir(n,e);case i.ActionDescriptor:return t||new Ge(n,e);case i.ReturnStatement:return t||new Pr(n,e);case i.Loop:return t||new Er(n,e);case i.Search:return t||new vr(n,e);case i.ValueDescriptor:return t||new Ar(n,e);case i.BuiltInBaseEntity:return t||new Lt(n,e);case i.InternalCall:return t||new ui(n,e);case i.ContinueStatement:return t||new ft(n,e);case i.BreakStatement:return t||new yi(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=Ft(n,e);return t.subscribe(),t}function G3(n,e){if(!n)throw new Error("Entity is null");switch(n.type){case i.PrimitiveValue:return pi.fromGenerationTarget(n,e);case i.CustomEntity:return Cr.fromGenerationTarget(n,e);case i.FunctionDeclaration:return mr.fromGenerationTarget(n,e);case i.GlobalEvent:return di.fromGenerationTarget(n,e);case i.DataType:return ci.fromGenerationTarget(n,e);case i.Property:return fr.fromGenerationTarget(n,e);case i.FunctionCall:return Sr.fromGenerationTarget(n,e);case i.Condition:return Rr.fromGenerationTarget(n,e);case i.Operation:return Tr.fromGenerationTarget(n,e);case i.VariableDeclaration:return br.fromGenerationTarget(n,e);case i.VariableInstance:return gr.fromGenerationTarget(n,e);case i.OutputMap:return Rn.fromGenerationTarget(n,e);case i.ReturnDeclaration:return wt.fromGenerationTarget(n,e);case i.ArgumentDeclaration:return Dr.fromGenerationTarget(n,e);case i.InputMap:return En.fromGenerationTarget(n,e);case i.InstalledProject:return Ir.fromGenerationTarget(n,e);case i.ReturnStatement:return Pr.fromGenerationTarget(n,e);case i.Loop:return Er.fromGenerationTarget(n,e);case i.Search:return vr.fromGenerationTarget(n,e);case i.ActionDescriptor:return Ge.fromGenerationTarget(n,e);case i.ValueDescriptor:return Ar.fromGenerationTarget(n,e);case i.InternalCall:return ui.fromGenerationTarget(n,e);case i.ContinueStatement:return ft.fromGenerationTarget(n,e);case i.BreakStatement:return yi.fromGenerationTarget(n,e);default:throw new Error("Invalid entity type: "+n.type)}}const Z=class Z{constructor(e){c(this,"initialData");c(this,"id");c(this,"version");c(this,"type",i.Project);c(this,"name",null);c(this,"description",null);c(this,"x");c(this,"y");c(this,"entities",[]);c(this,"projects",[]);c(this,"functions",[]);c(this,"events",[]);c(this,"variableDeclarations",[]);c(this,"variableInstances",[]);c(this,"conditions",[]);c(this,"operations",[]);c(this,"functionCalls",[]);c(this,"loops",[]);c(this,"searches",[]);c(this,"primitives",[]);c(this,"builtInBaseEntities",[]);c(this,"operationDeclarations",[]);c(this,"globalEventActionDescriptors",[]);c(this,"loopDeclarations",[]);c(this,"conditionDeclarations",[]);c(this,"valueDescriptors",[]);c(this,"dataTypes",[]);c(this,"project");c(this,"instances",{});c(this,"builtInInstances",{});c(this,"errors",[]);c(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{Z.UUID||(Z.UUID=ds==null?void 0:ds())}catch(t){console.error("Error initializing UUID module",t),Z.UUID={uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:r=>r}}}static injectUUIDModule(e){Z.UUID=e}static validateGenerationTarget(e,t){let r=JSON.parse(JSON.stringify(e));const a=[];return a.push(...Oe(r)),{errors:a,modifiedData:r}}async inject(...e){return await Promise.all(e.map(t=>new Promise(async r=>{await t.init(this),r(null)}))),this}validateGeneratedUpdate(e){return{errors:[],modifiedData:e}}addSelfToProject(){return{affected:v([]),self: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(r=>r.toFlat(e)),...this.functions.flatMap(r=>r.toFlat(e)),...this.events.flatMap(r=>r.toFlat(e)),...this.projects.flatMap(r=>r.toFlat(e)),...this.variableDeclarations.flatMap(r=>r.toFlat(e)),...this.variableInstances.flatMap(r=>r.toFlat(e)),...this.conditions.flatMap(r=>r.toFlat(e)),...this.operations.flatMap(r=>r.toFlat(e)),...this.functionCalls.flatMap(r=>r.toFlat(e)),...this.loops.flatMap(r=>r.toFlat(e)),...this.searches.flatMap(r=>r.toFlat(e))])}toFlatIds(e=new Set){return e.has(this.id)?[]:(e.add(this.id),Array.from(e))}toJSON(){return{id:this.id,version:this.version,type:this.type,name:this.name,description:this.description,entities:this.entities.map(e=>e.toJSON()),functions:this.functions.map(e=>e.toJSON()),events:this.events.map(e=>e.toJSON()),projects:this.projects.map(e=>e.toJSON()),variableDeclarations:this.variableDeclarations.map(e=>e.toJSON()),variableInstances:this.variableInstances.map(e=>e.toJSON()),conditions:this.conditions.map(e=>e.toJSON()),operations:this.operations.map(e=>e.toJSON()),functionCalls:this.functionCalls.map(e=>e.toJSON()),loops:this.loops.map(e=>e.toJSON()),searches:this.searches.map(e=>e.toJSON())}}toReference(){return{id:this.id+"--"+Z.UUID.uuid()+"--ref",type:i.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(r=>r.toFlatJSON(e)),...this.functions.flatMap(r=>r.toFlatJSON(e)),...this.events.flatMap(r=>r.toFlatJSON(e)),...this.projects.flatMap(r=>r.toFlatJSON(e)),...this.variableDeclarations.flatMap(r=>r.toFlatJSON(e)),...this.variableInstances.flatMap(r=>r.toFlatJSON(e)),...this.conditions.flatMap(r=>r.toFlatJSON(e)),...this.operations.flatMap(r=>r.toFlatJSON(e)),...this.functionCalls.flatMap(r=>r.toFlatJSON(e)),...this.loops.flatMap(r=>r.toFlatJSON(e)),...this.searches.flatMap(r=>r.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(r=>r.toFlatGenerationTarget(e)),...this.functions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.events.flatMap(r=>r.toFlatGenerationTarget(e)),...this.projects.flatMap(r=>r.toFlatGenerationTarget(e)),...this.variableDeclarations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.variableInstances.flatMap(r=>r.toFlatGenerationTarget(e)),...this.conditions.flatMap(r=>r.toFlatGenerationTarget(e)),...this.operations.flatMap(r=>r.toFlatGenerationTarget(e)),...this.functionCalls.flatMap(r=>r.toFlatGenerationTarget(e)),...this.loops.flatMap(r=>r.toFlatGenerationTarget(e)),...this.searches.flatMap(r=>r.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=o8(),t=this.toJSON();return e.safeParse(t),this.validateChildren(),{success:!0,error:null,data:t}}validateChildren(){this.entities.forEach(e=>e.validate()),this.projects.forEach(e=>e.validate()),this.functions.forEach(e=>e.validate()),this.events.forEach(e=>e.validate()),this.variableDeclarations.forEach(e=>e.validate()),this.variableInstances.forEach(e=>e.validate()),this.conditions.forEach(e=>e.validate()),this.operations.forEach(e=>e.validate()),this.functionCalls.forEach(e=>e.validate()),this.loops.forEach(e=>e.validate()),this.searches.forEach(e=>e.validate())}getErrors(){return[...this.errors,...this.entities.flatMap(t=>t.getErrors()),...this.projects.flatMap(t=>t.getErrors()),...this.functions.flatMap(t=>t.getErrors()),...this.events.flatMap(t=>t.getErrors()),...this.variableDeclarations.flatMap(t=>t.getErrors()),...this.variableInstances.flatMap(t=>t.getErrors()),...this.conditions.flatMap(t=>t.getErrors()),...this.operations.flatMap(t=>t.getErrors()),...this.functionCalls.flatMap(t=>t.getErrors()),...this.loops.flatMap(t=>t.getErrors()),...this.searches.flatMap(t=>t.getErrors())]}getShallowErrors(){return this.errors}clone(){return new Z(this.toJSON())}getCustomEntity(e){return this.entities.find(t=>t.id===e)||null}addCustomEntityFromTransfer(e){const t=R(e,this);return this.addCustomEntity(t),t}addCustomEntity(e){return this.entities.includes(e)||this.entities.push(e),e}addFunctionDeclarationFromTransfer(e){const t=R(e,this);return this.addFunctionDeclaration(t),t}addFunctionDeclaration(e){return this.functions.includes(e)||this.functions.push(e),e}addFunctionCallFromTransfer(e){const t=R(e,this);return this.addFunctionCall(t),t}addFunctionCall(e){return this.functionCalls.includes(e)||this.functionCalls.push(e),e}addVariableDeclarationFromTransfer(e){const t=R(e,this);return this.addVariableDeclaration(t),t}addVariableDeclaration(e){return this.variableDeclarations.includes(e)||this.variableDeclarations.push(e),e}addVariableInstanceFromTransfer(e){const t=R(e,this);return this.addVariableInstance(t),t}addVariableInstance(e){return this.variableInstances.includes(e)||this.variableInstances.push(e),e}addInstalledProjectFromTransfer(e){const t=R(e,this);return this.addInstalledProject(t),this}addInstalledProject(e){return this.projects.includes(e)||this.projects.push(e),this}addGlobalEventFromTransfer(e){const t=R(e,this);return this.addGlobalEvent(t),this}addGlobalEvent(e){return this.events.includes(e)||this.events.push(e),this}addConditionFromTransfer(e){const t=R(e,this);return this.addCondition(t),this}addCondition(e){return this.conditions.includes(e)||this.conditions.push(e),this}addOperationFromTransfer(e){const t=R(e,this);return this.addOperation(t),this}addOperation(e){return this.operations.includes(e)||this.operations.push(e),this}addLoopFromTransfer(e){const t=R(e,this);return this.addLoop(t),this}addLoop(e){return this.loops.includes(e)||this.loops.push(e),this}addSearchFromTransfer(e){const t=R(e,this);return this.addSearch(t),this}addSearch(e){return this.searches.includes(e)||this.searches.push(e),this}removeCustomEntity(e){const t=this.entities.findIndex(r=>r.id===e.id);if(t>-1){const r=this.entities[t];return this.entities.splice(t,1),r}return null}removeFunctionDeclaration(e){const t=this.functions.findIndex(r=>r.id===e.id);if(t>-1){const r=this.functions[t];return this.functions.splice(t,1),r}return null}removeExternalProject(e){const t=this.projects.findIndex(r=>r.id===e.id);if(t>-1){const r=this.projects[t];return this.projects.splice(t,1),r}return null}removeGlobalEvent(e){const t=this.events.findIndex(r=>r.id===e.id);if(t>-1){const r=this.events[t];return this.events.splice(t,1),r}return null}removeTopLevelVariableDeclaration(e){if(e.type!==i.VariableDeclaration)return null;const t=this.variableDeclarations.findIndex(r=>r.id===e.id);if(t>-1){const r=this.variableDeclarations[t];return this.variableDeclarations.splice(t,1),r}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,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.functionCalls.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.operations.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.loops.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[]),...this.searches.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Condition)]},[])]}getOperations(){return[...this.operations,...this.getEntryPoints().reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.functionCalls.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.conditions.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.loops.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[]),...this.searches.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.Operation)]},[])]}getFunctionCalls(){return[...this.functionCalls,...this.getEntryPoints().reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.conditions.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.operations.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.loops.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[]),...this.searches.reduce((t,r)=>{const a=Pe(r);return[...t,...a.filter(s=>s.type===i.FunctionCall)]},[])]}getVariables(){return[...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.functionCalls.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.conditions.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.operations.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.loops.reduce((t,r)=>{const a=K(r);return[...t,...a]},[]),...this.searches.reduce((t,r)=>{const a=K(r);return[...t,...a]},[])]}getVariableInstances(){return[...this.variableInstances,...this.getEntryPoints().reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.functionCalls.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.conditions.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.operations.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.loops.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[]),...this.searches.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableInstance);return[...t,...s]},[])]}getVariableDeclarations(){return v([...this.variableDeclarations,...this.getEntryPoints().reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.functionCalls.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.conditions.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.operations.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.loops.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[]),...this.searches.reduce((t,r)=>{const s=K(r).filter(o=>o.type===i.VariableDeclaration);return[...t,...s]},[])])}attachOrphanReferences(){const e=this.getVariableInstances(),t=this.getVariableDeclarations();return e.forEach(r=>{if(!r.declaration){const a=r.initialData,s=a.declaration.entityId||a.declaration.id,o=t.find(l=>l.id===s);o&&r.setDeclaration(o)}}),this}getBuiltInPersistedEntity(){return this.builtInBaseEntities.find(e=>e.name===N.PERSISTED_ENTITY)||null}};c(Z,"UUID",{uuid:()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),fromUUID:e=>e}),c(Z,"MUTABLE_BASE_PROPERTIES",["name","description"]),c(Z,"INMUTABLE_BASE_PROPERTIES",["id","type","version"]),c(Z,"BASE_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"MUTABLE_META_PROPERTIES",[...Z.MUTABLE_BASE_PROPERTIES,"x","y"]),c(Z,"INMUTABLE_META_PROPERTIES",[...Z.INMUTABLE_BASE_PROPERTIES]),c(Z,"META_PROPERTIES",[...Z.MUTABLE_META_PROPERTIES,...Z.INMUTABLE_META_PROPERTIES]),c(Z,"MUTABLE_UPSTREAM_PROPERTIES",[]),c(Z,"INMUTABLE_UPSTREAM_PROPERTIES",["primitives","builtInBaseEntities","operationDeclarations","globalEventActionDescriptors","loopDeclarations","builtInInstances"]),c(Z,"UPSTREAM_PROPERTIES",[...Z.MUTABLE_UPSTREAM_PROPERTIES,...Z.INMUTABLE_UPSTREAM_PROPERTIES]),c(Z,"MUTABLE_DOWNSTREAM_PROPERTIES",["entities","projects","functions","events","variableDeclarations","variableInstances","conditions","operations","functionCalls","loops","searches"]),c(Z,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),c(Z,"DOWNSTREAM_PROPERTIES",[...Z.MUTABLE_DOWNSTREAM_PROPERTIES,...Z.INMUTABLE_DOWNSTREAM_PROPERTIES]),c(Z,"PROPERTIES",[...Z.META_PROPERTIES,...Z.UPSTREAM_PROPERTIES,...Z.DOWNSTREAM_PROPERTIES]);let _=Z;class Zv extends Ge{constructor(t){super(Ut,t);c(this,"id",Ae.Parallel);c(this,"name",Ae.Parallel);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",Ut);c(this,"type",i.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=Ut.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=Ut.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=Ut.error?R(Ut.error,this.project):null}}class Xv extends Ge{constructor(t){super(ct,t);c(this,"id",ct.id);c(this,"name",ct.name);c(this,"description",ct.description);c(this,"version",ct.version);c(this,"autoexecutable",!1);c(this,"initialData",ct);c(this,"type",i.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=ct.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=ct.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=ct.error?R(ct.error,this.project):null}}class Qv extends Ge{constructor(t){super(on,t);c(this,"id",Ae.Sequential);c(this,"name",Ae.Sequential);c(this,"description","Execute a list of actions one after the other");c(this,"version",1);c(this,"autoexecutable",!0);c(this,"initialData",on);c(this,"type",i.ActionDescriptor);c(this,"fixedArguments",[]);c(this,"fixedReturns",[]);c(this,"error",null);c(this,"dynamicArgumentTypes",null);c(this,"dynamicReturnTypes",null);c(this,"project");this.project=t,this.fixedArguments=on.fixedArguments.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.fixedReturns=on.fixedReturns.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.error=on.error?R(on.error,this.project):null}}function F3(n){const e=[new Qv(n),new Zv(n),new Xv(n),new Ge(Ei,n),new Ge(_r,n),new Ge(Hn,n),new Ge(Aa,n),new Ge(So,n),new Ge(Bo,n),new Ge(Co,n),new Ge(Ia,n),new Ge(mi,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.operationDeclarations=e,e}class Kv extends Lt{constructor(t){super(Ve,t);c(this,"initialData");c(this,"id",N.PERSISTED_ENTITY);c(this,"version",1);c(this,"name",N.PERSISTED_ENTITY);c(this,"description",Ve.description);c(this,"type",i.BuiltInBaseEntity);c(this,"abstract",Ve.abstract);c(this,"static",Ve.static);c(this,"properties",[]);c(this,"methods",[]);c(this,"abstractMethods",[]);c(this,"extends",[]);c(this,"errors",[]);c(this,"project");this.initialData=Ve,this.project=t,this.id=Ve.id,this.version=Ve.version,this.name=Ve.name,this.static=Ve.static,this.abstract=Ve.abstract,this.properties=this.initialData.properties.map(r=>{const a=R(r,this.project);return a.setParent(this),a.initChildren(),a}),this.methods=this.initialData.methods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.abstractMethods=this.initialData.abstractMethods.map(r=>{const a=R(r,this.project);return a.parent=this,a}),this.extends=this.initialData.extends.map(r=>R(r,this.project))}}function U3(n){const e=[new Kv(n),new Lt(Na,n),new Lt(Dn,n),new Lt(zo,n),new Lt(_a,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.builtInBaseEntities=e,e}function x3(n){const e=[new Gt(U,n),new Gt(vn,n),new Gt(Se,n),new Gt(Ke,n),new Gt(In,n),new Gt(sn,n),new Gt(va,n),new Gt(Io,n)];return e.forEach(t=>{n.subscribeBuiltInInstance(t)}),n.primitives=e,e}function j3(n){const e=[new Ge(Fa,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.globalEventActionDescriptors=e,e}function k3(n){const e=[new Ge(Yn,n),new Ge(xo,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.loopDeclarations=e,e}function q3(n){const e=[new Ar(Ko,n)];return e.forEach(t=>{t.initChildren(),n.subscribeBuiltInInstance(t)}),n.valueDescriptors=e,e}function J3(n){const e=[new Ge(zn,n),new Ge(Vr,n)];return e.forEach(t=>{t.initChildren()}),n.conditionDeclarations=e,e}const Br={},Ro={};async function W3(n,e={}){const t={...db};return t.id=n.id,e.empty?{data:{id:n.id,type:i.Project,version:1,name:null,description:null,projects:[],entities:[],operations:[],functions:[],variableDeclarations:[],variableInstances:[],functionCalls:[],conditions:[],loops:[],searches:[],events:[]}}:{data:t}}function eI(n){const e=new _(n);return x3(e),U3(e),F3(e),j3(e),k3(e),q3(e),J3(e),e.initChildren(),e}async function H3(n,e={}){if(n.id&&Br[n.id])return Br[n.id];if(n.id&&Ro[n.id])return await Ro[n.id],Br[n.id];const t=W3(n,e);n.id&&(Ro[n.id]=t);const r=await t;if(r.data){const a=eI(r.data);return Br[n.id]=a,n.id&&delete Ro[n.id],a}return null}function Y3(n){return Br[n.id]&&delete Br[n.id],null}const z3="test_primitive_entities_export";u.AI_VALUE_CONNECTION_GENERATION_ACTION_EXPLANATION=Id,u.ActionDescriptorState=Ge,u.ActionDescriptorValuesType=F,u.ActionInputMapState=J9,u.ActionOutputMapState=Y9,u.AppendToListOperationInputIds=yp,u.AppendToListOperationOutputIds=hp,u.ArgumentDeclarationState=Dr,u.BREAK_AND_CONTINUE_STATEMENTS_RETURN_DECLARATIONS_EXPLANATION=Rd,u.BUILT_IN_BASE_ENTITY_IDS=J,u.BUILT_IN_ENTITY_TYPES=Mr,u.BaseCanvasDraggableState=C9,u.BaseEntityNames=N,u.BaseState=O9,u.BaseValueDescriptorIds=Lo,u.BreakStatementState=yi,u.BuiltInBaseEntityState=Lt,u.CACHED_PROJECTS_BY_ID=Br,u.CALLABLE_ENTITIES_EXPLANATION=s3,u.CALLABLE_TYPES=gn,u.CALLER_ENTITIES_EXPLANATION=yv,u.CALLER_TYPES=an,u.CALLS_UPDATE_EXPLANATION=Un,u.COMPARISON_CONDITIONS=pm,u.CONDITIONS=wI,u.CUSTOM_ENTITY_OPERATIONS=Oy,u.CallableEntityClass=w9,u.CallerEntityClass=fd,u.ChildEntityState=B9,u.ComparisonOperatorTypes=Be,u.ConditionState=Rr,u.ContinueStatementState=ft,u.CreateNewInputIds=iy,u.CreateNewOutputIds=ay,u.CustomEntityState=Cr,u.DRAGGABLE_CALLABLE_TYPES=go,u.DRAGGABLE_CALLER_TYPES=Ud,u.DRAGGABLE_ELEMENT_TYPES=vo,u.DRAGGABLE_EXECUTABLE_TYPES=aI,u.DRAGGABLE_PASS_THROUGH_CALLABLE_TYPES=bo,u.DataTypeCompatibilityTypes=$t,u.DataTypeParentChildRelation=qe,u.DataTypeState=ci,u.ENTITIES_WITH_VALLUES_EXPLANATION=ao,u.ENTITY_TYPES=sI,u.ENTITY_WITH_LOGIC_SCOPE_TYPES=lt,u.ENTITY_WITH_NAMES_TYPES=xd,u.ENTITY_WITH_VALUE_TYPES=Fd,u.ENTRY_POINT_ENTITIES_EXPLANATION=ma,u.ENTRY_POINT_TYPES=we,u.EVENT_TYPES=wr,u.EXECUTABLE_TYPES=iI,u.EXECUTION_OPERATIONS=ry,u.EntityError=ir,u.EntityErrorSeverity=T,u.EntityGenerationError=E,u.EntityGenerationErrorCode=h,u.EntityInstanceErrorCode=B,u.EntityOperations=Qe,u.EntityType=i,u.EntityWithLogicScopeClass=V9,u.EntityWithValueClass=N9,u.EntryPointEntityClass=M9,u.ExecutionOperations=Ae,u.FunctionCallState=Sr,u.FunctionDeclarationState=mr,u.GLOBAL_EVENT_DECLARATIONS=MI,u.GetLastInListOperationInputIds=tp,u.GetLastInListOperationOutputIds=np,u.GlobalEventNames=rn,u.GlobalEventState=di,u.HTTPOperations=Ye,u.HTTP_OPERATIONS=lh,u.InputMapState=En,u.InstalledProjectState=Ir,u.InternalCallState=ui,u.JoinListOperationInputIds=gu,u.JoinListOperationOutputIds=vu,u.JoinStringOperationInputIds=ou,u.JoinStringOperationOutputIds=lu,u.LIST_OPERATIONS=Sp,u.ListOperations=k,u.LoopState=Er,u.LoopTypes=Q,u.NON_INTERACTIVE_BASE_ENTITIES_EXPLANATION=xn,u.NUMBER_OPERATIONS=su,u.NumberAdditionOperationInputIds=Hd,u.NumberAdditionOperationOutputIds=Yd,u.NumberOperations=ot,u.OPERATION_DECLARATIONS=lI,u.OperationState=Tr,u.OutputMapParentChildRelation=Gd,u.OutputMapState=Rn,u.PARENT_AUTO_CALCULATION_FROM_CALLER_EXPLANATION=so,u.PASS_THROUGH_CALLABLE_ENTITIES_EXPLANATION=Fn,u.PASS_THROUGH_CALLABLE_TYPES=Ne,u.PROPERTY_NOT_VALUE_READER_WRITTER_EXPLANATION=vd,u.ParallelExecutionOperation=Zv,u.ParallelExecutionOperationInputIds=Op,u.ParallelExecutionOperationOutputIds=Cp,u.PassThroughCallableEntityClass=_9,u.PersistedEntity=Kv,u.PersistedEntityMethods=At,u.PrimitiveEntityState=Gt,u.PrimitiveTypes=D,u.PrimitiveValueState=pi,u.ProjectState=_,u.PropertyState=fr,u.RETURN_STATEMENT_RETURN_DECLARATIONS_EXPLANATION=o3,u.ReturnDeclarationState=wt,u.ReturnStatementState=Pr,u.STANDALONE_CONDITIONS=sm,u.STRING_OPERATIONS=bu,u.ScopeCompatibilityType=Eo,u.SearchState=vr,u.SequentialExecutionOperation=Qv,u.SequentialExecutionOperationInputIds=Wp,u.SequentialExecutionOperationOutputIds=Hp,u.SharedEntityErrorCode=I,u.SharedStateFunctionality=dv,u.SplitListOperationInputIds=Lu,u.SplitListOperationOutputIds=Gu,u.StandaloneOperatorTypes=_t,u.StringOperations=De,u.TERMINATION_TYPES=Me,u.USER_MANAGED_ENTITY_TYPES=oI,u.UserManagedEntityStateFunctionality=S9,u.VALUE_READING_ENTITIES_EXPLANATION=gd,u.VALUE_READING_TYPES=Jn,u.VALUE_WRITING_ENTITIES_EXPLANATION=hv,u.VALUE_WRITING_TYPES=_e,u.VARIABLE_DATA_TYPE_INFERRANCE_EXPLANATION=bd,u.VARIABLE_TYPES=Fe,u.ValidationInputIds=hy,u.ValidationOutputIds=fy,u.ValueAutogenerationType=xe,u.ValueDescriptorParentChildRelation=w,u.ValueDescriptorState=Ar,u.ValueReadingEntityClass=ha,u.ValueWritingEntityClass=fa,u.VariableDeclarationState=br,u.VariableInputMapState=q9,u.VariableInstanceState=gr,u.VariableOutputMapState=H9,u.WaitOperation=Xv,u.WaitOperationInputIds=Fp,u.WaitOperationOutputIds=Up,u._VALUE_READING_TYPES=nI,u._VALUE_WRITING_TYPES=rI,u.appendToListOperation=Aa,u.appendToListOperationElementToAppendArgument=Mo,u.appendToListOperationElementToAppendArgumentParentRef=vp,u.appendToListOperationElementToAppendArgumentRef=Tp,u.appendToListOperationError=Ap,u.appendToListOperationErrorParentRef=Pp,u.appendToListOperationListArgument=wo,u.appendToListOperationListArgumentParentRef=gp,u.appendToListOperationListArgumentRef=fp,u.appendToListOperationListDataType=mp,u.appendToListOperationResultListDataType=bp,u.appendToListOperationResultListReturn=Dp,u.appendToListOperationResultListReturnParentRef=Ip,u.appendToListOperationResultListReturnRef=Rp,u.appendToListOperationSecondListDataType=Ep,u.asGenerationActionExample=tn,u.baseHttpRequestFunctionDeclaration=Ei,u.baseHttpRequestFunctionDeclarationErrorValueDescriptor=Uo,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorDatatype=oh,u.baseHttpRequestFunctionDeclarationErrorValueDescriptorRef=sh,u.baseHttpRequestFunctionDeclarationRef=nh,u.baseHttpRequestFunctionDeclarationRefEight=ih,u.baseHttpRequestFunctionDeclarationRefFive=eh,u.baseHttpRequestFunctionDeclarationRefFour=Ky,u.baseHttpRequestFunctionDeclarationRefNine=ah,u.baseHttpRequestFunctionDeclarationRefSeven=rh,u.baseHttpRequestFunctionDeclarationRefSix=th,u.baseHttpRequestFunctionDeclarationRefThree=Qy,u.baseHttpRequestFunctionDeclarationRefTwo=Xy,u.booleanPrototype=vn,u.capitalizeFirstLetter=Xs,u.checkAreCustomEntitiesCompatibleAsDataType=zg,u.checkAreDataTypesCompatible=Jt,u.checkArePropertiesCompatibleAsDataType=Yg,u.checkIsBranchDependentButNotDirectlyOnBranch=Ea,u.checkIsBranchDependentOnBranch=m3,u.checkIsCallableEntityReachable=ga,u.checkIsCanvasEntity=_3,u.checkIsDetachedBranch=qv,u.checkIsDetachedBranchShallow=$d,u.checkIsGlobalVariable=w3,u.checkIsGloballyDeclared=Vd,u.checkIsMethod=Hv,u.checkIsNestedScope=To,u.checkScopeCompatibility=Ra,u.createEntityError=q,u.createNewInstanceOperation=_r,u.createNewInstanceOperationEntityToInstanciateArgument=cy,u.createNewInstanceOperationEntityToInstanciateArgumentRef=sy,u.createNewInstanceOperationEntityToInstanciateDataType=oy,u.createNewInstanceOperationError=yy,u.createNewInstanceOperationErrorParentRef=py,u.createNewInstanceOperationOutputEntityDeclaration=uy,u.createNewInstanceOperationOutputEntityDeclarationParentRef=dy,u.createNewInstanceOperationRef=ly,u.createSemanticId=Ze,u.createStateFromGenerationTargetType=G3,u.createStateFromType=Ft,u.createStateFromTypeAndSubscribe=R,u.cronJobBuiltInBaseEntity=zo,u.cronJobBuiltInBaseEntityExpressionProperty=nm,u.cronJobBuiltInBaseEntityExpressionPropertyDataTypeRef=OI,u.cronJobBuiltInBaseEntityExpressionPropertyRef=em,u.cronJobBuiltInBaseEntityRef=tm,u.cronJobTriggeredFunctionDeclarationBlueprint=Yo,u.cronJobTriggeredFunctionDeclarationBlueprintParentRef=Qf,u.customEntityToZodSchema=Bm,u.dataTypeCompatibilityToErrorExplanation=vv,u.datePrototype=sn,u.dateValueAutogenerationSchema=rc,u.deletePersistedEntityMethod=Ho,u.deletePersistedEntityMethodParentRef=Bf,u.deleteRootProject=Y3,u.endpointBuiltInBaseEntity=Na,u.endpointBuiltInBaseEntityRef=Ch,u.endpointBuiltInBaseEntityRefFour=Ef,u.endpointBuiltInBaseEntityRefThree=Gh,u.endpointBuiltInBaseEntityRefTwo=Nh,u.endpointBuiltInCorsProperty=Bh,u.endpointBuiltInCorsPropertyDataType=Oh,u.endpointBuiltInCorsPropertyDataTypeRef=Ah,u.endpointBuiltInCorsPropertyRef=Sh,u.endpointBuiltInMethodProperty=ko,u.endpointBuiltInMethodPropertyDataType=Lh,u.endpointBuiltInMethodPropertyDataTypeRef=Vh,u.endpointBuiltInMethodPropertyRef=$h,u.endpointBuiltInPathProperty=jo,u.endpointBuiltInPathPropertyDataType=_h,u.endpointBuiltInPathPropertyDataTypeRef=wh,u.endpointBuiltInPathPropertyRef=Mh,u.endpointPathParamsArgumentDeclaration=Kh,u.endpointPathParamsArgumentDeclarationRef=Yh,u.endpointPathParamsVariableDataType=zh,u.endpointPathParamsVariableDataTypeRef=Hh,u.endpointReachedTriggerActionDescriptor=qo,u.endpointReachedTriggerActionDescriptorRef=Zh,u.endpointReachedTriggerActionDescriptorRefFour=nf,u.endpointReachedTriggerActionDescriptorRefThree=ef,u.endpointReachedTriggerActionDescriptorRefTwo=Qh,u.endpointRequestBodyArgumentDeclaration=rf,u.endpointRequestBodyArgumentDeclarationRef=jh,u.endpointRequestBodyVariableDataType=kh,u.endpointRequestHeadersArgumentDeclaration=Xh,u.endpointRequestHeadersArgumentDeclarationRef=Uh,u.endpointRequestHeadersVariableDataType=xh,u.endpointRequestHeadersVariableDataTypeRef=Fh,u.endpointRequestQueryParamsArgumentDeclaration=tf,u.endpointRequestQueryParamsArgumentDeclarationRef=Jh,u.endpointRequestQueryParamsVariableDataType=Wh,u.endpointRequestQueryParamsVariableDataTypeRef=qh,u.endpointResponseBodyDataType=ff,u.endpointResponseBodyReturnDeclaration=Tf,u.endpointResponseBodyReturnDeclarationRef=hf,u.endpointResponseCodeDataType=sf,u.endpointResponseCodeReturnDeclaration=lf,u.endpointResponseCodeReturnDeclarationRef=af,u.endpointResponseHeadersDataType=uf,u.endpointResponseHeadersDataTypeRef=cf,u.endpointResponseHeadersReturnDeclaration=yf,u.endpointResponseHeadersReturnDeclarationRef=df,u.endpointReturnStatementRef=of,u.endpointReturnStatementRefThree=mf,u.endpointReturnStatementRefTwo=pf,u.enumOptionsProperty=Wd,u.enumOptionsPropertyDataType=qd,u.enumOptionsPropertyDataTypeRef=jd,u.enumOptionsPropertyRef=kd,u.enumPrototype=In,u.enumPrototypeRef=Jd,u.executionBuiltInEntity=Xo,u.executionBuiltInEntityAbortMethod=Zo,u.executionBuiltInEntityAbortMethodParentRef=rm,u.filterOutDuplicateEntities=v,u.filterOutDuplicateErrors=A4,u.findReferenceToSelfInList=$v,u.findReferencesToSelfInProject=P3,u.flattenCalls=nn,u.flattenCanvasAncestorsUntil=po,u.flattenCustomEntityExtensionAndImplementationTypes=xv,u.flattenCustomEntityExtensionTypes=fo,u.flattenCustomEntityExtensions=Md,u.flattenCustomEntityImplementations=_d,u.flattenCustomEntityImplementionTypes=ho,u.flattenDerivedCanvasEntities=Pt,u.flattenDetachedBranch=Wv,u.flattenElementCalls=Pe,u.flattenElementCallsOnTheSameScope=D3,u.flattenProjectElements=Vv,u.flattenRelatedCanvasElementsOnTheLeft=Uv,u.flattenRelatedCanvasElementsOnTheRight=Fv,u.flattenVariableReads=Nv,u.flattenVariableWrites=_v,u.flattenVariables=K,u.fromZodParseToEntityGenerationErrors=md,u.generate=OP,u.generateActionExample=l3,u.generateExecutionDataType=l9,u.generateMutablePropertiesExplanation=no,u.generateRandomBoolean=nT,u.generateRandomDate=Nm,u.generateRandomDateAfter=wm,u.generateRandomDateBefore=Mm,u.generateRandomDateBetweenRange=_m,u.generateRandomNumber=Xm,u.generateRandomNumberAfter=Ym,u.generateRandomNumberBefore=zm,u.generateRandomNumberBetweenRange=Zm,u.generateRandomText=tT,u.generateRandomTextAfter=Qm,u.generateRandomTextBefore=Km,u.generateRandomTextBetweenRange=eT,u.generateUniqueUUID=Hm,u.getAllActionDescriptorsForConditions=co,u.getAllActionDescriptorsForGlobalEvents=oo,u.getAllActionDescriptorsForLoops=lo,u.getAllActionDescriptorsForOperations=p3,u.getAllGloballyDeclaredFunctionDeclarationsExplanation=Rv,u.getBaseBuiltInEntities=kn,u.getBaseSchemaBasedOnType=uv,u.getBuiltInEntityOwner=qn,u.getCallableEntityReferenceSchema=ke,u.getCallableEntityTypeSchema=Vb,u.getCallerEntityReferenceSchema=wx,u.getCallerEntityTypeSchema=Bx,u.getCalls=Sd,u.getCanvasEntitiesDerivedFromInternalCalls=Gv,u.getCanvasEntitiesDerivedFromWrites=hi,u.getCanvasEntityDerivedFromValueReadingEntity=wd,u.getCanvasEntityReferenceSchema=Yx,u.getCanvasEntityTypeSchema=Hx,u.getChildrenEntityWithValues=E3,u.getCommonAncestor=Ad,u.getCommonChildren=Pv,u.getDeclaration=yr,u.getDeepestScope=zv,u.getDraggableCallableEntityReferenceSchema=Lb,u.getDraggableCallableEntityTypeSchema=$b,u.getDraggableCallerEntityReferenceSchema=_x,u.getDraggableCallerEntityTypeSchema=Mx,u.getDraggableExecutableEntityReferenceSchema=Lx,u.getDraggableExecutableEntityTypeSchema=$x,u.getDraggablePassThroughCallableEntityReferenceSchema=ks,u.getDraggablePassThroughCallableEntityTypeSchema=js,u.getDraggablePlayableEntityReferenceSchema=jx,u.getDraggablePlayableEntityTypeSchema=xx,u.getEntityArgumentDeclarations=Cd,u.getEntityInputMaps=Lv,u.getEntityOutputMaps=O3,u.getEntityReferenceSchema=Wx,u.getEntityReturnDeclarations=Bd,u.getEntityTypeSchema=Jx,u.getEntityWithLogicScopeReferenceSchema=fn,u.getEntityWithLogicScopeTypeSchema=Gx,u.getEntityWithValueReferenceSchema=Nb,u.getEntityWithValueTypeSchema=Cx,u.getEntryPointEntityReferenceSchema=je,u.getEntryPointEntityTypeSchema=$n,u.getEventEntityReferenceSchema=Us,u.getEventEntityTypeSchema=Fs,u.getExecutableEntityReferenceSchema=Vx,u.getExecutableEntityTypeSchema=Nx,u.getExtendedBuiltInEntity=C3,u.getExtendedCustomEntity=kv,u.getGenerationTargetSchemaBasedOnType=pv,u.getHeadIfPartOfDetachedBranch=Jv,u.getHighestScope=Yv,u.getImplementedBuiltInEntity=B3,u.getIsInteractive=Nd,u.getLastInListOperation=Bo,u.getLastInListOperationError=pp,u.getLastInListOperationErrorParentRef=up,u.getLastInListOperationInputListArgument=lp,u.getLastInListOperationInputListArgumentParentRef=op,u.getLastInListOperationInputListArgumentRef=rp,u.getLastInListOperationInputListDataType=ip,u.getLastInListOperationOutputElementDataType=sp,u.getLastInListOperationOutputElementReturn=dp,u.getLastInListOperationOutputElementReturnParentRef=cp,u.getLastInListOperationOutputElementReturnRef=ap,u.getLinkedEntitiesFromArgumentDeclaration=I3,u.getLowestPersistedEntityImplementation=jv,u.getParentCanvasEntities=mt,u.getParentCanvasEntity=He,u.getParentEntryPoint=T3,u.getPassThroughCallableEntityReferenceSchema=le,u.getPassThroughCallableEntityTypeSchema=xs,u.getPlayableEntityReferenceSchema=Ux,u.getPlayableEntityTypeSchema=Fx,u.getProject=H3,u.getPrototypeByType=mo,u.getReferenceEntityId=O,u.getReferencedEntitiesStateOrErrors=io,u.getReferencedEntityStateOrErrors=Td,u.getRelatedCanvasElementsOnTheLeft=Or,u.getRelatedCanvasElementsOnTheRight=jn,u.getRootEntryPointScopeOwner=Ld,u.getScopeOwner=Tt,u.getTerminationReferenceSchema=qx,u.getTerminationTypeSchema=kx,u.getUsedArgFromDeclaration=A3,u.getUsedReturnFromDeclaration=S3,u.getValueReadingEntityReferenceSchema=_b,u.getValueReadingEntityTypeSchema=hn,u.getValueWritingEntityReferenceSchema=Ox,u.getValueWritingEntityTypeSchema=ia,u.getVariableFromInputMapping=Sv,u.getVariableFromReturnVariablePointer=Bv,u.getVariableReferenceSchema=Vn,u.getVariableTypeSchema=or,u.getVariablesFromArgumentDeclarations=yo,u.getVariablesFromInputMaps=Ov,u.getVariablesFromOutputMapping=wv,u.getVariablesFromOutputMaps=Mv,u.getVariablesFromReturnDeclarations=Cv,u.getVariablesInSameOrHigherScope=sd,u.getWrites=Od,u.groupCallsBasedOnParallelizableExecution=b3,u.handleAfterEntityImplementationSideEffects=Dv,u.handleBeforeEntityImplementationSideEffects=Iv,u.httpRequestBodyArgument=Ba,u.httpRequestBodyArgumentRef=xy,u.httpRequestBodyDataType=jy,u.httpRequestHeadersArgument=Ca,u.httpRequestHeadersArgumentRef=Fy,u.httpRequestHeadersDataType=Uy,u.httpRequestMethodArgument=Sa,u.httpRequestMethodArgumentRef=Ly,u.httpRequestMethodDataType=Gy,u.httpRequestMethodDataTypeRef=Vy,u.httpRequestQueryParamsArgument=Go,u.httpRequestQueryParamsArgumentRef=_y,u.httpRequestQueryParamsDataType=Ny,u.httpRequestVariableURLArgument=Oa,u.httpRequestVariableURLArgumentRef=wy,u.httpRequestVariableURLDataType=My,u.httpRequestVariableURLDataTypeRef=Cy,u.httpResponseBodyReturnDataType=Zy,u.httpResponseBodyReturnDataTypeRef=Yy,u.httpResponseBodyReturnReturn=Ti,u.httpResponseBodyReturnReturnRef=zy,u.httpResponseCodeDataType=qy,u.httpResponseCodeReturn=Fo,u.httpResponseCodeReturnRef=ky,u.httpResponseHeadersDataType=Hy,u.httpResponseHeadersDataTypeRef=Jy,u.httpResponseHeadersReturn=wa,u.httpResponseHeadersReturnRef=Wy,u.implement=uo,u.inferArgumentDeclarationDataType=Zg,u.inferDataType=en,u.inferInputMapDataType=Xg,u.inferOutputMapDataType=ev,u.inferReturnDeclarationDataType=ad,u.inferVariableDeclarationDataType=Kg,u.inferVariableInstanceDataType=Qg,u.initProject=eI,u.iterateOverListActionDescriptor=Yn,u.iterateOverListActionDescriptorListArgumentDeclaration=fh,u.iterateOverListActionDescriptorListArgumentDeclarationDataType=yh,u.iterateOverListActionDescriptorListArgumentDeclarationDataTypeParentRef=ph,u.iterateOverListActionDescriptorListArgumentDeclarationParentRef=hh,u.iterateOverListActionDescriptorReturnDeclaration=uh,u.iterateOverListActionDescriptorReturnDeclarationParentRef=dh,u.joinListOperation=So,u.joinListOperationError=$u,u.joinListOperationErrorParentRef=Vu,u.joinListOperationFirstListArgument=Bu,u.joinListOperationFirstListArgumentParentRef=Cu,u.joinListOperationFirstListArgumentRef=Iu,u.joinListOperationFirstListDataType=Du,u.joinListOperationResultListDataType=Ou,u.joinListOperationResultListReturn=Nu,u.joinListOperationResultListReturnParentRef=_u,u.joinListOperationResultListReturnRef=Su,u.joinListOperationSecondListArgument=Mu,u.joinListOperationSecondListArgumentParentRef=wu,u.joinListOperationSecondListArgumentRef=Pu,u.joinListOperationSecondListDataType=Au,u.joinListWithLastSeparator=L,u.joinStringOperation=mi,u.joinStringOperationError=Ru,u.joinStringOperationErrorParentRef=Eu,u.joinStringOperationFirstStringArgument=Da,u.joinStringOperationFirstStringArgumentParentRef=fu,u.joinStringOperationFirstStringArgumentRef=cu,u.joinStringOperationFirstStringDataType=du,u.joinStringOperationResultStringDataType=hu,u.joinStringOperationResultStringReturn=fi,u.joinStringOperationResultStringReturnParentRef=Tu,u.joinStringOperationResultStringReturnRef=yu,u.joinStringOperationSecondStringArgument=Pa,u.joinStringOperationSecondStringArgumentParentRef=mu,u.joinStringOperationSecondStringArgumentRef=uu,u.joinStringOperationSecondStringDataType=pu,u.jsonPrototype=Io,u.keyValueParamBuiltInBaseEntity=_a,u.keyValueParamBuiltInBaseEntityNameProperty=vh,u.keyValueParamBuiltInBaseEntityNamePropertyDataTypeRef=dI,u.keyValueParamBuiltInBaseEntityNamePropertyParentRef=gh,u.keyValueParamBuiltInBaseEntityNamePropertyRef=bh,u.keyValueParamBuiltInBaseEntityValueProperty=Ph,u.keyValueParamBuiltInBaseEntityValuePropertyDataTypeRef=pI,u.keyValueParamBuiltInBaseEntityValuePropertyParentRef=Dh,u.keyValueParamBuiltInBaseEntityValuePropertyRef=Ih,u.lowercaseFirstLetter=Hg,u.manualFlowActionDescriptor=xo,u.manualFlowActionDescriptorDeclarationReturnDeclaration=Rh,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataType=Th,u.manualFlowActionDescriptorDeclarationReturnDeclarationDataTypeParentRef=mh,u.manualFlowActionDescriptorDeclarationReturnDeclarationParentRef=Eh,u.mapActionDescriptorToTypeItRepresents=N3,u.mergeEntityErrorsList=S4,u.mergeListOfEntities=M3,u.methodDefaultValue=$y,u.mockClientProject=db,u.moreThanOrEqualCondition=Vr,u.moreThanOrEqualConditionLeftHandArgument=cm,u.moreThanOrEqualConditionLeftHandArgumentParentRef=lm,u.moreThanOrEqualConditionRightHandArgument=um,u.moreThanOrEqualConditionRightHandArgumentParentRef=dm,u.notEmptyCondition=zn,u.notEmptyConditionArgument=am,u.notEmptyConditionRef=im,u.numberAdditionOperation=Ia,u.numberAdditionOperationError=au,u.numberAdditionOperationErrorParentRef=iu,u.numberAdditionOperationFirstNumberArgument=Do,u.numberAdditionOperationFirstNumberArgumentRef=zd,u.numberAdditionOperationFirstNumberDataType=Zd,u.numberAdditionOperationRef=tu,u.numberAdditionOperationRefThree=ru,u.numberAdditionOperationRefTwo=nu,u.numberAdditionOperationResultNumberDataType=eu,u.numberAdditionOperationResultNumberReturn=Ao,u.numberAdditionOperationResultNumberReturnRef=Kd,u.numberAdditionOperationSecondNumberArgument=Po,u.numberAdditionOperationSecondNumberArgumentRef=Xd,u.numberAdditionOperationSecondNumberDataType=Qd,u.numberPrototype=Se,u.numberValueAutogenerationSchema=nc,u.parallelExecutionOperation=Ut,u.parallelExecutionOperationError=Gp,u.parallelExecutionOperationErrorParentRef=Lp,u.parallelExecutionOperationListOfExecutionResultsDataType=Np,u.parallelExecutionOperationListOfExecutionResultsReturn=No,u.parallelExecutionOperationListOfExecutionResultsReturnRef=_p,u.parallelExecutionOperationListOfFunctionsArgument=_o,u.parallelExecutionOperationListOfFunctionsArgumentDatatype=Mp,u.parallelExecutionOperationListOfFunctionsArgumentRef=wp,u.parallelExecutionOperationListOfFunctionsBlueprint=Bp,u.parallelExecutionOperationRef=Vp,u.parallelExecutionOperationRefThree=$p,u.persistedBuiltInBaseEntity=Ve,u.persistedBuiltInBaseEntityCreatedAtProperty=Hf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataType=Jf,u.persistedBuiltInBaseEntityCreatedAtPropertyDataTypeRef=AI,u.persistedBuiltInBaseEntityCreatedAtPropertyParentRef=Wf,u.persistedBuiltInBaseEntityCreatedAtPropertyRef=qf,u.persistedBuiltInBaseEntityDatabaseProperty=bi,u.persistedBuiltInBaseEntityDatabasePropertyDataTypeRef=vI,u.persistedBuiltInBaseEntityDatabasePropertyParentRef=Vf,u.persistedBuiltInBaseEntityDatabasePropertyRef=Nf,u.persistedBuiltInBaseEntityDeletedAtProperty=kf,u.persistedBuiltInBaseEntityDeletedAtPropertyDataType=xf,u.persistedBuiltInBaseEntityDeletedAtPropertyDataTypeRef=PI,u.persistedBuiltInBaseEntityDeletedAtPropertyParentRef=jf,u.persistedBuiltInBaseEntityDeletedAtPropertyRef=Uf,u.persistedBuiltInBaseEntityIdentifierProperty=Ff,u.persistedBuiltInBaseEntityIdentifierPropertyDataTypeRef=$f,u.persistedBuiltInBaseEntityIdentifierPropertyParentRef=Gf,u.persistedBuiltInBaseEntityIdentifierPropertyRef=Lf,u.persistedBuiltInBaseEntityUpdatedAtProperty=Xf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataType=zf,u.persistedBuiltInBaseEntityUpdatedAtPropertyDataTypeRef=SI,u.persistedBuiltInBaseEntityUpdatedAtPropertyParentRef=Zf,u.persistedBuiltInBaseEntityUpdatedAtPropertyRef=Yf,u.processOutputGlobalValueDescriptorDataType=hm,u.processOutputGlobalValueDescriptorReturn=Ko,u.processOutputGlobalValueDescriptorReturnRef=ym,u.projectPublicationCompletedGlobalEvent=Fa,u.propertyToZodSchema=Cm,u.relationalDatabaseBuiltInBaseEntity=Dn,u.relationalDatabaseBuiltInBaseEntityAutoscalingProperty=Wo,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyDataTypeRef=Of,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyParentRef=Cf,u.relationalDatabaseBuiltInBaseEntityAutoscalingPropertyRef=Sf,u.relationalDatabaseBuiltInBaseEntityDefaultProperty=Jo,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyDataTypeRef=Pf,u.relationalDatabaseBuiltInBaseEntityDefaultPropertyRef=Af,u.relationalDatabaseBuiltInBaseEntityIdentifierProperty=Va,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyDataTypeRef=Rf,u.relationalDatabaseBuiltInBaseEntityIdentifierPropertyRef=bf,u.relationalDatabaseBuiltInBaseEntityMinSizeProperty=Ga,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyDataTypeRef=If,u.relationalDatabaseBuiltInBaseEntityMinSizePropertyRef=Df,u.relationalDatabaseBuiltInBaseEntityPasswordProperty=La,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyDataTypeRef=TI,u.relationalDatabaseBuiltInBaseEntityPasswordPropertyRef=vf,u.relationalDatabaseBuiltInBaseEntityRef=Nr,u.relationalDatabaseBuiltInBaseEntityUsernameProperty=$a,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyDataTypeRef=fI,u.relationalDatabaseBuiltInBaseEntityUsernamePropertyRef=gf,u.resolveActionDescriptorName=cv,u.resolveBaseEntityName=sv,u.resolveBuiltInBaseEntityDataTypeLabel=od,u.resolveConditionOperatorLabel=eo,u.resolveCustomEntityDataTypeLabel=ld,u.resolveDataType=Qs,u.resolveDataTypeLabel=rv,u.resolveEntityDataTypeLabel=av,u.resolveEntityName=P,u.resolveFirstCallsSecond=g3,u.resolveFirstWritesSecond=v3,u.resolvePrimitiveEntityName=lv,u.resolvePropertyDataTypeLabel=iv,u.resolveSearchName=ov,u.resolveVariableDataTypeLabel=p9,u.resolveVariableDeclarationDataTypeLabel=hr,u.resolveVariableInstanceDataTypeLabel=nv,u.resolveVariableScope=c9,u.sequentialExecutionOperation=on,u.sequentialExecutionOperationError=ny,u.sequentialExecutionOperationErrorParentRef=ty,u.sequentialExecutionOperationListOfExecutionResultsDataType=Qp,u.sequentialExecutionOperationListOfExecutionResultsReturn=$o,u.sequentialExecutionOperationListOfExecutionResultsReturnParentRef=ey,u.sequentialExecutionOperationListOfExecutionResultsReturnRef=Xp,u.sequentialExecutionOperationListOfFunctionsArgument=Vo,u.sequentialExecutionOperationListOfFunctionsArgumentDatatype=Zp,u.sequentialExecutionOperationListOfFunctionsArgumentParentRef=Kp,u.sequentialExecutionOperationListOfFunctionsArgumentRef=zp,u.sequentialExecutionOperationListOfFunctionsBlueprint=Yp,u.softDeletePersistedEntityMethod=Mf,u.softDeletePersistedEntityMethodParentRef=wf,u.sortCallsBasedOnExecutionDependencies=Av,u.sortChildrenEntitiesBasedOnExecutionDependencies=R3,u.splitListOperation=Co,u.splitListOperationError=ep,u.splitListOperationErrorParentRef=Ku,u.splitListOperationFirstOutputListDataType=ku,u.splitListOperationFirstOutputListReturn=zu,u.splitListOperationFirstOutputListReturnParentRef=Yu,u.splitListOperationFirstOutputListReturnRef=Oo,u.splitListOperationInputListArgument=Ju,u.splitListOperationInputListArgumentParentRef=qu,u.splitListOperationInputListArgumentRef=Fu,u.splitListOperationInputListDataType=Uu,u.splitListOperationSecondOutputListDataType=Zu,u.splitListOperationSecondOutputListReturn=Qu,u.splitListOperationSecondOutputListReturnParentRef=Xu,u.splitListOperationSplitIndexArgument=Hu,u.splitListOperationSplitIndexArgumentParentRef=Wu,u.splitListOperationSplitIndexArgumentRef=xu,u.splitListOperationSplitIndexDataType=ju,u.stringPrototype=U,u.stringValueAutogenerationSchema=tc,u.suggestNewIdForEntity=hd,u.test_primitive_entities_export=z3,u.toCamelCase=d9,u.toEntityState=Mt,u.toKebabCase=tv,u.toLowerCaseKebabCase=Ks,u.toPascalCase=u9,u.untypedObjectPrototype=Ke,u.updateErrorsList=ee,u.updateValueReader=ba,u.urlDefaultValue=By,u.uuidPrototype=va,u.validateArgumentDeclarationName=pd,u.validateCalledByErrorIdInAction=d3,u.validateCalledByIdInAction=c3,u.validateCallers=Ev,u.validateConditionEntityDeclaration=y3,u.validateCustomEntityName=to,u.validateDataOperation=Hn,u.validateDataOperationDataToValidateArgument=Ry,u.validateDataOperationDataToValidateArgumentParentRef=Ey,u.validateDataOperationDataToValidateArgumentRef=my,u.validateDataOperationDataToValidateDataType=Ty,u.validateDataOperationEntityToMatchTypeArgument=Iy,u.validateDataOperationEntityToMatchTypeArgumentParentRef=vy,u.validateDataOperationEntityToMatchTypeArgumentRef=by,u.validateDataOperationEntityToMatchTypeDataType=gy,u.validateDataOperationError=Sy,u.validateDataOperationErrorParentRef=Ay,u.validateDataOperationOutputEntityDeclaration=Py,u.validateDataOperationOutputEntityDeclarationParentRef=Dy,u.validateEntryCaller=Tv,u.validateErrorCaller=mv,u.validateFunctionCallDeclaration=bv,u.validateFunctionDeclarationName=cd,u.validateGeneratedEntityParentIsNotBuiltInEntity=a3,u.validateGeneration=r3,u.validateGenerationTarget=Oe,u.validateGenerationUpdate=i3,u.validateLoopEntityDeclaration=h3,u.validateName=y9,u.validateOperationEntityDeclaration=gv,u.validatePropertyName=ud,u.validateReachability=bn,u.validateReadsValueInActionPayload=u3,u.validateReferenceObject=ro,u.validateReferenceToOne=Ed,u.validateReferences=Ue,u.validateReturnDeclarationName=yd,u.validateSuccessCaller=fv,u.validateValueReaderGenerationUpdate=Ta,u.validateValueWritter=Dd,u.validateVariableDeclarationName=dd,u.validateVariableInternalCallUse=Pd,u.valueAutogenerationCurrentDateAndTimeSchema=pb,u.valueAutogenerationGenericSchema=Ds,u.valueAutogenerationOptions=ic,u.valueAutogenerationOptionsSchema=ub,u.valueAutogenerationRandomBooleanSchema=ec,u.valueAutogenerationRandomDateBetweenSchema=gb,u.valueAutogenerationRandomDateFromSchema=Rb,u.valueAutogenerationRandomDateSchema=Ss,u.valueAutogenerationRandomDateUntilSchema=bb,u.valueAutogenerationRandomNumberBetweenSchema=fb,u.valueAutogenerationRandomNumberFromSchema=yb,u.valueAutogenerationRandomNumberSchema=Ps,u.valueAutogenerationRandomNumberUntilSchema=hb,u.valueAutogenerationRandomSchema=Xi,u.valueAutogenerationRandomTextBetweenSchema=Eb,u.valueAutogenerationRandomTextFromSchema=mb,u.valueAutogenerationRandomTextSchema=As,u.valueAutogenerationRandomTextUntilSchema=Tb,u.valueAutogenerationRangeValueTypesSchema=Zi,u.valueAutogenerationUniqueSchema=Kl,u.waitOperation=ct,u.waitOperationMillisecondsNumberArgument=Wn,u.waitOperationMillisecondsNumberArgumentRef=xp,u.waitOperationMillisecondsNumberDataType=jp,u.waitOperationOperationError=Jp,u.waitOperationOperationErrorParentRef=qp,u.waitOperationRef=kp,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|