@elyx-code/project-logic-tree 0.0.6972 → 0.0.6973

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 CHANGED
@@ -51,7 +51,7 @@ This is likely an incorrect strategy, either the '${this.type}' entity doesn't n
51
51
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(p){return p instanceof this?p:new this(p)}static concat(p,...i){const r=new this(p);return i.forEach(a=>r.set(a)),r}static accessor(p){const r=(this[rU]=this[rU]={accessors:{}}).accessors,a=this.prototype;function c(e){const f=S0(e);r[f]||(t1i(a,e),r[f]=!0)}return He.isArray(p)?p.forEach(c):c(p),this}}_1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);He.reduceDescriptors(_1.prototype,({value:s},p)=>{let i=p[0].toUpperCase()+p.slice(1);return{get:()=>s,set(r){this[i]=r}}});He.freezeMethods(_1);const so=_1;function s_(s,p){const i=this||h$,r=p||i,a=so.from(r.headers);let c=r.data;return He.forEach(s,function(f){c=f.call(i,c,a.normalize(),p?p.status:void 0)}),a.normalize(),c}function XBe(s){return!!(s&&s.__CANCEL__)}class i1i extends ar{constructor(p,i,r){super(p??"canceled",ar.ERR_CANCELED,i,r),this.name="CanceledError",this.__CANCEL__=!0}}const _E=i1i;function e2e(s,p,i){const r=i.config.validateStatus;!i.status||!r||r(i.status)?s(i):p(new ar("Request failed with status code "+i.status,[ar.ERR_BAD_REQUEST,ar.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function r1i(s){const p=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return p&&p[1]||""}function n1i(s,p){s=s||10;const i=new Array(s),r=new Array(s);let a=0,c=0,e;return p=p!==void 0?p:1e3,function(h){const m=Date.now(),E=r[c];e||(e=m),i[a]=h,r[a]=m;let b=c,A=0;for(;b!==a;)A+=i[b++],b=b%s;if(a=(a+1)%s,a===c&&(c=(c+1)%s),m-e<p)return;const _=E&&m-E;return _?Math.round(A*1e3/_):void 0}}function a1i(s,p){let i=0,r=1e3/p,a,c;const e=(m,E=Date.now())=>{i=E,a=null,c&&(clearTimeout(c),c=null),s(...m)};return[(...m)=>{const E=Date.now(),b=E-i;b>=r?e(m,E):(a=m,c||(c=setTimeout(()=>{c=null,e(a)},r-b)))},()=>a&&e(a)]}const kg=(s,p,i=3)=>{let r=0;const a=n1i(50,250);return a1i(c=>{const e=c.loaded,f=c.lengthComputable?c.total:void 0,h=e-r,m=a(h),E=e<=f;r=e;const b={loaded:e,total:f,progress:f?e/f:void 0,bytes:h,rate:m||void 0,estimated:m&&f&&E?(f-e)/m:void 0,event:c,lengthComputable:f!=null,[p?"download":"upload"]:!0};s(b)},i)},nU=(s,p)=>{const i=s!=null;return[r=>p[0]({lengthComputable:i,total:s,loaded:r}),p[1]]},aU=s=>(...p)=>He.asap(()=>s(...p)),s1i=Da.hasStandardBrowserEnv?((s,p)=>i=>(i=new URL(i,Da.origin),s.protocol===i.protocol&&s.host===i.host&&(p||s.port===i.port)))(new URL(Da.origin),Da.navigator&&/(msie|trident)/i.test(Da.navigator.userAgent)):()=>!0,l1i=Da.hasStandardBrowserEnv?{write(s,p,i,r,a,c,e){if(typeof document>"u")return;const f=[`${s}=${encodeURIComponent(p)}`];He.isNumber(i)&&f.push(`expires=${new Date(i).toUTCString()}`),He.isString(r)&&f.push(`path=${r}`),He.isString(a)&&f.push(`domain=${a}`),c===!0&&f.push("secure"),He.isString(e)&&f.push(`SameSite=${e}`),document.cookie=f.join("; ")},read(s){if(typeof document>"u")return null;const p=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return p?decodeURIComponent(p[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function o1i(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function d1i(s,p){return p?s.replace(/\/?\/$/,"")+"/"+p.replace(/^\/+/,""):s}function t2e(s,p,i){let r=!o1i(p);return s&&(r||i==!1)?d1i(s,p):p}const sU=s=>s instanceof so?{...s}:s;function Of(s,p){p=p||{};const i={};function r(m,E,b,A){return He.isPlainObject(m)&&He.isPlainObject(E)?He.merge.call({caseless:A},m,E):He.isPlainObject(E)?He.merge({},E):He.isArray(E)?E.slice():E}function a(m,E,b,A){if(He.isUndefined(E)){if(!He.isUndefined(m))return r(void 0,m,b,A)}else return r(m,E,b,A)}function c(m,E){if(!He.isUndefined(E))return r(void 0,E)}function e(m,E){if(He.isUndefined(E)){if(!He.isUndefined(m))return r(void 0,m)}else return r(void 0,E)}function f(m,E,b){if(b in p)return r(m,E);if(b in s)return r(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,E,b)=>a(sU(m),sU(E),b,!0)};return He.forEach(Object.keys({...s,...p}),function(E){if(E==="__proto__"||E==="constructor"||E==="prototype")return;const b=He.hasOwnProp(h,E)?h[E]:a,A=b(s[E],p[E],E);He.isUndefined(A)&&b!==f||(i[E]=A)}),i}const i2e=s=>{const p=Of({},s);let{data:i,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:c,headers:e,auth:f}=p;if(p.headers=e=so.from(e),p.url=JBe(t2e(p.baseURL,p.url,p.allowAbsoluteUrls),s.params,s.paramsSerializer),f&&e.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),He.isFormData(i)){if(Da.hasStandardBrowserEnv||Da.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if(He.isFunction(i.getHeaders)){const h=i.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([E,b])=>{m.includes(E.toLowerCase())&&e.set(E,b)})}}if(Da.hasStandardBrowserEnv&&(r&&He.isFunction(r)&&(r=r(p)),r||r!==!1&&s1i(p.url))){const h=a&&c&&l1i.read(c);h&&e.set(a,h)}return p},u1i=typeof XMLHttpRequest<"u",p1i=u1i&&function(s){return new Promise(function(i,r){const a=i2e(s);let c=a.data;const e=so.from(a.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:m}=a,E,b,A,_,P;function V(){_&&_(),P&&P(),a.cancelToken&&a.cancelToken.unsubscribe(E),a.signal&&a.signal.removeEventListener("abort",E)}let M=new XMLHttpRequest;M.open(a.method.toUpperCase(),a.url,!0),M.timeout=a.timeout;function G(){if(!M)return;const K=so.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),X={data:!f||f==="text"||f==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:K,config:s,request:M};e2e(function(te){i(te),V()},function(te){r(te),V()},X),M=null}"onloadend"in M?M.onloadend=G:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(G)},M.onabort=function(){M&&(r(new ar("Request aborted",ar.ECONNABORTED,s,M)),M=null)},M.onerror=function(le){const X=le&&le.message?le.message:"Network Error",ae=new ar(X,ar.ERR_NETWORK,s,M);ae.event=le||null,r(ae),M=null},M.ontimeout=function(){let le=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const X=a.transitional||c$;a.timeoutErrorMessage&&(le=a.timeoutErrorMessage),r(new ar(le,X.clarifyTimeoutError?ar.ETIMEDOUT:ar.ECONNABORTED,s,M)),M=null},c===void 0&&e.setContentType(null),"setRequestHeader"in M&&He.forEach(e.toJSON(),function(le,X){M.setRequestHeader(X,le)}),He.isUndefined(a.withCredentials)||(M.withCredentials=!!a.withCredentials),f&&f!=="json"&&(M.responseType=a.responseType),m&&([A,P]=kg(m,!0),M.addEventListener("progress",A)),h&&M.upload&&([b,_]=kg(h),M.upload.addEventListener("progress",b),M.upload.addEventListener("loadend",_)),(a.cancelToken||a.signal)&&(E=K=>{M&&(r(!K||K.type?new _E(null,s,M):K),M.abort(),M=null)},a.cancelToken&&a.cancelToken.subscribe(E),a.signal&&(a.signal.aborted?E():a.signal.addEventListener("abort",E)));const k=r1i(a.url);if(k&&Da.protocols.indexOf(k)===-1){r(new ar("Unsupported protocol "+k+":",ar.ERR_BAD_REQUEST,s));return}M.send(c||null)})},c1i=(s,p)=>{const{length:i}=s=s?s.filter(Boolean):[];if(p||i){let r=new AbortController,a;const c=function(m){if(!a){a=!0,f();const E=m instanceof Error?m:this.reason;r.abort(E instanceof ar?E:new _E(E instanceof Error?E.message:E))}};let e=p&&setTimeout(()=>{e=null,c(new ar(`timeout of ${p}ms exceeded`,ar.ETIMEDOUT))},p);const f=()=>{s&&(e&&clearTimeout(e),e=null,s.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),s=null)};s.forEach(m=>m.addEventListener("abort",c));const{signal:h}=r;return h.unsubscribe=()=>He.asap(f),h}},f1i=c1i,y1i=function*(s,p){let i=s.byteLength;if(!p||i<p){yield s;return}let r=0,a;for(;r<i;)a=r+p,yield s.slice(r,a),r=a},h1i=async function*(s,p){for await(const i of m1i(s))yield*y1i(i,p)},m1i=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const p=s.getReader();try{for(;;){const{done:i,value:r}=await p.read();if(i)break;yield r}}finally{await p.cancel()}},lU=(s,p,i,r)=>{const a=h1i(s,p);let c=0,e,f=h=>{e||(e=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:E}=await a.next();if(m){f(),h.close();return}let b=E.byteLength;if(i){let A=c+=b;i(A)}h.enqueue(new Uint8Array(E))}catch(m){throw f(m),m}},cancel(h){return f(h),a.return()}},{highWaterMark:2})},oU=64*1024,{isFunction:sg}=He,T1i=(({Request:s,Response:p})=>({Request:s,Response:p}))(He.global),{ReadableStream:dU,TextEncoder:uU}=He.global,pU=(s,...p)=>{try{return!!s(...p)}catch{return!1}},v1i=s=>{s=He.merge.call({skipUndefined:!0},T1i,s);const{fetch:p,Request:i,Response:r}=s,a=p?sg(p):typeof fetch=="function",c=sg(i),e=sg(r);if(!a)return!1;const f=a&&sg(dU),h=a&&(typeof uU=="function"?(P=>V=>P.encode(V))(new uU):async P=>new Uint8Array(await new i(P).arrayBuffer())),m=c&&f&&pU(()=>{let P=!1;const V=new i(Da.origin,{body:new dU,method:"POST",get duplex(){return P=!0,"half"}}).headers.has("Content-Type");return P&&!V}),E=e&&f&&pU(()=>He.isReadableStream(new r("").body)),b={stream:E&&(P=>P.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(P=>{!b[P]&&(b[P]=(V,M)=>{let G=V&&V[P];if(G)return G.call(V);throw new ar(`Response type '${P}' is not supported`,ar.ERR_NOT_SUPPORT,M)})});const A=async P=>{if(P==null)return 0;if(He.isBlob(P))return P.size;if(He.isSpecCompliantForm(P))return(await new i(Da.origin,{method:"POST",body:P}).arrayBuffer()).byteLength;if(He.isArrayBufferView(P)||He.isArrayBuffer(P))return P.byteLength;if(He.isURLSearchParams(P)&&(P=P+""),He.isString(P))return(await h(P)).byteLength},_=async(P,V)=>{const M=He.toFiniteNumber(P.getContentLength());return M??A(V)};return async P=>{let{url:V,method:M,data:G,signal:k,cancelToken:K,timeout:le,onDownloadProgress:X,onUploadProgress:ae,responseType:te,headers:ne,withCredentials:ue="same-origin",fetchOptions:ee}=i2e(P),z=p||fetch;te=te?(te+"").toLowerCase():"text";let oe=f1i([k,K&&K.toAbortSignal()],le),ye=null;const pe=oe&&oe.unsubscribe&&(()=>{oe.unsubscribe()});let he;try{if(ae&&m&&M!=="get"&&M!=="head"&&(he=await _(ne,G))!==0){let Se=new i(V,{method:"POST",body:G,duplex:"half"}),Ke;if(He.isFormData(G)&&(Ke=Se.headers.get("content-type"))&&ne.setContentType(Ke),Se.body){const[Xe,Tt]=nU(he,kg(aU(ae)));G=lU(Se.body,oU,Xe,Tt)}}He.isString(ue)||(ue=ue?"include":"omit");const Ae=c&&"credentials"in i.prototype,Re={...ee,signal:oe,method:M.toUpperCase(),headers:ne.normalize().toJSON(),body:G,duplex:"half",credentials:Ae?ue:void 0};ye=c&&new i(V,Re);let Oe=await(c?z(ye,ee):z(V,Re));const Be=E&&(te==="stream"||te==="response");if(E&&(X||Be&&pe)){const Se={};["status","statusText","headers"].forEach(pt=>{Se[pt]=Oe[pt]});const Ke=He.toFiniteNumber(Oe.headers.get("content-length")),[Xe,Tt]=X&&nU(Ke,kg(aU(X),!0))||[];Oe=new r(lU(Oe.body,oU,Xe,()=>{Tt&&Tt(),pe&&pe()}),Se)}te=te||"text";let Ge=await b[He.findKey(b,te)||"text"](Oe,P);return!Be&&pe&&pe(),await new Promise((Se,Ke)=>{e2e(Se,Ke,{data:Ge,headers:so.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:P,request:ye})})}catch(Ae){throw pe&&pe(),Ae&&Ae.name==="TypeError"&&/Load failed|fetch/i.test(Ae.message)?Object.assign(new ar("Network Error",ar.ERR_NETWORK,P,ye,Ae&&Ae.response),{cause:Ae.cause||Ae}):ar.from(Ae,Ae&&Ae.code,P,ye,Ae&&Ae.response)}}},E1i=new Map,r2e=s=>{let p=s&&s.env||{};const{fetch:i,Request:r,Response:a}=p,c=[r,a,i];let e=c.length,f=e,h,m,E=E1i;for(;f--;)h=c[f],m=E.get(h),m===void 0&&E.set(h,m=f?new Map:v1i(p)),E=m;return m};r2e();const m$={http:xRi,xhr:p1i,fetch:{get:r2e}};He.forEach(m$,(s,p)=>{if(s){try{Object.defineProperty(s,"name",{value:p})}catch{}Object.defineProperty(s,"adapterName",{value:p})}});const cU=s=>`- ${s}`,b1i=s=>He.isFunction(s)||s===null||s===!1;function A1i(s,p){s=He.isArray(s)?s:[s];const{length:i}=s;let r,a;const c={};for(let e=0;e<i;e++){r=s[e];let f;if(a=r,!b1i(r)&&(a=m$[(f=String(r)).toLowerCase()],a===void 0))throw new ar(`Unknown adapter '${f}'`);if(a&&(He.isFunction(a)||(a=a.get(p))))break;c[f||"#"+e]=a}if(!a){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(cU).join(`
53
53
  `):" "+cU(e[0]):"as no adapter specified";throw new ar("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return a}const n2e={getAdapter:A1i,adapters:m$};function l_(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new _E(null,s)}function fU(s){return l_(s),s.headers=so.from(s.headers),s.data=s_.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),n2e.getAdapter(s.adapter||h$.adapter,s)(s).then(function(r){return l_(s),r.data=s_.call(s,s.transformResponse,r),r.headers=so.from(r.headers),r},function(r){return XBe(r)||(l_(s),r&&r.response&&(r.response.data=s_.call(s,s.transformResponse,r.response),r.response.headers=so.from(r.response.headers))),Promise.reject(r)})}const a2e="1.13.6",V1={};["object","boolean","number","function","string","symbol"].forEach((s,p)=>{V1[s]=function(r){return typeof r===s||"a"+(p<1?"n ":" ")+s}});const yU={};V1.transitional=function(p,i,r){function a(c,e){return"[Axios v"+a2e+"] Transitional option '"+c+"'"+e+(r?". "+r:"")}return(c,e,f)=>{if(p===!1)throw new ar(a(e," has been removed"+(i?" in "+i:"")),ar.ERR_DEPRECATED);return i&&!yU[e]&&(yU[e]=!0,console.warn(a(e," has been deprecated since v"+i+" and will be removed in the near future"))),p?p(c,e,f):!0}};V1.spelling=function(p){return(i,r)=>(console.warn(`${r} is likely a misspelling of ${p}`),!0)};function g1i(s,p,i){if(typeof s!="object")throw new ar("options must be an object",ar.ERR_BAD_OPTION_VALUE);const r=Object.keys(s);let a=r.length;for(;a-- >0;){const c=r[a],e=p[c];if(e){const f=s[c],h=f===void 0||e(f,c,s);if(h!==!0)throw new ar("option "+c+" must be "+h,ar.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new ar("Unknown option "+c,ar.ERR_BAD_OPTION)}}const Tg={assertOptions:g1i,validators:V1},ml=Tg.validators;class jg{constructor(p){this.defaults=p||{},this.interceptors={request:new iU,response:new iU}}async request(p,i){try{return await this._request(p,i)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const c=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?c&&!String(r.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(r.stack+=`
54
- `+c):r.stack=c}catch{}}throw r}}_request(p,i){typeof p=="string"?(i=i||{},i.url=p):i=p||{},i=Of(this.defaults,i);const{transitional:r,paramsSerializer:a,headers:c}=i;r!==void 0&&Tg.assertOptions(r,{silentJSONParsing:ml.transitional(ml.boolean),forcedJSONParsing:ml.transitional(ml.boolean),clarifyTimeoutError:ml.transitional(ml.boolean),legacyInterceptorReqResOrdering:ml.transitional(ml.boolean)},!1),a!=null&&(He.isFunction(a)?i.paramsSerializer={serialize:a}:Tg.assertOptions(a,{encode:ml.function,serialize:ml.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Tg.assertOptions(i,{baseUrl:ml.spelling("baseURL"),withXsrfToken:ml.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=c&&He.merge(c.common,c[i.method]);c&&He.forEach(["delete","get","head","post","put","patch","common"],P=>{delete c[P]}),i.headers=so.concat(e,c);const f=[];let h=!0;this.interceptors.request.forEach(function(V){if(typeof V.runWhen=="function"&&V.runWhen(i)===!1)return;h=h&&V.synchronous;const M=i.transitional||c$;M&&M.legacyInterceptorReqResOrdering?f.unshift(V.fulfilled,V.rejected):f.push(V.fulfilled,V.rejected)});const m=[];this.interceptors.response.forEach(function(V){m.push(V.fulfilled,V.rejected)});let E,b=0,A;if(!h){const P=[fU.bind(this),void 0];for(P.unshift(...f),P.push(...m),A=P.length,E=Promise.resolve(i);b<A;)E=E.then(P[b++],P[b++]);return E}A=f.length;let _=i;for(;b<A;){const P=f[b++],V=f[b++];try{_=P(_)}catch(M){V.call(this,M);break}}try{E=fU.call(this,_)}catch(P){return Promise.reject(P)}for(b=0,A=m.length;b<A;)E=E.then(m[b++],m[b++]);return E}getUri(p){p=Of(this.defaults,p);const i=t2e(p.baseURL,p.url,p.allowAbsoluteUrls);return JBe(i,p.params,p.paramsSerializer)}}He.forEach(["delete","get","head","options"],function(p){jg.prototype[p]=function(i,r){return this.request(Of(r||{},{method:p,url:i,data:(r||{}).data}))}});He.forEach(["post","put","patch"],function(p){function i(r){return function(c,e,f){return this.request(Of(f||{},{method:p,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:e}))}}jg.prototype[p]=i(),jg.prototype[p+"Form"]=i(!0)});const vg=jg;class T${constructor(p){if(typeof p!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(c){i=c});const r=this;this.promise.then(a=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](a);r._listeners=null}),this.promise.then=a=>{let c;const e=new Promise(f=>{r.subscribe(f),c=f}).then(a);return e.cancel=function(){r.unsubscribe(c)},e},p(function(c,e,f){r.reason||(r.reason=new _E(c,e,f),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(p){if(this.reason){p(this.reason);return}this._listeners?this._listeners.push(p):this._listeners=[p]}unsubscribe(p){if(!this._listeners)return;const i=this._listeners.indexOf(p);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const p=new AbortController,i=r=>{p.abort(r)};return this.subscribe(i),p.signal.unsubscribe=()=>this.unsubscribe(i),p.signal}static source(){let p;return{token:new T$(function(a){p=a}),cancel:p}}}const I1i=T$;function R1i(s){return function(i){return s.apply(null,i)}}function D1i(s){return He.isObject(s)&&s.isAxiosError===!0}const W_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(W_).forEach(([s,p])=>{W_[p]=s});const w1i=W_;function s2e(s){const p=new vg(s),i=UBe(vg.prototype.request,p);return He.extend(i,vg.prototype,p,{allOwnKeys:!0}),He.extend(i,p,null,{allOwnKeys:!0}),i.create=function(a){return s2e(Of(s,a))},i}const Kn=s2e(h$);Kn.Axios=vg;Kn.CanceledError=_E;Kn.CancelToken=I1i;Kn.isCancel=XBe;Kn.VERSION=a2e;Kn.toFormData=O1;Kn.AxiosError=ar;Kn.Cancel=Kn.CanceledError;Kn.all=function(p){return Promise.all(p)};Kn.spread=R1i;Kn.isAxiosError=D1i;Kn.mergeConfig=Of;Kn.AxiosHeaders=so;Kn.formToJSON=s=>QBe(He.isHTMLForm(s)?new FormData(s):s);Kn.getAdapter=n2e.getAdapter;Kn.HttpStatusCode=w1i;Kn.default=Kn;const l2e=Kn;class o2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(En.HttpRequest);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h;try{const m=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.method.id}),E=((a=m==null?void 0:m.value)==null?void 0:a.value)||"",b=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.url.id}),A=((c=b==null?void 0:b.value)==null?void 0:c.value)||"",_=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.query.id}),P=((e=_==null?void 0:_.value)==null?void 0:e.value)||"",V=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.body.id}),M=((f=V==null?void 0:V.value)==null?void 0:f.value)||"",G=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.headers.id}),k=((h=G==null?void 0:G.value)==null?void 0:h.value)||"",K={method:E,url:A,params:P,headers:k,data:M};Y.Logger.log("Axios request config: ",K);const le=await l2e(K);return{value:U.Success,error:null,result:{status:le.status,headers:le.headers,data:le.data}}}catch(m){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:m,result:null}}}})}}class d2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL,version:"1.0.0",description:"Execute SQL operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(ao.ExecuteSQL);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.connectionConfig.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.query.id}),E=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=this.extensionsRegistry.requestContexts(this,[se.Editor])[0],A=await l2e.post(((e=b.env)==null?void 0:e.API_BASE_URL)+"/editor-runtime/v1/execute-sql",{connectionConfig:h,query:E},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${await b.getAccessToken()}`}});return{value:U.Success,error:null,result:{results:A.data.results||[]}}}catch(f){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:f,result:null}}}})}}class u2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.Validate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)});Y.Logger.log("Inputs for entity validation: ",a);const e=AD(a[1]).safeParse(a[0]);return e.success?{value:U.Success,error:null,result:{data:a[0]}}:{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e.error.errors,result:null}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}const Xa=s=>s.map(p=>{var i,r;return((i=p.value)==null?void 0:i.valueAsType)??((r=p.value)==null?void 0:r.value)});class p2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY,version:"1.0.0",description:"Entity read-key operation implementation module (top-level)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.ReadKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=MVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class c2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY,version:"1.0.0",description:"Entity write-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.WriteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=GVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class f2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY,version:"1.0.0",description:"Entity delete-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.DeleteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=kVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY,version:"1.0.0",description:"Entity read-nested-key operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.ReadNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=jVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class h2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY,version:"1.0.0",description:"Entity write-nested-key operation implementation module (immutable, no auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.WriteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=UVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class m2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY,version:"1.0.0",description:"Entity write-safe-nested-key-recursively operation implementation module (immutable, auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.WriteSafeNestedKeyRecursively);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=FVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class T2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY,version:"1.0.0",description:"Entity delete-nested-key operation implementation module (immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.DeleteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=KVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class v2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY,version:"1.0.0",description:"Object has-key (top-level property present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.HasKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=qVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class E2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object key-value-equals (top-level property strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.KeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=SVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class b2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY,version:"1.0.0",description:"Object has-nested-key (path present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.HasNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=ZVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class A2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object nested-key-value-equals (path strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.NestedKeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=HVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class g2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE,version:"1.0.0",description:"Object is-instance-of-type (DefinitionEntity-based runtime check)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.IsInstanceOfType);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,E,b,A,_;try{const P=((c=(a=r[0])==null?void 0:a.value)==null?void 0:c.parent)||((f=(e=r[0])==null?void 0:e.value)==null?void 0:f.standaloneParent),V=(m=(h=r[0])==null?void 0:h.value)==null?void 0:m.value,M=(b=(E=r[1])==null?void 0:E.value)==null?void 0:b.valueAsTypeSingle;if(!V)throw new TypeError("IsInstanceOfType expects a non-null input value.");if(!M)throw new TypeError("IsInstanceOfType expects a valid expectedType input.");if(!P)throw new TypeError("IsInstanceOfType cannot determine the value owner.");if(M.type!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType expects expectedType to be a DefinitionEntity.");const G=P.getDataType(null);if(((A=G==null?void 0:G.entity)==null?void 0:A.type)!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType cannot determine the data type of the input value.");let k=!1;return((_=G==null?void 0:G.entity)==null?void 0:_.id)!==(M==null?void 0:M.id)?k=!1:AD(G==null?void 0:G.entity).safeParse(V).success?k=!0:k=!1,{value:U.Success,error:null,result:k}}catch(P){return{value:U.UnhandledError,error:P,result:null}}}})}}class I2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE,version:"1.0.0",description:"Object merge operation implementation module (immutable, shallow merge with right-precedence)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Merge);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const a=Xa(r),c=WVe(...a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class R2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS,version:"1.0.0",description:"Object keys operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Keys);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=zVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class D2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES,version:"1.0.0",description:"Object values operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Values);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=YVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class w2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES,version:"1.0.0",description:"Object entries operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Entries);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=JVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}let Us=null;try{Us=require("crypto")}catch{}const HT=typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle?globalThis.crypto:Us&&Us.webcrypto?Us.webcrypto:null,Ip=HT?HT.subtle:null;function av(s){const p=new ArrayBuffer(s.byteLength);return new Uint8Array(p).set(s),p}function yn(s,p="utf8"){if(s instanceof Uint8Array)return s;const i=String(s);if(p==="utf8"){if(typeof TextEncoder<"u")return new TextEncoder().encode(i);if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"utf8"))}else if(p==="hex"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"hex"))}else if(p==="base64"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"base64"))}else if(p==="base64url"){const r=i.replace(/-/g,"+").replace(/_/g,"/").replace(/=+$/,"");if(typeof Buffer<"u")return new Uint8Array(Buffer.from(r,"base64"));const a=typeof atob=="function"?atob(r):"",c=new Uint8Array(a.length);for(let e=0;e<a.length;e++)c[e]=a.charCodeAt(e);return c}throw new Error(`Unsupported environment/encoding combo for toBytes(${p})`)}function jo(s,p="utf8"){if(p==="utf8"){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf8")}else if(p==="hex"){if(typeof Buffer<"u")return Buffer.from(s).toString("hex")}else if(p==="base64"){if(typeof Buffer<"u")return Buffer.from(s).toString("base64")}else if(p==="base64url"&&typeof Buffer<"u")return Buffer.from(s).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");throw new Error(`Unsupported environment/encoding combo for fromBytes(${p})`)}const C2e=s=>yn(s,"base64"),O2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64")},_h=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64url")},_f=s=>yn(s,"base64url"),_2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"hex")},V2e=s=>yn(s,"hex");function v$(s){if(HT&&HT.getRandomValues){const p=new Uint8Array(s);return HT.getRandomValues(p),p}if(Us&&Us.randomBytes)return new Uint8Array(Us.randomBytes(s));throw new Error("Secure random not available")}function P1(s,p){if(!(s instanceof Uint8Array)||!(p instanceof Uint8Array)||s.length!==p.length)return!1;let i=0;for(let r=0;r<s.length;r++)i|=s[r]^p[r];return i===0}function P2e(s,p,i,r){if((typeof s!="string"||typeof p!="string")&&typeof s!="string"&&typeof p!="string")throw new Error("Invalid input types");const a=i??"utf8",c=r??"utf8",e=yn(s??"",a),f=yn(p??"",c);return P1(e,f)}async function N2e(s,p){if(Ip){const i=await Ip.digest({name:s},av(p));return new Uint8Array(i)}if(Us){const i=s.replace("SHA-","sha"),r=Us.createHash(i);return r.update(Buffer.from(p)),new Uint8Array(r.digest())}throw new Error("Hash not available")}async function x2e(s,p,i,r){if(typeof p!="string")throw new Error("Invalid input type for data; expected string");const a=String(s??"SHA-256"),c=i??"utf8",e=r??"base64url",f=yn(p??"",c),h=await N2e(a,f);return jo(h,e)}async function N1(s,p,i){if(Ip){const r=await Ip.importKey("raw",av(p),{name:"HMAC",hash:{name:s}},!1,["sign"]),a=await Ip.sign("HMAC",r,av(i));return new Uint8Array(a)}if(Us){const r=`sha${s.split("-")[1]}`,a=Us.createHmac(r,Buffer.from(p));return a.update(Buffer.from(i)),new Uint8Array(a.digest())}throw new Error("HMAC not available")}async function $2e(s,p,i,r,a,c){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for key or data; expected strings");const e=String(i??"SHA-256"),f=r??"utf8",h=a??"utf8",m=c??"base64url",E=yn(s??"",f),b=yn(p??"",h),A=await N1(e,E,b);return jo(A,m)}async function x1(s,p,{iterations:i,length:r,hashAlg:a="SHA-256"}){if(Ip){const c=await Ip.importKey("raw",av(s),"PBKDF2",!1,["deriveBits"]),e=await Ip.deriveBits({name:"PBKDF2",salt:av(p),iterations:i,hash:a},c,r*8);return new Uint8Array(e)}if(Us){const c=a==="SHA-512"?"sha512":"sha256";return await new Promise((e,f)=>{Us.pbkdf2(Buffer.from(s),Buffer.from(p),i,r,c,(h,m)=>{h?f(h):e(new Uint8Array(m))})})}throw new Error("PBKDF2 not available")}async function L2e(s,p,i,r,a,c,e,f){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for password or salt; expected strings");const h=c??"utf8",m=e??"utf8",E=f??"base64url",b=Math.max(1,Number(i)||21e4),A=Math.max(1,Number(r)||32),_=a??"SHA-256",P=yn(s??"",h),V=yn(p??"",m),M=await x1(P,V,{iterations:b,length:A,hashAlg:_});return jo(M,E)}async function B2e(s,p=v$(16),i=21e4,r=32,a="SHA-256"){const c=yn(s,"utf8"),e=await x1(c,p,{iterations:i,length:r,hashAlg:a}),f=_h(p),h=_h(e);return`pbkdf2$${a.toLowerCase()}$${i}$${f}$${h}`}async function M2e(s,p){const i=String(p).split("$");if(i.length!==5||i[0]!=="pbkdf2")return!1;const r=i[1].toLowerCase(),a=parseInt(i[2],10),c=_f(i[3]),e=_f(i[4]),f=r.includes("512")?"SHA-512":"SHA-256",h=await x1(yn(s,"utf8"),c,{iterations:a,length:e.length,hashAlg:f});return P1(h,e)}async function G2e(s,p,i,r,a,c){const e=p!=null?Math.max(1,Number(p)||0):void 0,f=i!=null?Math.max(1,Number(i)||0):void 0,h=r??void 0,m=c??"base64url",E=a!=null?yn(a,m):void 0;return await B2e(String(s??""),E,e,f,h)}function hU(s){return _h(yn(JSON.stringify(s),"utf8"))}function Ug(s){try{return JSON.parse(jo(_f(s),"utf8"))}catch{return null}}async function k2e(s,p,{alg:i="HS256",includeIat:r=!0,expiresInSeconds:a,notBeforeSeconds:c,issuer:e,subject:f,audience:h,jwtid:m,header:E={}}={}){const b={alg:i,typ:"JWT",...E},A=Math.floor(Date.now()/1e3),_={...s||{}};r&&(_.iat=A),typeof a=="number"&&(_.exp=A+a),typeof c=="number"&&(_.nbf=A+c),e&&(_.iss=e),f&&(_.sub=f),h&&(_.aud=h),m&&(_.jti=m);const P=hU(b),V=hU(_),M=yn(`${P}.${V}`,"utf8"),k=await N1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,M),K=_h(k);return`${P}.${V}.${K}`}async function j2e(s,p,i,r,a,c,e,f,h,m,E,b){if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(s!=null&&typeof s!="object")throw new Error("Invalid input type for payload; expected object");if(E!=null&&typeof E!="object")throw new Error("Invalid input type for header; expected object");if(m!=null&&typeof m!="string")throw new Error("Invalid input type for jwtid; expected string");if(e!=null&&typeof e!="string")throw new Error("Invalid input type for issuer; expected string");if(f!=null&&typeof f!="string")throw new Error("Invalid input type for subject; expected string");if(h!=null&&typeof h!="string"&&!Array.isArray(h))throw new Error("Invalid input type for audience; expected string or string[]");const _=yn(p??"",b??"utf8");return await k2e(s??{},_,{alg:i??"HS256",includeIat:r==null?!0:!!r,expiresInSeconds:a!=null?Number(a):void 0,notBeforeSeconds:c!=null?Number(c):void 0,issuer:e??void 0,subject:f??void 0,audience:h??void 0,jwtid:m??void 0,header:E??void 0})}async function U2e(s,p,{alg:i="HS256",issuer:r,audience:a,maxAgeSeconds:c,clockSkewSeconds:e=60}={}){try{const[f,h,m]=String(s).split(".");if(!f||!h||!m)return{valid:!1,header:null,payload:null,reason:"Malformed"};const E=Ug(f),b=Ug(h);if(!E||!b)return{valid:!1,header:E,payload:b,reason:"Bad base64/json"};if(E.alg!==i)return{valid:!1,header:E,payload:b,reason:"Alg mismatch"};const A=yn(`${f}.${h}`,"utf8"),P=await N1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,A),V=_f(m);if(!P1(P,V))return{valid:!1,header:E,payload:b,reason:"Bad signature"};const M=Math.floor(Date.now()/1e3),G=Math.max(0,Number(e)||0);if(b.nbf!=null&&M+G<Number(b.nbf))return{valid:!1,header:E,payload:b,reason:"Not before"};if(b.exp!=null&&M-G>=Number(b.exp))return{valid:!1,header:E,payload:b,reason:"Expired"};if(r&&b.iss!==r)return{valid:!1,header:E,payload:b,reason:"Issuer mismatch"};if(a){const k=b.aud;if(!(Array.isArray(k)?k.includes(a):k===a))return{valid:!1,header:E,payload:b,reason:"Audience mismatch"}}return c!=null&&b.iat!=null&&M-Number(b.iat)>Number(c)+G?{valid:!1,header:E,payload:b,reason:"MaxAge exceeded"}:{valid:!0,header:E,payload:b}}catch(f){return{valid:!1,header:null,payload:null,reason:String((f==null?void 0:f.message)??f)}}}async function F2e(s,p,i,r,a,c,e,f){if(typeof s!="string")throw new Error("Invalid input type for token; expected string");if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(typeof r!="string")throw new Error("Invalid input type for issuer; expected string");if(a!=null&&typeof a!="string")throw new Error("Invalid input type for audience; expected string");const m=yn(p??"",f??"utf8");return await U2e(String(s??""),m,{alg:i??"HS256",issuer:r??void 0,audience:a??void 0,maxAgeSeconds:c!=null?Number(c):void 0,clockSkewSeconds:e!=null?Number(e):void 0})}function K2e(s){const[p,i,r]=String(s).split(".");return{header:p?Ug(p):null,payload:i?Ug(i):null,signature:r?_f(r):new Uint8Array}}function q2e(s,p){if(!s)throw new Error("Token is required for decoding");if(typeof s!="string")throw new Error("Invalid input type for token; expected string");const i=p??"base64url",{header:r,payload:a,signature:c}=K2e(String(s??"")),e=jo(c,i);return{header:r,payload:a,signature:e}}class S2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES,version:"1.0.0",description:"Randomness generate random bytes operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(tt.GenerateRandomBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)}),e=Math.max(0,Number(a)||0),f=c??"base64url",h=v$(e),m=jo(h,f);return{value:U.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomInteger);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=EVe(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class H2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomFloat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=v1();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class W2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomHexadecimal);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Hx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomBase62);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Wx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=AVe(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class J2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomAlphanumeric);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=zx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Q2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateIdentifier);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=Yx(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class X2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomUUIDv4);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=gp();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class eMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{Y.Logger.log("Initializing Random Generate Short Identifier Module");const r=i.find(a=>a.contextType===se.Logic);if(r){Y.Logger.log("Project state found, setting up operation");const a=r.get(tt.GenerateShortIdentifier);a?(Y.Logger.log("Operation found, setting autoexecutable and implementation"),a.autoexecutable=!0,a.implementation=this.module.main):Y.Logger.warn("Operation generate-short-identifier not found in project state")}else Y.Logger.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,r)=>{try{const a=gVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class tMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateHexadecimalToken);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=IVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}function C1i(s){let p;if(s===null?p="null":Array.isArray(s)?p="array":p=typeof s,!["string","number","boolean","null","object","array"].includes(p))throw new TypeError("GetTypeOf cannot determine type of the given value.");return p}class iMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF,version:"1.0.0",description:"Data type get type of operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(Qe.GetTypeOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)||((h=e.value)==null?void 0:h.value)})[0];return{value:U.Success,error:null,result:C1i(c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class rMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING,version:"1.0.0",description:"Coerce any value to string via JS String(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.ToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class nMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER,version:"1.0.0",description:"Coerce to number via JS Number(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.ToNumber);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=Number(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class aMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES,version:"1.0.0",description:"Convert string/bytes-like to Uint8Array (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.ToBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=yn(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class sMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING,version:"1.0.0",description:"Convert Uint8Array to string (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.FromBytesToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=jo(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class lMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64,version:"1.0.0",description:"Bytes -> base64 string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:O2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class oMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64,version:"1.0.0",description:"base64 string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=C2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class dMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL,version:"1.0.0",description:"Bytes -> base64url string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=_h(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class uMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL,version:"1.0.0",description:"base64url string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=_f(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class pMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX,version:"1.0.0",description:"Bytes -> hex string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.EncodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=_2e(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class cMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX,version:"1.0.0",description:"hex string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.DecodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=V2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class fMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH,version:"1.0.0",description:"Crypto: Hash (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.Hash);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:x2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class yMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC,version:"1.0.0",description:"Crypto: HMAC (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.Hmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:$2e(c,e,a,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class hMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL,version:"1.0.0",description:"Crypto: constant-time equality for byte sequences",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.ConstantTimeEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:P2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class mMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2,version:"1.0.0",description:"Crypto: derive key with PBKDF2 (SHA-256/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.DeriveKeyPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:L2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class TMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE,version:"1.0.0",description:"Json parse string into object operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(bn.Parse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a;try{const c=(a=r[0].value)==null?void 0:a.value;if(typeof c!="string")throw new Error(`Invalid input type for JSON.parse operation: expected string, got ${typeof c}`);const e=JSON.parse(c);return{value:U.Success,error:null,result:e}}catch(c){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:c,result:null}}}})}}class vMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY,version:"1.0.0",description:"Json stringify object into string operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(bn.Stringify);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=(a=r[0].value)==null?void 0:a.value,f=(c=r[1].value)==null?void 0:c.value;if(!e||typeof e!="object"&&!Array.isArray(e))throw new Error(`Invalid input type for JSON.stringify operation: expected object or array, got ${typeof e}`);if(!f&&f!==0){const m=JSON.stringify(e);return{value:U.Success,error:null,result:m}}const h=JSON.stringify(e,null,f);return{value:U.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e,result:null}}}})}}class EMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC,version:"1.0.0",description:"JWT: build (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(hr.BuildJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b,A,_,P,V]=r.map(M=>{var G,k;return((G=M.value)==null?void 0:G.valueAsType)??((k=M.value)==null?void 0:k.value)});return{value:U.Success,error:null,result:await j2e(a,c,e,f,h,m,E,b,A,_,P,V)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class bMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC,version:"1.0.0",description:"JWT: verify (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(hr.VerifyJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:await F2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class AMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE,version:"1.0.0",description:"JWT: decode (no verification)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(hr.DecodeJwt);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:q2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class gMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2,version:"1.0.0",description:"Password: hash (PBKDF2) -> envelope string",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(An.HashPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:await G2e(a,c,e,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class IMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2,version:"1.0.0",description:"Password: verify (PBKDF2) -> boolean",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(An.VerifyPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=await M2e(String(a??""),String(c??""));return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class z_ extends R1{constructor(p,i,r=i.projectId){super(p,se.Editor),this._editor=i,this.id=r}get ready(){return this._editor.ready}get env(){return this._editor.env}get hasLoadedLogic(){return this._editor.hasLoadedLogic}get destroyed(){return this._editor.destroyed}get logicLoadingPromise(){return this._editor.logicLoadingPromise}get logic(){return this._editor.logic}get lastPublishedProjectState(){return this._editor.lastPublishedProjectState}get branchHead(){return this._editor.branchHead}get branchHeadPromise(){return this._editor.branchHeadPromise}get projectId(){return this._editor.projectId}get sessionId(){return this._editor.sessionId}get userAuthorId(){return this._editor.userAuthorId}get peerConnections(){return this._editor.peerConnections}get test(){return this._editor.test}get localTestValues(){return this._editor.localTestValues}get resolvedValues(){return this._editor.resolvedValues}get persistedExecutionResults(){return this._editor.persistedExecutionResults}get publication(){return this._editor.publication}get livePublishedVersions(){return this._editor.livePublishedVersions}get publications(){return this._editor.publications}get liveResources(){return this._editor.liveResources}get execution(){return this._editor.execution}get project(){return this._editor.logic}get lastExecutionResults(){return this._editor.lastExecutionResults}get undoableStackValueIndex(){return this._editor.undoableStackValueIndex}set undoableStackValueIndex(p){this._editor.undoableStackValueIndex=p}get activeWorkspace(){return this._editor.activeWorkspace}get branches(){return this._editor.branches}get roles(){return this._editor.roles}get READ_ONLY(){return this._editor.READ_ONLY}get isViewingNonHead(){return this._editor.isViewingNonHead}get canEdit(){return this._editor.canEdit}get PROJECT_NOTIFICATIONS_CHANNEL(){return this._editor.PROJECT_NOTIFICATIONS_CHANNEL}getAccessToken(){return this._editor.getAccessToken()}getRefreshToken(){return this._editor.getRefreshToken()}removeValueByOwnerId(p){return this._editor.removeValueByOwnerId(p)}removeValue(p){return this._editor.removeValue(p)}undo(){return this._editor.undo()}redo(){return this._editor.redo()}initTest(p,i){return this._editor.initTest(p,i)}removeTest(p){return this._editor.removeTest(p)}async copyEntities(p,i={}){return this._editor.copyEntities(p,i)}resolveInitialChildrenPositions(p,i,r){return this._editor.resolveInitialChildrenPositions(p,i,r)}publish(){return this._editor.publish()}loadGivenPublication(p){return this._editor.loadGivenPublication(p)}validateProjectState(p){return this._editor.validateProjectState(p)}requestActiveDynamicValue(p,i=!1){return this._editor.requestActiveDynamicValue(p,i)}getValueTypePreference(p){return this._editor.getValueTypePreference(p)}setValueTypePreference(p,i){return this._editor.setValueTypePreference(p,i)}implementFeature(p){return this._editor.implementFeature(p)}getProjectRoles(){return this._editor.getProjectRoles()}getLastPublishedVersionLogic(p){return this._editor.getLastPublishedVersionLogic(p)}initialLoads(p){return this._editor.initialLoads(p)}moveBranchHeadToVersion(p,i,r){return this._editor.moveBranchHeadToVersion(p,i,r)}loadInitialBranchHead(){return this._editor.loadInitialBranchHead()}}function O1i(s,p){return p instanceof z_?p:new z_(s,p)}class Y_ extends R1{constructor(p,i){super(p,se.PublicationRun),this._publicationRun=i}get id(){return this._publicationRun.id}get projectAutoIncrementPublicationCount(){return this._publicationRun.projectAutoIncrementPublicationCount}get projectPublishedSemanticVersion(){return this._publicationRun.projectPublishedSemanticVersion}get envIdentifier(){return this._publicationRun.envIdentifier}get projectVersion(){return this._publicationRun.projectVersion}get projectBranchId(){return this._publicationRun.projectBranchId}get projectId(){return this._publicationRun.projectId}get triggeredBy(){return this._publicationRun.triggeredBy}get createdAt(){return this._publicationRun.createdAt}get updatedAt(){return this._publicationRun.updatedAt}get status(){return this._publicationRun.status}get steps(){return this._publicationRun.steps}get editor(){return this._publicationRun.editor}get explicitResources(){return this._publicationRun.explicitResources}get implicitGlobalResources(){return this._publicationRun.implicitGlobalResources}get finalGlobalEvent(){return this._publicationRun.finalGlobalEvent}get finalStatus(){return this._publicationRun.finalStatus}}function _1i(s,p){return p instanceof Y_?p:new Y_(s,p)}function V1i(s){s.register(new EPe(s)),s.register(new vPe(s)),s.register(new yPe(s)),s.register(new mPe(s)),s.register(new TPe(s)),s.register(new hPe(s)),s.register(new eBe(s)),s.register(new tBe(s)),s.register(new iBe(s)),s.register(new nBe(s)),s.register(new rBe(s)),s.register(new aBe(s)),s.register(new Z2e(s)),s.register(new H2e(s)),s.register(new W2e(s)),s.register(new z2e(s)),s.register(new Y2e(s)),s.register(new J2e(s)),s.register(new Q2e(s)),s.register(new X2e(s)),s.register(new eMe(s)),s.register(new tMe(s)),s.register(new X$e(s)),s.register(new eLe(s)),s.register(new tLe(s)),s.register(new iLe(s)),s.register(new rLe(s)),s.register(new nLe(s)),s.register(new aLe(s)),s.register(new sLe(s)),s.register(new lLe(s)),s.register(new oLe(s)),s.register(new dLe(s)),s.register(new uLe(s)),s.register(new pLe(s)),s.register(new cLe(s)),s.register(new fLe(s)),s.register(new yLe(s)),s.register(new hLe(s)),s.register(new mLe(s)),s.register(new TLe(s)),s.register(new bLe(s)),s.register(new ALe(s)),s.register(new gLe(s)),s.register(new E$e(s)),s.register(new b$e(s)),s.register(new A$e(s)),s.register(new g$e(s)),s.register(new I$e(s)),s.register(new R$e(s)),s.register(new D$e(s)),s.register(new w$e(s)),s.register(new C$e(s)),s.register(new _$e(s)),s.register(new V$e(s)),s.register(new P$e(s)),s.register(new N$e(s)),s.register(new x$e(s)),s.register(new Gxe(s)),s.register(new u2e(s)),s.register(new o2e(s)),s.register(new d2e(s)),s.register(new MNe(s)),s.register(new GNe(s)),s.register(new kNe(s)),s.register(new jNe(s)),s.register(new UNe(s)),s.register(new FNe(s)),s.register(new KNe(s)),s.register(new qNe(s)),s.register(new SNe(s)),s.register(new nxe(s)),s.register(new Lxe(s)),s.register(new Bxe(s)),s.register(new Mxe(s)),s.register(new ZNe(s)),s.register(new HNe(s)),s.register(new WNe(s)),s.register(new zNe(s)),s.register(new YNe(s)),s.register(new JNe(s)),s.register(new QNe(s)),s.register(new XNe(s)),s.register(new exe(s)),s.register(new txe(s)),s.register(new ixe(s)),s.register(new rxe(s)),s.register(new axe(s)),s.register(new sxe(s)),s.register(new lxe(s)),s.register(new oxe(s)),s.register(new dxe(s)),s.register(new uxe(s)),s.register(new pxe(s)),s.register(new cxe(s)),s.register(new fxe(s)),s.register(new yxe(s)),s.register(new hxe(s)),s.register(new mxe(s)),s.register(new Dxe(s)),s.register(new wxe(s)),s.register(new Cxe(s)),s.register(new Txe(s)),s.register(new vxe(s)),s.register(new Exe(s)),s.register(new bxe(s)),s.register(new Axe(s)),s.register(new gxe(s)),s.register(new Ixe(s)),s.register(new Rxe(s)),s.register(new y2e(s)),s.register(new h2e(s)),s.register(new m2e(s)),s.register(new T2e(s)),s.register(new p2e(s)),s.register(new c2e(s)),s.register(new f2e(s)),s.register(new v2e(s)),s.register(new b2e(s)),s.register(new g2e(s)),s.register(new E2e(s)),s.register(new A2e(s)),s.register(new I2e(s)),s.register(new w2e(s)),s.register(new R2e(s)),s.register(new D2e(s)),s.register(new $$e(s)),s.register(new G$e(s)),s.register(new k$e(s)),s.register(new F$e(s)),s.register(new K$e(s)),s.register(new q$e(s)),s.register(new S$e(s)),s.register(new Z$e(s)),s.register(new H$e(s)),s.register(new W$e(s)),s.register(new z$e(s)),s.register(new j$e(s)),s.register(new U$e(s)),s.register(new B$e(s)),s.register(new M$e(s)),s.register(new L$e(s)),s.register(new O$e(s)),s.register(new J$e(s)),s.register(new Q$e(s)),s.register(new Y$e(s)),s.register(new lBe(s)),s.register(new PBe(s)),s.register(new VBe(s)),s.register(new NBe(s)),s.register(new xBe(s)),s.register(new uBe(s)),s.register(new pBe(s)),s.register(new TBe(s)),s.register(new hBe(s)),s.register(new OBe(s)),s.register(new gBe(s)),s.register(new RBe(s)),s.register(new wBe(s)),s.register(new DBe(s)),s.register(new mBe(s)),s.register(new EBe(s)),s.register(new bBe(s)),s.register(new vBe(s)),s.register(new sBe(s)),s.register(new cBe(s)),s.register(new IBe(s)),s.register(new BBe(s)),s.register(new q_(s)),s.register(new dBe(s)),s.register(new fBe(s)),s.register(new oBe(s)),s.register(new CBe(s)),s.register(new yBe(s)),s.register(new ABe(s)),s.register(new _Be(s)),s.register(new LBe(s)),s.register(new $Be(s)),s.register(new MBe(s)),s.register(new q_(s)),s.register(new kBe(s)),s.register(new GBe(s)),s.register(new jBe(s)),s.register(new MLe(s)),s.register(new GLe(s)),s.register(new kLe(s)),s.register(new RLe(s)),s.register(new ELe(s)),s.register(new OLe(s)),s.register(new NLe(s)),s.register(new vLe(s)),s.register(new xLe(s)),s.register(new BLe(s)),s.register(new VLe(s)),s.register(new _Le(s)),s.register(new Gg(s)),s.register(new jLe(s)),s.register(new ULe(s)),s.register(new PLe(s)),s.register(new LLe(s)),s.register(new $Le(s)),s.register(new CLe(s)),s.register(new wLe(s)),s.register(new DLe(s)),s.register(new ILe(s)),s.register(new qLe(s)),s.register(new KLe(s)),s.register(new SLe(s)),s.register(new FLe(s)),s.register(new Pxe(s)),s.register(new Oxe(s)),s.register(new Vxe(s)),s.register(new Nxe(s)),s.register(new xxe(s)),s.register(new _xe(s)),s.register(new $xe(s)),s.register(new iMe(s)),s.register(new oMe(s)),s.register(new uMe(s)),s.register(new cMe(s)),s.register(new lMe(s)),s.register(new dMe(s)),s.register(new pMe(s)),s.register(new sMe(s)),s.register(new aMe(s)),s.register(new nMe(s)),s.register(new rMe(s)),s.register(new TMe(s)),s.register(new vMe(s)),s.register(new hMe(s)),s.register(new mMe(s)),s.register(new S2e(s)),s.register(new fMe(s)),s.register(new yMe(s)),s.register(new bMe(s)),s.register(new EMe(s)),s.register(new AMe(s)),s.register(new gMe(s)),s.register(new IMe(s)),s.register(new APe(s)),s.register(new gPe(s)),s.register(new Bg(s)),s.register(new Mg(s))}class E${constructor(p=new Y.Events("extensions-registry-fallback-events")){R(this,"extensionsRegistry",new Map);R(this,"initialized",new Set);R(this,"initializedContexts",new Set);R(this,"onResolveEditorContextCallback",()=>null);R(this,"onResolveProjectLogicContextCallback",()=>null);R(this,"onResolveEditorGUIContextCallback",()=>null);R(this,"onResolveGUIContextCallback",()=>null);R(this,"onResolveCompileContextCallback",()=>null);R(this,"onResolvePublicationRunContextCallback",()=>null);this.events=p,this.off=this.events.off.bind(this.events),this.on=this.events.on.bind(this.events),this.emit=this.events.emit.bind(this.events),this.emitAsync=this.events.emitAsync.bind(this.events),this.emitAsyncAll=this.events.emitAsyncAll.bind(this.events),this.emitAsyncAllSettled=this.events.emitAsyncAllSettled.bind(this.events),this.emitAsyncSequentially=this.events.emitAsyncSequentially.bind(this.events),this.emitAsyncSequentiallyAll=this.events.emitAsyncSequentiallyAll.bind(this.events),this.emitAsyncSequentiallyAllSettled=this.events.emitAsyncSequentiallyAllSettled.bind(this.events)}onResolveEditorContext(p){this.onResolveEditorContextCallback=p}onResolveProjectLogicContext(p){this.onResolveProjectLogicContextCallback=p}onResolveGUIContext(p){this.onResolveGUIContextCallback=p}onResolveEditorGUIContext(p){this.onResolveEditorGUIContextCallback=p}onResolveCompileContext(p){this.onResolveCompileContextCallback=p}onResolvePublicationRunContext(p){this.onResolvePublicationRunContextCallback=p}get extensionInOrder(){return Array.from(this.extensionsRegistry.values()).sort((p,i)=>(p.manifest.initPriority||_e.Normal)-(i.manifest.initPriority||_e.Normal))}async setup(){V1i(this),Y.Logger.log("Initializing extensions without context..."),this.initForReady()}requestContext(p){switch(p){case se.Editor:return this.onResolveEditorContextCallback();case se.Logic:return this.onResolveProjectLogicContextCallback();case se.EditorGUI:return this.onResolveEditorGUIContextCallback();case se.Compile:return this.onResolveCompileContextCallback();case se.PublicationRun:return this.onResolvePublicationRunContextCallback();case se.GUI:return this.onResolveGUIContextCallback();case se.EditorGUI:return this.onResolveEditorGUIContextCallback();default:throw new Error(`Unknown context type: ${p}`)}}requestContexts(p,i=[]){const r=[];i.length===0&&(i=p.manifest.contexts);for(const a of i){const c=this.requestContext(a);c&&r.push(c)}return r}requestExtension(p){const i=this.extensionsRegistry.get(p);if(i)return i;throw new Error(`Unknown extension: ${p}`)}register(p){this.extensionsRegistry.set(p.manifest.id,p)}async initAll(){var p,i;for(const r of this.extensionInOrder)if(r.module.init&&!this.initialized.has(r.manifest.id)){const a=r.manifest.contexts.map(c=>this.requestContext(c)).filter(c=>c!==null);a.length&&(await((i=(p=r.module).init)==null?void 0:i.call(p,a)),this.initialized.add(r.manifest.id))}else!r.module.init&&!this.initialized.has(r.manifest.id)&&this.initialized.add(r.manifest.id)}async initForReady(){Y.Logger.log("Initializing extensions for ready contexts...");for(const p of this.extensionInOrder)if(p.module.init&&!this.initialized.has(p.manifest.id)){Y.Logger.log("Initializing "+p.manifest.id+" extension...");const i=this.requestContexts(p);p.manifest.contexts.every(a=>!!i.find(c=>c.contextType===a))?(await p.module.init(i),this.initialized.add(p.manifest.id)):Y.Logger.warn(`Skipping initialization of ${p.manifest.id} extension, not all contexts are ready.`,`Required contexts: ${p.manifest.contexts.join(", ")}`,`Available contexts: ${i.map(a=>a.contextType).join(", ")}`)}else!p.module.init&&!this.initialized.has(p.manifest.id)?(Y.Logger.log("Set "+p.manifest.id+" extension as initialized by default..."),this.initialized.add(p.manifest.id)):Y.Logger.log(`Skipping initialization of ${p.manifest.id} extension, already initialized or no init method defined.`)}async destroyAll(){for(const p of[...this.extensionInOrder].reverse())p.module.destroy&&await p.module.destroy();this.events.destroy()}on(p,i){this.events.on(p,i)}emit(p,...i){this.events.emit(p,...i)}off(p,i){this.events.off(p,i)}emitAsync(p,...i){return this.events.emitAsync(p,...i)}emitAsyncAll(p,...i){return this.events.emitAsyncAll(p,...i)}emitAsyncAllSettled(p,...i){return this.events.emitAsyncAllSettled(p,...i)}emitAsyncSequentially(p,...i){return this.events.emitAsyncSequentially(p,...i)}emitAsyncSequentiallyAll(p,...i){return this.events.emitAsyncSequentiallyAll(p,...i)}emitAsyncSequentiallyAllSettled(p,...i){return this.events.emitAsyncSequentiallyAllSettled(p,...i)}async contextAvailable(p){if(this.initializedContexts.has(p)){Y.Logger.warn(`Context ${p} is already initialized. Skipping re-initialization.`);return}switch(this.initializedContexts.add(p),p){case se.Editor:{if(!this.onResolveEditorContextCallback)throw new Error("No editor context resolver callback set. Call onResolveEditorContext first.");break}case se.Logic:{if(!this.onResolveProjectLogicContextCallback)throw new Error("No project logic context resolver callback set. Call onResolveProjectLogicContext first.");break}}Y.Logger.log(`Context ${p} is now available. Initializing extensions for this context...`),await this.initForReady()}getValueTypePreference(p){return window.localStorage.getItem("dynamic-value-type-preference--"+p)||null}setValueTypePreference(p,i){window.localStorage.setItem("dynamic-value-type-preference--"+p,(i==null?void 0:i.toString())||""),this.emit(p,{})}}let lg=null;const b$={requestExtension:s=>(lg||(lg=new E$,lg.setup()),lg.requestExtension(s))};function lp(s){return!(s instanceof Error)&&typeof s=="object"&&s!==null?s:s instanceof Error?{name:s.name,message:s.message,stack:s.stack,...s}:s}function mU(s){var p,i,r;if(s&&typeof s=="object"&&"value"in s){const a=s;return{single:((p=a.value)==null?void 0:p.valueAsTypeSingle)??((i=a.value)==null?void 0:i.value),list:((r=a.value)==null?void 0:r.valueAsTypeList)??null}}return{single:s,list:Array.isArray(s)?s:null}}const op={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};var A$=(s=>(s.FinishedSuccess="finished-success",s.FinishedError="finished-error",s.Running="running",s.Paused="paused",s.Stopped="stopped",s.NotStarted="not-started",s))(A$||{});const RMe={...b$,getValueTypePreference:()=>null,setValueTypePreference:()=>{}};class J_ extends Error{constructor(){super("Execution was stopped"),this.name="ExecutionStoppedError"}}class yh extends Y.Events{constructor(i,r,a,c=null,e=RMe){super();R(this,"project");R(this,"entryPoint");R(this,"state","not-started");R(this,"events",new Y.Events("fe-exec-inst-events"));R(this,"entities",[]);R(this,"parentExecution",null);R(this,"executing",[]);R(this,"executed",[]);R(this,"skipped",[]);R(this,"scheduled",[]);R(this,"localTestValues");R(this,"resolvedValues");R(this,"persistedExecutionResults");R(this,"lastExecutionResults");R(this,"onAddToSkippedListCallback",null);R(this,"onRemoveFromSkippedListCallback",null);R(this,"onAddEntityCallback",null);R(this,"onRemoveEntityCallback",null);R(this,"onAbortExecutionCallback",null);this.parentContext=e,this.entities=r,this.entryPoint=a,this.project=i,this.parentExecution=c,this.localTestValues=new LT(x.UUID.uuid(),this.project),this.resolvedValues=new LT(x.UUID.uuid(),this.project),this.persistedExecutionResults=new LT(x.UUID.uuid(),this.project),this.lastExecutionResults=new LT(x.UUID.uuid(),this.project)}get rootExecution(){let i=this;for(;i.parentExecution;)i=i.parentExecution;return i}get rootState(){return this.rootExecution.state}isStopped(){return this.state==="stopped"||this.rootExecution.state==="stopped"}isPaused(){return this.state==="paused"||this.rootExecution.state==="paused"}async checkStateAndPause(){if(this.isStopped())throw new J_;for(;this.isPaused();){if(this.isStopped())throw new J_;await new Promise(i=>setTimeout(i,100))}}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults,getValueTypePreference:this.parentContext.getValueTypePreference,setValueTypePreference:this.parentContext.setValueTypePreference}}skip(i){this.hasEntity(i)&&(this.removeFromScheduledList(i),!this.skipped.includes(i)&&(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),tr.includes(i.type)&&ft(i).forEach(r=>this.skip(r))))}async schedule(i,r,a){if(this.hasExecuted(i))return null;if(Ft.includes(i.type))return this.executeBranch(i,a,r);if(sr.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,a,r);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,r){const a=[];return[...Ot,...Ft].includes(r.type)?a.push(...r.inputs):Dt.includes(r.type)&&a.push(...r.outputs),a.map(e=>{var h;let f=i.find(m=>m.valueOwner.id===e.id);if(f)return f;if(!f&&Ft.includes(r.type)&&(f=i.find(m=>{var E;return((E=m.valueOwner.declaration)==null?void 0:E.id)===e.id})),f){const m=(h=f.value)==null?void 0:h.clone(null);return m==null||m.setStandaloneParent(e,null),{...f,valueOwner:e,value:m||null,inheritanceLink:{sources:[f],target:e}}}return Qr.includes(e.type)?to(e,this.valueResolutionContext):Cf(e,this.valueResolutionContext)}).reduce((e,f)=>{const h=ud(f==null?void 0:f.valueOwner,this.project),m=f?[f]:[];return h.forEach(E=>{var _,P,V;if(E.id===(f==null?void 0:f.valueOwner.id))return;const b=Ht(E.getDataType(null),E,this.project);b==null||b.metaSync({value:(_=f==null?void 0:f.value)==null?void 0:_.value},null),b==null||b.setValueAsTypeList(((P=f==null?void 0:f.value)==null?void 0:P.valueAsTypeList)||null),b==null||b.setValueAsTypeSingle(((V=f==null?void 0:f.value)==null?void 0:V.valueAsTypeSingle)||null);const A={...f,valueOwner:E,value:b};m.push(A)}),[...e,...m]},[]).sort((e,f)=>e.valueOwner.index-f.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,r,a,c={}){var f,h;const e={...op,...c};try{let m={value:U.Success,error:null,result:null};if(r.sort((V,M)=>V.valueOwner.index-M.valueOwner.index),Object.values(Gr).includes(i.declaration.id)){const V=this.parentContext.requestExtension(fh+i.declaration.id).module.main;V?m=await V(i,r):Y.Logger.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{const V=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,r,a,e);m={value:V.value,error:V.error,result:V.result}}let E=null;if(m.error&&i.error){Y.Logger.warn("Raw error executing entity: ",m.error);const{single:V,list:M}=mU(m.error),G=lp(V),k=(f=i.error)==null?void 0:f.getDataType(null),K=Ht(k||null,i.error,a);if(k!=null&&k.asType)M!==null?K==null||K.setValueAsTypeList(M):K==null||K.setValueAsTypeSingle(V);else{const le=vr(G)?JSON.stringify(G,null,2):G;K==null||K.metaSync({value:le},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:K}}const b=i==null?void 0:i.getDataType(null),A=Ht(b,i,a),{single:_,list:P}=mU(m.result);return b!=null&&b.asType?P!==null?A==null||A.setValueAsTypeList(P):A==null||A.setValueAsTypeSingle(_):A==null||A.metaSync({value:_},null),{value:m.value,entity:i,error:E,result:{value:A||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(m){if(m&&(m.name==="ExecutionStoppedError"||m.message==="Execution was stopped"))throw m;Y.Logger.warn("Internal call execution error: ",m);let E=null;if(i.error){const b=lp(m),A=(h=i.error)==null?void 0:h.getDataType(null),_=Ht(A,i.error,a);if(A!=null&&A.asType)_==null||_.setValueAsTypeSingle(m);else{const P=vr(b)?JSON.stringify(b,null,2):b;_==null||_.metaSync({value:P},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:_}}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:E,result:null}}}static async executeOperation(i,r,a){var c,e;try{let f={value:U.Success,error:null,result:null};r.sort((b,A)=>b.valueOwner.index-A.valueOwner.index),i.declaration.implementation&&(f=await i.declaration.implementation(i,r.sort((b,A)=>b.valueOwner.index-A.valueOwner.index)));let h=null;if(f.error&&i.error){const b=lp(f.error),A=((c=i.error)==null?void 0:c.getDataType(null))||null,_=Ht(A,i.error,a);if(A!=null&&A.asType)_==null||_.setValueAsTypeSingle(f.error);else{const P=vr(b)?JSON.stringify(b,null,2):b;_==null||_.metaSync({value:P},null)}h={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:_}}const m=i==null?void 0:i.getDataType(null),E=Ht(m,i,a);return m!=null&&m.asType?E==null||E.setValueAsTypeSingle(f.result):E==null||E.metaSync({value:f.result},null),{value:f.value,entity:i,error:h,result:{value:E||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(f){if(f&&(f.name==="ExecutionStoppedError"||f.message==="Execution was stopped"))throw f;console.warn("Operation execution error: ",f);let h=null;if(i.error){const m=lp(f),E=(e=i.error)==null?void 0:e.getDataType(null),b=Ht(E,i.error,a);if(E!=null&&E.asType)b==null||b.setValueAsTypeSingle(f);else{const A=vr(m)?JSON.stringify(m,null,2):m;b==null||b.metaSync({value:A},null)}h={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:b}}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:h,result:null}}}async executeSearch(i,r,a){var c;try{let e={value:U.Success,error:null,result:null};const f=await(await this.parentContext.requestExtension(Pe.SEARCH_NODE_IMPLEMENTATION)).module.main(i,r),h=i==null?void 0:i.getDataType(null),m=Ht(h,i,a);return m==null||m.metaSync({value:f},null),f.error?{value:U.UnhandledError,entity:i,error:{valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:m},result:null}:{value:e.value,entity:i,error:null,result:{value:m,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(e){if(e&&(e.name==="ExecutionStoppedError"||e.message==="Execution was stopped"))throw e;if(Y.Logger.warn(`Search node execution error: ${e}`),!i.error)return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null};const f=lp(e),h=(c=i.error)==null?void 0:c.getDataType(null),m=Ht(h,i.error,a),E=vr(f)?JSON.stringify(f,null,2):f;return m==null||m.metaSync({value:E},null),{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:m},result:null}}}async executeLoop(i,r,a,c={}){var f,h,m,E,b,A;const e={...op,...c};try{let _={value:U.Success,error:null,result:null};const P=r.map(X=>{var ae,te;return((ae=X==null?void 0:X.value)==null?void 0:ae.valueAsType)||((te=X==null?void 0:X.value)==null?void 0:te.value)});let V={};i.getUniqueInputMaps().forEach(X=>{const ae=i.body.inputs.find(ee=>ce(ee,a)===ce(X,a)),te=X==null?void 0:X.getDataType(null),ne=Ht(te,ae,a);te!=null&&te.asType?ne==null||ne.setValueAsTypeList([]):ne==null||ne.metaSync({value:[]},null),this.lastExecutionResults.writeValue(ae,ne);const ue={value:ne,valueOwner:ae,type:ke.ExecutionResult,inheritanceLink:null};V[ae.id]=ue});let G={value:U.Success,entity:i.body,error:null,result:null};switch(i.declaration.id){case re.loop["counted-loop"].id:{const X=P[0];let ae=1;for(;ae<=X&&ae<=50;){await this.checkStateAndPause();const te=i.body.inputs.map(ne=>{if(ne===i.currentIterationNumberArgumentDeclaration){const ue=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=Jd(ue),z=this.lastExecutionResults.readValue(ne.id);if(z){z.metaSync({value:ae},null),this.lastExecutionResults.writeValue(ne,z);const he={value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null};return V[ne.id]=he,he}const oe={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ae,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ee,standaloneParent:ne.toReference()},ye=lr(oe,a);this.lastExecutionResults.writeValue(ne,ye);const pe={value:ye,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null};return V[ne.id]=pe,pe}else return V[ne.id]}).filter(ne=>!!ne);if(G=await this.executeFullFunctionDeclarationLogic(i.body,te,e),(G.results||[]).forEach(ne=>{var oe,ye,pe,he;if(ne.valueOwner.type!==d.InputMap||Dt.includes(ne.valueOwner.parent.type))return;const ue=i.body.inputs.find(Ae=>ce(Ae,a)===ce(ne.valueOwner,a)),z=[...((ye=(oe=V==null?void 0:V[ue.id])==null?void 0:oe.value)==null?void 0:ye.value)||[],((pe=ne==null?void 0:ne.value)==null?void 0:pe.value)||null];(he=V[ue.id].value)==null||he.metaSync({value:z},null),this.lastExecutionResults.writeValue(ue,V[ue.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["manual-flow-loop"].id:{let X=1;for(;X<=50;){await this.checkStateAndPause();const ae=i.body.inputs.map(te=>{if(te===i.currentIterationNumberArgumentDeclaration){const ne=this.lastExecutionResults.readValue(te.id);if(ne){ne.metaSync({value:X},null),this.lastExecutionResults.writeValue(te,ne);const oe={value:ne,valueOwner:te,type:ke.ExecutionResult,inheritanceLink:null};return V[te.id]=oe,oe}const ue=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=Ht(ue,te,a);return ee==null||ee.metaSync({value:X},null),this.lastExecutionResults.writeValue(te,ee),{value:ee,valueOwner:te,type:ke.ExecutionResult,inheritanceLink:null}}else return V[te.id]}).filter(te=>!!te);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ae,e),(G.results||[]).forEach(te=>{var z,oe,ye;if(te.valueOwner.type!==d.InputMap||Dt.includes(te.valueOwner.parent.type))return;const ne=i.body.inputs.find(pe=>ce(pe,a)===ce(te.valueOwner,a)),ee=[...(z=V[ne.id].value)==null?void 0:z.value,((oe=te.value)==null?void 0:oe.value)||null];(ye=V[ne.id].value)==null||ye.metaSync({value:ee},null),this.lastExecutionResults.writeValue(ne,V[ne.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;X++}break}case re.loop["list-loop"].id:{const X=P[0];let ae=1;const te=X;for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["object-keys-loop"].id:{const X=P[0];let ae=1;const te=X?Object.keys(X):[];for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["object-values-loop"].id:{const X=P[0];let ae=1;const te=X?Object.values(X):[];for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["string-loop"].id:{const X=P[0];let ae=1;const te=X.split("");for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}}let k=U.Success;if(G.value===U.UnhandledError?i.catchesError||i.errorCalls.length?k=U.CaughtError:k=U.UnhandledError:[U.CaughtError,U.Return].includes(G.value)&&(k=G.value),_={value:k,error:((h=(f=G.error)==null?void 0:f.value)==null?void 0:h.value)||null,result:((E=(m=G==null?void 0:G.result)==null?void 0:m.value)==null?void 0:E.value)||null},_.value===U.UnhandledError||_.value===U.CaughtError){let X=null;if(i.error){const ae=lp(_.error),te=(b=i.error)==null?void 0:b.getDataType(null),ne=Ht(te||null,i.error,a);if(te!=null&&te.asType)ne==null||ne.setValueAsTypeSingle(_.error);else{const ue=vr(ae)?JSON.stringify(ae,null,2):ae;ne==null||ne.metaSync({value:ue},null)}X={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:ne}}return{value:_.value,entity:i,error:X,result:null}}const K=i==null?void 0:i.getDataType(null),le=Ht(K,i,a);return K!=null&&K.asType?le==null||le.setValueAsTypeSingle(_.result):le==null||le.metaSync({value:_.result},null),{value:_.value,entity:i,error:null,result:{value:le||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(_){if(_&&(_.name==="ExecutionStoppedError"||_.message==="Execution was stopped"))throw _;if(Y.Logger.warn("Error executing loop: ",_),i.error){const P=lp(_),V=(A=i.error)==null?void 0:A.getDataType(null),M=Ht(V,i.error,a);if(V!=null&&V.asType)M==null||M.setValueAsTypeSingle(_);else{const G=vr(P)?JSON.stringify(P,null,2):P;M==null||M.metaSync({value:G},null)}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:M},result:null}}else return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null}}}async executeFunctionCall(i,r,a,c={}){var f,h,m,E,b,A,_,P,V,M,G,k,K,le,X,ae,te,ne,ue,ee,z,oe,ye,pe,he,Ae;const e={...op,...c};try{const Re=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,r,a,e);let Oe=null;if(Re.error&&i.error){Y.Logger.warn("Raw error executing entity: ",Re.error);const Ke=(f=i.error)==null?void 0:f.getDataType(null),Xe=Ht(Ke||null,i.error,a);Ke!=null&&Ke.asType?(m=(h=Re.error)==null?void 0:h.value)!=null&&m.valueAsTypeSingle?Xe==null||Xe.setValueAsTypeSingle((b=(E=Re.error)==null?void 0:E.value)==null?void 0:b.valueAsTypeSingle):(_=(A=Re.error)==null?void 0:A.value)!=null&&_.valueAsTypeList&&Array.isArray((V=(P=Re.error)==null?void 0:P.value)==null?void 0:V.valueAsTypeList)&&(Xe==null||Xe.setValueAsTypeList((G=(M=Re.error)==null?void 0:M.value)==null?void 0:G.valueAsTypeList)):Xe==null||Xe.metaSync({value:(K=(k=Re.error)==null?void 0:k.value)==null?void 0:K.value},null),Oe={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:Xe}}let Be=U.Success;Re.value===U.UnhandledError&&(i.catchesError||i.errorCalls.length?Be=U.CaughtError:Be=U.UnhandledError);const Ge=i==null?void 0:i.getDataType(null),Se=Ht(Ge,i,a);return Ge!=null&&Ge.asType?(X=(le=Re.result)==null?void 0:le.value)!=null&&X.valueAsTypeSingle?Se==null||Se.setValueAsTypeSingle((te=(ae=Re.result)==null?void 0:ae.value)==null?void 0:te.valueAsTypeSingle):(ue=(ne=Re.result)==null?void 0:ne.value)!=null&&ue.valueAsTypeList&&Array.isArray((z=(ee=Re.result)==null?void 0:ee.value)==null?void 0:z.valueAsTypeList)&&(Se==null||Se.setValueAsTypeList((ye=(oe=Re.result)==null?void 0:oe.value)==null?void 0:ye.valueAsTypeList)):Se==null||Se.metaSync({value:((he=(pe=Re.result)==null?void 0:pe.value)==null?void 0:he.value)||null},null),{value:Be,entity:i,error:Oe,result:{value:Se||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(Re){if(Re&&(Re.name==="ExecutionStoppedError"||Re.message==="Execution was stopped"))throw Re;if(!i.error)return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null};const Oe=lp(Re),Be=(Ae=i.error)==null?void 0:Ae.getDataType(null),Ge=Ht(Be,i.error,a);if(Be!=null&&Be.asType)Ge==null||Ge.setValueAsTypeSingle(Re);else{const Se=vr(Oe)?JSON.stringify(Oe,null,2):Oe;Ge==null||Ge.metaSync({value:Se},null)}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:Ge},result:null}}}async executeCondition(i,r){var c,e,f,h;let a=!1;switch(i.declaration.id){case gn.BooleanIsTrue:{const m=(e=(c=r[0])==null?void 0:c.value)==null?void 0:e.value;if(typeof m!="boolean")throw new TypeError("BooleanIsTrue expects a boolean input.");a=m===!0;break}case gn.BooleanIsFalse:{const m=(h=(f=r[0])==null?void 0:f.value)==null?void 0:h.value;if(typeof m!="boolean")throw new TypeError("BooleanIsFalse expects a boolean input.");a=m===!1;break}case Vr.And:{a=(await Promise.all(i.andChildrenGroup.map(async E=>{const b=this.mergeExernalValuesWithInternalInputs(r,E);return(await this.executeCondition(E,b)).value===U.Success}))).every(E=>E);break}case Vr.Or:{a=(await Promise.all(i.orChildrenGroup.map(async E=>{const b=this.mergeExernalValuesWithInternalInputs(r,E);return(await this.executeCondition(E,b)).value===U.Success}))).some(E=>E);break}default:throw new Error(`Condition declaration ${i.declaration.name} does not have an implementation.`)}return{value:a?U.Success:U.ConditionNotMet,entity:i,error:null,result:null}}async executeDetachedFullFunctionDeclarationLogic(i,r,a,c={}){const e={...op,...c,onBeforeEntityExecution:(m,E,b)=>{var A;return((A=c==null?void 0:c.onBeforeEntityExecution)==null?void 0:A.call(c,m,E,{...b,detached:!0}))||Promise.resolve()},onEntityExecuted:(m,E,b)=>{var A;return((A=c==null?void 0:c.onEntityExecuted)==null?void 0:A.call(c,m,E,{...b,detached:!0}))||Promise.resolve()}},f=new yh(a,[i,...nI(i)],i,this,this.parentContext);return f.inheritValuesFromContext(this),await f.execute(e,r)}async executeFullFunctionDeclarationLogic(i,r,a={}){await this.checkStateAndPause();const c={...op,...a},e=nI(i);e.forEach(m=>{this.addEntity(m)}),e.reduce((m,E)=>Dt.includes(E.type)?[...m,...E.outputs]:Ot.includes(E.type)&&E.type!==d.Condition?[...m,...E.outputs,...E.inputs]:E.type===d.Condition?[...m,...E.inputs]:m,[]).forEach(m=>{this.lastExecutionResults.removeValue(m.id)});const h=await this.executeBranch(i,c,r);return{...h||{},value:(h==null?void 0:h.value)||U.Success,entity:i,error:(h==null?void 0:h.error)||null,result:(h==null?void 0:h.result)||null}}static async executeEntryPointEntity(i,r){return{value:U.Success,entity:i,error:null,result:null}}async executeReturnStatement(i,r){var f,h,m,E,b,A,_;if((f=i.throws)!=null&&f.readsValue){const P=to(i.throws,this.valueResolutionContext);return{value:U.UnhandledError,entity:i,error:{valueOwner:i.throws,type:ke.ExecutionResult,inheritanceLink:null,value:(P==null?void 0:P.value)||null},result:null}}let a=to(i,this.valueResolutionContext);const c=i.getDataType(null);if(c!=null&&c.isObject()){let P={};if(((h=c==null?void 0:c.entity)==null?void 0:h.type)===d.DefinitionEntity&&(P={...P,...c.entity.getActiveRawDefaultValue()}),a!=null&&a.value)vr((m=a==null?void 0:a.value)==null?void 0:m.value)&&(P={...P,...(E=a==null?void 0:a.value)==null?void 0:E.value}),a==null||a.value.metaSync({value:P},null);else{const V=Ht(c,i,this.project);V==null||V.metaSync({value:P},null),a={valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:V}}this.lastExecutionResults.writeValue(i,a.value),i.outputs.forEach(V=>{var M,G;if(((M=V.declaration)==null?void 0:M.type)===d.Property&&V.declaration.static){const k=this.lastExecutionResults.readValue(V.declaration.id),K=ce(V,this.project),le=V.codeName||((G=V.declaration)==null?void 0:G.codeName)||ir(K);if(k)k.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,k);else{const X=Ht(V.getDataType(null),V,this.project);X==null||X.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,X)}}})}else this.lastExecutionResults.writeValue(i,a==null?void 0:a.value);const e=(b=a==null?void 0:a.value)!=null&&b.value&&vr((A=a.value)==null?void 0:A.value)?((_=a.value)==null?void 0:_.value)||{}:{};return i.outputs.map(P=>{var k;const V=P.codeName||((k=P.declaration)==null?void 0:k.codeName)||ir(ce(P,this.project)),M=e[V],G=Ht(P.getDataType(null),P,this.project);G==null||G.metaSync({value:M},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Return,entity:i,error:null,result:a}}async executeContinueStatement(i,r){var f,h,m,E,b,A,_;if((f=i.throws)!=null&&f.readsValue){const P=to(i.throws,this.valueResolutionContext);return{value:U.UnhandledError,entity:i,error:{valueOwner:i.throws,type:ke.ExecutionResult,inheritanceLink:null,value:(P==null?void 0:P.value)||null},result:null}}let a=to(i,this.valueResolutionContext);const c=i.getDataType(null);if(c!=null&&c.isObject()){let P={};if(((h=c==null?void 0:c.entity)==null?void 0:h.type)===d.DefinitionEntity&&(P={...P,...c.entity.getActiveRawDefaultValue()}),a!=null&&a.value)vr((m=a==null?void 0:a.value)==null?void 0:m.value)&&(P={...P,...(E=a==null?void 0:a.value)==null?void 0:E.value}),a==null||a.value.metaSync({value:P},null);else{const V=Ht(c,i,this.project);V==null||V.metaSync({value:P},null),a={valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:V}}this.lastExecutionResults.writeValue(i,a.value),i.outputs.forEach(V=>{var M,G;if(((M=V.declaration)==null?void 0:M.type)===d.Property&&V.declaration.static){const k=this.lastExecutionResults.readValue(V.declaration.id),K=ce(V,this.project),le=V.codeName||((G=V.declaration)==null?void 0:G.codeName)||ir(K);if(k)k.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,k);else{const X=Ht(V.getDataType(null),V,this.project);X==null||X.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,X)}}})}else this.lastExecutionResults.writeValue(i,a==null?void 0:a.value);const e=(b=a==null?void 0:a.value)!=null&&b.value&&vr((A=a.value)==null?void 0:A.value)?((_=a.value)==null?void 0:_.value)||{}:{};return i.outputs.map(P=>{var k;const V=P.codeName||((k=P.declaration)==null?void 0:k.codeName)||ir(ce(P,this.project)),M=e[V],G=Ht(P.getDataType(null),P,this.project);G==null||G.metaSync({value:M},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Continue,entity:i,error:null,result:a}}async executeBreakStatement(i,r){var f,h,m,E,b,A,_;if((f=i.throws)!=null&&f.readsValue){const P=to(i.throws,this.valueResolutionContext);return{value:U.UnhandledError,entity:i,error:{valueOwner:i.throws,type:ke.ExecutionResult,inheritanceLink:null,value:(P==null?void 0:P.value)||null},result:null}}let a=to(i,this.valueResolutionContext);const c=i.getDataType(null);if(c!=null&&c.isObject()){let P={};if(((h=c==null?void 0:c.entity)==null?void 0:h.type)===d.DefinitionEntity&&(P={...P,...c.entity.getActiveRawDefaultValue()}),a!=null&&a.value)vr((m=a==null?void 0:a.value)==null?void 0:m.value)&&(P={...P,...(E=a==null?void 0:a.value)==null?void 0:E.value}),a==null||a.value.metaSync({value:P},null);else{const V=Ht(c,i,this.project);V==null||V.metaSync({value:P},null),a={valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:V}}this.lastExecutionResults.writeValue(i,a.value),i.outputs.forEach(V=>{var M,G;if(((M=V.declaration)==null?void 0:M.type)===d.Property&&V.declaration.static){const k=this.lastExecutionResults.readValue(V.declaration.id),K=ce(V,this.project),le=V.codeName||((G=V.declaration)==null?void 0:G.codeName)||ir(K);if(k)k.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,k);else{const X=Ht(V.getDataType(null),V,this.project);X==null||X.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,X)}}})}else this.lastExecutionResults.writeValue(i,a==null?void 0:a.value);const e=(b=a==null?void 0:a.value)!=null&&b.value&&vr((A=a.value)==null?void 0:A.value)?((_=a.value)==null?void 0:_.value)||{}:{};return i.outputs.map(P=>{var k;const V=P.codeName||((k=P.declaration)==null?void 0:k.codeName)||ir(ce(P,this.project)),M=e[V],G=Ht(P.getDataType(null),P,this.project);G==null||G.metaSync({value:M},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Break,entity:i,error:null,result:a}}async executeVariable(i,r){var h,m,E,b,A,_,P;let a=to(i,this.valueResolutionContext);const c=Ir(i),e=c.getDataType(null);if(e!=null&&e.isObject()){let V={};if(((h=e==null?void 0:e.entity)==null?void 0:h.type)===d.DefinitionEntity?V={...V,...e.entity.getActiveRawDefaultValue()}:((m=e==null?void 0:e.entity)==null?void 0:m.type)===d.BuiltInBaseEntity&&(V={...V,...e.entity.getRawDefaultValue()}),a!=null&&a.value)vr((E=a==null?void 0:a.value)==null?void 0:E.value)&&(V={...V,...(b=a==null?void 0:a.value)==null?void 0:b.value}),a==null||a.value.metaSync({value:V},null);else{const M=Ht(e,i,this.project);M==null||M.metaSync({value:V},null),a={valueOwner:c,type:ke.ExecutionResult,inheritanceLink:null,value:M}}i.inputs.forEach(M=>{var K,le,X,ae,te,ne;const G=to(M,this.valueResolutionContext),k=c.inputs.find(ue=>{var ee,z;return((ee=ue.declaration)==null?void 0:ee.id)===((z=M.declaration)==null?void 0:z.id)});if(((K=k==null?void 0:k.declaration)==null?void 0:K.type)===d.Property&&((le=k==null?void 0:k.declaration)!=null&&le.static))G!=null&&G.value?this.lastExecutionResults.writeValue(k==null?void 0:k.declaration,G==null?void 0:G.value):this.lastExecutionResults.removeValue(k==null?void 0:k.declaration.id);else if(G!=null&&G.value){const ue=ce(M,this.project),ee=M.codeName||((X=M.declaration)==null?void 0:X.codeName)||ir(ue);(ne=a==null?void 0:a.value)==null||ne.metaSync({value:{...(ae=a.value)==null?void 0:ae.value,[ee]:(te=G==null?void 0:G.value)==null?void 0:te.value}},null)}}),this.lastExecutionResults.writeValue(c,a.value)}else this.lastExecutionResults.writeValue(c,a==null?void 0:a.value);const f=(A=a==null?void 0:a.value)!=null&&A.value&&vr((_=a.value)==null?void 0:_.value)?((P=a.value)==null?void 0:P.value)||{}:{};return i.outputs.map(V=>{var K;const M=V.codeName||((K=V.declaration)==null?void 0:K.codeName)||ir(ce(V,this.project)),G=f[M],k=Ht(V.getDataType(null),V,this.project);k==null||k.metaSync({value:G},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Success,entity:i,error:null,result:a}}mergeValues(i,r){const a=[];for(let c=0;c<r.length;c++)i!=null&&i[c]?a.push(i[c]):a.push(r[c]);return a}async executeEntity(i,r=[],a={}){var f,h,m,E,b,A,_,P,V,M,G,k;const c={...op,...a},e={detached:!1,execution:this};switch(i.type){case d.Condition:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((f=c.onBeforeEntityExecution)==null?void 0:f.call(c,i,K,e)),this.executeCondition(i,K)}case d.InternalCall:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((h=c.onBeforeEntityExecution)==null?void 0:h.call(c,i,K,e)),this.executeInternalCall(i,K,this.project)}case d.Operation:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((m=c.onBeforeEntityExecution)==null?void 0:m.call(c,i,K,e)),yh.executeOperation(i,K,this.project)}case d.VariableInstance:case d.VariableDeclaration:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((E=c.onBeforeEntityExecution)==null?void 0:E.call(c,i,K,e)),this.executeVariable(i,K)}case d.FunctionCall:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((b=c.onBeforeEntityExecution)==null?void 0:b.call(c,i,K,e)),this.executeFunctionCall(i,K,this.project)}case d.FunctionDeclaration:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return K.forEach(le=>{le&&le.valueOwner&&this.lastExecutionResults.writeValue(le.valueOwner,le.value)}),await((A=c.onBeforeEntityExecution)==null?void 0:A.call(c,i,K,e)),yh.executeEntryPointEntity(i,K)}case d.Search:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((_=c.onBeforeEntityExecution)==null?void 0:_.call(c,i,K,e)),this.executeSearch(i,K,this.project)}case d.Loop:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((P=c.onBeforeEntityExecution)==null?void 0:P.call(c,i,K,e)),this.executeLoop(i,K,this.project,c)}case d.ReturnStatement:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((V=c.onBeforeEntityExecution)==null?void 0:V.call(c,i,K,e)),this.executeReturnStatement(i,K)}case d.ContinueStatement:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((M=c.onBeforeEntityExecution)==null?void 0:M.call(c,i,K,e)),this.executeContinueStatement(i,K)}case d.BreakStatement:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((G=c.onBeforeEntityExecution)==null?void 0:G.call(c,i,K,e)),this.executeBreakStatement(i,K)}case d.GlobalEvent:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return K.forEach(le=>{le&&le.valueOwner&&this.lastExecutionResults.writeValue(le.valueOwner,le.value)}),await((k=c.onBeforeEntityExecution)==null?void 0:k.call(c,i,K,e)),yh.executeEntryPointEntity(i,K)}default:throw new Error(`Entity type ${i==null?void 0:i.type} is not recognized for execution.`)}}storeLastExecutionValues(i){var a,c,e;if(i.error&&i.error.valueOwner&&this.lastExecutionResults.writeValue(i.error.valueOwner,i.error.value),!i.result||!((a=i.result)!=null&&a.valueOwner))return;const r=ud((c=i.result)==null?void 0:c.valueOwner,this.project);(e=i.result)!=null&&e.value?r.forEach(f=>{var h;this.lastExecutionResults.writeValue(f,(h=i.result)==null?void 0:h.value)}):r.forEach(f=>{this.lastExecutionResults.removeValue(f.id)})}async executeBranch(i,r={},a=[]){var m;await this.checkStateAndPause();const c={...op,...r},e={detached:!1,execution:this};if(!this.hasEntity(i)||this.hasSkipped(i))return null;this.addToExecutingList(i),this.hasScheduled(i)&&this.removeScheduled(i);const h=await this.executeEntity(i,a,c);if(this.removeFromExecutingList(i),this.addToAlreadyExecutedList(i),this.storeLastExecutionValues(h),await((m=c.onEntityExecuted)==null?void 0:m.call(c,i,h,e)),h.value===U.Success){const E=(i.successCalls||i.calls||[]).filter(V=>this.hasEntity(V));(i.errorCalls||[]).forEach(V=>{this.skip(V)});let A=[];const _=(await Promise.all(E.map(V=>this.schedule(V,[],c)))).filter(V=>!!V),P=_.filter(V=>!!V).find(V=>V.value===U.CaughtError||V.value===U.Return||V.value===U.Break||V.value===U.Continue);return P||(A=[...A,..._],h)}else if(h.value===U.CaughtError||h.value===U.ConditionNotMet){const E=(i.errorCalls||[]).filter(V=>this.hasEntity(V));(i.successCalls||i.calls||[]).forEach(V=>{this.skip(V)});let A=[];const _=(await Promise.all(E.map(V=>this.schedule(V,[],c)))).filter(V=>!!V),P=_.filter(V=>!!V).find(V=>V.value===U.CaughtError||V.value===U.UnhandledError||V.value===U.Return||V.value===U.Break||V.value===U.Continue);return P||(A=[...A,..._],h)}else{if(h.value===U.UnhandledError)return this.executing.forEach(E=>{this.skip(E)}),this.scheduled.forEach(E=>{this.skip(E)}),tr.includes(h.entity.type)&&ft(h.entity).forEach(E=>{this.skip(E)}),h;if(h.value===U.Return)return h;if(h.value===U.Break)return h;if(h.value===U.Continue)return h}return h}async execute(i={},r=[]){const a={...op,...i};this.state="running";const c=await this.executeBranch(this.entryPoint,a,r);return this.state="finished-success",c}addEntity(i){var r;this.entities.includes(i)||(this.entities.push(i),(r=this.onAddEntityCallback)==null||r.call(this,i,{}))}async addEntityAsync(i,r={}){var a;this.entities.includes(i)||(this.entities.push(i),await((a=this.onAddEntityCallback)==null?void 0:a.call(this,i,r)))}addEntities(i){i.forEach(r=>this.addEntity(r))}async addEntitiesAsync(i,r={}){const a=Y.YieldTracker.from(r),c=[];for(const e of i)c.push(this.addEntityAsync(e,r)),await a.tick();await Promise.all(c)}removeEntity(i){var r;if(i!==this.entryPoint){const a=this.entities.indexOf(i);a>-1&&(this.entities.splice(a,1),(r=this.onRemoveEntityCallback)==null||r.call(this,i,{}))}}hasEntity(i){var c;if(this.entities.includes(i))return!0;if(((c=i.parent)==null?void 0:c.type)===d.FunctionDeclaration)return this.entities.includes(i.parent);const r=ht(i);if(!r)return!1;const a=r.type===d.Loop&&i.parent===r.body?r.body:null;return a?this.entities.includes(a)||this.entities.includes(r):this.entities.includes(r)}removeScheduled(i){const r=this.scheduled.indexOf(i);r>-1&&this.scheduled.splice(r,1)}hasScheduled(i){return!!this.scheduled.includes(i)}hasSkipped(i){return!!this.skipped.includes(i)}hasExecuted(i){return!!this.executed.includes(i)}hasEntityWithId(i){const r=this.project.get(i);return r?this.hasEntity(r):!1}onAddToSkippedList(i){this.onAddToSkippedListCallback=i}onAbortExecution(i){this.onAbortExecutionCallback=i}onAddEntity(i){this.onAddEntityCallback=i}onRemoveFromSkippedList(i){this.onRemoveFromSkippedListCallback=i}onRemoveEntity(i){this.onRemoveEntityCallback=i}addToExecutingList(i){this.executing.includes(i)||this.executing.push(i)}addToScheduledList(i){this.scheduled.includes(i)||this.scheduled.push(i)}removeFromScheduledList(i){const r=this.scheduled.indexOf(i);r>-1&&this.scheduled.splice(r,1)}removeFromExecutingList(i){var a;const r=this.executing.indexOf(i);r>-1&&(this.executing.splice(r,1),(a=this.onAbortExecutionCallback)==null||a.call(this,i,{}))}removeFromAlreadyExecutedList(i){const r=this.executed.indexOf(i);r>-1&&this.executed.splice(r,1)}removeFromSkippedList(i){var a;const r=this.skipped.indexOf(i);r>-1&&(this.skipped.splice(r,1),(a=this.onRemoveFromSkippedListCallback)==null||a.call(this,i,{}))}addToAlreadyExecutedList(i){this.executed.includes(i)||this.executed.push(i)}addToSkippedList(i){var r;this.skipped.includes(i)||(this.skipped.push(i),(r=this.onAddToSkippedListCallback)==null||r.call(this,i,{}))}getValueTypePreference(i){return this.parentContext.getValueTypePreference(i)||null}setValueTypePreference(i,r){this.parentContext.setValueTypePreference(i,r),this.emit(i,{})}}function P1i(s){var p,i;if(s.isList)return"list";if(((p=s.entity)==null?void 0:p.type)===d.DefinitionEntity)return"definition-entity";switch((i=s.entity)==null?void 0:i.name){case fe.Number:return"number";case fe.String:return"text";case fe.Boolean:return"boolean";case fe.UUID:return"uuid";case fe.Date:return"date-time";default:return"definition-entity"}}const cs={[d.PrimitiveEntity]:{singular:"Primitive",plural:"Primitives",shortSingular:"Primitive",shortPlural:"Primitives"},[d.DefinitionEntity]:{singular:"Definition",plural:"Definitions",shortSingular:"Definition",shortPlural:"Definitions"},[d.BuiltInBaseEntity]:{singular:"Base",plural:"Bases",shortSingular:"Base definition",shortPlural:"Base definitions"},[d.Property]:{singular:"Property",plural:"Properties",shortSingular:"Property",shortPlural:"Properties"},[d.FunctionDeclaration]:{singular:"Custom trigger",plural:"Custom triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[d.FunctionCall]:{singular:"Execute trigger",plural:"Execute trigger",shortSingular:"Execute",shortPlural:"Execute"},[d.GlobalEvent]:{singular:"System trigger",plural:"System triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[d.Project]:{singular:"Project",plural:"Projects",shortSingular:"Project",shortPlural:"Projects"},[d.VariableDeclaration]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[d.VariableInstance]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[d.Condition]:{singular:"Condition",plural:"Conditions",shortSingular:"Condition",shortPlural:"Conditions"},[d.Operation]:{singular:"Operation",plural:"Operations",shortSingular:"Operation",shortPlural:"Operations"},[d.ReturnStatement]:{singular:"Termination",plural:"Terminations",shortSingular:"Termination",shortPlural:"Terminations"},[d.InstalledProject]:{singular:"Installed project",plural:"Installed projects",shortSingular:"Project",shortPlural:"Projects"},[d.Search]:{singular:"Search",plural:"Searches",shortSingular:"Search",shortPlural:"Searches"},[d.Loop]:{singular:"Loop",plural:"Loops",shortSingular:"Loop",shortPlural:"Loops"},[d.ActionDescriptor]:{singular:"Action descriptor",plural:"Action descriptors",shortSingular:"Action descriptor",shortPlural:"Action descriptors"},[d.InternalCall]:{singular:"Internal call",plural:"Internal calls",shortSingular:"Internal call",shortPlural:"Internal calls"},[d.BreakStatement]:{singular:"Loop exit",plural:"Loop exists",shortSingular:"Exit",shortPlural:"Exits"},[d.ContinueStatement]:{singular:"Next iteration",plural:"Next iterations",shortSingular:"Next",shortPlural:"Nexts"},[d.ArgumentDeclaration]:{singular:"Input definition",plural:"Input definitions",shortSingular:"Input",shortPlural:"Inputs"},[d.InputMap]:{singular:"Input",plural:"Inputs",shortSingular:"Input",shortPlural:"Inputs"},[d.OutputMap]:{singular:"Output",plural:"Outputs",shortSingular:"Output",shortPlural:"Outputs"},[d.ValueDescriptor]:{singular:"Value descriptor",plural:"Value descriptors",shortSingular:"Value descriptor",shortPlural:"Value descriptors"},[d.DataType]:{singular:"Data type",plural:"Data types",shortSingular:"Data type",shortPlural:"Data types"},[d.LiteralValue]:{singular:"Literal value",plural:"Literal values",shortSingular:"Value",shortPlural:"Values"}};function g$(s){const p=TD(s);if(!p){const r=Bh(s);if(r.includes(ge.HTTP_ENDPOINT))return"HTTP endpoint";if(r.includes(ge.PERSISTED_ENTITY))return"Persisted entity";if(r.includes(ge.CRON_JOB))return"Scheduled execution";if(r.includes(ge.RELATIONAL_DATABASE))return"Relational database"}if(p){let r="Extension of "+ce(p,p.project)+" entity",a=ys(r);const c=Bh(s);return c.includes(ge.HTTP_ENDPOINT)?"HTTP endpoint"+(a?", "+a:""):c.includes(ge.PERSISTED_ENTITY)?"Persisted entity"+(a?", "+a:""):c.includes(ge.CRON_JOB)?"Scheduled execution"+(a?", "+a:""):c.includes(ge.RELATIONAL_DATABASE)?"Relational database"+(a?", "+a:""):r}let i="";return s.abstract&&(i="Template "),s.static&&(i+=i?" single copy ":"Single copy "),i?i+"definition":"Definition"}function DMe(s){return s.parent.type===d.DefinitionEntity||s.parent.type===d.InstalledProject?"Internal action of "+ce(s.parent,s.project):s.parent.type===d.Loop?"Action repeated on every iteration":"Internal action of entity"}function I$(s){return qL(s)?DMe(s):"Custom trigger"}function N1i(s){var p;switch(s.type){case d.DefinitionEntity:return g$(s);case d.FunctionDeclaration:return I$(s)}return(p=cs[s.type])==null?void 0:p.singular}function x1i(s){var p;switch(s.type){case d.DefinitionEntity:return g$(s);case d.FunctionDeclaration:return I$(s)}return(p=cs[s.type])==null?void 0:p.singular}const R$=4e4,D$=280,$1i=300,w$=65,bf=32,Th=39,sv=26,wMe=49,lv=44,L1i=35,Eg=52,$1=10,Ua=$1*2,Tp=38,bg=90,Fg=270,CMe=R$/2+120,OMe=R$/2+180;function C$(s){let i=bf+lv+Tp+$1;const r=[...s.inputs];return r.length&&(i+=Ua,r.forEach(()=>{i+=sv})),{height:i,width:280}}function ov(s){var a,c;let i=bf+lv+Tp+$1;const r=[...s.inputs];return r.length&&(i+=Ua,r.forEach(()=>{i+=sv})),s.andChildrenGroup&&(i+=Ua,s.andChildrenGroup.forEach(e=>{i+=ov(e).height})),s.orChildrenGroup&&(i+=Ua,s.orChildrenGroup.forEach(e=>{i+=ov(e).height})),(((a=s.declaration)==null?void 0:a.id)===re.condition["condition-group-and"].id||((c=s.declaration)==null?void 0:c.id)===re.condition["condition-group-or"].id)&&(i+=Tp),{height:i,width:280}}function _Me(s){var h,m;let i=w$;const r=[];if([d.DefinitionEntity].includes(s.type)){const E=[...s.suggestedProperties||[],...s.properties||[]];E.length&&(i+=Ua,E.forEach(b=>{i+=b.static?wMe:Th}))}if([d.DefinitionEntity,d.InstalledProject,d.Loop].includes(s.type)){const E=[...(s==null?void 0:s.suggestedMethods)||[],...s.methods||[],...s.functions||[],...s.body?[s.body]:[]];E.length&&(i+=Ua,E.forEach(b=>{const A=C$(b);i+=A.height}))}Ot.includes(s.type)?(r.push(...(s.inputs||[]).flatMap(E=>[E])||[]),i+=Ua,i+=lv,s.error&&(i+=Eg)):[d.ReturnStatement,d.BreakStatement,d.ContinueStatement].includes(s.type)?(r.push(...s.outputs||[]),s.throws&&(i+=Eg)):s.type===d.Condition&&(r.push(s.inputs[0]),s.inputs[1]&&r.push(s.inputs[1]),(((h=s.declaration)==null?void 0:h.id)===re.condition["condition-group-and"].id||((m=s.declaration)==null?void 0:m.id)===re.condition["condition-group-or"].id)&&(i+=Tp),s.andChildrenGroup&&(i+=Ua,s.andChildrenGroup.forEach(E=>{i+=ov(E).height})),s.orChildrenGroup&&(i+=Ua,s.orChildrenGroup.forEach(E=>{i+=ov(E).height})));const a=r.length;a&&(i+=a*Th,i+=Ua);const c=[];if(s.type===d.FunctionDeclaration||s.type===d.GlobalEvent?c.push(...s.inputs||[]):Ot.includes(s.type)&&c.push(...s.outputs||[]),Mt.includes(s.type)){i+=Ua,i+=lv,s.usedInternalCalls.length&&s.usedInternalCalls.forEach(b=>{i+=Eg+Ua,i+=b.inputs.length*sv,i+=b.outputs.length*sv});const E=s.getDataType(null);(!E||E.canModifyObjectStructure())&&(i+=Tp)}s.type===d.Search&&(i+=Tp);const e=c.length;return e&&(i+=e*Th,i+=Ua),[d.DefinitionEntity,d.FunctionDeclaration,d.ReturnStatement,d.BreakStatement,d.ContinueStatement].includes(s.type)&&(i+=Tp),{height:i,width:280}}function VMe(s){let p=0;if(s.parent.type!==d.DefinitionEntity)return{offset:p};const i=s.parent,r=i.methods.findIndex(c=>c.id===s.id);return i.methods.slice(0,r).forEach(c=>{const e=C$(c);p+=e.height}),(i.properties.length||i.suggestedProperties.length)&&(p+=Ua,i.suggestedProperties.forEach(()=>{p+=Th}),i.properties.forEach(()=>{p+=Th})),{offset:p}}function VE(s){return`${s.split("-").map((r,a)=>a===0?r.charAt(0).toUpperCase()+r.slice(1):r.toLowerCase()).join(" ")}.`}function B1i(s){switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return"This template entity has non-template actions";case be.AbstractEntityWithNonAbstractProperties:return"This template entity has non-template properties";case be.IncorrectEntityImplementation:return"This entity incorrectly implements a template entity";case be.IncorrectMethodImplementation:return"This action incorrectly implements the template action it's based on";case be.IncorrectPropertyImplementation:return"This property incorrectly implements the template property it's based on";case be.AbstractMethodInNonAbstractEntity:return"This action is a template action in a non-template entity";case be.AbstractPropertyInNonAbstractEntity:return"This property is a template property in a non-template entity";case Ce.MethodOverwritesOtherSiblingWithSameName:return"An action in this entity overwrites an action in the template entity with the same name";case Ce.PropertyOverwritesOtherSiblingWithSameName:return"A property in this entity overwrites a property in the template entity with the same name";case be.MissingMethodImplementation:return"This entity is missing an action implementation from the template entity";case be.MissingPropertyImplementation:return"This entity is missing a property implementation from the template entity";case Ce.NameNotUniqueInScope:return"Invalid name. There is another entity with the same name in the same scope";case be.NoProperties:return"This entity has no properties, so it doesn't do anything";case be.NonStaticPropertyInStaticEntity:return"This property is not static in a static entity";case be.StaticEntityWithNonStaticProperties:return"This static entity has non-static properties";case be.ReadingFromIncompatibleType:return"This entity reads data from a value of a different data type";case be.WritingToIncompatibleType:return"This entity writes data to a value of a different data type";case be.ScopeWithoutLogic:return"This action has no logic, so it doesn't do anything";case be.NonStaticPropertyImplementsStatic:return"This property is static in a non-static entity";case be.PropertyImplementsIncompatibleType:return"This property implements a property of a different data type";case be.PropertyImplementsNonAbstact:return"This property implements a non-template property";case be.StaticPropertyImplementsNonStatic:return"This static property implements a non-static property";case be.VariableCallsOthersAndHasInternalCall:return"This variable calls other entities while being used to execute internal logic";case be.VariableHasInputsAndInternalCall:return"This variable has inputs while being used to execute internal logic";case be.VariableHasOutputsAndInternalCall:return"This variable has outputs while being used to execute internal logic";case be.VariableIsCalledAndHasInternalCall:return"This variable is called while being used to execute internal logic";case Ce.InternalCallDeclarationIsInvalidType:return"This internal call is not an action";case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"This internal call is not found in the parent entity";case Ce.InternalCallParentDeclarationEntityInvalidType:return"This internal call parent entity is not a data type";case Ce.InternalCallParentMissingDataType:return"This internal call parent entity has no data type";case Ce.UnreachableEntity:return"This entity is unreachable";case be.DisconnectedCallableEntity:return"This entity is disconnected and won't be executed by anything after publishing";case be.AbstractEntityImplements:return"This template entity implements a non-template entity";case be.AbstractExtendingNonAbstractEntity:return"This template entity extends a non-template entity";case be.InvalidPropertiesCombination:return"This entity has an invalid combination of properties";case be.ExtendingNonInteractiveEntity:return"This entity extends a non-interactive entity";case be.ExtendsIncompatibleEntities:return"This entity extends incompatible entities";case be.ImplementingNonAbstractEntity:return"This entity implements a non-template entity";case be.ImplementsIncompatibleEntities:return"This entity implements incompatible entities";case be.LackingReturnStatementOnSomeBranches:return"This action is missing a termination on some branches";case be.LastCalledEntityMustBeReturnEntity:return"The last called entity in this action must be a termination node";case be.MissingRequiredValue:return"This action is missing a required value";case be.NoPrimaryKeyProperty:return"This entity has no primary key property";case be.NonAbstractExtendingAbstractEntity:return"This non-template entity extends a template entity";case be.NonStaticExtendingStaticEntity:return"This non-static entity extends a static entity";case be.NonStaticImplementingStaticEntity:return"This non-static entity implements a static entity";case be.StaticExtendingNonStaticEntity:return"This static entity extends a non-static entity";case be.StaticImplementingNonStaticEntity:return"This static entity implements a non-static entity";case be.VariableReadsValueAndInternalCall:return"This variable reads a value while being used to execute internal logic";case be.VariableWritesValuesAndInternalCall:return"This variable writes values while being used to execute internal logic";case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return"This internal call declaration is not in the parent entity";case Ce.EmptyName:return"This entity has no name";case Ce.InvalidObjectStructure:return"This entity has an invalid structure";case Ce.LoopBodyFunctionOverwrite:return"This loop body action overwrites an action in the template entity with the same name";case Ce.MethodOverwritesBaseMethodWithSameImplementation:return"This action overwrites a base action with the same implementation";case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"This action overwrites an action in an extended entity with the same implementation";case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"This action overwrites an action in an implemented entity with the same implementation";case Ce.MissingCaller:return"This action is missing a caller";case Ce.NameAsResolvedCodeNameNotUniqueInScope:return"This entity has a name that is not unique in the scope of the code it is used in";case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"This entity name can only contain letters, numbers, underscores and spaces";case Ce.NameMustStartWithLetterOrUnderscore:return"This entity name must start with a letter or an underscore";case Ce.NoOverlapWithImplementedSignature:return"This action does not overlap with the implemented action signature";case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return"This property overwrites a base property with the same implementation";case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an extended entity with the same implementation";case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an implemented entity with the same implementation";case Ce.ReaderWriterIncompatibleDataType:return"This reader/writer has an incompatible data type with the value it is reading/writing";case Td.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case Td.StatusCodeMustBeNumber:return"HTTP status code must be a number, between 100 and 599";case hs.UUIDMustBeString:return`UUID must be a string, eg: "${gp()}"`;case hs.UUIDMustNotContainSpaces:return`UUID must not contain spaces, eg: "${gp()}"`;case hs.UUIDMustBeValidFormat:return`UUID must be in a valid format. Eg: "${gp()}"`;case xn.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case xn.StringValueMustNotHaveDashes:return"This value must not contain dashes";case xn.StringValueMustNotHaveSpaces:return"This value must not contain spaces";case xn.ValueMustBeString:return"This value must be a string";case ZT.DayOfMonthAndWeekConflict:return"Cron expression cannot have both day of month and day of week";case ZT.InvalidCharacters:return"Cron expression has invalid characters";case ZT.MustHaveSixFields:return"Cron expression must have six fields";default:return VE(s.code)}}function M1i(s){switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return"Non-template actions";case be.AbstractEntityWithNonAbstractProperties:return"Non-template properties";case be.IncorrectEntityImplementation:return"Incorrect implementation";case be.IncorrectMethodImplementation:return"Incorrect action implementation";case be.IncorrectPropertyImplementation:return"Incorrect property implementation";case be.AbstractMethodInNonAbstractEntity:return"Template action in non-template entity";case be.AbstractPropertyInNonAbstractEntity:return"Template property in non-template entity";case Ce.MethodOverwritesOtherSiblingWithSameName:return"Action overwrite";case Ce.PropertyOverwritesOtherSiblingWithSameName:return"Property overwrite";case be.MissingMethodImplementation:return"Missing action";case be.MissingPropertyImplementation:return"Missing property";case Ce.NameNotUniqueInScope:return"Duplicate name";case be.NoProperties:return"No properties";case be.NonStaticPropertyInStaticEntity:return"Non-static property";case be.StaticEntityWithNonStaticProperties:return"Non-static properties";case be.ReadingFromIncompatibleType:return"Read from different type";case be.WritingToIncompatibleType:return"Write to different type";case be.ScopeWithoutLogic:return"No logic";case be.NonStaticPropertyImplementsStatic:return"Invalid static property";case be.PropertyImplementsIncompatibleType:return"Incompatible data type";case be.PropertyImplementsNonAbstact:return"Non-template property";case be.StaticPropertyImplementsNonStatic:return"Non-static property";case be.VariableCallsOthersAndHasInternalCall:return"Bad internal call";case be.VariableHasInputsAndInternalCall:return"Bad internal call";case be.VariableHasOutputsAndInternalCall:return"Bad internal call";case be.VariableIsCalledAndHasInternalCall:return"Bad internal call";case Ce.InternalCallDeclarationIsInvalidType:return"Declaration not an action";case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"Declaration not found in parent";case Ce.InternalCallParentDeclarationEntityInvalidType:return"Invalid parent declaration type";case Ce.InternalCallParentMissingDataType:return"Parent has no data type";case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return"Declaration not in parent";case Ce.UnreachableEntity:return"Unreachable entity";case be.DisconnectedCallableEntity:return"Disconnected entity";case be.AbstractEntityImplements:return"Abstract entity implements a non-template entity";case be.AbstractExtendingNonAbstractEntity:return"Abstract entity extends a non-template entity";case be.InvalidPropertiesCombination:return"Invalid properties combination";case be.ExtendingNonInteractiveEntity:return"Extending non-interactive entity";case be.ExtendsIncompatibleEntities:return"Extends incompatible entities";case be.ImplementingNonAbstractEntity:return"Implementing non-template entity";case be.ImplementsIncompatibleEntities:return"Implements incompatible entities";case be.LackingReturnStatementOnSomeBranches:return"Missing termination on some branches";case be.LastCalledEntityMustBeReturnEntity:return"Last called entity must be a termination node";case be.MissingRequiredValue:return"Missing required value";case be.NoPrimaryKeyProperty:return"No primary key property";case be.NonAbstractExtendingAbstractEntity:return"Non-template entity extending a template entity";case be.NonStaticExtendingStaticEntity:return"Non-static entity extending a static entity";case be.NonStaticImplementingStaticEntity:return"Non-static entity implementing a static entity";case be.StaticExtendingNonStaticEntity:return"Static entity extending a non-static entity";case be.StaticImplementingNonStaticEntity:return"Static entity implementing a non-static entity";case be.VariableReadsValueAndInternalCall:return"Variable reads value and has internal call";case be.VariableWritesValuesAndInternalCall:return"Variable writes values and has internal call";case Ce.EmptyName:return"Empty name";case Ce.InvalidObjectStructure:return"Invalid object structure";case Ce.LoopBodyFunctionOverwrite:return"Loop body action overwrites action with same name";case Ce.MethodOverwritesBaseMethodWithSameImplementation:return"Action overwrites base action with same implementation";case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case Ce.MissingCaller:return"Missing caller";case Ce.NameAsResolvedCodeNameNotUniqueInScope:return"Name not unique in scope";case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"Name can only contain letters, numbers, underscores and spaces";case Ce.NameMustStartWithLetterOrUnderscore:return"Name must start with letter or underscore";case Ce.NoOverlapWithImplementedSignature:return"No overlap with implemented signature";case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return"Property overwrites base property with same implementation";case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case Ce.ReaderWriterIncompatibleDataType:return"Reader/writer incompatible data type";case Td.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case Td.StatusCodeMustBeNumber:return"HTTP status code must be a number";case hs.UUIDMustBeString:return"UUID must be a string";case hs.UUIDMustNotContainSpaces:return"UUID must not contain spaces";case hs.UUIDMustBeValidFormat:return"UUID must be in a valid format";case xn.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case xn.StringValueMustNotHaveDashes:return"This value must not contain dashes";case xn.StringValueMustNotHaveSpaces:return"This value must not contain spaces";default:return VE(s.code)}}function G1i(s){switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return`${ce(s.entity,s.entity.project)} has non-template actions`;case be.AbstractEntityWithNonAbstractProperties:return`${ce(s.entity,s.entity.project)} has non-template properties`;case be.IncorrectEntityImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements template`;case be.IncorrectMethodImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template`;case be.IncorrectPropertyImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template`;case be.AbstractMethodInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} can't be a template`;case be.AbstractPropertyInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} can't be a template`;case Ce.MethodOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites action`;case Ce.PropertyOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites property`;case be.MissingMethodImplementation:return`${ce(s.entity,s.entity.project)} is missing action`;case be.MissingPropertyImplementation:return`${ce(s.entity,s.entity.project)} is missing property`;case Ce.NameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} name is not unique`;case be.NoProperties:return`${ce(s.entity,s.entity.project)} has no properties`;case be.NonStaticPropertyInStaticEntity:return`${ce(s.entity,s.entity.project)} has non-static property`;case be.StaticEntityWithNonStaticProperties:return`${ce(s.entity,s.entity.project)} has non-static properties`;case be.ReadingFromIncompatibleType:return`${ce(s.entity,s.entity.project)} reads from different type`;case be.WritingToIncompatibleType:return`${ce(s.entity,s.entity.project)} writes to different type`;case be.ScopeWithoutLogic:return`${ce(s.entity,s.entity.project)} has no logic`;case be.NonStaticPropertyImplementsStatic:return`${ce(s.entity,s.entity.project)} has invalid static property`;case be.PropertyImplementsIncompatibleType:return`${ce(s.entity,s.entity.project)} has incompatible data type`;case be.PropertyImplementsNonAbstact:return`${ce(s.entity,s.entity.project)} has non-template property`;case be.StaticPropertyImplementsNonStatic:return`${ce(s.entity,s.entity.project)} has non-static property`;case be.VariableCallsOthersAndHasInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case be.VariableHasInputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case be.VariableHasOutputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case be.VariableIsCalledAndHasInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case Ce.InternalCallDeclarationIsInvalidType:return`${ce(s.entity,s.entity.project)} has declaration that is not an action`;case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has declaration that is not found in parent`;case Ce.InternalCallParentDeclarationEntityInvalidType:return`${ce(s.entity,s.entity.project)} has invalid parent declaration type`;case Ce.InternalCallParentMissingDataType:return`${ce(s.entity,s.entity.project)}'s parent has no data type`;case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has declaration that is not in parent`;case Ce.UnreachableEntity:return`${ce(s.entity,s.entity.project)} is unreachable`;case be.DisconnectedCallableEntity:return`${ce(s.entity,s.entity.project)} is not executed by any entity`;case be.AbstractEntityImplements:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.AbstractExtendingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} extends a non-template entity`;case be.InvalidPropertiesCombination:return`${ce(s.entity,s.entity.project)} has invalid properties combination`;case be.ExtendingNonInteractiveEntity:return`${ce(s.entity,s.entity.project)} extends a non-interactive entity`;case be.ExtendsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} extends incompatible entities`;case be.ImplementingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.ImplementsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} implements incompatible entities`;case be.LackingReturnStatementOnSomeBranches:return`${ce(s.entity,s.entity.project)} is missing termination on some branches`;case be.LastCalledEntityMustBeReturnEntity:return`${ce(s.entity,s.entity.project)}'s last called entity must be a termination node`;case be.MissingRequiredValue:return`${ce(s.entity,s.entity.project)} is missing a required value`;case be.NoPrimaryKeyProperty:return`${ce(s.entity,s.entity.project)} has no primary key property`;case be.NonAbstractExtendingAbstractEntity:return`${ce(s.entity,s.entity.project)} extends a template entity`;case be.NonStaticExtendingStaticEntity:return`${ce(s.entity,s.entity.project)} extends a static entity`;case be.NonStaticImplementingStaticEntity:return`${ce(s.entity,s.entity.project)} implements a static entity`;case be.StaticExtendingNonStaticEntity:return`${ce(s.entity,s.entity.project)} extends a non-static entity`;case be.StaticImplementingNonStaticEntity:return`${ce(s.entity,s.entity.project)} implements a non-static entity`;case be.VariableReadsValueAndInternalCall:return`${ce(s.entity,s.entity.project)} reads a value and has internal call`;case be.VariableWritesValuesAndInternalCall:return`${ce(s.entity,s.entity.project)} writes values and has internal call`;case Ce.EmptyName:return`${cs[s.entity.type]} has no name`;case Ce.InvalidObjectStructure:return`${ce(s.entity,s.entity.project)} has invalid structure`;case Ce.LoopBodyFunctionOverwrite:return`${ce(s.entity,s.entity.project)}'s loop body action overwrites an action`;case Ce.MethodOverwritesBaseMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites base action`;case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MissingCaller:return`${ce(s.entity,s.entity.project)} is missing a caller`;case Ce.NameAsResolvedCodeNameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} has a name not unique in the scope`;case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${ce(s.entity,s.entity.project)} name can only contain letters, numbers, underscores and spaces`;case Ce.NameMustStartWithLetterOrUnderscore:return`${ce(s.entity,s.entity.project)} name must start with letter or underscore`;case Ce.NoOverlapWithImplementedSignature:return`${ce(s.entity,s.entity.project)} has no overlap with implemented signature`;case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites base property`;case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.ReaderWriterIncompatibleDataType:return`${ce(s.entity,s.entity.project)} has reader/writer with incompatible data type`;case Td.StatusCodeMustBeBetween100And599:return`${ce(s.entity,s.entity.project)} HTTP status code must be between 100 and 599`;case Td.StatusCodeMustBeNumber:return`${ce(s.entity,s.entity.project)} HTTP status code must be a number`;case hs.UUIDMustBeString:return`${ce(s.entity,s.entity.project)} UUID must be a string`;case hs.UUIDMustNotContainSpaces:return`${ce(s.entity,s.entity.project)} UUID must not contain spaces`;case hs.UUIDMustBeValidFormat:return`${ce(s.entity,s.entity.project)} UUID must be in a valid format`;case xn.MustBeUniqueAmongSameEntities:return`${ce(s.entity,s.entity.project)} value must be unique among the same kind`;case xn.StringValueMustNotHaveDashes:return`${ce(s.entity,s.entity.project)} value must not contain dashes`;case xn.StringValueMustNotHaveSpaces:return`${ce(s.entity,s.entity.project)} value must not contain spaces`;default:return`${ce(s.entity,s.entity.project)} Error: ${VE(s.code)}`}}function k1i(s){var p,i,r,a;switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return`${ce(s.entity,s.entity.project)} has non-template actions`;case be.AbstractEntityWithNonAbstractProperties:return`${ce(s.entity,s.entity.project)} has non-template properties`;case be.IncorrectEntityImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template entity`;case be.IncorrectMethodImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template action it's based on`;case be.IncorrectPropertyImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template property it's based on`;case be.AbstractMethodInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} is a template action in a non-template entity`;case be.AbstractPropertyInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} is a template property in a non-template entity`;case Ce.MethodOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites an action in the template entity`;case Ce.PropertyOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites a property in the template entity`;case be.MissingMethodImplementation:return`${ce(s.entity,s.entity.project)} is missing an action implementation from the template entity`;case be.MissingPropertyImplementation:return`${ce(s.entity,s.entity.project)} is missing a property implementation from the template entity`;case Ce.NameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} has a duplicate name in the same scope`;case be.NoProperties:return`${ce(s.entity,s.entity.project)} has no properties, so it doesn't do anything`;case be.NonStaticPropertyInStaticEntity:return`${ce(s.entity,s.entity.project)} has a non-static property in a static entity`;case be.StaticEntityWithNonStaticProperties:return`${ce(s.entity,s.entity.project)} has non-static properties in a static entity`;case be.ReadingFromIncompatibleType:return`${ce(s.entity,s.entity.project)} reads data from a value of a different data type`;case be.WritingToIncompatibleType:return`${ce(s.entity,s.entity.project)} writes data to a value of a different data type`;case be.ScopeWithoutLogic:return`${ce(s.entity,s.entity.project)} has no logic`;case be.NonStaticPropertyImplementsStatic:return`${ce(s.entity,s.entity.project)} has a static property in a non-static entity`;case be.PropertyImplementsIncompatibleType:return`${ce(s.entity,s.entity.project)} implements a property of a different data type`;case be.PropertyImplementsNonAbstact:return`${ce(s.entity,s.entity.project)} implements a non-template property`;case be.StaticPropertyImplementsNonStatic:return`${ce(s.entity,s.entity.project)} has a static property in a non-static entity`;case be.VariableCallsOthersAndHasInternalCall:return`${ce(s.entity,s.entity.project)} calls other entities while being used to execute internal logic`;case be.VariableHasInputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has inputs while being used to execute internal logic`;case be.VariableHasOutputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has outputs while being used to execute internal logic`;case be.VariableIsCalledAndHasInternalCall:return`${ce(s.entity,s.entity.project)} is called while being used to execute internal logic`;case Ce.InternalCallDeclarationIsInvalidType:return`${ce(s.entity,s.entity.project)} has a declaration that is not an action`;case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has a declaration that is not found in ${(p=s.entity.parent.getDataType(null))!=null&&p.entity?ce((i=s.entity.parent.getDataType(null))==null?void 0:i.entity,s.entity.project):"the variable's data-type entity"}`;case Ce.InternalCallParentDeclarationEntityInvalidType:return`${ce(s.entity,s.entity.project)} is part of a variable whos data-type entity can't have actions`;case Ce.InternalCallParentMissingDataType:return`${ce(s.entity,s.entity.project)} is part of a variable with no data-type entity`;case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has a declaration doesn't belong to ${(r=s.entity.parent.getDataType(null))!=null&&r.entity?ce((a=s.entity.parent.getDataType(null))==null?void 0:a.entity,s.entity.project):"the variable's data-type entity"}`;case Ce.UnreachableEntity:return`${ce(s.entity,s.entity.project)} is unreachable`;case be.DisconnectedCallableEntity:return`${ce(s.entity,s.entity.project)} is disconnected and won't be executed by anything after publishing`;case be.AbstractEntityImplements:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.AbstractExtendingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} extends a non-template entity`;case be.InvalidPropertiesCombination:return`${ce(s.entity,s.entity.project)} has an invalid combination of properties`;case be.ExtendingNonInteractiveEntity:return`${ce(s.entity,s.entity.project)} extends a non-interactive entity`;case be.ExtendsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} extends incompatible entities`;case be.ImplementingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.ImplementsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} implements incompatible entities`;case be.LackingReturnStatementOnSomeBranches:return`${ce(s.entity,s.entity.project)} has branches that don't terminate`;case be.LastCalledEntityMustBeReturnEntity:return`${ce(s.entity,s.entity.project)} must end with a termination node`;case be.MissingRequiredValue:return`${ce(s.entity,s.entity.project)} is missing a required value`;case be.NoPrimaryKeyProperty:return`${ce(s.entity,s.entity.project)} has no primary key property`;case be.NonAbstractExtendingAbstractEntity:return`${ce(s.entity,s.entity.project)} is a non-template entity extending a template entity`;case be.NonStaticExtendingStaticEntity:return`${ce(s.entity,s.entity.project)} is a non-static entity extending a static entity`;case be.NonStaticImplementingStaticEntity:return`${ce(s.entity,s.entity.project)} is a non-static entity implementing a static entity`;case be.StaticExtendingNonStaticEntity:return`${ce(s.entity,s.entity.project)} is a static entity extending a non-static entity`;case be.StaticImplementingNonStaticEntity:return`${ce(s.entity,s.entity.project)} is a static entity implementing a non-static entity`;case be.VariableReadsValueAndInternalCall:return`${ce(s.entity,s.entity.project)} reads a value and has an internal call`;case be.VariableWritesValuesAndInternalCall:return`${ce(s.entity,s.entity.project)} writes values and has an internal call`;case Ce.EmptyName:return`${cs[s.entity.type]} has no name`;case Ce.InvalidObjectStructure:return`${ce(s.entity,s.entity.project)} has an invalid structure`;case Ce.LoopBodyFunctionOverwrite:return`${ce(s.entity,s.entity.project)}'s loop body action overwrites`;case Ce.MethodOverwritesBaseMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites a base action with same implementation`;case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MissingCaller:return`${ce(s.entity,s.entity.project)} is missing a caller`;case Ce.NameAsResolvedCodeNameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} has a name that is not unique in the scope`;case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${ce(s.entity,s.entity.project)} name can only contain letters, numbers, underscores and spaces`;case Ce.NameMustStartWithLetterOrUnderscore:return`${ce(s.entity,s.entity.project)} name must start with letter or underscore`;case Ce.NoOverlapWithImplementedSignature:return`${ce(s.entity,s.entity.project)} has no overlap with implemented signature`;case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites a base property with same implementation`;case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.ReaderWriterIncompatibleDataType:return`${ce(s.entity,s.entity.project)} has a reader/writer with incompatible data type`;case Td.StatusCodeMustBeBetween100And599:return`${ce(s.entity,s.entity.project)} HTTP status code must be between 100 and 599`;case Td.StatusCodeMustBeNumber:return`${ce(s.entity,s.entity.project)} HTTP status code must be a number, between 100 and 599`;case hs.UUIDMustBeString:return`${ce(s.entity,s.entity.project)} UUID must be a string, eg: "${gp()}"`;case hs.UUIDMustNotContainSpaces:return`${ce(s.entity,s.entity.project)} UUID must not contain spaces, eg: "${gp()}"`;case hs.UUIDMustBeValidFormat:return`${ce(s.entity,s.entity.project)} UUID must be in a valid format. Eg: "${gp()}"`;case xn.MustBeUniqueAmongSameEntities:return`${ce(s.entity,s.entity.project)} value must be unique among the same kind`;case xn.StringValueMustNotHaveDashes:return`${ce(s.entity,s.entity.project)} value must not contain dashes`;case xn.StringValueMustNotHaveSpaces:return`${ce(s.entity,s.entity.project)} value must not contain spaces`;default:return`${ce(s.entity,s.entity.project)} Error: ${VE(s.code)}`}}function PE(s){const p=(s||"").startsWith("error-caller-only--");switch(p?s.replace("error-caller-only--",""):s){case Qt.CallIsInHigherScope:return"In a higher scope";case Qt.CallIsInLowerScope:return"In a lower scope";case Qt.CallerIsInHigherScope:return"Caller is in a higher scope";case Qt.CallerIsInLowerScope:return"Caller is in a lower scope";case Qt.CannotBeCalledByChildren:return"Cannot be called by children";case Qt.CannotCallAncestor:return"Cannot call ancestor";case Qt.CannotConnectToItself:return"Cannot connect to itself";case Qt.CannotReadMoreThanOneValue:return"Cannot read more than one value";case Qt.CannotReadValueFromChildren:return"Cannot read value from entities executed after itself";case Qt.CannotWriteValueToAncestor:return"Cannot write value to ancestor";case vv.Suggestion:return"Suggestion";case Qt.ContinueOrBreakStatementCalledFromOutsideLoop:return"Cannot be called from outside loop";case Qt.DataTypesNotCompatible:return"Data types not compatible";case Qt.ElementInLoopBodyCallingOutsideLoop:return"Cannot call outside loop";case Qt.ErrorOututMapCannotBeConnectedToParentSuccessBranchCallees:return"Error cannot be connected to success branch";case Qt.ExecutionsAlreadyConnected:return"Executions already connected";case Qt.IsNotValueReadingEntity:return"Is not a value reading entity";case Qt.IsNotValueWritingEntity:return"Is not a value writing entity";case Qt.NotInScope:return"Not in a compatible scope";case Qt.OtherIncompatibleScopeReason:return"Incompatible scope";case Qt.SiblingInternalCallAlreadyUsedInParentVariable:return"Internal call already used in parent variable";case Qt.SuccessOutputMapCannotBeConnectedToParentErrorBranchCallees:return"Success cannot be connected to error branch";case Qt.ValuesAlreadyConnected:return"Values already connected";case Qt.CannotInteractWithInputInVariableWithInternalCalls:return"Cannot interact with input in variable with internal calls";case Qt.CannotInteractWithOutputInVariableWithInternalCalls:return"Cannot interact with output in variable with internal calls";case vv.CanvasGloballyDisabled:return"Canvas is globally disabled";case Qt.PropertyIsConstantItsValueCantBeReset:return"Property is constant, its value can't be reset";case Qt.CannotWriteValueOfGlobalVariableDeclaration:return"Cannot write value of global variable declaration";case Qt.CannotReSetValueOfConstantVariable:return"Cannot re-set value of constant variable";case Qt.CannotConnectToOwnNode:return"It is part of the same node";case Qt.CalledByErrorMustBePassThroughCallable:return"Called by error must be pass-through callable";case Qt.CannotChangeScopeBecauseItCallsOtherEntities:return"Cannot change scope because it calls other entities in its current scope";case Qt.CannotChangeScopeBecauseItIsAlreadyCalledByOtherEntitiesInDifferentScope:return"Cannot change scope because it is already called by other entities in different scope";case Qt.VariableDeclarationCannotBeMovedToLowerScopeBecauseInstancesUsage:return"Variable declaration cannot be moved to lower scope because its instances are used in the current or different incompatible lower scope";case Qt.CalledBySourceMustBeCallerEntity:return"Not a caller type";case Qt.CalledByErrorCannotBeConnectedToEntitiesCalledByOwnSuccessBranch:return"Already connected to the success branch from a common origin caller";case Qt.CalledBySuccessCannotBeConnectedToEntitiesCalledByOwnErrorBranch:return"Already connected to the error branch from a common origin caller";case Qt.RedundantCall:return"Redundant call. Already connected further down the execution path";case Qt.CannotBeCalledBeforeDeclaration:return"Cannot be called before declaration";case Qt.CannotBeCalledInParallelBranchToDeclaration:return"Cannot be called in parallel branch to declaration";case Qt.CannotBeHigherScopeThanDeclaration:return"Cannot be in a higher scope than declaration";case Qt.CannotCallGlobalVariableDeclaration:return"Cannot call global variable declaration";case Qt.EntityAlreadyCalledBySuccessCannotBeConnectedToUnrelatedErrorBranch:return p?"Cannot connect error: Already connected to a success branch from a common origin caller":"Already connected to a success branch from a common origin caller";case Qt.CannotInteractWithInputInGlobalVariableDeclaration:return"Cannot interact with input in global variable declaration";case Qt.IsNotCallableEntity:return"Is not a callable node type";case Qt.IsNotCallerEntity:return"Is not a caller node type";case Qt.IsNotPassThroughCallableEntity:return"Is not a pass-through callable node type that has an error branch";case Qt.NotAConnectableEntityType:return"Not a connectable node type";case Qt.WouldMakeAnEarlierNodeBeCalledBeforeItsDeclaration:return"Would make an earlier node be called before its declaration";default:return Gc(s||"")}}function j1i(s,p){const i=[...s,...p],r=Array.from(new Set(i));return{hasChanged:r.length!==s.length,reasons:r}}function U1i(s,p){const i=s.filter(a=>!p.includes(a));return{hasChanged:i.length!==s.length,reasons:i}}function F1i(s,p){return s.find(i=>i.entity.id===p)||null}function TU(s){return s.filter((p,i)=>s.indexOf(p)===i)}class sn{constructor(p,i,r=null,a){R(this,"ids",[]);R(this,"entity");R(this,"entityCardHeight");R(this,"entityCardWidth");R(this,"index");R(this,"childEntities",[]);R(this,"children",[]);R(this,"parents",[]);R(this,"calculationEntryPoint");R(this,"_onlyEntities",null);R(this,"_changeSet",null);if(this.index=i,this.entity=p,this.calculationEntryPoint=r||this,this._changeSet=a||null,this===this.calculationEntryPoint&&!a)throw new Error("Change-set must be provided for the calculation entry point");this.calculateCardSize(),this.getSortedChildren()}static autoGenerateLayout(p,i,r){const a=CMe-Fg-D$,c=OMe-bg-w$;p.type===d.Project?(p.x=a,p.y=c):p.metaSync({x:p.x||a,y:p.y||c},i);const e=new sn(p,0,null,i);e.calculationEntryPoint=e,e._onlyEntities=r||[],e.ids=["0"];const f=[];e.next(m=>{f.push(...m)}),sn.recursivelyAssembleChildrenAreas(f),e.resolveChildrenOverlaps();const h=e.flattenChildEntities();return e._onlyEntities?h.filter(m=>{var E;return(E=e._onlyEntities)==null?void 0:E.includes(m)}):h}static recursivelyAssembleChildrenAreas(p){const i=[];p.forEach(r=>{r.next(a=>{i.push(...a)})}),i.length>0&&sn.recursivelyAssembleChildrenAreas(i)}get onlyEntities(){return this.calculationEntryPoint._onlyEntities||[]}get changeSet(){return this.calculationEntryPoint._changeSet}set changeSet(p){this.calculationEntryPoint._changeSet=p}findAreaInChildrenFromEntity(p){if(this.entity===p)return this;const i=this.children.find(a=>a.entity===p);return i||this.children.reduce((a,c)=>a||c.findAreaInChildrenFromEntity(p),null)}findAreaFromEntity(p){if(this.entity===p)return this;const i=this.calculationEntryPoint.children,r=i.find(c=>c.entity===p);return r||i.reduce((c,e)=>c||e.findAreaInChildrenFromEntity(p),null)}addParent(p){if(!this.parents.includes(p)){const i=sn.resolveIds(p,this.index);this.ids.push(...i),this.parents.push(p)}}static resolveIds(p,i){return p?p.ids.map(r=>`${r}-${i}`):[`${i}`]}getSortedChildren(){if(this.entity.collapsed){this.childEntities=[];return}const p=uo(this.entity,!0);if(this.entity.type===d.Project){const i=[],r=[],a=[];p.forEach(e=>{if(d.DefinitionEntity===e.type){r.push(e);return}else if(Ft.includes(e.type)){a.push(e);return}i.push(e)});const c=i.sort((e,f)=>{const h=!!eI(e,f).length,m=uo(e),E=uo(f);return h?0:m.length&&!E.length?-1:!m.length&&E.length?1:0}).filter(e=>!Kc(e).length);this.childEntities=[...r,...a,...c]}else{const i=[],r=[],a=[],c=[],e=[];tr.includes(this.entity.type)&&yD(this.entity).forEach(m=>{if(Mt.includes(m.type)){a.push(m);return}const E=ht(m);i.push(E)}),wr.includes(this.entity.type)&&r.push(...this.entity.detachedChildren);const f=p.filter(h=>{const m=i.includes(h);return m||a.includes(h)||r.includes(h)?!1:Mt.includes(h.type)?(a.push(h),!1):sr.includes(h.type)&&!m?(c.push(h),!1):h.type===d.DefinitionEntity?(e.push(h),!1):!0});i.sort((h,m)=>no(h,m)?-1:0),c.sort((h,m)=>no(h,m)?-1:0),a.sort((h,m)=>wV(h,m)?1:wV(m,h)?-1:0),this.childEntities=[...e,...i,...c,...f,...a,...r]}}calculateCardSize(){const p=_Me(this.entity);this.entityCardWidth=p.width,this.entityCardHeight=p.height}static getBoundriesOfTwoAreas(p,i){return{top:Math.min(p.top,i.top),left:Math.min(p.left,i.left),bottom:Math.max(p.bottom,i.bottom),right:Math.max(p.right,i.right)}}static getBoundriedOfCombinedAreas(p,i){const r=p.filter(c=>!i.includes(c));return r.reduce((c,e)=>i.includes(e)?c:sn.getBoundriesOfTwoAreas(c,e.fullBranchArea),r[0].fullBranchArea)}getFullAreaUntilAny(p){const i=this.ownEntityPlusBufferArea;return this.children.filter(e=>!p.includes(e)).map(e=>e.getFullAreaUntilAny(p)).reduce((e,f)=>sn.getBoundriesOfTwoAreas(e,f),i)}getFullAreaUntilAreaOrAnyChildren(p){const i=[p,...p.flattenChildren()],r=this.ownEntityPlusBufferArea;return this.children.filter(e=>i.includes(e)).map(e=>e.getFullAreaUntil(p)).reduce((e,f)=>sn.getBoundriesOfTwoAreas(e,f),r)}getFullAreaUntil(p){const i=this.ownEntityPlusBufferArea;return this.children.filter(c=>c!==p).map(c=>c.getFullAreaUntil(p)).reduce((c,e)=>sn.getBoundriesOfTwoAreas(c,e),i)}get fullBranchArea(){const p=this.ownEntityPlusBufferArea;return this.children.map(a=>a.fullBranchArea).reduce((a,c)=>sn.getBoundriesOfTwoAreas(a,c),p)}get ownEntityArea(){return{top:this.entity.y,left:this.entity.x,bottom:this.entity.y+this.entityCardHeight,right:this.entity.x+this.entityCardWidth}}get ownEntityPlusBufferArea(){const p=this.ownEntityArea;return{top:p.top,left:p.left,bottom:p.bottom+bg,right:p.right+Fg}}static filterOutRepeatedAreas(p){return p.filter((i,r)=>p.indexOf(i)===r)}getEarliestId(p,i){const r=p.split("-"),a=i.split("-");return r.length<a.length?p:r.length>a.length?i:r.reduce((e,f,h)=>f<a[h]?p:i,p)}getEarliestLevel(){return this.ids.reduce((r,a)=>this.getEarliestId(r,a),this.ids[0]).split("-").length}countColumns(){let p=0;if(this!==this.calculationEntryPoint)p++;else return p;if(!this.parents.length)return p;const r=this.parents.reduce((a,c)=>c.getEarliestLevel()>a.getEarliestLevel()?c:a,this.parents[0]).countColumns();return p+=r,p}getLatestId(p,i){if(p===i)return p;const r=p.split("-"),a=i.split("-");return r.length<a.length?i:r.length>a.length?p:r.reduce((e,f,h)=>f>a[h]?p:i,p)}getLatestLevel(){return this.ids.length===1?this.ids[0].split("-").length:this.ids.reduce((r,a)=>this.getLatestId(r,a),this.ids[0]).split("-").length}smoothPosition(){const p=this.flattenSiblings();if(!p.length&&this.parents.length<=1&&this.children.length){const i=this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();this.parents.forEach(r=>{r!==this.calculationEntryPoint&&r.shiftDownAlone(i)})}else if([...Ft].includes(this.entity.type)&&this.children.length)this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();else if(!this.children.length&&this.parents.length>1){const i=p.filter(r=>!this.parents.includes(r));i.length?i.every(a=>{const c=this.countColumns(),e=a.countColumns();return c>e})&&this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight():i.length||this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight()}}shiftDownUntilAny(p,i){if(p.includes(this))return p;this.move(this.entity,{y:this.entity.y+i});let r=[...p,this];return this.children.forEach(a=>{if(sn.getEarliestParentInChain(a)!==this)return;const e=F1i(r,a.entity.id);r=sn.filterOutRepeatedAreas([...r]),e||(r=r.filter(h=>h!==a));const f=a.shiftDownUntilAny(r,i);r.push(...f)}),r}shiftRightUntilAny(p,i){p.includes(this)||(this.move(this.entity,{x:this.entity.x+i}),this.children.forEach(r=>{const a=sn.filterOutRepeatedAreas([...this.flattenSiblings(),...p]);sn.getEarliestParentInChain(r)===this&&r.shiftRightUntilAny(a,i)}))}shiftRight(p){this.move(this.entity,{x:this.entity.x+p}),this.children.forEach(i=>{const a=i.flattenSiblings().filter(c=>c!==i);i.shiftRightUntilAny(a,p)})}shiftDownAlone(p){this.move(this.entity,{y:this.entity.y+p})}centerHeaderVerticallyOverCombinedAllParentsHeaderHeight(){const p=this.parents.reduce((a,c)=>{const e=c.ownEntityArea,f=e.top+bf,h={top:f,left:e.left,bottom:f,right:e.right};return sn.getBoundriesOfTwoAreas(a,h)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),r=(p.bottom-p.top)/2-bf;this.shiftDownAlone(r)}centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight(){const p=this.children.reduce((a,c)=>{const e=c.ownEntityArea,f=e.top+bf,h={top:f,left:e.left,bottom:f,right:e.right};return sn.getBoundriesOfTwoAreas(a,h)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),r=(p.bottom-p.top)/2-bf;return this.shiftDownAlone(r),r}resolveChildrenOverlaps(){const p=this.flattenChildren();let i=[];p.forEach(r=>{const a=r.adjustVerticallyToAvoidOverlaps();i.push(...a)}),p.forEach(r=>{r.smoothPosition()})}static getEarliestParentInChain(p){let i=p.parents[0];return p.parents.length&&(i=p.parents.sort((r,a)=>{if(!r.ids.length)return-1;if(!a.ids.length)return 1;const c=r.ids.sort((f,h)=>f.length<h.length?-1:0),e=a.ids.sort((f,h)=>f.length<h.length?-1:0);return c[0].length-e[0].length})[0]),i}flattenEarlierSiblings(p=new Set){return p.add(this.entity.id),this.parents.reduce((r,a)=>{if(p.has(a.entity.id))return r;p.add(a.entity.id);const e=a.children.slice(0,a.children.indexOf(this)).reduce((f,h)=>[...f,h,...h.flattenChildren(p)],[]);return[...r,...e]},[])}flattenSiblings(p=new Set){return p.add(this.entity.id),this.parents.reduce((r,a)=>{if(p.has(a.entity.id))return r;p.add(a.entity.id);const e=a.children.filter(f=>f!==this).reduce((f,h)=>[...f,h,...h.flattenChildren(p)],[]);return[...r,...e]},[])}flattenChildren(p=new Set){return this.children.reduce((i,r)=>p.has(r.entity.id)?i:(p.add(r.entity.id),[...i,r,...r.flattenChildren(p)]),[])}flattenParents(p=new Set){return this.parents.reduce((r,a)=>p.has(a.entity.id)?r:(p.add(a.entity.id),[...r,a,...a.flattenParents(p)]),[])}getAreaIfRendered(p){return this.calculationEntryPoint.flattenChildren().find(a=>a.entity.id===p.id)||null}getLowerSiblings(){const p=this.parents.reduce((i,r)=>{const a=r.children.indexOf(this),c=r.children.slice(a+1);return[...i,...c]},[]);return TU(p)}getLowerAreas(){const p=this.getLowerSiblings(),i=this.parents.reduce((r,a)=>[...r,...a.getLowerAreas()],[]);return TU([...p,...i])}adjustVerticallyToAvoidOverlaps(p=[]){const r=sn.getEarliestParentInChain(this).children[this.index-1];if(!r)return p;const a=this.flattenEarlierSiblings(),c=this.flattenParents(),e=[...a,...c,r],m=C(e.flatMap(_=>eI(this.entity,_.entity))).filter(_=>_.id!==this.entity.id).map(_=>this.findAreaFromEntity(_)).filter(_=>!!_),E=this.getFullAreaUntilAny(m),b=r.getFullAreaUntilAny(m),A=e.reduce((_,P)=>P===this||P.fullBranchArea.left!==E.left?_:Math.max(_,P.fullBranchArea.bottom),b.bottom);if(E.top<A){const _=A-E.top+bg;return this.shiftDownUntilAny(p,_)}return p}move(p,i){if(this.onlyEntities.includes(p)){if(!this.changeSet)throw new Error("Change set is not defined for this area, cannot move entity");p.metaSync(i,this.changeSet)}}addChild(p){const i=this.childEntities[p];let r=null;i.x&&i.y?r=this.getAreaIfRendered(i):!i.x&&!i.y&&this.move(i,{x:this.entity.x,y:this.entity.y}),r||(r=new sn(i,p,this.calculationEntryPoint));const a=this.ownEntityPlusBufferArea;this.children.includes(r)||(this.children.push(r),r.addParent(this));const c=r.fullBranchArea;if(c.left<a.right){const e=a.right-c.left;r.shiftRight(e)}return r}flattenChildEntities(p=new Set){return this.children.reduce((i,r)=>p.has(r.entity.id)?i:(p.add(r.entity.id),[...i,r.entity,...r.flattenChildEntities(p)]),[])}next(p){const i=[];this.childEntities.forEach((r,a)=>{const c=this.addChild(a);c&&i.push(c)}),p(i)}}async function K1i(s,p,i={}){var c;const r=Y.YieldTracker.from(i),a=[];console.log("Generating layout for project...");for(const e of s.instancesList){if(s.diggestedBuiltInBaseEntitiesIds.has(e.id)||!$f.includes(e.type)||((c=ht(e))==null?void 0:c.id)!==e.id)continue;let f=Ut(e,s);if(!f){console.log("No top scope owner for instance: ",e," in project: ",s);continue}if(!(Ft.includes(f.type)&&f.collapsed&&f.id!==e.id)){for(;f.parent&&f.parent!==s;)f=f.parent,Ft.includes(f.type)&&f.collapsed&&(f.id,e.id);e.x=0,e.y=0,p==null||p.add(e,H.Updated),a.push(e),await r.tick()}}sn.autoGenerateLayout(s,p,a)}async function q1i(s,p,i={}){const r=Y.YieldTracker.from(i),a=[],c=[s,...ft(s)].map(e=>ht(e)).filter(Boolean);for(const e of c){if(s.project.diggestedBuiltInBaseEntitiesIds.has(e.id))continue;let f=Ut(e,s.project);if(f&&!(Ft.includes(f.type)&&f.collapsed&&f.id!==e.id)){for(;f.parent&&f.parent!==s.project;)f=f.parent,Ft.includes(f.type)&&f.collapsed&&(f.id,e.id);e.x=0,e.y=0,p==null||p.add(e,H.Updated),a.push(e),await r.tick()}}sn.autoGenerateLayout(s.project,p,a)}async function S1i(s,p,i={}){const r=Y.YieldTracker.from(i),a=[],c=new Set;RKe(p,{shallowMissingActivesError:!0,excludeAffected:!0}).forEach(m=>{var b;if((!m.x||!m.y)&&!c.has(m.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(m.id)&&(a.push(m),c.add(m.id)),co(m,s)){const A=ht(m);A&&!c.has(A.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(A.id)&&(a.push(A),c.add(A.id))}if(tr.includes(m.type)){const A=m;[A,...ft(A)].forEach(P=>{const V=ht(P);V&&!c.has(V.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(V.id)&&(a.push(V),c.add(V.id))})}m.type===d.DefinitionEntity&&m.methods.forEach(A=>{ft(A).forEach(P=>{const V=ht(P);V&&!c.has(V.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(V.id)&&(a.push(V),c.add(V.id))})}),((b=m.parent)==null?void 0:b.type)===d.Project&&(a.push(m),c.add(m.id),tr.includes(m.type)&&ft(m).forEach(P=>{const V=ht(P);V&&!c.has(V.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(V.id)&&(a.push(V),c.add(V.id))}))});let f=[];for(const m of a)s.diggestedBuiltInBaseEntitiesIds.has(m.id)||(m.x=0,m.y=0,p==null||p.add(m,H.Updated),f.push(m),await r.tick());f=C(f),sn.autoGenerateLayout(s,p,f);const h=C([...f,...s.variableDeclarations,...s.variableInstances,...s.loops,...s.conditions,...s.operations,...s.searches]).filter(m=>m.x===0||m.y===0);sn.autoGenerateLayout(s,p,h)}var MT=(s=>(s.Amazon="amazon",s.Google="google",s.Microsoft="microsoft",s))(MT||{}),Rr=(s=>(s.RelationalDatabase="relational-database",s.CompiledLocalCodebase="compiled-local-codebase",s.CloudHostedCodebase="cloud-hosted-codebase",s.HttpApi="http-api",s.HttpEndpoint="http-endpoint",s.ServerlessFunction="serverless-function",s.CronJob="cron-job",s.AWSTenantAccount="aws-tenant-account",s))(Rr||{}),Q_=(s=>(s.Post="post",s.Get="get",s.Acknowledgement="acknowledgment",s.Progress="progress",s.Error="error",s.Complete="complete",s))(Q_||{}),Tf=(s=>(s.Queued="queued",s.Running="running",s.Success="success",s.Failed="failed",s.CleanedUp="cleaned-up",s.Skipped="skipped",s.AbortedByUser="aborted-by-user",s.UnrecoverableFailure="unrecoverable-failure",s.Reverted="reverted",s.UnpublishingStarted="unpublishing-started",s.Unpublished="unpublished",s))(Tf||{}),X_=(s=>(s.Queued="queued",s.Running="running",s.Success="success",s.Failed="failed",s.CleanedUp="cleaned-up",s.UnrecoverableFailure="unrecoverable-failure",s.Reverted="reverted",s.UnpublishingStarted="unpublishing-started",s.Unpublished="unpublished",s))(X_||{}),Zt=(s=>(s.ProjectNotFound="project-not-found",s.ProjectPublishRequestAcknowledged="project-publish-request-acknowledged",s.PublicationStepFailedReasonUnknown="publication-step-failed-reason-unknown",s.DeploymentCompleted="deployment-completed",s.DeploymentStarted="deployment-started",s.DeploymentFailed="deployment-failed",s.AllInfrastructureSuccessfullyProvisioned="all-infrastucture-successfully-provisioned",s.RequestPayloadValidationFailed="request-payload-validation-failed",s.ProjectStateValidationFailedMissingName="project-state-validation-failed-missing-name",s.ProjectStateValidationFailedMissingAnyFunctionality="project-state-validation-failed-missing-any-functionality",s.ProjectAlreadyBeingPublished="project-already-being-published",s.BillingSubscriptionUpdateFailed="billing-subscription-update-failed",s.RelationalDatabaseDeploymentStarted="relational-database-deployment-started",s.RelationalDatabaseDeploymentCompleted="relational-database-deployment-completed",s.RelationalDatabaseDeploymentFailed="relational-database-deployment-failed",s.CreatingNewRelationalDatabase="creating-new-relational-database",s.WaitingForPreviousRelationalDatabaseDeployment="waiting-for-previous-relationa-database-deployment",s.RelationalDatabaseAlreadyExists="relational-database-already-exists",s.RelationalDatabaseDeletionStarted="relational-database-deletion-started",s.RelationalDatabaseDeletionCompleted="relational-database-deletion-completed",s.RelationalDatabaseDeletionFailed="relational-database-deletion-failed",s.WaitingForPreviousRelationalDatabaseDeletion="waiting-for-previous-relationa-database-deletion",s.HttpApiDeploymentStarted="http-api-deployment-started",s.HttpApiDeploymentCompleted="http-api-deployment-completed",s.HttpApiDeploymentFailed="http-api-deployment-failed",s.CreatingNewHttpApi="creating-new-http-api",s.HttpApiAlreadyExists="http-api-already-exists",s.HttpApiDeletionStarted="http-api-deletion-started",s.HttpApiDeletionCompleted="http-api-deletion-completed",s.HttpApiDeletionFailed="http-api-deletion-failed",s.WaitingForPreviousHttpApiDeletion="waiting-for-previous-http-api-deletion",s.BusinessLogicCodebaseDeploymentStarted="business-logic-codebase-deployment-started",s.BusinessLogicCodebaseDeploymentCompleted="business-logic-codebase-deployment-completed",s.BusinessLogicCodebaseDeploymentFailed="business-logic-codebase-deployment-failed",s.BundlingCodebaseForDownload="bundling-codebase-for-download",s.UploadingCodebaseToCloudStorage="uploading-codebase-to-cloud-storage",s.UploadingCodebaseToCloudStorageCompleted="uploading-codebase-to-cloud-storage-completed",s.UploadingCodebaseToCloudStorageFailed="uploading-codebase-to-cloud-storage-failed",s.InfrastructureValuesCodebaseInterpolationStarted="infrastructure-values-codebase-interpolation-started",s.InfrastructureValuesCodebaseInterpolationCompleted="infrastructure-values-codebase-interpolation-completed",s.InfrastructureValuesCodebaseInterpolationFailed="infrastructure-values-codebase-interpolation-failed",s.CodeCompilationStarted="code-compilation-started",s.CodeCompilationCompleted="code-compilation-completed",s.CodeCompilationFailed="code-compilation-failed",s.BundleCodebaseStarted="bundle-codebase-started",s.BundleCodebaseCompleted="bundle-codebase-completed",s.BundleCodebaseFailed="bundle-codebase-failed",s.InstallingCodebaseDependenciesStarted="installing-codebase-dependencies-started",s.InstallingCodebaseDependenciesCompleted="installing-codebase-dependencies-completed",s.InstallingCodebaseDependenciesFailed="installing-codebase-dependencies-failed",s.MigrateRelationalDatabaseStarted="migrate-relational-database-started",s.MigrateRelationalDatabaseCompleted="migrate-relational-database-completed",s.MigrateRelationalDatabaseFailed="migrate-relational-database-failed",s.ExecutePublicationCompletedEventStarted="execute-publication-completed-event-started",s.ExecutePublicationCompletedEventCompleted="execute-publication-completed-event-completed",s.ExecutePublicationCompletedEventFailed="execute-publication-completed-event-failed",s.ExecutePublicationCompletedEventTimedOut="execute-publication-completed-event-timed-out",s.AWSTenantAccountProvisioningStarted="aws-tenant-account-provisioning-started",s.AWSTenantAccountProvisioningCompleted="aws-tenant-account-provisioning-completed",s.AWSTenantAccountProvisioningFailed="aws-tenant-account-provisioning-failed",s))(Zt||{}),eo=(s=>(s.CodeCompilation="code-compilation",s.RelationalDatabaseDeployment="relational-database-deployment",s.RelationalDatabaseDeletion="relational-database-deletion",s.HttpApiDeployment="http-api-deployment",s.HttpApiDeletion="http-api-deletion",s.InfrastructureValuesCodebaseInterpolation="infrastructure-values-codebase-interpolation",s.BundleCodebase="bundle-codebase",s.MigrateRelationalDatabase="migrate-relational-database",s.BusinessLogicCodebaseDeployment="business-logic-codebase-deployment",s.ExecutePublicationCompletedEvent="execute-publication-completed-event",s.CodebaseCleanup="codebase-cleanup",s.AWSTenantAccountProvisioning="aws-tenant-account-provisioning",s))(eo||{});Rr.CloudHostedCodebase,Rr.HttpApi,Rr.RelationalDatabase,Rr.CloudHostedCodebase,Rr.CloudHostedCodebase,Rr.RelationalDatabase,Rr.CloudHostedCodebase,Rr.CloudHostedCodebase;function PMe(s){return`project-${s}-http-api`}function L1(s){return`entity-${s}-database`}class NMe{constructor(p,i,r,a,c,e,f,h,m){R(this,"stepType");R(this,"id");R(this,"resourceType");R(this,"index");R(this,"dependency",[]);R(this,"lastEvent",null);R(this,"lastEventTimestamp",null);R(this,"status",Tf.Queued);R(this,"publicationRun");R(this,"resource");this.stepType=p,this.id=i,this.resourceType=r,this.status=a,this.dependency=c,this.index=e,this.lastEventTimestamp=f,this.publicationRun=h,this.resource=m}toJSON(){return{stepType:this.stepType,id:this.id,resourceType:this.resourceType,index:this.index,status:this.status,dependency:this.dependency,lastEvent:this.lastEvent,resource:{resourceId:this.resource.resourceId,resourceType:this.resource.resourceType,provider:this.resource.provider,details:this.resource.details,status:this.resource.status,name:this.resource.name}}}async update(p){var i,r;this.status=p.status,this.dependency=p.dependency,this.index=p.index,this.stepType=p.stepType,this.resourceType=p.resourceType,this.lastEvent=p.lastEvent,this.id=p.id,(r=this.resource)==null||r.setDetails((i=p.resource)==null?void 0:i.details)}}var xMe=(s=>(s.Ready="ready",s.Provisioning="provisioning",s.Queued="queued",s.ProvisioningFailed="provisioning-failed",s.Deleting="deleting",s.DeletingFailed="deleting-failed",s.Deleted="deleted",s))(xMe||{});class kc{constructor(p,i,r){R(this,"provisionedBy");R(this,"publicationRun");R(this,"resourceType");R(this,"provider");R(this,"resourceId");R(this,"details",null);R(this,"name",null);R(this,"status","queued");this.publicationRun=p,this.resourceType=i,this.provider=r}setDetails(p){this.details=p}setStatus(p){this.status=p}setProvisionedBy(p){this.provisionedBy=p}}class Z1i extends kc{constructor(i,r,a){super(i,Rr.HttpEndpoint,a);R(this,"resourceType",Rr.HttpEndpoint);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,r;return this.resourceId=L1((r=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:r.id),this.resourceId}}class H1i extends kc{constructor(i,r,a){super(i,Rr.ServerlessFunction,a);R(this,"resourceType",Rr.ServerlessFunction);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,r;return this.resourceId=L1((r=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:r.id),this.resourceId}}class $Me extends kc{constructor(i,r,a){super(i,Rr.HttpApi,a);R(this,"resourceType",Rr.HttpApi);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=PMe(this.publicationRun.project.id),this.resourceId}}class LMe extends kc{constructor(i,r,a){super(i,Rr.RelationalDatabase,a);R(this,"resourceType",Rr.RelationalDatabase);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,r;return this.resourceId=L1((r=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:r.id),this.resourceId}}class BMe extends kc{constructor(i,r){super(i,Rr.CloudHostedCodebase,r);R(this,"resourceType",Rr.CloudHostedCodebase);R(this,"details",null);R(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=`cloud-hosted-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}`,this.resourceId}}class MMe extends kc{constructor(i,r){super(i,Rr.CompiledLocalCodebase,r);R(this,"resourceType",Rr.CompiledLocalCodebase);R(this,"details",null);R(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=`compiled-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}--${this.publicationRun.id}`,this.resourceId}}class W1i extends kc{constructor(i,r){super(i,Rr.AWSTenantAccount,r);R(this,"resourceType",Rr.AWSTenantAccount);R(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=`aws-tenant-account--${this.publicationRun.project.id}`,this.resourceId}}class z1i{constructor(p,i){R(this,"id");R(this,"projectAutoIncrementPublicationCount");R(this,"projectPublishedSemanticVersion");R(this,"envIdentifier");R(this,"projectVersion");R(this,"projectBranchId");R(this,"projectId");R(this,"triggeredBy");R(this,"createdAt");R(this,"updatedAt");R(this,"status");R(this,"steps",[]);R(this,"editor");R(this,"explicitResources",new Map);R(this,"implicitGlobalResources",new Map);R(this,"finalGlobalEvent",null);R(this,"finalStatus",null);R(this,"contextType",se.PublicationRun);R(this,"extensionsRegistry");this.id=p.id,this.projectAutoIncrementPublicationCount=p.projectAutoIncrementPublicationCount,this.projectPublishedSemanticVersion=p.projectPublishedSemanticVersion,this.envIdentifier=p.envIdentifier,this.projectVersion=p.projectVersion,this.projectBranchId=p.projectBranchId,this.projectId=p.projectId,this.triggeredBy=p.triggeredBy,this.createdAt=p.createdAt,this.updatedAt=p.updatedAt,this.status=p.status,this.editor=i,this.initRegistry()}get off(){return this.extensionsRegistry.off}get on(){return this.extensionsRegistry.on}get emit(){return this.extensionsRegistry.emit}get emitAsync(){return this.extensionsRegistry.emitAsync}get emitAsyncAll(){return this.extensionsRegistry.emitAsyncAll}get emitAsyncAllSettled(){return this.extensionsRegistry.emitAsyncAllSettled}get emitAsyncSequentially(){return this.extensionsRegistry.emitAsyncSequentially}get emitAsyncSequentiallyAll(){return this.extensionsRegistry.emitAsyncSequentiallyAll}get emitAsyncSequentiallyAllSettled(){return this.extensionsRegistry.emitAsyncSequentiallyAllSettled}get project(){return this.editor.project}getInfraTypes(p){return this.steps.filter(i=>p.includes(i.resourceType))}getStepsTypes(p){return this.steps.filter(i=>p.includes(i.stepType))}toIds(p){return p.map(i=>i.id)}getResourceForEntity(p){const i=Array.from(this.explicitResources.values()).find(r=>r.owners.has(p.id));return i||null}async init(){await this.initResources()}async initResources(){this.implicitGlobalResources.set(Rr.CompiledLocalCodebase,new MMe(this,MT.Amazon)),this.implicitGlobalResources.set(Rr.CloudHostedCodebase,new BMe(this,MT.Amazon));const p=this.project.entities.filter(r=>ui(r,ge.HTTP_ENDPOINT)),i=this.project.entities.filter(r=>ui(r,ge.RELATIONAL_DATABASE));if(i.length&&i.forEach(r=>{const a=new LMe(this,[r],MT.Amazon);this.explicitResources.set(a.resourceId,a)}),p.length){const r=new $Me(this,p,MT.Amazon);this.explicitResources.set(r.resourceId,r)}}setSteps(p,i){p.forEach(r=>{this.addStep(r,i)}),this.editor.events.emit(Zt.ProjectPublishRequestAcknowledged,{})}addStep(p,i){const r=p.dependency||[];if(r.length){const c=r.filter(e=>!this.steps.find(f=>f.id===e));if(c.length)throw new Error(`Missing dependencies: ${c.join(", ")}`)}if(!this.steps.find(c=>c.id===p.id)){const c=new NMe(p.stepType,p.id,p.resourceType,p.status,r,p.index,i,this,null);this.steps.push(c)}}onUpdate(p){var i;if(Y.Logger.log("onUpdate",p),(i=p.payload)!=null&&i.stepType){const r=this.steps.find(a=>{var c;return a.id===((c=p.payload)==null?void 0:c.id)});r&&B(p.emittedAt).isAfter(B(r.lastEventTimestamp))&&r.update(p.payload)}this.editor.events.emit("publication-updated",{}),p.type===Q_.Error?(this.finalStatus=X_.Failed,this.finalGlobalEvent=p.event,this.editor.events.emit("project-publication-error",p)):p.type===Q_.Complete&&(this.finalStatus=X_.Success,this.finalGlobalEvent=p.event,this.editor.events.emit("project-publication-completed",p))}requestExtension(p){return this.extensionsRegistry.requestExtension(p)}async initRegistry(){return this.extensionsRegistry=new E$(this.editor.events),await this.extensionsRegistry.setup(),this.extensionsRegistry.onResolvePublicationRunContext(()=>this),await this.extensionsRegistry.contextAvailable(se.PublicationRun),this.extensionsRegistry}}function Y1i(s){switch(s){case eo.CodeCompilation:return"Code generation";case eo.RelationalDatabaseDeployment:return"Database creation";case eo.HttpApiDeployment:return"HTTP gateway creation";case eo.InfrastructureValuesCodebaseInterpolation:return"Link code with resources";case eo.BundleCodebase:return"Bundle code";case eo.MigrateRelationalDatabase:return"Database structure migration";case eo.BusinessLogicCodebaseDeployment:return"Update servers with new code";case eo.CodebaseCleanup:return"Code cleanup";case eo.HttpApiDeletion:return"HTTP gateway deletion";case eo.RelationalDatabaseDeletion:return"Database deletion";default:return"Publication finished"}}function J1i(s){switch(s){case Zt.DeploymentCompleted:return"Successfully published";case Zt.DeploymentStarted:return"Publication started";case Zt.DeploymentFailed:return"Publication failed";case Zt.AllInfrastructureSuccessfullyProvisioned:return"All infrastructure successfully provisioned";case Zt.RequestPayloadValidationFailed:return"Request payload validation failed";case Zt.ProjectStateValidationFailedMissingName:return"Project state validation failed: missing name";case Zt.ProjectStateValidationFailedMissingAnyFunctionality:return"Project state validation failed: missing any functionality";case Zt.RelationalDatabaseDeploymentStarted:return"Database creation started";case Zt.RelationalDatabaseDeploymentCompleted:return"Database creation completed";case Zt.RelationalDatabaseDeploymentFailed:return"Database creation failed";case Zt.CreatingNewRelationalDatabase:return"Creating new database (up to 5 mins)";case Zt.WaitingForPreviousRelationalDatabaseDeployment:return"Waiting for previous database creation";case Zt.RelationalDatabaseAlreadyExists:return"Database already exists";case Zt.HttpApiDeploymentStarted:return"HTTP gateway creation started";case Zt.HttpApiDeploymentCompleted:return"HTTP gateway creation completed";case Zt.HttpApiDeploymentFailed:return"HTTP gateway creation failed";case Zt.CreatingNewHttpApi:return"Creating new HTTP gateway";case Zt.HttpApiAlreadyExists:return"HTTP gateway already exists";case Zt.BusinessLogicCodebaseDeploymentStarted:return"Update servers with new code started";case Zt.BusinessLogicCodebaseDeploymentCompleted:return"Update servers with new code completed";case Zt.BusinessLogicCodebaseDeploymentFailed:return"Update servers with new code failed";case Zt.BundlingCodebaseForDownload:return"Bundling code for download";case Zt.UploadingCodebaseToCloudStorage:return"Uploading code to cloud storage";case Zt.InfrastructureValuesCodebaseInterpolationStarted:return"Linking code with resources started";case Zt.InfrastructureValuesCodebaseInterpolationCompleted:return"Linking code with resources completed";case Zt.InfrastructureValuesCodebaseInterpolationFailed:return"Linking code with resources failed";case Zt.CodeCompilationStarted:return"Code generation started";case Zt.CodeCompilationCompleted:return"Code generation completed";case Zt.CodeCompilationFailed:return"Code generation failed";case Zt.BundleCodebaseStarted:return"Code bundling started";case Zt.BundleCodebaseCompleted:return"Code bundling completed";case Zt.BundleCodebaseFailed:return"Code bundling failed";case Zt.InstallingCodebaseDependenciesStarted:return"Installing code dependencies";case Zt.InstallingCodebaseDependenciesCompleted:return"Installing code dependencies completed";case Zt.InstallingCodebaseDependenciesFailed:return"Installing code dependencies failed";case Zt.MigrateRelationalDatabaseStarted:return"Database structure migration started";case Zt.MigrateRelationalDatabaseCompleted:return"Database structure migration completed";case Zt.MigrateRelationalDatabaseFailed:return"Database structure migration failed";case Zt.ProjectAlreadyBeingPublished:return"Project already being published. You need to wait for the previous publication to complete";case Zt.ProjectPublishRequestAcknowledged:return"Project publish request acknowledged";case Zt.UploadingCodebaseToCloudStorageCompleted:return"Uploading code to cloud storage completed";case Zt.UploadingCodebaseToCloudStorageFailed:return"Uploading code to cloud storage failed";case Zt.BillingSubscriptionUpdateFailed:return"Billing subscription update failed";case Zt.ProjectNotFound:return"Project not found";case Zt.HttpApiDeletionCompleted:return"HTTP gateway deletion completed";case Zt.HttpApiDeletionFailed:return"HTTP gateway deletion failed";case Zt.HttpApiDeletionStarted:return"HTTP gateway deletion started";case Zt.PublicationStepFailedReasonUnknown:return"Publication step failed: reason unknown";case Zt.WaitingForPreviousHttpApiDeletion:return"Waiting for previous HTTP gateway deletion";case Zt.RelationalDatabaseDeletionStarted:return"Database deletion started";case Zt.RelationalDatabaseDeletionCompleted:return"Database deletion completed";case Zt.RelationalDatabaseDeletionFailed:return"Database deletion failed";case Zt.WaitingForPreviousRelationalDatabaseDeletion:return"Waiting for previous database deletion"}return"Unknown event"}var GMe=(s=>(s.NO_LOGIC="NO_LOGIC",s.NO_NAME="NO_NAME",s.NO_CHANGES="NO_CHANGES",s.PROJECT_PUBLICATION_ALREADY_ONGOING="PROJECT_PUBLICATION_ALREADY_ONGOING",s))(GMe||{});function Q1i(s){switch(s){case"NO_LOGIC":return"This project has no logic";case"NO_NAME":return"This project has no name";case"NO_CHANGES":return"This version has already been published";case"PROJECT_PUBLICATION_ALREADY_ONGOING":return"This project is already being published";default:return"Publishing is currently not available. Try again later"}}function X1i(s){switch(s){case Rr.RelationalDatabase:return"Relational database";case Rr.HttpEndpoint:case Rr.HttpApi:return"HTTP endpoints";case Rr.ServerlessFunction:case Rr.CloudHostedCodebase:return"Server code functions";default:return"Resources"}}function eDi(s){switch(s){case Tf.Running:return"In progress";case Tf.Failed:return"Failed";case Tf.Success:return"Succeeded";case Tf.Skipped:return"Skipped";case Tf.Queued:default:return"Queued"}}function kMe(s){var r;if(!ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION))return null;let p=null;const i=re["built-in-base-entity"].BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_ENTITY.properties.integration.id;if(s.type===d.BuiltInBaseEntity?ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION)&&(p=eV(s.name)):s.type===d.DefinitionEntity&&s.implements.forEach(a=>{if(ui(a,ge.EXTERNAL_INTEGRATION_CONNECTION)){const c=eV(a==null?void 0:a.name);if(c)return p=c,!0}}),!p){const a=s.properties.find(c=>!!c.implements.find(e=>e.id===i)||!!c.implements.find(e=>{var f;return((f=e.extends)==null?void 0:f.id)===i}));p=(r=a==null?void 0:a.getDefaultValue())==null?void 0:r.value}return p}function tDi(s){return bTe[s]}function eV(s){return s.includes("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_")?s.replace("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_","").toLocaleLowerCase().replace("_auth",""):null}function jMe(s){if(s.type!==d.ActionDescriptor&&s.type!==d.Operation)throw new Error("Only ActionDescriptorState or OperationState can be used to resolve an external integration ID");if(s.type===d.ActionDescriptor){const p=s;if(p.id.startsWith("external-integration--"))return p.id.split("--")[1]}if(s.type===d.Operation){const p=s.declaration;if(Object.values(Ti).includes(p.id))return p.id.split("--")[1]||null}return null}function iDi(s){if(!s)throw new Error("The integrationName parameter is required to resolve the base built-in name.");return Object.values(ge).find(i=>!!(i.startsWith("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_")&&i.endsWith("_AUTH")&&i.replace("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_","").replace("_AUTH","").toLowerCase()===s.toLowerCase()))||null}function rDi(s){return s.type===d.BuiltInBaseEntity||s.type===d.DefinitionEntity?kMe(s):s.type===d.ActionDescriptor||s.type===d.Operation?jMe(s):null}function UMe(s){var a,c,e;if(!ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION))return null;let p=null;const i=yKe(s,ge.EXTERNAL_INTEGRATION_CONNECTION);if(!i)return null;const r=re["built-in-base-entity"][i.id].properties.connectionId.id;if(s.type===d.BuiltInBaseEntity){if(ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION)){const f=s.properties.find(h=>{var m;return((m=h.extends)==null?void 0:m.id)===r});f&&(p=(a=f.getDefaultValue())==null?void 0:a.value)}}else if(s.type===d.DefinitionEntity){const f=s.properties.find(h=>!!h.implements.find(m=>m.id===r)||!!h.implements.find(m=>{var E;return((E=m.extends)==null?void 0:E.id)===r}));if(!f&&((c=s.extends)==null?void 0:c.type)===d.DefinitionEntity)return UMe(s.extends);p=(e=f==null?void 0:f.getDefaultValue())==null?void 0:e.value}return p}async function FMe(s,p={}){var f;const i=Y.YieldTracker.from(p),a=[...Aa(s),...Dn(s),...O$(s),...ga(s),..._$(s)],c=JE(s);a.push(...c);const e=qt(s.errors,a);await i.tick();for(const h of s.inputs)await h.validateAsync({tracker:i});for(const h of s.outputs)await h.validateAsync({tracker:i});for(const h of s.internalCalls)await h.validateAsync({tracker:i});return await((f=s.dataType)==null?void 0:f.validateAsync({tracker:i})),e}function KMe(s){var a;(a=s.dataType)==null||a.validate(),s.inputs.forEach(c=>c.validate()),s.outputs.forEach(c=>c.validate()),s.internalCalls.forEach(c=>c.validate());const i=[...Aa(s),...Dn(s),...O$(s),...ga(s),..._$(s)],r=JE(s);return i.push(...r),qt(s.errors,i)}function O$(s,p){const r=[...s.project.getVariableDeclarations()].filter(a=>a.id!==s.id);return XE(s,[ir],r,p)}function _$(s){const p=[];if(s.parent!==s.project)return p;if(s.catchesError){const i=Rt({id:`${s.id}--${Ce.GlobalVariableDeclarationCannotCatchError}`,message:`${cs[s.type].singular} "${ce(s,s.project)}" with id "${s.id}" cannot catch an error because it is globally declared. Global variable declarations must crash the project if an error occurs.`,severity:ve.Error,code:Ce.GlobalVariableDeclarationCannotCatchError,entity:s});p.push(i.error)}if(s.errorCalls.length){const i=Rt({id:`${s.id}--${Ce.GlobalVariableDeclarationCannotCallOnError}`,message:`${cs[s.type].singular} "${ce(s,s.project)}" with id "${s.id}" cannot call other entities from its error branch because it is globally declared. Global variable declarations must crash the project if an error occurs.`,severity:ve.Error,code:Ce.GlobalVariableDeclarationCannotCallOnError,entity:s});p.push(i.error)}if(s.calledBy.length){const i=Rt({id:`${s.id}--${Ce.GlobalVariableDeclarationCannotBeCalled}`,message:`${cs[s.type].singular} "${ce(s,s.project)}" with id "${s.id}" cannot be called because it is globally declared. Global variable declarations must be self initialized when the project is loaded, and not be called for initialization.`,severity:ve.Error,code:Ce.GlobalVariableDeclarationCannotBeCalled,entity:s});p.push(i.error)}return[]}const nDi=Object.freeze(Object.defineProperty({__proto__:null,validate:KMe,validateAsync:FMe,validateGlobalVariableDeclaration:_$,validateVariableDeclarationName:O$},Symbol.toStringTag,{value:"Module"}));async function qMe(s,p={}){const i=Y.YieldTracker.from(p),a=[...Aa(s),...Dn(s),...ga(s),...ad(s),...ZMe(s)],c=JE(s);a.push(...c);const e=qt(s.errors,a);await i.tick();for(const f of s.inputs)await f.validateAsync({tracker:i});for(const f of s.outputs)await f.validateAsync({tracker:i});for(const f of s.internalCalls)await f.validateAsync({tracker:i});return e}function SMe(s){s.inputs.forEach(a=>a.validate()),s.outputs.forEach(a=>a.validate()),s.internalCalls.forEach(a=>a.validate());const i=[...Aa(s),...Dn(s),...ga(s)],r=JE(s);return i.push(...r),qt(s.errors,i)}function ZMe(s){const p=[],i=s.declaration.constant;if(i&&s.readsValue){const r=Rt({id:`${s.id}--${be.ValueReadingOverridesConstantVariable}`,message:`The '${s.type}' entity "${ce(s,s.project)}" with id "${s.id}" is a constant variable whose value cannot be overriden, but reads a value.`,severity:ve.Error,code:be.ValueReadingOverridesConstantVariable,entity:s});p.push(r.error)}if(i&&s.defaultValue){const r=Rt({id:`${s.id}--${be.DefaultValueOverridesConstantVariable}`,message:`The '${s.type}' entity "${ce(s,s.project)}" with id "${s.id}" is a constant variable whose value cannot be overridden, but has a 'defaultValue'.`,severity:ve.Error,code:be.DefaultValueOverridesConstantVariable,entity:s});p.push(r.error)}return p}function ad(s){var h;const p=[],i=s.declaration;if((i==null?void 0:i.id)===((h=s.parent)==null?void 0:h.id)||!s.calledBy.length&&!s.successCalls.length&&!s.errorCalls.length&&s.usedInternalCalls.length)return p;const r=ft(s),a=ft(i);!!r.find(m=>m.id===i.id)&&p.push(Rt({id:`${s.id}--${be.CalledBeforeDeclaration}`,code:be.CalledBeforeDeclaration,severity:ve.Error,message:`Entity of type "${s.type}" with id "${s.id}" is called before its 'variable-declaration' '${i.name}' with id "${i.id}".
54
+ `+c):r.stack=c}catch{}}throw r}}_request(p,i){typeof p=="string"?(i=i||{},i.url=p):i=p||{},i=Of(this.defaults,i);const{transitional:r,paramsSerializer:a,headers:c}=i;r!==void 0&&Tg.assertOptions(r,{silentJSONParsing:ml.transitional(ml.boolean),forcedJSONParsing:ml.transitional(ml.boolean),clarifyTimeoutError:ml.transitional(ml.boolean),legacyInterceptorReqResOrdering:ml.transitional(ml.boolean)},!1),a!=null&&(He.isFunction(a)?i.paramsSerializer={serialize:a}:Tg.assertOptions(a,{encode:ml.function,serialize:ml.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Tg.assertOptions(i,{baseUrl:ml.spelling("baseURL"),withXsrfToken:ml.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=c&&He.merge(c.common,c[i.method]);c&&He.forEach(["delete","get","head","post","put","patch","common"],P=>{delete c[P]}),i.headers=so.concat(e,c);const f=[];let h=!0;this.interceptors.request.forEach(function(V){if(typeof V.runWhen=="function"&&V.runWhen(i)===!1)return;h=h&&V.synchronous;const M=i.transitional||c$;M&&M.legacyInterceptorReqResOrdering?f.unshift(V.fulfilled,V.rejected):f.push(V.fulfilled,V.rejected)});const m=[];this.interceptors.response.forEach(function(V){m.push(V.fulfilled,V.rejected)});let E,b=0,A;if(!h){const P=[fU.bind(this),void 0];for(P.unshift(...f),P.push(...m),A=P.length,E=Promise.resolve(i);b<A;)E=E.then(P[b++],P[b++]);return E}A=f.length;let _=i;for(;b<A;){const P=f[b++],V=f[b++];try{_=P(_)}catch(M){V.call(this,M);break}}try{E=fU.call(this,_)}catch(P){return Promise.reject(P)}for(b=0,A=m.length;b<A;)E=E.then(m[b++],m[b++]);return E}getUri(p){p=Of(this.defaults,p);const i=t2e(p.baseURL,p.url,p.allowAbsoluteUrls);return JBe(i,p.params,p.paramsSerializer)}}He.forEach(["delete","get","head","options"],function(p){jg.prototype[p]=function(i,r){return this.request(Of(r||{},{method:p,url:i,data:(r||{}).data}))}});He.forEach(["post","put","patch"],function(p){function i(r){return function(c,e,f){return this.request(Of(f||{},{method:p,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:e}))}}jg.prototype[p]=i(),jg.prototype[p+"Form"]=i(!0)});const vg=jg;class T${constructor(p){if(typeof p!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(c){i=c});const r=this;this.promise.then(a=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](a);r._listeners=null}),this.promise.then=a=>{let c;const e=new Promise(f=>{r.subscribe(f),c=f}).then(a);return e.cancel=function(){r.unsubscribe(c)},e},p(function(c,e,f){r.reason||(r.reason=new _E(c,e,f),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(p){if(this.reason){p(this.reason);return}this._listeners?this._listeners.push(p):this._listeners=[p]}unsubscribe(p){if(!this._listeners)return;const i=this._listeners.indexOf(p);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const p=new AbortController,i=r=>{p.abort(r)};return this.subscribe(i),p.signal.unsubscribe=()=>this.unsubscribe(i),p.signal}static source(){let p;return{token:new T$(function(a){p=a}),cancel:p}}}const I1i=T$;function R1i(s){return function(i){return s.apply(null,i)}}function D1i(s){return He.isObject(s)&&s.isAxiosError===!0}const W_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(W_).forEach(([s,p])=>{W_[p]=s});const w1i=W_;function s2e(s){const p=new vg(s),i=UBe(vg.prototype.request,p);return He.extend(i,vg.prototype,p,{allOwnKeys:!0}),He.extend(i,p,null,{allOwnKeys:!0}),i.create=function(a){return s2e(Of(s,a))},i}const Kn=s2e(h$);Kn.Axios=vg;Kn.CanceledError=_E;Kn.CancelToken=I1i;Kn.isCancel=XBe;Kn.VERSION=a2e;Kn.toFormData=O1;Kn.AxiosError=ar;Kn.Cancel=Kn.CanceledError;Kn.all=function(p){return Promise.all(p)};Kn.spread=R1i;Kn.isAxiosError=D1i;Kn.mergeConfig=Of;Kn.AxiosHeaders=so;Kn.formToJSON=s=>QBe(He.isHTMLForm(s)?new FormData(s):s);Kn.getAdapter=n2e.getAdapter;Kn.HttpStatusCode=w1i;Kn.default=Kn;const l2e=Kn;class o2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(En.HttpRequest);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h;try{const m=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.method.id}),E=((a=m==null?void 0:m.value)==null?void 0:a.value)||"",b=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.url.id}),A=((c=b==null?void 0:b.value)==null?void 0:c.value)||"",_=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.query.id}),P=((e=_==null?void 0:_.value)==null?void 0:e.value)||"",V=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.body.id}),M=((f=V==null?void 0:V.value)==null?void 0:f.value)||"",G=r.find(X=>{var ae,te;return((te=(ae=X.valueOwner)==null?void 0:ae.declaration)==null?void 0:te.id)===re.operation[En.HttpRequest].inputs.headers.id}),k=((h=G==null?void 0:G.value)==null?void 0:h.value)||"",K={method:E,url:A,params:P,headers:k,data:M};Y.Logger.log("Axios request config: ",K);const le=await l2e(K);return{value:U.Success,error:null,result:{status:le.status,headers:le.headers,data:le.data}}}catch(m){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:m,result:null}}}})}}class d2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL,version:"1.0.0",description:"Execute SQL operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(ao.ExecuteSQL);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.connectionConfig.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find(_=>{var P,V;return((V=(P=_.valueOwner)==null?void 0:P.declaration)==null?void 0:V.id)===re.operation[ao.ExecuteSQL].inputs.query.id}),E=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=this.extensionsRegistry.requestContexts(this,[se.Editor])[0],A=await l2e.post(((e=b.env)==null?void 0:e.API_BASE_URL)+"/editor-runtime/v1/execute-sql",{connectionConfig:h,query:E},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${await b.getAccessToken()}`}});return{value:U.Success,error:null,result:{results:A.data.results||[]}}}catch(f){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:f,result:null}}}})}}class u2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.Validate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)});Y.Logger.log("Inputs for entity validation: ",a);const e=AD(a[1]).safeParse(a[0]);return e.success?{value:U.Success,error:null,result:{data:a[0]}}:{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e.error.errors,result:null}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}const Xa=s=>s.map(p=>{var i,r;return((i=p.value)==null?void 0:i.valueAsType)??((r=p.value)==null?void 0:r.value)});class p2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY,version:"1.0.0",description:"Entity read-key operation implementation module (top-level)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.ReadKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=MVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class c2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY,version:"1.0.0",description:"Entity write-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.WriteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=GVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class f2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY,version:"1.0.0",description:"Entity delete-key operation implementation module (top-level, immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.DeleteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=kVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY,version:"1.0.0",description:"Entity read-nested-key operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.ReadNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=jVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class h2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_NESTED_KEY,version:"1.0.0",description:"Entity write-nested-key operation implementation module (immutable, no auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.WriteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=UVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class m2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_SAFE_NESTED_KEY_RECURSIVELY,version:"1.0.0",description:"Entity write-safe-nested-key-recursively operation implementation module (immutable, auto-create)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.WriteSafeNestedKeyRecursively);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=FVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class T2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY,version:"1.0.0",description:"Entity delete-nested-key operation implementation module (immutable)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(xe.DeleteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const[a,c]=Xa(r),e=KVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class v2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY,version:"1.0.0",description:"Object has-key (top-level property present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.HasKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=qVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class E2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object key-value-equals (top-level property strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.KeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=SVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class b2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY,version:"1.0.0",description:"Object has-nested-key (path present?)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.HasNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=Xa(r),e=ZVe(a,c);return{value:U.Success,error:null,result:e}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class A2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object nested-key-value-equals (path strict equality)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.NestedKeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e]=Xa(r),f=HVe(a,c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class g2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE,version:"1.0.0",description:"Object is-instance-of-type (DefinitionEntity-based runtime check)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(xe.IsInstanceOfType);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,E,b,A,_;try{const P=((c=(a=r[0])==null?void 0:a.value)==null?void 0:c.parent)||((f=(e=r[0])==null?void 0:e.value)==null?void 0:f.standaloneParent),V=(m=(h=r[0])==null?void 0:h.value)==null?void 0:m.value,M=(b=(E=r[1])==null?void 0:E.value)==null?void 0:b.valueAsTypeSingle;if(!V)throw new TypeError("IsInstanceOfType expects a non-null input value.");if(!M)throw new TypeError("IsInstanceOfType expects a valid expectedType input.");if(!P)throw new TypeError("IsInstanceOfType cannot determine the value owner.");if(M.type!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType expects expectedType to be a DefinitionEntity.");const G=P.getDataType(null);if(((A=G==null?void 0:G.entity)==null?void 0:A.type)!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType cannot determine the data type of the input value.");let k=!1;return((_=G==null?void 0:G.entity)==null?void 0:_.id)!==(M==null?void 0:M.id)?k=!1:AD(G==null?void 0:G.entity).safeParse(V).success?k=!0:k=!1,{value:U.Success,error:null,result:k}}catch(P){return{value:U.UnhandledError,error:P,result:null}}}})}}class I2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE,version:"1.0.0",description:"Object merge operation implementation module (immutable, shallow merge with right-precedence)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Merge);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const a=Xa(r),c=WVe(...a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class R2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS,version:"1.0.0",description:"Object keys operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Keys);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=zVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class D2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES,version:"1.0.0",description:"Object values operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Values);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=YVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}class w2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES,version:"1.0.0",description:"Object entries operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic);if(!r)return;const a=r.get(xe.Entries);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=Xa(r),c=JVe(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:U.UnhandledError,error:a,result:null}}}})}}let Us=null;try{Us=require("crypto")}catch{}const HT=typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle?globalThis.crypto:Us&&Us.webcrypto?Us.webcrypto:null,Ip=HT?HT.subtle:null;function av(s){const p=new ArrayBuffer(s.byteLength);return new Uint8Array(p).set(s),p}function yn(s,p="utf8"){if(s instanceof Uint8Array)return s;const i=String(s);if(p==="utf8"){if(typeof TextEncoder<"u")return new TextEncoder().encode(i);if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"utf8"))}else if(p==="hex"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"hex"))}else if(p==="base64"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"base64"))}else if(p==="base64url"){const r=i.replace(/-/g,"+").replace(/_/g,"/").replace(/=+$/,"");if(typeof Buffer<"u")return new Uint8Array(Buffer.from(r,"base64"));const a=typeof atob=="function"?atob(r):"",c=new Uint8Array(a.length);for(let e=0;e<a.length;e++)c[e]=a.charCodeAt(e);return c}throw new Error(`Unsupported environment/encoding combo for toBytes(${p})`)}function jo(s,p="utf8"){if(p==="utf8"){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf8")}else if(p==="hex"){if(typeof Buffer<"u")return Buffer.from(s).toString("hex")}else if(p==="base64"){if(typeof Buffer<"u")return Buffer.from(s).toString("base64")}else if(p==="base64url"&&typeof Buffer<"u")return Buffer.from(s).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");throw new Error(`Unsupported environment/encoding combo for fromBytes(${p})`)}const C2e=s=>yn(s,"base64"),O2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64")},_h=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"base64url")},_f=s=>yn(s,"base64url"),_2e=(s,p)=>{const i=s instanceof Uint8Array?s:yn(String(s),p||"utf8");return jo(i,"hex")},V2e=s=>yn(s,"hex");function v$(s){if(HT&&HT.getRandomValues){const p=new Uint8Array(s);return HT.getRandomValues(p),p}if(Us&&Us.randomBytes)return new Uint8Array(Us.randomBytes(s));throw new Error("Secure random not available")}function P1(s,p){if(!(s instanceof Uint8Array)||!(p instanceof Uint8Array)||s.length!==p.length)return!1;let i=0;for(let r=0;r<s.length;r++)i|=s[r]^p[r];return i===0}function P2e(s,p,i,r){if((typeof s!="string"||typeof p!="string")&&typeof s!="string"&&typeof p!="string")throw new Error("Invalid input types");const a=i??"utf8",c=r??"utf8",e=yn(s??"",a),f=yn(p??"",c);return P1(e,f)}async function N2e(s,p){if(Ip){const i=await Ip.digest({name:s},av(p));return new Uint8Array(i)}if(Us){const i=s.replace("SHA-","sha"),r=Us.createHash(i);return r.update(Buffer.from(p)),new Uint8Array(r.digest())}throw new Error("Hash not available")}async function x2e(s,p,i,r){if(typeof p!="string")throw new Error("Invalid input type for data; expected string");const a=String(s??"SHA-256"),c=i??"utf8",e=r??"base64url",f=yn(p??"",c),h=await N2e(a,f);return jo(h,e)}async function N1(s,p,i){if(Ip){const r=await Ip.importKey("raw",av(p),{name:"HMAC",hash:{name:s}},!1,["sign"]),a=await Ip.sign("HMAC",r,av(i));return new Uint8Array(a)}if(Us){const r=`sha${s.split("-")[1]}`,a=Us.createHmac(r,Buffer.from(p));return a.update(Buffer.from(i)),new Uint8Array(a.digest())}throw new Error("HMAC not available")}async function $2e(s,p,i,r,a,c){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for key or data; expected strings");const e=String(i??"SHA-256"),f=r??"utf8",h=a??"utf8",m=c??"base64url",E=yn(s??"",f),b=yn(p??"",h),A=await N1(e,E,b);return jo(A,m)}async function x1(s,p,{iterations:i,length:r,hashAlg:a="SHA-256"}){if(Ip){const c=await Ip.importKey("raw",av(s),"PBKDF2",!1,["deriveBits"]),e=await Ip.deriveBits({name:"PBKDF2",salt:av(p),iterations:i,hash:a},c,r*8);return new Uint8Array(e)}if(Us){const c=a==="SHA-512"?"sha512":"sha256";return await new Promise((e,f)=>{Us.pbkdf2(Buffer.from(s),Buffer.from(p),i,r,c,(h,m)=>{h?f(h):e(new Uint8Array(m))})})}throw new Error("PBKDF2 not available")}async function L2e(s,p,i,r,a,c,e,f){if(typeof s!="string"||typeof p!="string")throw new Error("Invalid input types for password or salt; expected strings");const h=c??"utf8",m=e??"utf8",E=f??"base64url",b=Math.max(1,Number(i)||21e4),A=Math.max(1,Number(r)||32),_=a??"SHA-256",P=yn(s??"",h),V=yn(p??"",m),M=await x1(P,V,{iterations:b,length:A,hashAlg:_});return jo(M,E)}async function B2e(s,p=v$(16),i=21e4,r=32,a="SHA-256"){const c=yn(s,"utf8"),e=await x1(c,p,{iterations:i,length:r,hashAlg:a}),f=_h(p),h=_h(e);return`pbkdf2$${a.toLowerCase()}$${i}$${f}$${h}`}async function M2e(s,p){const i=String(p).split("$");if(i.length!==5||i[0]!=="pbkdf2")return!1;const r=i[1].toLowerCase(),a=parseInt(i[2],10),c=_f(i[3]),e=_f(i[4]),f=r.includes("512")?"SHA-512":"SHA-256",h=await x1(yn(s,"utf8"),c,{iterations:a,length:e.length,hashAlg:f});return P1(h,e)}async function G2e(s,p,i,r,a,c){const e=p!=null?Math.max(1,Number(p)||0):void 0,f=i!=null?Math.max(1,Number(i)||0):void 0,h=r??void 0,m=c??"base64url",E=a!=null?yn(a,m):void 0;return await B2e(String(s??""),E,e,f,h)}function hU(s){return _h(yn(JSON.stringify(s),"utf8"))}function Ug(s){try{return JSON.parse(jo(_f(s),"utf8"))}catch{return null}}async function k2e(s,p,{alg:i="HS256",includeIat:r=!0,expiresInSeconds:a,notBeforeSeconds:c,issuer:e,subject:f,audience:h,jwtid:m,header:E={}}={}){const b={alg:i,typ:"JWT",...E},A=Math.floor(Date.now()/1e3),_={...s||{}};r&&(_.iat=A),typeof a=="number"&&(_.exp=A+a),typeof c=="number"&&(_.nbf=A+c),e&&(_.iss=e),f&&(_.sub=f),h&&(_.aud=h),m&&(_.jti=m);const P=hU(b),V=hU(_),M=yn(`${P}.${V}`,"utf8"),k=await N1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,M),K=_h(k);return`${P}.${V}.${K}`}async function j2e(s,p,i,r,a,c,e,f,h,m,E,b){if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(s!=null&&typeof s!="object")throw new Error("Invalid input type for payload; expected object");if(E!=null&&typeof E!="object")throw new Error("Invalid input type for header; expected object");if(m!=null&&typeof m!="string")throw new Error("Invalid input type for jwtid; expected string");if(e!=null&&typeof e!="string")throw new Error("Invalid input type for issuer; expected string");if(f!=null&&typeof f!="string")throw new Error("Invalid input type for subject; expected string");if(h!=null&&typeof h!="string"&&!Array.isArray(h))throw new Error("Invalid input type for audience; expected string or string[]");const _=yn(p??"",b??"utf8");return await k2e(s??{},_,{alg:i??"HS256",includeIat:r==null?!0:!!r,expiresInSeconds:a!=null?Number(a):void 0,notBeforeSeconds:c!=null?Number(c):void 0,issuer:e??void 0,subject:f??void 0,audience:h??void 0,jwtid:m??void 0,header:E??void 0})}async function U2e(s,p,{alg:i="HS256",issuer:r,audience:a,maxAgeSeconds:c,clockSkewSeconds:e=60}={}){try{const[f,h,m]=String(s).split(".");if(!f||!h||!m)return{valid:!1,header:null,payload:null,reason:"Malformed"};const E=Ug(f),b=Ug(h);if(!E||!b)return{valid:!1,header:E,payload:b,reason:"Bad base64/json"};if(E.alg!==i)return{valid:!1,header:E,payload:b,reason:"Alg mismatch"};const A=yn(`${f}.${h}`,"utf8"),P=await N1(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",p,A),V=_f(m);if(!P1(P,V))return{valid:!1,header:E,payload:b,reason:"Bad signature"};const M=Math.floor(Date.now()/1e3),G=Math.max(0,Number(e)||0);if(b.nbf!=null&&M+G<Number(b.nbf))return{valid:!1,header:E,payload:b,reason:"Not before"};if(b.exp!=null&&M-G>=Number(b.exp))return{valid:!1,header:E,payload:b,reason:"Expired"};if(r&&b.iss!==r)return{valid:!1,header:E,payload:b,reason:"Issuer mismatch"};if(a){const k=b.aud;if(!(Array.isArray(k)?k.includes(a):k===a))return{valid:!1,header:E,payload:b,reason:"Audience mismatch"}}return c!=null&&b.iat!=null&&M-Number(b.iat)>Number(c)+G?{valid:!1,header:E,payload:b,reason:"MaxAge exceeded"}:{valid:!0,header:E,payload:b}}catch(f){return{valid:!1,header:null,payload:null,reason:String((f==null?void 0:f.message)??f)}}}async function F2e(s,p,i,r,a,c,e,f){if(typeof s!="string")throw new Error("Invalid input type for token; expected string");if(typeof p!="string")throw new Error("Invalid input type for secret; expected string");if(typeof r!="string")throw new Error("Invalid input type for issuer; expected string");if(a!=null&&typeof a!="string")throw new Error("Invalid input type for audience; expected string");const m=yn(p??"",f??"utf8");return await U2e(String(s??""),m,{alg:i??"HS256",issuer:r??void 0,audience:a??void 0,maxAgeSeconds:c!=null?Number(c):void 0,clockSkewSeconds:e!=null?Number(e):void 0})}function K2e(s){const[p,i,r]=String(s).split(".");return{header:p?Ug(p):null,payload:i?Ug(i):null,signature:r?_f(r):new Uint8Array}}function q2e(s,p){if(!s)throw new Error("Token is required for decoding");if(typeof s!="string")throw new Error("Invalid input type for token; expected string");const i=p??"base64url",{header:r,payload:a,signature:c}=K2e(String(s??"")),e=jo(c,i);return{header:r,payload:a,signature:e}}class S2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES,version:"1.0.0",description:"Randomness generate random bytes operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(tt.GenerateRandomBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)}),e=Math.max(0,Number(a)||0),f=c??"base64url",h=v$(e),m=jo(h,f);return{value:U.Success,error:null,result:m}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomInteger);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=EVe(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class H2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomFloat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=v1();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class W2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomHexadecimal);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Hx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class z2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomBase62);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=Wx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Y2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=AVe(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class J2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomAlphanumeric);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)||((m=f.value)==null?void 0:m.value)})[0],e=zx(c);return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class Q2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateIdentifier);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)||((E=h.value)==null?void 0:E.value)}),c=a[0],e=a[1],f=Yx(c,e);return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class X2e extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateRandomUUIDv4);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=gp();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class eMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{Y.Logger.log("Initializing Random Generate Short Identifier Module");const r=i.find(a=>a.contextType===se.Logic);if(r){Y.Logger.log("Project state found, setting up operation");const a=r.get(tt.GenerateShortIdentifier);a?(Y.Logger.log("Operation found, setting autoexecutable and implementation"),a.autoexecutable=!0,a.implementation=this.module.main):Y.Logger.warn("Operation generate-short-identifier not found in project state")}else Y.Logger.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,r)=>{try{const a=gVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class tMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(tt.GenerateHexadecimalToken);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=IVe();return{value:U.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}function C1i(s){let p;if(s===null?p="null":Array.isArray(s)?p="array":p=typeof s,!["string","number","boolean","null","object","array"].includes(p))throw new TypeError("GetTypeOf cannot determine type of the given value.");return p}class iMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF,version:"1.0.0",description:"Data type get type of operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(Qe.GetTypeOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const c=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)||((h=e.value)==null?void 0:h.value)})[0];return{value:U.Success,error:null,result:C1i(c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class rMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING,version:"1.0.0",description:"Coerce any value to string via JS String(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.ToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=String(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class nMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER,version:"1.0.0",description:"Coerce to number via JS Number(value)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.ToNumber);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=Number(a);return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class aMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES,version:"1.0.0",description:"Convert string/bytes-like to Uint8Array (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.ToBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=yn(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class sMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING,version:"1.0.0",description:"Convert Uint8Array to string (utf8|hex|base64|base64url)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.FromBytesToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)}),f=jo(a,c||"utf8");return{value:U.Success,error:null,result:f}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class lMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64,version:"1.0.0",description:"Bytes -> base64 string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:O2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class oMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64,version:"1.0.0",description:"base64 string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=C2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class dMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL,version:"1.0.0",description:"Bytes -> base64url string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.EncodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=_h(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class uMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL,version:"1.0.0",description:"base64url string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.DecodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=_f(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class pMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX,version:"1.0.0",description:"Bytes -> hex string (accepts string input by converting from utf8)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.EncodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=_2e(a,c||"utf8");return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class cMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX,version:"1.0.0",description:"hex string -> bytes (Uint8Array)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Qe.DecodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)}),c=V2e(String(a));return{value:U.Success,error:null,result:c}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class fMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH,version:"1.0.0",description:"Crypto: Hash (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.Hash);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:x2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class yMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC,version:"1.0.0",description:"Crypto: HMAC (SHA-256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.Hmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:$2e(c,e,a,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class hMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL,version:"1.0.0",description:"Crypto: constant-time equality for byte sequences",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.ConstantTimeEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f]=r.map(h=>{var m,E;return((m=h.value)==null?void 0:m.valueAsType)??((E=h.value)==null?void 0:E.value)});return{value:U.Success,error:null,result:P2e(a,c,e,f)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class mMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2,version:"1.0.0",description:"Crypto: derive key with PBKDF2 (SHA-256/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(Li.DeriveKeyPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:L2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class TMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE,version:"1.0.0",description:"Json parse string into object operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(bn.Parse);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a;try{const c=(a=r[0].value)==null?void 0:a.value;if(typeof c!="string")throw new Error(`Invalid input type for JSON.parse operation: expected string, got ${typeof c}`);const e=JSON.parse(c);return{value:U.Success,error:null,result:e}}catch(c){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:c,result:null}}}})}}class vMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY,version:"1.0.0",description:"Json stringify object into string operation implementation module",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(a=>a.contextType===se.Logic);if(r){const a=r.get(bn.Stringify);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=(a=r[0].value)==null?void 0:a.value,f=(c=r[1].value)==null?void 0:c.value;if(!e||typeof e!="object"&&!Array.isArray(e))throw new Error(`Invalid input type for JSON.stringify operation: expected object or array, got ${typeof e}`);if(!f&&f!==0){const m=JSON.stringify(e);return{value:U.Success,error:null,result:m}}const h=JSON.stringify(e,null,f);return{value:U.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:e,result:null}}}})}}class EMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC,version:"1.0.0",description:"JWT: build (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(hr.BuildJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b,A,_,P,V]=r.map(M=>{var G,k;return((G=M.value)==null?void 0:G.valueAsType)??((k=M.value)==null?void 0:k.value)});return{value:U.Success,error:null,result:await j2e(a,c,e,f,h,m,E,b,A,_,P,V)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class bMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC,version:"1.0.0",description:"JWT: verify (HS256/384/512)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(hr.VerifyJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m,E,b]=r.map(A=>{var _,P;return((_=A.value)==null?void 0:_.valueAsType)??((P=A.value)==null?void 0:P.value)});return{value:U.Success,error:null,result:await F2e(a,c,e,f,h,m,E,b)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class AMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE,version:"1.0.0",description:"JWT: decode (no verification)",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(hr.DecodeJwt);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(e=>{var f,h;return((f=e.value)==null?void 0:f.valueAsType)??((h=e.value)==null?void 0:h.value)});return{value:U.Success,error:null,result:q2e(a,c)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class gMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2,version:"1.0.0",description:"Password: hash (PBKDF2) -> envelope string",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(An.HashPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c,e,f,h,m]=r.map(E=>{var b,A;return((b=E.value)==null?void 0:b.valueAsType)??((A=E.value)==null?void 0:A.value)});return{value:U.Success,error:null,result:await G2e(a,c,e,f,h,m)}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class IMe extends Ne{constructor(){super(...arguments);R(this,"manifest",{id:Pe.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2,version:"1.0.0",description:"Password: verify (PBKDF2) -> boolean",initPriority:_e.High,permissions:[Ve.All],contexts:[se.Logic]});R(this,"module",{init:i=>{const r=i.find(c=>c.contextType===se.Logic),a=r==null?void 0:r.get(An.VerifyPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const[a,c]=r.map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=await M2e(String(a??""),String(c??""));return{value:U.Success,error:null,result:e}}catch(a){return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,error:a,result:null}}}})}}class z_ extends R1{constructor(p,i,r=i.projectId){super(p,se.Editor),this._editor=i,this.id=r}get ready(){return this._editor.ready}get env(){return this._editor.env}get hasLoadedLogic(){return this._editor.hasLoadedLogic}get destroyed(){return this._editor.destroyed}get logicLoadingPromise(){return this._editor.logicLoadingPromise}get logic(){return this._editor.logic}get lastPublishedProjectState(){return this._editor.lastPublishedProjectState}get branchHead(){return this._editor.branchHead}get branchHeadPromise(){return this._editor.branchHeadPromise}get projectId(){return this._editor.projectId}get sessionId(){return this._editor.sessionId}get userAuthorId(){return this._editor.userAuthorId}get peerConnections(){return this._editor.peerConnections}get test(){return this._editor.test}get localTestValues(){return this._editor.localTestValues}get resolvedValues(){return this._editor.resolvedValues}get persistedExecutionResults(){return this._editor.persistedExecutionResults}get publication(){return this._editor.publication}get livePublishedVersions(){return this._editor.livePublishedVersions}get publications(){return this._editor.publications}get liveResources(){return this._editor.liveResources}get execution(){return this._editor.execution}get project(){return this._editor.logic}get lastExecutionResults(){return this._editor.lastExecutionResults}get undoableStackValueIndex(){return this._editor.undoableStackValueIndex}set undoableStackValueIndex(p){this._editor.undoableStackValueIndex=p}get activeWorkspace(){return this._editor.activeWorkspace}get branches(){return this._editor.branches}get roles(){return this._editor.roles}get READ_ONLY(){return this._editor.READ_ONLY}get isViewingNonHead(){return this._editor.isViewingNonHead}get canEdit(){return this._editor.canEdit}get PROJECT_NOTIFICATIONS_CHANNEL(){return this._editor.PROJECT_NOTIFICATIONS_CHANNEL}getAccessToken(){return this._editor.getAccessToken()}getRefreshToken(){return this._editor.getRefreshToken()}removeValueByOwnerId(p){return this._editor.removeValueByOwnerId(p)}removeValue(p){return this._editor.removeValue(p)}undo(){return this._editor.undo()}redo(){return this._editor.redo()}initTest(p,i){return this._editor.initTest(p,i)}removeTest(p){return this._editor.removeTest(p)}async copyEntities(p,i={}){return this._editor.copyEntities(p,i)}resolveInitialChildrenPositions(p,i,r){return this._editor.resolveInitialChildrenPositions(p,i,r)}publish(){return this._editor.publish()}loadGivenPublication(p){return this._editor.loadGivenPublication(p)}validateProjectState(p){return this._editor.validateProjectState(p)}requestActiveDynamicValue(p,i=!1){return this._editor.requestActiveDynamicValue(p,i)}getValueTypePreference(p){return this._editor.getValueTypePreference(p)}setValueTypePreference(p,i){return this._editor.setValueTypePreference(p,i)}implementFeature(p){return this._editor.implementFeature(p)}getProjectRoles(){return this._editor.getProjectRoles()}getLastPublishedVersionLogic(p){return this._editor.getLastPublishedVersionLogic(p)}initialLoads(p){return this._editor.initialLoads(p)}moveBranchHeadToVersion(p,i,r){return this._editor.moveBranchHeadToVersion(p,i,r)}loadInitialBranchHead(){return this._editor.loadInitialBranchHead()}}function O1i(s,p){return p instanceof z_?p:new z_(s,p)}class Y_ extends R1{constructor(p,i){super(p,se.PublicationRun),this._publicationRun=i}get id(){return this._publicationRun.id}get projectAutoIncrementPublicationCount(){return this._publicationRun.projectAutoIncrementPublicationCount}get projectPublishedSemanticVersion(){return this._publicationRun.projectPublishedSemanticVersion}get envIdentifier(){return this._publicationRun.envIdentifier}get projectVersion(){return this._publicationRun.projectVersion}get projectBranchId(){return this._publicationRun.projectBranchId}get projectId(){return this._publicationRun.projectId}get triggeredBy(){return this._publicationRun.triggeredBy}get createdAt(){return this._publicationRun.createdAt}get updatedAt(){return this._publicationRun.updatedAt}get status(){return this._publicationRun.status}get steps(){return this._publicationRun.steps}get editor(){return this._publicationRun.editor}get explicitResources(){return this._publicationRun.explicitResources}get implicitGlobalResources(){return this._publicationRun.implicitGlobalResources}get finalGlobalEvent(){return this._publicationRun.finalGlobalEvent}get finalStatus(){return this._publicationRun.finalStatus}}function _1i(s,p){return p instanceof Y_?p:new Y_(s,p)}function V1i(s){s.register(new EPe(s)),s.register(new vPe(s)),s.register(new yPe(s)),s.register(new mPe(s)),s.register(new TPe(s)),s.register(new hPe(s)),s.register(new eBe(s)),s.register(new tBe(s)),s.register(new iBe(s)),s.register(new nBe(s)),s.register(new rBe(s)),s.register(new aBe(s)),s.register(new Z2e(s)),s.register(new H2e(s)),s.register(new W2e(s)),s.register(new z2e(s)),s.register(new Y2e(s)),s.register(new J2e(s)),s.register(new Q2e(s)),s.register(new X2e(s)),s.register(new eMe(s)),s.register(new tMe(s)),s.register(new X$e(s)),s.register(new eLe(s)),s.register(new tLe(s)),s.register(new iLe(s)),s.register(new rLe(s)),s.register(new nLe(s)),s.register(new aLe(s)),s.register(new sLe(s)),s.register(new lLe(s)),s.register(new oLe(s)),s.register(new dLe(s)),s.register(new uLe(s)),s.register(new pLe(s)),s.register(new cLe(s)),s.register(new fLe(s)),s.register(new yLe(s)),s.register(new hLe(s)),s.register(new mLe(s)),s.register(new TLe(s)),s.register(new bLe(s)),s.register(new ALe(s)),s.register(new gLe(s)),s.register(new E$e(s)),s.register(new b$e(s)),s.register(new A$e(s)),s.register(new g$e(s)),s.register(new I$e(s)),s.register(new R$e(s)),s.register(new D$e(s)),s.register(new w$e(s)),s.register(new C$e(s)),s.register(new _$e(s)),s.register(new V$e(s)),s.register(new P$e(s)),s.register(new N$e(s)),s.register(new x$e(s)),s.register(new Gxe(s)),s.register(new u2e(s)),s.register(new o2e(s)),s.register(new d2e(s)),s.register(new MNe(s)),s.register(new GNe(s)),s.register(new kNe(s)),s.register(new jNe(s)),s.register(new UNe(s)),s.register(new FNe(s)),s.register(new KNe(s)),s.register(new qNe(s)),s.register(new SNe(s)),s.register(new nxe(s)),s.register(new Lxe(s)),s.register(new Bxe(s)),s.register(new Mxe(s)),s.register(new ZNe(s)),s.register(new HNe(s)),s.register(new WNe(s)),s.register(new zNe(s)),s.register(new YNe(s)),s.register(new JNe(s)),s.register(new QNe(s)),s.register(new XNe(s)),s.register(new exe(s)),s.register(new txe(s)),s.register(new ixe(s)),s.register(new rxe(s)),s.register(new axe(s)),s.register(new sxe(s)),s.register(new lxe(s)),s.register(new oxe(s)),s.register(new dxe(s)),s.register(new uxe(s)),s.register(new pxe(s)),s.register(new cxe(s)),s.register(new fxe(s)),s.register(new yxe(s)),s.register(new hxe(s)),s.register(new mxe(s)),s.register(new Dxe(s)),s.register(new wxe(s)),s.register(new Cxe(s)),s.register(new Txe(s)),s.register(new vxe(s)),s.register(new Exe(s)),s.register(new bxe(s)),s.register(new Axe(s)),s.register(new gxe(s)),s.register(new Ixe(s)),s.register(new Rxe(s)),s.register(new y2e(s)),s.register(new h2e(s)),s.register(new m2e(s)),s.register(new T2e(s)),s.register(new p2e(s)),s.register(new c2e(s)),s.register(new f2e(s)),s.register(new v2e(s)),s.register(new b2e(s)),s.register(new g2e(s)),s.register(new E2e(s)),s.register(new A2e(s)),s.register(new I2e(s)),s.register(new w2e(s)),s.register(new R2e(s)),s.register(new D2e(s)),s.register(new $$e(s)),s.register(new G$e(s)),s.register(new k$e(s)),s.register(new F$e(s)),s.register(new K$e(s)),s.register(new q$e(s)),s.register(new S$e(s)),s.register(new Z$e(s)),s.register(new H$e(s)),s.register(new W$e(s)),s.register(new z$e(s)),s.register(new j$e(s)),s.register(new U$e(s)),s.register(new B$e(s)),s.register(new M$e(s)),s.register(new L$e(s)),s.register(new O$e(s)),s.register(new J$e(s)),s.register(new Q$e(s)),s.register(new Y$e(s)),s.register(new lBe(s)),s.register(new PBe(s)),s.register(new VBe(s)),s.register(new NBe(s)),s.register(new xBe(s)),s.register(new uBe(s)),s.register(new pBe(s)),s.register(new TBe(s)),s.register(new hBe(s)),s.register(new OBe(s)),s.register(new gBe(s)),s.register(new RBe(s)),s.register(new wBe(s)),s.register(new DBe(s)),s.register(new mBe(s)),s.register(new EBe(s)),s.register(new bBe(s)),s.register(new vBe(s)),s.register(new sBe(s)),s.register(new cBe(s)),s.register(new IBe(s)),s.register(new BBe(s)),s.register(new q_(s)),s.register(new dBe(s)),s.register(new fBe(s)),s.register(new oBe(s)),s.register(new CBe(s)),s.register(new yBe(s)),s.register(new ABe(s)),s.register(new _Be(s)),s.register(new LBe(s)),s.register(new $Be(s)),s.register(new MBe(s)),s.register(new q_(s)),s.register(new kBe(s)),s.register(new GBe(s)),s.register(new jBe(s)),s.register(new MLe(s)),s.register(new GLe(s)),s.register(new kLe(s)),s.register(new RLe(s)),s.register(new ELe(s)),s.register(new OLe(s)),s.register(new NLe(s)),s.register(new vLe(s)),s.register(new xLe(s)),s.register(new BLe(s)),s.register(new VLe(s)),s.register(new _Le(s)),s.register(new Gg(s)),s.register(new jLe(s)),s.register(new ULe(s)),s.register(new PLe(s)),s.register(new LLe(s)),s.register(new $Le(s)),s.register(new CLe(s)),s.register(new wLe(s)),s.register(new DLe(s)),s.register(new ILe(s)),s.register(new qLe(s)),s.register(new KLe(s)),s.register(new SLe(s)),s.register(new FLe(s)),s.register(new Pxe(s)),s.register(new Oxe(s)),s.register(new Vxe(s)),s.register(new Nxe(s)),s.register(new xxe(s)),s.register(new _xe(s)),s.register(new $xe(s)),s.register(new iMe(s)),s.register(new oMe(s)),s.register(new uMe(s)),s.register(new cMe(s)),s.register(new lMe(s)),s.register(new dMe(s)),s.register(new pMe(s)),s.register(new sMe(s)),s.register(new aMe(s)),s.register(new nMe(s)),s.register(new rMe(s)),s.register(new TMe(s)),s.register(new vMe(s)),s.register(new hMe(s)),s.register(new mMe(s)),s.register(new S2e(s)),s.register(new fMe(s)),s.register(new yMe(s)),s.register(new bMe(s)),s.register(new EMe(s)),s.register(new AMe(s)),s.register(new gMe(s)),s.register(new IMe(s)),s.register(new APe(s)),s.register(new gPe(s)),s.register(new Bg(s)),s.register(new Mg(s))}class E${constructor(p=new Y.Events("extensions-registry-fallback-events")){R(this,"extensionsRegistry",new Map);R(this,"initialized",new Set);R(this,"initializedContexts",new Set);R(this,"onResolveEditorContextCallback",()=>null);R(this,"onResolveProjectLogicContextCallback",()=>null);R(this,"onResolveEditorGUIContextCallback",()=>null);R(this,"onResolveGUIContextCallback",()=>null);R(this,"onResolveCompileContextCallback",()=>null);R(this,"onResolvePublicationRunContextCallback",()=>null);this.events=p,this.off=this.events.off.bind(this.events),this.on=this.events.on.bind(this.events),this.emit=this.events.emit.bind(this.events),this.emitAsync=this.events.emitAsync.bind(this.events),this.emitAsyncAll=this.events.emitAsyncAll.bind(this.events),this.emitAsyncAllSettled=this.events.emitAsyncAllSettled.bind(this.events),this.emitAsyncSequentially=this.events.emitAsyncSequentially.bind(this.events),this.emitAsyncSequentiallyAll=this.events.emitAsyncSequentiallyAll.bind(this.events),this.emitAsyncSequentiallyAllSettled=this.events.emitAsyncSequentiallyAllSettled.bind(this.events)}onResolveEditorContext(p){this.onResolveEditorContextCallback=p}onResolveProjectLogicContext(p){this.onResolveProjectLogicContextCallback=p}onResolveGUIContext(p){this.onResolveGUIContextCallback=p}onResolveEditorGUIContext(p){this.onResolveEditorGUIContextCallback=p}onResolveCompileContext(p){this.onResolveCompileContextCallback=p}onResolvePublicationRunContext(p){this.onResolvePublicationRunContextCallback=p}get extensionInOrder(){return Array.from(this.extensionsRegistry.values()).sort((p,i)=>(p.manifest.initPriority||_e.Normal)-(i.manifest.initPriority||_e.Normal))}async setup(){V1i(this),Y.Logger.log("Initializing extensions without context..."),this.initForReady()}requestContext(p){switch(p){case se.Editor:return this.onResolveEditorContextCallback();case se.Logic:return this.onResolveProjectLogicContextCallback();case se.EditorGUI:return this.onResolveEditorGUIContextCallback();case se.Compile:return this.onResolveCompileContextCallback();case se.PublicationRun:return this.onResolvePublicationRunContextCallback();case se.GUI:return this.onResolveGUIContextCallback();case se.EditorGUI:return this.onResolveEditorGUIContextCallback();default:throw new Error(`Unknown context type: ${p}`)}}requestContexts(p,i=[]){const r=[];i.length===0&&(i=p.manifest.contexts);for(const a of i){const c=this.requestContext(a);c&&r.push(c)}return r}requestExtension(p){const i=this.extensionsRegistry.get(p);if(i)return i;throw new Error(`Unknown extension: ${p}`)}register(p){this.extensionsRegistry.set(p.manifest.id,p)}async initAll(){var p,i;for(const r of this.extensionInOrder)if(r.module.init&&!this.initialized.has(r.manifest.id)){const a=r.manifest.contexts.map(c=>this.requestContext(c)).filter(c=>c!==null);a.length&&(await((i=(p=r.module).init)==null?void 0:i.call(p,a)),this.initialized.add(r.manifest.id))}else!r.module.init&&!this.initialized.has(r.manifest.id)&&this.initialized.add(r.manifest.id)}async initForReady(){Y.Logger.log("Initializing extensions for ready contexts...");for(const p of this.extensionInOrder)if(p.module.init&&!this.initialized.has(p.manifest.id)){Y.Logger.log("Initializing "+p.manifest.id+" extension...");const i=this.requestContexts(p);p.manifest.contexts.every(a=>!!i.find(c=>c.contextType===a))?(await p.module.init(i),this.initialized.add(p.manifest.id)):Y.Logger.warn(`Skipping initialization of ${p.manifest.id} extension, not all contexts are ready.`,`Required contexts: ${p.manifest.contexts.join(", ")}`,`Available contexts: ${i.map(a=>a.contextType).join(", ")}`)}else!p.module.init&&!this.initialized.has(p.manifest.id)?(Y.Logger.log("Set "+p.manifest.id+" extension as initialized by default..."),this.initialized.add(p.manifest.id)):Y.Logger.log(`Skipping initialization of ${p.manifest.id} extension, already initialized or no init method defined.`)}async destroyAll(){for(const p of[...this.extensionInOrder].reverse())p.module.destroy&&await p.module.destroy();this.events.destroy()}on(p,i){this.events.on(p,i)}emit(p,...i){this.events.emit(p,...i)}off(p,i){this.events.off(p,i)}emitAsync(p,...i){return this.events.emitAsync(p,...i)}emitAsyncAll(p,...i){return this.events.emitAsyncAll(p,...i)}emitAsyncAllSettled(p,...i){return this.events.emitAsyncAllSettled(p,...i)}emitAsyncSequentially(p,...i){return this.events.emitAsyncSequentially(p,...i)}emitAsyncSequentiallyAll(p,...i){return this.events.emitAsyncSequentiallyAll(p,...i)}emitAsyncSequentiallyAllSettled(p,...i){return this.events.emitAsyncSequentiallyAllSettled(p,...i)}async contextAvailable(p){if(this.initializedContexts.has(p)){Y.Logger.warn(`Context ${p} is already initialized. Skipping re-initialization.`);return}switch(this.initializedContexts.add(p),p){case se.Editor:{if(!this.onResolveEditorContextCallback)throw new Error("No editor context resolver callback set. Call onResolveEditorContext first.");break}case se.Logic:{if(!this.onResolveProjectLogicContextCallback)throw new Error("No project logic context resolver callback set. Call onResolveProjectLogicContext first.");break}}Y.Logger.log(`Context ${p} is now available. Initializing extensions for this context...`),await this.initForReady()}getValueTypePreference(p){return window.localStorage.getItem("dynamic-value-type-preference--"+p)||null}setValueTypePreference(p,i){window.localStorage.setItem("dynamic-value-type-preference--"+p,(i==null?void 0:i.toString())||""),this.emit(p,{})}}let lg=null;const b$={requestExtension:s=>(lg||(lg=new E$,lg.setup()),lg.requestExtension(s))};function lp(s){return!(s instanceof Error)&&typeof s=="object"&&s!==null?s:s instanceof Error?{name:s.name,message:s.message,stack:s.stack,...s}:s}function mU(s){var p,i,r;if(s&&typeof s=="object"&&"value"in s){const a=s;return{single:((p=a.value)==null?void 0:p.valueAsTypeSingle)??((i=a.value)==null?void 0:i.value),list:((r=a.value)==null?void 0:r.valueAsTypeList)??null}}return{single:s,list:Array.isArray(s)?s:null}}const op={onBeforeEntityExecution:async()=>{},onEntityExecuted:async()=>{}};var A$=(s=>(s.FinishedSuccess="finished-success",s.FinishedError="finished-error",s.Running="running",s.Paused="paused",s.Stopped="stopped",s.NotStarted="not-started",s))(A$||{});const RMe={...b$,getValueTypePreference:()=>null,setValueTypePreference:()=>{}};class J_ extends Error{constructor(){super("Execution was stopped"),this.name="ExecutionStoppedError"}}class yh extends Y.Events{constructor(i,r,a,c=null,e=RMe){super();R(this,"project");R(this,"entryPoint");R(this,"state","not-started");R(this,"events",new Y.Events("fe-exec-inst-events"));R(this,"entities",[]);R(this,"parentExecution",null);R(this,"executing",[]);R(this,"executed",[]);R(this,"skipped",[]);R(this,"scheduled",[]);R(this,"localTestValues");R(this,"resolvedValues");R(this,"persistedExecutionResults");R(this,"lastExecutionResults");R(this,"onAddToSkippedListCallback",null);R(this,"onRemoveFromSkippedListCallback",null);R(this,"onAddEntityCallback",null);R(this,"onRemoveEntityCallback",null);R(this,"onAbortExecutionCallback",null);this.parentContext=e,this.entities=r,this.entryPoint=a,this.project=i,this.parentExecution=c,this.localTestValues=new LT(x.UUID.uuid(),this.project),this.resolvedValues=new LT(x.UUID.uuid(),this.project),this.persistedExecutionResults=new LT(x.UUID.uuid(),this.project),this.lastExecutionResults=new LT(x.UUID.uuid(),this.project)}get rootExecution(){let i=this;for(;i.parentExecution;)i=i.parentExecution;return i}get rootState(){return this.rootExecution.state}isStopped(){return this.state==="stopped"||this.rootExecution.state==="stopped"}isPaused(){return this.state==="paused"||this.rootExecution.state==="paused"}async checkStateAndPause(){if(this.isStopped())throw new J_;for(;this.isPaused();){if(this.isStopped())throw new J_;await new Promise(i=>setTimeout(i,100))}}get valueResolutionContext(){return{execution:this,project:this.project,localTestValues:this.localTestValues,resolvedValues:this.resolvedValues,persistedExecutionResults:this.persistedExecutionResults,lastExecutionResults:this.lastExecutionResults,getValueTypePreference:this.parentContext.getValueTypePreference,setValueTypePreference:this.parentContext.setValueTypePreference}}skip(i){this.hasEntity(i)&&(this.removeFromScheduledList(i),!this.skipped.includes(i)&&(this.skipped.push(i),this.onAddToSkippedListCallback&&this.onAddToSkippedListCallback(i),tr.includes(i.type)&&ft(i).forEach(r=>this.skip(r))))}async schedule(i,r,a){if(this.hasExecuted(i))return null;if(Ft.includes(i.type))return this.executeBranch(i,a,r);if(sr.includes(i.type)){if(i.calledBy.every(e=>this.hasExecuted(e)||!this.hasEntity(e)))return this.executeBranch(i,a,r);this.scheduled.includes(i)||this.scheduled.push(i)}return null}mergeExernalValuesWithInternalInputs(i,r){const a=[];return[...Ot,...Ft].includes(r.type)?a.push(...r.inputs):Dt.includes(r.type)&&a.push(...r.outputs),a.map(e=>{var h;let f=i.find(m=>m.valueOwner.id===e.id);if(f)return f;if(!f&&Ft.includes(r.type)&&(f=i.find(m=>{var E;return((E=m.valueOwner.declaration)==null?void 0:E.id)===e.id})),f){const m=(h=f.value)==null?void 0:h.clone(null);return m==null||m.setStandaloneParent(e,null),{...f,valueOwner:e,value:m||null,inheritanceLink:{sources:[f],target:e}}}return Qr.includes(e.type)?to(e,this.valueResolutionContext):Cf(e,this.valueResolutionContext)}).reduce((e,f)=>{const h=ud(f==null?void 0:f.valueOwner,this.project),m=f?[f]:[];return h.forEach(E=>{var _,P,V;if(E.id===(f==null?void 0:f.valueOwner.id))return;const b=Ht(E.getDataType(null),E,this.project);b==null||b.metaSync({value:(_=f==null?void 0:f.value)==null?void 0:_.value},null),b==null||b.setValueAsTypeList(((P=f==null?void 0:f.value)==null?void 0:P.valueAsTypeList)||null),b==null||b.setValueAsTypeSingle(((V=f==null?void 0:f.value)==null?void 0:V.valueAsTypeSingle)||null);const A={...f,valueOwner:E,value:b};m.push(A)}),[...e,...m]},[]).sort((e,f)=>e.valueOwner.index-f.valueOwner.index)}inheritValuesFromContext(i){this.localTestValues=i.localTestValues,this.resolvedValues=i.resolvedValues,this.persistedExecutionResults=i.persistedExecutionResults}async executeInternalCall(i,r,a,c={}){var f,h;const e={...op,...c};try{let m={value:U.Success,error:null,result:null};if(r.sort((V,M)=>V.valueOwner.index-M.valueOwner.index),Object.values(Gr).includes(i.declaration.id)){const V=this.parentContext.requestExtension(fh+i.declaration.id).module.main;V?m=await V(i,r):Y.Logger.warn(`No implementation found for built-in function: ${i.declaration.id}`)}else{const V=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,r,a,e);m={value:V.value,error:V.error,result:V.result}}let E=null;if(m.error&&i.error){Y.Logger.warn("Raw error executing entity: ",m.error);const{single:V,list:M}=mU(m.error),G=lp(V),k=(f=i.error)==null?void 0:f.getDataType(null),K=Ht(k||null,i.error,a);if(k!=null&&k.asType)M!==null?K==null||K.setValueAsTypeList(M):K==null||K.setValueAsTypeSingle(V);else{const le=vr(G)?JSON.stringify(G,null,2):G;K==null||K.metaSync({value:le},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:K}}const b=i==null?void 0:i.getDataType(null),A=Ht(b,i,a),{single:_,list:P}=mU(m.result);return b!=null&&b.asType?P!==null?A==null||A.setValueAsTypeList(P):A==null||A.setValueAsTypeSingle(_):A==null||A.metaSync({value:_},null),{value:m.value,entity:i,error:E,result:{value:A||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(m){if(m&&(m.name==="ExecutionStoppedError"||m.message==="Execution was stopped"))throw m;Y.Logger.warn("Internal call execution error: ",m);let E=null;if(i.error){const b=lp(m),A=(h=i.error)==null?void 0:h.getDataType(null),_=Ht(A,i.error,a);if(A!=null&&A.asType)_==null||_.setValueAsTypeSingle(m);else{const P=vr(b)?JSON.stringify(b,null,2):b;_==null||_.metaSync({value:P},null)}E={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:_}}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:E,result:null}}}static async executeOperation(i,r,a){var c,e;try{let f={value:U.Success,error:null,result:null};r.sort((b,A)=>b.valueOwner.index-A.valueOwner.index),i.declaration.implementation&&(f=await i.declaration.implementation(i,r.sort((b,A)=>b.valueOwner.index-A.valueOwner.index)));let h=null;if(f.error&&i.error){const b=lp(f.error),A=((c=i.error)==null?void 0:c.getDataType(null))||null,_=Ht(A,i.error,a);if(A!=null&&A.asType)_==null||_.setValueAsTypeSingle(f.error);else{const P=vr(b)?JSON.stringify(b,null,2):b;_==null||_.metaSync({value:P},null)}h={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:_}}const m=i==null?void 0:i.getDataType(null),E=Ht(m,i,a);return m!=null&&m.asType?E==null||E.setValueAsTypeSingle(f.result):E==null||E.metaSync({value:f.result},null),{value:f.value,entity:i,error:h,result:{value:E||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(f){if(f&&(f.name==="ExecutionStoppedError"||f.message==="Execution was stopped"))throw f;console.warn("Operation execution error: ",f);let h=null;if(i.error){const m=lp(f),E=(e=i.error)==null?void 0:e.getDataType(null),b=Ht(E,i.error,a);if(E!=null&&E.asType)b==null||b.setValueAsTypeSingle(f);else{const A=vr(m)?JSON.stringify(m,null,2):m;b==null||b.metaSync({value:A},null)}h={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:b}}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:h,result:null}}}async executeSearch(i,r,a){var c;try{let e={value:U.Success,error:null,result:null};const f=await(await this.parentContext.requestExtension(Pe.SEARCH_NODE_IMPLEMENTATION)).module.main(i,r),h=i==null?void 0:i.getDataType(null),m=Ht(h,i,a);return m==null||m.metaSync({value:f},null),f.error?{value:U.UnhandledError,entity:i,error:{valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:m},result:null}:{value:e.value,entity:i,error:null,result:{value:m,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(e){if(e&&(e.name==="ExecutionStoppedError"||e.message==="Execution was stopped"))throw e;if(Y.Logger.warn(`Search node execution error: ${e}`),!i.error)return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null};const f=lp(e),h=(c=i.error)==null?void 0:c.getDataType(null),m=Ht(h,i.error,a),E=vr(f)?JSON.stringify(f,null,2):f;return m==null||m.metaSync({value:E},null),{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:m},result:null}}}async executeLoop(i,r,a,c={}){var f,h,m,E,b,A;const e={...op,...c};try{let _={value:U.Success,error:null,result:null};const P=r.map(X=>{var ae,te;return((ae=X==null?void 0:X.value)==null?void 0:ae.valueAsType)||((te=X==null?void 0:X.value)==null?void 0:te.value)});let V={};i.getUniqueInputMaps().forEach(X=>{const ae=i.body.inputs.find(ee=>ce(ee,a)===ce(X,a)),te=X==null?void 0:X.getDataType(null),ne=Ht(te,ae,a);te!=null&&te.asType?ne==null||ne.setValueAsTypeList([]):ne==null||ne.metaSync({value:[]},null),this.lastExecutionResults.writeValue(ae,ne);const ue={value:ne,valueOwner:ae,type:ke.ExecutionResult,inheritanceLink:null};V[ae.id]=ue});let G={value:U.Success,entity:i.body,error:null,result:null};switch(i.declaration.id){case re.loop["counted-loop"].id:{const X=P[0];let ae=1;for(;ae<=X&&ae<=50;){await this.checkStateAndPause();const te=i.body.inputs.map(ne=>{if(ne===i.currentIterationNumberArgumentDeclaration){const ue=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=Jd(ue),z=this.lastExecutionResults.readValue(ne.id);if(z){z.metaSync({value:ae},null),this.lastExecutionResults.writeValue(ne,z);const he={value:z,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null};return V[ne.id]=he,he}const oe={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ae,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ee,standaloneParent:ne.toReference()},ye=lr(oe,a);this.lastExecutionResults.writeValue(ne,ye);const pe={value:ye,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null};return V[ne.id]=pe,pe}else return V[ne.id]}).filter(ne=>!!ne);if(G=await this.executeFullFunctionDeclarationLogic(i.body,te,e),(G.results||[]).forEach(ne=>{var oe,ye,pe,he;if(ne.valueOwner.type!==d.InputMap||Dt.includes(ne.valueOwner.parent.type))return;const ue=i.body.inputs.find(Ae=>ce(Ae,a)===ce(ne.valueOwner,a)),z=[...((ye=(oe=V==null?void 0:V[ue.id])==null?void 0:oe.value)==null?void 0:ye.value)||[],((pe=ne==null?void 0:ne.value)==null?void 0:pe.value)||null];(he=V[ue.id].value)==null||he.metaSync({value:z},null),this.lastExecutionResults.writeValue(ue,V[ue.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["manual-flow-loop"].id:{let X=1;for(;X<=50;){await this.checkStateAndPause();const ae=i.body.inputs.map(te=>{if(te===i.currentIterationNumberArgumentDeclaration){const ne=this.lastExecutionResults.readValue(te.id);if(ne){ne.metaSync({value:X},null),this.lastExecutionResults.writeValue(te,ne);const oe={value:ne,valueOwner:te,type:ke.ExecutionResult,inheritanceLink:null};return V[te.id]=oe,oe}const ue=i.currentIterationNumberArgumentDeclaration.getDataType(null),ee=Ht(ue,te,a);return ee==null||ee.metaSync({value:X},null),this.lastExecutionResults.writeValue(te,ee),{value:ee,valueOwner:te,type:ke.ExecutionResult,inheritanceLink:null}}else return V[te.id]}).filter(te=>!!te);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ae,e),(G.results||[]).forEach(te=>{var z,oe,ye;if(te.valueOwner.type!==d.InputMap||Dt.includes(te.valueOwner.parent.type))return;const ne=i.body.inputs.find(pe=>ce(pe,a)===ce(te.valueOwner,a)),ee=[...(z=V[ne.id].value)==null?void 0:z.value,((oe=te.value)==null?void 0:oe.value)||null];(ye=V[ne.id].value)==null||ye.metaSync({value:ee},null),this.lastExecutionResults.writeValue(ne,V[ne.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;X++}break}case re.loop["list-loop"].id:{const X=P[0];let ae=1;const te=X;for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["object-keys-loop"].id:{const X=P[0];let ae=1;const te=X?Object.keys(X):[];for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["object-values-loop"].id:{const X=P[0];let ae=1;const te=X?Object.values(X):[];for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}case re.loop["string-loop"].id:{const X=P[0];let ae=1;const te=X.split("");for(let ne=0;ne<te.length;ne++){await this.checkStateAndPause();const ue=te[ne],ee=i.body.inputs.map(z=>{if(z===i.currentIterationNumberArgumentDeclaration){const oe=this.lastExecutionResults.readValue(z.id);if(oe)return oe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,oe),{value:oe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const ye=i.currentIterationNumberArgumentDeclaration.getDataType(null),pe=Ht(ye,z,a);return pe==null||pe.metaSync({value:ae},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:i.currentIterationNumberArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else if(z===i.currentValueArgumentDeclaration){const oe=i.currentValueArgumentDeclaration.getDataType(null),ye=Jd(oe),pe=this.lastExecutionResults.readValue(z.id);if(pe)return pe.metaSync({value:ue},null),this.lastExecutionResults.writeValue(z,pe),{value:pe,valueOwner:z,type:ke.ExecutionResult,inheritanceLink:null};const he={id:x.UUID.uuid(),deletable:!0,editable:!0,type:d.LiteralValue,autogeneration:null,version:x.UUID.uuid(),createdAt:new Date().toISOString(),author:x.sessionAuthor,deleted:!1,previousVersion:null,value:ue,valueAsTypeSingle:null,valueAsTypeList:null,parent:null,name:ye,standaloneParent:z.toReference()},Ae=lr(he,a);return this.lastExecutionResults.writeValue(z,Ae),{value:Ae,valueOwner:i.currentValueArgumentDeclaration,type:ke.ExecutionResult,inheritanceLink:null}}else return V[z.id]}).filter(z=>!!z);if(G=await this.executeFullFunctionDeclarationLogic(i.body,ee,e),(G.results||[]).forEach(z=>{var he,Ae,Re;if(z.valueOwner.type!==d.InputMap||Dt.includes(z.valueOwner.parent.type))return;const oe=i.body.inputs.find(Oe=>ce(Oe,a)===ce(z.valueOwner,a)),pe=[...(he=V[oe.id].value)==null?void 0:he.value,((Ae=z.value)==null?void 0:Ae.value)||null];(Re=V[oe.id].value)==null||Re.metaSync({value:pe},null),this.lastExecutionResults.writeValue(oe,V[oe.id].value)}),[U.CaughtError,U.UnhandledError,U.Break,U.Return].includes(G.value))break;ae++}break}}let k=U.Success;if(G.value===U.UnhandledError?i.catchesError||i.errorCalls.length?k=U.CaughtError:k=U.UnhandledError:[U.CaughtError,U.Return].includes(G.value)&&(k=G.value),_={value:k,error:((h=(f=G.error)==null?void 0:f.value)==null?void 0:h.value)||null,result:((E=(m=G==null?void 0:G.result)==null?void 0:m.value)==null?void 0:E.value)||null},_.value===U.UnhandledError||_.value===U.CaughtError){let X=null;if(i.error){const ae=lp(_.error),te=(b=i.error)==null?void 0:b.getDataType(null),ne=Ht(te||null,i.error,a);if(te!=null&&te.asType)ne==null||ne.setValueAsTypeSingle(_.error);else{const ue=vr(ae)?JSON.stringify(ae,null,2):ae;ne==null||ne.metaSync({value:ue},null)}X={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:ne}}return{value:_.value,entity:i,error:X,result:null}}const K=i==null?void 0:i.getDataType(null),le=Ht(K,i,a);return K!=null&&K.asType?le==null||le.setValueAsTypeSingle(_.result):le==null||le.metaSync({value:_.result},null),{value:_.value,entity:i,error:null,result:{value:le||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(_){if(_&&(_.name==="ExecutionStoppedError"||_.message==="Execution was stopped"))throw _;if(Y.Logger.warn("Error executing loop: ",_),i.error){const P=lp(_),V=(A=i.error)==null?void 0:A.getDataType(null),M=Ht(V,i.error,a);if(V!=null&&V.asType)M==null||M.setValueAsTypeSingle(_);else{const G=vr(P)?JSON.stringify(P,null,2):P;M==null||M.metaSync({value:G},null)}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:M},result:null}}else return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null}}}async executeFunctionCall(i,r,a,c={}){var f,h,m,E,b,A,_,P,V,M,G,k,K,le,X,ae,te,ne,ue,ee,z,oe,ye,pe,he,Ae;const e={...op,...c};try{const Re=await this.executeDetachedFullFunctionDeclarationLogic(i.declaration,r,a,e);let Oe=null;if(Re.error&&i.error){Y.Logger.warn("Raw error executing entity: ",Re.error);const Ke=(f=i.error)==null?void 0:f.getDataType(null),Xe=Ht(Ke||null,i.error,a);Ke!=null&&Ke.asType?(m=(h=Re.error)==null?void 0:h.value)!=null&&m.valueAsTypeSingle?Xe==null||Xe.setValueAsTypeSingle((b=(E=Re.error)==null?void 0:E.value)==null?void 0:b.valueAsTypeSingle):(_=(A=Re.error)==null?void 0:A.value)!=null&&_.valueAsTypeList&&Array.isArray((V=(P=Re.error)==null?void 0:P.value)==null?void 0:V.valueAsTypeList)&&(Xe==null||Xe.setValueAsTypeList((G=(M=Re.error)==null?void 0:M.value)==null?void 0:G.valueAsTypeList)):Xe==null||Xe.metaSync({value:(K=(k=Re.error)==null?void 0:k.value)==null?void 0:K.value},null),Oe={valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:Xe}}let Be=U.Success;Re.value===U.UnhandledError&&(i.catchesError||i.errorCalls.length?Be=U.CaughtError:Be=U.UnhandledError);const Ge=i==null?void 0:i.getDataType(null),Se=Ht(Ge,i,a);return Ge!=null&&Ge.asType?(X=(le=Re.result)==null?void 0:le.value)!=null&&X.valueAsTypeSingle?Se==null||Se.setValueAsTypeSingle((te=(ae=Re.result)==null?void 0:ae.value)==null?void 0:te.valueAsTypeSingle):(ue=(ne=Re.result)==null?void 0:ne.value)!=null&&ue.valueAsTypeList&&Array.isArray((z=(ee=Re.result)==null?void 0:ee.value)==null?void 0:z.valueAsTypeList)&&(Se==null||Se.setValueAsTypeList((ye=(oe=Re.result)==null?void 0:oe.value)==null?void 0:ye.valueAsTypeList)):Se==null||Se.metaSync({value:((he=(pe=Re.result)==null?void 0:pe.value)==null?void 0:he.value)||null},null),{value:Be,entity:i,error:Oe,result:{value:Se||null,valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null}}}catch(Re){if(Re&&(Re.name==="ExecutionStoppedError"||Re.message==="Execution was stopped"))throw Re;if(!i.error)return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:null,result:null};const Oe=lp(Re),Be=(Ae=i.error)==null?void 0:Ae.getDataType(null),Ge=Ht(Be,i.error,a);if(Be!=null&&Be.asType)Ge==null||Ge.setValueAsTypeSingle(Re);else{const Se=vr(Oe)?JSON.stringify(Oe,null,2):Oe;Ge==null||Ge.metaSync({value:Se},null)}return{value:i.catchesError||i.errorCalls.length?U.CaughtError:U.UnhandledError,entity:i,error:{valueOwner:i.error,type:ke.ExecutionResult,inheritanceLink:null,value:Ge},result:null}}}async executeCondition(i,r){var c,e,f,h;let a=!1;switch(i.declaration.id){case gn.BooleanIsTrue:{const m=(e=(c=r[0])==null?void 0:c.value)==null?void 0:e.value;if(typeof m!="boolean")throw new TypeError("BooleanIsTrue expects a boolean input.");a=m===!0;break}case gn.BooleanIsFalse:{const m=(h=(f=r[0])==null?void 0:f.value)==null?void 0:h.value;if(typeof m!="boolean")throw new TypeError("BooleanIsFalse expects a boolean input.");a=m===!1;break}case Vr.And:{a=(await Promise.all(i.andChildrenGroup.map(async E=>{const b=this.mergeExernalValuesWithInternalInputs(r,E);return(await this.executeCondition(E,b)).value===U.Success}))).every(E=>E);break}case Vr.Or:{a=(await Promise.all(i.orChildrenGroup.map(async E=>{const b=this.mergeExernalValuesWithInternalInputs(r,E);return(await this.executeCondition(E,b)).value===U.Success}))).some(E=>E);break}default:throw new Error(`Condition declaration ${i.declaration.name} does not have an implementation.`)}return{value:a?U.Success:U.ConditionNotMet,entity:i,error:null,result:null}}async executeDetachedFullFunctionDeclarationLogic(i,r,a,c={}){const e={...op,...c,onBeforeEntityExecution:(m,E,b)=>{var A;return((A=c==null?void 0:c.onBeforeEntityExecution)==null?void 0:A.call(c,m,E,{...b,detached:!0}))||Promise.resolve()},onEntityExecuted:(m,E,b)=>{var A;return((A=c==null?void 0:c.onEntityExecuted)==null?void 0:A.call(c,m,E,{...b,detached:!0}))||Promise.resolve()}},f=new yh(a,[i,...nI(i)],i,this,this.parentContext);return f.inheritValuesFromContext(this),await f.execute(e,r)}async executeFullFunctionDeclarationLogic(i,r,a={}){await this.checkStateAndPause();const c={...op,...a},e=nI(i);e.forEach(m=>{this.addEntity(m)}),e.reduce((m,E)=>Dt.includes(E.type)?[...m,...E.outputs]:Ot.includes(E.type)&&E.type!==d.Condition?[...m,...E.outputs,...E.inputs]:E.type===d.Condition?[...m,...E.inputs]:m,[]).forEach(m=>{this.lastExecutionResults.removeValue(m.id)});const h=await this.executeBranch(i,c,r);return{...h||{},value:(h==null?void 0:h.value)||U.Success,entity:i,error:(h==null?void 0:h.error)||null,result:(h==null?void 0:h.result)||null}}static async executeEntryPointEntity(i,r){return{value:U.Success,entity:i,error:null,result:null}}async executeReturnStatement(i,r){var f,h,m,E,b,A,_;if((f=i.throws)!=null&&f.readsValue){const P=to(i.throws,this.valueResolutionContext);return{value:U.UnhandledError,entity:i,error:{valueOwner:i.throws,type:ke.ExecutionResult,inheritanceLink:null,value:(P==null?void 0:P.value)||null},result:null}}let a=to(i,this.valueResolutionContext);const c=i.getDataType(null);if(c!=null&&c.isObject()){let P={};if(((h=c==null?void 0:c.entity)==null?void 0:h.type)===d.DefinitionEntity&&(P={...P,...c.entity.getActiveRawDefaultValue()}),a!=null&&a.value)vr((m=a==null?void 0:a.value)==null?void 0:m.value)&&(P={...P,...(E=a==null?void 0:a.value)==null?void 0:E.value}),a==null||a.value.metaSync({value:P},null);else{const V=Ht(c,i,this.project);V==null||V.metaSync({value:P},null),a={valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:V}}this.lastExecutionResults.writeValue(i,a.value),i.outputs.forEach(V=>{var M,G;if(((M=V.declaration)==null?void 0:M.type)===d.Property&&V.declaration.static){const k=this.lastExecutionResults.readValue(V.declaration.id),K=ce(V,this.project),le=V.codeName||((G=V.declaration)==null?void 0:G.codeName)||ir(K);if(k)k.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,k);else{const X=Ht(V.getDataType(null),V,this.project);X==null||X.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,X)}}})}else this.lastExecutionResults.writeValue(i,a==null?void 0:a.value);const e=(b=a==null?void 0:a.value)!=null&&b.value&&vr((A=a.value)==null?void 0:A.value)?((_=a.value)==null?void 0:_.value)||{}:{};return i.outputs.map(P=>{var k;const V=P.codeName||((k=P.declaration)==null?void 0:k.codeName)||ir(ce(P,this.project)),M=e[V],G=Ht(P.getDataType(null),P,this.project);G==null||G.metaSync({value:M},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Return,entity:i,error:null,result:a}}async executeContinueStatement(i,r){var f,h,m,E,b,A,_;if((f=i.throws)!=null&&f.readsValue){const P=to(i.throws,this.valueResolutionContext);return{value:U.UnhandledError,entity:i,error:{valueOwner:i.throws,type:ke.ExecutionResult,inheritanceLink:null,value:(P==null?void 0:P.value)||null},result:null}}let a=to(i,this.valueResolutionContext);const c=i.getDataType(null);if(c!=null&&c.isObject()){let P={};if(((h=c==null?void 0:c.entity)==null?void 0:h.type)===d.DefinitionEntity&&(P={...P,...c.entity.getActiveRawDefaultValue()}),a!=null&&a.value)vr((m=a==null?void 0:a.value)==null?void 0:m.value)&&(P={...P,...(E=a==null?void 0:a.value)==null?void 0:E.value}),a==null||a.value.metaSync({value:P},null);else{const V=Ht(c,i,this.project);V==null||V.metaSync({value:P},null),a={valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:V}}this.lastExecutionResults.writeValue(i,a.value),i.outputs.forEach(V=>{var M,G;if(((M=V.declaration)==null?void 0:M.type)===d.Property&&V.declaration.static){const k=this.lastExecutionResults.readValue(V.declaration.id),K=ce(V,this.project),le=V.codeName||((G=V.declaration)==null?void 0:G.codeName)||ir(K);if(k)k.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,k);else{const X=Ht(V.getDataType(null),V,this.project);X==null||X.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,X)}}})}else this.lastExecutionResults.writeValue(i,a==null?void 0:a.value);const e=(b=a==null?void 0:a.value)!=null&&b.value&&vr((A=a.value)==null?void 0:A.value)?((_=a.value)==null?void 0:_.value)||{}:{};return i.outputs.map(P=>{var k;const V=P.codeName||((k=P.declaration)==null?void 0:k.codeName)||ir(ce(P,this.project)),M=e[V],G=Ht(P.getDataType(null),P,this.project);G==null||G.metaSync({value:M},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Continue,entity:i,error:null,result:a}}async executeBreakStatement(i,r){var f,h,m,E,b,A,_;if((f=i.throws)!=null&&f.readsValue){const P=to(i.throws,this.valueResolutionContext);return{value:U.UnhandledError,entity:i,error:{valueOwner:i.throws,type:ke.ExecutionResult,inheritanceLink:null,value:(P==null?void 0:P.value)||null},result:null}}let a=to(i,this.valueResolutionContext);const c=i.getDataType(null);if(c!=null&&c.isObject()){let P={};if(((h=c==null?void 0:c.entity)==null?void 0:h.type)===d.DefinitionEntity&&(P={...P,...c.entity.getActiveRawDefaultValue()}),a!=null&&a.value)vr((m=a==null?void 0:a.value)==null?void 0:m.value)&&(P={...P,...(E=a==null?void 0:a.value)==null?void 0:E.value}),a==null||a.value.metaSync({value:P},null);else{const V=Ht(c,i,this.project);V==null||V.metaSync({value:P},null),a={valueOwner:i,type:ke.ExecutionResult,inheritanceLink:null,value:V}}this.lastExecutionResults.writeValue(i,a.value),i.outputs.forEach(V=>{var M,G;if(((M=V.declaration)==null?void 0:M.type)===d.Property&&V.declaration.static){const k=this.lastExecutionResults.readValue(V.declaration.id),K=ce(V,this.project),le=V.codeName||((G=V.declaration)==null?void 0:G.codeName)||ir(K);if(k)k.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,k);else{const X=Ht(V.getDataType(null),V,this.project);X==null||X.metaSync({value:P[le]},null),this.lastExecutionResults.writeValue(V.declaration,X)}}})}else this.lastExecutionResults.writeValue(i,a==null?void 0:a.value);const e=(b=a==null?void 0:a.value)!=null&&b.value&&vr((A=a.value)==null?void 0:A.value)?((_=a.value)==null?void 0:_.value)||{}:{};return i.outputs.map(P=>{var k;const V=P.codeName||((k=P.declaration)==null?void 0:k.codeName)||ir(ce(P,this.project)),M=e[V],G=Ht(P.getDataType(null),P,this.project);G==null||G.metaSync({value:M},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Break,entity:i,error:null,result:a}}async executeVariable(i,r){var h,m,E,b,A,_,P;let a=to(i,this.valueResolutionContext);const c=Ir(i),e=c.getDataType(null);if(e!=null&&e.isObject()){let V={};if(((h=e==null?void 0:e.entity)==null?void 0:h.type)===d.DefinitionEntity?V={...V,...e.entity.getActiveRawDefaultValue()}:((m=e==null?void 0:e.entity)==null?void 0:m.type)===d.BuiltInBaseEntity&&(V={...V,...e.entity.getRawDefaultValue()}),a!=null&&a.value)vr((E=a==null?void 0:a.value)==null?void 0:E.value)&&(V={...V,...(b=a==null?void 0:a.value)==null?void 0:b.value}),a==null||a.value.metaSync({value:V},null);else{const M=Ht(e,i,this.project);M==null||M.metaSync({value:V},null),a={valueOwner:c,type:ke.ExecutionResult,inheritanceLink:null,value:M}}i.inputs.forEach(M=>{var K,le,X,ae,te,ne;const G=to(M,this.valueResolutionContext),k=c.inputs.find(ue=>{var ee,z;return((ee=ue.declaration)==null?void 0:ee.id)===((z=M.declaration)==null?void 0:z.id)});if(((K=k==null?void 0:k.declaration)==null?void 0:K.type)===d.Property&&((le=k==null?void 0:k.declaration)!=null&&le.static))G!=null&&G.value?this.lastExecutionResults.writeValue(k==null?void 0:k.declaration,G==null?void 0:G.value):this.lastExecutionResults.removeValue(k==null?void 0:k.declaration.id);else if(G!=null&&G.value){const ue=ce(M,this.project),ee=M.codeName||((X=M.declaration)==null?void 0:X.codeName)||ir(ue);(ne=a==null?void 0:a.value)==null||ne.metaSync({value:{...(ae=a.value)==null?void 0:ae.value,[ee]:(te=G==null?void 0:G.value)==null?void 0:te.value}},null)}}),this.lastExecutionResults.writeValue(c,a.value)}else this.lastExecutionResults.writeValue(c,a==null?void 0:a.value);const f=(A=a==null?void 0:a.value)!=null&&A.value&&vr((_=a.value)==null?void 0:_.value)?((P=a.value)==null?void 0:P.value)||{}:{};return i.outputs.map(V=>{var K;const M=V.codeName||((K=V.declaration)==null?void 0:K.codeName)||ir(ce(V,this.project)),G=f[M],k=Ht(V.getDataType(null),V,this.project);k==null||k.metaSync({value:G},null),ke.ExecutionResult}),a.type=ke.ExecutionResult,{value:U.Success,entity:i,error:null,result:a}}mergeValues(i,r){const a=[];for(let c=0;c<r.length;c++)i!=null&&i[c]?a.push(i[c]):a.push(r[c]);return a}async executeEntity(i,r=[],a={}){var f,h,m,E,b,A,_,P,V,M,G,k;const c={...op,...a},e={detached:!1,execution:this};switch(i.type){case d.Condition:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((f=c.onBeforeEntityExecution)==null?void 0:f.call(c,i,K,e)),this.executeCondition(i,K)}case d.InternalCall:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((h=c.onBeforeEntityExecution)==null?void 0:h.call(c,i,K,e)),this.executeInternalCall(i,K,this.project)}case d.Operation:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((m=c.onBeforeEntityExecution)==null?void 0:m.call(c,i,K,e)),yh.executeOperation(i,K,this.project)}case d.VariableInstance:case d.VariableDeclaration:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((E=c.onBeforeEntityExecution)==null?void 0:E.call(c,i,K,e)),this.executeVariable(i,K)}case d.FunctionCall:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((b=c.onBeforeEntityExecution)==null?void 0:b.call(c,i,K,e)),this.executeFunctionCall(i,K,this.project)}case d.FunctionDeclaration:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return K.forEach(le=>{le&&le.valueOwner&&this.lastExecutionResults.writeValue(le.valueOwner,le.value)}),await((A=c.onBeforeEntityExecution)==null?void 0:A.call(c,i,K,e)),yh.executeEntryPointEntity(i,K)}case d.Search:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((_=c.onBeforeEntityExecution)==null?void 0:_.call(c,i,K,e)),this.executeSearch(i,K,this.project)}case d.Loop:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((P=c.onBeforeEntityExecution)==null?void 0:P.call(c,i,K,e)),this.executeLoop(i,K,this.project,c)}case d.ReturnStatement:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((V=c.onBeforeEntityExecution)==null?void 0:V.call(c,i,K,e)),this.executeReturnStatement(i,K)}case d.ContinueStatement:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((M=c.onBeforeEntityExecution)==null?void 0:M.call(c,i,K,e)),this.executeContinueStatement(i,K)}case d.BreakStatement:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return await((G=c.onBeforeEntityExecution)==null?void 0:G.call(c,i,K,e)),this.executeBreakStatement(i,K)}case d.GlobalEvent:{const K=this.mergeExernalValuesWithInternalInputs(r,i);return K.forEach(le=>{le&&le.valueOwner&&this.lastExecutionResults.writeValue(le.valueOwner,le.value)}),await((k=c.onBeforeEntityExecution)==null?void 0:k.call(c,i,K,e)),yh.executeEntryPointEntity(i,K)}default:throw new Error(`Entity type ${i==null?void 0:i.type} is not recognized for execution.`)}}storeLastExecutionValues(i){var a,c,e;if(i.error&&i.error.valueOwner&&this.lastExecutionResults.writeValue(i.error.valueOwner,i.error.value),!i.result||!((a=i.result)!=null&&a.valueOwner))return;const r=ud((c=i.result)==null?void 0:c.valueOwner,this.project);(e=i.result)!=null&&e.value?r.forEach(f=>{var h;this.lastExecutionResults.writeValue(f,(h=i.result)==null?void 0:h.value)}):r.forEach(f=>{this.lastExecutionResults.removeValue(f.id)})}async executeBranch(i,r={},a=[]){var m;await this.checkStateAndPause();const c={...op,...r},e={detached:!1,execution:this};if(!this.hasEntity(i)||this.hasSkipped(i))return null;this.addToExecutingList(i),this.hasScheduled(i)&&this.removeScheduled(i);const h=await this.executeEntity(i,a,c);if(this.removeFromExecutingList(i),this.addToAlreadyExecutedList(i),this.storeLastExecutionValues(h),await((m=c.onEntityExecuted)==null?void 0:m.call(c,i,h,e)),h.value===U.Success){const E=(i.successCalls||i.calls||[]).filter(V=>this.hasEntity(V));(i.errorCalls||[]).forEach(V=>{this.skip(V)});let A=[];const _=(await Promise.all(E.map(V=>this.schedule(V,[],c)))).filter(V=>!!V),P=_.filter(V=>!!V).find(V=>V.value===U.CaughtError||V.value===U.Return||V.value===U.Break||V.value===U.Continue);return P||(A=[...A,..._],h)}else if(h.value===U.CaughtError||h.value===U.ConditionNotMet){const E=(i.errorCalls||[]).filter(V=>this.hasEntity(V));(i.successCalls||i.calls||[]).forEach(V=>{this.skip(V)});let A=[];const _=(await Promise.all(E.map(V=>this.schedule(V,[],c)))).filter(V=>!!V),P=_.filter(V=>!!V).find(V=>V.value===U.CaughtError||V.value===U.UnhandledError||V.value===U.Return||V.value===U.Break||V.value===U.Continue);return P||(A=[...A,..._],h)}else{if(h.value===U.UnhandledError)return this.executing.forEach(E=>{this.skip(E)}),this.scheduled.forEach(E=>{this.skip(E)}),tr.includes(h.entity.type)&&ft(h.entity).forEach(E=>{this.skip(E)}),h;if(h.value===U.Return)return h;if(h.value===U.Break)return h;if(h.value===U.Continue)return h}return h}async execute(i={},r=[]){const a={...op,...i};this.state="running";const c=await this.executeBranch(this.entryPoint,a,r);return this.state="finished-success",c}addEntity(i){var r;this.entities.includes(i)||(this.entities.push(i),(r=this.onAddEntityCallback)==null||r.call(this,i,{}))}async addEntityAsync(i,r={}){var a;this.entities.includes(i)||(this.entities.push(i),await((a=this.onAddEntityCallback)==null?void 0:a.call(this,i,r)))}addEntities(i){i.forEach(r=>this.addEntity(r))}async addEntitiesAsync(i,r={}){const a=Y.YieldTracker.from(r),c=[];for(const e of i)c.push(this.addEntityAsync(e,r)),await a.tick();await Promise.all(c)}removeEntity(i){var r;if(i!==this.entryPoint){const a=this.entities.indexOf(i);a>-1&&(this.entities.splice(a,1),(r=this.onRemoveEntityCallback)==null||r.call(this,i,{}))}}hasEntity(i){var c;if(this.entities.includes(i)||((c=i.parent)==null?void 0:c.type)===d.FunctionDeclaration&&this.entities.includes(i.parent))return!0;const r=ht(i);if(r&&r!==i&&this.entities.includes(r))return!0;const a=r&&r.type===d.Loop&&i.parent===r.body?r.body:null;return a&&(this.entities.includes(a)||this.entities.includes(r))?!0:i.parent&&i.parent!==i?this.hasEntity(i.parent):!1}removeScheduled(i){const r=this.scheduled.indexOf(i);r>-1&&this.scheduled.splice(r,1)}hasScheduled(i){return!!this.scheduled.includes(i)}hasSkipped(i){return!!this.skipped.includes(i)}hasExecuted(i){return!!this.executed.includes(i)}hasEntityWithId(i){const r=this.project.get(i);return r?this.hasEntity(r):!1}onAddToSkippedList(i){this.onAddToSkippedListCallback=i}onAbortExecution(i){this.onAbortExecutionCallback=i}onAddEntity(i){this.onAddEntityCallback=i}onRemoveFromSkippedList(i){this.onRemoveFromSkippedListCallback=i}onRemoveEntity(i){this.onRemoveEntityCallback=i}addToExecutingList(i){this.executing.includes(i)||this.executing.push(i)}addToScheduledList(i){this.scheduled.includes(i)||this.scheduled.push(i)}removeFromScheduledList(i){const r=this.scheduled.indexOf(i);r>-1&&this.scheduled.splice(r,1)}removeFromExecutingList(i){var a;const r=this.executing.indexOf(i);r>-1&&(this.executing.splice(r,1),(a=this.onAbortExecutionCallback)==null||a.call(this,i,{}))}removeFromAlreadyExecutedList(i){const r=this.executed.indexOf(i);r>-1&&this.executed.splice(r,1)}removeFromSkippedList(i){var a;const r=this.skipped.indexOf(i);r>-1&&(this.skipped.splice(r,1),(a=this.onRemoveFromSkippedListCallback)==null||a.call(this,i,{}))}addToAlreadyExecutedList(i){this.executed.includes(i)||this.executed.push(i)}addToSkippedList(i){var r;this.skipped.includes(i)||(this.skipped.push(i),(r=this.onAddToSkippedListCallback)==null||r.call(this,i,{}))}getValueTypePreference(i){return this.parentContext.getValueTypePreference(i)||null}setValueTypePreference(i,r){this.parentContext.setValueTypePreference(i,r),this.emit(i,{})}}function P1i(s){var p,i;if(s.isList)return"list";if(((p=s.entity)==null?void 0:p.type)===d.DefinitionEntity)return"definition-entity";switch((i=s.entity)==null?void 0:i.name){case fe.Number:return"number";case fe.String:return"text";case fe.Boolean:return"boolean";case fe.UUID:return"uuid";case fe.Date:return"date-time";default:return"definition-entity"}}const cs={[d.PrimitiveEntity]:{singular:"Primitive",plural:"Primitives",shortSingular:"Primitive",shortPlural:"Primitives"},[d.DefinitionEntity]:{singular:"Definition",plural:"Definitions",shortSingular:"Definition",shortPlural:"Definitions"},[d.BuiltInBaseEntity]:{singular:"Base",plural:"Bases",shortSingular:"Base definition",shortPlural:"Base definitions"},[d.Property]:{singular:"Property",plural:"Properties",shortSingular:"Property",shortPlural:"Properties"},[d.FunctionDeclaration]:{singular:"Custom trigger",plural:"Custom triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[d.FunctionCall]:{singular:"Execute trigger",plural:"Execute trigger",shortSingular:"Execute",shortPlural:"Execute"},[d.GlobalEvent]:{singular:"System trigger",plural:"System triggers",shortSingular:"Trigger",shortPlural:"Triggers"},[d.Project]:{singular:"Project",plural:"Projects",shortSingular:"Project",shortPlural:"Projects"},[d.VariableDeclaration]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[d.VariableInstance]:{singular:"Variable",plural:"Variables",shortSingular:"Variable",shortPlural:"Variables"},[d.Condition]:{singular:"Condition",plural:"Conditions",shortSingular:"Condition",shortPlural:"Conditions"},[d.Operation]:{singular:"Operation",plural:"Operations",shortSingular:"Operation",shortPlural:"Operations"},[d.ReturnStatement]:{singular:"Termination",plural:"Terminations",shortSingular:"Termination",shortPlural:"Terminations"},[d.InstalledProject]:{singular:"Installed project",plural:"Installed projects",shortSingular:"Project",shortPlural:"Projects"},[d.Search]:{singular:"Search",plural:"Searches",shortSingular:"Search",shortPlural:"Searches"},[d.Loop]:{singular:"Loop",plural:"Loops",shortSingular:"Loop",shortPlural:"Loops"},[d.ActionDescriptor]:{singular:"Action descriptor",plural:"Action descriptors",shortSingular:"Action descriptor",shortPlural:"Action descriptors"},[d.InternalCall]:{singular:"Internal call",plural:"Internal calls",shortSingular:"Internal call",shortPlural:"Internal calls"},[d.BreakStatement]:{singular:"Loop exit",plural:"Loop exists",shortSingular:"Exit",shortPlural:"Exits"},[d.ContinueStatement]:{singular:"Next iteration",plural:"Next iterations",shortSingular:"Next",shortPlural:"Nexts"},[d.ArgumentDeclaration]:{singular:"Input definition",plural:"Input definitions",shortSingular:"Input",shortPlural:"Inputs"},[d.InputMap]:{singular:"Input",plural:"Inputs",shortSingular:"Input",shortPlural:"Inputs"},[d.OutputMap]:{singular:"Output",plural:"Outputs",shortSingular:"Output",shortPlural:"Outputs"},[d.ValueDescriptor]:{singular:"Value descriptor",plural:"Value descriptors",shortSingular:"Value descriptor",shortPlural:"Value descriptors"},[d.DataType]:{singular:"Data type",plural:"Data types",shortSingular:"Data type",shortPlural:"Data types"},[d.LiteralValue]:{singular:"Literal value",plural:"Literal values",shortSingular:"Value",shortPlural:"Values"}};function g$(s){const p=TD(s);if(!p){const r=Bh(s);if(r.includes(ge.HTTP_ENDPOINT))return"HTTP endpoint";if(r.includes(ge.PERSISTED_ENTITY))return"Persisted entity";if(r.includes(ge.CRON_JOB))return"Scheduled execution";if(r.includes(ge.RELATIONAL_DATABASE))return"Relational database"}if(p){let r="Extension of "+ce(p,p.project)+" entity",a=ys(r);const c=Bh(s);return c.includes(ge.HTTP_ENDPOINT)?"HTTP endpoint"+(a?", "+a:""):c.includes(ge.PERSISTED_ENTITY)?"Persisted entity"+(a?", "+a:""):c.includes(ge.CRON_JOB)?"Scheduled execution"+(a?", "+a:""):c.includes(ge.RELATIONAL_DATABASE)?"Relational database"+(a?", "+a:""):r}let i="";return s.abstract&&(i="Template "),s.static&&(i+=i?" single copy ":"Single copy "),i?i+"definition":"Definition"}function DMe(s){return s.parent.type===d.DefinitionEntity||s.parent.type===d.InstalledProject?"Internal action of "+ce(s.parent,s.project):s.parent.type===d.Loop?"Action repeated on every iteration":"Internal action of entity"}function I$(s){return qL(s)?DMe(s):"Custom trigger"}function N1i(s){var p;switch(s.type){case d.DefinitionEntity:return g$(s);case d.FunctionDeclaration:return I$(s)}return(p=cs[s.type])==null?void 0:p.singular}function x1i(s){var p;switch(s.type){case d.DefinitionEntity:return g$(s);case d.FunctionDeclaration:return I$(s)}return(p=cs[s.type])==null?void 0:p.singular}const R$=4e4,D$=280,$1i=300,w$=65,bf=32,Th=39,sv=26,wMe=49,lv=44,L1i=35,Eg=52,$1=10,Ua=$1*2,Tp=38,bg=90,Fg=270,CMe=R$/2+120,OMe=R$/2+180;function C$(s){let i=bf+lv+Tp+$1;const r=[...s.inputs];return r.length&&(i+=Ua,r.forEach(()=>{i+=sv})),{height:i,width:280}}function ov(s){var a,c;let i=bf+lv+Tp+$1;const r=[...s.inputs];return r.length&&(i+=Ua,r.forEach(()=>{i+=sv})),s.andChildrenGroup&&(i+=Ua,s.andChildrenGroup.forEach(e=>{i+=ov(e).height})),s.orChildrenGroup&&(i+=Ua,s.orChildrenGroup.forEach(e=>{i+=ov(e).height})),(((a=s.declaration)==null?void 0:a.id)===re.condition["condition-group-and"].id||((c=s.declaration)==null?void 0:c.id)===re.condition["condition-group-or"].id)&&(i+=Tp),{height:i,width:280}}function _Me(s){var h,m;let i=w$;const r=[];if([d.DefinitionEntity].includes(s.type)){const E=[...s.suggestedProperties||[],...s.properties||[]];E.length&&(i+=Ua,E.forEach(b=>{i+=b.static?wMe:Th}))}if([d.DefinitionEntity,d.InstalledProject,d.Loop].includes(s.type)){const E=[...(s==null?void 0:s.suggestedMethods)||[],...s.methods||[],...s.functions||[],...s.body?[s.body]:[]];E.length&&(i+=Ua,E.forEach(b=>{const A=C$(b);i+=A.height}))}Ot.includes(s.type)?(r.push(...(s.inputs||[]).flatMap(E=>[E])||[]),i+=Ua,i+=lv,s.error&&(i+=Eg)):[d.ReturnStatement,d.BreakStatement,d.ContinueStatement].includes(s.type)?(r.push(...s.outputs||[]),s.throws&&(i+=Eg)):s.type===d.Condition&&(r.push(s.inputs[0]),s.inputs[1]&&r.push(s.inputs[1]),(((h=s.declaration)==null?void 0:h.id)===re.condition["condition-group-and"].id||((m=s.declaration)==null?void 0:m.id)===re.condition["condition-group-or"].id)&&(i+=Tp),s.andChildrenGroup&&(i+=Ua,s.andChildrenGroup.forEach(E=>{i+=ov(E).height})),s.orChildrenGroup&&(i+=Ua,s.orChildrenGroup.forEach(E=>{i+=ov(E).height})));const a=r.length;a&&(i+=a*Th,i+=Ua);const c=[];if(s.type===d.FunctionDeclaration||s.type===d.GlobalEvent?c.push(...s.inputs||[]):Ot.includes(s.type)&&c.push(...s.outputs||[]),Mt.includes(s.type)){i+=Ua,i+=lv,s.usedInternalCalls.length&&s.usedInternalCalls.forEach(b=>{i+=Eg+Ua,i+=b.inputs.length*sv,i+=b.outputs.length*sv});const E=s.getDataType(null);(!E||E.canModifyObjectStructure())&&(i+=Tp)}s.type===d.Search&&(i+=Tp);const e=c.length;return e&&(i+=e*Th,i+=Ua),[d.DefinitionEntity,d.FunctionDeclaration,d.ReturnStatement,d.BreakStatement,d.ContinueStatement].includes(s.type)&&(i+=Tp),{height:i,width:280}}function VMe(s){let p=0;if(s.parent.type!==d.DefinitionEntity)return{offset:p};const i=s.parent,r=i.methods.findIndex(c=>c.id===s.id);return i.methods.slice(0,r).forEach(c=>{const e=C$(c);p+=e.height}),(i.properties.length||i.suggestedProperties.length)&&(p+=Ua,i.suggestedProperties.forEach(()=>{p+=Th}),i.properties.forEach(()=>{p+=Th})),{offset:p}}function VE(s){return`${s.split("-").map((r,a)=>a===0?r.charAt(0).toUpperCase()+r.slice(1):r.toLowerCase()).join(" ")}.`}function B1i(s){switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return"This template entity has non-template actions";case be.AbstractEntityWithNonAbstractProperties:return"This template entity has non-template properties";case be.IncorrectEntityImplementation:return"This entity incorrectly implements a template entity";case be.IncorrectMethodImplementation:return"This action incorrectly implements the template action it's based on";case be.IncorrectPropertyImplementation:return"This property incorrectly implements the template property it's based on";case be.AbstractMethodInNonAbstractEntity:return"This action is a template action in a non-template entity";case be.AbstractPropertyInNonAbstractEntity:return"This property is a template property in a non-template entity";case Ce.MethodOverwritesOtherSiblingWithSameName:return"An action in this entity overwrites an action in the template entity with the same name";case Ce.PropertyOverwritesOtherSiblingWithSameName:return"A property in this entity overwrites a property in the template entity with the same name";case be.MissingMethodImplementation:return"This entity is missing an action implementation from the template entity";case be.MissingPropertyImplementation:return"This entity is missing a property implementation from the template entity";case Ce.NameNotUniqueInScope:return"Invalid name. There is another entity with the same name in the same scope";case be.NoProperties:return"This entity has no properties, so it doesn't do anything";case be.NonStaticPropertyInStaticEntity:return"This property is not static in a static entity";case be.StaticEntityWithNonStaticProperties:return"This static entity has non-static properties";case be.ReadingFromIncompatibleType:return"This entity reads data from a value of a different data type";case be.WritingToIncompatibleType:return"This entity writes data to a value of a different data type";case be.ScopeWithoutLogic:return"This action has no logic, so it doesn't do anything";case be.NonStaticPropertyImplementsStatic:return"This property is static in a non-static entity";case be.PropertyImplementsIncompatibleType:return"This property implements a property of a different data type";case be.PropertyImplementsNonAbstact:return"This property implements a non-template property";case be.StaticPropertyImplementsNonStatic:return"This static property implements a non-static property";case be.VariableCallsOthersAndHasInternalCall:return"This variable calls other entities while being used to execute internal logic";case be.VariableHasInputsAndInternalCall:return"This variable has inputs while being used to execute internal logic";case be.VariableHasOutputsAndInternalCall:return"This variable has outputs while being used to execute internal logic";case be.VariableIsCalledAndHasInternalCall:return"This variable is called while being used to execute internal logic";case Ce.InternalCallDeclarationIsInvalidType:return"This internal call is not an action";case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"This internal call is not found in the parent entity";case Ce.InternalCallParentDeclarationEntityInvalidType:return"This internal call parent entity is not a data type";case Ce.InternalCallParentMissingDataType:return"This internal call parent entity has no data type";case Ce.UnreachableEntity:return"This entity is unreachable";case be.DisconnectedCallableEntity:return"This entity is disconnected and won't be executed by anything after publishing";case be.AbstractEntityImplements:return"This template entity implements a non-template entity";case be.AbstractExtendingNonAbstractEntity:return"This template entity extends a non-template entity";case be.InvalidPropertiesCombination:return"This entity has an invalid combination of properties";case be.ExtendingNonInteractiveEntity:return"This entity extends a non-interactive entity";case be.ExtendsIncompatibleEntities:return"This entity extends incompatible entities";case be.ImplementingNonAbstractEntity:return"This entity implements a non-template entity";case be.ImplementsIncompatibleEntities:return"This entity implements incompatible entities";case be.LackingReturnStatementOnSomeBranches:return"This action is missing a termination on some branches";case be.LastCalledEntityMustBeReturnEntity:return"The last called entity in this action must be a termination node";case be.MissingRequiredValue:return"This action is missing a required value";case be.NoPrimaryKeyProperty:return"This entity has no primary key property";case be.NonAbstractExtendingAbstractEntity:return"This non-template entity extends a template entity";case be.NonStaticExtendingStaticEntity:return"This non-static entity extends a static entity";case be.NonStaticImplementingStaticEntity:return"This non-static entity implements a static entity";case be.StaticExtendingNonStaticEntity:return"This static entity extends a non-static entity";case be.StaticImplementingNonStaticEntity:return"This static entity implements a non-static entity";case be.VariableReadsValueAndInternalCall:return"This variable reads a value while being used to execute internal logic";case be.VariableWritesValuesAndInternalCall:return"This variable writes values while being used to execute internal logic";case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return"This internal call declaration is not in the parent entity";case Ce.EmptyName:return"This entity has no name";case Ce.InvalidObjectStructure:return"This entity has an invalid structure";case Ce.LoopBodyFunctionOverwrite:return"This loop body action overwrites an action in the template entity with the same name";case Ce.MethodOverwritesBaseMethodWithSameImplementation:return"This action overwrites a base action with the same implementation";case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"This action overwrites an action in an extended entity with the same implementation";case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"This action overwrites an action in an implemented entity with the same implementation";case Ce.MissingCaller:return"This action is missing a caller";case Ce.NameAsResolvedCodeNameNotUniqueInScope:return"This entity has a name that is not unique in the scope of the code it is used in";case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"This entity name can only contain letters, numbers, underscores and spaces";case Ce.NameMustStartWithLetterOrUnderscore:return"This entity name must start with a letter or an underscore";case Ce.NoOverlapWithImplementedSignature:return"This action does not overlap with the implemented action signature";case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return"This property overwrites a base property with the same implementation";case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an extended entity with the same implementation";case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"This property overwrites a property in an implemented entity with the same implementation";case Ce.ReaderWriterIncompatibleDataType:return"This reader/writer has an incompatible data type with the value it is reading/writing";case Td.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case Td.StatusCodeMustBeNumber:return"HTTP status code must be a number, between 100 and 599";case hs.UUIDMustBeString:return`UUID must be a string, eg: "${gp()}"`;case hs.UUIDMustNotContainSpaces:return`UUID must not contain spaces, eg: "${gp()}"`;case hs.UUIDMustBeValidFormat:return`UUID must be in a valid format. Eg: "${gp()}"`;case xn.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case xn.StringValueMustNotHaveDashes:return"This value must not contain dashes";case xn.StringValueMustNotHaveSpaces:return"This value must not contain spaces";case xn.ValueMustBeString:return"This value must be a string";case ZT.DayOfMonthAndWeekConflict:return"Cron expression cannot have both day of month and day of week";case ZT.InvalidCharacters:return"Cron expression has invalid characters";case ZT.MustHaveSixFields:return"Cron expression must have six fields";default:return VE(s.code)}}function M1i(s){switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return"Non-template actions";case be.AbstractEntityWithNonAbstractProperties:return"Non-template properties";case be.IncorrectEntityImplementation:return"Incorrect implementation";case be.IncorrectMethodImplementation:return"Incorrect action implementation";case be.IncorrectPropertyImplementation:return"Incorrect property implementation";case be.AbstractMethodInNonAbstractEntity:return"Template action in non-template entity";case be.AbstractPropertyInNonAbstractEntity:return"Template property in non-template entity";case Ce.MethodOverwritesOtherSiblingWithSameName:return"Action overwrite";case Ce.PropertyOverwritesOtherSiblingWithSameName:return"Property overwrite";case be.MissingMethodImplementation:return"Missing action";case be.MissingPropertyImplementation:return"Missing property";case Ce.NameNotUniqueInScope:return"Duplicate name";case be.NoProperties:return"No properties";case be.NonStaticPropertyInStaticEntity:return"Non-static property";case be.StaticEntityWithNonStaticProperties:return"Non-static properties";case be.ReadingFromIncompatibleType:return"Read from different type";case be.WritingToIncompatibleType:return"Write to different type";case be.ScopeWithoutLogic:return"No logic";case be.NonStaticPropertyImplementsStatic:return"Invalid static property";case be.PropertyImplementsIncompatibleType:return"Incompatible data type";case be.PropertyImplementsNonAbstact:return"Non-template property";case be.StaticPropertyImplementsNonStatic:return"Non-static property";case be.VariableCallsOthersAndHasInternalCall:return"Bad internal call";case be.VariableHasInputsAndInternalCall:return"Bad internal call";case be.VariableHasOutputsAndInternalCall:return"Bad internal call";case be.VariableIsCalledAndHasInternalCall:return"Bad internal call";case Ce.InternalCallDeclarationIsInvalidType:return"Declaration not an action";case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return"Declaration not found in parent";case Ce.InternalCallParentDeclarationEntityInvalidType:return"Invalid parent declaration type";case Ce.InternalCallParentMissingDataType:return"Parent has no data type";case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return"Declaration not in parent";case Ce.UnreachableEntity:return"Unreachable entity";case be.DisconnectedCallableEntity:return"Disconnected entity";case be.AbstractEntityImplements:return"Abstract entity implements a non-template entity";case be.AbstractExtendingNonAbstractEntity:return"Abstract entity extends a non-template entity";case be.InvalidPropertiesCombination:return"Invalid properties combination";case be.ExtendingNonInteractiveEntity:return"Extending non-interactive entity";case be.ExtendsIncompatibleEntities:return"Extends incompatible entities";case be.ImplementingNonAbstractEntity:return"Implementing non-template entity";case be.ImplementsIncompatibleEntities:return"Implements incompatible entities";case be.LackingReturnStatementOnSomeBranches:return"Missing termination on some branches";case be.LastCalledEntityMustBeReturnEntity:return"Last called entity must be a termination node";case be.MissingRequiredValue:return"Missing required value";case be.NoPrimaryKeyProperty:return"No primary key property";case be.NonAbstractExtendingAbstractEntity:return"Non-template entity extending a template entity";case be.NonStaticExtendingStaticEntity:return"Non-static entity extending a static entity";case be.NonStaticImplementingStaticEntity:return"Non-static entity implementing a static entity";case be.StaticExtendingNonStaticEntity:return"Static entity extending a non-static entity";case be.StaticImplementingNonStaticEntity:return"Static entity implementing a non-static entity";case be.VariableReadsValueAndInternalCall:return"Variable reads value and has internal call";case be.VariableWritesValuesAndInternalCall:return"Variable writes values and has internal call";case Ce.EmptyName:return"Empty name";case Ce.InvalidObjectStructure:return"Invalid object structure";case Ce.LoopBodyFunctionOverwrite:return"Loop body action overwrites action with same name";case Ce.MethodOverwritesBaseMethodWithSameImplementation:return"Action overwrites base action with same implementation";case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return"Action overwrites another with same implementation";case Ce.MissingCaller:return"Missing caller";case Ce.NameAsResolvedCodeNameNotUniqueInScope:return"Name not unique in scope";case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return"Name can only contain letters, numbers, underscores and spaces";case Ce.NameMustStartWithLetterOrUnderscore:return"Name must start with letter or underscore";case Ce.NoOverlapWithImplementedSignature:return"No overlap with implemented signature";case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return"Property overwrites base property with same implementation";case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return"Property overwrites another with same implementation";case Ce.ReaderWriterIncompatibleDataType:return"Reader/writer incompatible data type";case Td.StatusCodeMustBeBetween100And599:return"HTTP status code must be between 100 and 599";case Td.StatusCodeMustBeNumber:return"HTTP status code must be a number";case hs.UUIDMustBeString:return"UUID must be a string";case hs.UUIDMustNotContainSpaces:return"UUID must not contain spaces";case hs.UUIDMustBeValidFormat:return"UUID must be in a valid format";case xn.MustBeUniqueAmongSameEntities:return"This value must be unique among the same kind";case xn.StringValueMustNotHaveDashes:return"This value must not contain dashes";case xn.StringValueMustNotHaveSpaces:return"This value must not contain spaces";default:return VE(s.code)}}function G1i(s){switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return`${ce(s.entity,s.entity.project)} has non-template actions`;case be.AbstractEntityWithNonAbstractProperties:return`${ce(s.entity,s.entity.project)} has non-template properties`;case be.IncorrectEntityImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements template`;case be.IncorrectMethodImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template`;case be.IncorrectPropertyImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template`;case be.AbstractMethodInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} can't be a template`;case be.AbstractPropertyInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} can't be a template`;case Ce.MethodOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites action`;case Ce.PropertyOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites property`;case be.MissingMethodImplementation:return`${ce(s.entity,s.entity.project)} is missing action`;case be.MissingPropertyImplementation:return`${ce(s.entity,s.entity.project)} is missing property`;case Ce.NameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} name is not unique`;case be.NoProperties:return`${ce(s.entity,s.entity.project)} has no properties`;case be.NonStaticPropertyInStaticEntity:return`${ce(s.entity,s.entity.project)} has non-static property`;case be.StaticEntityWithNonStaticProperties:return`${ce(s.entity,s.entity.project)} has non-static properties`;case be.ReadingFromIncompatibleType:return`${ce(s.entity,s.entity.project)} reads from different type`;case be.WritingToIncompatibleType:return`${ce(s.entity,s.entity.project)} writes to different type`;case be.ScopeWithoutLogic:return`${ce(s.entity,s.entity.project)} has no logic`;case be.NonStaticPropertyImplementsStatic:return`${ce(s.entity,s.entity.project)} has invalid static property`;case be.PropertyImplementsIncompatibleType:return`${ce(s.entity,s.entity.project)} has incompatible data type`;case be.PropertyImplementsNonAbstact:return`${ce(s.entity,s.entity.project)} has non-template property`;case be.StaticPropertyImplementsNonStatic:return`${ce(s.entity,s.entity.project)} has non-static property`;case be.VariableCallsOthersAndHasInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case be.VariableHasInputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case be.VariableHasOutputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case be.VariableIsCalledAndHasInternalCall:return`${ce(s.entity,s.entity.project)} has bad internal call`;case Ce.InternalCallDeclarationIsInvalidType:return`${ce(s.entity,s.entity.project)} has declaration that is not an action`;case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has declaration that is not found in parent`;case Ce.InternalCallParentDeclarationEntityInvalidType:return`${ce(s.entity,s.entity.project)} has invalid parent declaration type`;case Ce.InternalCallParentMissingDataType:return`${ce(s.entity,s.entity.project)}'s parent has no data type`;case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has declaration that is not in parent`;case Ce.UnreachableEntity:return`${ce(s.entity,s.entity.project)} is unreachable`;case be.DisconnectedCallableEntity:return`${ce(s.entity,s.entity.project)} is not executed by any entity`;case be.AbstractEntityImplements:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.AbstractExtendingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} extends a non-template entity`;case be.InvalidPropertiesCombination:return`${ce(s.entity,s.entity.project)} has invalid properties combination`;case be.ExtendingNonInteractiveEntity:return`${ce(s.entity,s.entity.project)} extends a non-interactive entity`;case be.ExtendsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} extends incompatible entities`;case be.ImplementingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.ImplementsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} implements incompatible entities`;case be.LackingReturnStatementOnSomeBranches:return`${ce(s.entity,s.entity.project)} is missing termination on some branches`;case be.LastCalledEntityMustBeReturnEntity:return`${ce(s.entity,s.entity.project)}'s last called entity must be a termination node`;case be.MissingRequiredValue:return`${ce(s.entity,s.entity.project)} is missing a required value`;case be.NoPrimaryKeyProperty:return`${ce(s.entity,s.entity.project)} has no primary key property`;case be.NonAbstractExtendingAbstractEntity:return`${ce(s.entity,s.entity.project)} extends a template entity`;case be.NonStaticExtendingStaticEntity:return`${ce(s.entity,s.entity.project)} extends a static entity`;case be.NonStaticImplementingStaticEntity:return`${ce(s.entity,s.entity.project)} implements a static entity`;case be.StaticExtendingNonStaticEntity:return`${ce(s.entity,s.entity.project)} extends a non-static entity`;case be.StaticImplementingNonStaticEntity:return`${ce(s.entity,s.entity.project)} implements a non-static entity`;case be.VariableReadsValueAndInternalCall:return`${ce(s.entity,s.entity.project)} reads a value and has internal call`;case be.VariableWritesValuesAndInternalCall:return`${ce(s.entity,s.entity.project)} writes values and has internal call`;case Ce.EmptyName:return`${cs[s.entity.type]} has no name`;case Ce.InvalidObjectStructure:return`${ce(s.entity,s.entity.project)} has invalid structure`;case Ce.LoopBodyFunctionOverwrite:return`${ce(s.entity,s.entity.project)}'s loop body action overwrites an action`;case Ce.MethodOverwritesBaseMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites base action`;case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MissingCaller:return`${ce(s.entity,s.entity.project)} is missing a caller`;case Ce.NameAsResolvedCodeNameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} has a name not unique in the scope`;case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${ce(s.entity,s.entity.project)} name can only contain letters, numbers, underscores and spaces`;case Ce.NameMustStartWithLetterOrUnderscore:return`${ce(s.entity,s.entity.project)} name must start with letter or underscore`;case Ce.NoOverlapWithImplementedSignature:return`${ce(s.entity,s.entity.project)} has no overlap with implemented signature`;case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites base property`;case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.ReaderWriterIncompatibleDataType:return`${ce(s.entity,s.entity.project)} has reader/writer with incompatible data type`;case Td.StatusCodeMustBeBetween100And599:return`${ce(s.entity,s.entity.project)} HTTP status code must be between 100 and 599`;case Td.StatusCodeMustBeNumber:return`${ce(s.entity,s.entity.project)} HTTP status code must be a number`;case hs.UUIDMustBeString:return`${ce(s.entity,s.entity.project)} UUID must be a string`;case hs.UUIDMustNotContainSpaces:return`${ce(s.entity,s.entity.project)} UUID must not contain spaces`;case hs.UUIDMustBeValidFormat:return`${ce(s.entity,s.entity.project)} UUID must be in a valid format`;case xn.MustBeUniqueAmongSameEntities:return`${ce(s.entity,s.entity.project)} value must be unique among the same kind`;case xn.StringValueMustNotHaveDashes:return`${ce(s.entity,s.entity.project)} value must not contain dashes`;case xn.StringValueMustNotHaveSpaces:return`${ce(s.entity,s.entity.project)} value must not contain spaces`;default:return`${ce(s.entity,s.entity.project)} Error: ${VE(s.code)}`}}function k1i(s){var p,i,r,a;switch(s.code){case be.AbstractEntityWithNonAbstractMethods:return`${ce(s.entity,s.entity.project)} has non-template actions`;case be.AbstractEntityWithNonAbstractProperties:return`${ce(s.entity,s.entity.project)} has non-template properties`;case be.IncorrectEntityImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template entity`;case be.IncorrectMethodImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template action it's based on`;case be.IncorrectPropertyImplementation:return`${ce(s.entity,s.entity.project)} incorrectly implements the template property it's based on`;case be.AbstractMethodInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} is a template action in a non-template entity`;case be.AbstractPropertyInNonAbstractEntity:return`${ce(s.entity,s.entity.project)} is a template property in a non-template entity`;case Ce.MethodOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites an action in the template entity`;case Ce.PropertyOverwritesOtherSiblingWithSameName:return`${ce(s.entity,s.entity.project)} overwrites a property in the template entity`;case be.MissingMethodImplementation:return`${ce(s.entity,s.entity.project)} is missing an action implementation from the template entity`;case be.MissingPropertyImplementation:return`${ce(s.entity,s.entity.project)} is missing a property implementation from the template entity`;case Ce.NameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} has a duplicate name in the same scope`;case be.NoProperties:return`${ce(s.entity,s.entity.project)} has no properties, so it doesn't do anything`;case be.NonStaticPropertyInStaticEntity:return`${ce(s.entity,s.entity.project)} has a non-static property in a static entity`;case be.StaticEntityWithNonStaticProperties:return`${ce(s.entity,s.entity.project)} has non-static properties in a static entity`;case be.ReadingFromIncompatibleType:return`${ce(s.entity,s.entity.project)} reads data from a value of a different data type`;case be.WritingToIncompatibleType:return`${ce(s.entity,s.entity.project)} writes data to a value of a different data type`;case be.ScopeWithoutLogic:return`${ce(s.entity,s.entity.project)} has no logic`;case be.NonStaticPropertyImplementsStatic:return`${ce(s.entity,s.entity.project)} has a static property in a non-static entity`;case be.PropertyImplementsIncompatibleType:return`${ce(s.entity,s.entity.project)} implements a property of a different data type`;case be.PropertyImplementsNonAbstact:return`${ce(s.entity,s.entity.project)} implements a non-template property`;case be.StaticPropertyImplementsNonStatic:return`${ce(s.entity,s.entity.project)} has a static property in a non-static entity`;case be.VariableCallsOthersAndHasInternalCall:return`${ce(s.entity,s.entity.project)} calls other entities while being used to execute internal logic`;case be.VariableHasInputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has inputs while being used to execute internal logic`;case be.VariableHasOutputsAndInternalCall:return`${ce(s.entity,s.entity.project)} has outputs while being used to execute internal logic`;case be.VariableIsCalledAndHasInternalCall:return`${ce(s.entity,s.entity.project)} is called while being used to execute internal logic`;case Ce.InternalCallDeclarationIsInvalidType:return`${ce(s.entity,s.entity.project)} has a declaration that is not an action`;case Ce.InternalCallDeclarationNotFoundInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has a declaration that is not found in ${(p=s.entity.parent.getDataType(null))!=null&&p.entity?ce((i=s.entity.parent.getDataType(null))==null?void 0:i.entity,s.entity.project):"the variable's data-type entity"}`;case Ce.InternalCallParentDeclarationEntityInvalidType:return`${ce(s.entity,s.entity.project)} is part of a variable whos data-type entity can't have actions`;case Ce.InternalCallParentMissingDataType:return`${ce(s.entity,s.entity.project)} is part of a variable with no data-type entity`;case Ce.InternalCallDeclarationNotInParentDatatypeEntity:return`${ce(s.entity,s.entity.project)} has a declaration doesn't belong to ${(r=s.entity.parent.getDataType(null))!=null&&r.entity?ce((a=s.entity.parent.getDataType(null))==null?void 0:a.entity,s.entity.project):"the variable's data-type entity"}`;case Ce.UnreachableEntity:return`${ce(s.entity,s.entity.project)} is unreachable`;case be.DisconnectedCallableEntity:return`${ce(s.entity,s.entity.project)} is disconnected and won't be executed by anything after publishing`;case be.AbstractEntityImplements:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.AbstractExtendingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} extends a non-template entity`;case be.InvalidPropertiesCombination:return`${ce(s.entity,s.entity.project)} has an invalid combination of properties`;case be.ExtendingNonInteractiveEntity:return`${ce(s.entity,s.entity.project)} extends a non-interactive entity`;case be.ExtendsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} extends incompatible entities`;case be.ImplementingNonAbstractEntity:return`${ce(s.entity,s.entity.project)} implements a non-template entity`;case be.ImplementsIncompatibleEntities:return`${ce(s.entity,s.entity.project)} implements incompatible entities`;case be.LackingReturnStatementOnSomeBranches:return`${ce(s.entity,s.entity.project)} has branches that don't terminate`;case be.LastCalledEntityMustBeReturnEntity:return`${ce(s.entity,s.entity.project)} must end with a termination node`;case be.MissingRequiredValue:return`${ce(s.entity,s.entity.project)} is missing a required value`;case be.NoPrimaryKeyProperty:return`${ce(s.entity,s.entity.project)} has no primary key property`;case be.NonAbstractExtendingAbstractEntity:return`${ce(s.entity,s.entity.project)} is a non-template entity extending a template entity`;case be.NonStaticExtendingStaticEntity:return`${ce(s.entity,s.entity.project)} is a non-static entity extending a static entity`;case be.NonStaticImplementingStaticEntity:return`${ce(s.entity,s.entity.project)} is a non-static entity implementing a static entity`;case be.StaticExtendingNonStaticEntity:return`${ce(s.entity,s.entity.project)} is a static entity extending a non-static entity`;case be.StaticImplementingNonStaticEntity:return`${ce(s.entity,s.entity.project)} is a static entity implementing a non-static entity`;case be.VariableReadsValueAndInternalCall:return`${ce(s.entity,s.entity.project)} reads a value and has an internal call`;case be.VariableWritesValuesAndInternalCall:return`${ce(s.entity,s.entity.project)} writes values and has an internal call`;case Ce.EmptyName:return`${cs[s.entity.type]} has no name`;case Ce.InvalidObjectStructure:return`${ce(s.entity,s.entity.project)} has an invalid structure`;case Ce.LoopBodyFunctionOverwrite:return`${ce(s.entity,s.entity.project)}'s loop body action overwrites`;case Ce.MethodOverwritesBaseMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites a base action with same implementation`;case Ce.MethodOverwritesOtherExtendedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MethodOverwritesOtherImplementedEntitysMethodWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another action with same implementation`;case Ce.MissingCaller:return`${ce(s.entity,s.entity.project)} is missing a caller`;case Ce.NameAsResolvedCodeNameNotUniqueInScope:return`${ce(s.entity,s.entity.project)} has a name that is not unique in the scope`;case Ce.NameCanOnlyContainLettersNumbersUnderscoreAndSpaces:return`${ce(s.entity,s.entity.project)} name can only contain letters, numbers, underscores and spaces`;case Ce.NameMustStartWithLetterOrUnderscore:return`${ce(s.entity,s.entity.project)} name must start with letter or underscore`;case Ce.NoOverlapWithImplementedSignature:return`${ce(s.entity,s.entity.project)} has no overlap with implemented signature`;case Ce.PropertyOverwritesBasePropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites a base property with same implementation`;case Ce.PropertyOverwritesOtherExtendedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.PropertyOverwritesOtherImplementedEntitysPropertyWithSameImplementation:return`${ce(s.entity,s.entity.project)} overwrites another property with same implementation`;case Ce.ReaderWriterIncompatibleDataType:return`${ce(s.entity,s.entity.project)} has a reader/writer with incompatible data type`;case Td.StatusCodeMustBeBetween100And599:return`${ce(s.entity,s.entity.project)} HTTP status code must be between 100 and 599`;case Td.StatusCodeMustBeNumber:return`${ce(s.entity,s.entity.project)} HTTP status code must be a number, between 100 and 599`;case hs.UUIDMustBeString:return`${ce(s.entity,s.entity.project)} UUID must be a string, eg: "${gp()}"`;case hs.UUIDMustNotContainSpaces:return`${ce(s.entity,s.entity.project)} UUID must not contain spaces, eg: "${gp()}"`;case hs.UUIDMustBeValidFormat:return`${ce(s.entity,s.entity.project)} UUID must be in a valid format. Eg: "${gp()}"`;case xn.MustBeUniqueAmongSameEntities:return`${ce(s.entity,s.entity.project)} value must be unique among the same kind`;case xn.StringValueMustNotHaveDashes:return`${ce(s.entity,s.entity.project)} value must not contain dashes`;case xn.StringValueMustNotHaveSpaces:return`${ce(s.entity,s.entity.project)} value must not contain spaces`;default:return`${ce(s.entity,s.entity.project)} Error: ${VE(s.code)}`}}function PE(s){const p=(s||"").startsWith("error-caller-only--");switch(p?s.replace("error-caller-only--",""):s){case Qt.CallIsInHigherScope:return"In a higher scope";case Qt.CallIsInLowerScope:return"In a lower scope";case Qt.CallerIsInHigherScope:return"Caller is in a higher scope";case Qt.CallerIsInLowerScope:return"Caller is in a lower scope";case Qt.CannotBeCalledByChildren:return"Cannot be called by children";case Qt.CannotCallAncestor:return"Cannot call ancestor";case Qt.CannotConnectToItself:return"Cannot connect to itself";case Qt.CannotReadMoreThanOneValue:return"Cannot read more than one value";case Qt.CannotReadValueFromChildren:return"Cannot read value from entities executed after itself";case Qt.CannotWriteValueToAncestor:return"Cannot write value to ancestor";case vv.Suggestion:return"Suggestion";case Qt.ContinueOrBreakStatementCalledFromOutsideLoop:return"Cannot be called from outside loop";case Qt.DataTypesNotCompatible:return"Data types not compatible";case Qt.ElementInLoopBodyCallingOutsideLoop:return"Cannot call outside loop";case Qt.ErrorOututMapCannotBeConnectedToParentSuccessBranchCallees:return"Error cannot be connected to success branch";case Qt.ExecutionsAlreadyConnected:return"Executions already connected";case Qt.IsNotValueReadingEntity:return"Is not a value reading entity";case Qt.IsNotValueWritingEntity:return"Is not a value writing entity";case Qt.NotInScope:return"Not in a compatible scope";case Qt.OtherIncompatibleScopeReason:return"Incompatible scope";case Qt.SiblingInternalCallAlreadyUsedInParentVariable:return"Internal call already used in parent variable";case Qt.SuccessOutputMapCannotBeConnectedToParentErrorBranchCallees:return"Success cannot be connected to error branch";case Qt.ValuesAlreadyConnected:return"Values already connected";case Qt.CannotInteractWithInputInVariableWithInternalCalls:return"Cannot interact with input in variable with internal calls";case Qt.CannotInteractWithOutputInVariableWithInternalCalls:return"Cannot interact with output in variable with internal calls";case vv.CanvasGloballyDisabled:return"Canvas is globally disabled";case Qt.PropertyIsConstantItsValueCantBeReset:return"Property is constant, its value can't be reset";case Qt.CannotWriteValueOfGlobalVariableDeclaration:return"Cannot write value of global variable declaration";case Qt.CannotReSetValueOfConstantVariable:return"Cannot re-set value of constant variable";case Qt.CannotConnectToOwnNode:return"It is part of the same node";case Qt.CalledByErrorMustBePassThroughCallable:return"Called by error must be pass-through callable";case Qt.CannotChangeScopeBecauseItCallsOtherEntities:return"Cannot change scope because it calls other entities in its current scope";case Qt.CannotChangeScopeBecauseItIsAlreadyCalledByOtherEntitiesInDifferentScope:return"Cannot change scope because it is already called by other entities in different scope";case Qt.VariableDeclarationCannotBeMovedToLowerScopeBecauseInstancesUsage:return"Variable declaration cannot be moved to lower scope because its instances are used in the current or different incompatible lower scope";case Qt.CalledBySourceMustBeCallerEntity:return"Not a caller type";case Qt.CalledByErrorCannotBeConnectedToEntitiesCalledByOwnSuccessBranch:return"Already connected to the success branch from a common origin caller";case Qt.CalledBySuccessCannotBeConnectedToEntitiesCalledByOwnErrorBranch:return"Already connected to the error branch from a common origin caller";case Qt.RedundantCall:return"Redundant call. Already connected further down the execution path";case Qt.CannotBeCalledBeforeDeclaration:return"Cannot be called before declaration";case Qt.CannotBeCalledInParallelBranchToDeclaration:return"Cannot be called in parallel branch to declaration";case Qt.CannotBeHigherScopeThanDeclaration:return"Cannot be in a higher scope than declaration";case Qt.CannotCallGlobalVariableDeclaration:return"Cannot call global variable declaration";case Qt.EntityAlreadyCalledBySuccessCannotBeConnectedToUnrelatedErrorBranch:return p?"Cannot connect error: Already connected to a success branch from a common origin caller":"Already connected to a success branch from a common origin caller";case Qt.CannotInteractWithInputInGlobalVariableDeclaration:return"Cannot interact with input in global variable declaration";case Qt.IsNotCallableEntity:return"Is not a callable node type";case Qt.IsNotCallerEntity:return"Is not a caller node type";case Qt.IsNotPassThroughCallableEntity:return"Is not a pass-through callable node type that has an error branch";case Qt.NotAConnectableEntityType:return"Not a connectable node type";case Qt.WouldMakeAnEarlierNodeBeCalledBeforeItsDeclaration:return"Would make an earlier node be called before its declaration";default:return Gc(s||"")}}function j1i(s,p){const i=[...s,...p],r=Array.from(new Set(i));return{hasChanged:r.length!==s.length,reasons:r}}function U1i(s,p){const i=s.filter(a=>!p.includes(a));return{hasChanged:i.length!==s.length,reasons:i}}function F1i(s,p){return s.find(i=>i.entity.id===p)||null}function TU(s){return s.filter((p,i)=>s.indexOf(p)===i)}class sn{constructor(p,i,r=null,a){R(this,"ids",[]);R(this,"entity");R(this,"entityCardHeight");R(this,"entityCardWidth");R(this,"index");R(this,"childEntities",[]);R(this,"children",[]);R(this,"parents",[]);R(this,"calculationEntryPoint");R(this,"_onlyEntities",null);R(this,"_changeSet",null);if(this.index=i,this.entity=p,this.calculationEntryPoint=r||this,this._changeSet=a||null,this===this.calculationEntryPoint&&!a)throw new Error("Change-set must be provided for the calculation entry point");this.calculateCardSize(),this.getSortedChildren()}static autoGenerateLayout(p,i,r){const a=CMe-Fg-D$,c=OMe-bg-w$;p.type===d.Project?(p.x=a,p.y=c):p.metaSync({x:p.x||a,y:p.y||c},i);const e=new sn(p,0,null,i);e.calculationEntryPoint=e,e._onlyEntities=r||[],e.ids=["0"];const f=[];e.next(m=>{f.push(...m)}),sn.recursivelyAssembleChildrenAreas(f),e.resolveChildrenOverlaps();const h=e.flattenChildEntities();return e._onlyEntities?h.filter(m=>{var E;return(E=e._onlyEntities)==null?void 0:E.includes(m)}):h}static recursivelyAssembleChildrenAreas(p){const i=[];p.forEach(r=>{r.next(a=>{i.push(...a)})}),i.length>0&&sn.recursivelyAssembleChildrenAreas(i)}get onlyEntities(){return this.calculationEntryPoint._onlyEntities||[]}get changeSet(){return this.calculationEntryPoint._changeSet}set changeSet(p){this.calculationEntryPoint._changeSet=p}findAreaInChildrenFromEntity(p){if(this.entity===p)return this;const i=this.children.find(a=>a.entity===p);return i||this.children.reduce((a,c)=>a||c.findAreaInChildrenFromEntity(p),null)}findAreaFromEntity(p){if(this.entity===p)return this;const i=this.calculationEntryPoint.children,r=i.find(c=>c.entity===p);return r||i.reduce((c,e)=>c||e.findAreaInChildrenFromEntity(p),null)}addParent(p){if(!this.parents.includes(p)){const i=sn.resolveIds(p,this.index);this.ids.push(...i),this.parents.push(p)}}static resolveIds(p,i){return p?p.ids.map(r=>`${r}-${i}`):[`${i}`]}getSortedChildren(){if(this.entity.collapsed){this.childEntities=[];return}const p=uo(this.entity,!0);if(this.entity.type===d.Project){const i=[],r=[],a=[];p.forEach(e=>{if(d.DefinitionEntity===e.type){r.push(e);return}else if(Ft.includes(e.type)){a.push(e);return}i.push(e)});const c=i.sort((e,f)=>{const h=!!eI(e,f).length,m=uo(e),E=uo(f);return h?0:m.length&&!E.length?-1:!m.length&&E.length?1:0}).filter(e=>!Kc(e).length);this.childEntities=[...r,...a,...c]}else{const i=[],r=[],a=[],c=[],e=[];tr.includes(this.entity.type)&&yD(this.entity).forEach(m=>{if(Mt.includes(m.type)){a.push(m);return}const E=ht(m);i.push(E)}),wr.includes(this.entity.type)&&r.push(...this.entity.detachedChildren);const f=p.filter(h=>{const m=i.includes(h);return m||a.includes(h)||r.includes(h)?!1:Mt.includes(h.type)?(a.push(h),!1):sr.includes(h.type)&&!m?(c.push(h),!1):h.type===d.DefinitionEntity?(e.push(h),!1):!0});i.sort((h,m)=>no(h,m)?-1:0),c.sort((h,m)=>no(h,m)?-1:0),a.sort((h,m)=>wV(h,m)?1:wV(m,h)?-1:0),this.childEntities=[...e,...i,...c,...f,...a,...r]}}calculateCardSize(){const p=_Me(this.entity);this.entityCardWidth=p.width,this.entityCardHeight=p.height}static getBoundriesOfTwoAreas(p,i){return{top:Math.min(p.top,i.top),left:Math.min(p.left,i.left),bottom:Math.max(p.bottom,i.bottom),right:Math.max(p.right,i.right)}}static getBoundriedOfCombinedAreas(p,i){const r=p.filter(c=>!i.includes(c));return r.reduce((c,e)=>i.includes(e)?c:sn.getBoundriesOfTwoAreas(c,e.fullBranchArea),r[0].fullBranchArea)}getFullAreaUntilAny(p){const i=this.ownEntityPlusBufferArea;return this.children.filter(e=>!p.includes(e)).map(e=>e.getFullAreaUntilAny(p)).reduce((e,f)=>sn.getBoundriesOfTwoAreas(e,f),i)}getFullAreaUntilAreaOrAnyChildren(p){const i=[p,...p.flattenChildren()],r=this.ownEntityPlusBufferArea;return this.children.filter(e=>i.includes(e)).map(e=>e.getFullAreaUntil(p)).reduce((e,f)=>sn.getBoundriesOfTwoAreas(e,f),r)}getFullAreaUntil(p){const i=this.ownEntityPlusBufferArea;return this.children.filter(c=>c!==p).map(c=>c.getFullAreaUntil(p)).reduce((c,e)=>sn.getBoundriesOfTwoAreas(c,e),i)}get fullBranchArea(){const p=this.ownEntityPlusBufferArea;return this.children.map(a=>a.fullBranchArea).reduce((a,c)=>sn.getBoundriesOfTwoAreas(a,c),p)}get ownEntityArea(){return{top:this.entity.y,left:this.entity.x,bottom:this.entity.y+this.entityCardHeight,right:this.entity.x+this.entityCardWidth}}get ownEntityPlusBufferArea(){const p=this.ownEntityArea;return{top:p.top,left:p.left,bottom:p.bottom+bg,right:p.right+Fg}}static filterOutRepeatedAreas(p){return p.filter((i,r)=>p.indexOf(i)===r)}getEarliestId(p,i){const r=p.split("-"),a=i.split("-");return r.length<a.length?p:r.length>a.length?i:r.reduce((e,f,h)=>f<a[h]?p:i,p)}getEarliestLevel(){return this.ids.reduce((r,a)=>this.getEarliestId(r,a),this.ids[0]).split("-").length}countColumns(){let p=0;if(this!==this.calculationEntryPoint)p++;else return p;if(!this.parents.length)return p;const r=this.parents.reduce((a,c)=>c.getEarliestLevel()>a.getEarliestLevel()?c:a,this.parents[0]).countColumns();return p+=r,p}getLatestId(p,i){if(p===i)return p;const r=p.split("-"),a=i.split("-");return r.length<a.length?i:r.length>a.length?p:r.reduce((e,f,h)=>f>a[h]?p:i,p)}getLatestLevel(){return this.ids.length===1?this.ids[0].split("-").length:this.ids.reduce((r,a)=>this.getLatestId(r,a),this.ids[0]).split("-").length}smoothPosition(){const p=this.flattenSiblings();if(!p.length&&this.parents.length<=1&&this.children.length){const i=this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();this.parents.forEach(r=>{r!==this.calculationEntryPoint&&r.shiftDownAlone(i)})}else if([...Ft].includes(this.entity.type)&&this.children.length)this.centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight();else if(!this.children.length&&this.parents.length>1){const i=p.filter(r=>!this.parents.includes(r));i.length?i.every(a=>{const c=this.countColumns(),e=a.countColumns();return c>e})&&this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight():i.length||this.centerHeaderVerticallyOverCombinedAllParentsHeaderHeight()}}shiftDownUntilAny(p,i){if(p.includes(this))return p;this.move(this.entity,{y:this.entity.y+i});let r=[...p,this];return this.children.forEach(a=>{if(sn.getEarliestParentInChain(a)!==this)return;const e=F1i(r,a.entity.id);r=sn.filterOutRepeatedAreas([...r]),e||(r=r.filter(h=>h!==a));const f=a.shiftDownUntilAny(r,i);r.push(...f)}),r}shiftRightUntilAny(p,i){p.includes(this)||(this.move(this.entity,{x:this.entity.x+i}),this.children.forEach(r=>{const a=sn.filterOutRepeatedAreas([...this.flattenSiblings(),...p]);sn.getEarliestParentInChain(r)===this&&r.shiftRightUntilAny(a,i)}))}shiftRight(p){this.move(this.entity,{x:this.entity.x+p}),this.children.forEach(i=>{const a=i.flattenSiblings().filter(c=>c!==i);i.shiftRightUntilAny(a,p)})}shiftDownAlone(p){this.move(this.entity,{y:this.entity.y+p})}centerHeaderVerticallyOverCombinedAllParentsHeaderHeight(){const p=this.parents.reduce((a,c)=>{const e=c.ownEntityArea,f=e.top+bf,h={top:f,left:e.left,bottom:f,right:e.right};return sn.getBoundriesOfTwoAreas(a,h)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),r=(p.bottom-p.top)/2-bf;this.shiftDownAlone(r)}centerHeaderVerticallyOverCombinedAllChildrenHeaderHeight(){const p=this.children.reduce((a,c)=>{const e=c.ownEntityArea,f=e.top+bf,h={top:f,left:e.left,bottom:f,right:e.right};return sn.getBoundriesOfTwoAreas(a,h)},{top:1/0,left:1/0,bottom:-1/0,right:-1/0}),r=(p.bottom-p.top)/2-bf;return this.shiftDownAlone(r),r}resolveChildrenOverlaps(){const p=this.flattenChildren();let i=[];p.forEach(r=>{const a=r.adjustVerticallyToAvoidOverlaps();i.push(...a)}),p.forEach(r=>{r.smoothPosition()})}static getEarliestParentInChain(p){let i=p.parents[0];return p.parents.length&&(i=p.parents.sort((r,a)=>{if(!r.ids.length)return-1;if(!a.ids.length)return 1;const c=r.ids.sort((f,h)=>f.length<h.length?-1:0),e=a.ids.sort((f,h)=>f.length<h.length?-1:0);return c[0].length-e[0].length})[0]),i}flattenEarlierSiblings(p=new Set){return p.add(this.entity.id),this.parents.reduce((r,a)=>{if(p.has(a.entity.id))return r;p.add(a.entity.id);const e=a.children.slice(0,a.children.indexOf(this)).reduce((f,h)=>[...f,h,...h.flattenChildren(p)],[]);return[...r,...e]},[])}flattenSiblings(p=new Set){return p.add(this.entity.id),this.parents.reduce((r,a)=>{if(p.has(a.entity.id))return r;p.add(a.entity.id);const e=a.children.filter(f=>f!==this).reduce((f,h)=>[...f,h,...h.flattenChildren(p)],[]);return[...r,...e]},[])}flattenChildren(p=new Set){return this.children.reduce((i,r)=>p.has(r.entity.id)?i:(p.add(r.entity.id),[...i,r,...r.flattenChildren(p)]),[])}flattenParents(p=new Set){return this.parents.reduce((r,a)=>p.has(a.entity.id)?r:(p.add(a.entity.id),[...r,a,...a.flattenParents(p)]),[])}getAreaIfRendered(p){return this.calculationEntryPoint.flattenChildren().find(a=>a.entity.id===p.id)||null}getLowerSiblings(){const p=this.parents.reduce((i,r)=>{const a=r.children.indexOf(this),c=r.children.slice(a+1);return[...i,...c]},[]);return TU(p)}getLowerAreas(){const p=this.getLowerSiblings(),i=this.parents.reduce((r,a)=>[...r,...a.getLowerAreas()],[]);return TU([...p,...i])}adjustVerticallyToAvoidOverlaps(p=[]){const r=sn.getEarliestParentInChain(this).children[this.index-1];if(!r)return p;const a=this.flattenEarlierSiblings(),c=this.flattenParents(),e=[...a,...c,r],m=C(e.flatMap(_=>eI(this.entity,_.entity))).filter(_=>_.id!==this.entity.id).map(_=>this.findAreaFromEntity(_)).filter(_=>!!_),E=this.getFullAreaUntilAny(m),b=r.getFullAreaUntilAny(m),A=e.reduce((_,P)=>P===this||P.fullBranchArea.left!==E.left?_:Math.max(_,P.fullBranchArea.bottom),b.bottom);if(E.top<A){const _=A-E.top+bg;return this.shiftDownUntilAny(p,_)}return p}move(p,i){if(this.onlyEntities.includes(p)){if(!this.changeSet)throw new Error("Change set is not defined for this area, cannot move entity");p.metaSync(i,this.changeSet)}}addChild(p){const i=this.childEntities[p];let r=null;i.x&&i.y?r=this.getAreaIfRendered(i):!i.x&&!i.y&&this.move(i,{x:this.entity.x,y:this.entity.y}),r||(r=new sn(i,p,this.calculationEntryPoint));const a=this.ownEntityPlusBufferArea;this.children.includes(r)||(this.children.push(r),r.addParent(this));const c=r.fullBranchArea;if(c.left<a.right){const e=a.right-c.left;r.shiftRight(e)}return r}flattenChildEntities(p=new Set){return this.children.reduce((i,r)=>p.has(r.entity.id)?i:(p.add(r.entity.id),[...i,r.entity,...r.flattenChildEntities(p)]),[])}next(p){const i=[];this.childEntities.forEach((r,a)=>{const c=this.addChild(a);c&&i.push(c)}),p(i)}}async function K1i(s,p,i={}){var c;const r=Y.YieldTracker.from(i),a=[];console.log("Generating layout for project...");for(const e of s.instancesList){if(s.diggestedBuiltInBaseEntitiesIds.has(e.id)||!$f.includes(e.type)||((c=ht(e))==null?void 0:c.id)!==e.id)continue;let f=Ut(e,s);if(!f){console.log("No top scope owner for instance: ",e," in project: ",s);continue}if(!(Ft.includes(f.type)&&f.collapsed&&f.id!==e.id)){for(;f.parent&&f.parent!==s;)f=f.parent,Ft.includes(f.type)&&f.collapsed&&(f.id,e.id);e.x=0,e.y=0,p==null||p.add(e,H.Updated),a.push(e),await r.tick()}}sn.autoGenerateLayout(s,p,a)}async function q1i(s,p,i={}){const r=Y.YieldTracker.from(i),a=[],c=[s,...ft(s)].map(e=>ht(e)).filter(Boolean);for(const e of c){if(s.project.diggestedBuiltInBaseEntitiesIds.has(e.id))continue;let f=Ut(e,s.project);if(f&&!(Ft.includes(f.type)&&f.collapsed&&f.id!==e.id)){for(;f.parent&&f.parent!==s.project;)f=f.parent,Ft.includes(f.type)&&f.collapsed&&(f.id,e.id);e.x=0,e.y=0,p==null||p.add(e,H.Updated),a.push(e),await r.tick()}}sn.autoGenerateLayout(s.project,p,a)}async function S1i(s,p,i={}){const r=Y.YieldTracker.from(i),a=[],c=new Set;RKe(p,{shallowMissingActivesError:!0,excludeAffected:!0}).forEach(m=>{var b;if((!m.x||!m.y)&&!c.has(m.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(m.id)&&(a.push(m),c.add(m.id)),co(m,s)){const A=ht(m);A&&!c.has(A.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(A.id)&&(a.push(A),c.add(A.id))}if(tr.includes(m.type)){const A=m;[A,...ft(A)].forEach(P=>{const V=ht(P);V&&!c.has(V.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(V.id)&&(a.push(V),c.add(V.id))})}m.type===d.DefinitionEntity&&m.methods.forEach(A=>{ft(A).forEach(P=>{const V=ht(P);V&&!c.has(V.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(V.id)&&(a.push(V),c.add(V.id))})}),((b=m.parent)==null?void 0:b.type)===d.Project&&(a.push(m),c.add(m.id),tr.includes(m.type)&&ft(m).forEach(P=>{const V=ht(P);V&&!c.has(V.id)&&!s.diggestedBuiltInBaseEntitiesIds.has(V.id)&&(a.push(V),c.add(V.id))}))});let f=[];for(const m of a)s.diggestedBuiltInBaseEntitiesIds.has(m.id)||(m.x=0,m.y=0,p==null||p.add(m,H.Updated),f.push(m),await r.tick());f=C(f),sn.autoGenerateLayout(s,p,f);const h=C([...f,...s.variableDeclarations,...s.variableInstances,...s.loops,...s.conditions,...s.operations,...s.searches]).filter(m=>m.x===0||m.y===0);sn.autoGenerateLayout(s,p,h)}var MT=(s=>(s.Amazon="amazon",s.Google="google",s.Microsoft="microsoft",s))(MT||{}),Rr=(s=>(s.RelationalDatabase="relational-database",s.CompiledLocalCodebase="compiled-local-codebase",s.CloudHostedCodebase="cloud-hosted-codebase",s.HttpApi="http-api",s.HttpEndpoint="http-endpoint",s.ServerlessFunction="serverless-function",s.CronJob="cron-job",s.AWSTenantAccount="aws-tenant-account",s))(Rr||{}),Q_=(s=>(s.Post="post",s.Get="get",s.Acknowledgement="acknowledgment",s.Progress="progress",s.Error="error",s.Complete="complete",s))(Q_||{}),Tf=(s=>(s.Queued="queued",s.Running="running",s.Success="success",s.Failed="failed",s.CleanedUp="cleaned-up",s.Skipped="skipped",s.AbortedByUser="aborted-by-user",s.UnrecoverableFailure="unrecoverable-failure",s.Reverted="reverted",s.UnpublishingStarted="unpublishing-started",s.Unpublished="unpublished",s))(Tf||{}),X_=(s=>(s.Queued="queued",s.Running="running",s.Success="success",s.Failed="failed",s.CleanedUp="cleaned-up",s.UnrecoverableFailure="unrecoverable-failure",s.Reverted="reverted",s.UnpublishingStarted="unpublishing-started",s.Unpublished="unpublished",s))(X_||{}),Zt=(s=>(s.ProjectNotFound="project-not-found",s.ProjectPublishRequestAcknowledged="project-publish-request-acknowledged",s.PublicationStepFailedReasonUnknown="publication-step-failed-reason-unknown",s.DeploymentCompleted="deployment-completed",s.DeploymentStarted="deployment-started",s.DeploymentFailed="deployment-failed",s.AllInfrastructureSuccessfullyProvisioned="all-infrastucture-successfully-provisioned",s.RequestPayloadValidationFailed="request-payload-validation-failed",s.ProjectStateValidationFailedMissingName="project-state-validation-failed-missing-name",s.ProjectStateValidationFailedMissingAnyFunctionality="project-state-validation-failed-missing-any-functionality",s.ProjectAlreadyBeingPublished="project-already-being-published",s.BillingSubscriptionUpdateFailed="billing-subscription-update-failed",s.RelationalDatabaseDeploymentStarted="relational-database-deployment-started",s.RelationalDatabaseDeploymentCompleted="relational-database-deployment-completed",s.RelationalDatabaseDeploymentFailed="relational-database-deployment-failed",s.CreatingNewRelationalDatabase="creating-new-relational-database",s.WaitingForPreviousRelationalDatabaseDeployment="waiting-for-previous-relationa-database-deployment",s.RelationalDatabaseAlreadyExists="relational-database-already-exists",s.RelationalDatabaseDeletionStarted="relational-database-deletion-started",s.RelationalDatabaseDeletionCompleted="relational-database-deletion-completed",s.RelationalDatabaseDeletionFailed="relational-database-deletion-failed",s.WaitingForPreviousRelationalDatabaseDeletion="waiting-for-previous-relationa-database-deletion",s.HttpApiDeploymentStarted="http-api-deployment-started",s.HttpApiDeploymentCompleted="http-api-deployment-completed",s.HttpApiDeploymentFailed="http-api-deployment-failed",s.CreatingNewHttpApi="creating-new-http-api",s.HttpApiAlreadyExists="http-api-already-exists",s.HttpApiDeletionStarted="http-api-deletion-started",s.HttpApiDeletionCompleted="http-api-deletion-completed",s.HttpApiDeletionFailed="http-api-deletion-failed",s.WaitingForPreviousHttpApiDeletion="waiting-for-previous-http-api-deletion",s.BusinessLogicCodebaseDeploymentStarted="business-logic-codebase-deployment-started",s.BusinessLogicCodebaseDeploymentCompleted="business-logic-codebase-deployment-completed",s.BusinessLogicCodebaseDeploymentFailed="business-logic-codebase-deployment-failed",s.BundlingCodebaseForDownload="bundling-codebase-for-download",s.UploadingCodebaseToCloudStorage="uploading-codebase-to-cloud-storage",s.UploadingCodebaseToCloudStorageCompleted="uploading-codebase-to-cloud-storage-completed",s.UploadingCodebaseToCloudStorageFailed="uploading-codebase-to-cloud-storage-failed",s.InfrastructureValuesCodebaseInterpolationStarted="infrastructure-values-codebase-interpolation-started",s.InfrastructureValuesCodebaseInterpolationCompleted="infrastructure-values-codebase-interpolation-completed",s.InfrastructureValuesCodebaseInterpolationFailed="infrastructure-values-codebase-interpolation-failed",s.CodeCompilationStarted="code-compilation-started",s.CodeCompilationCompleted="code-compilation-completed",s.CodeCompilationFailed="code-compilation-failed",s.BundleCodebaseStarted="bundle-codebase-started",s.BundleCodebaseCompleted="bundle-codebase-completed",s.BundleCodebaseFailed="bundle-codebase-failed",s.InstallingCodebaseDependenciesStarted="installing-codebase-dependencies-started",s.InstallingCodebaseDependenciesCompleted="installing-codebase-dependencies-completed",s.InstallingCodebaseDependenciesFailed="installing-codebase-dependencies-failed",s.MigrateRelationalDatabaseStarted="migrate-relational-database-started",s.MigrateRelationalDatabaseCompleted="migrate-relational-database-completed",s.MigrateRelationalDatabaseFailed="migrate-relational-database-failed",s.ExecutePublicationCompletedEventStarted="execute-publication-completed-event-started",s.ExecutePublicationCompletedEventCompleted="execute-publication-completed-event-completed",s.ExecutePublicationCompletedEventFailed="execute-publication-completed-event-failed",s.ExecutePublicationCompletedEventTimedOut="execute-publication-completed-event-timed-out",s.AWSTenantAccountProvisioningStarted="aws-tenant-account-provisioning-started",s.AWSTenantAccountProvisioningCompleted="aws-tenant-account-provisioning-completed",s.AWSTenantAccountProvisioningFailed="aws-tenant-account-provisioning-failed",s))(Zt||{}),eo=(s=>(s.CodeCompilation="code-compilation",s.RelationalDatabaseDeployment="relational-database-deployment",s.RelationalDatabaseDeletion="relational-database-deletion",s.HttpApiDeployment="http-api-deployment",s.HttpApiDeletion="http-api-deletion",s.InfrastructureValuesCodebaseInterpolation="infrastructure-values-codebase-interpolation",s.BundleCodebase="bundle-codebase",s.MigrateRelationalDatabase="migrate-relational-database",s.BusinessLogicCodebaseDeployment="business-logic-codebase-deployment",s.ExecutePublicationCompletedEvent="execute-publication-completed-event",s.CodebaseCleanup="codebase-cleanup",s.AWSTenantAccountProvisioning="aws-tenant-account-provisioning",s))(eo||{});Rr.CloudHostedCodebase,Rr.HttpApi,Rr.RelationalDatabase,Rr.CloudHostedCodebase,Rr.CloudHostedCodebase,Rr.RelationalDatabase,Rr.CloudHostedCodebase,Rr.CloudHostedCodebase;function PMe(s){return`project-${s}-http-api`}function L1(s){return`entity-${s}-database`}class NMe{constructor(p,i,r,a,c,e,f,h,m){R(this,"stepType");R(this,"id");R(this,"resourceType");R(this,"index");R(this,"dependency",[]);R(this,"lastEvent",null);R(this,"lastEventTimestamp",null);R(this,"status",Tf.Queued);R(this,"publicationRun");R(this,"resource");this.stepType=p,this.id=i,this.resourceType=r,this.status=a,this.dependency=c,this.index=e,this.lastEventTimestamp=f,this.publicationRun=h,this.resource=m}toJSON(){return{stepType:this.stepType,id:this.id,resourceType:this.resourceType,index:this.index,status:this.status,dependency:this.dependency,lastEvent:this.lastEvent,resource:{resourceId:this.resource.resourceId,resourceType:this.resource.resourceType,provider:this.resource.provider,details:this.resource.details,status:this.resource.status,name:this.resource.name}}}async update(p){var i,r;this.status=p.status,this.dependency=p.dependency,this.index=p.index,this.stepType=p.stepType,this.resourceType=p.resourceType,this.lastEvent=p.lastEvent,this.id=p.id,(r=this.resource)==null||r.setDetails((i=p.resource)==null?void 0:i.details)}}var xMe=(s=>(s.Ready="ready",s.Provisioning="provisioning",s.Queued="queued",s.ProvisioningFailed="provisioning-failed",s.Deleting="deleting",s.DeletingFailed="deleting-failed",s.Deleted="deleted",s))(xMe||{});class kc{constructor(p,i,r){R(this,"provisionedBy");R(this,"publicationRun");R(this,"resourceType");R(this,"provider");R(this,"resourceId");R(this,"details",null);R(this,"name",null);R(this,"status","queued");this.publicationRun=p,this.resourceType=i,this.provider=r}setDetails(p){this.details=p}setStatus(p){this.status=p}setProvisionedBy(p){this.provisionedBy=p}}class Z1i extends kc{constructor(i,r,a){super(i,Rr.HttpEndpoint,a);R(this,"resourceType",Rr.HttpEndpoint);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,r;return this.resourceId=L1((r=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:r.id),this.resourceId}}class H1i extends kc{constructor(i,r,a){super(i,Rr.ServerlessFunction,a);R(this,"resourceType",Rr.ServerlessFunction);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,r;return this.resourceId=L1((r=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:r.id),this.resourceId}}class $Me extends kc{constructor(i,r,a){super(i,Rr.HttpApi,a);R(this,"resourceType",Rr.HttpApi);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=PMe(this.publicationRun.project.id),this.resourceId}}class LMe extends kc{constructor(i,r,a){super(i,Rr.RelationalDatabase,a);R(this,"resourceType",Rr.RelationalDatabase);R(this,"owners",new Map);R(this,"details",null);R(this,"status","queued");r.forEach(c=>{this.owners.set(c.id,c)}),this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){var i,r;return this.resourceId=L1((r=(i=Array.from(this.owners.values()))==null?void 0:i[0])==null?void 0:r.id),this.resourceId}}class BMe extends kc{constructor(i,r){super(i,Rr.CloudHostedCodebase,r);R(this,"resourceType",Rr.CloudHostedCodebase);R(this,"details",null);R(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=`cloud-hosted-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}`,this.resourceId}}class MMe extends kc{constructor(i,r){super(i,Rr.CompiledLocalCodebase,r);R(this,"resourceType",Rr.CompiledLocalCodebase);R(this,"details",null);R(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=`compiled-codebase--${this.publicationRun.project.id}--${this.publicationRun.project.version}--${this.publicationRun.id}`,this.resourceId}}class W1i extends kc{constructor(i,r){super(i,Rr.AWSTenantAccount,r);R(this,"resourceType",Rr.AWSTenantAccount);R(this,"status","queued");this.resolveDeterministicResourceId()}resolveDeterministicResourceId(){return this.resourceId=`aws-tenant-account--${this.publicationRun.project.id}`,this.resourceId}}class z1i{constructor(p,i){R(this,"id");R(this,"projectAutoIncrementPublicationCount");R(this,"projectPublishedSemanticVersion");R(this,"envIdentifier");R(this,"projectVersion");R(this,"projectBranchId");R(this,"projectId");R(this,"triggeredBy");R(this,"createdAt");R(this,"updatedAt");R(this,"status");R(this,"steps",[]);R(this,"editor");R(this,"explicitResources",new Map);R(this,"implicitGlobalResources",new Map);R(this,"finalGlobalEvent",null);R(this,"finalStatus",null);R(this,"contextType",se.PublicationRun);R(this,"extensionsRegistry");this.id=p.id,this.projectAutoIncrementPublicationCount=p.projectAutoIncrementPublicationCount,this.projectPublishedSemanticVersion=p.projectPublishedSemanticVersion,this.envIdentifier=p.envIdentifier,this.projectVersion=p.projectVersion,this.projectBranchId=p.projectBranchId,this.projectId=p.projectId,this.triggeredBy=p.triggeredBy,this.createdAt=p.createdAt,this.updatedAt=p.updatedAt,this.status=p.status,this.editor=i,this.initRegistry()}get off(){return this.extensionsRegistry.off}get on(){return this.extensionsRegistry.on}get emit(){return this.extensionsRegistry.emit}get emitAsync(){return this.extensionsRegistry.emitAsync}get emitAsyncAll(){return this.extensionsRegistry.emitAsyncAll}get emitAsyncAllSettled(){return this.extensionsRegistry.emitAsyncAllSettled}get emitAsyncSequentially(){return this.extensionsRegistry.emitAsyncSequentially}get emitAsyncSequentiallyAll(){return this.extensionsRegistry.emitAsyncSequentiallyAll}get emitAsyncSequentiallyAllSettled(){return this.extensionsRegistry.emitAsyncSequentiallyAllSettled}get project(){return this.editor.project}getInfraTypes(p){return this.steps.filter(i=>p.includes(i.resourceType))}getStepsTypes(p){return this.steps.filter(i=>p.includes(i.stepType))}toIds(p){return p.map(i=>i.id)}getResourceForEntity(p){const i=Array.from(this.explicitResources.values()).find(r=>r.owners.has(p.id));return i||null}async init(){await this.initResources()}async initResources(){this.implicitGlobalResources.set(Rr.CompiledLocalCodebase,new MMe(this,MT.Amazon)),this.implicitGlobalResources.set(Rr.CloudHostedCodebase,new BMe(this,MT.Amazon));const p=this.project.entities.filter(r=>ui(r,ge.HTTP_ENDPOINT)),i=this.project.entities.filter(r=>ui(r,ge.RELATIONAL_DATABASE));if(i.length&&i.forEach(r=>{const a=new LMe(this,[r],MT.Amazon);this.explicitResources.set(a.resourceId,a)}),p.length){const r=new $Me(this,p,MT.Amazon);this.explicitResources.set(r.resourceId,r)}}setSteps(p,i){p.forEach(r=>{this.addStep(r,i)}),this.editor.events.emit(Zt.ProjectPublishRequestAcknowledged,{})}addStep(p,i){const r=p.dependency||[];if(r.length){const c=r.filter(e=>!this.steps.find(f=>f.id===e));if(c.length)throw new Error(`Missing dependencies: ${c.join(", ")}`)}if(!this.steps.find(c=>c.id===p.id)){const c=new NMe(p.stepType,p.id,p.resourceType,p.status,r,p.index,i,this,null);this.steps.push(c)}}onUpdate(p){var i;if(Y.Logger.log("onUpdate",p),(i=p.payload)!=null&&i.stepType){const r=this.steps.find(a=>{var c;return a.id===((c=p.payload)==null?void 0:c.id)});r&&B(p.emittedAt).isAfter(B(r.lastEventTimestamp))&&r.update(p.payload)}this.editor.events.emit("publication-updated",{}),p.type===Q_.Error?(this.finalStatus=X_.Failed,this.finalGlobalEvent=p.event,this.editor.events.emit("project-publication-error",p)):p.type===Q_.Complete&&(this.finalStatus=X_.Success,this.finalGlobalEvent=p.event,this.editor.events.emit("project-publication-completed",p))}requestExtension(p){return this.extensionsRegistry.requestExtension(p)}async initRegistry(){return this.extensionsRegistry=new E$(this.editor.events),await this.extensionsRegistry.setup(),this.extensionsRegistry.onResolvePublicationRunContext(()=>this),await this.extensionsRegistry.contextAvailable(se.PublicationRun),this.extensionsRegistry}}function Y1i(s){switch(s){case eo.CodeCompilation:return"Code generation";case eo.RelationalDatabaseDeployment:return"Database creation";case eo.HttpApiDeployment:return"HTTP gateway creation";case eo.InfrastructureValuesCodebaseInterpolation:return"Link code with resources";case eo.BundleCodebase:return"Bundle code";case eo.MigrateRelationalDatabase:return"Database structure migration";case eo.BusinessLogicCodebaseDeployment:return"Update servers with new code";case eo.CodebaseCleanup:return"Code cleanup";case eo.HttpApiDeletion:return"HTTP gateway deletion";case eo.RelationalDatabaseDeletion:return"Database deletion";default:return"Publication finished"}}function J1i(s){switch(s){case Zt.DeploymentCompleted:return"Successfully published";case Zt.DeploymentStarted:return"Publication started";case Zt.DeploymentFailed:return"Publication failed";case Zt.AllInfrastructureSuccessfullyProvisioned:return"All infrastructure successfully provisioned";case Zt.RequestPayloadValidationFailed:return"Request payload validation failed";case Zt.ProjectStateValidationFailedMissingName:return"Project state validation failed: missing name";case Zt.ProjectStateValidationFailedMissingAnyFunctionality:return"Project state validation failed: missing any functionality";case Zt.RelationalDatabaseDeploymentStarted:return"Database creation started";case Zt.RelationalDatabaseDeploymentCompleted:return"Database creation completed";case Zt.RelationalDatabaseDeploymentFailed:return"Database creation failed";case Zt.CreatingNewRelationalDatabase:return"Creating new database (up to 5 mins)";case Zt.WaitingForPreviousRelationalDatabaseDeployment:return"Waiting for previous database creation";case Zt.RelationalDatabaseAlreadyExists:return"Database already exists";case Zt.HttpApiDeploymentStarted:return"HTTP gateway creation started";case Zt.HttpApiDeploymentCompleted:return"HTTP gateway creation completed";case Zt.HttpApiDeploymentFailed:return"HTTP gateway creation failed";case Zt.CreatingNewHttpApi:return"Creating new HTTP gateway";case Zt.HttpApiAlreadyExists:return"HTTP gateway already exists";case Zt.BusinessLogicCodebaseDeploymentStarted:return"Update servers with new code started";case Zt.BusinessLogicCodebaseDeploymentCompleted:return"Update servers with new code completed";case Zt.BusinessLogicCodebaseDeploymentFailed:return"Update servers with new code failed";case Zt.BundlingCodebaseForDownload:return"Bundling code for download";case Zt.UploadingCodebaseToCloudStorage:return"Uploading code to cloud storage";case Zt.InfrastructureValuesCodebaseInterpolationStarted:return"Linking code with resources started";case Zt.InfrastructureValuesCodebaseInterpolationCompleted:return"Linking code with resources completed";case Zt.InfrastructureValuesCodebaseInterpolationFailed:return"Linking code with resources failed";case Zt.CodeCompilationStarted:return"Code generation started";case Zt.CodeCompilationCompleted:return"Code generation completed";case Zt.CodeCompilationFailed:return"Code generation failed";case Zt.BundleCodebaseStarted:return"Code bundling started";case Zt.BundleCodebaseCompleted:return"Code bundling completed";case Zt.BundleCodebaseFailed:return"Code bundling failed";case Zt.InstallingCodebaseDependenciesStarted:return"Installing code dependencies";case Zt.InstallingCodebaseDependenciesCompleted:return"Installing code dependencies completed";case Zt.InstallingCodebaseDependenciesFailed:return"Installing code dependencies failed";case Zt.MigrateRelationalDatabaseStarted:return"Database structure migration started";case Zt.MigrateRelationalDatabaseCompleted:return"Database structure migration completed";case Zt.MigrateRelationalDatabaseFailed:return"Database structure migration failed";case Zt.ProjectAlreadyBeingPublished:return"Project already being published. You need to wait for the previous publication to complete";case Zt.ProjectPublishRequestAcknowledged:return"Project publish request acknowledged";case Zt.UploadingCodebaseToCloudStorageCompleted:return"Uploading code to cloud storage completed";case Zt.UploadingCodebaseToCloudStorageFailed:return"Uploading code to cloud storage failed";case Zt.BillingSubscriptionUpdateFailed:return"Billing subscription update failed";case Zt.ProjectNotFound:return"Project not found";case Zt.HttpApiDeletionCompleted:return"HTTP gateway deletion completed";case Zt.HttpApiDeletionFailed:return"HTTP gateway deletion failed";case Zt.HttpApiDeletionStarted:return"HTTP gateway deletion started";case Zt.PublicationStepFailedReasonUnknown:return"Publication step failed: reason unknown";case Zt.WaitingForPreviousHttpApiDeletion:return"Waiting for previous HTTP gateway deletion";case Zt.RelationalDatabaseDeletionStarted:return"Database deletion started";case Zt.RelationalDatabaseDeletionCompleted:return"Database deletion completed";case Zt.RelationalDatabaseDeletionFailed:return"Database deletion failed";case Zt.WaitingForPreviousRelationalDatabaseDeletion:return"Waiting for previous database deletion"}return"Unknown event"}var GMe=(s=>(s.NO_LOGIC="NO_LOGIC",s.NO_NAME="NO_NAME",s.NO_CHANGES="NO_CHANGES",s.PROJECT_PUBLICATION_ALREADY_ONGOING="PROJECT_PUBLICATION_ALREADY_ONGOING",s))(GMe||{});function Q1i(s){switch(s){case"NO_LOGIC":return"This project has no logic";case"NO_NAME":return"This project has no name";case"NO_CHANGES":return"This version has already been published";case"PROJECT_PUBLICATION_ALREADY_ONGOING":return"This project is already being published";default:return"Publishing is currently not available. Try again later"}}function X1i(s){switch(s){case Rr.RelationalDatabase:return"Relational database";case Rr.HttpEndpoint:case Rr.HttpApi:return"HTTP endpoints";case Rr.ServerlessFunction:case Rr.CloudHostedCodebase:return"Server code functions";default:return"Resources"}}function eDi(s){switch(s){case Tf.Running:return"In progress";case Tf.Failed:return"Failed";case Tf.Success:return"Succeeded";case Tf.Skipped:return"Skipped";case Tf.Queued:default:return"Queued"}}function kMe(s){var r;if(!ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION))return null;let p=null;const i=re["built-in-base-entity"].BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_ENTITY.properties.integration.id;if(s.type===d.BuiltInBaseEntity?ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION)&&(p=eV(s.name)):s.type===d.DefinitionEntity&&s.implements.forEach(a=>{if(ui(a,ge.EXTERNAL_INTEGRATION_CONNECTION)){const c=eV(a==null?void 0:a.name);if(c)return p=c,!0}}),!p){const a=s.properties.find(c=>!!c.implements.find(e=>e.id===i)||!!c.implements.find(e=>{var f;return((f=e.extends)==null?void 0:f.id)===i}));p=(r=a==null?void 0:a.getDefaultValue())==null?void 0:r.value}return p}function tDi(s){return bTe[s]}function eV(s){return s.includes("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_")?s.replace("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_","").toLocaleLowerCase().replace("_auth",""):null}function jMe(s){if(s.type!==d.ActionDescriptor&&s.type!==d.Operation)throw new Error("Only ActionDescriptorState or OperationState can be used to resolve an external integration ID");if(s.type===d.ActionDescriptor){const p=s;if(p.id.startsWith("external-integration--"))return p.id.split("--")[1]}if(s.type===d.Operation){const p=s.declaration;if(Object.values(Ti).includes(p.id))return p.id.split("--")[1]||null}return null}function iDi(s){if(!s)throw new Error("The integrationName parameter is required to resolve the base built-in name.");return Object.values(ge).find(i=>!!(i.startsWith("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_")&&i.endsWith("_AUTH")&&i.replace("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_","").replace("_AUTH","").toLowerCase()===s.toLowerCase()))||null}function rDi(s){return s.type===d.BuiltInBaseEntity||s.type===d.DefinitionEntity?kMe(s):s.type===d.ActionDescriptor||s.type===d.Operation?jMe(s):null}function UMe(s){var a,c,e;if(!ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION))return null;let p=null;const i=yKe(s,ge.EXTERNAL_INTEGRATION_CONNECTION);if(!i)return null;const r=re["built-in-base-entity"][i.id].properties.connectionId.id;if(s.type===d.BuiltInBaseEntity){if(ui(s,ge.EXTERNAL_INTEGRATION_CONNECTION)){const f=s.properties.find(h=>{var m;return((m=h.extends)==null?void 0:m.id)===r});f&&(p=(a=f.getDefaultValue())==null?void 0:a.value)}}else if(s.type===d.DefinitionEntity){const f=s.properties.find(h=>!!h.implements.find(m=>m.id===r)||!!h.implements.find(m=>{var E;return((E=m.extends)==null?void 0:E.id)===r}));if(!f&&((c=s.extends)==null?void 0:c.type)===d.DefinitionEntity)return UMe(s.extends);p=(e=f==null?void 0:f.getDefaultValue())==null?void 0:e.value}return p}async function FMe(s,p={}){var f;const i=Y.YieldTracker.from(p),a=[...Aa(s),...Dn(s),...O$(s),...ga(s),..._$(s)],c=JE(s);a.push(...c);const e=qt(s.errors,a);await i.tick();for(const h of s.inputs)await h.validateAsync({tracker:i});for(const h of s.outputs)await h.validateAsync({tracker:i});for(const h of s.internalCalls)await h.validateAsync({tracker:i});return await((f=s.dataType)==null?void 0:f.validateAsync({tracker:i})),e}function KMe(s){var a;(a=s.dataType)==null||a.validate(),s.inputs.forEach(c=>c.validate()),s.outputs.forEach(c=>c.validate()),s.internalCalls.forEach(c=>c.validate());const i=[...Aa(s),...Dn(s),...O$(s),...ga(s),..._$(s)],r=JE(s);return i.push(...r),qt(s.errors,i)}function O$(s,p){const r=[...s.project.getVariableDeclarations()].filter(a=>a.id!==s.id);return XE(s,[ir],r,p)}function _$(s){const p=[];if(s.parent!==s.project)return p;if(s.catchesError){const i=Rt({id:`${s.id}--${Ce.GlobalVariableDeclarationCannotCatchError}`,message:`${cs[s.type].singular} "${ce(s,s.project)}" with id "${s.id}" cannot catch an error because it is globally declared. Global variable declarations must crash the project if an error occurs.`,severity:ve.Error,code:Ce.GlobalVariableDeclarationCannotCatchError,entity:s});p.push(i.error)}if(s.errorCalls.length){const i=Rt({id:`${s.id}--${Ce.GlobalVariableDeclarationCannotCallOnError}`,message:`${cs[s.type].singular} "${ce(s,s.project)}" with id "${s.id}" cannot call other entities from its error branch because it is globally declared. Global variable declarations must crash the project if an error occurs.`,severity:ve.Error,code:Ce.GlobalVariableDeclarationCannotCallOnError,entity:s});p.push(i.error)}if(s.calledBy.length){const i=Rt({id:`${s.id}--${Ce.GlobalVariableDeclarationCannotBeCalled}`,message:`${cs[s.type].singular} "${ce(s,s.project)}" with id "${s.id}" cannot be called because it is globally declared. Global variable declarations must be self initialized when the project is loaded, and not be called for initialization.`,severity:ve.Error,code:Ce.GlobalVariableDeclarationCannotBeCalled,entity:s});p.push(i.error)}return[]}const nDi=Object.freeze(Object.defineProperty({__proto__:null,validate:KMe,validateAsync:FMe,validateGlobalVariableDeclaration:_$,validateVariableDeclarationName:O$},Symbol.toStringTag,{value:"Module"}));async function qMe(s,p={}){const i=Y.YieldTracker.from(p),a=[...Aa(s),...Dn(s),...ga(s),...ad(s),...ZMe(s)],c=JE(s);a.push(...c);const e=qt(s.errors,a);await i.tick();for(const f of s.inputs)await f.validateAsync({tracker:i});for(const f of s.outputs)await f.validateAsync({tracker:i});for(const f of s.internalCalls)await f.validateAsync({tracker:i});return e}function SMe(s){s.inputs.forEach(a=>a.validate()),s.outputs.forEach(a=>a.validate()),s.internalCalls.forEach(a=>a.validate());const i=[...Aa(s),...Dn(s),...ga(s)],r=JE(s);return i.push(...r),qt(s.errors,i)}function ZMe(s){const p=[],i=s.declaration.constant;if(i&&s.readsValue){const r=Rt({id:`${s.id}--${be.ValueReadingOverridesConstantVariable}`,message:`The '${s.type}' entity "${ce(s,s.project)}" with id "${s.id}" is a constant variable whose value cannot be overriden, but reads a value.`,severity:ve.Error,code:be.ValueReadingOverridesConstantVariable,entity:s});p.push(r.error)}if(i&&s.defaultValue){const r=Rt({id:`${s.id}--${be.DefaultValueOverridesConstantVariable}`,message:`The '${s.type}' entity "${ce(s,s.project)}" with id "${s.id}" is a constant variable whose value cannot be overridden, but has a 'defaultValue'.`,severity:ve.Error,code:be.DefaultValueOverridesConstantVariable,entity:s});p.push(r.error)}return p}function ad(s){var h;const p=[],i=s.declaration;if((i==null?void 0:i.id)===((h=s.parent)==null?void 0:h.id)||!s.calledBy.length&&!s.successCalls.length&&!s.errorCalls.length&&s.usedInternalCalls.length)return p;const r=ft(s),a=ft(i);!!r.find(m=>m.id===i.id)&&p.push(Rt({id:`${s.id}--${be.CalledBeforeDeclaration}`,code:be.CalledBeforeDeclaration,severity:ve.Error,message:`Entity of type "${s.type}" with id "${s.id}" is called before its 'variable-declaration' '${i.name}' with id "${i.id}".
55
55
  The 'variable-declaration' must be called before any internal call that references it can be called.`,entity:s}).error);const e=Ut(i,s.project),f=Ut(s,s.project);if((e==null?void 0:e.type)!==d.Project&&e&&f){const m=!!a.find(E=>E.id===s.id);if((e==null?void 0:e.id)===(f==null?void 0:f.id))m||p.push(Rt({id:`${s.id}--${be.CalledInParallelBranchToDeclaration}`,code:be.CalledInParallelBranchToDeclaration,severity:ve.Error,message:`Entity of type "${s.type}" with id "${s.id}" is called in a parallel branch to its 'variable-declaration' '${i.name}' with id "${i.id}".
56
56
  The 'variable-declaration' must be called in a different branch that executes before any internal call that references it can be called.`,entity:s}).error);else if(Fa(f,e,s.project))p.push(Rt({id:`${s.id}--${be.HigherScopeThanDeclaration}`,code:be.HigherScopeThanDeclaration,severity:ve.Error,message:`Entity of type "${s.type}" with id "${s.id}" is called in a higher scope than its 'variable-declaration' '${i.name}' with id "${i.id}".
57
57
  The 'variable-declaration' must be called in the same scope or in a higher scope than any internal call that references it.`,entity:s}).error);else if(Fa(e,f,s.project)){let E=f;for(;E.id!==e.id&&E.id!==s.project.id;){const A=Ut(E,s.project);if(A.id===e.id)break;E=A}const b=Ym(E);if(b){const _=!!ft(b).find(V=>V.id===i.id),P=!!a.find(V=>V.id===b.id);_?p.push(Rt({id:`${s.id}--${be.CalledBeforeDeclaration}`,code:be.CalledBeforeDeclaration,severity:ve.Error,message:`Entity of type "${s.type}" with id "${s.id}" is called before its 'variable-declaration' '${i.name}' with id "${i.id}".
package/dist/index.d.ts CHANGED
@@ -9576,7 +9576,7 @@ export declare enum BaseValueDescriptorIds {
9576
9576
  }
9577
9577
 
9578
9578
  export declare interface BuiltInFunctionImplementationModule {
9579
- main: (entity: InternalCallState, _inputs: IDynamicValue[]) => Promise<IExecutionResult>;
9579
+ main: (entity: InternalCallState, _inputs: IDynamicValue[], execution?: Execution) => Promise<IExecutionResult>;
9580
9580
  }
9581
9581
 
9582
9582
  export declare class BuiltInFunctionImplementationUpdatePersistedEntityModule extends BaseRegisteredExtension<BuiltInFunctionImplementationModule> implements IRegisteredExtension<BuiltInFunctionImplementationModule> {
package/dist/index.js CHANGED
@@ -126738,19 +126738,17 @@ class uT extends Wy {
126738
126738
  }
126739
126739
  hasEntity(i) {
126740
126740
  var c;
126741
- if (this.entities.includes(i))
126741
+ if (this.entities.includes(i) || ((c = i.parent) == null ? void 0 : c.type) === d.FunctionDeclaration && this.entities.includes(
126742
+ i.parent
126743
+ ))
126742
126744
  return !0;
126743
- if (((c = i.parent) == null ? void 0 : c.type) === d.FunctionDeclaration)
126744
- return this.entities.includes(
126745
- i.parent
126746
- );
126747
126745
  const r = vt(
126748
126746
  i
126749
126747
  );
126750
- if (!r)
126751
- return !1;
126752
- const a = r.type === d.Loop && i.parent === r.body ? r.body : null;
126753
- return a ? this.entities.includes(a) || this.entities.includes(r) : this.entities.includes(r);
126748
+ if (r && r !== i && this.entities.includes(r))
126749
+ return !0;
126750
+ const a = r && r.type === d.Loop && i.parent === r.body ? r.body : null;
126751
+ return a && (this.entities.includes(a) || this.entities.includes(r)) ? !0 : i.parent && i.parent !== i ? this.hasEntity(i.parent) : !1;
126754
126752
  }
126755
126753
  removeScheduled(i) {
126756
126754
  const r = this.scheduled.indexOf(i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyx-code/project-logic-tree",
3
- "version": "0.0.6972",
3
+ "version": "0.0.6973",
4
4
  "author": "Sergio Herrero",
5
5
  "license": "UNLICENSED",
6
6
  "description": "An installable module which contains the type definitions and ephemeral state management for a projects' logic tree data structure",