@elyx-code/project-logic-tree 0.0.7128 → 0.0.7129
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.cjs +1 -1
- package/dist/index.js +6 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -46,7 +46,7 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
|
|
|
46
46
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.
|
|
47
47
|
You shouldn't have to manually update a 'parent' property. The equivalent result is to change its callers, the value writers of its inputs, or the value readers of its outputs.`})),{errors:n,explanations:s,modifiedData:i}}subscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]||(this.detachedDependents[n.entity.id]=n)}),this}unsubscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]&&delete this.detachedDependents[n.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const n=[],s=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);n.push(...h.updated),s.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}onDetachedDependencyRemoved(i,n,s){const c=[],e=[],f=[],h=[];if(n==="loop-parent-field"){const{updated:m,added:T,removed:g}=this.remove({ignoreUpstream:!1},s);c.push(...m),e.push(...T),f.push(...g)}return{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}onDetachedDependencyRestored(i,n,s){const c=[],e=[],f=[],h=[];if(n==="loop-parent-field"){const{updated:m,added:T,removed:g}=this.restore({},s);c.push(...m),e.push(...T),f.push(...g)}return{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}unsubscribeFromDependencies(){var i,n,s,c,e,f,h,m,T,g,b,R,I;return(i=this.parent)==null||i.unsubscribeDependents([{entity:this,field:"loop-parent-field"}]),(c=(s=(n=this.dataType)==null?void 0:n.entity)==null?void 0:s.unsubscribeDependents)==null||c.call(s,[{entity:this,field:"loop-data-type-entity-field"}]),(f=(e=this.dataType)==null?void 0:e.unsubscribeDependents)==null||f.call(e,[{entity:this,field:"loop-data-type-field"}]),(g=(T=(m=(h=this.body)==null?void 0:h.dataType)==null?void 0:m.entity)==null?void 0:T.unsubscribeDependents)==null||g.call(T,[{entity:this,field:"loop-body-data-type-entity-field"}]),(I=(R=(b=this.body)==null?void 0:b.dataType)==null?void 0:R.unsubscribeDependents)==null||I.call(R,[{entity:this,field:"loop-body-data-type-field"}]),this}subscribeToDependencies(){var i,n,s,c,e,f,h,m,T,g,b,R,I;return(i=this.parent)==null||i.subscribeDependents([{entity:this,field:"loop-parent-field"}]),(c=(s=(n=this.dataType)==null?void 0:n.entity)==null?void 0:s.subscribeDependents)==null||c.call(s,[{entity:this,field:"loop-data-type-entity-field"}]),(f=(e=this.dataType)==null?void 0:e.subscribeDependents)==null||f.call(e,[{entity:this,field:"loop-data-type-field"}]),(g=(T=(m=(h=this.body)==null?void 0:h.dataType)==null?void 0:m.entity)==null?void 0:T.subscribeDependents)==null||g.call(T,[{entity:this,field:"loop-body-data-type-entity-field"}]),(I=(R=(b=this.body)==null?void 0:b.dataType)==null?void 0:R.subscribeDependents)==null||I.call(R,[{entity:this,field:"loop-body-data-type-field"}]),this}increaseVersion(i){var n;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((n=this.knownVersions)!=null&&n.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=M.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var n;const i=((n=this.knownVersions)==null?void 0:n.get(this.version))||new Ji(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new Ji(this,this.project);return this.apply(i)}apply(i){const n=this.toMeta();return i.metaSync(n,null),i.inputs=[...this.inputs],i.outputs=[...this.outputs],i.error=this.error,i.successCalls=[...this.successCalls],i.errorCalls=[...this.errorCalls],i.declaration=this.declaration,i.body=this.body,i.calledByEntry=[...this.calledByEntry],i.calledBySuccess=[...this.calledBySuccess],i.calledByError=[...this.calledByError],i.writesValues=[...this.writesValues],i.dataType=this.dataType,i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const n=[],s=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);n.push(this.parent,...f.updated),s.push(...f.added),c.push(...f.removed)}return{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}async restoreVersion(i,n){var m;const s=[],c=[],e=[],f=[];if(this.version===i&&(n!=null&&n.skipIfSameVersion))return{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this};if(!this.knownVersions){const T=new Map;for(const[g,b]of this.knownVersions||new Map){if(T.set(g,b),b.activeVersion=!1,b.knownVersions)for(const[R,I]of b.knownVersions)T.set(R,I);b.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const T=await this.APILoadVersion({},i);if(!T)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new Ji(T,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.inputs=[...h.inputs],this.outputs=[...h.outputs],this.error=h.error,this.successCalls=[...h.successCalls],this.errorCalls=[...h.errorCalls],this.declaration=h.declaration,this.body=h.body,this.calledBySuccess=[...h.calledBySuccess],this.calledByError=[...h.calledByError],this.calledByEntry=[...h.calledByEntry],this.writesValues=[...h.writesValues],this.dataType=h.dataType,this.parent=h.parent,{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this}}updateWithShallowTransfer(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,n),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,this.unsubscribeFromDependencies(),i.parent){const s=he(i.parent),c=this.project.get(s),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(n),c)this.setParent(c,n),this.addSelfToProject(n);else throw n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${s}' that isn't found in the project`)}else throw n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.declaration){const s=he(i.declaration),c=this.project.get(s);c&&this.setDeclaration(c)}if(i.calledByEntry.forEach(s=>{const c=he(s),e=this.project.get(c);e&&(this.addEntryCaller(e,n),e.addCall(this,n))}),[...this.calledByEntry].forEach(s=>{i.calledByEntry.find(e=>he(e)===s.id)||(this.removeCaller(s,n),s.removeCall(this,n))}),i.calledBySuccess.forEach(s=>{const c=he(s),e=this.project.get(c);e&&(this.addSuccessCaller(e,n),e.addSuccessCall(this,n))}),[...this.calledBySuccess].forEach(s=>{i.calledBySuccess.find(e=>he(e)===s.id)||(this.removeCaller(s,n),s.removeCall(this,n))}),i.calledByError.forEach(s=>{const c=he(s),e=this.project.get(c);e&&(this.addErrorCaller(e,n),e.addErrorCall(this,n))}),[...this.calledByError].forEach(s=>{i.calledByError.find(e=>he(e)===s.id)||(this.removeCaller(s,n),s.removeCall(this,n))}),i.dataType){const s=he(i.dataType),c=this.project.get(s);c&&this.setDataType(c,n)}else this.setDataType(null,n);return i.outputs.forEach(s=>{const c=he(s),e=this.project.get(c);e&&(this.addOutput(e,n),e.setParent(this,n))}),[...this.outputs].forEach(s=>{i.outputs.find(e=>he(e)===s.id)||(this.removeOutput(s,n),s.removeFromParent(n))}),i.inputs.forEach(s=>{const c=he(s),e=this.project.get(c);e&&(this.addInput(e,n),e.setParent(this,n))}),[...this.inputs].forEach(s=>{i.inputs.find(e=>he(e)===s.id)||(this.removeInput(s,n),s.removeFromParent(n))}),i.writesValues.forEach(s=>{const c=he(s),e=this.project.get(c);e&&(this.addValueReader(e,n),e.setValueWriter(this,n))}),[...this.writesValues].forEach(s=>{i.writesValues.find(e=>he(e)===s.id)||(this.removeValueReader(s,n),s.setValueWriter(null,n))}),this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithGenerationTarget))){var s,c,e;if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,n),i.parent){const f=he(i.parent),h=this.project.get(f),m=this.parent;if(m&&m.id!==(h==null?void 0:h.id)&&this.removeFromParent(n),h)this.setParent(h,n),this.addSelfToProject(n);else throw n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${f}' that isn't found in the project`)}if(i.declaration){const f=he(i.declaration),h=this.project.get(f);if(h)this.setDeclaration(h);else throw new Error(`${this.type} with id '${this.id}' has a 'declaration' reference '${f}' that isn't found in the project`)}return(s=i.calledByEntry)==null||s.forEach(f=>{const h=he(f),m=this.project.get(h);if(m)this.addEntryCaller(m,n),m.addCall(this,n);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByEntry' reference '${h}' that isn't found in the project`)}),i.calledByEntry&&[...this.calledByEntry].forEach(f=>{var m;((m=i.calledByEntry)==null?void 0:m.find(T=>he(T)===f.id))||(this.removeCaller(f,n),f.removeCall(this,n))}),(c=i.calledBySuccess)==null||c.forEach(f=>{const h=he(f),m=this.project.get(h);if(m)this.addSuccessCaller(m,n),m.addSuccessCall(this,n);else throw new Error(`${this.type} with id '${this.id}' has a 'calledBySuccess' reference '${h}' that isn't found in the project`)}),i.calledBySuccess&&[...this.calledBySuccess].forEach(f=>{var m;((m=i.calledBySuccess)==null?void 0:m.find(T=>he(T)===f.id))||(this.removeCaller(f,n),f.removeCall(this,n))}),(e=i.calledByError)==null||e.forEach(f=>{const h=he(f),m=this.project.get(h);if(m)this.addErrorCaller(m,n),m.addErrorCall(this,n);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByError' reference '${h}' that isn't found in the project`)}),i.calledByError&&[...this.calledByError].forEach(f=>{var m;((m=i.calledByError)==null?void 0:m.find(T=>he(T)===f.id))||(this.removeCaller(f,n),f.removeCall(this,n))}),this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],n=[],s=[],c=[];if(this.initialData.parent){const e=he(this.initialData.parent),f=this.project.get(e);if(f)this.setParent(f,null),i.push(f);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.declaration){const e=he(this.initialData.declaration),f=this.project.get(e);f&&(this.setDeclaration(f),i.push(f))}return this.initialData.calledByEntry.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.addEntryCaller(h,null)}),this.initialData.calledBySuccess.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.addSuccessCaller(h,null)}),this.initialData.calledByError.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.addErrorCaller(h,null)}),{updated:V(i),added:V(n),removed:V(s),affected:V(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];if(this.initialized=!0,this.checkIsSynced())return i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this};const{updated:f,added:h,removed:m}=this.syncChildren(i);return n.push(...f),s.push(...h),c.push(...m),this.inputs.sort((T,g)=>{var b,R;return(T.index??((b=T.declaration)==null?void 0:b.index))-(g.index??((R=g.declaration)==null?void 0:R.index))}),this.outputs.sort((T,g)=>{var b,R;return(T.index??((b=T.declaration)==null?void 0:b.index))-(g.index??((R=g.declaration)==null?void 0:R.index))}),this.errorCalls.length&&!this.catchesError&&this.metaSync({catchesError:!0},i),i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){const n=[this],s=[],c=[],e=[];return this.parent===this.project&&this.project.addLoop(this),this.successCalls.forEach(f=>{f.addSuccessCaller(this,i),n.push(f)}),this.errorCalls.forEach(f=>{f.addErrorCaller(this,i),n.push(f)}),this.calledByEntry.forEach(f=>{f.addCall(this,i),n.push(f)}),this.calledBySuccess.forEach(f=>{f.addSuccessCall(this,i),n.push(f)}),this.calledByError.forEach(f=>{f.addErrorCall(this,i),n.push(f)}),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveInput))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[removeInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.RemoveInput,this.id),this;const s=this.inputs.findIndex(c=>c.id===i.id);return s>-1&&(this.inputs.splice(s,1),n&&(n==null||n.add(this,se.Affected))),n==null||n.attemptAutoclose(P.RemoveInput,this.id),this}addInput(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddInput))){return this.checkCanEdit(this,n)?this.inputs.includes(i)?(n==null||n.attemptAutoclose(P.AddInput,this.id),this):(this.inputs.push(i),n==null||n.add(this,se.Affected),n==null||n.attemptAutoclose(P.AddInput,this.id),this):(oe.Logger.warn(`[addInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.AddInput,this.id),this)}addOutput(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"add-output"))){return this.checkCanEdit(this,n)?this.outputs.includes(i)?(n==null||n.attemptAutoclose("add-output",this.id),this):(this.outputs.push(i),n==null||n.add(this,se.Affected),n==null||n.attemptAutoclose("add-output",this.id),this):(oe.Logger.warn(`[addOutput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose("add-output",this.id),this)}removeOutput(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"remove-output"))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[removeOutput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose("remove-output",this.id),this;const s=this.outputs.findIndex(c=>c.id===i.id);return s>-1&&(this.outputs.splice(s,1),n&&(n==null||n.add(this,se.Affected))),n==null||n.attemptAutoclose("remove-output",this.id),this}setBody(i){return this.body=i,this}detachBody(){return this.body=null,this}addSuccessCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddSuccessCaller)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddSuccessCaller,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddSuccessCaller}-${this.id}--${ze.CannotSuccessCallItself}`,action:P.AddSuccessCaller,owner:this,errorReason:ze.CannotSuccessCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddSuccessCaller})),this.calledBySuccess.find(e=>e.id===i.id)||(this.calledBySuccess.push(i),n==null||n.add(this,se.Updated),s&&ni(this,n)),n==null||n.attemptAutoclose(P.AddSuccessCaller,this.id),this):this}addErrorCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddErrorCaller)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddErrorCaller,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddErrorCaller}-${this.id}--${ze.CannotErrorCallItself}`,action:P.AddErrorCaller,owner:this,errorReason:ze.CannotErrorCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddErrorCaller})),this.calledByError.find(e=>e.id===i.id)||(this.calledByError.push(i),n==null||n.add(this,se.Updated),s&&ni(this,n)),n==null||n.attemptAutoclose(P.AddErrorCaller,this.id),this):this}addEntryCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddEntryCaller)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddEntryCaller,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddEntryCaller}-${this.id}--${ze.CannotEntryCallItself}`,action:P.AddEntryCaller,owner:this,errorReason:ze.CannotEntryCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddEntryCaller})),this.calledByEntry.find(e=>e.id===i.id)||(this.calledByEntry.push(i),n==null||n.add(this,se.Updated),s&&ni(this,n)),n==null||n.attemptAutoclose(P.AddEntryCaller,this.id),this):this}addErrorCall(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddErrorCall)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddErrorCall,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddErrorCaller}-${this.id}--${ze.CannotErrorCallItself}`,action:P.AddErrorCaller,owner:this,errorReason:ze.CannotErrorCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddErrorCaller})),this.errorCalls.find(e=>e.id===i.id)||(this.errorCalls.push(i),this.catchesError||this.metaSync({catchesError:!0},n),s&&ni(this,n),n==null||n.add(this,se.Affected)),n==null||n.attemptAutoclose(P.AddErrorCall,this.id),this):this}addSuccessCall(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddSuccessCall)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddSuccessCall,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddSuccessCaller}-${this.id}`,action:P.AddSuccessCaller,owner:this,errorReason:ze.CannotSuccessCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddSuccessCaller})),this.successCalls.find(e=>e.id===i.id)||(this.successCalls.push(i),s&&ni(this,n),n==null||n.add(this,se.Affected)),n==null||n.attemptAutoclose(P.AddSuccessCall,this.id),this):this}removeCall(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveCall)),s=!1){if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,P.RemoveCall,n))return this;const c=this.successCalls.findIndex(f=>f.id===i.id);c>-1&&(this.successCalls.splice(c,1),n==null||n.add(this,se.Affected));const e=this.errorCalls.findIndex(f=>f.id===i.id);return e>-1&&(this.errorCalls.splice(e,1),n==null||n.add(this,se.Affected)),s&&ni(this,n),n==null||n.attemptAutoclose(P.RemoveCall,this.id),this}removeCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"remove-caller")),s=!1){return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.RemoveCaller,n)?(this.calledBySuccess=this.calledBySuccess.filter(c=>c.id!==i.id?!0:(n==null||n.add(this,se.Updated),n==null||n.add(c,se.Affected),!1)),this.calledByError=this.calledByError.filter(c=>c.id!==i.id?!0:(n==null||n.add(this,se.Updated),n==null||n.add(c,se.Affected),!1)),this.calledByEntry=this.calledByEntry.filter(c=>c.id!==i.id?!0:(n==null||n.add(this,se.Updated),n==null||n.add(c,se.Affected),!1)),s&&ni(this,n),n==null||n.attemptAutoclose(P.RemoveCaller,this.id),this):this}replaceDetachedChild(i,n){const s=this.detachedChildren.indexOf(i);return s!==-1&&(this.detachedChildren[s]=n),this}subscribeDetachedChild(i){return this.detachedChildren.includes(i)||this.detachedChildren.push(i),this}unsubscribeDetachedChild(i){const n=this.detachedChildren.indexOf(i);return n!==-1&&this.detachedChildren.splice(n,1),this}setError(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetErrorEntity))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[setError] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetErrorEntity,this.id),this;const s=this.error;return(s==null?void 0:s.id)!==(i==null?void 0:i.id)&&(s==null||s.remove({ignoreUpstream:!0},n),this.error=i,this.subscribeToDependencies(),n==null||n.add(this,se.Affected)),n==null||n.attemptAutoclose(P.SetErrorEntity,this.id),this}setParent(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetParent))){var s;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.SetParent,n)?(((s=this.parent)==null?void 0:s.id)!==(i==null?void 0:i.id)&&(this.parent=i,n&&(n==null||n.add(this,se.Updated))),n==null||n.attemptAutoclose(P.SetParent,this.id),this):this}setDeclaration(i){return this.declaration=i,this}initChildren(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.declaration=Ve(this.initialData.declaration,this.project),this.initialData.dataType){const n=Ve(this.initialData.dataType,this.project);this.setDataType(n,null),this.dataType.setParent(this,null),this.dataType.initChildren(i)}return this.successCalls=this.initialData.successCalls.map(n=>{const s=Ve(n,this.project);if(s.addSuccessCaller(this,null),[r.BreakStatement,r.ContinueStatement].includes(s.type))s.setParent(this.parent.parent,null),s.initChildren(i);else if(s.type===r.ReturnStatement){const c=ys(this,this.project);s.setParent(c,null),s.initChildren(i)}else s.type!==r.InternalCall&&(s.setParent(this.parent,null),s.initChildren(i));return s}),this.errorCalls=this.initialData.errorCalls.map(n=>{const s=Ve(n,this.project);if(s.addErrorCaller(this,null),[r.BreakStatement,r.ContinueStatement].includes(s.type))s.setParent(this.parent.parent,null),s.initChildren(i);else if(s.type===r.ReturnStatement){const c=ys(this,this.project);s.setParent(c,null),s.initChildren(i)}else s.type!==r.InternalCall&&(s.setParent(this.parent,null),s.initChildren(i));return s}),this.inputs=this.initialData.inputs.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(i),s}),this.outputs=this.initialData.outputs.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(i),s}),this.initialData.body&&(this.body=Ve(this.initialData.body,this.project),this.body.setParent(this,null),this.body.initChildren(i)),this.initialData.error&&(this.error=Ve(this.initialData.error,this.project),this.error.setParent(this,null),this.error.initChildren(i)),this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(n=>{n.version!==this.version&&(n.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const s=Za(this,i,n),c=qa(this,s),e=this.toMeta();return this.x=s.x||e.x,this.y=s.y||e.y,this.catchesError=s.catchesError!==void 0?s.catchesError:this.catchesError,super.baseMetaSync(s,this,n),s.deleted===!0&&!e.deleted?n==null||n.add(this,se.Removed):s.deleted===!1&&e.deleted?n==null||n.add(this,se.Added):c&&(n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=st,...n){return await Ji.repository.APILoad(this.id,...n),this}async APICreate(i=st,...n){return await Ji.repository.APICreate(this.toShallowJSON(),...n),this}async APIUpdate(i=st,...n){return await Ji.repository.APIUpdate(this.toShallowJSON(),...n),this}async APIDelete(i=st,...n){return await Ji.repository.APIDelete(this.toShallowJSON(),...n),this}async APIClone(i=st,...n){return await Ji.repository.APIClone(this.id,...n),this}async APILoadVersion(i=st,n,...s){return await Ji.repository.APILoadVersion(this.id,n,...s)}removeFromParent(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveFromParent))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return this.parent.type===r.Project?(this.parent.removeLoop(this),e.push(this.parent)):this.parent.detachedChildren.includes(this)&&this.parent.unsubscribeDetachedChild(this),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:V(c),updated:V(n),removed:V(s),affected:V(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveEntity))){var h;if(!this.checkCanDelete(this,n))return oe.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),n==null||n.event({id:`${P.RemoveEntity}-${this.id}--${ze.ActionOwnerEntityNonDeletable}`,action:P.RemoveEntity,owner:this,errorReason:ze.ActionOwnerEntityNonDeletable,rootAction:((h=n==null?void 0:n.self)==null?void 0:h.id)===this.id&&(n==null?void 0:n.actionName)===P.RemoveEntity}),n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const s=[],c=[],e=[],f=[];if(n!=null&&n.hasRemoved(this.id))return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},n),Object.values(this.detachedDependents).forEach(m=>{const{updated:T,removed:g,added:b}=m.entity.onDetachedDependencyRemoved(this,m.field,n);s.push(...T),c.push(...g),e.push(...b)}),this.inputs.forEach(m=>{const{updated:T,removed:g}=m.remove({ignoreUpstream:!0},n);s.push(...T),c.push(...g)}),this.outputs.forEach(m=>{const{updated:T,removed:g}=m.remove({ignoreUpstream:!0},n);s.push(...T),c.push(...g)}),this.body.remove({ignoreUpstream:!0},n),this.error){const{updated:m,removed:T}=this.error.remove({ignoreUpstream:!0},n);s.push(...m),c.push(...T)}if(this.dataType){const{updated:m,removed:T}=this.dataType.remove({ignoreUpstream:!0},n);s.push(...m),c.push(...T)}if(this.successCalls.forEach(m=>{s.push(m),m.removeCaller(this,n)}),this.errorCalls.forEach(m=>{s.push(m),m.removeCaller(this,n)}),!i){const m=this.removeFromParent(n);e.push(...m.added),s.push(...m.updated),c.push(...m.removed),f.push(...m.affected),this.calledBy.forEach(T=>{s.push(T),T.removeCall(this,n)})}return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:V(e),updated:V(s),removed:V(c),affected:V(f),self:this}}restore({}={},i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RestoreEntity))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];if(i!=null&&i.hasAdded(this.id))return i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),this.inputs.forEach(f=>{const{updated:h}=f.restore({},i);s.push(...h)}),this.outputs.forEach(f=>{const{updated:h}=f.restore({},i);s.push(...h)}),this.body.restore({},i),this.successCalls.forEach(f=>{s.push(f),f.addSuccessCaller(this,i)}),this.errorCalls.forEach(f=>{s.push(f),f.addErrorCaller(this,i)}),this.error){const{updated:f}=this.error.restore({},i);s.push(...f)}if(this.dataType){const{updated:f}=this.dataType.restore({},i);s.push(...f)}return this.calledBySuccess.forEach(f=>{s.push(f),f.addSuccessCall(this,i)}),this.calledByError.forEach(f=>{s.push(f),f.addErrorCall(this,i)}),this.calledByEntry.forEach(f=>{s.push(f),f.addCall(this,i)}),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:V(n),updated:V(s),removed:V(c),affected:V(e),self:this}}toFlat(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this,...this.inputs.flatMap(s=>s.toFlat(i)),...this.outputs.flatMap(s=>s.toFlat(i)),...this.successCalls.flatMap(s=>s.toFlat(i)),...this.errorCalls.flatMap(s=>s.toFlat(i)),...this.error?this.error.toFlat(i):[],...this.body?this.body.toFlat(i):[],...this.dataType?this.dataType.toFlat(i):[],...this.continueStatements.flatMap(s=>s.toFlat(i)),...this.breakStatements.flatMap(s=>s.toFlat(i))])}toFlatIds(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.inputs.flatMap(s=>s.toFlatIds(i)),...this.outputs.flatMap(s=>s.toFlatIds(i)),...this.successCalls.flatMap(s=>s.toFlatIds(i)),...this.errorCalls.flatMap(s=>s.toFlatIds(i)),...this.error?this.error.toFlatIds(i):[],...this.body?this.body.toFlatIds(i):[],...this.dataType?this.dataType.toFlatIds(i):[],...this.continueStatements.flatMap(s=>s.toFlatIds(i)),...this.breakStatements.flatMap(s=>s.toFlatIds(i))])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,x:this.x,y:this.y,type:this.type,editable:this.editable,deletable:this.deletable,catchesError:this.catchesError}}toJSON(i=new Set){var n,s;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,catchesError:this.catchesError,x:this.x,y:this.y,dataType:((n=this.dataType)==null?void 0:n.toJSON(i))||null,calledBySuccess:this.calledBySuccess.map(c=>c.toReference()),calledByError:this.calledByError.map(c=>c.toReference()),calledByEntry:this.calledByEntry.map(c=>c.toReference()),writesValues:this.writesValues.map(c=>c.toJSON(i)),declaration:this.declaration.toJSON(i),inputs:this.inputs.map(c=>c.toJSON(i)),outputs:this.outputs.map(c=>c.toJSON(i)),successCalls:this.successCalls.map(c=>c.toJSON(i)),errorCalls:this.errorCalls.map(c=>c.toJSON(i)),error:((s=this.error)==null?void 0:s.toJSON(i))||null,body:this.body.toJSON(i),parent:this.parent.toReference()})}toJSONClone(i=wt){var s,c,e,f,h,m,T;let n;return(s=i.seenEntityMaps)!=null&&s.has(this.id)?n=i.seenEntityMaps.get(this.id):(n=i.newId||Xa(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,n)),(c=i.seenEntities)!=null&&c.has(n)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(n),(h=i.seenEntities)==null||h.add(this.id),{id:n,version:M.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,x:this.x,y:this.y,catchesError:this.catchesError,dataType:((m=this.dataType)==null?void 0:m.toJSONClone({...i,newId:null}))||null,calledBySuccess:this.calledBySuccess.map(g=>g.toReference({seenEntityMaps:i.seenEntityMaps})),calledByError:this.calledByError.map(g=>g.toReference({seenEntityMaps:i.seenEntityMaps})),calledByEntry:this.calledByEntry.map(g=>g.toReference({seenEntityMaps:i.seenEntityMaps})),declaration:this.declaration.toJSON(),inputs:this.inputs.map(g=>g.toJSONClone({...i,newId:null})),outputs:this.outputs.map(g=>g.toJSONClone({...i,newId:null})),writesValues:this.writesValues.map(g=>g.toJSONClone({...i,newId:null})),successCalls:this.successCalls.map(g=>g.toJSONClone({...i,newId:null})),errorCalls:this.errorCalls.map(g=>g.toJSONClone({...i,newId:null})),error:((T=this.error)==null?void 0:T.toJSONClone({...i,newId:null}))||null,body:this.body.toJSONClone({...i,newId:null}),parent:this.parent.toReference({seenEntityMaps:i.seenEntityMaps})})}toReference(i=wt){var s;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n+"--"+M.UUID.uuid()+"--ref",type:r.GenericReference,entityId:n,version:this.version,entityType:this.type}}toShallowJSON(i=wt){var s,c,e,f,h;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,catchesError:this.catchesError,x:this.x,y:this.y,dataType:((c=this.dataType)==null?void 0:c.toReference(i))||null,declaration:((e=this.declaration)==null?void 0:e.toReference(i))||null,body:((f=this.body)==null?void 0:f.toReference(i))||null,inputs:this.inputs.map(m=>m.toReference(i)),outputs:this.outputs.map(m=>m.toReference(i)),writesValues:this.writesValues.map(m=>m.toReference(i)),successCalls:this.successCalls.map(m=>m.toReference(i)),errorCalls:this.errorCalls.map(m=>m.toReference(i)),calledBySuccess:this.calledBySuccess.map(m=>m.toReference(i)),calledByError:this.calledByError.map(m=>m.toReference(i)),calledByEntry:this.calledByEntry.map(m=>m.toReference(i)),error:((h=this.error)==null?void 0:h.toReference(i))||null,parent:this.parent.toReference(i)}}toFlatJSON(i=new Set){var s;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...((s=this.body)==null?void 0:s.toFlatJSON(i))||[],...this.successCalls.flatMap(c=>c.toFlatJSON(i)),...this.errorCalls.flatMap(c=>c.toFlatJSON(i)),...this.inputs.flatMap(c=>c.toFlatJSON(i)),...this.outputs.flatMap(c=>c.toFlatJSON(i)),...this.continueStatements.flatMap(c=>c.toFlatJSON(i)),...this.breakStatements.flatMap(c=>c.toFlatJSON(i)),...this.error?this.error.toFlatJSON(i):[],...this.dataType?this.dataType.toFlatJSON(i):[]])}toGenerationTarget(i=wt){var c,e;const n=this.parent.type===r.Project?void 0:(c=i.seenEntityMaps)!=null&&c.has(this.parent.id)?i.seenEntityMaps.get(this.parent.id):this.parent.id;let s=this.id;return(e=i.seenEntityMaps)!=null&&e.has(this.id)&&(s=i.seenEntityMaps.get(this.id)),{id:s,type:this.type,calledByEntry:this.calledByEntry.map(f=>f.id),calledBySuccess:this.calledBySuccess.map(f=>f.id),calledByError:this.calledByError.map(f=>f.id),declaration:this.declaration.id,parent:n}}toFlatGenerationTarget(i=new Set){var s;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...((s=this.body)==null?void 0:s.toFlatGenerationTarget(i))||[],...this.successCalls.flatMap(c=>c.toFlatGenerationTarget(i)),...this.errorCalls.flatMap(c=>c.toFlatGenerationTarget(i)),...this.inputs.flatMap(c=>c.toFlatGenerationTarget(i)),...this.outputs.flatMap(c=>c.toFlatGenerationTarget(i)),...this.continueStatements.flatMap(c=>c.toFlatGenerationTarget(i)),...this.breakStatements.flatMap(c=>c.toFlatGenerationTarget(i)),...this.error?this.error.toFlatGenerationTarget(i):[],...this.dataType?this.dataType.toFlatGenerationTarget(i):[]])}clearErrors(){var i,n;return this.errors=[],this.inputs.forEach(s=>s.clearErrors()),this.outputs.forEach(s=>s.clearErrors()),this.successCalls.forEach(s=>s.clearErrors()),this.errorCalls.forEach(s=>s.clearErrors()),this.continueStatements.forEach(s=>s.clearErrors()),this.breakStatements.forEach(s=>s.clearErrors()),(i=this.error)==null||i.clearErrors(),(n=this.dataType)==null||n.clearErrors(),this}validate(){return this.errors=U2(this),{success:!0}}async validateAsync(i={}){const n=oe.YieldTracker.from(i);return this.errors=await ntt(this,{tracker:n}),{success:!0}}getErrors(){return[...this.errors,...this.inputs.flatMap(n=>n.getErrors()),...this.outputs.flatMap(n=>n.getErrors()),...this.body?this.body.getErrors():[],...this.error?this.error.getErrors():[],...this.dataType?this.dataType.getErrors():[]]}async getErrorsAsync(i={}){const n=oe.YieldTracker.from(i),s=[...this.errors];await n.tick();for(const c of this.inputs)s.push(...await c.getErrorsAsync({tracker:n}));for(const c of this.outputs)s.push(...await c.getErrorsAsync({tracker:n}));return this.body&&s.push(...await this.body.getErrorsAsync({tracker:n})),this.error&&s.push(...await this.error.getErrorsAsync({tracker:n})),this.dataType&&s.push(...await this.dataType.getErrorsAsync({tracker:n})),s}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.CloneEntity)),n=null,s=null,c=!0){var I,D;const e=_a(n,this),f=this.toJSON(),h=s||M.UUID.uuid();f.inputs=[];const m=h.split("-id"),T=m[m.length-1||0]||h;f.id=h,f.version=M.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.deletable=!0,f.editable=!0;const g=Cr(f,e);n?g.setParent(n,i):g.setParent(this.parent,null),c&&g.subscribe(),g.initChildren(i),i==null||i.add(g,se.Added);const b=(I=this.inputs)==null?void 0:I.map((N,$)=>N.clone(i,g,T+"-input-map-"+$+"-id",c));g.inputs=b;const R=(D=this.outputs)==null?void 0:D.map((N,$)=>N.clone(i,g,T+"-output-map-"+$+"-id",c));return g.outputs=R,this.body&&(g.body=this.body.clone(i,g,T+"-body-id",c,!0)),this.error&&(g.error=this.error.clone(i,g,T+"-error-map-id",c)),this.dataType&&(g.dataType=this.dataType.clone(i,g,T+"-data-type-id",c)),i||g.captureVersion(),i==null||i.attemptAutoclose(P.CloneEntity,this.id),g}getVariableInstances(){return this.body?Yr(this.body).filter(s=>s.type===r.VariableInstance):[]}addReturnStatement(i){return $i.includes(this.parent.type)&&this.parent.addReturnStatement(i),this}removeReturnStatement(i){return $i.includes(this.parent.type)&&this.parent.removeReturnStatement(i),this}addBreakStatement(i){return this.breakStatements.includes(i)||this.breakStatements.push(i),this}removeBreakStatement(i){const n=this.breakStatements.indexOf(i);return n!==-1&&this.breakStatements.splice(n,1),this}addContinueStatement(i){return this.continueStatements.includes(i)||this.continueStatements.push(i),this}removeContinueStatement(i){const n=this.continueStatements.indexOf(i);return n!==-1&&this.continueStatements.splice(n,1),this}getUniqueInputMaps(){const i=[];return[...this.breakStatements,...this.continueStatements].forEach(s=>{s.outputs.filter(e=>{var f;return!e.deleted&&!((f=e.declaration)!=null&&f.deleted)}).forEach(e=>{i.find(h=>h===e||Ee(h,this.project)===Ee(e,this.project)&&ji(h.dataType,e.dataType))||i.push(e)})}),V(i)}syncTerminationStatements(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-termination-statements"))){const n=[],s=[],c=[],e=[],f=this.getUniqueInputMaps();return[...this.breakStatements,...this.continueStatements].forEach(m=>{const T=m.outputs.filter(b=>{var R;return!b.deleted&&!((R=b.declaration)!=null&&R.deleted)}),g=f.filter(b=>!T.find(R=>Ee(b,this.project)===Ee(R,this.project)&&ji(b.dataType,R.dataType)));g.length&&(n.push(m),i==null||i.add(m,se.Updated)),g.forEach(b=>{const R=b.clone(i,m);i==null||i.add(R,se.Added),R.addSelfToProject(i),s.push(R)})}),i==null||i.attemptAutoclose("sync-termination-statements",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}syncBodyInputIndexes(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-body-input-indexes"))){const n=[],s=[],c=[],e=[];return this.body.inputs.sort((f,h)=>f.index-h.index),i==null||i.attemptAutoclose("sync-body-input-indexes",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}syncBodyArgumentsDeclarations(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-body-arguments-declarations"))){var N;const n=[],s=[],c=[],e=[],{updated:f,added:h,removed:m}=this.syncFixedBodyArgumentDeclarations(i);n.push(...f),s.push(...h),c.push(...m);const T=this.getUniqueInputMaps(),g=this.body.inputs;T.sort(($,x)=>$.index-x.index);const b=this.getDataType();if(((N=b==null?void 0:b.entity)==null?void 0:N.id)!==B["primitive-entity"].void.id&&(b!=null&&b.entity||b!=null&&b.isGroup||b!=null&&b.foreignKeyRef)&&!g.find(x=>{var L,K,q,W,Z;return x.id!==((L=this.currentIterationNumberArgumentDeclaration)==null?void 0:L.id)&&x.id!==((K=this.currentValueArgumentDeclaration)==null?void 0:K.id)&&((W=(q=x.dataType)==null?void 0:q.entity)==null?void 0:W.id)===((Z=b==null?void 0:b.entity)==null?void 0:Z.id)})){let x=0;this.currentIterationNumberArgumentDeclaration&&x++,this.currentValueArgumentDeclaration&&x++;const L=mo.new(i);L.name="Aggregate result",L.description="Aggretated list of all previously outputted values from each iteration",L.constant=!0,L.index=x,L.required=!1,L.parent=this.body.toReference();const K=Ve(L,this.project);if(K.hydrateAncestors(),K.addSelfToProject(i),i==null||i.add(K,se.Added),s.push(K),K.setParent(this.body,i),K.initChildren(i),!K.dataType&&b){const q=Xr.new(i);q.parent=K.toReference();const W=Ve(q,this.project);W.hydrateAncestors(),W.addSelfToProject(i),s.push(W),W.setParent(K,i),W.initChildren(i),W.merge(b,i),W.setEntity(b.entity,i),i==null||i.add(W,se.Added),K.dataType=W,i||W.captureVersion()}i||K.captureVersion()}const{updated:R,added:I,removed:D}=this.removeExtraBodyArgumentDeclarations(i);return n.push(...R),s.push(...I),c.push(...D),i==null||i.attemptAutoclose("sync-body-arguments-declarations",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}reAttachAllTerminationInputMapsToDeclarations(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"reattach-termination-input-maps-to-declarations"))){var h,m,T;const n=[],s=[],c=[],e=[];return!((h=this.body)!=null&&h.dataType)||!((m=this.body)!=null&&m.dataType.entity)||((T=this.body)==null?void 0:T.dataType.entity.type)!==r.DefinitionEntity?(i==null||i.attemptAutoclose("reattach-termination-input-maps-to-declarations",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}):([...this.breakStatements,...this.continueStatements].forEach(g=>{var N,$,x;const b=g.outputs.filter(L=>{var K;return!L.deleted&&!((K=L.declaration)!=null&&K.deleted)}),R=b.filter(L=>!L.declaration&&!!L.readsValue),I=b.filter(L=>!L.declaration&&!L.readsValue);let D=(((x=($=(N=this.body)==null?void 0:N.dataType)==null?void 0:$.entity)==null?void 0:x.properties)||[]).filter(L=>!b.find(K=>{var q,W;return!K.deleted&&!((q=K.declaration)!=null&&q.deleted)&&((W=K.declaration)==null?void 0:W.id)===L.id}));R.forEach(L=>{const K=L.getDataType(i);if(L.readsValue){const q=Ee(L.readsValue,this.project),W=D.find(Z=>Ee(Z,this.project)===q&&ji(Z.dataType,K));if(W){L.setDeclaration(W,i),n.push(L),D=D.filter(Z=>Z!==W);return}}}),I.forEach(L=>{const K=L.getDataType(i),q=D.find(W=>ji(W.dataType,K));if(q){L.setDeclaration(q,i),n.push(L),D=D.filter(W=>W!==q);return}}),b.forEach(L=>{const K=D.find(q=>Ee(q,this.project)===Ee(L,this.project));L.declaration&&!D.includes(L.declaration)&&K&&(L.setDeclaration(K,i),n.push(L),D=D.filter(q=>q!==K))})}),i==null||i.attemptAutoclose("reattach-termination-input-maps-to-declarations",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this})}syncOutputDataType(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-outputs-properties"))){var D,N,$,x,L,K,q,W,Z,X,te,z,J,Q,ne,ae,de,fe,me,be,Ce,Oe,xe;const n=[],s=[],c=[],e=[],f=[...this.breakStatements,...this.continueStatements];if(!f.every(Re=>Re.initialized))return i==null||i.attemptAutoclose("sync-outputs-properties",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this};let h=!1;if(!((D=this.body)!=null&&D.dataType)){const Re=Xr.new(i);Re.parent=this.body.toReference(),Re.inferred=!0;const Ke=Ve(Re,this.project);Ke.hydrateAncestors(),Ke.addSelfToProject(i),i==null||i.add(Ke,se.Added),Ke.initChildren(i),s.push(Ke),h=!0}const m=f.find(Re=>!!Re.readsValue);if(m){const Re=(N=m.readsValue)==null?void 0:N.getDataType(i);Re&&((x=($=this.body)==null?void 0:$.dataType)==null||x.merge(Re,i))}h&&(i||(K=(L=this.body)==null?void 0:L.dataType)==null||K.captureVersion());const T=this.getUniqueInputMaps();let g=(W=(q=this.body)==null?void 0:q.dataType)==null?void 0:W.entity;if(T.length&&(!g||g.id===B["primitive-entity"].void.id)){const Re=Ua.new(i);Re.parent=((Z=this.body)==null?void 0:Z.dataType).toReference(),Re.name=`${Ee(this,this.project)} output definition`,Re.description=`The definition of the output data type of the loop '${Ee(this,this.project)}'`;const Ke=Ve(Re,this.project);Ke.setParent((X=this.body)==null?void 0:X.dataType,i),Ke.hydrateAncestors(),i==null||i.add(Ke,se.Added),Ke.addSelfToProject(i),Ke.initChildren(i),s.push(Ke),g=Ke,(z=(te=this.body)==null?void 0:te.dataType)==null||z.metaSync({inferred:!0},i),i||Ke.captureVersion()}const b=(g==null?void 0:g.properties)||[];(Q=(J=this.body)==null?void 0:J.dataType)!=null&&Q.inferred&&((ae=(ne=this.body)==null?void 0:ne.dataType.entity)==null?void 0:ae.type)===r.DefinitionEntity&&(T.forEach(Re=>{var Fe,je,nt,yt,Gt;const Ke=Re.getDataType(i);let Ue=b.find(Dt=>Ee(Dt,this.project)===Ee(Re,this.project)&&ji(Dt.dataType,Re.dataType));if(!Ue){const Dt=fo.new(i);Dt.name=Ee(Re,this.project),Dt.description=`Aggretated list of all previously outputted values from each iteration by the output '${Ee(Re,this.project)}'`,Dt.index=Re.index,Dt.required=((Fe=Re.declaration)==null?void 0:Fe.required)||!1,Dt.parent=((nt=(je=this.body)==null?void 0:je.dataType)==null?void 0:nt.entity).toReference();const mt=Ve(Dt,this.project);mt.hydrateAncestors(),mt.setParent((Gt=(yt=this.body)==null?void 0:yt.dataType)==null?void 0:Gt.entity,i),mt.addSelfToProject(i),i==null||i.add(mt,se.Added),mt.initChildren(i),s.push(mt),Ue=mt,i||mt.captureVersion()}Ue.index!==Re.index&&(Ue.metaSync({index:Re.index},i),n.push(Ue));let Qe=Ue.getDataType(i);if(Ke&&(!Qe||!ji(Qe,Ke))){if(!Qe){const Dt=Ke.clone(i,Ue);i==null||i.add(Dt,se.Added),Dt.addSelfToProject(i),Qe=Dt,s.push(Dt),n.push(Ue)}Qe.merge(Ke,i)}if(!Ke&&!Qe){const Dt={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,parentRelationType:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:Ue.toReference()},mt=Ve(Dt,this.project);mt.hydrateAncestors(),mt.setParent(Ue,i),mt.addSelfToProject(i),i==null||i.add(mt,se.Added),mt.initChildren(i),s.push(mt),i||mt.captureVersion()}}),this.reAttachAllTerminationInputMapsToDeclarations(i)),(fe=(de=this.body)==null?void 0:de.dataType)!=null&&fe.inferred&&((be=(me=this.body)==null?void 0:me.dataType.entity)==null?void 0:be.type)===r.DefinitionEntity&&b.filter(Ke=>!T.find(Ue=>Ee(Ke,this.project)===Ee(Ue,this.project))).forEach(Ke=>{if(!(i!=null&&i.hasRemoved(Ke.id))&&!Ke.deleted){const{updated:Je,removed:Ue}=Ke.remove({ignoreUpstream:!1},i);n.push(...Je),c.push(...Ue)}}),f.forEach(Re=>{Re.outputs.filter(Je=>{var Ue;return!Je.deleted&&!((Ue=Je.declaration)!=null&&Ue.deleted)}).forEach(Je=>{var Ze,Qe,Fe;if(!(((Fe=(Qe=(Ze=this.body)==null?void 0:Ze.dataType)==null?void 0:Qe.entity)==null?void 0:Fe.properties)||[]).find(je=>{var nt;return((nt=Je.declaration)==null?void 0:nt.id)===je.id})&&!(i!=null&&i.hasRemoved(Je.id))&&!Je.deleted){const{updated:je,removed:nt}=Je.remove({ignoreUpstream:!1},i);n.push(...je),c.push(...nt)}})});const R=this.getUniqueInputMaps();if(f.every(Re=>!Re.readsValue)&&!R.length){const Re=this.project.getBuiltIn(B["primitive-entity"].void.id);(Oe=(Ce=this.body)==null?void 0:Ce.dataType)==null||Oe.setEntity(Re,i),n.push((xe=this.body)==null?void 0:xe.dataType)}return i==null||i.attemptAutoclose("sync-outputs-properties",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}syncOutputMaps(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SyncOutputs))){var T,g,b;const n=[],s=[],c=[],e=[],f=((b=(g=(T=this.body)==null?void 0:T.dataType)==null?void 0:g.entity)==null?void 0:b.properties)||[],h=this.outputs;return f.forEach(R=>{var N;let D=h.find($=>{var x,L;return((x=$.declaration)==null?void 0:x.id)===R.id&&ji((L=$.declaration)==null?void 0:L.dataType,R.dataType)});if(D)((N=D.declaration)==null?void 0:N.id)!==R.id&&(D.setDeclaration(R,i),n.push(D));else{const $={dataType:null,id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.OutputMap,index:R.index,declaration:R.toJSON(),writesValues:[],parent:this.toReference()},x=Ve($,this.project);x.hydrateAncestors(),x.setParent(this,i),x.addSelfToProject(i),i==null||i.add(x,se.Added),x.initChildren(i),s.push(x),i||x.captureVersion(),D=x}D.index!==R.index&&(D.metaSync({index:R.index},i),n.push(D))}),h.filter(R=>!f.find(D=>{var N;return((N=R.declaration)==null?void 0:N.id)===D.id})).forEach(R=>{const{updated:I,removed:D}=R.remove({ignoreUpstream:!1},i);n.push(...I),c.push(...D)}),this.outputs.forEach(R=>{const{updated:I,added:D,removed:N}=R.afterAllChildrenInitialized(i);n.push(...I),s.push(...D),c.push(...N)}),this.outputs.sort((R,I)=>R.index-I.index),i==null||i.attemptAutoclose(P.SyncOutputs,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}createCurrentIterationNumberArgumentDeclaration(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"create-current-iteration-number-argument-declaration"))){const n=[],s=[],c=[],e=[];let h=this.body.inputs.find(b=>{var R;return b.name===Ji.CURRENT_ITERATION_NUMBER_ARG_NAME||b.id===((R=this.currentIterationNumberArgumentDeclaration)==null?void 0:R.id)});const m=this.getCurrentIterationNumberBuiltInValueDescriptor();if(!h){const b={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.ArgumentDeclaration,name:Ji.CURRENT_ITERATION_NUMBER_ARG_NAME,codeName:null,description:"The number of the current iteration",defaultValue:null,constant:!0,dataType:null,implements:[m==null?void 0:m.toJSON()],index:this.body.inputs.length,required:!0,parent:this.body.toReference(),writesValues:[]},R=Ve(b,this.project);R.hydrateAncestors(),R.setParent(this.body,i),R.addSelfToProject(i),i==null||i.add(R,se.Added),R.initChildren(i),s.push(R),i||R.captureVersion(),h=R}!h.index&&h.index!==0&&(h.metaSync({index:0},i),n.push(h)),(!h.implements||!h.implements.find(b=>b.id===m.id))&&(h.addImplementation(m,i),n.push(h));let g=h.getDataType(i);if(!g){const b={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,actionEntities:null,parentRelationType:null,isList:!1,index:null,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:h.toReference()},R=Ve(b,this.project);R.hydrateAncestors(),R.setParent(h,i),R.addSelfToProject(i),i==null||i.add(R,se.Added),R.initChildren(i),s.push(R),i||R.captureVersion(),g=R}if(!g.entity||g.entity.type!==r.PrimitiveEntity||g.entity.name!==ce.Number||g.entity.id!==B["primitive-entity"].number.id){const b=this.project.getBuiltIn(B["primitive-entity"].number.id);g.setEntity(b,i),n.push(g)}return i==null||i.attemptAutoclose("create-current-iteration-number-argument-declaration",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}removeExtraBodyArgumentDeclarations(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"remove-extra-body-argument-declarations"))){const n=[],s=[],c=[],e=[],f=this.body.inputs,h=this.getDataType();return f.filter(T=>{var g,b,R,I,D;return T===this.currentIterationNumberArgumentDeclaration||T===this.currentValueArgumentDeclaration?!1:((g=h==null?void 0:h.entity)==null?void 0:g.id)===B["primitive-entity"].void.id||((b=h==null?void 0:h.entity)==null?void 0:b.id)===void 0?!0:((I=(R=T.dataType)==null?void 0:R.entity)==null?void 0:I.id)!==((D=h==null?void 0:h.entity)==null?void 0:D.id)}).forEach(T=>{const{updated:g,removed:b}=T.remove({ignoreUpstream:!1},i);n.push(...g),c.push(...b)}),i==null||i.attemptAutoclose("remove-extra-body-argument-declarations",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}createCurrentValueInputBasedOnInputMap(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"create-current-value-input-based-on-input-map"))){var T,g,b,R,I,D,N,$,x;const n=[],s=[],c=[],e=[];switch(this.declaration.id){case Lt.List:{const L=this.body.inputs.find(W=>!!W.implements.find(Z=>Z.id===B[r.Loop][Lt.List].body.inputs.currentValue.id)),K=this.inputs.find(W=>{var Z;return((Z=W.declaration)==null?void 0:Z.id)===B[r.Loop][Lt.List].inputs.list.id});if(!K)break;const q=this.getCurrentValueBuiltInValueDescriptor();if(L){q&&!L.implements.find(te=>te.id===q.id)&&(L.addImplementation(q,i),n.push(L));let Z=L.getDataType(i);if(!Z){const te={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:(T=this.currentValueArgumentDeclaration)==null?void 0:T.toReference()},z=Ve(te,this.project);z.hydrateAncestors(),z.setParent(this.currentValueArgumentDeclaration,i),z.addSelfToProject(i),i==null||i.add(z,se.Added),z.initChildren(i),s.push(z),i||z.captureVersion(),Z=z}const X=K.getDataType(i);Z.merge(X,i),Z.metaSync({isList:!1},i)}else{const W={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.ArgumentDeclaration,name:Ji.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:[q],writesValues:[],dataType:null,parent:this.body.toReference()},Z=Ve(W,this.project);Z.hydrateAncestors(),Z.setParent(this.body,i),Z.addSelfToProject(i),i==null||i.add(Z,se.Added),Z.initChildren(i),q&&!Z.implements.find(X=>X.id===q.id)&&(Z.addImplementation(q,i),n.push(Z)),s.push(Z),i||Z.captureVersion()}break}case Lt.ManualFlow:break;case Lt.Counted:break;case Lt.ObjectKeys:{const L=this.body.inputs.find(W=>!!W.implements.find(Z=>Z.id===B[r.Loop][Lt.ObjectKeys].body.inputs.currentValue.id));if(!this.inputs.find(W=>{var Z;return((Z=W.declaration)==null?void 0:Z.id)===B[r.Loop][Lt.ObjectKeys].inputs.object.id}))break;const q=this.getCurrentValueBuiltInValueDescriptor();if(L){q&&!L.implements.find(X=>X.id===q.id)&&(L.addImplementation(q),n.push(L));let Z=L.getDataType(i);if(Z){const X=this.project.getBuiltIn(B["primitive-entity"].string.id);((b=Z.entity)==null?void 0:b.id)!==X.id&&(Z.setEntity(X,i),n.push(Z))}else{const X={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:(g=this.currentValueArgumentDeclaration)==null?void 0:g.toReference()},te=Ve(X,this.project);te.hydrateAncestors(),te.setParent(this.currentValueArgumentDeclaration,i),te.addSelfToProject(i),i==null||i.add(te,se.Added),te.initChildren(i),i||te.captureVersion(),Z=te}}else{const W={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.ArgumentDeclaration,name:Ji.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,defaultValue:null,index:this.body.inputs.length,constant:!0,required:!0,implements:[q],writesValues:[],dataType:null,parent:this.body.toReference()},Z=Ve(W,this.project);Z.hydrateAncestors(),Z.setParent(this.body,i),Z.addSelfToProject(i),i==null||i.add(Z,se.Added),Z.initChildren(i),q&&!Z.implements.find(X=>X.id===q.id)&&(Z.addImplementation(q,i),n.push(Z)),s.push(Z),i||Z.captureVersion()}break}case Lt.ObjectValues:{const L=this.body.inputs.find(W=>!!W.implements.find(Z=>Z.id===B[r.Loop][Lt.ObjectValues].body.inputs.currentValue.id)),K=this.inputs.find(W=>{var Z;return((Z=W.declaration)==null?void 0:Z.id)===B[r.Loop][Lt.ObjectValues].inputs.object.id});if(!K)break;const q=this.getCurrentValueBuiltInValueDescriptor();if(L){q&&!L.implements.find(X=>X.id===q.id)&&(L.addImplementation(q,i),n.push(L));let Z=L.getDataType(i);if(Z){const X=K.getDataType(i),te=((D=X==null?void 0:X.entity)==null?void 0:D.properties)||[];(N=Z.orChildrenGroup)==null||N.forEach(z=>{const{updated:J,removed:Q}=z.remove({ignoreUpstream:!1},i);n.push(...J),c.push(...Q)}),te.forEach(z=>{if(!z.getDataType(i)){const Q={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,actionEntities:null,index:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:dt.OrDataTypeGroup,parent:Z.toReference()},ne=Ve(Q,this.project);ne.hydrateAncestors(),ne.setParent(Z,i),ne.addSelfToProject(i),i==null||i.add(ne,se.Added),ne.initChildren(i),i||ne.captureVersion(),s.push(ne)}})}else{const X={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:(R=this.currentValueArgumentDeclaration)==null?void 0:R.toReference()},te=Ve(X,this.project);te.hydrateAncestors(),te.setParent(this.currentValueArgumentDeclaration,i),te.addSelfToProject(i),i==null||i.add(te,se.Added),te.initChildren(i),i||te.captureVersion(),Z=te;const z=K.getDataType(i);(((I=z==null?void 0:z.entity)==null?void 0:I.properties)||[]).forEach(Q=>{if(!Q.getDataType(i)){const ae={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,staticEntities:null,interactiveEntities:null,actionEntities:null,index:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parentRelationType:dt.OrDataTypeGroup,parent:te.toReference()},de=Ve(ae,this.project);de.hydrateAncestors(),de.setParent(te,i),de.addSelfToProject(i),i==null||i.add(de,se.Added),de.initChildren(i),i||de.captureVersion(),s.push(de)}})}}else{const W={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.ArgumentDeclaration,name:Ji.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,constant:!0,defaultValue:null,index:this.body.inputs.length,required:!0,implements:[q],writesValues:[],dataType:null,parent:this.body.toReference()},Z=Ve(W,this.project);Z.hydrateAncestors(),Z.setParent(this.body,i),Z.addSelfToProject(i),i==null||i.add(Z,se.Added),Z.initChildren(i),q&&!Z.implements.find(X=>X.id===q.id)&&(Z.addImplementation(q,i),n.push(Z)),s.push(Z),i||Z.captureVersion()}break}case Lt.String:{const L=this.body.inputs.find(W=>!!W.implements.find(Z=>Z.id===B[r.Loop][Lt.String].body.inputs.currentValue.id));if(!this.inputs.find(W=>{var Z;return((Z=W.declaration)==null?void 0:Z.id)===B[r.Loop][Lt.String].inputs.string.id}))break;const q=this.getCurrentValueBuiltInValueDescriptor();if(L){q&&!L.implements.find(X=>X.id===q.id)&&(L.addImplementation(q,i),n.push(L));let Z=L.getDataType(i);if(Z){const X=this.project.getBuiltIn(B["primitive-entity"].string.id);((x=Z.entity)==null?void 0:x.id)!==X.id&&(Z.setEntity(X,i),n.push(Z))}else{const X={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.DataType,foreignKeyRef:null,foreignKeyAllowed:null,options:[],implementationChooseOne:!1,parentRelationType:null,staticEntities:null,interactiveEntities:null,index:null,actionEntities:null,isList:!1,entity:null,asType:!1,like:!1,inferred:!1,andChildrenGroup:null,orChildrenGroup:null,parent:($=this.currentValueArgumentDeclaration)==null?void 0:$.toReference()},te=Ve(X,this.project);te.hydrateAncestors(),te.setParent(this.currentValueArgumentDeclaration,i),te.addSelfToProject(i),i==null||i.add(te,se.Added),te.initChildren(i),i||te.captureVersion(),s.push(te),Z=te}}else{const W={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.ArgumentDeclaration,name:Ji.CURRENT_VALUE_ARG_NAME,codeName:null,description:null,index:this.body.inputs.length,required:!0,constant:!0,defaultValue:null,implements:[q],writesValues:[],dataType:null,parent:this.body.toReference()},Z=Ve(W,this.project);Z.hydrateAncestors(),Z.setParent(this.body,i),Z.addSelfToProject(i),i==null||i.add(Z,se.Added),Z.initChildren(i),q&&!Z.implements.find(X=>X.id===q.id)&&(Z.addImplementation(q,i),n.push(Z)),s.push(Z),i||Z.captureVersion()}break}}const{updated:f,added:h,removed:m}=this.removeExtraBodyArgumentDeclarations(i);return n.push(...f),s.push(...h),c.push(...m),i==null||i.attemptAutoclose("create-current-value-input-based-on-input-map",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}syncFixedBodyArgumentDeclarations(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-fixed-body-argument-declarations"))){const n=[],s=[],c=[],e=[],{updated:f,added:h,removed:m}=this.createCurrentIterationNumberArgumentDeclaration(i);n.push(...f),s.push(...h),c.push(...m);const{updated:T,added:g,removed:b}=this.createCurrentValueInputBasedOnInputMap(i);return n.push(...T),s.push(...g),c.push(...b),i==null||i.attemptAutoclose("sync-fixed-body-argument-declarations",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}syncInputMaps(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-input-maps"))){const n=[],s=[],c=[],e=[];switch(this.declaration.id){case Lt.List:{let f=null;if(this.inputs.forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)===B[r.Loop]["list-loop"].inputs.list.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==B[r.Loop]["list-loop"].inputs.list.id){const m=this.project.get(B[r.Loop]["list-loop"].inputs.list.id);f.setDeclaration(m,i),n.push(f)}}else{const m=this.project.get(B[r.Loop]["list-loop"].inputs.list.id),T={dataType:null,id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},g=Ve(T,this.project);g.hydrateAncestors(),g.setParent(this,i),g.addSelfToProject(i),i==null||i.add(g,se.Added),g.initChildren(i),i||g.captureVersion(),s.push(g)}[...this.inputs].forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)!==B[r.Loop]["list-loop"].inputs.list.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,T)=>U(m.createdAt).isBefore(U(T.createdAt))?-1:1).forEach((m,T)=>{T!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Lt.ManualFlow:{this.inputs.forEach(f=>{f.remove({ignoreUpstream:!1},i),c.push(f)});break}case Lt.Counted:{let f=null;if(this.inputs.forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)===B[r.Loop]["counted-loop"].inputs.number.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==B[r.Loop]["counted-loop"].inputs.number.id){const m=this.project.get(B[r.Loop]["counted-loop"].inputs.number.id);f.setDeclaration(m,i),n.push(f)}}else{const m=this.project.get(B[r.Loop]["counted-loop"].inputs.number.id),T={dataType:null,id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},g=Ve(T,this.project);g.hydrateAncestors(),g.setParent(this,i),g.addSelfToProject(i),i==null||i.add(g,se.Added),g.initChildren(i),i||g.captureVersion(),s.push(g)}[...this.inputs].forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)!==B[r.Loop]["counted-loop"].inputs.number.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,T)=>U(m.createdAt).isBefore(U(T.createdAt))?-1:1).forEach((m,T)=>{T!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Lt.ObjectKeys:{let f=null;if(this.inputs.forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)===B[r.Loop]["object-keys-loop"].inputs.object.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==B[r.Loop]["object-keys-loop"].inputs.object.id){const m=this.project.get(B[r.Loop]["object-keys-loop"].inputs.object.id);f.setDeclaration(m,i),n.push(f)}}else{const m=this.project.get(B[r.Loop]["object-keys-loop"].inputs.object.id),T={dataType:null,id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},g=Ve(T,this.project);g.hydrateAncestors(),g.setParent(this,i),g.addSelfToProject(i),i==null||i.add(g,se.Added),g.initChildren(i),i||g.captureVersion(),s.push(g)}[...this.inputs].forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)!==B[r.Loop]["object-keys-loop"].inputs.object.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,T)=>U(m.createdAt).isBefore(U(T.createdAt))?-1:1).forEach((m,T)=>{T!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Lt.ObjectValues:{let f=null;if(this.inputs.forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)===B[r.Loop]["object-values-loop"].inputs.object.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==B[r.Loop]["object-values-loop"].inputs.object.id){const m=this.project.get(B[r.Loop]["object-values-loop"].inputs.object.id);f.setDeclaration(m,i),n.push(f)}}else{const m=this.project.get(B[r.Loop]["object-values-loop"].inputs.object.id),T={dataType:null,id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},g=Ve(T,this.project);g.hydrateAncestors(),g.setParent(this,i),g.addSelfToProject(i),i==null||i.add(g,se.Added),g.initChildren(i),i||g.captureVersion(),s.push(g)}[...this.inputs].forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)!==B[r.Loop]["object-values-loop"].inputs.object.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,T)=>U(m.createdAt).isBefore(U(T.createdAt))?-1:1).forEach((m,T)=>{T!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}case Lt.String:{let f=null;if(this.inputs.forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)===B[r.Loop]["string-loop"].inputs.string.id?f=m:(m.remove({ignoreUpstream:!1},i),c.push(m))}),f){if(f.declaration.id!==B[r.Loop]["string-loop"].inputs.string.id){const m=this.project.get(B[r.Loop]["string-loop"].inputs.string.id);f.setDeclaration(m,i),n.push(f)}}else{const m=this.project.get(B[r.Loop]["string-loop"].inputs.string.id),T={dataType:null,id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.InputMap,parentRelationType:null,name:null,codeName:null,description:null,index:0,declaration:m.toJSON(),readsValue:null,defaultValue:null,parent:this.toReference()},g=Ve(T,this.project);g.hydrateAncestors(),g.setParent(this,i),g.addSelfToProject(i),i==null||i.add(g,se.Added),g.initChildren(i),i||g.captureVersion(),s.push(g)}[...this.inputs].forEach(m=>{var T;((T=m.declaration)==null?void 0:T.id)!==B[r.Loop]["string-loop"].inputs.string.id&&(m.remove({ignoreUpstream:!1},i),c.push(m))}),this.inputs.sort((m,T)=>U(m.createdAt).isBefore(U(T.createdAt))?-1:1).forEach((m,T)=>{T!==0&&(m.remove({ignoreUpstream:!1},i),c.push(m))});break}}return this.inputs.forEach(f=>{const{updated:h,added:m,removed:T}=f.afterAllChildrenInitialized(i);n.push(...h),s.push(...m),c.push(...T)}),this.inputs.sort((f,h)=>f.index-h.index),i==null||i.attemptAutoclose("sync-input-maps",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}getValueInputMapDeclarationId(){switch(this.declaration.id){case Lt.List:return B[r.Loop]["list-loop"].inputs.list.id;case Lt.ObjectKeys:return B[r.Loop]["object-keys-loop"].inputs.object.id;case Lt.ObjectValues:return B[r.Loop]["object-values-loop"].inputs.object.id;case Lt.String:return B[r.Loop]["string-loop"].inputs.string.id;case Lt.Counted:return B[r.Loop]["counted-loop"].inputs.number.id;default:return null}}getCurrentValueBuiltInValueDescriptor(){var n;if(this.declaration.id===Lt.ManualFlow||this.declaration.id===Lt.Counted)return null;const i=(n=B[r.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:n.id;return i?this.project.get(i):null}getCurrentIterationNumberBuiltInValueDescriptor(){const i=B[r.Loop][this.declaration.id].body.inputs.iterationNumber.id;return this.project.get(i)}syncBody(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-body"))){var m;const n=[],s=[],c=[],e=[],f=B[r.Loop][this.declaration.id].body.id,h=this.project.getBuiltIn(f);if(this.body)((m=this.body.implements)==null?void 0:m.id)!==h.id&&(this.body.setImplements(h,i),this.body.setParent(this,i),n.push(this.body));else{const T=Wp.new(i);T.implements=h.toJSON(),T.name=h.name,T.parent=this.toReference();const g=Ve(T,this.project);g.hydrateAncestors(),g.setParent(this,i),g.addSelfToProject(i),i==null||i.add(g,se.Added),g.initChildren(i),i||g.captureVersion(),s.push(g)}return i==null||i.attemptAutoclose("sync-body",this.id),{self:this,updated:V(n),added:V(s),removed:V(c),affected:V(e)}}checkIsSynced(){var b,R,I,D,N,$,x,L,K,q,W,Z,X,te,z,J,Q,ne,ae;if((!this.body||!((b=this.body)!=null&&b.dataType)||!((R=this.body)!=null&&R.dataType.entity))&&this.id)return!1;const i=[Lt.List,Lt.ObjectKeys,Lt.ObjectValues,Lt.String],n=this.body.inputs.find(de=>de.implements.find(fe=>fe.id===B[r.Loop][this.declaration.id].body.inputs.iterationNumber.id))||null,s=this.body.inputs.find(de=>de.implements.find(fe=>{var me;return fe.id===((me=B[r.Loop][this.declaration.id].body.inputs.currentValue)==null?void 0:me.id)}))||null;if(!n||i.includes(this.declaration.id)&&!s)return!1;if(this.declaration.id===Lt.List){const de=this.inputs.find(fe=>{var me;return((me=fe.declaration)==null?void 0:me.id)===B[r.Loop]["list-loop"].inputs.list.id});if(de&&s){const fe=de.getDataType(null),me=s.getDataType(null),be=ji(fe,me,{ignoreTopListDif:!0});if(!be.compatible||!be.exact||(me==null?void 0:me.isList)!==!1)return!1}}const c=[...this.breakStatements,...this.continueStatements],e=this.getDataType();if(((I=e==null?void 0:e.entity)==null?void 0:I.id)!==B["primitive-entity"].void.id&&(e!=null&&e.entity||e!=null&&e.isGroup||e!=null&&e.foreignKeyRef)){if(!this.body.inputs.find(fe=>{var me,be,Ce;return((be=(me=fe.dataType)==null?void 0:me.entity)==null?void 0:be.id)===((Ce=e==null?void 0:e.entity)==null?void 0:Ce.id)})||((D=e==null?void 0:e.entity)==null?void 0:D.type)===r.DefinitionEntity&&(!(e==null?void 0:e.entity).properties.every(be=>this.outputs.find(Ce=>{var Oe;return((Oe=Ce.declaration)==null?void 0:Oe.id)===be.id}))||!c.every(be=>{const Ce=be.outputs.filter(Re=>!Re.deleted),Oe=(e==null?void 0:e.entity).properties.every(Re=>Ce.find(Ke=>{var Je;return((Je=Ke.declaration)==null?void 0:Je.id)===Re.id})),xe=Ce.every(Re=>(e==null?void 0:e.entity).properties.find(Ke=>{var Je;return Ke.id===((Je=Re.declaration)==null?void 0:Je.id)}));return Oe&&xe})))return!1}else if(this.body.inputs.find(me=>{var be,Ce,Oe;return((Ce=(be=me.dataType)==null?void 0:be.entity)==null?void 0:Ce.id)===((Oe=e==null?void 0:e.entity)==null?void 0:Oe.id)})||this.outputs.length>0||![...this.breakStatements,...this.continueStatements].every(me=>me.outputs.filter(be=>!be.deleted).length===0))return!1;if([Lt.List,Lt.Counted,Lt.ObjectKeys,Lt.ObjectValues,Lt.String].includes(this.declaration.id)){if(this.inputs.length!==1)return!1;const de=this.inputs[0],fe=this.getValueInputMapDeclarationId();if(((N=de.declaration)==null?void 0:N.id)!==fe)return!1}else if(this.inputs.length>0)return!1;if((x=($=this.body)==null?void 0:$.dataType)!=null&&x.inferred){const de=this.getUniqueInputMaps();if(c.every(Ce=>!Ce.readsValue)&&!de.length&&((q=(K=(L=this.body)==null?void 0:L.dataType)==null?void 0:K.entity)==null?void 0:q.id)!==B["primitive-entity"].void.id)return!1;const me=c.find(Ce=>Ce.readsValue),be=(X=(Z=(W=me==null?void 0:me.readsValue)==null?void 0:W.getDataType(null))==null?void 0:Z.entity)==null?void 0:X.id;if(be&&be!==((J=(z=(te=this.body)==null?void 0:te.dataType)==null?void 0:z.entity)==null?void 0:J.id))return!1}const h=((ae=(ne=(Q=this.body)==null?void 0:Q.dataType)==null?void 0:ne.entity)==null?void 0:ae.properties)||[],m=this.outputs,T=h.every(de=>m.find(fe=>{var me;return((me=fe.declaration)==null?void 0:me.id)===de.id})),g=m.every(de=>h.find(fe=>{var me;return fe.id===((me=de.declaration)==null?void 0:me.id)}));return!(!T||!g)}syncFromDataType(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-from-data-type"))){const n=[],s=[],c=[],e=[],{updated:f,added:h,removed:m}=this.syncOutputDataType(i);n.push(...f),s.push(...h),c.push(...m);const{updated:T,added:g,removed:b}=this.syncBodyArgumentsDeclarations(i);n.push(...T),s.push(...g),c.push(...b);const{updated:R,added:I,removed:D}=this.syncBodyInputIndexes(i);n.push(...R),s.push(...I),c.push(...D);const{updated:N,added:$,removed:x}=this.syncOutputMaps(i);return n.push(...N),s.push(...$),c.push(...x),i==null||i.attemptAutoclose("sync-from-data-type",this.id),{self:this,updated:V(n),added:V(s),removed:V(c),affected:V(e)}}syncChildren(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-children"))){const n=[],s=[],c=[],e=[],{updated:f,added:h,removed:m}=this.syncBody(i);n.push(...f),s.push(...h),c.push(...m);const{updated:T,added:g,removed:b}=this.syncInputMaps(i);n.push(...T),s.push(...g),c.push(...b);const{updated:R,added:I,removed:D}=this.syncTerminationStatements(i);n.push(...R),s.push(...I),c.push(...D);const{updated:N,added:$,removed:x}=this.syncFromDataType(i);return n.push(...N),s.push(...$),c.push(...x),i==null||i.attemptAutoclose("sync-children",this.id),{self:this,updated:V(n),added:V(s),removed:V(c),affected:V(e)}}getUnusedInputs(){return this.inputs.filter(i=>i.suggestion||!i.readsValue&&!i.defaultValue)}getUnusedOutputs(){return this.outputs.filter(i=>i.suggestion||!i.writesValues.length)}getUsedInputs(){return this.inputs.filter(i=>!i.suggestion&&(i.readsValue||i.defaultValue))}getUsedOutputs(){return this.outputs.filter(i=>!i.suggestion&&i.writesValues.length)}addValueReader(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddValueReader))){var e,f,h,m;if(!this.checkCanEditFromScopeOwnerWithSideEffects(this,P.AddValueReader,n))return this;(i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.SetValueWriter}-${this.id}`,action:P.SetValueWriter,owner:this,errorReason:ze.CannotValueWriteItself,rootAction:((e=n==null?void 0:n.self)==null?void 0:e.id)===this.id&&(n==null?void 0:n.actionName)===P.SetValueWriter}));const s=i.type===r.InputMap&&i.parent.type===r.VariableInstance&&((f=i.declaration)==null?void 0:f.type)===r.Property&&((h=i.declaration)==null?void 0:h.constant),c=i.type===r.VariableInstance&&((m=i.declaration)==null?void 0:m.constant);return(s||c)&&i?(n==null||n.event({id:`${P.SetValueWriter}-${this.id}--${i.id}`,action:P.SetValueWriter,owner:i,counterpart:this,errorReason:ze.ValueReadingOverridesConstantVariable,rootAction:!1}),n==null||n.attemptAutoclose(P.AddValueReader,this.id),this):this.writesValues.includes(i)?(n==null||n.attemptAutoclose(P.AddValueReader,this.id),this):(this.writesValues.push(i),n==null||n.add(this,se.Affected),this)}setDataType(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetDataType))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[setDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetDataType,this.id),this;const s=this.dataType;return(s==null?void 0:s.id)!==(i==null?void 0:i.id)&&(s==null||s.remove({ignoreUpstream:!0},n),this.dataType=i,this.subscribeToDependencies(),n==null||n.add(this,se.Affected)),n==null||n.attemptAutoclose(P.SetDataType,this.id),this}removeValueReader(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveValueReader))){return this.checkCanEditFromScopeOwnerWithSideEffects(this,P.RemoveValueReader,n)?this.writesValues.includes(i)?(this.writesValues=this.writesValues.filter(s=>s.id!==i.id),n==null||n.add(this,se.Affected),this):(n==null||n.attemptAutoclose(P.RemoveValueReader,this.id),this):this}removeDataType(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveDataType))){return this.checkCanEdit(this,i)?(this.dataType&&(this.dataType.remove({ignoreUpstream:!0},i),i==null||i.add(this,se.Affected),this.dataType=null),i==null||i.attemptAutoclose(P.RemoveDataType,this.id),this):(oe.Logger.warn(`[removeDataType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RemoveDataType,this.id),this)}getDataType(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"get-data-type"))){var n;return i==null||i.attemptAutoclose("get-data-type",this.id),this.dataType||((n=this.body)==null?void 0:n.dataType)||null}};C(Ji,"repository",{APICreate:async(i,...n)=>i,APIUpdate:async(i,...n)=>i,APIDelete:async(i,...n)=>i,APIClone:async(i,...n)=>{},APILoad:async(i,...n)=>null,APILoadVersion:async(i,n,...s)=>null}),C(Ji,"type",r.Loop),C(Ji,"USER_MANAGED_PARENT_TYPES",[...fa,r.Project]),C(Ji,"PARENT_TYPES",[...Yn.USER_MANAGED_PARENT_TYPES]),C(Ji,"CURRENT_ITERATION_NUMBER_ARG_NAME","Current iteration number"),C(Ji,"CURRENT_VALUE_ARG_NAME","Current value"),C(Ji,"MUTABLE_BASE_PROPERTIES",["catchesError"]),C(Ji,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),C(Ji,"BASE_PROPERTIES",[...Ji.MUTABLE_BASE_PROPERTIES,...Ji.INMUTABLE_BASE_PROPERTIES]),C(Ji,"MUTABLE_META_PROPERTIES",[...Ji.MUTABLE_BASE_PROPERTIES,"x","y"]),C(Ji,"INMUTABLE_META_PROPERTIES",[...Ji.INMUTABLE_BASE_PROPERTIES]),C(Ji,"META_PROPERTIES",[...Ji.MUTABLE_META_PROPERTIES,...Ji.INMUTABLE_META_PROPERTIES]),C(Ji,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry"]),C(Ji,"INMUTABLE_UPSTREAM_PROPERTIES",["parent","declaration","dataType"]),C(Ji,"UPSTREAM_PROPERTIES",[...Ji.MUTABLE_UPSTREAM_PROPERTIES,...Ji.INMUTABLE_UPSTREAM_PROPERTIES]),C(Ji,"MUTABLE_DOWNSTREAM_PROPERTIES",["body","inputs","outputs","successCalls","errorCalls","error","breakStatements","continueStatements"]),C(Ji,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),C(Ji,"DOWNSTREAM_PROPERTIES",[...Ji.MUTABLE_DOWNSTREAM_PROPERTIES,...Ji.INMUTABLE_DOWNSTREAM_PROPERTIES]),C(Ji,"PROPERTIES",[...Ji.META_PROPERTIES,...Ji.UPSTREAM_PROPERTIES,...Ji.DOWNSTREAM_PROPERTIES]);let Ty=Ji;async function ltt(l,u={}){const i=oe.YieldTracker.from(u),n=Pl(l),s=xl(l),c=Vl(l),e=dtt(l),f=[...n,...s,...c,...e],h=Li(l.errors,f);await i.tick();for(const m of l.inputs)await m.validateAsync({tracker:i});for(const m of l.andChildrenGroup||[])await m.validateAsync({tracker:i});for(const m of l.orChildrenGroup||[])await m.validateAsync({tracker:i});return h}function ott(l){l.inputs.forEach(e=>e.validate());const u=Pl(l),i=xl(l),n=Vl(l),s=dtt(l),c=[...u,...i,...n,...s];return(l.andChildrenGroup||[]).forEach(e=>e.validate()),(l.orChildrenGroup||[]).forEach(e=>e.validate()),Li(l.errors,c)}function dtt(l){var i,n;const u=[];if(((i=l.declaration)==null?void 0:i.id)!==B.condition["condition-group-and"].id&&((n=l.declaration)==null?void 0:n.id)!==B.condition["condition-group-or"].id)return u;if(!l.andChildrenGroup&&!l.orChildrenGroup){const s=Xt({id:`${l.id}--${we.EmptyGroupCondition}`,message:`Condition "${Ee(l,l.project)}" with id "${l.id}" does not have any nested conditions. So it doesn't do anything.`,severity:Ie.Error,code:we.EmptyGroupCondition,entity:l});u.push(s.error)}return Li(l.errors,u)}const iXi=Object.freeze(Object.defineProperty({__proto__:null,validate:ott,validateAsync:ltt},Symbol.toStringTag,{value:"Module"}));var utt=(l=>(l.Parent="parent",l))(utt||{});const kn=class kn extends es{constructor(i,n){super(i);C(this,"initialData");C(this,"id");C(this,"x");C(this,"y");C(this,"type",r.Condition);C(this,"index",null);C(this,"successCalls",[]);C(this,"errorCalls",[]);C(this,"declaration");C(this,"inputs",[]);C(this,"calledBySuccess",[]);C(this,"calledByError",[]);C(this,"calledByEntry",[]);C(this,"andChildrenGroup",null);C(this,"orChildrenGroup",null);C(this,"project");C(this,"errors",[]);C(this,"parent");C(this,"detachedDependents",{});C(this,"knownVersions",null);C(this,"activeVersion",!1);C(this,"initialized",!1);C(this,"startedInitialization",!1);this.initialData=i,this.project=n,this.id=i.id,this.x=i.x,this.y=i.y,this.index=i.index??null}static new(i=null){return{id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:(i==null?void 0:i.author)||M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.Condition,declaration:null,index:null,inputs:[],parent:null,andChildrenGroup:null,orChildrenGroup:null,calledByEntry:[],calledBySuccess:[],calledByError:[],errorCalls:[],successCalls:[],x:0,y:0}}static fromGenerationTarget(i,n,s){var I,D;const c=s===void 0?n.addChangeSet(new ie(n,M.sessionAuthor,U().toISOString(),n,!0,P.CreateFromGenerationTarget)):s;let e=n;if(i.parent){const N=he(i.parent);e=n.get(N)}const f=(i.calledByEntry||[]).map(N=>{const $=he(N);return n.get($)}),h=(i.calledBySuccess||[]).map(N=>{const $=he(N);return n.get($)}),m=(i.calledByError||[]).map(N=>{const $=he(N);return n.get($)});let T;if(i.declaration){const N=he(i.declaration);T=n.get(N)}let g=null;e&&e.type===r.Condition&&(((I=e.declaration)==null?void 0:I.id)===ga.Or?g=(e.orChildrenGroup||[]).length:((D=e.declaration)==null?void 0:D.id)===ga.And&&(g=(e.andChildrenGroup||[]).length));const b={id:i.id,version:M.UUID.uuid(),createdAt:(c==null?void 0:c.timestamp)||U().toISOString(),author:(c==null?void 0:c.author)||M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.Condition,index:g,declaration:T.toJSON(),andChildrenGroup:[],orChildrenGroup:[],calledByEntry:f.map(N=>N.toReference()),calledBySuccess:h.map(N=>N.toReference()),calledByError:m.map(N=>N.toReference()),errorCalls:[],successCalls:[],inputs:[],x:0,y:0,parent:e.toReference()},R=Ve(b,n);return R.hydrateAncestors(),R.setParent(e,c),R.addSelfToProject(c),c==null||c.add(R,se.Added),R.initChildren(c),c||R.captureVersion(),R}static validateGenerationTarget(i,n){let s=JSON.parse(JSON.stringify(i));const c=[],e=[],f=$s(s,{parent:{list:!1,types:[...fa,r.Project],optional:!0}},n);c.push(...f.explanations),s=f.modifiedData;const h=Ka(s);if(e.push(...f.errors,...h.errors),c.push(...h.explanations),!i.declaration)e.push(new Se({id:`${i.id}--${Me.InvalidObjectStructure}`,code:Me.InvalidObjectStructure,severity:Ie.Error,message:`Entity of type '${i.type}' with id '${i.id}' is missing the 'declaration' property. This property is required for a '${i.type}' entity and must point to one of the built-in action descriptors reserved for '${r.Condition}' entities.`})),c.push({id:yr.AllConditionActionDescriptors,message:oD(n)});else if(!n.get(i.declaration))e.push(new Se({id:`${i.id}--${Ae.ReferencedEntityNotFound}`,code:Ae.ReferencedEntityNotFound,severity:Ie.Error,message:`Entity of type '${i.type}' with id '${i.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 '${r.Condition}' entities.`})),c.push({id:yr.AllConditionActionDescriptors,message:oD(n)});else{const T=Wyt(i.declaration,n);e.push(...T.errors),c.push(...T.explanations)}return{errors:e,explanations:c,modifiedData:s}}validateGeneratedUpdate(i){const n=[],s=[];return i.parent&&n.push(new Se({id:`${this.id}--${Ae.InvalidParentUpdate}`,code:Ae.InvalidParentUpdate,severity:Ie.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.
|
|
48
48
|
If an entity is called by another, they must be in the same scope, which means they have the same parent.`})),{errors:n,explanations:s,modifiedData:i}}subscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]||(this.detachedDependents[n.entity.id]=n)}),this}unsubscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]&&delete this.detachedDependents[n.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const n=[],s=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);n.push(...h.updated),s.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}onDetachedDependencyRemoved(i,n,s){const c=[],e=[],f=[],h=[];if(n==="parent"){const{updated:m,added:T,removed:g}=this.remove({ignoreUpstream:!1},s);c.push(...m),e.push(...T),f.push(...g)}return{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}onDetachedDependencyRestored(i,n,s){const c=[],e=[],f=[],h=[];if(n==="parent"){const{updated:m,added:T,removed:g}=this.restore({},s);c.push(...m),e.push(...T),f.push(...g)}return{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}unsubscribeFromDependencies(){return this.parent.unsubscribeDependents([{entity:this,field:"parent"}]),this}subscribeToDependencies(){var i;return(i=this.parent)==null||i.subscribeDependents([{entity:this,field:"parent"}]),this}increaseVersion(i){var n;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((n=this.knownVersions)!=null&&n.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=M.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var n;const i=((n=this.knownVersions)==null?void 0:n.get(this.version))||new kn(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new kn(this,this.project);return this.apply(i)}apply(i){const n=this.toMeta();return i.metaSync(n,null),i.inputs=[...this.inputs],i.declaration=this.declaration,i.andChildrenGroup=this.andChildrenGroup?[...this.andChildrenGroup]:this.andChildrenGroup,i.orChildrenGroup=this.orChildrenGroup?[...this.orChildrenGroup]:this.orChildrenGroup,i.successCalls=[...this.successCalls],i.errorCalls=[...this.errorCalls],i.calledBySuccess=[...this.calledBySuccess],i.calledByError=[...this.calledByError],i.calledByEntry=[...this.calledByEntry],i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const n=[],s=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);n.push(this.parent,...f.updated),s.push(...f.added),c.push(...f.removed)}return{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}async restoreVersion(i,n){var m;const s=[],c=[],e=[],f=[];if(this.version===i&&(n!=null&&n.skipIfSameVersion))return{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this};if(!this.knownVersions){const T=new Map;for(const[g,b]of this.knownVersions||new Map){if(T.set(g,b),b.activeVersion=!1,b.knownVersions)for(const[R,I]of b.knownVersions)T.set(R,I);b.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const T=await this.APILoadVersion({},i);if(!T)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new kn(T,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.inputs=[...h.inputs],this.declaration=h.declaration,this.andChildrenGroup=h.andChildrenGroup?[...h.andChildrenGroup]:null,this.orChildrenGroup=h.orChildrenGroup?[...h.orChildrenGroup]:null,this.successCalls=[...h.successCalls],this.errorCalls=[...h.errorCalls],this.calledBySuccess=[...h.calledBySuccess],this.calledByError=[...h.calledByError],this.calledByEntry=[...h.calledByEntry],this.parent=h.parent,{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this}}updateWithShallowTransfer(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithShallowTransfer))){var s,c;if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,n),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,i.parent){const e=he(i.parent),f=this.project.get(e),h=this.parent;if(h&&h.id!==(f==null?void 0:f.id)&&this.removeFromParent(n),f)this.setParent(f,n),this.addSelfToProject(n);else throw n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else throw n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.declaration){const e=he(i.declaration),f=this.project.get(e);f&&this.setDeclaration(f)}return(s=i.andChildrenGroup)==null||s.forEach(e=>{const f=he(e),h=this.project.get(f);h&&(this.addToAndGroup(h,n),h.setParent(this,n))}),[...this.andChildrenGroup||[]].forEach(e=>{var h;((h=i.andChildrenGroup)==null?void 0:h.find(m=>he(m)===e.id))||(this.removeChildGroup(e,n),e.removeFromParent(n))}),(c=i.orChildrenGroup)==null||c.forEach(e=>{const f=he(e),h=this.project.get(f);h&&(this.addToOrGroup(h,n),h.setParent(this,n))}),[...this.orChildrenGroup||[]].forEach(e=>{var h;((h=i.orChildrenGroup)==null?void 0:h.find(m=>he(m)===e.id))||(this.removeChildGroup(e,n),e.removeFromParent(n))}),i.calledByEntry.forEach(e=>{const f=he(e),h=this.project.get(f);h&&(this.addEntryCaller(h,n),h.addCall(this,n))}),[...this.calledByEntry].forEach(e=>{i.calledByEntry.find(h=>he(h)===e.id)||(this.removeCaller(e,n),e.removeCall(this,n))}),i.calledBySuccess.forEach(e=>{const f=he(e),h=this.project.get(f);h&&(this.addSuccessCaller(h,n),h.addSuccessCall(this,n))}),[...this.calledBySuccess].forEach(e=>{i.calledBySuccess.find(h=>he(h)===e.id)||(this.removeCaller(e,n),e.removeCall(this,n))}),i.calledByError.forEach(e=>{const f=he(e),h=this.project.get(f);h&&(this.addErrorCaller(h,n),h.addErrorCall(this,n))}),[...this.calledByError].forEach(e=>{i.calledByError.find(h=>he(h)===e.id)||(this.removeCaller(e,n),e.removeCall(this,n))}),this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithGenerationTarget))){var s,c,e;if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,n),i.parent){const f=he(i.parent),h=this.project.get(f),m=this.parent;if(m&&m.id!==(h==null?void 0:h.id)&&this.removeFromParent(n),h)this.setParent(h,n),this.addSelfToProject(n);else throw n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${f}' that isn't found in the project`)}if(i.declaration){const f=he(i.declaration),h=this.project.get(f);if(h)this.setDeclaration(h);else throw new Error(`${this.type} with id '${this.id}' has a 'declaration' reference '${f}' that isn't found in the project`)}return(s=i.calledByEntry)==null||s.forEach(f=>{const h=he(f),m=this.project.get(h);if(m)this.addEntryCaller(m,n),m.addCall(this,n);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByEntry' reference '${h}' that isn't found in the project`)}),i.calledByEntry&&[...this.calledByEntry].forEach(f=>{var m;((m=i.calledByEntry)==null?void 0:m.find(T=>he(T)===f.id))||(this.removeCaller(f,n),f.removeCall(this,n))}),(c=i.calledBySuccess)==null||c.forEach(f=>{const h=he(f),m=this.project.get(h);if(m)this.addSuccessCaller(m,n),m.addSuccessCall(this,n);else throw new Error(`${this.type} with id '${this.id}' has a 'calledBySuccess' reference '${h}' that isn't found in the project`)}),i.calledBySuccess&&[...this.calledBySuccess].forEach(f=>{var m;((m=i.calledBySuccess)==null?void 0:m.find(T=>he(T)===f.id))||(this.removeCaller(f,n),f.removeCall(this,n))}),(e=i.calledByError)==null||e.forEach(f=>{const h=he(f),m=this.project.get(h);if(m)this.addErrorCaller(m,n),m.addErrorCall(this,n);else throw new Error(`${this.type} with id '${this.id}' has a 'calledByError' reference '${h}' that isn't found in the project`)}),i.calledByError&&[...this.calledByError].forEach(f=>{var m;((m=i.calledByError)==null?void 0:m.find(T=>he(T)===f.id))||(this.removeCaller(f,n),f.removeCall(this,n))}),this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],n=[],s=[],c=[];if(this.initialData.parent){const e=he(this.initialData.parent),f=this.project.get(e);if(f)this.setParent(f,null);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.declaration){const e=he(this.initialData.declaration),f=this.project.get(e);f&&(this.setDeclaration(f),i.push(f))}return this.initialData.calledByEntry.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.addEntryCaller(h,null)}),this.initialData.calledBySuccess.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.addSuccessCaller(h,null)}),this.initialData.calledByError.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.addErrorCaller(h,null)}),{updated:V(i),added:V(n),removed:V(s),affected:V(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AfterAllChildrenInitialized))){var T,g;if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];if(this.initialized=!0,this.parent.type===r.Condition){let b=this.index||0;const R=(this.parent.declaration.id===ga.And?this.parent.andChildrenGroup||[]:this.parent.orChildrenGroup||[]).filter(D=>!D.deleted&&D.id!==this.id);R.length&&(b>R.length+1?b=R.length:b<0&&(b=0)),R.find(D=>(D.index||0)===b&&!D.deleted)&&R.filter(D=>(D.index||0)>=b&&!D.deleted).forEach(D=>{D.metaSync({index:(D.index||0)+1},i),i==null||i.add(D,se.Updated),n.push(D)}),this.metaSync({index:b},i)}(T=this.andChildrenGroup)!=null&&T.length&&this.andChildrenGroup.sort((b,R)=>(b.index||0)-(R.index||0)),(g=this.orChildrenGroup)!=null&&g.length&&this.orChildrenGroup.sort((b,R)=>(b.index||0)-(R.index||0)),this.inputs.sort((b,R)=>{var I,D;return(b.index??((I=b.declaration)==null?void 0:I.index))-(R.index??((D=R.declaration)==null?void 0:D.index))});const{updated:f,added:h,removed:m}=this.syncInputs(i);return n.push(...f),s.push(...h),c.push(...m),i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){const n=[this],s=[],c=[],e=[];return this.parent===this.project?this.project.addCondition(this):this.parent.type===r.Condition&&(this.parent.declaration.id===ga.And?this.parent.addToAndGroup(this,i):this.parent.declaration.id===ga.Or&&this.parent.addToOrGroup(this,i)),this.successCalls.forEach(f=>{f.addSuccessCaller(this,i),n.push(f)}),this.errorCalls.forEach(f=>{f.addErrorCaller(this,i),n.push(f)}),this.calledByEntry.forEach(f=>{f.addCall(this,i),n.push(f)}),this.calledBySuccess.forEach(f=>{f.addSuccessCall(this,i),n.push(f)}),this.calledByError.forEach(f=>{f.addErrorCall(this,i),n.push(f)}),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}get calledBy(){return[...this.calledByEntry,...this.calledBySuccess,...this.calledByError]}removeInput(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveInput))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[removeInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.RemoveInput,this.id),this;const s=this.inputs.findIndex(c=>c.id===i.id);return s>-1&&(this.inputs.splice(s,1),n&&(n==null||n.add(this,se.Affected))),n==null||n.attemptAutoclose(P.RemoveInput,this.id),this}addInput(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddInput))){return this.checkCanEdit(this,n)?this.inputs.includes(i)?(n==null||n.attemptAutoclose(P.AddInput,this.id),this):(this.inputs.push(i),n==null||n.add(this,se.Affected),n==null||n.attemptAutoclose(P.AddInput,this.id),this):(oe.Logger.warn(`[addInput] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.AddInput,this.id),this)}addOutput(i){return this}removeOutput(i){return this}addSuccessCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddSuccessCaller)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddSuccessCaller,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddSuccessCaller}-${this.id}--${ze.CannotSuccessCallItself}`,action:P.AddSuccessCaller,owner:this,errorReason:ze.CannotSuccessCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddSuccessCaller})),this.calledBySuccess.find(e=>e.id===i.id)||(this.calledBySuccess.push(i),n==null||n.add(this,se.Updated),s&&ni(this,n)),n==null||n.attemptAutoclose(P.AddSuccessCaller,this.id),this):this}addErrorCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddErrorCaller)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddErrorCaller,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddErrorCaller}-${this.id}--${ze.CannotErrorCallItself}`,action:P.AddErrorCaller,owner:this,errorReason:ze.CannotErrorCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddErrorCaller})),this.calledByError.find(e=>e.id===i.id)||(this.calledByError.push(i),n==null||n.add(this,se.Updated),s&&ni(this,n)),n==null||n.attemptAutoclose(P.AddErrorCaller,this.id),this):this}addEntryCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddEntryCaller)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddEntryCaller,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddEntryCaller}-${this.id}--${ze.CannotEntryCallItself}`,action:P.AddEntryCaller,owner:this,errorReason:ze.CannotEntryCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddEntryCaller})),this.calledByEntry.find(e=>e.id===i.id)||(this.calledByEntry.push(i),n==null||n.add(this,se.Updated),s&&ni(this,n)),n==null||n.attemptAutoclose(P.AddEntryCaller,this.id),this):this}addErrorCall(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddErrorCall)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddErrorCall,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddErrorCaller}-${this.id}--${ze.CannotErrorCallItself}`,action:P.AddErrorCaller,owner:this,errorReason:ze.CannotErrorCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddErrorCaller})),this.errorCalls.find(e=>e.id===i.id)||(this.errorCalls.push(i),s&&ni(this,n),n==null||n.add(this,se.Affected)),n==null||n.attemptAutoclose(P.AddErrorCall,this.id),this):this}addSuccessCall(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddSuccessCall)),s=!1){var c;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.AddSuccessCall,n)?((i==null?void 0:i.id)===this.id&&(n==null||n.event({id:`${P.AddSuccessCaller}-${this.id}`,action:P.AddSuccessCaller,owner:this,errorReason:ze.CannotSuccessCallItself,rootAction:((c=n==null?void 0:n.self)==null?void 0:c.id)===this.id&&(n==null?void 0:n.actionName)===P.AddSuccessCaller})),this.successCalls.find(e=>e.id===i.id)||(this.successCalls.push(i),s&&ni(this,n),n==null||n.add(this,se.Affected)),n==null||n.attemptAutoclose(P.AddSuccessCall,this.id),this):this}removeCall(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveCall)),s=!1){if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,P.RemoveCall,n))return this;const c=this.successCalls.findIndex(f=>f.id===i.id);c>-1&&(this.successCalls.splice(c,1),n==null||n.add(this,se.Affected));const e=this.errorCalls.findIndex(f=>f.id===i.id);return e>-1&&(this.errorCalls.splice(e,1),n==null||n.add(this,se.Affected)),s&&ni(this,n),n==null||n.attemptAutoclose(P.RemoveCall,this.id),this}removeCaller(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveCaller)),s=!1){return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.RemoveCaller,n)?(this.calledBySuccess=this.calledBySuccess.filter(c=>c.id!==i.id?!0:(n==null||n.add(this,se.Updated),n==null||n.add(c,se.Affected),!1)),this.calledByError=this.calledByError.filter(c=>c.id!==i.id?!0:(n==null||n.add(this,se.Updated),n==null||n.add(c,se.Affected),!1)),this.calledByEntry=this.calledByEntry.filter(c=>c.id!==i.id?!0:(n==null||n.add(this,se.Updated),n==null||n.add(c,se.Affected),!1)),s&&ni(this,n),n==null||n.attemptAutoclose(P.RemoveCaller,this.id),this):this}setParent(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetParent))){var s;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.SetParent,n)?(((s=this.parent)==null?void 0:s.id)!==(i==null?void 0:i.id)&&(this.parent=i,n&&(n==null||n.add(this,se.Updated))),n==null||n.attemptAutoclose(P.SetParent,this.id),this):this}removeChildGroup(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveChildGroup))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[removeChildGroup] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.RemoveChildGroup,this.id),this;if(this.andChildrenGroup){const s=this.andChildrenGroup.findIndex(c=>c.id===i.id);s!==-1&&(this.andChildrenGroup.splice(s,1),n==null||n.add(this,se.Updated))}if(this.orChildrenGroup){const s=this.orChildrenGroup.findIndex(c=>c.id===i.id);s!==-1&&(this.orChildrenGroup.splice(s,1),n==null||n.add(this,se.Updated))}return n==null||n.attemptAutoclose(P.RemoveChildGroup,this.id),this}setDeclaration(i){return this.declaration=i,this}initChildren(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"init-children"))){return this.initialized||this.startedInitialization?this:(this.startedInitialization=!0,this.declaration=Ve(this.initialData.declaration,this.project),this.initialData.andChildrenGroup&&(this.andChildrenGroup=this.initialData.andChildrenGroup.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(i),s})),this.initialData.orChildrenGroup&&(this.orChildrenGroup=this.initialData.orChildrenGroup.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(i),s})),this.successCalls=this.initialData.successCalls.map(n=>{const s=Ve(n,this.project);if(s.addSuccessCaller(this,null),[r.BreakStatement,r.ContinueStatement].includes(s.type))s.setParent(this.parent.parent,null),s.initChildren(i);else if(s.type===r.ReturnStatement){const c=ys(this,this.project);s.setParent(c,null),s.initChildren(i)}else s.type!==r.InternalCall&&(s.setParent(this.parent,null),s.initChildren(i));return s}),this.errorCalls=this.initialData.errorCalls.map(n=>{const s=Ve(n,this.project);if(s.addErrorCaller(this,null),[r.BreakStatement,r.ContinueStatement].includes(s.type))s.setParent(this.parent.parent,null),s.initChildren(i);else if(s.type===r.ReturnStatement){const c=ys(this,this.project);s.setParent(c,null),s.initChildren(i)}else s.type!==r.InternalCall&&(s.setParent(this.parent,null),s.initChildren(i));return s}),this.inputs=this.initialData.inputs.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(i),s}),this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this)}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(n=>{n.version!==this.version&&(n.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const s=Za(this,i,n),c=qa(this,s),e=this.toMeta();return this.x=s.x!==void 0?s.x:e.x,this.y=s.y!==void 0?s.y:e.y,this.index=s.index!==void 0?s.index:e.index,super.baseMetaSync(s,this,n),s.deleted===!0&&!e.deleted?n==null||n.add(this,se.Removed):s.deleted===!1&&e.deleted?n==null||n.add(this,se.Added):c&&(n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=st,...n){return await kn.repository.APILoad(this.id,...n),this}async APICreate(i=st,...n){return await kn.repository.APICreate(this.toShallowJSON(),...n),this}async APIUpdate(i=st,...n){return await kn.repository.APIUpdate(this.toShallowJSON(),...n),this}async APIDelete(i=st,...n){return await kn.repository.APIDelete(this.toShallowJSON(),...n),this}async APIClone(i=st,...n){return await kn.repository.APIClone(this.id,...n),this}async APILoadVersion(i=st,n,...s){return await kn.repository.APILoadVersion(this.id,n,...s)}removeFromParent(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveFromParent))){var f;if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return this.parent.type===r.Project?(this.parent.removeCondition(this),e.push(this.parent)):((f=this.parent)==null?void 0:f.type)===r.Condition?this.parent.removeChildGroup(this,i):this.parent.detachedChildren.includes(this)&&this.parent.unsubscribeDetachedChild(this),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:V(c),updated:V(n),removed:V(s),affected:V(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveEntity))){var h;if(!this.checkCanDelete(this,n))return oe.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),n==null||n.event({id:`${P.RemoveEntity}-${this.id}--${ze.ActionOwnerEntityNonDeletable}`,action:P.RemoveEntity,owner:this,errorReason:ze.ActionOwnerEntityNonDeletable,rootAction:((h=n==null?void 0:n.self)==null?void 0:h.id)===this.id&&(n==null?void 0:n.actionName)===P.RemoveEntity}),n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const s=[],c=[],e=[],f=[];if(n!=null&&n.hasRemoved(this.id))return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},n),Object.values(this.detachedDependents).forEach(m=>{const{updated:T,removed:g,added:b}=m.entity.onDetachedDependencyRemoved(this,m.field,n);s.push(...T),c.push(...g),e.push(...b)}),this.andChildrenGroup&&this.andChildrenGroup.forEach(m=>{const{removed:T,updated:g}=m.remove({ignoreUpstream:!0},n);c.push(...T),s.push(...g)}),this.orChildrenGroup&&this.orChildrenGroup.forEach(m=>{const{removed:T,updated:g}=m.remove({ignoreUpstream:!0},n);c.push(...T),s.push(...g)}),this.inputs.forEach(m=>{const{updated:T,removed:g}=m.remove({ignoreUpstream:!0},n);s.push(...T),c.push(...g)}),this.successCalls.forEach(m=>{s.push(m),m.removeCaller(this,n)}),this.errorCalls.forEach(m=>{s.push(m),m.removeCaller(this,n)}),!i){const m=this.removeFromParent(n);e.push(...m.added),s.push(...m.updated),c.push(...m.removed),f.push(...m.affected),this.calledBy.forEach(T=>{s.push(T),T.removeCall(this,n)})}return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:V(e),updated:V(s),removed:V(c),affected:V(f),self:this}}restore({}={},i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RestoreEntity))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return i!=null&&i.hasAdded(this.id)?(i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),Object.values(this.detachedDependents).forEach(f=>{const{updated:h,removed:m,added:T}=f.entity.onDetachedDependencyRestored(this,f.field,i);s.push(...h),c.push(...m),n.push(...T)}),this.andChildrenGroup&&this.andChildrenGroup.forEach(f=>{const{updated:h,added:m}=f.restore({},i);s.push(...h),n.push(...m)}),this.orChildrenGroup&&this.orChildrenGroup.forEach(f=>{const{updated:h,added:m}=f.restore({},i);s.push(...h),n.push(...m)}),this.inputs.forEach(f=>{const{updated:h}=f.restore({},i);s.push(...h)}),this.successCalls.forEach(f=>{s.push(f),f.addSuccessCaller(this,i)}),this.errorCalls.forEach(f=>{s.push(f),f.addErrorCaller(this,i)}),this.calledBySuccess.forEach(f=>{s.push(f),f.addSuccessCall(this,i)}),this.calledByError.forEach(f=>{s.push(f),f.addErrorCall(this,i)}),this.calledByEntry.forEach(f=>{s.push(f),f.addCall(this,i)}),this.parent.type===r.Project&&this.project.addCondition(this),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:V(n),updated:V(s),removed:V(c),affected:V(e),self:this})}toFlat(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this,...((s=this.andChildrenGroup)==null?void 0:s.flatMap(e=>e.toFlat(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlat(i)))||[],...this.inputs.flatMap(e=>e.toFlat(i)),...this.successCalls.flatMap(e=>e.toFlat(i)),...this.errorCalls.flatMap(e=>e.toFlat(i)),...this.calledBy.flatMap(e=>e.toFlat(i))])}toFlatIds(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this.id,...((s=this.andChildrenGroup)==null?void 0:s.flatMap(e=>e.toFlatIds(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlatIds(i)))||[],...this.inputs.flatMap(e=>e.toFlatIds(i)),...this.successCalls.flatMap(e=>e.toFlatIds(i)),...this.errorCalls.flatMap(e=>e.toFlatIds(i)),...this.calledBy.flatMap(e=>e.toFlatIds(i))])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,index:this.index,x:this.x,y:this.y,type:this.type,editable:this.editable,deletable:this.deletable}}toJSON(i=new Set){var n,s;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,index:this.index,x:this.x,y:this.y,declaration:this.declaration.toJSON(i),andChildrenGroup:((n=this.andChildrenGroup)==null?void 0:n.map(c=>c.toJSON(i)))||null,orChildrenGroup:((s=this.orChildrenGroup)==null?void 0:s.map(c=>c.toJSON(i)))||null,successCalls:this.successCalls.map(c=>c.toJSON(i)),errorCalls:this.errorCalls.map(c=>c.toJSON(i)),calledBySuccess:this.calledBySuccess.map(c=>c.toReference()),calledByError:this.calledByError.map(c=>c.toReference()),calledByEntry:this.calledByEntry.map(c=>c.toReference()),inputs:this.inputs.map(c=>c.toJSON(i)),parent:this.parent.toReference()})}toJSONClone(i=wt){var s,c,e,f,h,m,T;let n;return(s=i.seenEntityMaps)!=null&&s.has(this.id)?n=i.seenEntityMaps.get(this.id):(n=i.newId||Xa(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,n)),(c=i.seenEntities)!=null&&c.has(n)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(n),(h=i.seenEntities)==null||h.add(this.id),{id:n,version:M.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,index:this.index,x:this.x,y:this.y,declaration:this.declaration.toJSON(),andChildrenGroup:((m=this.andChildrenGroup)==null?void 0:m.map(g=>g.toJSONClone({...i,newId:null})))||null,orChildrenGroup:((T=this.orChildrenGroup)==null?void 0:T.map(g=>g.toJSONClone({...i,newId:null})))||null,successCalls:this.successCalls.map(g=>g.toJSONClone({...i,newId:null})),errorCalls:this.errorCalls.map(g=>g.toJSONClone({...i,newId:null})),calledBySuccess:this.calledBySuccess.map(g=>g.toReference({seenEntityMaps:i.seenEntityMaps})),calledByError:this.calledByError.map(g=>g.toReference({seenEntityMaps:i.seenEntityMaps})),calledByEntry:this.calledByEntry.map(g=>g.toReference({seenEntityMaps:i.seenEntityMaps})),inputs:this.inputs.map(g=>g.toJSONClone({...i,newId:null})),parent:this.parent.toReference({seenEntityMaps:i.seenEntityMaps})})}toReference(i=wt){var s;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n+"--"+M.UUID.uuid()+"--ref",type:r.GenericReference,entityId:n,version:this.version,entityType:this.type}}toShallowJSON(i=wt){var s,c,e;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,index:this.index,x:this.x,y:this.y,declaration:this.declaration.toReference(i),andChildrenGroup:((c=this.andChildrenGroup)==null?void 0:c.map(f=>f.toReference(i)))||null,orChildrenGroup:((e=this.orChildrenGroup)==null?void 0:e.map(f=>f.toReference(i)))||null,inputs:this.inputs.map(f=>f.toReference(i)),successCalls:this.successCalls.map(f=>f.toReference(i)),errorCalls:this.errorCalls.map(f=>f.toReference(i)),calledBySuccess:this.calledBySuccess.map(f=>f.toReference(i)),calledByError:this.calledByError.map(f=>f.toReference(i)),calledByEntry:this.calledByEntry.map(f=>f.toReference(i)),parent:this.parent.toReference(i)}}toFlatJSON(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...((s=this.andChildrenGroup)==null?void 0:s.flatMap(e=>e.toFlatJSON(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlatJSON(i)))||[],...this.inputs.flatMap(e=>e.toFlatJSON(i)),...this.successCalls.flatMap(e=>e.toFlatJSON(i)),...this.errorCalls.flatMap(e=>e.toFlatJSON(i)),...this.calledBy.flatMap(e=>e.toFlatJSON(i))])}toGenerationTarget(i=wt){var c,e;const n=this.parent.type===r.Project?void 0:(c=i.seenEntityMaps)!=null&&c.has(this.parent.id)?i.seenEntityMaps.get(this.parent.id):this.parent.id;let s=this.id;return(e=i.seenEntityMaps)!=null&&e.has(this.id)&&(s=i.seenEntityMaps.get(this.id)),{id:s,type:this.type,declaration:this.declaration.id,calledByEntry:this.calledByEntry.map(f=>f.id),calledBySuccess:this.calledBySuccess.map(f=>f.id),calledByError:this.calledByError.map(f=>f.id),parent:n}}toFlatGenerationTarget(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...((s=this.andChildrenGroup)==null?void 0:s.flatMap(e=>e.toFlatGenerationTarget(i)))||[],...((c=this.orChildrenGroup)==null?void 0:c.flatMap(e=>e.toFlatGenerationTarget(i)))||[],...this.inputs.flatMap(e=>e.toFlatGenerationTarget(i)),...this.successCalls.flatMap(e=>e.toFlatGenerationTarget(i)),...this.errorCalls.flatMap(e=>e.toFlatGenerationTarget(i))])}clearErrors(){var i,n;return this.errors=[],(i=this.andChildrenGroup)==null||i.forEach(s=>s.clearErrors()),(n=this.orChildrenGroup)==null||n.forEach(s=>s.clearErrors()),this.inputs.forEach(s=>s.clearErrors()),this.successCalls.forEach(s=>s.clearErrors()),this.errorCalls.forEach(s=>s.clearErrors()),this}validate(){return this.errors=ott(this),{success:!0}}async validateAsync(i={}){const n=oe.YieldTracker.from(i);return this.errors=await ltt(this,{tracker:n}),{success:!0}}getErrors(){return[...this.errors,...this.inputs.flatMap(n=>n.getErrors()),...this.andChildrenGroup?this.andChildrenGroup.flatMap(n=>n.getErrors()):[],...this.orChildrenGroup?this.orChildrenGroup.flatMap(n=>n.getErrors()):[]]}async getErrorsAsync(i={}){const n=oe.YieldTracker.from(i),s=[...this.errors];await n.tick();for(const c of this.inputs){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}if(await n.tick(),this.andChildrenGroup)for(const c of this.andChildrenGroup){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}if(this.orChildrenGroup)for(const c of this.orChildrenGroup){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}return s}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.CloneEntity)),n=null,s=null,c=!0){var D,N,$;const e=_a(n,this),f=this.toJSON(),h=s||M.UUID.uuid();f.inputs=[];const m=h.split("-id"),T=m[m.length-1||0]||h;f.id=h,f.version=M.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.deletable=!0,f.editable=!0;const g=Cr(f,e);n?g.setParent(n,i):g.setParent(this.parent,null),c&&g.subscribe(),g.initChildren(i),i==null||i.add(g,se.Added);const b=(D=this.andChildrenGroup)==null?void 0:D.map(x=>x.clone(i,g,M.UUID.uuid(),c)),R=(N=this.orChildrenGroup)==null?void 0:N.map(x=>x.clone(i,g,M.UUID.uuid(),c));g.andChildrenGroup=b||null,g.orChildrenGroup=R||null;const I=($=this.inputs)==null?void 0:$.map((x,L)=>x.clone(i,g,T+"-input-map-"+L+"-id",c));return g.inputs=I,i||g.captureVersion(),i==null||i.attemptAutoclose(P.CloneEntity,this.id),g}addToAndGroup(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddToAndGroup))){return this.checkCanEdit(this,n)?(this.andChildrenGroup||(this.andChildrenGroup=[]),this.andChildrenGroup.includes(i)||(this.andChildrenGroup.push(i),n==null||n.add(i,se.Affected)),n==null||n.attemptAutoclose(P.AddToAndGroup,this.id),this):(oe.Logger.warn(`[addToAndGroup] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.AddToAndGroup,this.id),this)}addToOrGroup(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddToOrGroup))){return this.checkCanEdit(this,n)?(this.orChildrenGroup||(this.orChildrenGroup=[]),this.orChildrenGroup.includes(i)||(this.orChildrenGroup.push(i),n==null||n.add(i,se.Affected)),n==null||n.attemptAutoclose(P.AddToOrGroup,this.id),this):(oe.Logger.warn(`[addToOrGroup] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.AddToOrGroup,this.id),this)}removeUnrecognizedInputs(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveUnrecognizedInputs))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[removeUnrecognizedInputs] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RemoveUnrecognizedInputs,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return this.inputs.forEach(h=>{if(!this.declaration.inputs.find(T=>{var g;return T.id===((g=h.declaration)==null?void 0:g.id)})){const T=h.remove({ignoreUpstream:!1},i);c.push(...T.removed),n.push(...T.updated)}}),this.inputs.filter((h,m)=>{const T=this.inputs.findIndex(b=>b.declaration===h.declaration&&b!==h);if(T===-1)return!1;const g=this.inputs[T];return U(g==null?void 0:g.createdAt).isSame(U(h.createdAt))?m>T:!!U(g==null?void 0:g.createdAt).isAfter(h.createdAt)}).forEach(h=>{const m=h.remove({ignoreUpstream:!1},i);c.push(...m.removed),n.push(...m.updated)}),i==null||i.attemptAutoclose(P.RemoveUnrecognizedInputs,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}syncInputs(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SyncInputs))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[syncInputs] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.SyncInputs,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[],f=this.declaration.inputs.filter(g=>g.parentRelationType===k.FixedArguments&&!this.inputs.find(b=>b.declaration.id===g.id));this.inputs.sort((g,b)=>g.index-b.index),f.forEach(g=>{this.inputs.forEach(I=>{I.index>=g.index&&I.metaSync({index:I.index+1},i)});const b={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.InputMap,dataType:null,parentRelationType:null,declaration:g.toJSON(),readsValue:null,defaultValue:null,index:g.index,name:null,codeName:null,description:null,parent:this.toReference()},R=Ve(b,this.project);R.setParent(this,i),R.addSelfToProject(i),i==null||i.add(R,se.Added),R.initChildren(i),i||R.captureVersion()}),this.inputs.sort((g,b)=>g.index-b.index);const{updated:h,added:m,removed:T}=this.removeUnrecognizedInputs(i);return n.push(...h),s.push(...m),c.push(...T),this.inputs.forEach(g=>{const{updated:b,added:R,removed:I}=g.afterAllChildrenInitialized(i);n.push(...b),s.push(...R),c.push(...I)}),this.inputs.sort((g,b)=>g.index-b.index),i==null||i.attemptAutoclose(P.SyncInputs,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}getUnusedInputs(){return this.inputs.filter(i=>i.suggestion||!i.readsValue&&!i.defaultValue)}getUnusedOutputs(){return[]}getUsedInputs(){return this.inputs.filter(i=>!i.suggestion&&(i.readsValue||i.defaultValue))}getUsedOutputs(){return[]}getDataType(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"get-data-type"))){var s;const n=((s=this.declaration)==null?void 0:s.getDataType(i))||null;return i==null||i.attemptAutoclose("get-data-type",this.id),n}};C(kn,"repository",{APICreate:async(i,...n)=>i,APIUpdate:async(i,...n)=>i,APIDelete:async(i,...n)=>i,APIClone:async(i,...n)=>{},APILoad:async(i,...n)=>null,APILoadVersion:async(i,n,...s)=>null}),C(kn,"type",r.Condition),C(kn,"USER_MANAGED_PARENT_TYPES",[...fa,r.Project,r.Condition]),C(kn,"PARENT_TYPES",[...kn.USER_MANAGED_PARENT_TYPES]),C(kn,"MUTABLE_BASE_PROPERTIES",["operator"]),C(kn,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion","index"]),C(kn,"BASE_PROPERTIES",[...kn.MUTABLE_BASE_PROPERTIES,...kn.INMUTABLE_BASE_PROPERTIES]),C(kn,"MUTABLE_META_PROPERTIES",["x","y"]),C(kn,"INMUTABLE_META_PROPERTIES",[...kn.INMUTABLE_BASE_PROPERTIES]),C(kn,"META_PROPERTIES",[...kn.MUTABLE_META_PROPERTIES,...kn.INMUTABLE_META_PROPERTIES]),C(kn,"MUTABLE_UPSTREAM_PROPERTIES",["calledBySuccess","calledByError","calledByEntry","parent"]),C(kn,"INMUTABLE_UPSTREAM_PROPERTIES",[]),C(kn,"UPSTREAM_PROPERTIES",[...kn.MUTABLE_UPSTREAM_PROPERTIES,...kn.INMUTABLE_UPSTREAM_PROPERTIES]),C(kn,"MUTABLE_DOWNSTREAM_PROPERTIES",["andChildrenGroup","orChildrenGroup","successCalls","errorCalls","inputsDeclarations","inputs"]),C(kn,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),C(kn,"DOWNSTREAM_PROPERTIES",[...kn.MUTABLE_DOWNSTREAM_PROPERTIES,...kn.INMUTABLE_DOWNSTREAM_PROPERTIES]),C(kn,"PROPERTIES",[...kn.META_PROPERTIES,...kn.UPSTREAM_PROPERTIES,...kn.DOWNSTREAM_PROPERTIES]);let vy=kn;async function nXi(l,u={}){const i=oe.YieldTracker.from(u),n=[],s=Li(l.errors,n);return await i.tick(),s}function rXi(l){const u=[];return Li(l.errors,u)}async function ptt(l,u={}){const i=oe.YieldTracker.from(u),n=[],s=Li(l.errors,n);return await i.tick(),s}function ctt(l){const u=[];return Li(l.errors,u)}const aXi=Object.freeze(Object.defineProperty({__proto__:null,validate:ctt,validateAsync:ptt},Symbol.toStringTag,{value:"Module"}));function sXi(l,u){const i=[],n=[];if(l.parent)if(l.parent){const s=u.get(l.parent);s?ua.USER_MANAGED_PARENT_TYPES.includes(s.type)||n.push(new Se({id:`${l.id}--${l.parent}--${Ae.InvalidParentReference}`,code:Ae.InvalidParentReference,severity:Ie.Error,message:`Entity of type "${l.type}" with id "${l.id}", has a parent reference which is of type ${s.type}, and therefore that isn't pointing to the following valid types for this reference: '${ti(ua.USER_MANAGED_PARENT_TYPES,"', '","' or '")}'.`})):n.push(new Se({id:`${l.id}--${l.parent}--${Ae.ReferencedEntityNotFound}`,code:Ae.ReferencedEntityNotFound,severity:Ie.Error,message:`Entity of type "${l.type}" with id "${l.id}", is referencing an entity with id "${l.parent}" at 'parent' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`}))}else n.push(new Se({id:`${l.id}--${Me.InvalidObjectStructure}`,code:Me.InvalidObjectStructure,severity:Ie.Error,message:`Entity of type "${l.type}" with id "${l.id}" is missing a 'parent' reference. The 'parent' of a literal value entity must be a reference to an entity of type '${ti(ua.USER_MANAGED_PARENT_TYPES,"', '","', or '")}'.`}));else return n.push(new Se({id:`${l.id}--${Me.InvalidObjectStructure}`,code:Me.InvalidObjectStructure,severity:Ie.Error,message:`Entity of type "${l.type}" with id "${l.id}" is missing a 'parent' reference. The 'parent' of a literal value entity must be a reference to an entity of type '${ti(ua.USER_MANAGED_PARENT_TYPES,"', '","', or '")}'.`})),{errors:n,explanations:i};if(l.valueAsTypeSingle){const s=[],c=[],e=l.valueAsTypeSingle;Array.isArray(e)?e.forEach(f=>{typeof f=="string"?c.push(f):s.push(f)}):typeof e=="string"?c.push(e):s.push(e),s.forEach(f=>{const h=VO(f);n.push(...h),h.length===0&&c.push(f.entityId)}),c.forEach(f=>{const h=u.get(f);h?[r.DefinitionEntity,r.BuiltInBaseEntity].includes(h.type)||n.push(new Se({id:`${l.id}--${f}--${Ae.InvalidImplementsReference}`,code:Ae.InvalidImplementsReference,severity:Ie.Error,message:`Entity of type "${l.type}" with id "${l.id}", has an 'valueAsTypeSingle' reference which is of type ${h.type}, and therefore that isn't pointing to the following valid types for this reference: 'definition-entity', 'function-declaration' or 'operation'.`})):n.push(new Se({id:`${l.id}--${f}--${Ae.ReferencedEntityNotFound}`,code:Ae.ReferencedEntityNotFound,severity:Ie.Error,message:`Entity of type "${l.type}" with id "${l.id}", is referencing an entity with id "${f}" at 'valueAsTypeSingle' that isn't yet found in the project. Perhaps it should be created first. Or perhaps the ID is incorrect.`}))})}return{errors:n,explanations:i}}var ftt=(l=>(l.ValueAsTypeSingle="value-as-type-single",l.ValueAsTypeList="value-as-type-list",l))(ftt||{});const Tn=class Tn extends es{constructor(i,n){super(i);C(this,"initialData");C(this,"type",r.LiteralValue);C(this,"id");C(this,"name");C(this,"autogeneration",null);C(this,"value",null);C(this,"rawString",null);C(this,"valueAsTypeSingle",null);C(this,"valueAsTypeList",null);C(this,"errors",[]);C(this,"parent",null);C(this,"standaloneParent",null);C(this,"project");C(this,"detachedDependents",{});C(this,"knownVersions",null);C(this,"activeVersion",!1);C(this,"initialized",!1);C(this,"startedInitialization",!1);C(this,"standalone",!1);if(this.initialData=i,this.project=n,this.id=i.id,this.name=i.name,this.autogeneration=i.autogeneration,this.value=i.value,this.rawString=i.rawString!==void 0?i.rawString:typeof i.value=="string"?i.value:null,!this.name)throw new Error("[LiteralValueState.constructor] Must have a name in the initial data passed to the constructor")}static new(i=null){return{id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(i==null?void 0:i.timestamp)||U().toISOString(),author:(i==null?void 0:i.author)||M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:"",autogeneration:null,value:null,rawString:null,valueAsTypeSingle:null,valueAsTypeList:null,parent:null}}static fromGenerationTarget(i,n,s){const c=s===void 0?n.addChangeSet(new ie(n,M.sessionAuthor,U().toISOString(),n,!0,P.CreateFromGenerationTarget)):s,e=he(i.parent),f=n.get(e);let h=null,m=null;i.valueAsTypeList?Array.isArray(i.valueAsTypeList)&&(m=i.valueAsTypeList.map(b=>n.get(b)||n.getBuiltIn(b))):i.valueAsTypeSingle&&(h=n.get(i.valueAsTypeSingle)||n.getBuiltIn(i.valueAsTypeSingle));const T={id:i.id,version:M.UUID.uuid(),createdAt:(c==null?void 0:c.timestamp)||U().toISOString(),author:(c==null?void 0:c.author)||M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:i.name,autogeneration:i.autogeneration,valueAsTypeSingle:h,valueAsTypeList:m,value:i.value||null,rawString:i.rawString!==void 0?i.rawString:typeof i.value=="string"?i.value:null,parent:f.toReference()},g=Ve(T,n);return g.hydrateAncestors(),g.setParent(f,c),g.addSelfToProject(c),c==null||c.add(g,se.Added),g.initChildren(c),c||g.captureVersion(),g}static validateGenerationTarget(i,n){let s=JSON.parse(JSON.stringify(i));(s.valueAsTypeList||s.valueAsTypeSingle)&&(s.name=ce.EntityTemplate);const c=[],e=[],f=sXi(s,n),h=Ka(s);return e.push(...f.errors,...h.errors),c.push(...f.explanations,...h.explanations),{errors:e,explanations:c,modifiedData:s}}get valueAsType(){return this.valueAsTypeSingle?this.valueAsTypeSingle:this.valueAsTypeList?this.valueAsTypeList:null}get isFinal(){var i,n;return!!(((i=this.parent)==null?void 0:i.type)===r.Property&&(this.parent.constant||this.parent.implements.some(s=>s.constant))||((n=this.parent)==null?void 0:n.type)===r.Property&&this.parent.parent.type===r.DefinitionEntity&&!zd(this.parent.parent))}validateGeneratedUpdate(i){const n=[],s=[];return i.parent&&n.push(new Se({id:`${this.id}--${Ae.InvalidParentUpdate}`,code:Ae.InvalidParentUpdate,severity:Ie.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.
|
|
49
|
-
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.`})),{errors:n,explanations:s,modifiedData:i}}subscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]||(this.detachedDependents[n.entity.id]=n)}),this}unsubscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]&&delete this.detachedDependents[n.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const n=[],s=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);n.push(...h.updated),s.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}onDetachedDependencyRemoved(i,n,s){const c=[],e=[],f=[],h=[];return n==="value-as-type-single"&&(this.valueAsTypeSingle=null,s==null||s.add(this,se.Updated)),n==="value-as-type-list"&&(this.valueAsTypeList=(this.valueAsTypeList||[]).filter(m=>m.id!==i.id),s==null||s.add(this,se.Updated)),{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}onDetachedDependencyRestored(i,n,s){const c=[],e=[],f=[],h=[];return n==="value-as-type-single"&&(this.valueAsTypeSingle=i,s==null||s.add(this,se.Updated)),n==="value-as-type-list"&&(this.valueAsTypeList=[...Array.isArray(this.valueAsTypeList||[])?this.valueAsTypeList:[],i],s==null||s.add(this,se.Updated)),{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}unsubscribeFromDependencies(){return this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==r.BuiltInBaseEntity&&this.valueAsTypeSingle.unsubscribeDependents([{entity:this,field:"value-as-type-single"}]),this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&this.valueAsTypeList.forEach(i=>{i.type!==r.BuiltInBaseEntity&&i.unsubscribeDependents([{entity:this,field:"value-as-type-list"}])}),this}subscribeToDependencies(){return!this.valueAsTypeSingle&&!this.valueAsTypeList?this:(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.forEach(i=>{i.type!==r.BuiltInBaseEntity&&i.subscribeDependents([{entity:this,field:"value-as-type-list"}])}):this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==r.BuiltInBaseEntity&&this.valueAsTypeSingle.subscribeDependents([{entity:this,field:"value-as-type-single"}]),this)}increaseVersion(i){var n;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((n=this.knownVersions)!=null&&n.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=M.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var n;const i=((n=this.knownVersions)==null?void 0:n.get(this.version))||new Tn(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new Tn(this,this.project);return this.apply(i)}apply(i){const n=this.toMeta();return i.metaSync(n,null),i.valueAsTypeSingle=this.valueAsTypeSingle,i.valueAsTypeList=this.valueAsTypeList?[...this.valueAsTypeList]:this.valueAsTypeList,i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const n=[],s=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);n.push(this.parent,...f.updated),s.push(...f.added),c.push(...f.removed)}return{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}async restoreVersion(i,n){var m;const s=[],c=[],e=[],f=[];if(this.version===i&&(n!=null&&n.skipIfSameVersion))return{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this};if(!this.knownVersions){const T=new Map;for(const[g,b]of this.knownVersions||new Map){if(T.set(g,b),b.activeVersion=!1,b.knownVersions)for(const[R,I]of b.knownVersions)T.set(R,I);b.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const T=await this.APILoadVersion({},i);if(!T)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new Tn(T,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.valueAsTypeSingle=h.valueAsTypeSingle,this.parent=h.parent,{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this}}updateWithShallowTransfer(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,n),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,this.unsubscribeFromDependencies(),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const s=he(i.parent),c=this.project.get(s),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(n),c)this.setParent(c,n),this.addSelfToProject(n);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${s}' that isn't found in the project`)}else if(i.standaloneParent){const s=he(i.standaloneParent),c=this.project.get(s);if(c)this.setStandaloneParent(c,n);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${s}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(s=>{const c=he(s),e=this.project.get(c);e&&this.addValueAsTypeToList(e,n)}),[...this.valueAsTypeList].forEach(s=>{(i.valueAsTypeList||[]).find(e=>he(e)===s.id)||this.removeValueAsTypeFromList(s,n)}),this.setValueAsTypeSingle(null,n),this.metaSync({value:null},n);else if(i.valueAsTypeSingle){const s=he(i.valueAsTypeSingle),c=this.project.get(s);c&&(this.setValueAsTypeSingle(c,n),this.setValueAsTypeList(null,n),this.metaSync({value:null},n))}else this.setValueAsTypeSingle(null,n),this.setValueAsTypeList(null,n);return this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithGenerationTarget))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,n),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const s=he(i.parent),c=this.project.get(s),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(n),c)this.setParent(c,n),this.addSelfToProject(n);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${s}' that isn't found in the project`)}else if(i.standaloneParent){const s=he(i.standaloneParent),c=this.project.get(s);if(c)this.setStandaloneParent(c,n);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${s}' that isn't found in the project`)}if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(s=>{const c=he(s),e=this.project.get(c);e&&this.addValueAsTypeToList(e,n)}),[...this.valueAsTypeList].forEach(s=>{(i.valueAsTypeList||[]).find(e=>he(e)===s.id)||this.removeValueAsTypeFromList(s,n)}),this.setValueAsTypeSingle(null,n),this.metaSync({value:null},n);else if(i.valueAsTypeSingle){const s=he(i.valueAsTypeSingle),c=this.project.get(s);c&&(this.setValueAsTypeSingle(c,n),this.setValueAsTypeList(null,n),this.metaSync({value:null},n))}return(i.valueAsTypeSingle===null||i.valueAsTypeList||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeSingle(null,n),(i.valueAsTypeList===null||i.valueAsTypeSingle||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeList(null,n),this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],n=[],s=[],c=[];if(this.initialData.parent&&this.initialData.standaloneParent){const e=he(this.initialData.parent),f=this.project.get(e),h=he(this.initialData.standaloneParent),m=this.project.get(h);let T="";throw f?T+=` Parent -> ${f.type}: '${f.id}' "${He(f,this.project)}".`:T+=" Parent -> not-found.",m?T+=` Standalone Parent -> ${m.type}: '${m.id}' "${He(m,this.project)}".`:T+=" Standalone Parent -> not-found.",new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.${T}`)}if(this.initialData.parent){const e=he(this.initialData.parent),f=this.project.get(e);if(oe.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating parent reference '${e}' for entity with id '${this.id}'`),f)oe.Logger.log(`[LiteralValueState.hydrateAncestors] Setting parent reference '${f.id}' for entity with id '${this.id}'`),this.setParent(f,null),i.push(f);else throw oe.Logger.error(`[LiteralValueState.hydrateAncestors] Parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else if(this.initialData.standaloneParent){const e=he(this.initialData.standaloneParent),f=this.project.get(e);if(oe.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating standalone parent reference '${e}' for entity with id '${this.id}'`),f)oe.Logger.log(`[LiteralValueState.hydrateAncestors] Setting standalone parent reference '${f.id}' for entity with id '${this.id}'`),this.setStandaloneParent(f,null);else throw oe.Logger.error(`[LiteralValueState.hydrateAncestors] Standalone parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${e}' that isn't found in the project`)}else throw oe.Logger.error(`[LiteralValueState.hydrateAncestors] Entity with id '${this.id}' must have a 'parent'`),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],this.initialData.valueAsTypeList.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.valueAsTypeList.push(h)});else if(this.initialData.valueAsTypeSingle){const e=he(this.initialData.valueAsTypeSingle),f=this.project.get(e);f&&(this.valueAsTypeSingle=f)}return{updated:V(i),added:V(n),removed:V(s),affected:V(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return this.initialized=!0,i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){var f,h;const n=[this],s=[],c=[],e=[];return((f=this.parent)==null?void 0:f.type)===r.DataType?this.parent.setEntity(this,i):(h=this.parent)==null||h.setDefaultValue(this,i),e.push(this.parent),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}setParent(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetParent))){var s;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.SetParent,n)?(((s=this.parent)==null?void 0:s.id)!==(i==null?void 0:i.id)&&(this.parent=i,this.standaloneParent&&(this.standaloneParent=null,this.standalone=!1),n&&(n==null||n.add(this,se.Updated))),n==null||n.attemptAutoclose(P.SetParent,this.id),this):this}setStandaloneParent(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetStandaloneParent))){var s;if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,P.SetStandaloneParent,n))return this;if(this.project.get(this.id)&&this.parent)throw new Error("[LiteralValueState.setStandaloneParent] This literal-value belongs to the project AST and setting a standalone parent is not possible. Clone the instance, or create a separate one to be standalone.");return((s=this.standaloneParent)==null?void 0:s.id)!==(i==null?void 0:i.id)&&(this.parent&&(this.removeFromParent(n),this.parent=null),this.standaloneParent=i,this.standalone=!0,n&&(n==null||n.add(this,se.Updated))),n==null||n.attemptAutoclose(P.SetStandaloneParent,this.id),this}addValueAsTypeToList(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddValueAsTypeToList))){return this.checkCanEdit(this,n)?((this.valueAsTypeList||[]).includes(i)||(this.valueAsTypeList=this.valueAsTypeList||[],this.valueAsTypeList.push(i),this.value!==null&&this.metaSync({value:null},n),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,n==null||n.add(this,se.Updated)),n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.AddValueAsTypeToList,this.id),this):(oe.Logger.warn(`[addValueAsTypeToList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.AddValueAsTypeToList,this.id),this)}removeValueAsTypeFromList(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveValueAsTypeFromList))){return this.checkCanEdit(this,n)?(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&(this.valueAsTypeList||[]).includes(i)&&(this.valueAsTypeList=this.valueAsTypeList.filter(s=>s.id!==i.id),this.valueAsTypeList.length===0?this.valueAsTypeList=null:(this.value!==null&&this.metaSync({value:null},n),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,n==null||n.add(this,se.Updated))),n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.RemoveValueAsTypeFromList,this.id),this):(oe.Logger.warn(`[removeValueAsTypeFromList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.RemoveValueAsTypeFromList,this.id),this)}setValueAsTypeSingle(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetValueAsTypeSingle))){return this.checkCanEdit(this,n)?(this.valueAsTypeSingle!==i&&(this.valueAsTypeSingle=i,n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.SetValueAsTypeSingle,this.id),this):(oe.Logger.warn(`[setValueAsTypeSingle] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetValueAsTypeSingle,this.id),this)}setValueAsTypeList(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetValueAsTypeList))){var s,c;return this.checkCanEdit(this,n)?(!i&&this.valueAsTypeList?(this.valueAsTypeList=null,n==null||n.add(this,se.Updated)):i&&!this.valueAsTypeList?(this.valueAsTypeList=i,n==null||n.add(this,se.Updated)):i&&this.valueAsTypeList&&((s=this.valueAsTypeList)==null?void 0:s.length)!==i.length?(this.valueAsTypeList=i,n==null||n.add(this,se.Updated)):i&&this.valueAsTypeList&&((c=this.valueAsTypeList)!=null&&c.every((e,f)=>e!==i[f]))&&(this.valueAsTypeList=i,n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.SetValueAsTypeList,this.id),this):(oe.Logger.warn(`[setValueAsTypeList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetValueAsTypeList,this.id),this)}setValueAsType(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetValueAsType))){return this.checkCanEdit(this,n)?i?(Array.isArray(i)?this.setValueAsTypeList(i,n):this.setValueAsTypeSingle(i,n),n==null||n.attemptAutoclose(P.SetValueAsType,this.id),this):(this.setValueAsTypeSingle(null,n),this.setValueAsTypeList(null,n),this):(oe.Logger.warn(`[setValueAsType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetValueAsType,this.id),this)}initChildren(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.standalone){if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(n=>{if(n.type===r.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(n);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.entityType}' with id '${n.entityId}' that is not part of the project state.`);return c}const s=this.project.get(n.id);if(!s)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.type}' with id '${n.id}' that is not part of the project state.`);return s});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===r.GenericReference){const s=this.project.findSubscribedBuiltInInstanceFromReference(this.initialData.valueAsTypeSingle);if(!s)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=s,this}const n=this.project.get(this.initialData.valueAsTypeSingle.id);if(!n)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=n}return this}if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(n=>{if(n.type===r.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(n);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.entityType}' with id '${n.entityId}' that is not part of the project state.`);return c}const s=this.project.get(n.id);if(!s)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.type}' with id '${n.id}' that is not part of the project state.`);return s});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===r.GenericReference){const s=he(this.initialData.valueAsTypeSingle),c=s?this.project.get(s):null;if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=c,this}const n=this.project.get(this.initialData.valueAsTypeSingle.id);if(!n)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=n}return this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(n=>{n.version!==this.version&&(n.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const s=Za(this,i,n);this.id==="3a497c83-1410-4ab0-8478-1e9c4f0c1935"&&i.value===!1&&console.trace("[LiteralValueState.metaSync] Test error");const c=qa(this,s),e=this.toMeta();this.name=s.name!==void 0?s.name:e.name,this.autogeneration=s.autogeneration!==void 0?s.autogeneration:e.autogeneration,this.value=s.value!==void 0?s.value:e.value,s.rawString!==void 0?this.rawString=s.rawString:s.value!==void 0&&typeof s.value=="string"?this.rawString=s.value:this.rawString=e.rawString;const f=i.valueAsTypeSingle!==void 0?i.valueAsTypeSingle:this.valueAsTypeSingle??null,h=i.valueAsTypeList!==void 0?i.valueAsTypeList:this.valueAsTypeList??null;return(this.name!==ce.String||f!==null||h!==null&&h.length>0)&&(this.rawString=null,s.rawString=null),super.baseMetaSync(s,this,n),s.deleted===!0&&!e.deleted?n==null||n.add(this,se.Removed):s.deleted===!1&&e.deleted?n==null||n.add(this,se.Added):c&&(n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=st,...n){return await Tn.repository.APILoad(this.id,...n),this}async APICreate(i=st,...n){return await Tn.repository.APICreate(this.toShallowJSON(),...n),this}async APIUpdate(i=st,...n){return await Tn.repository.APIUpdate(this.toShallowJSON(),...n),this}async APIDelete(i=st,...n){return await Tn.repository.APIDelete(this.toShallowJSON(),...n),this}async APIClone(i=st,...n){return await Tn.repository.APIClone(this.id,...n),this}async APILoadVersion(i=st,n,...s){return await Tn.repository.APILoadVersion(this.id,n,...s)}removeFromParent(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveFromParent))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return this.parent&&(this.parent.type===r.DataType?this.parent.setEntity(null,i):RD.includes(this.parent.type)&&this.parent.setDefaultValue(null,i),e.push(this.parent)),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:V(c),updated:V(n),removed:V(s),affected:V(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveEntity))){var h;if(!this.checkCanDelete(this,n))return oe.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),n==null||n.event({id:`${P.RemoveEntity}-${this.id}--${ze.ActionOwnerEntityNonDeletable}`,action:P.RemoveEntity,owner:this,errorReason:ze.ActionOwnerEntityNonDeletable,rootAction:((h=n==null?void 0:n.self)==null?void 0:h.id)===this.id&&(n==null?void 0:n.actionName)===P.RemoveEntity}),n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const s=[],c=[],e=[],f=[];if(n!=null&&n.hasRemoved(this.id))return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},n),Object.values(this.detachedDependents).forEach(m=>{const{updated:T,removed:g,added:b}=m.entity.onDetachedDependencyRemoved(this,m.field,n);s.push(...T),c.push(...g),e.push(...b)}),!i){const m=this.removeFromParent(n);e.push(...m.added),s.push(...m.updated),c.push(...m.removed),f.push(...m.affected)}return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:V(e),updated:V(s),removed:V(c),affected:V(f),self:this}}restore({}={},i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RestoreEntity))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return i!=null&&i.hasAdded(this.id)?(i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),Object.values(this.detachedDependents).forEach(f=>{const{updated:h,removed:m,added:T}=f.entity.onDetachedDependencyRestored(this,f.field,i);s.push(...h),c.push(...m),n.push(...T)}),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:V(n),updated:V(s),removed:V(c),affected:V(e),self:this})}toFlat(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlat(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlat(i)):[]])}toFlatIds(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatIds(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlatIds(i)):[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name}}toJSON(i=new Set){var n,s,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:((n=this.valueAsTypeSingle)==null?void 0:n.toJSON(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(e=>e.toJSON(i)):null,parent:((s=this.parent)==null?void 0:s.toReference())||null,standaloneParent:((c=this.standaloneParent)==null?void 0:c.toReference())||null})}toJSONClone(i=wt){var s,c,e,f,h,m,T;let n;return(s=i.seenEntityMaps)!=null&&s.has(this.id)?n=i.seenEntityMaps.get(this.id):(n=i.newId||Xa(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,n)),(c=i.seenEntities)!=null&&c.has(n)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(n),(h=i.seenEntities)==null||h.add(this.id),{id:n,version:M.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:this.valueAsTypeSingle?this.project.getBuiltIn(this.valueAsTypeSingle.id)?this.valueAsTypeSingle.toJSON():this.valueAsTypeSingle.toJSONClone({...i,newId:null}):null,valueAsTypeList:this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(g=>{var b;return this.project.getBuiltIn(g.id)?g.toJSON(i.seenEntities):(b=g.toJSONClone)==null?void 0:b.call(g,{...i,newId:null})}):null,parent:((m=this.parent)==null?void 0:m.toReference({seenEntityMaps:i.seenEntityMaps}))||null,standaloneParent:((T=this.standaloneParent)==null?void 0:T.toReference({seenEntityMaps:i.seenEntityMaps}))||null})}toReference(i=wt){var s;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n+"--"+M.UUID.uuid()+"--ref",type:r.GenericReference,entityId:n,version:this.version,entityType:this.type}}toShallowJSON(i=wt){var s,c,e,f;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.toReference(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.toReference(i)):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:((e=this.parent)==null?void 0:e.toReference(i))||null,standaloneParent:(f=this.standaloneParent)==null?void 0:f.toReference(i)}}toFlatJSON(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatJSON(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlatJSON(i)):[]])}toGenerationTarget(i=wt){var s,c,e,f;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n,type:this.type,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.id)||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.id):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:(e=this.parent)==null?void 0:e.id,standaloneParent:(f=this.standaloneParent)==null?void 0:f.id}}toFlatGenerationTarget(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatGenerationTarget(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlatGenerationTarget(i)):[]])}clearErrors(){return this.errors=[],this}validate(){return this.errors=ctt(this),{success:!0}}async validateAsync(i={}){const n=oe.YieldTracker.from(i);return this.errors=await ptt(this,{tracker:n}),{success:!0}}getErrors(){return[...this.errors]}async getErrorsAsync(i={}){const n=oe.YieldTracker.from(i),s=[...this.errors];return await n.tick(),s}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.CloneEntity)),n=null,s=null,c=!0){const e=_a(n,this),f=this.toJSON();n?(f.parent=n.toReference(),f.standaloneParent=null):(f.parent=null,this.standaloneParent?f.standaloneParent=this.standaloneParent.toReference():this.parent?f.standaloneParent=this.parent.toReference():f.standaloneParent=null);const h=s||M.UUID.uuid();f.id=h,f.version=M.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.editable=!0,f.deletable=!0;const m=Cr(f,e);return m.hydrateAncestors(),n&&m.setParent(n,i),c&&(m.subscribe(),m.addSelfToProject(i)),i==null||i.add(m,se.Added),m.initChildren(i),!i&&c&&m.captureVersion(),i==null||i.attemptAutoclose(P.CloneEntity,this.id),m}merge(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"merge-literal-value"))){const s=[],c=[],e=[],f=[];return this.valueAsTypeSingle!==(i==null?void 0:i.valueAsTypeSingle)&&(this.setValueAsType(i.valueAsTypeSingle,n),s.push(this)),this.valueAsTypeList!==i.valueAsTypeList&&(this.setValueAsTypeList(i.valueAsTypeList,n),s.push(this)),this.value!==i.value&&(this.metaSync({value:i.value},n),s.push(this)),this.autogeneration!==i.autogeneration&&(this.metaSync({autogeneration:i.autogeneration},n),s.push(this)),this.name!==i.name&&(this.metaSync({name:i.name},n),s.push(this)),n==null||n.attemptAutoclose("merge-literal-value",this.id),{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this}}};C(Tn,"repository",{APICreate:async(i,...n)=>i,APIUpdate:async(i,...n)=>i,APIDelete:async(i,...n)=>i,APIClone:async(i,...n)=>{},APILoad:async(i,...n)=>null,APILoadVersion:async(i,n,...s)=>null}),C(Tn,"type",r.LiteralValue),C(Tn,"USER_MANAGED_PARENT_TYPES",[r.DataType,r.InputMap,r.Property,r.ArgumentDeclaration,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.VariableDeclaration,r.VariableInstance,r.ValueDescriptor]),C(Tn,"USER_MANAGED_STANDALONE_PARENT_TYPES",[...AD]),C(Tn,"PARENT_TYPES",[...Tn.USER_MANAGED_PARENT_TYPES]),C(Tn,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value","rawString"]),C(Tn,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),C(Tn,"BASE_PROPERTIES",[...Tn.MUTABLE_BASE_PROPERTIES,...Tn.INMUTABLE_BASE_PROPERTIES]),C(Tn,"MUTABLE_META_PROPERTIES",[...Tn.MUTABLE_BASE_PROPERTIES]),C(Tn,"INMUTABLE_META_PROPERTIES",[...Tn.INMUTABLE_BASE_PROPERTIES]),C(Tn,"META_PROPERTIES",[...Tn.MUTABLE_META_PROPERTIES,...Tn.INMUTABLE_META_PROPERTIES]),C(Tn,"MUTABLE_UPSTREAM_PROPERTIES",["valueAsTypeSingle","valueAsTypeList"]),C(Tn,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),C(Tn,"UPSTREAM_PROPERTIES",[...Tn.MUTABLE_UPSTREAM_PROPERTIES,...Tn.INMUTABLE_UPSTREAM_PROPERTIES]),C(Tn,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),C(Tn,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),C(Tn,"DOWNSTREAM_PROPERTIES",[...Tn.MUTABLE_DOWNSTREAM_PROPERTIES,...Tn.INMUTABLE_DOWNSTREAM_PROPERTIES]),C(Tn,"PROPERTIES",[...Tn.META_PROPERTIES,...Tn.UPSTREAM_PROPERTIES,...Tn.DOWNSTREAM_PROPERTIES]);let ua=Tn;function Z0(l){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){const i=new Uint8Array(l);return crypto.getRandomValues(i),i}const{randomBytes:u}=require("crypto");return u(l)}function ytt(l,u){const i=u-l+1,s=Zw()*i;return Math.floor(s)+l}function htt(){const l=Z0(4);return(l[0]<<24|l[1]<<16|l[2]<<8|l[3])>>>0}function Zw(){return htt()/2**32}function j2(l){const u=Z0(l);return Array.from(u).map(i=>i.toString(16).padStart(2,"0")).join("")}const dN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function K2(l){let u="";const i=Z0(l);for(let n=0;n<l;n++)u+=dN[i[n]%dN.length];return u}function mtt(l){const u=Z0(l);let i;if(typeof Buffer<"u")i=Buffer.from(u).toString("base64");else{const n=String.fromCharCode(...u);i=btoa(n)}return i.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function q2(l){return K2(l)}function Z2(l,u=dN){let i="";const n=Z0(l);for(let s=0;s<l;s++)i+=u[n[s]%u.length];return i}function oy(){const l=Z0(16);l[6]=l[6]&15|64,l[8]=l[8]&63|128;const u=Array.from(l).map(i=>i.toString(16).padStart(2,"0")).join("");return[u.slice(0,8),u.slice(8,12),u.slice(12,16),u.slice(16,20),u.slice(20,32)].join("-")}function Ttt(){return Z2(6)}function vtt(){return j2(32)}const lXi=63,oXi=/^[a-z][a-z0-9-]*[a-z0-9]$/;function dXi(l){return l.length>=1&&l.length<=lXi&&oXi.test(l)&&!l.includes("--")}function*uXi(){yield"";const l="abcdefghijklmnopqrstuvwxyz";for(let u=1;;u++){const i=new Array(u).fill(0);let n=!1;for(;!n;){yield i.map(s=>l[s]).join("");for(let s=u-1;s>=0&&(i[s]++,!(i[s]<l.length));s--)i[s]=0,s===0&&(n=!0)}}}function pXi(l,u){const i=new Set(l.map(s=>s.toLowerCase())),n=u>0?"secondarydb":"main";for(const s of uXi()){const c=s?`${n}${s}`:n;if(dXi(c)&&!i.has(c))return c}throw new Error("Unable to generate identifier")}function gtt(l,u){switch(l.id){case B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const i=l.project.entities.filter(h=>!!h.implements.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)),n=i.find(h=>{const m=h.properties.find(b=>b.implements.find(R=>R.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),T=m==null?void 0:m.getDefaultValue();return(T==null?void 0:T.value)===!0});if(!n&&i.length){const m=i[0].properties.find(g=>g.implements.find(b=>b.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),T=m==null?void 0:m.defaultValue;if(T)T.metaSync({value:!0},u);else if(m!=null&&m.dataType){const g={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:ce.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:m==null?void 0:m.toReference()},b=Ve(g,l.project);return b.hydrateAncestors(),b.setParent(m,u),b.addSelfToProject(u),u==null||u.add(b,se.Added),b.initChildren(u),u||b.captureVersion(),{newEntities:[b]}}return{newEntities:[]}}else if(n)return{newEntities:[]};const s=l.project.get(B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),c=Hw(s,"Main database",u);if(c.errors.length>0)return{newEntities:[]};const e=c.properties.find(h=>h.implements.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),f=e==null?void 0:e.defaultValue;if(f)f.metaSync({value:!0},u);else if(e!=null&&e.dataType){const h={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:ce.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:e==null?void 0:e.toReference()},m=Ve(h,l.project);m.hydrateAncestors(),m.setParent(e,u),m.addSelfToProject(u),u==null||u.add(m,se.Added),m.initChildren(u),u||m.captureVersion()}return{newEntities:[c]}}}return{newEntities:[]}}function Ett(l,u){const i=[],n=[],s=[],c=[];return Zv(l).filter(f=>f.type===r.BuiltInBaseEntity).forEach(f=>{var h,m,T,g,b,R,I,D,N;switch(f.id){case B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const $=l.project.entities.filter(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));let x=$.find(Z=>!!Z.properties.find(X=>{var te;return X.implements.find(z=>z.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((te=X.getDefaultValue())==null?void 0:te.value)===!0}));if(!x&&$.length)x=$[0];else if(!x&&!$.length){x=l.project.getBuiltIn(B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id).implement("Relational database",u);const X=x.properties.find(te=>te.implements.find(z=>z.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));(h=X==null?void 0:X.defaultValue)==null||h.metaSync({value:!0},u),n.push(x)}const L=l.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id));if(L&&!(L!=null&&L.defaultValue)){const Z={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:ce.EntityTemplate,autogeneration:null,value:null,valueAsTypeSingle:(x==null?void 0:x.toJSON())||null,valueAsTypeList:null,parent:L==null?void 0:L.toReference()},X=Ve(Z,l.project);X.hydrateAncestors(),X.setParent(L,u),X.addSelfToProject(u),u==null||u.add(X,se.Added),X.initChildren(u),(L==null?void 0:L.defaultValue).setValueAsTypeSingle(x||null,u),n.push(X),u||X.captureVersion();return}else L!=null&&L.defaultValue&&!(L!=null&&L.defaultValue.valueAsTypeSingle)&&(L==null||L.defaultValue.setValueAsTypeSingle(x||null,u));const K=l.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.primaryKey.id));if(!K)throw new Error(`[handleAfterEntityImplementationSideEffects] Primary key property not found for implemented base entity ${B["built-in-base-entity"]}`);let q=!1;if(!K.dataType){const Z=Xr.new(u);Z.parent=K.toReference();const X=Ve(Z,l.project);X.hydrateAncestors(),X.setParent(K,u),X.addSelfToProject(u),u==null||u.add(X,se.Added),X.initChildren(u),q=!0}const W=l.project.getBuiltIn(B["primitive-entity"].number.id);(m=K.dataType)==null||m.setEntity(W,u),q&&(u||(T=K.dataType)==null||T.captureVersion());return}case B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id:{const $=l.project.entities.filter(z=>z.implements.find(J=>J.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)&&z.id!==l.id),x=$.map(z=>{var ne;const J=z.properties.find(ae=>ae.implements.find(de=>de.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));return(ne=J==null?void 0:J.getDefaultValue())==null?void 0:ne.value}).filter(z=>!!z),L=l.properties.find(z=>z.implements.find(J=>J.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));if(!$.find(z=>!!z.properties.find(J=>{var Q;return J.implements.find(ne=>ne.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((Q=J.getDefaultValue())==null?void 0:Q.value)===!0}))){const z=l.properties.find(Q=>Q.implements.find(ne=>ne.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));if(!z)throw new Error("Default boolean property not found for relational database entity with id: "+l.id);let J=!1;if(!(z!=null&&z.defaultValue)){const Q=ua.new(u);Q.parent=z.toReference();const ne=Ve(Q,l.project);ne.hydrateAncestors(),ne.setParent(z,u),ne.addSelfToProject(u),u==null||u.add(ne,se.Added),ne.initChildren(u),J=!0}(g=z==null?void 0:z.defaultValue)==null||g.metaSync({value:!0},u),J&&(u||(b=z==null?void 0:z.defaultValue)==null||b.captureVersion())}if(!L)throw new Error("Identifier property not found for relational database entity with id: "+l.id);let q=!1;if(!(L!=null&&L.defaultValue)){const z=ua.new(u);z.parent=L.toReference();const J=Ve(z,l.project);J.hydrateAncestors(),J.setParent(L,u),J.addSelfToProject(u),u==null||u.add(J,se.Added),J.initChildren(u),q=!0}const W=pXi(x,$.length);(R=L.defaultValue)==null||R.metaSync({value:W},u),q&&(u||(I=L.defaultValue)==null||I.captureVersion());const Z=l.properties.find(z=>z.implements.find(J=>J.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.password.id));if(!Z)throw new Error(`[handleAfterEntityImplementationSideEffects] Password property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id} with id ${l.id}`);let X=!1;if(!Z.defaultValue){const z=ua.new(u);z.parent=Z.toReference();const J=Ve(z,l.project);J.hydrateAncestors(),J.setParent(Z,u),J.addSelfToProject(u),u==null||u.add(J,se.Added),J.initChildren(u),n.push(J),X=!0}const te=q2(24);(D=Z.defaultValue)==null||D.metaSync({value:te},u),X&&(u||(N=Z.defaultValue)==null||N.captureVersion());return}case B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id:{const $=l.properties.find(q=>q.implements.find(W=>W.id===B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.time.id));if(!$)throw new Error(`[handleAfterEntityImplementationSideEffects] Time property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${l.id}`);let x=$.defaultValue||null;if(!x){const q=ua.new(u);q.parent=$.toReference(),q.name=ce.Date,q.id=M.UUID.uuid(),x=Ve(q,l.project),x.hydrateAncestors(),x.setParent($,u),x.addSelfToProject(u),x.initChildren(u),u==null||u.add(x,se.Added)}x.metaSync({value:new Date().toISOString()},u),x.metaSync({editable:!1,deletable:!1},u),$.metaSync({editable:!1,deletable:!1},u);const L=l.properties.find(q=>q.implements.find(W=>W.id===B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.definition.id));if(!L)throw new Error(`[handleAfterEntityImplementationSideEffects] Definition property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${l.id}`);let K=L.defaultValue||null;if(!K){const q=ua.new(u);q.name=ce.EntityTemplate,q.parent=L.toReference(),q.id=M.UUID.uuid(),K=Ve(q,l.project),K.hydrateAncestors(),K.setParent(L,u),K.addSelfToProject(u),K.initChildren(u),u==null||u.add(K,se.Added)}break}case B["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id:{const $=l.project.entities.filter(x=>Hi(x,De.SHARED_DRIVE_ENTITY)&&x.id!==l.id);if($.length===1){const x=$[0],L=l.properties.find(q=>q.implements.find(W=>W.id===B["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.properties.sharedDrive.id));if(!L)throw new Error(`[handleAfterEntityImplementationSideEffects] Shared Drive property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id} with id ${l.id}`);let K=L.defaultValue||null;if(!K){const q=ua.new(u);q.name=ce.EntityTemplate,q.parent=L.toReference(),q.id=M.UUID.uuid(),K=Ve(q,l.project),K.hydrateAncestors(),K.setParent(L,u),K.addSelfToProject(u),K.initChildren(u),u==null||u.add(K,se.Added)}K.setValueAsTypeSingle(x,u)}break}case B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id:{const $=l.properties.find(W=>W.implements.find(Z=>Z.id===B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id));if(!$)throw new Error(`[handleAfterEntityImplementationSideEffects] Compute name property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id} with id ${l.id}`);const x=l.project.entities.filter(W=>Hi(W,De.COMPUTE_ENTITY)&&W.id!==l.id);let L=$.defaultValue||null;if(!L){const W=ua.new(u);W.name=ce.EntityTemplate,W.parent=$.toReference(),W.id=M.UUID.uuid(),L=Ve(W,l.project),L.hydrateAncestors(),L.setParent($,u),L.addSelfToProject(u),L.initChildren(u),u==null||u.add(L,se.Added)}const K=x.map(W=>{var Z,X;return((X=(Z=W.properties.find(te=>te.implements.some(z=>z.id===B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id)))==null?void 0:Z.defaultValue)==null?void 0:X.value)||""}),q=G2(L.value||"compute-instance",K,"-");L.metaSync({value:q},u);break}}}),{self:l,updated:V(i),added:V(n),removed:V(s),affected:V(c)}}function Hw(l,u,i,n){const s=n||M.UUID.uuid(),c=Ua.new(i);c.id=s,c.name=u,c.static=l.static,c.implements=[l.toJSON()],c.parent=l.project.toReference(),c.static=l.static,gtt(l,i);const e=Ve(c,l.project);return e.hydrateAncestors(),i==null||i.add(e,se.Added),e.addSelfToProject(i),e.initChildren(i),i||e.captureVersion(),Ett(e,i),e.afterAllChildrenInitialized(i),e}function H2(l,u){return u.entities.find(s=>{const c=s.properties,e=c.map(g=>g.name),f=l.every(g=>e.includes(g)),h=e.filter(g=>!l.includes(g)),m=c.every(g=>!h.includes(g.name)||!g.required);return f&&m})||null}function btt(l,u,i,n=dt.OrDataTypeGroup){const s=[],c=[],e=[],f=[],h=M.UUID.uuid(),m=Xr.new(i);m.id=h,m.parent=u.toReference(),m.like=!0,m.parentRelationType=n;const T=Ve(m,l.project);return c.push(T),T.setParent(u,i),T.addSelfToProject(i),i==null||i.add(T,se.Added),T.setEntity(l,i),T.initChildren(i),i||T.captureVersion(),{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:T}}function W2(l,u,i,n,s){var m,T,g,b,R,I,D,N;const c=[],e=[],f=[],h=[];switch(typeof l){case"string":let $=!1;const x=new Date(l);if(x instanceof Date&&!isNaN(x.valueOf())&&($=!0),$){const L=u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Date].id);u.setEntity(L,n);break}else{const L=u.project.getBuiltIn(B[r.PrimitiveEntity][ce.String].id);u.setEntity(L,n);break}case"number":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Number].id),n);break;case"boolean":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Boolean].id),n);break;case"object":if(l===null){u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Null].id),n);break}else if(Array.isArray(l))if(u.metaSync({isList:!0},n),l.length>0){const L=l.slice(0,5).filter(q=>q!==void 0);if(L.every(q=>typeof q==typeof L[0])&&(typeof L[0]!="object"||L[0]===null))switch(typeof L[0]){case"string":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.String].id),n);break;case"number":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Number].id),n);break;case"boolean":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Boolean].id),n);break;case"object":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Null].id),n);break}else{const q=[];let W=!1;L.forEach(X=>{var te,z,J,Q;if(Array.isArray(X)&&(W=!0),typeof X=="object"&&!Array.isArray(X)&&X!==null){const ne=A1(X,u.project,{...i,id:M.UUID.uuid()},n,s);ne.hasCreated&&q.push((te=ne.changeSet)==null?void 0:te.self),c.push(...(z=ne.changeSet)==null?void 0:z.updated),e.push(...(J=ne.changeSet)==null?void 0:J.added),f.push(...(Q=ne.changeSet)==null?void 0:Q.removed)}});const Z=V(q);if(!Z.length&&!W){L.forEach(X=>{const te=Xr.new(n);te.parentRelationType=dt.OrDataTypeGroup,te.parent=u.toReference();const z=Ve(te,u.project);switch(z.hydrateAncestors(),z.setParent(u,n),z.addSelfToProject(n),n==null||n.add(z,se.Added),z.initChildren(n),typeof X){case"string":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.String].id),n);break;case"number":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.Number].id),n);break;case"boolean":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.Boolean].id),n);break;case"object":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.Null].id),n);break}n||z.captureVersion()});break}else Z.length===1&&!W?u.setEntity(Z[0],n):L.forEach(X=>{if(typeof X=="object"&&!Array.isArray(X)&&X!==null){const te=H2(Object.keys(X),u.project);if(te){const z=btt(te||Z[0],u,n,dt.OrDataTypeGroup);c.push(...z.updated),e.push(...z.added),f.push(...z.removed)}}else{const te=Xr.new(n);te.parentRelationType=dt.OrDataTypeGroup,te.parent=u.toReference();const z=Ve(te,u.project);z.hydrateAncestors(),z.setParent(u,n),z.addSelfToProject(n),n==null||n.add(z,se.Added),z.initChildren(n);const J=W2(X,z,{...i,id:M.UUID.uuid()},n,s);c.push(...J.updated),e.push(...J.added),f.push(...J.removed),n||z.captureVersion()}})}}else{const L=A1(l[0],u.project,{...i},n,s);u.setEntity((m=L.changeSet)==null?void 0:m.self,n),c.push(...(T=L.changeSet)==null?void 0:T.updated),e.push(...(g=L.changeSet)==null?void 0:g.added),f.push(...(b=L.changeSet)==null?void 0:b.removed);break}else{const L=A1(l,u.project,{...i},n,s);u.setEntity((R=L.changeSet)==null?void 0:R.self,n),c.push(...(I=L.changeSet)==null?void 0:I.updated),e.push(...(D=L.changeSet)==null?void 0:D.added),f.push(...(N=L.changeSet)==null?void 0:N.removed);break}}return{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:u}}function A1(l,u,i,n,s){const c=[],e=[],f=[],h=[],m=Object.keys(l),T=H2(m,u);if(T)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],affected:[],self:T}};const g=s?i.name+" of "+s.name:i.name,R={id:i.id||M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(n==null?void 0:n.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,name:g,codeName:null,deletable:!0,editable:!0,type:r.DefinitionEntity,additionalProperties:!1,additionalPropertiesDataType:null,allPropertiesImplement:null,description:i.description||null,static:i.static||!1,abstract:i.abstract||!1,properties:[],methods:[],abstractMethods:[],extends:null,implements:[],x:0,y:0,parent:u.toReference()},I=Ve(R,u);return I.hydrateAncestors(),I.setParent(u,n),I.addSelfToProject(n),n==null||n.add(I,se.Added),I.initChildren(n),e.push(I),m.forEach((D,N)=>{const $=M.UUID.uuid(),x=fo.new(n);x.id=$,x.name=D,x.codeName=D,x.parent=I.toReference(),x.index=N,x.required=!0,x.interactive=!0;const L=Ve(x,u);L.hydrateAncestors(),L.setParent(I,n),L.addSelfToProject(n),n==null||n.add(L,se.Added),L.initChildren(n),e.push(L);const K=l[D],q=M.UUID.uuid(),W=Xr.new(n);W.id=q,W.parent=L.toReference(),W.like=!0,W.isList=!1;const Z=Ve(W,u);Z.hydrateAncestors(),Z.setParent(L,n),Z.addSelfToProject(n),n==null||n.add(Z,se.Added),Z.initChildren(n),e.push(Z);const X=W2(K,Z,{...i,name:D,id:M.UUID.uuid()},n,s||I);c.push(...X.updated),e.push(...X.added),f.push(...X.removed),n||(L.captureVersion(),Z.captureVersion())}),n||I.captureVersion(),{hasCreated:!0,changeSet:{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:I}}}function Gc(l,u,i,n,s){const c={ignoreImplementationMatch:!1,...s},e=[];return!l.length||!u.length?{errors:e,overlap:!1}:(l.length>u.length?l.forEach(f=>{const h=u.find(T=>T.name===f.name),m=u.find(T=>{var g,b;return Array.isArray(T.implements)?T.implements.some(R=>!!f.implements.find(I=>I.id===R.id)):((g=T.implements)==null?void 0:g.id)===((b=f.implements)==null?void 0:b.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const T=new Ct({id:f.id+"--"+h.id+"--"+n,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${h.type} ${h.name} with id "${h.id}" that has the same name`,severity:Ie.Error,code:n,entity:f,firstRelationship:h});e.push(T)}if(m&&!c.ignoreImplementationMatch){const T=new Ct({id:f.id+"--"+m.id+"--"+i,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${m.type} ${m.name} with id "${m.id}" that implements the same base descriptor`,severity:Ie.Error,code:i,entity:f,firstRelationship:m});e.push(T)}}):u.forEach(f=>{var T;const h=l.find(g=>g.name===f.name),m=l.find(g=>{var b,R;return g.implements&&Array.isArray(g.implements)?g.implements.some(I=>!!f.implements.find(D=>D.id===I.id)):((b=g.implements)==null?void 0:b.id)===((R=f.implements)==null?void 0:R.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const g=new Ct({id:h.id+"--"+f.id+"--"+n,message:`Entity of type ${h.type} named "${h.name}" with id "${h.id}" overrides a base entity ${f.name} with id "${f.id}" that has the same name`,severity:Ie.Error,code:n,entity:h,firstRelationship:f});e.push(g)}if(m&&!c.ignoreImplementationMatch){const g=new Ct({id:m.id+"--"+f.id+"--"+i,message:`Entity of type ${m.type} named "${m.name}" with id "${m.id}" overrides a base entity ${f.name} with id "${f.id}" that implements the same base ${Array.isArray(m==null?void 0:m.implements)?ti(m==null?void 0:m.implements.map(b=>b.type),"', '","' and '"):(T=m.implements)==null?void 0:T.id}`,severity:Ie.Error,code:i,entity:m,firstRelationship:f});e.push(g)}}),{errors:e,overlap:!!e.length})}function cXi(l,u){return l.abstract||(l.properties.forEach(n=>{n.abstract||n.metaSync({abstract:!0},u)}),Object.values(l.detachedDependents).forEach(n=>{n.field===bM.EntityField&&n.entity.remove({ignoreUpstream:!1},u)}),l.metaSync({abstract:!0},u)),l}function fXi(l,u){return l.abstract&&(l.properties.forEach(n=>{n.abstract&&n.metaSync({abstract:!1},u)}),Object.values(l.detachedDependents).forEach(n=>{(n.field===dD.Implements||n.field===dD.Extends)&&n.entity.onDetachedDependencyRemoved(l,n.field,u)}),l.metaSync({abstract:!1},u)),l}function yXi(l,u){return l.static||(l.properties.forEach(n=>{n.static||n.metaSync({static:!0},u)}),l.metaSync({static:!0},u)),l}function hXi(l,u){return l.static&&l.metaSync({static:!1},u),l}const db=class db extends M2{constructor(i,n){super(i);C(this,"initialData");C(this,"id");C(this,"version");C(this,"name");C(this,"description",null);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",!1);C(this,"static");C(this,"additionalProperties",!1);C(this,"properties",[]);C(this,"allPropertiesImplement",null);C(this,"additionalPropertiesDataType",null);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"interactive",!1);C(this,"errors",[]);C(this,"project");if(this.initialData=this.initialData||i,this.project=this.project||n,this.id=this.id||i.id,this.version=this.version||i.version,this.name=this.name||i.name,this.static=this.static||i.static,this.interactive=this.interactive||i.interactive,this.abstract=i.abstract,this.additionalProperties=i.additionalProperties,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.initialData.allPropertiesImplement){const s=Ve(this.initialData.allPropertiesImplement,this.project);s.setParent(this,null),s.initChildren(null),this.allPropertiesImplement=s}if(this.initialData.additionalPropertiesDataType){const s=Ve(this.initialData.additionalPropertiesDataType,this.project);s.setParent(this,null),s.initChildren(null),this.additionalPropertiesDataType=s}this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project))}get allMethods(){return V([...this.ownDeclaredMethods,...this.allBaseMethodsFromOriginalParents])}get allProperties(){return V([...this.ownDeclaredProperties,...this.allBasePropertiesFromOriginalParents])}get allBaseMethodsFromOriginalParents(){var s;const i=((s=this.extends)==null?void 0:s.allMethods)||[],n=[...i].filter(c=>!i.some(e=>e.id!==c.id));return V(n)}get allBasePropertiesFromOriginalParents(){var s;const i=((s=this.extends)==null?void 0:s.allProperties)||[],n=[...i].filter(c=>!i.some(e=>{var f;return e.id!==c.id&&(!!e.implements.find(h=>h.id===c.id)||((f=e.extends)==null?void 0:f.id)===c.id)}));return V(n)}get allBasePropertiesFromExtendedAndImplementedEntities(){var s,c;const i=[...((s=this.extends)==null?void 0:s.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.allBasePropertiesFromExtendedAndImplementedEntities)||[]].filter(e=>!e.abstract),n=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return V([...n])}get allBaseMethodsFromExtendedAndImplementedEntities(){return V([...(this.extends?[this.extends]:[]).reduce((i,n)=>n.type===r.PrimitiveEntity?i:[...[...n.ownDeclaredMethods,...n.allBaseMethodsFromExtendedAndImplementedEntities].filter(c=>c.type!==r.ActionDescriptor),...i],[])])}get extendedPropertiesFromOriginalParents(){var s,c;const i=[...((s=this.extends)==null?void 0:s.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.extendedPropertiesFromOriginalParents)||[]].filter(e=>!e.abstract),n=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return V(n)}get implementedPropertiesFromOriginalParents(){return V([...(this.extends?[this.extends]:[]).reduce((i,n)=>{const s=n.implementedPropertiesFromOriginalParents,c=[...n.ownDeclaredProperties].filter(h=>!!h.abstract),e=[...s,...c,...i];return[...e].filter(h=>!!!e.find(T=>{var g;return((g=T.extends)==null?void 0:g.id)===h.id||!!T.implements.find(b=>b.id===h.id)}))},[])].filter(i=>!!i.abstract))}get extendedProperties(){return this.properties.filter(i=>i.isExtendedProperty)}get ownDeclaredMethods(){return[...this.methods,...this.abstractMethods]}get ownDeclaredProperties(){return this.properties.filter(i=>!i.isExtendedProperty)}subscribe(){return this.project.subscribeBuiltInInstance(this),this}unsubscribe(){return this.project.unsubscribeBuiltInInstance(this),this}async APILoad(i=st,...n){return await db.repository.APILoad(this.id,...n),this}toFlat(i=new Set){var s;return i.has(this.id)?[]:(i.add(this.id),[this,...this.properties.flatMap(c=>c.toFlat(i)),...this.methods.flatMap(c=>c.toFlat(i)),...this.abstractMethods.flatMap(c=>c.toFlat(i)),...((s=this.extends)==null?void 0:s.toFlat(i))||[]])}toFlatIds(i=new Set){var s;return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.properties.flatMap(c=>c.toFlatIds(i)),...this.methods.flatMap(c=>c.toFlatIds(i)),...this.abstractMethods.flatMap(c=>c.toFlatIds(i)),...((s=this.extends)==null?void 0:s.toFlatIds(i))||[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,description:this.description,interactive:this.interactive,additionalProperties:this.additionalProperties,abstract:this.abstract,static:this.static,type:this.type,name:this.name}}toJSON(i=new Set){var n,s,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,additionalProperties:this.additionalProperties,interactive:this.interactive,additionalPropertiesDataType:((n=this.additionalPropertiesDataType)==null?void 0:n.toJSON(i))||null,allPropertiesImplement:((s=this.allPropertiesImplement)==null?void 0:s.toJSON(i))||null,properties:this.properties.map(e=>e.toJSON(i)),methods:this.methods.map(e=>e.toJSON(i)),abstractMethods:this.abstractMethods.map(e=>e.toJSON(i)),extends:((c=this.extends)==null?void 0:c.toJSON(i))||null})}toReference(i=wt){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(i=wt){var n,s,c;return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,additionalProperties:this.additionalProperties,additionalPropertiesDataType:((n=this.additionalPropertiesDataType)==null?void 0:n.toReference())||null,allPropertiesImplement:((s=this.allPropertiesImplement)==null?void 0:s.toReference())||null,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:((c=this.extends)==null?void 0:c.toReference())||null}}toFlatJSON(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(e=>e.toFlatJSON(i)),...this.methods.flatMap(e=>e.toFlatJSON(i)),...this.abstractMethods.flatMap(e=>e.toFlatJSON(i)),...((s=this.additionalPropertiesDataType)==null?void 0:s.toFlatJSON(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatJSON(i))||[]])}toGenerationTarget(i=wt){var n;return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,additionalProperties:this.additionalProperties,extends:(n=this.extends)==null?void 0:n.id}}toFlatGenerationTarget(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(e=>e.toFlatGenerationTarget(i)),...this.methods.flatMap(e=>e.toFlatGenerationTarget(i)),...this.abstractMethods.flatMap(e=>e.toFlatGenerationTarget(i)),...((s=this.additionalPropertiesDataType)==null?void 0:s.toFlatGenerationTarget(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatGenerationTarget(i))||[]])}clearErrors(){var i,n;return this.errors=[],this.properties.forEach(s=>s.clearErrors()),this.methods.forEach(s=>s.clearErrors()),this.abstractMethods.forEach(s=>s.clearErrors()),(i=this.additionalPropertiesDataType)==null||i.clearErrors(),(n=this.allPropertiesImplement)==null||n.clearErrors(),this}validate(){return this.errors=rXi(this),{success:!0}}async validateAsync(i={}){const n=oe.YieldTracker.from(i);return this.errors=await nXi(this,{tracker:n}),{success:!0}}getErrors(){var n,s;return[...this.errors,...this.properties.flatMap(c=>c.getErrors()),...this.methods.flatMap(c=>c.getErrors()),...this.abstractMethods.flatMap(c=>c.getErrors()),...((n=this.additionalPropertiesDataType)==null?void 0:n.getErrors())||[],...((s=this.allPropertiesImplement)==null?void 0:s.getErrors())||[]]}async getErrorsAsync(i={}){const n=oe.YieldTracker.from(i),s=[...this.errors];await n.tick();for(const c of this.properties){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}for(const c of this.methods){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}for(const c of this.abstractMethods){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}if(this.additionalPropertiesDataType){const c=await this.additionalPropertiesDataType.getErrorsAsync({tracker:n});s.push(...c)}if(this.allPropertiesImplement){const c=await this.allPropertiesImplement.getErrorsAsync({tracker:n});s.push(...c)}return s}getShallowErrors(){return this.errors}implement(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),null,!0,"implement-built-in-base-entity")),s){const c=Hw(this,i,n,s);return n==null||n.attemptAutoclose("implement-built-in-base-entity",this.id),c}getAllPropertiesImplements(){var n;const i=[];return this.allPropertiesImplement&&i.push(this.allPropertiesImplement),((n=this.extends)==null?void 0:n.type)===r.BuiltInBaseEntity&&i.push(...this.extends.getAllPropertiesImplements()||[]),i}getAllInteractiveMethods(){const i=[];if(this.interactive){if(i.push(...this.methods,...this.abstractMethods),!this.extends||this.extends.type===r.BuiltInBaseEntity&&this.extends.interactive||this.extends.type===r.PrimitiveEntity)return i;this.extends instanceof db&&i.push(...this.extends.getAllInteractiveMethods())}return V(i)}getRawDefaultValue(){const i={};return this.properties.forEach(n=>{var e;if(!Nb(n)||!n.defaultValue)return;const s=Ee(n,this.project),c=n.codeName||Uc(n,this.project)||Mo(Dr(s));i[c]=((e=n.getDefaultValue())==null?void 0:e.value)||null}),i}};C(db,"repository",{APILoad:async(i,...n)=>null});let jo=db;class Itt extends jo{constructor(i){super(Rs,i);C(this,"initialData");C(this,"id",De.PERSISTED_ENTITY);C(this,"version","1");C(this,"name",De.PERSISTED_ENTITY);C(this,"description",Rs.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",Rs.abstract);C(this,"static",Rs.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=Rs,this.project=i,this.id=Rs.id,this.version=Rs.version,this.name=Rs.name,this.static=Rs.static,this.abstract=Rs.abstract,this.properties=this.initialData.properties.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(null),s}),this.methods=this.initialData.methods.map(n=>{const s=Ve(n,this.project);return s.parent=this,s}),this.abstractMethods=this.initialData.abstractMethods.map(n=>{const s=Ve(n,this.project);return s.parent=this,s}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project))}}var Hs=(l=>(l.ValueMustBeString="value-must-be-string",l.StringValueMustNotHaveSpaces="string-value-must-not-have-spaces",l.StringValueMustNotHaveDashes="string-value-must-not-have-dashes",l.MustBeUniqueAmongSameEntities="must-be-unique-among-same-entities",l))(Hs||{});function hT(l,u){const i=[],n=u;if(!n)return{errors:i,override:u};if(typeof n!="string")return{errors:[],override:u};if(n.includes(" ")){const s=new Ct({id:l.id+"--string-value-must-not-have-spaces",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value cannot contain spaces.`,severity:Ie.Error,code:"string-value-must-not-have-spaces",entity:l});i.push(s)}return{errors:i,override:n.replace(/\s/g,"-")}}function Att(l,u){const i=[],n=u;if(!n)return{errors:i,override:u};if(typeof n!="string")return{errors:[],override:u};if(n.includes(" ")){const s=new Ct({id:l.id+"--string-value-must-not-have-spaces",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ie.Error,code:"string-value-must-not-have-spaces",entity:l});i.push(s)}if(n.includes("-")){const s=new Ct({id:l.id+"--string-value-must-not-have-dashes",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ie.Error,code:"string-value-must-not-have-dashes",entity:l});i.push(s)}return{errors:i,override:n.replace(/\s|-/g,"_")}}var zp=(l=>(l.StatusCodeMustBeNumber="status-code-must-be-number",l.StatusCodeMustBeBetween100And599="status-code-must-be-between-100-and-599",l))(zp||{}),Rtt=(l=>(l.PathMustStartWithSlash="path-must-start-with-slash",l.PathContainsInvalidCharacters="path-contains-invalid-characters",l.PathUnclosedCurlyBracket="path-unclosed-curly-bracket",l.PathUnopenedCurlyBracket="path-unopened-curly-bracket",l.PathEmptyCurlyBrackets="path-empty-curly-brackets",l.PathConflictsWithExistingEndpoint="path-conflicts-with-existing-endpoint",l))(Rtt||{});function uN(l,u){if(!l||!u)return!1;if(l===u)return!0;const i=l.split("/").filter(Boolean),n=u.split("/").filter(Boolean);if(i.length!==n.length)return!1;for(let s=0;s<i.length;s++){const c=i[s],e=n[s],f=c.startsWith("{")&&c.endsWith("}"),h=e.startsWith("{")&&e.endsWith("}");if(!(f&&h)&&c!==e)return!1}return!0}function Dtt(l,u){const i=[];if(typeof u!="number"){const n=new Ct({id:l.id+"--status-code-must-be-number",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be a number.`,severity:Ie.Error,code:"status-code-must-be-number",entity:l});return i.push(n),{errors:i,override:u}}if(u<100||u>599){const n=new Ct({id:l.id+"--status-code-must-be-between-100-and-599",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be a number between 100 and 599.`,severity:Ie.Error,code:"status-code-must-be-between-100-and-599",entity:l});i.push(n)}return{errors:i,override:u}}class Ctt extends jo{constructor(i){var f,h;super(_o,i);C(this,"initialData");C(this,"id",De.HTTP_ENDPOINT);C(this,"version","1");C(this,"name",De.HTTP_ENDPOINT);C(this,"description",_o.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",_o.abstract);C(this,"static",_o.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=_o,this.project=i,this.id=_o.id,this.version=_o.version,this.name=_o.name,this.static=_o.static,this.abstract=_o.abstract,this.properties=this.initialData.properties.map(m=>{const T=Ve(m,this.project);return T.setParent(this,null),T.initChildren(null),T}),this.methods=this.initialData.methods.map(m=>{const T=Ve(m,this.project);return T.parent=this,T}),this.abstractMethods=this.initialData.abstractMethods.map(m=>{const T=Ve(m,this.project);return T.parent=this,T}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id);if(!n)throw new Error("Path property not found in endpoint entity");n._codeNativeValueValidation=(m,T)=>{var $;const g=hT(m,T);let b=typeof g.override=="string"?g.override:"";if(b&&!b.startsWith("/")&&(b="/"+b),typeof b=="string"){if(/[^a-zA-Z0-9\-_/{}]/g.test(b)){const q=new Ct({id:m.id+"--path-contains-invalid-characters",message:`Path "${b}" contains invalid characters. Only alphanumeric, -, _, /, and {} are allowed.`,severity:Ie.Error,code:"path-contains-invalid-characters",entity:m});g.errors.push(q)}let L=!1,K="";for(let q=0;q<b.length;q++){const W=b[q];if(W==="{")L=!0,K+=W;else if(W==="}"){if(!L){const Z=new Ct({id:m.id+"--path-unopened-curly-bracket",message:`Path "${b}" has a closed curly bracket '}' without an opening bracket '{'.`,severity:Ie.Error,code:"path-unopened-curly-bracket",entity:m});g.errors.push(Z)}L=!1,K+=W}else K+=L?W:W.toLowerCase()}if(b=K,L){const q=new Ct({id:m.id+"--path-unclosed-curly-bracket",message:`Path "${b}" has an unclosed curly bracket '{'.`,severity:Ie.Error,code:"path-unclosed-curly-bracket",entity:m});g.errors.push(q)}if(b.includes("{}")){const q=new Ct({id:m.id+"--path-empty-curly-brackets",message:`Path "${b}" has empty curly brackets '{}'. Path parameters must have a name.`,severity:Ie.Error,code:"path-empty-curly-brackets",entity:m});g.errors.push(q)}}g.override=b;const R=m.parent,I=R.properties.find(x=>x.implements.find(L=>L.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id)),D=($=I==null?void 0:I.getDefaultValue())==null?void 0:$.value;if(m.project.entities.filter(x=>Hi(x,De.HTTP_ENDPOINT)&&x.id!==R.id).some(x=>{var q,W;const L=x.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));if(((q=L==null?void 0:L.getDefaultValue())==null?void 0:q.value)!==D)return!1;const K=x.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!K)throw new Error(`"Path" property not found in endpoint entity "${x.name}" (${x.id})`);return uN((W=K.getDefaultValue())==null?void 0:W.value,b)})){const x=new Ct({id:m.id+"--path-conflicts-with-existing-endpoint",message:`Path "${b}" conflicts with another endpoint using the ${D} method.`,severity:Ie.Error,code:"path-conflicts-with-existing-endpoint",entity:m});g.errors.push(x)}return g};const s=this.properties.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id);s&&(s._codeNativeValueValidation=(m,T)=>{var N;const g={errors:[],override:T},b=m.parent,R=b.properties.find($=>$.implements.find(x=>x.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id)),I=(N=R==null?void 0:R.getDefaultValue())==null?void 0:N.value;if(m.project.entities.filter($=>Hi($,De.HTTP_ENDPOINT)&&$.id!==b.id).some($=>{var K,q;const x=$.properties.find(W=>W.implements.find(Z=>Z.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!uN((K=x==null?void 0:x.getDefaultValue())==null?void 0:K.value,I))return!1;const L=$.properties.find(W=>W.implements.find(Z=>Z.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));return((q=L==null?void 0:L.getDefaultValue())==null?void 0:q.value)===T})){const $=new Ct({id:m.id+"--"+Hs.MustBeUniqueAmongSameEntities,message:`Method "${T}" cannot be used because another endpoint is already using the ${T} method on path "${I}".`,severity:Ie.Error,code:Hs.MustBeUniqueAmongSameEntities,entity:m});g.errors.push($)}return g});const c=this.abstractMethods.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.id);if(!c)throw new Error("Handler method not found in endpoint entity");const e=(((h=(f=c.dataType)==null?void 0:f.entity)==null?void 0:h.properties)||[]).find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.dataType.entity.properties.statusCode.id);if(!e)throw new Error("Status code output not found in handler method");e._codeNativeValueValidation=(m,T)=>Dtt(m,T)}}var XE=(l=>(l.InvalidCharacters="cron-invalid-characters",l.MustHaveSixFields="cron-must-have-six-fields",l.DayOfMonthAndWeekConflict="cron-day-of-month-and-week-conflict",l))(XE||{});function wtt(l,u){const i=[];let n=u;if(typeof u!="string"){const e=new Ct({id:l.id+"--"+Hs.ValueMustBeString,message:`Entity of type ${l.type} with id "${l.id}" has an invalid value. The cron expression must be a string.`,severity:Ie.Error,code:Hs.ValueMustBeString,entity:l});return i.push(e),{errors:i,override:""}}n=u.trimStart().replace(/\s{2,}/g," ");const s=/[^0-9A-Z *?\-/,LW#]/g;if(s.test(n)){const e=Array.from(new Set(n.match(s)));i.push(new Ct({id:l.id+"--cron-invalid-characters",message:`Cron expression contains invalid characters: "${e.join(", ")}". Only alphanumeric characters and (* ? - / , L W #) are allowed.`,severity:Ie.Error,code:"cron-invalid-characters",entity:l})),n=n.replace(s,"")}const c=n.split(" ").filter(Boolean);if(c.length!==6)i.push(new Ct({id:l.id+"--cron-must-have-six-fields",message:`Elyx Cron expressions must have exactly 6 fields separated by spaces (Minutes, Hours, Day-of-month, Month, Day-of-week, Year). Currently has ${c.length}.`,severity:Ie.Error,code:"cron-must-have-six-fields",entity:l}));else{const e=c[2],f=c[4];e!=="?"&&f!=="?"&&(i.push(new Ct({id:l.id+"--cron-day-of-month-and-week-conflict",message:"Elyx restricts defining both Day-of-month and Day-of-week simultaneously. If you specify one, the other must be '?'",severity:Ie.Error,code:"cron-day-of-month-and-week-conflict",entity:l})),e==="*"&&f==="*"&&(c[4]="?",n=c.join(" ")))}return{errors:i,override:n}}class Ott extends jo{constructor(i){super(dd,i);C(this,"initialData");C(this,"id",De.CRON_JOB);C(this,"version","1");C(this,"name",De.CRON_JOB);C(this,"description",dd.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",dd.abstract);C(this,"static",dd.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=dd,this.project=i,this.id=dd.id,this.version=dd.version,this.name=dd.name,this.static=dd.static,this.abstract=dd.abstract,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(s=>s.id===B["built-in-base-entity"].BUILT_IN_CRON_JOB_ENTITY.properties.expression.id);if(!n)throw new Error("Expression property not found in cron job entity");n._codeNativeValueValidation=(s,c)=>wtt(s,c)}}class Ptt extends jo{constructor(i){super(Ks,i);C(this,"initialData");C(this,"id",De.RELATIONAL_DATABASE);C(this,"version","1");C(this,"name",De.RELATIONAL_DATABASE);C(this,"description",Ks.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",Ks.abstract);C(this,"static",Ks.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=Ks,this.project=i,this.id=Ks.id,this.version=Ks.version,this.name=Ks.name,this.static=Ks.static,this.abstract=Ks.abstract,this.properties=this.initialData.properties.map(c=>{const e=Ve(c,this.project);return e.setParent(this,null),e.initChildren(null),e}),this.methods=this.initialData.methods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.abstractMethods=this.initialData.abstractMethods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(c=>c.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id);if(!n)throw new Error("Path property not found in endpoint entity");n._codeNativeValueValidation=(c,e)=>Att(c,e);const s=this.properties.find(c=>c.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.minSize.id);s&&(s._codeNativeValueValidation=(c,e)=>{const f={errors:[],override:e};if(typeof e=="number"){if(e<6){const h=new Ct({id:c.id+"--"+we.RelationalDatabaseMinSizeTooSmall,message:"Minimum GB size cannot be less than 6.",severity:Ie.Error,code:we.RelationalDatabaseMinSizeTooSmall,entity:c});f.errors.push(h)}else if(e>65536){const h=new Ct({id:c.id+"--"+we.RelationalDatabaseMinSizeTooLarge,message:"Minimum GB size cannot be greater than 65536.",severity:Ie.Error,code:we.RelationalDatabaseMinSizeTooLarge,entity:c});f.errors.push(h)}}else if(e!==void 0){const h=new Ct({id:c.id+"--"+we.RelationalDatabaseMinSizeMustBeNumber,message:"Minimum GB size must be a number.",severity:Ie.Error,code:we.RelationalDatabaseMinSizeMustBeNumber,entity:c});f.errors.push(h)}return f})}}var xtt=(l=>(l.InvalidCharacters="compute-name-invalid-characters",l.TooLong="compute-name-too-long",l.Empty="compute-name-empty",l))(xtt||{});class Vtt extends jo{constructor(i){super(ud,i);C(this,"initialData");C(this,"id",De.COMPUTE_ENTITY);C(this,"version","1");C(this,"name",De.COMPUTE_ENTITY);C(this,"description",ud.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",ud.abstract);C(this,"static",ud.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=ud,this.project=i,this.id=ud.id,this.version=ud.version,this.name=ud.name,this.static=ud.static,this.abstract=ud.abstract,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(s=>s.id===B["built-in-base-entity"][De.COMPUTE_ENTITY].properties.computeName.id);n&&(n._codeNativeValueValidation=(s,c)=>{const e={errors:[],override:c};if(typeof c!="string"||!c){const h=new Ct({id:s.id+"--compute-name-empty",message:"Compute name cannot be empty.",severity:Ie.Error,code:"compute-name-empty",entity:s});return e.errors.push(h),e}if(c.length>255){const h=new Ct({id:s.id+"--compute-name-too-long",message:"Compute name must be 255 characters or fewer.",severity:Ie.Error,code:"compute-name-too-long",entity:s});e.errors.push(h)}if(/[^a-zA-Z0-9\-_]/g.test(c)){const h=new Ct({id:s.id+"--compute-name-invalid-characters",message:`Compute name "${c}" contains invalid characters. Only alphanumeric characters, hyphens (-), and underscores (_) are allowed.`,severity:Ie.Error,code:"compute-name-invalid-characters",entity:s});e.errors.push(h)}return e.errors.length||this.project.entities.filter(m=>Hi(m,De.COMPUTE_ENTITY)&&m.id!==this.id).forEach(m=>{var g;const T=m.properties.find(b=>b.implements.some(R=>R.id===B[r.BuiltInBaseEntity][De.COMPUTE_ENTITY].properties.computeName.id));if(T&&(T==null?void 0:T.id)!==s.id&&((g=T.defaultValue)==null?void 0:g.value)===c){const b=new Ct({id:s.id+"--"+we.ComputeNameNotUnique,message:`Compute name "${c}" is duplicated.`,severity:Ie.Error,code:we.ComputeNameNotUnique,entity:s});e.errors.push(b)}}),e})}}var _tt=(l=>(l.InvalidImageUri="container-compute-invalid-image-uri",l.InvalidMinTasks="container-compute-invalid-min-tasks",l.InvalidMaxTasks="container-compute-invalid-max-tasks",l.MaxTasksLessThanMinTasks="container-compute-max-less-than-min",l.InvalidEphemeralStorage="container-compute-invalid-ephemeral-storage",l))(_tt||{});class Ntt extends jo{constructor(i){super(pd,i);C(this,"initialData");C(this,"id",De.CONTAINER_COMPUTE_ENTITY);C(this,"version","1");C(this,"name",De.CONTAINER_COMPUTE_ENTITY);C(this,"description",pd.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",pd.abstract);C(this,"static",pd.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=pd,this.project=i,this.id=pd.id,this.version=pd.version,this.name=pd.name,this.static=pd.static,this.abstract=pd.abstract,this.properties=this.initialData.properties.map(f=>{const h=Ve(f,this.project);return h.setParent(this,null),h.initChildren(null),h}),this.methods=this.initialData.methods.map(f=>{const h=Ve(f,this.project);return h.parent=this,h}),this.abstractMethods=this.initialData.abstractMethods.map(f=>{const h=Ve(f,this.project);return h.parent=this,h}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(f=>f.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.imageUri.id);n&&(n._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="string"||!h)return m;if(/\s/.test(h)){const T=new Ct({id:f.id+"--container-compute-invalid-image-uri",message:`Image URI "${h}" contains spaces, which is invalid.`,severity:Ie.Error,code:"container-compute-invalid-image-uri",entity:f});m.errors.push(T)}return m});const s=this.properties.find(f=>f.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id);s&&(s._codeNativeValueValidation=(f,h)=>{var R;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<0){const I=new Ct({id:f.id+"--container-compute-invalid-min-tasks",message:"Minimum Tasks must be 0 or greater.",severity:Ie.Error,code:"container-compute-invalid-min-tasks",entity:f});m.errors.push(I)}const g=f.parent.properties.find(I=>I.implements.find(D=>D.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id)),b=(R=g==null?void 0:g.getDefaultValue())==null?void 0:R.value;if(typeof b=="number"&&h>b){const I=new Ct({id:f.id+"--container-compute-max-less-than-min",message:`Minimum Tasks (${h}) cannot be greater than Maximum Tasks (${b}).`,severity:Ie.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(I)}return m});const c=this.properties.find(f=>f.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id);c&&(c._codeNativeValueValidation=(f,h)=>{var R;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<1){const I=new Ct({id:f.id+"--container-compute-invalid-max-tasks",message:"Maximum Tasks must be 1 or greater.",severity:Ie.Error,code:"container-compute-invalid-max-tasks",entity:f});m.errors.push(I)}const g=f.parent.properties.find(I=>I.implements.find(D=>D.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id)),b=(R=g==null?void 0:g.getDefaultValue())==null?void 0:R.value;if(typeof b=="number"&&h<b){const I=new Ct({id:f.id+"--container-compute-max-less-than-min",message:`Maximum Tasks (${h}) cannot be less than Minimum Tasks (${b}).`,severity:Ie.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(I)}return m});const e=this.properties.find(f=>{var h;return f.id===((h=B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.ephemeralStorage)==null?void 0:h.id)});e&&(e._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="number")return m;if(h<20||h>200){const T=new Ct({id:f.id+"--container-compute-invalid-ephemeral-storage",message:"Ephemeral Storage must be between 20 and 200 GB.",severity:Ie.Error,code:"container-compute-invalid-ephemeral-storage",entity:f});m.errors.push(T)}return m})}}var $tt=(l=>(l.PathContainsInvalidCharacters="shared-drive-mount-path-invalid-characters",l.PathIsSystemFolder="shared-drive-mount-path-is-system-folder",l.PathInvalidFormat="shared-drive-mount-path-invalid-format",l))($tt||{});class Ltt extends jo{constructor(i){super(No,i);C(this,"initialData");C(this,"id",De.SHARED_DRIVE_MOUNT_ENTITY);C(this,"version","1");C(this,"name",De.SHARED_DRIVE_MOUNT_ENTITY);C(this,"description",No.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",No.abstract);C(this,"static",No.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=No,this.project=i,this.id=No.id,this.version=No.version,this.name=No.name,this.static=No.static,this.abstract=No.abstract,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(s=>s.id===B["built-in-base-entity"][De.SHARED_DRIVE_MOUNT_ENTITY].properties.path.id);if(!n)throw new Error("Path property not found in shared drive mount entity");n._codeNativeValueValidation=(s,c)=>{const e=hT(s,c);let f=typeof e.override=="string"?e.override:"";if(f&&!f.startsWith("/")&&(f="/"+f),typeof f=="string"){if(/[^a-zA-Z0-9\-_/]/g.test(f)){const T=new Ct({id:s.id+"--shared-drive-mount-path-invalid-characters",message:`Mount path "${f}" contains invalid characters. Only alphanumeric, -, _, and / are allowed.`,severity:Ie.Error,code:"shared-drive-mount-path-invalid-characters",entity:s});e.errors.push(T)}const m=["/bin","/boot","/dev","/etc","/lib","/lib64","/proc","/sys","/usr","/sbin","/run","/var/run"];for(const T of m)if(f===T||f.startsWith(T+"/")){const g=new Ct({id:s.id+"--shared-drive-mount-path-is-system-folder",message:`Mounting to or within critical system folder "${T}" is not allowed.`,severity:Ie.Error,code:"shared-drive-mount-path-is-system-folder",entity:s});e.errors.push(g);break}}return e.override=f,e}}}var Gtt=(l=>(l.DocumentCannotStartWithSlash="document-cannot-start-with-slash",l.DocumentContainsInvalidCharacters="document-contains-invalid-characters",l))(Gtt||{});class Btt extends jo{constructor(i){super(xr,i);C(this,"initialData");C(this,"id",De.CLOUD_FILE_SYSTEM_BUCKET);C(this,"version","1");C(this,"name",De.CLOUD_FILE_SYSTEM_BUCKET);C(this,"description",xr.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",xr.abstract);C(this,"static",xr.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=xr,this.project=i,this.id=xr.id,this.version=xr.version,this.name=xr.name,this.static=xr.static,this.abstract=xr.abstract,this.properties=this.initialData.properties.map(c=>{const e=Ve(c,this.project);return e.setParent(this,null),e.initChildren(null),e}),this.methods=this.initialData.methods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.abstractMethods=this.initialData.abstractMethods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(c=>{var e;return c.id===((e=B["built-in-base-entity"].BUILT_IN_CLOUD_FILE_SYSTEM_BUCKET_ENTITY.properties.indexDocument)==null?void 0:e.id)});n&&(n._codeNativeValueValidation=(c,e)=>{const f=hT(c,e);let h=typeof f.override=="string"?f.override:"";if(typeof h=="string"&&h.startsWith("/")){const m=new Ct({id:c.id+"--document-cannot-start-with-slash",message:`Document "${h}" cannot start with a slash. It must be a relative path.`,severity:Ie.Error,code:"document-cannot-start-with-slash",entity:c});f.errors.push(m)}return f});const s=this.properties.find(c=>{var e;return c.id===((e=B["built-in-base-entity"].BUILT_IN_CLOUD_FILE_SYSTEM_BUCKET_ENTITY.properties.errorDocument)==null?void 0:e.id)});s&&(s._codeNativeValueValidation=(c,e)=>{const f=hT(c,e);let h=typeof f.override=="string"?f.override:"";if(typeof h=="string"&&h.startsWith("/")){const m=new Ct({id:c.id+"--document-cannot-start-with-slash",message:`Document "${h}" cannot start with a slash. It must be a relative path.`,severity:Ie.Error,code:"document-cannot-start-with-slash",entity:c});f.errors.push(m)}return f})}}class Mtt extends Yn{constructor(i){super(bl,i);C(this,"id",bl.id);C(this,"name",bl.name);C(this,"description",bl.description);C(this,"version",bl.version);C(this,"autoexecutable",!1);C(this,"type",r.ActionDescriptor);C(this,"inputs",[]);C(this,"dataType",null);C(this,"error",null);C(this,"project");this.project=i,this.inputs=bl.inputs.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(null),s}),this.dataType=Ve(bl.dataType,this.project),this.dataType.setParent(this,null),this.dataType.initChildren(null),this.error=bl.error?Ve(bl.error,this.project):null}}var Fo=(l=>(l.UUIDMustBeString="uuid-must-be-string",l.UUIDMustBeValidFormat="uuid-must-be-valid-format",l.UUIDMustNotContainSpaces="uuid-must-not-contain-spaces",l))(Fo||{});function mXi(l,u){const i=[];if(typeof u!="string"){const s=new Ct({id:l.id+"--uuid-must-be-string",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be text.`,severity:Ie.Error,code:"uuid-must-be-string",entity:l});return i.push(s),{errors:i,override:u}}const n=hT(l,u);if(n.errors.length>0)return i.push(...n.errors),{errors:i,override:u};if(!B2(u)){const s=new Ct({id:l.id+"--uuid-must-be-valid-format",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be a valid UUID format. Eg: "123e4567-e89b-12d3-a456-426614174000".`,severity:Ie.Error,code:"uuid-must-be-valid-format",entity:l});i.push(s)}return{errors:i,override:u}}var Ye=(l=>(l.Inherited="inherited",l.DefaultValue="default-value",l.Missing="missing",l.Undefined="undefined",l.Empty="empty",l.AutoCalculated="auto-calculated",l.QueuedAutocalculation="queued-autocalculation",l.External="external",l.Testing="testing",l.ExecutionResult="execution-result",l))(Ye||{});const Ftt={initialized:!1,id:"",project:null,values:{},onWriteCallback:()=>{},onRemoveCallback:()=>{},onWrite:()=>{},onRemove:()=>{},init:()=>{},toJSON:()=>({}),writeValue:()=>{},readValue:()=>null,removeValue:()=>{},clear:()=>{}};function SE(l,u){return{...Ftt,id:l,project:u}}class kE{constructor(u,i){C(this,"initialized",!1);C(this,"id");C(this,"project");C(this,"values",{});C(this,"onWriteCallback",()=>{});C(this,"onRemoveCallback",()=>{});this.id=u,this.project=i,this.init()}onWrite(u){this.onWriteCallback=u}onRemove(u){this.onRemoveCallback=u}init(){var n;if(!((n=this.project)!=null&&n.id)||this.initialized)return;const u={},i={};Object.keys(u).forEach(s=>{const c=u[s],e=new ua(c,this.project);try{if(c.parent){const m=this.project.findSubscribedInstanceFromReference(c.parent);if(!m)return;e.setParent(m,null),e.hydrateAncestors(),e.initChildren(null)}else if(c.standaloneParent){const m=this.project.findSubscribedInstanceFromReference(c.standaloneParent);if(!m)return;e.standalone=!0,e.setStandaloneParent(m,null),e.hydrateAncestors(),e.initChildren(null)}i[s]=e;const f=e.parent||e.standaloneParent,h=iit(e,f,this.project);h?i[s]=h:delete u[s]}catch(f){oe.Logger.error("Error hydrating ancestors: ",f),delete u[s]}}),this.values={...this.values,...i},this.initialized=!0}toJSON(){const u={};return Object.keys(this.values).forEach(i=>{u[i]=this.values[i].toJSON()}),u}writeValue(u,i){if(!u)throw new Error("The value owner entity is required when writing a value to a value store");let s=this.values[u.id];if(!s)if(i instanceof ua)s=i;else if(i)s=Cr(i,this.project);else{const c={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:new Date().toISOString(),author:M.sessionAuthor,deleted:!1,previousVersion:null,value:null,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:u.toReference(),parent:null,valueAsTypeSingle:null,valueAsTypeList:null,autogeneration:null,name:Bc(u.getDataType(null))};s=Cr(c,this.project)}s.standalone=!0,s.initialData.standaloneParent||oe.Logger.warn("instance.initialData: ",s.initialData),s.setStandaloneParent(u,null),s.hydrateAncestors(),s.initChildren(null),i&&(s.metaSync({...i},null),s.setValueAsType(i.valueAsType,null)),this.values[u.id]=s,this.onWriteCallback(u,s)}readValue(u){return this.values[u]||null}removeValue(u){if(!this.values[u])return;delete this.values[u];const i=this.project.get(u);i&&this.onRemoveCallback(i)}clear(){this.values={}}}function va(l){return l!==null&&typeof l=="object"&&!Array.isArray(l)}function z2(l){if(Array.isArray(l))return l.map(h=>typeof h=="number"?h:e(h)?Number(h):String(h));const u=[];let i=0,n="",s=!1,c=null;for(;i<l.length;){const h=l[i];if(h==="."&&!s){n.length&&(u.push(f(n)),n=""),i++;continue}if(h==="["&&!s){n.length&&(u.push(f(n)),n=""),s=!0,i++;continue}if(s){if(!c&&(h==='"'||h==="'")){c=h,i++;continue}if(c){if(h==="\\"&&i+1<l.length){n+=l[i+1],i+=2;continue}if(h===c){c=null,i++;continue}n+=h,i++;continue}if(h==="]"){u.push(f(n)),n="",s=!1,i++;continue}if(/\s/.test(h)&&!c){i++;continue}n+=h,i++;continue}n+=h,i++}return n.length&&u.push(f(n)),u;function e(h){return/^[0-9]+$/.test(h)}function f(h){const m=h.trim();return e(m)?Number(m):m}}function Ww(l,u,i){if(l==null)return i;const n=z2(u);let s=l;for(let c=0;c<n.length;c++){const e=n[c];if(s==null)return i;if(Array.isArray(s)&&typeof e=="number"){if(!(e in s))return i;s=s[e]}else{if(!Object.prototype.hasOwnProperty.call(s,e))return i;s=s[e]}}return s}const TXi=new Set(["__proto__","prototype","constructor"]);function Stt(l){return typeof l=="string"&&TXi.has(l)}function vXi(l,u,i,n){const{createMissing:s=!0,coerce:c=!0}=n??{};if(l==null||typeof l!="object")throw new TypeError("set(...) expects a non-null object as target.");const e=z2(u);if(e.length===0)throw new Error("set(...) path must not be empty.");let f=l;for(let h=0;h<e.length;h++){const m=e[h];if(Stt(m))throw new Error(`Refusing to set unsafe key "${String(m)}" on object.`);const T=h===e.length-1,b=typeof e[h+1]=="number",R=Array.isArray(f)&&typeof m=="number";if(T){if(R&&f[m]==null&&!s)throw new Error(`set(...) missing array index "${String(m)}" (createMissing=false).`);return f[m]=i,l}else{if(!Object.prototype.hasOwnProperty.call(f,m)||f[m]==null){if(!s)throw new Error(`set(...) missing parent at segment "${String(m)}" (createMissing=false).`);f[m]=b?[]:{}}else{const I=f[m],D=I!==null&&typeof I=="object",N=Array.isArray(I);if(b){if(!N){if(!c)throw new Error(`set(...) expected an array at "${String(m)}" but found non-array (coerce=false).`);f[m]=[]}}else if(!D||N){if(!c)throw new Error(`set(...) expected an object at "${String(m)}" but found non-object (coerce=false).`);f[m]={}}}f=f[m]}}return l}function Y2(l,u,i,n){const s=z2(u);if(s.length===0)return l;function c(e,f){const h=s[f],m=f===s.length-1;if(n==="strict-set"||n==="strict-delete"){if(Stt(h))throw new Error(`Unsafe key "${String(h)}"`);if(e==null||typeof e!="object"&&!Array.isArray(e))throw new Error(`Missing parent or invalid container at segment "${String(h)}".`);if(n==="strict-delete"&&m&&!(h in e))return e}let T;if(Array.isArray(e))T=[...e];else if(e&&typeof e=="object")T={...e};else if(n==="safe-set")T=typeof h=="number"?[]:{};else throw new Error(`Cannot traverse path at "${String(h)}"`);if(m)return n==="strict-delete"?delete T[h]:T[h]=i,T;const g=e?e[h]:void 0;if(n==="safe-set"&&g==null){const b=typeof s[f+1]=="number",R=c(b?[]:{},f+1);return T[h]=R,T}return T[h]=c(g,f+1),T}if(l==null&&n==="safe-set"){const e=typeof s[0]=="number";return c(e?[]:{},0)}return c(l,0)}const wK=Symbol("missing"),gXi=l=>l!=null&&typeof l=="object";function zw(l,u){if(typeof l!="string")throw new TypeError(`${u} expects the key to be a string.`);return l}function xv(l,u){if(typeof l!="string"&&!Array.isArray(l))throw new TypeError(`${u} expects the path to be string or array.`);return l}function H0(l,u){if(!va(l))throw new TypeError(`${u} expects the first argument to be an object.`);return l??{}}function ktt(l,u){const i=zw(u,"ReadKey");return(l??{})[i]}function Utt(l,u,i){const n=zw(u,"WriteKey");if(l&&typeof l=="object"){const s=Array.isArray(l)?[...l]:{...l};return s[n]=i,s}return{[n]:i}}function jtt(l,u){if(!l||typeof l!="object")return{};const i=String(u),{[i]:n,...s}=l;return s}function Ktt(l,u,i){const n=H0(l,"ReadNestedKey"),s=xv(u,"ReadNestedKey");return Ww(n,s,i)}function qtt(l,u,i){const n=H0(l,"WriteNestedKey"),s=xv(u,"WriteNestedKey");return Y2(n,s,i,"strict-set")}function Ztt(l,u,i){const n=H0(l,"WriteSafeNestedKeyRecursively"),s=xv(u,"WriteSafeNestedKeyRecursively");return Y2(n,s,i,"safe-set")}function Htt(l,u){const i=H0(l,"DeleteNestedKey"),n=xv(u,"DeleteNestedKey");return Y2(i,n,null,"strict-delete")}function Wtt(l,u){const i=zw(u,"HasKey"),n=l;return n!=null&&gXi(n)&&Object.prototype.hasOwnProperty.call(n,i)}function ztt(l,u,i){const n=zw(u,"KeyValueEquals");return l==null||typeof l!="object"?!1:l[n]===i}function Ytt(l,u){const i=l,n=xv(u,"HasNestedKey");return Ww(i,n,wK)!==wK}function Jtt(l,u,i){const n=xv(u,"NestedKeyValueEquals");return Ww(l,n)===i}function Qtt(...l){const u={};for(let i=0;i<l.length;i++){const n=l[i];if(n!=null){if(!va(n))throw new TypeError("MergeObjects expects every argument to be an object (or null/undefined).");Object.assign(u,n)}}return u}function Xtt(l){const u=H0(l,"ObjectKeys");return Object.keys(u)}function eit(l){const u=H0(l,"ObjectValues");return Object.values(u)}function tit(l){const u=H0(l,"ObjectEntries");return Object.entries(u)}const nT=new Set;function EXi(l){return{execution:null,project:l,localTestValues:SE("local-test-values",l),resolvedValues:SE("resolved-values",l),persistedExecutionResults:SE("persisted-execution-results",l),lastExecutionResults:SE("last-execution-results",l),getValueTypePreference:()=>null,setValueTypePreference:()=>{}}}function Vv(l,u,i,n){var f;let s;if(((f=l==null?void 0:l.entity)==null?void 0:f.type)===r.PrimitiveEntity)switch(l.entity.name){case ce.EntityTemplate:s=ce.EntityTemplate;break;case ce.String:s=ce.String;break;case ce.Number:s=ce.Number;break;case ce.Boolean:s=ce.Boolean;break;case ce.Null:s=ce.Null;break;case ce.Enum:s=ce.Enum;break;case ce.KeyValue:s=ce.KeyValue;break;case ce.Untyped:s=ce.Untyped;break;case ce.KeyValue:s=ce.KeyValue;break;case ce.Date:s=ce.Date;break;case ce.UUID:s=ce.UUID;break;case ce.FileReference:s=ce.FileReference;break;case ce.Void:s=ce.Void;break;case ce.ActionDescriptor:s=ce.ActionDescriptor;break;case ce.Bytes:s=ce.Bytes;break;case ce.SqlProgram:s=ce.SqlProgram;break;default:throw new Error(`Primitive type ${He(l.entity,i)} is not supported`)}else s=ce.Untyped;const c=ua.new(n);c.name=s,c.parent=u.toReference();const e=Ve(c,i);return e.hydrateAncestors(),n==null||n.add(e,se.Added),e.addSelfToProject(n),e.initChildren(n),e}function kp(l,u,i=new Set){var n,s,c,e;if(i.has(l.id))return[];if(i.add(l.id),Ni.includes(l.type)){const f=la(l);return V([f,...[f].flatMap(h=>kp(h,u,i))])}else if(l.type===r.OutputMap){if(Ni.includes(l.parent.type)&&((n=l.declaration)==null?void 0:n.type)===r.Property&&l.declaration.static)return V([l,l.declaration,...[l,l.declaration].flatMap(f=>kp(f,u,i))])}else if(l.type===r.InputMap){if(Ni.includes(l.parent.type)&&((s=l.declaration)==null?void 0:s.type)===r.Property&&((c=l.declaration)!=null&&c.static))return V([l.declaration,...[l.declaration].flatMap(f=>kp(f,u,i))])}else if(l.type===r.ValueDescriptor&&((e=l.parent)==null?void 0:e.type)===r.Search){const f=l.parent.inputs.find(h=>{var m;return((m=h.declaration)==null?void 0:m.id)===l.id});if(f)return[f]}return[l]}function iit(l,u,i){return l}function _v(l,u,i=!1){const n=l.readsValue;let s=null;const c=jc(n,u,i);if(c){const e={sources:[c],target:l};s={value:c.value,valueOwner:l,type:Ye.Inherited,inheritanceLink:e}}else s={value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null};return s}function ln(l,u,i){var f;if(!u)return null;let n;if(((f=l==null?void 0:l.entity)==null?void 0:f.type)===r.PrimitiveEntity)switch(l.entity.name){case ce.EntityTemplate:n=ce.EntityTemplate;break;case ce.String:n=ce.String;break;case ce.Number:n=ce.Number;break;case ce.Boolean:n=ce.Boolean;break;case ce.Null:n=ce.Null;break;case ce.Enum:n=ce.Enum;break;case ce.KeyValue:n=ce.KeyValue;break;case ce.Untyped:n=ce.Untyped;break;case ce.KeyValue:n=ce.KeyValue;break;case ce.Date:n=ce.Date;break;case ce.UUID:n=ce.UUID;break;case ce.FileReference:n=ce.FileReference;break;case ce.Void:n=ce.Void;break;case ce.ActionDescriptor:n=ce.ActionDescriptor;break;case ce.Bytes:n=ce.Bytes;break;case ce.SqlProgram:n=ce.SqlProgram;break;default:throw new Error(`Primitive type ${He(l.entity,i)} is not supported`)}else n=ce.Untyped;if(!i.get(u.id))return null;const c=ua.new(null);c.name=n,c.standaloneParent=u.toReference();let e=new ua(c,i);return e.hydrateAncestors(),e.standalone=!0,e.setStandaloneParent(u,null),e.initChildren(null),e}function nit(l,u,i=!1){var c,e;if(u.execution&&u.execution.hasEntity(l)&&!i){const f=(c=u.lastExecutionResults)==null?void 0:c.readValue(l.id);if(f)return{value:f,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=(e=u.localTestValues)==null?void 0:e.readValue(l.id),s=u.getValueTypePreference(l.id);return n&&!i&&(s===null||s!==Ye.DefaultValue)?{value:n,valueOwner:l,type:Ye.Testing,inheritanceLink:null}:{value:null,valueOwner:l,type:Ye.QueuedAutocalculation,inheritanceLink:null}}function R1(l,u,i,n=!1){var e,f;const s={...l},c=u.type===r.VariableDeclaration?u.inputs:ci.includes(u.type)?u.outputs:[];if(!c||c.length===0)return s;for(const h of c){if(!T0(h))continue;const m=yb(h,i,n);if(m&&m.value)try{const T=Ee(h,i.project),g=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||Dr(T);s[g]=Ds((m==null?void 0:m.value)||null)?s[g]:(f=m==null?void 0:m.value)==null?void 0:f.value}catch{}}return s}function UE(l,u,i,n=!1){var e,f;const s={...l},c=u.inputs;if(!c)return s;for(const h of c){if(!T0(h))continue;const m=FI(h,i,n);if(m&&m.value&&m.type!==Ye.Undefined){const T=He(h,i.project),g=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||Dr(T);s[g]=(f=m==null?void 0:m.value)==null?void 0:f.value}}return s}function rit(l,u,i=!1){var T,g,b,R,I,D,N,$;let n={};if(((g=(T=l.getDataType(null))==null?void 0:T.entity)==null?void 0:g.type)===r.DefinitionEntity&&(n={...n,...((b=l.getDataType(null))==null?void 0:b.entity).getActiveRawDefaultValue()}),u.execution&&u.execution.hasEntity(l)&&!i){const x=(R=u.lastExecutionResults)==null?void 0:R.readValue(l.id);if(x){if(va(x.value)){const K={...n,...x.value},q={...UE(K,l,u,i)};x.metaSync({value:q},null)}return{value:x,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}}const s=!!((I=u.execution)!=null&&I.entities.length),c=(D=u.execution)==null?void 0:D.hasEntity(l),e=l.readsValue;let f=null;if(e){const x=(N=u.execution)==null?void 0:N.hasEntity(e);if((!s||s&&x&&c||s&&!x&&!c)&&(f=_v(l,u,i),f&&f.value&&va(f.value.value))){const K={...n,...f.value.value},q={...UE(K,l,u,i)};f.value.metaSync({value:q},null)}}const h=l.defaultValue,m=u.getValueTypePreference(l.id);if(!f&&h){const x=h;if(x&&x.value===null&&x.autogeneration){const L=WO(x);if(x.metaSync({value:L},null),va(L)){const K={...UE(L,l,u,i)};x.metaSync({value:K},null)}}(i||m===null||m!==Ye.Testing)&&(f={value:x,valueOwner:l,type:Ds(x)?l.readsValue?Ye.Inherited:Ye.Empty:Ye.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ye.DefaultValue||f.type===Ye.External)&&!i||m===Ye.Testing){const x=($=u.localTestValues)==null?void 0:$.readValue(l.id);if(x){if(va(x.value)){const L={...n,...x.value},K={...UE(L,l,u,i)};x.metaSync({value:K},null)}return{value:x,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}}return Ds((f==null?void 0:f.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function J2(l,u,i=!1){var f,h,m,T,g,b,R,I,D,N,$,x,L,K,q,W,Z;let n={};if(((h=(f=l.getDataType(null))==null?void 0:f.entity)==null?void 0:h.type)===r.DefinitionEntity?n={...n,...((m=l.getDataType(null))==null?void 0:m.entity).getActiveRawDefaultValue()}:((g=(T=l.getDataType(null))==null?void 0:T.entity)==null?void 0:g.type)===r.BuiltInBaseEntity&&(n={...n,...((b=l.getDataType(null))==null?void 0:b.entity).getRawDefaultValue()}),u.execution&&u.execution.hasEntity(l)&&!i){const X=(R=u.lastExecutionResults)==null?void 0:R.readValue(l.id);if(X){if(va(X.value)){const z={...n,...X.value},J=R1(z,l,u,i);X==null||X.metaSync({value:J},null)}return{value:X,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}}const s=(I=u.localTestValues)==null?void 0:I.readValue(l.id);let c=!1;if(l.type===r.VariableDeclaration){const X=l,te=!!((D=u.execution)!=null&&D.entities.length),z=(N=u.execution)==null?void 0:N.hasEntity(l),J=X.readsValue;if(J){const Q=($=u.execution)==null?void 0:$.hasEntity(J);c=!te||te&&Q&&z||te&&!Q&&!z}}const e=u.getValueTypePreference(l.id);if(s&&!i&&(!c||e===Ye.Testing)){if(va(s.value)){const te={...n,...s.value},z=R1(te,l,u,i);s.metaSync({value:z},null)}return{value:s,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}if((x=l.getDataType(null))!=null&&x.entity&&(((K=(L=l.getDataType(null))==null?void 0:L.entity)==null?void 0:K.type)===r.DefinitionEntity||((W=(q=l.getDataType(null))==null?void 0:q.entity)==null?void 0:W.type)===r.BuiltInBaseEntity)&&((Z=l.getDataType(null))!=null&&Z.isObject())){const X=ln(l.dataType,l,u.project),te=R1(n,l,u,i);return X==null||X.metaSync({value:te},null),{value:X,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null}}return null}function Yw(l,u,i=!1){var T,g,b,R,I;if((T=l.dataType)!=null&&T.isObject())return rit(l,u,i);const n=Zt(l),s=!!((g=u.execution)!=null&&g.entities.length),c=(b=u.execution)==null?void 0:b.hasEntity(n),e=l.readsValue;let f=null;if(e){const D=(R=u.execution)==null?void 0:R.hasEntity(e);(!s||s&&D&&c||s&&!D&&!c)&&(f=_v(l,u,i))}const h=l.defaultValue,m=u.getValueTypePreference(l.id);if(!f&&h){const D=h;if(D&&D.value===null&&D.autogeneration){const N=WO(D);D.metaSync({value:N},null)}(i||m===null||m!==Ye.Testing)&&(f={value:D,valueOwner:l,type:Ds(D)?l.readsValue?Ye.Inherited:Ye.Empty:Ye.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ye.DefaultValue||f.type===Ye.External)&&!i||m===Ye.Testing){const D=(I=u.localTestValues)==null?void 0:I.readValue(l.id);if(D)return{value:D,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}return Ds((f==null?void 0:f.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function Q2(l,u,i=!1){var s,c;if(u.execution&&u.execution.hasEntity(l)&&!i){const e=(s=u.lastExecutionResults)==null?void 0:s.readValue(l.id);if(e)return{value:e,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}return(c=l.dataType)!=null&&c.isObject()||l.outputs.length?J2(l,u,i):Yw(l,u,i)}function ait(l,u,i=!1){var b,R,I,D;const n=!!((b=u.execution)!=null&&b.entities.length),s=(R=u.execution)==null?void 0:R.hasEntity(l);let c=null;const e=l.readsValue;if(e){const N=(I=u.execution)==null?void 0:I.hasEntity(e);(!n||n&&N&&s||n&&!N&&!s)&&(c=_v(l,u,i))}const f=l.declaration;if(!c&&f){const N=Yw(f,u,i);N&&N.value&&(c=N)}const h=u.getValueTypePreference(l.id);if(!c||(c.type===Ye.DefaultValue||c.type===Ye.External)&&!i||h===Ye.Testing){const N=(D=u.localTestValues)==null?void 0:D.readValue(l.id);if(N)return{value:N,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const m=tf(l),T=l.getDataType(null);return m&&s&&(!(c!=null&&c.value)||!no(T)&&Up(c==null?void 0:c.value))?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:s&&!m&&Ds((c==null?void 0:c.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:c||{value:null,valueOwner:l,type:Ye.External,inheritanceLink:null}}function sit(l,u,i=!1){return Q2(l.declaration,u,i)}function lit(l,u,i=!1){var R,I,D,N;if(!i&&u.execution&&u.execution.hasEntity(l)){const $=(R=u.lastExecutionResults)==null?void 0:R.readValue(l.id);if($)return{value:$,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=!u.execution||!u.execution.parentExecution,s=u.getValueTypePreference(l.id);if(n){const $=(I=u.localTestValues)==null?void 0:I.readValue(l.id);if($&&!i&&(s===null||s!==Ye.DefaultValue))return{value:$,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const c=Zt(l),e=l.parent.type===r.FunctionDeclaration&&l.parent.parent.type===r.Loop?l.parent:null,f=!!((D=u.execution)!=null&&D.hasEntity(c))||!!e&&!!((N=u.execution)!=null&&N.hasEntity(e));let h=null;const m=l.defaultValue;if(m){const $=m||null;if($&&$.value===null&&$.autogeneration){const x=WO($);$.metaSync({value:x},null)}(i||s===null||s!==Ye.Testing)&&(h={value:$,valueOwner:l,type:Ds($)?Ye.Empty:Ye.DefaultValue,inheritanceLink:null})}!h||(h.type===Ye.DefaultValue||h.type===Ye.External)&&!i||Ye.Testing;const T=tf(l),g=l.getDataType(null);let b=T&&f&&(!(h!=null&&h.value)||!no(g)&&Up(h==null?void 0:h.value));return c.type===r.Loop&&f&&(b=!1),b?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:f&&!T&&Ds((h==null?void 0:h.value)||null)?{value:null,valueOwner:l,type:Ye.Empty,inheritanceLink:null}:h||{value:null,valueOwner:l,type:Ye.External,inheritanceLink:null}}function X2(l,u,i=!1){var R,I,D,N,$,x;if((R=l.getDataType(null))!=null&&R.isObject()||l.outputs.length)return J2(l,u);if(u.execution&&u.execution.hasEntity(l)&&!i){const L=(I=u.lastExecutionResults)==null?void 0:I.readValue(l.id);if(L)return{value:L,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=Zt(l),s=!!((D=u.execution)!=null&&D.entities.length),c=(N=u.execution)==null?void 0:N.hasEntity(n),e=l.readsValue;let f=null;if(e){const L=($=u.execution)==null?void 0:$.hasEntity(e);(!s||s&&L&&c||s&&!L&&!c)&&(f=_v(l,u,i))}const h=l.defaultValue,m=u.getValueTypePreference(l.id);if(!f&&h){const L=h;(i||m===null||m!==Ye.Testing)&&(f={value:L,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ye.DefaultValue||f.type===Ye.External)&&!i||m===Ye.Testing){const L=(x=u.localTestValues)==null?void 0:x.readValue(l.id);if(L)return{value:L,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const T=tf(l),g=l.getDataType(null);return T&&(!(f!=null&&f.value)||!no(g)&&Up(f==null?void 0:f.value))?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:!l.defaultValue&&!l.readsValue?{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null}:!T&&Ds((f==null?void 0:f.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function oit(l,u,i=!1){var e,f,h,m,T,g,b,R;if(u.execution&&u.execution.hasEntity(l)&&!i){const I=(e=u.lastExecutionResults)==null?void 0:e.readValue(l.id);if(I)return{value:I,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=wy(l);if(Zc.includes(n.type)){const I=jc(n,u,i),D=l.codeName||((f=l.declaration)==null?void 0:f.codeName)||Dr(He(l,u.project));if(I!=null&&I.value&&l.parentRelationType!==cd.Error){const N=(I.value.value||{})[D];if(N===void 0)return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null};const $=ln(l.getDataType(null),l,u.project);return $==null||$.metaSync({value:N,rawString:typeof N=="string"&&typeof((h=I==null?void 0:I.value)==null?void 0:h.rawString)=="string"?(m=I==null?void 0:I.value)==null?void 0:m.rawString:void 0},null),{value:$,valueOwner:l,type:!Ni.includes(n.type)&&I.type===Ye.Empty?Ye.QueuedAutocalculation:I.type,inheritanceLink:{sources:[I],target:l}}}return{value:null,valueOwner:l,type:Ni.includes(n.type)?Ye.Empty:Ye.QueuedAutocalculation,inheritanceLink:null}}const s=(T=u.execution)==null?void 0:T.hasEntity(n),c=((g=u.execution)==null?void 0:g.state)===vB.Running;if((b=u.persistedExecutionResults)!=null&&b.values[l.id]&&!s&&!c&&!i){const I=(R=u.persistedExecutionResults)==null?void 0:R.readValue(l.id);if((I==null?void 0:I.value)!==null||(I==null?void 0:I.valueAsType)!==null)return{value:I,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}return null}function pN(l,u,i=!1){var g,b,R,I,D;if(![...ci,...Ni].includes(l.parent.type)||!T0(l))return null;if(((g=l.declaration)==null?void 0:g.type)===r.Property&&l.declaration.static)return jc(l.declaration,u);const n=FI(l,u,i);if(n&&n.type!==Ye.Empty&&n.type!==Ye.Missing&&n.type!==Ye.Undefined)return n;const s=la(l.parent),c=Pu(s,u,i),e=l.codeName||((b=l.declaration)==null?void 0:b.codeName)||Dr(He(l,u.project)),f=ln(l.getDataType(null),l,u.project),h=tf(l),m=(R=c==null?void 0:c.value)==null?void 0:R.value;if(m){let N=(m||{})[e];if(m[e]===void 0)return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:{sources:c?[c]:[],target:l}};f==null||f.metaSync({value:N,rawString:typeof N=="string"&&typeof((I=c==null?void 0:c.value)==null?void 0:I.rawString)=="string"?(D=c==null?void 0:c.value)==null?void 0:D.rawString:void 0},null);const $=tf(l),x=l.getDataType(null);return $&&(!f||!no(x)&&Up(f))?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:{value:f,valueOwner:l,type:c.type,inheritanceLink:{sources:c?[c]:[],target:l}}}return c!=null&&c.type&&c.type!==Ye.Missing&&c.type!==Ye.Empty&&c.type!==Ye.Undefined?{value:null,valueOwner:l,type:c.type,inheritanceLink:{sources:c?[c]:[],target:l}}:h?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}}function cN(l,u,i=!1){var m,T,g,b,R,I,D,N,$,x,L;if(![...ci,...Ni].includes(l.parent.type)||!T0(l))return null;if(((m=l.declaration)==null?void 0:m.type)===r.Property&&l.declaration.static)return jc(l.declaration,u,i);const n=ci.includes(l.parent.type)?l.parent:la(l.parent),s=jc(n,u,i);let c=yb(l,u,i);if((c==null?void 0:c.type)===Ye.Undefined||(c==null?void 0:c.type)===Ye.Missing){const K=la(l.parent);let q=l;K.type===r.VariableDeclaration&&(q=(l.parent===K?l:K.inputs.find(Z=>{var X,te;return((X=Z.declaration)==null?void 0:X.id)===((te=l.declaration)==null?void 0:te.id)}))||l,c=yb(q,u,i))}const e=l.codeName||((T=l.declaration)==null?void 0:T.codeName)||Dr(He(l,u.project));let f=l.defaultValue||ln(l.getDataType(null),l,u.project);const h=(g=s==null?void 0:s.value)==null?void 0:g.value;if(((s==null?void 0:s.type)===Ye.ExecutionResult||(s==null?void 0:s.type)===Ye.Testing)&&!i&&h){let K=(h||{})[e];if(h[e]===void 0&&!l.readsValue&&!l.defaultValue)return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:{sources:s?[s]:[],target:l}};f!=null&&f.parent&&!f.standaloneParent&&(f=f.clone(null,null,null,!1),f.setStandaloneParent(l,null));let q=K;return l.defaultValue&&(q=l.defaultValue.value),f==null||f.metaSync({value:q,rawString:typeof K=="string"&&typeof((b=s==null?void 0:s.value)==null?void 0:b.rawString)=="string"?(R=s==null?void 0:s.value)==null?void 0:R.rawString:void 0},null),{value:f,valueOwner:l,type:s.type,inheritanceLink:{sources:s?[s]:[],target:l}}}if(c&&c.type!==Ye.Empty&&c.type!==Ye.Missing&&c.type!==Ye.Undefined)return c;if(h){let K=(h||{})[e];h[e]!==void 0&&(f!=null&&f.standaloneParent)&&(f==null||f.metaSync({value:K,rawString:typeof K=="string"&&typeof((I=s==null?void 0:s.value)==null?void 0:I.rawString)=="string"?(D=s==null?void 0:s.value)==null?void 0:D.rawString:void 0},null));const q=tf(l),W=l.getDataType(null),Z=q&&(!f||!no(W)&&Up(f)),X=!!((N=u.execution)!=null&&N.entities.length),te=($=u.execution)==null?void 0:$.hasEntity(n),z=n.readsValue;if(z){const J=(x=u.execution)==null?void 0:x.hasEntity(z);if(Z&&(!X||X&&J&&te||X&&!J&&!te))return{value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null}}if(l.readsValue){const J=(L=u.execution)==null?void 0:L.hasEntity(l.readsValue);if(Z&&(!X||X&&J&&te||X&&!J&&!te))return{value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null}}return Z?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:h[e]===void 0&&!l.readsValue&&!l.defaultValue?{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:{sources:s?[s]:[],target:l}}:{value:f,valueOwner:l,type:Ds(f)&&!l.readsValue?Ye.Empty:Ye.Inherited,inheritanceLink:null}}return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null}}function FI(l,u,i=!1){var D,N,$,x,L;const n=Zt(l),s=!!((D=u.execution)!=null&&D.entities.length),c=(N=u.execution)==null?void 0:N.hasEntity(n),e=l.readsValue;let f=null,h=!1;if(e){const K=($=u.execution)==null?void 0:$.hasEntity(e);h=!s||s&&K&&c||s&&!K&&!c,h&&(f=_v(l,u,i))}const m=!!e&&h,T=l.defaultValue,g=u.getValueTypePreference(l.id);if(!f&&T&&(i||g===null||g!==Ye.Testing)&&(f={value:T,valueOwner:l,type:Up(T)?Ye.Empty:Ye.DefaultValue,inheritanceLink:null}),(!f||f.type===Ye.DefaultValue||(f==null?void 0:f.type)===Ye.Empty||g===Ye.Testing)&&!m){const K=(x=u.persistedExecutionResults)==null?void 0:x.readValue(l.id);if(K&&!i)return{value:K,valueOwner:l,type:Ye.Testing,inheritanceLink:null};const q=(L=u.localTestValues)==null?void 0:L.readValue(l.id);if(q&&!i&&(g===null||g===Ye.Testing))return{value:q,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}if(T&&!Up(T))return{value:T,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null};const b=tf(l),R=l.getDataType(null),I=b&&(!(f!=null&&f.value)||!no(R)&&Up(f==null?void 0:f.value));return m&&I?{value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null}:I?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:(f==null?void 0:f.inheritanceLink)||null}:!f&&!l.defaultValue&&!m?{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null}:!b&&(!f||f.type===Ye.Inherited)&&!(f!=null&&f.inheritanceLink)?{value:null,valueOwner:l,type:m?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function yb(l,u,i=!1){var s;if(u.execution&&u.execution.hasEntity(l)&&!i){const c=(s=u.lastExecutionResults)==null?void 0:s.readValue(l.id);if(c)return{value:c,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}return FI(l,u,i)}function dit(l,u,i=!1){var n,s;return Ni.includes(l.parent.type)&&(n=la(l.parent).dataType)!=null&&n.isObject()||ci.includes(l.parent.type)&&(s=l.parent.getDataType(null))!=null&&s.isObject()?pN(l,u,i):FI(l,u,i)}function eB(l,u,i=!1){var n,s;if(Ni.includes(l.parent.type)){const c=la(l.parent);if((n=c.dataType)!=null&&n.isObject()||c.inputs.length)return cN(l,u,i)}return ci.includes(l.parent.type)&&((s=l.parent.getDataType(null))!=null&&s.isObject()||l.parent.outputs.length)?cN(l,u,i):yb(l,u,i)}function uit(l,u,i=!1){var T,g;if(u.execution){const b=(T=u.lastExecutionResults)==null?void 0:T.readValue(l.id);if(b&&!i)return{value:b,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=!u.execution||!u.execution.parentExecution,s=u.getValueTypePreference(l.id);if(n){const b=(g=u.localTestValues)==null?void 0:g.readValue(l.id);if(b&&!i&&(s===null||s!==Ye.DefaultValue))return{value:b,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const c=l.defaultValue;let e=null;c&&(i||s===null||s!==Ye.Testing)&&(e={value:c,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null});const f=tf(l),h=l.getDataType(null);return f&&(!(e!=null&&e.value)||!no(h)&&Up(e==null?void 0:e.value))&&l.static?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:Ds(e==null?void 0:e.value)?{value:null,valueOwner:l,type:Ye.Empty,inheritanceLink:null}:e}function pit(l,u,i=!1){var f,h,m;if(u.execution&&u.execution.hasEntity(l)&&!i){const T=(f=u.lastExecutionResults)==null?void 0:f.readValue(l.id);if(T)return{value:T,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=!u.execution||!u.execution.parentExecution,s=u.getValueTypePreference(l.id);if(n){const T=(h=u.localTestValues)==null?void 0:h.readValue(l.id);if(T&&!i&&(s===null||s!==Ye.DefaultValue))return{value:T,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const c=l.defaultValue;let e=null;if(c&&(i||s===null||s!==Ye.Testing)&&(e={value:c,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null}),((m=l.parent)==null?void 0:m.type)===r.Search){const T=l.parent.inputs.find(g=>{var b;return((b=g.declaration)==null?void 0:b.id)===l.id});if(T)return eB(T,u,i)}return Ds((e==null?void 0:e.value)||null)?{value:null,valueOwner:l,type:Ye.Empty,inheritanceLink:null}:e}function jc(l,u,i=!1){if(nT.has(l.id))return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null};nT.add(l.id);try{switch(l.type){case r.ArgumentDeclaration:return lit(l,u,i);case r.InputMap:return eB(l,u,i);case r.VariableDeclaration:return Q2(l,u,i);case r.VariableInstance:return sit(l,u,i);case r.OutputMap:return oit(l,u,i);case r.ReturnStatement:case r.BreakStatement:case r.ContinueStatement:return X2(l,u,i);case r.Property:return uit(l,u,i);case r.ValueDescriptor:return pit(l,u,i);case r.Operation:case r.Loop:case r.FunctionCall:case r.InternalCall:case r.Search:return nit(l,u,i);default:return null}}finally{nT.delete(l.id)}}function Pu(l,u,i=!1){if(nT.has(l.id))return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null};nT.add(l.id);try{switch(l.type){case r.InputMap:return dit(l,u,i);case r.VariableDeclaration:return Yw(l,u,i);case r.VariableInstance:return ait(l,u,i);case r.ReturnStatement:case r.BreakStatement:case r.ContinueStatement:return X2(l,u,i);default:return null}}finally{nT.delete(l.id)}}function bXi(l){var u,i,n,s,c;if(l&&l.type===Ye.DefaultValue&&l.value&&l.valueOwner&&(!RD.includes(l.valueOwner.type)||((u=l.valueOwner.defaultValue)==null?void 0:u.id)===l.value.id)){const e=ln(l.valueOwner.getDataType(null),l.valueOwner,l.valueOwner.project);return e==null||e.metaSync({value:(i=l.value)==null?void 0:i.value,rawString:typeof((n=l.value)==null?void 0:n.value)=="string"&&typeof((s=l.value)==null?void 0:s.rawString)=="string"?(c=l.value)==null?void 0:c.rawString:void 0},null),{type:Ye.DefaultValue,value:e,valueOwner:l.valueOwner,inheritanceLink:null}}return l}function IXi(l,u,i,n){var R,I,D,N;let s=!1,c=null,e=null;n instanceof ie?(s=!0,c=n,e=null):(c=null,e=n);const f=la(l.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=s?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!s&&m&&m.id===((R=f.defaultValue)==null?void 0:R.id)&&(m=ln(f.getDataType(null),f,u)):s?m=Vv(f.getDataType(null),f,u,c):m=ln(f.getDataType(null),f,u);const T=He(l,u),g=l.codeName||((I=l.declaration)==null?void 0:I.codeName)||Dr(T);let b={};if(((N=(D=f.dataType)==null?void 0:D.entity)==null?void 0:N.type)===r.DefinitionEntity&&(b={...b,...f.dataType.entity.getActiveRawDefaultValue()}),va(m==null?void 0:m.value)&&(b={...b,...m.value}),b[g]=i,m==null||m.metaSync({value:b},c),s||e==null||e.writeValue(f,m),(i===""||i===null||i===void 0)&&l.type===r.OutputMap){const $=f.inputs.find(x=>{var L,K;return((L=x.declaration)==null?void 0:L.id)===((K=l.declaration)==null?void 0:K.id)||He(x,u)===T});if($){let x=s?$.defaultValue:e==null?void 0:e.readValue($.id);x&&x.metaSync({value:null},c),s||e==null||e.removeValue($.id)}}return c}function AXi(l,u,i){const n=kp(l,u);let s=!1,c=null,e=null;return i instanceof ie?(s=!0,c=i,e=null):(c=null,e=i),n.forEach(f=>{var m;let h=s?((m=f.getDefaultValue)==null?void 0:m.call(f))||null:e==null?void 0:e.readValue(f.id);s?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id)}),c}function RXi(l,u,i,n,s,c){const e=kp(u,i);let f=!1,h=null,m=null;return n instanceof ie?(f=!0,h=n,m=null):(h=null,m=n),i.diggestedBuiltInBaseEntitiesIds.has(u.id)||e.forEach(T=>{var R,I,D,N;if(i.diggestedBuiltInBaseEntitiesIds.has(T.id))return;let g=null;if(f){const $=((R=T.getDefaultValue)==null?void 0:R.call(T))||null;$&&(i.diggestedBuiltInBaseEntitiesIds.has($.id)||((I=$.parent)==null?void 0:I.id)!==T.id?g=$.clone(h,T):g=$)}else g=m==null?void 0:m.readValue(T.id);g?!f&&g&&g.id===((N=(D=T.getDefaultValue)==null?void 0:D.call(T))==null?void 0:N.id)&&(g=ln(T.getDataType(null),T,i)):f?(g=Vv(T.getDataType(null),T,i,h),h==null||h.add(g,se.Added)):g=ln(T.getDataType(null),T,i),g==null||g.setValueAsType(null,h);let b=s||(g==null?void 0:g.name);(!(g!=null&&g.name)||(g==null?void 0:g.name)===ce.Untyped)&&!s&&(typeof l=="string"?b=ce.String:l===null?b=ce.Null:typeof l=="number"?b=ce.Number:typeof l=="boolean"&&(b=ce.Boolean)),g==null||g.metaSync({value:l,name:b,rawString:c!==void 0?c:null},h),f||m==null||m.writeValue(T,g)}),h}function d0(l,u,i,n){let s=!1,c=null,e=null;n instanceof ie?(s=!0,c=n,e=null):(c=null,e=n);const f=l.parent;return u.getVariableDeclarations().forEach(m=>{var g,b,R,I,D,N;const T=m.getDataType(null);if(((g=T==null?void 0:T.entity)==null?void 0:g.id)===f.id){let $=s?m.defaultValue:e==null?void 0:e.readValue(m.id);$?!s&&$&&$.id===((b=m.defaultValue)==null?void 0:b.id)&&($=ln(m.getDataType(null),m,u)):s?$=Vv(m.getDataType(null),m,u,c):$=ln(m.getDataType(null),m,u);const x=He(l,u),L=l.codeName||((R=l.extends)==null?void 0:R.codeName)||((I=l.implements[0])==null?void 0:I.codeName)||Dr(x);let K={};((N=(D=m.dataType)==null?void 0:D.entity)==null?void 0:N.type)===r.DefinitionEntity&&(K={...K,...m.dataType.entity.getActiveRawDefaultValue()}),va($==null?void 0:$.value)&&(K={...K,...$.value}),Array.isArray(i)?K[L]=(i==null?void 0:i.map(q=>q.toShallowJSON()))||null:K[L]=(i==null?void 0:i.toShallowJSON())||null,$==null||$.metaSync({value:K},c),s||e==null||e.writeValue(m,$);return}}),c}function hb(l,u,i,n){var R,I,D,N;let s=!1,c=null,e=null;n instanceof ie?(s=!0,c=n,e=null):(c=null,e=n);const f=la(l.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=s?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!s&&m&&m.id===((R=f.defaultValue)==null?void 0:R.id)&&(m=ln(f.getDataType(null),f,u)):s?m=Vv(f.getDataType(null),f,u,c):m=ln(f.getDataType(null),f,u);const T=He(l,u),g=l.codeName||((I=l.declaration)==null?void 0:I.codeName)||Dr(T);let b={};if(((N=(D=f.dataType)==null?void 0:D.entity)==null?void 0:N.type)===r.DefinitionEntity&&(b={...b,...f.dataType.entity.getActiveRawDefaultValue()}),va(m==null?void 0:m.value)&&(b={...b,...m.value}),Array.isArray(i)?b[g]=(i==null?void 0:i.map($=>$.toShallowJSON()))||null:b[g]=(i==null?void 0:i.toShallowJSON())||null,m==null||m.metaSync({value:b},c),s||e==null||e.writeValue(f,m),i==null&&l.type===r.OutputMap){const $=f.inputs.find(x=>{var L,K;return((L=x.declaration)==null?void 0:L.id)===((K=l.declaration)==null?void 0:K.id)||He(x,u)===T});if($){let x=s?$.defaultValue:e==null?void 0:e.readValue($.id);x&&(Array.isArray(i)?x==null||x.setValueAsTypeList(i,c):x==null||x.setValueAsTypeSingle(i,c)),s||e==null||e.removeValue($.id)}}return c}function cit(l,u,i){var n,s,c,e;return l.type===r.InputMap?((n=l.declaration)==null?void 0:n.type)===r.Property&&l.declaration.static?d0(l.declaration,u,null,i):Ni.includes(l.parent.type)&&((s=l.declaration)==null?void 0:s.type)===r.Property&&hb(l,u,null,i):l.type===r.OutputMap?((c=l.declaration)==null?void 0:c.type)===r.Property&&l.declaration.static?d0(l.declaration,u,null,i):Ni.includes(l.parent.type)&&((e=l.declaration)==null?void 0:e.type)===r.Property&&hb(l,u,null,i):l.type===r.Property&&l.static&&d0(l,u,null,i),i}function fit(l,u,i,n){var s,c,e,f;return u.type===r.InputMap?((s=u.declaration)==null?void 0:s.type)===r.Property&&u.declaration.static?d0(u.declaration,i,l,n):Ni.includes(u.parent.type)&&((c=u.declaration)==null?void 0:c.type)===r.Property&&hb(u,i,l,n):u.type===r.OutputMap?((e=u.declaration)==null?void 0:e.type)===r.Property&&u.declaration.static?d0(u.declaration,i,null,n):Ni.includes(u.parent.type)&&((f=u.declaration)==null?void 0:f.type)===r.Property&&hb(u,i,null,n):u.type===r.Property&&u.static&&d0(u,i,l,n),n}function DXi(l,u,i){const n=kp(l,u);let s=!1,c=null,e=null;return i instanceof ie?(s=!0,c=i,e=null):(c=null,e=i),n.forEach(f=>{var m;let h=s?(m=f.getDefaultValue)==null?void 0:m.call(f):e==null?void 0:e.readValue(f.id);s?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id),cit(f,u,i)}),c}function CXi(l,u,i,n){const s=kp(u,i);let c=!1,e=null,f=null;return n instanceof ie?(c=!0,e=n,f=null):(e=null,f=n),s.forEach(h=>{var T,g,b;let m=c?(T=h.getDefaultValue)==null?void 0:T.call(h):f==null?void 0:f.readValue(h.id);m?!c&&m&&m.id===((b=(g=h.getDefaultValue)==null?void 0:g.call(h))==null?void 0:b.id)&&(m=ln(h.getDataType(null),h,h.project)):c?m=Vv(h.getDataType(null),h,i,e):m=ln(h.getDataType(null),h,i),Array.isArray(l)?m==null||m.setValueAsTypeList(l,e):m==null||m.setValueAsTypeSingle(l,e),m==null||m.metaSync({value:null},e),c||f==null||f.writeValue(h,m),fit(l,h,i,n)}),e}function _r(l,u){let i=l;return l&&l.parent&&l.project.get(l.id)&&(i=i.clone(null,null,null,!1),i.setStandaloneParent(u,null)),i}class Jw{constructor(u,i){this.extensionsRegistry=u,this.contextType=i,this.off=this.extensionsRegistry.off.bind(this.extensionsRegistry),this.on=this.extensionsRegistry.on.bind(this.extensionsRegistry),this.emit=this.extensionsRegistry.emit.bind(this.extensionsRegistry),this.emitAsync=this.extensionsRegistry.emitAsync.bind(this.extensionsRegistry),this.emitAsyncAll=this.extensionsRegistry.emitAsyncAll.bind(this.extensionsRegistry),this.emitAsyncAllSettled=this.extensionsRegistry.emitAsyncAllSettled.bind(this.extensionsRegistry),this.emitAsyncSequentially=this.extensionsRegistry.emitAsyncSequentially.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAll=this.extensionsRegistry.emitAsyncSequentiallyAll.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAllSettled=this.extensionsRegistry.emitAsyncSequentiallyAllSettled.bind(this.extensionsRegistry)}on(u,i){this.extensionsRegistry.on(u,i)}emit(u,...i){this.extensionsRegistry.emit(u,...i)}off(u,i){this.extensionsRegistry.off(u,i)}emitAsync(u,...i){return this.extensionsRegistry.emitAsync(u,...i)}emitAsyncAll(u,...i){return this.extensionsRegistry.emitAsyncAll(u,...i)}emitAsyncAllSettled(u,...i){return this.extensionsRegistry.emitAsyncAllSettled(u,...i)}emitAsyncSequentially(u,...i){return this.extensionsRegistry.emitAsyncSequentially(u,...i)}emitAsyncSequentiallyAll(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAll(u,...i)}emitAsyncSequentiallyAllSettled(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAllSettled(u,...i)}}var _e=(l=>(l[l.High=1]="High",l[l.Normal=5]="Normal",l[l.Low=10]="Low",l))(_e||{}),ee=(l=>(l.Logic="logic",l.EditorGUI="editor-gui",l.GUI="gui",l.Editor="editor",l.Compile="compile",l.PublicationRun="publication-run",l))(ee||{}),Ne=(l=>(l.All="*",l.OnAll="on:*",l.EmitAll="emit:*",l.ReadAll="read:*",l.WriteAll="write:*",l.UpdateAll="update:*",l.DoAll="do:*",l.OnLogicAll="on:logic:*",l.EmitLogicAll="emit:logic:*",l.ReadLogicAll="read:logic:*",l.WriteLogicAll="write:logic:*",l.UpdateLogicAll="update:logic:*",l.DoLogicAll="do:logic:*",l.OnGUIAll="on:gui:*",l.EmitGUIAll="emit:gui:*",l.ReadGUIAll="read:gui:*",l.WriteGUIAll="write:gui:*",l.UpdateGUIAll="update:gui:*",l.DoGUIAll="do:gui:*",l.OnEditorAll="on:editor:*",l.EmitEditorAll="emit:editor:*",l.ReadEditorAll="read:editor:*",l.WriteEditorAll="write:editor:*",l.UpdateEditorAll="update:editor:*",l.DoEditorAll="do:editor:*",l.OnCompileBefore="on:compile:before:DefinitionEntity",l.OnCompileDefault="on:compile:default:DefinitionEntity",l.OnCompileAfter="on:compile:after:DefinitionEntity",l.EmitCompile="emit:compile:DefinitionEntity",l.DoEditorPublish="do:editor:publish",l.PostGUICanvasSlotNewToolbarButton="write:gui:canvas:slot:toolbar-button",l.ReadGUICanvasSlotToolbarButtons="read:gui:canvas:slot:toolbar-buttons",l.UpdateGUIGlobalTheme="update:gui:global:theme",l))(Ne||{});class yit{constructor(u){C(this,"state",new Map);u&&(this.state=new Map(Object.entries(u)))}get(u){return this.state.get(u)}set(u,i){this.state.set(u,i)}delete(u){this.state.delete(u)}}class hit extends yit{constructor(u,i){super(i),this.parentExtension=u}}class $e{constructor(u,i){C(this,"manifest");C(this,"module");C(this,"state");this.extensionsRegistry=u,this.state=new hit(this,i)}}class fN extends Jw{constructor(i,n){super(i,ee.Logic);C(this,"id");this._project=n,this.id=n.id}get type(){return this._project.type}get name(){return this._project.name}get workspaceId(){return this._project.workspaceId}get description(){return this._project.description}get version(){return this._project.version}get createdAt(){return this._project.createdAt}get previousVersion(){return this._project.previousVersion}get author(){return this._project.author}get deleted(){return this._project.deleted}get editable(){return this._project.editable}get deletable(){return this._project.deletable}get entities(){return[...this._project.entities]}get projects(){return[...this._project.projects]}get functions(){return[...this._project.functions]}get events(){return[...this._project.events]}get variableDeclarations(){return[...this._project.variableDeclarations]}get variableInstances(){return[...this._project.variableInstances]}get conditions(){return[...this._project.conditions]}get operations(){return[...this._project.operations]}get functionCalls(){return[...this._project.functionCalls]}get loops(){return[...this._project.loops]}get searches(){return[...this._project.searches]}get primitives(){return[...this._project.primitives]}get builtInBaseEntities(){return[...this._project.builtInBaseEntities]}get operationDeclarations(){return[...this._project.operationDeclarations]}get globalEventActionDescriptors(){return[...this._project.globalEventActionDescriptors]}get loopDeclarations(){return[...this._project.loopDeclarations]}get loopDeclarationsBodies(){return[...this._project.loopDeclarationsBodies]}get conditionDeclarations(){return[...this._project.conditionDeclarations]}get valueDescriptors(){return[...this._project.valueDescriptors]}get dataTypes(){return[...this._project.dataTypes]}get errors(){return[...this._project.errors]}get history(){return[...this._project.history]}get undoableStackValueIndex(){return this._project.undoableStackValueIndex}get knownVersions(){return this._project.knownVersions}get activeVersion(){return this._project.activeVersion}get initialized(){return this._project.initialized}get startedInitialization(){return this._project.startedInitialization}closePersistChangeSetsSequentially(){return this._project.closePersistChangeSetsSequentially()}persistChangeSetSequentially(i){return this._project.persistChangeSetSequentially(i)}toLatestChangeSet(i,n,s,c=!1,e="here-this"){return this._project.toLatestChangeSet(i,n,s,c,e)}addChangeSet(i){return this._project.addChangeSet(i)}discardChangeSet(i){return this._project.discardChangeSet(i)}subscribeDependents(i){return this._project.subscribeDependents(i)}unsubscribeDependents(i){return this._project.unsubscribeDependents(i)}syncDependents(i){return this._project.syncDependents(i)}onDetachedDependencyRemoved(i,n,s){return this._project.onDetachedDependencyRemoved(i,n,s)}onDetachedDependencyRestored(i,n,s){return this._project.onDetachedDependencyRestored(i,n,s)}increaseVersion(i){return this._project.increaseVersion(i)}captureVersion(){return this._project.captureVersion()}restoreVersion(i){return this._project.restoreVersion(i)}updateWithShallowTransfer(i,n){return this._project.updateWithShallowTransfer(i,n)}hydrateAncestors(){return this._project.hydrateAncestors()}afterAllChildrenInitialized(i=null){return this._project.afterAllChildrenInitialized(i)}addSelfToProject(i){return this._project.addSelfToProject(i)}get instancesList(){return[...this._project.instancesList]}isOperationDeclaration(i){return this._project.isOperationDeclaration(i)}isGlobalEventActionDescriptor(i){return this._project.isGlobalEventActionDescriptor(i)}isLoopDeclaration(i){return this._project.isLoopDeclaration(i)}isConditionDeclaration(i){return this._project.isConditionDeclaration(i)}findSubscribedBuiltInInstance(i){return this._project.findSubscribedBuiltInInstance(i)}get(i){return this._project.get(i)}getDeleted(i){return this._project.getDeleted(i)}getManaged(i){return this._project.getManaged(i)}getBuiltIn(i){return this._project.getBuiltIn(i)}findSubscribedInstanceFromReference(i){return this._project.findSubscribedInstanceFromReference(i)}findSubscribedBuiltInInstanceFromReference(i){return this._project.findSubscribedBuiltInInstanceFromReference(i)}metaSync(i,n){return this._project.metaSync(i,n)}getAllBuiltInIds(){return this._project.getAllBuiltInIds()}getAllBuiltIn(){return this._project.getAllBuiltIn()}toFlat(i){return this._project.toFlat(i)}toFlatIds(i){return this._project.toFlatIds(i)}toMeta(){return this._project.toMeta()}toJSON(i){return this._project.toJSON(i)}toJSONClone(i){return this._project.toJSONClone(i)}toReference(i){return this._project.toReference(i)}toShallowJSON(i){return this._project.toShallowJSON(i)}toFlatJSON(i){return this._project.toFlatJSON(i)}toGenerationTarget(i){return this._project.toGenerationTarget(i)}toFlatGenerationTarget(i){return this._project.toFlatGenerationTarget(i)}clearErrors(){return this._project.clearErrors()}validate(){return this._project.validate()}validateChildren(){return this._project.validateChildren()}getErrors(){return this._project.getErrors()}getShallowErrors(){return this._project.getShallowErrors()}addDefinitionEntity(i){return this._project.addDefinitionEntity(i)}addFunctionDeclaration(i){return this._project.addFunctionDeclaration(i)}addFunctionCall(i){return this._project.addFunctionCall(i)}addVariableDeclaration(i){return this._project.addVariableDeclaration(i)}addVariableInstance(i){return this._project.addVariableInstance(i)}addInstalledProject(i){return this._project.addInstalledProject(i)}addGlobalEvent(i){return this._project.addGlobalEvent(i)}addCondition(i){return this._project.addCondition(i)}addOperation(i){return this._project.addOperation(i)}addLoop(i){return this._project.addLoop(i)}addSearch(i){return this._project.addSearch(i)}removeDefinitionEntity(i){return this._project.removeDefinitionEntity(i)}removeCondition(i){return this._project.removeCondition(i)}removeOperation(i){return this._project.removeOperation(i)}removeLoop(i){return this._project.removeLoop(i)}removeSearch(i){return this._project.removeSearch(i)}removeFunctionCall(i){return this._project.removeFunctionCall(i)}removeVariableInstance(i){return this._project.removeVariableInstance(i)}removeVariableDeclaration(i){return this._project.removeVariableDeclaration(i)}removeFunctionDeclaration(i){return this._project.removeFunctionDeclaration(i)}removeInstalledProject(i){return this._project.removeInstalledProject(i)}removeGlobalEvent(i){return this._project.removeGlobalEvent(i)}removeTopLevelVariableDeclaration(i){return this._project.removeTopLevelVariableDeclaration(i)}getEntryPoints(){return this._project.getEntryPoints()}getTerminationStatements(){return this._project.getTerminationStatements()}getFunctionDeclaration(i){return this._project.getFunctionDeclaration(i)}getConditions(){return this._project.getConditions()}getOperations(){return this._project.getOperations()}getVariables(){return this._project.getVariables()}getVariableInstances(){return this._project.getVariableInstances()}getVariableDeclarations(){return this._project.getVariableDeclarations()}getLoops(){return this._project.getLoops()}getSearches(){return this._project.getSearches()}getBuiltInPersistedEntity(){return this._project.getBuiltInPersistedEntity()}requestActiveDynamicValue(i,n=!1){return this._project.requestActiveDynamicValue(i,n)}undo(){return this._project.undo()}redo(){return this._project.redo()}applyExternalChangeSet(i){return this._project.applyExternalChangeSet(i)}toFullProjectTransfer(){return this._project.toFullProjectTransfer()}}function wXi(l,u){return u instanceof fN?u:new fN(l,u)}const qn="built-in-function-implementations__",ke="operations-implementations__",Vo="conditions-implementations__",Be={UUID:"uuid",SEARCH_NODE_IMPLEMENTATION:"search-node-implementation",BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION:qn+Ca.AbortExecution,BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY:qn+Ca.CreatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY:qn+Ca.UpdatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY:qn+Ca.DeletePersistedEntity,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALUES_MERGE_EMPTY:ke+Ya.MergeEmpty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALUES_MERGE_FALSY:ke+Ya.MergeFalsy,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY:ke+Oi.Empty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY:ke+Oi.NotEmpty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL:ke+Oi.PrimitiveEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL:ke+Oi.PrimitiveNotEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST:ke+ds.HttpRequest,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL:ke+Lu.ExecuteSQL,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY:ke+Ge.Validate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT:ke+yo.Wait,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN:ke+ve.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT:ke+ve.Split,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS:ke+ve.DeleteLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS:ke+ve.DeleteFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX:ke+ve.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX:ke+ve.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS:ke+ve.ReplaceFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS:ke+ve.ReplaceLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL:ke+ve.ReplaceAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX:ke+ve.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM:ke+ve.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST:ke+ve.GetFirst,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST:ke+ve.GetLast,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND:ke+ve.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND:ke+ve.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE:ke+ve.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH:ke+ve.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS:ke+ve.GetFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS:ke+ve.GetLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE:ke+ve.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT:ke+ve.Concat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF:ke+ve.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF:ke+ve.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE:ke+ve.Unique,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN:ke+ve.Flatten,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT:ke+ve.Sort,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE:ke+ve.Shuffle,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK:ke+ve.Chunk,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START:ke+ve.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END:ke+ve.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT:ke+ve.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH:ke+le.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE:ke+le.ToLowerCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE:ke+le.ToUpperCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN:ke+le.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS:ke+ve.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL:ke+ve.ContainsAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY:ke+ve.ContainsAny,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX:ke+le.SplitAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS:ke+le.SplitAtAllSeparators,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR:ke+le.SplitAtFirstSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR:ke+le.SplitAtLastSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS:ke+le.DeleteLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS:ke+le.DeleteFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX:ke+le.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX:ke+le.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS:ke+le.ReplaceFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS:ke+le.ReplaceLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX:ke+le.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH:ke+le.ReplaceFirstMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH:ke+le.ReplaceLastMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES:ke+le.ReplaceAllMatches,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM:ke+le.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS:ke+le.GetFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS:ke+le.GetLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF:ke+le.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND:ke+le.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND:ke+le.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE:ke+le.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM:ke+le.Trim,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START:ke+le.TrimStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END:ke+le.TrimEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING:ke+le.Substring,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE:ke+le.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START:ke+le.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END:ke+le.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT:ke+le.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF:ke+le.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX:ke+le.MatchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX:ke+le.MatchAllRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX:ke+le.SearchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX:ke+le.ReplaceRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE:ke+le.NormalizeUnicode,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS:ke+le.RemoveDiacritics,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES:ke+le.CountOccurrences,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX:ke+le.EnsurePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX:ke+le.EnsureSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX:ke+le.RemovePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX:ke+le.RemoveSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION:ke+ge.Addition,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION:ke+ge.Subtraction,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION:ke+ge.Multiplication,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION:ke+ge.Division,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER:ke+ge.Remainder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION:ke+ge.Exponentiation,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE:ke+ge.Absolute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN:ke+ge.Sign,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND:ke+ge.Round,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE:ke+ge.Negate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR:ke+ge.Floor,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL:ke+ge.Ceil,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP:ke+ge.Clamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC:ke+ge.Trunc,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS:ke+ge.RoundToDecimals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP:ke+ge.SnapToStep,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE:ke+ge.MapRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE:ke+ge.Average,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN:ke+ge.Median,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF:ke+ge.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF:ke+ge.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT:ke+ge.SquareRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT:ke+ge.CubeRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT:ke+ge.NthRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP:ke+ge.Exp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL:ke+ge.LogNatural,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10:ke+ge.Log10,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN:ke+ge.Sin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS:ke+ge.Cos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN:ke+ge.Tan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN:ke+ge.Asin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS:ke+ge.Acos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN:ke+ge.Atan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2:ke+ge.Atan2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS:ke+ge.ToRadians,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES:ke+ge.ToDegrees,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF:ke+ge.PercentOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE:ke+ge.PercentageChange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN:ke+ge.MoreThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN:ke+ge.LessThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL:ke+ge.LessThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL:ke+ge.MoreThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER:ke+ht.GenerateRandomInteger,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT:ke+ht.GenerateRandomFloat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL:ke+ht.GenerateRandomHexadecimal,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62:ke+ht.GenerateRandomBase62,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64:ke+ht.GenerateRandomBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC:ke+ht.GenerateRandomAlphanumeric,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER:ke+ht.GenerateIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4:ke+ht.GenerateRandomUUIDv4,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER:ke+ht.GenerateShortIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN:ke+ht.GenerateHexadecimalToken,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH:ke+le.StartsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH:ke+le.EndsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS:ke+le.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX:ke+le.MatchesRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP:ke+H.GetCurrentTimestamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE:ke+H.FormatDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE:ke+H.ParseDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE:ke+H.AddToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE:ke+H.SubtractFromDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES:ke+H.DifferenceBetweenDates,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE:ke+H.ToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX:ke+H.ToUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX:ke+H.FromUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING:ke+H.ToISOString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR:ke+H.GetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH:ke+H.GetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE:ke+H.GetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR:ke+H.GetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE:ke+H.GetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND:ke+H.GetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND:ke+H.GetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY:ke+H.GetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR:ke+H.GetWeekOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER:ke+H.GetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR:ke+H.GetDayOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH:ke+H.GetDaysInMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE:ke+H.GetCurrentIanaTimeZone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR:ke+H.SetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH:ke+H.SetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE:ke+H.SetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR:ke+H.SetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE:ke+H.SetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND:ke+H.SetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND:ke+H.SetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY:ke+H.SetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER:ke+H.SetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF:ke+H.StartOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF:ke+H.EndOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO:ke+H.RoundTo,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE:Vo+H.IsBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER:Vo+H.IsAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME:Vo+H.IsSame,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE:Vo+H.IsSameOrBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER:Vo+H.IsSameOrAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN:Vo+H.IsBetween,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID:Vo+H.IsValid,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR:Vo+H.IsLeapYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE:ke+H.ClampToRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF:ke+H.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF:ke+H.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW:ke+H.FromNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW:ke+H.ToNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF:ke+H.HumanizeDiff,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS:ke+H.AddBusinessDays,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY:ke+H.NextWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY:ke+H.PreviousWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC:ke+H.ToUTC,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE:ke+H.ConvertTimezone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET:ke+H.GetTimezoneOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET:ke+H.SetUTCOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY:ke+Ge.ReadKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY:ke+Ge.WriteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY:ke+Ge.DeleteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY:ke+Ge.ReadNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY:ke+Ge.WriteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY:ke+Ge.DeleteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY:ke+Ge.WriteSafeNestedKeyRecursively,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY:Vo+Ge.HasKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY:Vo+Ge.HasNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS:Vo+Ge.KeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS:Vo+Ge.NestedKeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE:Vo+Ge.IsInstanceOfType,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE:ke+Ge.Merge,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS:ke+Ge.Keys,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES:ke+Ge.Values,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES:ke+Ge.Entries,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF:ke+We.GetTypeOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH:ke+Ei.Hash,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC:ke+Ei.Hmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES:ke+ht.GenerateRandomBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL:ke+Ei.ConstantTimeEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2:ke+Ei.DeriveKeyPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2:ke+da.HashPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2:ke+da.VerifyPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC:ke+ki.BuildJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC:ke+ki.VerifyJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE:ke+ki.DecodeJwt,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING:ke+We.FromBytesToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES:ke+We.ToBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER:ke+We.ToNumber,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING:ke+We.ToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64:ke+We.EncodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64:ke+We.DecodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL:ke+We.EncodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL:ke+We.DecodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX:ke+We.EncodeHex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX:ke+We.DecodeHex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_MULTIPART_BODY:ke+We.ParseMultipartBody,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_DATA_URI:ke+We.ParseDataUri,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DETECT_MIME_TYPE_FROM_BYTES:ke+We.DetectMimeTypeFromBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_SPREADSHEET_RANGE_TO_A1:ke+We.ParseSpreadsheetRangeToA1,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_A1_TO_SPREADSHEET_RANGE:ke+We.ParseA1ToSpreadsheetRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_BYTES_TO_FILE_REFERENCE:ke+We.BytesToFileReference,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FILE_REFERENCE_TO_BYTES:ke+We.FileReferenceToBytes,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE:ke+ps.Parse,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY:ke+ps.Stringify,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_UPLOAD_FILE:ke+qe.UploadFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_FILE:ke+qe.GetFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DOWNLOAD_FILE:ke+qe.DownloadFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_LIST_FILES:ke+qe.ListFiles,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FILE:ke+qe.DeleteFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FILES:ke+qe.DeleteFiles,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_COPY_FILE:ke+qe.CopyFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_MOVE_FILE:ke+qe.MoveFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_RENAME_FILE:ke+qe.RenameFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_FILE_METADATA:ke+qe.GetFileMetadata,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_CHECK_FILE_EXISTS:ke+qe.CheckFileExists,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_PRESIGNED_URL:ke+qe.GetPresignedUrl,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_SET_FILE_ACCESS:ke+qe.SetFileAccess,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_CREATE_FOLDER:ke+qe.CreateFolder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FOLDER:ke+qe.DeleteFolders,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FOLDERS:ke+qe.DeleteFolders,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_CREATE_MULTIPART_UPLOAD:ke+qe.CreateMultipartUpload,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_UPLOAD_PART_PRESIGNED_URL:ke+qe.GetUploadPartPresignedUrl,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_COMPLETE_MULTIPART_UPLOAD:ke+qe.CompleteMultipartUpload,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_ABORT_MULTIPART_UPLOAD:ke+qe.AbortMultipartUpload,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_UPLOAD_FILE_PART:ke+qe.UploadFilePart};class mit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION,version:"1.0.0",description:'Implementation for the built-in function "Abort Execution". It terminates the execution of the current entity being run.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class Tit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Delete SQL database table". It deletes the current entity as an entry in the persisted storage.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class vit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Create SQL database table". It saves the current entity state to the persisted storage.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class git extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Update SQL database table". It saves the current entity state to the persisted storage.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class Eit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.SEARCH_NODE_IMPLEMENTATION,version:"1.0.0",description:"Implementation for search nodes when they get executed and query data.",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({error:"Search module not implemented",data:null})})}}class bit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.UUID,version:"1.0.0",description:"UUID generation module, for all contexts and runtimes",initPriority:_e.High,permissions:[Ne.All],contexts:[]});C(this,"module",n$)}}class Iit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY,version:"1.0.0",description:"Comparison: Empty (!value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.Empty);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[Oi.Empty].inputs.leftHand.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f==null;return{value:j.Success,error:null,result:h}}catch(e){return{value:j.UnhandledError,error:e,result:null}}}})}}class Ait extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY,version:"1.0.0",description:"Comparison: NotEmpty (!!value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.NotEmpty);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[Oi.NotEmpty].inputs.leftHand.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f!=null;return{value:j.Success,error:null,result:h}}catch(e){return{value:j.UnhandledError,error:e,result:null}}}})}}const TD=class TD extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveEqual (typed equality / deep JSON equality)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.PrimitiveEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=(c=(s=n[0])==null?void 0:s.value)==null?void 0:c.name,g=(f=(e=n[0])==null?void 0:e.value)==null?void 0:f.value,b=(m=(h=n[1])==null?void 0:h.value)==null?void 0:m.value;let R=!1;return T&&TD.primitiveSet.has(T)?R=g===b:T===ce.Untyped||T===ce.KeyValue?R=JSON.stringify(g)===JSON.stringify(b):R=!1,{value:j.Success,error:null,result:R}}catch(T){return{value:j.UnhandledError,error:T,result:null}}}})}};C(TD,"primitiveSet",new Set([ce.String,ce.Number,ce.Boolean,ce.Null,ce.Enum,ce.Date,ce.UUID]));let H1=TD;const vD=class vD extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveNotEqual (typed inequality / deep JSON inequality)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.PrimitiveNotEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=(c=(s=n[0])==null?void 0:s.value)==null?void 0:c.name,g=(f=(e=n[0])==null?void 0:e.value)==null?void 0:f.value,b=(m=(h=n[1])==null?void 0:h.value)==null?void 0:m.value;let R=!1;return T&&vD.primitiveSet.has(T)?R=g!==b:T===ce.Untyped||T===ce.KeyValue?R=JSON.stringify(g)!==JSON.stringify(b):R=!1,{value:j.Success,error:null,result:R}}catch(T){return{value:j.UnhandledError,error:T,result:null}}}})}};C(vD,"primitiveSet",new Set([ce.String,ce.Number,ce.Boolean,ce.Null,ce.Enum,ce.Date,ce.UUID]));let W1=vD;var Rit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(c,e,f){var h=e.prototype;f.utc=function(D){var N={date:D,utc:!0,args:arguments};return new e(N)},h.utc=function(D){var N=f(this.toDate(),{locale:this.$L,utc:!0});return D?N.add(this.utcOffset(),i):N},h.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var m=h.parse;h.parse=function(D){D.utc&&(this.$u=!0),this.$utils().u(D.$offset)||(this.$offset=D.$offset),m.call(this,D)};var T=h.init;h.init=function(){if(this.$u){var D=this.$d;this.$y=D.getUTCFullYear(),this.$M=D.getUTCMonth(),this.$D=D.getUTCDate(),this.$W=D.getUTCDay(),this.$H=D.getUTCHours(),this.$m=D.getUTCMinutes(),this.$s=D.getUTCSeconds(),this.$ms=D.getUTCMilliseconds()}else T.call(this)};var g=h.utcOffset;h.utcOffset=function(D,N){var $=this.$utils().u;if($(D))return this.$u?0:$(this.$offset)?g.call(this):this.$offset;if(typeof D=="string"&&(D=function(q){q===void 0&&(q="");var W=q.match(n);if(!W)return null;var Z=(""+W[0]).match(s)||["-",0,0],X=Z[0],te=60*+Z[1]+ +Z[2];return te===0?0:X==="+"?te:-te}(D),D===null))return this;var x=Math.abs(D)<=16?60*D:D;if(x===0)return this.utc(N);var L=this.clone();if(N)return L.$offset=x,L.$u=!1,L;var K=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(L=this.local().add(x+K,i)).$offset=x,L.$x.$localOffset=K,L};var b=h.format;h.format=function(D){var N=D||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.call(this,N)},h.valueOf=function(){var D=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*D},h.isUTC=function(){return!!this.$u},h.toISOString=function(){return this.toDate().toISOString()},h.toString=function(){return this.toDate().toUTCString()};var R=h.toDate;h.toDate=function(D){return D==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():R.call(this)};var I=h.diff;h.diff=function(D,N,$){if(D&&this.$u===D.$u)return I.call(this,D,N,$);var x=this.local(),L=f(D).local();return I.call(x,L,N,$)}}})})(Rit);var OXi=Rit.exports;const PXi=Qo(OXi);var Dit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,c,e){var f,h=function(b,R,I){I===void 0&&(I={});var D=new Date(b),N=function($,x){x===void 0&&(x={});var L=x.timeZoneName||"short",K=$+"|"+L,q=n[K];return q||(q=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:$,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:L}),n[K]=q),q}(R,I);return N.formatToParts(D)},m=function(b,R){for(var I=h(b,R),D=[],N=0;N<I.length;N+=1){var $=I[N],x=$.type,L=$.value,K=i[x];K>=0&&(D[K]=parseInt(L,10))}var q=D[3],W=q===24?0:q,Z=D[0]+"-"+D[1]+"-"+D[2]+" "+W+":"+D[4]+":"+D[5]+":000",X=+b;return(e.utc(Z).valueOf()-(X-=X%1e3))/6e4},T=c.prototype;T.tz=function(b,R){b===void 0&&(b=f);var I,D=this.utcOffset(),N=this.toDate(),$=N.toLocaleString("en-US",{timeZone:b}),x=Math.round((N-new Date($))/1e3/60),L=15*-Math.round(N.getTimezoneOffset()/15)-x;if(!Number(L))I=this.utcOffset(0,R);else if(I=e($,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(L,!0),R){var K=I.utcOffset();I=I.add(D-K,"minute")}return I.$x.$timezone=b,I},T.offsetName=function(b){var R=this.$x.$timezone||e.tz.guess(),I=h(this.valueOf(),R,{timeZoneName:b}).find(function(D){return D.type.toLowerCase()==="timezonename"});return I&&I.value};var g=T.startOf;T.startOf=function(b,R){if(!this.$x||!this.$x.$timezone)return g.call(this,b,R);var I=e(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return g.call(I,b,R).tz(this.$x.$timezone,!0)},e.tz=function(b,R,I){var D=I&&R,N=I||R||f,$=m(+e(),N);if(typeof b!="string")return e(b).tz(N);var x=function(W,Z,X){var te=W-60*Z*1e3,z=m(te,X);if(Z===z)return[te,Z];var J=m(te-=60*(z-Z)*1e3,X);return z===J?[te,z]:[W-60*Math.min(z,J)*1e3,Math.max(z,J)]}(e.utc(b,D).valueOf(),$,N),L=x[0],K=x[1],q=e(L).utcOffset(K);return q.$x.$timezone=N,q},e.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},e.tz.setDefault=function(b){f=b}}})})(Dit);var xXi=Dit.exports;const VXi=Qo(xXi);var Cit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n,s){n.prototype.isBetween=function(c,e,f,h){var m=s(c),T=s(e),g=(h=h||"()")[0]==="(",b=h[1]===")";return(g?this.isAfter(m,f):!this.isBefore(m,f))&&(b?this.isBefore(T,f):!this.isAfter(T,f))||(g?this.isBefore(m,f):!this.isAfter(m,f))&&(b?this.isAfter(T,f):!this.isBefore(T,f))}}})})(Cit);var _Xi=Cit.exports;const NXi=Qo(_Xi);var wit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n){n.prototype.isSameOrAfter=function(s,c){return this.isSame(s,c)||this.isAfter(s,c)}}})})(wit);var $Xi=wit.exports;const LXi=Qo($Xi);var Oit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n){n.prototype.isSameOrBefore=function(s,c){return this.isSame(s,c)||this.isBefore(s,c)}}})})(Oit);var GXi=Oit.exports;const BXi=Qo(GXi);var Pit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="week",n="year";return function(s,c,e){var f=c.prototype;f.week=function(h){if(h===void 0&&(h=null),h!==null)return this.add(7*(h-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var T=e(this).startOf(n).add(1,n).date(m),g=e(this).endOf(i);if(T.isBefore(g))return 1}var b=e(this).startOf(n).date(m).startOf(i).subtract(1,"millisecond"),R=this.diff(b,i,!0);return R<0?e(this).startOf("week").week():Math.ceil(R)},f.weeks=function(h){return h===void 0&&(h=null),this.week(h)}}})})(Pit);var MXi=Pit.exports;const FXi=Qo(MXi);var xit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="day";return function(n,s,c){var e=function(m){return m.add(4-m.isoWeekday(),i)},f=s.prototype;f.isoWeekYear=function(){return e(this).year()},f.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),i);var T,g,b,R,I=e(this),D=(T=this.isoWeekYear(),g=this.$u,b=(g?c.utc:c)().year(T).startOf("year"),R=4-b.isoWeekday(),b.isoWeekday()>4&&(R+=7),b.add(R,i));return I.diff(D,"week")+1},f.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var h=f.startOf;f.startOf=function(m,T){var g=this.$utils(),b=!!g.u(T)||T;return g.p(m)==="isoweek"?b?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):h.bind(this)(m,T)}}})})(xit);var SXi=xit.exports;const kXi=Qo(SXi);var Vit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="month",n="quarter";return function(s,c){var e=c.prototype;e.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var f=e.add;e.add=function(m,T){return m=Number(m),this.$utils().p(T)===n?this.add(3*m,i):f.bind(this)(m,T)};var h=e.startOf;e.startOf=function(m,T){var g=this.$utils(),b=!!g.u(T)||T;if(g.p(m)===n){var R=this.quarter()-1;return b?this.month(3*R).startOf(i).startOf("day"):this.month(3*R+2).endOf(i).endOf("day")}return h.bind(this)(m,T)}}})})(Vit);var UXi=Vit.exports;const jXi=Qo(UXi);var _it={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n,s){n.prototype.dayOfYear=function(c){var e=Math.round((s(this).startOf("day")-s(this).startOf("year"))/864e5)+1;return c==null?e:this.add(c-e,"day")}}})})(_it);var KXi=_it.exports;const qXi=Qo(KXi);var Nit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n,s){i=i||{};var c=n.prototype,e={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function f(m,T,g,b){return c.fromToBase(m,T,g,b)}s.en.relativeTime=e,c.fromToBase=function(m,T,g,b,R){for(var I,D,N,$=g.$locale().relativeTime||e,x=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],L=x.length,K=0;K<L;K+=1){var q=x[K];q.d&&(I=b?s(m).diff(g,q.d,!0):g.diff(m,q.d,!0));var W=(i.rounding||Math.round)(Math.abs(I));if(N=I>0,W<=q.r||!q.r){W<=1&&K>0&&(q=x[K-1]);var Z=$[q.l];R&&(W=R(""+W)),D=typeof Z=="string"?Z.replace("%d",W):Z(W,T,q.l,N);break}}if(T)return D;var X=N?$.future:$.past;return typeof X=="function"?X(D):X.replace("%s",D)},c.to=function(m,T){return f(m,T,this,!0)},c.from=function(m,T){return f(m,T,this)};var h=function(m){return m.$u?s.utc():s()};c.toNow=function(m){return this.to(h(this),m)},c.fromNow=function(m){return this.from(h(this),m)}}})})(Nit);var ZXi=Nit.exports;const HXi=Qo(ZXi);var $it={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i,n,s=1e3,c=6e4,e=36e5,f=864e5,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=31536e6,T=2628e6,g=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,b={years:m,months:T,days:f,hours:e,minutes:c,seconds:s,milliseconds:1,weeks:6048e5},R=function(W){return W instanceof K},I=function(W,Z,X){return new K(W,X,Z.$l)},D=function(W){return n.p(W)+"s"},N=function(W){return W<0},$=function(W){return N(W)?Math.ceil(W):Math.floor(W)},x=function(W){return Math.abs(W)},L=function(W,Z){return W?N(W)?{negative:!0,format:""+x(W)+Z}:{negative:!1,format:""+W+Z}:{negative:!1,format:""}},K=function(){function W(X,te,z){var J=this;if(this.$d={},this.$l=z,X===void 0&&(this.$ms=0,this.parseFromMilliseconds()),te)return I(X*b[D(te)],this);if(typeof X=="number")return this.$ms=X,this.parseFromMilliseconds(),this;if(typeof X=="object")return Object.keys(X).forEach(function(ae){J.$d[D(ae)]=X[ae]}),this.calMilliseconds(),this;if(typeof X=="string"){var Q=X.match(g);if(Q){var ne=Q.slice(2).map(function(ae){return ae!=null?Number(ae):0});return this.$d.years=ne[0],this.$d.months=ne[1],this.$d.weeks=ne[2],this.$d.days=ne[3],this.$d.hours=ne[4],this.$d.minutes=ne[5],this.$d.seconds=ne[6],this.calMilliseconds(),this}}return this}var Z=W.prototype;return Z.calMilliseconds=function(){var X=this;this.$ms=Object.keys(this.$d).reduce(function(te,z){return te+(X.$d[z]||0)*b[z]},0)},Z.parseFromMilliseconds=function(){var X=this.$ms;this.$d.years=$(X/m),X%=m,this.$d.months=$(X/T),X%=T,this.$d.days=$(X/f),X%=f,this.$d.hours=$(X/e),X%=e,this.$d.minutes=$(X/c),X%=c,this.$d.seconds=$(X/s),X%=s,this.$d.milliseconds=X},Z.toISOString=function(){var X=L(this.$d.years,"Y"),te=L(this.$d.months,"M"),z=+this.$d.days||0;this.$d.weeks&&(z+=7*this.$d.weeks);var J=L(z,"D"),Q=L(this.$d.hours,"H"),ne=L(this.$d.minutes,"M"),ae=this.$d.seconds||0;this.$d.milliseconds&&(ae+=this.$d.milliseconds/1e3,ae=Math.round(1e3*ae)/1e3);var de=L(ae,"S"),fe=X.negative||te.negative||J.negative||Q.negative||ne.negative||de.negative,me=Q.format||ne.format||de.format?"T":"",be=(fe?"-":"")+"P"+X.format+te.format+J.format+me+Q.format+ne.format+de.format;return be==="P"||be==="-P"?"P0D":be},Z.toJSON=function(){return this.toISOString()},Z.format=function(X){var te=X||"YYYY-MM-DDTHH:mm:ss",z={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return te.replace(h,function(J,Q){return Q||String(z[J])})},Z.as=function(X){return this.$ms/b[D(X)]},Z.get=function(X){var te=this.$ms,z=D(X);return z==="milliseconds"?te%=1e3:te=z==="weeks"?$(te/b[z]):this.$d[z],te||0},Z.add=function(X,te,z){var J;return J=te?X*b[D(te)]:R(X)?X.$ms:I(X,this).$ms,I(this.$ms+J*(z?-1:1),this)},Z.subtract=function(X,te){return this.add(X,te,!0)},Z.locale=function(X){var te=this.clone();return te.$l=X,te},Z.clone=function(){return I(this.$ms,this)},Z.humanize=function(X){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!X)},Z.valueOf=function(){return this.asMilliseconds()},Z.milliseconds=function(){return this.get("milliseconds")},Z.asMilliseconds=function(){return this.as("milliseconds")},Z.seconds=function(){return this.get("seconds")},Z.asSeconds=function(){return this.as("seconds")},Z.minutes=function(){return this.get("minutes")},Z.asMinutes=function(){return this.as("minutes")},Z.hours=function(){return this.get("hours")},Z.asHours=function(){return this.as("hours")},Z.days=function(){return this.get("days")},Z.asDays=function(){return this.as("days")},Z.weeks=function(){return this.get("weeks")},Z.asWeeks=function(){return this.as("weeks")},Z.months=function(){return this.get("months")},Z.asMonths=function(){return this.as("months")},Z.years=function(){return this.get("years")},Z.asYears=function(){return this.as("years")},W}(),q=function(W,Z,X){return W.add(Z.years()*X,"y").add(Z.months()*X,"M").add(Z.days()*X,"d").add(Z.hours()*X,"h").add(Z.minutes()*X,"m").add(Z.seconds()*X,"s").add(Z.milliseconds()*X,"ms")};return function(W,Z,X){i=X,n=X().$utils(),X.duration=function(J,Q){var ne=X.locale();return I(J,{$l:ne},Q)},X.isDuration=R;var te=Z.prototype.add,z=Z.prototype.subtract;Z.prototype.add=function(J,Q){return R(J)?q(this,J,1):te.bind(this)(J,Q)},Z.prototype.subtract=function(J,Q){return R(J)?q(this,J,-1):z.bind(this)(J,Q)}}})})($it);var WXi=$it.exports;const zXi=Qo(WXi);var Lit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n){n.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}})})(Lit);var YXi=Lit.exports;const JXi=Qo(YXi);U.extend(PXi);U.extend(VXi);U.extend(NXi);U.extend(LXi);U.extend(BXi);U.extend(FXi);U.extend(kXi);U.extend(jXi);U.extend(qXi);U.extend(HXi);U.extend(zXi);U.extend(JXi);const bi=l=>U(l),na=l=>l.toISOString();function Git(){return na(U())}function Bit(l,u){return bi(l).format(u)}function Mit(l){return na(U(l))}function Fit(l){if(l==null)throw new TypeError("ToDate expects a non-null value.");if(typeof l=="string"){const u=U(l);if(!u.isValid())throw new TypeError("Invalid date string.");return u.toISOString()}if(typeof l=="number"&&Number.isFinite(l)){const u=Math.abs(l)<1e12?U.unix(l):U(l);if(!u.isValid())throw new TypeError("Invalid numeric timestamp.");return u.toISOString()}if(l instanceof Date){const u=U(l);if(!u.isValid())throw new TypeError("Invalid Date object.");return u.toISOString()}throw new TypeError("Unsupported value type for ToDate. Provide a string, number, or Date.")}function Sit(l,u,i){return na(bi(l).add(u,i))}function kit(l,u,i){return na(bi(l).subtract(u,i))}function Uit(l,u,i,n=!1){return bi(l).diff(bi(u),i,n)}function jit(l){return bi(l).unix()}function Kit(l){return na(U.unix(l))}function qit(l){return na(bi(l))}function Zit(l){return bi(l).year()}function Hit(l){return bi(l).month()}function Wit(l){return bi(l).date()}function zit(l){return bi(l).hour()}function Yit(l){return bi(l).minute()}function Jit(l){return bi(l).second()}function Qit(l){return bi(l).millisecond()}function Xit(l){return bi(l).isoWeekday()}function ent(l){return bi(l).week()}function tnt(l){return bi(l).quarter()}function int(l){return bi(l).dayOfYear()}function nnt(l){return bi(l).daysInMonth()}function rnt(l,u){return na(bi(l).year(u))}function ant(l,u){return na(bi(l).month(u))}function snt(l,u){return na(bi(l).date(u))}function lnt(l,u){return na(bi(l).hour(u))}function ont(l,u){return na(bi(l).minute(u))}function dnt(l,u){return na(bi(l).second(u))}function unt(l,u){return na(bi(l).millisecond(u))}function pnt(l,u){return na(bi(l).isoWeekday(u))}function cnt(l,u){return na(bi(l).quarter(u))}function fnt(l,u){return na(bi(l).startOf(u))}function ynt(l,u){return na(bi(l).endOf(u))}function hnt(l,u){const i=bi(l),n=i.startOf(u),s=i.endOf(u),c=n.valueOf()+(s.valueOf()-n.valueOf())/2;return na(i.valueOf()<c?n:s)}function mnt(l,u,i){return bi(l).isBefore(bi(u),i)}function Tnt(l,u,i){return bi(l).isAfter(bi(u),i)}function vnt(l,u,i){return bi(l).isSame(bi(u),i)}function gnt(l,u,i){return bi(l).isSameOrBefore(bi(u),i)}function Ent(l,u,i){return bi(l).isSameOrAfter(bi(u),i)}function bnt(l,u,i,n,s="()"){return bi(l).isBetween(bi(u),bi(i),n,s)}function Int(l){return U(l).isValid()}function Ant(l){return bi(l).isLeapYear()}function Rnt(l,u,i){const n=bi(l);return n.isBefore(u)?na(bi(u)):n.isAfter(i)?na(bi(i)):na(n)}function Dnt(l){if(l.length===0)throw new Error("minOf requires at least one date");let u=bi(l[0]);for(let i=1;i<l.length;i++){const n=bi(l[i]);n.isBefore(u)&&(u=n)}return na(u)}function Cnt(l){if(l.length===0)throw new Error("maxOf requires at least one date");let u=bi(l[0]);for(let i=1;i<l.length;i++){const n=bi(l[i]);n.isAfter(u)&&(u=n)}return na(u)}function wnt(l,u=!1){return bi(l).fromNow(u)}function Ont(l,u=!1){return bi(l).toNow(u)}function Pnt(l,u,i=!0){const n=bi(l).diff(bi(u),"millisecond",!0),s=Math.abs(n),e=U.duration(s,"milliseconds").humanize();return i?n>=0?`in ${e}`:`${e} ago`:e}function xnt(l,u,i=["6","7"],n=[]){const s=m=>n.some(T=>bi(T).isSame(m,"day")),c=m=>((m.day()+6)%7+1).toString();let e=bi(l);const f=u>=0?1:-1;let h=Math.abs(u);for(;h>0;){e=e.add(f,"day");const m=c(e);!i.includes(m)&&!s(e)&&h--}return na(e)}function Vnt(l,u){let i=bi(l);const n=u;for(let s=0;s<7;s++)if(i=i.add(1,"day"),i.isoWeekday()===n)return na(i);return na(i)}function _nt(l,u){let i=bi(l);const n=u;for(let s=0;s<7;s++)if(i=i.subtract(1,"day"),i.isoWeekday()===n)return na(i);return na(i)}const Nnt="Local";function tB(){try{const l=Intl.DateTimeFormat().resolvedOptions().timeZone;if(l&&typeof l=="string")return l}catch{}try{if(typeof process<"u"&&process.env&&process.env.TZ)return process.env.TZ}catch{}return null}function iB(){const l=tB();if(l)return l;throw new Error("Unable to detect current IANA timezone from host environment.")}function $nt(l,u,i=!1){let n=u;if(n===Nnt){const e=tB();if(!e)throw new Error("Unable to detect current timezone from host environment.");n=e}const s=n?U.tz(l,n):bi(l),c=i?s.utc(!0):s.utc();return na(c)}function Lnt(l,u,i=!1){const n=bi(l);return na(i?n.tz(u,!0):n.tz(u))}function Gnt(l,u){const i=l===Nnt?iB():l;return bi(u).tz(i).utcOffset()}function Bnt(l,u,i=!1){return na(bi(l).utcOffset(u,i))}class Mnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP,version:"1.0.0",description:"Date get current timestamp operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetCurrentTimestamp);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=Git();return{value:j.Success,error:null,result:s}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Fnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE,version:"1.0.0",description:"Date format operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.FormatDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.FormatDate].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.FormatDate].inputs.format.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Bit(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Snt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE,version:"1.0.0",description:"Date parse operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ParseDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ParseDate].inputs.inputValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Mit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class knt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE,version:"1.0.0",description:"Date add-to-date operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.AddToDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.AddToDate].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.AddToDate].inputs.amount.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.AddToDate].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Sit(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Unt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE,version:"1.0.0",description:"Date subtract-from-date operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SubtractFromDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.SubtractFromDate].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.SubtractFromDate].inputs.amount.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.SubtractFromDate].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=kit(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class jnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES,version:"1.0.0",description:"Date difference-between-dates operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.DifferenceBetweenDates);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m,T,g;try{const b=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.firstDate.id}),R=((s=b==null?void 0:b.value)==null?void 0:s.valueAsType)??((c=b==null?void 0:b.value)==null?void 0:c.value),I=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.secondDate.id}),D=((e=I==null?void 0:I.value)==null?void 0:e.valueAsType)??((f=I==null?void 0:I.value)==null?void 0:f.value),N=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.unit.id}),$=((h=N==null?void 0:N.value)==null?void 0:h.valueAsType)??((m=N==null?void 0:N.value)==null?void 0:m.value),x=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.asFloat.id}),L=((T=x==null?void 0:x.value)==null?void 0:T.valueAsType)??((g=x==null?void 0:x.value)==null?void 0:g.value)??!1,K=Uit(R,D,$,L);return{value:j.Success,error:null,result:K}}catch(b){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:b,result:null}}}})}}class QXi extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE,version:"1.0.0",description:"Date to-date operation implementation module (coerce to ISO 8601 string)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ToDate].inputs.inputValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Fit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Knt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX,version:"1.0.0",description:"Date to-unix operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToUnix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ToUnix].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class qnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX,version:"1.0.0",description:"Date from-unix operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.FromUnix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.FromUnix].inputs.seconds.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Kit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Znt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING,version:"1.0.0",description:"Date to-iso-string operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToISOString);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ToISOString].inputs.inputValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=qit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Hnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR,version:"1.0.0",description:"Date get-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Zit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Wnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH,version:"1.0.0",description:"Date get-month (0-based) operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetMonth);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetMonth].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Hit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class znt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE,version:"1.0.0",description:"Date get-date (day of month) operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetDate].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Wit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Ynt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR,version:"1.0.0",description:"Date get-hour operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetHour);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetHour].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=zit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Jnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE,version:"1.0.0",description:"Date get-minute operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetMinute);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetMinute].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Yit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Qnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND,version:"1.0.0",description:"Date get-second operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetSecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetSecond].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Jit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Xnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND,version:"1.0.0",description:"Date get-millisecond operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetMillisecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetMillisecond].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Qit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class ert extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY,version:"1.0.0",description:"Date get-iso-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetIsoWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetIsoWeekday].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Xit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class trt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR,version:"1.0.0",description:"Date get-week-of-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetWeekOfYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetWeekOfYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ent(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class irt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER,version:"1.0.0",description:"Date get-quarter operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetQuarter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetQuarter].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=tnt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class nrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR,version:"1.0.0",description:"Date get-day-of-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetDayOfYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetDayOfYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=int(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class rrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH,version:"1.0.0",description:"Date get-days-in-month operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetDaysInMonth);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetDaysInMonth].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=nnt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class art extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE,version:"1.0.0",description:"Date get-current-iana-timezone operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetCurrentIanaTimeZone);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=iB();return{value:j.Success,error:null,result:s}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class srt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR,version:"1.0.0",description:"Date set-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetYear].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetYear].inputs.year.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=rnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class lrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH,version:"1.0.0",description:"Date set-month operation implementation module (0-based month)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetMonth);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMonth].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMonth].inputs.month.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=ant(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class ort extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE,version:"1.0.0",description:"Date set-date (day of month) operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetDate].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetDate].inputs.date.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=snt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class drt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR,version:"1.0.0",description:"Date set-hour operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetHour);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetHour].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetHour].inputs.hour.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=lnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class urt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE,version:"1.0.0",description:"Date set-minute operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetMinute);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMinute].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMinute].inputs.minute.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=ont(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class prt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND,version:"1.0.0",description:"Date set-second operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetSecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetSecond].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetSecond].inputs.second.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=dnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class crt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND,version:"1.0.0",description:"Date set-millisecond operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetMillisecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMillisecond].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMillisecond].inputs.millisecond.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=unt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class frt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY,version:"1.0.0",description:"Date set-iso-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetIsoWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetIsoWeekday].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetIsoWeekday].inputs.isoWeekday.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=pnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class yrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER,version:"1.0.0",description:"Date set-quarter operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetQuarter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetQuarter].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetQuarter].inputs.quarter.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=cnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class hrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF,version:"1.0.0",description:"Date start-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.StartOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.StartOf].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.StartOf].inputs.unit.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=fnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class mrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF,version:"1.0.0",description:"Date end-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.EndOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.EndOf].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.EndOf].inputs.unit.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=ynt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Trt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO,version:"1.0.0",description:"Date round-to operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.RoundTo);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.RoundTo].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.RoundTo].inputs.unit.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=hnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class vrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE,version:"1.0.0",description:"Date is-before operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsBefore);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsBefore].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsBefore].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsBefore].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=mnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class grt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER,version:"1.0.0",description:"Date is-after operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsAfter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsAfter].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsAfter].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsAfter].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Tnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Ert extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME,version:"1.0.0",description:"Date is-same operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsSame);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSame].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSame].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSame].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=vnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class brt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE,version:"1.0.0",description:"Date is-same-or-before operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsSameOrBefore);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrBefore].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrBefore].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrBefore].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=gnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Irt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER,version:"1.0.0",description:"Date is-same-or-after operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsSameOrAfter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrAfter].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrAfter].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrAfter].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Ent(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Art extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN,version:"1.0.0",description:"Date is-between operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsBetween);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m,T,g,b,R;try{const I=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.target.id}),D=((s=I==null?void 0:I.value)==null?void 0:s.valueAsType)??((c=I==null?void 0:I.value)==null?void 0:c.value),N=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.start.id}),$=((e=N==null?void 0:N.value)==null?void 0:e.valueAsType)??((f=N==null?void 0:N.value)==null?void 0:f.value),x=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.end.id}),L=((h=x==null?void 0:x.value)==null?void 0:h.valueAsType)??((m=x==null?void 0:x.value)==null?void 0:m.value),K=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.unit.id}),q=((T=K==null?void 0:K.value)==null?void 0:T.valueAsType)??((g=K==null?void 0:K.value)==null?void 0:g.value),W=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.inclusivity.id}),Z=((b=W==null?void 0:W.value)==null?void 0:b.valueAsType)??((R=W==null?void 0:W.value)==null?void 0:R.value),X=bnt(D,$,L,q,Z??void 0);return{value:j.Success,error:null,result:X}}catch(I){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:I,result:null}}}})}}class Rrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID,version:"1.0.0",description:"Date is-valid operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsValid);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.IsValid].inputs.value.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Int(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Drt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR,version:"1.0.0",description:"Date is-leap-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsLeapYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.IsLeapYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Ant(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Crt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE,version:"1.0.0",description:"Date clamp-to-range operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ClampToRange);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.ClampToRange].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.ClampToRange].inputs.min.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.ClampToRange].inputs.max.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Rnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class wrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF,version:"1.0.0",description:"Date min-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.MinOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[H.MinOf].inputs.dates.id}).map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=Dnt(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ort extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF,version:"1.0.0",description:"Date max-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.MaxOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[H.MaxOf].inputs.dates.id}).map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=Cnt(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Prt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW,version:"1.0.0",description:"Date from-now operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.FromNow);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.FromNow].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.FromNow].inputs.withoutSuffix.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value)??!1,R=wnt(m,b);return{value:j.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class xrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW,version:"1.0.0",description:"Date to-now operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToNow);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.ToNow].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.ToNow].inputs.withoutSuffix.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value)??!1,R=Ont(m,b);return{value:j.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Vrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF,version:"1.0.0",description:"Date humanize-diff operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.HumanizeDiff);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.HumanizeDiff].inputs.firstDate.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.HumanizeDiff].inputs.secondDate.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.HumanizeDiff].inputs.withoutSuffix.id}),N=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value)??!0,$=Pnt(g,R,N);return{value:j.Success,error:null,result:$}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class _rt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS,version:"1.1.0",description:"Date add-business-days operation implementation module (ISO-weekend strings)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.AddBusinessDays);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(g=>{var b,R;return((R=(b=g.valueOwner)==null?void 0:b.declaration)==null?void 0:R.id)===B.operation[H.AddBusinessDays].inputs.dateValue.id}).map(g=>{var b,R;return((b=g.value)==null?void 0:b.valueAsType)??((R=g.value)==null?void 0:R.value)}),e=c[0],f=c[1],h=c[2]??void 0,m=c[3]??[],T=xnt(e,f,h,m);return{value:j.Success,error:null,result:T}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Nrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY,version:"1.0.0",description:"Date next-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.NextWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.NextWeekday].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.NextWeekday].inputs.weekday.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Vnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class $rt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY,version:"1.0.0",description:"Date previous-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.PreviousWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.PreviousWeekday].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.PreviousWeekday].inputs.weekday.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=_nt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Lrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC,version:"1.1.0",description:"Date to-utc operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToUTC);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(T=>{var g,b;return((b=(g=T.valueOwner)==null?void 0:g.declaration)==null?void 0:b.id)===B.operation[H.ToUTC].inputs.dateValue.id}).map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)??((b=T.value)==null?void 0:b.value)}),e=c[0],f=c[1]||void 0,h=c[2]??!1,m=$nt(e,f,h);return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Grt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE,version:"1.0.0",description:"Date convert-timezone operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ConvertTimezone);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.ConvertTimezone].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.ConvertTimezone].inputs.targetTimezone.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.ConvertTimezone].inputs.keepLocalTime.id}),N=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value)??!1,$=Lnt(g,R,N);return{value:j.Success,error:null,result:$}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Brt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET,version:"1.0.0",description:"Date get-timezone-offset operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetTimezoneOffset);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[H.GetTimezoneOffset].inputs.timezone.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[H.GetTimezoneOffset].inputs.atDate.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),I=Gnt(m,g);return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Mrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET,version:"1.0.0",description:"Date set-utc-offset operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetUTCOffset);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.SetUTCOffset].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.SetUTCOffset].inputs.offsetMinutes.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.SetUTCOffset].inputs.keepLocalTime.id}),N=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value)??!1,$=Bnt(g,R,N);return{value:j.Success,error:null,result:$}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Frt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(yo.Wait);s&&(s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[yo.Wait].inputs.duration.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return typeof f!="number"||f<0?{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"Invalid wait time provided",result:null}:(await new Promise(h=>setTimeout(h,f)),{value:j.Success,error:null,result:null})}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}const XXi=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,nB=l=>l===null||["string","number","boolean"].includes(typeof l);function Js(l,u="Input must be an array"){if(!Array.isArray(l))throw new TypeError(u);return l}function fp(l){const u=Js(l,"Input must be an array");if(!u||u.length===0)throw new TypeError("No list provided or list is empty");return u}function rB(l){return Array.isArray(l)?l:[]}function md(l){return Number(l)}function Srt(l){if(!l||l.length===0)throw new TypeError("No input lists provided");if(!l.every(n=>Array.isArray(n)))throw new TypeError("All inputs must be arrays");const[u,...i]=l;return i.reduce((n,s)=>n.concat(s),u)}function krt(l,...u){if(!Array.isArray(l))throw new TypeError("First input must be an array");if(!u.every(i=>Array.isArray(i)))throw new TypeError("All subsequent inputs must be arrays");return l.concat(...u)}function Urt(l,u){const i=fp(l),n=md(u);return[i.slice(0,n),i.slice(n)]}function jrt(l){return fp(l).slice().reverse()}function Krt(l){return fp(l).slice(0,-1)}function qrt(l){return fp(l).slice(1)}function Zrt(l,u,i){const n=Js(l),s=md(u);if(s<0||s>n.length)throw new TypeError("Index out of bounds");return[...n.slice(0,s),i,...n.slice(s)]}function Hrt(l,u,i){const n=fp(l),s=md(u);if(s<0||s>=n.length)throw new TypeError("Index out of bounds");const c=[...n];return c[s]=i,c}function Wrt(l,u,i){const n=fp(l),s=n.indexOf(u);if(s===-1)return n;const c=[...n];return c[s]=i,c}function zrt(l,u,i){const n=fp(l),s=n.lastIndexOf(u);if(s===-1)return n;const c=[...n];return c[s]=i,c}function Yrt(l,u,i){return fp(l).map(s=>s===u?i:s)}function Jrt(l,u){const i=fp(l),n=md(u);if(n<0||n>=i.length)throw new TypeError("Index out of bounds");return i[n]}function Qrt(l){return fp(l)[0]}function Xrt(l){const u=fp(l);return u[u.length-1]}function eat(l,u,...i){return[...Js(l),u,...i]}function tat(l,u){const i=Js(l);return[u,...i]}function iat(l){return Js(l).length}function nat(l,u){const i=Js(l),n=md(u);if(n<0||n>=i.length)throw new TypeError("Index out of bounds");return i.slice(0,n).concat(i.slice(n+1))}function rat(l,u){const i=Js(l),n=Math.max(0,md(u)??0);return i.slice(0,n)}function aat(l,u){const i=Js(l),n=Math.max(0,md(u)??0);return n===0?[]:i.slice(-n)}function sat(l,u,i){const n=Js(l),s=u==null?void 0:md(u),c=i==null?void 0:md(i);return n.slice(s,c)}function lat(l,u){return Js(l).indexOf(u)}function oat(l,u){return Js(l).lastIndexOf(u)}function dat(l){const u=Js(l),i=[],n=new Set;for(const s of u)n.has(s)||(n.add(s),i.push(s));return i}function uat(l){return Js(l).reduce((i,n)=>i.concat(n),[])}function pat(l){const u=Js(l);if(u.length<=1)return[...u];const i=u[0],n=typeof i=="number"&&u.every(e=>typeof e=="number"&&Number.isFinite(e)),s=typeof i=="string"&&u.every(e=>typeof e=="string");let c=null;if(n?c="number":s&&(c=u.every(f=>XXi.test(f)&&U(f).isValid())?"date":"string"),!c)throw new TypeError("All items must be of the same supported type: number, string, or ISO date string.");return c==="number"?[...u].sort((e,f)=>e-f):c==="string"?[...u].sort((e,f)=>e.localeCompare(f)):[...u].sort((e,f)=>U(e).valueOf()-U(f).valueOf())}function cat(l){const i=[...Js(l)];for(let n=i.length-1;n>0;n--){const s=Math.floor(Zw()*(n+1));[i[n],i[s]]=[i[s],i[n]]}return i}function fat(l,u){const i=Js(l),n=Math.max(1,md(u)||1),s=[];for(let c=0;c<i.length;c+=n)s.push(i.slice(c,c+n));return s}function yat(l,u,i){const n=Js(l),s=Math.max(0,md(u)||0);if(n.length>=s)return[...n];const c=s-n.length;return Array(c).fill(i).concat(n)}function hat(l,u,i){const n=Js(l),s=Math.max(0,md(u)||0);if(n.length>=s)return[...n];const c=s-n.length,e=Array(c).fill(i);return n.concat(e)}function mat(l,u){const i=Js(l),n=Math.max(0,md(u)||0),s=[];for(let c=0;c<n;c++)s.push(...i);return s}function Tat(l,u){if(!nB(u))throw new TypeError("Contains expects the needle to be a primitive (string | number | boolean | null).");return rB(l).some(n=>n===u)}function vat(l,u){const i=rB(l),n=Array.isArray(u)?u:[u];if(n.length===0)return!1;if(!n.every(nB))throw new TypeError("ContainsAll expects all needles to be primitives (string | number | boolean | null).");return n.every(s=>i.includes(s))}function gat(l,u){const i=rB(l),n=Array.isArray(u)?u:[u];if(n.length===0)return!1;if(!n.every(nB))throw new TypeError("ContainsAny expects all needles to be primitives (string | number | boolean | null).");return n.some(s=>i.includes(s))}class Eat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Join);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Join].inputs.firstList.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Join].inputs.separator.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Join].inputs.secondList.id}).map(D=>{var N,$;return((N=D.value)==null?void 0:N.valueAsType)??(($=D.value)==null?void 0:$.value)}),I=Srt([m,g,...R]);return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class bat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Split);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[ve.Split].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[ve.Split].inputs.index.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),[b,R]=Urt(m,g);return{value:j.Success,error:null,result:[b,R]}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Iat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Reverse);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Reverse].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Aat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS,version:"1.0.0",description:"List delete last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.DeleteLastNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.DeleteLastNItems].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Krt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Rat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS,version:"1.0.0",description:"List delete first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.DeleteFirstNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.DeleteFirstNItems].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=qrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Dat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.AddAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.AddAtIndex].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.AddAtIndex].inputs.index.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.AddAtIndex].inputs.value.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Zrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Cat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAtIndex].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAtIndex].inputs.index.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAtIndex].inputs.value.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Hrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class wat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS,version:"1.0.0",description:"List replace first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceFirstNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceFirstNItems].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceFirstNItems].inputs.searchValue.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceFirstNItems].inputs.replaceValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Wrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Oat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS,version:"1.0.0",description:"List replace last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceLastNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceLastNItems].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceLastNItems].inputs.searchValue.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceLastNItems].inputs.replaceValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=zrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Pat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL,version:"1.0.0",description:"List replace all operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceAll);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAll].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAll].inputs.searchValue.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAll].inputs.replaceValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Yrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class xat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.GetIndexItem);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexItem].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexItem].inputs.index.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Jrt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Vat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.GetFirst);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.GetFirst].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Qrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class _at extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.GetLast);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.GetLast].inputs.list.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Xrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Nat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Append);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Append].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Append].inputs.elementToAppend.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Append].inputs.dynamicArgument.id}).map(D=>{var N,$;return((N=D.value)==null?void 0:N.valueAsType)??(($=D.value)==null?void 0:$.value)}),I=eat(m,g,...R);return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class $at extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Prepend);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Prepend].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Prepend].inputs.value.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=tat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Lat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH,version:"1.0.0",description:"List get length",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetLength);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[ve.GetLength].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:j.Success,error:null,result:iat(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Gat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX,version:"1.0.0",description:"List delete one item at index (non-mutating)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.DeleteAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.DeleteAtIndex].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.DeleteAtIndex].inputs.index.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=nat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Bat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS,version:"1.0.0",description:"List get first N items",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetFirstNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetFirstNItems].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetFirstNItems].inputs.count.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=rat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Mat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS,version:"1.0.0",description:"List get last N items",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetLastNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastNItems].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastNItems].inputs.count.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=aat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Fat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE,version:"1.0.0",description:"List slice(start, end)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Slice);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.Slice].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.Slice].inputs.startIndex.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.Slice].inputs.endIndex.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=sat(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Sat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT,version:"1.0.0",description:"List concat(base, ...others)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Concat);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),[c,...e]=s,f=krt(c,...e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class kat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF,version:"1.0.0",description:"List listGetIndexOf(value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexOf].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexOf].inputs.searchValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=lat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Uat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF,version:"1.0.0",description:"List listGetLastIndexOf(value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetLastIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastIndexOf].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastIndexOf].inputs.searchValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=oat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class jat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE,version:"1.0.0",description:"List unique (stable, by reference/===)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Unique);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Unique].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=dat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Kat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN,version:"1.0.0",description:"List flatten one level",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Flatten);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Flatten].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=uat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class qat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT,version:"1.0.0",description:"List sort (non-mutating). Supports lists of strings (alphabetic), numbers (numeric), or ISO date strings (chronological).",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Sort);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Sort].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=pat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Zat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE,version:"1.0.0",description:"List shuffle (Fisher–Yates, secure RNG helper)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Shuffle);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Shuffle].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=cat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Hat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK,version:"1.0.0",description:"List chunk(size) -> list of lists",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Chunk);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Chunk].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Chunk].inputs.size.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=fat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Wat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START,version:"1.0.0",description:"List padStart(targetLength, padValue)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.PadStart);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadStart].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadStart].inputs.targetLength.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadStart].inputs.padValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=yat(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class zat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END,version:"1.0.0",description:"List padEnd(targetLength, padValue)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.PadEnd);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadEnd].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadEnd].inputs.targetLength.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadEnd].inputs.padValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=hat(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Yat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT,version:"1.0.0",description:"List repeat(count)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Repeat);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Repeat].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Repeat].inputs.count.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=mat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Jat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS,version:"1.0.0",description:"List contains (primitive needles)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Contains);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Contains].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Contains].inputs.needle.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Tat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Qat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL,version:"1.0.0",description:"List contains all (primitive needles)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.ContainsAll);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAll].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAll].inputs.needle.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=vat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Xat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY,version:"1.0.0",description:"List contains any (primitive needles)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.ContainsAny);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAny].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAny].inputs.needle.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=gat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class een extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH,version:"1.0.0",description:"Returns the number of characters in a string",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.GetLength);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.length;return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class est extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Join);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e;try{const f=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.separator.id}),h=((s=f==null?void 0:f.value)==null?void 0:s.value)||"",m=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.first.id}),T=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",g=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.second.id}),b=((e=g==null?void 0:g.value)==null?void 0:e.value)||"",I=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.dynamicString.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)||((x=N.value)==null?void 0:x.value)||""}),D=[T,b,...I].join(h);return{value:j.Success,error:null,result:D}}catch(f){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:f,result:null}}}})}}class tst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX,version:"1.0.0",description:"String split at index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1],f={firstPart:c.slice(0,e),secondPart:c.slice(e)};return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ist extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS,version:"1.0.0",description:"String split at all the occurrences of separators operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtAllSeparators);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1],f=c.split(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class nst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR,version:"1.0.0",description:"String split at the first occurrence of a separator operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtFirstSeparator);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=c.indexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class rst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR,version:"1.0.0",description:"String split at the last occurrence of a separator operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtLastSeparator);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=c.lastIndexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ast extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS,version:"1.0.0",description:"String delete last number of characters operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.DeleteLastNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,-e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class sst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS,version:"1.0.0",description:"String delete first number of characters operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.DeleteFirstNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class lst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Reverse);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const e=c.split("").reverse().join("");return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ost extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ToLowerCase);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const e=c.toLowerCase();return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class dst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ToUpperCase);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const e=c.toUpperCase();return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ust extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.DeleteAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)||((b=T.value)==null?void 0:b.value)}),c=s[0],e=s[1],f=s[2]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=Math.min(f,c.length-e),m=c.slice(0,e)+c.slice(e+h);return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class pst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.AddAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,e)+f+c.slice(e);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class cst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS,version:"1.0.0",description:"String replace first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceFirstNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1]??1,f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=f+c.slice(e);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class fst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS,version:"1.0.0",description:"String replace last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceLastNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1]??1,f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,-e)+f;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class yst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)||((b=T.value)==null?void 0:b.value)}),c=s[0],e=s[1],f=s[2]??1,h=s[3];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const m=(c.slice(0,e)||"")+h+(c.slice(e+f)||"");return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class hst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceFirstMatch);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.replace(e,f);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class mst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceLastMatch);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)||((b=T.value)==null?void 0:b.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.lastIndexOf(e),m=h===-1?c:c.substring(0,h)+f+c.substring(h+e.length);return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Tst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceAllMatches);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.split(e).join(f);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class vst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetIndexItem);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.charAt(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class gst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS,version:"1.0.0",description:"String get last N chars operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetLastNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(-e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Est extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS,version:"1.0.0",description:"String get first N chars operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetFirstNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class bst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};if(typeof e!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No search value provided",result:null};const f=c.indexOf(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ist extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Append);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[le.Append].inputs.stringValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[le.Append].inputs.valueToAppend.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[le.Append].inputs.dynamicArgument.id}).map(D=>{var N,$;return((N=D.value)==null?void 0:N.valueAsType)??(($=D.value)==null?void 0:$.value)});if(typeof m!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};if(typeof g!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No value to append provided",result:null};if(!R.every(D=>typeof D=="string"))return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"All values to append must be strings",result:null};const I=[m,g,...R].join("");return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Ast extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Prepend);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=e+c;return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Rst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM,version:"1.0.0",description:"String trim implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Trim);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.trim();return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Dst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START,version:"1.0.0",description:"String trimStart implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.TrimStart);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.trimStart();return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Cst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END,version:"1.0.0",description:"String trimEnd implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.TrimEnd);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.trimEnd();return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class wst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING,version:"1.0.0",description:"String substring(start, end?) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Substring);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.substring(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ost extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE,version:"1.0.0",description:"String slice(start, end?) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Slice);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.slice(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Pst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF,version:"1.0.0",description:"String lastIndexOf(search, fromIndex?) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.GetLastIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.lastIndexOf(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class xst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START,version:"1.0.0",description:"String padStart(targetLength, padString?) implementation",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.PadStart);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.padStart(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Vst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END,version:"1.0.0",description:"String padEnd(targetLength, padString?) implementation",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.PadEnd);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.padEnd(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class _st extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT,version:"1.0.0",description:"String repeat(count) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Repeat);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=s.repeat(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Nst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX,version:"1.0.0",description:"String match(regex) -> first match array or null",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.MatchRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),f=new RegExp(String(c??""),e?String(e):void 0),h=String(s??"").match(f);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class $st extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX,version:"1.0.0",description:"String matchAll(regex) -> array of matches",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.MatchAllRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(g=>{var b,R;return((b=g.value)==null?void 0:b.valueAsType)??((R=g.value)==null?void 0:R.value)}),f=e?String(e):"",h=f.includes("g")?f:f+"g",m=new RegExp(String(c??""),h),T=Array.from(String(s??"").matchAll(m),g=>Array.from(g));return{value:j.Success,error:null,result:T}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Lst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX,version:"1.0.0",description:"String search(regex) -> index or -1",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.SearchRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)});let f=-1;try{const h=new RegExp(String(c??""),e?String(e):void 0);f=String(s??"").search(h)}catch{f=-1}return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Gst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX,version:"1.0.0",description:"String replace using RegExp (pattern, replacement, flags?)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.ReplaceRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e,f]=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)??((b=T.value)==null?void 0:b.value)});let h=String(s??"");const m=new RegExp(String(c??""),f?String(f):void 0);return h=h.replace(m,String(e??"")),{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Bst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE,version:"1.0.0",description:"String normalize(form?) implementation module (NFC by default)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.NormalizeUnicode);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=s.normalize(c||"NFC");return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}const gD=class gD extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS,version:"1.0.0",description:"Remove diacritics via NFD decomposition + strip combining marks",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.RemoveDiacritics);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(s??"").normalize("NFD").replace(gD.COMBINING_MARKS,"");return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}};C(gD,"COMBINING_MARKS",/[\u0300-\u036f]/g);let z1=gD;class Mst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES,version:"1.0.0",description:"Count literal substring occurrences in a string",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.CountOccurrences);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=f===""?0:e.split(f).length-1;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Fst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX,version:"1.0.0",description:"Ensure string starts with given prefix (add if missing)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.EnsurePrefix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.startsWith(f)?e:f+e;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Sst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX,version:"1.0.0",description:"Ensure string ends with given suffix (add if missing)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.EnsureSuffix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.endsWith(f)?e:e+f;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class kst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX,version:"1.0.0",description:"Remove prefix if present",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.RemovePrefix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.startsWith(f)?e.slice(f.length):e;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ust extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX,version:"1.0.0",description:"Remove suffix if present",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.RemoveSuffix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.endsWith(f)?e.slice(0,-f.length):e;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class jst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH,version:"1.0.0",description:"String startsWith(needle) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.StartsWith);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("StartsWith expects two strings.");const e=s.startsWith(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Kst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH,version:"1.0.0",description:"String endsWith(needle) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.EndsWith);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("EndsWith expects two strings.");const e=s.endsWith(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class qst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS,version:"1.0.0",description:"String includes(needle) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Contains);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("Contains expects two strings.");const e=s.includes(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Zst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX,version:"1.0.0",description:"Regex test: new RegExp(pattern, flags?).test(src) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.MatchesRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("MatchesRegex expects source and pattern to be strings.");if(!(e===void 0||typeof e=="string"))throw new TypeError("MatchesRegex flags must be a string if provided.");let f=!1;return f=new RegExp(c,e).test(s),{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}function Hst(l,u){const i=Number(l),s=10**Math.max(0,Number(u)||0);return Math.round(i*s)/s}function Wst(l,u){const i=Number(l),n=Math.abs(Number(u)||0);return n===0?i:Math.round(i/n)*n}function zst(l,u,i){const n=Number(l),s=Number(u),c=Number(i);return Math.min(Math.max(n,s),c)}function Yst(l,u,i,n,s){const c=Number(l),e=Number(u),f=Number(i),h=Number(n),m=Number(s);if(e===f)throw new Error("Input range cannot be zero");const T=(c-e)/(f-e);return h+T*(m-h)}function Jst(...l){const u=l.map(n=>Number(n));return u.length===0?0:u.reduce((n,s)=>n+s,0)/u.length}function Qst(...l){const u=l.map(n=>Number(n)).sort((n,s)=>n-s);if(u.length===0)return 0;const i=Math.floor(u.length/2);return u.length%2?u[i]:(u[i-1]+u[i])/2}function Xst(l,u){const i=Number(l),n=Number(u);return n===0?NaN:i<0&&n%2===1?-Math.pow(-i,1/n):Math.pow(i,1/n)}function elt(l,u){const i=Number(l),n=Number(u);return i===0?1/0:(n-i)/i*100}const mr=l=>l.map(u=>{var i,n;return((i=u.value)==null?void 0:i.valueAsType)??((n=u.value)==null?void 0:n.value)});class tlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Addition);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=mr(n).reduce((e,f)=>e+f,0);return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ilt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Subtraction);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=mr(n).reduce((e,f)=>e-f,0);return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class nlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Multiplication);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Multiplication].inputs.firstFactor.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Multiplication].inputs.secondFactor.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Multiplication].inputs.dynamicFactor.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),D=[m,g,...R].reduce((N,$)=>N*$,1);return{value:j.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class rlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Division);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const[s,c]=mr(n);if(c===0)throw new Error("Division by zero is not allowed");const e=s/c;return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class alt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Remainder);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const[s,c]=mr(n);if(c===0)throw new Error("Division by zero is not allowed");const e=s%c;return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class slt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Exponentiation);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const[s,c]=mr(n),e=Math.pow(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class llt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE,version:"1.0.0",description:"Number negate (unary -x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Negate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:-s}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class olt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE,version:"1.0.0",description:"Number absolute (|x|)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Absolute);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.abs(Number(s))}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class dlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN,version:"1.0.0",description:"Number sign (-1 | 0 | 1)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Sign);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.sign(Number(s))}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ult extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND,version:"1.0.0",description:"Number round to nearest integer",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Round);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.round(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class plt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR,version:"1.0.0",description:"Number floor (⌊x⌋)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Floor);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.floor(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class clt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL,version:"1.0.0",description:"Number ceil (⌈x⌉)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Ceil);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.ceil(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class flt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC,version:"1.0.0",description:"Number truncation (drop fractional part)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Trunc);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.trunc(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class ylt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS,version:"1.0.0",description:"Round to N decimals",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.RoundToDecimals);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Hst(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class hlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP,version:"1.0.0",description:"Snap a number to the nearest multiple of step (>=0 step)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.SnapToStep);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Wst(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class mlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP,version:"1.0.0",description:"Clamp value to [min, max]",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Clamp);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=mr(n),f=zst(s,c,e);return{value:j.Success,error:null,result:f}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Tlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE,version:"1.0.0",description:"Map value from [inMin,inMax] to [outMin,outMax]",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MapRange);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e,f,h]=mr(n),m=Yst(s,c,e,f,h);return{value:j.Success,error:null,result:m}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class vlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE,version:"1.0.0",description:"Average(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Average);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Average].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Average].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Average].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R],D=Jst(...I);return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class glt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN,version:"1.0.0",description:"Median(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Median);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Median].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Median].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Median].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R],D=Qst(...I);return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class Elt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF,version:"1.0.0",description:"Min(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MinOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MinOf].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MinOf].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MinOf].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R].filter(N=>typeof N=="number"&&!Number.isNaN(N)),D=I.length?Math.min(...I):1/0;return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class blt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF,version:"1.0.0",description:"Max(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MaxOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MaxOf].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MaxOf].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MaxOf].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R].filter(N=>typeof N=="number"&&!Number.isNaN(N)),D=I.length?Math.max(...I):-1/0;return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class Ilt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT,version:"1.0.0",description:"Square root",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.SquareRoot);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.sqrt(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Alt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT,version:"1.0.0",description:"Cube root",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.CubeRoot);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.cbrt(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Rlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT,version:"1.0.0",description:"Nth root (value, n)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.NthRoot);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Xst(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Dlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP,version:"1.0.0",description:"e^x",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Exp);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.exp(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Clt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL,version:"1.0.0",description:"Natural log ln(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.LogNatural);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.log(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class wlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10,version:"1.0.0",description:"Log base 10",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Log10);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n),c=Number(s),e=Math.log10?Math.log10(c):Math.log(c)/Math.LN10;return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Olt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN,version:"1.0.0",description:"sin(x in radians)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Sin);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.sin(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Plt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS,version:"1.0.0",description:"cos(x in radians)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Cos);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.cos(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class xlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN,version:"1.0.0",description:"tan(x in radians)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Tan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.tan(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Vlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN,version:"1.0.0",description:"asin(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Asin);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.asin(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class _lt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS,version:"1.0.0",description:"acos(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Acos);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.acos(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Nlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN,version:"1.0.0",description:"atan(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Atan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.atan(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class $lt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2,version:"1.0.0",description:"atan2(y, x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Atan2);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:Math.atan2(Number(s),Number(c))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Llt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS,version:"1.0.0",description:"deg → rad",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.ToRadians);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Number(s)*Math.PI/180}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Glt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES,version:"1.0.0",description:"rad → deg",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.ToDegrees);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Number(s)*180/Math.PI}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Blt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF,version:"1.0.0",description:"x percent of y",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.PercentOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Number(s)/100*Number(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class yN extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE,version:"1.0.0",description:"((new-old)/old)*100",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.PercentageChange);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=elt(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Mlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN,version:"1.0.0",description:"a < b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.LessThan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s<c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Flt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN,version:"1.0.0",description:"a > b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MoreThan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s>c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Slt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL,version:"1.0.0",description:"a <= b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.LessThanOrEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s<=c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class klt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL,version:"1.0.0",description:"a >= b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MoreThanOrEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s>=c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}function Ult(l,u){return function(){return l.apply(u,arguments)}}const{toString:ten}=Object.prototype,{getPrototypeOf:aB}=Object,{iterator:Qw,toStringTag:jlt}=Symbol,Xw=(l=>u=>{const i=ten.call(u);return l[i]||(l[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),yp=l=>(l=l.toLowerCase(),u=>Xw(u)===l),eO=l=>u=>typeof u===l,{isArray:Nv}=Array,mT=eO("undefined");function SI(l){return l!==null&&!mT(l)&&l.constructor!==null&&!mT(l.constructor)&&So(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const Klt=yp("ArrayBuffer");function ien(l){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(l):u=l&&l.buffer&&Klt(l.buffer),u}const nen=eO("string"),So=eO("function"),qlt=eO("number"),kI=l=>l!==null&&typeof l=="object",ren=l=>l===!0||l===!1,D1=l=>{if(Xw(l)!=="object")return!1;const u=aB(l);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(jlt in l)&&!(Qw in l)},aen=l=>{if(!kI(l)||SI(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},sen=yp("Date"),len=yp("File"),oen=l=>!!(l&&typeof l.uri<"u"),den=l=>l&&typeof l.getParts<"u",uen=yp("Blob"),pen=yp("FileList"),cen=l=>kI(l)&&So(l.pipe);function fen(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const OK=fen(),PK=typeof OK.FormData<"u"?OK.FormData:void 0,yen=l=>{let u;return l&&(PK&&l instanceof PK||So(l.append)&&((u=Xw(l))==="formdata"||u==="object"&&So(l.toString)&&l.toString()==="[object FormData]"))},hen=yp("URLSearchParams"),[men,Ten,ven,gen]=["ReadableStream","Request","Response","Headers"].map(yp),Een=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function UI(l,u,{allOwnKeys:i=!1}={}){if(l===null||typeof l>"u")return;let n,s;if(typeof l!="object"&&(l=[l]),Nv(l))for(n=0,s=l.length;n<s;n++)u.call(null,l[n],n,l);else{if(SI(l))return;const c=i?Object.getOwnPropertyNames(l):Object.keys(l),e=c.length;let f;for(n=0;n<e;n++)f=c[n],u.call(null,l[f],f,l)}}function Zlt(l,u){if(SI(l))return null;u=u.toLowerCase();const i=Object.keys(l);let n=i.length,s;for(;n-- >0;)if(s=i[n],u===s.toLowerCase())return s;return null}const a0=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Hlt=l=>!mT(l)&&l!==a0;function hN(){const{caseless:l,skipUndefined:u}=Hlt(this)&&this||{},i={},n=(s,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const e=l&&Zlt(i,c)||c;D1(i[e])&&D1(s)?i[e]=hN(i[e],s):D1(s)?i[e]=hN({},s):Nv(s)?i[e]=s.slice():(!u||!mT(s))&&(i[e]=s)};for(let s=0,c=arguments.length;s<c;s++)arguments[s]&&UI(arguments[s],n);return i}const ben=(l,u,i,{allOwnKeys:n}={})=>(UI(u,(s,c)=>{i&&So(s)?Object.defineProperty(l,c,{value:Ult(s,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(l,c,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),l),Ien=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),Aen=(l,u,i,n)=>{l.prototype=Object.create(u.prototype,n),Object.defineProperty(l.prototype,"constructor",{value:l,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(l,"super",{value:u.prototype}),i&&Object.assign(l.prototype,i)},Ren=(l,u,i,n)=>{let s,c,e;const f={};if(u=u||{},l==null)return u;do{for(s=Object.getOwnPropertyNames(l),c=s.length;c-- >0;)e=s[c],(!n||n(e,l,u))&&!f[e]&&(u[e]=l[e],f[e]=!0);l=i!==!1&&aB(l)}while(l&&(!i||i(l,u))&&l!==Object.prototype);return u},Den=(l,u,i)=>{l=String(l),(i===void 0||i>l.length)&&(i=l.length),i-=u.length;const n=l.indexOf(u,i);return n!==-1&&n===i},Cen=l=>{if(!l)return null;if(Nv(l))return l;let u=l.length;if(!qlt(u))return null;const i=new Array(u);for(;u-- >0;)i[u]=l[u];return i},wen=(l=>u=>l&&u instanceof l)(typeof Uint8Array<"u"&&aB(Uint8Array)),Oen=(l,u)=>{const n=(l&&l[Qw]).call(l);let s;for(;(s=n.next())&&!s.done;){const c=s.value;u.call(l,c[0],c[1])}},Pen=(l,u)=>{let i;const n=[];for(;(i=l.exec(u))!==null;)n.push(i);return n},xen=yp("HTMLFormElement"),Ven=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,n,s){return n.toUpperCase()+s}),xK=(({hasOwnProperty:l})=>(u,i)=>l.call(u,i))(Object.prototype),_en=yp("RegExp"),Wlt=(l,u)=>{const i=Object.getOwnPropertyDescriptors(l),n={};UI(i,(s,c)=>{let e;(e=u(s,c,l))!==!1&&(n[c]=e||s)}),Object.defineProperties(l,n)},Nen=l=>{Wlt(l,(u,i)=>{if(So(l)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const n=l[i];if(So(n)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},$en=(l,u)=>{const i={},n=s=>{s.forEach(c=>{i[c]=!0})};return Nv(l)?n(l):n(String(l).split(u)),i},Len=()=>{},Gen=(l,u)=>l!=null&&Number.isFinite(l=+l)?l:u;function Ben(l){return!!(l&&So(l.append)&&l[jlt]==="FormData"&&l[Qw])}const Men=l=>{const u=new Array(10),i=(n,s)=>{if(kI(n)){if(u.indexOf(n)>=0)return;if(SI(n))return n;if(!("toJSON"in n)){u[s]=n;const c=Nv(n)?[]:{};return UI(n,(e,f)=>{const h=i(e,s+1);!mT(h)&&(c[f]=h)}),u[s]=void 0,c}}return n};return i(l,0)},Fen=yp("AsyncFunction"),Sen=l=>l&&(kI(l)||So(l))&&So(l.then)&&So(l.catch),zlt=((l,u)=>l?setImmediate:u?((i,n)=>(a0.addEventListener("message",({source:s,data:c})=>{s===a0&&c===i&&n.length&&n.shift()()},!1),s=>{n.push(s),a0.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",So(a0.postMessage)),ken=typeof queueMicrotask<"u"?queueMicrotask.bind(a0):typeof process<"u"&&process.nextTick||zlt,Uen=l=>l!=null&&So(l[Qw]),lt={isArray:Nv,isArrayBuffer:Klt,isBuffer:SI,isFormData:yen,isArrayBufferView:ien,isString:nen,isNumber:qlt,isBoolean:ren,isObject:kI,isPlainObject:D1,isEmptyObject:aen,isReadableStream:men,isRequest:Ten,isResponse:ven,isHeaders:gen,isUndefined:mT,isDate:sen,isFile:len,isReactNativeBlob:oen,isReactNative:den,isBlob:uen,isRegExp:_en,isFunction:So,isStream:cen,isURLSearchParams:hen,isTypedArray:wen,isFileList:pen,forEach:UI,merge:hN,extend:ben,trim:Een,stripBOM:Ien,inherits:Aen,toFlatObject:Ren,kindOf:Xw,kindOfTest:yp,endsWith:Den,toArray:Cen,forEachEntry:Oen,matchAll:Pen,isHTMLForm:xen,hasOwnProperty:xK,hasOwnProp:xK,reduceDescriptors:Wlt,freezeMethods:Nen,toObjectSet:$en,toCamelCase:Ven,noop:Len,toFiniteNumber:Gen,findKey:Zlt,global:a0,isContextDefined:Hlt,isSpecCompliantForm:Ben,toJSONObject:Men,isAsyncFn:Fen,isThenable:Sen,setImmediate:zlt,asap:ken,isIterable:Uen};class bo extends Error{static from(u,i,n,s,c,e){const f=new bo(u.message,i||u.code,n,s,c);return f.cause=u,f.name=u.name,u.status!=null&&f.status==null&&(f.status=u.status),e&&Object.assign(f,e),f}constructor(u,i,n,s,c){super(u),Object.defineProperty(this,"message",{value:u,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),n&&(this.config=n),s&&(this.request=s),c&&(this.response=c,this.status=c.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:lt.toJSONObject(this.config),code:this.code,status:this.status}}}bo.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";bo.ERR_BAD_OPTION="ERR_BAD_OPTION";bo.ECONNABORTED="ECONNABORTED";bo.ETIMEDOUT="ETIMEDOUT";bo.ERR_NETWORK="ERR_NETWORK";bo.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";bo.ERR_DEPRECATED="ERR_DEPRECATED";bo.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";bo.ERR_BAD_REQUEST="ERR_BAD_REQUEST";bo.ERR_CANCELED="ERR_CANCELED";bo.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";bo.ERR_INVALID_URL="ERR_INVALID_URL";const br=bo,jen=null;function mN(l){return lt.isPlainObject(l)||lt.isArray(l)}function Ylt(l){return lt.endsWith(l,"[]")?l.slice(0,-2):l}function A_(l,u,i){return l?l.concat(u).map(function(s,c){return s=Ylt(s),!i&&c?"["+s+"]":s}).join(i?".":""):u}function Ken(l){return lt.isArray(l)&&!l.some(mN)}const qen=lt.toFlatObject(lt,{},null,function(u){return/^is[A-Z]/.test(u)});function tO(l,u,i){if(!lt.isObject(l))throw new TypeError("target must be an object");u=u||new FormData,i=lt.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(D,N){return!lt.isUndefined(N[D])});const n=i.metaTokens,s=i.visitor||T,c=i.dots,e=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&<.isSpecCompliantForm(u);if(!lt.isFunction(s))throw new TypeError("visitor must be a function");function m(I){if(I===null)return"";if(lt.isDate(I))return I.toISOString();if(lt.isBoolean(I))return I.toString();if(!h&<.isBlob(I))throw new br("Blob is not supported. Use a Buffer instead.");return lt.isArrayBuffer(I)||lt.isTypedArray(I)?h&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function T(I,D,N){let $=I;if(lt.isReactNative(u)&<.isReactNativeBlob(I))return u.append(A_(N,D,c),m(I)),!1;if(I&&!N&&typeof I=="object"){if(lt.endsWith(D,"{}"))D=n?D:D.slice(0,-2),I=JSON.stringify(I);else if(lt.isArray(I)&&Ken(I)||(lt.isFileList(I)||lt.endsWith(D,"[]"))&&($=lt.toArray(I)))return D=Ylt(D),$.forEach(function(L,K){!(lt.isUndefined(L)||L===null)&&u.append(e===!0?A_([D],K,c):e===null?D:D+"[]",m(L))}),!1}return mN(I)?!0:(u.append(A_(N,D,c),m(I)),!1)}const g=[],b=Object.assign(qen,{defaultVisitor:T,convertValue:m,isVisitable:mN});function R(I,D){if(!lt.isUndefined(I)){if(g.indexOf(I)!==-1)throw Error("Circular reference detected in "+D.join("."));g.push(I),lt.forEach(I,function($,x){(!(lt.isUndefined($)||$===null)&&s.call(u,$,lt.isString(x)?x.trim():x,D,b))===!0&&R($,D?D.concat(x):[x])}),g.pop()}}if(!lt.isObject(l))throw new TypeError("data must be an object");return R(l),u}function VK(l){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(n){return u[n]})}function sB(l,u){this._pairs=[],l&&tO(l,this,u)}const Jlt=sB.prototype;Jlt.append=function(u,i){this._pairs.push([u,i])};Jlt.toString=function(u){const i=u?function(n){return u.call(this,n,VK)}:VK;return this._pairs.map(function(s){return i(s[0])+"="+i(s[1])},"").join("&")};function Zen(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Qlt(l,u,i){if(!u)return l;const n=i&&i.encode||Zen,s=lt.isFunction(i)?{serialize:i}:i,c=s&&s.serialize;let e;if(c?e=c(u,s):e=lt.isURLSearchParams(u)?u.toString():new sB(u,s).toString(n),e){const f=l.indexOf("#");f!==-1&&(l=l.slice(0,f)),l+=(l.indexOf("?")===-1?"?":"&")+e}return l}class Hen{constructor(){this.handlers=[]}use(u,i,n){return this.handlers.push({fulfilled:u,rejected:i,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){lt.forEach(this.handlers,function(n){n!==null&&u(n)})}}const _K=Hen,lB={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Wen=typeof URLSearchParams<"u"?URLSearchParams:sB,zen=typeof FormData<"u"?FormData:null,Yen=typeof Blob<"u"?Blob:null,Jen={isBrowser:!0,classes:{URLSearchParams:Wen,FormData:zen,Blob:Yen},protocols:["http","https","file","blob","url","data"]},oB=typeof window<"u"&&typeof document<"u",TN=typeof navigator=="object"&&navigator||void 0,Qen=oB&&(!TN||["ReactNative","NativeScript","NS"].indexOf(TN.product)<0),Xen=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),etn=oB&&window.location.href||"http://localhost",ttn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:oB,hasStandardBrowserEnv:Qen,hasStandardBrowserWebWorkerEnv:Xen,navigator:TN,origin:etn},Symbol.toStringTag,{value:"Module"})),Ll={...ttn,...Jen};function itn(l,u){return tO(l,new Ll.classes.URLSearchParams,{visitor:function(i,n,s,c){return Ll.isNode&<.isBuffer(i)?(this.append(n,i.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...u})}function ntn(l){return lt.matchAll(/\w+|\[(\w*)]/g,l).map(u=>u[0]==="[]"?"":u[1]||u[0])}function rtn(l){const u={},i=Object.keys(l);let n;const s=i.length;let c;for(n=0;n<s;n++)c=i[n],u[c]=l[c];return u}function Xlt(l){function u(i,n,s,c){let e=i[c++];if(e==="__proto__")return!0;const f=Number.isFinite(+e),h=c>=i.length;return e=!e&<.isArray(s)?s.length:e,h?(lt.hasOwnProp(s,e)?s[e]=[s[e],n]:s[e]=n,!f):((!s[e]||!lt.isObject(s[e]))&&(s[e]=[]),u(i,n,s[e],c)&<.isArray(s[e])&&(s[e]=rtn(s[e])),!f)}if(lt.isFormData(l)&<.isFunction(l.entries)){const i={};return lt.forEachEntry(l,(n,s)=>{u(ntn(n),s,i,0)}),i}return null}function atn(l,u,i){if(lt.isString(l))try{return(u||JSON.parse)(l),lt.trim(l)}catch(n){if(n.name!=="SyntaxError")throw n}return(i||JSON.stringify)(l)}const dB={transitional:lB,adapter:["xhr","http","fetch"],transformRequest:[function(u,i){const n=i.getContentType()||"",s=n.indexOf("application/json")>-1,c=lt.isObject(u);if(c&<.isHTMLForm(u)&&(u=new FormData(u)),lt.isFormData(u))return s?JSON.stringify(Xlt(u)):u;if(lt.isArrayBuffer(u)||lt.isBuffer(u)||lt.isStream(u)||lt.isFile(u)||lt.isBlob(u)||lt.isReadableStream(u))return u;if(lt.isArrayBufferView(u))return u.buffer;if(lt.isURLSearchParams(u))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),u.toString();let f;if(c){if(n.indexOf("application/x-www-form-urlencoded")>-1)return itn(u,this.formSerializer).toString();if((f=lt.isFileList(u))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return tO(f?{"files[]":u}:u,h&&new h,this.formSerializer)}}return c||s?(i.setContentType("application/json",!1),atn(u)):u}],transformResponse:[function(u){const i=this.transitional||dB.transitional,n=i&&i.forcedJSONParsing,s=this.responseType==="json";if(lt.isResponse(u)||lt.isReadableStream(u))return u;if(u&<.isString(u)&&(n&&!this.responseType||s)){const e=!(i&&i.silentJSONParsing)&&s;try{return JSON.parse(u,this.parseReviver)}catch(f){if(e)throw f.name==="SyntaxError"?br.from(f,br.ERR_BAD_RESPONSE,this,null,this.response):f}}return u}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ll.classes.FormData,Blob:Ll.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};lt.forEach(["delete","get","head","post","put","patch"],l=>{dB.headers[l]={}});const uB=dB,stn=lt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ltn=l=>{const u={};let i,n,s;return l&&l.split(`
|
|
49
|
+
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.`})),{errors:n,explanations:s,modifiedData:i}}subscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]||(this.detachedDependents[n.entity.id]=n)}),this}unsubscribeDependents(i){return i.forEach(n=>{this.detachedDependents[n.entity.id]&&delete this.detachedDependents[n.entity.id]}),this}syncDependents(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"sync-dependents"))){const n=[],s=[],c=[],e=[];return Object.values(this.detachedDependents).forEach(f=>{const h=f.entity.afterAllChildrenInitialized(i);n.push(...h.updated),s.push(...h.added),c.push(...h.removed),e.push(...h.affected)}),i==null||i.attemptAutoclose("sync-dependents",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}onDetachedDependencyRemoved(i,n,s){const c=[],e=[],f=[],h=[];return n==="value-as-type-single"&&(this.valueAsTypeSingle=null,s==null||s.add(this,se.Updated)),n==="value-as-type-list"&&(this.valueAsTypeList=(this.valueAsTypeList||[]).filter(m=>m.id!==i.id),s==null||s.add(this,se.Updated)),{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}onDetachedDependencyRestored(i,n,s){const c=[],e=[],f=[],h=[];return n==="value-as-type-single"&&(this.valueAsTypeSingle=i,s==null||s.add(this,se.Updated)),n==="value-as-type-list"&&(this.valueAsTypeList=[...Array.isArray(this.valueAsTypeList||[])?this.valueAsTypeList:[],i],s==null||s.add(this,se.Updated)),{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:this}}unsubscribeFromDependencies(){return this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==r.BuiltInBaseEntity&&this.valueAsTypeSingle.unsubscribeDependents([{entity:this,field:"value-as-type-single"}]),this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&this.valueAsTypeList.forEach(i=>{i.type!==r.BuiltInBaseEntity&&i.unsubscribeDependents([{entity:this,field:"value-as-type-list"}])}),this}subscribeToDependencies(){return!this.valueAsTypeSingle&&!this.valueAsTypeList?this:(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.forEach(i=>{i.type!==r.BuiltInBaseEntity&&i.subscribeDependents([{entity:this,field:"value-as-type-list"}])}):this.valueAsTypeSingle&&this.valueAsTypeSingle.type!==r.BuiltInBaseEntity&&this.valueAsTypeSingle.subscribeDependents([{entity:this,field:"value-as-type-single"}]),this)}increaseVersion(i){var n;if(this.project.diggestedBuiltInBaseEntitiesIds.has(this.id))return this;if(i&&!U(i).isValid())throw new Error(`The shared timestamp '${i}' is not a valid ISO 8601 date string.`);if(i&&U(i).isSame(U(this.createdAt)))return this;if(!((n=this.knownVersions)!=null&&n.has(this.version))&&this.project.initialized)throw new Error(`The current ${this.type} ${this.id} version '${this.version}' is not captured in the 'knownVersions' map. Capture the current version before increasing it to avoid losing data.`);if(!this.activeVersion)throw new Error(`Only active versions can be increased. Entity with id '${this.id}' and version '${this.version}' is not active.`);return this.previousVersion=this.version,this.version=M.UUID.uuid(),this.createdAt=U(i).toISOString()||U().toISOString(),this}captureVersion(){var n;const i=((n=this.knownVersions)==null?void 0:n.get(this.version))||new Tn(this,this.project);if(!this.activeVersion)throw new Error(`Only active versions can be captured. Entity of type ${this.type} with id '${this.id}' and version '${this.version}' is not active.`);if(this.version!==i.version)throw new Error(`Captured ${this.type} with id '${this.id}', version '${i.version}' does not match current entity version '${this.version}'.`);return this.knownVersions=this.knownVersions?this.knownVersions.set(this.version,i):new Map().set(this.version,i),this.apply(i),this}snapshot(){const i=new Tn(this,this.project);return this.apply(i)}apply(i){const n=this.toMeta();return i.metaSync(n,null),i.valueAsTypeSingle=this.valueAsTypeSingle,i.valueAsTypeList=this.valueAsTypeList?[...this.valueAsTypeList]:this.valueAsTypeList,i.parent=this.parent,i}recursiveCaptureUpstreamVersions(i){const n=[],s=[],c=[],e=[];if(this.parent){this.parent.increaseVersion(i);const f=this.parent.recursiveCaptureUpstreamVersions(i);n.push(this.parent,...f.updated),s.push(...f.added),c.push(...f.removed)}return{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}async restoreVersion(i,n){var m;const s=[],c=[],e=[],f=[];if(this.version===i&&(n!=null&&n.skipIfSameVersion))return{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this};if(!this.knownVersions){const T=new Map;for(const[g,b]of this.knownVersions||new Map){if(T.set(g,b),b.activeVersion=!1,b.knownVersions)for(const[R,I]of b.knownVersions)T.set(R,I);b.knownVersions=null}}let h=(m=this.knownVersions)==null?void 0:m.get(i);if(!h){const T=await this.APILoadVersion({},i);if(!T)throw new Error(`Version with id '${i}' for entity with id '${this.id}' not found.`);h=new Tn(T,this.project)}return this.metaSync(h.toShallowJSON(),null),this.previousVersion=h.previousVersion,this.version=h.version,this.createdAt=h.createdAt,this.author=h.author,this.deleted=h.deleted,this.valueAsTypeSingle=h.valueAsTypeSingle,this.parent=h.parent,{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this}}updateWithShallowTransfer(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithShallowTransfer))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithShallowTransfer] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this;if(this.metaSync(i,n),this.version=i.version,this.createdAt=i.createdAt,this.author=i.author,this.deleted=i.deleted,this.previousVersion=i.previousVersion,this.unsubscribeFromDependencies(),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const s=he(i.parent),c=this.project.get(s),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(n),c)this.setParent(c,n),this.addSelfToProject(n);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${s}' that isn't found in the project`)}else if(i.standaloneParent){const s=he(i.standaloneParent),c=this.project.get(s);if(c)this.setStandaloneParent(c,n);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${s}' that isn't found in the project`)}else throw new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(s=>{const c=he(s),e=this.project.get(c);e&&this.addValueAsTypeToList(e,n)}),[...this.valueAsTypeList].forEach(s=>{(i.valueAsTypeList||[]).find(e=>he(e)===s.id)||this.removeValueAsTypeFromList(s,n)}),this.setValueAsTypeSingle(null,n),this.metaSync({value:null},n);else if(i.valueAsTypeSingle){const s=he(i.valueAsTypeSingle),c=this.project.get(s);c&&(this.setValueAsTypeSingle(c,n),this.setValueAsTypeList(null,n),this.metaSync({value:null},n))}else this.setValueAsTypeSingle(null,n),this.setValueAsTypeList(null,n);return this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithShallowTransfer,this.id),this}updateWithGenerationTarget(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.UpdateWithGenerationTarget))){if(!this.checkCanEdit(this,n))return oe.Logger.warn(`[updateWithGenerationTarget] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this;if(this.metaSync(i,n),i.parent&&i.standaloneParent)throw new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.`);if(i.parent){const s=he(i.parent),c=this.project.get(s),e=this.parent;if(e&&e.id!==(c==null?void 0:c.id)&&this.removeFromParent(n),c)this.setParent(c,n),this.addSelfToProject(n);else throw new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${s}' that isn't found in the project`)}else if(i.standaloneParent){const s=he(i.standaloneParent),c=this.project.get(s);if(c)this.setStandaloneParent(c,n);else throw new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${s}' that isn't found in the project`)}if(i.valueAsTypeList&&Array.isArray(i.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],i.valueAsTypeList.forEach(s=>{const c=he(s),e=this.project.get(c);e&&this.addValueAsTypeToList(e,n)}),[...this.valueAsTypeList].forEach(s=>{(i.valueAsTypeList||[]).find(e=>he(e)===s.id)||this.removeValueAsTypeFromList(s,n)}),this.setValueAsTypeSingle(null,n),this.metaSync({value:null},n);else if(i.valueAsTypeSingle){const s=he(i.valueAsTypeSingle),c=this.project.get(s);c&&(this.setValueAsTypeSingle(c,n),this.setValueAsTypeList(null,n),this.metaSync({value:null},n))}return(i.valueAsTypeSingle===null||i.valueAsTypeList||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeSingle(null,n),(i.valueAsTypeList===null||i.valueAsTypeSingle||i.value!==null&&i.value!==void 0)&&this.setValueAsTypeList(null,n),this.captureVersion(),this.subscribeToDependencies(),n==null||n.attemptAutoclose(P.UpdateWithGenerationTarget,this.id),this}hydrateAncestors(){const i=[],n=[],s=[],c=[];if(this.initialData.parent&&this.initialData.standaloneParent){const e=he(this.initialData.parent),f=this.project.get(e),h=he(this.initialData.standaloneParent),m=this.project.get(h);let T="";throw f?T+=` Parent -> ${f.type}: '${f.id}' "${He(f,this.project)}".`:T+=" Parent -> not-found.",m?T+=` Standalone Parent -> ${m.type}: '${m.id}' "${He(m,this.project)}".`:T+=" Standalone Parent -> not-found.",new Error(`Entity with id '${this.id}' cannot have both 'parent' and 'standaloneParent' properties set.${T}`)}if(this.initialData.parent){const e=he(this.initialData.parent),f=this.project.get(e);if(oe.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating parent reference '${e}' for entity with id '${this.id}'`),f)oe.Logger.log(`[LiteralValueState.hydrateAncestors] Setting parent reference '${f.id}' for entity with id '${this.id}'`),this.setParent(f,null),i.push(f);else throw oe.Logger.error(`[LiteralValueState.hydrateAncestors] Parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'parent' reference '${e}' that isn't found in the project`)}else if(this.initialData.standaloneParent){const e=he(this.initialData.standaloneParent),f=this.project.get(e);if(oe.Logger.log(`[LiteralValueState.hydrateAncestors] Hydrating standalone parent reference '${e}' for entity with id '${this.id}'`),f)oe.Logger.log(`[LiteralValueState.hydrateAncestors] Setting standalone parent reference '${f.id}' for entity with id '${this.id}'`),this.setStandaloneParent(f,null);else throw oe.Logger.error(`[LiteralValueState.hydrateAncestors] Standalone parent reference '${e}' for entity with id '${this.id}' not found in the project`),new Error(`${this.type} with id '${this.id}' has a 'standaloneParent' reference '${e}' that isn't found in the project`)}else throw oe.Logger.error(`[LiteralValueState.hydrateAncestors] Entity with id '${this.id}' must have a 'parent'`),new Error(`${this.type} with id '${this.id}' must have a 'parent'`);if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.valueAsTypeList||[],this.initialData.valueAsTypeList.forEach(e=>{const f=he(e),h=this.project.get(f);h&&this.valueAsTypeList.push(h)});else if(this.initialData.valueAsTypeSingle){const e=he(this.initialData.valueAsTypeSingle),f=this.project.get(e);f&&(this.valueAsTypeSingle=f)}return{updated:V(i),added:V(n),removed:V(s),affected:V(c),self:this}}afterAllChildrenInitialized(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AfterAllChildrenInitialized))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[afterAllChildrenInitialized] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:[],added:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return this.initialized=!0,i==null||i.attemptAutoclose(P.AfterAllChildrenInitialized,this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}addSelfToProject(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"add-self-to-project"))){var f,h;const n=[this],s=[],c=[],e=[];return((f=this.parent)==null?void 0:f.type)===r.DataType?this.parent.setEntity(this,i):(h=this.parent)==null||h.setDefaultValue(this,i),e.push(this.parent),this.subscribe(),this.subscribeToDependencies(),i==null||i.attemptAutoclose("add-self-to-project",this.id),{updated:V(n),added:V(s),removed:V(c),affected:V(e),self:this}}setParent(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetParent))){var s;return this.checkCanEditWithCounterpartAndSideEffects(this,i,P.SetParent,n)?(((s=this.parent)==null?void 0:s.id)!==(i==null?void 0:i.id)&&(this.parent=i,this.standaloneParent&&(this.standaloneParent=null,this.standalone=!1),n&&(n==null||n.add(this,se.Updated))),n==null||n.attemptAutoclose(P.SetParent,this.id),this):this}setStandaloneParent(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetStandaloneParent))){var s;if(!this.checkCanEditWithCounterpartAndSideEffects(this,i,P.SetStandaloneParent,n))return this;if(this.project.get(this.id)&&this.parent)throw new Error("[LiteralValueState.setStandaloneParent] This literal-value belongs to the project AST and setting a standalone parent is not possible. Clone the instance, or create a separate one to be standalone.");return((s=this.standaloneParent)==null?void 0:s.id)!==(i==null?void 0:i.id)&&(this.parent&&(this.removeFromParent(n),this.parent=null),this.standaloneParent=i,this.standalone=!0,n&&(n==null||n.add(this,se.Updated))),n==null||n.attemptAutoclose(P.SetStandaloneParent,this.id),this}addValueAsTypeToList(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.AddValueAsTypeToList))){return this.checkCanEdit(this,n)?((this.valueAsTypeList||[]).includes(i)||(this.valueAsTypeList=this.valueAsTypeList||[],this.valueAsTypeList.push(i),this.value!==null&&this.metaSync({value:null},n),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,n==null||n.add(this,se.Updated)),n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.AddValueAsTypeToList,this.id),this):(oe.Logger.warn(`[addValueAsTypeToList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.AddValueAsTypeToList,this.id),this)}removeValueAsTypeFromList(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveValueAsTypeFromList))){return this.checkCanEdit(this,n)?(this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)&&(this.valueAsTypeList||[]).includes(i)&&(this.valueAsTypeList=this.valueAsTypeList.filter(s=>s.id!==i.id),this.valueAsTypeList.length===0?this.valueAsTypeList=null:(this.value!==null&&this.metaSync({value:null},n),this.valueAsTypeSingle!==null&&(this.valueAsTypeSingle=null,n==null||n.add(this,se.Updated))),n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.RemoveValueAsTypeFromList,this.id),this):(oe.Logger.warn(`[removeValueAsTypeFromList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.RemoveValueAsTypeFromList,this.id),this)}setValueAsTypeSingle(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetValueAsTypeSingle))){return this.checkCanEdit(this,n)?(this.valueAsTypeSingle!==i&&(this.valueAsTypeSingle=i,n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.SetValueAsTypeSingle,this.id),this):(oe.Logger.warn(`[setValueAsTypeSingle] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetValueAsTypeSingle,this.id),this)}setValueAsTypeList(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetValueAsTypeList))){var s,c;return this.checkCanEdit(this,n)?(!i&&this.valueAsTypeList?(this.valueAsTypeList=null,n==null||n.add(this,se.Updated)):i&&!this.valueAsTypeList?(this.valueAsTypeList=i,n==null||n.add(this,se.Updated)):i&&this.valueAsTypeList&&((s=this.valueAsTypeList)==null?void 0:s.length)!==i.length?(this.valueAsTypeList=i,n==null||n.add(this,se.Updated)):i&&this.valueAsTypeList&&((c=this.valueAsTypeList)!=null&&c.every((e,f)=>e!==i[f]))&&(this.valueAsTypeList=i,n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose(P.SetValueAsTypeList,this.id),this):(oe.Logger.warn(`[setValueAsTypeList] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetValueAsTypeList,this.id),this)}setValueAsType(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.SetValueAsType))){return this.checkCanEdit(this,n)?i?(Array.isArray(i)?this.setValueAsTypeList(i,n):this.setValueAsTypeSingle(i,n),n==null||n.attemptAutoclose(P.SetValueAsType,this.id),this):(this.setValueAsTypeSingle(null,n),this.setValueAsTypeList(null,n),this):(oe.Logger.warn(`[setValueAsType] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),n==null||n.attemptAutoclose(P.SetValueAsType,this.id),this)}initChildren(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"init-children"))){if(this.initialized||this.startedInitialization)return this;if(this.startedInitialization=!0,this.standalone){if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(n=>{if(n.type===r.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(n);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.entityType}' with id '${n.entityId}' that is not part of the project state.`);return c}const s=this.project.get(n.id);if(!s)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.type}' with id '${n.id}' that is not part of the project state.`);return s});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===r.GenericReference){const s=this.project.findSubscribedBuiltInInstanceFromReference(this.initialData.valueAsTypeSingle);if(!s)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=s,this}const n=this.project.get(this.initialData.valueAsTypeSingle.id);if(!n)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=n}return this}if(this.initialData.valueAsTypeList&&Array.isArray(this.initialData.valueAsTypeList))this.valueAsTypeList=this.initialData.valueAsTypeList.map(n=>{if(n.type===r.GenericReference){const c=this.project.findSubscribedBuiltInInstanceFromReference(n);if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.entityType}' with id '${n.entityId}' that is not part of the project state.`);return c}const s=this.project.get(n.id);if(!s)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${n.type}' with id '${n.id}' that is not part of the project state.`);return s});else if(this.initialData.valueAsTypeSingle){if(this.initialData.valueAsTypeSingle.type===r.GenericReference){const s=he(this.initialData.valueAsTypeSingle),c=s?this.project.get(s):null;if(!c)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.entityType}' with id '${this.initialData.valueAsTypeSingle.entityId}' that is not part of the project state.`);return this.valueAsTypeSingle=c,this}const n=this.project.get(this.initialData.valueAsTypeSingle.id);if(!n)throw new Error(`Standalone entity of type '${this.type}' with id '${this.id}' has a reference to an entity of type '${this.initialData.valueAsTypeSingle.type}' with id '${this.initialData.valueAsTypeSingle.id}' that is not part of the project state.`);this.valueAsTypeSingle=n}return this.subscribeToDependencies(),this.afterAllChildrenInitialized(i),i==null||i.attemptAutoclose("init-children",this.id),this}subscribe(){var i;return this.activeVersion=!0,(i=this.knownVersions)==null||i.forEach(n=>{n.version!==this.version&&(n.activeVersion=!1)}),this.project.subscribeInstance(this),this}unsubscribe(){return this.project.unsubscribeInstance(this),this}metaSync(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"meta-sync"))){const s=Za(this,i,n);this.id==="3a497c83-1410-4ab0-8478-1e9c4f0c1935"&&i.value===!1&&console.trace("[LiteralValueState.metaSync] Test error");const c=qa(this,s),e=this.toMeta();this.name=s.name!==void 0?s.name:e.name,this.autogeneration=s.autogeneration!==void 0?s.autogeneration:e.autogeneration,this.value=s.value!==void 0?s.value:e.value,s.rawString!==void 0?this.rawString=s.rawString:s.value!==void 0&&typeof s.value=="string"?this.rawString=s.value:this.rawString=e.rawString;const f=i.valueAsTypeSingle!==void 0?i.valueAsTypeSingle:this.valueAsTypeSingle??null,h=i.valueAsTypeList!==void 0?i.valueAsTypeList:this.valueAsTypeList??null;return(this.name!==ce.String||f!==null||h!==null&&h.length>0)&&(this.rawString=null,s.rawString=null),super.baseMetaSync(s,this,n),s.deleted===!0&&!e.deleted?n==null||n.add(this,se.Removed):s.deleted===!1&&e.deleted?n==null||n.add(this,se.Added):c&&(n==null||n.add(this,se.Updated)),n==null||n.attemptAutoclose("meta-sync",this.id),this}async APILoad(i=st,...n){return await Tn.repository.APILoad(this.id,...n),this}async APICreate(i=st,...n){return await Tn.repository.APICreate(this.toShallowJSON(),...n),this}async APIUpdate(i=st,...n){return await Tn.repository.APIUpdate(this.toShallowJSON(),...n),this}async APIDelete(i=st,...n){return await Tn.repository.APIDelete(this.toShallowJSON(),...n),this}async APIClone(i=st,...n){return await Tn.repository.APIClone(this.id,...n),this}async APILoadVersion(i=st,n,...s){return await Tn.repository.APILoadVersion(this.id,n,...s)}removeFromParent(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveFromParent))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[removeFromParent] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return this.parent&&(this.parent.type===r.DataType?this.parent.setEntity(null,i):RD.includes(this.parent.type)&&this.parent.setDefaultValue(null,i),e.push(this.parent)),i==null||i.attemptAutoclose(P.RemoveFromParent,this.id),{added:V(c),updated:V(n),removed:V(s),affected:V(e),self:this}}remove({ignoreUpstream:i}={ignoreUpstream:!1},n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RemoveEntity))){var h;if(!this.checkCanDelete(this,n))return oe.Logger.warn(`[remove] User is not allowed to delete or edit this ${this.type} entity with id: ${this.id}`),n==null||n.event({id:`${P.RemoveEntity}-${this.id}--${ze.ActionOwnerEntityNonDeletable}`,action:P.RemoveEntity,owner:this,errorReason:ze.ActionOwnerEntityNonDeletable,rootAction:((h=n==null?void 0:n.self)==null?void 0:h.id)===this.id&&(n==null?void 0:n.actionName)===P.RemoveEntity}),n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const s=[],c=[],e=[],f=[];if(n!=null&&n.hasRemoved(this.id))return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};if(c.push(this),this.unsubscribe(),this.unsubscribeFromDependencies(),this.project.subscribeDeletedInstance(this),this.metaSync({deleted:!0},n),Object.values(this.detachedDependents).forEach(m=>{const{updated:T,removed:g,added:b}=m.entity.onDetachedDependencyRemoved(this,m.field,n);s.push(...T),c.push(...g),e.push(...b)}),!i){const m=this.removeFromParent(n);e.push(...m.added),s.push(...m.updated),c.push(...m.removed),f.push(...m.affected)}return n==null||n.attemptAutoclose(P.RemoveEntity,this.id),{added:V(e),updated:V(s),removed:V(c),affected:V(f),self:this}}restore({}={},i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.RestoreEntity))){if(!this.checkCanEdit(this,i))return oe.Logger.warn(`[restore] User is not allowed to edit this ${this.type} entity with id: ${this.id}`),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this};const n=[],s=[],c=[],e=[];return i!=null&&i.hasAdded(this.id)?(i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:[],updated:[],removed:[],affected:[],self:this}):(this.subscribe(),this.project.unsubscribeDeletedInstance(this),this.metaSync({deleted:!1},i),Object.values(this.detachedDependents).forEach(f=>{const{updated:h,removed:m,added:T}=f.entity.onDetachedDependencyRestored(this,f.field,i);s.push(...h),c.push(...m),n.push(...T)}),i==null||i.attemptAutoclose(P.RestoreEntity,this.id),{added:V(n),updated:V(s),removed:V(c),affected:V(e),self:this})}toFlat(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlat(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlat(i)):[]])}toFlatIds(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatIds(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlatIds(i)):[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name}}toJSON(i=new Set){var n,s,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:((n=this.valueAsTypeSingle)==null?void 0:n.toJSON(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(e=>e.toJSON(i)):null,parent:((s=this.parent)==null?void 0:s.toReference())||null,standaloneParent:((c=this.standaloneParent)==null?void 0:c.toReference())||null})}toJSONClone(i=wt){var s,c,e,f,h,m,T;let n;return(s=i.seenEntityMaps)!=null&&s.has(this.id)?n=i.seenEntityMaps.get(this.id):(n=i.newId||Xa(this,this.project,i.uuidStrategy),i.seenEntityMaps&&i.seenEntityMaps.set(this.id,n)),(c=i.seenEntities)!=null&&c.has(n)||(e=i.seenEntities)!=null&&e.has(this.id)?this.toReference({seenEntityMaps:i.seenEntityMaps}):((f=i.seenEntities)==null||f.add(n),(h=i.seenEntities)==null||h.add(this.id),{id:n,version:M.UUID.uuid(),createdAt:i.timestamp||U().toISOString(),previousVersion:null,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,autogeneration:this.autogeneration,value:this.value,rawString:this.rawString,valueAsTypeSingle:this.valueAsTypeSingle?this.project.getBuiltIn(this.valueAsTypeSingle.id)?this.valueAsTypeSingle.toJSON():this.valueAsTypeSingle.toJSONClone({...i,newId:null}):null,valueAsTypeList:this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(g=>{var b;return this.project.getBuiltIn(g.id)?g.toJSON(i.seenEntities):(b=g.toJSONClone)==null?void 0:b.call(g,{...i,newId:null})}):null,parent:((m=this.parent)==null?void 0:m.toReference({seenEntityMaps:i.seenEntityMaps}))||null,standaloneParent:((T=this.standaloneParent)==null?void 0:T.toReference({seenEntityMaps:i.seenEntityMaps}))||null})}toReference(i=wt){var s;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n+"--"+M.UUID.uuid()+"--ref",type:r.GenericReference,entityId:n,version:this.version,entityType:this.type}}toShallowJSON(i=wt){var s,c,e,f;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,editable:this.editable,deletable:this.deletable,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.toReference(i))||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.toReference(i)):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:((e=this.parent)==null?void 0:e.toReference(i))||null,standaloneParent:(f=this.standaloneParent)==null?void 0:f.toReference(i)}}toFlatJSON(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatJSON(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlatJSON(i)):[]])}toGenerationTarget(i=wt){var s,c,e,f;let n=this.id;return(s=i.seenEntityMaps)!=null&&s.has(this.id)&&(n=i.seenEntityMaps.get(this.id)),{id:n,type:this.type,name:this.name,valueAsTypeSingle:((c=this.valueAsTypeSingle)==null?void 0:c.id)||null,valueAsTypeList:Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.map(h=>h.id):null,value:this.value,rawString:this.rawString,autogeneration:this.autogeneration,parent:(e=this.parent)==null?void 0:e.id,standaloneParent:(f=this.standaloneParent)==null?void 0:f.id}}toFlatGenerationTarget(i=new Set){return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.valueAsTypeSingle?this.valueAsTypeSingle.toFlatGenerationTarget(i):[],...this.valueAsTypeList&&Array.isArray(this.valueAsTypeList)?this.valueAsTypeList.flatMap(s=>s.toFlatGenerationTarget(i)):[]])}clearErrors(){return this.errors=[],this}validate(){return this.errors=ctt(this),{success:!0}}async validateAsync(i={}){const n=oe.YieldTracker.from(i);return this.errors=await ptt(this,{tracker:n}),{success:!0}}getErrors(){return[...this.errors]}async getErrorsAsync(i={}){const n=oe.YieldTracker.from(i),s=[...this.errors];return await n.tick(),s}getShallowErrors(){return this.errors}clone(i=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,P.CloneEntity)),n=null,s=null,c=!0){const e=_a(n,this),f=this.toJSON();n?(f.parent=n.toReference(),f.standaloneParent=null):(f.parent=null,this.standaloneParent?f.standaloneParent=this.standaloneParent.toReference():this.parent?f.standaloneParent=this.parent.toReference():f.standaloneParent=null);const h=s||M.UUID.uuid();f.id=h,f.version=M.UUID.uuid(),f.createdAt=(i==null?void 0:i.timestamp)||U().toISOString(),f.author=(i==null?void 0:i.author)||"1",f.previousVersion=null,f.deleted=!1,f.editable=!0,f.deletable=!0;const m=Cr(f,e);return m.hydrateAncestors(),n&&m.setParent(n,i),c&&(m.subscribe(),m.addSelfToProject(i)),i==null||i.add(m,se.Added),m.initChildren(i),!i&&c&&m.captureVersion(),i==null||i.attemptAutoclose(P.CloneEntity,this.id),m}merge(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),this,!0,"merge-literal-value"))){const s=[],c=[],e=[],f=[];return this.valueAsTypeSingle!==(i==null?void 0:i.valueAsTypeSingle)&&(this.setValueAsType(i.valueAsTypeSingle,n),s.push(this)),this.valueAsTypeList!==i.valueAsTypeList&&(this.setValueAsTypeList(i.valueAsTypeList,n),s.push(this)),this.value!==i.value&&(this.metaSync({value:i.value},n),s.push(this)),this.autogeneration!==i.autogeneration&&(this.metaSync({autogeneration:i.autogeneration},n),s.push(this)),this.name!==i.name&&(this.metaSync({name:i.name},n),s.push(this)),n==null||n.attemptAutoclose("merge-literal-value",this.id),{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:this}}};C(Tn,"repository",{APICreate:async(i,...n)=>i,APIUpdate:async(i,...n)=>i,APIDelete:async(i,...n)=>i,APIClone:async(i,...n)=>{},APILoad:async(i,...n)=>null,APILoadVersion:async(i,n,...s)=>null}),C(Tn,"type",r.LiteralValue),C(Tn,"USER_MANAGED_PARENT_TYPES",[r.DataType,r.InputMap,r.Property,r.ArgumentDeclaration,r.ReturnStatement,r.BreakStatement,r.ContinueStatement,r.VariableDeclaration,r.VariableInstance,r.ValueDescriptor]),C(Tn,"USER_MANAGED_STANDALONE_PARENT_TYPES",[...AD]),C(Tn,"PARENT_TYPES",[...Tn.USER_MANAGED_PARENT_TYPES]),C(Tn,"MUTABLE_BASE_PROPERTIES",["name","autogeneration","value","rawString"]),C(Tn,"INMUTABLE_BASE_PROPERTIES",["id","type","version","createdAt","author","previousVersion"]),C(Tn,"BASE_PROPERTIES",[...Tn.MUTABLE_BASE_PROPERTIES,...Tn.INMUTABLE_BASE_PROPERTIES]),C(Tn,"MUTABLE_META_PROPERTIES",[...Tn.MUTABLE_BASE_PROPERTIES]),C(Tn,"INMUTABLE_META_PROPERTIES",[...Tn.INMUTABLE_BASE_PROPERTIES]),C(Tn,"META_PROPERTIES",[...Tn.MUTABLE_META_PROPERTIES,...Tn.INMUTABLE_META_PROPERTIES]),C(Tn,"MUTABLE_UPSTREAM_PROPERTIES",["valueAsTypeSingle","valueAsTypeList"]),C(Tn,"INMUTABLE_UPSTREAM_PROPERTIES",["parent"]),C(Tn,"UPSTREAM_PROPERTIES",[...Tn.MUTABLE_UPSTREAM_PROPERTIES,...Tn.INMUTABLE_UPSTREAM_PROPERTIES]),C(Tn,"MUTABLE_DOWNSTREAM_PROPERTIES",[]),C(Tn,"INMUTABLE_DOWNSTREAM_PROPERTIES",[]),C(Tn,"DOWNSTREAM_PROPERTIES",[...Tn.MUTABLE_DOWNSTREAM_PROPERTIES,...Tn.INMUTABLE_DOWNSTREAM_PROPERTIES]),C(Tn,"PROPERTIES",[...Tn.META_PROPERTIES,...Tn.UPSTREAM_PROPERTIES,...Tn.DOWNSTREAM_PROPERTIES]);let ua=Tn;function Z0(l){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){const i=new Uint8Array(l);return crypto.getRandomValues(i),i}const{randomBytes:u}=require("crypto");return u(l)}function ytt(l,u){const i=u-l+1,s=Zw()*i;return Math.floor(s)+l}function htt(){const l=Z0(4);return(l[0]<<24|l[1]<<16|l[2]<<8|l[3])>>>0}function Zw(){return htt()/2**32}function j2(l){const u=Z0(l);return Array.from(u).map(i=>i.toString(16).padStart(2,"0")).join("")}const dN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function K2(l){let u="";const i=Z0(l);for(let n=0;n<l;n++)u+=dN[i[n]%dN.length];return u}function mtt(l){const u=Z0(l);let i;if(typeof Buffer<"u")i=Buffer.from(u).toString("base64");else{const n=String.fromCharCode(...u);i=btoa(n)}return i.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function q2(l){return K2(l)}function Z2(l,u=dN){let i="";const n=Z0(l);for(let s=0;s<l;s++)i+=u[n[s]%u.length];return i}function oy(){const l=Z0(16);l[6]=l[6]&15|64,l[8]=l[8]&63|128;const u=Array.from(l).map(i=>i.toString(16).padStart(2,"0")).join("");return[u.slice(0,8),u.slice(8,12),u.slice(12,16),u.slice(16,20),u.slice(20,32)].join("-")}function Ttt(){return Z2(6)}function vtt(){return j2(32)}const lXi=63,oXi=/^[a-z][a-z0-9-]*[a-z0-9]$/;function dXi(l){return l.length>=1&&l.length<=lXi&&oXi.test(l)&&!l.includes("--")}function*uXi(){yield"";const l="abcdefghijklmnopqrstuvwxyz";for(let u=1;;u++){const i=new Array(u).fill(0);let n=!1;for(;!n;){yield i.map(s=>l[s]).join("");for(let s=u-1;s>=0&&(i[s]++,!(i[s]<l.length));s--)i[s]=0,s===0&&(n=!0)}}}function pXi(l,u){const i=new Set(l.map(s=>s.toLowerCase())),n=u>0?"secondarydb":"main";for(const s of uXi()){const c=s?`${n}${s}`:n;if(dXi(c)&&!i.has(c))return c}throw new Error("Unable to generate identifier")}function gtt(l,u){switch(l.id){case B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const i=l.project.entities.filter(h=>!!h.implements.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)),n=i.find(h=>{const m=h.properties.find(b=>b.implements.find(R=>R.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),T=m==null?void 0:m.getDefaultValue();return(T==null?void 0:T.value)===!0});if(!n&&i.length){const m=i[0].properties.find(g=>g.implements.find(b=>b.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),T=m==null?void 0:m.defaultValue;if(T)T.metaSync({value:!0},u);else if(m!=null&&m.dataType){const g={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:ce.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:m==null?void 0:m.toReference()},b=Ve(g,l.project);return b.hydrateAncestors(),b.setParent(m,u),b.addSelfToProject(u),u==null||u.add(b,se.Added),b.initChildren(u),u||b.captureVersion(),{newEntities:[b]}}return{newEntities:[]}}else if(n)return{newEntities:[]};const s=l.project.get(B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id),c=Hw(s,"Main database",u);if(c.errors.length>0)return{newEntities:[]};const e=c.properties.find(h=>h.implements.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)),f=e==null?void 0:e.defaultValue;if(f)f.metaSync({value:!0},u);else if(e!=null&&e.dataType){const h={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:ce.EntityTemplate,autogeneration:null,value:!0,valueAsTypeSingle:null,valueAsTypeList:null,parent:e==null?void 0:e.toReference()},m=Ve(h,l.project);m.hydrateAncestors(),m.setParent(e,u),m.addSelfToProject(u),u==null||u.add(m,se.Added),m.initChildren(u),u||m.captureVersion()}return{newEntities:[c]}}}return{newEntities:[]}}function Ett(l,u){const i=[],n=[],s=[],c=[];return Zv(l).filter(f=>f.type===r.BuiltInBaseEntity).forEach(f=>{var h,m,T,g,b,R,I,D,N;switch(f.id){case B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.id:{const $=l.project.entities.filter(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id));let x=$.find(Z=>!!Z.properties.find(X=>{var te;return X.implements.find(z=>z.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((te=X.getDefaultValue())==null?void 0:te.value)===!0}));if(!x&&$.length)x=$[0];else if(!x&&!$.length){x=l.project.getBuiltIn(B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id).implement("Relational database",u);const X=x.properties.find(te=>te.implements.find(z=>z.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));(h=X==null?void 0:X.defaultValue)==null||h.metaSync({value:!0},u),n.push(x)}const L=l.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.database.id));if(L&&!(L!=null&&L.defaultValue)){const Z={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(u==null?void 0:u.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:null,name:ce.EntityTemplate,autogeneration:null,value:null,valueAsTypeSingle:(x==null?void 0:x.toJSON())||null,valueAsTypeList:null,parent:L==null?void 0:L.toReference()},X=Ve(Z,l.project);X.hydrateAncestors(),X.setParent(L,u),X.addSelfToProject(u),u==null||u.add(X,se.Added),X.initChildren(u),(L==null?void 0:L.defaultValue).setValueAsTypeSingle(x||null,u),n.push(X),u||X.captureVersion();return}else L!=null&&L.defaultValue&&!(L!=null&&L.defaultValue.valueAsTypeSingle)&&(L==null||L.defaultValue.setValueAsTypeSingle(x||null,u));const K=l.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_PERSISTED_ENTITY_ENTITY.properties.primaryKey.id));if(!K)throw new Error(`[handleAfterEntityImplementationSideEffects] Primary key property not found for implemented base entity ${B["built-in-base-entity"]}`);let q=!1;if(!K.dataType){const Z=Xr.new(u);Z.parent=K.toReference();const X=Ve(Z,l.project);X.hydrateAncestors(),X.setParent(K,u),X.addSelfToProject(u),u==null||u.add(X,se.Added),X.initChildren(u),q=!0}const W=l.project.getBuiltIn(B["primitive-entity"].number.id);(m=K.dataType)==null||m.setEntity(W,u),q&&(u||(T=K.dataType)==null||T.captureVersion());return}case B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id:{const $=l.project.entities.filter(z=>z.implements.find(J=>J.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id)&&z.id!==l.id),x=$.map(z=>{var ne;const J=z.properties.find(ae=>ae.implements.find(de=>de.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));return(ne=J==null?void 0:J.getDefaultValue())==null?void 0:ne.value}).filter(z=>!!z),L=l.properties.find(z=>z.implements.find(J=>J.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id));if(!$.find(z=>!!z.properties.find(J=>{var Q;return J.implements.find(ne=>ne.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id)&&((Q=J.getDefaultValue())==null?void 0:Q.value)===!0}))){const z=l.properties.find(Q=>Q.implements.find(ne=>ne.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.default.id));if(!z)throw new Error("Default boolean property not found for relational database entity with id: "+l.id);let J=!1;if(!(z!=null&&z.defaultValue)){const Q=ua.new(u);Q.parent=z.toReference();const ne=Ve(Q,l.project);ne.hydrateAncestors(),ne.setParent(z,u),ne.addSelfToProject(u),u==null||u.add(ne,se.Added),ne.initChildren(u),J=!0}(g=z==null?void 0:z.defaultValue)==null||g.metaSync({value:!0},u),J&&(u||(b=z==null?void 0:z.defaultValue)==null||b.captureVersion())}if(!L)throw new Error("Identifier property not found for relational database entity with id: "+l.id);let q=!1;if(!(L!=null&&L.defaultValue)){const z=ua.new(u);z.parent=L.toReference();const J=Ve(z,l.project);J.hydrateAncestors(),J.setParent(L,u),J.addSelfToProject(u),u==null||u.add(J,se.Added),J.initChildren(u),q=!0}const W=pXi(x,$.length);(R=L.defaultValue)==null||R.metaSync({value:W},u),q&&(u||(I=L.defaultValue)==null||I.captureVersion());const Z=l.properties.find(z=>z.implements.find(J=>J.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.password.id));if(!Z)throw new Error(`[handleAfterEntityImplementationSideEffects] Password property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.id} with id ${l.id}`);let X=!1;if(!Z.defaultValue){const z=ua.new(u);z.parent=Z.toReference();const J=Ve(z,l.project);J.hydrateAncestors(),J.setParent(Z,u),J.addSelfToProject(u),u==null||u.add(J,se.Added),J.initChildren(u),n.push(J),X=!0}const te=q2(24);(D=Z.defaultValue)==null||D.metaSync({value:te},u),X&&(u||(N=Z.defaultValue)==null||N.captureVersion());return}case B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id:{const $=l.properties.find(q=>q.implements.find(W=>W.id===B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.time.id));if(!$)throw new Error(`[handleAfterEntityImplementationSideEffects] Time property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${l.id}`);let x=$.defaultValue||null;if(!x){const q=ua.new(u);q.parent=$.toReference(),q.name=ce.Date,q.id=M.UUID.uuid(),x=Ve(q,l.project),x.hydrateAncestors(),x.setParent($,u),x.addSelfToProject(u),x.initChildren(u),u==null||u.add(x,se.Added)}x.metaSync({value:new Date().toISOString()},u),x.metaSync({editable:!1,deletable:!1},u),$.metaSync({editable:!1,deletable:!1},u);const L=l.properties.find(q=>q.implements.find(W=>W.id===B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.properties.definition.id));if(!L)throw new Error(`[handleAfterEntityImplementationSideEffects] Definition property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_SQL_ROW_TRANSFORMER_ENTITY.id} with id ${l.id}`);let K=L.defaultValue||null;if(!K){const q=ua.new(u);q.name=ce.EntityTemplate,q.parent=L.toReference(),q.id=M.UUID.uuid(),K=Ve(q,l.project),K.hydrateAncestors(),K.setParent(L,u),K.addSelfToProject(u),K.initChildren(u),u==null||u.add(K,se.Added)}break}case B["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id:{const $=l.project.entities.filter(x=>Hi(x,De.SHARED_DRIVE_ENTITY)&&x.id!==l.id);if($.length===1){const x=$[0],L=l.properties.find(q=>q.implements.find(W=>W.id===B["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.properties.sharedDrive.id));if(!L)throw new Error(`[handleAfterEntityImplementationSideEffects] Shared Drive property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_SHARED_DRIVE_MOUNT_ENTITY.id} with id ${l.id}`);let K=L.defaultValue||null;if(!K){const q=ua.new(u);q.name=ce.EntityTemplate,q.parent=L.toReference(),q.id=M.UUID.uuid(),K=Ve(q,l.project),K.hydrateAncestors(),K.setParent(L,u),K.addSelfToProject(u),K.initChildren(u),u==null||u.add(K,se.Added)}K.setValueAsTypeSingle(x,u)}break}case B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id:{const $=l.properties.find(W=>W.implements.find(Z=>Z.id===B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id));if(!$)throw new Error(`[handleAfterEntityImplementationSideEffects] Compute name property not found for implemented base entity ${B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.id} with id ${l.id}`);const x=l.project.entities.filter(W=>Hi(W,De.COMPUTE_ENTITY)&&W.id!==l.id);let L=$.defaultValue||null;if(!L){const W=ua.new(u);W.name=ce.EntityTemplate,W.parent=$.toReference(),W.id=M.UUID.uuid(),L=Ve(W,l.project),L.hydrateAncestors(),L.setParent($,u),L.addSelfToProject(u),L.initChildren(u),u==null||u.add(L,se.Added)}const K=x.map(W=>{var Z,X;return((X=(Z=W.properties.find(te=>te.implements.some(z=>z.id===B["built-in-base-entity"].BUILT_IN_COMPUTE_ENTITY.properties.computeName.id)))==null?void 0:Z.defaultValue)==null?void 0:X.value)||""}),q=G2(L.value||"compute-instance",K,"-");L.metaSync({value:q},u);break}}}),{self:l,updated:V(i),added:V(n),removed:V(s),affected:V(c)}}function Hw(l,u,i,n){const s=n||M.UUID.uuid(),c=Ua.new(i);c.id=s,c.name=u,c.static=l.static,c.implements=[l.toJSON()],c.parent=l.project.toReference(),c.static=l.static,gtt(l,i);const e=Ve(c,l.project);return e.hydrateAncestors(),i==null||i.add(e,se.Added),e.addSelfToProject(i),e.initChildren(i),i||e.captureVersion(),Ett(e,i),e.afterAllChildrenInitialized(i),e}function H2(l,u){return u.entities.find(s=>{const c=s.properties,e=c.map(g=>g.name),f=l.every(g=>e.includes(g)),h=e.filter(g=>!l.includes(g)),m=c.every(g=>!h.includes(g.name)||!g.required);return f&&m})||null}function btt(l,u,i,n=dt.OrDataTypeGroup){const s=[],c=[],e=[],f=[],h=M.UUID.uuid(),m=Xr.new(i);m.id=h,m.parent=u.toReference(),m.like=!0,m.parentRelationType=n;const T=Ve(m,l.project);return c.push(T),T.setParent(u,i),T.addSelfToProject(i),i==null||i.add(T,se.Added),T.setEntity(l,i),T.initChildren(i),i||T.captureVersion(),{updated:V(s),added:V(c),removed:V(e),affected:V(f),self:T}}function W2(l,u,i,n,s){var m,T,g,b,R,I,D,N;const c=[],e=[],f=[],h=[];switch(typeof l){case"string":let $=!1;const x=new Date(l);if(x instanceof Date&&!isNaN(x.valueOf())&&($=!0),$){const L=u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Date].id);u.setEntity(L,n);break}else{const L=u.project.getBuiltIn(B[r.PrimitiveEntity][ce.String].id);u.setEntity(L,n);break}case"number":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Number].id),n);break;case"boolean":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Boolean].id),n);break;case"object":if(l===null){u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Null].id),n);break}else if(Array.isArray(l))if(u.metaSync({isList:!0},n),l.length>0){const L=l.slice(0,5).filter(q=>q!==void 0);if(L.every(q=>typeof q==typeof L[0])&&(typeof L[0]!="object"||L[0]===null))switch(typeof L[0]){case"string":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.String].id),n);break;case"number":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Number].id),n);break;case"boolean":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Boolean].id),n);break;case"object":u.setEntity(u.project.getBuiltIn(B[r.PrimitiveEntity][ce.Null].id),n);break}else{const q=[];let W=!1;L.forEach(X=>{var te,z,J,Q;if(Array.isArray(X)&&(W=!0),typeof X=="object"&&!Array.isArray(X)&&X!==null){const ne=A1(X,u.project,{...i,id:M.UUID.uuid()},n,s);ne.hasCreated&&q.push((te=ne.changeSet)==null?void 0:te.self),c.push(...(z=ne.changeSet)==null?void 0:z.updated),e.push(...(J=ne.changeSet)==null?void 0:J.added),f.push(...(Q=ne.changeSet)==null?void 0:Q.removed)}});const Z=V(q);if(!Z.length&&!W){L.forEach(X=>{const te=Xr.new(n);te.parentRelationType=dt.OrDataTypeGroup,te.parent=u.toReference();const z=Ve(te,u.project);switch(z.hydrateAncestors(),z.setParent(u,n),z.addSelfToProject(n),n==null||n.add(z,se.Added),z.initChildren(n),typeof X){case"string":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.String].id),n);break;case"number":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.Number].id),n);break;case"boolean":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.Boolean].id),n);break;case"object":z.setEntity(z.project.getBuiltIn(B[r.PrimitiveEntity][ce.Null].id),n);break}n||z.captureVersion()});break}else Z.length===1&&!W?u.setEntity(Z[0],n):L.forEach(X=>{if(typeof X=="object"&&!Array.isArray(X)&&X!==null){const te=H2(Object.keys(X),u.project);if(te){const z=btt(te||Z[0],u,n,dt.OrDataTypeGroup);c.push(...z.updated),e.push(...z.added),f.push(...z.removed)}}else{const te=Xr.new(n);te.parentRelationType=dt.OrDataTypeGroup,te.parent=u.toReference();const z=Ve(te,u.project);z.hydrateAncestors(),z.setParent(u,n),z.addSelfToProject(n),n==null||n.add(z,se.Added),z.initChildren(n);const J=W2(X,z,{...i,id:M.UUID.uuid()},n,s);c.push(...J.updated),e.push(...J.added),f.push(...J.removed),n||z.captureVersion()}})}}else{const L=A1(l[0],u.project,{...i},n,s);u.setEntity((m=L.changeSet)==null?void 0:m.self,n),c.push(...(T=L.changeSet)==null?void 0:T.updated),e.push(...(g=L.changeSet)==null?void 0:g.added),f.push(...(b=L.changeSet)==null?void 0:b.removed);break}else{const L=A1(l,u.project,{...i},n,s);u.setEntity((R=L.changeSet)==null?void 0:R.self,n),c.push(...(I=L.changeSet)==null?void 0:I.updated),e.push(...(D=L.changeSet)==null?void 0:D.added),f.push(...(N=L.changeSet)==null?void 0:N.removed);break}}return{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:u}}function A1(l,u,i,n,s){const c=[],e=[],f=[],h=[],m=Object.keys(l),T=H2(m,u);if(T)return{hasCreated:!1,changeSet:{updated:[],added:[],removed:[],affected:[],self:T}};const g=s?i.name+" of "+s.name:i.name,R={id:i.id||M.UUID.uuid(),version:M.UUID.uuid(),createdAt:(n==null?void 0:n.timestamp)||new Date().toISOString(),author:M.sessionAuthor,previousVersion:null,deleted:!1,name:g,codeName:null,deletable:!0,editable:!0,type:r.DefinitionEntity,additionalProperties:!1,additionalPropertiesDataType:null,allPropertiesImplement:null,description:i.description||null,static:i.static||!1,abstract:i.abstract||!1,properties:[],methods:[],abstractMethods:[],extends:null,implements:[],x:0,y:0,parent:u.toReference()},I=Ve(R,u);return I.hydrateAncestors(),I.setParent(u,n),I.addSelfToProject(n),n==null||n.add(I,se.Added),I.initChildren(n),e.push(I),m.forEach((D,N)=>{const $=M.UUID.uuid(),x=fo.new(n);x.id=$,x.name=D,x.codeName=D,x.parent=I.toReference(),x.index=N,x.required=!0,x.interactive=!0;const L=Ve(x,u);L.hydrateAncestors(),L.setParent(I,n),L.addSelfToProject(n),n==null||n.add(L,se.Added),L.initChildren(n),e.push(L);const K=l[D],q=M.UUID.uuid(),W=Xr.new(n);W.id=q,W.parent=L.toReference(),W.like=!0,W.isList=!1;const Z=Ve(W,u);Z.hydrateAncestors(),Z.setParent(L,n),Z.addSelfToProject(n),n==null||n.add(Z,se.Added),Z.initChildren(n),e.push(Z);const X=W2(K,Z,{...i,name:D,id:M.UUID.uuid()},n,s||I);c.push(...X.updated),e.push(...X.added),f.push(...X.removed),n||(L.captureVersion(),Z.captureVersion())}),n||I.captureVersion(),{hasCreated:!0,changeSet:{updated:V(c),added:V(e),removed:V(f),affected:V(h),self:I}}}function Gc(l,u,i,n,s){const c={ignoreImplementationMatch:!1,...s},e=[];return!l.length||!u.length?{errors:e,overlap:!1}:(l.length>u.length?l.forEach(f=>{const h=u.find(T=>T.name===f.name),m=u.find(T=>{var g,b;return Array.isArray(T.implements)?T.implements.some(R=>!!f.implements.find(I=>I.id===R.id)):((g=T.implements)==null?void 0:g.id)===((b=f.implements)==null?void 0:b.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const T=new Ct({id:f.id+"--"+h.id+"--"+n,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${h.type} ${h.name} with id "${h.id}" that has the same name`,severity:Ie.Error,code:n,entity:f,firstRelationship:h});e.push(T)}if(m&&!c.ignoreImplementationMatch){const T=new Ct({id:f.id+"--"+m.id+"--"+i,message:`Entity of type ${f.type} named "${f.name}" with id "${f.id}" overrides a base ${m.type} ${m.name} with id "${m.id}" that implements the same base descriptor`,severity:Ie.Error,code:i,entity:f,firstRelationship:m});e.push(T)}}):u.forEach(f=>{var T;const h=l.find(g=>g.name===f.name),m=l.find(g=>{var b,R;return g.implements&&Array.isArray(g.implements)?g.implements.some(I=>!!f.implements.find(D=>D.id===I.id)):((b=g.implements)==null?void 0:b.id)===((R=f.implements)==null?void 0:R.id)});if(h&&!(c.ignoreImplementationMatch&&m&&(m==null?void 0:m.id)===(h==null?void 0:h.id))){const g=new Ct({id:h.id+"--"+f.id+"--"+n,message:`Entity of type ${h.type} named "${h.name}" with id "${h.id}" overrides a base entity ${f.name} with id "${f.id}" that has the same name`,severity:Ie.Error,code:n,entity:h,firstRelationship:f});e.push(g)}if(m&&!c.ignoreImplementationMatch){const g=new Ct({id:m.id+"--"+f.id+"--"+i,message:`Entity of type ${m.type} named "${m.name}" with id "${m.id}" overrides a base entity ${f.name} with id "${f.id}" that implements the same base ${Array.isArray(m==null?void 0:m.implements)?ti(m==null?void 0:m.implements.map(b=>b.type),"', '","' and '"):(T=m.implements)==null?void 0:T.id}`,severity:Ie.Error,code:i,entity:m,firstRelationship:f});e.push(g)}}),{errors:e,overlap:!!e.length})}function cXi(l,u){return l.abstract||(l.properties.forEach(n=>{n.abstract||n.metaSync({abstract:!0},u)}),Object.values(l.detachedDependents).forEach(n=>{n.field===bM.EntityField&&n.entity.remove({ignoreUpstream:!1},u)}),l.metaSync({abstract:!0},u)),l}function fXi(l,u){return l.abstract&&(l.properties.forEach(n=>{n.abstract&&n.metaSync({abstract:!1},u)}),Object.values(l.detachedDependents).forEach(n=>{(n.field===dD.Implements||n.field===dD.Extends)&&n.entity.onDetachedDependencyRemoved(l,n.field,u)}),l.metaSync({abstract:!1},u)),l}function yXi(l,u){return l.static||(l.properties.forEach(n=>{n.static||n.metaSync({static:!0},u)}),l.metaSync({static:!0},u)),l}function hXi(l,u){return l.static&&l.metaSync({static:!1},u),l}const db=class db extends M2{constructor(i,n){super(i);C(this,"initialData");C(this,"id");C(this,"version");C(this,"name");C(this,"description",null);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",!1);C(this,"static");C(this,"additionalProperties",!1);C(this,"properties",[]);C(this,"allPropertiesImplement",null);C(this,"additionalPropertiesDataType",null);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"interactive",!1);C(this,"errors",[]);C(this,"project");if(this.initialData=this.initialData||i,this.project=this.project||n,this.id=this.id||i.id,this.version=this.version||i.version,this.name=this.name||i.name,this.static=this.static||i.static,this.interactive=this.interactive||i.interactive,this.abstract=i.abstract,this.additionalProperties=i.additionalProperties,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.initialData.allPropertiesImplement){const s=Ve(this.initialData.allPropertiesImplement,this.project);s.setParent(this,null),s.initChildren(null),this.allPropertiesImplement=s}if(this.initialData.additionalPropertiesDataType){const s=Ve(this.initialData.additionalPropertiesDataType,this.project);s.setParent(this,null),s.initChildren(null),this.additionalPropertiesDataType=s}this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project))}get allMethods(){return V([...this.ownDeclaredMethods,...this.allBaseMethodsFromOriginalParents])}get allProperties(){return V([...this.ownDeclaredProperties,...this.allBasePropertiesFromOriginalParents])}get allBaseMethodsFromOriginalParents(){var s;const i=((s=this.extends)==null?void 0:s.allMethods)||[],n=[...i].filter(c=>!i.some(e=>e.id!==c.id));return V(n)}get allBasePropertiesFromOriginalParents(){var s;const i=((s=this.extends)==null?void 0:s.allProperties)||[],n=[...i].filter(c=>!i.some(e=>{var f;return e.id!==c.id&&(!!e.implements.find(h=>h.id===c.id)||((f=e.extends)==null?void 0:f.id)===c.id)}));return V(n)}get allBasePropertiesFromExtendedAndImplementedEntities(){var s,c;const i=[...((s=this.extends)==null?void 0:s.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.allBasePropertiesFromExtendedAndImplementedEntities)||[]].filter(e=>!e.abstract),n=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return V([...n])}get allBaseMethodsFromExtendedAndImplementedEntities(){return V([...(this.extends?[this.extends]:[]).reduce((i,n)=>n.type===r.PrimitiveEntity?i:[...[...n.ownDeclaredMethods,...n.allBaseMethodsFromExtendedAndImplementedEntities].filter(c=>c.type!==r.ActionDescriptor),...i],[])])}get extendedPropertiesFromOriginalParents(){var s,c;const i=[...((s=this.extends)==null?void 0:s.ownDeclaredProperties)||[],...((c=this.extends)==null?void 0:c.extendedPropertiesFromOriginalParents)||[]].filter(e=>!e.abstract),n=[...i].filter(e=>!i.some(f=>{var h;return f.id!==e.id&&(!!f.implements.find(m=>m.id===e.id)||((h=f.extends)==null?void 0:h.id)===e.id)}));return V(n)}get implementedPropertiesFromOriginalParents(){return V([...(this.extends?[this.extends]:[]).reduce((i,n)=>{const s=n.implementedPropertiesFromOriginalParents,c=[...n.ownDeclaredProperties].filter(h=>!!h.abstract),e=[...s,...c,...i];return[...e].filter(h=>!!!e.find(T=>{var g;return((g=T.extends)==null?void 0:g.id)===h.id||!!T.implements.find(b=>b.id===h.id)}))},[])].filter(i=>!!i.abstract))}get extendedProperties(){return this.properties.filter(i=>i.isExtendedProperty)}get ownDeclaredMethods(){return[...this.methods,...this.abstractMethods]}get ownDeclaredProperties(){return this.properties.filter(i=>!i.isExtendedProperty)}subscribe(){return this.project.subscribeBuiltInInstance(this),this}unsubscribe(){return this.project.unsubscribeBuiltInInstance(this),this}async APILoad(i=st,...n){return await db.repository.APILoad(this.id,...n),this}toFlat(i=new Set){var s;return i.has(this.id)?[]:(i.add(this.id),[this,...this.properties.flatMap(c=>c.toFlat(i)),...this.methods.flatMap(c=>c.toFlat(i)),...this.abstractMethods.flatMap(c=>c.toFlat(i)),...((s=this.extends)==null?void 0:s.toFlat(i))||[]])}toFlatIds(i=new Set){var s;return i.has(this.id)?[]:(i.add(this.id),[this.id,...this.properties.flatMap(c=>c.toFlatIds(i)),...this.methods.flatMap(c=>c.toFlatIds(i)),...this.abstractMethods.flatMap(c=>c.toFlatIds(i)),...((s=this.extends)==null?void 0:s.toFlatIds(i))||[]])}toMeta(){return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,description:this.description,interactive:this.interactive,additionalProperties:this.additionalProperties,abstract:this.abstract,static:this.static,type:this.type,name:this.name}}toJSON(i=new Set){var n,s,c;return i.has(this.id)?this.toReference():(i.add(this.id),{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,additionalProperties:this.additionalProperties,interactive:this.interactive,additionalPropertiesDataType:((n=this.additionalPropertiesDataType)==null?void 0:n.toJSON(i))||null,allPropertiesImplement:((s=this.allPropertiesImplement)==null?void 0:s.toJSON(i))||null,properties:this.properties.map(e=>e.toJSON(i)),methods:this.methods.map(e=>e.toJSON(i)),abstractMethods:this.abstractMethods.map(e=>e.toJSON(i)),extends:((c=this.extends)==null?void 0:c.toJSON(i))||null})}toReference(i=wt){return{id:this.id+"--"+M.UUID.uuid()+"--ref",type:r.GenericReference,entityId:this.id,version:this.version,entityType:this.type}}toShallowJSON(i=wt){var n,s,c;return{id:this.id,version:this.version,createdAt:this.createdAt,previousVersion:this.previousVersion,author:this.author,deleted:this.deleted,type:this.type,name:this.name,description:this.description,abstract:this.abstract,static:this.static,interactive:this.interactive,additionalProperties:this.additionalProperties,additionalPropertiesDataType:((n=this.additionalPropertiesDataType)==null?void 0:n.toReference())||null,allPropertiesImplement:((s=this.allPropertiesImplement)==null?void 0:s.toReference())||null,properties:this.properties.map(e=>e.toReference()),methods:this.methods.map(e=>e.toReference()),abstractMethods:this.abstractMethods.map(e=>e.toReference()),extends:((c=this.extends)==null?void 0:c.toReference())||null}}toFlatJSON(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this.toShallowJSON(),...this.properties.flatMap(e=>e.toFlatJSON(i)),...this.methods.flatMap(e=>e.toFlatJSON(i)),...this.abstractMethods.flatMap(e=>e.toFlatJSON(i)),...((s=this.additionalPropertiesDataType)==null?void 0:s.toFlatJSON(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatJSON(i))||[]])}toGenerationTarget(i=wt){var n;return{id:this.id,type:this.type,name:this.name,description:this.description,static:this.static,abstract:this.abstract,interactive:this.interactive,additionalProperties:this.additionalProperties,extends:(n=this.extends)==null?void 0:n.id}}toFlatGenerationTarget(i=new Set){var s,c;return i.has(this.id)?[]:(i.add(this.id),[this.toGenerationTarget(),...this.properties.flatMap(e=>e.toFlatGenerationTarget(i)),...this.methods.flatMap(e=>e.toFlatGenerationTarget(i)),...this.abstractMethods.flatMap(e=>e.toFlatGenerationTarget(i)),...((s=this.additionalPropertiesDataType)==null?void 0:s.toFlatGenerationTarget(i))||[],...((c=this.allPropertiesImplement)==null?void 0:c.toFlatGenerationTarget(i))||[]])}clearErrors(){var i,n;return this.errors=[],this.properties.forEach(s=>s.clearErrors()),this.methods.forEach(s=>s.clearErrors()),this.abstractMethods.forEach(s=>s.clearErrors()),(i=this.additionalPropertiesDataType)==null||i.clearErrors(),(n=this.allPropertiesImplement)==null||n.clearErrors(),this}validate(){return this.errors=rXi(this),{success:!0}}async validateAsync(i={}){const n=oe.YieldTracker.from(i);return this.errors=await nXi(this,{tracker:n}),{success:!0}}getErrors(){var n,s;return[...this.errors,...this.properties.flatMap(c=>c.getErrors()),...this.methods.flatMap(c=>c.getErrors()),...this.abstractMethods.flatMap(c=>c.getErrors()),...((n=this.additionalPropertiesDataType)==null?void 0:n.getErrors())||[],...((s=this.allPropertiesImplement)==null?void 0:s.getErrors())||[]]}async getErrorsAsync(i={}){const n=oe.YieldTracker.from(i),s=[...this.errors];await n.tick();for(const c of this.properties){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}for(const c of this.methods){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}for(const c of this.abstractMethods){const e=await c.getErrorsAsync({tracker:n});s.push(...e)}if(this.additionalPropertiesDataType){const c=await this.additionalPropertiesDataType.getErrorsAsync({tracker:n});s.push(...c)}if(this.allPropertiesImplement){const c=await this.allPropertiesImplement.getErrorsAsync({tracker:n});s.push(...c)}return s}getShallowErrors(){return this.errors}implement(i,n=this.project.addChangeSet(new ie(this.project,M.sessionAuthor,U().toISOString(),null,!0,"implement-built-in-base-entity")),s){const c=Hw(this,i,n,s);return n==null||n.attemptAutoclose("implement-built-in-base-entity",this.id),c}getAllPropertiesImplements(){var n;const i=[];return this.allPropertiesImplement&&i.push(this.allPropertiesImplement),((n=this.extends)==null?void 0:n.type)===r.BuiltInBaseEntity&&i.push(...this.extends.getAllPropertiesImplements()||[]),i}getAllInteractiveMethods(){const i=[];if(this.interactive){if(i.push(...this.methods,...this.abstractMethods),!this.extends||this.extends.type===r.BuiltInBaseEntity&&this.extends.interactive||this.extends.type===r.PrimitiveEntity)return i;this.extends instanceof db&&i.push(...this.extends.getAllInteractiveMethods())}return V(i)}getRawDefaultValue(){const i={};return this.properties.forEach(n=>{var e;if(!Nb(n)||!n.defaultValue)return;const s=Ee(n,this.project),c=n.codeName||Uc(n,this.project)||Mo(Dr(s));i[c]=((e=n.getDefaultValue())==null?void 0:e.value)||null}),i}};C(db,"repository",{APILoad:async(i,...n)=>null});let jo=db;class Itt extends jo{constructor(i){super(Rs,i);C(this,"initialData");C(this,"id",De.PERSISTED_ENTITY);C(this,"version","1");C(this,"name",De.PERSISTED_ENTITY);C(this,"description",Rs.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",Rs.abstract);C(this,"static",Rs.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=Rs,this.project=i,this.id=Rs.id,this.version=Rs.version,this.name=Rs.name,this.static=Rs.static,this.abstract=Rs.abstract,this.properties=this.initialData.properties.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(null),s}),this.methods=this.initialData.methods.map(n=>{const s=Ve(n,this.project);return s.parent=this,s}),this.abstractMethods=this.initialData.abstractMethods.map(n=>{const s=Ve(n,this.project);return s.parent=this,s}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project))}}var Hs=(l=>(l.ValueMustBeString="value-must-be-string",l.StringValueMustNotHaveSpaces="string-value-must-not-have-spaces",l.StringValueMustNotHaveDashes="string-value-must-not-have-dashes",l.MustBeUniqueAmongSameEntities="must-be-unique-among-same-entities",l))(Hs||{});function hT(l,u){const i=[],n=u;if(!n)return{errors:i,override:u};if(typeof n!="string")return{errors:[],override:u};if(n.includes(" ")){const s=new Ct({id:l.id+"--string-value-must-not-have-spaces",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value cannot contain spaces.`,severity:Ie.Error,code:"string-value-must-not-have-spaces",entity:l});i.push(s)}return{errors:i,override:n.replace(/\s/g,"-")}}function Att(l,u){const i=[],n=u;if(!n)return{errors:i,override:u};if(typeof n!="string")return{errors:[],override:u};if(n.includes(" ")){const s=new Ct({id:l.id+"--string-value-must-not-have-spaces",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ie.Error,code:"string-value-must-not-have-spaces",entity:l});i.push(s)}if(n.includes("-")){const s=new Ct({id:l.id+"--string-value-must-not-have-dashes",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value cannot contain spaces or dashes.`,severity:Ie.Error,code:"string-value-must-not-have-dashes",entity:l});i.push(s)}return{errors:i,override:n.replace(/\s|-/g,"_")}}var zp=(l=>(l.StatusCodeMustBeNumber="status-code-must-be-number",l.StatusCodeMustBeBetween100And599="status-code-must-be-between-100-and-599",l))(zp||{}),Rtt=(l=>(l.PathMustStartWithSlash="path-must-start-with-slash",l.PathContainsInvalidCharacters="path-contains-invalid-characters",l.PathUnclosedCurlyBracket="path-unclosed-curly-bracket",l.PathUnopenedCurlyBracket="path-unopened-curly-bracket",l.PathEmptyCurlyBrackets="path-empty-curly-brackets",l.PathConflictsWithExistingEndpoint="path-conflicts-with-existing-endpoint",l))(Rtt||{});function uN(l,u){if(!l||!u)return!1;if(l===u)return!0;const i=l.split("/").filter(Boolean),n=u.split("/").filter(Boolean);if(i.length!==n.length)return!1;for(let s=0;s<i.length;s++){const c=i[s],e=n[s],f=c.startsWith("{")&&c.endsWith("}"),h=e.startsWith("{")&&e.endsWith("}");if(!(f&&h)&&c!==e)return!1}return!0}function Dtt(l,u){const i=[];if(typeof u!="number"){const n=new Ct({id:l.id+"--status-code-must-be-number",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be a number.`,severity:Ie.Error,code:"status-code-must-be-number",entity:l});return i.push(n),{errors:i,override:u}}if(u<100||u>599){const n=new Ct({id:l.id+"--status-code-must-be-between-100-and-599",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be a number between 100 and 599.`,severity:Ie.Error,code:"status-code-must-be-between-100-and-599",entity:l});i.push(n)}return{errors:i,override:u}}class Ctt extends jo{constructor(i){var f,h;super(_o,i);C(this,"initialData");C(this,"id",De.HTTP_ENDPOINT);C(this,"version","1");C(this,"name",De.HTTP_ENDPOINT);C(this,"description",_o.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",_o.abstract);C(this,"static",_o.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=_o,this.project=i,this.id=_o.id,this.version=_o.version,this.name=_o.name,this.static=_o.static,this.abstract=_o.abstract,this.properties=this.initialData.properties.map(m=>{const T=Ve(m,this.project);return T.setParent(this,null),T.initChildren(null),T}),this.methods=this.initialData.methods.map(m=>{const T=Ve(m,this.project);return T.parent=this,T}),this.abstractMethods=this.initialData.abstractMethods.map(m=>{const T=Ve(m,this.project);return T.parent=this,T}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id);if(!n)throw new Error("Path property not found in endpoint entity");n._codeNativeValueValidation=(m,T)=>{var $;const g=hT(m,T);let b=typeof g.override=="string"?g.override:"";if(b&&!b.startsWith("/")&&(b="/"+b),typeof b=="string"){if(/[^a-zA-Z0-9\-_/{}]/g.test(b)){const q=new Ct({id:m.id+"--path-contains-invalid-characters",message:`Path "${b}" contains invalid characters. Only alphanumeric, -, _, /, and {} are allowed.`,severity:Ie.Error,code:"path-contains-invalid-characters",entity:m});g.errors.push(q)}let L=!1,K="";for(let q=0;q<b.length;q++){const W=b[q];if(W==="{")L=!0,K+=W;else if(W==="}"){if(!L){const Z=new Ct({id:m.id+"--path-unopened-curly-bracket",message:`Path "${b}" has a closed curly bracket '}' without an opening bracket '{'.`,severity:Ie.Error,code:"path-unopened-curly-bracket",entity:m});g.errors.push(Z)}L=!1,K+=W}else K+=L?W:W.toLowerCase()}if(b=K,L){const q=new Ct({id:m.id+"--path-unclosed-curly-bracket",message:`Path "${b}" has an unclosed curly bracket '{'.`,severity:Ie.Error,code:"path-unclosed-curly-bracket",entity:m});g.errors.push(q)}if(b.includes("{}")){const q=new Ct({id:m.id+"--path-empty-curly-brackets",message:`Path "${b}" has empty curly brackets '{}'. Path parameters must have a name.`,severity:Ie.Error,code:"path-empty-curly-brackets",entity:m});g.errors.push(q)}}g.override=b;const R=m.parent,I=R.properties.find(x=>x.implements.find(L=>L.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id)),D=($=I==null?void 0:I.getDefaultValue())==null?void 0:$.value;if(m.project.entities.filter(x=>Hi(x,De.HTTP_ENDPOINT)&&x.id!==R.id).some(x=>{var q,W;const L=x.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));if(((q=L==null?void 0:L.getDefaultValue())==null?void 0:q.value)!==D)return!1;const K=x.properties.find(Z=>Z.implements.find(X=>X.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!K)throw new Error(`"Path" property not found in endpoint entity "${x.name}" (${x.id})`);return uN((W=K.getDefaultValue())==null?void 0:W.value,b)})){const x=new Ct({id:m.id+"--path-conflicts-with-existing-endpoint",message:`Path "${b}" conflicts with another endpoint using the ${D} method.`,severity:Ie.Error,code:"path-conflicts-with-existing-endpoint",entity:m});g.errors.push(x)}return g};const s=this.properties.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id);s&&(s._codeNativeValueValidation=(m,T)=>{var N;const g={errors:[],override:T},b=m.parent,R=b.properties.find($=>$.implements.find(x=>x.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id)),I=(N=R==null?void 0:R.getDefaultValue())==null?void 0:N.value;if(m.project.entities.filter($=>Hi($,De.HTTP_ENDPOINT)&&$.id!==b.id).some($=>{var K,q;const x=$.properties.find(W=>W.implements.find(Z=>Z.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.path.id));if(!uN((K=x==null?void 0:x.getDefaultValue())==null?void 0:K.value,I))return!1;const L=$.properties.find(W=>W.implements.find(Z=>Z.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.properties.method.id));return((q=L==null?void 0:L.getDefaultValue())==null?void 0:q.value)===T})){const $=new Ct({id:m.id+"--"+Hs.MustBeUniqueAmongSameEntities,message:`Method "${T}" cannot be used because another endpoint is already using the ${T} method on path "${I}".`,severity:Ie.Error,code:Hs.MustBeUniqueAmongSameEntities,entity:m});g.errors.push($)}return g});const c=this.abstractMethods.find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.id);if(!c)throw new Error("Handler method not found in endpoint entity");const e=(((h=(f=c.dataType)==null?void 0:f.entity)==null?void 0:h.properties)||[]).find(m=>m.id===B["built-in-base-entity"].BUILT_IN_HTTP_ENDPOINT_ENTITY.methods.handler.dataType.entity.properties.statusCode.id);if(!e)throw new Error("Status code output not found in handler method");e._codeNativeValueValidation=(m,T)=>Dtt(m,T)}}var XE=(l=>(l.InvalidCharacters="cron-invalid-characters",l.MustHaveSixFields="cron-must-have-six-fields",l.DayOfMonthAndWeekConflict="cron-day-of-month-and-week-conflict",l))(XE||{});function wtt(l,u){const i=[];let n=u;if(typeof u!="string"){const e=new Ct({id:l.id+"--"+Hs.ValueMustBeString,message:`Entity of type ${l.type} with id "${l.id}" has an invalid value. The cron expression must be a string.`,severity:Ie.Error,code:Hs.ValueMustBeString,entity:l});return i.push(e),{errors:i,override:""}}n=u.trimStart().replace(/\s{2,}/g," ");const s=/[^0-9A-Z *?\-/,LW#]/g;if(s.test(n)){const e=Array.from(new Set(n.match(s)));i.push(new Ct({id:l.id+"--cron-invalid-characters",message:`Cron expression contains invalid characters: "${e.join(", ")}". Only alphanumeric characters and (* ? - / , L W #) are allowed.`,severity:Ie.Error,code:"cron-invalid-characters",entity:l})),n=n.replace(s,"")}const c=n.split(" ").filter(Boolean);if(c.length!==6)i.push(new Ct({id:l.id+"--cron-must-have-six-fields",message:`Elyx Cron expressions must have exactly 6 fields separated by spaces (Minutes, Hours, Day-of-month, Month, Day-of-week, Year). Currently has ${c.length}.`,severity:Ie.Error,code:"cron-must-have-six-fields",entity:l}));else{const e=c[2],f=c[4];e!=="?"&&f!=="?"&&(i.push(new Ct({id:l.id+"--cron-day-of-month-and-week-conflict",message:"Elyx restricts defining both Day-of-month and Day-of-week simultaneously. If you specify one, the other must be '?'",severity:Ie.Error,code:"cron-day-of-month-and-week-conflict",entity:l})),e==="*"&&f==="*"&&(c[4]="?",n=c.join(" ")))}return{errors:i,override:n}}class Ott extends jo{constructor(i){super(dd,i);C(this,"initialData");C(this,"id",De.CRON_JOB);C(this,"version","1");C(this,"name",De.CRON_JOB);C(this,"description",dd.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",dd.abstract);C(this,"static",dd.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=dd,this.project=i,this.id=dd.id,this.version=dd.version,this.name=dd.name,this.static=dd.static,this.abstract=dd.abstract,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(s=>s.id===B["built-in-base-entity"].BUILT_IN_CRON_JOB_ENTITY.properties.expression.id);if(!n)throw new Error("Expression property not found in cron job entity");n._codeNativeValueValidation=(s,c)=>wtt(s,c)}}class Ptt extends jo{constructor(i){super(Ks,i);C(this,"initialData");C(this,"id",De.RELATIONAL_DATABASE);C(this,"version","1");C(this,"name",De.RELATIONAL_DATABASE);C(this,"description",Ks.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",Ks.abstract);C(this,"static",Ks.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=Ks,this.project=i,this.id=Ks.id,this.version=Ks.version,this.name=Ks.name,this.static=Ks.static,this.abstract=Ks.abstract,this.properties=this.initialData.properties.map(c=>{const e=Ve(c,this.project);return e.setParent(this,null),e.initChildren(null),e}),this.methods=this.initialData.methods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.abstractMethods=this.initialData.abstractMethods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(c=>c.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.identifier.id);if(!n)throw new Error("Path property not found in endpoint entity");n._codeNativeValueValidation=(c,e)=>Att(c,e);const s=this.properties.find(c=>c.id===B["built-in-base-entity"].BUILT_IN_RELATIONAL_DATABASE_ENTITY.properties.minSize.id);s&&(s._codeNativeValueValidation=(c,e)=>{const f={errors:[],override:e};if(typeof e=="number"){if(e<6){const h=new Ct({id:c.id+"--"+we.RelationalDatabaseMinSizeTooSmall,message:"Minimum GB size cannot be less than 6.",severity:Ie.Error,code:we.RelationalDatabaseMinSizeTooSmall,entity:c});f.errors.push(h)}else if(e>65536){const h=new Ct({id:c.id+"--"+we.RelationalDatabaseMinSizeTooLarge,message:"Minimum GB size cannot be greater than 65536.",severity:Ie.Error,code:we.RelationalDatabaseMinSizeTooLarge,entity:c});f.errors.push(h)}}else if(e!==void 0){const h=new Ct({id:c.id+"--"+we.RelationalDatabaseMinSizeMustBeNumber,message:"Minimum GB size must be a number.",severity:Ie.Error,code:we.RelationalDatabaseMinSizeMustBeNumber,entity:c});f.errors.push(h)}return f})}}var xtt=(l=>(l.InvalidCharacters="compute-name-invalid-characters",l.TooLong="compute-name-too-long",l.Empty="compute-name-empty",l))(xtt||{});class Vtt extends jo{constructor(i){super(ud,i);C(this,"initialData");C(this,"id",De.COMPUTE_ENTITY);C(this,"version","1");C(this,"name",De.COMPUTE_ENTITY);C(this,"description",ud.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",ud.abstract);C(this,"static",ud.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=ud,this.project=i,this.id=ud.id,this.version=ud.version,this.name=ud.name,this.static=ud.static,this.abstract=ud.abstract,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(s=>s.id===B["built-in-base-entity"][De.COMPUTE_ENTITY].properties.computeName.id);n&&(n._codeNativeValueValidation=(s,c)=>{const e={errors:[],override:c};if(typeof c!="string"||!c){const h=new Ct({id:s.id+"--compute-name-empty",message:"Compute name cannot be empty.",severity:Ie.Error,code:"compute-name-empty",entity:s});return e.errors.push(h),e}if(c.length>255){const h=new Ct({id:s.id+"--compute-name-too-long",message:"Compute name must be 255 characters or fewer.",severity:Ie.Error,code:"compute-name-too-long",entity:s});e.errors.push(h)}if(/[^a-zA-Z0-9\-_]/g.test(c)){const h=new Ct({id:s.id+"--compute-name-invalid-characters",message:`Compute name "${c}" contains invalid characters. Only alphanumeric characters, hyphens (-), and underscores (_) are allowed.`,severity:Ie.Error,code:"compute-name-invalid-characters",entity:s});e.errors.push(h)}return e.errors.length||this.project.entities.filter(m=>Hi(m,De.COMPUTE_ENTITY)&&m.id!==this.id).forEach(m=>{var g;const T=m.properties.find(b=>b.implements.some(R=>R.id===B[r.BuiltInBaseEntity][De.COMPUTE_ENTITY].properties.computeName.id));if(T&&(T==null?void 0:T.id)!==s.id&&((g=T.defaultValue)==null?void 0:g.value)===c){const b=new Ct({id:s.id+"--"+we.ComputeNameNotUnique,message:`Compute name "${c}" is duplicated.`,severity:Ie.Error,code:we.ComputeNameNotUnique,entity:s});e.errors.push(b)}}),e})}}var _tt=(l=>(l.InvalidImageUri="container-compute-invalid-image-uri",l.InvalidMinTasks="container-compute-invalid-min-tasks",l.InvalidMaxTasks="container-compute-invalid-max-tasks",l.MaxTasksLessThanMinTasks="container-compute-max-less-than-min",l.InvalidEphemeralStorage="container-compute-invalid-ephemeral-storage",l))(_tt||{});class Ntt extends jo{constructor(i){super(pd,i);C(this,"initialData");C(this,"id",De.CONTAINER_COMPUTE_ENTITY);C(this,"version","1");C(this,"name",De.CONTAINER_COMPUTE_ENTITY);C(this,"description",pd.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",pd.abstract);C(this,"static",pd.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=pd,this.project=i,this.id=pd.id,this.version=pd.version,this.name=pd.name,this.static=pd.static,this.abstract=pd.abstract,this.properties=this.initialData.properties.map(f=>{const h=Ve(f,this.project);return h.setParent(this,null),h.initChildren(null),h}),this.methods=this.initialData.methods.map(f=>{const h=Ve(f,this.project);return h.parent=this,h}),this.abstractMethods=this.initialData.abstractMethods.map(f=>{const h=Ve(f,this.project);return h.parent=this,h}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(f=>f.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.imageUri.id);n&&(n._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="string"||!h)return m;if(/\s/.test(h)){const T=new Ct({id:f.id+"--container-compute-invalid-image-uri",message:`Image URI "${h}" contains spaces, which is invalid.`,severity:Ie.Error,code:"container-compute-invalid-image-uri",entity:f});m.errors.push(T)}return m});const s=this.properties.find(f=>f.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id);s&&(s._codeNativeValueValidation=(f,h)=>{var R;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<0){const I=new Ct({id:f.id+"--container-compute-invalid-min-tasks",message:"Minimum Tasks must be 0 or greater.",severity:Ie.Error,code:"container-compute-invalid-min-tasks",entity:f});m.errors.push(I)}const g=f.parent.properties.find(I=>I.implements.find(D=>D.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id)),b=(R=g==null?void 0:g.getDefaultValue())==null?void 0:R.value;if(typeof b=="number"&&h>b){const I=new Ct({id:f.id+"--container-compute-max-less-than-min",message:`Minimum Tasks (${h}) cannot be greater than Maximum Tasks (${b}).`,severity:Ie.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(I)}return m});const c=this.properties.find(f=>f.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.maxTasks.id);c&&(c._codeNativeValueValidation=(f,h)=>{var R;const m={errors:[],override:h};if(typeof h!="number")return m;if(h<1){const I=new Ct({id:f.id+"--container-compute-invalid-max-tasks",message:"Maximum Tasks must be 1 or greater.",severity:Ie.Error,code:"container-compute-invalid-max-tasks",entity:f});m.errors.push(I)}const g=f.parent.properties.find(I=>I.implements.find(D=>D.id===B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.minTasks.id)),b=(R=g==null?void 0:g.getDefaultValue())==null?void 0:R.value;if(typeof b=="number"&&h<b){const I=new Ct({id:f.id+"--container-compute-max-less-than-min",message:`Maximum Tasks (${h}) cannot be less than Minimum Tasks (${b}).`,severity:Ie.Error,code:"container-compute-max-less-than-min",entity:f});m.errors.push(I)}return m});const e=this.properties.find(f=>{var h;return f.id===((h=B["built-in-base-entity"][De.CONTAINER_COMPUTE_ENTITY].properties.ephemeralStorage)==null?void 0:h.id)});e&&(e._codeNativeValueValidation=(f,h)=>{const m={errors:[],override:h};if(typeof h!="number")return m;if(h<20||h>200){const T=new Ct({id:f.id+"--container-compute-invalid-ephemeral-storage",message:"Ephemeral Storage must be between 20 and 200 GB.",severity:Ie.Error,code:"container-compute-invalid-ephemeral-storage",entity:f});m.errors.push(T)}return m})}}var $tt=(l=>(l.PathContainsInvalidCharacters="shared-drive-mount-path-invalid-characters",l.PathIsSystemFolder="shared-drive-mount-path-is-system-folder",l.PathInvalidFormat="shared-drive-mount-path-invalid-format",l))($tt||{});class Ltt extends jo{constructor(i){super(No,i);C(this,"initialData");C(this,"id",De.SHARED_DRIVE_MOUNT_ENTITY);C(this,"version","1");C(this,"name",De.SHARED_DRIVE_MOUNT_ENTITY);C(this,"description",No.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",No.abstract);C(this,"static",No.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=No,this.project=i,this.id=No.id,this.version=No.version,this.name=No.name,this.static=No.static,this.abstract=No.abstract,this.properties=this.initialData.properties.map(s=>{const c=Ve(s,this.project);return c.setParent(this,null),c.initChildren(null),c}),this.methods=this.initialData.methods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.abstractMethods=this.initialData.abstractMethods.map(s=>{const c=Ve(s,this.project);return c.parent=this,c}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(s=>s.id===B["built-in-base-entity"][De.SHARED_DRIVE_MOUNT_ENTITY].properties.path.id);if(!n)throw new Error("Path property not found in shared drive mount entity");n._codeNativeValueValidation=(s,c)=>{const e=hT(s,c);let f=typeof e.override=="string"?e.override:"";if(f&&!f.startsWith("/")&&(f="/"+f),typeof f=="string"){if(/[^a-zA-Z0-9\-_/]/g.test(f)){const T=new Ct({id:s.id+"--shared-drive-mount-path-invalid-characters",message:`Mount path "${f}" contains invalid characters. Only alphanumeric, -, _, and / are allowed.`,severity:Ie.Error,code:"shared-drive-mount-path-invalid-characters",entity:s});e.errors.push(T)}const m=["/bin","/boot","/dev","/etc","/lib","/lib64","/proc","/sys","/usr","/sbin","/run","/var/run"];for(const T of m)if(f===T||f.startsWith(T+"/")){const g=new Ct({id:s.id+"--shared-drive-mount-path-is-system-folder",message:`Mounting to or within critical system folder "${T}" is not allowed.`,severity:Ie.Error,code:"shared-drive-mount-path-is-system-folder",entity:s});e.errors.push(g);break}}return e.override=f,e}}}var Gtt=(l=>(l.DocumentCannotStartWithSlash="document-cannot-start-with-slash",l.DocumentContainsInvalidCharacters="document-contains-invalid-characters",l))(Gtt||{});class Btt extends jo{constructor(i){super(xr,i);C(this,"initialData");C(this,"id",De.CLOUD_FILE_SYSTEM_BUCKET);C(this,"version","1");C(this,"name",De.CLOUD_FILE_SYSTEM_BUCKET);C(this,"description",xr.description);C(this,"type",r.BuiltInBaseEntity);C(this,"abstract",xr.abstract);C(this,"static",xr.static);C(this,"properties",[]);C(this,"methods",[]);C(this,"abstractMethods",[]);C(this,"extends",null);C(this,"errors",[]);C(this,"project");this.initialData=xr,this.project=i,this.id=xr.id,this.version=xr.version,this.name=xr.name,this.static=xr.static,this.abstract=xr.abstract,this.properties=this.initialData.properties.map(c=>{const e=Ve(c,this.project);return e.setParent(this,null),e.initChildren(null),e}),this.methods=this.initialData.methods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.abstractMethods=this.initialData.abstractMethods.map(c=>{const e=Ve(c,this.project);return e.parent=this,e}),this.initialData.extends&&(this.extends=Ve(this.initialData.extends,this.project));const n=this.properties.find(c=>{var e;return c.id===((e=B["built-in-base-entity"].BUILT_IN_CLOUD_FILE_SYSTEM_BUCKET_ENTITY.properties.indexDocument)==null?void 0:e.id)});n&&(n._codeNativeValueValidation=(c,e)=>{const f=hT(c,e);let h=typeof f.override=="string"?f.override:"";if(typeof h=="string"&&h.startsWith("/")){const m=new Ct({id:c.id+"--document-cannot-start-with-slash",message:`Document "${h}" cannot start with a slash. It must be a relative path.`,severity:Ie.Error,code:"document-cannot-start-with-slash",entity:c});f.errors.push(m)}return f});const s=this.properties.find(c=>{var e;return c.id===((e=B["built-in-base-entity"].BUILT_IN_CLOUD_FILE_SYSTEM_BUCKET_ENTITY.properties.errorDocument)==null?void 0:e.id)});s&&(s._codeNativeValueValidation=(c,e)=>{const f=hT(c,e);let h=typeof f.override=="string"?f.override:"";if(typeof h=="string"&&h.startsWith("/")){const m=new Ct({id:c.id+"--document-cannot-start-with-slash",message:`Document "${h}" cannot start with a slash. It must be a relative path.`,severity:Ie.Error,code:"document-cannot-start-with-slash",entity:c});f.errors.push(m)}return f})}}class Mtt extends Yn{constructor(i){super(bl,i);C(this,"id",bl.id);C(this,"name",bl.name);C(this,"description",bl.description);C(this,"version",bl.version);C(this,"autoexecutable",!1);C(this,"type",r.ActionDescriptor);C(this,"inputs",[]);C(this,"dataType",null);C(this,"error",null);C(this,"project");this.project=i,this.inputs=bl.inputs.map(n=>{const s=Ve(n,this.project);return s.setParent(this,null),s.initChildren(null),s}),this.dataType=Ve(bl.dataType,this.project),this.dataType.setParent(this,null),this.dataType.initChildren(null),this.error=bl.error?Ve(bl.error,this.project):null}}var Fo=(l=>(l.UUIDMustBeString="uuid-must-be-string",l.UUIDMustBeValidFormat="uuid-must-be-valid-format",l.UUIDMustNotContainSpaces="uuid-must-not-contain-spaces",l))(Fo||{});function mXi(l,u){const i=[];if(typeof u!="string"){const s=new Ct({id:l.id+"--uuid-must-be-string",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be text.`,severity:Ie.Error,code:"uuid-must-be-string",entity:l});return i.push(s),{errors:i,override:u}}const n=hT(l,u);if(n.errors.length>0)return i.push(...n.errors),{errors:i,override:u};if(!B2(u)){const s=new Ct({id:l.id+"--uuid-must-be-valid-format",message:`Entity of type ${l.type} with id "${l.id}" has an invalid value "${u}". The value must be a valid UUID format. Eg: "123e4567-e89b-12d3-a456-426614174000".`,severity:Ie.Error,code:"uuid-must-be-valid-format",entity:l});i.push(s)}return{errors:i,override:u}}var Ye=(l=>(l.Inherited="inherited",l.DefaultValue="default-value",l.Missing="missing",l.Undefined="undefined",l.Empty="empty",l.AutoCalculated="auto-calculated",l.QueuedAutocalculation="queued-autocalculation",l.External="external",l.Testing="testing",l.ExecutionResult="execution-result",l))(Ye||{});const Ftt={initialized:!1,id:"",project:null,values:{},onWriteCallback:()=>{},onRemoveCallback:()=>{},onWrite:()=>{},onRemove:()=>{},init:()=>{},toJSON:()=>({}),writeValue:()=>{},readValue:()=>null,removeValue:()=>{},clear:()=>{}};function SE(l,u){return{...Ftt,id:l,project:u}}class kE{constructor(u,i){C(this,"initialized",!1);C(this,"id");C(this,"project");C(this,"values",{});C(this,"onWriteCallback",()=>{});C(this,"onRemoveCallback",()=>{});this.id=u,this.project=i,this.init()}onWrite(u){this.onWriteCallback=u}onRemove(u){this.onRemoveCallback=u}init(){var n;if(!((n=this.project)!=null&&n.id)||this.initialized)return;const u={},i={};Object.keys(u).forEach(s=>{const c=u[s],e=new ua(c,this.project);try{if(c.parent){const m=this.project.findSubscribedInstanceFromReference(c.parent);if(!m)return;e.setParent(m,null),e.hydrateAncestors(),e.initChildren(null)}else if(c.standaloneParent){const m=this.project.findSubscribedInstanceFromReference(c.standaloneParent);if(!m)return;e.standalone=!0,e.setStandaloneParent(m,null),e.hydrateAncestors(),e.initChildren(null)}i[s]=e;const f=e.parent||e.standaloneParent,h=iit(e,f,this.project);h?i[s]=h:delete u[s]}catch(f){oe.Logger.error("Error hydrating ancestors: ",f),delete u[s]}}),this.values={...this.values,...i},this.initialized=!0}toJSON(){const u={};return Object.keys(this.values).forEach(i=>{u[i]=this.values[i].toJSON()}),u}writeValue(u,i){if(!u)throw new Error("The value owner entity is required when writing a value to a value store");let s=this.values[u.id];if(!s)if(i instanceof ua)s=i;else if(i)s=Cr(i,this.project);else{const c={id:M.UUID.uuid(),version:M.UUID.uuid(),createdAt:new Date().toISOString(),author:M.sessionAuthor,deleted:!1,previousVersion:null,value:null,deletable:!0,editable:!0,type:r.LiteralValue,standaloneParent:u.toReference(),parent:null,valueAsTypeSingle:null,valueAsTypeList:null,autogeneration:null,name:Bc(u.getDataType(null))};s=Cr(c,this.project)}s.standalone=!0,s.initialData.standaloneParent||oe.Logger.warn("instance.initialData: ",s.initialData),s.setStandaloneParent(u,null),s.hydrateAncestors(),s.initChildren(null),i&&(s.metaSync({...i},null),s.setValueAsType(i.valueAsType,null)),this.values[u.id]=s,this.onWriteCallback(u,s)}readValue(u){return this.values[u]||null}removeValue(u){if(!this.values[u])return;delete this.values[u];const i=this.project.get(u);i&&this.onRemoveCallback(i)}clear(){this.values={}}}function va(l){return l!==null&&typeof l=="object"&&!Array.isArray(l)}function z2(l){if(Array.isArray(l))return l.map(h=>typeof h=="number"?h:e(h)?Number(h):String(h));const u=[];let i=0,n="",s=!1,c=null;for(;i<l.length;){const h=l[i];if(h==="."&&!s){n.length&&(u.push(f(n)),n=""),i++;continue}if(h==="["&&!s){n.length&&(u.push(f(n)),n=""),s=!0,i++;continue}if(s){if(!c&&(h==='"'||h==="'")){c=h,i++;continue}if(c){if(h==="\\"&&i+1<l.length){n+=l[i+1],i+=2;continue}if(h===c){c=null,i++;continue}n+=h,i++;continue}if(h==="]"){u.push(f(n)),n="",s=!1,i++;continue}if(/\s/.test(h)&&!c){i++;continue}n+=h,i++;continue}n+=h,i++}return n.length&&u.push(f(n)),u;function e(h){return/^[0-9]+$/.test(h)}function f(h){const m=h.trim();return e(m)?Number(m):m}}function Ww(l,u,i){if(l==null)return i;const n=z2(u);let s=l;for(let c=0;c<n.length;c++){const e=n[c];if(s==null)return i;if(Array.isArray(s)&&typeof e=="number"){if(!(e in s))return i;s=s[e]}else{if(!Object.prototype.hasOwnProperty.call(s,e))return i;s=s[e]}}return s}const TXi=new Set(["__proto__","prototype","constructor"]);function Stt(l){return typeof l=="string"&&TXi.has(l)}function vXi(l,u,i,n){const{createMissing:s=!0,coerce:c=!0}=n??{};if(l==null||typeof l!="object")throw new TypeError("set(...) expects a non-null object as target.");const e=z2(u);if(e.length===0)throw new Error("set(...) path must not be empty.");let f=l;for(let h=0;h<e.length;h++){const m=e[h];if(Stt(m))throw new Error(`Refusing to set unsafe key "${String(m)}" on object.`);const T=h===e.length-1,b=typeof e[h+1]=="number",R=Array.isArray(f)&&typeof m=="number";if(T){if(R&&f[m]==null&&!s)throw new Error(`set(...) missing array index "${String(m)}" (createMissing=false).`);return f[m]=i,l}else{if(!Object.prototype.hasOwnProperty.call(f,m)||f[m]==null){if(!s)throw new Error(`set(...) missing parent at segment "${String(m)}" (createMissing=false).`);f[m]=b?[]:{}}else{const I=f[m],D=I!==null&&typeof I=="object",N=Array.isArray(I);if(b){if(!N){if(!c)throw new Error(`set(...) expected an array at "${String(m)}" but found non-array (coerce=false).`);f[m]=[]}}else if(!D||N){if(!c)throw new Error(`set(...) expected an object at "${String(m)}" but found non-object (coerce=false).`);f[m]={}}}f=f[m]}}return l}function Y2(l,u,i,n){const s=z2(u);if(s.length===0)return l;function c(e,f){const h=s[f],m=f===s.length-1;if(n==="strict-set"||n==="strict-delete"){if(Stt(h))throw new Error(`Unsafe key "${String(h)}"`);if(e==null||typeof e!="object"&&!Array.isArray(e))throw new Error(`Missing parent or invalid container at segment "${String(h)}".`);if(n==="strict-delete"&&m&&!(h in e))return e}let T;if(Array.isArray(e))T=[...e];else if(e&&typeof e=="object")T={...e};else if(n==="safe-set")T=typeof h=="number"?[]:{};else throw new Error(`Cannot traverse path at "${String(h)}"`);if(m)return n==="strict-delete"?delete T[h]:T[h]=i,T;const g=e?e[h]:void 0;if(n==="safe-set"&&g==null){const b=typeof s[f+1]=="number",R=c(b?[]:{},f+1);return T[h]=R,T}return T[h]=c(g,f+1),T}if(l==null&&n==="safe-set"){const e=typeof s[0]=="number";return c(e?[]:{},0)}return c(l,0)}const wK=Symbol("missing"),gXi=l=>l!=null&&typeof l=="object";function zw(l,u){if(typeof l!="string")throw new TypeError(`${u} expects the key to be a string.`);return l}function xv(l,u){if(typeof l!="string"&&!Array.isArray(l))throw new TypeError(`${u} expects the path to be string or array.`);return l}function H0(l,u){if(!va(l))throw new TypeError(`${u} expects the first argument to be an object.`);return l??{}}function ktt(l,u){const i=zw(u,"ReadKey");return(l??{})[i]}function Utt(l,u,i){const n=zw(u,"WriteKey");if(l&&typeof l=="object"){const s=Array.isArray(l)?[...l]:{...l};return s[n]=i,s}return{[n]:i}}function jtt(l,u){if(!l||typeof l!="object")return{};const i=String(u),{[i]:n,...s}=l;return s}function Ktt(l,u,i){const n=H0(l,"ReadNestedKey"),s=xv(u,"ReadNestedKey");return Ww(n,s,i)}function qtt(l,u,i){const n=H0(l,"WriteNestedKey"),s=xv(u,"WriteNestedKey");return Y2(n,s,i,"strict-set")}function Ztt(l,u,i){const n=H0(l,"WriteSafeNestedKeyRecursively"),s=xv(u,"WriteSafeNestedKeyRecursively");return Y2(n,s,i,"safe-set")}function Htt(l,u){const i=H0(l,"DeleteNestedKey"),n=xv(u,"DeleteNestedKey");return Y2(i,n,null,"strict-delete")}function Wtt(l,u){const i=zw(u,"HasKey"),n=l;return n!=null&&gXi(n)&&Object.prototype.hasOwnProperty.call(n,i)}function ztt(l,u,i){const n=zw(u,"KeyValueEquals");return l==null||typeof l!="object"?!1:l[n]===i}function Ytt(l,u){const i=l,n=xv(u,"HasNestedKey");return Ww(i,n,wK)!==wK}function Jtt(l,u,i){const n=xv(u,"NestedKeyValueEquals");return Ww(l,n)===i}function Qtt(...l){const u={};for(let i=0;i<l.length;i++){const n=l[i];if(n!=null){if(!va(n))throw new TypeError("MergeObjects expects every argument to be an object (or null/undefined).");Object.assign(u,n)}}return u}function Xtt(l){const u=H0(l,"ObjectKeys");return Object.keys(u)}function eit(l){const u=H0(l,"ObjectValues");return Object.values(u)}function tit(l){const u=H0(l,"ObjectEntries");return Object.entries(u)}const nT=new Set;function EXi(l){return{execution:null,project:l,localTestValues:SE("local-test-values",l),resolvedValues:SE("resolved-values",l),persistedExecutionResults:SE("persisted-execution-results",l),lastExecutionResults:SE("last-execution-results",l),getValueTypePreference:()=>null,setValueTypePreference:()=>{}}}function Vv(l,u,i,n){var f;let s;if(((f=l==null?void 0:l.entity)==null?void 0:f.type)===r.PrimitiveEntity)switch(l.entity.name){case ce.EntityTemplate:s=ce.EntityTemplate;break;case ce.String:s=ce.String;break;case ce.Number:s=ce.Number;break;case ce.Boolean:s=ce.Boolean;break;case ce.Null:s=ce.Null;break;case ce.Enum:s=ce.Enum;break;case ce.KeyValue:s=ce.KeyValue;break;case ce.Untyped:s=ce.Untyped;break;case ce.KeyValue:s=ce.KeyValue;break;case ce.Date:s=ce.Date;break;case ce.UUID:s=ce.UUID;break;case ce.FileReference:s=ce.FileReference;break;case ce.Void:s=ce.Void;break;case ce.ActionDescriptor:s=ce.ActionDescriptor;break;case ce.Bytes:s=ce.Bytes;break;case ce.SqlProgram:s=ce.SqlProgram;break;default:throw new Error(`Primitive type ${He(l.entity,i)} is not supported`)}else s=ce.Untyped;const c=ua.new(n);c.name=s,c.parent=u.toReference();const e=Ve(c,i);return e.hydrateAncestors(),n==null||n.add(e,se.Added),e.addSelfToProject(n),e.initChildren(n),e}function kp(l,u,i=new Set){var n,s,c,e;if(i.has(l.id))return[];if(i.add(l.id),Ni.includes(l.type)){const f=la(l);return V([f,...[f].flatMap(h=>kp(h,u,i))])}else if(l.type===r.OutputMap){if(Ni.includes(l.parent.type)&&((n=l.declaration)==null?void 0:n.type)===r.Property&&l.declaration.static)return V([l,l.declaration,...[l,l.declaration].flatMap(f=>kp(f,u,i))])}else if(l.type===r.InputMap){if(Ni.includes(l.parent.type)&&((s=l.declaration)==null?void 0:s.type)===r.Property&&((c=l.declaration)!=null&&c.static))return V([l.declaration,...[l.declaration].flatMap(f=>kp(f,u,i))])}else if(l.type===r.ValueDescriptor&&((e=l.parent)==null?void 0:e.type)===r.Search){const f=l.parent.inputs.find(h=>{var m;return((m=h.declaration)==null?void 0:m.id)===l.id});if(f)return[f]}return[l]}function iit(l,u,i){return l}function _v(l,u,i=!1){const n=l.readsValue;let s=null;const c=jc(n,u,i);if(c){const e={sources:[c],target:l};s={value:c.value,valueOwner:l,type:Ye.Inherited,inheritanceLink:e}}else s={value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null};return s}function ln(l,u,i){var f;if(!u)return null;let n;if(((f=l==null?void 0:l.entity)==null?void 0:f.type)===r.PrimitiveEntity)switch(l.entity.name){case ce.EntityTemplate:n=ce.EntityTemplate;break;case ce.String:n=ce.String;break;case ce.Number:n=ce.Number;break;case ce.Boolean:n=ce.Boolean;break;case ce.Null:n=ce.Null;break;case ce.Enum:n=ce.Enum;break;case ce.KeyValue:n=ce.KeyValue;break;case ce.Untyped:n=ce.Untyped;break;case ce.KeyValue:n=ce.KeyValue;break;case ce.Date:n=ce.Date;break;case ce.UUID:n=ce.UUID;break;case ce.FileReference:n=ce.FileReference;break;case ce.Void:n=ce.Void;break;case ce.ActionDescriptor:n=ce.ActionDescriptor;break;case ce.Bytes:n=ce.Bytes;break;case ce.SqlProgram:n=ce.SqlProgram;break;case ce.RGB:n=ce.RGB;break;case ce.RGBA:n=ce.RGBA;break;default:throw new Error(`Primitive type ${He(l.entity,i)} is not supported`)}else n=ce.Untyped;if(!i.get(u.id))return null;const c=ua.new(null);c.name=n,c.standaloneParent=u.toReference();let e=new ua(c,i);return e.hydrateAncestors(),e.standalone=!0,e.setStandaloneParent(u,null),e.initChildren(null),e}function nit(l,u,i=!1){var c,e;if(u.execution&&u.execution.hasEntity(l)&&!i){const f=(c=u.lastExecutionResults)==null?void 0:c.readValue(l.id);if(f)return{value:f,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=(e=u.localTestValues)==null?void 0:e.readValue(l.id),s=u.getValueTypePreference(l.id);return n&&!i&&(s===null||s!==Ye.DefaultValue)?{value:n,valueOwner:l,type:Ye.Testing,inheritanceLink:null}:{value:null,valueOwner:l,type:Ye.QueuedAutocalculation,inheritanceLink:null}}function R1(l,u,i,n=!1){var e,f;const s={...l},c=u.type===r.VariableDeclaration?u.inputs:ci.includes(u.type)?u.outputs:[];if(!c||c.length===0)return s;for(const h of c){if(!T0(h))continue;const m=yb(h,i,n);if(m&&m.value)try{const T=Ee(h,i.project),g=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||Dr(T);s[g]=Ds((m==null?void 0:m.value)||null)?s[g]:(f=m==null?void 0:m.value)==null?void 0:f.value}catch{}}return s}function UE(l,u,i,n=!1){var e,f;const s={...l},c=u.inputs;if(!c)return s;for(const h of c){if(!T0(h))continue;const m=FI(h,i,n);if(m&&m.value&&m.type!==Ye.Undefined){const T=He(h,i.project),g=h.codeName||((e=h.declaration)==null?void 0:e.codeName)||Dr(T);s[g]=(f=m==null?void 0:m.value)==null?void 0:f.value}}return s}function rit(l,u,i=!1){var T,g,b,R,I,D,N,$;let n={};if(((g=(T=l.getDataType(null))==null?void 0:T.entity)==null?void 0:g.type)===r.DefinitionEntity&&(n={...n,...((b=l.getDataType(null))==null?void 0:b.entity).getActiveRawDefaultValue()}),u.execution&&u.execution.hasEntity(l)&&!i){const x=(R=u.lastExecutionResults)==null?void 0:R.readValue(l.id);if(x){if(va(x.value)){const K={...n,...x.value},q={...UE(K,l,u,i)};x.metaSync({value:q},null)}return{value:x,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}}const s=!!((I=u.execution)!=null&&I.entities.length),c=(D=u.execution)==null?void 0:D.hasEntity(l),e=l.readsValue;let f=null;if(e){const x=(N=u.execution)==null?void 0:N.hasEntity(e);if((!s||s&&x&&c||s&&!x&&!c)&&(f=_v(l,u,i),f&&f.value&&va(f.value.value))){const K={...n,...f.value.value},q={...UE(K,l,u,i)};f.value.metaSync({value:q},null)}}const h=l.defaultValue,m=u.getValueTypePreference(l.id);if(!f&&h){const x=h;if(x&&x.value===null&&x.autogeneration){const L=WO(x);if(x.metaSync({value:L},null),va(L)){const K={...UE(L,l,u,i)};x.metaSync({value:K},null)}}(i||m===null||m!==Ye.Testing)&&(f={value:x,valueOwner:l,type:Ds(x)?l.readsValue?Ye.Inherited:Ye.Empty:Ye.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ye.DefaultValue||f.type===Ye.External)&&!i||m===Ye.Testing){const x=($=u.localTestValues)==null?void 0:$.readValue(l.id);if(x){if(va(x.value)){const L={...n,...x.value},K={...UE(L,l,u,i)};x.metaSync({value:K},null)}return{value:x,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}}return Ds((f==null?void 0:f.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function J2(l,u,i=!1){var f,h,m,T,g,b,R,I,D,N,$,x,L,K,q,W,Z;let n={};if(((h=(f=l.getDataType(null))==null?void 0:f.entity)==null?void 0:h.type)===r.DefinitionEntity?n={...n,...((m=l.getDataType(null))==null?void 0:m.entity).getActiveRawDefaultValue()}:((g=(T=l.getDataType(null))==null?void 0:T.entity)==null?void 0:g.type)===r.BuiltInBaseEntity&&(n={...n,...((b=l.getDataType(null))==null?void 0:b.entity).getRawDefaultValue()}),u.execution&&u.execution.hasEntity(l)&&!i){const X=(R=u.lastExecutionResults)==null?void 0:R.readValue(l.id);if(X){if(va(X.value)){const z={...n,...X.value},J=R1(z,l,u,i);X==null||X.metaSync({value:J},null)}return{value:X,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}}const s=(I=u.localTestValues)==null?void 0:I.readValue(l.id);let c=!1;if(l.type===r.VariableDeclaration){const X=l,te=!!((D=u.execution)!=null&&D.entities.length),z=(N=u.execution)==null?void 0:N.hasEntity(l),J=X.readsValue;if(J){const Q=($=u.execution)==null?void 0:$.hasEntity(J);c=!te||te&&Q&&z||te&&!Q&&!z}}const e=u.getValueTypePreference(l.id);if(s&&!i&&(!c||e===Ye.Testing)){if(va(s.value)){const te={...n,...s.value},z=R1(te,l,u,i);s.metaSync({value:z},null)}return{value:s,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}if((x=l.getDataType(null))!=null&&x.entity&&(((K=(L=l.getDataType(null))==null?void 0:L.entity)==null?void 0:K.type)===r.DefinitionEntity||((W=(q=l.getDataType(null))==null?void 0:q.entity)==null?void 0:W.type)===r.BuiltInBaseEntity)&&((Z=l.getDataType(null))!=null&&Z.isObject())){const X=ln(l.dataType,l,u.project),te=R1(n,l,u,i);return X==null||X.metaSync({value:te},null),{value:X,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null}}return null}function Yw(l,u,i=!1){var T,g,b,R,I;if((T=l.dataType)!=null&&T.isObject())return rit(l,u,i);const n=Zt(l),s=!!((g=u.execution)!=null&&g.entities.length),c=(b=u.execution)==null?void 0:b.hasEntity(n),e=l.readsValue;let f=null;if(e){const D=(R=u.execution)==null?void 0:R.hasEntity(e);(!s||s&&D&&c||s&&!D&&!c)&&(f=_v(l,u,i))}const h=l.defaultValue,m=u.getValueTypePreference(l.id);if(!f&&h){const D=h;if(D&&D.value===null&&D.autogeneration){const N=WO(D);D.metaSync({value:N},null)}(i||m===null||m!==Ye.Testing)&&(f={value:D,valueOwner:l,type:Ds(D)?l.readsValue?Ye.Inherited:Ye.Empty:Ye.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ye.DefaultValue||f.type===Ye.External)&&!i||m===Ye.Testing){const D=(I=u.localTestValues)==null?void 0:I.readValue(l.id);if(D)return{value:D,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}return Ds((f==null?void 0:f.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function Q2(l,u,i=!1){var s,c;if(u.execution&&u.execution.hasEntity(l)&&!i){const e=(s=u.lastExecutionResults)==null?void 0:s.readValue(l.id);if(e)return{value:e,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}return(c=l.dataType)!=null&&c.isObject()||l.outputs.length?J2(l,u,i):Yw(l,u,i)}function ait(l,u,i=!1){var b,R,I,D;const n=!!((b=u.execution)!=null&&b.entities.length),s=(R=u.execution)==null?void 0:R.hasEntity(l);let c=null;const e=l.readsValue;if(e){const N=(I=u.execution)==null?void 0:I.hasEntity(e);(!n||n&&N&&s||n&&!N&&!s)&&(c=_v(l,u,i))}const f=l.declaration;if(!c&&f){const N=Yw(f,u,i);N&&N.value&&(c=N)}const h=u.getValueTypePreference(l.id);if(!c||(c.type===Ye.DefaultValue||c.type===Ye.External)&&!i||h===Ye.Testing){const N=(D=u.localTestValues)==null?void 0:D.readValue(l.id);if(N)return{value:N,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const m=tf(l),T=l.getDataType(null);return m&&s&&(!(c!=null&&c.value)||!no(T)&&Up(c==null?void 0:c.value))?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:s&&!m&&Ds((c==null?void 0:c.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:c||{value:null,valueOwner:l,type:Ye.External,inheritanceLink:null}}function sit(l,u,i=!1){return Q2(l.declaration,u,i)}function lit(l,u,i=!1){var R,I,D,N;if(!i&&u.execution&&u.execution.hasEntity(l)){const $=(R=u.lastExecutionResults)==null?void 0:R.readValue(l.id);if($)return{value:$,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=!u.execution||!u.execution.parentExecution,s=u.getValueTypePreference(l.id);if(n){const $=(I=u.localTestValues)==null?void 0:I.readValue(l.id);if($&&!i&&(s===null||s!==Ye.DefaultValue))return{value:$,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const c=Zt(l),e=l.parent.type===r.FunctionDeclaration&&l.parent.parent.type===r.Loop?l.parent:null,f=!!((D=u.execution)!=null&&D.hasEntity(c))||!!e&&!!((N=u.execution)!=null&&N.hasEntity(e));let h=null;const m=l.defaultValue;if(m){const $=m||null;if($&&$.value===null&&$.autogeneration){const x=WO($);$.metaSync({value:x},null)}(i||s===null||s!==Ye.Testing)&&(h={value:$,valueOwner:l,type:Ds($)?Ye.Empty:Ye.DefaultValue,inheritanceLink:null})}!h||(h.type===Ye.DefaultValue||h.type===Ye.External)&&!i||Ye.Testing;const T=tf(l),g=l.getDataType(null);let b=T&&f&&(!(h!=null&&h.value)||!no(g)&&Up(h==null?void 0:h.value));return c.type===r.Loop&&f&&(b=!1),b?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:f&&!T&&Ds((h==null?void 0:h.value)||null)?{value:null,valueOwner:l,type:Ye.Empty,inheritanceLink:null}:h||{value:null,valueOwner:l,type:Ye.External,inheritanceLink:null}}function X2(l,u,i=!1){var R,I,D,N,$,x;if((R=l.getDataType(null))!=null&&R.isObject()||l.outputs.length)return J2(l,u);if(u.execution&&u.execution.hasEntity(l)&&!i){const L=(I=u.lastExecutionResults)==null?void 0:I.readValue(l.id);if(L)return{value:L,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=Zt(l),s=!!((D=u.execution)!=null&&D.entities.length),c=(N=u.execution)==null?void 0:N.hasEntity(n),e=l.readsValue;let f=null;if(e){const L=($=u.execution)==null?void 0:$.hasEntity(e);(!s||s&&L&&c||s&&!L&&!c)&&(f=_v(l,u,i))}const h=l.defaultValue,m=u.getValueTypePreference(l.id);if(!f&&h){const L=h;(i||m===null||m!==Ye.Testing)&&(f={value:L,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null})}if(!f||(f.type===Ye.DefaultValue||f.type===Ye.External)&&!i||m===Ye.Testing){const L=(x=u.localTestValues)==null?void 0:x.readValue(l.id);if(L)return{value:L,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const T=tf(l),g=l.getDataType(null);return T&&(!(f!=null&&f.value)||!no(g)&&Up(f==null?void 0:f.value))?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:!l.defaultValue&&!l.readsValue?{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null}:!T&&Ds((f==null?void 0:f.value)||null)?{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function oit(l,u,i=!1){var e,f,h,m,T,g,b,R;if(u.execution&&u.execution.hasEntity(l)&&!i){const I=(e=u.lastExecutionResults)==null?void 0:e.readValue(l.id);if(I)return{value:I,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=wy(l);if(Zc.includes(n.type)){const I=jc(n,u,i),D=l.codeName||((f=l.declaration)==null?void 0:f.codeName)||Dr(He(l,u.project));if(I!=null&&I.value&&l.parentRelationType!==cd.Error){const N=(I.value.value||{})[D];if(N===void 0)return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null};const $=ln(l.getDataType(null),l,u.project);return $==null||$.metaSync({value:N,rawString:typeof N=="string"&&typeof((h=I==null?void 0:I.value)==null?void 0:h.rawString)=="string"?(m=I==null?void 0:I.value)==null?void 0:m.rawString:void 0},null),{value:$,valueOwner:l,type:!Ni.includes(n.type)&&I.type===Ye.Empty?Ye.QueuedAutocalculation:I.type,inheritanceLink:{sources:[I],target:l}}}return{value:null,valueOwner:l,type:Ni.includes(n.type)?Ye.Empty:Ye.QueuedAutocalculation,inheritanceLink:null}}const s=(T=u.execution)==null?void 0:T.hasEntity(n),c=((g=u.execution)==null?void 0:g.state)===vB.Running;if((b=u.persistedExecutionResults)!=null&&b.values[l.id]&&!s&&!c&&!i){const I=(R=u.persistedExecutionResults)==null?void 0:R.readValue(l.id);if((I==null?void 0:I.value)!==null||(I==null?void 0:I.valueAsType)!==null)return{value:I,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}return null}function pN(l,u,i=!1){var g,b,R,I,D;if(![...ci,...Ni].includes(l.parent.type)||!T0(l))return null;if(((g=l.declaration)==null?void 0:g.type)===r.Property&&l.declaration.static)return jc(l.declaration,u);const n=FI(l,u,i);if(n&&n.type!==Ye.Empty&&n.type!==Ye.Missing&&n.type!==Ye.Undefined)return n;const s=la(l.parent),c=Pu(s,u,i),e=l.codeName||((b=l.declaration)==null?void 0:b.codeName)||Dr(He(l,u.project)),f=ln(l.getDataType(null),l,u.project),h=tf(l),m=(R=c==null?void 0:c.value)==null?void 0:R.value;if(m){let N=(m||{})[e];if(m[e]===void 0)return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:{sources:c?[c]:[],target:l}};f==null||f.metaSync({value:N,rawString:typeof N=="string"&&typeof((I=c==null?void 0:c.value)==null?void 0:I.rawString)=="string"?(D=c==null?void 0:c.value)==null?void 0:D.rawString:void 0},null);const $=tf(l),x=l.getDataType(null);return $&&(!f||!no(x)&&Up(f))?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:{value:f,valueOwner:l,type:c.type,inheritanceLink:{sources:c?[c]:[],target:l}}}return c!=null&&c.type&&c.type!==Ye.Missing&&c.type!==Ye.Empty&&c.type!==Ye.Undefined?{value:null,valueOwner:l,type:c.type,inheritanceLink:{sources:c?[c]:[],target:l}}:h?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:{value:null,valueOwner:l,type:l.readsValue?Ye.Inherited:Ye.Empty,inheritanceLink:null}}function cN(l,u,i=!1){var m,T,g,b,R,I,D,N,$,x,L;if(![...ci,...Ni].includes(l.parent.type)||!T0(l))return null;if(((m=l.declaration)==null?void 0:m.type)===r.Property&&l.declaration.static)return jc(l.declaration,u,i);const n=ci.includes(l.parent.type)?l.parent:la(l.parent),s=jc(n,u,i);let c=yb(l,u,i);if((c==null?void 0:c.type)===Ye.Undefined||(c==null?void 0:c.type)===Ye.Missing){const K=la(l.parent);let q=l;K.type===r.VariableDeclaration&&(q=(l.parent===K?l:K.inputs.find(Z=>{var X,te;return((X=Z.declaration)==null?void 0:X.id)===((te=l.declaration)==null?void 0:te.id)}))||l,c=yb(q,u,i))}const e=l.codeName||((T=l.declaration)==null?void 0:T.codeName)||Dr(He(l,u.project));let f=l.defaultValue||ln(l.getDataType(null),l,u.project);const h=(g=s==null?void 0:s.value)==null?void 0:g.value;if(((s==null?void 0:s.type)===Ye.ExecutionResult||(s==null?void 0:s.type)===Ye.Testing)&&!i&&h){let K=(h||{})[e];if(h[e]===void 0&&!l.readsValue&&!l.defaultValue)return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:{sources:s?[s]:[],target:l}};f!=null&&f.parent&&!f.standaloneParent&&(f=f.clone(null,null,null,!1),f.setStandaloneParent(l,null));let q=K;return l.defaultValue&&(q=l.defaultValue.value),f==null||f.metaSync({value:q,rawString:typeof K=="string"&&typeof((b=s==null?void 0:s.value)==null?void 0:b.rawString)=="string"?(R=s==null?void 0:s.value)==null?void 0:R.rawString:void 0},null),{value:f,valueOwner:l,type:s.type,inheritanceLink:{sources:s?[s]:[],target:l}}}if(c&&c.type!==Ye.Empty&&c.type!==Ye.Missing&&c.type!==Ye.Undefined)return c;if(h){let K=(h||{})[e];h[e]!==void 0&&(f!=null&&f.standaloneParent)&&(f==null||f.metaSync({value:K,rawString:typeof K=="string"&&typeof((I=s==null?void 0:s.value)==null?void 0:I.rawString)=="string"?(D=s==null?void 0:s.value)==null?void 0:D.rawString:void 0},null));const q=tf(l),W=l.getDataType(null),Z=q&&(!f||!no(W)&&Up(f)),X=!!((N=u.execution)!=null&&N.entities.length),te=($=u.execution)==null?void 0:$.hasEntity(n),z=n.readsValue;if(z){const J=(x=u.execution)==null?void 0:x.hasEntity(z);if(Z&&(!X||X&&J&&te||X&&!J&&!te))return{value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null}}if(l.readsValue){const J=(L=u.execution)==null?void 0:L.hasEntity(l.readsValue);if(Z&&(!X||X&&J&&te||X&&!J&&!te))return{value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null}}return Z?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:h[e]===void 0&&!l.readsValue&&!l.defaultValue?{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:{sources:s?[s]:[],target:l}}:{value:f,valueOwner:l,type:Ds(f)&&!l.readsValue?Ye.Empty:Ye.Inherited,inheritanceLink:null}}return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null}}function FI(l,u,i=!1){var D,N,$,x,L;const n=Zt(l),s=!!((D=u.execution)!=null&&D.entities.length),c=(N=u.execution)==null?void 0:N.hasEntity(n),e=l.readsValue;let f=null,h=!1;if(e){const K=($=u.execution)==null?void 0:$.hasEntity(e);h=!s||s&&K&&c||s&&!K&&!c,h&&(f=_v(l,u,i))}const m=!!e&&h,T=l.defaultValue,g=u.getValueTypePreference(l.id);if(!f&&T&&(i||g===null||g!==Ye.Testing)&&(f={value:T,valueOwner:l,type:Up(T)?Ye.Empty:Ye.DefaultValue,inheritanceLink:null}),(!f||f.type===Ye.DefaultValue||(f==null?void 0:f.type)===Ye.Empty||g===Ye.Testing)&&!m){const K=(x=u.persistedExecutionResults)==null?void 0:x.readValue(l.id);if(K&&!i)return{value:K,valueOwner:l,type:Ye.Testing,inheritanceLink:null};const q=(L=u.localTestValues)==null?void 0:L.readValue(l.id);if(q&&!i&&(g===null||g===Ye.Testing))return{value:q,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}if(T&&!Up(T))return{value:T,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null};const b=tf(l),R=l.getDataType(null),I=b&&(!(f!=null&&f.value)||!no(R)&&Up(f==null?void 0:f.value));return m&&I?{value:null,valueOwner:l,type:Ye.Inherited,inheritanceLink:null}:I?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:(f==null?void 0:f.inheritanceLink)||null}:!f&&!l.defaultValue&&!m?{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null}:!b&&(!f||f.type===Ye.Inherited)&&!(f!=null&&f.inheritanceLink)?{value:null,valueOwner:l,type:m?Ye.Inherited:Ye.Empty,inheritanceLink:null}:f}function yb(l,u,i=!1){var s;if(u.execution&&u.execution.hasEntity(l)&&!i){const c=(s=u.lastExecutionResults)==null?void 0:s.readValue(l.id);if(c)return{value:c,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}return FI(l,u,i)}function dit(l,u,i=!1){var n,s;return Ni.includes(l.parent.type)&&(n=la(l.parent).dataType)!=null&&n.isObject()||ci.includes(l.parent.type)&&(s=l.parent.getDataType(null))!=null&&s.isObject()?pN(l,u,i):FI(l,u,i)}function eB(l,u,i=!1){var n,s;if(Ni.includes(l.parent.type)){const c=la(l.parent);if((n=c.dataType)!=null&&n.isObject()||c.inputs.length)return cN(l,u,i)}return ci.includes(l.parent.type)&&((s=l.parent.getDataType(null))!=null&&s.isObject()||l.parent.outputs.length)?cN(l,u,i):yb(l,u,i)}function uit(l,u,i=!1){var T,g;if(u.execution){const b=(T=u.lastExecutionResults)==null?void 0:T.readValue(l.id);if(b&&!i)return{value:b,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=!u.execution||!u.execution.parentExecution,s=u.getValueTypePreference(l.id);if(n){const b=(g=u.localTestValues)==null?void 0:g.readValue(l.id);if(b&&!i&&(s===null||s!==Ye.DefaultValue))return{value:b,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const c=l.defaultValue;let e=null;c&&(i||s===null||s!==Ye.Testing)&&(e={value:c,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null});const f=tf(l),h=l.getDataType(null);return f&&(!(e!=null&&e.value)||!no(h)&&Up(e==null?void 0:e.value))&&l.static?{value:null,valueOwner:l,type:Ye.Missing,inheritanceLink:null}:Ds(e==null?void 0:e.value)?{value:null,valueOwner:l,type:Ye.Empty,inheritanceLink:null}:e}function pit(l,u,i=!1){var f,h,m;if(u.execution&&u.execution.hasEntity(l)&&!i){const T=(f=u.lastExecutionResults)==null?void 0:f.readValue(l.id);if(T)return{value:T,valueOwner:l,type:Ye.ExecutionResult,inheritanceLink:null}}const n=!u.execution||!u.execution.parentExecution,s=u.getValueTypePreference(l.id);if(n){const T=(h=u.localTestValues)==null?void 0:h.readValue(l.id);if(T&&!i&&(s===null||s!==Ye.DefaultValue))return{value:T,valueOwner:l,type:Ye.Testing,inheritanceLink:null}}const c=l.defaultValue;let e=null;if(c&&(i||s===null||s!==Ye.Testing)&&(e={value:c,valueOwner:l,type:Ye.DefaultValue,inheritanceLink:null}),((m=l.parent)==null?void 0:m.type)===r.Search){const T=l.parent.inputs.find(g=>{var b;return((b=g.declaration)==null?void 0:b.id)===l.id});if(T)return eB(T,u,i)}return Ds((e==null?void 0:e.value)||null)?{value:null,valueOwner:l,type:Ye.Empty,inheritanceLink:null}:e}function jc(l,u,i=!1){if(nT.has(l.id))return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null};nT.add(l.id);try{switch(l.type){case r.ArgumentDeclaration:return lit(l,u,i);case r.InputMap:return eB(l,u,i);case r.VariableDeclaration:return Q2(l,u,i);case r.VariableInstance:return sit(l,u,i);case r.OutputMap:return oit(l,u,i);case r.ReturnStatement:case r.BreakStatement:case r.ContinueStatement:return X2(l,u,i);case r.Property:return uit(l,u,i);case r.ValueDescriptor:return pit(l,u,i);case r.Operation:case r.Loop:case r.FunctionCall:case r.InternalCall:case r.Search:return nit(l,u,i);default:return null}}finally{nT.delete(l.id)}}function Pu(l,u,i=!1){if(nT.has(l.id))return{value:null,valueOwner:l,type:Ye.Undefined,inheritanceLink:null};nT.add(l.id);try{switch(l.type){case r.InputMap:return dit(l,u,i);case r.VariableDeclaration:return Yw(l,u,i);case r.VariableInstance:return ait(l,u,i);case r.ReturnStatement:case r.BreakStatement:case r.ContinueStatement:return X2(l,u,i);default:return null}}finally{nT.delete(l.id)}}function bXi(l){var u,i,n,s,c;if(l&&l.type===Ye.DefaultValue&&l.value&&l.valueOwner&&(!RD.includes(l.valueOwner.type)||((u=l.valueOwner.defaultValue)==null?void 0:u.id)===l.value.id)){const e=ln(l.valueOwner.getDataType(null),l.valueOwner,l.valueOwner.project);return e==null||e.metaSync({value:(i=l.value)==null?void 0:i.value,rawString:typeof((n=l.value)==null?void 0:n.value)=="string"&&typeof((s=l.value)==null?void 0:s.rawString)=="string"?(c=l.value)==null?void 0:c.rawString:void 0},null),{type:Ye.DefaultValue,value:e,valueOwner:l.valueOwner,inheritanceLink:null}}return l}function IXi(l,u,i,n){var R,I,D,N;let s=!1,c=null,e=null;n instanceof ie?(s=!0,c=n,e=null):(c=null,e=n);const f=la(l.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=s?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!s&&m&&m.id===((R=f.defaultValue)==null?void 0:R.id)&&(m=ln(f.getDataType(null),f,u)):s?m=Vv(f.getDataType(null),f,u,c):m=ln(f.getDataType(null),f,u);const T=He(l,u),g=l.codeName||((I=l.declaration)==null?void 0:I.codeName)||Dr(T);let b={};if(((N=(D=f.dataType)==null?void 0:D.entity)==null?void 0:N.type)===r.DefinitionEntity&&(b={...b,...f.dataType.entity.getActiveRawDefaultValue()}),va(m==null?void 0:m.value)&&(b={...b,...m.value}),b[g]=i,m==null||m.metaSync({value:b},c),s||e==null||e.writeValue(f,m),(i===""||i===null||i===void 0)&&l.type===r.OutputMap){const $=f.inputs.find(x=>{var L,K;return((L=x.declaration)==null?void 0:L.id)===((K=l.declaration)==null?void 0:K.id)||He(x,u)===T});if($){let x=s?$.defaultValue:e==null?void 0:e.readValue($.id);x&&x.metaSync({value:null},c),s||e==null||e.removeValue($.id)}}return c}function AXi(l,u,i){const n=kp(l,u);let s=!1,c=null,e=null;return i instanceof ie?(s=!0,c=i,e=null):(c=null,e=i),n.forEach(f=>{var m;let h=s?((m=f.getDefaultValue)==null?void 0:m.call(f))||null:e==null?void 0:e.readValue(f.id);s?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id)}),c}function RXi(l,u,i,n,s,c){const e=kp(u,i);let f=!1,h=null,m=null;return n instanceof ie?(f=!0,h=n,m=null):(h=null,m=n),i.diggestedBuiltInBaseEntitiesIds.has(u.id)||e.forEach(T=>{var R,I,D,N;if(i.diggestedBuiltInBaseEntitiesIds.has(T.id))return;let g=null;if(f){const $=((R=T.getDefaultValue)==null?void 0:R.call(T))||null;$&&(i.diggestedBuiltInBaseEntitiesIds.has($.id)||((I=$.parent)==null?void 0:I.id)!==T.id?g=$.clone(h,T):g=$)}else g=m==null?void 0:m.readValue(T.id);g?!f&&g&&g.id===((N=(D=T.getDefaultValue)==null?void 0:D.call(T))==null?void 0:N.id)&&(g=ln(T.getDataType(null),T,i)):f?(g=Vv(T.getDataType(null),T,i,h),h==null||h.add(g,se.Added)):g=ln(T.getDataType(null),T,i),g==null||g.setValueAsType(null,h);let b=s||(g==null?void 0:g.name);(!(g!=null&&g.name)||(g==null?void 0:g.name)===ce.Untyped)&&!s&&(typeof l=="string"?b=ce.String:l===null?b=ce.Null:typeof l=="number"?b=ce.Number:typeof l=="boolean"&&(b=ce.Boolean)),g==null||g.metaSync({value:l,name:b,rawString:c!==void 0?c:null},h),f||m==null||m.writeValue(T,g)}),h}function d0(l,u,i,n){let s=!1,c=null,e=null;n instanceof ie?(s=!0,c=n,e=null):(c=null,e=n);const f=l.parent;return u.getVariableDeclarations().forEach(m=>{var g,b,R,I,D,N;const T=m.getDataType(null);if(((g=T==null?void 0:T.entity)==null?void 0:g.id)===f.id){let $=s?m.defaultValue:e==null?void 0:e.readValue(m.id);$?!s&&$&&$.id===((b=m.defaultValue)==null?void 0:b.id)&&($=ln(m.getDataType(null),m,u)):s?$=Vv(m.getDataType(null),m,u,c):$=ln(m.getDataType(null),m,u);const x=He(l,u),L=l.codeName||((R=l.extends)==null?void 0:R.codeName)||((I=l.implements[0])==null?void 0:I.codeName)||Dr(x);let K={};((N=(D=m.dataType)==null?void 0:D.entity)==null?void 0:N.type)===r.DefinitionEntity&&(K={...K,...m.dataType.entity.getActiveRawDefaultValue()}),va($==null?void 0:$.value)&&(K={...K,...$.value}),Array.isArray(i)?K[L]=(i==null?void 0:i.map(q=>q.toShallowJSON()))||null:K[L]=(i==null?void 0:i.toShallowJSON())||null,$==null||$.metaSync({value:K},c),s||e==null||e.writeValue(m,$);return}}),c}function hb(l,u,i,n){var R,I,D,N;let s=!1,c=null,e=null;n instanceof ie?(s=!0,c=n,e=null):(c=null,e=n);const f=la(l.parent),h=f.getDataType(null);if(!(h!=null&&h.isObject()))return c;let m=s?f.defaultValue:e==null?void 0:e.readValue(f.id);m?!s&&m&&m.id===((R=f.defaultValue)==null?void 0:R.id)&&(m=ln(f.getDataType(null),f,u)):s?m=Vv(f.getDataType(null),f,u,c):m=ln(f.getDataType(null),f,u);const T=He(l,u),g=l.codeName||((I=l.declaration)==null?void 0:I.codeName)||Dr(T);let b={};if(((N=(D=f.dataType)==null?void 0:D.entity)==null?void 0:N.type)===r.DefinitionEntity&&(b={...b,...f.dataType.entity.getActiveRawDefaultValue()}),va(m==null?void 0:m.value)&&(b={...b,...m.value}),Array.isArray(i)?b[g]=(i==null?void 0:i.map($=>$.toShallowJSON()))||null:b[g]=(i==null?void 0:i.toShallowJSON())||null,m==null||m.metaSync({value:b},c),s||e==null||e.writeValue(f,m),i==null&&l.type===r.OutputMap){const $=f.inputs.find(x=>{var L,K;return((L=x.declaration)==null?void 0:L.id)===((K=l.declaration)==null?void 0:K.id)||He(x,u)===T});if($){let x=s?$.defaultValue:e==null?void 0:e.readValue($.id);x&&(Array.isArray(i)?x==null||x.setValueAsTypeList(i,c):x==null||x.setValueAsTypeSingle(i,c)),s||e==null||e.removeValue($.id)}}return c}function cit(l,u,i){var n,s,c,e;return l.type===r.InputMap?((n=l.declaration)==null?void 0:n.type)===r.Property&&l.declaration.static?d0(l.declaration,u,null,i):Ni.includes(l.parent.type)&&((s=l.declaration)==null?void 0:s.type)===r.Property&&hb(l,u,null,i):l.type===r.OutputMap?((c=l.declaration)==null?void 0:c.type)===r.Property&&l.declaration.static?d0(l.declaration,u,null,i):Ni.includes(l.parent.type)&&((e=l.declaration)==null?void 0:e.type)===r.Property&&hb(l,u,null,i):l.type===r.Property&&l.static&&d0(l,u,null,i),i}function fit(l,u,i,n){var s,c,e,f;return u.type===r.InputMap?((s=u.declaration)==null?void 0:s.type)===r.Property&&u.declaration.static?d0(u.declaration,i,l,n):Ni.includes(u.parent.type)&&((c=u.declaration)==null?void 0:c.type)===r.Property&&hb(u,i,l,n):u.type===r.OutputMap?((e=u.declaration)==null?void 0:e.type)===r.Property&&u.declaration.static?d0(u.declaration,i,null,n):Ni.includes(u.parent.type)&&((f=u.declaration)==null?void 0:f.type)===r.Property&&hb(u,i,null,n):u.type===r.Property&&u.static&&d0(u,i,l,n),n}function DXi(l,u,i){const n=kp(l,u);let s=!1,c=null,e=null;return i instanceof ie?(s=!0,c=i,e=null):(c=null,e=i),n.forEach(f=>{var m;let h=s?(m=f.getDefaultValue)==null?void 0:m.call(f):e==null?void 0:e.readValue(f.id);s?h==null||h.remove({ignoreUpstream:!1},c):e==null||e.removeValue(f.id),cit(f,u,i)}),c}function CXi(l,u,i,n){const s=kp(u,i);let c=!1,e=null,f=null;return n instanceof ie?(c=!0,e=n,f=null):(e=null,f=n),s.forEach(h=>{var T,g,b;let m=c?(T=h.getDefaultValue)==null?void 0:T.call(h):f==null?void 0:f.readValue(h.id);m?!c&&m&&m.id===((b=(g=h.getDefaultValue)==null?void 0:g.call(h))==null?void 0:b.id)&&(m=ln(h.getDataType(null),h,h.project)):c?m=Vv(h.getDataType(null),h,i,e):m=ln(h.getDataType(null),h,i),Array.isArray(l)?m==null||m.setValueAsTypeList(l,e):m==null||m.setValueAsTypeSingle(l,e),m==null||m.metaSync({value:null},e),c||f==null||f.writeValue(h,m),fit(l,h,i,n)}),e}function _r(l,u){let i=l;return l&&l.parent&&l.project.get(l.id)&&(i=i.clone(null,null,null,!1),i.setStandaloneParent(u,null)),i}class Jw{constructor(u,i){this.extensionsRegistry=u,this.contextType=i,this.off=this.extensionsRegistry.off.bind(this.extensionsRegistry),this.on=this.extensionsRegistry.on.bind(this.extensionsRegistry),this.emit=this.extensionsRegistry.emit.bind(this.extensionsRegistry),this.emitAsync=this.extensionsRegistry.emitAsync.bind(this.extensionsRegistry),this.emitAsyncAll=this.extensionsRegistry.emitAsyncAll.bind(this.extensionsRegistry),this.emitAsyncAllSettled=this.extensionsRegistry.emitAsyncAllSettled.bind(this.extensionsRegistry),this.emitAsyncSequentially=this.extensionsRegistry.emitAsyncSequentially.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAll=this.extensionsRegistry.emitAsyncSequentiallyAll.bind(this.extensionsRegistry),this.emitAsyncSequentiallyAllSettled=this.extensionsRegistry.emitAsyncSequentiallyAllSettled.bind(this.extensionsRegistry)}on(u,i){this.extensionsRegistry.on(u,i)}emit(u,...i){this.extensionsRegistry.emit(u,...i)}off(u,i){this.extensionsRegistry.off(u,i)}emitAsync(u,...i){return this.extensionsRegistry.emitAsync(u,...i)}emitAsyncAll(u,...i){return this.extensionsRegistry.emitAsyncAll(u,...i)}emitAsyncAllSettled(u,...i){return this.extensionsRegistry.emitAsyncAllSettled(u,...i)}emitAsyncSequentially(u,...i){return this.extensionsRegistry.emitAsyncSequentially(u,...i)}emitAsyncSequentiallyAll(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAll(u,...i)}emitAsyncSequentiallyAllSettled(u,...i){return this.extensionsRegistry.emitAsyncSequentiallyAllSettled(u,...i)}}var _e=(l=>(l[l.High=1]="High",l[l.Normal=5]="Normal",l[l.Low=10]="Low",l))(_e||{}),ee=(l=>(l.Logic="logic",l.EditorGUI="editor-gui",l.GUI="gui",l.Editor="editor",l.Compile="compile",l.PublicationRun="publication-run",l))(ee||{}),Ne=(l=>(l.All="*",l.OnAll="on:*",l.EmitAll="emit:*",l.ReadAll="read:*",l.WriteAll="write:*",l.UpdateAll="update:*",l.DoAll="do:*",l.OnLogicAll="on:logic:*",l.EmitLogicAll="emit:logic:*",l.ReadLogicAll="read:logic:*",l.WriteLogicAll="write:logic:*",l.UpdateLogicAll="update:logic:*",l.DoLogicAll="do:logic:*",l.OnGUIAll="on:gui:*",l.EmitGUIAll="emit:gui:*",l.ReadGUIAll="read:gui:*",l.WriteGUIAll="write:gui:*",l.UpdateGUIAll="update:gui:*",l.DoGUIAll="do:gui:*",l.OnEditorAll="on:editor:*",l.EmitEditorAll="emit:editor:*",l.ReadEditorAll="read:editor:*",l.WriteEditorAll="write:editor:*",l.UpdateEditorAll="update:editor:*",l.DoEditorAll="do:editor:*",l.OnCompileBefore="on:compile:before:DefinitionEntity",l.OnCompileDefault="on:compile:default:DefinitionEntity",l.OnCompileAfter="on:compile:after:DefinitionEntity",l.EmitCompile="emit:compile:DefinitionEntity",l.DoEditorPublish="do:editor:publish",l.PostGUICanvasSlotNewToolbarButton="write:gui:canvas:slot:toolbar-button",l.ReadGUICanvasSlotToolbarButtons="read:gui:canvas:slot:toolbar-buttons",l.UpdateGUIGlobalTheme="update:gui:global:theme",l))(Ne||{});class yit{constructor(u){C(this,"state",new Map);u&&(this.state=new Map(Object.entries(u)))}get(u){return this.state.get(u)}set(u,i){this.state.set(u,i)}delete(u){this.state.delete(u)}}class hit extends yit{constructor(u,i){super(i),this.parentExtension=u}}class $e{constructor(u,i){C(this,"manifest");C(this,"module");C(this,"state");this.extensionsRegistry=u,this.state=new hit(this,i)}}class fN extends Jw{constructor(i,n){super(i,ee.Logic);C(this,"id");this._project=n,this.id=n.id}get type(){return this._project.type}get name(){return this._project.name}get workspaceId(){return this._project.workspaceId}get description(){return this._project.description}get version(){return this._project.version}get createdAt(){return this._project.createdAt}get previousVersion(){return this._project.previousVersion}get author(){return this._project.author}get deleted(){return this._project.deleted}get editable(){return this._project.editable}get deletable(){return this._project.deletable}get entities(){return[...this._project.entities]}get projects(){return[...this._project.projects]}get functions(){return[...this._project.functions]}get events(){return[...this._project.events]}get variableDeclarations(){return[...this._project.variableDeclarations]}get variableInstances(){return[...this._project.variableInstances]}get conditions(){return[...this._project.conditions]}get operations(){return[...this._project.operations]}get functionCalls(){return[...this._project.functionCalls]}get loops(){return[...this._project.loops]}get searches(){return[...this._project.searches]}get primitives(){return[...this._project.primitives]}get builtInBaseEntities(){return[...this._project.builtInBaseEntities]}get operationDeclarations(){return[...this._project.operationDeclarations]}get globalEventActionDescriptors(){return[...this._project.globalEventActionDescriptors]}get loopDeclarations(){return[...this._project.loopDeclarations]}get loopDeclarationsBodies(){return[...this._project.loopDeclarationsBodies]}get conditionDeclarations(){return[...this._project.conditionDeclarations]}get valueDescriptors(){return[...this._project.valueDescriptors]}get dataTypes(){return[...this._project.dataTypes]}get errors(){return[...this._project.errors]}get history(){return[...this._project.history]}get undoableStackValueIndex(){return this._project.undoableStackValueIndex}get knownVersions(){return this._project.knownVersions}get activeVersion(){return this._project.activeVersion}get initialized(){return this._project.initialized}get startedInitialization(){return this._project.startedInitialization}closePersistChangeSetsSequentially(){return this._project.closePersistChangeSetsSequentially()}persistChangeSetSequentially(i){return this._project.persistChangeSetSequentially(i)}toLatestChangeSet(i,n,s,c=!1,e="here-this"){return this._project.toLatestChangeSet(i,n,s,c,e)}addChangeSet(i){return this._project.addChangeSet(i)}discardChangeSet(i){return this._project.discardChangeSet(i)}subscribeDependents(i){return this._project.subscribeDependents(i)}unsubscribeDependents(i){return this._project.unsubscribeDependents(i)}syncDependents(i){return this._project.syncDependents(i)}onDetachedDependencyRemoved(i,n,s){return this._project.onDetachedDependencyRemoved(i,n,s)}onDetachedDependencyRestored(i,n,s){return this._project.onDetachedDependencyRestored(i,n,s)}increaseVersion(i){return this._project.increaseVersion(i)}captureVersion(){return this._project.captureVersion()}restoreVersion(i){return this._project.restoreVersion(i)}updateWithShallowTransfer(i,n){return this._project.updateWithShallowTransfer(i,n)}hydrateAncestors(){return this._project.hydrateAncestors()}afterAllChildrenInitialized(i=null){return this._project.afterAllChildrenInitialized(i)}addSelfToProject(i){return this._project.addSelfToProject(i)}get instancesList(){return[...this._project.instancesList]}isOperationDeclaration(i){return this._project.isOperationDeclaration(i)}isGlobalEventActionDescriptor(i){return this._project.isGlobalEventActionDescriptor(i)}isLoopDeclaration(i){return this._project.isLoopDeclaration(i)}isConditionDeclaration(i){return this._project.isConditionDeclaration(i)}findSubscribedBuiltInInstance(i){return this._project.findSubscribedBuiltInInstance(i)}get(i){return this._project.get(i)}getDeleted(i){return this._project.getDeleted(i)}getManaged(i){return this._project.getManaged(i)}getBuiltIn(i){return this._project.getBuiltIn(i)}findSubscribedInstanceFromReference(i){return this._project.findSubscribedInstanceFromReference(i)}findSubscribedBuiltInInstanceFromReference(i){return this._project.findSubscribedBuiltInInstanceFromReference(i)}metaSync(i,n){return this._project.metaSync(i,n)}getAllBuiltInIds(){return this._project.getAllBuiltInIds()}getAllBuiltIn(){return this._project.getAllBuiltIn()}toFlat(i){return this._project.toFlat(i)}toFlatIds(i){return this._project.toFlatIds(i)}toMeta(){return this._project.toMeta()}toJSON(i){return this._project.toJSON(i)}toJSONClone(i){return this._project.toJSONClone(i)}toReference(i){return this._project.toReference(i)}toShallowJSON(i){return this._project.toShallowJSON(i)}toFlatJSON(i){return this._project.toFlatJSON(i)}toGenerationTarget(i){return this._project.toGenerationTarget(i)}toFlatGenerationTarget(i){return this._project.toFlatGenerationTarget(i)}clearErrors(){return this._project.clearErrors()}validate(){return this._project.validate()}validateChildren(){return this._project.validateChildren()}getErrors(){return this._project.getErrors()}getShallowErrors(){return this._project.getShallowErrors()}addDefinitionEntity(i){return this._project.addDefinitionEntity(i)}addFunctionDeclaration(i){return this._project.addFunctionDeclaration(i)}addFunctionCall(i){return this._project.addFunctionCall(i)}addVariableDeclaration(i){return this._project.addVariableDeclaration(i)}addVariableInstance(i){return this._project.addVariableInstance(i)}addInstalledProject(i){return this._project.addInstalledProject(i)}addGlobalEvent(i){return this._project.addGlobalEvent(i)}addCondition(i){return this._project.addCondition(i)}addOperation(i){return this._project.addOperation(i)}addLoop(i){return this._project.addLoop(i)}addSearch(i){return this._project.addSearch(i)}removeDefinitionEntity(i){return this._project.removeDefinitionEntity(i)}removeCondition(i){return this._project.removeCondition(i)}removeOperation(i){return this._project.removeOperation(i)}removeLoop(i){return this._project.removeLoop(i)}removeSearch(i){return this._project.removeSearch(i)}removeFunctionCall(i){return this._project.removeFunctionCall(i)}removeVariableInstance(i){return this._project.removeVariableInstance(i)}removeVariableDeclaration(i){return this._project.removeVariableDeclaration(i)}removeFunctionDeclaration(i){return this._project.removeFunctionDeclaration(i)}removeInstalledProject(i){return this._project.removeInstalledProject(i)}removeGlobalEvent(i){return this._project.removeGlobalEvent(i)}removeTopLevelVariableDeclaration(i){return this._project.removeTopLevelVariableDeclaration(i)}getEntryPoints(){return this._project.getEntryPoints()}getTerminationStatements(){return this._project.getTerminationStatements()}getFunctionDeclaration(i){return this._project.getFunctionDeclaration(i)}getConditions(){return this._project.getConditions()}getOperations(){return this._project.getOperations()}getVariables(){return this._project.getVariables()}getVariableInstances(){return this._project.getVariableInstances()}getVariableDeclarations(){return this._project.getVariableDeclarations()}getLoops(){return this._project.getLoops()}getSearches(){return this._project.getSearches()}getBuiltInPersistedEntity(){return this._project.getBuiltInPersistedEntity()}requestActiveDynamicValue(i,n=!1){return this._project.requestActiveDynamicValue(i,n)}undo(){return this._project.undo()}redo(){return this._project.redo()}applyExternalChangeSet(i){return this._project.applyExternalChangeSet(i)}toFullProjectTransfer(){return this._project.toFullProjectTransfer()}}function wXi(l,u){return u instanceof fN?u:new fN(l,u)}const qn="built-in-function-implementations__",ke="operations-implementations__",Vo="conditions-implementations__",Be={UUID:"uuid",SEARCH_NODE_IMPLEMENTATION:"search-node-implementation",BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION:qn+Ca.AbortExecution,BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY:qn+Ca.CreatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY:qn+Ca.UpdatePersistedEntity,BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY:qn+Ca.DeletePersistedEntity,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALUES_MERGE_EMPTY:ke+Ya.MergeEmpty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALUES_MERGE_FALSY:ke+Ya.MergeFalsy,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY:ke+Oi.Empty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY:ke+Oi.NotEmpty,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL:ke+Oi.PrimitiveEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL:ke+Oi.PrimitiveNotEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST:ke+ds.HttpRequest,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL:ke+Lu.ExecuteSQL,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY:ke+Ge.Validate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT:ke+yo.Wait,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN:ke+ve.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT:ke+ve.Split,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS:ke+ve.DeleteLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS:ke+ve.DeleteFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX:ke+ve.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX:ke+ve.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS:ke+ve.ReplaceFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS:ke+ve.ReplaceLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL:ke+ve.ReplaceAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX:ke+ve.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM:ke+ve.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST:ke+ve.GetFirst,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST:ke+ve.GetLast,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND:ke+ve.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND:ke+ve.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE:ke+ve.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH:ke+ve.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS:ke+ve.GetFirstNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS:ke+ve.GetLastNItems,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE:ke+ve.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT:ke+ve.Concat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF:ke+ve.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF:ke+ve.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE:ke+ve.Unique,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN:ke+ve.Flatten,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT:ke+ve.Sort,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE:ke+ve.Shuffle,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK:ke+ve.Chunk,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START:ke+ve.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END:ke+ve.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT:ke+ve.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH:ke+le.GetLength,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE:ke+le.ToLowerCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE:ke+le.ToUpperCase,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN:ke+le.Join,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS:ke+ve.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL:ke+ve.ContainsAll,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY:ke+ve.ContainsAny,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX:ke+le.SplitAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS:ke+le.SplitAtAllSeparators,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR:ke+le.SplitAtFirstSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR:ke+le.SplitAtLastSeparator,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS:ke+le.DeleteLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS:ke+le.DeleteFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX:ke+le.DeleteAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX:ke+le.AddAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS:ke+le.ReplaceFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS:ke+le.ReplaceLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX:ke+le.ReplaceAtIndex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH:ke+le.ReplaceFirstMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH:ke+le.ReplaceLastMatch,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES:ke+le.ReplaceAllMatches,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM:ke+le.GetIndexItem,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS:ke+le.GetFirstNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS:ke+le.GetLastNChars,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF:ke+le.GetIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND:ke+le.Append,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND:ke+le.Prepend,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE:ke+le.Reverse,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM:ke+le.Trim,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START:ke+le.TrimStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END:ke+le.TrimEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING:ke+le.Substring,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE:ke+le.Slice,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START:ke+le.PadStart,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END:ke+le.PadEnd,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT:ke+le.Repeat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF:ke+le.GetLastIndexOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX:ke+le.MatchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX:ke+le.MatchAllRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX:ke+le.SearchRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX:ke+le.ReplaceRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE:ke+le.NormalizeUnicode,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS:ke+le.RemoveDiacritics,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES:ke+le.CountOccurrences,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX:ke+le.EnsurePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX:ke+le.EnsureSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX:ke+le.RemovePrefix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX:ke+le.RemoveSuffix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION:ke+ge.Addition,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION:ke+ge.Subtraction,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION:ke+ge.Multiplication,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION:ke+ge.Division,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER:ke+ge.Remainder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION:ke+ge.Exponentiation,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE:ke+ge.Absolute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN:ke+ge.Sign,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND:ke+ge.Round,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE:ke+ge.Negate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR:ke+ge.Floor,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL:ke+ge.Ceil,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP:ke+ge.Clamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC:ke+ge.Trunc,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS:ke+ge.RoundToDecimals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP:ke+ge.SnapToStep,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE:ke+ge.MapRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE:ke+ge.Average,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN:ke+ge.Median,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF:ke+ge.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF:ke+ge.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT:ke+ge.SquareRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT:ke+ge.CubeRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT:ke+ge.NthRoot,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP:ke+ge.Exp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL:ke+ge.LogNatural,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10:ke+ge.Log10,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN:ke+ge.Sin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS:ke+ge.Cos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN:ke+ge.Tan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN:ke+ge.Asin,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS:ke+ge.Acos,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN:ke+ge.Atan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2:ke+ge.Atan2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS:ke+ge.ToRadians,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES:ke+ge.ToDegrees,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF:ke+ge.PercentOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE:ke+ge.PercentageChange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN:ke+ge.MoreThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN:ke+ge.LessThan,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL:ke+ge.LessThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL:ke+ge.MoreThanOrEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER:ke+ht.GenerateRandomInteger,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT:ke+ht.GenerateRandomFloat,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL:ke+ht.GenerateRandomHexadecimal,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62:ke+ht.GenerateRandomBase62,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64:ke+ht.GenerateRandomBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC:ke+ht.GenerateRandomAlphanumeric,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER:ke+ht.GenerateIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4:ke+ht.GenerateRandomUUIDv4,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER:ke+ht.GenerateShortIdentifier,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN:ke+ht.GenerateHexadecimalToken,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH:ke+le.StartsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH:ke+le.EndsWith,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS:ke+le.Contains,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX:ke+le.MatchesRegex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP:ke+H.GetCurrentTimestamp,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE:ke+H.FormatDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE:ke+H.ParseDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE:ke+H.AddToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE:ke+H.SubtractFromDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES:ke+H.DifferenceBetweenDates,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE:ke+H.ToDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX:ke+H.ToUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX:ke+H.FromUnix,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING:ke+H.ToISOString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR:ke+H.GetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH:ke+H.GetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE:ke+H.GetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR:ke+H.GetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE:ke+H.GetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND:ke+H.GetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND:ke+H.GetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY:ke+H.GetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR:ke+H.GetWeekOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER:ke+H.GetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR:ke+H.GetDayOfYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH:ke+H.GetDaysInMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE:ke+H.GetCurrentIanaTimeZone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR:ke+H.SetYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH:ke+H.SetMonth,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE:ke+H.SetDate,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR:ke+H.SetHour,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE:ke+H.SetMinute,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND:ke+H.SetSecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND:ke+H.SetMillisecond,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY:ke+H.SetIsoWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER:ke+H.SetQuarter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF:ke+H.StartOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF:ke+H.EndOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO:ke+H.RoundTo,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE:Vo+H.IsBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER:Vo+H.IsAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME:Vo+H.IsSame,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE:Vo+H.IsSameOrBefore,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER:Vo+H.IsSameOrAfter,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN:Vo+H.IsBetween,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID:Vo+H.IsValid,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR:Vo+H.IsLeapYear,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE:ke+H.ClampToRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF:ke+H.MinOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF:ke+H.MaxOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW:ke+H.FromNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW:ke+H.ToNow,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF:ke+H.HumanizeDiff,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS:ke+H.AddBusinessDays,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY:ke+H.NextWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY:ke+H.PreviousWeekday,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC:ke+H.ToUTC,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE:ke+H.ConvertTimezone,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET:ke+H.GetTimezoneOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET:ke+H.SetUTCOffset,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY:ke+Ge.ReadKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY:ke+Ge.WriteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY:ke+Ge.DeleteKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY:ke+Ge.ReadNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY:ke+Ge.WriteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY:ke+Ge.DeleteNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY:ke+Ge.WriteSafeNestedKeyRecursively,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY:Vo+Ge.HasKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY:Vo+Ge.HasNestedKey,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS:Vo+Ge.KeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS:Vo+Ge.NestedKeyValueEquals,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE:Vo+Ge.IsInstanceOfType,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE:ke+Ge.Merge,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS:ke+Ge.Keys,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES:ke+Ge.Values,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES:ke+Ge.Entries,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF:ke+We.GetTypeOf,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH:ke+Ei.Hash,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC:ke+Ei.Hmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES:ke+ht.GenerateRandomBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL:ke+Ei.ConstantTimeEqual,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2:ke+Ei.DeriveKeyPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2:ke+da.HashPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2:ke+da.VerifyPasswordPBKDF2,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC:ke+ki.BuildJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC:ke+ki.VerifyJwtHmac,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE:ke+ki.DecodeJwt,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING:ke+We.FromBytesToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES:ke+We.ToBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER:ke+We.ToNumber,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING:ke+We.ToString,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64:ke+We.EncodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64:ke+We.DecodeBase64,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL:ke+We.EncodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL:ke+We.DecodeBase64Url,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX:ke+We.EncodeHex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX:ke+We.DecodeHex,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_MULTIPART_BODY:ke+We.ParseMultipartBody,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_DATA_URI:ke+We.ParseDataUri,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DETECT_MIME_TYPE_FROM_BYTES:ke+We.DetectMimeTypeFromBytes,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_SPREADSHEET_RANGE_TO_A1:ke+We.ParseSpreadsheetRangeToA1,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_PARSE_A1_TO_SPREADSHEET_RANGE:ke+We.ParseA1ToSpreadsheetRange,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_BYTES_TO_FILE_REFERENCE:ke+We.BytesToFileReference,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FILE_REFERENCE_TO_BYTES:ke+We.FileReferenceToBytes,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE:ke+ps.Parse,BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY:ke+ps.Stringify,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_UPLOAD_FILE:ke+qe.UploadFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_FILE:ke+qe.GetFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DOWNLOAD_FILE:ke+qe.DownloadFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_LIST_FILES:ke+qe.ListFiles,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FILE:ke+qe.DeleteFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FILES:ke+qe.DeleteFiles,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_COPY_FILE:ke+qe.CopyFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_MOVE_FILE:ke+qe.MoveFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_RENAME_FILE:ke+qe.RenameFile,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_FILE_METADATA:ke+qe.GetFileMetadata,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_CHECK_FILE_EXISTS:ke+qe.CheckFileExists,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_PRESIGNED_URL:ke+qe.GetPresignedUrl,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_SET_FILE_ACCESS:ke+qe.SetFileAccess,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_CREATE_FOLDER:ke+qe.CreateFolder,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FOLDER:ke+qe.DeleteFolders,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_DELETE_FOLDERS:ke+qe.DeleteFolders,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_CREATE_MULTIPART_UPLOAD:ke+qe.CreateMultipartUpload,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_GET_UPLOAD_PART_PRESIGNED_URL:ke+qe.GetUploadPartPresignedUrl,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_COMPLETE_MULTIPART_UPLOAD:ke+qe.CompleteMultipartUpload,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_ABORT_MULTIPART_UPLOAD:ke+qe.AbortMultipartUpload,BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CLOUD_FILE_SYSTEM_UPLOAD_FILE_PART:ke+qe.UploadFilePart};class mit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__ABORT_EXECUTION,version:"1.0.0",description:'Implementation for the built-in function "Abort Execution". It terminates the execution of the current entity being run.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class Tit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__DELETE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Delete SQL database table". It deletes the current entity as an entry in the persisted storage.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class vit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__CREATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Create SQL database table". It saves the current entity state to the persisted storage.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class git extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_IN_FUNCTION_IMPLEMENTATIONS__UPDATE_PERSISTED_ENTITY,version:"1.0.0",description:'Implementation for the built-in function "Update SQL database table". It saves the current entity state to the persisted storage.',initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,entity:i,error:null,result:null})})}}class Eit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.SEARCH_NODE_IMPLEMENTATION,version:"1.0.0",description:"Implementation for search nodes when they get executed and query data.",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Editor]});C(this,"module",{main:async(i,n)=>({error:"Search module not implemented",data:null})})}}class bit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.UUID,version:"1.0.0",description:"UUID generation module, for all contexts and runtimes",initPriority:_e.High,permissions:[Ne.All],contexts:[]});C(this,"module",n$)}}class Iit extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_EMPTY,version:"1.0.0",description:"Comparison: Empty (!value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.Empty);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[Oi.Empty].inputs.leftHand.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f==null;return{value:j.Success,error:null,result:h}}catch(e){return{value:j.UnhandledError,error:e,result:null}}}})}}class Ait extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_NOT_EMPTY,version:"1.0.0",description:"Comparison: NotEmpty (!!value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.NotEmpty);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[Oi.NotEmpty].inputs.leftHand.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=f!=null;return{value:j.Success,error:null,result:h}}catch(e){return{value:j.UnhandledError,error:e,result:null}}}})}}const TD=class TD extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveEqual (typed equality / deep JSON equality)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.PrimitiveEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=(c=(s=n[0])==null?void 0:s.value)==null?void 0:c.name,g=(f=(e=n[0])==null?void 0:e.value)==null?void 0:f.value,b=(m=(h=n[1])==null?void 0:h.value)==null?void 0:m.value;let R=!1;return T&&TD.primitiveSet.has(T)?R=g===b:T===ce.Untyped||T===ce.KeyValue?R=JSON.stringify(g)===JSON.stringify(b):R=!1,{value:j.Success,error:null,result:R}}catch(T){return{value:j.UnhandledError,error:T,result:null}}}})}};C(TD,"primitiveSet",new Set([ce.String,ce.Number,ce.Boolean,ce.Null,ce.Enum,ce.Date,ce.UUID]));let H1=TD;const vD=class vD extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__COMPARISON_PRIMITIVE_NOT_EQUAL,version:"1.0.0",description:"Comparison: PrimitiveNotEqual (typed inequality / deep JSON inequality)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic);if(!n)return;const s=n.get(Oi.PrimitiveNotEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=(c=(s=n[0])==null?void 0:s.value)==null?void 0:c.name,g=(f=(e=n[0])==null?void 0:e.value)==null?void 0:f.value,b=(m=(h=n[1])==null?void 0:h.value)==null?void 0:m.value;let R=!1;return T&&vD.primitiveSet.has(T)?R=g!==b:T===ce.Untyped||T===ce.KeyValue?R=JSON.stringify(g)!==JSON.stringify(b):R=!1,{value:j.Success,error:null,result:R}}catch(T){return{value:j.UnhandledError,error:T,result:null}}}})}};C(vD,"primitiveSet",new Set([ce.String,ce.Number,ce.Boolean,ce.Null,ce.Enum,ce.Date,ce.UUID]));let W1=vD;var Rit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(c,e,f){var h=e.prototype;f.utc=function(D){var N={date:D,utc:!0,args:arguments};return new e(N)},h.utc=function(D){var N=f(this.toDate(),{locale:this.$L,utc:!0});return D?N.add(this.utcOffset(),i):N},h.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var m=h.parse;h.parse=function(D){D.utc&&(this.$u=!0),this.$utils().u(D.$offset)||(this.$offset=D.$offset),m.call(this,D)};var T=h.init;h.init=function(){if(this.$u){var D=this.$d;this.$y=D.getUTCFullYear(),this.$M=D.getUTCMonth(),this.$D=D.getUTCDate(),this.$W=D.getUTCDay(),this.$H=D.getUTCHours(),this.$m=D.getUTCMinutes(),this.$s=D.getUTCSeconds(),this.$ms=D.getUTCMilliseconds()}else T.call(this)};var g=h.utcOffset;h.utcOffset=function(D,N){var $=this.$utils().u;if($(D))return this.$u?0:$(this.$offset)?g.call(this):this.$offset;if(typeof D=="string"&&(D=function(q){q===void 0&&(q="");var W=q.match(n);if(!W)return null;var Z=(""+W[0]).match(s)||["-",0,0],X=Z[0],te=60*+Z[1]+ +Z[2];return te===0?0:X==="+"?te:-te}(D),D===null))return this;var x=Math.abs(D)<=16?60*D:D;if(x===0)return this.utc(N);var L=this.clone();if(N)return L.$offset=x,L.$u=!1,L;var K=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(L=this.local().add(x+K,i)).$offset=x,L.$x.$localOffset=K,L};var b=h.format;h.format=function(D){var N=D||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.call(this,N)},h.valueOf=function(){var D=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*D},h.isUTC=function(){return!!this.$u},h.toISOString=function(){return this.toDate().toISOString()},h.toString=function(){return this.toDate().toUTCString()};var R=h.toDate;h.toDate=function(D){return D==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():R.call(this)};var I=h.diff;h.diff=function(D,N,$){if(D&&this.$u===D.$u)return I.call(this,D,N,$);var x=this.local(),L=f(D).local();return I.call(x,L,N,$)}}})})(Rit);var OXi=Rit.exports;const PXi=Qo(OXi);var Dit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,c,e){var f,h=function(b,R,I){I===void 0&&(I={});var D=new Date(b),N=function($,x){x===void 0&&(x={});var L=x.timeZoneName||"short",K=$+"|"+L,q=n[K];return q||(q=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:$,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:L}),n[K]=q),q}(R,I);return N.formatToParts(D)},m=function(b,R){for(var I=h(b,R),D=[],N=0;N<I.length;N+=1){var $=I[N],x=$.type,L=$.value,K=i[x];K>=0&&(D[K]=parseInt(L,10))}var q=D[3],W=q===24?0:q,Z=D[0]+"-"+D[1]+"-"+D[2]+" "+W+":"+D[4]+":"+D[5]+":000",X=+b;return(e.utc(Z).valueOf()-(X-=X%1e3))/6e4},T=c.prototype;T.tz=function(b,R){b===void 0&&(b=f);var I,D=this.utcOffset(),N=this.toDate(),$=N.toLocaleString("en-US",{timeZone:b}),x=Math.round((N-new Date($))/1e3/60),L=15*-Math.round(N.getTimezoneOffset()/15)-x;if(!Number(L))I=this.utcOffset(0,R);else if(I=e($,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(L,!0),R){var K=I.utcOffset();I=I.add(D-K,"minute")}return I.$x.$timezone=b,I},T.offsetName=function(b){var R=this.$x.$timezone||e.tz.guess(),I=h(this.valueOf(),R,{timeZoneName:b}).find(function(D){return D.type.toLowerCase()==="timezonename"});return I&&I.value};var g=T.startOf;T.startOf=function(b,R){if(!this.$x||!this.$x.$timezone)return g.call(this,b,R);var I=e(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return g.call(I,b,R).tz(this.$x.$timezone,!0)},e.tz=function(b,R,I){var D=I&&R,N=I||R||f,$=m(+e(),N);if(typeof b!="string")return e(b).tz(N);var x=function(W,Z,X){var te=W-60*Z*1e3,z=m(te,X);if(Z===z)return[te,Z];var J=m(te-=60*(z-Z)*1e3,X);return z===J?[te,z]:[W-60*Math.min(z,J)*1e3,Math.max(z,J)]}(e.utc(b,D).valueOf(),$,N),L=x[0],K=x[1],q=e(L).utcOffset(K);return q.$x.$timezone=N,q},e.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},e.tz.setDefault=function(b){f=b}}})})(Dit);var xXi=Dit.exports;const VXi=Qo(xXi);var Cit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n,s){n.prototype.isBetween=function(c,e,f,h){var m=s(c),T=s(e),g=(h=h||"()")[0]==="(",b=h[1]===")";return(g?this.isAfter(m,f):!this.isBefore(m,f))&&(b?this.isBefore(T,f):!this.isAfter(T,f))||(g?this.isBefore(m,f):!this.isAfter(m,f))&&(b?this.isAfter(T,f):!this.isBefore(T,f))}}})})(Cit);var _Xi=Cit.exports;const NXi=Qo(_Xi);var wit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n){n.prototype.isSameOrAfter=function(s,c){return this.isSame(s,c)||this.isAfter(s,c)}}})})(wit);var $Xi=wit.exports;const LXi=Qo($Xi);var Oit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n){n.prototype.isSameOrBefore=function(s,c){return this.isSame(s,c)||this.isBefore(s,c)}}})})(Oit);var GXi=Oit.exports;const BXi=Qo(GXi);var Pit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="week",n="year";return function(s,c,e){var f=c.prototype;f.week=function(h){if(h===void 0&&(h=null),h!==null)return this.add(7*(h-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var T=e(this).startOf(n).add(1,n).date(m),g=e(this).endOf(i);if(T.isBefore(g))return 1}var b=e(this).startOf(n).date(m).startOf(i).subtract(1,"millisecond"),R=this.diff(b,i,!0);return R<0?e(this).startOf("week").week():Math.ceil(R)},f.weeks=function(h){return h===void 0&&(h=null),this.week(h)}}})})(Pit);var MXi=Pit.exports;const FXi=Qo(MXi);var xit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="day";return function(n,s,c){var e=function(m){return m.add(4-m.isoWeekday(),i)},f=s.prototype;f.isoWeekYear=function(){return e(this).year()},f.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),i);var T,g,b,R,I=e(this),D=(T=this.isoWeekYear(),g=this.$u,b=(g?c.utc:c)().year(T).startOf("year"),R=4-b.isoWeekday(),b.isoWeekday()>4&&(R+=7),b.add(R,i));return I.diff(D,"week")+1},f.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var h=f.startOf;f.startOf=function(m,T){var g=this.$utils(),b=!!g.u(T)||T;return g.p(m)==="isoweek"?b?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):h.bind(this)(m,T)}}})})(xit);var SXi=xit.exports;const kXi=Qo(SXi);var Vit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i="month",n="quarter";return function(s,c){var e=c.prototype;e.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var f=e.add;e.add=function(m,T){return m=Number(m),this.$utils().p(T)===n?this.add(3*m,i):f.bind(this)(m,T)};var h=e.startOf;e.startOf=function(m,T){var g=this.$utils(),b=!!g.u(T)||T;if(g.p(m)===n){var R=this.quarter()-1;return b?this.month(3*R).startOf(i).startOf("day"):this.month(3*R+2).endOf(i).endOf("day")}return h.bind(this)(m,T)}}})})(Vit);var UXi=Vit.exports;const jXi=Qo(UXi);var _it={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n,s){n.prototype.dayOfYear=function(c){var e=Math.round((s(this).startOf("day")-s(this).startOf("year"))/864e5)+1;return c==null?e:this.add(c-e,"day")}}})})(_it);var KXi=_it.exports;const qXi=Qo(KXi);var Nit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n,s){i=i||{};var c=n.prototype,e={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function f(m,T,g,b){return c.fromToBase(m,T,g,b)}s.en.relativeTime=e,c.fromToBase=function(m,T,g,b,R){for(var I,D,N,$=g.$locale().relativeTime||e,x=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],L=x.length,K=0;K<L;K+=1){var q=x[K];q.d&&(I=b?s(m).diff(g,q.d,!0):g.diff(m,q.d,!0));var W=(i.rounding||Math.round)(Math.abs(I));if(N=I>0,W<=q.r||!q.r){W<=1&&K>0&&(q=x[K-1]);var Z=$[q.l];R&&(W=R(""+W)),D=typeof Z=="string"?Z.replace("%d",W):Z(W,T,q.l,N);break}}if(T)return D;var X=N?$.future:$.past;return typeof X=="function"?X(D):X.replace("%s",D)},c.to=function(m,T){return f(m,T,this,!0)},c.from=function(m,T){return f(m,T,this)};var h=function(m){return m.$u?s.utc():s()};c.toNow=function(m){return this.to(h(this),m)},c.fromNow=function(m){return this.from(h(this),m)}}})})(Nit);var ZXi=Nit.exports;const HXi=Qo(ZXi);var $it={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){var i,n,s=1e3,c=6e4,e=36e5,f=864e5,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=31536e6,T=2628e6,g=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,b={years:m,months:T,days:f,hours:e,minutes:c,seconds:s,milliseconds:1,weeks:6048e5},R=function(W){return W instanceof K},I=function(W,Z,X){return new K(W,X,Z.$l)},D=function(W){return n.p(W)+"s"},N=function(W){return W<0},$=function(W){return N(W)?Math.ceil(W):Math.floor(W)},x=function(W){return Math.abs(W)},L=function(W,Z){return W?N(W)?{negative:!0,format:""+x(W)+Z}:{negative:!1,format:""+W+Z}:{negative:!1,format:""}},K=function(){function W(X,te,z){var J=this;if(this.$d={},this.$l=z,X===void 0&&(this.$ms=0,this.parseFromMilliseconds()),te)return I(X*b[D(te)],this);if(typeof X=="number")return this.$ms=X,this.parseFromMilliseconds(),this;if(typeof X=="object")return Object.keys(X).forEach(function(ae){J.$d[D(ae)]=X[ae]}),this.calMilliseconds(),this;if(typeof X=="string"){var Q=X.match(g);if(Q){var ne=Q.slice(2).map(function(ae){return ae!=null?Number(ae):0});return this.$d.years=ne[0],this.$d.months=ne[1],this.$d.weeks=ne[2],this.$d.days=ne[3],this.$d.hours=ne[4],this.$d.minutes=ne[5],this.$d.seconds=ne[6],this.calMilliseconds(),this}}return this}var Z=W.prototype;return Z.calMilliseconds=function(){var X=this;this.$ms=Object.keys(this.$d).reduce(function(te,z){return te+(X.$d[z]||0)*b[z]},0)},Z.parseFromMilliseconds=function(){var X=this.$ms;this.$d.years=$(X/m),X%=m,this.$d.months=$(X/T),X%=T,this.$d.days=$(X/f),X%=f,this.$d.hours=$(X/e),X%=e,this.$d.minutes=$(X/c),X%=c,this.$d.seconds=$(X/s),X%=s,this.$d.milliseconds=X},Z.toISOString=function(){var X=L(this.$d.years,"Y"),te=L(this.$d.months,"M"),z=+this.$d.days||0;this.$d.weeks&&(z+=7*this.$d.weeks);var J=L(z,"D"),Q=L(this.$d.hours,"H"),ne=L(this.$d.minutes,"M"),ae=this.$d.seconds||0;this.$d.milliseconds&&(ae+=this.$d.milliseconds/1e3,ae=Math.round(1e3*ae)/1e3);var de=L(ae,"S"),fe=X.negative||te.negative||J.negative||Q.negative||ne.negative||de.negative,me=Q.format||ne.format||de.format?"T":"",be=(fe?"-":"")+"P"+X.format+te.format+J.format+me+Q.format+ne.format+de.format;return be==="P"||be==="-P"?"P0D":be},Z.toJSON=function(){return this.toISOString()},Z.format=function(X){var te=X||"YYYY-MM-DDTHH:mm:ss",z={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return te.replace(h,function(J,Q){return Q||String(z[J])})},Z.as=function(X){return this.$ms/b[D(X)]},Z.get=function(X){var te=this.$ms,z=D(X);return z==="milliseconds"?te%=1e3:te=z==="weeks"?$(te/b[z]):this.$d[z],te||0},Z.add=function(X,te,z){var J;return J=te?X*b[D(te)]:R(X)?X.$ms:I(X,this).$ms,I(this.$ms+J*(z?-1:1),this)},Z.subtract=function(X,te){return this.add(X,te,!0)},Z.locale=function(X){var te=this.clone();return te.$l=X,te},Z.clone=function(){return I(this.$ms,this)},Z.humanize=function(X){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!X)},Z.valueOf=function(){return this.asMilliseconds()},Z.milliseconds=function(){return this.get("milliseconds")},Z.asMilliseconds=function(){return this.as("milliseconds")},Z.seconds=function(){return this.get("seconds")},Z.asSeconds=function(){return this.as("seconds")},Z.minutes=function(){return this.get("minutes")},Z.asMinutes=function(){return this.as("minutes")},Z.hours=function(){return this.get("hours")},Z.asHours=function(){return this.as("hours")},Z.days=function(){return this.get("days")},Z.asDays=function(){return this.as("days")},Z.weeks=function(){return this.get("weeks")},Z.asWeeks=function(){return this.as("weeks")},Z.months=function(){return this.get("months")},Z.asMonths=function(){return this.as("months")},Z.years=function(){return this.get("years")},Z.asYears=function(){return this.as("years")},W}(),q=function(W,Z,X){return W.add(Z.years()*X,"y").add(Z.months()*X,"M").add(Z.days()*X,"d").add(Z.hours()*X,"h").add(Z.minutes()*X,"m").add(Z.seconds()*X,"s").add(Z.milliseconds()*X,"ms")};return function(W,Z,X){i=X,n=X().$utils(),X.duration=function(J,Q){var ne=X.locale();return I(J,{$l:ne},Q)},X.isDuration=R;var te=Z.prototype.add,z=Z.prototype.subtract;Z.prototype.add=function(J,Q){return R(J)?q(this,J,1):te.bind(this)(J,Q)},Z.prototype.subtract=function(J,Q){return R(J)?q(this,J,-1):z.bind(this)(J,Q)}}})})($it);var WXi=$it.exports;const zXi=Qo(WXi);var Lit={exports:{}};(function(l,u){(function(i,n){l.exports=n()})(ka,function(){return function(i,n){n.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}})})(Lit);var YXi=Lit.exports;const JXi=Qo(YXi);U.extend(PXi);U.extend(VXi);U.extend(NXi);U.extend(LXi);U.extend(BXi);U.extend(FXi);U.extend(kXi);U.extend(jXi);U.extend(qXi);U.extend(HXi);U.extend(zXi);U.extend(JXi);const bi=l=>U(l),na=l=>l.toISOString();function Git(){return na(U())}function Bit(l,u){return bi(l).format(u)}function Mit(l){return na(U(l))}function Fit(l){if(l==null)throw new TypeError("ToDate expects a non-null value.");if(typeof l=="string"){const u=U(l);if(!u.isValid())throw new TypeError("Invalid date string.");return u.toISOString()}if(typeof l=="number"&&Number.isFinite(l)){const u=Math.abs(l)<1e12?U.unix(l):U(l);if(!u.isValid())throw new TypeError("Invalid numeric timestamp.");return u.toISOString()}if(l instanceof Date){const u=U(l);if(!u.isValid())throw new TypeError("Invalid Date object.");return u.toISOString()}throw new TypeError("Unsupported value type for ToDate. Provide a string, number, or Date.")}function Sit(l,u,i){return na(bi(l).add(u,i))}function kit(l,u,i){return na(bi(l).subtract(u,i))}function Uit(l,u,i,n=!1){return bi(l).diff(bi(u),i,n)}function jit(l){return bi(l).unix()}function Kit(l){return na(U.unix(l))}function qit(l){return na(bi(l))}function Zit(l){return bi(l).year()}function Hit(l){return bi(l).month()}function Wit(l){return bi(l).date()}function zit(l){return bi(l).hour()}function Yit(l){return bi(l).minute()}function Jit(l){return bi(l).second()}function Qit(l){return bi(l).millisecond()}function Xit(l){return bi(l).isoWeekday()}function ent(l){return bi(l).week()}function tnt(l){return bi(l).quarter()}function int(l){return bi(l).dayOfYear()}function nnt(l){return bi(l).daysInMonth()}function rnt(l,u){return na(bi(l).year(u))}function ant(l,u){return na(bi(l).month(u))}function snt(l,u){return na(bi(l).date(u))}function lnt(l,u){return na(bi(l).hour(u))}function ont(l,u){return na(bi(l).minute(u))}function dnt(l,u){return na(bi(l).second(u))}function unt(l,u){return na(bi(l).millisecond(u))}function pnt(l,u){return na(bi(l).isoWeekday(u))}function cnt(l,u){return na(bi(l).quarter(u))}function fnt(l,u){return na(bi(l).startOf(u))}function ynt(l,u){return na(bi(l).endOf(u))}function hnt(l,u){const i=bi(l),n=i.startOf(u),s=i.endOf(u),c=n.valueOf()+(s.valueOf()-n.valueOf())/2;return na(i.valueOf()<c?n:s)}function mnt(l,u,i){return bi(l).isBefore(bi(u),i)}function Tnt(l,u,i){return bi(l).isAfter(bi(u),i)}function vnt(l,u,i){return bi(l).isSame(bi(u),i)}function gnt(l,u,i){return bi(l).isSameOrBefore(bi(u),i)}function Ent(l,u,i){return bi(l).isSameOrAfter(bi(u),i)}function bnt(l,u,i,n,s="()"){return bi(l).isBetween(bi(u),bi(i),n,s)}function Int(l){return U(l).isValid()}function Ant(l){return bi(l).isLeapYear()}function Rnt(l,u,i){const n=bi(l);return n.isBefore(u)?na(bi(u)):n.isAfter(i)?na(bi(i)):na(n)}function Dnt(l){if(l.length===0)throw new Error("minOf requires at least one date");let u=bi(l[0]);for(let i=1;i<l.length;i++){const n=bi(l[i]);n.isBefore(u)&&(u=n)}return na(u)}function Cnt(l){if(l.length===0)throw new Error("maxOf requires at least one date");let u=bi(l[0]);for(let i=1;i<l.length;i++){const n=bi(l[i]);n.isAfter(u)&&(u=n)}return na(u)}function wnt(l,u=!1){return bi(l).fromNow(u)}function Ont(l,u=!1){return bi(l).toNow(u)}function Pnt(l,u,i=!0){const n=bi(l).diff(bi(u),"millisecond",!0),s=Math.abs(n),e=U.duration(s,"milliseconds").humanize();return i?n>=0?`in ${e}`:`${e} ago`:e}function xnt(l,u,i=["6","7"],n=[]){const s=m=>n.some(T=>bi(T).isSame(m,"day")),c=m=>((m.day()+6)%7+1).toString();let e=bi(l);const f=u>=0?1:-1;let h=Math.abs(u);for(;h>0;){e=e.add(f,"day");const m=c(e);!i.includes(m)&&!s(e)&&h--}return na(e)}function Vnt(l,u){let i=bi(l);const n=u;for(let s=0;s<7;s++)if(i=i.add(1,"day"),i.isoWeekday()===n)return na(i);return na(i)}function _nt(l,u){let i=bi(l);const n=u;for(let s=0;s<7;s++)if(i=i.subtract(1,"day"),i.isoWeekday()===n)return na(i);return na(i)}const Nnt="Local";function tB(){try{const l=Intl.DateTimeFormat().resolvedOptions().timeZone;if(l&&typeof l=="string")return l}catch{}try{if(typeof process<"u"&&process.env&&process.env.TZ)return process.env.TZ}catch{}return null}function iB(){const l=tB();if(l)return l;throw new Error("Unable to detect current IANA timezone from host environment.")}function $nt(l,u,i=!1){let n=u;if(n===Nnt){const e=tB();if(!e)throw new Error("Unable to detect current timezone from host environment.");n=e}const s=n?U.tz(l,n):bi(l),c=i?s.utc(!0):s.utc();return na(c)}function Lnt(l,u,i=!1){const n=bi(l);return na(i?n.tz(u,!0):n.tz(u))}function Gnt(l,u){const i=l===Nnt?iB():l;return bi(u).tz(i).utcOffset()}function Bnt(l,u,i=!1){return na(bi(l).utcOffset(u,i))}class Mnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_TIMESTAMP,version:"1.0.0",description:"Date get current timestamp operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetCurrentTimestamp);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=Git();return{value:j.Success,error:null,result:s}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Fnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FORMAT_DATE,version:"1.0.0",description:"Date format operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.FormatDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.FormatDate].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.FormatDate].inputs.format.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Bit(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Snt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PARSE_DATE,version:"1.0.0",description:"Date parse operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ParseDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ParseDate].inputs.inputValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Mit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class knt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_TO_DATE,version:"1.0.0",description:"Date add-to-date operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.AddToDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.AddToDate].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.AddToDate].inputs.amount.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.AddToDate].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Sit(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Unt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SUBTRACT_FROM_DATE,version:"1.0.0",description:"Date subtract-from-date operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SubtractFromDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.SubtractFromDate].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.SubtractFromDate].inputs.amount.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.SubtractFromDate].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=kit(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class jnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_DIFFERENCE_BETWEEN_DATES,version:"1.0.0",description:"Date difference-between-dates operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.DifferenceBetweenDates);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m,T,g;try{const b=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.firstDate.id}),R=((s=b==null?void 0:b.value)==null?void 0:s.valueAsType)??((c=b==null?void 0:b.value)==null?void 0:c.value),I=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.secondDate.id}),D=((e=I==null?void 0:I.value)==null?void 0:e.valueAsType)??((f=I==null?void 0:I.value)==null?void 0:f.value),N=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.unit.id}),$=((h=N==null?void 0:N.value)==null?void 0:h.valueAsType)??((m=N==null?void 0:N.value)==null?void 0:m.value),x=n.find(q=>{var W,Z;return((Z=(W=q.valueOwner)==null?void 0:W.declaration)==null?void 0:Z.id)===B.operation[H.DifferenceBetweenDates].inputs.asFloat.id}),L=((T=x==null?void 0:x.value)==null?void 0:T.valueAsType)??((g=x==null?void 0:x.value)==null?void 0:g.value)??!1,K=Uit(R,D,$,L);return{value:j.Success,error:null,result:K}}catch(b){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:b,result:null}}}})}}class QXi extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_DATE,version:"1.0.0",description:"Date to-date operation implementation module (coerce to ISO 8601 string)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ToDate].inputs.inputValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Fit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Knt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UNIX,version:"1.0.0",description:"Date to-unix operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToUnix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ToUnix].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class qnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_UNIX,version:"1.0.0",description:"Date from-unix operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.FromUnix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.FromUnix].inputs.seconds.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Kit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Znt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_ISO_STRING,version:"1.0.0",description:"Date to-iso-string operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToISOString);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.ToISOString].inputs.inputValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=qit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Hnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_YEAR,version:"1.0.0",description:"Date get-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Zit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Wnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MONTH,version:"1.0.0",description:"Date get-month (0-based) operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetMonth);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetMonth].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Hit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class znt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DATE,version:"1.0.0",description:"Date get-date (day of month) operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetDate].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Wit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Ynt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_HOUR,version:"1.0.0",description:"Date get-hour operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetHour);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetHour].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=zit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Jnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MINUTE,version:"1.0.0",description:"Date get-minute operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetMinute);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetMinute].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Yit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Qnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_SECOND,version:"1.0.0",description:"Date get-second operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetSecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetSecond].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Jit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Xnt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_MILLISECOND,version:"1.0.0",description:"Date get-millisecond operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetMillisecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetMillisecond].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Qit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class ert extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_ISO_WEEKDAY,version:"1.0.0",description:"Date get-iso-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetIsoWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetIsoWeekday].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Xit(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class trt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_WEEK_OF_YEAR,version:"1.0.0",description:"Date get-week-of-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetWeekOfYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetWeekOfYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=ent(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class irt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_QUARTER,version:"1.0.0",description:"Date get-quarter operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetQuarter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetQuarter].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=tnt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class nrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAY_OF_YEAR,version:"1.0.0",description:"Date get-day-of-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetDayOfYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetDayOfYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=int(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class rrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_DAYS_IN_MONTH,version:"1.0.0",description:"Date get-days-in-month operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetDaysInMonth);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.GetDaysInMonth].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=nnt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class art extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_CURRENT_IANA_TIMEZONE,version:"1.0.0",description:"Date get-current-iana-timezone operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetCurrentIanaTimeZone);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=iB();return{value:j.Success,error:null,result:s}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class srt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_YEAR,version:"1.0.0",description:"Date set-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetYear].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetYear].inputs.year.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=rnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class lrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MONTH,version:"1.0.0",description:"Date set-month operation implementation module (0-based month)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetMonth);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMonth].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMonth].inputs.month.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=ant(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class ort extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_DATE,version:"1.0.0",description:"Date set-date (day of month) operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetDate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetDate].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetDate].inputs.date.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=snt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class drt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_HOUR,version:"1.0.0",description:"Date set-hour operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetHour);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetHour].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetHour].inputs.hour.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=lnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class urt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MINUTE,version:"1.0.0",description:"Date set-minute operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetMinute);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMinute].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMinute].inputs.minute.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=ont(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class prt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_SECOND,version:"1.0.0",description:"Date set-second operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetSecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetSecond].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetSecond].inputs.second.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=dnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class crt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_MILLISECOND,version:"1.0.0",description:"Date set-millisecond operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetMillisecond);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMillisecond].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetMillisecond].inputs.millisecond.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=unt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class frt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_ISO_WEEKDAY,version:"1.0.0",description:"Date set-iso-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetIsoWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetIsoWeekday].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetIsoWeekday].inputs.isoWeekday.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=pnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class yrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_QUARTER,version:"1.0.0",description:"Date set-quarter operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetQuarter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetQuarter].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.SetQuarter].inputs.quarter.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=cnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class hrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_START_OF,version:"1.0.0",description:"Date start-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.StartOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.StartOf].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.StartOf].inputs.unit.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=fnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class mrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_END_OF,version:"1.0.0",description:"Date end-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.EndOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.EndOf].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.EndOf].inputs.unit.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=ynt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Trt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ROUND_TO,version:"1.0.0",description:"Date round-to operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.RoundTo);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.RoundTo].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.RoundTo].inputs.unit.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=hnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class vrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BEFORE,version:"1.0.0",description:"Date is-before operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsBefore);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsBefore].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsBefore].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsBefore].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=mnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class grt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_AFTER,version:"1.0.0",description:"Date is-after operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsAfter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsAfter].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsAfter].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsAfter].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Tnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Ert extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME,version:"1.0.0",description:"Date is-same operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsSame);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSame].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSame].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSame].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=vnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class brt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_BEFORE,version:"1.0.0",description:"Date is-same-or-before operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsSameOrBefore);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrBefore].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrBefore].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrBefore].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=gnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Irt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_SAME_OR_AFTER,version:"1.0.0",description:"Date is-same-or-after operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsSameOrAfter);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrAfter].inputs.leftHand.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrAfter].inputs.rightHand.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.IsSameOrAfter].inputs.unit.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Ent(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Art extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_BETWEEN,version:"1.0.0",description:"Date is-between operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsBetween);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m,T,g,b,R;try{const I=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.target.id}),D=((s=I==null?void 0:I.value)==null?void 0:s.valueAsType)??((c=I==null?void 0:I.value)==null?void 0:c.value),N=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.start.id}),$=((e=N==null?void 0:N.value)==null?void 0:e.valueAsType)??((f=N==null?void 0:N.value)==null?void 0:f.value),x=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.end.id}),L=((h=x==null?void 0:x.value)==null?void 0:h.valueAsType)??((m=x==null?void 0:x.value)==null?void 0:m.value),K=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.unit.id}),q=((T=K==null?void 0:K.value)==null?void 0:T.valueAsType)??((g=K==null?void 0:K.value)==null?void 0:g.value),W=n.find(te=>{var z,J;return((J=(z=te.valueOwner)==null?void 0:z.declaration)==null?void 0:J.id)===B.operation[H.IsBetween].inputs.inclusivity.id}),Z=((b=W==null?void 0:W.value)==null?void 0:b.valueAsType)??((R=W==null?void 0:W.value)==null?void 0:R.value),X=bnt(D,$,L,q,Z??void 0);return{value:j.Success,error:null,result:X}}catch(I){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:I,result:null}}}})}}class Rrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_VALID,version:"1.0.0",description:"Date is-valid operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsValid);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.IsValid].inputs.value.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Int(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Drt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_IS_LEAP_YEAR,version:"1.0.0",description:"Date is-leap-year operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.IsLeapYear);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[H.IsLeapYear].inputs.dateValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Ant(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Crt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CLAMP_TO_RANGE,version:"1.0.0",description:"Date clamp-to-range operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ClampToRange);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.ClampToRange].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.ClampToRange].inputs.min.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[H.ClampToRange].inputs.max.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Rnt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class wrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MIN_OF,version:"1.0.0",description:"Date min-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.MinOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[H.MinOf].inputs.dates.id}).map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=Dnt(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ort extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_MAX_OF,version:"1.0.0",description:"Date max-of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.MaxOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[H.MaxOf].inputs.dates.id}).map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),e=c.length===1&&Array.isArray(c[0])?c[0]:c,f=Cnt(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Prt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_FROM_NOW,version:"1.0.0",description:"Date from-now operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.FromNow);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.FromNow].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.FromNow].inputs.withoutSuffix.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value)??!1,R=wnt(m,b);return{value:j.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class xrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_NOW,version:"1.0.0",description:"Date to-now operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToNow);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.ToNow].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[H.ToNow].inputs.withoutSuffix.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value)??!1,R=Ont(m,b);return{value:j.Success,error:null,result:R}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Vrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_HUMANIZE_DIFF,version:"1.0.0",description:"Date humanize-diff operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.HumanizeDiff);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.HumanizeDiff].inputs.firstDate.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.HumanizeDiff].inputs.secondDate.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.HumanizeDiff].inputs.withoutSuffix.id}),N=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value)??!0,$=Pnt(g,R,N);return{value:j.Success,error:null,result:$}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class _rt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_ADD_BUSINESS_DAYS,version:"1.1.0",description:"Date add-business-days operation implementation module (ISO-weekend strings)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.AddBusinessDays);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(g=>{var b,R;return((R=(b=g.valueOwner)==null?void 0:b.declaration)==null?void 0:R.id)===B.operation[H.AddBusinessDays].inputs.dateValue.id}).map(g=>{var b,R;return((b=g.value)==null?void 0:b.valueAsType)??((R=g.value)==null?void 0:R.value)}),e=c[0],f=c[1],h=c[2]??void 0,m=c[3]??[],T=xnt(e,f,h,m);return{value:j.Success,error:null,result:T}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Nrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_NEXT_WEEKDAY,version:"1.0.0",description:"Date next-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.NextWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.NextWeekday].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.NextWeekday].inputs.weekday.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Vnt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class $rt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_PREVIOUS_WEEKDAY,version:"1.0.0",description:"Date previous-weekday operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.PreviousWeekday);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.PreviousWeekday].inputs.dateValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[H.PreviousWeekday].inputs.weekday.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=_nt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Lrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_TO_UTC,version:"1.1.0",description:"Date to-utc operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ToUTC);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.filter(T=>{var g,b;return((b=(g=T.valueOwner)==null?void 0:g.declaration)==null?void 0:b.id)===B.operation[H.ToUTC].inputs.dateValue.id}).map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)??((b=T.value)==null?void 0:b.value)}),e=c[0],f=c[1]||void 0,h=c[2]??!1,m=$nt(e,f,h);return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Grt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_CONVERT_TIMEZONE,version:"1.0.0",description:"Date convert-timezone operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.ConvertTimezone);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.ConvertTimezone].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.ConvertTimezone].inputs.targetTimezone.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.ConvertTimezone].inputs.keepLocalTime.id}),N=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value)??!1,$=Lnt(g,R,N);return{value:j.Success,error:null,result:$}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Brt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_GET_TIMEZONE_OFFSET,version:"1.0.0",description:"Date get-timezone-offset operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.GetTimezoneOffset);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[H.GetTimezoneOffset].inputs.timezone.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[H.GetTimezoneOffset].inputs.atDate.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),I=Gnt(m,g);return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Mrt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATE_SET_UTC_OFFSET,version:"1.0.0",description:"Date set-utc-offset operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(H.SetUTCOffset);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.SetUTCOffset].inputs.dateValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.SetUTCOffset].inputs.offsetMinutes.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find(x=>{var L,K;return((K=(L=x.valueOwner)==null?void 0:L.declaration)==null?void 0:K.id)===B.operation[H.SetUTCOffset].inputs.keepLocalTime.id}),N=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value)??!1,$=Bnt(g,R,N);return{value:j.Success,error:null,result:$}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Frt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_WAIT,version:"1.0.0",description:"Execution wait operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(yo.Wait);s&&(s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[yo.Wait].inputs.duration.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return typeof f!="number"||f<0?{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"Invalid wait time provided",result:null}:(await new Promise(h=>setTimeout(h,f)),{value:j.Success,error:null,result:null})}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}const XXi=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,nB=l=>l===null||["string","number","boolean"].includes(typeof l);function Js(l,u="Input must be an array"){if(!Array.isArray(l))throw new TypeError(u);return l}function fp(l){const u=Js(l,"Input must be an array");if(!u||u.length===0)throw new TypeError("No list provided or list is empty");return u}function rB(l){return Array.isArray(l)?l:[]}function md(l){return Number(l)}function Srt(l){if(!l||l.length===0)throw new TypeError("No input lists provided");if(!l.every(n=>Array.isArray(n)))throw new TypeError("All inputs must be arrays");const[u,...i]=l;return i.reduce((n,s)=>n.concat(s),u)}function krt(l,...u){if(!Array.isArray(l))throw new TypeError("First input must be an array");if(!u.every(i=>Array.isArray(i)))throw new TypeError("All subsequent inputs must be arrays");return l.concat(...u)}function Urt(l,u){const i=fp(l),n=md(u);return[i.slice(0,n),i.slice(n)]}function jrt(l){return fp(l).slice().reverse()}function Krt(l){return fp(l).slice(0,-1)}function qrt(l){return fp(l).slice(1)}function Zrt(l,u,i){const n=Js(l),s=md(u);if(s<0||s>n.length)throw new TypeError("Index out of bounds");return[...n.slice(0,s),i,...n.slice(s)]}function Hrt(l,u,i){const n=fp(l),s=md(u);if(s<0||s>=n.length)throw new TypeError("Index out of bounds");const c=[...n];return c[s]=i,c}function Wrt(l,u,i){const n=fp(l),s=n.indexOf(u);if(s===-1)return n;const c=[...n];return c[s]=i,c}function zrt(l,u,i){const n=fp(l),s=n.lastIndexOf(u);if(s===-1)return n;const c=[...n];return c[s]=i,c}function Yrt(l,u,i){return fp(l).map(s=>s===u?i:s)}function Jrt(l,u){const i=fp(l),n=md(u);if(n<0||n>=i.length)throw new TypeError("Index out of bounds");return i[n]}function Qrt(l){return fp(l)[0]}function Xrt(l){const u=fp(l);return u[u.length-1]}function eat(l,u,...i){return[...Js(l),u,...i]}function tat(l,u){const i=Js(l);return[u,...i]}function iat(l){return Js(l).length}function nat(l,u){const i=Js(l),n=md(u);if(n<0||n>=i.length)throw new TypeError("Index out of bounds");return i.slice(0,n).concat(i.slice(n+1))}function rat(l,u){const i=Js(l),n=Math.max(0,md(u)??0);return i.slice(0,n)}function aat(l,u){const i=Js(l),n=Math.max(0,md(u)??0);return n===0?[]:i.slice(-n)}function sat(l,u,i){const n=Js(l),s=u==null?void 0:md(u),c=i==null?void 0:md(i);return n.slice(s,c)}function lat(l,u){return Js(l).indexOf(u)}function oat(l,u){return Js(l).lastIndexOf(u)}function dat(l){const u=Js(l),i=[],n=new Set;for(const s of u)n.has(s)||(n.add(s),i.push(s));return i}function uat(l){return Js(l).reduce((i,n)=>i.concat(n),[])}function pat(l){const u=Js(l);if(u.length<=1)return[...u];const i=u[0],n=typeof i=="number"&&u.every(e=>typeof e=="number"&&Number.isFinite(e)),s=typeof i=="string"&&u.every(e=>typeof e=="string");let c=null;if(n?c="number":s&&(c=u.every(f=>XXi.test(f)&&U(f).isValid())?"date":"string"),!c)throw new TypeError("All items must be of the same supported type: number, string, or ISO date string.");return c==="number"?[...u].sort((e,f)=>e-f):c==="string"?[...u].sort((e,f)=>e.localeCompare(f)):[...u].sort((e,f)=>U(e).valueOf()-U(f).valueOf())}function cat(l){const i=[...Js(l)];for(let n=i.length-1;n>0;n--){const s=Math.floor(Zw()*(n+1));[i[n],i[s]]=[i[s],i[n]]}return i}function fat(l,u){const i=Js(l),n=Math.max(1,md(u)||1),s=[];for(let c=0;c<i.length;c+=n)s.push(i.slice(c,c+n));return s}function yat(l,u,i){const n=Js(l),s=Math.max(0,md(u)||0);if(n.length>=s)return[...n];const c=s-n.length;return Array(c).fill(i).concat(n)}function hat(l,u,i){const n=Js(l),s=Math.max(0,md(u)||0);if(n.length>=s)return[...n];const c=s-n.length,e=Array(c).fill(i);return n.concat(e)}function mat(l,u){const i=Js(l),n=Math.max(0,md(u)||0),s=[];for(let c=0;c<n;c++)s.push(...i);return s}function Tat(l,u){if(!nB(u))throw new TypeError("Contains expects the needle to be a primitive (string | number | boolean | null).");return rB(l).some(n=>n===u)}function vat(l,u){const i=rB(l),n=Array.isArray(u)?u:[u];if(n.length===0)return!1;if(!n.every(nB))throw new TypeError("ContainsAll expects all needles to be primitives (string | number | boolean | null).");return n.every(s=>i.includes(s))}function gat(l,u){const i=rB(l),n=Array.isArray(u)?u:[u];if(n.length===0)return!1;if(!n.every(nB))throw new TypeError("ContainsAny expects all needles to be primitives (string | number | boolean | null).");return n.some(s=>i.includes(s))}class Eat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_JOIN,version:"1.0.0",description:"List join operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Join);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Join].inputs.firstList.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Join].inputs.separator.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Join].inputs.secondList.id}).map(D=>{var N,$;return((N=D.value)==null?void 0:N.valueAsType)??(($=D.value)==null?void 0:$.value)}),I=Srt([m,g,...R]);return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class bat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SPLIT,version:"1.0.0",description:"List split operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Split);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[ve.Split].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(I=>{var D,N;return((N=(D=I.valueOwner)==null?void 0:D.declaration)==null?void 0:N.id)===B.operation[ve.Split].inputs.index.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),[b,R]=Urt(m,g);return{value:j.Success,error:null,result:[b,R]}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Iat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REVERSE,version:"1.0.0",description:"List reverse operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Reverse);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Reverse].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Aat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_LAST_N_ITEMS,version:"1.0.0",description:"List delete last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.DeleteLastNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.DeleteLastNItems].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Krt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Rat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_FIRST_N_ITEMS,version:"1.0.0",description:"List delete first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.DeleteFirstNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.DeleteFirstNItems].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=qrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Dat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_ADD_AT_INDEX,version:"1.0.0",description:"List add index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.AddAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.AddAtIndex].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.AddAtIndex].inputs.index.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.AddAtIndex].inputs.value.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Zrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Cat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_AT_INDEX,version:"1.0.0",description:"List replace index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAtIndex].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAtIndex].inputs.index.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAtIndex].inputs.value.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Hrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class wat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_FIRST_N_ITEMS,version:"1.0.0",description:"List replace first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceFirstNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceFirstNItems].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceFirstNItems].inputs.searchValue.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceFirstNItems].inputs.replaceValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Wrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Oat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_LAST_N_ITEMS,version:"1.0.0",description:"List replace last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceLastNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceLastNItems].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceLastNItems].inputs.searchValue.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceLastNItems].inputs.replaceValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=zrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Pat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPLACE_ALL,version:"1.0.0",description:"List replace all operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.ReplaceAll);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAll].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAll].inputs.searchValue.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.ReplaceAll].inputs.replaceValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=Yrt(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class xat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_ITEM,version:"1.0.0",description:"List get index item operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.GetIndexItem);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexItem].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexItem].inputs.index.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Jrt(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Vat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST,version:"1.0.0",description:"List get first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.GetFirst);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.GetFirst].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Qrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class _at extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST,version:"1.0.0",description:"List get last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.GetLast);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.GetLast].inputs.list.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Xrt(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Nat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_APPEND,version:"1.0.0",description:"List append operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Append);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Append].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Append].inputs.elementToAppend.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[ve.Append].inputs.dynamicArgument.id}).map(D=>{var N,$;return((N=D.value)==null?void 0:N.valueAsType)??(($=D.value)==null?void 0:$.value)}),I=eat(m,g,...R);return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class $at extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PREPEND,version:"1.0.0",description:"List prepend operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ve.Prepend);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Prepend].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Prepend].inputs.value.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=tat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Lat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LENGTH,version:"1.0.0",description:"List get length",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetLength);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===B.operation[ve.GetLength].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:j.Success,error:null,result:iat(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Gat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_DELETE_AT_INDEX,version:"1.0.0",description:"List delete one item at index (non-mutating)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.DeleteAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.DeleteAtIndex].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.DeleteAtIndex].inputs.index.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=nat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Bat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_FIRST_N_ITEMS,version:"1.0.0",description:"List get first N items",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetFirstNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetFirstNItems].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetFirstNItems].inputs.count.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=rat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Mat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_N_ITEMS,version:"1.0.0",description:"List get last N items",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetLastNItems);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastNItems].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastNItems].inputs.count.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=aat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Fat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SLICE,version:"1.0.0",description:"List slice(start, end)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Slice);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.Slice].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.Slice].inputs.startIndex.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.Slice].inputs.endIndex.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=sat(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Sat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONCAT,version:"1.0.0",description:"List concat(base, ...others)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Concat);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),[c,...e]=s,f=krt(c,...e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class kat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_INDEX_OF,version:"1.0.0",description:"List listGetIndexOf(value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexOf].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetIndexOf].inputs.searchValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=lat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Uat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_GET_LAST_INDEX_OF,version:"1.0.0",description:"List listGetLastIndexOf(value)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.GetLastIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastIndexOf].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.GetLastIndexOf].inputs.searchValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=oat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class jat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_UNIQUE,version:"1.0.0",description:"List unique (stable, by reference/===)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Unique);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Unique].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=dat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Kat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_FLATTEN,version:"1.0.0",description:"List flatten one level",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Flatten);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Flatten].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=uat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class qat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SORT,version:"1.0.0",description:"List sort (non-mutating). Supports lists of strings (alphabetic), numbers (numeric), or ISO date strings (chronological).",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Sort);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Sort].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=pat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Zat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_SHUFFLE,version:"1.0.0",description:"List shuffle (Fisher–Yates, secure RNG helper)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Shuffle);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c;try{const e=n.find(m=>{var T,g;return((g=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:g.id)===B.operation[ve.Shuffle].inputs.listValue.id}),f=((s=e==null?void 0:e.value)==null?void 0:s.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=cat(f);return{value:j.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:e,result:null}}}})}}class Hat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CHUNK,version:"1.0.0",description:"List chunk(size) -> list of lists",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Chunk);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Chunk].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Chunk].inputs.size.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=fat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Wat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_START,version:"1.0.0",description:"List padStart(targetLength, padValue)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.PadStart);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadStart].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadStart].inputs.targetLength.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadStart].inputs.padValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=yat(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class zat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_PAD_END,version:"1.0.0",description:"List padEnd(targetLength, padValue)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.PadEnd);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f,h,m;try{const T=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadEnd].inputs.listValue.id}),g=((s=T==null?void 0:T.value)==null?void 0:s.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),b=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadEnd].inputs.targetLength.id}),R=((e=b==null?void 0:b.value)==null?void 0:e.valueAsType)??((f=b==null?void 0:b.value)==null?void 0:f.value),I=n.find($=>{var x,L;return((L=(x=$.valueOwner)==null?void 0:x.declaration)==null?void 0:L.id)===B.operation[ve.PadEnd].inputs.padValue.id}),D=((h=I==null?void 0:I.value)==null?void 0:h.valueAsType)??((m=I==null?void 0:I.value)==null?void 0:m.value),N=hat(g,R,D);return{value:j.Success,error:null,result:N}}catch(T){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:T,result:null}}}})}}class Yat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_REPEAT,version:"1.0.0",description:"List repeat(count)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Repeat);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Repeat].inputs.listValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Repeat].inputs.count.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=mat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Jat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS,version:"1.0.0",description:"List contains (primitive needles)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.Contains);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Contains].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.Contains].inputs.needle.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=Tat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Qat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ALL,version:"1.0.0",description:"List contains all (primitive needles)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.ContainsAll);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAll].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAll].inputs.needle.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=vat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Xat extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__LIST_CONTAINS_ANY,version:"1.0.0",description:"List contains any (primitive needles)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ve.ContainsAny);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAny].inputs.list.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(R=>{var I,D;return((D=(I=R.valueOwner)==null?void 0:I.declaration)==null?void 0:D.id)===B.operation[ve.ContainsAny].inputs.needle.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),b=gat(m,g);return{value:j.Success,error:null,result:b}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class een extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LENGTH,version:"1.0.0",description:"Returns the number of characters in a string",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.GetLength);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.length;return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class est extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_JOIN,version:"1.0.0",description:"String join operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Join);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e;try{const f=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.separator.id}),h=((s=f==null?void 0:f.value)==null?void 0:s.value)||"",m=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.first.id}),T=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",g=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.second.id}),b=((e=g==null?void 0:g.value)==null?void 0:e.value)||"",I=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[le.Join].inputs.dynamicString.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)||((x=N.value)==null?void 0:x.value)||""}),D=[T,b,...I].join(h);return{value:j.Success,error:null,result:D}}catch(f){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:f,result:null}}}})}}class tst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_INDEX,version:"1.0.0",description:"String split at index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1],f={firstPart:c.slice(0,e),secondPart:c.slice(e)};return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ist extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_ALL_SEPARATORS,version:"1.0.0",description:"String split at all the occurrences of separators operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtAllSeparators);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1],f=c.split(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class nst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_FIRST_SEPARATOR,version:"1.0.0",description:"String split at the first occurrence of a separator operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtFirstSeparator);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=c.indexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class rst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SPLIT_AT_LAST_SEPARATOR,version:"1.0.0",description:"String split at the last occurrence of a separator operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.SplitAtLastSeparator);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=c.lastIndexOf(e),h={firstPart:c.slice(0,f),secondPart:c.slice(f+e.length)};return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ast extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_LAST_N_CHARS,version:"1.0.0",description:"String delete last number of characters operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.DeleteLastNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,-e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class sst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_FIRST_N_CHARS,version:"1.0.0",description:"String delete first number of characters operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.DeleteFirstNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class lst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REVERSE,version:"1.0.0",description:"String reverse operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Reverse);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const e=c.split("").reverse().join("");return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ost extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_LOWER_CASE,version:"1.0.0",description:"String to lower case operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ToLowerCase);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const e=c.toLowerCase();return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class dst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TO_UPPER_CASE,version:"1.0.0",description:"String to upper case operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ToUpperCase);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const e=c.toUpperCase();return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ust extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_DELETE_AT_INDEX,version:"1.0.0",description:"String delete index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.DeleteAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)||((b=T.value)==null?void 0:b.value)}),c=s[0],e=s[1],f=s[2]??1;if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=Math.min(f,c.length-e),m=c.slice(0,e)+c.slice(e+h);return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class pst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ADD_AT_INDEX,version:"1.0.0",description:"String add index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.AddAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,e)+f+c.slice(e);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class cst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_N_CHARS,version:"1.0.0",description:"String replace first operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceFirstNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1]??1,f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=f+c.slice(e);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class fst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_N_CHARS,version:"1.0.0",description:"String replace last operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceLastNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1]??1,f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.slice(0,-e)+f;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class yst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_AT_INDEX,version:"1.0.0",description:"String replace index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceAtIndex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)||((b=T.value)==null?void 0:b.value)}),c=s[0],e=s[1],f=s[2]??1,h=s[3];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const m=(c.slice(0,e)||"")+h+(c.slice(e+f)||"");return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class hst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_FIRST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceFirstMatch);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.replace(e,f);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class mst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_LAST_MATCH,version:"1.0.0",description:"String replace single match operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceLastMatch);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)||((b=T.value)==null?void 0:b.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.lastIndexOf(e),m=h===-1?c:c.substring(0,h)+f+c.substring(h+e.length);return{value:j.Success,error:null,result:m}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Tst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_ALL_MATCHES,version:"1.0.0",description:"String replace all matches operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.ReplaceAllMatches);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)||((g=m.value)==null?void 0:g.value)}),c=s[0],e=s[1],f=s[2];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const h=c.split(e).join(f);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class vst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_ITEM,version:"1.0.0",description:"String get index operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetIndexItem);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.charAt(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class gst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_N_CHARS,version:"1.0.0",description:"String get last N chars operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetLastNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(-e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Est extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_FIRST_N_CHARS,version:"1.0.0",description:"String get first N chars operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetFirstNChars);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=c.slice(0,e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class bst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_INDEX_OF,version:"1.0.0",description:"String get index of operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.GetIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};if(typeof e!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No search value provided",result:null};const f=c.indexOf(e);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ist extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_APPEND,version:"1.0.0",description:"String append operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Append);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[le.Append].inputs.stringValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[le.Append].inputs.valueToAppend.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(D=>{var N,$;return(($=(N=D.valueOwner)==null?void 0:N.declaration)==null?void 0:$.id)===B.operation[le.Append].inputs.dynamicArgument.id}).map(D=>{var N,$;return((N=D.value)==null?void 0:N.valueAsType)??(($=D.value)==null?void 0:$.value)});if(typeof m!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};if(typeof g!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No value to append provided",result:null};if(!R.every(D=>typeof D=="string"))return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"All values to append must be strings",result:null};const I=[m,g,...R].join("");return{value:j.Success,error:null,result:I}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class Ast extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PREPEND,version:"1.0.0",description:"String prepend operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(le.Prepend);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const s=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)||((T=h.value)==null?void 0:T.value)}),c=s[0],e=s[1];if(typeof c!="string")return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:"No string provided",result:null};const f=e+c;return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Rst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM,version:"1.0.0",description:"String trim implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Trim);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.trim();return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Dst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_START,version:"1.0.0",description:"String trimStart implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.TrimStart);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.trimStart();return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Cst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_TRIM_END,version:"1.0.0",description:"String trimEnd implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.TrimEnd);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=s.trimEnd();return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class wst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SUBSTRING,version:"1.0.0",description:"String substring(start, end?) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Substring);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.substring(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ost extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SLICE,version:"1.0.0",description:"String slice(start, end?) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Slice);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.slice(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Pst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_GET_LAST_INDEX_OF,version:"1.0.0",description:"String lastIndexOf(search, fromIndex?) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.GetLastIndexOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.lastIndexOf(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class xst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_START,version:"1.0.0",description:"String padStart(targetLength, padString?) implementation",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.PadStart);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.padStart(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Vst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_PAD_END,version:"1.0.0",description:"String padEnd(targetLength, padString?) implementation",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.PadEnd);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)}),f=s.padEnd(c,e??void 0);return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class _st extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPEAT,version:"1.0.0",description:"String repeat(count) implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Repeat);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=s.repeat(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Nst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_REGEX,version:"1.0.0",description:"String match(regex) -> first match array or null",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.MatchRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),f=new RegExp(String(c??""),e?String(e):void 0),h=String(s??"").match(f);return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class $st extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCH_ALL_REGEX,version:"1.0.0",description:"String matchAll(regex) -> array of matches",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.MatchAllRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(g=>{var b,R;return((b=g.value)==null?void 0:b.valueAsType)??((R=g.value)==null?void 0:R.value)}),f=e?String(e):"",h=f.includes("g")?f:f+"g",m=new RegExp(String(c??""),h),T=Array.from(String(s??"").matchAll(m),g=>Array.from(g));return{value:j.Success,error:null,result:T}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Lst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_SEARCH_REGEX,version:"1.0.0",description:"String search(regex) -> index or -1",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.SearchRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(h=>{var m,T;return((m=h.value)==null?void 0:m.valueAsType)??((T=h.value)==null?void 0:T.value)});let f=-1;try{const h=new RegExp(String(c??""),e?String(e):void 0);f=String(s??"").search(h)}catch{f=-1}return{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Gst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REPLACE_REGEX,version:"1.0.0",description:"String replace using RegExp (pattern, replacement, flags?)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.ReplaceRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e,f]=n.map(T=>{var g,b;return((g=T.value)==null?void 0:g.valueAsType)??((b=T.value)==null?void 0:b.value)});let h=String(s??"");const m=new RegExp(String(c??""),f?String(f):void 0);return h=h.replace(m,String(e??"")),{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Bst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_NORMALIZE_UNICODE,version:"1.0.0",description:"String normalize(form?) implementation module (NFC by default)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.NormalizeUnicode);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=s.normalize(c||"NFC");return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}const gD=class gD extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_DIACRITICS,version:"1.0.0",description:"Remove diacritics via NFD decomposition + strip combining marks",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.RemoveDiacritics);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=n.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(s??"").normalize("NFD").replace(gD.COMBINING_MARKS,"");return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}};C(gD,"COMBINING_MARKS",/[\u0300-\u036f]/g);let z1=gD;class Mst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_COUNT_OCCURRENCES,version:"1.0.0",description:"Count literal substring occurrences in a string",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.CountOccurrences);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=f===""?0:e.split(f).length-1;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Fst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_PREFIX,version:"1.0.0",description:"Ensure string starts with given prefix (add if missing)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.EnsurePrefix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.startsWith(f)?e:f+e;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Sst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENSURE_SUFFIX,version:"1.0.0",description:"Ensure string ends with given suffix (add if missing)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.EnsureSuffix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.endsWith(f)?e:e+f;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class kst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_PREFIX,version:"1.0.0",description:"Remove prefix if present",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.RemovePrefix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.startsWith(f)?e.slice(f.length):e;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Ust extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_REMOVE_SUFFIX,version:"1.0.0",description:"Remove suffix if present",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.RemoveSuffix);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)}),e=String(s??""),f=String(c??""),h=e.endsWith(f)?e.slice(0,-f.length):e;return{value:j.Success,error:null,result:h}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class jst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_STARTS_WITH,version:"1.0.0",description:"String startsWith(needle) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.StartsWith);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("StartsWith expects two strings.");const e=s.startsWith(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Kst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_ENDS_WITH,version:"1.0.0",description:"String endsWith(needle) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.EndsWith);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("EndsWith expects two strings.");const e=s.endsWith(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class qst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_CONTAINS,version:"1.0.0",description:"String includes(needle) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.Contains);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=n.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("Contains expects two strings.");const e=s.includes(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class Zst extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__STRING_MATCHES_REGEX,version:"1.0.0",description:"Regex test: new RegExp(pattern, flags?).test(src) -> boolean",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(le.MatchesRegex);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=n.map(m=>{var T,g;return((T=m.value)==null?void 0:T.valueAsType)??((g=m.value)==null?void 0:g.value)});if(typeof s!="string"||typeof c!="string")throw new TypeError("MatchesRegex expects source and pattern to be strings.");if(!(e===void 0||typeof e=="string"))throw new TypeError("MatchesRegex flags must be a string if provided.");let f=!1;return f=new RegExp(c,e).test(s),{value:j.Success,error:null,result:f}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}function Hst(l,u){const i=Number(l),s=10**Math.max(0,Number(u)||0);return Math.round(i*s)/s}function Wst(l,u){const i=Number(l),n=Math.abs(Number(u)||0);return n===0?i:Math.round(i/n)*n}function zst(l,u,i){const n=Number(l),s=Number(u),c=Number(i);return Math.min(Math.max(n,s),c)}function Yst(l,u,i,n,s){const c=Number(l),e=Number(u),f=Number(i),h=Number(n),m=Number(s);if(e===f)throw new Error("Input range cannot be zero");const T=(c-e)/(f-e);return h+T*(m-h)}function Jst(...l){const u=l.map(n=>Number(n));return u.length===0?0:u.reduce((n,s)=>n+s,0)/u.length}function Qst(...l){const u=l.map(n=>Number(n)).sort((n,s)=>n-s);if(u.length===0)return 0;const i=Math.floor(u.length/2);return u.length%2?u[i]:(u[i-1]+u[i])/2}function Xst(l,u){const i=Number(l),n=Number(u);return n===0?NaN:i<0&&n%2===1?-Math.pow(-i,1/n):Math.pow(i,1/n)}function elt(l,u){const i=Number(l),n=Number(u);return i===0?1/0:(n-i)/i*100}const mr=l=>l.map(u=>{var i,n;return((i=u.value)==null?void 0:i.valueAsType)??((n=u.value)==null?void 0:n.value)});class tlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ADDITION,version:"1.0.0",description:"Number addition operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Addition);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=mr(n).reduce((e,f)=>e+f,0);return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ilt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SUBTRACTION,version:"1.0.0",description:"Number subtraction operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Subtraction);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const c=mr(n).reduce((e,f)=>e-f,0);return{value:j.Success,error:null,result:c}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class nlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MULTIPLICATION,version:"1.0.0",description:"Number multiplication operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Multiplication);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Multiplication].inputs.firstFactor.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Multiplication].inputs.secondFactor.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Multiplication].inputs.dynamicFactor.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),D=[m,g,...R].reduce((N,$)=>N*$,1);return{value:j.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:h,result:null}}}})}}class rlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_DIVISION,version:"1.0.0",description:"Number division operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Division);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const[s,c]=mr(n);if(c===0)throw new Error("Division by zero is not allowed");const e=s/c;return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class alt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_REMAINDER,version:"1.0.0",description:"Number remainder operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Remainder);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const[s,c]=mr(n);if(c===0)throw new Error("Division by zero is not allowed");const e=s%c;return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class slt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXPONENTIATION,version:"1.0.0",description:"Number exponentiation operation implementation module",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(s=>s.contextType===ee.Logic);if(n){const s=n.get(ge.Exponentiation);s&&(s.autoexecutable=!0,s.implementation=this.module.main)}},main:async(i,n)=>{try{const[s,c]=mr(n),e=Math.pow(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class llt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NEGATE,version:"1.0.0",description:"Number negate (unary -x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Negate);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:-s}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class olt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ABSOLUTE,version:"1.0.0",description:"Number absolute (|x|)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Absolute);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.abs(Number(s))}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class dlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIGN,version:"1.0.0",description:"Number sign (-1 | 0 | 1)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Sign);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.sign(Number(s))}}catch(s){return{value:i.catchesError||i.errorCalls.length?j.CaughtError:j.UnhandledError,error:s,result:null}}}})}}class ult extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND,version:"1.0.0",description:"Number round to nearest integer",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Round);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.round(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class plt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_FLOOR,version:"1.0.0",description:"Number floor (⌊x⌋)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Floor);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.floor(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class clt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CEIL,version:"1.0.0",description:"Number ceil (⌈x⌉)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Ceil);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.ceil(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class flt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TRUNC,version:"1.0.0",description:"Number truncation (drop fractional part)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Trunc);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.trunc(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class ylt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ROUND_TO_DECIMALS,version:"1.0.0",description:"Round to N decimals",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.RoundToDecimals);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Hst(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class hlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SNAP_TO_STEP,version:"1.0.0",description:"Snap a number to the nearest multiple of step (>=0 step)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.SnapToStep);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Wst(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class mlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CLAMP,version:"1.0.0",description:"Clamp value to [min, max]",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Clamp);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e]=mr(n),f=zst(s,c,e);return{value:j.Success,error:null,result:f}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Tlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAP_RANGE,version:"1.0.0",description:"Map value from [inMin,inMax] to [outMin,outMax]",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MapRange);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c,e,f,h]=mr(n),m=Yst(s,c,e,f,h);return{value:j.Success,error:null,result:m}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class vlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_AVERAGE,version:"1.0.0",description:"Average(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Average);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Average].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Average].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Average].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R],D=Jst(...I);return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class glt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MEDIAN,version:"1.0.0",description:"Median(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Median);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Median].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Median].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.Median].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R],D=Qst(...I);return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class Elt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MIN_OF,version:"1.0.0",description:"Min(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MinOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MinOf].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MinOf].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MinOf].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R].filter(N=>typeof N=="number"&&!Number.isNaN(N)),D=I.length?Math.min(...I):1/0;return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class blt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MAX_OF,version:"1.0.0",description:"Max(numbers...)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MaxOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{var s,c,e,f;try{const h=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MaxOf].inputs.firstValue.id}),m=((s=h==null?void 0:h.value)==null?void 0:s.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=n.find(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MaxOf].inputs.secondValue.id}),g=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),R=n.filter(N=>{var $,x;return((x=($=N.valueOwner)==null?void 0:$.declaration)==null?void 0:x.id)===B.operation[ge.MaxOf].inputs.dynamicValue.id}).map(N=>{var $,x;return(($=N.value)==null?void 0:$.valueAsType)??((x=N.value)==null?void 0:x.value)}),I=[m,g,...R].filter(N=>typeof N=="number"&&!Number.isNaN(N)),D=I.length?Math.max(...I):-1/0;return{value:j.Success,error:null,result:D}}catch(h){return{value:j.UnhandledError,error:h,result:null}}}})}}class Ilt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SQUARE_ROOT,version:"1.0.0",description:"Square root",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.SquareRoot);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.sqrt(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Alt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_CUBE_ROOT,version:"1.0.0",description:"Cube root",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.CubeRoot);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.cbrt(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Rlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_NTH_ROOT,version:"1.0.0",description:"Nth root (value, n)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.NthRoot);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Xst(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Dlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_EXP,version:"1.0.0",description:"e^x",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Exp);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.exp(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Clt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG_NATURAL,version:"1.0.0",description:"Natural log ln(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.LogNatural);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.log(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class wlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LOG10,version:"1.0.0",description:"Log base 10",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Log10);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n),c=Number(s),e=Math.log10?Math.log10(c):Math.log(c)/Math.LN10;return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Olt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_SIN,version:"1.0.0",description:"sin(x in radians)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Sin);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.sin(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Plt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_COS,version:"1.0.0",description:"cos(x in radians)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Cos);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.cos(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class xlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TAN,version:"1.0.0",description:"tan(x in radians)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Tan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.tan(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Vlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ASIN,version:"1.0.0",description:"asin(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Asin);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.asin(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class _lt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ACOS,version:"1.0.0",description:"acos(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Acos);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.acos(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Nlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN,version:"1.0.0",description:"atan(x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Atan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Math.atan(Number(s))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class $lt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_ATAN2,version:"1.0.0",description:"atan2(y, x)",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.Atan2);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:Math.atan2(Number(s),Number(c))}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Llt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_RADIANS,version:"1.0.0",description:"deg → rad",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.ToRadians);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Number(s)*Math.PI/180}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Glt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_TO_DEGREES,version:"1.0.0",description:"rad → deg",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.ToDegrees);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s]=mr(n);return{value:j.Success,error:null,result:Number(s)*180/Math.PI}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Blt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENT_OF,version:"1.0.0",description:"x percent of y",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.PercentOf);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=Number(s)/100*Number(c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class yN extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_PERCENTAGE_CHANGE,version:"1.0.0",description:"((new-old)/old)*100",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.PercentageChange);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n),e=elt(s,c);return{value:j.Success,error:null,result:e}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Mlt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN,version:"1.0.0",description:"a < b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.LessThan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s<c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Flt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN,version:"1.0.0",description:"a > b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MoreThan);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s>c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class Slt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_LESS_THAN_OR_EQUAL,version:"1.0.0",description:"a <= b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.LessThanOrEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s<=c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}class klt extends $e{constructor(){super(...arguments);C(this,"manifest",{id:Be.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__NUMBER_MORE_THAN_OR_EQUAL,version:"1.0.0",description:"a >= b",initPriority:_e.High,permissions:[Ne.All],contexts:[ee.Logic]});C(this,"module",{init:i=>{const n=i.find(c=>c.contextType===ee.Logic),s=n==null?void 0:n.get(ge.MoreThanOrEqual);s&&(s.autoexecutable=!0,s.implementation=this.module.main)},main:async(i,n)=>{try{const[s,c]=mr(n);return{value:j.Success,error:null,result:s>=c}}catch(s){return{value:j.UnhandledError,error:s,result:null}}}})}}function Ult(l,u){return function(){return l.apply(u,arguments)}}const{toString:ten}=Object.prototype,{getPrototypeOf:aB}=Object,{iterator:Qw,toStringTag:jlt}=Symbol,Xw=(l=>u=>{const i=ten.call(u);return l[i]||(l[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),yp=l=>(l=l.toLowerCase(),u=>Xw(u)===l),eO=l=>u=>typeof u===l,{isArray:Nv}=Array,mT=eO("undefined");function SI(l){return l!==null&&!mT(l)&&l.constructor!==null&&!mT(l.constructor)&&So(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const Klt=yp("ArrayBuffer");function ien(l){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(l):u=l&&l.buffer&&Klt(l.buffer),u}const nen=eO("string"),So=eO("function"),qlt=eO("number"),kI=l=>l!==null&&typeof l=="object",ren=l=>l===!0||l===!1,D1=l=>{if(Xw(l)!=="object")return!1;const u=aB(l);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(jlt in l)&&!(Qw in l)},aen=l=>{if(!kI(l)||SI(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},sen=yp("Date"),len=yp("File"),oen=l=>!!(l&&typeof l.uri<"u"),den=l=>l&&typeof l.getParts<"u",uen=yp("Blob"),pen=yp("FileList"),cen=l=>kI(l)&&So(l.pipe);function fen(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const OK=fen(),PK=typeof OK.FormData<"u"?OK.FormData:void 0,yen=l=>{let u;return l&&(PK&&l instanceof PK||So(l.append)&&((u=Xw(l))==="formdata"||u==="object"&&So(l.toString)&&l.toString()==="[object FormData]"))},hen=yp("URLSearchParams"),[men,Ten,ven,gen]=["ReadableStream","Request","Response","Headers"].map(yp),Een=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function UI(l,u,{allOwnKeys:i=!1}={}){if(l===null||typeof l>"u")return;let n,s;if(typeof l!="object"&&(l=[l]),Nv(l))for(n=0,s=l.length;n<s;n++)u.call(null,l[n],n,l);else{if(SI(l))return;const c=i?Object.getOwnPropertyNames(l):Object.keys(l),e=c.length;let f;for(n=0;n<e;n++)f=c[n],u.call(null,l[f],f,l)}}function Zlt(l,u){if(SI(l))return null;u=u.toLowerCase();const i=Object.keys(l);let n=i.length,s;for(;n-- >0;)if(s=i[n],u===s.toLowerCase())return s;return null}const a0=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Hlt=l=>!mT(l)&&l!==a0;function hN(){const{caseless:l,skipUndefined:u}=Hlt(this)&&this||{},i={},n=(s,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const e=l&&Zlt(i,c)||c;D1(i[e])&&D1(s)?i[e]=hN(i[e],s):D1(s)?i[e]=hN({},s):Nv(s)?i[e]=s.slice():(!u||!mT(s))&&(i[e]=s)};for(let s=0,c=arguments.length;s<c;s++)arguments[s]&&UI(arguments[s],n);return i}const ben=(l,u,i,{allOwnKeys:n}={})=>(UI(u,(s,c)=>{i&&So(s)?Object.defineProperty(l,c,{value:Ult(s,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(l,c,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),l),Ien=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),Aen=(l,u,i,n)=>{l.prototype=Object.create(u.prototype,n),Object.defineProperty(l.prototype,"constructor",{value:l,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(l,"super",{value:u.prototype}),i&&Object.assign(l.prototype,i)},Ren=(l,u,i,n)=>{let s,c,e;const f={};if(u=u||{},l==null)return u;do{for(s=Object.getOwnPropertyNames(l),c=s.length;c-- >0;)e=s[c],(!n||n(e,l,u))&&!f[e]&&(u[e]=l[e],f[e]=!0);l=i!==!1&&aB(l)}while(l&&(!i||i(l,u))&&l!==Object.prototype);return u},Den=(l,u,i)=>{l=String(l),(i===void 0||i>l.length)&&(i=l.length),i-=u.length;const n=l.indexOf(u,i);return n!==-1&&n===i},Cen=l=>{if(!l)return null;if(Nv(l))return l;let u=l.length;if(!qlt(u))return null;const i=new Array(u);for(;u-- >0;)i[u]=l[u];return i},wen=(l=>u=>l&&u instanceof l)(typeof Uint8Array<"u"&&aB(Uint8Array)),Oen=(l,u)=>{const n=(l&&l[Qw]).call(l);let s;for(;(s=n.next())&&!s.done;){const c=s.value;u.call(l,c[0],c[1])}},Pen=(l,u)=>{let i;const n=[];for(;(i=l.exec(u))!==null;)n.push(i);return n},xen=yp("HTMLFormElement"),Ven=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,n,s){return n.toUpperCase()+s}),xK=(({hasOwnProperty:l})=>(u,i)=>l.call(u,i))(Object.prototype),_en=yp("RegExp"),Wlt=(l,u)=>{const i=Object.getOwnPropertyDescriptors(l),n={};UI(i,(s,c)=>{let e;(e=u(s,c,l))!==!1&&(n[c]=e||s)}),Object.defineProperties(l,n)},Nen=l=>{Wlt(l,(u,i)=>{if(So(l)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const n=l[i];if(So(n)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},$en=(l,u)=>{const i={},n=s=>{s.forEach(c=>{i[c]=!0})};return Nv(l)?n(l):n(String(l).split(u)),i},Len=()=>{},Gen=(l,u)=>l!=null&&Number.isFinite(l=+l)?l:u;function Ben(l){return!!(l&&So(l.append)&&l[jlt]==="FormData"&&l[Qw])}const Men=l=>{const u=new Array(10),i=(n,s)=>{if(kI(n)){if(u.indexOf(n)>=0)return;if(SI(n))return n;if(!("toJSON"in n)){u[s]=n;const c=Nv(n)?[]:{};return UI(n,(e,f)=>{const h=i(e,s+1);!mT(h)&&(c[f]=h)}),u[s]=void 0,c}}return n};return i(l,0)},Fen=yp("AsyncFunction"),Sen=l=>l&&(kI(l)||So(l))&&So(l.then)&&So(l.catch),zlt=((l,u)=>l?setImmediate:u?((i,n)=>(a0.addEventListener("message",({source:s,data:c})=>{s===a0&&c===i&&n.length&&n.shift()()},!1),s=>{n.push(s),a0.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",So(a0.postMessage)),ken=typeof queueMicrotask<"u"?queueMicrotask.bind(a0):typeof process<"u"&&process.nextTick||zlt,Uen=l=>l!=null&&So(l[Qw]),lt={isArray:Nv,isArrayBuffer:Klt,isBuffer:SI,isFormData:yen,isArrayBufferView:ien,isString:nen,isNumber:qlt,isBoolean:ren,isObject:kI,isPlainObject:D1,isEmptyObject:aen,isReadableStream:men,isRequest:Ten,isResponse:ven,isHeaders:gen,isUndefined:mT,isDate:sen,isFile:len,isReactNativeBlob:oen,isReactNative:den,isBlob:uen,isRegExp:_en,isFunction:So,isStream:cen,isURLSearchParams:hen,isTypedArray:wen,isFileList:pen,forEach:UI,merge:hN,extend:ben,trim:Een,stripBOM:Ien,inherits:Aen,toFlatObject:Ren,kindOf:Xw,kindOfTest:yp,endsWith:Den,toArray:Cen,forEachEntry:Oen,matchAll:Pen,isHTMLForm:xen,hasOwnProperty:xK,hasOwnProp:xK,reduceDescriptors:Wlt,freezeMethods:Nen,toObjectSet:$en,toCamelCase:Ven,noop:Len,toFiniteNumber:Gen,findKey:Zlt,global:a0,isContextDefined:Hlt,isSpecCompliantForm:Ben,toJSONObject:Men,isAsyncFn:Fen,isThenable:Sen,setImmediate:zlt,asap:ken,isIterable:Uen};class bo extends Error{static from(u,i,n,s,c,e){const f=new bo(u.message,i||u.code,n,s,c);return f.cause=u,f.name=u.name,u.status!=null&&f.status==null&&(f.status=u.status),e&&Object.assign(f,e),f}constructor(u,i,n,s,c){super(u),Object.defineProperty(this,"message",{value:u,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),n&&(this.config=n),s&&(this.request=s),c&&(this.response=c,this.status=c.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:lt.toJSONObject(this.config),code:this.code,status:this.status}}}bo.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";bo.ERR_BAD_OPTION="ERR_BAD_OPTION";bo.ECONNABORTED="ECONNABORTED";bo.ETIMEDOUT="ETIMEDOUT";bo.ERR_NETWORK="ERR_NETWORK";bo.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";bo.ERR_DEPRECATED="ERR_DEPRECATED";bo.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";bo.ERR_BAD_REQUEST="ERR_BAD_REQUEST";bo.ERR_CANCELED="ERR_CANCELED";bo.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";bo.ERR_INVALID_URL="ERR_INVALID_URL";const br=bo,jen=null;function mN(l){return lt.isPlainObject(l)||lt.isArray(l)}function Ylt(l){return lt.endsWith(l,"[]")?l.slice(0,-2):l}function A_(l,u,i){return l?l.concat(u).map(function(s,c){return s=Ylt(s),!i&&c?"["+s+"]":s}).join(i?".":""):u}function Ken(l){return lt.isArray(l)&&!l.some(mN)}const qen=lt.toFlatObject(lt,{},null,function(u){return/^is[A-Z]/.test(u)});function tO(l,u,i){if(!lt.isObject(l))throw new TypeError("target must be an object");u=u||new FormData,i=lt.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(D,N){return!lt.isUndefined(N[D])});const n=i.metaTokens,s=i.visitor||T,c=i.dots,e=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&<.isSpecCompliantForm(u);if(!lt.isFunction(s))throw new TypeError("visitor must be a function");function m(I){if(I===null)return"";if(lt.isDate(I))return I.toISOString();if(lt.isBoolean(I))return I.toString();if(!h&<.isBlob(I))throw new br("Blob is not supported. Use a Buffer instead.");return lt.isArrayBuffer(I)||lt.isTypedArray(I)?h&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function T(I,D,N){let $=I;if(lt.isReactNative(u)&<.isReactNativeBlob(I))return u.append(A_(N,D,c),m(I)),!1;if(I&&!N&&typeof I=="object"){if(lt.endsWith(D,"{}"))D=n?D:D.slice(0,-2),I=JSON.stringify(I);else if(lt.isArray(I)&&Ken(I)||(lt.isFileList(I)||lt.endsWith(D,"[]"))&&($=lt.toArray(I)))return D=Ylt(D),$.forEach(function(L,K){!(lt.isUndefined(L)||L===null)&&u.append(e===!0?A_([D],K,c):e===null?D:D+"[]",m(L))}),!1}return mN(I)?!0:(u.append(A_(N,D,c),m(I)),!1)}const g=[],b=Object.assign(qen,{defaultVisitor:T,convertValue:m,isVisitable:mN});function R(I,D){if(!lt.isUndefined(I)){if(g.indexOf(I)!==-1)throw Error("Circular reference detected in "+D.join("."));g.push(I),lt.forEach(I,function($,x){(!(lt.isUndefined($)||$===null)&&s.call(u,$,lt.isString(x)?x.trim():x,D,b))===!0&&R($,D?D.concat(x):[x])}),g.pop()}}if(!lt.isObject(l))throw new TypeError("data must be an object");return R(l),u}function VK(l){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(n){return u[n]})}function sB(l,u){this._pairs=[],l&&tO(l,this,u)}const Jlt=sB.prototype;Jlt.append=function(u,i){this._pairs.push([u,i])};Jlt.toString=function(u){const i=u?function(n){return u.call(this,n,VK)}:VK;return this._pairs.map(function(s){return i(s[0])+"="+i(s[1])},"").join("&")};function Zen(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Qlt(l,u,i){if(!u)return l;const n=i&&i.encode||Zen,s=lt.isFunction(i)?{serialize:i}:i,c=s&&s.serialize;let e;if(c?e=c(u,s):e=lt.isURLSearchParams(u)?u.toString():new sB(u,s).toString(n),e){const f=l.indexOf("#");f!==-1&&(l=l.slice(0,f)),l+=(l.indexOf("?")===-1?"?":"&")+e}return l}class Hen{constructor(){this.handlers=[]}use(u,i,n){return this.handlers.push({fulfilled:u,rejected:i,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){lt.forEach(this.handlers,function(n){n!==null&&u(n)})}}const _K=Hen,lB={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Wen=typeof URLSearchParams<"u"?URLSearchParams:sB,zen=typeof FormData<"u"?FormData:null,Yen=typeof Blob<"u"?Blob:null,Jen={isBrowser:!0,classes:{URLSearchParams:Wen,FormData:zen,Blob:Yen},protocols:["http","https","file","blob","url","data"]},oB=typeof window<"u"&&typeof document<"u",TN=typeof navigator=="object"&&navigator||void 0,Qen=oB&&(!TN||["ReactNative","NativeScript","NS"].indexOf(TN.product)<0),Xen=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),etn=oB&&window.location.href||"http://localhost",ttn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:oB,hasStandardBrowserEnv:Qen,hasStandardBrowserWebWorkerEnv:Xen,navigator:TN,origin:etn},Symbol.toStringTag,{value:"Module"})),Ll={...ttn,...Jen};function itn(l,u){return tO(l,new Ll.classes.URLSearchParams,{visitor:function(i,n,s,c){return Ll.isNode&<.isBuffer(i)?(this.append(n,i.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...u})}function ntn(l){return lt.matchAll(/\w+|\[(\w*)]/g,l).map(u=>u[0]==="[]"?"":u[1]||u[0])}function rtn(l){const u={},i=Object.keys(l);let n;const s=i.length;let c;for(n=0;n<s;n++)c=i[n],u[c]=l[c];return u}function Xlt(l){function u(i,n,s,c){let e=i[c++];if(e==="__proto__")return!0;const f=Number.isFinite(+e),h=c>=i.length;return e=!e&<.isArray(s)?s.length:e,h?(lt.hasOwnProp(s,e)?s[e]=[s[e],n]:s[e]=n,!f):((!s[e]||!lt.isObject(s[e]))&&(s[e]=[]),u(i,n,s[e],c)&<.isArray(s[e])&&(s[e]=rtn(s[e])),!f)}if(lt.isFormData(l)&<.isFunction(l.entries)){const i={};return lt.forEachEntry(l,(n,s)=>{u(ntn(n),s,i,0)}),i}return null}function atn(l,u,i){if(lt.isString(l))try{return(u||JSON.parse)(l),lt.trim(l)}catch(n){if(n.name!=="SyntaxError")throw n}return(i||JSON.stringify)(l)}const dB={transitional:lB,adapter:["xhr","http","fetch"],transformRequest:[function(u,i){const n=i.getContentType()||"",s=n.indexOf("application/json")>-1,c=lt.isObject(u);if(c&<.isHTMLForm(u)&&(u=new FormData(u)),lt.isFormData(u))return s?JSON.stringify(Xlt(u)):u;if(lt.isArrayBuffer(u)||lt.isBuffer(u)||lt.isStream(u)||lt.isFile(u)||lt.isBlob(u)||lt.isReadableStream(u))return u;if(lt.isArrayBufferView(u))return u.buffer;if(lt.isURLSearchParams(u))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),u.toString();let f;if(c){if(n.indexOf("application/x-www-form-urlencoded")>-1)return itn(u,this.formSerializer).toString();if((f=lt.isFileList(u))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return tO(f?{"files[]":u}:u,h&&new h,this.formSerializer)}}return c||s?(i.setContentType("application/json",!1),atn(u)):u}],transformResponse:[function(u){const i=this.transitional||dB.transitional,n=i&&i.forcedJSONParsing,s=this.responseType==="json";if(lt.isResponse(u)||lt.isReadableStream(u))return u;if(u&<.isString(u)&&(n&&!this.responseType||s)){const e=!(i&&i.silentJSONParsing)&&s;try{return JSON.parse(u,this.parseReviver)}catch(f){if(e)throw f.name==="SyntaxError"?br.from(f,br.ERR_BAD_RESPONSE,this,null,this.response):f}}return u}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ll.classes.FormData,Blob:Ll.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};lt.forEach(["delete","get","head","post","put","patch"],l=>{dB.headers[l]={}});const uB=dB,stn=lt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ltn=l=>{const u={};let i,n,s;return l&&l.split(`
|
|
50
50
|
`).forEach(function(e){s=e.indexOf(":"),i=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!(!i||u[i]&&stn[i])&&(i==="set-cookie"?u[i]?u[i].push(n):u[i]=[n]:u[i]=u[i]?u[i]+", "+n:n)}),u},NK=Symbol("internals");function Yg(l){return l&&String(l).trim().toLowerCase()}function C1(l){return l===!1||l==null?l:lt.isArray(l)?l.map(C1):String(l)}function otn(l){const u=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(l);)u[n[1]]=n[2];return u}const dtn=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function R_(l,u,i,n,s){if(lt.isFunction(n))return n.call(this,u,i);if(s&&(u=i),!!lt.isString(u)){if(lt.isString(n))return u.indexOf(n)!==-1;if(lt.isRegExp(n))return n.test(u)}}function utn(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(u,i,n)=>i.toUpperCase()+n)}function ptn(l,u){const i=lt.toCamelCase(" "+u);["get","set","has"].forEach(n=>{Object.defineProperty(l,n+i,{value:function(s,c,e){return this[n].call(this,u,s,c,e)},configurable:!0})})}class iO{constructor(u){u&&this.set(u)}set(u,i,n){const s=this;function c(f,h,m){const T=Yg(h);if(!T)throw new Error("header name must be a non-empty string");const g=lt.findKey(s,T);(!g||s[g]===void 0||m===!0||m===void 0&&s[g]!==!1)&&(s[g||h]=C1(f))}const e=(f,h)=>lt.forEach(f,(m,T)=>c(m,T,h));if(lt.isPlainObject(u)||u instanceof this.constructor)e(u,i);else if(lt.isString(u)&&(u=u.trim())&&!dtn(u))e(ltn(u),i);else if(lt.isObject(u)&<.isIterable(u)){let f={},h,m;for(const T of u){if(!lt.isArray(T))throw TypeError("Object iterator must return a key-value pair");f[m=T[0]]=(h=f[m])?lt.isArray(h)?[...h,T[1]]:[h,T[1]]:T[1]}e(f,i)}else u!=null&&c(i,u,n);return this}get(u,i){if(u=Yg(u),u){const n=lt.findKey(this,u);if(n){const s=this[n];if(!i)return s;if(i===!0)return otn(s);if(lt.isFunction(i))return i.call(this,s,n);if(lt.isRegExp(i))return i.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(u,i){if(u=Yg(u),u){const n=lt.findKey(this,u);return!!(n&&this[n]!==void 0&&(!i||R_(this,this[n],n,i)))}return!1}delete(u,i){const n=this;let s=!1;function c(e){if(e=Yg(e),e){const f=lt.findKey(n,e);f&&(!i||R_(n,n[f],f,i))&&(delete n[f],s=!0)}}return lt.isArray(u)?u.forEach(c):c(u),s}clear(u){const i=Object.keys(this);let n=i.length,s=!1;for(;n--;){const c=i[n];(!u||R_(this,this[c],c,u,!0))&&(delete this[c],s=!0)}return s}normalize(u){const i=this,n={};return lt.forEach(this,(s,c)=>{const e=lt.findKey(n,c);if(e){i[e]=C1(s),delete i[c];return}const f=u?utn(c):String(c).trim();f!==c&&delete i[c],i[f]=C1(s),n[f]=!0}),this}concat(...u){return this.constructor.concat(this,...u)}toJSON(u){const i=Object.create(null);return lt.forEach(this,(n,s)=>{n!=null&&n!==!1&&(i[s]=u&<.isArray(n)?n.join(", "):n)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([u,i])=>u+": "+i).join(`
|
|
51
51
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(u){return u instanceof this?u:new this(u)}static concat(u,...i){const n=new this(u);return i.forEach(s=>n.set(s)),n}static accessor(u){const n=(this[NK]=this[NK]={accessors:{}}).accessors,s=this.prototype;function c(e){const f=Yg(e);n[f]||(ptn(s,e),n[f]=!0)}return lt.isArray(u)?u.forEach(c):c(u),this}}iO.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);lt.reduceDescriptors(iO.prototype,({value:l},u)=>{let i=u[0].toUpperCase()+u.slice(1);return{get:()=>l,set(n){this[i]=n}}});lt.freezeMethods(iO);const Gu=iO;function D_(l,u){const i=this||uB,n=u||i,s=Gu.from(n.headers);let c=n.data;return lt.forEach(l,function(f){c=f.call(i,c,s.normalize(),u?u.status:void 0)}),s.normalize(),c}function eot(l){return!!(l&&l.__CANCEL__)}class ctn extends br{constructor(u,i,n){super(u??"canceled",br.ERR_CANCELED,i,n),this.name="CanceledError",this.__CANCEL__=!0}}const jI=ctn;function tot(l,u,i){const n=i.config.validateStatus;!i.status||!n||n(i.status)?l(i):u(new br("Request failed with status code "+i.status,[br.ERR_BAD_REQUEST,br.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function ftn(l){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l);return u&&u[1]||""}function ytn(l,u){l=l||10;const i=new Array(l),n=new Array(l);let s=0,c=0,e;return u=u!==void 0?u:1e3,function(h){const m=Date.now(),T=n[c];e||(e=m),i[s]=h,n[s]=m;let g=c,b=0;for(;g!==s;)b+=i[g++],g=g%l;if(s=(s+1)%l,s===c&&(c=(c+1)%l),m-e<u)return;const R=T&&m-T;return R?Math.round(b*1e3/R):void 0}}function htn(l,u){let i=0,n=1e3/u,s,c;const e=(m,T=Date.now())=>{i=T,s=null,c&&(clearTimeout(c),c=null),l(...m)};return[(...m)=>{const T=Date.now(),g=T-i;g>=n?e(m,T):(s=m,c||(c=setTimeout(()=>{c=null,e(s)},n-g)))},()=>s&&e(s)]}const Y1=(l,u,i=3)=>{let n=0;const s=ytn(50,250);return htn(c=>{const e=c.loaded,f=c.lengthComputable?c.total:void 0,h=e-n,m=s(h),T=e<=f;n=e;const g={loaded:e,total:f,progress:f?e/f:void 0,bytes:h,rate:m||void 0,estimated:m&&f&&T?(f-e)/m:void 0,event:c,lengthComputable:f!=null,[u?"download":"upload"]:!0};l(g)},i)},$K=(l,u)=>{const i=l!=null;return[n=>u[0]({lengthComputable:i,total:l,loaded:n}),u[1]]},LK=l=>(...u)=>lt.asap(()=>l(...u)),mtn=Ll.hasStandardBrowserEnv?((l,u)=>i=>(i=new URL(i,Ll.origin),l.protocol===i.protocol&&l.host===i.host&&(u||l.port===i.port)))(new URL(Ll.origin),Ll.navigator&&/(msie|trident)/i.test(Ll.navigator.userAgent)):()=>!0,Ttn=Ll.hasStandardBrowserEnv?{write(l,u,i,n,s,c,e){if(typeof document>"u")return;const f=[`${l}=${encodeURIComponent(u)}`];lt.isNumber(i)&&f.push(`expires=${new Date(i).toUTCString()}`),lt.isString(n)&&f.push(`path=${n}`),lt.isString(s)&&f.push(`domain=${s}`),c===!0&&f.push("secure"),lt.isString(e)&&f.push(`SameSite=${e}`),document.cookie=f.join("; ")},read(l){if(typeof document>"u")return null;const u=document.cookie.match(new RegExp("(?:^|; )"+l+"=([^;]*)"));return u?decodeURIComponent(u[1]):null},remove(l){this.write(l,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function vtn(l){return typeof l!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(l)}function gtn(l,u){return u?l.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):l}function iot(l,u,i){let n=!vtn(u);return l&&(n||i==!1)?gtn(l,u):u}const GK=l=>l instanceof Gu?{...l}:l;function c0(l,u){u=u||{};const i={};function n(m,T,g,b){return lt.isPlainObject(m)&<.isPlainObject(T)?lt.merge.call({caseless:b},m,T):lt.isPlainObject(T)?lt.merge({},T):lt.isArray(T)?T.slice():T}function s(m,T,g,b){if(lt.isUndefined(T)){if(!lt.isUndefined(m))return n(void 0,m,g,b)}else return n(m,T,g,b)}function c(m,T){if(!lt.isUndefined(T))return n(void 0,T)}function e(m,T){if(lt.isUndefined(T)){if(!lt.isUndefined(m))return n(void 0,m)}else return n(void 0,T)}function f(m,T,g){if(g in u)return n(m,T);if(g in l)return n(void 0,m)}const h={url:c,method:c,data:c,baseURL:e,transformRequest:e,transformResponse:e,paramsSerializer:e,timeout:e,timeoutMessage:e,withCredentials:e,withXSRFToken:e,adapter:e,responseType:e,xsrfCookieName:e,xsrfHeaderName:e,onUploadProgress:e,onDownloadProgress:e,decompress:e,maxContentLength:e,maxBodyLength:e,beforeRedirect:e,transport:e,httpAgent:e,httpsAgent:e,cancelToken:e,socketPath:e,responseEncoding:e,validateStatus:f,headers:(m,T,g)=>s(GK(m),GK(T),g,!0)};return lt.forEach(Object.keys({...l,...u}),function(T){if(T==="__proto__"||T==="constructor"||T==="prototype")return;const g=lt.hasOwnProp(h,T)?h[T]:s,b=g(l[T],u[T],T);lt.isUndefined(b)&&g!==f||(i[T]=b)}),i}const not=l=>{const u=c0({},l);let{data:i,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:c,headers:e,auth:f}=u;if(u.headers=e=Gu.from(e),u.url=Qlt(iot(u.baseURL,u.url,u.allowAbsoluteUrls),l.params,l.paramsSerializer),f&&e.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),lt.isFormData(i)){if(Ll.hasStandardBrowserEnv||Ll.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if(lt.isFunction(i.getHeaders)){const h=i.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([T,g])=>{m.includes(T.toLowerCase())&&e.set(T,g)})}}if(Ll.hasStandardBrowserEnv&&(n&<.isFunction(n)&&(n=n(u)),n||n!==!1&&mtn(u.url))){const h=s&&c&&Ttn.read(c);h&&e.set(s,h)}return u},Etn=typeof XMLHttpRequest<"u",btn=Etn&&function(l){return new Promise(function(i,n){const s=not(l);let c=s.data;const e=Gu.from(s.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:m}=s,T,g,b,R,I;function D(){R&&R(),I&&I(),s.cancelToken&&s.cancelToken.unsubscribe(T),s.signal&&s.signal.removeEventListener("abort",T)}let N=new XMLHttpRequest;N.open(s.method.toUpperCase(),s.url,!0),N.timeout=s.timeout;function $(){if(!N)return;const L=Gu.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),q={data:!f||f==="text"||f==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:L,config:l,request:N};tot(function(Z){i(Z),D()},function(Z){n(Z),D()},q),N=null}"onloadend"in N?N.onloadend=$:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout($)},N.onabort=function(){N&&(n(new br("Request aborted",br.ECONNABORTED,l,N)),N=null)},N.onerror=function(K){const q=K&&K.message?K.message:"Network Error",W=new br(q,br.ERR_NETWORK,l,N);W.event=K||null,n(W),N=null},N.ontimeout=function(){let K=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const q=s.transitional||lB;s.timeoutErrorMessage&&(K=s.timeoutErrorMessage),n(new br(K,q.clarifyTimeoutError?br.ETIMEDOUT:br.ECONNABORTED,l,N)),N=null},c===void 0&&e.setContentType(null),"setRequestHeader"in N&<.forEach(e.toJSON(),function(K,q){N.setRequestHeader(q,K)}),lt.isUndefined(s.withCredentials)||(N.withCredentials=!!s.withCredentials),f&&f!=="json"&&(N.responseType=s.responseType),m&&([b,I]=Y1(m,!0),N.addEventListener("progress",b)),h&&N.upload&&([g,R]=Y1(h),N.upload.addEventListener("progress",g),N.upload.addEventListener("loadend",R)),(s.cancelToken||s.signal)&&(T=L=>{N&&(n(!L||L.type?new jI(null,l,N):L),N.abort(),N=null)},s.cancelToken&&s.cancelToken.subscribe(T),s.signal&&(s.signal.aborted?T():s.signal.addEventListener("abort",T)));const x=ftn(s.url);if(x&&Ll.protocols.indexOf(x)===-1){n(new br("Unsupported protocol "+x+":",br.ERR_BAD_REQUEST,l));return}N.send(c||null)})},Itn=(l,u)=>{const{length:i}=l=l?l.filter(Boolean):[];if(u||i){let n=new AbortController,s;const c=function(m){if(!s){s=!0,f();const T=m instanceof Error?m:this.reason;n.abort(T instanceof br?T:new jI(T instanceof Error?T.message:T))}};let e=u&&setTimeout(()=>{e=null,c(new br(`timeout of ${u}ms exceeded`,br.ETIMEDOUT))},u);const f=()=>{l&&(e&&clearTimeout(e),e=null,l.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),l=null)};l.forEach(m=>m.addEventListener("abort",c));const{signal:h}=n;return h.unsubscribe=()=>lt.asap(f),h}},Atn=Itn,Rtn=function*(l,u){let i=l.byteLength;if(!u||i<u){yield l;return}let n=0,s;for(;n<i;)s=n+u,yield l.slice(n,s),n=s},Dtn=async function*(l,u){for await(const i of Ctn(l))yield*Rtn(i,u)},Ctn=async function*(l){if(l[Symbol.asyncIterator]){yield*l;return}const u=l.getReader();try{for(;;){const{done:i,value:n}=await u.read();if(i)break;yield n}}finally{await u.cancel()}},BK=(l,u,i,n)=>{const s=Dtn(l,u);let c=0,e,f=h=>{e||(e=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:m,value:T}=await s.next();if(m){f(),h.close();return}let g=T.byteLength;if(i){let b=c+=g;i(b)}h.enqueue(new Uint8Array(T))}catch(m){throw f(m),m}},cancel(h){return f(h),s.return()}},{highWaterMark:2})},MK=64*1024,{isFunction:h1}=lt,wtn=(({Request:l,Response:u})=>({Request:l,Response:u}))(lt.global),{ReadableStream:FK,TextEncoder:SK}=lt.global,kK=(l,...u)=>{try{return!!l(...u)}catch{return!1}},Otn=l=>{l=lt.merge.call({skipUndefined:!0},wtn,l);const{fetch:u,Request:i,Response:n}=l,s=u?h1(u):typeof fetch=="function",c=h1(i),e=h1(n);if(!s)return!1;const f=s&&h1(FK),h=s&&(typeof SK=="function"?(I=>D=>I.encode(D))(new SK):async I=>new Uint8Array(await new i(I).arrayBuffer())),m=c&&f&&kK(()=>{let I=!1;const D=new i(Ll.origin,{body:new FK,method:"POST",get duplex(){return I=!0,"half"}}).headers.has("Content-Type");return I&&!D}),T=e&&f&&kK(()=>lt.isReadableStream(new n("").body)),g={stream:T&&(I=>I.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(I=>{!g[I]&&(g[I]=(D,N)=>{let $=D&&D[I];if($)return $.call(D);throw new br(`Response type '${I}' is not supported`,br.ERR_NOT_SUPPORT,N)})});const b=async I=>{if(I==null)return 0;if(lt.isBlob(I))return I.size;if(lt.isSpecCompliantForm(I))return(await new i(Ll.origin,{method:"POST",body:I}).arrayBuffer()).byteLength;if(lt.isArrayBufferView(I)||lt.isArrayBuffer(I))return I.byteLength;if(lt.isURLSearchParams(I)&&(I=I+""),lt.isString(I))return(await h(I)).byteLength},R=async(I,D)=>{const N=lt.toFiniteNumber(I.getContentLength());return N??b(D)};return async I=>{let{url:D,method:N,data:$,signal:x,cancelToken:L,timeout:K,onDownloadProgress:q,onUploadProgress:W,responseType:Z,headers:X,withCredentials:te="same-origin",fetchOptions:z}=not(I),J=u||fetch;Z=Z?(Z+"").toLowerCase():"text";let Q=Atn([x,L&&L.toAbortSignal()],K),ne=null;const ae=Q&&Q.unsubscribe&&(()=>{Q.unsubscribe()});let de;try{if(W&&m&&N!=="get"&&N!=="head"&&(de=await R(X,$))!==0){let xe=new i(D,{method:"POST",body:$,duplex:"half"}),Re;if(lt.isFormData($)&&(Re=xe.headers.get("content-type"))&&X.setContentType(Re),xe.body){const[Ke,Je]=$K(de,Y1(LK(W)));$=BK(xe.body,MK,Ke,Je)}}lt.isString(te)||(te=te?"include":"omit");const fe=c&&"credentials"in i.prototype,me={...z,signal:Q,method:N.toUpperCase(),headers:X.normalize().toJSON(),body:$,duplex:"half",credentials:fe?te:void 0};ne=c&&new i(D,me);let be=await(c?J(ne,z):J(D,me));const Ce=T&&(Z==="stream"||Z==="response");if(T&&(q||Ce&&ae)){const xe={};["status","statusText","headers"].forEach(Ue=>{xe[Ue]=be[Ue]});const Re=lt.toFiniteNumber(be.headers.get("content-length")),[Ke,Je]=q&&$K(Re,Y1(LK(q),!0))||[];be=new n(BK(be.body,MK,Ke,()=>{Je&&Je(),ae&&ae()}),xe)}Z=Z||"text";let Oe=await g[lt.findKey(g,Z)||"text"](be,I);return!Ce&&ae&&ae(),await new Promise((xe,Re)=>{tot(xe,Re,{data:Oe,headers:Gu.from(be.headers),status:be.status,statusText:be.statusText,config:I,request:ne})})}catch(fe){throw ae&&ae(),fe&&fe.name==="TypeError"&&/Load failed|fetch/i.test(fe.message)?Object.assign(new br("Network Error",br.ERR_NETWORK,I,ne,fe&&fe.response),{cause:fe.cause||fe}):br.from(fe,fe&&fe.code,I,ne,fe&&fe.response)}}},Ptn=new Map,rot=l=>{let u=l&&l.env||{};const{fetch:i,Request:n,Response:s}=u,c=[n,s,i];let e=c.length,f=e,h,m,T=Ptn;for(;f--;)h=c[f],m=T.get(h),m===void 0&&T.set(h,m=f?new Map:Otn(u)),T=m;return m};rot();const pB={http:jen,xhr:btn,fetch:{get:rot}};lt.forEach(pB,(l,u)=>{if(l){try{Object.defineProperty(l,"name",{value:u})}catch{}Object.defineProperty(l,"adapterName",{value:u})}});const UK=l=>`- ${l}`,xtn=l=>lt.isFunction(l)||l===null||l===!1;function Vtn(l,u){l=lt.isArray(l)?l:[l];const{length:i}=l;let n,s;const c={};for(let e=0;e<i;e++){n=l[e];let f;if(s=n,!xtn(n)&&(s=pB[(f=String(n)).toLowerCase()],s===void 0))throw new br(`Unknown adapter '${f}'`);if(s&&(lt.isFunction(s)||(s=s.get(u))))break;c[f||"#"+e]=s}if(!s){const e=Object.entries(c).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let f=i?e.length>1?`since :
|
|
52
52
|
`+e.map(UK).join(`
|