var{defineProperty:c,getOwnPropertyNames:k,getOwnPropertyDescriptor:N}=Object,$=Object.prototype.hasOwnProperty;function C(t){return this[t]}var B=(t)=>{var n=(f??=new WeakMap).get(t),e;if(n)return n;if(n=c({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function"){for(var r of k(t))if(!$.call(n,r))c(n,r,{get:C.bind(t,r),enumerable:!(e=N(t,r))||e.enumerable})}return f.set(t,n),n},f;var v=(t)=>t;function y(t,n){this[t]=v.bind(null,n)}var O=(t,n)=>{for(var e in n)c(t,e,{get:n[e],enumerable:!0,configurable:!0,set:y.bind(n,e)})};var x=(t,n)=>()=>(t&&(n=t(t=0)),n);function l(t,n){if(!t)return!0;let e=t.trim();if(!e)return!0;let r=d(e,"||");if(r.length>1)return r.some((i)=>l(i,n));let u=d(e,"&&");if(u.length>1)return u.every((i)=>l(i,n));return g(e,n)}function g(t,n){let e=t.trim();if(!e)return!0;if(e.startsWith("!"))return!g(e.slice(1),n);let r=e.match(/^(data|input|output)\.([A-Za-z0-9_.[\]]+)\s*(===|==|!==|!=|>=|<=|>|<)\s*(.+)$/);if(r){let[,s,o,a,h]=r,b=p(s,n,o),w=m(h);return E(b,w,a)}let u=e.match(/^(data|input|output)\.([A-Za-z0-9_.[\]]+)$/);if(u){let[,s,o]=u,a=p(s,n,o);return Boolean(a)}let i=m(e);return Boolean(i)}function E(t,n,e){switch(e){case"===":case"==":return t===n;case"!==":case"!=":return t!==n;case">":return Number(t)>Number(n);case">=":return Number(t)>=Number(n);case"<":return Number(t)<Number(n);case"<=":return Number(t)<=Number(n);default:return!1}}function m(t){let n=(t??"").trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(n))return Number(n);if(/^true$/i.test(n))return!0;if(/^false$/i.test(n))return!1;if(/^null$/i.test(n))return null;if(/^undefined$/i.test(n))return;return n}function p(t,n,e){let r=t==="data"?n.data:t==="input"?n.input:n.output;return W(r,e)}function W(t,n){if(t==null)return;if(!n)return t;let e=n.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean),r=t;for(let u of e){if(r==null)return;r=r[u]}return r}function d(t,n){let e=[],r="",u=!1,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if(!o)continue;let a=t.slice(s,s+n.length);if(o==="'"&&!i){u=!u,r+=o;continue}if(o==='"'&&!u){i=!i,r+=o;continue}if(!u&&!i&&a===n){e.push(r.trim()),r="",s+=n.length-1;continue}r+=o}if(r.trim().length)e.push(r.trim());return e}export{l as evaluateExpression};
