@elyx-code/project-logic-tree 0.0.7012 → 0.0.7014
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +95 -31
- package/package.json +1 -1
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(u){return u instanceof this?u:new this(u)}static concat(u,...i){const r=new this(u);return i.forEach(a=>r.set(a)),r}static accessor(u){const r=(this[mU]=this[mU]={accessors:{}}).accessors,a=this.prototype;function c(e){const f=VT(e);r[f]||(E1i(a,e),r[f]=!0)}return Je.isArray(u)?u.forEach(c):c(u),this}}yw.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Je.reduceDescriptors(yw.prototype,({value:s},u)=>{let i=u[0].toUpperCase()+u.slice(1);return{get:()=>s,set(r){this[i]=r}}});Je.freezeMethods(yw);const Uo=yw;function k_(s,u){const i=this||z$,r=u||i,a=Uo.from(r.headers);let c=r.data;return Je.forEach(s,function(f){c=f.call(i,c,a.normalize(),u?u.status:void 0)}),a.normalize(),c}function fMe(s){return!!(s&&s.__CANCEL__)}class b1i extends Or{constructor(u,i,r){super(u??"canceled",Or.ERR_CANCELED,i,r),this.name="CanceledError",this.__CANCEL__=!0}}const Eb=b1i;function yMe(s,u,i){const r=i.config.validateStatus;!i.status||!r||r(i.status)?s(i):u(new Or("Request failed with status code "+i.status,[Or.ERR_BAD_REQUEST,Or.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function A1i(s){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return u&&u[1]||""}function g1i(s,u){s=s||10;const i=new Array(s),r=new Array(s);let a=0,c=0,e;return u=u!==void 0?u:1e3,function(h){const m=Date.now(),T=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<u)return;const D=T&&m-T;return D?Math.round(A*1e3/D):void 0}}function I1i(s,u){let i=0,r=1e3/u,a,c;const e=(m,T=Date.now())=>{i=T,a=null,c&&(clearTimeout(c),c=null),s(...m)};return[(...m)=>{const T=Date.now(),b=T-i;b>=r?e(m,T):(a=m,c||(c=setTimeout(()=>{c=null,e(a)},r-b)))},()=>a&&e(a)]}const DI=(s,u,i=3)=>{let r=0;const a=g1i(50,250);return I1i(c=>{const e=c.loaded,f=c.lengthComputable?c.total:void 0,h=e-r,m=a(h),T=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&&T?(f-e)/m:void 0,event:c,lengthComputable:f!=null,[u?"download":"upload"]:!0};s(b)},i)},TU=(s,u)=>{const i=s!=null;return[r=>u[0]({lengthComputable:i,total:s,loaded:r}),u[1]]},vU=s=>(...u)=>Je.asap(()=>s(...u)),R1i=rs.hasStandardBrowserEnv?((s,u)=>i=>(i=new URL(i,rs.origin),s.protocol===i.protocol&&s.host===i.host&&(u||s.port===i.port)))(new URL(rs.origin),rs.navigator&&/(msie|trident)/i.test(rs.navigator.userAgent)):()=>!0,w1i=rs.hasStandardBrowserEnv?{write(s,u,i,r,a,c,e){if(typeof document>"u")return;const f=[`${s}=${encodeURIComponent(u)}`];Je.isNumber(i)&&f.push(`expires=${new Date(i).toUTCString()}`),Je.isString(r)&&f.push(`path=${r}`),Je.isString(a)&&f.push(`domain=${a}`),c===!0&&f.push("secure"),Je.isString(e)&&f.push(`SameSite=${e}`),document.cookie=f.join("; ")},read(s){if(typeof document>"u")return null;const u=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return u?decodeURIComponent(u[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function D1i(s){return typeof s!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function C1i(s,u){return u?s.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):s}function hMe(s,u,i){let r=!D1i(u);return s&&(r||i==!1)?C1i(s,u):u}const EU=s=>s instanceof Uo?{...s}:s;function dy(s,u){u=u||{};const i={};function r(m,T,b,A){return Je.isPlainObject(m)&&Je.isPlainObject(T)?Je.merge.call({caseless:A},m,T):Je.isPlainObject(T)?Je.merge({},T):Je.isArray(T)?T.slice():T}function a(m,T,b,A){if(Je.isUndefined(T)){if(!Je.isUndefined(m))return r(void 0,m,b,A)}else return r(m,T,b,A)}function c(m,T){if(!Je.isUndefined(T))return r(void 0,T)}function e(m,T){if(Je.isUndefined(T)){if(!Je.isUndefined(m))return r(void 0,m)}else return r(void 0,T)}function f(m,T,b){if(b in u)return r(m,T);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,T,b)=>a(EU(m),EU(T),b,!0)};return Je.forEach(Object.keys({...s,...u}),function(T){if(T==="__proto__"||T==="constructor"||T==="prototype")return;const b=Je.hasOwnProp(h,T)?h[T]:a,A=b(s[T],u[T],T);Je.isUndefined(A)&&b!==f||(i[T]=A)}),i}const mMe=s=>{const u=dy({},s);let{data:i,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:c,headers:e,auth:f}=u;if(u.headers=e=Uo.from(e),u.url=pMe(hMe(u.baseURL,u.url,u.allowAbsoluteUrls),s.params,s.paramsSerializer),f&&e.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),Je.isFormData(i)){if(rs.hasStandardBrowserEnv||rs.hasStandardBrowserWebWorkerEnv)e.setContentType(void 0);else if(Je.isFunction(i.getHeaders)){const h=i.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([T,b])=>{m.includes(T.toLowerCase())&&e.set(T,b)})}}if(rs.hasStandardBrowserEnv&&(r&&Je.isFunction(r)&&(r=r(u)),r||r!==!1&&R1i(u.url))){const h=a&&c&&w1i.read(c);h&&e.set(a,h)}return u},O1i=typeof XMLHttpRequest<"u",_1i=O1i&&function(s){return new Promise(function(i,r){const a=mMe(s);let c=a.data;const e=Uo.from(a.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:m}=a,T,b,A,D,g;function w(){D&&D(),g&&g(),a.cancelToken&&a.cancelToken.unsubscribe(T),a.signal&&a.signal.removeEventListener("abort",T)}let $=new XMLHttpRequest;$.open(a.method.toUpperCase(),a.url,!0),$.timeout=a.timeout;function L(){if(!$)return;const k=Uo.from("getAllResponseHeaders"in $&&$.getAllResponseHeaders()),re={data:!f||f==="text"||f==="json"?$.responseText:$.response,status:$.status,statusText:$.statusText,headers:k,config:s,request:$};yMe(function(z){i(z),w()},function(z){r(z),w()},re),$=null}"onloadend"in $?$.onloadend=L:$.onreadystatechange=function(){!$||$.readyState!==4||$.status===0&&!($.responseURL&&$.responseURL.indexOf("file:")===0)||setTimeout(L)},$.onabort=function(){$&&(r(new Or("Request aborted",Or.ECONNABORTED,s,$)),$=null)},$.onerror=function(Y){const re=Y&&Y.message?Y.message:"Network Error",ie=new Or(re,Or.ERR_NETWORK,s,$);ie.event=Y||null,r(ie),$=null},$.ontimeout=function(){let Y=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const re=a.transitional||Z$;a.timeoutErrorMessage&&(Y=a.timeoutErrorMessage),r(new Or(Y,re.clarifyTimeoutError?Or.ETIMEDOUT:Or.ECONNABORTED,s,$)),$=null},c===void 0&&e.setContentType(null),"setRequestHeader"in $&&Je.forEach(e.toJSON(),function(Y,re){$.setRequestHeader(re,Y)}),Je.isUndefined(a.withCredentials)||($.withCredentials=!!a.withCredentials),f&&f!=="json"&&($.responseType=a.responseType),m&&([A,g]=DI(m,!0),$.addEventListener("progress",A)),h&&$.upload&&([b,D]=DI(h),$.upload.addEventListener("progress",b),$.upload.addEventListener("loadend",D)),(a.cancelToken||a.signal)&&(T=k=>{$&&(r(!k||k.type?new Eb(null,s,$):k),$.abort(),$=null)},a.cancelToken&&a.cancelToken.subscribe(T),a.signal&&(a.signal.aborted?T():a.signal.addEventListener("abort",T)));const V=A1i(a.url);if(V&&rs.protocols.indexOf(V)===-1){r(new Or("Unsupported protocol "+V+":",Or.ERR_BAD_REQUEST,s));return}$.send(c||null)})},P1i=(s,u)=>{const{length:i}=s=s?s.filter(Boolean):[];if(u||i){let r=new AbortController,a;const c=function(m){if(!a){a=!0,f();const T=m instanceof Error?m:this.reason;r.abort(T instanceof Or?T:new Eb(T instanceof Error?T.message:T))}};let e=u&&setTimeout(()=>{e=null,c(new Or(`timeout of ${u}ms exceeded`,Or.ETIMEDOUT))},u);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=()=>Je.asap(f),h}},N1i=P1i,x1i=function*(s,u){let i=s.byteLength;if(!u||i<u){yield s;return}let r=0,a;for(;r<i;)a=r+u,yield s.slice(r,a),r=a},V1i=async function*(s,u){for await(const i of $1i(s))yield*x1i(i,u)},$1i=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const u=s.getReader();try{for(;;){const{done:i,value:r}=await u.read();if(i)break;yield r}}finally{await u.cancel()}},bU=(s,u,i,r)=>{const a=V1i(s,u);let c=0,e,f=h=>{e||(e=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:T}=await a.next();if(m){f(),h.close();return}let b=T.byteLength;if(i){let A=c+=b;i(A)}h.enqueue(new Uint8Array(T))}catch(m){throw f(m),m}},cancel(h){return f(h),a.return()}},{highWaterMark:2})},AU=64*1024,{isFunction:Zg}=Je,L1i=(({Request:s,Response:u})=>({Request:s,Response:u}))(Je.global),{ReadableStream:gU,TextEncoder:IU}=Je.global,RU=(s,...u)=>{try{return!!s(...u)}catch{return!1}},B1i=s=>{s=Je.merge.call({skipUndefined:!0},L1i,s);const{fetch:u,Request:i,Response:r}=s,a=u?Zg(u):typeof fetch=="function",c=Zg(i),e=Zg(r);if(!a)return!1;const f=a&&Zg(gU),h=a&&(typeof IU=="function"?(g=>w=>g.encode(w))(new IU):async g=>new Uint8Array(await new i(g).arrayBuffer())),m=c&&f&&RU(()=>{let g=!1;const w=new i(rs.origin,{body:new gU,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!w}),T=e&&f&&RU(()=>Je.isReadableStream(new r("").body)),b={stream:T&&(g=>g.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!b[g]&&(b[g]=(w,$)=>{let L=w&&w[g];if(L)return L.call(w);throw new Or(`Response type '${g}' is not supported`,Or.ERR_NOT_SUPPORT,$)})});const A=async g=>{if(g==null)return 0;if(Je.isBlob(g))return g.size;if(Je.isSpecCompliantForm(g))return(await new i(rs.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(Je.isArrayBufferView(g)||Je.isArrayBuffer(g))return g.byteLength;if(Je.isURLSearchParams(g)&&(g=g+""),Je.isString(g))return(await h(g)).byteLength},D=async(g,w)=>{const $=Je.toFiniteNumber(g.getContentLength());return $??A(w)};return async g=>{let{url:w,method:$,data:L,signal:V,cancelToken:k,timeout:Y,onDownloadProgress:re,onUploadProgress:ie,responseType:z,headers:te,withCredentials:oe="same-origin",fetchOptions:Q}=mMe(g),H=u||fetch;z=z?(z+"").toLowerCase():"text";let se=N1i([V,k&&k.toAbortSignal()],Y),ce=null;const le=se&&se.unsubscribe&&(()=>{se.unsubscribe()});let he;try{if(ie&&m&&$!=="get"&&$!=="head"&&(he=await D(te,L))!==0){let Be=new i(w,{method:"POST",body:L,duplex:"half"}),Ce;if(Je.isFormData(L)&&(Ce=Be.headers.get("content-type"))&&te.setContentType(Ce),Be.body){const[qe,Xe]=TU(he,DI(vU(ie)));L=bU(Be.body,AU,qe,Xe)}}Je.isString(oe)||(oe=oe?"include":"omit");const ve=c&&"credentials"in i.prototype,ge={...Q,signal:se,method:$.toUpperCase(),headers:te.normalize().toJSON(),body:L,duplex:"half",credentials:ve?oe:void 0};ce=c&&new i(w,ge);let Ie=await(c?H(ce,Q):H(w,ge));const ke=T&&(z==="stream"||z==="response");if(T&&(re||ke&&le)){const Be={};["status","statusText","headers"].forEach(Ye=>{Be[Ye]=Ie[Ye]});const Ce=Je.toFiniteNumber(Ie.headers.get("content-length")),[qe,Xe]=re&&TU(Ce,DI(vU(re),!0))||[];Ie=new r(bU(Ie.body,AU,qe,()=>{Xe&&Xe(),le&&le()}),Be)}z=z||"text";let Me=await b[Je.findKey(b,z)||"text"](Ie,g);return!ke&&le&&le(),await new Promise((Be,Ce)=>{yMe(Be,Ce,{data:Me,headers:Uo.from(Ie.headers),status:Ie.status,statusText:Ie.statusText,config:g,request:ce})})}catch(ve){throw le&&le(),ve&&ve.name==="TypeError"&&/Load failed|fetch/i.test(ve.message)?Object.assign(new Or("Network Error",Or.ERR_NETWORK,g,ce,ve&&ve.response),{cause:ve.cause||ve}):Or.from(ve,ve&&ve.code,g,ce,ve&&ve.response)}}},M1i=new Map,TMe=s=>{let u=s&&s.env||{};const{fetch:i,Request:r,Response:a}=u,c=[r,a,i];let e=c.length,f=e,h,m,T=M1i;for(;f--;)h=c[f],m=T.get(h),m===void 0&&T.set(h,m=f?new Map:B1i(u)),T=m;return m};TMe();const J$={http:YRi,xhr:_1i,fetch:{get:TMe}};Je.forEach(J$,(s,u)=>{if(s){try{Object.defineProperty(s,"name",{value:u})}catch{}Object.defineProperty(s,"adapterName",{value:u})}});const wU=s=>`- ${s}`,G1i=s=>Je.isFunction(s)||s===null||s===!1;function k1i(s,u){s=Je.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,!G1i(r)&&(a=J$[(f=String(r)).toLowerCase()],a===void 0))throw new Or(`Unknown adapter '${f}'`);if(a&&(Je.isFunction(a)||(a=a.get(u))))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(wU).join(`
|
|
53
53
|
`):" "+wU(e[0]):"as no adapter specified";throw new Or("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return a}const vMe={getAdapter:k1i,adapters:J$};function j_(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Eb(null,s)}function DU(s){return j_(s),s.headers=Uo.from(s.headers),s.data=k_.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),vMe.getAdapter(s.adapter||z$.adapter,s)(s).then(function(r){return j_(s),r.data=k_.call(s,s.transformResponse,r),r.headers=Uo.from(r.headers),r},function(r){return fMe(r)||(j_(s),r&&r.response&&(r.response.data=k_.call(s,s.transformResponse,r.response),r.response.headers=Uo.from(r.response.headers))),Promise.reject(r)})}const EMe="1.13.6",hw={};["object","boolean","number","function","string","symbol"].forEach((s,u)=>{hw[s]=function(r){return typeof r===s||"a"+(u<1?"n ":" ")+s}});const CU={};hw.transitional=function(u,i,r){function a(c,e){return"[Axios v"+EMe+"] Transitional option '"+c+"'"+e+(r?". "+r:"")}return(c,e,f)=>{if(u===!1)throw new Or(a(e," has been removed"+(i?" in "+i:"")),Or.ERR_DEPRECATED);return i&&!CU[e]&&(CU[e]=!0,console.warn(a(e," has been deprecated since v"+i+" and will be removed in the near future"))),u?u(c,e,f):!0}};hw.spelling=function(u){return(i,r)=>(console.warn(`${r} is likely a misspelling of ${u}`),!0)};function j1i(s,u,i){if(typeof s!="object")throw new Or("options must be an object",Or.ERR_BAD_OPTION_VALUE);const r=Object.keys(s);let a=r.length;for(;a-- >0;){const c=r[a],e=u[c];if(e){const f=s[c],h=f===void 0||e(f,c,s);if(h!==!0)throw new Or("option "+c+" must be "+h,Or.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Or("Unknown option "+c,Or.ERR_BAD_OPTION)}}const nI={assertOptions:j1i,validators:hw},Jl=nI.validators;class CI{constructor(u){this.defaults=u||{},this.interceptors={request:new hU,response:new hU}}async request(u,i){try{return await this._request(u,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(u,i){typeof u=="string"?(i=i||{},i.url=u):i=u||{},i=dy(this.defaults,i);const{transitional:r,paramsSerializer:a,headers:c}=i;r!==void 0&&nI.assertOptions(r,{silentJSONParsing:Jl.transitional(Jl.boolean),forcedJSONParsing:Jl.transitional(Jl.boolean),clarifyTimeoutError:Jl.transitional(Jl.boolean),legacyInterceptorReqResOrdering:Jl.transitional(Jl.boolean)},!1),a!=null&&(Je.isFunction(a)?i.paramsSerializer={serialize:a}:nI.assertOptions(a,{encode:Jl.function,serialize:Jl.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nI.assertOptions(i,{baseUrl:Jl.spelling("baseURL"),withXsrfToken:Jl.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=c&&Je.merge(c.common,c[i.method]);c&&Je.forEach(["delete","get","head","post","put","patch","common"],g=>{delete c[g]}),i.headers=Uo.concat(e,c);const f=[];let h=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(i)===!1)return;h=h&&w.synchronous;const $=i.transitional||Z$;$&&$.legacyInterceptorReqResOrdering?f.unshift(w.fulfilled,w.rejected):f.push(w.fulfilled,w.rejected)});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let T,b=0,A;if(!h){const g=[DU.bind(this),void 0];for(g.unshift(...f),g.push(...m),A=g.length,T=Promise.resolve(i);b<A;)T=T.then(g[b++],g[b++]);return T}A=f.length;let D=i;for(;b<A;){const g=f[b++],w=f[b++];try{D=g(D)}catch($){w.call(this,$);break}}try{T=DU.call(this,D)}catch(g){return Promise.reject(g)}for(b=0,A=m.length;b<A;)T=T.then(m[b++],m[b++]);return T}getUri(u){u=dy(this.defaults,u);const i=hMe(u.baseURL,u.url,u.allowAbsoluteUrls);return pMe(i,u.params,u.paramsSerializer)}}Je.forEach(["delete","get","head","options"],function(u){CI.prototype[u]=function(i,r){return this.request(dy(r||{},{method:u,url:i,data:(r||{}).data}))}});Je.forEach(["post","put","patch"],function(u){function i(r){return function(c,e,f){return this.request(dy(f||{},{method:u,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:e}))}}CI.prototype[u]=i(),CI.prototype[u+"Form"]=i(!0)});const aI=CI;class Y${constructor(u){if(typeof u!="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},u(function(c,e,f){r.reason||(r.reason=new Eb(c,e,f),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const i=this._listeners.indexOf(u);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const u=new AbortController,i=r=>{u.abort(r)};return this.subscribe(i),u.signal.unsubscribe=()=>this.unsubscribe(i),u.signal}static source(){let u;return{token:new Y$(function(a){u=a}),cancel:u}}}const U1i=Y$;function F1i(s){return function(i){return s.apply(null,i)}}function K1i(s){return Je.isObject(s)&&s.isAxiosError===!0}const OP={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(OP).forEach(([s,u])=>{OP[u]=s});const S1i=OP;function bMe(s){const u=new aI(s),i=tMe(aI.prototype.request,u);return Je.extend(i,aI.prototype,u,{allOwnKeys:!0}),Je.extend(i,u,null,{allOwnKeys:!0}),i.create=function(a){return bMe(dy(s,a))},i}const va=bMe(z$);va.Axios=aI;va.CanceledError=Eb;va.CancelToken=U1i;va.isCancel=fMe;va.VERSION=EMe;va.toFormData=fw;va.AxiosError=Or;va.Cancel=va.CanceledError;va.all=function(u){return Promise.all(u)};va.spread=F1i;va.isAxiosError=K1i;va.mergeConfig=dy;va.AxiosHeaders=Uo;va.formToJSON=s=>cMe(Je.isHTMLForm(s)?new FormData(s):s);va.getAdapter=vMe.getAdapter;va.HttpStatusCode=S1i;va.default=va;const ds=va;class AMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(qn.HttpRequest);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h;try{const m=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.method.id}),T=((a=m==null?void 0:m.value)==null?void 0:a.value)||"",b=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.url.id}),A=((c=b==null?void 0:b.value)==null?void 0:c.value)||"",D=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.query.id}),g=(e=D==null?void 0:D.value)==null?void 0:e.value,w=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.body.id}),$=(f=w==null?void 0:w.value)==null?void 0:f.value,L=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.headers.id}),V=(h=L==null?void 0:L.value)==null?void 0:h.value,k={method:T,url:A};g!==void 0&&g!==""&&(k.params=g),V!==void 0&&V!==""&&(k.headers=V),$!==void 0&&$!==""&&(k.data=$),ee.Logger.log("Axios request config: ",k);const Y=await ds(k);return{value:F.Success,error:null,result:{status:Y.status,headers:Y.headers,data:Y.data}}}catch(m){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:m,result:null}}}})}}class gMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL,version:"1.0.0",description:"Execute SQL operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(jo.ExecuteSQL);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[jo.ExecuteSQL].inputs.connectionConfig.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[jo.ExecuteSQL].inputs.query.id}),T=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],A=await ds.post(((e=b.env)==null?void 0:e.API_BASE_URL)+"/editor-runtime/v1/execute-sql",{connectionConfig:h,query:T},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${await b.getAccessToken()}`}});return{value:F.Success,error:null,result:{results:A.data.results||[]}}}catch(f){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:f,result:null}}}})}}class IMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.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)});ee.Logger.log("Inputs for entity validation: ",a);const e=sD(a[1]).safeParse(a[0]);return e.success?{value:F.Success,error:null,result:{data:a[0]}}:{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e.error.errors,result:null}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class RMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY,version:"1.0.0",description:"Entity read-key operation implementation module (top-level)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.ReadKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=eNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class wMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY,version:"1.0.0",description:"Entity write-key operation implementation module (top-level, immutable)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.WriteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteKey].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteKey].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteKey].inputs.value.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=tNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class DMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY,version:"1.0.0",description:"Entity delete-key operation implementation module (top-level, immutable)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.DeleteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=iNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class CMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY,version:"1.0.0",description:"Entity read-nested-key operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.ReadNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadNestedKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadNestedKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=rNe(m,b,void 0);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class OMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.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:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.WriteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteNestedKey].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteNestedKey].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteNestedKey].inputs.value.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=nNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class _Me extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.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:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.WriteSafeNestedKeyRecursively);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteSafeNestedKeyRecursively].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteSafeNestedKeyRecursively].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteSafeNestedKeyRecursively].inputs.value.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=aNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class PMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY,version:"1.0.0",description:"Entity delete-nested-key operation implementation module (immutable)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.DeleteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteNestedKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteNestedKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=sNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class NMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY,version:"1.0.0",description:"Object has-key (top-level property present?)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.HasKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=lNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class xMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object key-value-equals (top-level property strict equality)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.KeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.KeyValueEquals].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.KeyValueEquals].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.KeyValueEquals].inputs.expectedValue.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=oNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class VMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY,version:"1.0.0",description:"Object has-nested-key (path present?)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.HasNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasNestedKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasNestedKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=dNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class $Me extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object nested-key-value-equals (path strict equality)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.NestedKeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.NestedKeyValueEquals].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.NestedKeyValueEquals].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.NestedKeyValueEquals].inputs.expectedValue.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=uNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class LMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE,version:"1.0.0",description:"Object is-instance-of-type (DefinitionEntity-based runtime check)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.IsInstanceOfType);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D;try{const g=((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),w=(m=(h=r[0])==null?void 0:h.value)==null?void 0:m.value,$=(b=(T=r[1])==null?void 0:T.value)==null?void 0:b.valueAsTypeSingle;if(!w)throw new TypeError("IsInstanceOfType expects a non-null input value.");if(!$)throw new TypeError("IsInstanceOfType expects a valid expectedType input.");if(!g)throw new TypeError("IsInstanceOfType cannot determine the value owner.");if($.type!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType expects expectedType to be a DefinitionEntity.");const L=g.getDataType(null);if(((A=L==null?void 0:L.entity)==null?void 0:A.type)!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType cannot determine the data type of the input value.");let V=!1;return((D=L==null?void 0:L.entity)==null?void 0:D.id)!==($==null?void 0:$.id)?V=!1:sD(L==null?void 0:L.entity).safeParse(w).success?V=!0:V=!1,{value:F.Success,error:null,result:V}}catch(g){return{value:F.UnhandledError,error:g,result:null}}}})}}class BMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE,version:"1.0.0",description:"Object merge operation implementation module (immutable, shallow merge with right-precedence)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Merge);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const c=r.filter(f=>{var h,m;return((m=(h=f.valueOwner)==null?void 0:h.declaration)==null?void 0:m.id)===j.operation[Oe.Merge].inputs.left.id}).map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=pNe(...c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class MMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS,version:"1.0.0",description:"Object keys operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Keys);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[Oe.Keys].inputs.objectValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=cNe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}class GMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES,version:"1.0.0",description:"Object values operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Values);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[Oe.Values].inputs.objectValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=fNe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}class kMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES,version:"1.0.0",description:"Object entries operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Entries);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[Oe.Entries].inputs.objectValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=yNe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}let Il=null;try{Il=require("crypto")}catch{}const Bv=typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle?globalThis.crypto:Il&&Il.webcrypto?Il.webcrypto:null,lc=Bv?Bv.subtle:null;function zv(s){const u=new ArrayBuffer(s.byteLength);return new Uint8Array(u).set(s),u}function kn(s,u="utf8"){if(s instanceof Uint8Array)return s;const i=String(s);if(u==="utf8"){if(typeof TextEncoder<"u")return new TextEncoder().encode(i);if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"utf8"))}else if(u==="hex"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"hex"))}else if(u==="base64"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"base64"))}else if(u==="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(${u})`)}function bd(s,u="utf8"){if(u==="utf8"){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf8")}else if(u==="hex"){if(typeof Buffer<"u")return Buffer.from(s).toString("hex")}else if(u==="base64"){if(typeof Buffer<"u")return Buffer.from(s).toString("base64")}else if(u==="base64url"&&typeof Buffer<"u")return Buffer.from(s).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");throw new Error(`Unsupported environment/encoding combo for fromBytes(${u})`)}const jMe=s=>kn(s,"base64"),UMe=(s,u)=>{const i=s instanceof Uint8Array?s:kn(String(s),u||"utf8");return bd(i,"base64")},om=(s,u)=>{const i=s instanceof Uint8Array?s:kn(String(s),u||"utf8");return bd(i,"base64url")},uy=s=>kn(s,"base64url"),FMe=(s,u)=>{const i=s instanceof Uint8Array?s:kn(String(s),u||"utf8");return bd(i,"hex")},KMe=s=>kn(s,"hex");function Q$(s){if(Bv&&Bv.getRandomValues){const u=new Uint8Array(s);return Bv.getRandomValues(u),u}if(Il&&Il.randomBytes)return new Uint8Array(Il.randomBytes(s));throw new Error("Secure random not available")}function mw(s,u){if(!(s instanceof Uint8Array)||!(u instanceof Uint8Array)||s.length!==u.length)return!1;let i=0;for(let r=0;r<s.length;r++)i|=s[r]^u[r];return i===0}function SMe(s,u,i,r){if((typeof s!="string"||typeof u!="string")&&typeof s!="string"&&typeof u!="string")throw new Error("Invalid input types");const a=i??"utf8",c=r??"utf8",e=kn(s??"",a),f=kn(u??"",c);return mw(e,f)}async function qMe(s,u){if(lc){const i=await lc.digest({name:s},zv(u));return new Uint8Array(i)}if(Il){const i=s.replace("SHA-","sha"),r=Il.createHash(i);return r.update(Buffer.from(u)),new Uint8Array(r.digest())}throw new Error("Hash not available")}async function ZMe(s,u,i,r){if(typeof u!="string")throw new Error("Invalid input type for data; expected string");const a=String(s??"SHA-256"),c=i??"utf8",e=r??"base64url",f=kn(u??"",c),h=await qMe(a,f);return bd(h,e)}async function Tw(s,u,i){if(lc){const r=await lc.importKey("raw",zv(u),{name:"HMAC",hash:{name:s}},!1,["sign"]),a=await lc.sign("HMAC",r,zv(i));return new Uint8Array(a)}if(Il){const r=`sha${s.split("-")[1]}`,a=Il.createHmac(r,Buffer.from(u));return a.update(Buffer.from(i)),new Uint8Array(a.digest())}throw new Error("HMAC not available")}async function HMe(s,u,i,r,a,c){if(typeof s!="string"||typeof u!="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",T=kn(s??"",f),b=kn(u??"",h),A=await Tw(e,T,b);return bd(A,m)}async function vw(s,u,{iterations:i,length:r,hashAlg:a="SHA-256"}){if(lc){const c=await lc.importKey("raw",zv(s),"PBKDF2",!1,["deriveBits"]),e=await lc.deriveBits({name:"PBKDF2",salt:zv(u),iterations:i,hash:a},c,r*8);return new Uint8Array(e)}if(Il){const c=a==="SHA-512"?"sha512":"sha256";return await new Promise((e,f)=>{Il.pbkdf2(Buffer.from(s),Buffer.from(u),i,r,c,(h,m)=>{h?f(h):e(new Uint8Array(m))})})}throw new Error("PBKDF2 not available")}async function WMe(s,u,i,r,a,c,e,f){if(typeof s!="string"||typeof u!="string")throw new Error("Invalid input types for password or salt; expected strings");const h=c??"utf8",m=e??"utf8",T=f??"base64url",b=Math.max(1,Number(i)||21e4),A=Math.max(1,Number(r)||32),D=a??"SHA-256",g=kn(s??"",h),w=kn(u??"",m),$=await vw(g,w,{iterations:b,length:A,hashAlg:D});return bd($,T)}async function zMe(s,u=Q$(16),i=21e4,r=32,a="SHA-256"){const c=kn(s,"utf8"),e=await vw(c,u,{iterations:i,length:r,hashAlg:a}),f=om(u),h=om(e);return`pbkdf2$${a.toLowerCase()}$${i}$${f}$${h}`}async function JMe(s,u){const i=String(u).split("$");if(i.length!==5||i[0]!=="pbkdf2")return!1;const r=i[1].toLowerCase(),a=parseInt(i[2],10),c=uy(i[3]),e=uy(i[4]),f=r.includes("512")?"SHA-512":"SHA-256",h=await vw(kn(s,"utf8"),c,{iterations:a,length:e.length,hashAlg:f});return mw(h,e)}async function YMe(s,u,i,r,a,c){const e=u!=null?Math.max(1,Number(u)||0):void 0,f=i!=null?Math.max(1,Number(i)||0):void 0,h=r??void 0,m=c??"base64url",T=a!=null?kn(a,m):void 0;return await zMe(String(s??""),T,e,f,h)}function OU(s){return om(kn(JSON.stringify(s),"utf8"))}function OI(s){try{return JSON.parse(bd(uy(s),"utf8"))}catch{return null}}async function QMe(s,u,{alg:i="HS256",includeIat:r=!0,expiresInSeconds:a,notBeforeSeconds:c,issuer:e,subject:f,audience:h,jwtid:m,header:T={}}={}){const b={alg:i,typ:"JWT",...T},A=Math.floor(Date.now()/1e3),D={...s||{}};r&&(D.iat=A),typeof a=="number"&&(D.exp=A+a),typeof c=="number"&&(D.nbf=A+c),e&&(D.iss=e),f&&(D.sub=f),h&&(D.aud=h),m&&(D.jti=m);const g=OU(b),w=OU(D),$=kn(`${g}.${w}`,"utf8"),V=await Tw(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",u,$),k=om(V);return`${g}.${w}.${k}`}async function XMe(s,u,i,r,a,c,e,f,h,m,T,b){if(typeof u!="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(T!=null&&typeof T!="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 D=kn(u??"",b??"utf8");return await QMe(s??{},D,{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:T??void 0})}async function e2e(s,u,{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 T=OI(f),b=OI(h);if(!T||!b)return{valid:!1,header:T,payload:b,reason:"Bad base64/json"};if(T.alg!==i)return{valid:!1,header:T,payload:b,reason:"Alg mismatch"};const A=kn(`${f}.${h}`,"utf8"),g=await Tw(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",u,A),w=uy(m);if(!mw(g,w))return{valid:!1,header:T,payload:b,reason:"Bad signature"};const $=Math.floor(Date.now()/1e3),L=Math.max(0,Number(e)||0);if(b.nbf!=null&&$+L<Number(b.nbf))return{valid:!1,header:T,payload:b,reason:"Not before"};if(b.exp!=null&&$-L>=Number(b.exp))return{valid:!1,header:T,payload:b,reason:"Expired"};if(r&&b.iss!==r)return{valid:!1,header:T,payload:b,reason:"Issuer mismatch"};if(a){const V=b.aud;if(!(Array.isArray(V)?V.includes(a):V===a))return{valid:!1,header:T,payload:b,reason:"Audience mismatch"}}return c!=null&&b.iat!=null&&$-Number(b.iat)>Number(c)+L?{valid:!1,header:T,payload:b,reason:"MaxAge exceeded"}:{valid:!0,header:T,payload:b}}catch(f){return{valid:!1,header:null,payload:null,reason:String((f==null?void 0:f.message)??f)}}}async function t2e(s,u,i,r,a,c,e,f){if(typeof s!="string")throw new Error("Invalid input type for token; expected string");if(typeof u!="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=kn(u??"",f??"utf8");return await e2e(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 i2e(s){const[u,i,r]=String(s).split(".");return{header:u?OI(u):null,payload:i?OI(i):null,signature:r?uy(r):new Uint8Array}}function r2e(s,u){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=u??"base64url",{header:r,payload:a,signature:c}=i2e(String(s??"")),e=bd(c,i);return{header:r,payload:a,signature:e}}class n2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES,version:"1.0.0",description:"Randomness generate random bytes operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(at.GenerateRandomBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var L,V;return((V=(L=$.valueOwner)==null?void 0:L.declaration)==null?void 0:V.id)===j.operation[at.GenerateRandomBytes].inputs.length.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find($=>{var L,V;return((V=(L=$.valueOwner)==null?void 0:L.declaration)==null?void 0:V.id)===j.operation[at.GenerateRandomBytes].inputs.outputEncoding.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=Math.max(0,Number(m)||0),D=b??"base64url",g=Q$(A),w=bd(g,D);return{value:F.Success,error:null,result:w}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class a2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomInteger);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateRandomInteger].inputs.min.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateRandomInteger].inputs.max.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=BPe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class s2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomFloat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=nw();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class l2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomHexadecimal);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomHexadecimal].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=C$(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class o2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomBase62);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomBase62].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=O$(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class d2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomBase64].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=GPe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class u2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomAlphanumeric);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomAlphanumeric].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=_$(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class p2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateIdentifier);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateIdentifier].inputs.length.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateIdentifier].inputs.alphabet.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=P$(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class c2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomUUIDv4);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=sc();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class f2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{ee.Logger.log("Initializing Random Generate Short Identifier Module");const r=i.find(a=>a.contextType===de.Logic);if(r){ee.Logger.log("Project state found, setting up operation");const a=r.get(at.GenerateShortIdentifier);a?(ee.Logger.log("Operation found, setting autoexecutable and implementation"),a.autoexecutable=!0,a.implementation=this.module.main):ee.Logger.warn("Operation generate-short-identifier not found in project state")}else ee.Logger.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,r)=>{try{const a=kPe();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class y2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateHexadecimalToken);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=jPe();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}function q1i(s){let u;if(s===null?u="null":Array.isArray(s)?u="array":u=typeof s,!["string","number","boolean","null","object","array"].includes(u))throw new TypeError("GetTypeOf cannot determine type of the given value.");return u}class h2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF,version:"1.0.0",description:"Data type get type of operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(et.GetTypeOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===j.operation[et.GetTypeOf].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:F.Success,error:null,result:q1i(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class m2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING,version:"1.0.0",description:"Coerce any value to string via JS String(value)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.ToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.ToString].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=String(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class T2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER,version:"1.0.0",description:"Coerce to number via JS Number(value)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.ToNumber);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.ToNumber].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Number(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class v2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES,version:"1.0.0",description:"Convert string/bytes-like to Uint8Array (utf8|hex|base64|base64url)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.ToBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.ToBytes].inputs.input.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.ToBytes].inputs.encoding.id}),A=(((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value))||"utf8",D=kn(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class E2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING,version:"1.0.0",description:"Convert Uint8Array to string (utf8|hex|base64|base64url)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.FromBytesToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.FromBytesToString].inputs.bytes.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.FromBytesToString].inputs.encoding.id}),A=(((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value))||"utf8",D=bd(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class b2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64,version:"1.0.0",description:"Bytes -> base64 string (accepts string input by converting from utf8)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.EncodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===j.operation[et.EncodeBase64].inputs.bytes.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:F.Success,error:null,result:UMe(f,void 0)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class A2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64,version:"1.0.0",description:"base64 string -> bytes (Uint8Array)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.DecodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.DecodeBase64].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jMe(String(f));return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class g2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL,version:"1.0.0",description:"Bytes -> base64url string (accepts string input by converting from utf8)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.EncodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.EncodeBase64Url].inputs.bytes.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=om(f,"utf8");return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class I2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL,version:"1.0.0",description:"base64url string -> bytes (Uint8Array)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.DecodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.DecodeBase64Url].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=uy(String(f));return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class R2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX,version:"1.0.0",description:"Bytes -> hex string (accepts string input by converting from utf8)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.EncodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.EncodeHex].inputs.bytes.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=FMe(f,"utf8");return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class w2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX,version:"1.0.0",description:"hex string -> bytes (Uint8Array)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.DecodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.DecodeHex].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=KMe(String(f));return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class D2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH,version:"1.0.0",description:"Crypto: Hash (SHA-256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.Hash);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b;try{const A=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.alg.id}),D=((a=A==null?void 0:A.value)==null?void 0:a.valueAsType)??((c=A==null?void 0:A.value)==null?void 0:c.value),g=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.inputEncoding.id}),w=((e=g==null?void 0:g.value)==null?void 0:e.valueAsType)??((f=g==null?void 0:g.value)==null?void 0:f.value),$=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.data.id}),L=((h=$==null?void 0:$.value)==null?void 0:h.valueAsType)??((m=$==null?void 0:$.value)==null?void 0:m.value),V=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.outputEncoding.id}),k=((T=V==null?void 0:V.value)==null?void 0:T.valueAsType)??((b=V==null?void 0:V.value)==null?void 0:b.value);return{value:F.Success,error:null,result:ZMe(D,w,L,k)}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class C2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC,version:"1.0.0",description:"Crypto: HMAC (SHA-256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.Hmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w;try{const $=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.alg.id}),L=((a=$==null?void 0:$.value)==null?void 0:a.valueAsType)??((c=$==null?void 0:$.value)==null?void 0:c.value),V=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.dataEncoding.id}),k=((e=V==null?void 0:V.value)==null?void 0:e.valueAsType)??((f=V==null?void 0:V.value)==null?void 0:f.value),Y=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.data.id}),re=((h=Y==null?void 0:Y.value)==null?void 0:h.valueAsType)??((m=Y==null?void 0:Y.value)==null?void 0:m.value),ie=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.keyEncoding.id}),z=((T=ie==null?void 0:ie.value)==null?void 0:T.valueAsType)??((b=ie==null?void 0:ie.value)==null?void 0:b.value),te=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.key.id}),oe=((A=te==null?void 0:te.value)==null?void 0:A.valueAsType)??((D=te==null?void 0:te.value)==null?void 0:D.value),Q=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.outputEncoding.id}),H=((g=Q==null?void 0:Q.value)==null?void 0:g.valueAsType)??((w=Q==null?void 0:Q.value)==null?void 0:w.value);return{value:F.Success,error:null,result:HMe(k,re,L,z,oe,H)}}catch($){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:$,result:null}}}})}}class O2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL,version:"1.0.0",description:"Crypto: constant-time equality for byte sequences",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.ConstantTimeEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b;try{const A=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.aEncoding.id}),D=((a=A==null?void 0:A.value)==null?void 0:a.valueAsType)??((c=A==null?void 0:A.value)==null?void 0:c.value),g=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.a.id}),w=((e=g==null?void 0:g.value)==null?void 0:e.valueAsType)??((f=g==null?void 0:g.value)==null?void 0:f.value),$=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.bEncoding.id}),L=((h=$==null?void 0:$.value)==null?void 0:h.valueAsType)??((m=$==null?void 0:$.value)==null?void 0:m.value),V=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.b.id}),k=((T=V==null?void 0:V.value)==null?void 0:T.valueAsType)??((b=V==null?void 0:V.value)==null?void 0:b.value);return{value:F.Success,error:null,result:SMe(D,w,L,k)}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class _2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2,version:"1.0.0",description:"Crypto: derive key with PBKDF2 (SHA-256/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.DeriveKeyPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k;try{const Y=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.passwordEncoding.id}),re=((a=Y==null?void 0:Y.value)==null?void 0:a.valueAsType)??((c=Y==null?void 0:Y.value)==null?void 0:c.value),ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.password.id}),z=((e=ie==null?void 0:ie.value)==null?void 0:e.valueAsType)??((f=ie==null?void 0:ie.value)==null?void 0:f.value),te=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.saltEncoding.id}),oe=((h=te==null?void 0:te.value)==null?void 0:h.valueAsType)??((m=te==null?void 0:te.value)==null?void 0:m.value),Q=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.salt.id}),H=((T=Q==null?void 0:Q.value)==null?void 0:T.valueAsType)??((b=Q==null?void 0:Q.value)==null?void 0:b.value),se=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.iterations.id}),ce=((A=se==null?void 0:se.value)==null?void 0:A.valueAsType)??((D=se==null?void 0:se.value)==null?void 0:D.value),le=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.outputEncoding.id}),he=((g=le==null?void 0:le.value)==null?void 0:g.valueAsType)??((w=le==null?void 0:le.value)==null?void 0:w.value),ve=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.length.id}),ge=(($=ve==null?void 0:ve.value)==null?void 0:$.valueAsType)??((L=ve==null?void 0:ve.value)==null?void 0:L.value),Ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.hashAlg.id}),ke=((V=Ie==null?void 0:Ie.value)==null?void 0:V.valueAsType)??((k=Ie==null?void 0:Ie.value)==null?void 0:k.value);return{value:F.Success,error:null,result:WMe(re,z,oe,H,ce,he,ge,ke)}}catch(Y){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:Y,result:null}}}})}}class P2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE,version:"1.0.0",description:"Json parse string into object operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Hn.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:F.Success,error:null,result:e}}catch(c){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:c,result:null}}}})}}class N2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY,version:"1.0.0",description:"Json stringify object into string operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Hn.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:F.Success,error:null,result:m}}const h=JSON.stringify(e,null,f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class x2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC,version:"1.0.0",description:"JWT: build (HS256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(gi.BuildJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H;try{const se=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.header.id}),ce=((a=se==null?void 0:se.value)==null?void 0:a.valueAsType)??((c=se==null?void 0:se.value)==null?void 0:c.value),le=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.payload.id}),he=((e=le==null?void 0:le.value)==null?void 0:e.valueAsType)??((f=le==null?void 0:le.value)==null?void 0:f.value),ve=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.secret.id}),ge=((h=ve==null?void 0:ve.value)==null?void 0:h.valueAsType)??((m=ve==null?void 0:ve.value)==null?void 0:m.value),Ie=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.alg.id}),ke=((T=Ie==null?void 0:Ie.value)==null?void 0:T.valueAsType)??((b=Ie==null?void 0:Ie.value)==null?void 0:b.value),Me=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.includeIat.id}),Be=((A=Me==null?void 0:Me.value)==null?void 0:A.valueAsType)??((D=Me==null?void 0:Me.value)==null?void 0:D.value),Ce=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.expiresInSec.id}),qe=((g=Ce==null?void 0:Ce.value)==null?void 0:g.valueAsType)??((w=Ce==null?void 0:Ce.value)==null?void 0:w.value),Xe=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.notBeforeSec.id}),Ye=(($=Xe==null?void 0:Xe.value)==null?void 0:$.valueAsType)??((L=Xe==null?void 0:Xe.value)==null?void 0:L.value),ft=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.issuer.id}),$t=((V=ft==null?void 0:ft.value)==null?void 0:V.valueAsType)??((k=ft==null?void 0:ft.value)==null?void 0:k.value),mt=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.subject.id}),lt=((Y=mt==null?void 0:mt.value)==null?void 0:Y.valueAsType)??((re=mt==null?void 0:mt.value)==null?void 0:re.value),dt=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.audience.id}),vi=((ie=dt==null?void 0:dt.value)==null?void 0:ie.valueAsType)??((z=dt==null?void 0:dt.value)==null?void 0:z.value),Bi=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.secretEncoding.id}),gt=((te=Bi==null?void 0:Bi.value)==null?void 0:te.valueAsType)??((oe=Bi==null?void 0:Bi.value)==null?void 0:oe.value),ot=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.jwtid.id}),Xt=((Q=ot==null?void 0:ot.value)==null?void 0:Q.valueAsType)??((H=ot==null?void 0:ot.value)==null?void 0:H.value);return{value:F.Success,error:null,result:await XMe(ce,he,ge,ke,Be,qe,Ye,$t,lt,vi,gt,Xt)}}catch(se){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:se,result:null}}}})}}class V2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC,version:"1.0.0",description:"JWT: verify (HS256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(gi.VerifyJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k;try{const Y=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.token.id}),re=((a=Y==null?void 0:Y.value)==null?void 0:a.valueAsType)??((c=Y==null?void 0:Y.value)==null?void 0:c.value),ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.secret.id}),z=((e=ie==null?void 0:ie.value)==null?void 0:e.valueAsType)??((f=ie==null?void 0:ie.value)==null?void 0:f.value),te=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.alg.id}),oe=((h=te==null?void 0:te.value)==null?void 0:h.valueAsType)??((m=te==null?void 0:te.value)==null?void 0:m.value),Q=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.secretEncoding.id}),H=((T=Q==null?void 0:Q.value)==null?void 0:T.valueAsType)??((b=Q==null?void 0:Q.value)==null?void 0:b.value),se=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.issuer.id}),ce=((A=se==null?void 0:se.value)==null?void 0:A.valueAsType)??((D=se==null?void 0:se.value)==null?void 0:D.value),le=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.subject.id}),he=((g=le==null?void 0:le.value)==null?void 0:g.valueAsType)??((w=le==null?void 0:le.value)==null?void 0:w.value),ve=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.audience.id}),ge=(($=ve==null?void 0:ve.value)==null?void 0:$.valueAsType)??((L=ve==null?void 0:ve.value)==null?void 0:L.value),Ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.maxAgeSeconds.id}),ke=((V=Ie==null?void 0:Ie.value)==null?void 0:V.valueAsType)??((k=Ie==null?void 0:Ie.value)==null?void 0:k.value);return{value:F.Success,error:null,result:await t2e(re,z,oe,H,ce,he,ge,ke)}}catch(Y){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:Y,result:null}}}})}}class $2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE,version:"1.0.0",description:"JWT: decode (no verification)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(gi.DecodeJwt);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(A=>{var D,g;return((g=(D=A.valueOwner)==null?void 0:D.declaration)==null?void 0:g.id)===j.operation[gi.DecodeJwt].inputs.token.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(A=>{var D,g;return((g=(D=A.valueOwner)==null?void 0:D.declaration)==null?void 0:g.id)===j.operation[gi.DecodeJwt].inputs.signatureOutputEncoding.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value);return{value:F.Success,error:null,result:r2e(m,b)}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class L2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2,version:"1.0.0",description:"Password: hash (PBKDF2) -> envelope string",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Wr.HashPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w;try{const $=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.password.id}),L=((a=$==null?void 0:$.value)==null?void 0:a.valueAsType)??((c=$==null?void 0:$.value)==null?void 0:c.value),V=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.saltEncoding.id}),k=((e=V==null?void 0:V.value)==null?void 0:e.valueAsType)??((f=V==null?void 0:V.value)==null?void 0:f.value),Y=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.salt.id}),re=((h=Y==null?void 0:Y.value)==null?void 0:h.valueAsType)??((m=Y==null?void 0:Y.value)==null?void 0:m.value),ie=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.iterations.id}),z=((T=ie==null?void 0:ie.value)==null?void 0:T.valueAsType)??((b=ie==null?void 0:ie.value)==null?void 0:b.value),te=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.length.id}),oe=((A=te==null?void 0:te.value)==null?void 0:A.valueAsType)??((D=te==null?void 0:te.value)==null?void 0:D.value),Q=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.hashAlg.id}),H=((g=Q==null?void 0:Q.value)==null?void 0:g.valueAsType)??((w=Q==null?void 0:Q.value)==null?void 0:w.value);return{value:F.Success,error:null,result:await YMe(L,k,re,z,oe,H)}}catch($){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:$,result:null}}}})}}class B2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2,version:"1.0.0",description:"Password: verify (PBKDF2) -> boolean",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Wr.VerifyPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Wr.VerifyPasswordPBKDF2].inputs.password.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Wr.VerifyPasswordPBKDF2].inputs.envelope.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=await JMe(String(m??""),String(b??""));return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}function M2e(s){var r;if(!Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION))return null;let u=null;const i=j["built-in-base-entity"].BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_ENTITY.properties.integration.id;if(s.type===d.BuiltInBaseEntity?Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION)&&(u=_P(s.name)):s.type===d.DefinitionEntity&&s.implements.forEach(a=>{if(Gi(a,Re.EXTERNAL_INTEGRATION_CONNECTION)){const c=_P(a==null?void 0:a.name);if(c)return u=c,!0}}),!u){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}));u=(r=a==null?void 0:a.getDefaultValue())==null?void 0:r.value}return u}function Z1i(s){return MTe[s]}function _P(s){return s.includes("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_")?s.replace("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_","").toLocaleLowerCase().replace("_auth",""):null}function G2e(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 u=s;if(u.id.startsWith("external-integration--"))return u.id.split("--")[1]}if(s.type===d.Operation){const u=s.declaration;if(Object.values(je).includes(u.id))return u.id.split("--")[1]||null}return null}function H1i(s){if(!s)throw new Error("The integrationName parameter is required to resolve the base built-in name.");return Object.values(Re).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 W1i(s){return s.type===d.BuiltInBaseEntity||s.type===d.DefinitionEntity?M2e(s):s.type===d.ActionDescriptor||s.type===d.Operation?G2e(s):null}function Io(s){var a,c,e;if(!Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION))return null;let u=null;const i=GKe(s,Re.EXTERNAL_INTEGRATION_CONNECTION);if(!i)return null;const r=j["built-in-base-entity"][i.id].properties.connectionId.id;if(s.type===d.BuiltInBaseEntity){if(Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION)){const f=s.properties.find(h=>{var m;return((m=h.extends)==null?void 0:m.id)===r});f&&(u=(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 T;return((T=m.extends)==null?void 0:T.id)===r}));if(!f&&((c=s.extends)==null?void 0:c.type)===d.DefinitionEntity)return Io(s.extends);u=(e=f==null?void 0:f.getDefaultValue())==null?void 0:e.value}return u}class k2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackSendMessage,version:"1.0.0",description:"Send Slack message operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackSendMessage);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce;try{const le=((c=(a=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!le||!(le instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:le?"Invalid entity template value provided":"No entity template provided",result:null};const he=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],ve=Io(le),ge=((m=(h=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.channel.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.channel.id}))==null?void 0:T.value)==null?void 0:b.value),Ie=((D=(A=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.text.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.text.id}))==null?void 0:g.value)==null?void 0:w.value),ke=(((L=($=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.thread_ts.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.thread_ts.id}))==null?void 0:V.value)==null?void 0:k.value))||void 0,Me=typeof(((re=(Y=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:ie.value)==null?void 0:z.value))>"u"?void 0:!!(((oe=(te=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:Q.value)==null?void 0:H.value));if(!ge||!Ie)return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Missing required inputs: channel and text",result:null};const Be={channel:ge,text:Ie};ke&&(Be.thread_ts=ke),typeof Me<"u"&&(Be.reply_broadcast=Me);const Ce=await he.getAccessToken(),qe=`${(se=he.env)==null?void 0:se.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${he.projectId}/${_r.slack}/${ve}`,Xe={Authorization:`Bearer ${Ce}`},Ye=await ds.post(`${qe}/chat.postMessage`,{data:Be},{headers:Xe}),ft=Ye&&(Ye.data??Ye),$t={channel:String((ft==null?void 0:ft.channel)??ge),message:String(((ce=ft==null?void 0:ft.message)==null?void 0:ce.text)??Ie),ok:!!(ft!=null&&ft.ok),raw_json:JSON.stringify(ft??{}),ts:String((ft==null?void 0:ft.ts)??"")};return ee.Logger.log("[Slack] chat.postMessage via proxy response:",$t),{value:F.Success,error:null,result:{channel:$t.channel,message:$t.message,ok:$t.ok,raw_json:$t.raw_json,ts:$t.ts}}}catch(le){return ee.Logger.error("[Slack] Error sending message via proxy:",le),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:le,result:null}}}})}}class j2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackChannels,version:"1.0.0",description:"Get Slack channels operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackChannels);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge,Ie,ke,Me,Be,Ce,qe,Xe,Ye,ft,$t,mt,lt,dt;try{const vi=((c=(a=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!vi||!(vi instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid or missing connection entity",result:null};const Bi=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],gt=Io(vi),ot=(((m=(h=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.types.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.types.id}))==null?void 0:T.value)==null?void 0:b.value))||[],Xt=((D=(A=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.excludeArchived.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.excludeArchived.id}))==null?void 0:g.value)==null?void 0:w.value)??!1,it=(((L=($=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageSize.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageSize.id}))==null?void 0:V.value)==null?void 0:k.value))||200,yt=(((re=(Y=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageToken.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageToken.id}))==null?void 0:ie.value)==null?void 0:z.value))||void 0,Rt=(((oe=(te=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.onlyJoined.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.onlyJoined.id}))==null?void 0:Q.value)==null?void 0:H.value))||!1,an=(((ce=(se=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.teamId.id}))==null?void 0:se.value)==null?void 0:ce.valueAsType)??((he=(le=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.teamId.id}))==null?void 0:le.value)==null?void 0:he.value))||void 0,Pr=(((ge=(ve=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.joinPublicChannels.id}))==null?void 0:ve.value)==null?void 0:ge.valueAsType)??((ke=(Ie=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.joinPublicChannels.id}))==null?void 0:Ie.value)==null?void 0:ke.value))||!1,ca=(((Be=(Me=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.autoPaginate.id}))==null?void 0:Me.value)==null?void 0:Be.valueAsType)??((qe=(Ce=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.autoPaginate.id}))==null?void 0:Ce.value)==null?void 0:qe.value))||!1,Qn=(lt=(mt=((Ye=(Xe=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.nameContains.id}))==null?void 0:Xe.value)==null?void 0:Ye.valueAsType)??(($t=(ft=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.nameContains.id}))==null?void 0:ft.value)==null?void 0:$t.value))==null?void 0:mt.trim())==null?void 0:lt.toLowerCase(),Ni=await Bi.getAccessToken(),ii=`${(dt=Bi.env)==null?void 0:dt.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${Bi.projectId}/${_r.slack}/${gt}`,ri={Authorization:`Bearer ${Ni}`},Xn={limit:String(Math.min(Math.max(1,it),999)),types:(ot.length?ot:["public_channel","private_channel"]).join(","),exclude_archived:String(!!Xt)};an&&(Xn.team_id=an);const Mn=async ct=>{var ut;const It={...Xn};ct&&(It.cursor=ct);const Gt=new URLSearchParams(It).toString(),{data:Pt}=await ds.get(`${ii}/conversations.list?${Gt}`,{headers:ri});if(!(Pt!=null&&Pt.ok))throw new Error((Pt==null?void 0:Pt.error)||"Slack API error");const Ct=Array.isArray(Pt.channels)?Pt.channels:[],He=((ut=Pt==null?void 0:Pt.response_metadata)==null?void 0:ut.next_cursor)||"";return{channels:Ct,nextCursor:He}};let Nr=[],wr=yt||"";if(ca){let ct=0;do{const{channels:It,nextCursor:Gt}=await Mn(wr||void 0);Nr=Nr.concat(It),wr=Gt,ct+=1}while(wr&&ct<50)}else{const{channels:ct,nextCursor:It}=await Mn(wr||void 0);Nr=ct,wr=It}if(Rt&&(Nr=Nr.filter(ct=>(ct==null?void 0:ct.is_member)===!0)),Qn&&(Nr=Nr.filter(ct=>{var It;return(It=ct==null?void 0:ct.name)==null?void 0:It.toLowerCase().includes(Qn)})),Pr){for(const ct of Nr)if(ct!=null&&ct.is_channel&&!(ct!=null&&ct.is_private)&&!(ct!=null&&ct.is_shared)&&(ct==null?void 0:ct.is_member)===!1)try{await ds.post(`${ii}/conversations.join`,{channel:ct.id},{headers:ri})}catch(It){ee.Logger.warn(`[Slack] conversations.join failed for ${ct==null?void 0:ct.id}`,It)}}const Zt=Nr.map(ct=>({id:ct.id,name:ct.name,name_normalized:ct.name_normalized,is_shared:!!ct.is_shared,is_private:!!ct.is_private,is_mpim:!!ct.is_mpim,is_im:!!ct.is_im,is_group:!!ct.is_group,is_channel:!!ct.is_channel,is_archived:!!ct.is_archived,is_general:!!ct.is_general,created:ct.created,updated:ct.updated,creator:ct.creator,num_members:typeof ct.num_members=="number"?ct.num_members:null,raw_json:JSON.stringify(ct)})),jt=ca?null:wr||null;return ee.Logger.log("[Slack] List channels response:",{count:Zt.length,next:jt}),{value:F.Success,error:null,result:{records:Zt,nextPageToken:jt}}}catch(vi){return ee.Logger.error("[Slack] List channels error:",vi),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:vi,result:null}}}})}}class U2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackMessages,version:"1.0.0",description:"Get Slack messages (conversations.history)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackMessages);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge,Ie,ke,Me,Be,Ce,qe,Xe,Ye,ft,$t,mt,lt,dt,vi,Bi,gt,ot;try{const Xt=((c=(a=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!Xt||!(Xt instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid or missing connection entity",result:null};const it=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],yt=Io(Xt),Rt=((m=(h=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.channel.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.channel.id}))==null?void 0:T.value)==null?void 0:b.value),an=(((D=(A=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageSize.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageSize.id}))==null?void 0:g.value)==null?void 0:w.value))||200,Pr=(((L=($=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageToken.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageToken.id}))==null?void 0:V.value)==null?void 0:k.value))||void 0,ca=(((re=(Y=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.oldest.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.oldest.id}))==null?void 0:ie.value)==null?void 0:z.value))||void 0,Qn=(((oe=(te=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.latest.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.latest.id}))==null?void 0:Q.value)==null?void 0:H.value))||void 0,Ni=((ce=(se=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.inclusive.id}))==null?void 0:se.value)==null?void 0:ce.valueAsType)??((he=(le=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.inclusive.id}))==null?void 0:le.value)==null?void 0:he.value)??!1,ii=((ge=(ve=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.includeAllMetadata.id}))==null?void 0:ve.value)==null?void 0:ge.valueAsType)??((ke=(Ie=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.includeAllMetadata.id}))==null?void 0:Ie.value)==null?void 0:ke.value)??!1,ri=((Be=(Me=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.autoPaginate.id}))==null?void 0:Me.value)==null?void 0:Be.valueAsType)??((qe=(Ce=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.autoPaginate.id}))==null?void 0:Ce.value)==null?void 0:qe.value)??!1,Xn=(lt=(mt=((Ye=(Xe=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.textContains.id}))==null?void 0:Xe.value)==null?void 0:Ye.valueAsType)??(($t=(ft=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.textContains.id}))==null?void 0:ft.value)==null?void 0:$t.value))==null?void 0:mt.trim())==null?void 0:lt.toLowerCase(),Mn=((vi=(dt=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.onlyThreadRoots.id}))==null?void 0:dt.value)==null?void 0:vi.valueAsType)??((gt=(Bi=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.onlyThreadRoots.id}))==null?void 0:Bi.value)==null?void 0:gt.value)??!1;if(!Rt)return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Missing required input: channel",result:null};const Nr=await it.getAccessToken(),wr=`${(ot=it.env)==null?void 0:ot.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${it.projectId}/${_r.slack}/${yt}`,Zt={Authorization:`Bearer ${Nr}`},jt={channel:Rt,limit:String(Math.min(Math.max(1,an),999)),inclusive:String(!!Ni),include_all_metadata:String(!!ii)};ca&&(jt.oldest=ca),Qn&&(jt.latest=Qn);const ct=async He=>{var Id;const ut={...jt};He&&(ut.cursor=He);const Bt=new URLSearchParams(ut).toString(),{data:ea}=await ds.get(`${wr}/conversations.history?${Bt}`,{headers:Zt});if(!(ea!=null&&ea.ok))throw new Error((ea==null?void 0:ea.error)||"Slack API error");const cl=Array.isArray(ea.messages)?ea.messages:[],ks=((Id=ea==null?void 0:ea.response_metadata)==null?void 0:Id.next_cursor)||"";return{messages:cl,nextCursor:ks}};let It=[],Gt=Pr||"";if(ri){let He=0;do{const{messages:ut,nextCursor:Bt}=await ct(Gt||void 0);It=It.concat(ut),Gt=Bt,He+=1}while(Gt&&He<50)}else{const{messages:He,nextCursor:ut}=await ct(Gt||void 0);It=He,Gt=ut}Xn&&(It=It.filter(He=>{var ut,Bt;return(Bt=(ut=He==null?void 0:He.text)==null?void 0:ut.toLowerCase)==null?void 0:Bt.call(ut).includes(Xn)})),Mn&&(It=It.filter(He=>typeof(He==null?void 0:He.reply_count)=="number"&&He.reply_count>0));const Pt=It.map(He=>({ts:He.ts,text:He.text,user:He.user,type:He.type,thread_ts:He.thread_ts,reply_count:typeof He.reply_count=="number"?He.reply_count:null,latest_reply:He.latest_reply,subtype:He.subtype,bot_id:He.bot_id,team:He.team,raw_json:JSON.stringify(He)})),Ct=ri?null:Gt||null;return{value:F.Success,error:null,result:{records:Pt,nextPageToken:Ct}}}catch(Xt){return ee.Logger.error("[Slack] conversations.history error:",Xt),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:Xt,result:null}}}})}}class F2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackReplies,version:"1.0.0",description:"Get Slack thread replies (conversations.replies)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackReplies);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge,Ie,ke,Me,Be,Ce,qe,Xe,Ye,ft,$t,mt,lt,dt,vi,Bi;try{const gt=((c=(a=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!gt||!(gt instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid or missing connection entity",result:null};const ot=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],Xt=Io(gt),it=((m=(h=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.channel.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.channel.id}))==null?void 0:T.value)==null?void 0:b.value),yt=((D=(A=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.threadTs.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.threadTs.id}))==null?void 0:g.value)==null?void 0:w.value),Rt=(((L=($=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageSize.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageSize.id}))==null?void 0:V.value)==null?void 0:k.value))||200,an=(((re=(Y=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageToken.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageToken.id}))==null?void 0:ie.value)==null?void 0:z.value))||void 0,Pr=(((oe=(te=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.oldest.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.oldest.id}))==null?void 0:Q.value)==null?void 0:H.value))||void 0,ca=(((ce=(se=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.latest.id}))==null?void 0:se.value)==null?void 0:ce.valueAsType)??((he=(le=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.latest.id}))==null?void 0:le.value)==null?void 0:he.value))||void 0,Qn=((ge=(ve=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.inclusive.id}))==null?void 0:ve.value)==null?void 0:ge.valueAsType)??((ke=(Ie=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.inclusive.id}))==null?void 0:Ie.value)==null?void 0:ke.value)??!1,Ni=((Be=(Me=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeAllMetadata.id}))==null?void 0:Me.value)==null?void 0:Be.valueAsType)??((qe=(Ce=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeAllMetadata.id}))==null?void 0:Ce.value)==null?void 0:qe.value)??!1,ii=((Ye=(Xe=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.autoPaginate.id}))==null?void 0:Xe.value)==null?void 0:Ye.valueAsType)??(($t=(ft=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.autoPaginate.id}))==null?void 0:ft.value)==null?void 0:$t.value)??!1,ri=((lt=(mt=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeParent.id}))==null?void 0:mt.value)==null?void 0:lt.valueAsType)??((vi=(dt=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeParent.id}))==null?void 0:dt.value)==null?void 0:vi.value)??!0;if(!it||!yt)return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Missing required inputs: channel and threadTs",result:null};const Xn=await ot.getAccessToken(),Mn=`${(Bi=ot.env)==null?void 0:Bi.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${ot.projectId}/${_r.slack}/${Xt}`,Nr={Authorization:`Bearer ${Xn}`},wr={channel:it,ts:yt,limit:String(Math.min(Math.max(1,Rt),999)),inclusive:String(!!Qn),include_all_metadata:String(!!Ni)};Pr&&(wr.oldest=Pr),ca&&(wr.latest=ca);const Zt=async Pt=>{var cl;const Ct={...wr};Pt&&(Ct.cursor=Pt);const He=new URLSearchParams(Ct).toString(),{data:ut}=await ds.get(`${Mn}/conversations.replies?${He}`,{headers:Nr});if(!(ut!=null&&ut.ok))throw new Error((ut==null?void 0:ut.error)||"Slack API error");const Bt=Array.isArray(ut.messages)?ut.messages:[],ea=((cl=ut==null?void 0:ut.response_metadata)==null?void 0:cl.next_cursor)||"";return{messages:Bt,nextCursor:ea}};let jt=[],ct=an||"";if(ii){let Pt=0;do{const{messages:Ct,nextCursor:He}=await Zt(ct||void 0);jt=jt.concat(Ct),ct=He,Pt+=1}while(ct&&Pt<50)}else{const{messages:Pt,nextCursor:Ct}=await Zt(ct||void 0);jt=Pt,ct=Ct}ri||(jt=jt.filter(Pt=>(Pt==null?void 0:Pt.ts)!==yt));const It=jt.map(Pt=>({ts:Pt.ts,text:Pt.text,user:Pt.user,type:Pt.type,thread_ts:Pt.thread_ts,subtype:Pt.subtype,bot_id:Pt.bot_id,team:Pt.team,raw_json:JSON.stringify(Pt)})),Gt=ii?null:ct||null;return{value:F.Success,error:null,result:{records:It,nextPageToken:Gt}}}catch(gt){return ee.Logger.error("[Slack] conversations.replies error:",gt),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:gt,result:null}}}})}}function z1i(s){return!!s&&typeof s=="object"&&typeof s.presignedUrl=="string"}function Hg(s,u){return ee.Logger.log("[Gmail] send email error:",u),{value:s.catchesError||s.errorCalls.length?F.CaughtError:F.UnhandledError,error:u,result:null}}function J1i(s){if(s!=null)return Array.isArray(s)?s.filter(Boolean).join(", "):s}function Xf(s,u){const i=J1i(u);return i?`${s}: ${i}`:null}function Y1i(s){return Buffer.from(s,"utf8").toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function Q1i(s){const{from:u,to:i,subject:r,body:a,bodyHtml:c,cc:e,bcc:f,replyTo:h,headers:m={}}=s,T=Object.entries(m).map(([w,$])=>Xf(w,$)).filter(w=>w!=null),b=c?'Content-Type: text/html; charset="UTF-8"':'Content-Type: text/plain; charset="UTF-8"',g=[...[Xf("From",u),Xf("To",i),Xf("Cc",e),Xf("Bcc",f),Xf("Reply-To",h),Xf("Subject",r),...T,"MIME-Version: 1.0",b].filter(w=>w!=null),"",c??a??""].join(`\r
|
|
54
|
+
`+c):r.stack=c}catch{}}throw r}}_request(u,i){typeof u=="string"?(i=i||{},i.url=u):i=u||{},i=dy(this.defaults,i);const{transitional:r,paramsSerializer:a,headers:c}=i;r!==void 0&&nI.assertOptions(r,{silentJSONParsing:Jl.transitional(Jl.boolean),forcedJSONParsing:Jl.transitional(Jl.boolean),clarifyTimeoutError:Jl.transitional(Jl.boolean),legacyInterceptorReqResOrdering:Jl.transitional(Jl.boolean)},!1),a!=null&&(Je.isFunction(a)?i.paramsSerializer={serialize:a}:nI.assertOptions(a,{encode:Jl.function,serialize:Jl.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nI.assertOptions(i,{baseUrl:Jl.spelling("baseURL"),withXsrfToken:Jl.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let e=c&&Je.merge(c.common,c[i.method]);c&&Je.forEach(["delete","get","head","post","put","patch","common"],g=>{delete c[g]}),i.headers=Uo.concat(e,c);const f=[];let h=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(i)===!1)return;h=h&&w.synchronous;const $=i.transitional||Z$;$&&$.legacyInterceptorReqResOrdering?f.unshift(w.fulfilled,w.rejected):f.push(w.fulfilled,w.rejected)});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let T,b=0,A;if(!h){const g=[DU.bind(this),void 0];for(g.unshift(...f),g.push(...m),A=g.length,T=Promise.resolve(i);b<A;)T=T.then(g[b++],g[b++]);return T}A=f.length;let D=i;for(;b<A;){const g=f[b++],w=f[b++];try{D=g(D)}catch($){w.call(this,$);break}}try{T=DU.call(this,D)}catch(g){return Promise.reject(g)}for(b=0,A=m.length;b<A;)T=T.then(m[b++],m[b++]);return T}getUri(u){u=dy(this.defaults,u);const i=hMe(u.baseURL,u.url,u.allowAbsoluteUrls);return pMe(i,u.params,u.paramsSerializer)}}Je.forEach(["delete","get","head","options"],function(u){CI.prototype[u]=function(i,r){return this.request(dy(r||{},{method:u,url:i,data:(r||{}).data}))}});Je.forEach(["post","put","patch"],function(u){function i(r){return function(c,e,f){return this.request(dy(f||{},{method:u,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:e}))}}CI.prototype[u]=i(),CI.prototype[u+"Form"]=i(!0)});const aI=CI;class Y${constructor(u){if(typeof u!="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},u(function(c,e,f){r.reason||(r.reason=new Eb(c,e,f),i(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const i=this._listeners.indexOf(u);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const u=new AbortController,i=r=>{u.abort(r)};return this.subscribe(i),u.signal.unsubscribe=()=>this.unsubscribe(i),u.signal}static source(){let u;return{token:new Y$(function(a){u=a}),cancel:u}}}const U1i=Y$;function F1i(s){return function(i){return s.apply(null,i)}}function K1i(s){return Je.isObject(s)&&s.isAxiosError===!0}const OP={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(OP).forEach(([s,u])=>{OP[u]=s});const S1i=OP;function bMe(s){const u=new aI(s),i=tMe(aI.prototype.request,u);return Je.extend(i,aI.prototype,u,{allOwnKeys:!0}),Je.extend(i,u,null,{allOwnKeys:!0}),i.create=function(a){return bMe(dy(s,a))},i}const va=bMe(z$);va.Axios=aI;va.CanceledError=Eb;va.CancelToken=U1i;va.isCancel=fMe;va.VERSION=EMe;va.toFormData=fw;va.AxiosError=Or;va.Cancel=va.CanceledError;va.all=function(u){return Promise.all(u)};va.spread=F1i;va.isAxiosError=K1i;va.mergeConfig=dy;va.AxiosHeaders=Uo;va.formToJSON=s=>cMe(Je.isHTMLForm(s)?new FormData(s):s);va.getAdapter=vMe.getAdapter;va.HttpStatusCode=S1i;va.default=va;const ds=va;class AMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__HTTP_REQUEST,version:"1.0.0",description:"HTTP request operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(qn.HttpRequest);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h;try{const m=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.method.id}),T=((a=m==null?void 0:m.value)==null?void 0:a.value)||"",b=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.url.id}),A=((c=b==null?void 0:b.value)==null?void 0:c.value)||"",D=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.query.id}),g=(e=D==null?void 0:D.value)==null?void 0:e.value,w=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.body.id}),$=(f=w==null?void 0:w.value)==null?void 0:f.value,L=r.find(re=>{var ie,z;return((z=(ie=re.valueOwner)==null?void 0:ie.declaration)==null?void 0:z.id)===j.operation[qn.HttpRequest].inputs.headers.id}),V=(h=L==null?void 0:L.value)==null?void 0:h.value,k={method:T,url:A};g!==void 0&&g!==""&&(k.params=g),V!==void 0&&V!==""&&(k.headers=V),$!==void 0&&$!==""&&(k.data=$),ee.Logger.log("Axios request config: ",k);const Y=await ds(k);return{value:F.Success,error:null,result:{status:Y.status,headers:Y.headers,data:Y.data}}}catch(m){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:m,result:null}}}})}}class gMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__EXECUTE_SQL,version:"1.0.0",description:"Execute SQL operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(jo.ExecuteSQL);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e;try{const f=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[jo.ExecuteSQL].inputs.connectionConfig.id}),h=((a=f==null?void 0:f.value)==null?void 0:a.value)||"",m=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[jo.ExecuteSQL].inputs.query.id}),T=((c=m==null?void 0:m.value)==null?void 0:c.value)||"",b=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],A=await ds.post(((e=b.env)==null?void 0:e.API_BASE_URL)+"/editor-runtime/v1/execute-sql",{connectionConfig:h,query:T},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${await b.getAccessToken()}`}});return{value:F.Success,error:null,result:{results:A.data.results||[]}}}catch(f){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:f,result:null}}}})}}class IMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__VALIDATE_ENTITY,version:"1.0.0",description:"Entity validate operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.Validate);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(A=>{var D,g;return((g=(D=A.valueOwner)==null?void 0:D.declaration)==null?void 0:g.id)===j.operation[Oe.Validate].inputs.entityToMatch.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)||"",h=r.find(A=>{var D,g;return((g=(D=A.valueOwner)==null?void 0:D.declaration)==null?void 0:g.id)===j.operation[Oe.Validate].inputs.dataToValidate.id}),m=((c=h==null?void 0:h.value)==null?void 0:c.value)||"";ee.Logger.log("Inputs for entity validation: ",r);const b=sD(f).safeParse(m);return b.success?{value:F.Success,error:null,result:{data:m}}:{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:b.error.errors,result:null}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class RMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_KEY,version:"1.0.0",description:"Entity read-key operation implementation module (top-level)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.ReadKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=eNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class wMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_WRITE_KEY,version:"1.0.0",description:"Entity write-key operation implementation module (top-level, immutable)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.WriteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteKey].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteKey].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteKey].inputs.value.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=tNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class DMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_KEY,version:"1.0.0",description:"Entity delete-key operation implementation module (top-level, immutable)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.DeleteKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=iNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class CMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_READ_NESTED_KEY,version:"1.0.0",description:"Entity read-nested-key operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.ReadNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadNestedKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.ReadNestedKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=rNe(m,b,void 0);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class OMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.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:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.WriteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteNestedKey].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteNestedKey].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteNestedKey].inputs.value.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=nNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class _Me extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.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:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.WriteSafeNestedKeyRecursively);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteSafeNestedKeyRecursively].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteSafeNestedKeyRecursively].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.WriteSafeNestedKeyRecursively].inputs.value.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=aNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class PMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__ENTITY_DELETE_NESTED_KEY,version:"1.0.0",description:"Entity delete-nested-key operation implementation module (immutable)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Oe.DeleteNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteNestedKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.DeleteNestedKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=sNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class NMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_KEY,version:"1.0.0",description:"Object has-key (top-level property present?)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.HasKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=lNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class xMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object key-value-equals (top-level property strict equality)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.KeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.KeyValueEquals].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.KeyValueEquals].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.KeyValueEquals].inputs.expectedValue.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=oNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class VMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_HAS_NESTED_KEY,version:"1.0.0",description:"Object has-nested-key (path present?)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.HasNestedKey);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasNestedKey].inputs.objectValue.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Oe.HasNestedKey].inputs.key.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=dNe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:F.UnhandledError,error:h,result:null}}}})}}class $Me extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_NESTED_KEY_VALUE_EQUALS,version:"1.0.0",description:"Object nested-key-value-equals (path strict equality)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.NestedKeyValueEquals);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m;try{const T=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.NestedKeyValueEquals].inputs.objectValue.id}),b=((a=T==null?void 0:T.value)==null?void 0:a.valueAsType)??((c=T==null?void 0:T.value)==null?void 0:c.value),A=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.NestedKeyValueEquals].inputs.key.id}),D=((e=A==null?void 0:A.value)==null?void 0:e.valueAsType)??((f=A==null?void 0:A.value)==null?void 0:f.value),g=r.find(L=>{var V,k;return((k=(V=L.valueOwner)==null?void 0:V.declaration)==null?void 0:k.id)===j.operation[Oe.NestedKeyValueEquals].inputs.expectedValue.id}),w=((h=g==null?void 0:g.value)==null?void 0:h.valueAsType)??((m=g==null?void 0:g.value)==null?void 0:m.value),$=uNe(b,D,w);return{value:F.Success,error:null,result:$}}catch(T){return{value:F.UnhandledError,error:T,result:null}}}})}}class LMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_IS_INSTANCE_OF_TYPE,version:"1.0.0",description:"Object is-instance-of-type (DefinitionEntity-based runtime check)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Oe.IsInstanceOfType);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D;try{const g=((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),w=(m=(h=r[0])==null?void 0:h.value)==null?void 0:m.value,$=(b=(T=r[1])==null?void 0:T.value)==null?void 0:b.valueAsTypeSingle;if(!w)throw new TypeError("IsInstanceOfType expects a non-null input value.");if(!$)throw new TypeError("IsInstanceOfType expects a valid expectedType input.");if(!g)throw new TypeError("IsInstanceOfType cannot determine the value owner.");if($.type!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType expects expectedType to be a DefinitionEntity.");const L=g.getDataType(null);if(((A=L==null?void 0:L.entity)==null?void 0:A.type)!==d.DefinitionEntity)throw new TypeError("IsInstanceOfType cannot determine the data type of the input value.");let V=!1;return((D=L==null?void 0:L.entity)==null?void 0:D.id)!==($==null?void 0:$.id)?V=!1:sD(L==null?void 0:L.entity).safeParse(w).success?V=!0:V=!1,{value:F.Success,error:null,result:V}}catch(g){return{value:F.UnhandledError,error:g,result:null}}}})}}class BMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_MERGE,version:"1.0.0",description:"Object merge operation implementation module (immutable, shallow merge with right-precedence)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Merge);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{try{const c=r.filter(f=>{var h,m;return((m=(h=f.valueOwner)==null?void 0:h.declaration)==null?void 0:m.id)===j.operation[Oe.Merge].inputs.left.id}).map(f=>{var h,m;return((h=f.value)==null?void 0:h.valueAsType)??((m=f.value)==null?void 0:m.value)}),e=pNe(...c);return{value:F.Success,error:null,result:e}}catch(a){return{value:F.UnhandledError,error:a,result:null}}}})}}class MMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_KEYS,version:"1.0.0",description:"Object keys operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Keys);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[Oe.Keys].inputs.objectValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=cNe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}class GMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_VALUES,version:"1.0.0",description:"Object values operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Values);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[Oe.Values].inputs.objectValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=fNe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}class kMe extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__OBJECT_ENTRIES,version:"1.0.0",description:"Object entries operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic);if(!r)return;const a=r.get(Oe.Entries);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[Oe.Entries].inputs.objectValue.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=yNe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:F.UnhandledError,error:e,result:null}}}})}}let Il=null;try{Il=require("crypto")}catch{}const Bv=typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle?globalThis.crypto:Il&&Il.webcrypto?Il.webcrypto:null,lc=Bv?Bv.subtle:null;function zv(s){const u=new ArrayBuffer(s.byteLength);return new Uint8Array(u).set(s),u}function kn(s,u="utf8"){if(s instanceof Uint8Array)return s;const i=String(s);if(u==="utf8"){if(typeof TextEncoder<"u")return new TextEncoder().encode(i);if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"utf8"))}else if(u==="hex"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"hex"))}else if(u==="base64"){if(typeof Buffer<"u")return new Uint8Array(Buffer.from(i,"base64"))}else if(u==="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(${u})`)}function bd(s,u="utf8"){if(u==="utf8"){if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf8")}else if(u==="hex"){if(typeof Buffer<"u")return Buffer.from(s).toString("hex")}else if(u==="base64"){if(typeof Buffer<"u")return Buffer.from(s).toString("base64")}else if(u==="base64url"&&typeof Buffer<"u")return Buffer.from(s).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");throw new Error(`Unsupported environment/encoding combo for fromBytes(${u})`)}const jMe=s=>kn(s,"base64"),UMe=(s,u)=>{const i=s instanceof Uint8Array?s:kn(String(s),u||"utf8");return bd(i,"base64")},om=(s,u)=>{const i=s instanceof Uint8Array?s:kn(String(s),u||"utf8");return bd(i,"base64url")},uy=s=>kn(s,"base64url"),FMe=(s,u)=>{const i=s instanceof Uint8Array?s:kn(String(s),u||"utf8");return bd(i,"hex")},KMe=s=>kn(s,"hex");function Q$(s){if(Bv&&Bv.getRandomValues){const u=new Uint8Array(s);return Bv.getRandomValues(u),u}if(Il&&Il.randomBytes)return new Uint8Array(Il.randomBytes(s));throw new Error("Secure random not available")}function mw(s,u){if(!(s instanceof Uint8Array)||!(u instanceof Uint8Array)||s.length!==u.length)return!1;let i=0;for(let r=0;r<s.length;r++)i|=s[r]^u[r];return i===0}function SMe(s,u,i,r){if((typeof s!="string"||typeof u!="string")&&typeof s!="string"&&typeof u!="string")throw new Error("Invalid input types");const a=i??"utf8",c=r??"utf8",e=kn(s??"",a),f=kn(u??"",c);return mw(e,f)}async function qMe(s,u){if(lc){const i=await lc.digest({name:s},zv(u));return new Uint8Array(i)}if(Il){const i=s.replace("SHA-","sha"),r=Il.createHash(i);return r.update(Buffer.from(u)),new Uint8Array(r.digest())}throw new Error("Hash not available")}async function ZMe(s,u,i,r){if(typeof u!="string")throw new Error("Invalid input type for data; expected string");const a=String(s??"SHA-256"),c=i??"utf8",e=r??"base64url",f=kn(u??"",c),h=await qMe(a,f);return bd(h,e)}async function Tw(s,u,i){if(lc){const r=await lc.importKey("raw",zv(u),{name:"HMAC",hash:{name:s}},!1,["sign"]),a=await lc.sign("HMAC",r,zv(i));return new Uint8Array(a)}if(Il){const r=`sha${s.split("-")[1]}`,a=Il.createHmac(r,Buffer.from(u));return a.update(Buffer.from(i)),new Uint8Array(a.digest())}throw new Error("HMAC not available")}async function HMe(s,u,i,r,a,c){if(typeof s!="string"||typeof u!="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",T=kn(s??"",f),b=kn(u??"",h),A=await Tw(e,T,b);return bd(A,m)}async function vw(s,u,{iterations:i,length:r,hashAlg:a="SHA-256"}){if(lc){const c=await lc.importKey("raw",zv(s),"PBKDF2",!1,["deriveBits"]),e=await lc.deriveBits({name:"PBKDF2",salt:zv(u),iterations:i,hash:a},c,r*8);return new Uint8Array(e)}if(Il){const c=a==="SHA-512"?"sha512":"sha256";return await new Promise((e,f)=>{Il.pbkdf2(Buffer.from(s),Buffer.from(u),i,r,c,(h,m)=>{h?f(h):e(new Uint8Array(m))})})}throw new Error("PBKDF2 not available")}async function WMe(s,u,i,r,a,c,e,f){if(typeof s!="string"||typeof u!="string")throw new Error("Invalid input types for password or salt; expected strings");const h=c??"utf8",m=e??"utf8",T=f??"base64url",b=Math.max(1,Number(i)||21e4),A=Math.max(1,Number(r)||32),D=a??"SHA-256",g=kn(s??"",h),w=kn(u??"",m),$=await vw(g,w,{iterations:b,length:A,hashAlg:D});return bd($,T)}async function zMe(s,u=Q$(16),i=21e4,r=32,a="SHA-256"){const c=kn(s,"utf8"),e=await vw(c,u,{iterations:i,length:r,hashAlg:a}),f=om(u),h=om(e);return`pbkdf2$${a.toLowerCase()}$${i}$${f}$${h}`}async function JMe(s,u){const i=String(u).split("$");if(i.length!==5||i[0]!=="pbkdf2")return!1;const r=i[1].toLowerCase(),a=parseInt(i[2],10),c=uy(i[3]),e=uy(i[4]),f=r.includes("512")?"SHA-512":"SHA-256",h=await vw(kn(s,"utf8"),c,{iterations:a,length:e.length,hashAlg:f});return mw(h,e)}async function YMe(s,u,i,r,a,c){const e=u!=null?Math.max(1,Number(u)||0):void 0,f=i!=null?Math.max(1,Number(i)||0):void 0,h=r??void 0,m=c??"base64url",T=a!=null?kn(a,m):void 0;return await zMe(String(s??""),T,e,f,h)}function OU(s){return om(kn(JSON.stringify(s),"utf8"))}function OI(s){try{return JSON.parse(bd(uy(s),"utf8"))}catch{return null}}async function QMe(s,u,{alg:i="HS256",includeIat:r=!0,expiresInSeconds:a,notBeforeSeconds:c,issuer:e,subject:f,audience:h,jwtid:m,header:T={}}={}){const b={alg:i,typ:"JWT",...T},A=Math.floor(Date.now()/1e3),D={...s||{}};r&&(D.iat=A),typeof a=="number"&&(D.exp=A+a),typeof c=="number"&&(D.nbf=A+c),e&&(D.iss=e),f&&(D.sub=f),h&&(D.aud=h),m&&(D.jti=m);const g=OU(b),w=OU(D),$=kn(`${g}.${w}`,"utf8"),V=await Tw(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",u,$),k=om(V);return`${g}.${w}.${k}`}async function XMe(s,u,i,r,a,c,e,f,h,m,T,b){if(typeof u!="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(T!=null&&typeof T!="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 D=kn(u??"",b??"utf8");return await QMe(s??{},D,{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:T??void 0})}async function e2e(s,u,{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 T=OI(f),b=OI(h);if(!T||!b)return{valid:!1,header:T,payload:b,reason:"Bad base64/json"};if(T.alg!==i)return{valid:!1,header:T,payload:b,reason:"Alg mismatch"};const A=kn(`${f}.${h}`,"utf8"),g=await Tw(i==="HS512"?"SHA-512":i==="HS384"?"SHA-384":"SHA-256",u,A),w=uy(m);if(!mw(g,w))return{valid:!1,header:T,payload:b,reason:"Bad signature"};const $=Math.floor(Date.now()/1e3),L=Math.max(0,Number(e)||0);if(b.nbf!=null&&$+L<Number(b.nbf))return{valid:!1,header:T,payload:b,reason:"Not before"};if(b.exp!=null&&$-L>=Number(b.exp))return{valid:!1,header:T,payload:b,reason:"Expired"};if(r&&b.iss!==r)return{valid:!1,header:T,payload:b,reason:"Issuer mismatch"};if(a){const V=b.aud;if(!(Array.isArray(V)?V.includes(a):V===a))return{valid:!1,header:T,payload:b,reason:"Audience mismatch"}}return c!=null&&b.iat!=null&&$-Number(b.iat)>Number(c)+L?{valid:!1,header:T,payload:b,reason:"MaxAge exceeded"}:{valid:!0,header:T,payload:b}}catch(f){return{valid:!1,header:null,payload:null,reason:String((f==null?void 0:f.message)??f)}}}async function t2e(s,u,i,r,a,c,e,f){if(typeof s!="string")throw new Error("Invalid input type for token; expected string");if(typeof u!="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=kn(u??"",f??"utf8");return await e2e(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 i2e(s){const[u,i,r]=String(s).split(".");return{header:u?OI(u):null,payload:i?OI(i):null,signature:r?uy(r):new Uint8Array}}function r2e(s,u){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=u??"base64url",{header:r,payload:a,signature:c}=i2e(String(s??"")),e=bd(c,i);return{header:r,payload:a,signature:e}}class n2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_GENERATE_RANDOM_BYTES,version:"1.0.0",description:"Randomness generate random bytes operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(at.GenerateRandomBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find($=>{var L,V;return((V=(L=$.valueOwner)==null?void 0:L.declaration)==null?void 0:V.id)===j.operation[at.GenerateRandomBytes].inputs.length.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find($=>{var L,V;return((V=(L=$.valueOwner)==null?void 0:L.declaration)==null?void 0:V.id)===j.operation[at.GenerateRandomBytes].inputs.outputEncoding.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=Math.max(0,Number(m)||0),D=b??"base64url",g=Q$(A),w=bd(g,D);return{value:F.Success,error:null,result:w}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class a2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_INTEGER,version:"1.0.0",description:"Randomness generate random integer operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomInteger);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateRandomInteger].inputs.min.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateRandomInteger].inputs.max.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=BPe(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class s2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_FLOAT,version:"1.0.0",description:"Randomness generate random float operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomFloat);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=nw();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class l2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_HEXADECIMAL,version:"1.0.0",description:"Randomness generate random hexadecimal operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomHexadecimal);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomHexadecimal].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=C$(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class o2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE62,version:"1.0.0",description:"Randomness generate random base62 operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomBase62);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomBase62].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=O$(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class d2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_BASE64,version:"1.0.0",description:"Randomness generate random base64 operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomBase64].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=GPe(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class u2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_ALPHANUMERIC,version:"1.0.0",description:"Randomness generate random alphanumeric operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomAlphanumeric);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[at.GenerateRandomAlphanumeric].inputs.length.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=_$(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class p2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_IDENTIFIER,version:"1.0.0",description:"Generate identifier operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateIdentifier);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateIdentifier].inputs.length.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[at.GenerateIdentifier].inputs.alphabet.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=P$(m,b);return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class c2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_RANDOM_UUIDV4,version:"1.0.0",description:"Generate UUID v4 operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateRandomUUIDv4);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=sc();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class f2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_SHORT_IDENTIFIER,version:"1.0.0",description:"Generate short identifier operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{ee.Logger.log("Initializing Random Generate Short Identifier Module");const r=i.find(a=>a.contextType===de.Logic);if(r){ee.Logger.log("Project state found, setting up operation");const a=r.get(at.GenerateShortIdentifier);a?(ee.Logger.log("Operation found, setting autoexecutable and implementation"),a.autoexecutable=!0,a.implementation=this.module.main):ee.Logger.warn("Operation generate-short-identifier not found in project state")}else ee.Logger.warn("Project state not found in contexts for Random Generate Short Identifier Module")},main:async(i,r)=>{try{const a=kPe();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}class y2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__RANDOMNESS_GENERATE_HEXADECIMAL_TOKEN,version:"1.0.0",description:"Generate hexadecimal token operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(at.GenerateHexadecimalToken);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{try{const a=jPe();return{value:F.Success,error:null,result:a}}catch(a){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:a,result:null}}}})}}function q1i(s){let u;if(s===null?u="null":Array.isArray(s)?u="array":u=typeof s,!["string","number","boolean","null","object","array"].includes(u))throw new TypeError("GetTypeOf cannot determine type of the given value.");return u}class h2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_GET_TYPE_OF,version:"1.0.0",description:"Data type get type of operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(et.GetTypeOf);a&&(a.autoexecutable=!0,a.implementation=this.module.main)}},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===j.operation[et.GetTypeOf].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:F.Success,error:null,result:q1i(f)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class m2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_STRING,version:"1.0.0",description:"Coerce any value to string via JS String(value)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.ToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.ToString].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=String(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class T2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_NUMBER,version:"1.0.0",description:"Coerce to number via JS Number(value)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.ToNumber);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.ToNumber].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=Number(f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class v2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_TO_BYTES,version:"1.0.0",description:"Convert string/bytes-like to Uint8Array (utf8|hex|base64|base64url)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.ToBytes);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.ToBytes].inputs.input.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.ToBytes].inputs.encoding.id}),A=(((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value))||"utf8",D=kn(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class E2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_FROM_BYTES_TO_STRING,version:"1.0.0",description:"Convert Uint8Array to string (utf8|hex|base64|base64url)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.FromBytesToString);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.FromBytesToString].inputs.bytes.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(g=>{var w,$;return(($=(w=g.valueOwner)==null?void 0:w.declaration)==null?void 0:$.id)===j.operation[et.FromBytesToString].inputs.encoding.id}),A=(((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value))||"utf8",D=bd(m,A);return{value:F.Success,error:null,result:D}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class b2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64,version:"1.0.0",description:"Bytes -> base64 string (accepts string input by converting from utf8)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.EncodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(h=>{var m,T;return((T=(m=h.valueOwner)==null?void 0:m.declaration)==null?void 0:T.id)===j.operation[et.EncodeBase64].inputs.bytes.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value);return{value:F.Success,error:null,result:UMe(f,void 0)}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class A2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64,version:"1.0.0",description:"base64 string -> bytes (Uint8Array)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.DecodeBase64);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.DecodeBase64].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=jMe(String(f));return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class g2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_BASE64URL,version:"1.0.0",description:"Bytes -> base64url string (accepts string input by converting from utf8)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.EncodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.EncodeBase64Url].inputs.bytes.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=om(f,"utf8");return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class I2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_BASE64URL,version:"1.0.0",description:"base64url string -> bytes (Uint8Array)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.DecodeBase64Url);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.DecodeBase64Url].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=uy(String(f));return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class R2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_ENCODE_HEX,version:"1.0.0",description:"Bytes -> hex string (accepts string input by converting from utf8)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.EncodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.EncodeHex].inputs.bytes.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=FMe(f,"utf8");return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class w2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__DATA_TYPE_DECODE_HEX,version:"1.0.0",description:"hex string -> bytes (Uint8Array)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(et.DecodeHex);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c;try{const e=r.find(m=>{var T,b;return((b=(T=m.valueOwner)==null?void 0:T.declaration)==null?void 0:b.id)===j.operation[et.DecodeHex].inputs.value.id}),f=((a=e==null?void 0:e.value)==null?void 0:a.valueAsType)??((c=e==null?void 0:e.value)==null?void 0:c.value),h=KMe(String(f));return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class D2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HASH,version:"1.0.0",description:"Crypto: Hash (SHA-256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.Hash);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b;try{const A=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.alg.id}),D=((a=A==null?void 0:A.value)==null?void 0:a.valueAsType)??((c=A==null?void 0:A.value)==null?void 0:c.value),g=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.inputEncoding.id}),w=((e=g==null?void 0:g.value)==null?void 0:e.valueAsType)??((f=g==null?void 0:g.value)==null?void 0:f.value),$=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.data.id}),L=((h=$==null?void 0:$.value)==null?void 0:h.valueAsType)??((m=$==null?void 0:$.value)==null?void 0:m.value),V=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.Hash].inputs.outputEncoding.id}),k=((T=V==null?void 0:V.value)==null?void 0:T.valueAsType)??((b=V==null?void 0:V.value)==null?void 0:b.value);return{value:F.Success,error:null,result:ZMe(D,w,L,k)}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class C2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_HMAC,version:"1.0.0",description:"Crypto: HMAC (SHA-256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.Hmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w;try{const $=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.alg.id}),L=((a=$==null?void 0:$.value)==null?void 0:a.valueAsType)??((c=$==null?void 0:$.value)==null?void 0:c.value),V=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.dataEncoding.id}),k=((e=V==null?void 0:V.value)==null?void 0:e.valueAsType)??((f=V==null?void 0:V.value)==null?void 0:f.value),Y=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.data.id}),re=((h=Y==null?void 0:Y.value)==null?void 0:h.valueAsType)??((m=Y==null?void 0:Y.value)==null?void 0:m.value),ie=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.keyEncoding.id}),z=((T=ie==null?void 0:ie.value)==null?void 0:T.valueAsType)??((b=ie==null?void 0:ie.value)==null?void 0:b.value),te=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.key.id}),oe=((A=te==null?void 0:te.value)==null?void 0:A.valueAsType)??((D=te==null?void 0:te.value)==null?void 0:D.value),Q=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[li.Hmac].inputs.outputEncoding.id}),H=((g=Q==null?void 0:Q.value)==null?void 0:g.valueAsType)??((w=Q==null?void 0:Q.value)==null?void 0:w.value);return{value:F.Success,error:null,result:HMe(k,re,L,z,oe,H)}}catch($){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:$,result:null}}}})}}class O2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_CONSTANT_TIME_EQUAL,version:"1.0.0",description:"Crypto: constant-time equality for byte sequences",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.ConstantTimeEqual);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b;try{const A=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.aEncoding.id}),D=((a=A==null?void 0:A.value)==null?void 0:a.valueAsType)??((c=A==null?void 0:A.value)==null?void 0:c.value),g=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.a.id}),w=((e=g==null?void 0:g.value)==null?void 0:e.valueAsType)??((f=g==null?void 0:g.value)==null?void 0:f.value),$=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.bEncoding.id}),L=((h=$==null?void 0:$.value)==null?void 0:h.valueAsType)??((m=$==null?void 0:$.value)==null?void 0:m.value),V=r.find(Y=>{var re,ie;return((ie=(re=Y.valueOwner)==null?void 0:re.declaration)==null?void 0:ie.id)===j.operation[li.ConstantTimeEqual].inputs.b.id}),k=((T=V==null?void 0:V.value)==null?void 0:T.valueAsType)??((b=V==null?void 0:V.value)==null?void 0:b.value);return{value:F.Success,error:null,result:SMe(D,w,L,k)}}catch(A){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:A,result:null}}}})}}class _2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__CRYPTO_DERIVE_KEY_PBKDF2,version:"1.0.0",description:"Crypto: derive key with PBKDF2 (SHA-256/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(li.DeriveKeyPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k;try{const Y=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.passwordEncoding.id}),re=((a=Y==null?void 0:Y.value)==null?void 0:a.valueAsType)??((c=Y==null?void 0:Y.value)==null?void 0:c.value),ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.password.id}),z=((e=ie==null?void 0:ie.value)==null?void 0:e.valueAsType)??((f=ie==null?void 0:ie.value)==null?void 0:f.value),te=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.saltEncoding.id}),oe=((h=te==null?void 0:te.value)==null?void 0:h.valueAsType)??((m=te==null?void 0:te.value)==null?void 0:m.value),Q=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.salt.id}),H=((T=Q==null?void 0:Q.value)==null?void 0:T.valueAsType)??((b=Q==null?void 0:Q.value)==null?void 0:b.value),se=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.iterations.id}),ce=((A=se==null?void 0:se.value)==null?void 0:A.valueAsType)??((D=se==null?void 0:se.value)==null?void 0:D.value),le=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.outputEncoding.id}),he=((g=le==null?void 0:le.value)==null?void 0:g.valueAsType)??((w=le==null?void 0:le.value)==null?void 0:w.value),ve=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.length.id}),ge=(($=ve==null?void 0:ve.value)==null?void 0:$.valueAsType)??((L=ve==null?void 0:ve.value)==null?void 0:L.value),Ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[li.DeriveKeyPBKDF2].inputs.hashAlg.id}),ke=((V=Ie==null?void 0:Ie.value)==null?void 0:V.valueAsType)??((k=Ie==null?void 0:Ie.value)==null?void 0:k.value);return{value:F.Success,error:null,result:WMe(re,z,oe,H,ce,he,ge,ke)}}catch(Y){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:Y,result:null}}}})}}class P2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_PARSE,version:"1.0.0",description:"Json parse string into object operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Hn.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:F.Success,error:null,result:e}}catch(c){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:c,result:null}}}})}}class N2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_IN_OPERATIONS_IMPLEMENTATIONS__JSON_STRINGIFY,version:"1.0.0",description:"Json stringify object into string operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(Hn.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:F.Success,error:null,result:m}}const h=JSON.stringify(e,null,f);return{value:F.Success,error:null,result:h}}catch(e){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:e,result:null}}}})}}class x2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_BUILD_HMAC,version:"1.0.0",description:"JWT: build (HS256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(gi.BuildJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H;try{const se=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.header.id}),ce=((a=se==null?void 0:se.value)==null?void 0:a.valueAsType)??((c=se==null?void 0:se.value)==null?void 0:c.value),le=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.payload.id}),he=((e=le==null?void 0:le.value)==null?void 0:e.valueAsType)??((f=le==null?void 0:le.value)==null?void 0:f.value),ve=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.secret.id}),ge=((h=ve==null?void 0:ve.value)==null?void 0:h.valueAsType)??((m=ve==null?void 0:ve.value)==null?void 0:m.value),Ie=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.alg.id}),ke=((T=Ie==null?void 0:Ie.value)==null?void 0:T.valueAsType)??((b=Ie==null?void 0:Ie.value)==null?void 0:b.value),Me=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.includeIat.id}),Be=((A=Me==null?void 0:Me.value)==null?void 0:A.valueAsType)??((D=Me==null?void 0:Me.value)==null?void 0:D.value),Ce=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.expiresInSec.id}),qe=((g=Ce==null?void 0:Ce.value)==null?void 0:g.valueAsType)??((w=Ce==null?void 0:Ce.value)==null?void 0:w.value),Xe=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.notBeforeSec.id}),Ye=(($=Xe==null?void 0:Xe.value)==null?void 0:$.valueAsType)??((L=Xe==null?void 0:Xe.value)==null?void 0:L.value),ft=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.issuer.id}),$t=((V=ft==null?void 0:ft.value)==null?void 0:V.valueAsType)??((k=ft==null?void 0:ft.value)==null?void 0:k.value),mt=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.subject.id}),lt=((Y=mt==null?void 0:mt.value)==null?void 0:Y.valueAsType)??((re=mt==null?void 0:mt.value)==null?void 0:re.value),dt=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.audience.id}),vi=((ie=dt==null?void 0:dt.value)==null?void 0:ie.valueAsType)??((z=dt==null?void 0:dt.value)==null?void 0:z.value),Bi=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.secretEncoding.id}),gt=((te=Bi==null?void 0:Bi.value)==null?void 0:te.valueAsType)??((oe=Bi==null?void 0:Bi.value)==null?void 0:oe.value),ot=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[gi.BuildJwtHmac].inputs.jwtid.id}),Xt=((Q=ot==null?void 0:ot.value)==null?void 0:Q.valueAsType)??((H=ot==null?void 0:ot.value)==null?void 0:H.value);return{value:F.Success,error:null,result:await XMe(ce,he,ge,ke,Be,qe,Ye,$t,lt,vi,gt,Xt)}}catch(se){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:se,result:null}}}})}}class V2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_VERIFY_HMAC,version:"1.0.0",description:"JWT: verify (HS256/384/512)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(gi.VerifyJwtHmac);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k;try{const Y=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.token.id}),re=((a=Y==null?void 0:Y.value)==null?void 0:a.valueAsType)??((c=Y==null?void 0:Y.value)==null?void 0:c.value),ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.secret.id}),z=((e=ie==null?void 0:ie.value)==null?void 0:e.valueAsType)??((f=ie==null?void 0:ie.value)==null?void 0:f.value),te=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.alg.id}),oe=((h=te==null?void 0:te.value)==null?void 0:h.valueAsType)??((m=te==null?void 0:te.value)==null?void 0:m.value),Q=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.secretEncoding.id}),H=((T=Q==null?void 0:Q.value)==null?void 0:T.valueAsType)??((b=Q==null?void 0:Q.value)==null?void 0:b.value),se=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.issuer.id}),ce=((A=se==null?void 0:se.value)==null?void 0:A.valueAsType)??((D=se==null?void 0:se.value)==null?void 0:D.value),le=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.subject.id}),he=((g=le==null?void 0:le.value)==null?void 0:g.valueAsType)??((w=le==null?void 0:le.value)==null?void 0:w.value),ve=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.audience.id}),ge=(($=ve==null?void 0:ve.value)==null?void 0:$.valueAsType)??((L=ve==null?void 0:ve.value)==null?void 0:L.value),Ie=r.find(Me=>{var Be,Ce;return((Ce=(Be=Me.valueOwner)==null?void 0:Be.declaration)==null?void 0:Ce.id)===j.operation[gi.VerifyJwtHmac].inputs.maxAgeSeconds.id}),ke=((V=Ie==null?void 0:Ie.value)==null?void 0:V.valueAsType)??((k=Ie==null?void 0:Ie.value)==null?void 0:k.value);return{value:F.Success,error:null,result:await t2e(re,z,oe,H,ce,he,ge,ke)}}catch(Y){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:Y,result:null}}}})}}class $2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__JWT_DECODE,version:"1.0.0",description:"JWT: decode (no verification)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(gi.DecodeJwt);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(A=>{var D,g;return((g=(D=A.valueOwner)==null?void 0:D.declaration)==null?void 0:g.id)===j.operation[gi.DecodeJwt].inputs.token.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(A=>{var D,g;return((g=(D=A.valueOwner)==null?void 0:D.declaration)==null?void 0:g.id)===j.operation[gi.DecodeJwt].inputs.signatureOutputEncoding.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value);return{value:F.Success,error:null,result:r2e(m,b)}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}class L2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_HASH_PBKDF2,version:"1.0.0",description:"Password: hash (PBKDF2) -> envelope string",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Wr.HashPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w;try{const $=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.password.id}),L=((a=$==null?void 0:$.value)==null?void 0:a.valueAsType)??((c=$==null?void 0:$.value)==null?void 0:c.value),V=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.saltEncoding.id}),k=((e=V==null?void 0:V.value)==null?void 0:e.valueAsType)??((f=V==null?void 0:V.value)==null?void 0:f.value),Y=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.salt.id}),re=((h=Y==null?void 0:Y.value)==null?void 0:h.valueAsType)??((m=Y==null?void 0:Y.value)==null?void 0:m.value),ie=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.iterations.id}),z=((T=ie==null?void 0:ie.value)==null?void 0:T.valueAsType)??((b=ie==null?void 0:ie.value)==null?void 0:b.value),te=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.length.id}),oe=((A=te==null?void 0:te.value)==null?void 0:A.valueAsType)??((D=te==null?void 0:te.value)==null?void 0:D.value),Q=r.find(se=>{var ce,le;return((le=(ce=se.valueOwner)==null?void 0:ce.declaration)==null?void 0:le.id)===j.operation[Wr.HashPasswordPBKDF2].inputs.hashAlg.id}),H=((g=Q==null?void 0:Q.value)==null?void 0:g.valueAsType)??((w=Q==null?void 0:Q.value)==null?void 0:w.value);return{value:F.Success,error:null,result:await YMe(L,k,re,z,oe,H)}}catch($){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:$,result:null}}}})}}class B2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:$e.BUILT_INT_OPERATIONS_IMPLEMENTATIONS__PASSWORD_VERIFY_PBKDF2,version:"1.0.0",description:"Password: verify (PBKDF2) -> boolean",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Logic]});C(this,"module",{init:i=>{const r=i.find(c=>c.contextType===de.Logic),a=r==null?void 0:r.get(Wr.VerifyPasswordPBKDF2);a&&(a.autoexecutable=!0,a.implementation=this.module.main)},main:async(i,r)=>{var a,c,e,f;try{const h=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Wr.VerifyPasswordPBKDF2].inputs.password.id}),m=((a=h==null?void 0:h.value)==null?void 0:a.valueAsType)??((c=h==null?void 0:h.value)==null?void 0:c.value),T=r.find(D=>{var g,w;return((w=(g=D.valueOwner)==null?void 0:g.declaration)==null?void 0:w.id)===j.operation[Wr.VerifyPasswordPBKDF2].inputs.envelope.id}),b=((e=T==null?void 0:T.value)==null?void 0:e.valueAsType)??((f=T==null?void 0:T.value)==null?void 0:f.value),A=await JMe(String(m??""),String(b??""));return{value:F.Success,error:null,result:A}}catch(h){return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:h,result:null}}}})}}function M2e(s){var r;if(!Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION))return null;let u=null;const i=j["built-in-base-entity"].BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_ENTITY.properties.integration.id;if(s.type===d.BuiltInBaseEntity?Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION)&&(u=_P(s.name)):s.type===d.DefinitionEntity&&s.implements.forEach(a=>{if(Gi(a,Re.EXTERNAL_INTEGRATION_CONNECTION)){const c=_P(a==null?void 0:a.name);if(c)return u=c,!0}}),!u){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}));u=(r=a==null?void 0:a.getDefaultValue())==null?void 0:r.value}return u}function Z1i(s){return MTe[s]}function _P(s){return s.includes("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_")?s.replace("BUILT_IN_EXTERNAL_INTEGRATION_CONNECTION_","").toLocaleLowerCase().replace("_auth",""):null}function G2e(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 u=s;if(u.id.startsWith("external-integration--"))return u.id.split("--")[1]}if(s.type===d.Operation){const u=s.declaration;if(Object.values(je).includes(u.id))return u.id.split("--")[1]||null}return null}function H1i(s){if(!s)throw new Error("The integrationName parameter is required to resolve the base built-in name.");return Object.values(Re).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 W1i(s){return s.type===d.BuiltInBaseEntity||s.type===d.DefinitionEntity?M2e(s):s.type===d.ActionDescriptor||s.type===d.Operation?G2e(s):null}function Io(s){var a,c,e;if(!Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION))return null;let u=null;const i=GKe(s,Re.EXTERNAL_INTEGRATION_CONNECTION);if(!i)return null;const r=j["built-in-base-entity"][i.id].properties.connectionId.id;if(s.type===d.BuiltInBaseEntity){if(Gi(s,Re.EXTERNAL_INTEGRATION_CONNECTION)){const f=s.properties.find(h=>{var m;return((m=h.extends)==null?void 0:m.id)===r});f&&(u=(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 T;return((T=m.extends)==null?void 0:T.id)===r}));if(!f&&((c=s.extends)==null?void 0:c.type)===d.DefinitionEntity)return Io(s.extends);u=(e=f==null?void 0:f.getDefaultValue())==null?void 0:e.value}return u}class k2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackSendMessage,version:"1.0.0",description:"Send Slack message operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackSendMessage);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce;try{const le=((c=(a=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!le||!(le instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:le?"Invalid entity template value provided":"No entity template provided",result:null};const he=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],ve=Io(le),ge=((m=(h=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.channel.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.channel.id}))==null?void 0:T.value)==null?void 0:b.value),Ie=((D=(A=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.text.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.text.id}))==null?void 0:g.value)==null?void 0:w.value),ke=(((L=($=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.thread_ts.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.thread_ts.id}))==null?void 0:V.value)==null?void 0:k.value))||void 0,Me=typeof(((re=(Y=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:ie.value)==null?void 0:z.value))>"u"?void 0:!!(((oe=(te=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(mt=>{var lt,dt;return((dt=(lt=mt.valueOwner)==null?void 0:lt.declaration)==null?void 0:dt.id)===j.operation[je.SlackSendMessage].inputs.reply_broadcast.id}))==null?void 0:Q.value)==null?void 0:H.value));if(!ge||!Ie)return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Missing required inputs: channel and text",result:null};const Be={channel:ge,text:Ie};ke&&(Be.thread_ts=ke),typeof Me<"u"&&(Be.reply_broadcast=Me);const Ce=await he.getAccessToken(),qe=`${(se=he.env)==null?void 0:se.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${he.projectId}/${_r.slack}/${ve}`,Xe={Authorization:`Bearer ${Ce}`},Ye=await ds.post(`${qe}/chat.postMessage`,{data:Be},{headers:Xe}),ft=Ye&&(Ye.data??Ye),$t={channel:String((ft==null?void 0:ft.channel)??ge),message:String(((ce=ft==null?void 0:ft.message)==null?void 0:ce.text)??Ie),ok:!!(ft!=null&&ft.ok),raw_json:JSON.stringify(ft??{}),ts:String((ft==null?void 0:ft.ts)??"")};return ee.Logger.log("[Slack] chat.postMessage via proxy response:",$t),{value:F.Success,error:null,result:{channel:$t.channel,message:$t.message,ok:$t.ok,raw_json:$t.raw_json,ts:$t.ts}}}catch(le){return ee.Logger.error("[Slack] Error sending message via proxy:",le),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:le,result:null}}}})}}class j2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackChannels,version:"1.0.0",description:"Get Slack channels operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackChannels);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge,Ie,ke,Me,Be,Ce,qe,Xe,Ye,ft,$t,mt,lt,dt;try{const vi=((c=(a=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!vi||!(vi instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid or missing connection entity",result:null};const Bi=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],gt=Io(vi),ot=(((m=(h=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.types.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.types.id}))==null?void 0:T.value)==null?void 0:b.value))||[],Xt=((D=(A=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.excludeArchived.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.excludeArchived.id}))==null?void 0:g.value)==null?void 0:w.value)??!1,it=(((L=($=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageSize.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageSize.id}))==null?void 0:V.value)==null?void 0:k.value))||200,yt=(((re=(Y=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageToken.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.pageToken.id}))==null?void 0:ie.value)==null?void 0:z.value))||void 0,Rt=(((oe=(te=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.onlyJoined.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.onlyJoined.id}))==null?void 0:Q.value)==null?void 0:H.value))||!1,an=(((ce=(se=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.teamId.id}))==null?void 0:se.value)==null?void 0:ce.valueAsType)??((he=(le=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.teamId.id}))==null?void 0:le.value)==null?void 0:he.value))||void 0,Pr=(((ge=(ve=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.joinPublicChannels.id}))==null?void 0:ve.value)==null?void 0:ge.valueAsType)??((ke=(Ie=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.joinPublicChannels.id}))==null?void 0:Ie.value)==null?void 0:ke.value))||!1,ca=(((Be=(Me=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.autoPaginate.id}))==null?void 0:Me.value)==null?void 0:Be.valueAsType)??((qe=(Ce=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.autoPaginate.id}))==null?void 0:Ce.value)==null?void 0:qe.value))||!1,Qn=(lt=(mt=((Ye=(Xe=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.nameContains.id}))==null?void 0:Xe.value)==null?void 0:Ye.valueAsType)??(($t=(ft=r.find(ct=>{var It,Gt;return((Gt=(It=ct.valueOwner)==null?void 0:It.declaration)==null?void 0:Gt.id)===j.operation[je.SlackChannels].inputs.nameContains.id}))==null?void 0:ft.value)==null?void 0:$t.value))==null?void 0:mt.trim())==null?void 0:lt.toLowerCase(),Ni=await Bi.getAccessToken(),ii=`${(dt=Bi.env)==null?void 0:dt.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${Bi.projectId}/${_r.slack}/${gt}`,ri={Authorization:`Bearer ${Ni}`},Xn={limit:String(Math.min(Math.max(1,it),999)),types:(ot.length?ot:["public_channel","private_channel"]).join(","),exclude_archived:String(!!Xt)};an&&(Xn.team_id=an);const Mn=async ct=>{var ut;const It={...Xn};ct&&(It.cursor=ct);const Gt=new URLSearchParams(It).toString(),{data:Pt}=await ds.get(`${ii}/conversations.list?${Gt}`,{headers:ri});if(!(Pt!=null&&Pt.ok))throw new Error((Pt==null?void 0:Pt.error)||"Slack API error");const Ct=Array.isArray(Pt.channels)?Pt.channels:[],He=((ut=Pt==null?void 0:Pt.response_metadata)==null?void 0:ut.next_cursor)||"";return{channels:Ct,nextCursor:He}};let Nr=[],wr=yt||"";if(ca){let ct=0;do{const{channels:It,nextCursor:Gt}=await Mn(wr||void 0);Nr=Nr.concat(It),wr=Gt,ct+=1}while(wr&&ct<50)}else{const{channels:ct,nextCursor:It}=await Mn(wr||void 0);Nr=ct,wr=It}if(Rt&&(Nr=Nr.filter(ct=>(ct==null?void 0:ct.is_member)===!0)),Qn&&(Nr=Nr.filter(ct=>{var It;return(It=ct==null?void 0:ct.name)==null?void 0:It.toLowerCase().includes(Qn)})),Pr){for(const ct of Nr)if(ct!=null&&ct.is_channel&&!(ct!=null&&ct.is_private)&&!(ct!=null&&ct.is_shared)&&(ct==null?void 0:ct.is_member)===!1)try{await ds.post(`${ii}/conversations.join`,{channel:ct.id},{headers:ri})}catch(It){ee.Logger.warn(`[Slack] conversations.join failed for ${ct==null?void 0:ct.id}`,It)}}const Zt=Nr.map(ct=>({id:ct.id,name:ct.name,name_normalized:ct.name_normalized,is_shared:!!ct.is_shared,is_private:!!ct.is_private,is_mpim:!!ct.is_mpim,is_im:!!ct.is_im,is_group:!!ct.is_group,is_channel:!!ct.is_channel,is_archived:!!ct.is_archived,is_general:!!ct.is_general,created:ct.created,updated:ct.updated,creator:ct.creator,num_members:typeof ct.num_members=="number"?ct.num_members:null,raw_json:JSON.stringify(ct)})),jt=ca?null:wr||null;return ee.Logger.log("[Slack] List channels response:",{count:Zt.length,next:jt}),{value:F.Success,error:null,result:{records:Zt,nextPageToken:jt}}}catch(vi){return ee.Logger.error("[Slack] List channels error:",vi),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:vi,result:null}}}})}}class U2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackMessages,version:"1.0.0",description:"Get Slack messages (conversations.history)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackMessages);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge,Ie,ke,Me,Be,Ce,qe,Xe,Ye,ft,$t,mt,lt,dt,vi,Bi,gt,ot;try{const Xt=((c=(a=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!Xt||!(Xt instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid or missing connection entity",result:null};const it=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],yt=Io(Xt),Rt=((m=(h=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.channel.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.channel.id}))==null?void 0:T.value)==null?void 0:b.value),an=(((D=(A=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageSize.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageSize.id}))==null?void 0:g.value)==null?void 0:w.value))||200,Pr=(((L=($=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageToken.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.pageToken.id}))==null?void 0:V.value)==null?void 0:k.value))||void 0,ca=(((re=(Y=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.oldest.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.oldest.id}))==null?void 0:ie.value)==null?void 0:z.value))||void 0,Qn=(((oe=(te=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.latest.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.latest.id}))==null?void 0:Q.value)==null?void 0:H.value))||void 0,Ni=((ce=(se=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.inclusive.id}))==null?void 0:se.value)==null?void 0:ce.valueAsType)??((he=(le=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.inclusive.id}))==null?void 0:le.value)==null?void 0:he.value)??!1,ii=((ge=(ve=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.includeAllMetadata.id}))==null?void 0:ve.value)==null?void 0:ge.valueAsType)??((ke=(Ie=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.includeAllMetadata.id}))==null?void 0:Ie.value)==null?void 0:ke.value)??!1,ri=((Be=(Me=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.autoPaginate.id}))==null?void 0:Me.value)==null?void 0:Be.valueAsType)??((qe=(Ce=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.autoPaginate.id}))==null?void 0:Ce.value)==null?void 0:qe.value)??!1,Xn=(lt=(mt=((Ye=(Xe=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.textContains.id}))==null?void 0:Xe.value)==null?void 0:Ye.valueAsType)??(($t=(ft=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.textContains.id}))==null?void 0:ft.value)==null?void 0:$t.value))==null?void 0:mt.trim())==null?void 0:lt.toLowerCase(),Mn=((vi=(dt=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.onlyThreadRoots.id}))==null?void 0:dt.value)==null?void 0:vi.valueAsType)??((gt=(Bi=r.find(He=>{var ut,Bt;return((Bt=(ut=He.valueOwner)==null?void 0:ut.declaration)==null?void 0:Bt.id)===j.operation[je.SlackMessages].inputs.onlyThreadRoots.id}))==null?void 0:Bi.value)==null?void 0:gt.value)??!1;if(!Rt)return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Missing required input: channel",result:null};const Nr=await it.getAccessToken(),wr=`${(ot=it.env)==null?void 0:ot.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${it.projectId}/${_r.slack}/${yt}`,Zt={Authorization:`Bearer ${Nr}`},jt={channel:Rt,limit:String(Math.min(Math.max(1,an),999)),inclusive:String(!!Ni),include_all_metadata:String(!!ii)};ca&&(jt.oldest=ca),Qn&&(jt.latest=Qn);const ct=async He=>{var Id;const ut={...jt};He&&(ut.cursor=He);const Bt=new URLSearchParams(ut).toString(),{data:ea}=await ds.get(`${wr}/conversations.history?${Bt}`,{headers:Zt});if(!(ea!=null&&ea.ok))throw new Error((ea==null?void 0:ea.error)||"Slack API error");const cl=Array.isArray(ea.messages)?ea.messages:[],ks=((Id=ea==null?void 0:ea.response_metadata)==null?void 0:Id.next_cursor)||"";return{messages:cl,nextCursor:ks}};let It=[],Gt=Pr||"";if(ri){let He=0;do{const{messages:ut,nextCursor:Bt}=await ct(Gt||void 0);It=It.concat(ut),Gt=Bt,He+=1}while(Gt&&He<50)}else{const{messages:He,nextCursor:ut}=await ct(Gt||void 0);It=He,Gt=ut}Xn&&(It=It.filter(He=>{var ut,Bt;return(Bt=(ut=He==null?void 0:He.text)==null?void 0:ut.toLowerCase)==null?void 0:Bt.call(ut).includes(Xn)})),Mn&&(It=It.filter(He=>typeof(He==null?void 0:He.reply_count)=="number"&&He.reply_count>0));const Pt=It.map(He=>({ts:He.ts,text:He.text,user:He.user,type:He.type,thread_ts:He.thread_ts,reply_count:typeof He.reply_count=="number"?He.reply_count:null,latest_reply:He.latest_reply,subtype:He.subtype,bot_id:He.bot_id,team:He.team,raw_json:JSON.stringify(He)})),Ct=ri?null:Gt||null;return{value:F.Success,error:null,result:{records:Pt,nextPageToken:Ct}}}catch(Xt){return ee.Logger.error("[Slack] conversations.history error:",Xt),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:Xt,result:null}}}})}}class F2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.SlackReplies,version:"1.0.0",description:"Get Slack thread replies (conversations.replies)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.SlackReplies);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge,Ie,ke,Me,Be,Ce,qe,Xe,Ye,ft,$t,mt,lt,dt,vi,Bi;try{const gt=((c=(a=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!gt||!(gt instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid or missing connection entity",result:null};const ot=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],Xt=Io(gt),it=((m=(h=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.channel.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.channel.id}))==null?void 0:T.value)==null?void 0:b.value),yt=((D=(A=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.threadTs.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.threadTs.id}))==null?void 0:g.value)==null?void 0:w.value),Rt=(((L=($=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageSize.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageSize.id}))==null?void 0:V.value)==null?void 0:k.value))||200,an=(((re=(Y=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageToken.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.pageToken.id}))==null?void 0:ie.value)==null?void 0:z.value))||void 0,Pr=(((oe=(te=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.oldest.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.oldest.id}))==null?void 0:Q.value)==null?void 0:H.value))||void 0,ca=(((ce=(se=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.latest.id}))==null?void 0:se.value)==null?void 0:ce.valueAsType)??((he=(le=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.latest.id}))==null?void 0:le.value)==null?void 0:he.value))||void 0,Qn=((ge=(ve=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.inclusive.id}))==null?void 0:ve.value)==null?void 0:ge.valueAsType)??((ke=(Ie=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.inclusive.id}))==null?void 0:Ie.value)==null?void 0:ke.value)??!1,Ni=((Be=(Me=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeAllMetadata.id}))==null?void 0:Me.value)==null?void 0:Be.valueAsType)??((qe=(Ce=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeAllMetadata.id}))==null?void 0:Ce.value)==null?void 0:qe.value)??!1,ii=((Ye=(Xe=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.autoPaginate.id}))==null?void 0:Xe.value)==null?void 0:Ye.valueAsType)??(($t=(ft=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.autoPaginate.id}))==null?void 0:ft.value)==null?void 0:$t.value)??!1,ri=((lt=(mt=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeParent.id}))==null?void 0:mt.value)==null?void 0:lt.valueAsType)??((vi=(dt=r.find(Pt=>{var Ct,He;return((He=(Ct=Pt.valueOwner)==null?void 0:Ct.declaration)==null?void 0:He.id)===j.operation[je.SlackReplies].inputs.includeParent.id}))==null?void 0:dt.value)==null?void 0:vi.value)??!0;if(!it||!yt)return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Missing required inputs: channel and threadTs",result:null};const Xn=await ot.getAccessToken(),Mn=`${(Bi=ot.env)==null?void 0:Bi.API_BASE_URL}/editor-runtime/v1/external-integrations/proxy/${ot.projectId}/${_r.slack}/${Xt}`,Nr={Authorization:`Bearer ${Xn}`},wr={channel:it,ts:yt,limit:String(Math.min(Math.max(1,Rt),999)),inclusive:String(!!Qn),include_all_metadata:String(!!Ni)};Pr&&(wr.oldest=Pr),ca&&(wr.latest=ca);const Zt=async Pt=>{var cl;const Ct={...wr};Pt&&(Ct.cursor=Pt);const He=new URLSearchParams(Ct).toString(),{data:ut}=await ds.get(`${Mn}/conversations.replies?${He}`,{headers:Nr});if(!(ut!=null&&ut.ok))throw new Error((ut==null?void 0:ut.error)||"Slack API error");const Bt=Array.isArray(ut.messages)?ut.messages:[],ea=((cl=ut==null?void 0:ut.response_metadata)==null?void 0:cl.next_cursor)||"";return{messages:Bt,nextCursor:ea}};let jt=[],ct=an||"";if(ii){let Pt=0;do{const{messages:Ct,nextCursor:He}=await Zt(ct||void 0);jt=jt.concat(Ct),ct=He,Pt+=1}while(ct&&Pt<50)}else{const{messages:Pt,nextCursor:Ct}=await Zt(ct||void 0);jt=Pt,ct=Ct}ri||(jt=jt.filter(Pt=>(Pt==null?void 0:Pt.ts)!==yt));const It=jt.map(Pt=>({ts:Pt.ts,text:Pt.text,user:Pt.user,type:Pt.type,thread_ts:Pt.thread_ts,subtype:Pt.subtype,bot_id:Pt.bot_id,team:Pt.team,raw_json:JSON.stringify(Pt)})),Gt=ii?null:ct||null;return{value:F.Success,error:null,result:{records:It,nextPageToken:Gt}}}catch(gt){return ee.Logger.error("[Slack] conversations.replies error:",gt),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:gt,result:null}}}})}}function z1i(s){return!!s&&typeof s=="object"&&typeof s.presignedUrl=="string"}function Hg(s,u){return ee.Logger.log("[Gmail] send email error:",u),{value:s.catchesError||s.errorCalls.length?F.CaughtError:F.UnhandledError,error:u,result:null}}function J1i(s){if(s!=null)return Array.isArray(s)?s.filter(Boolean).join(", "):s}function Xf(s,u){const i=J1i(u);return i?`${s}: ${i}`:null}function Y1i(s){return Buffer.from(s,"utf8").toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function Q1i(s){const{from:u,to:i,subject:r,body:a,bodyHtml:c,cc:e,bcc:f,replyTo:h,headers:m={}}=s,T=Object.entries(m).map(([w,$])=>Xf(w,$)).filter(w=>w!=null),b=c?'Content-Type: text/html; charset="UTF-8"':'Content-Type: text/plain; charset="UTF-8"',g=[...[Xf("From",u),Xf("To",i),Xf("Cc",e),Xf("Bcc",f),Xf("Reply-To",h),Xf("Subject",r),...T,"MIME-Version: 1.0",b].filter(w=>w!=null),"",c??a??""].join(`\r
|
|
55
55
|
`);return Y1i(g)}class K2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.GoogleMailSendEmail,version:"1.0.0",description:"Send Gmail email operation implementation module (direct API)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.GoogleMailSendEmail);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w;try{const $=(c=(a=r.find(Xe=>{var Ye;return((Ye=Xe.valueOwner.declaration)==null?void 0:Ye.id)===j.operation["external-integration--google-mail--post--send-email"].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType;if(!($ instanceof jn))return Hg(i,"Invalid or missing connection entity");const L=((f=(e=r.find(Xe=>{var Ye;return((Ye=Xe.valueOwner.declaration)==null?void 0:Ye.id)===j.operation["external-integration--google-mail--post--send-email"].inputs.from.id}))==null?void 0:e.value)==null?void 0:f.value)||"",V=((m=(h=r.find(Xe=>{var Ye;return((Ye=Xe.valueOwner.declaration)==null?void 0:Ye.id)===j.operation["external-integration--google-mail--post--send-email"].inputs.to.id}))==null?void 0:h.value)==null?void 0:m.value)||"",k=((b=(T=r.find(Xe=>{var Ye;return((Ye=Xe.valueOwner.declaration)==null?void 0:Ye.id)===j.operation["external-integration--google-mail--post--send-email"].inputs.subject.id}))==null?void 0:T.value)==null?void 0:b.value)||"",Y=((D=(A=r.find(Xe=>{var Ye;return((Ye=Xe.valueOwner.declaration)==null?void 0:Ye.id)===j.operation["external-integration--google-mail--post--send-email"].inputs.body.id}))==null?void 0:A.value)==null?void 0:D.value)||"",re=null,ie="",z="",te="",oe="",Q={};if(!L||!V)return Hg(i,"`from` and `to` are required");const H=Io($);if(!H)return Hg(i,"Connection entity is missing the Connection ID value");const se=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],le={Authorization:`Bearer ${await se.getAccessToken()}`},he=`${(g=se.env)==null?void 0:g.API_BASE_URL}/editor-runtime/v1/external-integrations/generic-proxy/${se.projectId}/${_r["google-mail"]}/${H}`,ve=async Xe=>ds.post(he,Xe,{headers:le}),ge=async Xe=>{const Ye=Xe.data;if(z1i(Ye)){const ft=await ds.get(Ye.presignedUrl,{responseType:"text"}),$t=typeof ft.data=="string"?ft.data:new TextDecoder().decode(ft.data),mt=JSON.parse($t);return{status:Ye.status??200,headers:Ye.headers,data:mt}}else return Ye},ke={raw:Q1i({from:L,to:V,subject:k,body:Y,bodyHtml:re,cc:ie,bcc:z,replyTo:te,headers:Q})},Me=await ve({method:"POST",endpoint:"/gmail/v1/users/me/messages/send",data:ke,retries:3}),Be=await ge(Me);if(Be.status<200||Be.status>=300){const Xe=Be.data&&Be.data.error&&Be.data.error.message||`Gmail send failed (status=${Be.status})`;return Hg(i,Xe)}const{id:Ce,threadId:qe}=Be.data||{};return ee.Logger.log("[Google Mail] Send email response:",{id:Ce,threadId:qe}),{value:F.Success,error:null,result:{id:Ce,threadId:qe??null}}}catch($){const L=((w=$.response)==null?void 0:w.data)||$.message||$;return ee.Logger.error("[Gmail] Send email failed:",L),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:L,result:null}}}})}}function X1i(s){return!!s&&typeof s=="object"&&typeof s.presignedUrl=="string"}const ewi=["From","To","Cc","Bcc","Reply-To","Subject","Date","Message-ID"];function _U(s){if(s==null)return;if(typeof s=="number")return Math.floor(s);const u=Date.parse(s);if(!Number.isNaN(u))return Math.floor(u/1e3)}function twi(s,u,i){if(s&&s.trim())return s.trim();const r=[],a=_U(u),c=_U(i);return a&&r.push(`after:${a}`),c&&r.push(`before:${c}`),r.length?r.join(" "):void 0}function iwi(s,u=!0){const i={};if(!s)return i;for(const r of s){const a=u?r.name.toLowerCase():r.name;i[a]=r.value}return i}function PU(s){let u=s.replace(/-/g,"+").replace(/_/g,"/");const i=u.length%4;i&&(u+="=".repeat(4-i));const r=atob(u),a=new Uint8Array(r.length);for(let c=0;c<r.length;c++)a[c]=r.charCodeAt(c);return new TextDecoder("utf-8").decode(a)}function rwi(s,u,i){var f;let r=null,a=null;const c=[],e=h=>{var b,A,D;if(!h)return;const m=h.mimeType||"";if(((b=h.body)==null?void 0:b.data)&&typeof h.body.data=="string"&&(m==="text/plain"&&(u==="text"||u==="both"||u==="auto")&&!r?r=PU(h.body.data):m==="text/html"&&(u==="html"||u==="both"||u==="auto")&&!a&&(a=PU(h.body.data))),i!=="none"&&h.filename&&((A=h.body)!=null&&A.attachmentId)&&c.push({attachmentId:h.body.attachmentId,filename:h.filename,mimeType:h.mimeType||"application/octet-stream",size:typeof h.body.size=="number"?h.body.size:null}),(D=h.parts)!=null&&D.length)for(const g of h.parts)e(g)};if(s.payload&&(e(s.payload),(f=s.payload.parts)!=null&&f.length))for(const h of s.payload.parts)e(h);return{text:r,html:a,attachments:c}}async function nwi(s,u,i){const r=new Array(s.length);let a=0,c=0;return new Promise((e,f)=>{const h=()=>{if(a>=s.length&&c===0)return e(r);for(;c<u&&a<s.length;){const m=a++;c++,i(s[m],m).then(T=>{r[m]=T,c--,h()}).catch(f)}};h()})}class S2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.GoogleMailEmails,version:"1.0.0",description:"Gmail: list & fetch messages with optional body/attachments",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.GoogleMailEmails);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge,Ie,ke,Me,Be,Ce,qe,Xe,Ye,ft,$t,mt,lt,dt,vi,Bi,gt,ot,Xt,it,yt,Rt,an,Pr,ca,Qn,Ni,ii,ri,Xn,Mn;try{const Nr=((c=(a=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!(Nr instanceof jn))return NU(i,"Invalid or missing connection entity");const wr=(A=((m=(h=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.q.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.q.id}))==null?void 0:T.value)==null?void 0:b.value))==null?void 0:A.trim(),Zt=((g=(D=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.after.id}))==null?void 0:D.value)==null?void 0:g.valueAsType)??(($=(w=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.after.id}))==null?void 0:w.value)==null?void 0:$.value),jt=((V=(L=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.before.id}))==null?void 0:L.value)==null?void 0:V.valueAsType)??((Y=(k=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.before.id}))==null?void 0:k.value)==null?void 0:Y.value),ct=(((ie=(re=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.labelIds.id}))==null?void 0:re.value)==null?void 0:ie.valueAsType)??((te=(z=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.labelIds.id}))==null?void 0:z.value)==null?void 0:te.value))||[],It=((Q=(oe=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.pageSize.id}))==null?void 0:oe.value)==null?void 0:Q.valueAsType)??((se=(H=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.pageSize.id}))==null?void 0:H.value)==null?void 0:se.value)??100,Gt=(((le=(ce=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.pageToken.id}))==null?void 0:ce.value)==null?void 0:le.valueAsType)??((ve=(he=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.pageToken.id}))==null?void 0:he.value)==null?void 0:ve.value))||void 0,Pt=((Ie=(ge=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.autoPaginate.id}))==null?void 0:ge.value)==null?void 0:Ie.valueAsType)??((Me=(ke=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.autoPaginate.id}))==null?void 0:ke.value)==null?void 0:Me.value)??!1,Ct=((Ce=(Be=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.includeBody.id}))==null?void 0:Be.value)==null?void 0:Ce.valueAsType)??((Xe=(qe=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.includeBody.id}))==null?void 0:qe.value)==null?void 0:Xe.value)??"auto",He=((ft=(Ye=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.attachmentsMode.id}))==null?void 0:Ye.value)==null?void 0:ft.valueAsType)??((mt=($t=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.attachmentsMode.id}))==null?void 0:$t.value)==null?void 0:mt.value)??"metadata",ut=((gt=((dt=(lt=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.includeHeaders.id}))==null?void 0:lt.value)==null?void 0:dt.valueAsType)??((Bi=(vi=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.includeHeaders.id}))==null?void 0:vi.value)==null?void 0:Bi.value))==null?void 0:gt.filter(Boolean))||ewi,Bt=((Xt=(ot=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.includeSpamTrash.id}))==null?void 0:ot.value)==null?void 0:Xt.valueAsType)??((yt=(it=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.includeSpamTrash.id}))==null?void 0:it.value)==null?void 0:yt.value)??!1,ea=((an=(Rt=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.maxPages.id}))==null?void 0:Rt.value)==null?void 0:an.valueAsType)??((ca=(Pr=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.maxPages.id}))==null?void 0:Pr.value)==null?void 0:ca.value)??10,cl=((Ni=(Qn=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.maxMessages.id}))==null?void 0:Qn.value)==null?void 0:Ni.valueAsType)??((ri=(ii=r.find(Ft=>{var ht,wt;return((wt=(ht=Ft.valueOwner)==null?void 0:ht.declaration)==null?void 0:wt.id)===j.operation[je.GoogleMailEmails].inputs.maxMessages.id}))==null?void 0:ii.value)==null?void 0:ri.value),ks=Math.max(1,Math.min(500,Math.floor(It))),Id=Io(Nr);if(!Id)return NU(i,"Connection entity is missing the Connection ID value");const Ul=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],lA={Authorization:`Bearer ${await Ul.getAccessToken()}`},oA=`${((Xn=Ul.env)==null?void 0:Xn.API_BASE_URL)+"/editor-runtime"}/v1/external-integrations/generic-proxy/${Ul.projectId}/${_r["google-mail"]}/${Id}`,L0=async Ft=>ds.post(oA,Ft,{headers:lA}),B0=async Ft=>{const ht=Ft.data;if(X1i(ht)){const wt=await ds.get(ht.presignedUrl,{responseType:"text"}),ys=typeof wt.data=="string"?wt.data:new TextDecoder().decode(wt.data),fa=JSON.parse(ys);return{status:ht.status??200,headers:ht.headers,data:fa}}else return ht},M0=twi(wr,Zt,jt),G0=async Ft=>{var fa,eh;const ht={maxResults:String(ks)};M0&&(ht.q=M0),Ft&&(ht.pageToken=Ft),Bt&&(ht.includeSpamTrash="true"),ct&&ct.length&&(ht.labelIds=ct);const wt=await L0({method:"GET",endpoint:"/gmail/v1/users/me/messages",params:ht,retries:5}),ys=await B0(wt);if(ys.status!==200)throw new Error(`Gmail list failed (status=${ys.status})`);return{messages:Array.isArray((fa=ys.data)==null?void 0:fa.messages)?ys.data.messages:[],nextPageToken:((eh=ys.data)==null?void 0:eh.nextPageToken)||""}},k0=Ct!=="none"||He!=="none",wu=async Ft=>{var hs;const ht=k0?{format:"full"}:{format:"metadata",metadataHeaders:ut},wt=await L0({method:"GET",endpoint:`/gmail/v1/users/me/messages/${encodeURIComponent(Ft)}`,params:ht,retries:5}),ys=await B0(wt);if(ys.status!==200)throw new Error(`Gmail message fetch failed (status=${ys.status})`);const fa=ys.data,eh=iwi((hs=fa.payload)==null?void 0:hs.headers),es=th=>eh[th.toLowerCase()]||null,U0=fa.internalDate?Number(fa.internalDate):NaN,Cu=Number.isFinite(U0)?U0:Date.now();let Pf=null,F0=null,Nf=null;if(k0){const{text:th,html:pA,attachments:K0}=rwi(fa,Ct,He);Pf=th??null,F0=pA??null,Nf=K0&&K0.length?K0:null}return{id:fa.id,threadId:fa.threadId,labelIds:fa.labelIds||null,internalDateMs:Cu,dateIso:new Date(Cu).toISOString(),from:es("From"),to:es("To"),cc:es("Cc"),bcc:es("Bcc"),replyTo:es("Reply-To"),subject:es("Subject"),messageId:es("Message-ID"),snippet:fa.snippet??null,bodyText:Pf,bodyHtml:F0,attachments:Nf,raw_json:JSON.stringify(fa)}},xp=[];let Du=Gt||"",dA=0;const j0=async Ft=>{const ht=Ft.map(fa=>fa.id),ys=await nwi(ht,5,fa=>wu(fa));xp.push(...ys)};if(Pt)do{const{messages:Ft,nextPageToken:ht}=await G0(Du||void 0);if(Ft.length&&await j0(Ft),Du=ht,dA+=1,ea&&dA>=ea)break;if(typeof cl=="number"&&xp.length>=cl){xp.splice(cl),Du="";break}}while(Du);else{const{messages:Ft,nextPageToken:ht}=await G0(Du||void 0);Ft.length&&await j0(Ft),Du=ht}const uA=Pt?null:Du||null;return{value:F.Success,error:null,result:{records:xp,nextPageToken:uA}}}catch(Nr){const wr=((Mn=Nr.response)==null?void 0:Mn.data)||Nr.message||Nr;return ee.Logger.error("[Gmail] Get emails failed:",wr),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:wr,result:null}}}})}}function NU(s,u){return ee.Logger.log("[Gmail] error:",u),{value:s.catchesError||s.errorCalls.length?F.CaughtError:F.UnhandledError,error:u,result:null}}class q2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.GoogleDriveFiles,version:"1.0.0",description:"Get Google Drive files operation implementation module",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.GoogleDriveFiles);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k,Y,re,ie,z,te,oe,Q,H,se,ce,le,he,ve,ge;try{const Ie=((c=(a=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value);if(!Ie)return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"No entity template provided",result:null};if(!(Ie instanceof jn))return{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:"Invalid entity template value provided",result:null};const ke=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],Me=Io(Ie),Be=(((m=(h=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.mimeTypes.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.mimeTypes.id}))==null?void 0:T.value)==null?void 0:b.value))||[],Ce=(((D=(A=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.filesFilter.id}))==null?void 0:A.value)==null?void 0:D.valueAsType)??((w=(g=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.filesFilter.id}))==null?void 0:g.value)==null?void 0:w.value))||[],qe=(((L=($=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.foldersFilter.id}))==null?void 0:$.value)==null?void 0:L.valueAsType)??((k=(V=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.foldersFilter.id}))==null?void 0:V.value)==null?void 0:k.value))||[],Xe=(((re=(Y=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.trashed.id}))==null?void 0:Y.value)==null?void 0:re.valueAsType)??((z=(ie=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.trashed.id}))==null?void 0:ie.value)==null?void 0:z.value))||!1,Ye=(((oe=(te=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.pageSize.id}))==null?void 0:te.value)==null?void 0:oe.valueAsType)??((H=(Q=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.pageSize.id}))==null?void 0:Q.value)==null?void 0:H.value))||100,ft=((ce=(se=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.pageToken.id}))==null?void 0:se.value)==null?void 0:ce.valueAsType)??((he=(le=r.find(gt=>{var ot,Xt;return((Xt=(ot=gt.valueOwner)==null?void 0:ot.declaration)==null?void 0:Xt.id)===j.operation[je.GoogleDriveFiles].inputs.pageToken.id}))==null?void 0:le.value)==null?void 0:he.value),$t=Ce.length?`and (${Ce.map(gt=>`id='${gt}'`).join(" or ")})`:"",mt=qe.length?`and (${qe.map(gt=>`'${gt}' in parents`).join(" or ")})`:"",lt=Be.length?`and (${Be.map(gt=>`mimeType='${gt}'`).join(" or ")})`:"",dt={fields:"files(id, name, mimeType, webViewLink, parents, modifiedTime), nextPageToken",pageSize:Ye.toString(),q:`trashed = ${Xe} ${$t} ${mt} ${lt}`.trim(),corpora:"allDrives",supportsAllDrives:"true",includeItemsFromAllDrives:"true"};ft&&(dt.pageToken=ft);const vi=new URLSearchParams(dt).toString(),Bi=await ds.get(`${((ve=ke.env)==null?void 0:ve.API_BASE_URL)+"/editor-runtime"}/v1/external-integrations/proxy/${ke.projectId}/${_r["google-drive"]}/${Me}/drive/v3/files?${vi}`,{headers:{Authorization:`Bearer ${await ke.getAccessToken()}`}});return ee.Logger.log("[Google Drive] Get files response:",Bi.data),{value:F.Success,error:null,result:{records:Bi.data.files||[],nextPageToken:Bi.data.nextPageToken}}}catch(Ie){const ke=((ge=Ie.response)==null?void 0:ge.data)||Ie.message||Ie;return console.error("[Google Drive] Get files failed:",ke),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:ke,result:null}}}})}}function awi(s){return!!s&&typeof s=="object"&&typeof s.presignedUrl=="string"}class Z2e extends Ve{constructor(){super(...arguments);C(this,"manifest",{id:as+je.GoogleDriveSmartFetchDocument,version:"1.0.2",description:"Google Drive: smart fetch document (Docs/Sheets JSON, text, or binary)",initPriority:Ne.High,permissions:[xe.All],contexts:[de.Editor,de.Logic]});C(this,"module",{init:i=>{const r=i.find(a=>a.contextType===de.Logic);if(r){const a=r.get(je.GoogleDriveSmartFetchDocument);a&&(a.implementation=this.module.main)}},main:async(i,r)=>{var a,c,e,f,h,m,T,b,A,D,g,w,$,L,V,k;try{const Y=((c=(a=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[je.GoogleDriveSmartFetchDocument].inputs.connection.id}))==null?void 0:a.value)==null?void 0:c.valueAsType)??((f=(e=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[je.GoogleDriveSmartFetchDocument].inputs.connection.id}))==null?void 0:e.value)==null?void 0:f.value),re=(A=((m=(h=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[je.GoogleDriveSmartFetchDocument].inputs.fileId.id}))==null?void 0:h.value)==null?void 0:m.valueAsType)??((b=(T=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[je.GoogleDriveSmartFetchDocument].inputs.fileId.id}))==null?void 0:T.value)==null?void 0:b.value))==null?void 0:A.trim(),ie=(((g=(D=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[je.GoogleDriveSmartFetchDocument].inputs.mode.id}))==null?void 0:D.value)==null?void 0:g.valueAsType)??(($=(w=r.find(it=>{var yt,Rt;return((Rt=(yt=it.valueOwner)==null?void 0:yt.declaration)==null?void 0:Rt.id)===j.operation[je.GoogleDriveSmartFetchDocument].inputs.mode.id}))==null?void 0:w.value)==null?void 0:$.value))||"auto";if(!Y||!(Y instanceof jn))return ts(i,"Invalid or missing connection entity");if(!re)return ts(i,"Missing required input: fileId");if(!["auto","native","binary","plain-text"].includes(ie))return ts(i,`Invalid mode: ${ie}`);const z=this.extensionsRegistry.requestContexts(this,[de.Editor])[0],te=Io(Y),Q={Authorization:`Bearer ${await z.getAccessToken()}`},H=`${((L=z.env)==null?void 0:L.API_BASE_URL)+"/editor-runtime"}/v1/external-integrations/generic-proxy/${z.projectId}/${_r["google-drive"]}/${te}`,se=async it=>ds.post(H,it,{headers:Q}),ce=async(it,yt)=>{const Rt=yt==="arraybuffer",an=await ds.get(it.presignedUrl,{responseType:Rt?"arraybuffer":"text"});let Pr;if(yt==="json"){const ca=typeof an.data=="string"?an.data:new TextDecoder().decode(an.data);Pr=JSON.parse(ca)}else Pr=an.data;return{status:200,headers:an.headers,data:Pr}},le=async(it,yt="json")=>{const Rt=it.data;return awi(Rt)?await ce(Rt,yt):Rt},he=it=>{if(it instanceof ArrayBuffer)return it;if((it==null?void 0:it.buffer)instanceof ArrayBuffer)return it.buffer;if(typeof it=="string"){const yt=atob(it),Rt=yt.length,an=new Uint8Array(Rt);for(let Pr=0;Pr<Rt;Pr++)an[Pr]=yt.charCodeAt(Pr);return an.buffer}if((it==null?void 0:it.type)==="Buffer"&&Array.isArray(it==null?void 0:it.data))return new Uint8Array(it.data).buffer;throw new Error("Unexpected binary payload shape from proxy")},ve=it=>{const yt=new Uint8Array(it),Rt=32768;let an="";for(let Pr=0;Pr<yt.length;Pr+=Rt)an+=String.fromCharCode.apply(null,Array.from(yt.subarray(Pr,Pr+Rt)));return btoa(an)},ge=it=>new TextDecoder("utf-8",{fatal:!1}).decode(new Uint8Array(it)),Ie=(it,yt)=>{var an;return it&&(it[yt]??it[String(yt).toLowerCase()]??((an=Object.entries(it).find(([Pr])=>Pr.toLowerCase()===yt.toLowerCase()))==null?void 0:an[1]))||""},ke=it=>{if(!it)return!1;const yt=it.toLowerCase();return yt.startsWith("text/")||yt.includes("json")||yt.includes("xml")||yt.includes("javascript")||yt.includes("csv")},Me=await le(await se({method:"GET",endpoint:`/drive/v3/files/${encodeURIComponent(re)}`,params:{fields:"id,name,mimeType,size",supportsAllDrives:"true"},retries:3}),"json");if(!((V=Me==null?void 0:Me.data)!=null&&V.id)||!((k=Me==null?void 0:Me.data)!=null&&k.mimeType))return ts(i,`Failed to retrieve file metadata (status=${(Me==null?void 0:Me.status)??"n/a"})`);const Be=Me.data,Ce=Be.mimeType,qe=Be.name??null,Xe=Be.size?Number(Be.size):null,Ye=Ce==="application/vnd.google-apps.document"||Ce==="application/vnd.google-apps.document",ft=Ce==="application/vnd.google-apps.spreadsheet"||Ce==="application/vnd.google-apps.spreadsheet",$t=Ce==null?void 0:Ce.startsWith("application/vnd.google-apps.");let mt,lt="",dt=!1,vi=null,Bi=null,gt=null;const ot={metadata:Be,modeRequested:ie,modeResolved:null,source:null,exportMimeType:null,note:null};if(ie==="auto")if(Ye){const it=await le(await se({method:"GET",baseUrlOverride:"https://docs.googleapis.com",endpoint:`/v1/documents/${encodeURIComponent(re)}`,params:{includeTabsContent:"true"},retries:3}),"json");if(it.status!==200)return ts(i,`Docs API failed (status=${it.status})`);mt="docs",lt="application/json",dt=!1,gt=JSON.stringify(it.data),ot.modeResolved="native",ot.source="docs"}else if(ft){const it=await le(await se({method:"GET",baseUrlOverride:"https://sheets.googleapis.com",endpoint:`/v4/spreadsheets/${encodeURIComponent(re)}`,params:{includeGridData:"true"},retries:3}),"json");if(it.status!==200)return ts(i,`Sheets API failed (status=${it.status})`);mt="sheets",lt="application/json",dt=!1,gt=JSON.stringify(it.data),ot.modeResolved="native",ot.source="sheets"}else{const it=await le(await se({method:"GET",endpoint:`/drive/v3/files/${encodeURIComponent(re)}`,params:{alt:"media"},responseType:"arraybuffer",retries:3}),"arraybuffer");if(it.status!==200)return ts(i,`Drive media fetch failed (status=${it.status})`);const yt=Ie(it.headers,"content-type"),Rt=he(it.data);ke(yt)?(mt="text",lt=yt||"text/plain",dt=!1,vi=ge(Rt),ot.modeResolved="plain-text",ot.source="drive"):(mt="binary",lt=yt||"application/octet-stream",dt=!0,Bi=ve(Rt),ot.modeResolved="binary",ot.source="drive")}else if(ie==="native")if(Ye){const it=await le(await se({method:"GET",baseUrlOverride:"https://docs.googleapis.com",endpoint:`/v1/documents/${encodeURIComponent(re)}`,params:{includeTabsContent:"true"},retries:3}),"json");if(it.status!==200)return ts(i,`Docs API failed (status=${it.status})`);mt="docs",lt="application/json",dt=!1,gt=JSON.stringify(it.data),ot.modeResolved="native",ot.source="docs"}else if(ft){const it=await le(await se({method:"GET",baseUrlOverride:"https://sheets.googleapis.com",endpoint:`/v4/spreadsheets/${encodeURIComponent(re)}`,params:{includeGridData:"true"},retries:3}),"json");if(it.status!==200)return ts(i,`Sheets API failed (status=${it.status})`);mt="sheets",lt="application/json",dt=!1,gt=JSON.stringify(it.data),ot.modeResolved="native",ot.source="sheets"}else return ts(i,`mode=native is not supported for mimeType=${Ce}. Try 'binary' or 'plain-text'.`);else if(ie==="plain-text")if(Ye){const it=await le(await se({method:"GET",endpoint:`/drive/v3/files/${encodeURIComponent(re)}/export`,params:{mimeType:"text/plain"},responseType:"text",retries:3}),"text");if(it.status!==200)return ts(i,`Drive export (text) failed (status=${it.status})`);mt="text",lt="text/plain",dt=!1,vi=it.data??"",ot.modeResolved="plain-text",ot.source="drive"}else if(ft){const it=await le(await se({method:"GET",endpoint:`/drive/v3/files/${encodeURIComponent(re)}/export`,params:{mimeType:"text/csv"},responseType:"text",retries:3}),"text");if(it.status!==200)return ts(i,`Drive export (csv) failed (status=${it.status})`);mt="text",lt="text/csv",dt=!1,vi=it.data??"",ot.modeResolved="plain-text",ot.source="drive",ot.note="Sheets CSV export returns only the first sheet."}else{const it=await le(await se({method:"GET",endpoint:`/drive/v3/files/${encodeURIComponent(re)}`,params:{alt:"media"},responseType:"arraybuffer",retries:3}),"arraybuffer");if(it.status!==200)return ts(i,`Drive media fetch failed (status=${it.status})`);const yt=Ie(it.headers,"content-type");if(!ke(yt))return ts(i,`mode=plain-text not supported for mimeType=${Ce} (content-type=${yt}).`);const Rt=he(it.data);mt="text",lt=yt||"text/plain",dt=!1,vi=ge(Rt),ot.modeResolved="plain-text",ot.source="drive"}else if(ie==="binary")if($t){const it="application/pdf",yt=await le(await se({method:"GET",endpoint:`/drive/v3/files/${encodeURIComponent(re)}/export`,params:{mimeType:it},responseType:"arraybuffer",retries:3}),"arraybuffer");if(yt.status!==200)return ts(i,`Drive export (pdf) failed (status=${yt.status})`);const Rt=he(yt.data);mt="binary",lt=it,dt=!0,Bi=ve(Rt),ot.modeResolved="binary",ot.source="drive",ot.exportMimeType=it}else{const it=await le(await se({method:"GET",endpoint:`/drive/v3/files/${encodeURIComponent(re)}`,params:{alt:"media"},responseType:"arraybuffer",retries:3}),"arraybuffer");if(it.status!==200)return ts(i,`Drive media fetch failed (status=${it.status})`);const yt=Ie(it.headers,"content-type")||"application/octet-stream",Rt=he(it.data);mt="binary",lt=yt,dt=!0,Bi=ve(Rt),ot.modeResolved="binary",ot.source="drive"}else throw new Error(`Unsupported mode: ${ie}`);lt||(lt=Ye||ft?"application/json":"application/octet-stream");const Xt=JSON.stringify(ot);return gt&&typeof gt=="string"&&(gt=JSON.parse(gt)),{value:F.Success,error:null,result:{kind:mt,mime:lt,isBinary:dt,title:qe,sizeBytes:Xe,text:vi,base64:Bi,json:gt,raw_json:Xt}}}catch(Y){const re=String((Y==null?void 0:Y.message)||Y),ie=re.toLowerCase().includes("insufficient")||re.toLowerCase().includes("forbidden")?" (Hint: mode=native requires Docs/Sheets read scopes in addition to Drive, and access to the file.)":"";return ee.Logger.error("[Google Drive] Smart fetch error:",Y),{value:i.catchesError||i.errorCalls.length?F.CaughtError:F.UnhandledError,error:re+ie,result:null}}}})}}function ts(s,u){return ee.Logger.log("[Google Drive] Smart fetch error:",u),{value:s.catchesError||s.errorCalls.length?F.CaughtError:F.UnhandledError,error:u,result:null}}const wv="id,name,mimeType,size,webViewLink,parents,modifiedTime",xU=5*1024*1024,swi="X-Elyx-Proxy-Config";function lwi(s){return s.startsWith("/")?s.slice(1):s}async function owi(s){if(typeof s=="string"&&/^data:[^;]+;base64,/.test(s)){const[,u,i]=s.match(/^data:([^;]+);base64,(.*)$/)||[],r=atob(i),a=new Uint8Array(r.length);for(let c=0;c<r.length;c++)a[c]=r.charCodeAt(c);return{bytes:a,inferredMime:u,isBinary:!0}}if(typeof s=="string")return{bytes:new TextEncoder().encode(s),inferredMime:void 0,isBinary:!1};if(s instanceof Blob){const u=await s.arrayBuffer();return{bytes:new Uint8Array(u),inferredMime:s.type||void 0,isBinary:!0}}return s instanceof ArrayBuffer?{bytes:new Uint8Array(s),inferredMime:void 0,isBinary:!0}:{bytes:s,inferredMime:void 0,isBinary:!0}}async function dwi(s){if(typeof s=="string"){if(/^data:[^;]+;base64,/.test(s)){const[,i]=s.match(/^data:([^;]+);base64,(.*)$/)||[];return new TextDecoder("utf-8").decode(Uint8Array.from(atob(i),r=>r.charCodeAt(0)))}return s}if(s instanceof Blob)return new TextDecoder("utf-8").decode(new Uint8Array(await s.arrayBuffer()));const u=s instanceof ArrayBuffer?s:s.buffer;return new TextDecoder("utf-8").decode(new Uint8Array(u))}function uwi(s){let u=s;return!u.includes(`
|
|
56
56
|
`)&&/\\n/.test(u)&&(u=u.replace(/\\r\\n/g,`
|
|
57
57
|
`).replace(/\\n/g,`
|
package/dist/index.d.ts
CHANGED
|
@@ -25884,7 +25884,7 @@ export declare enum BaseValueDescriptorIds {
|
|
|
25884
25884
|
manifest: ExtensionManifest;
|
|
25885
25885
|
module: {
|
|
25886
25886
|
init: (contexts: (DefaultEditorContext | DefaultProjectLogicContext)[]) => void;
|
|
25887
|
-
main: (entity: OperationState,
|
|
25887
|
+
main: (entity: OperationState, inputs: IDynamicValue[]) => Promise<IPrimitiveExecutionResult>;
|
|
25888
25888
|
};
|
|
25889
25889
|
}
|
|
25890
25890
|
|
package/dist/index.js
CHANGED
|
@@ -122824,30 +122824,36 @@ class YTi extends Ve {
|
|
|
122824
122824
|
}
|
|
122825
122825
|
},
|
|
122826
122826
|
main: async (i, r) => {
|
|
122827
|
+
var a, c;
|
|
122827
122828
|
try {
|
|
122828
|
-
const
|
|
122829
|
-
(
|
|
122830
|
-
var
|
|
122831
|
-
return ((
|
|
122829
|
+
const e = r.find(
|
|
122830
|
+
(A) => {
|
|
122831
|
+
var C, I;
|
|
122832
|
+
return ((I = (C = A.valueOwner) == null ? void 0 : C.declaration) == null ? void 0 : I.id) === U.operation[Oe.Validate].inputs.entityToMatch.id;
|
|
122832
122833
|
}
|
|
122833
|
-
)
|
|
122834
|
-
|
|
122835
|
-
|
|
122836
|
-
|
|
122837
|
-
|
|
122838
|
-
|
|
122834
|
+
), f = ((a = e == null ? void 0 : e.value) == null ? void 0 : a.valueAsType) || "", h = r.find(
|
|
122835
|
+
(A) => {
|
|
122836
|
+
var C, I;
|
|
122837
|
+
return ((I = (C = A.valueOwner) == null ? void 0 : C.declaration) == null ? void 0 : I.id) === U.operation[Oe.Validate].inputs.dataToValidate.id;
|
|
122838
|
+
}
|
|
122839
|
+
), m = ((c = h == null ? void 0 : h.value) == null ? void 0 : c.value) || "";
|
|
122840
|
+
ye.log("Inputs for entity validation: ", r);
|
|
122841
|
+
const E = fN(
|
|
122842
|
+
f
|
|
122843
|
+
).safeParse(m);
|
|
122844
|
+
return E.success ? {
|
|
122839
122845
|
value: F.Success,
|
|
122840
122846
|
error: null,
|
|
122841
|
-
result: { data:
|
|
122847
|
+
result: { data: m }
|
|
122842
122848
|
} : {
|
|
122843
122849
|
value: i.catchesError || i.errorCalls.length ? F.CaughtError : F.UnhandledError,
|
|
122844
|
-
error:
|
|
122850
|
+
error: E.error.errors,
|
|
122845
122851
|
result: null
|
|
122846
122852
|
};
|
|
122847
|
-
} catch (
|
|
122853
|
+
} catch (e) {
|
|
122848
122854
|
return {
|
|
122849
122855
|
value: i.catchesError || i.errorCalls.length ? F.CaughtError : F.UnhandledError,
|
|
122850
|
-
error:
|
|
122856
|
+
error: e,
|
|
122851
122857
|
result: null
|
|
122852
122858
|
};
|
|
122853
122859
|
}
|
|
@@ -122872,7 +122878,9 @@ class QTi extends Ve {
|
|
|
122872
122878
|
(a) => a.contextType === oe.Logic
|
|
122873
122879
|
);
|
|
122874
122880
|
if (r) {
|
|
122875
|
-
const a = r.get(
|
|
122881
|
+
const a = r.get(
|
|
122882
|
+
Oe.ReadKey
|
|
122883
|
+
);
|
|
122876
122884
|
a && (a.autoexecutable = !0, a.implementation = this.module.main);
|
|
122877
122885
|
}
|
|
122878
122886
|
},
|
|
@@ -122890,7 +122898,11 @@ class QTi extends Ve {
|
|
|
122890
122898
|
return ((w = (I = C.valueOwner) == null ? void 0 : I.declaration) == null ? void 0 : w.id) === U.operation[Oe.ReadKey].inputs.key.id;
|
|
122891
122899
|
}
|
|
122892
122900
|
), E = ((e = v == null ? void 0 : v.value) == null ? void 0 : e.valueAsType) ?? ((f = v == null ? void 0 : v.value) == null ? void 0 : f.value), A = eci(m, E);
|
|
122893
|
-
return {
|
|
122901
|
+
return {
|
|
122902
|
+
value: F.Success,
|
|
122903
|
+
error: null,
|
|
122904
|
+
result: A
|
|
122905
|
+
};
|
|
122894
122906
|
} catch (h) {
|
|
122895
122907
|
return {
|
|
122896
122908
|
value: F.UnhandledError,
|
|
@@ -122919,7 +122931,9 @@ class XTi extends Ve {
|
|
|
122919
122931
|
(a) => a.contextType === oe.Logic
|
|
122920
122932
|
);
|
|
122921
122933
|
if (r) {
|
|
122922
|
-
const a = r.get(
|
|
122934
|
+
const a = r.get(
|
|
122935
|
+
Oe.WriteKey
|
|
122936
|
+
);
|
|
122923
122937
|
a && (a.autoexecutable = !0, a.implementation = this.module.main);
|
|
122924
122938
|
}
|
|
122925
122939
|
},
|
|
@@ -122975,7 +122989,9 @@ class ebi extends Ve {
|
|
|
122975
122989
|
(a) => a.contextType === oe.Logic
|
|
122976
122990
|
);
|
|
122977
122991
|
if (r) {
|
|
122978
|
-
const a = r.get(
|
|
122992
|
+
const a = r.get(
|
|
122993
|
+
Oe.DeleteKey
|
|
122994
|
+
);
|
|
122979
122995
|
a && (a.autoexecutable = !0, a.implementation = this.module.main);
|
|
122980
122996
|
}
|
|
122981
122997
|
},
|
|
@@ -123046,7 +123062,11 @@ class tbi extends Ve {
|
|
|
123046
123062
|
return ((w = (I = C.valueOwner) == null ? void 0 : I.declaration) == null ? void 0 : w.id) === U.operation[Oe.ReadNestedKey].inputs.key.id;
|
|
123047
123063
|
}
|
|
123048
123064
|
), E = ((e = v == null ? void 0 : v.value) == null ? void 0 : e.valueAsType) ?? ((f = v == null ? void 0 : v.value) == null ? void 0 : f.value), A = rci(m, E, void 0);
|
|
123049
|
-
return {
|
|
123065
|
+
return {
|
|
123066
|
+
value: F.Success,
|
|
123067
|
+
error: null,
|
|
123068
|
+
result: A
|
|
123069
|
+
};
|
|
123050
123070
|
} catch (h) {
|
|
123051
123071
|
return {
|
|
123052
123072
|
value: F.UnhandledError,
|
|
@@ -123157,7 +123177,11 @@ class rbi extends Ve {
|
|
|
123157
123177
|
var V, k;
|
|
123158
123178
|
return ((k = (V = L.valueOwner) == null ? void 0 : V.declaration) == null ? void 0 : k.id) === U.operation[Oe.WriteSafeNestedKeyRecursively].inputs.value.id;
|
|
123159
123179
|
}
|
|
123160
|
-
), w = ((h = I == null ? void 0 : I.value) == null ? void 0 : h.valueAsType) ?? ((m = I == null ? void 0 : I.value) == null ? void 0 : m.value), $ = aci(
|
|
123180
|
+
), w = ((h = I == null ? void 0 : I.value) == null ? void 0 : h.valueAsType) ?? ((m = I == null ? void 0 : I.value) == null ? void 0 : m.value), $ = aci(
|
|
123181
|
+
E,
|
|
123182
|
+
C,
|
|
123183
|
+
w
|
|
123184
|
+
);
|
|
123161
123185
|
return {
|
|
123162
123186
|
value: F.Success,
|
|
123163
123187
|
error: null,
|
|
@@ -123242,7 +123266,9 @@ class abi extends Ve {
|
|
|
123242
123266
|
init: (i) => {
|
|
123243
123267
|
const r = i.find(
|
|
123244
123268
|
(c) => c.contextType === oe.Logic
|
|
123245
|
-
), a = r == null ? void 0 : r.get(
|
|
123269
|
+
), a = r == null ? void 0 : r.get(
|
|
123270
|
+
Oe.HasKey
|
|
123271
|
+
);
|
|
123246
123272
|
a && (a.autoexecutable = !0, a.implementation = this.module.main);
|
|
123247
123273
|
},
|
|
123248
123274
|
main: async (i, r) => {
|
|
@@ -123259,7 +123285,11 @@ class abi extends Ve {
|
|
|
123259
123285
|
return ((w = (I = C.valueOwner) == null ? void 0 : I.declaration) == null ? void 0 : w.id) === U.operation[Oe.HasKey].inputs.key.id;
|
|
123260
123286
|
}
|
|
123261
123287
|
), E = ((e = v == null ? void 0 : v.value) == null ? void 0 : e.valueAsType) ?? ((f = v == null ? void 0 : v.value) == null ? void 0 : f.value), A = lci(m, E);
|
|
123262
|
-
return {
|
|
123288
|
+
return {
|
|
123289
|
+
value: F.Success,
|
|
123290
|
+
error: null,
|
|
123291
|
+
result: A
|
|
123292
|
+
};
|
|
123263
123293
|
} catch (h) {
|
|
123264
123294
|
return {
|
|
123265
123295
|
value: F.UnhandledError,
|
|
@@ -123310,7 +123340,11 @@ class sbi extends Ve {
|
|
|
123310
123340
|
return ((k = (V = L.valueOwner) == null ? void 0 : V.declaration) == null ? void 0 : k.id) === U.operation[Oe.KeyValueEquals].inputs.expectedValue.id;
|
|
123311
123341
|
}
|
|
123312
123342
|
), w = ((h = I == null ? void 0 : I.value) == null ? void 0 : h.valueAsType) ?? ((m = I == null ? void 0 : I.value) == null ? void 0 : m.value), $ = oci(E, C, w);
|
|
123313
|
-
return {
|
|
123343
|
+
return {
|
|
123344
|
+
value: F.Success,
|
|
123345
|
+
error: null,
|
|
123346
|
+
result: $
|
|
123347
|
+
};
|
|
123314
123348
|
} catch (v) {
|
|
123315
123349
|
return {
|
|
123316
123350
|
value: F.UnhandledError,
|
|
@@ -123356,7 +123390,11 @@ class lbi extends Ve {
|
|
|
123356
123390
|
return ((w = (I = C.valueOwner) == null ? void 0 : I.declaration) == null ? void 0 : w.id) === U.operation[Oe.HasNestedKey].inputs.key.id;
|
|
123357
123391
|
}
|
|
123358
123392
|
), E = ((e = v == null ? void 0 : v.value) == null ? void 0 : e.valueAsType) ?? ((f = v == null ? void 0 : v.value) == null ? void 0 : f.value), A = dci(m, E);
|
|
123359
|
-
return {
|
|
123393
|
+
return {
|
|
123394
|
+
value: F.Success,
|
|
123395
|
+
error: null,
|
|
123396
|
+
result: A
|
|
123397
|
+
};
|
|
123360
123398
|
} catch (h) {
|
|
123361
123399
|
return {
|
|
123362
123400
|
value: F.UnhandledError,
|
|
@@ -123407,7 +123445,11 @@ class obi extends Ve {
|
|
|
123407
123445
|
return ((k = (V = L.valueOwner) == null ? void 0 : V.declaration) == null ? void 0 : k.id) === U.operation[Oe.NestedKeyValueEquals].inputs.expectedValue.id;
|
|
123408
123446
|
}
|
|
123409
123447
|
), w = ((h = I == null ? void 0 : I.value) == null ? void 0 : h.valueAsType) ?? ((m = I == null ? void 0 : I.value) == null ? void 0 : m.value), $ = uci(E, C, w);
|
|
123410
|
-
return {
|
|
123448
|
+
return {
|
|
123449
|
+
value: F.Success,
|
|
123450
|
+
error: null,
|
|
123451
|
+
result: $
|
|
123452
|
+
};
|
|
123411
123453
|
} catch (v) {
|
|
123412
123454
|
return {
|
|
123413
123455
|
value: F.UnhandledError,
|
|
@@ -123467,7 +123509,11 @@ class dbi extends Ve {
|
|
|
123467
123509
|
let V = !1;
|
|
123468
123510
|
return ((C = L == null ? void 0 : L.entity) == null ? void 0 : C.id) !== ($ == null ? void 0 : $.id) ? V = !1 : fN(
|
|
123469
123511
|
L == null ? void 0 : L.entity
|
|
123470
|
-
).safeParse(w).success ? V = !0 : V = !1, {
|
|
123512
|
+
).safeParse(w).success ? V = !0 : V = !1, {
|
|
123513
|
+
value: F.Success,
|
|
123514
|
+
error: null,
|
|
123515
|
+
result: V
|
|
123516
|
+
};
|
|
123471
123517
|
} catch (I) {
|
|
123472
123518
|
return {
|
|
123473
123519
|
value: F.UnhandledError,
|
|
@@ -123513,7 +123559,11 @@ class ubi extends Ve {
|
|
|
123513
123559
|
return ((h = f.value) == null ? void 0 : h.valueAsType) ?? ((m = f.value) == null ? void 0 : m.value);
|
|
123514
123560
|
}
|
|
123515
123561
|
), e = pci(...c);
|
|
123516
|
-
return {
|
|
123562
|
+
return {
|
|
123563
|
+
value: F.Success,
|
|
123564
|
+
error: null,
|
|
123565
|
+
result: e
|
|
123566
|
+
};
|
|
123517
123567
|
} catch (a) {
|
|
123518
123568
|
return {
|
|
123519
123569
|
value: F.UnhandledError,
|
|
@@ -123555,7 +123605,11 @@ class pbi extends Ve {
|
|
|
123555
123605
|
return ((E = (v = m.valueOwner) == null ? void 0 : v.declaration) == null ? void 0 : E.id) === U.operation[Oe.Keys].inputs.objectValue.id;
|
|
123556
123606
|
}
|
|
123557
123607
|
), f = ((a = e == null ? void 0 : e.value) == null ? void 0 : a.valueAsType) ?? ((c = e == null ? void 0 : e.value) == null ? void 0 : c.value), h = cci(f);
|
|
123558
|
-
return {
|
|
123608
|
+
return {
|
|
123609
|
+
value: F.Success,
|
|
123610
|
+
error: null,
|
|
123611
|
+
result: h
|
|
123612
|
+
};
|
|
123559
123613
|
} catch (e) {
|
|
123560
123614
|
return {
|
|
123561
123615
|
value: F.UnhandledError,
|
|
@@ -123597,7 +123651,11 @@ class cbi extends Ve {
|
|
|
123597
123651
|
return ((E = (v = m.valueOwner) == null ? void 0 : v.declaration) == null ? void 0 : E.id) === U.operation[Oe.Values].inputs.objectValue.id;
|
|
123598
123652
|
}
|
|
123599
123653
|
), f = ((a = e == null ? void 0 : e.value) == null ? void 0 : a.valueAsType) ?? ((c = e == null ? void 0 : e.value) == null ? void 0 : c.value), h = fci(f);
|
|
123600
|
-
return {
|
|
123654
|
+
return {
|
|
123655
|
+
value: F.Success,
|
|
123656
|
+
error: null,
|
|
123657
|
+
result: h
|
|
123658
|
+
};
|
|
123601
123659
|
} catch (e) {
|
|
123602
123660
|
return {
|
|
123603
123661
|
value: F.UnhandledError,
|
|
@@ -123627,7 +123685,9 @@ class fbi extends Ve {
|
|
|
123627
123685
|
);
|
|
123628
123686
|
if (!r)
|
|
123629
123687
|
return;
|
|
123630
|
-
const a = r.get(
|
|
123688
|
+
const a = r.get(
|
|
123689
|
+
Oe.Entries
|
|
123690
|
+
);
|
|
123631
123691
|
a && (a.autoexecutable = !0, a.implementation = this.module.main);
|
|
123632
123692
|
},
|
|
123633
123693
|
main: async (i, r) => {
|
|
@@ -123639,7 +123699,11 @@ class fbi extends Ve {
|
|
|
123639
123699
|
return ((E = (v = m.valueOwner) == null ? void 0 : v.declaration) == null ? void 0 : E.id) === U.operation[Oe.Entries].inputs.objectValue.id;
|
|
123640
123700
|
}
|
|
123641
123701
|
), f = ((a = e == null ? void 0 : e.value) == null ? void 0 : a.valueAsType) ?? ((c = e == null ? void 0 : e.value) == null ? void 0 : c.value), h = yci(f);
|
|
123642
|
-
return {
|
|
123702
|
+
return {
|
|
123703
|
+
value: F.Success,
|
|
123704
|
+
error: null,
|
|
123705
|
+
result: h
|
|
123706
|
+
};
|
|
123643
123707
|
} catch (e) {
|
|
123644
123708
|
return {
|
|
123645
123709
|
value: F.UnhandledError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyx-code/project-logic-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7014",
|
|
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",
|