@motiadev/plugin-logs 0.9.4-beta.150 → 0.9.4-beta.151-216335

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.
@@ -1 +1 @@
1
- {"version":3,"file":"logs-page.d.ts","sourceRoot":"","sources":["../../src/components/logs-page.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,+CAuFpB,CAAA"}
1
+ {"version":3,"file":"logs-page.d.ts","sourceRoot":"","sources":["../../src/components/logs-page.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ,+CAuFpB,CAAA"}
package/dist/index.cjs CHANGED
@@ -1,57 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("@motiadev/stream-client-browser"),p=require("react"),Y=require("@motiadev/ui");function ot(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const T=ot(p),Ee=e=>{let t;const n=new Set,r=(d,m)=>{const v=typeof d=="function"?d(t):d;if(!Object.is(v,t)){const w=t;t=m??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(E=>E(t,w))}},l=()=>t,c={setState:r,getState:l,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,l,c);return c},it=e=>e?Ee(e):Ee,lt=e=>e;function ct(e,t=lt){const n=p.useSyncExternalStore(e.subscribe,p.useCallback(()=>t(e.getState()),[e,t]),p.useCallback(()=>t(e.getInitialState()),[e,t]));return p.useDebugValue(n),n}const ut=e=>{const t=it(e),n=r=>ct(t,r);return Object.assign(n,t),n},ft=e=>ut,Q=ft()(e=>({logs:[],selectedLogId:void 0,addLog:t=>e(n=>({logs:[t,...n.logs]})),resetLogs:()=>{e({logs:[]})},selectLogId:t=>e({selectedLogId:t})})),dt="__motia.logs",pt="default",gt="log",mt=()=>{new st.Stream(window.location.origin.replace("http","ws")).subscribeGroup(dt,pt).onEvent(gt,Q.getState().addLog)};var te={exports:{}},G={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Ae;function vt(){if(Ae)return G;Ae=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,l,i){var o=null;if(i!==void 0&&(o=""+i),l.key!==void 0&&(o=""+l.key),"key"in l){i={};for(var c in l)c!=="key"&&(i[c]=l[c])}else i=l;return l=i.ref,{$$typeof:e,type:r,key:o,ref:l!==void 0?l:null,props:i}}return G.Fragment=t,G.jsx=n,G.jsxs=n,G}var X={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var ke;function ht(){return ke||(ke=1,process.env.NODE_ENV!=="production"&&function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===B?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case A:return"Profiler";case N:return"StrictMode";case b:return"Suspense";case k:return"SuspenseList";case R:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case x:return"Portal";case $:return(s.displayName||"Context")+".Provider";case P:return(s._context.displayName||"Context")+".Consumer";case h:var g=s.render;return s=s.displayName,s||(s=g.displayName||g.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case C:return g=s.displayName||null,g!==null?g:e(s.type)||"Memo";case H:g=s._payload,s=s._init;try{return e(s(g))}catch{}}return null}function t(s){return""+s}function n(s){try{t(s);var g=!1}catch{g=!0}if(g){g=console;var y=g.error,f=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return y.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",f),t(s)}}function r(s){if(s===S)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===H)return"<...>";try{var g=e(s);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function l(){var s=L.A;return s===null?null:s.getOwner()}function i(){return Error("react-stack-top-frame")}function o(s){if(D.call(s,"key")){var g=Object.getOwnPropertyDescriptor(s,"key").get;if(g&&g.isReactWarning)return!1}return s.key!==void 0}function c(s,g){function y(){O||(O=!0,console.error("%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://react.dev/link/special-props)",g))}y.isReactWarning=!0,Object.defineProperty(s,"key",{get:y,configurable:!0})}function u(){var s=e(this.type);return M[s]||(M[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function d(s,g,y,f,j,V,ae,se){return y=V.ref,s={$$typeof:E,type:s,key:g,props:V,_owner:j},(y!==void 0?y:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:u}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ae}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function m(s,g,y,f,j,V,ae,se){var I=g.children;if(I!==void 0)if(f)if(U(I)){for(f=0;f<I.length;f++)v(I[f]);Object.freeze&&Object.freeze(I)}else console.error("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 v(I);if(D.call(g,"key")){I=e(s);var q=Object.keys(g).filter(function(at){return at!=="key"});f=0<q.length?"{key: someKey, "+q.join(": ..., ")+": ...}":"{key: someKey}",F[I+f]||(q=0<q.length?"{"+q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("@motiadev/stream-client-browser"),p=require("react"),V=require("@motiadev/ui");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const T=st(p),Ee=e=>{let t;const n=new Set,r=(d,g)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const w=t;t=g??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(x=>x(t,w))}},l=()=>t,c={setState:r,getState:l,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,l,c);return c},ot=(e=>e?Ee(e):Ee),it=e=>e;function lt(e,t=it){const n=p.useSyncExternalStore(e.subscribe,p.useCallback(()=>t(e.getState()),[e,t]),p.useCallback(()=>t(e.getInitialState()),[e,t]));return p.useDebugValue(n),n}const ct=e=>{const t=ot(e),n=r=>lt(t,r);return Object.assign(n,t),n},ut=(e=>ct),Q=ut()(e=>({logs:[],selectedLogId:void 0,addLog:t=>e(n=>({logs:[t,...n.logs]})),resetLogs:()=>{e({logs:[]})},selectLogId:t=>e({selectedLogId:t})})),ft="__motia.logs",dt="default",pt="log",gt=()=>{new at.Stream(window.location.origin.replace("http","ws")).subscribeGroup(ft,dt).onEvent(pt,Q.getState().addLog)};var te={exports:{}},G={};var Se;function mt(){if(Se)return G;Se=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,l,i){var o=null;if(i!==void 0&&(o=""+i),l.key!==void 0&&(o=""+l.key),"key"in l){i={};for(var c in l)c!=="key"&&(i[c]=l[c])}else i=l;return l=i.ref,{$$typeof:e,type:r,key:o,ref:l!==void 0?l:null,props:i}}return G.Fragment=t,G.jsx=n,G.jsxs=n,G}var X={};var Ae;function vt(){return Ae||(Ae=1,process.env.NODE_ENV!=="production"&&(function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===$?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case N:return"Fragment";case P:return"Profiler";case S:return"StrictMode";case A:return"Suspense";case C:return"SuspenseList";case z:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case E:return"Portal";case b:return s.displayName||"Context";case I:return(s._context.displayName||"Context")+".Consumer";case j:var m=s.render;return s=s.displayName,s||(s=m.displayName||m.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case Z:return m=s.displayName||null,m!==null?m:e(s.type)||"Memo";case R:m=s._payload,s=s._init;try{return e(s(m))}catch{}}return null}function t(s){return""+s}function n(s){try{t(s);var m=!1}catch{m=!0}if(m){m=console;var f=m.error,v=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return f.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",v),t(s)}}function r(s){if(s===N)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===R)return"<...>";try{var m=e(s);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function l(){var s=D.A;return s===null?null:s.getOwner()}function i(){return Error("react-stack-top-frame")}function o(s){if(M.call(s,"key")){var m=Object.getOwnPropertyDescriptor(s,"key").get;if(m&&m.isReactWarning)return!1}return s.key!==void 0}function c(s,m){function f(){F||(F=!0,console.error("%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://react.dev/link/special-props)",m))}f.isReactWarning=!0,Object.defineProperty(s,"key",{get:f,configurable:!0})}function u(){var s=e(this.type);return _[s]||(_[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function d(s,m,f,v,B,ae){var L=f.ref;return s={$$typeof:y,type:s,key:m,props:f,_owner:v},(L!==void 0?L:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:u}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ae}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function g(s,m,f,v,B,ae){var L=m.children;if(L!==void 0)if(v)if(Y(L)){for(v=0;v<L.length;v++)h(L[v]);Object.freeze&&Object.freeze(L)}else console.error("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 h(L);if(M.call(m,"key")){L=e(s);var q=Object.keys(m).filter(function(rt){return rt!=="key"});v=0<q.length?"{key: someKey, "+q.join(": ..., ")+": ...}":"{key: someKey}",k[L+v]||(q=0<q.length?"{"+q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
2
  let props = %s;
19
3
  <%s {...props} />
20
4
  React keys must be passed directly to JSX without using spread:
21
5
  let props = %s;
22
- <%s key={someKey} {...props} />`,f,I,q,I),F[I+f]=!0)}if(I=null,y!==void 0&&(n(y),I=""+y),o(g)&&(n(g.key),I=""+g.key),"key"in g){y={};for(var oe in g)oe!=="key"&&(y[oe]=g[oe])}else y=g;return I&&c(y,typeof s=="function"?s.displayName||s.name||"Unknown":s),d(s,I,V,j,l(),y,ae,se)}function v(s){typeof s=="object"&&s!==null&&s.$$typeof===E&&s._store&&(s._store.validated=1)}var w=p,E=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),$=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),B=Symbol.for("react.client.reference"),L=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,U=Array.isArray,Z=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(s){return s()}};var O,M={},_=w.react_stack_bottom_frame.bind(w,i)(),z=Z(r(i)),F={};X.Fragment=S,X.jsx=function(s,g,y,f,j){var V=1e4>L.recentlyCreatedOwnerStacks++;return m(s,g,y,!1,f,j,V?Error("react-stack-top-frame"):_,V?Z(r(s)):z)},X.jsxs=function(s,g,y,f,j){var V=1e4>L.recentlyCreatedOwnerStacks++;return m(s,g,y,!0,f,j,V?Error("react-stack-top-frame"):_,V?Z(r(s)):z)}}()),X}var _e;function bt(){return _e||(_e=1,process.env.NODE_ENV==="production"?te.exports=vt():te.exports=ht()),te.exports}var a=bt();/**
23
- * @license lucide-react v0.545.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */const jt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Te=e=>{const t=yt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ke=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),wt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
28
- * @license lucide-react v0.545.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */var xt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
33
- * @license lucide-react v0.545.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */const Ct=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:i,iconNode:o,...c},u)=>p.createElement("svg",{ref:u,...xt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ke("lucide",l),...!i&&!wt(c)&&{"aria-hidden":"true"},...c},[...o.map(([d,m])=>p.createElement(d,m)),...Array.isArray(i)?i:[i]]));/**
38
- * @license lucide-react v0.545.0 - ISC
39
- *
40
- * This source code is licensed under the ISC license.
41
- * See the LICENSE file in the root directory of this source tree.
42
- */const he=(e,t)=>{const n=p.forwardRef(({className:r,...l},i)=>p.createElement(Ct,{ref:i,iconNode:t,className:Ke(`lucide-${jt(Te(e))}`,`lucide-${e}`,r),...l}));return n.displayName=Te(e),n};/**
43
- * @license lucide-react v0.545.0 - ISC
44
- *
45
- * This source code is licensed under the ISC license.
46
- * See the LICENSE file in the root directory of this source tree.
47
- */const St=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Et=he("search",St);/**
48
- * @license lucide-react v0.545.0 - ISC
49
- *
50
- * This source code is licensed under the ISC license.
51
- * See the LICENSE file in the root directory of this source tree.
52
- */const At=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],kt=he("trash",At);/**
53
- * @license lucide-react v0.545.0 - ISC
54
- *
55
- * This source code is licensed under the ISC license.
56
- * See the LICENSE file in the root directory of this source tree.
57
- */const _t=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ge=he("x",_t),Xe=e=>{const t=new Date(Number(e));return`${t.toLocaleDateString("en-US",{year:void 0,month:"short",day:"2-digit"})}, ${t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"})}.${t.getMilliseconds().toString().padStart(3,"0")}`};function Tt(e,t,n,r){function l(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function c(m){try{d(r.next(m))}catch(v){o(v)}}function u(m){try{d(r.throw(m))}catch(v){o(v)}}function d(m){m.done?i(m.value):l(m.value).then(c,u)}d((r=r.apply(e,[])).next())})}var Ot=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(l){e.addRange(l)}),t&&t.focus()}},Nt=Ot,Oe={"text/plain":"Text","text/html":"Url",default:"Text"},Rt="Copy to clipboard: #{key}, Enter";function Lt(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function Dt(e,t){var n,r,l,i,o,c,u=!1;t||(t={}),n=t.debug||!1;try{l=Nt(),i=document.createRange(),o=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(m){if(m.stopPropagation(),t.format)if(m.preventDefault(),typeof m.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var v=Oe[t.format]||Oe.default;window.clipboardData.setData(v,e)}else m.clipboardData.clearData(),m.clipboardData.setData(t.format,e);t.onCopy&&(m.preventDefault(),t.onCopy(m.clipboardData))}),document.body.appendChild(c),i.selectNodeContents(c),o.addRange(i);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");u=!0}catch(m){n&&console.error("unable to copy using execCommand: ",m),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(v){n&&console.error("unable to copy using clipboardData: ",v),n&&console.error("falling back to prompt"),r=Lt("message"in t?t.message:Rt),window.prompt(r,e)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(i):o.removeAllRanges()),c&&document.body.removeChild(c),l()}return u}var Pt=Dt;function W(e){return Object.prototype.toString.call(e)==="[object Object]"}function ee(e){return Array.isArray(e)?e.length:W(e)?Object.keys(e).length:0}function It(e,t){if(typeof e=="string")return e;try{return JSON.stringify(e,(n,r)=>{switch(typeof r){case"bigint":return String(r)+"n";case"number":case"boolean":case"object":case"string":return r;default:return String(r)}},t)}catch(n){return`${n.name}: ${n.message}`||"JSON.stringify failed"}}function $t(e){return Tt(this,void 0,void 0,function*(){try{yield navigator.clipboard.writeText(e)}catch{Pt(e)}})}function Ne(e,t,n,r,l,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const o=ee(e);if(typeof r=="function"){const c=be(r,[{node:e,depth:t,indexOrName:n,size:o}]);if(typeof c=="boolean")return c}return!!(Array.isArray(e)&&o>l||W(e)&&o>l)}function Re(e,t,n,r,l,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const o=Math.ceil(e.length/100);if(typeof r=="function"){const c=be(r,[{node:e,depth:t,indexOrName:n,size:o}]);if(typeof c=="boolean")return c}return!!(Array.isArray(e)&&o>l||W(e)&&o>l)}function K(e,t,n){return typeof e=="boolean"?e:!!(typeof e=="number"&&t>e||e==="collapsed"&&n||e==="expanded"&&!n)}function be(e,t){try{return e(...t)}catch(n){reportError(n)}}function Qe(e){if(e===!0||W(e)&&e.add===!0)return!0}function Le(e){if(e===!0||W(e)&&e.edit===!0)return!0}function je(e){if(e===!0||W(e)&&e.delete===!0)return!0}function Mt(e){return typeof e=="function"}function et(e){return!e||e.add===void 0||!!e.add}function De(e){return!e||e.edit===void 0||!!e.edit}function ye(e){return!e||e.delete===void 0||!!e.delete}function ne(e){return!e||e.enableClipboard===void 0||!!e.enableClipboard}function Ft(e){return!e||e.matchesURL===void 0||!!e.matchesURL}function Ht(e,t){return e==="string"?t.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):t}var Pe;function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}var we=function(t){return T.createElement("svg",ie({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},t),Pe||(Pe=T.createElement("path",{fill:"currentColor",d:"M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"})))},Ie;function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},le.apply(this,arguments)}var Ut=function(t){return T.createElement("svg",le({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Ie||(Ie=T.createElement("path",{fill:"currentColor",d:"M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"})))},$e,Me;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(this,arguments)}var Zt=function(t){return T.createElement("svg",ce({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),$e||($e=T.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"})),Me||(Me=T.createElement("path",{fill:"#14C786",d:"M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"})))};function re({node:e,nodeMeta:t}){const{customizeCopy:n,CopyComponent:r,CopiedComponent:l}=p.useContext(J),[i,o]=p.useState(!1),c=u=>{u.stopPropagation();const d=n(e,t);typeof d=="string"&&d&&$t(d),o(!0),setTimeout(()=>o(!1),3e3)};return i?typeof l=="function"?a.jsx(l,{className:"json-view--copy",style:{display:"inline-block"}}):a.jsx(Zt,{className:"json-view--copy",style:{display:"inline-block"}}):typeof r=="function"?a.jsx(r,{onClick:c,className:"json-view--copy"}):a.jsx(Ut,{onClick:c,className:"json-view--copy"})}function ue({indexOrName:e,value:t,depth:n,deleteHandle:r,editHandle:l,parent:i,parentPath:o}){const{displayArrayIndex:c}=p.useContext(J),u=Array.isArray(i);return a.jsxs("div",Object.assign({className:"json-view--pair"},{children:[!u||u&&c?a.jsxs(a.Fragment,{children:[a.jsx("span",Object.assign({className:typeof e=="number"?"json-view--index":"json-view--property"},{children:e})),":"," "]}):a.jsx(a.Fragment,{}),a.jsx(nt,{node:t,depth:n+1,deleteHandle:(d,m)=>r(d,m),editHandle:(d,m,v,w)=>l(d,m,v,w),parent:i,indexOrName:e,parentPath:o})]}))}var Fe,He;function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe.apply(this,arguments)}var xe=function(t){return T.createElement("svg",fe({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Fe||(Fe=T.createElement("path",{fill:"currentColor",d:"M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"})),He||(He=T.createElement("path",{fill:"#DA0000",d:"M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"})))},Ue,Ze;function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}var tt=function(t){return T.createElement("svg",de({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Ue||(Ue=T.createElement("path",{fill:"currentColor",d:"M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"})),Ze||(Ze=T.createElement("path",{fill:"#14C786",d:"M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"})))},ze,Ve;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}var Ce=function(t){return T.createElement("svg",pe({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),ze||(ze=T.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})),Ve||(Ve=T.createElement("path",{fill:"#14C786",d:"m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"})))},Ye,Be;function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ge.apply(this,arguments)}var Se=function(t){return T.createElement("svg",ge({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Ye||(Ye=T.createElement("path",{fill:"#DA0000",d:"M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"})),Be||(Be=T.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})))};function zt({originNode:e,node:t,depth:n,index:r,deleteHandle:l,customOptions:i,startIndex:o,parent:c,parentPath:u}){const{enableClipboard:d,src:m,onEdit:v,onChange:w,forceUpdate:E,displaySize:x,CustomOperation:S}=p.useContext(J),N=[...u,String(r)],[A,P]=p.useState(!0),$=p.useCallback((k,C,H)=>{e[k]=C,v&&v({newValue:C,oldValue:H,depth:n,src:m,indexOrName:k,parentType:"array",parentPath:u}),w&&w({type:"edit",depth:n,src:m,indexOrName:k,parentType:"array",parentPath:u}),E()},[t,v,w,E]),h=k=>{e.splice(k,1),l&&l(k,u),E()},b=a.jsxs(a.Fragment,{children:[!A&&a.jsxs("span",Object.assign({onClick:()=>P(!0),className:"jv-size-chevron"},{children:[K(x,n,A)&&a.jsxs("span",Object.assign({className:"jv-size"},{children:[ee(t)," Items"]})),a.jsx(we,{className:"jv-chevron"})]})),!A&&d&&ne(i)&&a.jsx(re,{node:t,nodeMeta:{depth:n,indexOrName:r,parent:c,parentPath:u,currentPath:N}}),typeof S=="function"?a.jsx(S,{node:t}):null]});return a.jsxs("div",{children:[a.jsx("span",{children:"["}),b,A?a.jsxs("button",Object.assign({onClick:()=>P(!1),className:"jv-button"},{children:[o," ... ",o+t.length-1]})):a.jsx("div",Object.assign({className:"jv-indent"},{children:t.map((k,C)=>a.jsx(ue,{indexOrName:C+o,value:k,depth:n,parent:t,deleteHandle:h,editHandle:$,parentPath:u},String(r)+String(C)))})),a.jsx("span",{children:"]"})]})}function Vt({node:e,depth:t,deleteHandle:n,indexOrName:r,customOptions:l,parent:i,parentPath:o}){const c=typeof r<"u"?[...o,String(r)]:o,u=[];for(let O=0;O<e.length;O+=100)u.push(e.slice(O,O+100));const{collapsed:d,enableClipboard:m,collapseObjectsAfterLength:v,editable:w,onDelete:E,src:x,onAdd:S,CustomOperation:N,onChange:A,forceUpdate:P,displaySize:$}=p.useContext(J),[h,b]=p.useState(Re(e,t,r,d,v,l));p.useEffect(()=>{b(Re(e,t,r,d,v,l))},[d,v]);const[k,C]=p.useState(!1),H=()=>{C(!1),n&&n(r,o),E&&E({value:e,depth:t,src:x,indexOrName:r,parentType:"array",parentPath:o}),A&&A({type:"delete",depth:t,src:x,indexOrName:r,parentType:"array",parentPath:o})},[R,B]=p.useState(!1),L=()=>{const O=e;O.push(null),S&&S({indexOrName:O.length-1,depth:t,src:x,parentType:"array",parentPath:o}),A&&A({type:"add",indexOrName:O.length-1,depth:t,src:x,parentType:"array",parentPath:o}),P()},D=k||R,U=()=>{C(!1),B(!1)},Z=a.jsxs(a.Fragment,{children:[!h&&!D&&a.jsxs("span",Object.assign({onClick:()=>b(!0),className:"jv-size-chevron"},{children:[K($,t,h)&&a.jsxs("span",Object.assign({className:"jv-size"},{children:[e.length," Items"]})),a.jsx(we,{className:"jv-chevron"})]})),D&&a.jsx(Ce,{className:"json-view--edit",style:{display:"inline-block"},onClick:R?L:H}),D&&a.jsx(Se,{className:"json-view--edit",style:{display:"inline-block"},onClick:U}),!h&&!D&&m&&ne(l)&&a.jsx(re,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:i,parentPath:o,currentPath:c}}),!h&&!D&&Qe(w)&&et(l)&&a.jsx(tt,{className:"json-view--edit",onClick:()=>{L()}}),!h&&!D&&je(w)&&ye(l)&&n&&a.jsx(xe,{className:"json-view--edit",onClick:()=>C(!0)}),typeof N=="function"?a.jsx(N,{node:e}):null]});return a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"["}),Z,h?a.jsx("button",Object.assign({onClick:()=>b(!1),className:"jv-button"},{children:"..."})):a.jsx("div",Object.assign({className:"jv-indent"},{children:u.map((O,M)=>a.jsx(zt,{originNode:e,node:O,depth:t,index:M,startIndex:M*100,deleteHandle:n,customOptions:l,parentPath:o},String(r)+String(M)))})),a.jsx("span",{children:"]"}),h&&K($,t,h)&&a.jsxs("span",Object.assign({onClick:()=>b(!1),className:"jv-size"},{children:[e.length," Items"]}))]})}function Yt({node:e,depth:t,indexOrName:n,deleteHandle:r,customOptions:l,parent:i,parentPath:o}){const{collapsed:c,onCollapse:u,enableClipboard:d,ignoreLargeArray:m,collapseObjectsAfterLength:v,editable:w,onDelete:E,src:x,onAdd:S,onEdit:N,onChange:A,forceUpdate:P,displaySize:$,CustomOperation:h}=p.useContext(J),b=typeof n<"u"?[...o,String(n)]:o;if(!m&&Array.isArray(e)&&e.length>100)return a.jsx(Vt,{node:e,depth:t,indexOrName:n,deleteHandle:r,customOptions:l,parentPath:b});const k=W(e),[C,H]=p.useState(Ne(e,t,n,c,v,l)),R=f=>{u?.({isCollapsing:!f,node:e,depth:t,indexOrName:n}),H(f)};p.useEffect(()=>{R(Ne(e,t,n,c,v,l))},[c,v]);const B=p.useCallback((f,j,V)=>{Array.isArray(e)?e[+f]=j:e&&(e[f]=j),N&&N({newValue:j,oldValue:V,depth:t,src:x,indexOrName:f,parentType:k?"object":"array",parentPath:b}),A&&A({type:"edit",depth:t,src:x,indexOrName:f,parentType:k?"object":"array",parentPath:b}),P()},[e,N,A,P]),L=f=>{Array.isArray(e)?e.splice(+f,1):e&&delete e[f],P()},[D,U]=p.useState(!1),Z=()=>{U(!1),r&&r(n,b),E&&E({value:e,depth:t,src:x,indexOrName:n,parentType:k?"object":"array",parentPath:b}),A&&A({type:"delete",depth:t,src:x,indexOrName:n,parentType:k?"object":"array",parentPath:b})},[O,M]=p.useState(!1),_=p.useRef(null),z=()=>{var f;if(k){const j=(f=_.current)===null||f===void 0?void 0:f.value;j&&(e[j]=null,_.current&&(_.current.value=""),M(!1),S&&S({indexOrName:j,depth:t,src:x,parentType:"object",parentPath:b}),A&&A({type:"add",indexOrName:j,depth:t,src:x,parentType:"object",parentPath:b}))}else if(Array.isArray(e)){const j=e;j.push(null),S&&S({indexOrName:j.length-1,depth:t,src:x,parentType:"array",parentPath:b}),A&&A({type:"add",indexOrName:j.length-1,depth:t,src:x,parentType:"array",parentPath:b})}P()},F=f=>{f.key==="Enter"?(f.preventDefault(),z()):f.key==="Escape"&&g()},s=D||O,g=()=>{U(!1),M(!1)},y=a.jsxs(a.Fragment,{children:[!C&&!s&&a.jsxs("span",Object.assign({onClick:()=>R(!0),className:"jv-size-chevron"},{children:[K($,t,C)&&a.jsxs("span",Object.assign({className:"jv-size"},{children:[ee(e)," Items"]})),a.jsx(we,{className:"jv-chevron"})]})),O&&k&&a.jsx("input",{className:"json-view--input",placeholder:"property",ref:_,onKeyDown:F}),s&&a.jsx(Ce,{className:"json-view--edit",style:{display:"inline-block"},onClick:O?z:Z}),s&&a.jsx(Se,{className:"json-view--edit",style:{display:"inline-block"},onClick:g}),!C&&!s&&d&&ne(l)&&a.jsx(re,{node:e,nodeMeta:{depth:t,indexOrName:n,parent:i,parentPath:o,currentPath:b}}),!C&&!s&&Qe(w)&&et(l)&&a.jsx(tt,{className:"json-view--edit",onClick:()=>{k?(M(!0),setTimeout(()=>{var f;return(f=_.current)===null||f===void 0?void 0:f.focus()})):z()}}),!C&&!s&&je(w)&&ye(l)&&r&&a.jsx(xe,{className:"json-view--edit",onClick:()=>U(!0)}),typeof h=="function"?a.jsx(h,{node:e}):null]});return Array.isArray(e)?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"["}),y,C?a.jsx("button",Object.assign({onClick:()=>R(!1),className:"jv-button"},{children:"..."})):a.jsx("div",Object.assign({className:"jv-indent"},{children:e.map((f,j)=>a.jsx(ue,{indexOrName:j,value:f,depth:t,parent:e,deleteHandle:L,editHandle:B,parentPath:b},String(n)+String(j)))})),a.jsx("span",{children:"]"}),C&&K($,t,C)&&a.jsxs("span",Object.assign({onClick:()=>R(!1),className:"jv-size"},{children:[ee(e)," Items"]}))]}):k?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"{"}),y,C?a.jsx("button",Object.assign({onClick:()=>R(!1),className:"jv-button"},{children:"..."})):a.jsx("div",Object.assign({className:"jv-indent"},{children:Object.entries(e).map(([f,j])=>a.jsx(ue,{indexOrName:f,value:j,depth:t,parent:e,deleteHandle:L,editHandle:B,parentPath:b},String(n)+String(f)))})),a.jsx("span",{children:"}"}),C&&K($,t,C)&&a.jsxs("span",Object.assign({onClick:()=>R(!1),className:"jv-size"},{children:[ee(e)," Items"]}))]}):a.jsx("span",{children:String(e)})}const Bt=p.forwardRef(({str:e,className:t,ctrlClick:n},r)=>{let{collapseStringMode:l,collapseStringsAfterLength:i,customizeCollapseStringUI:o}=p.useContext(J);const[c,u]=p.useState(!0),d=p.useRef(null);i=i>0?i:0;const m=e.replace(/\s+/g," "),v=typeof o=="function"?o(m,c):typeof o=="string"?o:"...",w=E=>{var x;if((E.ctrlKey||E.metaKey)&&n)n(E);else{const S=window.getSelection();if(S&&S.anchorOffset!==S.focusOffset&&((x=S.anchorNode)===null||x===void 0?void 0:x.parentElement)===d.current)return;u(!c)}};if(e.length<=i)return a.jsxs("span",Object.assign({ref:d,className:t,onClick:n},{children:['"',e,'"']}));if(l==="address")return e.length<=10?a.jsxs("span",Object.assign({ref:d,className:t,onClick:n},{children:['"',e,'"']})):a.jsxs("span",Object.assign({ref:d,onClick:w,className:t+" cursor-pointer"},{children:['"',c?[m.slice(0,6),v,m.slice(-4)]:e,'"']}));if(l==="directly")return a.jsxs("span",Object.assign({ref:d,onClick:w,className:t+" cursor-pointer"},{children:['"',c?[m.slice(0,i),v]:e,'"']}));if(l==="word"){let E=i,x=i+1,S=m,N=1;for(;;){if(/\W/.test(e[E])){S=e.slice(0,E);break}if(/\W/.test(e[x])){S=e.slice(0,x);break}if(N===6){S=e.slice(0,i);break}N++,E--,x++}return a.jsxs("span",Object.assign({ref:d,onClick:w,className:t+" cursor-pointer"},{children:['"',c?[S,v]:e,'"']}))}return a.jsxs("span",Object.assign({ref:d,className:t},{children:['"',e,'"']}))});var We;function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},me.apply(this,arguments)}var Wt=function(t){return T.createElement("svg",me({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),We||(We=T.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"})))},Je,qe;function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ve.apply(this,arguments)}var Jt=function(t){return T.createElement("svg",ve({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Je||(Je=T.createElement("path",{fill:"currentColor",d:"M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"})),qe||(qe=T.createElement("path",{fill:"currentColor",d:"M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"})))};function nt({node:e,depth:t,deleteHandle:n,indexOrName:r,parent:l,editHandle:i,parentPath:o}){const{collapseStringsAfterLength:c,enableClipboard:u,editable:d,src:m,onDelete:v,onChange:w,customizeNode:E,matchesURL:x,urlRegExp:S,EditComponent:N,DoneComponent:A,CancelComponent:P,CustomOperation:$}=p.useContext(J);let h;if(typeof E=="function"&&(h=be(E,[{node:e,depth:t,indexOrName:r}])),h){if(p.isValidElement(h))return h;if(Mt(h)){const b=h;return a.jsx(b,{node:e,depth:t,indexOrName:r})}}if(Array.isArray(e)||W(e))return a.jsx(Yt,{parent:l,node:e,depth:t,indexOrName:r,deleteHandle:n,parentPath:o,customOptions:typeof h=="object"?h:void 0});{const b=typeof e,k=typeof r<"u"?[...o,String(r)]:o,[C,H]=p.useState(!1),[R,B]=p.useState(!1),L=p.useRef(null),D=()=>{H(!0),setTimeout(()=>{var f,j;(f=window.getSelection())===null||f===void 0||f.selectAllChildren(L.current),(j=L.current)===null||j===void 0||j.focus()})},U=p.useCallback(()=>{let f=L.current.innerText;try{const j=JSON.parse(f);i&&i(r,j,e,o)}catch{const V=Ht(b,f);i&&i(r,V,e,o)}H(!1)},[i,r,e,o,b]),Z=()=>{H(!1),B(!1)},O=()=>{B(!1),n&&n(r,o),v&&v({value:e,depth:t,src:m,indexOrName:r,parentType:Array.isArray(l)?"array":"object",parentPath:o}),w&&w({depth:t,src:m,indexOrName:r,parentType:Array.isArray(l)?"array":"object",type:"delete",parentPath:o})},M=p.useCallback(f=>{f.key==="Enter"?(f.preventDefault(),U()):f.key==="Escape"&&Z()},[U]),_=C||R,z=!_&&Le(d)&&De(h)&&i?f=>{(f.ctrlKey||f.metaKey)&&D()}:void 0,F=a.jsxs(a.Fragment,{children:[_&&(typeof A=="function"?a.jsx(A,{className:"json-view--edit",style:{display:"inline-block"},onClick:R?O:U}):a.jsx(Ce,{className:"json-view--edit",style:{display:"inline-block"},onClick:R?O:U})),_&&(typeof P=="function"?a.jsx(P,{className:"json-view--edit",style:{display:"inline-block"},onClick:Z}):a.jsx(Se,{className:"json-view--edit",style:{display:"inline-block"},onClick:Z})),!_&&u&&ne(h)&&a.jsx(re,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:l,parentPath:o,currentPath:k}}),!_&&x&&b==="string"&&S.test(e)&&Ft(h)&&a.jsx("a",Object.assign({href:e,target:"_blank",className:"json-view--link"},{children:a.jsx(Jt,{})})),!_&&Le(d)&&De(h)&&i&&(typeof N=="function"?a.jsx(N,{className:"json-view--edit",onClick:D}):a.jsx(Wt,{className:"json-view--edit",onClick:D})),!_&&je(d)&&ye(h)&&n&&a.jsx(xe,{className:"json-view--edit",onClick:()=>B(!0)}),typeof $=="function"?a.jsx($,{node:e}):null]});let s="json-view--string";switch(b){case"number":case"bigint":s="json-view--number";break;case"boolean":s="json-view--boolean";break;case"object":s="json-view--null";break}typeof h?.className=="string"&&(s+=" "+h.className),R&&(s+=" json-view--deleting");let g=String(e);b==="bigint"&&(g+="n");const y=p.useMemo(()=>a.jsx("span",{contentEditable:!0,className:s,dangerouslySetInnerHTML:{__html:b==="string"?`"${g}"`:g},ref:L,onKeyDown:M}),[g,b,M]);return b==="string"?a.jsxs(a.Fragment,{children:[C?y:e.length>c?a.jsx(Bt,{str:e,ref:L,className:s,ctrlClick:z}):a.jsxs("span",Object.assign({className:s,onClick:z},{children:['"',g,'"']})),F]}):a.jsxs(a.Fragment,{children:[C?y:a.jsx("span",Object.assign({className:s,onClick:z},{children:g})),F]})}}const rt=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,J=p.createContext({src:void 0,collapseStringsAfterLength:99,collapseStringMode:"directly",customizeCollapseStringUI:void 0,collapseObjectsAfterLength:20,collapsed:!1,onCollapse:void 0,enableClipboard:!0,editable:!1,onEdit:void 0,onDelete:void 0,onAdd:void 0,onChange:void 0,forceUpdate:()=>{},customizeNode:void 0,customizeCopy:()=>{},displaySize:void 0,displayArrayIndex:!0,matchesURL:!1,urlRegExp:rt,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function qt({src:e,collapseStringsAfterLength:t=99,collapseStringMode:n="directly",customizeCollapseStringUI:r,collapseObjectsAfterLength:l=99,collapsed:i,onCollapse:o,enableClipboard:c=!0,editable:u=!1,onEdit:d,onDelete:m,onAdd:v,onChange:w,dark:E=!1,theme:x="default",customizeNode:S,customizeCopy:N=Z=>It(Z),displaySize:A,displayArrayIndex:P=!0,style:$,className:h,matchesURL:b=!1,urlRegExp:k=rt,ignoreLargeArray:C=!1,CopyComponent:H,CopiedComponent:R,EditComponent:B,CancelComponent:L,DoneComponent:D,CustomOperation:U}){const[Z,O]=p.useState(0),M=p.useCallback(()=>O(F=>++F),[]),[_,z]=p.useState(e);return p.useEffect(()=>z(e),[e]),a.jsx(J.Provider,Object.assign({value:{src:_,collapseStringsAfterLength:t,collapseStringMode:n,customizeCollapseStringUI:r,collapseObjectsAfterLength:l,collapsed:i,onCollapse:o,enableClipboard:c,editable:u,onEdit:d,onDelete:m,onAdd:v,onChange:w,forceUpdate:M,customizeNode:S,customizeCopy:N,displaySize:A,displayArrayIndex:P,matchesURL:b,urlRegExp:k,ignoreLargeArray:C,CopyComponent:H,CopiedComponent:R,EditComponent:B,CancelComponent:L,DoneComponent:D,CustomOperation:U}},{children:a.jsx("code",Object.assign({className:"json-view"+(E?" dark":"")+(x&&x!=="default"?" json-view_"+x:"")+(h?" "+h:""),style:$},{children:a.jsx(nt,{node:_,depth:1,editHandle:(F,s,g,y)=>{z(s),d&&d({newValue:s,oldValue:g,depth:1,src:_,indexOrName:F,parentType:null,parentPath:y}),w&&w({type:"edit",depth:1,src:_,indexOrName:F,parentType:null,parentPath:y})},deleteHandle:(F,s)=>{z(void 0),m&&m({value:_,depth:1,src:_,indexOrName:F,parentType:null,parentPath:s}),w&&w({depth:1,src:_,indexOrName:F,parentType:null,type:"delete",parentPath:s})},parentPath:[]})}))}))}const Kt=["id","msg","time","level","step","flows","traceId"],Gt=({log:e,onClose:t})=>{const[n,r]=p.useState(!1),l=p.useMemo(()=>{if(!e)return null;const i=Object.keys(e??{}).filter(o=>!Kt.includes(o));return r(i.length>0),i.reduce((o,c)=>(o[c]=e[c],o),{})},[e]);return e?a.jsx(Y.Sidebar,{onClose:t,title:"Logs Details",subtitle:"Details including custom properties",actions:[{icon:a.jsx(Ge,{}),onClick:t,label:"Close"}],details:[{label:"Level",value:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Y.LevelDot,{level:e.level}),a.jsx("div",{className:"capitalize",children:e.level})]})},{label:"Time",value:Xe(e.time)},{label:"Step",value:e.step},{label:"Flows",value:e.flows.join(", ")},{label:"Trace ID",value:e.traceId}],children:n&&a.jsx(qt,{src:l,theme:"default",enableClipboard:!0})}):null},Xt=()=>{const e=Q(u=>u.logs),t=Q(u=>u.resetLogs),n=Q(u=>u.selectedLogId),r=Q(u=>u.selectLogId),l=p.useMemo(()=>n?e.find(u=>u.id===n):void 0,[e,n]),[i,o]=p.useState(""),c=p.useMemo(()=>e.filter(u=>u.msg.toLowerCase().includes(i.toLowerCase())||u.traceId.toLowerCase().includes(i.toLowerCase())||u.step.toLowerCase().includes(i.toLowerCase())),[e,i]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-rows-[auto_1fr] h-full","data-testid":"logs-container",children:[a.jsxs("div",{className:"flex p-2 border-b gap-2","data-testid":"logs-search-container",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(Y.Input,{variant:"shade",value:i,onChange:u=>o(u.target.value),className:"px-9 font-medium",placeholder:"Search by Trace ID or Message"}),a.jsx(Et,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50"}),a.jsx(Ge,{className:"cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>o("")})]}),a.jsxs(Y.Button,{variant:"default",onClick:t,className:"h-[34px]",children:[a.jsx(kt,{})," Clear"]})]}),a.jsx(Y.Table,{children:a.jsx(Y.TableBody,{className:"font-mono font-medium",children:c.map((u,d)=>a.jsxs(Y.TableRow,{"data-testid":"log-row",className:Y.cn("font-mono font-semibold cursor-pointer border-0",{"bg-muted-foreground/10 hover:bg-muted-foreground/20":n===u.id,"hover:bg-muted-foreground/10":n!==u.id}),onClick:()=>r(u.id),children:[a.jsxs(Y.TableCell,{"data-testid":`time-${d}`,className:"whitespace-nowrap flex items-center gap-2 text-muted-foreground",children:[a.jsx(Y.LevelDot,{level:u.level}),Xe(u.time)]}),a.jsx(Y.TableCell,{"data-testid":`trace-${u.traceId}`,className:"whitespace-nowrap cursor-pointer hover:text-primary text-muted-foreground",onClick:()=>o(u.traceId),children:u.traceId}),a.jsx(Y.TableCell,{"data-testid":`step-${d}`,"aria-label":u.step,className:"whitespace-nowrap",children:u.step}),a.jsx(Y.TableCell,{"data-testid":`msg-${d}`,"aria-label":u.msg,className:"whitespace-nowrap max-w-[500px] truncate w-full",children:u.msg})]},d))})})]}),a.jsx(Gt,{log:l,onClose:()=>r(void 0)})]})};mt();exports.LogsPage=Xt;
6
+ <%s key={someKey} {...props} />`,v,L,q,L),k[L+v]=!0)}if(L=null,f!==void 0&&(n(f),L=""+f),o(m)&&(n(m.key),L=""+m.key),"key"in m){f={};for(var se in m)se!=="key"&&(f[se]=m[se])}else f=m;return L&&c(f,typeof s=="function"?s.displayName||s.name||"Unknown":s),d(s,L,f,l(),B,ae)}function h(s){w(s)?s._store&&(s._store.validated=1):typeof s=="object"&&s!==null&&s.$$typeof===R&&(s._payload.status==="fulfilled"?w(s._payload.value)&&s._payload.value._store&&(s._payload.value._store.validated=1):s._store&&(s._store.validated=1))}function w(s){return typeof s=="object"&&s!==null&&s.$$typeof===y}var x=p,y=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),b=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),D=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,Y=Array.isArray,O=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(s){return s()}};var F,_={},U=x.react_stack_bottom_frame.bind(x,i)(),H=O(r(i)),k={};X.Fragment=N,X.jsx=function(s,m,f){var v=1e4>D.recentlyCreatedOwnerStacks++;return g(s,m,f,!1,v?Error("react-stack-top-frame"):U,v?O(r(s)):H)},X.jsxs=function(s,m,f){var v=1e4>D.recentlyCreatedOwnerStacks++;return g(s,m,f,!0,v?Error("react-stack-top-frame"):U,v?O(r(s)):H)}})()),X}var ke;function ht(){return ke||(ke=1,process.env.NODE_ENV==="production"?te.exports=mt():te.exports=vt()),te.exports}var a=ht();const bt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_e=e=>{const t=jt(e);return t.charAt(0).toUpperCase()+t.slice(1)},qe=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),yt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var wt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const xt=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:i,iconNode:o,...c},u)=>p.createElement("svg",{ref:u,...wt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:qe("lucide",l),...!i&&!yt(c)&&{"aria-hidden":"true"},...c},[...o.map(([d,g])=>p.createElement(d,g)),...Array.isArray(i)?i:[i]]));const ve=(e,t)=>{const n=p.forwardRef(({className:r,...l},i)=>p.createElement(xt,{ref:i,iconNode:t,className:qe(`lucide-${bt(_e(e))}`,`lucide-${e}`,r),...l}));return n.displayName=_e(e),n};const Ct=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Et=ve("search",Ct);const St=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],At=ve("trash",St);const kt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ke=ve("x",kt),Ge=e=>{const t=new Date(Number(e));return`${t.toLocaleDateString("en-US",{year:void 0,month:"short",day:"2-digit"})}, ${t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"})}.${t.getMilliseconds().toString().padStart(3,"0")}`};function _t(e,t,n,r){function l(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function c(g){try{d(r.next(g))}catch(h){o(h)}}function u(g){try{d(r.throw(g))}catch(h){o(h)}}function d(g){g.done?i(g.value):l(g.value).then(c,u)}d((r=r.apply(e,[])).next())})}var Tt=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(l){e.addRange(l)}),t&&t.focus()}},Ot=Tt,Te={"text/plain":"Text","text/html":"Url",default:"Text"},Nt="Copy to clipboard: #{key}, Enter";function Rt(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function Lt(e,t){var n,r,l,i,o,c,u=!1;t||(t={}),n=t.debug||!1;try{l=Ot(),i=document.createRange(),o=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(g){if(g.stopPropagation(),t.format)if(g.preventDefault(),typeof g.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Te[t.format]||Te.default;window.clipboardData.setData(h,e)}else g.clipboardData.clearData(),g.clipboardData.setData(t.format,e);t.onCopy&&(g.preventDefault(),t.onCopy(g.clipboardData))}),document.body.appendChild(c),i.selectNodeContents(c),o.addRange(i);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");u=!0}catch(g){n&&console.error("unable to copy using execCommand: ",g),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(h){n&&console.error("unable to copy using clipboardData: ",h),n&&console.error("falling back to prompt"),r=Rt("message"in t?t.message:Nt),window.prompt(r,e)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(i):o.removeAllRanges()),c&&document.body.removeChild(c),l()}return u}var Dt=Lt;function W(e){return Object.prototype.toString.call(e)==="[object Object]"}function ee(e){return Array.isArray(e)?e.length:W(e)?Object.keys(e).length:0}function Pt(e,t){if(typeof e=="string")return e;try{return JSON.stringify(e,(n,r)=>{switch(typeof r){case"bigint":return String(r)+"n";case"number":case"boolean":case"object":case"string":return r;default:return String(r)}},t)}catch(n){return`${n.name}: ${n.message}`||"JSON.stringify failed"}}function It(e){return _t(this,void 0,void 0,function*(){try{yield navigator.clipboard.writeText(e)}catch{Dt(e)}})}function Oe(e,t,n,r,l,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const o=ee(e);if(typeof r=="function"){const c=he(r,[{node:e,depth:t,indexOrName:n,size:o}]);if(typeof c=="boolean")return c}return!!(Array.isArray(e)&&o>l||W(e)&&o>l)}function Ne(e,t,n,r,l,i){if(i&&i.collapsed!==void 0)return!!i.collapsed;if(typeof r=="boolean")return r;if(typeof r=="number"&&t>r)return!0;const o=Math.ceil(e.length/100);if(typeof r=="function"){const c=he(r,[{node:e,depth:t,indexOrName:n,size:o}]);if(typeof c=="boolean")return c}return!!(Array.isArray(e)&&o>l||W(e)&&o>l)}function K(e,t,n){return typeof e=="boolean"?e:!!(typeof e=="number"&&t>e||e==="collapsed"&&n||e==="expanded"&&!n)}function he(e,t){try{return e(...t)}catch(n){reportError(n)}}function Xe(e){if(e===!0||W(e)&&e.add===!0)return!0}function Re(e){if(e===!0||W(e)&&e.edit===!0)return!0}function be(e){if(e===!0||W(e)&&e.delete===!0)return!0}function $t(e){return typeof e=="function"}function Qe(e){return!e||e.add===void 0||!!e.add}function Le(e){return!e||e.edit===void 0||!!e.edit}function je(e){return!e||e.delete===void 0||!!e.delete}function ne(e){return!e||e.enableClipboard===void 0||!!e.enableClipboard}function Mt(e){return!e||e.matchesURL===void 0||!!e.matchesURL}function Ft(e,t){return e==="string"?t.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):t}var De;function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oe.apply(this,arguments)}var ye=function(t){return T.createElement("svg",oe({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},t),De||(De=T.createElement("path",{fill:"currentColor",d:"M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"})))},Pe;function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}var Ht=function(t){return T.createElement("svg",ie({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Pe||(Pe=T.createElement("path",{fill:"currentColor",d:"M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"})))},Ie,$e;function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},le.apply(this,arguments)}var Ut=function(t){return T.createElement("svg",le({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Ie||(Ie=T.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"})),$e||($e=T.createElement("path",{fill:"#14C786",d:"M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"})))};function re({node:e,nodeMeta:t}){const{customizeCopy:n,CopyComponent:r,CopiedComponent:l}=p.useContext(J),[i,o]=p.useState(!1),c=u=>{u.stopPropagation();const d=n(e,t);typeof d=="string"&&d&&It(d),o(!0),setTimeout(()=>o(!1),3e3)};return i?typeof l=="function"?a.jsx(l,{className:"json-view--copy",style:{display:"inline-block"}}):a.jsx(Ut,{className:"json-view--copy",style:{display:"inline-block"}}):typeof r=="function"?a.jsx(r,{onClick:c,className:"json-view--copy"}):a.jsx(Ht,{onClick:c,className:"json-view--copy"})}function ce({indexOrName:e,value:t,depth:n,deleteHandle:r,editHandle:l,parent:i,parentPath:o}){const{displayArrayIndex:c}=p.useContext(J),u=Array.isArray(i);return a.jsxs("div",Object.assign({className:"json-view--pair"},{children:[!u||u&&c?a.jsxs(a.Fragment,{children:[a.jsx("span",Object.assign({className:typeof e=="number"?"json-view--index":"json-view--property"},{children:e})),":"," "]}):a.jsx(a.Fragment,{}),a.jsx(tt,{node:t,depth:n+1,deleteHandle:(d,g)=>r(d,g),editHandle:(d,g,h,w)=>l(d,g,h,w),parent:i,indexOrName:e,parentPath:o})]}))}var Me,Fe;function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ue.apply(this,arguments)}var we=function(t){return T.createElement("svg",ue({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Me||(Me=T.createElement("path",{fill:"currentColor",d:"M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"})),Fe||(Fe=T.createElement("path",{fill:"#DA0000",d:"M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"})))},He,Ue;function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe.apply(this,arguments)}var et=function(t){return T.createElement("svg",fe({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),He||(He=T.createElement("path",{fill:"currentColor",d:"M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"})),Ue||(Ue=T.createElement("path",{fill:"#14C786",d:"M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"})))},Ze,Ve;function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},de.apply(this,arguments)}var xe=function(t){return T.createElement("svg",de({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Ze||(Ze=T.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})),Ve||(Ve=T.createElement("path",{fill:"#14C786",d:"m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"})))},ze,Ye;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}var Ce=function(t){return T.createElement("svg",pe({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),ze||(ze=T.createElement("path",{fill:"#DA0000",d:"M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"})),Ye||(Ye=T.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})))};function Zt({originNode:e,node:t,depth:n,index:r,deleteHandle:l,customOptions:i,startIndex:o,parent:c,parentPath:u}){const{enableClipboard:d,src:g,onEdit:h,onChange:w,forceUpdate:x,displaySize:y,CustomOperation:E}=p.useContext(J),N=[...u,String(r)],[S,P]=p.useState(!0),I=p.useCallback((A,C,Z)=>{e[A]=C,h&&h({newValue:C,oldValue:Z,depth:n,src:g,indexOrName:A,parentType:"array",parentPath:u}),w&&w({type:"edit",depth:n,src:g,indexOrName:A,parentType:"array",parentPath:u}),x()},[t,h,w,x]),b=A=>{e.splice(A,1),l&&l(A,u),x()},j=a.jsxs(a.Fragment,{children:[!S&&a.jsxs("span",Object.assign({onClick:()=>P(!0),className:"jv-size-chevron"},{children:[K(y,n,S)&&a.jsxs("span",Object.assign({className:"jv-size"},{children:[ee(t)," Items"]})),a.jsx(ye,{className:"jv-chevron"})]})),!S&&d&&ne(i)&&a.jsx(re,{node:t,nodeMeta:{depth:n,indexOrName:r,parent:c,parentPath:u,currentPath:N}}),typeof E=="function"?a.jsx(E,{node:t}):null]});return a.jsxs("div",{children:[a.jsx("span",{children:"["}),j,S?a.jsxs("button",Object.assign({onClick:()=>P(!1),className:"jv-button"},{children:[o," ... ",o+t.length-1]})):a.jsx("div",Object.assign({className:"jv-indent"},{children:t.map((A,C)=>a.jsx(ce,{indexOrName:C+o,value:A,depth:n,parent:t,deleteHandle:b,editHandle:I,parentPath:u},String(r)+String(C)))})),a.jsx("span",{children:"]"})]})}function Vt({node:e,depth:t,deleteHandle:n,indexOrName:r,customOptions:l,parent:i,parentPath:o}){const c=typeof r<"u"?[...o,String(r)]:o,u=[];for(let O=0;O<e.length;O+=100)u.push(e.slice(O,O+100));const{collapsed:d,enableClipboard:g,collapseObjectsAfterLength:h,editable:w,onDelete:x,src:y,onAdd:E,CustomOperation:N,onChange:S,forceUpdate:P,displaySize:I}=p.useContext(J),[b,j]=p.useState(Ne(e,t,r,d,h,l));p.useEffect(()=>{j(Ne(e,t,r,d,h,l))},[d,h]);const[A,C]=p.useState(!1),Z=()=>{C(!1),n&&n(r,o),x&&x({value:e,depth:t,src:y,indexOrName:r,parentType:"array",parentPath:o}),S&&S({type:"delete",depth:t,src:y,indexOrName:r,parentType:"array",parentPath:o})},[R,z]=p.useState(!1),$=()=>{const O=e;O.push(null),E&&E({indexOrName:O.length-1,depth:t,src:y,parentType:"array",parentPath:o}),S&&S({type:"add",indexOrName:O.length-1,depth:t,src:y,parentType:"array",parentPath:o}),P()},D=A||R,M=()=>{C(!1),z(!1)},Y=a.jsxs(a.Fragment,{children:[!b&&!D&&a.jsxs("span",Object.assign({onClick:()=>j(!0),className:"jv-size-chevron"},{children:[K(I,t,b)&&a.jsxs("span",Object.assign({className:"jv-size"},{children:[e.length," Items"]})),a.jsx(ye,{className:"jv-chevron"})]})),D&&a.jsx(xe,{className:"json-view--edit",style:{display:"inline-block"},onClick:R?$:Z}),D&&a.jsx(Ce,{className:"json-view--edit",style:{display:"inline-block"},onClick:M}),!b&&!D&&g&&ne(l)&&a.jsx(re,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:i,parentPath:o,currentPath:c}}),!b&&!D&&Xe(w)&&Qe(l)&&a.jsx(et,{className:"json-view--edit",onClick:()=>{$()}}),!b&&!D&&be(w)&&je(l)&&n&&a.jsx(we,{className:"json-view--edit",onClick:()=>C(!0)}),typeof N=="function"?a.jsx(N,{node:e}):null]});return a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"["}),Y,b?a.jsx("button",Object.assign({onClick:()=>j(!1),className:"jv-button"},{children:"..."})):a.jsx("div",Object.assign({className:"jv-indent"},{children:u.map((O,F)=>a.jsx(Zt,{originNode:e,node:O,depth:t,index:F,startIndex:F*100,deleteHandle:n,customOptions:l,parentPath:o},String(r)+String(F)))})),a.jsx("span",{children:"]"}),b&&K(I,t,b)&&a.jsxs("span",Object.assign({onClick:()=>j(!1),className:"jv-size"},{children:[e.length," Items"]}))]})}function zt({node:e,depth:t,indexOrName:n,deleteHandle:r,customOptions:l,parent:i,parentPath:o}){const{collapsed:c,onCollapse:u,enableClipboard:d,ignoreLargeArray:g,collapseObjectsAfterLength:h,editable:w,onDelete:x,src:y,onAdd:E,onEdit:N,onChange:S,forceUpdate:P,displaySize:I,CustomOperation:b}=p.useContext(J),j=typeof n<"u"?[...o,String(n)]:o;if(!g&&Array.isArray(e)&&e.length>100)return a.jsx(Vt,{node:e,depth:t,indexOrName:n,deleteHandle:r,customOptions:l,parentPath:j});const A=W(e),[C,Z]=p.useState(Oe(e,t,n,c,h,l)),R=f=>{u?.({isCollapsing:!f,node:e,depth:t,indexOrName:n}),Z(f)};p.useEffect(()=>{R(Oe(e,t,n,c,h,l))},[c,h]);const z=p.useCallback((f,v,B)=>{Array.isArray(e)?e[+f]=v:e&&(e[f]=v),N&&N({newValue:v,oldValue:B,depth:t,src:y,indexOrName:f,parentType:A?"object":"array",parentPath:j}),S&&S({type:"edit",depth:t,src:y,indexOrName:f,parentType:A?"object":"array",parentPath:j}),P()},[e,N,S,P]),$=f=>{Array.isArray(e)?e.splice(+f,1):e&&delete e[f],P()},[D,M]=p.useState(!1),Y=()=>{M(!1),r&&r(n,j),x&&x({value:e,depth:t,src:y,indexOrName:n,parentType:A?"object":"array",parentPath:j}),S&&S({type:"delete",depth:t,src:y,indexOrName:n,parentType:A?"object":"array",parentPath:j})},[O,F]=p.useState(!1),_=p.useRef(null),U=()=>{var f;if(A){const v=(f=_.current)===null||f===void 0?void 0:f.value;v&&(e[v]=null,_.current&&(_.current.value=""),F(!1),E&&E({indexOrName:v,depth:t,src:y,parentType:"object",parentPath:j}),S&&S({type:"add",indexOrName:v,depth:t,src:y,parentType:"object",parentPath:j}))}else if(Array.isArray(e)){const v=e;v.push(null),E&&E({indexOrName:v.length-1,depth:t,src:y,parentType:"array",parentPath:j}),S&&S({type:"add",indexOrName:v.length-1,depth:t,src:y,parentType:"array",parentPath:j})}P()},H=f=>{f.key==="Enter"?(f.preventDefault(),U()):f.key==="Escape"&&s()},k=D||O,s=()=>{M(!1),F(!1)},m=a.jsxs(a.Fragment,{children:[!C&&!k&&a.jsxs("span",Object.assign({onClick:()=>R(!0),className:"jv-size-chevron"},{children:[K(I,t,C)&&a.jsxs("span",Object.assign({className:"jv-size"},{children:[ee(e)," Items"]})),a.jsx(ye,{className:"jv-chevron"})]})),O&&A&&a.jsx("input",{className:"json-view--input",placeholder:"property",ref:_,onKeyDown:H}),k&&a.jsx(xe,{className:"json-view--edit",style:{display:"inline-block"},onClick:O?U:Y}),k&&a.jsx(Ce,{className:"json-view--edit",style:{display:"inline-block"},onClick:s}),!C&&!k&&d&&ne(l)&&a.jsx(re,{node:e,nodeMeta:{depth:t,indexOrName:n,parent:i,parentPath:o,currentPath:j}}),!C&&!k&&Xe(w)&&Qe(l)&&a.jsx(et,{className:"json-view--edit",onClick:()=>{A?(F(!0),setTimeout(()=>{var f;return(f=_.current)===null||f===void 0?void 0:f.focus()})):U()}}),!C&&!k&&be(w)&&je(l)&&r&&a.jsx(we,{className:"json-view--edit",onClick:()=>M(!0)}),typeof b=="function"?a.jsx(b,{node:e}):null]});return Array.isArray(e)?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"["}),m,C?a.jsx("button",Object.assign({onClick:()=>R(!1),className:"jv-button"},{children:"..."})):a.jsx("div",Object.assign({className:"jv-indent"},{children:e.map((f,v)=>a.jsx(ce,{indexOrName:v,value:f,depth:t,parent:e,deleteHandle:$,editHandle:z,parentPath:j},String(n)+String(v)))})),a.jsx("span",{children:"]"}),C&&K(I,t,C)&&a.jsxs("span",Object.assign({onClick:()=>R(!1),className:"jv-size"},{children:[ee(e)," Items"]}))]}):A?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"{"}),m,C?a.jsx("button",Object.assign({onClick:()=>R(!1),className:"jv-button"},{children:"..."})):a.jsx("div",Object.assign({className:"jv-indent"},{children:Object.entries(e).map(([f,v])=>a.jsx(ce,{indexOrName:f,value:v,depth:t,parent:e,deleteHandle:$,editHandle:z,parentPath:j},String(n)+String(f)))})),a.jsx("span",{children:"}"}),C&&K(I,t,C)&&a.jsxs("span",Object.assign({onClick:()=>R(!1),className:"jv-size"},{children:[ee(e)," Items"]}))]}):a.jsx("span",{children:String(e)})}const Yt=p.forwardRef(({str:e,className:t,ctrlClick:n},r)=>{let{collapseStringMode:l,collapseStringsAfterLength:i,customizeCollapseStringUI:o}=p.useContext(J);const[c,u]=p.useState(!0),d=p.useRef(null);i=i>0?i:0;const g=e.replace(/\s+/g," "),h=typeof o=="function"?o(g,c):typeof o=="string"?o:"...",w=x=>{var y;if((x.ctrlKey||x.metaKey)&&n)n(x);else{const E=window.getSelection();if(E&&E.anchorOffset!==E.focusOffset&&((y=E.anchorNode)===null||y===void 0?void 0:y.parentElement)===d.current)return;u(!c)}};if(e.length<=i)return a.jsxs("span",Object.assign({ref:d,className:t,onClick:n},{children:['"',e,'"']}));if(l==="address")return e.length<=10?a.jsxs("span",Object.assign({ref:d,className:t,onClick:n},{children:['"',e,'"']})):a.jsxs("span",Object.assign({ref:d,onClick:w,className:t+" cursor-pointer"},{children:['"',c?[g.slice(0,6),h,g.slice(-4)]:e,'"']}));if(l==="directly")return a.jsxs("span",Object.assign({ref:d,onClick:w,className:t+" cursor-pointer"},{children:['"',c?[g.slice(0,i),h]:e,'"']}));if(l==="word"){let x=i,y=i+1,E=g,N=1;for(;;){if(/\W/.test(e[x])){E=e.slice(0,x);break}if(/\W/.test(e[y])){E=e.slice(0,y);break}if(N===6){E=e.slice(0,i);break}N++,x--,y++}return a.jsxs("span",Object.assign({ref:d,onClick:w,className:t+" cursor-pointer"},{children:['"',c?[E,h]:e,'"']}))}return a.jsxs("span",Object.assign({ref:d,className:t},{children:['"',e,'"']}))});var Be;function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ge.apply(this,arguments)}var Bt=function(t){return T.createElement("svg",ge({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),Be||(Be=T.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"})))},We,Je;function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},me.apply(this,arguments)}var Wt=function(t){return T.createElement("svg",me({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},t),We||(We=T.createElement("path",{fill:"currentColor",d:"M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"})),Je||(Je=T.createElement("path",{fill:"currentColor",d:"M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"})))};function tt({node:e,depth:t,deleteHandle:n,indexOrName:r,parent:l,editHandle:i,parentPath:o}){const{collapseStringsAfterLength:c,enableClipboard:u,editable:d,src:g,onDelete:h,onChange:w,customizeNode:x,matchesURL:y,urlRegExp:E,EditComponent:N,DoneComponent:S,CancelComponent:P,CustomOperation:I}=p.useContext(J);let b;if(typeof x=="function"&&(b=he(x,[{node:e,depth:t,indexOrName:r}])),b){if(p.isValidElement(b))return b;if($t(b)){const j=b;return a.jsx(j,{node:e,depth:t,indexOrName:r})}}if(Array.isArray(e)||W(e))return a.jsx(zt,{parent:l,node:e,depth:t,indexOrName:r,deleteHandle:n,parentPath:o,customOptions:typeof b=="object"?b:void 0});{const j=typeof e,A=typeof r<"u"?[...o,String(r)]:o,[C,Z]=p.useState(!1),[R,z]=p.useState(!1),$=p.useRef(null),D=()=>{Z(!0),setTimeout(()=>{var f,v;(f=window.getSelection())===null||f===void 0||f.selectAllChildren($.current),(v=$.current)===null||v===void 0||v.focus()})},M=p.useCallback(()=>{let f=$.current.innerText;try{const v=JSON.parse(f);i&&i(r,v,e,o)}catch{const B=Ft(j,f);i&&i(r,B,e,o)}Z(!1)},[i,r,e,o,j]),Y=()=>{Z(!1),z(!1)},O=()=>{z(!1),n&&n(r,o),h&&h({value:e,depth:t,src:g,indexOrName:r,parentType:Array.isArray(l)?"array":"object",parentPath:o}),w&&w({depth:t,src:g,indexOrName:r,parentType:Array.isArray(l)?"array":"object",type:"delete",parentPath:o})},F=p.useCallback(f=>{f.key==="Enter"?(f.preventDefault(),M()):f.key==="Escape"&&Y()},[M]),_=C||R,U=!_&&Re(d)&&Le(b)&&i?f=>{(f.ctrlKey||f.metaKey)&&D()}:void 0,H=a.jsxs(a.Fragment,{children:[_&&(typeof S=="function"?a.jsx(S,{className:"json-view--edit",style:{display:"inline-block"},onClick:R?O:M}):a.jsx(xe,{className:"json-view--edit",style:{display:"inline-block"},onClick:R?O:M})),_&&(typeof P=="function"?a.jsx(P,{className:"json-view--edit",style:{display:"inline-block"},onClick:Y}):a.jsx(Ce,{className:"json-view--edit",style:{display:"inline-block"},onClick:Y})),!_&&u&&ne(b)&&a.jsx(re,{node:e,nodeMeta:{depth:t,indexOrName:r,parent:l,parentPath:o,currentPath:A}}),!_&&y&&j==="string"&&E.test(e)&&Mt(b)&&a.jsx("a",Object.assign({href:e,target:"_blank",className:"json-view--link"},{children:a.jsx(Wt,{})})),!_&&Re(d)&&Le(b)&&i&&(typeof N=="function"?a.jsx(N,{className:"json-view--edit",onClick:D}):a.jsx(Bt,{className:"json-view--edit",onClick:D})),!_&&be(d)&&je(b)&&n&&a.jsx(we,{className:"json-view--edit",onClick:()=>z(!0)}),typeof I=="function"?a.jsx(I,{node:e}):null]});let k="json-view--string";switch(j){case"number":case"bigint":k="json-view--number";break;case"boolean":k="json-view--boolean";break;case"object":k="json-view--null";break}typeof b?.className=="string"&&(k+=" "+b.className),R&&(k+=" json-view--deleting");let s=String(e);j==="bigint"&&(s+="n");const m=p.useMemo(()=>a.jsx("span",{contentEditable:!0,className:k,dangerouslySetInnerHTML:{__html:j==="string"?`"${s}"`:s},ref:$,onKeyDown:F}),[s,j,F]);return j==="string"?a.jsxs(a.Fragment,{children:[C?m:e.length>c?a.jsx(Yt,{str:e,ref:$,className:k,ctrlClick:U}):a.jsxs("span",Object.assign({className:k,onClick:U},{children:['"',s,'"']})),H]}):a.jsxs(a.Fragment,{children:[C?m:a.jsx("span",Object.assign({className:k,onClick:U},{children:s})),H]})}}const nt=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,J=p.createContext({src:void 0,collapseStringsAfterLength:99,collapseStringMode:"directly",customizeCollapseStringUI:void 0,collapseObjectsAfterLength:20,collapsed:!1,onCollapse:void 0,enableClipboard:!0,editable:!1,onEdit:void 0,onDelete:void 0,onAdd:void 0,onChange:void 0,forceUpdate:()=>{},customizeNode:void 0,customizeCopy:(()=>{}),displaySize:void 0,displayArrayIndex:!0,matchesURL:!1,urlRegExp:nt,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function Jt({src:e,collapseStringsAfterLength:t=99,collapseStringMode:n="directly",customizeCollapseStringUI:r,collapseObjectsAfterLength:l=99,collapsed:i,onCollapse:o,enableClipboard:c=!0,editable:u=!1,onEdit:d,onDelete:g,onAdd:h,onChange:w,dark:x=!1,theme:y="default",customizeNode:E,customizeCopy:N=Y=>Pt(Y),displaySize:S,displayArrayIndex:P=!0,style:I,className:b,matchesURL:j=!1,urlRegExp:A=nt,ignoreLargeArray:C=!1,CopyComponent:Z,CopiedComponent:R,EditComponent:z,CancelComponent:$,DoneComponent:D,CustomOperation:M}){const[Y,O]=p.useState(0),F=p.useCallback(()=>O(H=>++H),[]),[_,U]=p.useState(e);return p.useEffect(()=>U(e),[e]),a.jsx(J.Provider,Object.assign({value:{src:_,collapseStringsAfterLength:t,collapseStringMode:n,customizeCollapseStringUI:r,collapseObjectsAfterLength:l,collapsed:i,onCollapse:o,enableClipboard:c,editable:u,onEdit:d,onDelete:g,onAdd:h,onChange:w,forceUpdate:F,customizeNode:E,customizeCopy:N,displaySize:S,displayArrayIndex:P,matchesURL:j,urlRegExp:A,ignoreLargeArray:C,CopyComponent:Z,CopiedComponent:R,EditComponent:z,CancelComponent:$,DoneComponent:D,CustomOperation:M}},{children:a.jsx("code",Object.assign({className:"json-view"+(x?" dark":"")+(y&&y!=="default"?" json-view_"+y:"")+(b?" "+b:""),style:I},{children:a.jsx(tt,{node:_,depth:1,editHandle:(H,k,s,m)=>{U(k),d&&d({newValue:k,oldValue:s,depth:1,src:_,indexOrName:H,parentType:null,parentPath:m}),w&&w({type:"edit",depth:1,src:_,indexOrName:H,parentType:null,parentPath:m})},deleteHandle:(H,k)=>{U(void 0),g&&g({value:_,depth:1,src:_,indexOrName:H,parentType:null,parentPath:k}),w&&w({depth:1,src:_,indexOrName:H,parentType:null,type:"delete",parentPath:k})},parentPath:[]})}))}))}const qt=["id","msg","time","level","step","flows","traceId"],Kt=({log:e,onClose:t})=>{const[n,r]=p.useState(!1),l=p.useMemo(()=>{if(!e)return null;const i=Object.keys(e??{}).filter(o=>!qt.includes(o));return r(i.length>0),i.reduce((o,c)=>(o[c]=e[c],o),{})},[e]);return e?a.jsx(V.Sidebar,{onClose:t,title:"Logs Details",subtitle:"Details including custom properties",actions:[{icon:a.jsx(Ke,{}),onClick:t,label:"Close"}],details:[{label:"Level",value:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(V.LevelDot,{level:e.level}),a.jsx("div",{className:"capitalize",children:e.level})]})},{label:"Time",value:Ge(e.time)},{label:"Step",value:e.step},{label:"Flows",value:e.flows.join(", ")},{label:"Trace ID",value:e.traceId}],children:n&&a.jsx(Jt,{src:l,theme:"default",enableClipboard:!0})}):null},Gt=()=>{const e=Q(u=>u.logs),t=Q(u=>u.resetLogs),n=Q(u=>u.selectedLogId),r=Q(u=>u.selectLogId),l=p.useMemo(()=>n?e.find(u=>u.id===n):void 0,[e,n]),[i,o]=p.useState(""),c=p.useMemo(()=>e.filter(u=>u.msg.toLowerCase().includes(i.toLowerCase())||u.traceId.toLowerCase().includes(i.toLowerCase())||u.step.toLowerCase().includes(i.toLowerCase())),[e,i]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-rows-[auto_1fr] h-full","data-testid":"logs-container",children:[a.jsxs("div",{className:"flex p-2 border-b gap-2","data-testid":"logs-search-container",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(V.Input,{variant:"shade",value:i,onChange:u=>o(u.target.value),className:"px-9 font-medium",placeholder:"Search by Trace ID or Message"}),a.jsx(Et,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50"}),a.jsx(Ke,{className:"cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>o("")})]}),a.jsxs(V.Button,{variant:"default",onClick:t,className:"h-[34px]",children:[a.jsx(At,{})," Clear"]})]}),a.jsx(V.Table,{children:a.jsx(V.TableBody,{className:"font-mono font-medium",children:c.map((u,d)=>a.jsxs(V.TableRow,{"data-testid":"log-row",className:V.cn("font-mono font-semibold cursor-pointer border-0",{"bg-muted-foreground/10 hover:bg-muted-foreground/20":n===u.id,"hover:bg-muted-foreground/10":n!==u.id}),onClick:()=>r(u.id),children:[a.jsxs(V.TableCell,{"data-testid":`time-${d}`,className:"whitespace-nowrap flex items-center gap-2 text-muted-foreground",children:[a.jsx(V.LevelDot,{level:u.level}),Ge(u.time)]}),a.jsx(V.TableCell,{"data-testid":`trace-${u.traceId}`,className:"whitespace-nowrap cursor-pointer hover:text-primary text-muted-foreground",onClick:()=>o(u.traceId),children:u.traceId}),a.jsx(V.TableCell,{"data-testid":`step-${d}`,"aria-label":u.step,className:"whitespace-nowrap",children:u.step}),a.jsx(V.TableCell,{"data-testid":`msg-${d}`,"aria-label":u.msg,className:"whitespace-nowrap max-w-[500px] truncate w-full",children:u.msg})]},d))})})]}),a.jsx(Kt,{log:l,onClose:()=>r(void 0)})]})};gt();exports.LogsPage=Gt;