UNPKG

hypersync-query-builder-component

Version:

React component for building HyperSync blockchain queries with an intuitive UI

63 lines (61 loc) 108 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Ve=require("react");function Yt(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(a,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return a.default=r,Object.freeze(a)}const W=Yt(Ve);function qt(r,a){return r>a?r:a}function Le(r){return r===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:r!==null&&r.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:r.BS_PRIVATE_NESTED_SOME_NONE+1|0}:r}function Pe(r){if(r===null||r.BS_PRIVATE_NESTED_SOME_NONE===void 0)return r;let a=r.BS_PRIVATE_NESTED_SOME_NONE;if(a!==0)return{BS_PRIVATE_NESTED_SOME_NONE:a-1|0}}function rt(r,a){if(a>=0&&a<r.length)return Le(r[a])}function Kt(r,a){if(r<=0)return[];let t=new Array(r);for(let s=0;s<r;++s)t[s]=a(s);return t}function Zt(r,a){let t=a-r|0,s=new Array(t+1|0);for(let u=0;u<=t;++u)s[u]=r+u|0;return s}function ce(r,a){let t=r.length,s=new Array(t),u=0;for(let o=0;o<t;++o){let g=r[o];a(g,o)&&(s[u]=g,u=u+1|0)}return s.length=u,s}function Xt(r,a,t){return r.reduce(t,a)}function be(r,a){let t=r.length,s=new Array(t),u=0;for(let o=0;o<t;++o){let g=r[o],b=a(g);b!==void 0&&(s[u]=Pe(b),u=u+1|0)}return s.length=u,s}function pe(r,a){let t=parseInt(r);if(!(isNaN(t)||t>2147483647||t<-2147483648))return t|0}let es="JsExn";function at(r,a){if(r!==void 0)return Le(a(Pe(r)))}function ve(r,a){if(r!==void 0)return a(Pe(r))}function m(r,a){return r!==void 0?Pe(r):a}function Fe(r){return r!==void 0}function ft(r){return r===void 0}var Ce={exports:{}},we={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var it;function ts(){if(it)return we;it=1;var r=Ve,a=Symbol.for("react.element"),t=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function g(b,y,l){var h,i={},d=null,c=null;l!==void 0&&(d=""+l),y.key!==void 0&&(d=""+y.key),y.ref!==void 0&&(c=y.ref);for(h in y)s.call(y,h)&&!o.hasOwnProperty(h)&&(i[h]=y[h]);if(b&&b.defaultProps)for(h in y=b.defaultProps,y)i[h]===void 0&&(i[h]=y[h]);return{$$typeof:a,type:b,key:d,ref:c,props:i,_owner:u.current}}return we.Fragment=t,we.jsx=g,we.jsxs=g,we}var Be={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lt;function ss(){return lt||(lt=1,process.env.NODE_ENV!=="production"&&function(){var r=Ve,a=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),b=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),i=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),f=Symbol.iterator,k="@@iterator";function A(n){if(n===null||typeof n!="object")return null;var x=f&&n[f]||n[k];return typeof x=="function"?x:null}var p=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(n){{for(var x=arguments.length,N=new Array(x>1?x-1:0),w=1;w<x;w++)N[w-1]=arguments[w];S("error",n,N)}}function S(n,x,N){{var w=p.ReactDebugCurrentFrame,$=w.getStackAddendum();$!==""&&(x+="%s",N=N.concat([$]));var H=N.map(function(P){return String(P)});H.unshift("Warning: "+x),Function.prototype.apply.call(console[n],console,H)}}var G=!1,q=!1,K=!1,Q=!1,j=!1,C;C=Symbol.for("react.module.reference");function T(n){return!!(typeof n=="string"||typeof n=="function"||n===s||n===o||j||n===u||n===l||n===h||Q||n===c||G||q||K||typeof n=="object"&&n!==null&&(n.$$typeof===d||n.$$typeof===i||n.$$typeof===g||n.$$typeof===b||n.$$typeof===y||n.$$typeof===C||n.getModuleId!==void 0))}function E(n,x,N){var w=n.displayName;if(w)return w;var $=x.displayName||x.name||"";return $!==""?N+"("+$+")":N}function B(n){return n.displayName||"Context"}function R(n){if(n==null)return null;if(typeof n.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case s:return"Fragment";case t:return"Portal";case o:return"Profiler";case u:return"StrictMode";case l:return"Suspense";case h:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case b:var x=n;return B(x)+".Consumer";case g:var N=n;return B(N._context)+".Provider";case y:return E(n,n.render,"ForwardRef");case i:var w=n.displayName||null;return w!==null?w:R(n.type)||"Memo";case d:{var $=n,H=$._payload,P=$._init;try{return R(P(H))}catch{return null}}}return null}var M=Object.assign,O=0,z,ee,Z,te,ne,de,ue;function fe(){}fe.__reactDisabledLog=!0;function xe(){{if(O===0){z=console.log,ee=console.info,Z=console.warn,te=console.error,ne=console.group,de=console.groupCollapsed,ue=console.groupEnd;var n={configurable:!0,enumerable:!0,value:fe,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}O++}}function I(){{if(O--,O===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},n,{value:z}),info:M({},n,{value:ee}),warn:M({},n,{value:Z}),error:M({},n,{value:te}),group:M({},n,{value:ne}),groupCollapsed:M({},n,{value:de}),groupEnd:M({},n,{value:ue})})}O<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var v=p.ReactCurrentDispatcher,L;function V(n,x,N){{if(L===void 0)try{throw Error()}catch($){var w=$.stack.trim().match(/\n( *(at )?)/);L=w&&w[1]||""}return` `+L+n}}var J=!1,D;{var le=typeof WeakMap=="function"?WeakMap:Map;D=new le}function X(n,x){if(!n||J)return"";{var N=D.get(n);if(N!==void 0)return N}var w;J=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=v.current,v.current=null,xe();try{if(x){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(ie){w=ie}Reflect.construct(n,[],P)}else{try{P.call()}catch(ie){w=ie}n.call(P.prototype)}}else{try{throw Error()}catch(ie){w=ie}n()}}catch(ie){if(ie&&w&&typeof ie.stack=="string"){for(var F=ie.stack.split(` `),se=w.stack.split(` `),U=F.length-1,Y=se.length-1;U>=1&&Y>=0&&F[U]!==se[Y];)Y--;for(;U>=1&&Y>=0;U--,Y--)if(F[U]!==se[Y]){if(U!==1||Y!==1)do if(U--,Y--,Y<0||F[U]!==se[Y]){var oe=` `+F[U].replace(" at new "," at ");return n.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",n.displayName)),typeof n=="function"&&D.set(n,oe),oe}while(U>=1&&Y>=0);break}}}finally{J=!1,v.current=H,I(),Error.prepareStackTrace=$}var ke=n?n.displayName||n.name:"",Ne=ke?V(ke):"";return typeof n=="function"&&D.set(n,Ne),Ne}function re(n,x,N){return X(n,!1)}function ye(n){var x=n.prototype;return!!(x&&x.isReactComponent)}function ge(n,x,N){if(n==null)return"";if(typeof n=="function")return X(n,ye(n));if(typeof n=="string")return V(n);switch(n){case l:return V("Suspense");case h:return V("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case y:return re(n.render);case i:return ge(n.type,x,N);case d:{var w=n,$=w._payload,H=w._init;try{return ge(H($),x,N)}catch{}}}return""}var he=Object.prototype.hasOwnProperty,Ee={},me=p.ReactDebugCurrentFrame;function ae(n){if(n){var x=n._owner,N=ge(n.type,n._source,x?x.type:null);me.setExtraStackFrame(N)}else me.setExtraStackFrame(null)}function Et(n,x,N,w,$){{var H=Function.call.bind(he);for(var P in n)if(H(n,P)){var F=void 0;try{if(typeof n[P]!="function"){var se=Error((w||"React class")+": "+N+" type `"+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[P]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw se.name="Invariant Violation",se}F=n[P](x,P,w,N,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(U){F=U}F&&!(F instanceof Error)&&(ae($),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",w||"React class",N,P,typeof F),ae(null)),F instanceof Error&&!(F.message in Ee)&&(Ee[F.message]=!0,ae($),_("Failed %s type: %s",N,F.message),ae(null))}}}var wt=Array.isArray;function Me(n){return wt(n)}function Bt(n){{var x=typeof Symbol=="function"&&Symbol.toStringTag,N=x&&n[Symbol.toStringTag]||n.constructor.name||"Object";return N}}function At(n){try{return Je(n),!1}catch{return!0}}function Je(n){return""+n}function Ue(n){if(At(n))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Bt(n)),Je(n)}var Qe=p.ReactCurrentOwner,Lt={key:!0,ref:!0,__self:!0,__source:!0},Ye,qe;function Ct(n){if(he.call(n,"ref")){var x=Object.getOwnPropertyDescriptor(n,"ref").get;if(x&&x.isReactWarning)return!1}return n.ref!==void 0}function Rt(n){if(he.call(n,"key")){var x=Object.getOwnPropertyDescriptor(n,"key").get;if(x&&x.isReactWarning)return!1}return n.key!==void 0}function Ot(n,x){typeof n.ref=="string"&&Qe.current}function Ft(n,x){{var N=function(){Ye||(Ye=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",x))};N.isReactWarning=!0,Object.defineProperty(n,"key",{get:N,configurable:!0})}}function Pt(n,x){{var N=function(){qe||(qe=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",x))};N.isReactWarning=!0,Object.defineProperty(n,"ref",{get:N,configurable:!0})}}var Mt=function(n,x,N,w,$,H,P){var F={$$typeof:a,type:n,key:x,ref:N,props:P,_owner:H};return F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(F,"_self",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.defineProperty(F,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F};function Dt(n,x,N,w,$){{var H,P={},F=null,se=null;N!==void 0&&(Ue(N),F=""+N),Rt(x)&&(Ue(x.key),F=""+x.key),Ct(x)&&(se=x.ref,Ot(x,$));for(H in x)he.call(x,H)&&!Lt.hasOwnProperty(H)&&(P[H]=x[H]);if(n&&n.defaultProps){var U=n.defaultProps;for(H in U)P[H]===void 0&&(P[H]=U[H])}if(F||se){var Y=typeof n=="function"?n.displayName||n.name||"Unknown":n;F&&Ft(P,Y),se&&Pt(P,Y)}return Mt(n,F,se,$,w,Qe.current,P)}}var De=p.ReactCurrentOwner,Ke=p.ReactDebugCurrentFrame;function je(n){if(n){var x=n._owner,N=ge(n.type,n._source,x?x.type:null);Ke.setExtraStackFrame(N)}else Ke.setExtraStackFrame(null)}var Ie;Ie=!1;function $e(n){return typeof n=="object"&&n!==null&&n.$$typeof===a}function Ze(){{if(De.current){var n=R(De.current.type);if(n)return` Check the render method of \``+n+"`."}return""}}function It(n){return""}var Xe={};function $t(n){{var x=Ze();if(!x){var N=typeof n=="string"?n:n.displayName||n.name;N&&(x=` Check the top-level render call using <`+N+">.")}return x}}function et(n,x){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var N=$t(x);if(Xe[N])return;Xe[N]=!0;var w="";n&&n._owner&&n._owner!==De.current&&(w=" It was passed a child from "+R(n._owner.type)+"."),je(n),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',N,w),je(null)}}function tt(n,x){{if(typeof n!="object")return;if(Me(n))for(var N=0;N<n.length;N++){var w=n[N];$e(w)&&et(w,x)}else if($e(n))n._store&&(n._store.validated=!0);else if(n){var $=A(n);if(typeof $=="function"&&$!==n.entries)for(var H=$.call(n),P;!(P=H.next()).done;)$e(P.value)&&et(P.value,x)}}}function zt(n){{var x=n.type;if(x==null||typeof x=="string")return;var N;if(typeof x=="function")N=x.propTypes;else if(typeof x=="object"&&(x.$$typeof===y||x.$$typeof===i))N=x.propTypes;else return;if(N){var w=R(x);Et(N,n.props,"prop",w,n)}else if(x.PropTypes!==void 0&&!Ie){Ie=!0;var $=R(x);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof x.getDefaultProps=="function"&&!x.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ht(n){{for(var x=Object.keys(n.props),N=0;N<x.length;N++){var w=x[N];if(w!=="children"&&w!=="key"){je(n),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",w),je(null);break}}n.ref!==null&&(je(n),_("Invalid attribute `ref` supplied to `React.Fragment`."),je(null))}}var st={};function nt(n,x,N,w,$,H){{var P=T(n);if(!P){var F="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(F+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var se=It();se?F+=se:F+=Ze();var U;n===null?U="null":Me(n)?U="array":n!==void 0&&n.$$typeof===a?(U="<"+(R(n.type)||"Unknown")+" />",F=" Did you accidentally export a JSX literal instead of a component?"):U=typeof n,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",U,F)}var Y=Dt(n,x,N,$,H);if(Y==null)return Y;if(P){var oe=x.children;if(oe!==void 0)if(w)if(Me(oe)){for(var ke=0;ke<oe.length;ke++)tt(oe[ke],n);Object.freeze&&Object.freeze(oe)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tt(oe,n)}if(he.call(x,"key")){var Ne=R(n),ie=Object.keys(x).filter(function(Qt){return Qt!=="key"}),ze=ie.length>0?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}";if(!st[Ne+ze]){var Ut=ie.length>0?"{"+ie.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,ze,Ne,Ut,Ne),st[Ne+ze]=!0}}return n===s?Ht(Y):zt(Y),Y}}function Wt(n,x,N){return nt(n,x,N,!0)}function Gt(n,x,N){return nt(n,x,N,!1)}var Vt=Gt,Jt=Wt;Be.Fragment=s,Be.jsx=Vt,Be.jsxs=Jt}()),Be}var ot;function ns(){return ot||(ot=1,process.env.NODE_ENV==="production"?Ce.exports=ts():Ce.exports=ss()),Ce.exports}var e=ns();function xt(r){let a=m(r.hash,[]),t=m(r.miner,[]);if(!(a.length>0||t.length>0))return"No filters applied - will match all blocks";let u=[];if(a.length>0){let o;a.length===1?o="the block hash is "+a[0]:o="the block hash is "+a.join(" OR "),u.push(o)}if(t.length>0){let o;t.length===1?o="the miner address is "+t[0]:o="the miner address is "+t.join(" OR "),u.push(o)}return u.length>0?"Match blocks where: "+u.join(" AND "):"No filters applied - will match all blocks"}function He(r){let a=m(r.hash,[]),t=m(r.miner,[]);if(!(a.length>0||t.length>0))return"No filters";let u=[],o=[];a.length>0&&o.push("hash"),t.length>0&&o.push("miner");let g=o.length>1;g&&u.push("AND");let b=0;if(a.length>0){let y=b===(o.length-1|0),l=g?y?"└── ":"├── ":"";a.length===1?u.push(l+"hash = "+a[0]):(u.push(l+"OR (hash)"),a.forEach((h,i)=>{let d=i===(a.length-1|0),c=g?y?d?" └── ":" ├── ":d?"│ └── ":"│ ├── ":d?"└── ":"├── ";u.push(c+h)})),b=b+1|0}if(t.length>0){let y=g?"└── ":"";t.length===1?u.push(y+"miner = "+t[0]):(u.push(y+"OR (miner)"),t.forEach((l,h)=>{let i=h===(t.length-1|0),d=g?i?" └── ":" ├── ":i?"└── ":"├── ";u.push(d+l)}))}return u.join(` `)}function gt(r){let a=r.status,t=m(r.from_,[]),s=m(r.to_,[]),u=m(r.sighash,[]),o=m(r.kind,[]),g=m(r.contractAddress,[]),b=m(r.authorizationList,[]);if(!(t.length>0||s.length>0||u.length>0||Fe(a)||o.length>0||g.length>0||b.length>0))return"No filters applied - will match all transactions";let l=[];if(t.length>0){let h;t.length===1?h="the sender address is "+t[0]:h="the sender address is "+t.join(" OR "),l.push(h)}if(s.length>0){let h;s.length===1?h="the recipient address is "+s[0]:h="the recipient address is "+s.join(" OR "),l.push(h)}if(u.length>0){let h;u.length===1?h="the function signature is "+u[0]:h="the function signature is "+u.join(" OR "),l.push(h)}if(a!==void 0){let h=a===1?"successful":"failed";l.push("the transaction is "+h)}if(o.length>0){let h;if(o.length===1)h="the transaction kind is "+o[0].toString();else{let i=o.length,d;switch(i){case 0:d="";break;case 1:d=o[0].toString();break;case 2:d=o[0].toString()+" OR "+o[1].toString();break;default:let c=o[0].toString(),f=o[1].toString(),k=o.slice(2),A=Xt(k,"",(p,_)=>p+" OR "+_.toString());d=c+" OR "+f+A}h="the transaction kind is "+d}l.push(h)}if(g.length>0){let h;g.length===1?h="the contract address is "+g[0]:h="the contract address is "+g.join(" OR "),l.push(h)}if(b.length>0){let h=b.length===1?"the authorization list includes "+b.length.toString()+" authorization":"the authorization list includes "+b.length.toString()+" authorizations";l.push(h)}return l.length>0?"Match transactions where: "+l.join(" AND "):"No filters applied - will match all transactions"}function We(r){let a=r.status,t=m(r.from_,[]),s=m(r.to_,[]),u=m(r.sighash,[]),o=m(r.kind,[]),g=m(r.contractAddress,[]),b=m(r.authorizationList,[]);if(!(t.length>0||s.length>0||u.length>0||Fe(a)||o.length>0||g.length>0||b.length>0))return"No filters";let l=[],h=[];t.length>0&&h.push("from"),s.length>0&&h.push("to"),u.length>0&&h.push("sighash"),Fe(a)&&h.push("status"),o.length>0&&h.push("kind"),g.length>0&&h.push("contractAddress"),b.length>0&&h.push("authorizationList");let i=h.length>1;i&&l.push("AND");let d=0;if(t.length>0){let c=d===(h.length-1|0),f=i?c?"└── ":"├── ":"";t.length===1?l.push(f+"from = "+t[0]):(l.push(f+"OR (from)"),t.forEach((k,A)=>{let p=A===(t.length-1|0),_=i?c?p?" └── ":" ├── ":p?"│ └── ":"│ ├── ":p?"└── ":"├── ";l.push(_+k)})),d=d+1|0}if(s.length>0){let c=d===(h.length-1|0),f=i?c?"└── ":"├── ":"";s.length===1?l.push(f+"to = "+s[0]):(l.push(f+"OR (to)"),s.forEach((k,A)=>{let p=A===(s.length-1|0),_=i?c?p?" └── ":" ├── ":p?"│ └── ":"│ ├── ":p?"└── ":"├── ";l.push(_+k)})),d=d+1|0}if(u.length>0){let c=d===(h.length-1|0),f=i?c?"└── ":"├── ":"";u.length===1?l.push(f+"sighash = "+u[0]):(l.push(f+"OR (sighash)"),u.forEach((k,A)=>{let p=A===(u.length-1|0),_=i?c?p?" └── ":" ├── ":p?"│ └── ":"│ ├── ":p?"└── ":"├── ";l.push(_+k)})),d=d+1|0}if(a!==void 0){let c=d===(h.length-1|0),f=i?c?"└── ":"├── ":"",k=a===1?"success":"failed";l.push(f+"status = "+a.toString()+" ("+k+")"),d=d+1|0}if(o.length>0){let c=d===(h.length-1|0),f=i?c?"└── ":"├── ":"";o.length===1?l.push(f+"kind = "+o[0].toString()):(l.push(f+"OR (kind)"),o.forEach((k,A)=>{let p=A===(o.length-1|0),_=i?c?p?" └── ":" ├── ":p?"│ └── ":"│ ├── ":p?"└── ":"├── ";l.push(_+k.toString())})),d=d+1|0}if(g.length>0){let c=d===(h.length-1|0),f=i?c?"└── ":"├── ":"";g.length===1?l.push(f+"contractAddress = "+g[0]):(l.push(f+"OR (contractAddress)"),g.forEach((k,A)=>{let p=A===(g.length-1|0),_=i?c?p?" └── ":" ├── ":p?"│ └── ":"│ ├── ":p?"└── ":"├── ";l.push(_+k)})),d=d+1|0}if(b.length>0){let c=d===(h.length-1|0),f=i?c?"└── ":"├── ":"";b.length===1?l.push(f+"authorizationList has "+b.length.toString()+" authorization"):l.push(f+"authorizationList has "+b.length.toString()+" authorizations"),d=d+1|0}return l.join(` `)}function _e(r){let a=m(r.address,[]),t=m(r.topics,[]);return a.length===0?t.length===0:!1}function Se(r){let a=m(r.from_,[]),t=m(r.to_,[]),s=m(r.sighash,[]),u=m(r.kind,[]),o=m(r.contractAddress,[]),g=m(r.authorizationList,[]);return a.length===0&&t.length===0&&s.length===0&&ft(r.status)&&u.length===0&&o.length===0?g.length===0:!1}function Te(r){let a=m(r.hash,[]),t=m(r.miner,[]);return a.length===0?t.length===0:!1}function rs(r){let a=m(r.address,[]),t=m(r.topics,[]),s=[];if(a.length>0){let o;a.length===1?o="the contract address is "+a[0]:o="the contract address is "+a.join(" OR "),s.push(o)}let u=[];if(t.forEach((o,g)=>{if(o.length<=0)return;let b;if(o.length===1)b="topic["+g.toString()+"] is "+o[0];else{let y=o.join(" OR ");b="topic["+g.toString()+"] is "+y}u.push(b)}),u.length>0){let o=u.join(" AND ");s.push(o)}return s.join(" AND ")}function as(r){let a=gt(r);return a.startsWith("Match transactions where: ")?a.slice(26):a}function is(r){let a=xt(r);return a.startsWith("Match blocks where: ")?a.slice(20):a}function ls(r){if(r===void 0||r.length===0)return"selecting None";if(r.length===1&&_e(r[0]))return"selecting ALL";let a=r.map(t=>{if(_e(t))return"ALL logs";let s=rs(t);return s.includes(" AND ")?"("+s+")":s}).filter(t=>t!=="");return a.length===0?"selecting None":"Match logs where: "+a.join(" OR ")}function os(r){if(r===void 0||r.length===0)return"selecting None";if(r.length===1&&Se(r[0]))return"selecting ALL";let a=r.map(t=>{if(Se(t))return"ALL transactions";let s=as(t);return s.includes(" AND ")?"("+s+")":s}).filter(t=>t!=="");return a.length===0?"selecting None":"Match transactions where: "+a.join(" OR ")}function cs(r){if(r===void 0||r.length===0)return"selecting None";if(r.length===1&&Te(r[0]))return"selecting ALL";let a=r.map(t=>{if(Te(t))return"ALL blocks";let s=is(t);return s.includes(" AND ")?"("+s+")":s}).filter(t=>t!=="");return a.length===0?"selecting None":"Match blocks where: "+a.join(" OR ")}function ds(r){let a=m(r.address,[]),t=m(r.topics,[]);if(a.length===0&&t.length===0)return"No filters applied - will match all logs";let s=[];if(a.length>0){let o;a.length===1?o="the contract address is "+a[0]:o="the contract address is "+a.join(" OR "),s.push(o)}let u=[];if(t.forEach((o,g)=>{if(o.length<=0)return;let b;if(o.length===1)b="topic["+g.toString()+"] is "+o[0];else{let y=o.join(" OR ");b="topic["+g.toString()+"] is "+y}u.push(b)}),u.length>0){let o=u.join(" AND ");s.push(o)}return s.length>0?"Match logs where: "+s.join(" AND "):"No filters applied - will match all logs"}function Ge(r){let a=m(r.address,[]),t=m(r.topics,[]);if(a.length===0&&t.length===0)return"No filters";let s=[],u=a.length>0&&t.some(g=>g.length>0);if(u&&s.push("AND"),a.length>0){let g=u?"├── ":"";a.length===1?s.push(g+"address = "+a[0]):(s.push(g+"OR (address)"),a.forEach((b,y)=>{let l=y===(a.length-1|0),h=u?l?"│ └── ":"│ ├── ":l?"└── ":"├── ";s.push(h+b)}))}let o=be(t,g=>{if(g.length>0)return g});if(o.length>0){let g=o.length>1,b=u?"└── ":"";g&&s.push(b+"AND (topics)");let y={contents:0};t.forEach((l,h)=>{if(l.length<=0)return;let i=y.contents===(o.length-1|0),d=u?g?i?" └── ":" ├── ":"└── ":g?i?"└── ":"├── ":"";l.length===1?s.push(d+"topic["+h.toString()+"] = "+l[0]):(s.push(d+"OR (topic["+h.toString()+"])"),l.forEach((c,f)=>{let k=f===(l.length-1|0),A=u?g?i?k?" └── ":" ├── ":k?" │ └── ":" │ ├── ":k?"└── ":"├── ":g?i?k?" └── ":" ├── ":k?"│ └── ":"│ ├── ":k?"└── ":"├── ";s.push(A+c)})),y.contents=y.contents+1|0})}return s.join(` `)}function us(r){if(r===void 0||r.length===0)return"No filters";if(r.length===1&&_e(r[0]))return"All logs";let a=r.filter(o=>!_e(o)),t=r.some(_e);if(a.length===0&&t)return"All logs";if(a.length===1&&!t)return Ge(a[0]);let s=[];s.push("OR");let u=t?a.concat([{address:void 0,topics:void 0}]):a;return u.forEach((o,g)=>{let b=g===(u.length-1|0),y=b?"└── ":"├── ";if(_e(o)){s.push(y+"All logs");return}let l=Ge(o);if(l.includes(` `)){l.split(` `).forEach((i,d)=>{if(d===0){s.push(y+i);return}let c=b?" ":"│ ";s.push(c+i)});return}s.push(y+l)}),s.join(` `)}function ms(r){if(r===void 0||r.length===0)return"No filters";if(r.length===1&&Se(r[0]))return"All transactions";let a=r.filter(o=>!Se(o)),t=r.some(Se);if(a.length===0&&t)return"All transactions";if(a.length===1&&!t)return We(a[0]);let s=[];s.push("OR");let u=t?a.concat([{from_:void 0,to_:void 0,sighash:void 0,status:void 0,kind:void 0,contractAddress:void 0,authorizationList:void 0}]):a;return u.forEach((o,g)=>{let b=g===(u.length-1|0),y=b?"└── ":"├── ";if(Se(o)){s.push(y+"All transactions");return}let l=We(o);if(l.includes(` `)){l.split(` `).forEach((i,d)=>{if(d===0){s.push(y+i);return}let c=b?" ":"│ ";s.push(c+i)});return}s.push(y+l)}),s.join(` `)}function hs(r){if(r===void 0||r.length===0)return"No filters";if(r.length===1&&Te(r[0]))return"All blocks";let a=r.filter(o=>!Te(o)),t=r.some(Te);if(a.length===0&&t)return"All blocks";if(a.length===1&&!t)return He(a[0]);let s=[];s.push("OR");let u=t?a.concat([{hash:void 0,miner:void 0}]):a;return u.forEach((o,g)=>{let b=g===(u.length-1|0),y=b?"└── ":"├── ";if(Te(o)){s.push(y+"All blocks");return}let l=He(o);if(l.includes(` `)){l.split(` `).forEach((i,d)=>{if(d===0){s.push(y+i);return}let c=b?" ":"│ ";s.push(c+i)});return}s.push(y+l)}),s.join(` `)}function fs(r){let a=r.onRemove,t=r.onFilterChange,s=r.filterState,u=W.useState(()=>!0),o=u[1],g=u[0],b=W.useState(()=>""),y=b[1],l=b[0],h=W.useState(()=>""),i=h[1],d=h[0],c=W.useState(()=>0),f=c[1],k=c[0],p={address:void 0,topics:[["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]]},S={address:void 0,topics:[["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],[],["0x0000000000000000000000000000000000000000000000000000000000000000"]]},G=()=>{if(l!==""&&l.startsWith("0x"))return t({address:m(s.address,[]).concat([l]),topics:s.topics}),y(T=>"")},q=()=>{if(!(d!==""&&d.startsWith("0x")))return;let T=qt(m(s.topics,[]).length,k+1|0),E=Kt(T,M=>M<m(s.topics,[]).length?m(s.topics,[])[M]:[]),R=m(rt(E,k),[]).concat([d]);E[k]=R,t({address:s.address,topics:E}),i(M=>"")},K=()=>ds({address:s.address,topics:s.topics}),Q=()=>Ge({address:s.address,topics:s.topics}),j=()=>{let T=m(s.address,[]),E=m(s.topics,[]),B;T.length>0?B=` "address": [ `+T.map(z=>' "'+z+'"').join(`, `)+` ]`:B="";let R;E.length>0?R=` "topics": [ `+E.map(z=>z.length===0?" []":` [ `+z.map(Z=>' "'+Z+'"').join(`, `)+` ]`).join(`, `)+` ]`:R="";let M=[B,R].filter(O=>O!=="");return M.length>0?`{ `+M.join(`, `)+` }`:"{}"},C=m(s.address,[]).length>0||m(s.topics,[]).length>0;return e.jsxs("div",{children:[e.jsx("div",{children:e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("h3",{children:"Log Filter "+(r.filterIndex+1|0).toString(),className:"text-lg font-medium text-gray-900"}),C?e.jsx("span",{children:"Active",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800"}):null],className:"flex items-center space-x-3"}),e.jsxs("div",{children:[e.jsx("button",{children:e.jsx("svg",{children:e.jsx("path",{d:"M19 9l-7 7-7-7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),className:"w-4 h-4 transform transition-transform "+(g?"rotate-180":"rotate-0"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}),className:"inline-flex items-center p-2 text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:T=>o(E=>!E)}),e.jsx("button",{children:e.jsx("svg",{children:e.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}),className:"inline-flex items-center p-2 text-sm font-medium text-red-500 hover:text-red-700 hover:bg-red-100 rounded-md focus:outline-none focus:ring-2 focus:ring-red-500",onClick:T=>a()})],className:"flex items-center space-x-2"})],className:"flex items-center justify-between"}),className:"p-4 border-b border-gray-200"}),g?e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("button",{children:"Transfer Events",className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:T=>t(p)}),e.jsx("button",{children:"Burn Events",className:"px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",onClick:T=>t(S)})],className:"mb-4 flex flex-wrap gap-2"}),e.jsxs("div",{children:[e.jsx("label",{children:"Contract Addresses",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsxs("div",{children:[e.jsx("input",{className:"flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"0x...",type:"text",value:l,onChange:T=>{let E=T.target;y(B=>E.value)}}),e.jsx("button",{children:m(s.address,[]).length>0?"Add (via OR) Address":"Add Address",className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",disabled:l.length===0||!l.startsWith("0x"),onClick:T=>G()})],className:"flex space-x-2 mb-3"}),e.jsx("div",{children:m(s.address,[]).map((T,E)=>e.jsxs("div",{children:[e.jsx("span",{children:T,className:"text-sm font-mono text-gray-800"}),e.jsx("button",{children:"Remove",className:"text-red-600 hover:text-red-800 text-sm",onClick:B=>{let R=m(s.address,[]),M=ce(R,(O,z)=>z!==E);t({address:M.length>0?M:void 0,topics:s.topics})}})],className:"flex items-center justify-between bg-gray-50 px-3 py-2 rounded-md"},E.toString())),className:"space-y-2"})],className:"mb-6"}),e.jsxs("div",{children:[e.jsx("label",{children:"Event Topics",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsxs("div",{children:[e.jsx("select",{children:Zt(0,3).map((T,E)=>e.jsx("option",{children:"Topic "+E.toString(),value:E.toString()},E.toString())),className:"border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",value:k.toString(),onChange:T=>{let E=T.target,B=pe(E.value);if(B!==void 0)return f(R=>B)}}),e.jsx("input",{className:"flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"0x...",type:"text",value:d,onChange:T=>{let E=T.target;i(B=>E.value)}}),e.jsx("button",{children:k<m(s.topics,[]).length&&m(s.topics,[])[k].length>0?"Add (via OR) Topic":"Add Topic",className:"px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed",disabled:d.length===0||!d.startsWith("0x"),onClick:T=>q()})],className:"flex space-x-2 mb-3"}),e.jsx("div",{children:m(s.topics,[]).map((T,E)=>e.jsxs("div",{children:[e.jsx("h4",{children:"Topic "+E.toString(),className:"text-sm font-medium text-gray-700 mb-2"}),e.jsx("div",{children:T.map((B,R)=>e.jsxs("div",{children:[e.jsx("span",{children:B,className:"text-sm font-mono text-gray-800"}),e.jsx("button",{children:"Remove",className:"text-red-600 hover:text-red-800 text-sm",onClick:M=>{let O=m(s.topics,[]),z=m(rt(O,E),[]),ee=ce(z,(te,ne)=>ne!==R),Z=O.map((te,ne)=>ne===E?ee:te);t({address:s.address,topics:Z.length>0&&Z.some(te=>te.length>0)?Z:void 0})}})],className:"flex items-center justify-between bg-gray-50 px-3 py-2 rounded-md"},E.toString()+"-"+R.toString())),className:"space-y-2"})],className:"border border-gray-200 rounded-md p-3"},E.toString())),className:"space-y-3"})],className:"mb-6"}),e.jsxs("div",{children:[e.jsx("label",{children:"English Description",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("div",{children:e.jsx("p",{children:K(),className:"text-sm text-blue-800"}),className:"bg-blue-50 border border-blue-200 rounded-md p-4 mb-4"}),e.jsx("label",{children:"Boolean Logic Hierarchy",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("pre",{children:Q(),className:"bg-gray-50 border border-gray-200 rounded-md p-4 text-sm font-mono mb-4 whitespace-pre overflow-x-auto"}),e.jsx("label",{children:"Generated Query Structure",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("pre",{children:j(),className:"bg-gray-100 border border-gray-300 rounded-md p-4 text-sm font-mono overflow-x-auto"})],className:"mt-6"})],className:"p-6"}):null],className:"bg-white rounded-lg shadow"})}let pt=fs;function xs(r){let a=r.onRemove,t=r.onFilterChange,s=r.filterState,u=W.useState(()=>!0),o=u[1],g=u[0],b=W.useState(()=>""),y=b[1],l=b[0],h=W.useState(()=>""),i=h[1],d=h[0],f={hash:void 0,miner:["0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97"]},k=()=>{if(l!==""&&l.startsWith("0x"))return t({hash:m(s.hash,[]).concat([l]),miner:s.miner}),y(S=>"")},A=()=>{if(d!==""&&d.startsWith("0x"))return t({hash:s.hash,miner:m(s.miner,[]).concat([d])}),i(S=>"")},p=()=>{let S=s.miner,G=s.hash,q;G!==void 0&&G.length>0?q=` "hash": [ `+G.map(C=>' "'+C+'"').join(`, `)+` ]`:q="";let K;S!==void 0&&S.length>0?K=` "miner": [ `+S.map(C=>' "'+C+'"').join(`, `)+` ]`:K="";let Q=[q,K].filter(j=>j!=="");return Q.length>0?`{ `+Q.join(`, `)+` }`:"{}"},_=m(s.hash,[]).length>0||m(s.miner,[]).length>0;return e.jsxs("div",{children:[e.jsx("div",{children:e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("h3",{children:"Block Filter "+(r.filterIndex+1|0).toString(),className:"text-lg font-medium text-gray-900"}),_?e.jsx("span",{children:"Active",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800"}):null],className:"flex items-center space-x-3"}),e.jsxs("div",{children:[e.jsx("button",{children:e.jsx("svg",{children:e.jsx("path",{d:"M19 9l-7 7-7-7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),className:"w-4 h-4 transform transition-transform "+(g?"rotate-180":"rotate-0"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}),className:"inline-flex items-center p-2 text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:S=>o(G=>!G)}),e.jsx("button",{children:e.jsx("svg",{children:e.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}),className:"inline-flex items-center p-2 text-sm font-medium text-red-500 hover:text-red-700 hover:bg-red-100 rounded-md focus:outline-none focus:ring-2 focus:ring-red-500",onClick:S=>a()})],className:"flex items-center space-x-2"})],className:"flex items-center justify-between"}),className:"p-4 border-b border-gray-200"}),g?e.jsxs("div",{children:[e.jsx("div",{children:e.jsx("button",{children:"Titan Builder Blocks",className:"px-4 py-2 bg-purple-600 text-white text-sm font-medium rounded-md hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500",onClick:S=>t(f)}),className:"mb-4"}),e.jsxs("div",{children:[e.jsx("label",{children:"Block Hashes",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsxs("div",{children:[e.jsx("input",{className:"flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"0x...",type:"text",value:l,onChange:S=>{let G=S.target;y(q=>G.value)}}),e.jsx("button",{children:m(s.hash,[]).length>0?"Add (via OR) Hash":"Add Hash",className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",disabled:l.length===0||!l.startsWith("0x"),onClick:S=>k()})],className:"flex space-x-2 mb-3"}),e.jsx("div",{children:m(s.hash,[]).map((S,G)=>e.jsxs("div",{children:[e.jsx("span",{children:S,className:"text-sm font-mono text-gray-800"}),e.jsx("button",{children:"Remove",className:"text-red-600 hover:text-red-800 text-sm",onClick:q=>{let K=m(s.hash,[]),Q=ce(K,(j,C)=>C!==G);t({hash:Q.length>0?Q:void 0,miner:s.miner})}})],className:"flex items-center justify-between bg-gray-50 px-3 py-2 rounded-md"},G.toString())),className:"space-y-2"})],className:"mb-6"}),e.jsxs("div",{children:[e.jsx("label",{children:"Miner Addresses",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsxs("div",{children:[e.jsx("input",{className:"flex-1 border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"0x...",type:"text",value:d,onChange:S=>{let G=S.target;i(q=>G.value)}}),e.jsx("button",{children:m(s.miner,[]).length>0?"Add (via OR) Miner":"Add Miner",className:"px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed",disabled:d.length===0||!d.startsWith("0x"),onClick:S=>A()})],className:"flex space-x-2 mb-3"}),e.jsx("div",{children:m(s.miner,[]).map((S,G)=>e.jsxs("div",{children:[e.jsx("span",{children:S,className:"text-sm font-mono text-gray-800"}),e.jsx("button",{children:"Remove",className:"text-red-600 hover:text-red-800 text-sm",onClick:q=>{let K=m(s.miner,[]),Q=ce(K,(j,C)=>C!==G);t({hash:s.hash,miner:Q.length>0?Q:void 0})}})],className:"flex items-center justify-between bg-gray-50 px-3 py-2 rounded-md"},G.toString())),className:"space-y-2"})],className:"mb-6"}),e.jsxs("div",{children:[e.jsx("label",{children:"English Description",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("div",{children:e.jsx("p",{children:xt(s),className:"text-sm text-blue-800"}),className:"bg-blue-50 border border-blue-200 rounded-md p-4 mb-4"}),e.jsx("label",{children:"Boolean Logic Hierarchy",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("pre",{children:He(s),className:"bg-gray-50 border border-gray-200 rounded-md p-4 text-sm font-mono mb-4 whitespace-pre overflow-x-auto"}),e.jsx("label",{children:"Generated Query Structure",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("pre",{children:p(),className:"bg-gray-100 border border-gray-300 rounded-md p-4 text-sm font-mono overflow-x-auto"})],className:"mt-6"})],className:"p-6"}):null],className:"bg-white rounded-lg shadow"})}let bt=xs;function gs(r){let a=r.query,t=W.useState(()=>"Logs"),s=t[1],u=t[0],o=a.logs,g=o!==void 0?o.length>0:!1,b=a.transactions,y=b!==void 0?b.length>0:!1,l=a.blocks,h=l!==void 0?l.length>0:!1,i;switch(u){case"Logs":i=e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("h4",{children:"Log Filters Boolean Logic",className:"text-lg font-medium text-gray-900 mb-2"}),e.jsx("p",{children:"Boolean hierarchy for log filtering. Multiple filters are combined with OR logic.",className:"text-sm text-gray-600"})],className:"mb-4"}),g?e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("label",{children:"English Description",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("div",{children:e.jsx("p",{children:ls(a.logs),className:"text-sm text-blue-800"}),className:"bg-blue-50 border border-blue-200 rounded-md p-4"})]}),e.jsxs("div",{children:[e.jsx("label",{children:"Boolean Logic Hierarchy",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("pre",{children:us(a.logs),className:"bg-gray-50 border border-gray-200 rounded-md p-4 text-sm font-mono whitespace-pre overflow-x-auto"})]})],className:"space-y-6"}):e.jsxs("div",{children:[e.jsx("div",{children:e.jsx("svg",{children:e.jsx("path",{d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1"}),className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}),className:"text-gray-400 mb-4"}),e.jsx("h4",{children:"No Log Filters",className:"text-lg font-medium text-gray-500 mb-2"}),e.jsx("p",{children:"Add log filters to see the boolean logic visualization",className:"text-gray-400"})],className:"text-center py-12"})]});break;case"Transactions":i=e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("h4",{children:"Transaction Filters Boolean Logic",className:"text-lg font-medium text-gray-900 mb-2"}),e.jsx("p",{children:"Boolean hierarchy for transaction filtering. Multiple filters are combined with OR logic.",className:"text-sm text-gray-600"})],className:"mb-4"}),y?e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("label",{children:"English Description",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("div",{children:e.jsx("p",{children:os(a.transactions),className:"text-sm text-green-800"}),className:"bg-green-50 border border-green-200 rounded-md p-4"})]}),e.jsxs("div",{children:[e.jsx("label",{children:"Boolean Logic Hierarchy",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("pre",{children:ms(a.transactions),className:"bg-gray-50 border border-gray-200 rounded-md p-4 text-sm font-mono whitespace-pre overflow-x-auto"})]})],className:"space-y-6"}):e.jsxs("div",{children:[e.jsx("div",{children:e.jsx("svg",{children:e.jsx("path",{d:"M7 4V2a1 1 0 011-1h4a1 1 0 011 1v2h4a1 1 0 011 1v2a1 1 0 01-1 1h-1v9a2 2 0 01-2 2H8a2 2 0 01-2-2V8H5a1 1 0 01-1-1V5a1 1 0 011-1h4z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1"}),className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}),className:"text-gray-400 mb-4"}),e.jsx("h4",{children:"No Transaction Filters",className:"text-lg font-medium text-gray-500 mb-2"}),e.jsx("p",{children:"Add transaction filters to see the boolean logic visualization",className:"text-gray-400"})],className:"text-center py-12"})]});break;case"Blocks":i=e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("h4",{children:"Block Filters Boolean Logic",className:"text-lg font-medium text-gray-900 mb-2"}),e.jsx("p",{children:"Boolean hierarchy for block filtering. Multiple filters are combined with OR logic.",className:"text-sm text-gray-600"})],className:"mb-4"}),h?e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("label",{children:"English Description",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("div",{children:e.jsx("p",{children:cs(a.blocks),className:"text-sm text-purple-800"}),className:"bg-purple-50 border border-purple-200 rounded-md p-4"})]}),e.jsxs("div",{children:[e.jsx("label",{children:"Boolean Logic Hierarchy",className:"block text-sm font-medium text-gray-700 mb-2"}),e.jsx("pre",{children:hs(a.blocks),className:"bg-gray-50 border border-gray-200 rounded-md p-4 text-sm font-mono whitespace-pre overflow-x-auto"})]})],className:"space-y-6"}):e.jsxs("div",{children:[e.jsx("div",{children:e.jsx("svg",{children:e.jsx("path",{d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1"}),className:"w-12 h-12 mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"}),className:"text-gray-400 mb-4"}),e.jsx("h4",{children:"No Block Filters",className:"text-lg font-medium text-gray-500 mb-2"}),e.jsx("p",{children:"Add block filters to see the boolean logic visualization",className:"text-gray-400"})],className:"text-center py-12"})]});break}return e.jsxs("div",{children:[e.jsx("div",{children:e.jsxs("nav",{children:[e.jsx("button",{children:e.jsxs("div",{children:[e.jsx("span",{children:"Logs"}),g?e.jsx("span",{children:m(a.logs,[]).length.toString(),className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800"}):null],className:"flex items-center space-x-2"}),className:"py-2 px-1 border-b-2 font-medium text-sm "+(u==="Logs"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),onClick:d=>s(c=>"Logs")}),e.jsx("button",{children:e.jsxs("div",{children:[e.jsx("span",{children:"Transactions"}),y?e.jsx("span",{children:m(a.transactions,[]).length.toString(),className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800"}):null],className:"flex items-center space-x-2"}),className:"py-2 px-1 border-b-2 font-medium text-sm "+(u==="Transactions"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),onClick:d=>s(c=>"Transactions")}),e.jsx("button",{children:e.jsxs("div",{children:[e.jsx("span",{children:"Blocks"}),h?e.jsx("span",{children:m(a.blocks,[]).length.toString(),className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-purple-100 text-purple-800"}):null],className:"flex items-center space-x-2"}),className:"py-2 px-1 border-b-2 font-medium text-sm "+(u==="Blocks"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"),onClick:d=>s(c=>"Blocks")})],className:"flex space-x-6"}),className:"border-b border-gray-200 mb-6"}),e.jsx("div",{children:i,className:"min-h-80"})]})}let yt=gs;function ps(r){switch(r){case"Number":return"number";case"Hash":return"hash";case"ParentHash":return"parent_hash";case"Nonce":return"nonce";case"Sha3Uncles":return"sha3_uncles";case"LogsBloom":return"logs_bloom";case"TransactionsRoot":return"transactions_root";case"StateRoot":return"state_root";case"ReceiptsRoot":return"receipts_root";case"Miner":return"miner";case"Difficulty":return"difficulty";case"TotalDifficulty":return"total_difficulty";case"ExtraData":return"extra_data";case"Size":return"size";case"GasLimit":return"gas_limit";case"GasUsed":return"gas_used";case"Timestamp":return"timestamp";case"Uncles":return"uncles";case"BaseFeePerGas":return"base_fee_per_gas";case"BlobGasUsed":return"blob_gas_used";case"ExcessBlobGas":return"excess_blob_gas";case"ParentBeaconBlockRoot":return"parent_beacon_block_root";case"WithdrawalsRoot":return"withdrawals_root";case"Withdrawals":return"withdrawals";case"L1BlockNumber":return"l1_block_number";case"SendCount":return"send_count";case"SendRoot":return"send_root";case"MixHash":return"mix_hash"}}function bs(r){switch(r){case"BlockHash":return"block_hash";case"BlockNumber":return"block_number";case"From":return"from";case"Gas":return"gas";case"GasPrice":return"gas_price";case"Hash":return"hash";case"Input":return"input";case"Nonce":return"nonce";case"To":return"to";case"TransactionIndex":return"transaction_index";case"Value":return"value";case"V":return"v";case"R":return"r";case"S":return"s";case"YParity":return"y_parity";case"MaxPriorityFeePerGas":return"max_priority_fee_per_gas";case"MaxFeePerGas":return"max_fee_per_gas";case"ChainId":return"chain_id";case"AccessList":return"access_list";case"AuthorizationList":return"authorization_list";case"MaxFeePerBlobGas":return"max_fee_per_blob_gas";case"BlobVersionedHashes":return"blob_versioned_hashes";case"CumulativeGasUsed":return"cumulative_gas_used";case"EffectiveGasPrice":return"effective_gas_price";case"GasUsed":return"gas_used";case"ContractAddress":return"contract_address";case"LogsBloom":return"logs_bloom";case"Kind":return"kind";case"Root":return"root";case"Status":return"status";case"L1Fee":return"l1_fee";case"L1GasPrice":return"l1_gas_price";case"L1GasUsed":return"l1_gas_used";case"L1FeeScalar":return"l1_fee_scalar";case"GasUsedForL1":return"gas_used_for_l1"}}function ys(r){switch(r){case"Removed":return"removed";case"LogIndex":return"log_index";case"TransactionIndex":return"transaction_index";case"TransactionHash":return"transaction_hash";case"BlockHash":return"block_hash";case"BlockNumber":return"block_number";case"Address":return"address";case"Data":return"data";case"Topic0":return"topic0";case"Topic1":return"topic1";case"Topic2":return"topic2";case"Topic3":return"topic3"}}let ct=[["Number","Number"],["Hash","Hash"],["ParentHash","Parent Hash"],["Nonce","Nonce"],["Miner","Miner"],["Difficulty","Difficulty"],["TotalDifficulty","Total Difficulty"],["Size","Size"],["GasLimit","Gas Limit"],["GasUsed","Gas Used"],["Timestamp","Timestamp"],["BaseFeePerGas","Base Fee Per Gas"],["Sha3Uncles","SHA3 Uncles"],["LogsBloom","Logs Bloom"],["TransactionsRoot","Transactions Root"],["StateRoot","State Root"],["ReceiptsRoot","Receipts Root"],["ExtraData","Extra Data"],["Uncles","Uncles"],["BlobGasUsed","Blob Gas Used"],["ExcessBlobGas","Excess Blob Gas"],["ParentBeaconBlockRoot","Parent Beacon Block Root"],["WithdrawalsRoot","Withdrawals Root"],["Withdrawals","Withdrawals"]],dt=[["BlockHash","Block Hash"],["BlockNumber","Block Number"],["From","From"],["To","To"],["Hash","Hash"],["Input","Input"],["Value","Value"],["Gas","Gas"],["GasPrice","Gas Price"],["Nonce","Nonce"],["TransactionIndex","Transaction Index"],["Status","Status"],["CumulativeGasUsed","Cumulative Gas Used"],["EffectiveGasPrice","Effective Gas Price"],["GasUsed","Gas Used"],["ContractAddress","Contract Address"],["V","V"],["R","R"],["S","S"],["YParity","Y Parity"],["MaxPriorityFeePerGas","Max Priority Fee Per Gas"],["MaxFeePerGas","Max Fee Per Gas"],["ChainId","Chain ID"],["AccessList","Access List"],["AuthorizationList","Authorization List"]],ut=[["Address","Address"],["Data","Data"],["Topic0","Topic 0"],["Topic1","Topic 1"],["Topic2","Topic 2"],["Topic3","Topic 3"],["BlockHash","Block Hash"],["BlockNumber","Block Number"],["TransactionHash","Transaction Hash"],["TransactionIndex","Transaction Index"],["LogIndex","Log Index"],["Removed","Removed"]];function Ns(r){let a=r.onFieldSelectionChange,t