@raytrace-cli/cli 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -123
- package/bin/raytrace.mjs +110 -22
- package/dist/dashboard/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
- package/dist/dashboard/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
- package/dist/dashboard/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-600-normal-Aqo67rzb.woff2 +0 -0
- package/dist/dashboard/assets/dm-sans-latin-600-normal-BmdmIIQ2.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-700-normal-CUSSCpQX.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-700-normal-DvUfVpUG.woff2 +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2 +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2 +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-600-normal-4vooXBpG.woff2 +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-600-normal-DRtaDpgU.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-700-normal-BLI3TTWz.woff +0 -0
- package/dist/dashboard/assets/dm-sans-latin-ext-700-normal-CJIcxD6K.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- package/dist/dashboard/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- package/dist/dashboard/assets/index-Dc3LTk8b.js +38 -0
- package/dist/dashboard/assets/index-DtV3UdEB.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/package.json +4 -1
- package/proxy/agent-intent-schema.test.mjs +142 -0
- package/proxy/call-assessment.mjs +385 -0
- package/proxy/call-assessment.test.mjs +167 -0
- package/proxy/call-category.mjs +461 -0
- package/proxy/capture.mjs +38 -0
- package/proxy/capture.test.mjs +49 -0
- package/proxy/claude-code-adapter.mjs +65 -3
- package/proxy/claude-code-hook.mjs +3 -1
- package/proxy/codex-config.mjs +5 -0
- package/proxy/codex.mjs +3 -2
- package/proxy/evidence-schema.test.mjs +233 -0
- package/proxy/evidence-store.mjs +704 -33
- package/proxy/evidence-store.test.mjs +304 -0
- package/proxy/exec-narrative.mjs +625 -0
- package/proxy/exec-narrative.test.mjs +262 -0
- package/proxy/execution-correlation.mjs +185 -0
- package/proxy/execution-correlation.test.mjs +146 -0
- package/proxy/execution-runner.test.mjs +38 -0
- package/proxy/experiment-engine.mjs +7 -4
- package/proxy/experiment-engine.test.mjs +93 -0
- package/proxy/explanations.test.mjs +20 -0
- package/proxy/failure-signature.mjs +56 -0
- package/proxy/gvisor-forwarder.mjs +454 -0
- package/proxy/gvisor-forwarder.test.mjs +368 -0
- package/proxy/init-evidence-db.mjs +166 -12
- package/proxy/local-sandboxes.mjs +94 -0
- package/proxy/local-token.mjs +30 -0
- package/proxy/playground-recovery.test.mjs +130 -0
- package/proxy/playground.mjs +439 -0
- package/proxy/prompt-context.mjs +12 -7
- package/proxy/prompt-traces.mjs +6 -0
- package/proxy/prompt-traces.test.mjs +32 -0
- package/proxy/providers.test.mjs +76 -0
- package/proxy/proxy.integration.test.mjs +135 -0
- package/proxy/raytace-proxy.mjs +512 -188
- package/proxy/request-metrics.test.mjs +19 -0
- package/proxy/request-policy.mjs +45 -0
- package/proxy/request-policy.test.mjs +47 -0
- package/proxy/run-recap.mjs +139 -0
- package/proxy/runtime-attribution.mjs +110 -0
- package/proxy/sandbox-bridge.mjs +49 -0
- package/proxy/schema/EVIDENCE_DATABASE.md +276 -0
- package/proxy/schema/auxiliary.sql +48 -1
- package/proxy/schema/classification.sql +89 -0
- package/proxy/schema/file_context.sql +53 -0
- package/proxy/schema/runtime_evidence.sql +201 -0
- package/proxy/schema/search.sql +66 -0
- package/proxy/search.mjs +418 -0
- package/proxy/search.test.mjs +161 -0
- package/proxy/smoke.test.mjs +93 -0
- package/proxy/step-attribution.mjs +380 -0
- package/proxy/step-lab.test.mjs +38 -0
- package/proxy/summaries.test.mjs +69 -0
- package/proxy/tool-metadata.mjs +36 -0
- package/proxy/tool-metadata.test.mjs +38 -0
- package/proxy/trace-view.mjs +308 -0
- package/proxy/trace-view.test.mjs +72 -0
- package/proxy/typesafe.mjs +63 -0
- package/proxy/typesafe.test.mjs +39 -0
- package/src/claude-code.mjs +38 -1
- package/src/commands.mjs +133 -20
- package/src/config.mjs +16 -7
- package/src/export.mjs +200 -0
- package/src/lima.mjs +176 -0
- package/src/local-sandbox.mjs +339 -0
- package/src/paths.mjs +8 -8
- package/src/proxy-process.mjs +45 -3
- package/src/sandbox.mjs +37 -9
- package/src/upload.mjs +198 -0
- package/worker/sandbox/Dockerfile +8 -0
- package/worker/sandbox/SYSCALL_CATALOG.md +197 -0
- package/worker/sandbox/claude-hook.mjs +364 -0
- package/worker/sandbox/collector.py +357 -0
- package/worker/sandbox/dns_forwarder.py +255 -0
- package/worker/sandbox/engine.py +940 -0
- package/worker/sandbox/file_scan.py +491 -0
- package/worker/sandbox/lima.yaml +29 -0
- package/worker/sandbox/network.py +90 -0
- package/worker/sandbox/projects.py +679 -0
- package/worker/sandbox/setup.py +159 -0
- package/worker/sandbox/syscall_catalog.sql +985 -0
- package/worker/sandbox/transcript-delivery.test.mjs +153 -0
- package/worker/sandbox/viewer.py +151 -0
- package/dist/dashboard/assets/index-BQ9_JxGq.js +0 -27
- package/dist/dashboard/assets/index-L5cUAvhE.css +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function B(e){return{current:e}}function V(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function H(e,t){ee++,z[ee]=e.current,e.current=t}var te=B(null),U=B(null),ne=B(null),re=B(null);function ie(e,t){switch(H(ne,t),H(U,e),H(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}V(te),H(te,e)}function ae(){V(te),V(U),V(ne)}function oe(e){e.memoizedState!==null&&H(re,e);var t=te.current,n=Ud(t,e.type);t!==n&&(H(U,e),H(te,n))}function se(e){U.current===e&&(V(te),V(U)),re.current===e&&(V(re),$f._currentValue=R)}var ce,le;function ue(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``,le=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+ce+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ue(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue(`Lazy`);case 13:return e.child!==t&&t!==null?ue(`Suspense Fallback`):ue(`Suspense`);case 19:return ue(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return ue(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,Re=4194304;function ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Be(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function W(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Me(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=L.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function Qe(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,nt=`__reactContainer$`+$e,rt=`__reactEvents$`+$e,it=`__reactListeners$`+$e,at=`__reactHandles$`+$e,ot=`__reactResources$`+$e,st=`__reactMarker$`+$e;function ct(e){delete e[et],delete e[tt],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[et])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[et]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[ot];return t||=e[ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),yt={},bt={};function xt(e){return he.call(bt,e)?!0:he.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Ct(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function At(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var jt=/[\n"\\]/g;function Mt(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Tt(n)):Ft(e,o,Tt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Tt(s):e.removeAttribute(`name`)}function Pt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ot(e)}function Ft(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Lt(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function G(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function Rt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Bt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Vt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Bt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Bt(e,o,t[o])}function Ht(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Ut=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Wt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Gt(e){return Wt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Kt(){}var qt=null;function Jt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yt=null,Xt=null;function Zt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Mt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[tt]||null;if(!a)throw Error(i(90));Nt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&kt(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var Qt=!1;function $t(e,t,n){if(Qt)return e(t,n);Qt=!0;try{return e(t)}finally{if(Qt=!1,(Yt!==null||Xt!==null)&&(vu(),Yt&&(t=Yt,e=Xt,Xt=Yt=null,Zt(t),e)))for(t=0;t<e.length;t++)Zt(e[t])}}function en(e,t){var n=e.stateNode;if(n===null)return null;var r=n[tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,nn=!1;if(tn)try{var rn={};Object.defineProperty(rn,"passive",{get:function(){nn=!0}}),window.addEventListener(`test`,rn,rn),window.removeEventListener(`test`,rn,rn)}catch{nn=!1}var an=null,on=null,sn=null;function cn(){if(sn)return sn;var e,t=on,n=t.length,r,i=`value`in an?an.value:an.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return sn=i.slice(e,1<r?1-r:void 0)}function ln(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function un(){return!0}function dn(){return!1}function fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?un:dn,this.isPropagationStopped=dn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mn=fn(pn),hn=h({},pn,{view:0,detail:0}),gn=fn(hn),_n,vn,yn,bn=h({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==yn&&(yn&&e.type===`mousemove`?(_n=e.screenX-yn.screenX,vn=e.screenY-yn.screenY):vn=_n=0,yn=e),_n)},movementY:function(e){return`movementY`in e?e.movementY:vn}}),xn=fn(bn),Sn=fn(h({},bn,{dataTransfer:0})),Cn=fn(h({},hn,{relatedTarget:0})),wn=fn(h({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Tn=fn(h({},pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),En=fn(h({},pn,{data:0})),Dn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},On={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function An(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kn[e])?!!t[e]:!1}function jn(){return An}var K=fn(h({},hn,{key:function(e){if(e.key){var t=Dn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?On[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return e.type===`keypress`?ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Mn=fn(h({},bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=fn(h({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Pn=fn(h({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Fn=fn(h({},bn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),In=fn(h({},pn,{newState:0,oldState:0})),Ln=[9,13,27,32],Rn=tn&&`CompositionEvent`in window,zn=null;tn&&`documentMode`in document&&(zn=document.documentMode);var Bn=tn&&`TextEvent`in window&&!zn,Vn=tn&&(!Rn||zn&&8<zn&&11>=zn),Hn=` `,Un=!1;function Wn(e,t){switch(e){case`keyup`:return Ln.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Gn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Kn=!1;function qn(e,t){switch(e){case`compositionend`:return Gn(t);case`keypress`:return t.which===32?(Un=!0,Hn):null;case`textInput`:return e=t.data,e===Hn&&Un?null:e;default:return null}}function Jn(e,t){if(Kn)return e===`compositionend`||!Rn&&Wn(e,t)?(e=cn(),sn=on=an=null,Kn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Vn&&t.locale!==`ko`?null:t.data;default:return null}}var Yn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Yn[e.type]:t===`textarea`}function Zn(e,t,n,r){Yt?Xt?Xt.push(r):Xt=[r]:Yt=r,t=Ed(t,`onChange`),0<t.length&&(n=new mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Qn=null,$n=null;function er(e){vd(e,0)}function tr(e){if(kt(dt(e)))return e}function nr(e,t){if(e===`change`)return t}var rr=!1;if(tn){var ir;if(tn){var ar=`oninput`in document;if(!ar){var or=document.createElement(`div`);or.setAttribute(`oninput`,`return;`),ar=typeof or.oninput==`function`}ir=ar}else ir=!1;rr=ir&&(!document.documentMode||9<document.documentMode)}function sr(){Qn&&(Qn.detachEvent(`onpropertychange`,cr),$n=Qn=null)}function cr(e){if(e.propertyName===`value`&&tr($n)){var t=[];Zn(t,$n,e,Jt(e)),$t(er,t)}}function lr(e,t,n){e===`focusin`?(sr(),Qn=t,$n=n,Qn.attachEvent(`onpropertychange`,cr)):e===`focusout`&&sr()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return tr($n)}function dr(e,t){if(e===`click`)return tr(t)}function fr(e,t){if(e===`input`||e===`change`)return tr(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mr=typeof Object.is==`function`?Object.is:pr;function hr(e,t){if(mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!he.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _r(e,t){var n=gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=gr(n)}}function vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=At(e.document)}return t}function br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var xr=tn&&`documentMode`in document&&11>=document.documentMode,Sr=null,Cr=null,wr=null,Tr=!1;function Er(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tr||Sr==null||Sr!==At(r)||(r=Sr,`selectionStart`in r&&br(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wr&&hr(wr,r)||(wr=r,r=Ed(Cr,`onSelect`),0<r.length&&(t=new mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function Dr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Or={animationend:Dr(`Animation`,`AnimationEnd`),animationiteration:Dr(`Animation`,`AnimationIteration`),animationstart:Dr(`Animation`,`AnimationStart`),transitionrun:Dr(`Transition`,`TransitionRun`),transitionstart:Dr(`Transition`,`TransitionStart`),transitioncancel:Dr(`Transition`,`TransitionCancel`),transitionend:Dr(`Transition`,`TransitionEnd`)},kr={},Ar={};tn&&(Ar=document.createElement(`div`).style,`AnimationEvent`in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),`TransitionEvent`in window||delete Or.transitionend.transition);function jr(e){if(kr[e])return kr[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ar)return kr[e]=t[n];return e}var Mr=jr(`animationend`),Nr=jr(`animationiteration`),Pr=jr(`animationstart`),Fr=jr(`transitionrun`),Ir=jr(`transitionstart`),Lr=jr(`transitioncancel`),Rr=jr(`transitionend`),zr=new Map,Br=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Br.push(`scrollEnd`);function Vr(e,t){zr.set(e,t),gt(t,[e])}var Hr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ur=[],Wr=0,Gr=0;function Kr(){for(var e=Wr,t=Gr=Wr=0;t<e;){var n=Ur[t];Ur[t++]=null;var r=Ur[t];Ur[t++]=null;var i=Ur[t];Ur[t++]=null;var a=Ur[t];if(Ur[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Xr(n,i,a)}}function qr(e,t,n,r){Ur[Wr++]=e,Ur[Wr++]=t,Ur[Wr++]=n,Ur[Wr++]=r,Gr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Jr(e,t,n,r){return qr(e,t,n,r),Zr(e)}function Yr(e,t){return qr(e,null,null,t),Zr(e)}function Xr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Zr(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qr={};function $r(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(e,t,n,r){return new $r(e,t,n,r)}function ti(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ni(e,t){var n=e.alternate;return n===null?(n=ei(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ri(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ii(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ti(e)&&(s=1);else if(typeof e==`string`)s=Wf(e,n,te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ei(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ai(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ei(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ei(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ei(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ai(e,t,n,r){return e=ei(7,e,r,t),e.lanes=n,e}function oi(e,t,n){return e=ei(6,e,null,t),e.lanes=n,e}function si(e){var t=ei(18,null,null,0);return t.stateNode=e,t}function ci(e,t,n){return t=ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var li=new WeakMap;function ui(e,t){if(typeof e==`object`&&e){var n=li.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},li.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var di=[],fi=0,pi=null,mi=0,hi=[],gi=0,_i=null,vi=1,yi=``;function bi(e,t){di[fi++]=mi,di[fi++]=pi,pi=e,mi=t}function xi(e,t,n){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,_i=e;var r=vi;e=yi;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,vi=1<<32-Me(t)+i|n<<i|r,yi=a+e}else vi=1<<a|n<<i|r,yi=e}function Si(e){e.return!==null&&(bi(e,1),xi(e,1,0))}function Ci(e){for(;e===pi;)pi=di[--fi],di[fi]=null,mi=di[--fi],di[fi]=null;for(;e===_i;)_i=hi[--gi],hi[gi]=null,yi=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null}function wi(e,t){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,vi=t.id,yi=t.overflow,_i=e}var Ti=null,Ei=null,Di=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Li(ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function Mi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[et]=e,t[tt]=r,n){case`dialog`:yd(`cancel`,t),yd(`close`,t);break;case`iframe`:case`object`:case`embed`:yd(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)yd(gd[n],t);break;case`source`:yd(`error`,t);break;case`img`:case`image`:case`link`:yd(`error`,t),yd(`load`,t);break;case`details`:yd(`toggle`,t);break;case`input`:yd(`invalid`,t),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:yd(`invalid`,t);break;case`textarea`:yd(`invalid`,t),G(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(yd(`beforetoggle`,t),yd(`toggle`,t)),r.onScroll!=null&&yd(`scroll`,t),r.onScrollEnd!=null&&yd(`scrollend`,t),r.onClick!=null&&(t.onclick=Kt),t=!0):t=!1,t||ji(e,!0)}function Ni(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ti=Ti.return}}function Pi(e){if(e!==Ti)return!1;if(!Di)return Ni(e),Di=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Wd(e.type,e.memoizedProps)),n=!n),n&&Ei&&ji(e),Ni(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=df(e)}else t===27?(t=Ei,Qd(e.type)?(e=uf,uf=null,Ei=e):Ei=t):Ei=Ti?lf(e.stateNode.nextSibling):null;return!0}function Fi(){Ei=Ti=null,Di=!1}function Ii(){var e=Oi;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Oi=null),e}function Li(e){Oi===null?Oi=[e]:Oi.push(e)}var Ri=B(null),zi=null,Bi=null;function Vi(e,t,n){H(Ri,t._currentValue),t._currentValue=n}function Hi(e){e._currentValue=Ri.current,V(Ri)}function Ui(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Wi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ui(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ui(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Gi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===re.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[$f]:e.push($f))}a=a.return}e!==null&&Wi(t,e,n,r),t.flags|=262144}function Ki(e){for(e=e.firstContext;e!==null;){if(!mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qi(e){zi=e,Bi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ji(e){return Xi(zi,e)}function Yi(e,t){return zi===null&&qi(e),Xi(e,t)}function Xi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Bi===null){if(e===null)throw Error(i(308));Bi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Bi=Bi.next=t;return n}var Zi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Qi=t.unstable_scheduleCallback,$i=t.unstable_NormalPriority,ea={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ta(){return{controller:new Zi,data:new Map,refCount:0}}function na(e){e.refCount--,e.refCount===0&&Qi($i,function(){e.controller.abort()})}var ra=null,ia=0,aa=0,oa=null;function sa(e,t){if(ra===null){var n=ra=[];ia=0,aa=ud(),oa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ia++,t.then(ca,ca),t}function ca(){if(--ia===0&&ra!==null){oa!==null&&(oa.status=`fulfilled`);var e=ra;ra=null,aa=0,oa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function la(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ua=I.S;I.S=function(e,t){Ql=be(),typeof t==`object`&&t&&typeof t.then==`function`&&sa(e,t),ua!==null&&ua(e,t)};var da=B(null);function fa(){var e=da.current;return e===null?Il.pooledCache:e}function pa(e,t){t===null?H(da,da.current):H(da,t.pool)}function ma(){var e=fa();return e===null?null:{parent:ea._currentValue,pool:e}}var ha=Error(i(460)),ga=Error(i(474)),_a=Error(i(542)),va={then:function(){}};function ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ba(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kt,Kt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e;default:if(typeof t.status==`string`)t.then(Kt,Kt);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e}throw Sa=t,ha}}function xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Sa=e,ha):e}}var Sa=null;function Ca(){if(Sa===null)throw Error(i(459));var e=Sa;return Sa=null,e}function wa(e){if(e===ha||e===_a)throw Error(i(483))}var Ta=null,Ea=0;function Da(e){var t=Ea;return Ea+=1,Ta===null&&(Ta=[]),ba(Ta,e,t)}function Oa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ka(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Aa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ni(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=oi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&xa(i)===t.type)?(t=a(t,n.props),Oa(t,n),t.return=e,t):(t=ii(n.type,n.key,n.props,null,e.mode,r),Oa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ai(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ii(t.type,t.key,t.props,null,e.mode,n),Oa(n,t),n.return=e,n;case v:return t=ci(t,e.mode,n),t.return=e,t;case O:return t=xa(t),f(e,t,n)}if(F(t)||M(t))return t=ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Da(t),n);if(t.$$typeof===C)return f(e,Yi(e,t),n);ka(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=xa(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Da(n),r);if(n.$$typeof===C)return p(e,t,Yi(e,n),r);ka(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=xa(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Da(r),i);if(r.$$typeof===C)return m(e,t,n,Yi(t,r),i);ka(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Di&&bi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Di&&bi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Di&&bi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Di&&bi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Di&&bi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Di&&bi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Oa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=ai(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ii(o.type,o.key,o.props,null,e.mode,c),Oa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ci(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=xa(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Da(o),c);if(o.$$typeof===C)return b(e,r,Yi(e,o),c);ka(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ea=0;var i=b(e,t,n,r);return Ta=null,i}catch(t){if(t===ha||t===_a)throw t;var a=ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ja=Aa(!0),Ma=Aa(!1),Na=!1;function Pa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Y&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Zr(e),Xr(e,null,n),t}return qr(e,r,t,n),Zr(e)}function Ra(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ba=!1;function Va(){if(Ba){var e=oa;if(e!==null)throw e}}function Ha(e,t,n,r){Ba=!1;var i=e.updateQueue;Na=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Ll&f)===f:(r&f)===f){f!==0&&f===aa&&(Ba=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Na=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Z|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Wa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ua(n[e],t)}var Ga=B(null),Ka=B(0);function qa(e,t){e=Ul,H(Ka,e),H(Ga,t),Ul=e|t.baseLanes}function Ja(){H(Ka,Ul),H(Ga,Ga.current)}function Ya(){Ul=Ka.current,V(Ga),V(Ka)}var Xa=B(null),Za=null;function Qa(e){var t=e.alternate;H(ro,ro.current&1),H(Xa,e),Za===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(Za=e)}function $a(e){H(ro,ro.current),H(Xa,e),Za===null&&(Za=e)}function eo(e){e.tag===22?(H(ro,ro.current),H(Xa,e),Za===null&&(Za=e)):to(e)}function to(){H(ro,ro.current),H(Xa,Xa.current)}function no(e){V(Xa),Za===e&&(Za=null),V(ro)}var ro=B(0);function io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=0,q=null,oo=null,so=null,co=!1,lo=!1,uo=!1,fo=0,po=0,mo=null,ho=0;function go(){throw Error(i(321))}function _o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function vo(e,t,n,r,i,a){return ao=a,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Fs:Is,uo=!1,a=n(r,i),uo=!1,lo&&(a=bo(t,n,r,i)),yo(e),a}function yo(e){I.H=Ps;var t=oo!==null&&oo.next!==null;if(ao=0,so=oo=q=null,co=!1,po=0,mo=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Ki(e)&&($s=!0))}function bo(e,t,n,r){q=e;var a=0;do{if(lo&&(mo=null),po=0,lo=!1,25<=a)throw Error(i(301));if(a+=1,so=oo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=Ls,o=t(n,r)}while(lo);return o}function xo(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?Oo(t):t,e=e.useState()[0],(oo===null?null:oo.memoizedState)!==e&&(q.flags|=1024),t}function So(){var e=fo!==0;return fo=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wo(e){if(co){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}co=!1}ao=0,so=oo=q=null,lo=!1,po=fo=0,mo=null}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return so===null?q.memoizedState=so=e:so=so.next=e,so}function Eo(){if(oo===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=oo.next;var t=so===null?q.memoizedState:so.next;if(t!==null)so=t,oo=e;else{if(e===null)throw q.alternate===null?Error(i(467)):Error(i(310));oo=e,e={memoizedState:oo.memoizedState,baseState:oo.baseState,baseQueue:oo.baseQueue,queue:oo.queue,next:null},so===null?q.memoizedState=so=e:so=so.next=e}return so}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=po;return po+=1,mo===null&&(mo=[]),e=ba(mo,e,t),t=q,(so===null?t.memoizedState:so.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Fs:Is),e}function ko(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Oo(e);if(e.$$typeof===C)return Ji(e)}throw Error(i(438,String(e)))}function Ao(e){var t=null,n=q.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=q.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Do(),q.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function jo(e,t){return typeof t==`function`?t(e):t}function Mo(e){return No(Eo(),oo,e)}function No(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(Ll&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===aa&&(d=!0);else if((ao&p)===p){u=u.next,p===aa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,q.lanes|=p,Z|=p;f=u.action,uo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,q.lanes|=f,Z|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!mr(o,e.memoizedState)&&($s=!0,d&&(n=oa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Po(e){var t=Eo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);mr(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=q,a=Eo(),o=Di;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!mr((oo||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||so!==null&&so.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||ao&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t=Do(),q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function Bo(e){var t=Yr(e,2);t!==null&&pu(t,e,2)}function Vo(e){var t=To();if(typeof e==`function`){var n=e;if(e=n(),uo){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,oo,typeof r==`function`?r:jo)}function Uo(e,t,n,r,a){if(js(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(Di){var n=Il.formState;if(n!==null){a:{var r=q;if(Di){if(Ei){b:{for(var i=Ei,a=ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ei=lf(i.nextSibling),r=i.data===`F!`;break a}}ji(r)}r=!1}r&&(t=n[0])}}return n=To(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,q,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,q,!1,r.queue),r=To(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,q,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),oo,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Oo(t)}catch(e){throw e===ha?_a:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(q.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=oo;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=q.updateQueue,t===null&&(t=Do(),q.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=To();q.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;oo!==null&&r!==null&&_o(r,oo.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(q.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){q.flags|=4;var t=q.updateQueue;if(t===null)t=Do(),q.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Y&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&_o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&_o(t,r[1]))return r[0];if(r=e(),uo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||ao&1073741824&&!(Ll&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),q.lanes|=e,Z|=e,n)}function _s(e,t,n,r){return mr(n,t)?n:Ga.current===null?!(ao&42)||ao&1073741824&&!(Ll&261930)?($s=!0,e.memoizedState=n):(e=fu(),q.lanes|=e,Z|=e,t):(e=gs(e,n,r),mr(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,As(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,la(c,r),du(e)):ks(e,t,r,du(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,R,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:R},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},du())}function Cs(){return Ji($f)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Ia(n);var r=La(t,e,n);r!==null&&(pu(r,t,n),Ra(r,t,n)),t={cache:ta()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Jr(e,t,n,r),n!==null&&(pu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,du())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,mr(s,o))return qr(e,t,i,0),Il===null&&Kr(),!1}catch{}if(n=Jr(e,t,i,r),n!==null)return pu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Jr(e,n,r,2),t!==null&&pu(t,e,2)}function js(e){var t=e.alternate;return e===q||t!==null&&t===q}function Ms(e,t){lo=co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Ps={readContext:Ji,use:ko,useCallback:go,useContext:go,useEffect:go,useImperativeHandle:go,useLayoutEffect:go,useInsertionEffect:go,useMemo:go,useReducer:go,useRef:go,useState:go,useDebugValue:go,useDeferredValue:go,useTransition:go,useSyncExternalStore:go,useId:go,useHostTransitionStatus:go,useFormState:go,useActionState:go,useOptimistic:go,useMemoCache:go,useCacheRefresh:go};Ps.useEffectEvent=go;var Fs={readContext:Ji,use:ko,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:Ji,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=To();t=t===void 0?null:t;var r=e();if(uo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=To();if(n!==void 0){var i=n(t);if(uo){je(!0);try{n(t)}finally{je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,q,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(To(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,q,e.queue,!0,!1),To().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=q,a=To();if(Di){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Ll&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=To(),t=Il.identifierPrefix;if(Di){var n=yi,r=vi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=fo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=To();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,q,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return To().memoizedState=Es.bind(null,q)},useEffectEvent:function(e){var t=To(),n={impl:e};return t.memoizedState=n,function(){if(Y&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Ji,use:ko,useCallback:ms,useContext:Ji,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),oo.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),oo,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Ji,use:ko,useCallback:ms,useContext:Ji,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return oo===null?gs(n,e,t):_s(n,oo.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return oo===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,oo,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ia(r);i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ia(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Ia(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(pu(t,e,n),Ra(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!hr(n,r)||!hr(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Hr(e)}function Ws(e){console.error(e)}function Gs(e){Hr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=Ia(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Gi(t,n,a,!0),n=Xa.current,n!==null){switch(n.tag){case 31:case 13:return Za===null?Tu():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===va?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===va?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(Di)return t=Xa.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Li(ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ui(r,n),a=Js(e.stateNode,r,a),za(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Li(ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ui(o,n),Yl===null?Yl=[o]:Yl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),za(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Ma(t,null,n,r):ja(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return qi(t),r=vo(e,t,n,o,a,i),s=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(Di&&s&&Si(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ti(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?hr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(hr(a,r)&&e.ref===t.ref){if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pa(t,a===null?null:a.cachePool),a===null?Ja():qa(t,a),eo(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&pa(t,null),Ja(),to(t)):(pa(t,a.cachePool),qa(t,a),to(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=fa();return a=a===null?null:{parent:ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&pa(t,null),Ja(),eo(t),e!==null&&Gi(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return ja(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,no(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Di){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if($a(t),(e=Ei)?(e=af(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if($a(t),a){if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if($s||Gi(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Il,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Yr(e,s),pu(r,e,s),Qs;Tu(),t=cc(e,t,n)}else e=o.treeContext,Ei=lf(s.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return qi(t),n=vo(e,t,n,r,void 0,i),r=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(Di&&r&&Si(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return qi(t),t.updateQueue=null,n=bo(t,r,n,i),yo(e),r=So(),e!==null&&!$s?(Co(e,t,a),Tc(e,t,a)):(Di&&r&&Si(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(qi(t),t.stateNode===null){var a=Qr,o=n.contextType;typeof o==`object`&&o&&(a=Ji(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Pa(t),o=n.contextType,a.context=typeof o==`object`&&o?Ji(o):Qr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),Ha(t,r,a,i),Va(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Qr,typeof u==`object`&&u&&(o=Ji(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Na=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),Va(),l=t.memoizedState,s||f!==l||Na?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Na||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fa(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Qr,typeof l==`object`&&l&&(c=Ji(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Na=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i),Va();var p=t.memoizedState;o!==d||f!==p||Na||e!==null&&e.dependencies!==null&&Ki(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Na||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ki(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ja(t,e.child,null,i),t.child=ja(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Fi(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ma()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(ro.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Di){if(a?Qa(t):to(t),(e=Ei)?(e=af(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(to(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=ai(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):(Qa(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Qa(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(to(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=ai(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ja(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(to(t),t.child=e.child,t.flags|=128,t=null);else if(Qa(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Li({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Gi(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Il,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yr(e,r),pu(s,e,r),Qs;of(c)||Tu(),t=xc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ei=lf(c.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(to(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ni(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ai(c,a,n,null),c.flags|=2):c=ni(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ma():(l=ea._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):(Qa(t),n=e.child,e=n.sibling,n=ni(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ei(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return ja(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ui(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ro.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,H(ro,o),ec(e,t,r,n),r=Di?mi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Z|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Gi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ki(e)))}function Dc(e,t,n){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),Vi(t,ea,e.memoizedState.cache),Fi();break;case 27:case 5:oe(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:Vi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$a(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Qa(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):(Qa(t),t.flags|=128,null);Qa(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Gi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),H(ro,ro.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Vi(t,ea,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}}else $s=!1,Di&&t.flags&1048576&&xi(t,mi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=xa(t.elementType),t.type=e,typeof e==`function`)ti(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=tc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Fa(e,t),Ha(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Vi(t,ea,r),r!==o.cache&&Wi(t,[ea],n,!0),Va(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=ui(Error(i(424)),t),Li(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ei=lf(e.firstChild),Ti=t,Di=!0,Oi=null,ki=!0,n=Ma(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fi(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Af(t.type,null,t.pendingProps,null))?t.memoizedState=n:Di||(n=t.type,e=t.pendingProps,r=Vd(ne.current).createElement(n),r[et]=t,r[tt]=e,Fd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Di&&(r=t.stateNode=pf(t.type,t.pendingProps,ne.current),Ti=t,ki=!0,a=Ei,Qd(t.type)?(uf=a,Ei=lf(r.firstChild)):Ei=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Di&&((a=r=Ei)&&(r=nf(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ti=t,Ei=lf(r.firstChild),ki=!1,a=!0)),a||ji(t)),oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=vo(e,t,xo,null,null,n),$f._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&Di&&((e=n=Ei)&&(n=rf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ti=t,Ei=null,e=!0)),e||ji(t)),null;case 13:return vc(e,t,n);case 4:return ie(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ja(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Vi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,qi(t),a=Ji(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return qi(t),r=Ji(ea),e===null?(a=fa(),a===null&&(a=Il,o=ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Pa(t),Vi(t,ea,a)):((e.lanes&n)!==0&&(Fa(e,t),Ha(t,null,null,n),Va()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Vi(t,ea,r),r!==a.cache&&Wi(t,[ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Vi(t,ea,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw Sa=va,ga}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t)){if(Su())e.flags|=8192;else throw Sa=va,ga}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,Jl|=t)}function Nc(e,t){if(!Di)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ci(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Hi(ea),ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Pi(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ii())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(se(t),n=ne.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=te.current,Pi(t)?Mi(t,e):(e=pf(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=te.current,Pi(t))Mi(t,o);else{var s=Vd(ne.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ne.current,Pi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||ji(t,!0)}else e=Vd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Pi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(no(t),t):(no(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(no(t),t):(no(t),null)}return no(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return ae(),e===null&&Sd(t.stateNode.containerInfo),Pc(t),null;case 10:return Hi(t.type),Pc(t),null;case 19:if(V(ro),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=io(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ri(n,e),n=n.sibling;return H(ro,ro.current&1|2),Di&&bi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>$l&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Di)return Pc(t),null}else 2*be()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=ro.current,H(ro,a?n&1|2:n&1),Di&&bi(t,r.treeForkCount),e);case 22:case 23:return no(t),Ya(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&V(da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Hi(ea),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hi(ea),ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return se(t),null;case 31:if(t.memoizedState!==null){if(no(t),t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(no(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(ro),null;case 4:return ae(),null;case 10:return Hi(t.type),null;case 22:case 23:return no(t),Ya(),e!==null&&V(da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Hi(ea),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ci(t),t.tag){case 3:Hi(ea),ae();break;case 26:case 27:case 5:se(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&no(t);break;case 13:no(t);break;case 19:V(ro);break;case 10:Hi(t.type);break;case 22:case 23:no(t),Ya(),e!==null&&V(da);break;case 24:Hi(ea)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wa(t,n)}catch(t){Uu(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[tt]=t}catch(t){Uu(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Kt));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[et]=e,t[tt]=n}catch(t){Uu(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,zd=cp,e=yr(e),br(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},cp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wa(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,!!(n.subtreeFlags&8772)):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;Qd(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),mf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null){if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}}break;case 18:al!==null&&(ol?(e=al,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):$d(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pp(e)}catch(e){Uu(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pp(e)}catch(e){Uu(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[st]||o[et]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[et]=e,pt(o),r=o;break a;case`link`:var s=Hf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Hf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[et]=e,pt(o),r=o}e.stateNode=r}else Uf(a,e.type,e.stateNode)}else e.stateNode=Lf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Uf(a,e.type,e.stateNode):Lf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Rt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Vf=null,a=ml,ml=_f(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){Uu(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=_f(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Q=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ef(m,!0):ef(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Rt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:mf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ua(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&na(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Kf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=_f(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Ji(ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ji(ea).controller.signal}},J=typeof WeakMap==`function`?WeakMap:Map,Y=0,Il=null,X=null,Ll=0,Rl=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Z=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Q=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Y&2&&Ll!==0?Ll&-Ll:I.T===null?Ze():ud()}function fu(){if(ql===0){if(!(Ll&536870912)||Di){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),ql=e}else ql=536870912}return e=Xa.current,e!==null&&(e.flags|=32),ql}function pu(e,t,n){(e===Il&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Ll,ql,!1)),We(e,n),(!(Y&2)||e!==Il)&&(e===Il&&(!(Y&2)&&(Gl|=n),Wl===4&&_u(e,Ll,ql,!1)),nd(e))}function mu(e,t,n){if(Y&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ve(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){Vl&&!r&&_u(e,t,0,!1);break}if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,ql,!Bl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Q+300-be(),10<a)){if(_u(r,t,ql,!Bl),Be(r,0,!0)!==0)break a;au=t,r.timeoutHandle=qd(hu.bind(null,r,n,Xl,eu,Zl,t,ql,Gl,Jl,Bl,o,`Throttled`,-0,0),a);break a}hu(r,n,Xl,eu,Zl,t,ql,Gl,Jl,Bl,o,null,-0,0)}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kt},kl(t,a,d);var m=(a&62914560)===a?Q-be():(a&4194048)===a?Ql-be():0;if(m=Jf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!mr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _u(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function vu(){return Y&6?!0:(rd(0,!1),!1)}function yu(){if(X!==null){if(Rl===0)var e=X.return;else e=X,Bi=zi=null,wo(e),Ta=null,Ea=0,e=X;for(;e!==null;)Lc(e.alternate,e),e=e.return;X=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Il=e,X=n=ni(e.current,null),Ll=t,Rl=0,zl=null,Bl=!1,Vl=Ve(e,t),Hl=!1,Jl=ql=Kl=Gl=Z=Wl=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Kr(),n}function xu(e,t){q=null,I.H=Ps,t===ha||t===_a?(t=Ca(),Rl=3):t===ga?(t=Ca(),Rl=4):Rl=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,X===null&&(Wl=1,Ks(e,ui(t,e.current)))}function Su(){var e=Xa.current;return e===null?!0:(Ll&4194048)===Ll?Za===null:(Ll&62914560)===Ll||Ll&536870912?e===Za:!1}function Cu(){var e=I.H;return I.H=Ps,e===null?Ps:e}function wu(){var e=I.A;return I.A=Fl,e}function Tu(){Wl=4,Bl||(Ll&4194048)!==Ll&&Xa.current!==null||(Vl=!0),!(Z&134217727)&&!(Gl&134217727)||Il===null||_u(Il,Ll,ql,!1)}function Eu(e,t,n){var r=Y;Y|=2;var i=Cu(),a=wu();(Il!==e||Ll!==t)&&(eu=null,bu(e,t)),t=!1;var o=Wl;a:do try{if(Rl!==0&&X!==null){var s=X,c=zl;switch(Rl){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Xa.current===null&&(t=!0);var l=Rl;if(Rl=0,zl=null,Mu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=Rl,Rl=0,zl=null,Mu(e,s,c,l)}}Du(),o=Wl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Bi=zi=null,Y=r,I.H=i,I.A=a,X===null&&(Il=null,Ll=0,Kr()),o}function Du(){for(;X!==null;)Au(X)}function Ou(e,t){var n=Y;Y|=2;var r=Cu(),a=wu();Il!==e||Ll!==t?(eu=null,$l=be()+500,bu(e,t)):Vl=Ve(e,t);a:do try{if(Rl!==0&&X!==null){t=X;var o=zl;b:switch(Rl){case 1:Rl=0,zl=null,Mu(e,t,o,1);break;case 2:case 9:if(ya(o)){Rl=0,zl=null,ju(t);break}t=function(){Rl!==2&&Rl!==9||Il!==e||(Rl=7),nd(e)},o.then(t,t);break a;case 3:Rl=7;break a;case 4:Rl=5;break a;case 7:ya(o)?(Rl=0,zl=null,ju(t)):(Rl=0,zl=null,Mu(e,t,o,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Gf(s):c.stateNode.complete){Rl=0,zl=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Nu(u))}break b}}Rl=0,zl=null,Mu(e,t,o,5);break;case 6:Rl=0,zl=null,Mu(e,t,o,6);break;case 8:yu(),Wl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Bi=zi=null,I.H=r,I.A=a,Y=n,X===null?(Il=null,Ll=0,Kr(),Wl):0}function ku(){for(;X!==null&&!ve();)Au(X)}function Au(e){var t=Oc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Ll);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Ll);break;case 5:wo(t);default:Lc(n,t),t=X=ri(t,Ul),t=Oc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function Mu(e,t,n,r){Bi=zi=null,wo(t),Ta=null,Ea=0;var i=t.return;try{if(Zs(e,i,t,n,Ll)){Wl=1,Ks(e,ui(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;Wl=1,Ks(e,ui(n,e.current)),X=null;return}t.flags&32768?(Di||r===1?e=!0:Vl||Ll&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Bl);return}e=t.return;var n=Fc(t.alternate,t,Ul);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Wl===0&&(Wl=5)}function Pu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);Wl=6,X=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Y&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Gr,Ge(e,n,o,s,c,l),e===Il&&(X=Il=null,Ll=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(we,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Y,Y|=4;try{nl(e,t,n)}finally{Y=s,L.p=a,I.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Y;Y|=4;try{hl(t,e);var a=Bd,o=yr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&vr(s.ownerDocument.documentElement,s)){if(c!==null&&br(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=_r(s,h),v=_r(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}cp=!!zd,Bd=zd=null}finally{Y=i,L.p=r,I.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Y;Y|=4;try{rl(e,t.alternate,t)}finally{Y=i,L.p=r,I.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,ye();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),Xe(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,na(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Xe(au),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Y&6)throw Error(i(331));var c=Y;if(Y|=4,Ml(o.current),wl(o,o.current,s,n),Y=c,rd(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{L.p=a,I.T=r,zu(e,t)}}function Hu(e,t,n){t=ui(n,t),t=Js(e.stateNode,t,2),e=La(e,t,2),e!==null&&(We(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=ui(n,e),n=Ys(2),r=La(t,n,2),r!==null&&(Xs(n,r,t,e),We(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new J;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Ll&n)===n&&(Wl===4||Wl===3&&(Ll&62914560)===Ll&&300>be()-Q?!(Y&2)&&bu(e,0):Kl|=n,Jl===Ll&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=Ue()),e=Yr(e,t),e!==null&&(We(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return ge(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Me(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Ll,a=Be(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(r,a)||(n=!0,cd(r,a))}r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Kd()&&(e=td);for(var t=be(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=He(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Ll,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Xe(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=sd.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Ll;return r=Be(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,be()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Xd(function(){Y&6?ge(Se,id):ad()})}function ud(){if(td===0){var e=aa;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Gt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Br.length;md++){var hd=Br[md];Vr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Vr(Mr,`onAnimationEnd`),Vr(Nr,`onAnimationIteration`),Vr(Pr,`onAnimationStart`),Vr(`dblclick`,`onDoubleClick`),Vr(`focusin`,`onFocus`),Vr(`focusout`,`onBlur`),Vr(Fr,`onTransitionRun`),Vr(Ir,`onTransitionStart`),Vr(Lr,`onTransitionCancel`),Vr(Rr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Hr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Hr(e)}i.currentTarget=null,a=c}}}}function yd(e,t){var n=t[rt];n===void 0&&(n=t[rt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,mt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(hp(t)){case 2:var i=lp;break;case 8:i=up;break;default:i=dp}n=i.bind(null,t,n,e),i=void 0,!nn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=lt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}$t(function(){var r=a,i=Jt(n),s=[];a:{var c=zr.get(e);if(c!==void 0){var l=mn,u=e;switch(e){case`keypress`:if(ln(n)===0)break a;case`keydown`:case`keyup`:l=K;break;case`focusin`:u=`focus`,l=Cn;break;case`focusout`:u=`blur`,l=Cn;break;case`beforeblur`:case`afterblur`:l=Cn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Sn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Nn;break;case Mr:case Nr:case Pr:l=wn;break;case Rr:l=Pn;break;case`scroll`:case`scrollend`:l=gn;break;case`wheel`:l=Fn;break;case`copy`:case`cut`:case`paste`:l=Tn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Mn;break;case`toggle`:case`beforetoggle`:l=In}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=en(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==qt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[nt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?lt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Mn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=nr;else if(Xn(c)){if(rr)v=fr;else{v=ur;var y=lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ht(r.elementType)&&(v=nr):v=dr;if(v&&=v(e,r)){Zn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Xn(y)||y.contentEditable===`true`)&&(Sr=y,Cr=r,wr=null);break;case`focusout`:wr=Cr=Sr=null;break;case`mousedown`:Tr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Tr=!1,Er(s,n,i);break;case`selectionchange`:if(xr)break;case`keydown`:case`keyup`:Er(s,n,i)}var b;if(Rn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Kn?Wn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Vn&&n.locale!==`ko`&&(Kn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Kn&&(b=cn()):(an=i,on=`value`in an?an.value:an.textContent,Kn=!0)),y=Ed(r,x),0<y.length&&(x=new En(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Gn(n),b!==null&&(x.data=b)))),(b=Bn?qn(e,n):Jn(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new En(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=en(e,n),i!=null&&r.unshift(Td(e,i,a)),i=en(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=en(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=en(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
|
|
9
|
+
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Rt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Vt(e,r,o);break;case`data`:if(t!==`object`){Ct(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Gt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Gt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`onScroll`:r!=null&&yd(`scroll`,e);break;case`onScrollEnd`:r!=null&&yd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Gt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:yd(`beforetoggle`,e),yd(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Ut.get(n)||n,St(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Vt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Rt(e,``+r);break;case`onScroll`:r!=null&&yd(`scroll`,e);break;case`onScrollEnd`:r!=null&&yd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[tt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):St(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:yd(`error`,e),yd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:yd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Nd(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in yd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in yd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Nd(e,t,s,c,n,null)}G(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,l,r,n,null)}return;case`dialog`:yd(`beforetoggle`,e),yd(`toggle`,e),yd(`cancel`,e),yd(`close`,e);break;case`iframe`:case`object`:yd(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)yd(gd[r],e);break;case`image`:yd(`error`,e),yd(`load`,e);break;case`details`:yd(`toggle`,e);break;case`embed`:case`source`:case`link`:yd(`error`,e),yd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,u,r,n,null)}return;default:if(Ht(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Nd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}Nt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Nd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Nd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}Lt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Nd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Nd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Nd(e,t,u,p,r,m)}return;default:if(Ht(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Wd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e!==Gd&&(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[st]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body)}n=i}while(n);Pp(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[st])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=L.d;L.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=vu();return e||t}function bf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Fd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=ft(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);pt(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=ft(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=h({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),pt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=ft(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),pt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var a=(a=ne.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Mf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function jf(e){return`href="`+Mt(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),pt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Mt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),Fd(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=jf(n.href);var o=e.querySelector(Mf(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,pt(a),a):(r=n,(a=hf.get(o))&&(r=h({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[st]||a[et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Yf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var $f={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function ep(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=W(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=W(0),this.hiddenUpdates=W(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function tp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ep(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ei(3,null,null,t),e.current=a,a.stateNode=e,t=ta(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Pa(a),e}function np(e){return e?(e=Qr,e):Qr}function rp(e,t,n,r,i,a){i=np(i),r.context===null?r.context=i:r.pendingContext=i,r=Ia(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=La(e,r,t),n!==null&&(pu(n,e,t),Ra(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=Yr(e,67108864);t!==null&&pu(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=du();t=Ye(t);var n=Yr(e,t);n!==null&&pu(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,dp(e,t,n,r)}finally{L.p=a,I.T=i}}function up(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,dp(e,t,n,r)}finally{L.p=a,I.T=i}}function dp(e,t,n,r){if(cp){var i=fp(r);if(i===null)wd(e,t,r,pp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Y&6)&&($l=be()+500,rd(0,!1))}}break;case 31:case 13:s=Yr(a,2),s!==null&&pu(s,a,2),vu(),ap(a,2)}if(a=fp(r),a===null&&wd(e,t,r,pp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function fp(e){return e=Jt(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=lt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ut(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,i),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,i),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return bp.set(a,Tp(bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=lt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){sp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);qt=r,n.target.dispatchEvent(r),qt=null}else return t=ut(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[tt]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||null)s=o.formAction;else if(mp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;rp(n,du(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rp(e.current,2,null,e,null,null),vu(),t[nt]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=n.version;if(Rp!==`19.2.6`)throw Error(i(527,Rp,`19.2.6`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{ke=Bp.inject(zp),Ae=Bp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=tp(e,1,!1,null,null,n,r,null,o,s,c,Fp),e[nt]=t.current,Sd(e),new Ip(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g(),y=`http://127.0.0.1:8797`,b={fetch:(e,t)=>fetch(`${y}${e}`,t),summaries:!0,reruns:!0},x=()=>b;function S(e){b={...b,...e}}var C=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),w=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),T=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),E=e=>{let t=T(e);return t.charAt(0).toUpperCase()+t.slice(1)},D={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`},O=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},k=(0,_.createContext)({}),A=()=>(0,_.useContext)(k),j=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=A()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...D,width:t??l??D.width,height:t??l??D.height,stroke:e??f,strokeWidth:m,className:C(`lucide`,p,i),...!a&&!O(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),M=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(j,{ref:i,iconNode:t,className:C(`lucide-${w(E(e))}`,`lucide-${e}`,n),...r}));return n.displayName=E(e),n},N=M(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),P=M(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),F=M(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),I=M(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),L=M(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),R=M(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),z=M(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ee=M(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),B=M(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),V=M(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),H=M(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),te=M(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),U=M(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),ne=M(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),re=M(`folder-up`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]),ie=M(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),ae=M(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),oe=M(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),se=M(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),ce=M(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),le=M(`milestone`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M12 3v3`,key:`1n5kay`}],[`path`,{d:`M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z`,key:`8gz4t4`}]]),ue=M(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),de=M(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),fe=M(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),pe=M(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),me=M(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),he=M(`scan-search`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]),ge=M(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),_e=M(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ve=M(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ye=M(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),be=M(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`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`}]]),xe=M(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Se=M(`waypoints`,[[`path`,{d:`m10.586 5.414-5.172 5.172`,key:`4mc350`}],[`path`,{d:`m18.586 13.414-5.172 5.172`,key:`8c96vv`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`circle`,{cx:`12`,cy:`20`,r:`2`,key:`144qzu`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}],[`circle`,{cx:`20`,cy:`12`,r:`2`,key:`1xzzfp`}],[`circle`,{cx:`4`,cy:`12`,r:`2`,key:`1hvhnz`}]]),Ce=M(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),we=M(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Te=M(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function Ee(e){return e.title.startsWith(`Exchange complete`)}function De(e){if(!Ee(e))return!1;let t=Number(e.title.split(`·`)[1]?.trim());try{let t=JSON.parse(e.raw);if([`failed`,`incomplete`,`cancelled`].includes(t.response_status))return!0}catch{}return!Number.isFinite(t)||t<200||t>=300}function Oe(e){return e.title!==`Context assembled`&&(!Ee(e)||De(e))}function ke(e){let t=[];for(let[n,r]of e.entries()){if(r.title===`Context assembled`){let e=`request-${n}`;try{e=JSON.parse(r.raw).exchange_id||e}catch{}t.push({exchangeId:e,number:t.length+1,items:[]});continue}let e=t[t.length-1];e&&(Ee(r)&&!e.completion&&(e.completion=r),Oe(r)&&e.items.push({event:r,index:n}))}return t}function Ae(e,t){let n=(e??[]).filter(e=>e[t]!==null);return n.length?n.reduce((e,n)=>e+n[t],0):null}function je(e){let t=(e??[]).map(e=>Date.parse(e.startedAt)),n=(e??[]).map(e=>Date.parse(e.completedAt||``));return t.length&&[...t,...n].every(Number.isFinite)?Math.max(...n)-Math.min(...t):null}function Me(e){let t=(e??[]).flatMap(e=>[Date.parse(e.startedAt),e.completedAt?Date.parse(e.completedAt):NaN]).filter(Number.isFinite);return t.length?{since:Math.min(...t)-1e3,until:Math.max(...t)+1e3}:{}}function Ne(e,t){let n=e.find(e=>{if(!e.title.startsWith(`Tool result:`))return!1;try{return JSON.parse(e.raw).call_id===t}catch{return!1}});if(!n)return{state:`none`,code:null,output:``};let r=``,i=!1,a=null;try{let e=JSON.parse(n.raw),t=e.output??e.content;r=typeof t==`string`?t:JSON.stringify(t??``),i=e.is_error===!0||e.status===`failed`;let o=typeof e.exit_code==`number`?e.exit_code:t&&typeof t==`object`&&typeof t.exit_code==`number`?t.exit_code:null;typeof o==`number`&&(a=o)}catch{}if(i)return{state:`failed`,code:a,output:r};if(a!==null)return{state:a===0?`ok`:`failed`,code:a,output:r};if(/Rejected\(/.test(r))return{state:`rejected`,code:null,output:r};let o=Number(r.match(/Process exited with code (\d+)/)?.[1]??NaN);return Number.isFinite(o)?{state:o===0?`ok`:`failed`,code:o,output:r}:{state:/failed/i.test(r.slice(0,80))?`failed`:`ok`,code:null,output:r}}function Pe(e){return e.forkId?{where:`fork`,label:`Fork`,forkable:!1,reason:`This is a Playground fork’s own run. Fork from the original prompt instead.`}:e.sandboxId?.startsWith(`rtp-`)?e.provider===`claude-code`?{where:`sandbox`,label:`Sandbox`,forkable:!0,reason:null}:{where:`sandbox`,label:`Sandbox`,forkable:!1,reason:`Only Claude Code runs can be forked so far; this one ran a different agent in the sandbox.`}:{where:`mac`,label:`Mac`,forkable:!1,reason:`This prompt ran on your machine, so it can’t be forked: nothing recorded how your files looked at each step, and replaying it would touch your real project. Run Claude Code in a local sandbox (raytrace sandbox create --local) to get runs you can fork.`}}var Fe={};function Ie(e,t){let n=_.useRef(Fe);return n.current===Fe&&(n.current=e(t)),n}function Le(){}var Re=Object.freeze([]),ze=Object.freeze({});function Be(e){_.useEffect(e,Re)}var Ve=0,He=class e{static create(){return new e}currentId=Ve;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ve,t()},e)}isStarted(){return this.currentId!==Ve}clear=()=>{this.currentId!==Ve&&(clearTimeout(this.currentId),this.currentId=Ve)};disposeEffect=()=>this.clear};function Ue(){let e=Ie(He.create).current;return Be(e.disposeEffect),e}var W=typeof document<`u`?_.useLayoutEffect:()=>{};function We(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ge,platform:Ke,maxTouchPoints:qe}=We(),Je=Ge.toLowerCase(),Ye=Ke.toLowerCase(),Xe=/^i(os$|p)/.test(Ye)||Ye===`macintel`&&qe>1,Ze=`android`,Qe=Ye===Ze||Je.includes(Ze),$e=!Xe&&Ye.startsWith(`mac`);Ye.startsWith(`win`),!Qe&&/^(linux|chrome os)/.test(Ye);var et=$e||Xe,tt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!tt&&Je.includes(`firefox`),!tt&&Je.includes(`chrom`);var nt=et,rt=/jsdom|happydom/.test(Je);function it(e){e.preventDefault(),e.stopPropagation()}function at(e){return`nativeEvent`in e}function ot(e){return e.pointerType===``&&e.isTrusted?!0:Qe&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function st(e){return rt?!1:!Qe&&e.width===0&&e.height===0||Qe&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ct(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function lt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function ut(){return typeof window<`u`}function dt(e){return mt(e)?(e.nodeName||``).toLowerCase():`#document`}function ft(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pt(e){return((mt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function mt(e){return ut()?e instanceof Node||e instanceof ft(e).Node:!1}function ht(e){return ut()?e instanceof Element||e instanceof ft(e).Element:!1}function gt(e){return ut()?e instanceof HTMLElement||e instanceof ft(e).HTMLElement:!1}function _t(e){return!ut()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ft(e).ShadowRoot}function vt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function yt(e){return/^(table|td|th)$/.test(dt(e))}function bt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xt=/transform|translate|scale|rotate|perspective|filter/,St=/paint|layout|strict|content/,Ct=e=>!!e&&e!==`none`,wt;function Tt(e){let t=ht(e)?kt(e):e;return Ct(t.transform)||Ct(t.translate)||Ct(t.scale)||Ct(t.rotate)||Ct(t.perspective)||!Dt()&&(Ct(t.backdropFilter)||Ct(t.filter))||xt.test(t.willChange||``)||St.test(t.contain||``)}function Et(e){let t=jt(e);for(;gt(t)&&!Ot(t);){if(Tt(t))return t;if(bt(t))return null;t=jt(t)}return null}function Dt(){return wt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),wt}function Ot(e){return/^(html|body|#document)$/.test(dt(e))}function kt(e){return ft(e).getComputedStyle(e)}function At(e){return ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if(dt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_t(e)&&e.host||pt(e);return _t(t)?t.host:t}function Mt(e){let t=jt(e);return Ot(t)?(e.ownerDocument||e).body:gt(t)&&vt(t)?t:Mt(t)}function Nt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Mt(e),i=r===e.ownerDocument?.body,a=ft(r);if(i){let e=Pt(a);return t.concat(a,a.visualViewport||[],vt(r)?r:[],e&&n?Nt(e):[])}return t.concat(r,Nt(r,[],n))}function Pt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ft=`data-base-ui-focusable`,It=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Lt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function G(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&_t(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Rt(e){return`composedPath`in e?e.composedPath()[0]:e.target}function zt(e,t){if(!ht(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(G(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Bt(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Vt(e){return e.matches(`html,body`)}function Ht(e){return gt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ut(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${It}`)!=null}function Wt(e){return e?e.getAttribute(`role`)===`combobox`&&Ht(e):!1}function Gt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Kt(e,t){return t!=null&&!ct(t)?0:typeof e==`function`?e():e}function qt(e,t,n){let r=Kt(e,n);return typeof r==`number`?r:r?.[t]}function Jt(e){return typeof e==`function`?e():e}function Yt(e,t){return t||e===`click`||e===`mousedown`}function Xt(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Zt=`none`,Qt=`trigger-press`,$t=`trigger-hover`,en=`outside-press`,tn=`close-press`,nn=`focus-out`,rn=`escape-key`,an=`imperative-action`;function on(e,t,n,r){let i=!1,a=!1,o=r??ze;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var sn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),cn=o(((e,t)=>{t.exports=sn()}));function ln(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function un(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function dn(e,t,n,r){let i=Ie(pn).current;return mn(i,e,t,n,r)&&gn(i,[e,t,n,r]),i.callback}function fn(e){let t=Ie(pn).current;return hn(t,e)&&gn(t,e),t.callback}function pn(){return{callback:null,cleanup:null,refs:[]}}function mn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function hn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function gn(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function _n(e){let t=Ie(vn,e).current;return t.next=e,W(t.effect),t}function vn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var yn={..._},bn=yn.useInsertionEffect,xn=bn&&bn!==yn.useLayoutEffect?bn:e=>e();function Sn(e){let t=Ie(Cn).current;return t.next=e,xn(t.effect),t.trampoline}function Cn(){let e={next:void 0,callback:wn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function wn(){}var Tn=null;globalThis.requestAnimationFrame;var En=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Dn=class e{static create(){return new e}static request(e){return En.request(e)}static cancel(e){return En.cancel(e)}currentId=Tn;request(e){this.cancel(),this.currentId=En.request(()=>{this.currentId=Tn,e()})}cancel=()=>{this.currentId!==Tn&&(En.cancel(this.currentId),this.currentId=Tn)};disposeEffect=()=>this.cancel};function On(){let e=Ie(Dn.create).current;return Be(e.disposeEffect),e}function kn(e){return e?.ownerDocument||document}var An={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},jn={...An,position:`fixed`,top:0,left:0};({...An});var K=cn(),Mn=_.forwardRef(function(e,t){let[n,r]=_.useState();W(()=>{nt&&tt&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,K.jsx)(`span`,{...e,ref:t,style:jn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Nn=Math.min,Pn=Math.max,Fn=Math.round,In=Math.floor,Ln=e=>({x:e,y:e}),Rn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function zn(e,t,n){return Pn(e,Nn(t,n))}function Bn(e,t){return typeof e==`function`?e(t):e}function Vn(e){return e.split(`-`)[0]}function Hn(e){return e.split(`-`)[1]}function Un(e){return e===`x`?`y`:`x`}function Wn(e){return e===`y`?`height`:`width`}function Gn(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Kn(e){return Un(Gn(e))}function qn(e,t,n){n===void 0&&(n=!1);let r=Hn(e),i=Kn(e),a=Wn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=nr(o)),[o,nr(o)]}function Jn(e){let t=nr(e);return[Yn(e),t,Yn(t)]}function Yn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xn=[`left`,`right`],Zn=[`right`,`left`],Qn=[`top`,`bottom`],$n=[`bottom`,`top`];function er(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Zn:Xn:t?Xn:Zn;case`left`:case`right`:return t?Qn:$n;default:return[]}}function tr(e,t,n,r){let i=Hn(e),a=er(Vn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Yn)))),a}function nr(e){let t=Vn(e);return Rn[t]+e.slice(t.length)}function rr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ir(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:rr(e)}function ar(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function or(e){return e.visibility===`hidden`||e.visibility===`collapse`}function sr(e,t=e?kt(e):null){return!e||!e.isConnected||!t||or(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var cr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function lr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return _t(n)?n.host:null}function ur(e){for(let t of Array.from(e.children))if(dt(t)===`summary`)return t;return null}function dr(e,t){let n=ur(t);return!!n&&(e===n||G(n,e))}function fr(e){let t=e?dt(e):``;return e!=null&&e.matches(cr)&&(t!==`summary`||e.parentElement!=null&&dt(e.parentElement)===`details`&&ur(e.parentElement)===e)&&(t!==`details`||ur(e)==null)&&(t!==`input`||e.type!==`hidden`)}function pr(e){if(!fr(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=lr(t)){let n=t!==e,r=dt(t)===`slot`;if(t.hasAttribute(`inert`)||n&&dt(t)===`details`&&!t.open&&!dr(e,t)||t.hasAttribute(`hidden`)||!r&&!mr(t,n))return!1}return!0}function mr(e,t){let n=kt(e);return t?n.display!==`none`:sr(e,n)}function hr(e){let t=e.tabIndex;if(t<0){let t=dt(e);if(t===`details`||t===`audio`||t===`video`||gt(e)&&e.isContentEditable)return 0}return t}function gr(e){if(dt(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function _r(e,t){let n=gr(e);if(!n)return!0;let r=t.find(e=>{let t=gr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=gr(e);return t?.name===n.name&&t.form===n.form})===n}function vr(e){if(gt(e)&&dt(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return gt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function yr(e,t){vr(e).forEach(e=>{fr(e)&&t.push(e),yr(e,t)})}function br(e,t,n){vr(e).forEach(e=>{gt(e)&&e.matches(t)&&n.push(e),br(e,t,n)})}function xr(e){return pr(e)&&hr(e)>=0}function Sr(e){let t=[];return yr(e,t),t.filter(pr)}function Cr(e){let t=Sr(e);return t.filter(e=>hr(e)>=0&&_r(e,t))}function wr(e,t){let n=Cr(e),r=n.length;if(r===0)return;let i=Lt(kn(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Tr(e){return wr(kn(e).body,1)||e}function Er(e){return wr(kn(e).body,-1)||e}function Dr(e,t){if(!e)return null;let n=Cr(kn(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Or(e){return Dr(e,1)}function kr(e){return Dr(e,-1)}function Ar(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!G(n,r)}function jr(e){Cr(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Mr(e){let t=[];br(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Nr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Nr(e,t.id,n)])}function Pr(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Fr(e){return`data-base-ui-${e}`}var Ir=0;function Lr(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ir);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Le;let o=requestAnimationFrame(a);return Ir=o,()=>{Ir===o&&(cancelAnimationFrame(o),Ir=0)}}var Rr={inert:new WeakMap,"aria-hidden":new WeakMap},zr=`data-base-ui-inert`,Br={inert:new WeakSet,"aria-hidden":new WeakSet},Vr=new WeakMap,Hr=0;function Ur(e){return Br[e]}function Wr(e){return e?_t(e)?e.host:Wr(e.parentNode):null}var Gr=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Wr(t);return e.contains(n)?n:null}).filter(e=>e!=null),Kr=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},qr=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{dt(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Jr(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Gr(t,e),l=i?qr(t,Kr(c),new Set(c)):[],u=[],d=[];if(a){let e=Rr[a],n=Ur(a);s=n,o=e;let r=Gr(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);qr(t,Kr(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Vr.get(e)||0)+1;Vr.set(e,t),d.push(e),t===1&&e.setAttribute(zr,``)}),Hr+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Vr.get(e)||0)-1;Vr.set(e,t),t||e.removeAttribute(zr)}),--Hr,Hr||(Rr.inert=new WeakMap,Rr[`aria-hidden`]=new WeakMap,Br.inert=new WeakSet,Br[`aria-hidden`]=new WeakSet,Vr=new WeakMap)}}function Yr(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=kn(e[0]).body;return Jr(e,a,n,r,{mark:i})}var Xr=0;function Zr(e,t=`mui`){let[n,r]=_.useState(e),i=e||n;return _.useEffect(()=>{n??(Xr+=1,r(`${t}-${Xr}`))},[n,t]),i}var Qr=yn.useId;function $r(e,t){if(Qr!==void 0){let n=Qr();return e??(t?`${t}-${n}`:n)}return Zr(e,t)}function ei(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var ti=ei(`https://base-ui.com/production-error`,`Base UI`),ni=19;function ri(e){return ni>=e}function ii(e){if(!_.isValidElement(e))return null;let t=e,n=t.props;return(ri(19)?n?.ref:t.ref)??null}function ai(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function oi(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function si(e,t){return typeof e==`function`?e(t):e}function ci(e,t){return typeof e==`function`?e(t):e}var li={};function ui(e,t,n,r,i){if(!n&&!r&&!i&&!e)return fi(t);let a=fi(e);return t&&(a=pi(a,t)),n&&(a=pi(a,n)),r&&(a=pi(a,r)),i&&(a=pi(a,i)),a}function di(e){if(e.length===0)return li;if(e.length===1)return fi(e[0]);let t=fi(e[0]);for(let n=1;n<e.length;n+=1)t=pi(t,e[n]);return t}function fi(e){return _i(e)?{...vi(e,li)}:mi(e)}function pi(e,t){return _i(t)?vi(t,e):hi(e,t)}function mi(e){let t={...e};for(let e in t){let n=t[e];gi(e,n)&&(t[e]=bi(n))}return t}function hi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ai(e.style,r);break;case`className`:e[n]=Si(e.className,r);break;default:e[n]=gi(n,r)?yi(e[n],r):r}}return e}function gi(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function _i(e){return typeof e==`function`}function vi(e,t){return _i(e)?e(t):e??li}function yi(e,t){return t?e?(...n)=>{let r=n[0];if(Ci(r)){let i=r;xi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:bi(t):e}function bi(e){return e&&((...t)=>{let n=t[0];return Ci(n)&&xi(n),e(...t)})}function xi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Si(e,t){return t?e?t+` `+e:t:e}function Ci(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function wi(e,t,n={}){let r=t.render,i=Ti(t,n);return n.enabled===!1?null:Oi(e,r,i,n.state??ze)}function Ti(e,t={}){let{className:n,style:r,render:i}=e,{state:a=ze,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?si(n,a):void 0,d=l?ci(r,a):void 0,f=l?oi(a,c):ze,p=l&&s?Ei(s):void 0,m=l?ai(f,p)??{}:ze;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?fn([m.ref,ii(i),...o]):dn(m.ref,ii(i),o):dn(null,null)),l?(u!==void 0&&(m.className=Si(m.className,u)),d!==void 0&&(m.style=ai(m.style,d)),m):ze}function Ei(e){return Array.isArray(e)?di(e):ui(void 0,e)}var Di=Symbol.for(`react.lazy`);function Oi(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ui(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Di&&(i=_.Children.toArray(t)[0]),_.cloneElement(i,e)}if(e&&typeof e==`string`)return ki(e,n);throw Error(ti(8))}function ki(e,t){return e===`button`?(0,_.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,_.createElement)(`img`,{alt:``,...t,key:t.key}):_.createElement(e,t)}var Ai={style:{transition:`none`}},ji=`data-base-ui-click-trigger`,Mi={fallbackAxisSide:`end`},Ni={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Pi=c(m(),1),Fi=_.createContext(null),Ii=()=>_.useContext(Fi),Li=Fr(`portal`);function Ri(e={}){let{ref:t,container:n,componentProps:r=ze,elementProps:i}=e,a=$r(),o=Ii()?.portalNode,[s,c]=_.useState(null),[l,u]=_.useState(null),d=Sn(e=>{e!==null&&u(e)}),f=_.useRef(null);W(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(mt(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=wi(`div`,r,{ref:[t,d],props:[{id:a,[Li]:``},i]}),m=s&&p?Pi.createPortal(p,s):null;return{node:l,nodeId:_.isValidElement(p)?p.props.id:void 0,subtree:m}}var zi=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=Ri({container:o,ref:t,componentProps:e,elementProps:s}),d=_.useRef(null),f=_.useRef(null),p=_.useRef(null),m=_.useRef(null),[h,g]=_.useState(null),v=_.useRef(!1),y=h?.modal,b=h?.open,x=!!h&&!h.modal&&h.open&&!!c;_.useEffect(()=>{if(!c||y)return;function e(e){c&&e.relatedTarget&&Ar(e)&&(e.type===`focusin`?v.current&&=(Mr(c),!1):(jr(c),v.current=!0))}return un(ln(c,`focusin`,e,!0),ln(c,`focusout`,e,!0))},[c,y]),W(()=>{c&&b===!0&&v.current&&(Mr(c),v.current=!1)},[b,c]);let S=_.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,K.jsxs)(_.Fragment,{children:[u,(0,K.jsxs)(Fi.Provider,{value:S,children:[x&&c&&(0,K.jsx)(Mn,{"data-type":`outside`,ref:d,onFocus:e=>{Ar(e,c)?p.current?.focus():Er(h?h.domReference:null)?.focus()}}),x&&c&&(0,K.jsx)(`span`,{"aria-owns":l,style:Ni}),c&&Pi.createPortal(a,c),x&&c&&(0,K.jsx)(Mn,{"data-type":`outside`,ref:f,onFocus:e=>{Ar(e,c)?m.current?.focus():(Tr(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,on(`focus-out`,e.nativeEvent)))}})]})]})});function Bi(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Vi=class{nodesRef={current:[]};events=Bi();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Hi=_.createContext(null),Ui=_.createContext(null),Wi=()=>_.useContext(Hi)?.id||null,Gi=e=>{let t=_.useContext(Ui);return e??t};function Ki(e){let t=$r(),n=Gi(e),r=Wi();return W(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function qi(e){let{children:t,id:n}=e,r=Wi();return(0,K.jsx)(Hi.Provider,{value:_.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Ji(e){let{children:t,externalTree:n}=e,r=Ie(()=>n??new Vi).current;return(0,K.jsx)(Ui.Provider,{value:r,children:t})}function Yi(e){return e==null?e:`current`in e?e.current:e}function Xi(e,t){let n=ft(Rt(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Zi=20,Qi=[];function $i(){Qi=Qi.filter(e=>e.deref()?.isConnected)}function ea(e){$i(),e&&dt(e)!==`body`&&(Qi.push(new WeakRef(e)),Qi.length>Zi&&(Qi=Qi.slice(-20)))}function ta(){return $i(),Qi[Qi.length-1]?.deref()}function na(e){return e?xr(e)?e:Cr(e)[0]||e:null}function ra(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Sr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return xr(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ia(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),v=h.useState(`domReferenceElement`),y=h.useState(`floatingElement`),{events:b,dataRef:x}=h.context,S=Sn(()=>x.current.floatingContext?.nodeId),C=i===!1,w=Wt(v)&&C,T=_n(i),E=_n(a),D=_n(l),O=_n(g),k=Gi(p),A=Ii(),j=_.useRef(!1),M=_.useRef(!1),N=_.useRef(!1),P=_.useRef(null),F=_.useRef(``),I=_.useRef(``),L=_.useRef(null),R=_.useRef(null),z=dn(L,f,A?.beforeInsideRef),ee=dn(R,A?.afterInsideRef),B=Ue(),V=Ue(),H=On(),te=A!=null,U=Gt(y),ne=Sn((e=U)=>e?Cr(e):[]),re=Sn(()=>m?.().filter(e=>e!=null)??[]);_.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&G(U,Lt(kn(U)))&&ne().length===0&&!w&&it(e)}return ln(kn(U),`keydown`,e)},[r,U,s,w,ne]),_.useEffect(()=>{if(r||!g)return;let e=kn(U);function t(){N.current=!1}function n(e){let t=Rt(e),n=re(),r=G(y,t)||G(v,t)||G(A?.portalNode,t)||n.some(e=>e===t||G(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,V.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return un(ln(e,`pointerdown`,n,!0),ln(e,`pointerup`,t,!0),ln(e,`pointercancel`,t,!0),ln(e,`keydown`,i,!0),t)},[r,y,v,U,g,A,V,re]),_.useEffect(()=>{if(r||!c)return;let e=kn(U);function t(){M.current=!0,V.start(0,()=>{M.current=!1})}function n(e){let t=Rt(e);xr(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Rt(t);s&&n==null&&i!=null&&G(y,i)&&ea(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=re(),f=n?.hasAttribute(Fr(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Yi(d),Yi(u)].includes(n),p=!(G(v,n)||G(y,n)||G(n,y)||G(A?.portalNode,n)||l.some(e=>e===n||G(e,n))||c.hasMatchingElement(e=>G(e,n))||f||k&&(Nr(k.nodesRef.current,a).find(e=>G(e.context?.elements.floating,n)||G(e.context?.elements.domReference,n))||Pr(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Gt(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&U&&ra(U),o&&r!==v&&!sr(i)&&Lt(e)===e.body){if(gt(U)&&(U.focus(),o===`popup`)){H.request(()=>{U.focus()});return}let e=ne(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;gt(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==ta())&&(j.current=!0,h.setOpen(!1,on(nn,t)))})}function a(){N.current||(x.current.insideReactTree=!0,B.start(0,()=>{x.current.insideReactTree=!1}))}let l=gt(v)?v:null;if(y||l)return un(l&&ln(l,`focusout`,i),l&&ln(l,`pointerdown`,t),y&&ln(y,`focusin`,n),y&&ln(y,`focusout`,i),y&&A&&ln(y,`focusout`,a,!0))},[r,v,y,U,s,k,A,h,c,o,ne,w,S,x,B,V,H,u,d,re]),_.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Fr(`portal`)}]`)||[]),t=(k?Pr(k.nodesRef.current,S()):[]).find(e=>Wt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Yr([y,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...re(),t,Yi(d),Yi(u),w?v:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=Yr([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,v,y,s,A,w,k,S,u,d,re]),W(()=>{if(!g||r||!gt(U))return;F.current=``,I.current=``;let e=kn(U),t=Lt(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||G(U,t))return;let i=null,a=()=>(i??=ne(U),i[0]||U),o;o=r===!0||r===null?a():Yi(r),o||=a();let s=G(U,Lt(e));Lr(o,{preventScroll:o===U,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Lt(e);return!(t!==o&&G(U,t))}})})},[r,g,U,ne,T,D,O]),W(()=>{if(r||!U)return;let e=kn(U),t=Lt(e),n=D.current==null;ea(t);function i(e){if(e.open||(F.current=Xi(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(ot(e.nativeEvent)||st(e.nativeEvent))j.current=!1;else{let e=!1;kn(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&dt(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ta()||null,typeof i==`boolean`?s:Yi(i)||s||null}return()=>{b.off(`openchange`,i);let t=Lt(e),n=re(),r=G(y,t)||n.some(e=>e===t||G(e,t))||k&&Nr(k.nodesRef.current,S(),!1).some(e=>G(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=na(c),i=typeof o!=`boolean`;if(o&&!j.current&>(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,U,E,D,b,k,v,S,re]),W(()=>{if(!tt||g||!y)return;let e=Lt(kn(y));gt(e)&&Ht(e)&&G(y,e)&&e.blur()},[g,y]),W(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,v]),W(()=>{if(!r&&U)return ra(U),()=>{queueMicrotask($i)}},[r,U]);let ie=!r&&(!s||!w)&&(te||s);return(0,K.jsxs)(_.Fragment,{children:[ie&&(0,K.jsx)(Mn,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=ne();Lr(e[e.length-1])}else A?.portalNode&&(j.current=!1,Ar(e,A.portalNode)?Tr(v)?.focus():Yi(d??A.beforeOutsideRef)?.focus())}}),n,ie&&(0,K.jsx)(Mn,{"data-type":`inside`,ref:ee,onFocus:e=>{s?Lr(ne()[0]):A?.portalNode&&(c&&(j.current=!0),Ar(e,A.portalNode)?Er(v)?.focus():Yi(u??A.afterOutsideRef)?.focus())}})]})}function aa(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Qt}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=_.useRef(void 0),f=On(),p=Ue(),m=_.useMemo(()=>{function e(e,t,n,r){let i=on(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=ct(e.pointerType,!0)&&st(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||ct(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Rt(o);if(Ht(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}ct(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return _.useMemo(()=>n?{reference:m}:ze,[n,m])}function oa(){return!1}function sa(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ca(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=oa,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=Gi(c),m=Sn(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,v=Sn(()=>a),{escapeKey:y,outsidePress:b}=sa(s),x=_.useRef(!1),S=_.useRef(!1),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(``),E=_.useRef(null),D=Ue(),O=Ue(),k=Sn(()=>{O.clear(),f.current.insideReactTree=!1}),A=Sn(e=>{let t=f.current.floatingContext?.nodeId;return(p?Nr(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=Sn(e=>Bt(e,l.select(`floatingElement`))||Bt(e,l.select(`domReferenceElement`))),M=Sn(e=>{o()&&l.setOpen(!1,on(Qt,e.nativeEvent))}),N=Sn(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=on(rn,at(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=Sn(()=>{f.current.insideReactTree=!0,O.start(0,k)}),F=Sn(e=>{if(!u||!n||e.button!==0)return;let t=Rt(e.nativeEvent);G(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=Sn(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});_.useEffect(()=>{if(!u||!n)return k;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new He,t=new He;function i(){e.clear(),w.current=!0}function a(){e.start(tt?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function _(e){let t=f.current.floatingContext?.nodeId,n=p&&Nr(p.nodesRef.current,t).some(t=>Bt(e,t.context?.elements.floating));return j(e)||n}function O(e){if(m(e)){e.type!==`click`&&!j(e)&&(t.clear(),C.current=!1),k();return}if(f.current.insideReactTree){k();return}let n=Rt(e),r=`[${Fr(`inert`)}]`,i=ht(n)?n.getRootNode():null,a=Array.from((_t(i)?i:kn(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>G(e,n))))return;let s=ht(n)?n:null;for(;s&&!Ot(s);){let e=jt(s);if(Ot(e)||!ht(e))break;s=e}if(!(a.length&&ht(n)&&!Vt(n)&&!G(n,l.select(`floatingElement`))&&a.every(e=>!G(s,e)))){if(gt(n)&&!(`touches`in e)){let t=Ot(n),r=kt(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!_(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}(typeof h!=`function`||h(e))&&(A(`__outsidePressBubbles`)||(l.setOpen(!1,on(en,e)),k()))}}}function M(e){c()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!j(e)&&O(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||j(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Rt(e);if(!n)return;let r=ln(n,e.type,()=>{t(e),r()})}function I(e){T.current=`touch`,F(e,P)}function L(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):O(e)})}function R(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!_(e)){if(n){o();return}(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,k())}}}function z(e){if(c()!==`sloppy`||!E.current||j(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(O(e),D.clear(),E.current=null)}function ee(e){F(e,z)}function B(e){c()===`sloppy`&&E.current&&!j(e)&&(E.current.dismissOnTouchEnd&&O(e),D.clear(),E.current=null)}function V(e){F(e,B)}let H=kn(d),te=un(r&&un(ln(H,`keydown`,N),ln(H,`compositionstart`,i),ln(H,`compositionend`,a)),g&&un(ln(H,`click`,L,!0),ln(H,`pointerdown`,L,!0),ln(H,`pointerup`,R,!0),ln(H,`pointercancel`,R,!0),ln(H,`mousedown`,L,!0),ln(H,`mouseup`,R,!0),ln(H,`touchstart`,I,!0),ln(H,`touchmove`,ee,!0),ln(H,`touchend`,V,!0)));return()=>{te(),e.clear(),t.clear(),s(),C.current=!1,k()}},[f,d,r,g,h,u,n,y,b,N,k,v,A,j,p,l,D]);let L=_.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),R=_.useMemo(()=>({onKeyDown:N,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,I]);return _.useMemo(()=>n?{reference:L,floating:R,trigger:L}:{},[n,L,R])}function la(e,t,n){let{reference:r,floating:i}=e,a=Gn(t),o=Kn(t),s=Wn(o),c=Vn(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Hn(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ua(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Bn(t,e),p=ir(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ar(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ar(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var da=50,fa=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ua},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=la(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<da&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=la(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},pa=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Bn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Vn(r),_=Gn(o),v=Vn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[nr(o)]:Jn(o)),x=p!==`none`;!d&&x&&b.push(...tr(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=qn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Gn(t)||T.every(e=>Gn(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Gn(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},ma=new Set([`left`,`top`]);async function ha(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Vn(n),s=Hn(n),c=Gn(n)===`y`,l=ma.has(o)?-1:1,u=a&&c?-1:1,d=Bn(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ga=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ha(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_a=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Bn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Gn(i),p=Un(f),m=u[p],h=u[f],g=(e,t)=>zn(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},va=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Bn(e,t),u={x:n,y:r},d=Gn(i),f=Un(d),p=u[f],m=u[d],h=Bn(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ma.has(Vn(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ya=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Bn(e,t),c=await i.detectOverflow(t,s),l=Vn(n),u=Hn(n),d=Gn(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Nn(p-c[m],g),y=Nn(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Pn(c.left,c.right):S=p-2*Pn(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ba(e){let t=kt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Fn(n)!==a||Fn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function xa(e){return ht(e)?e:e.contextElement}function Sa(e){let t=xa(e);if(!gt(t))return Ln(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ba(t),o=(a?Fn(n.width):n.width)/r,s=(a?Fn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ca=Ln(0);function wa(e){let t=ft(e);return!Dt()||!t.visualViewport?Ca:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ta(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ft(e)}function Ea(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=xa(e),o=Ln(1);t&&(r?ht(r)&&(o=Sa(r)):o=Sa(e));let s=Ta(a,n,r)?wa(a):Ln(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ft(a),t=ht(r)?ft(r):r,n=e,i=Pt(n);for(;i&&t!==n;){let e=Sa(i),t=i.getBoundingClientRect(),r=kt(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ft(i),i=Pt(n)}}return ar({width:u,height:d,x:c,y:l})}function Da(e,t){let n=At(e).scrollLeft;return t?t.left+n:Ea(pt(e)).left+n}function Oa(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Da(e,n),y:n.top+t.scrollTop}}function ka(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=pt(r),s=t?bt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ln(1),u=Ln(0),d=gt(r);if((d||!a)&&((dt(r)!==`body`||vt(o))&&(c=At(r)),d)){let e=Ea(r);l=Sa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Oa(o,c):Ln(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Aa(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ja(e){let t=At(e),n=e.ownerDocument.body,r=Pn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Pn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Da(e),o=-t.scrollTop;return kt(n).direction===`rtl`&&(a+=Pn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ma=25;function Na(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ft(e),a=pt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Dt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Da(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ma&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Pa(e,t){let n=Ea(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Sa(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fa(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Na(e,n,t);else if(t===`document`)r=ja(pt(e));else if(ht(t))r=Pa(t,n);else{let n=wa(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ar(r)}function Ia(e,t){let n=t.get(e);if(n)return n;let r=Nt(e,[],!1).filter(e=>ht(e)&&dt(e)!==`body`),i=null,a=kt(e).position===`fixed`,o=a?jt(e):e;for(;ht(o)&&!Ot(o);){let e=kt(o),t=Tt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=jt(o)}return t.set(e,r),r}function La(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?bt(t)?[]:Ia(t,this._c):[].concat(n),r],o=Fa(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Fa(t,a[e],i);s=Pn(n.top,s),c=Nn(n.right,c),l=Nn(n.bottom,l),u=Pn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ra(e){let{width:t,height:n}=ba(e);return{width:t,height:n}}function za(e,t,n){let r=gt(t),i=pt(t),a=n===`fixed`,o=Ea(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ln(0);if((r||!a)&&((dt(t)!==`body`||vt(i))&&(s=At(t)),r)){let e=Ea(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Da(i));let l=i&&!r&&!a?Oa(i,s):Ln(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ba(e){return kt(e).position===`static`}function Va(e,t){if(!gt(e)||kt(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return pt(e)===n&&(n=n.ownerDocument.body),n}function Ha(e,t){let n=ft(e);if(bt(e))return n;if(!gt(e)){let t=jt(e);for(;t&&!Ot(t);){if(ht(t)&&!Ba(t))return t;t=jt(t)}return n}let r=Va(e,t);for(;r&&yt(r)&&Ba(r);)r=Va(r,t);return r&&Ot(r)&&Ba(r)&&!Tt(r)?n:r||Et(e)||n}var Ua=async function(e){let t=this.getOffsetParent||Ha,n=this.getDimensions,r=await n(e.floating);return{reference:za(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wa(e){return kt(e).direction===`rtl`}var Ga={convertOffsetParentRelativeRectToViewportRelativeRect:ka,getDocumentElement:pt,getClippingRect:La,getOffsetParent:Ha,getElementRects:Ua,getClientRects:Aa,getDimensions:Ra,getScale:Sa,isElement:ht,isRTL:Wa};function Ka(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qa(e,t,n){let r=null,i,a=pt(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=In(d),h=In(a.clientWidth-(u+f)),g=In(a.clientHeight-(d+p)),_=In(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Pn(0,Nn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ka(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ft(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ja(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=xa(e),u=i||a?[...l?Nt(l):[],...t?Nt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?qa(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ea(e):null;c&&g();function g(){let t=Ea(e);h&&!Ka(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ya=ga,Xa=_a,Za=pa,Qa=ya,$a=va,eo=(e,t,n)=>{let r=new Map,i=n??{},a={...Ga,...i.platform,_c:r};return fa(e,t,{...i,platform:a})},to=typeof document<`u`?_.useLayoutEffect:function(){};function no(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!no(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!no(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ro(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function io(e,t){let n=ro(e);return Math.round(t*n)/n}function ao(e){let t=_.useRef(e);return to(()=>{t.current=e}),t}function q(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);no(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=ao(c),O=ao(i),k=ao(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),eo(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!no(T.current,t)&&(T.current=t,Pi.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);to(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);to(()=>(j.current=!0,()=>{j.current=!1}),[]),to(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=io(N.floating,u.x),r=io(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ro(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var oo=(e,t)=>{let n=Ya(e);return{name:n.name,fn:n.fn,options:[e,t]}},so=(e,t)=>{let n=Xa(e);return{name:n.name,fn:n.fn,options:[e,t]}},co=(e,t)=>({fn:$a(e).fn,options:[e,t]}),lo=(e,t)=>{let n=Za(e);return{name:n.name,fn:n.fn,options:[e,t]}},uo=(e,t)=>{let n=Qa(e);return{name:n.name,fn:n.fn,options:[e,t]}},fo=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),po=o(((e,t)=>{t.exports=fo()})),mo=o((e=>{var t=u(),n=po();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ho=o(((e,t)=>{t.exports=mo()})),go=[],_o=void 0;function vo(){return _o}function yo(e){go.push(e)}var bo=po(),xo=c(ho(),1),So=ri(19)?To:Eo;function Co(e,t,n,r,i){return So(e,t,n,r,i)}function wo(e,t,n,r,i){let a=_.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,bo.useSyncExternalStore)(e.subscribe,a,a)}yo({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,bo.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function To(e,t,n,r,i){let a=vo();if(!a)return wo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Eo(e,t,n,r,i){return(0,xo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Do=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Co(this,e,t,n,r)}},Oo=class extends Do{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){_.useDebugValue(e);let n=this;W(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;W(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;W(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){_.useDebugValue(e);let n=this,r=t!==void 0;W(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return _.useDebugValue(e),Co(this,this.selectors[e],t,n,r)}useContextCallback(e,t){_.useDebugValue(e);let n=Sn(t??Le);this.context[e]=n}useStateSetter(e){let t=_.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},ko={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Ao=class extends Oo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Bi(),nested:n,triggerElements:i},ko),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&<(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function jo(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=_.useRef(null);r===void 0&&f.current===null&&(f.current=new Ao({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),W(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ht(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Mo(e,t=!1,n=!1){let[r,i]=_.useState(e&&t?`idle`:void 0),[a,o]=_.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),W(()=>{if(!e&&a&&r!==`ending`&&n){let e=Dn.request(()=>{i(`ending`)});return()=>{Dn.cancel(e)}}},[e,a,r,n]),W(()=>{if(!e||t)return;let n=Dn.request(()=>{i(void 0)});return()=>{Dn.cancel(n)}},[t,e]),W(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Dn.request(()=>{i(`idle`)});return()=>{Dn.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function No(e,t=!1){let n=On();return Sn((r,i=null)=>{n.cancel();let a=Yi(e);if(a==null)return;let o=a,s=()=>{Pi.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function Po(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Sn(i),o=No(r,n);_.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Fo={tabIndex:-1,[Ft]:``};function Io(e){return t=>t!==`touch`||e.current}function Lo(e,t=!1){let n=$r(),r=Wi()!=null,i=Ie(()=>e(n,r)).current;return jo({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ro({handle:e,store:t}){return W(()=>e.attachStore(t),[e,t]),null}function zo(e,t){let n=_.useRef(null),r=_.useRef(null);return _.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Bo(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Vo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ho(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=zo(e,n),o=Sn(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=_.useCallback(e=>{a(e),e&&o(e)},[a,o]);return W(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Uo(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=_.useRef(null),i=e.useState(`open`);W(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=on(Zt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Wo(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Mo(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Sn(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Po({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Go(e,t){e.useSyncedValues(t),W(()=>()=>{e.update({activeTriggerProps:ze,inactiveTriggerProps:ze,popupProps:ze})},[e])}function Ko(e,t){W(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),W(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var qo=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Jo(){return new Ao({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new qo,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Yo(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Jo(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ze,inactiveTriggerProps:ze,popupProps:ze}}function Xo(e,t,n=!1){return new Ao({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var Zo=e=>e.triggerIdProp??e.activeTriggerId,Qo=e=>e.openProp??e.open,$o=e=>(e.popupElement?.id??e.floatingId)||void 0;function es(e,t){return t!==void 0&&Qo(e)&&Zo(e)===t}function ts(e,t){return es(e,t)?!0:t!==void 0&&Qo(e)&&Zo(e)==null&&e.triggerCount===1}var ns={open:Qo,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Zo,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:$o,isTriggerActive:(e,t)=>t!==void 0&&Zo(e)===t,isOpenedByTrigger:(e,t)=>es(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Zo(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ts(e,t)?$o(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function rs(e){let t=_.useCallback(t=>e===void 0?Le:e.subscribeStore(t),[e]),n=_.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,bo.useSyncExternalStore)(t,n,()=>e?.serverStore)}function is(e){return as(e,e.rootContext)}function as(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=_.useState(null),[d,f]=_.useState(void 0),[p,m]=_.useState(void 0),h=_.useRef(null),g=Gi(r),v=_.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=q({...e,elements:{...v,...l&&{reference:l}}}),b=ht(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=_.useCallback(e=>{let t=ht(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=_.useCallback(e=>{(ht(e)||e===null)&&(h.current=e,f(e)),(ht(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!ht(e))&&y.refs.setReference(e)},[y.refs,f]),w=_.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=_.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=_.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=_.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return W(()=>{o&&(h.current=o)},[o]),W(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),_.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var os=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new He,this.restTimeout=new He,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ss=new WeakMap;function cs(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ss.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ss.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function ls(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ss.get(n);a&&a!==e&&cs(a),cs(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ss.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function us(e){let t=e.context.dataRef.current,n=Ie(()=>t.hoverInteractionState??os.create()).current;return t.hoverInteractionState||=n,Be(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ds(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=Gi(),d=Wi(),f=us(a),p=Ue(),m=Sn(()=>Yt(l.current.openEvent?.type,f.interactedInside)),h=Sn(()=>Xt(l.current.openEvent?.type)),g=Sn(()=>{cs(f)});W(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),_.useEffect(()=>g,[g]),W(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&ht(c)&&s){let e=c,t=s,n=kn(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return ls(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),_.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Nr(u.nodesRef.current,d).length>0)}function t(e){let t=qt(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,on($t,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Rt(e);if(!Ut(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(zt(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&ht(o)&&Nr(u.nodesRef.current,r,!1).some(e=>G(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,on($t,t)),u.events.emit(`floating.closed`,t)})}let y=s;return un(y&&ln(y,`mouseenter`,c),y&&ln(y,`mouseleave`,_),y&&ln(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var fs={current:null};function ps(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=fs,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:v}=h.context,y=Gi(l),b=us(h),x=_.useRef(!1),S=_n(i),C=_n(r),w=_n(o),T=_n(n),E=_n(p),D=_n(f),O=Sn(()=>Yt(g.current.openEvent?.type,b.interactedInside)),k=Sn(()=>E.current?.()!==!1),A=Sn((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!G(e,t);if(!ht(n))return!1;let i=n;return r.hasMatchingElement(e=>G(e,i))&&(!e||!G(e,i))}),j=Sn(()=>{b.handler&&=(kn(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=Sn(()=>{cs(b)});return u&&(b.handleCloseOptions=S.current?.__options),_.useEffect(()=>j,[j]),_.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===$t,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,j]),_.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=qt(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,on($t,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,on($t,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!ht(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!ct(b.pointerType))return;let t=Jt(w.current),n=qt(C.current,`open`,b.pointerType),r=Rt(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(ht(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(G(e,r)){s=e;break}}ht(i)&&ht(o)&&!h.context.triggerElements.hasElement(i)&&G(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&ht(s)&&ht(o)&&G(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,on($t,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,on($t,e,s))}):g&&k()&&h.setOpen(!0,on($t,e,s)))}function i(t){if(O()){M();return}j();let n=kn(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!zt(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!G(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){G(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?ln(t,`mouseout`,o):void 0;return s?un(ln(t,`mousemove`,r,{once:!0}),ln(t,`mouseenter`,r),ln(t,`mouseleave`,i),l):un(ln(t,`mouseenter`,r),ln(t,`mouseleave`,i),l)},[j,M,g,C,h,n,S,b,u,A,O,a,s,w,c,y,T,d,D,k,m]),_.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!ct(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;ls(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Jt(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=h.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,on($t,t,n))}b.pointerType===`touch`?Pi.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var ms=.1,hs=ms*ms,gs=.5;function _s(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function vs(e,t,n,r,i,a,o,s,c,l){let u=!1;return _s(e,t,n,r,i,a)&&(u=!u),_s(e,t,i,a,o,s)&&(u=!u),_s(e,t,o,s,c,l)&&(u=!u),_s(e,t,c,l,n,r)&&(u=!u),u}function ys(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function bs(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function xs(e={}){let{blockPointerEvents:t=!1}=e,n=new He,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*hs;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Rt(r),g=r.type===`mouseleave`,_=G(u,h),v=G(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ht(r.relatedTarget)&&G(u,r.relatedTarget))return;function y(){return!!(s&&Nr(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=bs(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=bs(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=bs(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=bs(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!ys(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?gs/2:gs*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+gs+1,o=C||T?S.bottom-gs:S.top,s=C?T?S.bottom-gs:S.top:S.bottom-gs;M=vs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?gs/2:gs*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-gs,o=C||T?S.top+gs:S.bottom,s=C?T?S.top+gs:S.bottom:S.top+gs;M=vs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?gs/2:gs*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+gs+1,o=w||E?S.right-gs:S.left,s=w?E?S.right-gs:S.left:S.right-gs;M=vs(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?gs/2:gs*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-gs,o=w||E?S.left+gs:S.right,s=w?E?S.left+gs:S.right:S.left+gs;M=vs(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Ss=_.createContext(void 0);function Cs(e){let t=_.useContext(Ss);if(t===void 0&&!e)throw Error(ti(47));return t}var ws={...ns,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Ts=class extends Oo{constructor(e,t,n){let r=new qo;super(Es(e,r,t,n),Ds(r),ws)}setOpen=(e,t)=>{let n=t.reason===$t,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Vo(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};Bo(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Pi.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Es(e,t,n,r=!1){let i={...Yo(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i.floatingRootContext=Xo(t,n,r),i}function Ds(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),stickIfOpenTimeout:new He,triggerElements:e}}function Os({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=As(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Ko(u,d),Uo(u);let{forceUnmount:m}=Wo(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),_.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),_.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,on(an))}),[m,u]);let h=d||f;return(0,K.jsxs)(Ss.Provider,{value:u,children:[s&&(0,K.jsx)(Ro,{handle:s,store:u}),h&&(0,K.jsx)(js,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function ks(e){return Cs(!0)?(0,K.jsx)(Os,{props:e}):(0,K.jsx)(Ji,{children:(0,K.jsx)(Os,{props:e})})}function As(e,t){let n=Lo((e,n)=>new Ts(t,e,n));return _.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function js({store:e,modal:t}){let n=ca(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Go(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var Ms=_.createContext(void 0);function Ns(e=!1){let t=_.useContext(Ms);if(t===void 0&&!e)throw Error(ti(16));return t}function Ps(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:_.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Fs(e,t,{detail:n=0}={}){e.dispatchEvent(new(ft(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Is(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=_.useRef(null),s=Ns(!0),c=a??s!==void 0,{props:l}=Ps({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=_.useCallback(()=>{let e=o.current;Ls(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return W(u,[u]),{getButtonProps:_.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ui({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(xi(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Ls(r),s=!i&&Rs(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Fs(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Fs(r,e)))},onKeyUp(e){if(!t){if(xi(e),a?.(e),e.target===e.currentTarget&&i&&c&&Ls(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Fs(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Sn(e=>{o.current=e,u()})}}function Ls(e){return gt(e)&&e.tagName===`BUTTON`}function Rs(e){return gt(e)&&e.tagName===`A`&&!!e.href}var zs=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Bs={"data-starting-style":``},Vs={"data-ending-style":``},Hs={transitionStatus(e){return e===`starting`?Bs:e===`ending`?Vs:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=zs.startingStyle]=`startingStyle`,e[e.endingStyle=zs.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var Us={"data-popup-open":``},Ws={"data-popup-open":``,"data-pressed":``},Gs={"data-open":``},Ks={"data-closed":``},qs={"data-anchor-hidden":``},Js={open(e){return e?Us:null}},Ys={open(e){return e?Ws:null}},Xs={open(e){return e?Gs:Ks},anchorHidden(e){return e?qs:null}},Zs={...Xs,...Hs};function Qs(e){return $r(e,`base-ui`)}function $s(e,t){let n=_.useRef(null);function r(t){Pi.flushSync(()=>{e.setOpen(!1,on(nn,t.nativeEvent,t.currentTarget))}),kr(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Ar(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Pi.flushSync(()=>{e.setOpen(!1,on(nn,n.nativeEvent,n.currentTarget))});let i=Or(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&G(r,i);){let e=i;if(i=Tr(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function ec(e){let t=_.useRef(``),n=_.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:_.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function tc(e,t){let{onClick:n,onPointerDown:r}=ec(Sn((n,r)=>{(typeof e==`function`?e():e)||t(r||(Xe?`touch`:``))}));return _.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var nc=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=Cs(!0),h=rs(s)??m;if(!h)throw Error(ti(74));let g=Qs(f),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=_.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Ho(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=ps(y,{enabled:!a&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:xs(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=aa(y,{stickIfOpen:E}),j=tc(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=Is({disabled:a,native:o}),F={open(e){return e&&T===`trigger-press`?Ys.open(e):Js.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=$s(h,S),z=wi(`button`,e,{state:{disabled:a,open:b},ref:[P,t,C,S],props:[A.reference,k,M,j,{[ji]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,N],stateAttributesMapping:F}),ee=(0,K.jsx)(_.Fragment,{children:z},g);return w&&!O?(0,K.jsxs)(_.Fragment,{children:[(0,K.jsx)(Mn,{ref:I,onFocus:L}),ee,(0,K.jsx)(Mn,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):ee}),rc=_.createContext(void 0);function ic(){let e=_.useContext(rc);if(e===void 0)throw Error(ti(45));return e}var ac=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Cs().useState(`mounted`)||n?(0,K.jsx)(rc.Provider,{value:n,children:(0,K.jsx)(zi,{ref:t,...r})}):null});function oc(e){return ri(19)?e:e?`true`:void 0}var sc=_.createContext(void 0);function cc(){let e=_.useContext(sc);if(!e)throw Error(ti(46));return e}var lc=_.createContext(void 0);function uc(){return _.useContext(lc)?.direction??`ltr`}var dc=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Bn(e,t)||{};if(l==null)return{};let f=ir(u),p={x:n,y:r},m=Kn(i),h=Wn(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=zn(k,j,A),N=!c.arrow&&Hn(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),fc=(e,t)=>({...dc(e),options:[e,t]}),pc={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},mc={sideX:`left`,sideY:`top`},hc=`--available-width`,gc=`--available-height`;function _c(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function vc(e,t,n){let{rects:r,placement:i}=e;return{side:_c(t,Vn(i),n),align:Hn(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function yc(e){return bc(e,is)}function bc(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=_.useState(null);!g&&w!==null&&T(null);let E=v.side||`flip`,D=v.align||`flip`,O=v.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=Sn(j),N=j?M:n,P=_n(n),F=_n(g),I=uc()===`rtl`,L=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let ee=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),H=+(i===`left`),te={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},U=_.useRef(null),ne=_n(a),re=_n(s),ie=typeof a==`function`?0:a,ae=typeof s==`function`?0:s,oe=[];p&&oe.push(p),oe.push(oo(e=>{let t=vc(e,i,I),n=typeof ne.current==`function`?ne.current(t):ne.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ie,ae,I,i]));let se=D===`none`&&E!==`shift`,ce=!se&&(u||k||E===`shift`),le=E===`none`?null:lo({...te,padding:{top:z.top+1+ee,right:z.right+1+H,bottom:z.bottom+1+B,left:z.left+1+V},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),ue=se?null:so({...te,rootBoundary:A,mainAxis:D!==`none`,crossAxis:ce,limiter:u||k?void 0:co(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=Gn(Vn(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[te,u,k,A,z,D]);E===`shift`||D===`shift`||o===`center`?oe.push(ue,le):oe.push(le,ue),oe.push(uo({...te,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(hc,`${t}px`),i.setProperty(gc,`${n}px`);let a=ft(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),fc(e=>({element:U.current||kn(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Vn(r),l=Gn(c),u=U.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(vc(e,i,I)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ce&&l===`y`&&b?S:x),{}}},pc,x),W(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let de=_.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:fe,elements:pe,x:me,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:oe,strategy:r,whileElementsMounted:m?void 0:(...e)=>Ja(...e,de),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||mc,we=be?r:`fixed`,Te=_.useMemo(()=>{let e;return e=be?x?{position:we,[Se]:me,[Ce]:he}:{...xe,position:we}:{position:we,top:0,left:0},e[hc]=`100vw`,e[gc]=`100vh`,be||(e.opacity=0),e},[x,we,Se,me,Ce,he,xe,be]),Ee=_.useRef(null);W(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(xc(t)?t.current:t)||null;n!==Ee.current&&(fe.setPositionReference(n),Ee.current=n)},[g,fe,N,P]),_.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&xc(e)&&e.current!==Ee.current&&(fe.setPositionReference(e.current),Ee.current=e.current)},[g,fe,N,P]),_.useEffect(()=>{if(m&&g&&pe.reference&&pe.floating)return Ja(pe.reference,pe.floating,_e,de)},[m,g,pe,_e,de]);let De=Vn(ve),Oe=_c(i,De,I),ke=Hn(ve)||`center`,Ae=!!ge.hide?.referenceHidden;W(()=>{S&&g&&be&&De!==L&&T(De)},[S,g,be,De,L]);let je=_.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:U,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:fe,context:ye,isPositioned:be,update:_e}),[Te,je,U,Me,Oe,ke,De,Ae,fe,ye,be,_e])}function xc(e){return e!=null&&`current`in e}var Sc=_.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,K.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Cc(e){return e===`starting`?Ai:ze}function wc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),wi(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Cc(r),i],stateAttributesMapping:Xs})}var Tc={},Ec={},Dc=``;function Oc(e,t){return vt(e)?e:t}function kc(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Oc(t,n)).overflowY)}function Ac(e){if(typeof document>`u`)return!1;let t=kn(e);return ft(t).innerWidth-t.documentElement.clientWidth>0}function jc(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=kn(e),n=t.documentElement,r=t.body,i=Oc(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Mc(e){let t=kn(e),n=t.documentElement,r=t.body,i=Oc(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Nc(e){let t=kn(e),n=t.documentElement,r=t.body,i=ft(n),a=0,o=0,s=!1,c=Dn.create();if(tt&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Tc={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Dc=n.style.scrollBehavior,Ec={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Oc(n,r);if(s=jc(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Tc),Object.assign(r.style,Ec),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Dc)}function d(){u(),c.request(l)}l();let f=ln(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Pc=new class{lockCount=0;restore=null;timeoutLock=He.create();timeoutUnlock=He.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=kn(e),n=t.documentElement,r=t.body,i=ft(n);if(kc(i,n,r)){let t=new i.MutationObserver(()=>{kc(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Xe||!Ac(e);this.restore=a?Mc(e):Nc(e)}};function Fc(e=!0,t=null){W(()=>{if(e)return Pc.acquire(t)},[e,t])}var Ic=20;function Lc(e,t,n,r){let[i,a]=_.useState(!1);W(()=>{if(!e||!t||n==null){a(!1);return}let r=kn(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Ic)},[e,t,n]),Fc(e&&(!t||i),r)}var Rc=_.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Mi,...v}=e,y=Cs(),b=ic(),x=Ki(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`positionerElement`),A=y.useState(`instantType`),j=y.useState(`transitionStatus`),M=y.useState(`adaptiveOrigin`),N=_.useRef(null),P=No(k),F=yc({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:b,nodeId:x,collisionAvoidance:g,adaptiveOrigin:M}),I=S.useState(`domReferenceElement`);W(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return P(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,y]);let L=D===!0&&T!==`trigger-hover`;Lc(w&&L,O===`touch`,k,E);let R=y.useStateSetter(`positionerElement`),z=wc(e,{open:w,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:v,refs:[t,R],hidden:!C,inert:!w});return(0,K.jsxs)(sc.Provider,{value:F,children:[C&&L&&(0,K.jsx)(Sc,{inert:oc(!w),cutout:E}),(0,K.jsx)(qi,{id:x,children:z})]})}),zc=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Bc=_.createContext(void 0);function Vc(e){let t=_.useContext(Bc);if(t===void 0&&!e)throw Error(ti(69));return t}var Hc=_.createContext(void 0);function Uc(){let[e,t]=_.useState(0),n=Sn(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:_.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Wc=_.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Cs(),l=cc(),u=Vc(!0)!=null,{context:d,hasClosePart:f}=Uc(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Po({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),ds(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Io(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=wi(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Fo,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&zc.has(e.key)&&e.stopPropagation()}},Cc(g),s],stateAttributesMapping:Zs});return(0,K.jsx)(ia,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:gt(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,K.jsx)(Hc.Provider,{value:d,children:M})})});function Gc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Gc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Kc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Gc(e))&&(r&&(r+=` `),r+=t);return r}var qc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Jc=(e,t)=>({classGroupId:e,validator:t}),Yc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Xc=`-`,Zc=[],Qc=`arbitrary..`,$c=e=>{let t=nl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return tl(e);let n=e.split(Xc);return el(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?qc(i,t):t:i||Zc}return n[e]||Zc}}},el=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=el(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Xc):e.slice(t).join(Xc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},tl=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Qc+r:void 0})(),nl=e=>{let{theme:t,classGroups:n}=e;return rl(n,t)},rl=(e,t)=>{let n=Yc();for(let r in e){let i=e[r];il(i,n,r,t)}return n},il=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];al(i,t,n,r)}},al=(e,t,n,r)=>{if(typeof e==`string`){ol(e,t,n);return}if(typeof e==`function`){sl(e,t,n,r);return}cl(e,t,n,r)},ol=(e,t,n)=>{let r=e===``?t:ll(t,e);r.classGroupId=n},sl=(e,t,n,r)=>{if(ul(e)){il(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Jc(n,e))},cl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];il(o,ll(t,a),n,r)}},ll=(e,t)=>{let n=e,r=t.split(Xc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Yc(),n.nextPart.set(t,i)),n=i}return n},ul=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,dl=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},fl=`!`,pl=`:`,ml=[],hl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),gl=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===pl){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(fl)?(c=s.slice(0,-1),l=!0):s.startsWith(fl)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return hl(t,l,c,u)};if(t){let e=t+pl,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):hl(ml,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},_l=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},vl=e=>({cache:dl(e.cacheSize),parseClassName:gl(e),sortModifiers:_l(e),postfixLookupClassGroupIds:yl(e),...$c(e)}),yl=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},bl=/\s+/,xl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(bl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+fl:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Sl=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Cl(n))&&(i&&(i+=` `),i+=r);return i},Cl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Cl(e[r]))&&(n&&(n+=` `),n+=t);return n},wl=(e,...t)=>{let n,r,i,a,o=o=>(n=vl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=xl(e,n);return i(e,a),a};return a=o,(...e)=>a(Sl(...e))},Tl=[],El=e=>{let t=t=>t[e]||Tl;return t.isThemeGetter=!0,t},Dl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ol=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Al=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Nl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fl=e=>kl.test(e),J=e=>!!e&&!Number.isNaN(Number(e)),Y=e=>!!e&&Number.isInteger(Number(e)),Il=e=>e.endsWith(`%`)&&J(e.slice(0,-1)),X=e=>Al.test(e),Ll=()=>!0,Rl=e=>jl.test(e)&&!Ml.test(e),zl=()=>!1,Bl=e=>Nl.test(e),Vl=e=>Pl.test(e),Hl=e=>!Z(e)&&!Q(e),Ul=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Wl=e=>au(e,lu,zl),Z=e=>Dl.test(e),Gl=e=>au(e,uu,Rl),Kl=e=>au(e,du,J),ql=e=>au(e,pu,Ll),Jl=e=>au(e,fu,zl),Yl=e=>au(e,su,zl),Xl=e=>au(e,cu,Vl),Zl=e=>au(e,mu,Bl),Q=e=>Ol.test(e),Ql=e=>ou(e,uu),$l=e=>ou(e,fu),eu=e=>ou(e,su),tu=e=>ou(e,lu),nu=e=>ou(e,cu),ru=e=>ou(e,mu,!0),iu=e=>ou(e,pu,!0),au=(e,t,n)=>{let r=Dl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ou=(e,t,n=!1)=>{let r=Ol.exec(e);return r?r[1]?t(r[1]):n:!1},su=e=>e===`position`||e===`percentage`,cu=e=>e===`image`||e===`url`,lu=e=>e===`length`||e===`size`||e===`bg-size`,uu=e=>e===`length`,du=e=>e===`number`,fu=e=>e===`family-name`,pu=e=>e===`number`||e===`weight`,mu=e=>e===`shadow`,hu=wl(()=>{let e=El(`color`),t=El(`font`),n=El(`text`),r=El(`font-weight`),i=El(`tracking`),a=El(`leading`),o=El(`breakpoint`),s=El(`container`),c=El(`spacing`),l=El(`radius`),u=El(`shadow`),d=El(`inset-shadow`),f=El(`text-shadow`),p=El(`drop-shadow`),m=El(`blur`),h=El(`perspective`),g=El(`aspect`),_=El(`ease`),v=El(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[Fl,`full`,`auto`,...w()],E=()=>[Y,`none`,`subgrid`,Q,Z],D=()=>[`auto`,{span:[`full`,Y,Q,Z]},Y,Q,Z],O=()=>[Y,`auto`,Q,Z],k=()=>[`auto`,`min`,`max`,`fr`,Q,Z],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Fl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Fl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Fl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Q,Z],L=()=>[...b(),eu,Yl,{position:[Q,Z]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,tu,Wl,{size:[Q,Z]}],ee=()=>[Il,Ql,Gl],B=()=>[``,`none`,`full`,l,Q,Z],V=()=>[``,J,Ql,Gl],H=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[J,Il,eu,Yl],ne=()=>[``,`none`,m,Q,Z],re=()=>[`none`,J,Q,Z],ie=()=>[`none`,J,Q,Z],ae=()=>[J,Q,Z],oe=()=>[Fl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[X],breakpoint:[X],color:[Ll],container:[X],"drop-shadow":[X],ease:[`in`,`out`,`in-out`],font:[Hl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[X],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[X],shadow:[X],spacing:[`px`,J],text:[X],"text-shadow":[X],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Fl,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[Ul],columns:[{columns:[J,Z,Q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Y,`auto`,Q,Z]}],basis:[{basis:[Fl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[J,Fl,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,J,Q,Z]}],shrink:[{shrink:[``,J,Q,Z]}],order:[{order:[Y,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Ql,Gl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,iu,ql]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Il,Z]}],"font-family":[{font:[$l,Jl,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[J,`none`,Q,Kl]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[J,`from-font`,`auto`,Q,Gl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[J,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Y,Q,Z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Y,Q,Z],radial:[``,Q,Z],conic:[Y,Q,Z]},nu,Xl]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[J,Q,Z]}],"outline-w":[{outline:[``,J,Ql,Gl]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,ru,Zl]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,ru,Zl]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[J,Gl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,ru,Zl]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[J,Q,Z]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[J]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[J]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:ne()}],brightness:[{brightness:[J,Q,Z]}],contrast:[{contrast:[J,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ru,Zl]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,J,Q,Z]}],"hue-rotate":[{"hue-rotate":[J,Q,Z]}],invert:[{invert:[``,J,Q,Z]}],saturate:[{saturate:[J,Q,Z]}],sepia:[{sepia:[``,J,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[J,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[J,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,J,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[J,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,J,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[J,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[J,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,J,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[J,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[J,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Y,Q,Z]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[J,Ql,Gl,Kl]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function gu(...e){return hu(Kc(e))}function _u({...e}){return(0,K.jsx)(ks,{"data-slot":`popover`,...e})}function vu({...e}){return(0,K.jsx)(nc,{"data-slot":`popover-trigger`,...e})}function yu({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,K.jsx)(ac,{children:(0,K.jsx)(Rc,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,K.jsx)(Wc,{"data-slot":`popover-content`,className:gu(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-2.5 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-72 origin-(--transform-origin) outline-hidden`,e),...a})})})}var bu=(e,t)=>e==null?null:`${e}:${t??``}`,xu={irreversible:`hard to undo`,touches_project_data:`changes project files`,touches_secrets:`touches secrets`,network_egress:`sends data out`,beyond_intent:`did more than asked`,steering_text:`text addresses the reviewer`},Su=.7;function Cu({severity:e,flags:t}){if(!e)return(0,K.jsx)(`span`,{className:`exec-muted`,children:`—`});let n=e.jev,r=e.floor>0&&e.floor===e.level&&(!n||Math.round(n.score)<e.floor),i=!!n&&(n.confidence??0)<Su,a=[`none`,`low`,`high`,`severe`],o=Object.entries(t??{});return(0,K.jsxs)(_u,{children:[(0,K.jsxs)(vu,{className:`severity-badge severity-${e.level} rt-sev`,children:[e.label,i?`?`:``,r?` (rule)`:``]}),(0,K.jsxs)(yu,{className:`rt-sev-pop`,align:`end`,children:[(0,K.jsxs)(`strong`,{children:[e.label,r?`, set by a rule`:``]}),e.rule&&(0,K.jsxs)(`p`,{children:[`Rule: `,e.rule]}),n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`p`,{children:[`Jev: `,n.score.toFixed(2),` of 3, `,Math.round((n.confidence??0)*100),`% confident`]}),n.probabilities&&(0,K.jsx)(`ul`,{className:`rt-dist`,children:a.map((e,t)=>{let r=n.probabilities?.[String(t)]??0;return(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{children:e}),(0,K.jsx)(`i`,{children:(0,K.jsx)(`b`,{className:`severity-${t}`,style:{width:`${Math.round(r*100)}%`}})}),(0,K.jsx)(`em`,{children:r.toFixed(2)})]},e)})})]}):(0,K.jsx)(`p`,{children:`Jev did not rate this command.`}),o.length>0&&(0,K.jsxs)(`p`,{children:[`Flags: `,o.map(([e,t])=>`${xu[e]??e}${Number.isFinite(Number(t))?` ${Number(t).toFixed(2)}`:``}`).join(`, `)]})]})]})}function wu(e){let t=[];return e.preamble&&t.push(`${e.preamble} env preamble${e.preamble>1?`s`:``} (${e.preambleChars.toLocaleString()} chars)`),e.reexec&&t.push(`${e.reexec} re-exec${e.reexec>1?`s`:``}`),e.machinery&&t.push(`${e.machinery} harness process${e.machinery>1?`es`:``} (the agent's own startup and RayTrace's hook)`),e.exits&&t.push(`${e.exits} exit row${e.exits>1?`s`:``}`),t.join(`, `)}function Tu(e,t,n){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{if(!e)return;let r=!1,a,c=new AbortController,l=async()=>{try{let a=`${t?`&since=${t}`:``}${n?`&until=${n}`:``}`,l=await x().fetch(`/raytace/runtime?sandbox=${encodeURIComponent(e)}${a}${s?`&raw=1`:``}`,{signal:c.signal}),u=await l.json();if(!l.ok)throw Error(u.error||`Runtime evidence unavailable`);r||(i(u),o(``))}catch(e){r||o(e instanceof Error?e.message:`Runtime evidence unavailable`)}!r&&!n&&(a=setTimeout(l,3e3))};return i(null),l(),()=>{r=!0,c.abort(),clearTimeout(a)}},[e,t,n,s]),{data:r,error:a,raw:s,setRaw:c}}function Eu(e){if(e==null||!Number.isFinite(e))return`—`;let t=new Date(e),n=(e,t=2)=>String(e).padStart(t,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}.${n(t.getMilliseconds(),3)}`}var Du=e=>e?Date.parse(e):NaN;function Ou(e){return e<1e3?`${Math.max(0,Math.round(e))}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}var ku=e=>e?Number(BigInt(e)/BigInt(1e6)):NaN;function Au({text:e}){let t=e.replace(/\s*\n\s*/g,` ⏎ `);return(0,K.jsx)(`code`,{className:`exec-cmd`,title:e,children:t})}var ju="The program reported success. That is not proof it did what was intended: `rm -f` also succeeds when there was nothing to delete.",Mu={1:[`Failed`,`A general error — the most common failure code.`],2:[`Failed`,`Usually a wrongly used command or invalid arguments.`],126:[`Couldn't run`,`The file exists but is not executable (a permission problem).`],127:[`Couldn't run`,`Command not found.`],130:[`Interrupted`,`Stopped by an interrupt (Ctrl-C).`],137:[`Killed`,`Forcibly killed — often out of memory or a timeout.`],143:[`Stopped`,`Asked to terminate.`]},Nu={2:[`Interrupted`,`Stopped by an interrupt (Ctrl-C).`],6:[`Crashed`,`Aborted by the program itself.`],9:[`Killed`,`Forcibly killed — often out of memory or a timeout.`],11:[`Crashed`,`Crashed accessing invalid memory.`],15:[`Stopped`,`Asked to terminate.`]};function Pu({observed:e,status:t,exitCode:n=null,signal:r=null,error:i=null}){if(!e)return{label:`—`,code:null,tone:`muted`,title:`Nothing was observed for this call. Missing evidence is not proof it did not run.`};let a=i?.match(/^exec failed: errno (\d+)/)?.[1];if(a)return{label:`Couldn't start`,code:`errno ${a}`,tone:`fail`,title:`The program never launched: the attempt to start it failed.`};if(t===`running`)return{label:`Still running`,code:null,tone:`muted`,title:`The sandbox saw it start and has not seen it end yet.`};if(t===`unknown`||!t&&n==null&&!r)return{label:`Unknown`,code:i?.startsWith(`evidence lost`)?`evidence lost`:null,tone:`muted`,title:i?.startsWith(`evidence lost`)?`The sandbox stopped reporting before this ended (${i.slice(15)}). That is not proof it failed.`:`How this ended was not recorded.`};let o=r??Number(i?.match(/^killed by signal (\d+)/)?.[1]??NaN);if(Number.isFinite(o)&&o>0){let[e,t]=Nu[o]??[`Killed`,`Stopped by signal ${o}.`];return{label:e,code:`signal ${o}`,tone:`fail`,title:t}}let s=n??(i?.match(/^exit (\d+)$/)?Number(i.slice(5)):t===`completed`?0:null);if(s===0)return{label:`Succeeded`,code:`exit 0`,tone:`ok`,title:ju};if(s!=null){let[e,t]=Mu[s]??(s>128&&s<160?[`Killed`,`Stopped by signal ${s-128}.`]:[`Failed`,`The program's own error code.`]);return{label:e,code:`exit ${s}`,tone:`fail`,title:t}}return{label:`Failed`,code:null,tone:`fail`,title:i||`The program reported a failure.`}}function Fu({outcome:e}){return(0,K.jsxs)(`span`,{title:e.title,children:[e.label,e.code&&(0,K.jsxs)(`span`,{className:`exec-code`,children:[` `,e.code]})]})}var Iu=`https://raytracer.si/reading-a-trace.html`,Lu={read:`Read`,search:`Search`,write:`Write`,edit:`Edit`,delete:`Delete / move`,run:`Run`,test:`Test`,build:`Build / install`,git:`Git`,web:`Web`,plan:`Plan`,delegate:`Delegate`,unsure:`Not sure`},Ru={ran:{id:`ran`,text:`✓ ran`,tone:`ok`,opens:`sandbox`},differs:{id:`differs`,text:`⚠ ran, differs`,tone:`warn`,opens:`sandbox`},rejected:{id:`rejected`,text:`✗ rejected`,tone:`fail`},not_seen:{id:`not_seen`,text:`— not seen`,tone:`none`},file_changed:{id:`file_changed`,text:`✓ file changed`,tone:`ok`,opens:`files`},no_change:{id:`no_change`,text:`✗ no change`,tone:`fail`,opens:`files`},in_agent:{id:`in_agent`,text:`in agent`,tone:`none`},not_covered:{id:`not_covered`,text:`not covered`,tone:`none`}},zu=new Set([`Write`,`Edit`,`MultiEdit`,`NotebookEdit`,`apply_patch`]),Bu=`/workspace`;function Vu(e){return!!e.sandboxId||(e.callVerifications??[]).some(e=>e.exec_id)}function Hu(e,t,n,r){if(t.exec_id)return t.reported_check&&t.reported_check!==`agrees`?Ru.differs:Ru.ran;if(n.state===`rejected`)return Ru.rejected;let i=Vu(e);if(t.kind!==`file`&&t.kind!==`agent`)return i?Ru.not_seen:Ru.not_covered;if(!zu.has(t.name))return Ru.in_agent;if(!i||!t.snapshot)return Ru.not_covered;if(r===null)return t.snapshot.changed?Ru.file_changed:n.state===`ok`?Ru.no_change:Ru.in_agent;if(r.startsWith(`/`)&&r!==Bu&&!r.startsWith(`${Bu}/`))return Ru.not_covered;let a=r.startsWith(`${Bu}/`)?r.slice(11):r.replace(/^\.\//,``),o=e=>e===a||e.endsWith(`/${a}`),s=(e.callVerifications??[]).filter(e=>e.exchange_id===t.exchange_id&&e.snapshot);return s.some(e=>e.snapshot.changes.some(e=>o(e.path)))?Ru.file_changed:s.some(e=>e.snapshot.too_big.some(o))?Ru.not_covered:n.state===`ok`?Ru.no_change:Ru.in_agent}function Uu(e,t){let n=e.events.find(e=>e.title.startsWith(`Tool call:`)&&e.exchange_id===t.exchange_id&&e.output_index===t.output_index);if(!n)return null;try{let e=JSON.parse(n.raw),t=e.arguments??e.input??``;for(let e=0;typeof t==`string`&&e<3;e+=1)try{t=JSON.parse(t)}catch{break}return t&&typeof t==`object`?t:{command:String(t)}}catch{return null}}function Wu(e){return[...e.matchAll(/"((?:\\.|[^"\\])*)"|'([^']*)'|(\S+)/g)].map(e=>e[1]??e[2]??e[3])}var Gu=e=>e.replace(/[`'"),;]+$/,``).split(`/`).filter(Boolean).pop()??``,Ku=e=>/\/|\.[A-Za-z0-9]{1,8}$/.test(e)&&!e.startsWith(`-`)&&!/^\d/.test(e);function qu(e){let t=e.replace(/\[([^\]^])[^\]]*\]/g,`$1`).split(/\\\||\||\s+/).map(e=>e.replace(/\\[bBdDsSwW]|[\\^$.*+?()[\]{}]/g,``).replace(/^[-_]+|[-_]+$/g,``)).filter(e=>e.length>=3);return{targets:t.map(e=>e.toLowerCase().replace(/[-_]/g,``)),display:t}}var Ju=new Set([`grep`,`egrep`,`rg`,`ag`,`ack`,`find`,`fd`]),Yu=new Set([`cat`,`head`,`tail`,`less`,`nl`,`wc`]),Xu=/^(?:npm (?:test|run test\S*)|pnpm (?:test|run test\S*)|yarn test\S*|node(?: \S+)* --test|pytest|vitest|jest|go test|cargo test)/;function Zu(e){let t=[],n=``,r=``,i=!1,a=()=>{n.trim()&&t.push(n.trim()),n=``,i=!1};for(let t=0;t<e.length;t+=1){let o=e[t];if(o===`\\`&&r!==`'`){i||(n+=o+(e[t+1]??``)),t+=1;continue}if(r){o===r&&(r=``),i||(n+=o);continue}if(o===`"`||o===`'`){r=o,i||(n+=o);continue}let s=e.slice(t,t+2);if(s===`&&`||s===`||`){a(),t+=1;continue}if(o===`;`||o===`
|
|
10
|
+
`){a();continue}if(o===`|`){i=!0;continue}i||(n+=o)}return a(),t}function Qu(e){for(let t of Zu(e)){let e=Wu(t);for(;e.length&&(/^(sudo|time|nice|env)$/.test(e[0])||/^\w+=/.test(e[0]));)e.shift();if(e[0]===`timeout`&&e.splice(0,e[1]&&/^\d/.test(e[1])?2:1),e.length&&e[0]!==`cd`&&e[0]!==`echo`)return e}return[]}function $u(e,t){let n={kind:`other`,targets:[],display:[],wide:!1},r=e=>typeof t?.[e]==`string`?t[e]:``,i=e=>/^(\/|~\/?|\$HOME\/?)$/.test(e.trim());if(e.name===`Grep`||e.name===`Glob`){let t=qu(e.name===`Glob`&&Gu(r(`pattern`))||r(`pattern`));return t.targets.length?{kind:`search`,...t,wide:i(r(`path`))}:n}if([`Read`,`NotebookRead`].includes(e.name)||[`Edit`,`Write`,`MultiEdit`,`NotebookEdit`].includes(e.name)){let t=Gu(r(`file_path`)||r(`notebook_path`));return t?{kind:e.name.includes(`Read`)?`read`:`edit`,targets:[t.toLowerCase()],display:[t],wide:!1}:n}let a=r(`command`)||r(`cmd`)||(e.name===`Bash`?e.proposed??``:``);if(!a)return n;let o=Qu(a),s=o[0]?.split(`/`).pop()??``,c=o.join(` `);if(Xu.test(c)){let e=c.match(Xu)[0].replace(/ --?\S+/g,``).trim();return{kind:`test`,targets:[e],display:[e],wide:!1}}if(Ju.has(s)||s===`git`&&o[1]===`grep`||s===`ls`&&o.some(e=>/^-\w*R/.test(e))){let e=o.slice(s===`git`?2:1),t=``,r=[];for(let n=0;n<e.length;n+=1){let i=e[n];if([`-e`,`--regexp`,`-name`,`-iname`,`-path`,`-g`,`--glob`].includes(i)){t||=e[n+1]??``,n+=1;continue}i.startsWith(`-`)||(!t&&s!==`find`&&s!==`fd`&&s!==`ls`?t=i:r.push(i))}s===`ls`&&(t=r.join(` `));let a=qu(t);return a.targets.length?{kind:`search`,...a,wide:r.some(i)}:n}let l=/\bsed\s+-i|(?:^|\s)(?:cat|echo|printf)\b[^|]*>\s*\S|\btee\b/.test(a);if(l||Yu.has(s)||s===`sed`&&o.includes(`-n`)){let e=[...new Set(Wu(a.split(/<<-?\s*['"]?\w+['"]?/)[0]).filter(Ku).map(Gu).filter(Boolean))];return e.length?{kind:l?`edit`:`read`,targets:e.map(e=>e.toLowerCase()),display:e,wide:!1}:n}return n}var ed=(e,t)=>e.some(e=>t.some(t=>e===t||Math.min(e.length,t.length)>=4&&(e.includes(t)||t.includes(e))));function td(e,t){let n=[];return t.forEach((t,r)=>{let i=$u(t,Uu(e,t)),a=t.category===void 0?i.kind===`other`?null:i.kind:t.category===`unsure`?null:t.category,o=n.at(-1),s=o?.calls.at(-1);if(o&&a&&o.kind===a&&ed(o.targets,i.targets)&&s&&Ne(e.events,s.call_id).state!==`rejected`){o.calls.push(t),o.targets=[...new Set([...o.targets,...i.targets])];for(let e of i.display)o.display.some(t=>t.toLowerCase()===e.toLowerCase())||o.display.push(e);i.wide&&(o.wide+=1)}else n.push({id:t.call_id,kind:a,calls:[t],first:r+1,targets:i.targets,display:[...i.display],wide:+!!i.wide})}),n.map(({targets:e,...t})=>t)}var nd={search:`Searched`,read:`Read`,write:`Wrote`,edit:`Edited`,delete:`Removed or moved`,web:`Fetched`};function rd(e,t){let n=e.calls.length,r=e.display.slice(0,3).join(`, `)+(e.display.length>3?`, …`:``),i=e.kind===`search`?`${nd.search} ${n} times for ${r}`:`${(e.kind&&nd[e.kind])??`Ran`} ${r} ${n} times`,a=e.calls.map(e=>Ne(t.events,e.call_id)),o=a.at(-1),s=o.output.trim()?o.output.trim().split(`
|
|
11
|
+
`).length:0,c=o.state===`failed`?`last: failed`:o.state===`rejected`?`last: refused`:s?`last: ${s} line${s===1?``:`s`}`:`last: no output`,l=a.filter(e=>e.state===`failed`).length,u=e.calls.reduce((e,t)=>e+(t.snapshot?.changed?t.snapshot.changes.length:0),0),d=[e.wide?`${e.wide} searched the whole filesystem`:``,l?`${l} failed`:``,u?`${u} file change${u===1?``:`s`}`:``].filter(Boolean),f=a.slice(0,-1),p=f.length>0&&f.every(e=>e.state===`failed`||e.state===`rejected`||!e.output.trim()),m=n>1?`Repeated ${n-1} time${n===2?``:`s`}${p?` because earlier attempts found nothing or failed`:`: each retry followed the previous attempt’s result`}.`:null;return{range:n>1?`#${e.first}–${e.first+n-1}`:`#${e.first}`,kind:e.kind?Lu[e.kind]:`Step`,label:i,outcome:c,flags:d,repeated:m}}var id=(e,t=!1)=>e===null?`Unavailable`:`${t?`≈ `:``}${e===0?`$0`:e<1e-6?`<$0.000001`:`$${e.toFixed(6)}`}`,ad=e=>e===null?`Unavailable`:`${(e/1e3).toFixed(2)} s`,od=e=>e===null?`—`:e.toLocaleString(),sd=_.createContext(void 0);function cd(e){let t=_.useContext(sd);if(!e&&t===void 0)throw Error(ti(27));return t}var ld=_.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=cd(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return wi(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Zs,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),ud=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=cd(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Is({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,on(tn,e.nativeEvent))}return wi(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),dd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=cd(),c=Qs(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),wi(`p`,e,{ref:t,props:[{id:c},o]})}),fd=_.createContext(void 0);function pd(){let e=_.useContext(fd);if(e===void 0)throw Error(ti(26));return e}var md={...Xs,...Hs,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},hd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=cd(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);pd(),Po({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Io(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=wi(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Fo,hidden:!m,onKeyDown(e){zc.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:md});return(0,K.jsx)(ia,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),gd=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=cd(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,K.jsx)(fd.Provider,{value:n,children:(0,K.jsxs)(zi,{ref:t,...r,children:[a&&o===!0&&(0,K.jsx)(Sc,{ref:i.context.internalBackdropRef,inert:oc(!s)}),e.children]})}):null});function _d({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=_.useState(0),[u,d]=_.useState(0),f=c===0,p=ca(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Rt(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||G(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Fc(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),W(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),Go(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var vd={...ns,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},yd=class extends Oo{constructor(e,t,n){let r=new qo,i=bd(e,r,t,n);super(i,xd(r),vd)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};Bo(n,e,t.trigger),this.update(n)}};function bd(e,t,n,r=!1){let i={...Yo(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=Xo(t,n,r),i}function xd(e){return{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Sd(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,v=m?`alertdialog`:`dialog`,y=cd(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:v},x=Lo((e,t)=>new yd({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);Ko(x,S),Uo(x);let{forceUnmount:T}=Wo(S,x);_.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,on(an))}),[T,x]);let E=S||C;return(0,K.jsxs)(sd.Provider,{value:x,children:[u&&(0,K.jsx)(Ro,{handle:u,store:x}),E&&(0,K.jsx)(_d,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}function Cd(e){return Sd(`dialog`,e)}var wd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=cd(),c=Qs(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),wi(`h2`,e,{ref:t,props:[{id:c},o]})}),Td=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=cd(!0),f=rs(l)??d;if(!f)throw Error(ti(79));let p=Qs(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),v=_.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Ho(p,v,f,{payload:c}),{getButtonProps:x,buttonRef:S}=Is({disabled:a,native:o}),C=aa(m),w=tc(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return wi(`button`,e,{state:T,ref:[S,t,y,v],props:[C.reference,E,w,{[ji]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:Js})}),Ed=_.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Is({disabled:i,focusableWhenDisabled:a,native:o});return wi(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Dd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Od=Kc,kd=((e,t)=>n=>{if(t?.variants==null)return Od(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Dd(t)||Dd(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Od(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Ad({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,K.jsx)(Ed,{"data-slot":`button`,className:gu(kd({variant:t,size:n,className:e})),...r})}function jd({...e}){return(0,K.jsx)(Cd,{"data-slot":`sheet`,...e})}function Md({...e}){return(0,K.jsx)(Td,{"data-slot":`sheet-trigger`,...e})}function Nd({...e}){return(0,K.jsx)(gd,{"data-slot":`sheet-portal`,...e})}function Pd({className:e,...t}){return(0,K.jsx)(ld,{"data-slot":`sheet-overlay`,className:gu(`bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0`,e),...t})}function Fd({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,K.jsxs)(Nd,{children:[(0,K.jsx)(Pd,{}),(0,K.jsxs)(hd,{"data-slot":`sheet-content`,"data-side":n,className:gu(`bg-popover text-popover-foreground fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem]`,e),...i,children:[t,r&&(0,K.jsxs)(ud,{"data-slot":`sheet-close`,render:(0,K.jsx)(Ad,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,K.jsx)(Te,{}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Id({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sheet-header`,className:gu(`gap-0.5 p-4 flex flex-col`,e),...t})}function Ld({className:e,...t}){return(0,K.jsx)(wd,{"data-slot":`sheet-title`,className:gu(`text-foreground text-base font-medium cn-font-heading`,e),...t})}function Rd({className:e,...t}){return(0,K.jsx)(dd,{"data-slot":`sheet-description`,className:gu(`text-muted-foreground text-sm`,e),...t})}function zd({className:e,size:t=`default`,...n}){return(0,K.jsxs)(`div`,{className:gu(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,K.jsx)(`select`,{"data-slot":`native-select`,"data-size":t,className:`border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed`,...n}),(0,K.jsx)(ee,{className:`text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function Bd({className:e,...t}){return(0,K.jsx)(`option`,{"data-slot":`native-select-option`,className:gu(`bg-[Canvas] text-[CanvasText]`,e),...t})}function Vd(e){try{return JSON.parse(e)}catch{return{}}}function Hd(e){return Array.isArray(e)?`[${e.map(Hd).join(`,`)}]`:e&&typeof e==`object`?`{${Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${JSON.stringify(e)}:${Hd(t)}`).join(`,`)}}`:JSON.stringify(e)??``}function Ud(e){return e.events.filter(e=>e.title.startsWith(`Tool call:`)).map(e=>{let t=Vd(e.raw),n=t.arguments??t.input??t.function?.arguments??``;if(typeof n==`string`)try{n=JSON.parse(n)}catch{}return{name:t.name??t.function?.name??e.title.slice(11),args:Hd(n)}})}function Wd(e,t){let n=[];if(e.length*t.length>25e4)return[...e.map(e=>({a:e,status:`Baseline only`})),...t.map(e=>({b:e,status:`Comparison only`}))];let r=e=>`${e.name}\n${e.args}`,i=Array.from({length:e.length+1},()=>new Uint32Array(t.length+1));for(let n=e.length-1;n>=0;n--)for(let a=t.length-1;a>=0;a--)i[n][a]=r(e[n])===r(t[a])?i[n+1][a+1]+1:Math.max(i[n+1][a],i[n][a+1]);let a=0,o=0,s=[],c=[];function l(){for(let e of s){let t=c.findIndex(t=>t.name===e.name);n.push(t<0?{a:e,status:`Removed`}:{a:e,b:c.splice(t,1)[0],status:`Arguments changed`})}n.push(...c.map(e=>({b:e,status:`Added`}))),s=[],c=[]}for(;a<e.length||o<t.length;)a<e.length&&o<t.length&&r(e[a])===r(t[o])?(l(),n.push({a:e[a++],b:t[o++],status:`Same`})):a<e.length&&(o===t.length||i[a+1][o]>=i[a][o+1])?s.push(e[a++]):c.push(t[o++]);return l(),n}function Gd(e){let t=e.requests??[],n=e=>t.length&&t.every(t=>typeof t[e]==`number`&&Number.isFinite(t[e]))?t.reduce((t,n)=>t+n[e],0):null,r=t.map(e=>Date.parse(e.startedAt)),i=t.map(e=>Date.parse(e.completedAt??``));return{cost:n(`cost`),input:n(`input`),output:n(`output`),time:n(`durationMs`),span:t.length&&[...r,...i].every(Number.isFinite)?Math.max(...i)-Math.min(...r):null,calls:t.length||e.events.filter(e=>e.title===`Context assembled`).length,tools:Ud(e).length}}function Kd(e){let t=e.events.findLast(e=>e.title===`Model answer`);if(!t)return`No model answer captured.`;let n=Vd(t.raw),r=e=>{if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(r).join(`
|
|
12
|
+
`);if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:t.content?r(t.content):``};return r(n)||t.raw}function qd(e,t){let n=new Map(e.evidence.map(e=>[e.id,e]));return e.evidence.filter(e=>e.exchange_id===t).map(e=>{let t=e.content_of?n.get(e.content_of)??e:e;return`[${e.kind}] ${e.label}\n${t.content??t.preview??``}${t.content===void 0?`
|
|
13
|
+
[Preview only]`:``}`}).join(`
|
|
14
|
+
|
|
15
|
+
`)||`No context captured.`}function Jd({title:e,a:t,b:n}){let r=new Set(t.split(`
|
|
16
|
+
`)),i=new Set(n.split(`
|
|
17
|
+
`));return(0,K.jsxs)(`details`,{className:`compare-detail`,children:[(0,K.jsxs)(`summary`,{children:[e,` · `,t===n?`Same`:`Different`]}),(0,K.jsx)(`p`,{children:`Highlighted lines occur only on that side.`}),(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{children:`How this is measured`}),(0,K.jsx)(`p`,{children:`Line order is preserved; this is not a word-level diff.`})]}),(0,K.jsx)(`div`,{className:`compare-pair`,children:[t,n].map((e,t)=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h4`,{children:t?`Comparison`:`Baseline`}),(0,K.jsx)(`pre`,{children:e.split(`
|
|
18
|
+
`).map((e,n)=>(0,K.jsxs)(`span`,{className:(t?r:i).has(e)?``:`diff-line`,children:[e||` `,` `,`
|
|
19
|
+
`]},n))})]},t))})]})}function Yd({a:e,b:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),o=e=>e.events.filter(e=>e.title===`Context assembled`).map(e=>{try{return JSON.parse(e.raw).exchange_id}catch{return``}}).filter(Boolean),s=o(e),c=o(t),l=s.includes(n)?n:s[0]??``,u=c.includes(i)?i:c[0]??``,d=Gd(e),f=Gd(t),p=Ud(e),m=Ud(t),h=Wd(p,m),g=(e,t)=>e===null?`Unavailable`:t===`$`?`$${e.toFixed(6)}`:t===`s`?`${(e/1e3).toFixed(2)} s`:e.toLocaleString();return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`compare-pair compare-identities`,children:[e,t].map((e,t)=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{children:t?`Comparison`:`Baseline`}),(0,K.jsxs)(`p`,{children:[e.provider,` · `,[...new Set(e.requests?.map(e=>e.model)??[e.model])].join(`, `)]}),(0,K.jsx)(`small`,{children:new Date(e.startedAt).toLocaleString()})]},e.id))}),(0,K.jsx)(`p`,{className:`compare-notice`,children:e.title===t.title?`Prompt titles match.`:`Starting prompts differ.`}),(0,K.jsxs)(`details`,{className:`compare-detail`,children:[(0,K.jsx)(`summary`,{children:`How this is measured`}),(0,K.jsx)(`p`,{className:`compare-note`,children:`Review captured context below before interpreting changes. Lower cost or time does not establish answer quality.`})]}),(0,K.jsx)(`div`,{className:`metrics-table`,children:(0,K.jsxs)(`table`,{children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`Metric`}),(0,K.jsx)(`th`,{children:`Baseline`}),(0,K.jsx)(`th`,{children:`Comparison`}),(0,K.jsx)(`th`,{children:`Change (B − A)`})]})}),(0,K.jsx)(`tbody`,{children:[[`cost`,`Reported cost`,`$`],[`span`,`Elapsed time`,`s`],[`time`,`Summed request time`,`s`],[`input`,`Input tokens`,``],[`output`,`Output tokens`,``],[`calls`,`API calls`,``],[`tools`,`Proposed tool calls`,``]].map(([e,t,n])=>{let r=d[e],i=f[e],a=r===null||i===null?null:i-r;return(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:t}),(0,K.jsx)(`td`,{children:g(r,n)}),(0,K.jsx)(`td`,{children:g(i,n)}),(0,K.jsx)(`td`,{children:a===null?`Unavailable`:`${a>0?`+`:``}${g(a,n)}${r===0?` · % unavailable`:` (${a>0?`+`:``}${(a/r*100).toFixed(1)}%)`}`})]},e)})})]})}),(0,K.jsx)(`p`,{className:`compare-note`,children:`Totals require every call to report the metric.`}),(0,K.jsxs)(`details`,{className:`compare-detail`,children:[(0,K.jsx)(`summary`,{children:`How this is measured`}),(0,K.jsx)(`p`,{className:`compare-note`,children:`Elapsed time spans the first request to the last response; summed time can include overlapping calls.`})]}),(0,K.jsx)(Jd,{title:`Starting prompt`,a:e.title,b:t.title}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{children:`Execution differences`}),(0,K.jsxs)(`p`,{children:[h.filter(e=>e.status===`Same`).length,` matching · `,h.filter(e=>e.status===`Added`).length,` added · `,h.filter(e=>e.status===`Removed`).length,` removed · `,h.filter(e=>e.status===`Arguments changed`).length,` changed`]}),(0,K.jsx)(`p`,{className:`compare-note`,children:`Exact tool names and arguments anchor matches.`}),(0,K.jsxs)(`details`,{className:`compare-detail`,children:[(0,K.jsx)(`summary`,{children:`How this is measured`}),(0,K.jsx)(`p`,{className:`compare-note`,children:`Same-name calls between anchors are paired as possible argument changes. Reordered calls may appear as added and removed. Each repeated call stays separate; carried tool results are excluded.`})]}),p.length*m.length>25e4&&(0,K.jsx)(`p`,{children:`These runs exceed the alignment limit. Calls are listed separately.`}),h.length?h.map((e,t)=>(0,K.jsxs)(`details`,{className:`compare-detail`,children:[(0,K.jsxs)(`summary`,{children:[e.status,` · `,e.a?.name??e.b?.name]}),(0,K.jsxs)(`div`,{className:`compare-pair`,children:[(0,K.jsx)(`pre`,{children:e.a?.args??`No call`}),(0,K.jsx)(`pre`,{children:e.b?.args??`No call`})]})]},t)):(0,K.jsx)(`p`,{children:`No proposed tool calls captured.`})]}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{children:`Captured context by request`}),(0,K.jsx)(`div`,{className:`compare-pair`,children:[s,c].map((e,t)=>(0,K.jsxs)(`label`,{children:[t?`Comparison request`:`Baseline request`,(0,K.jsxs)(zd,{value:t?u:l,onChange:e=>(t?a:r)(e.target.value),children:[!e.length&&(0,K.jsx)(Bd,{value:``,children:`No requests`}),e.map((e,t)=>(0,K.jsxs)(Bd,{value:e,children:[`Request `,t+1]},e))]})]},t))}),(0,K.jsx)(Jd,{title:`Instructions, messages, and tool results`,a:qd(e,l),b:qd(t,u)})]}),(0,K.jsx)(Jd,{title:`Last captured model answer`,a:Kd(e),b:Kd(t)})]})}function Xd({traces:e,currentId:t}){let[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(0),u=[...new Map([...e,...n].map(e=>[e.id,e])).values()].sort((e,t)=>t.startedAt.localeCompare(e.startedAt)),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(``);(0,_.useEffect)(()=>{if(!d)return;let e=new AbortController;return a(!0),s(``),x().fetch(`/raytace/traces?scope=history&evidence=1`,{signal:e.signal}).then(async e=>{if(!e.ok)throw Error(`Could not load saved runs. Check that the proxy is running with the latest version.`);let t=await e.json();if(!Array.isArray(t.traces))throw Error(`Invalid saved-run response.`);r(t.traces)}).catch(t=>{e.signal.aborted||s(t.message)}).finally(()=>{e.signal.aborted||a(!1)}),()=>e.abort()},[d,c]);let v=u.find(e=>e.id===p),y=u.find(e=>e.id===h);return(0,K.jsxs)(jd,{open:d,onOpenChange:e=>{f(e),e&&(m(t||u[0]?.id||``),g(``))},children:[(0,K.jsx)(Md,{className:`graph-open-button`,children:`Compare runs`}),(0,K.jsxs)(Fd,{className:`run-compare-panel`,children:[(0,K.jsxs)(Id,{children:[(0,K.jsx)(Ld,{children:`Compare runs`}),(0,K.jsx)(Rd,{children:`Compare saved captures. No new model calls are made.`})]}),(0,K.jsxs)(`div`,{className:`compare-body`,children:[i&&(0,K.jsx)(`output`,{children:`Loading saved runs…`}),o&&(0,K.jsxs)(`p`,{role:`alert`,children:[o,` `,(0,K.jsx)(`button`,{className:`graph-open-button`,onClick:()=>l(e=>e+1),children:`Retry`})]}),(0,K.jsx)(`p`,{className:`compare-note`,children:`Most recent 100 saved runs across sessions. Reopen to refresh history.`}),(0,K.jsx)(`div`,{className:`compare-pair`,children:[p,h].map((e,t)=>(0,K.jsxs)(`label`,{children:[t?`Comparison run`:`Baseline run`,(0,K.jsxs)(zd,{value:e,onChange:e=>(t?g:m)(e.target.value),children:[(0,K.jsx)(Bd,{value:``,children:`Choose a captured run`}),u.map(e=>(0,K.jsxs)(Bd,{value:e.id,children:[new Date(e.startedAt).toLocaleString(),` · `,e.model,` · `,e.title.slice(0,90)]},e.id))]})]},t))}),i?null:u.length<2?(0,K.jsx)(`p`,{children:`Capture at least two runs to compare them. Try the same task with a different prompt or model.`}):!v||!y?(0,K.jsx)(`p`,{children:`Select two saved runs to see cost, timing, execution, context, and answer differences.`}):v.id===y.id?(0,K.jsx)(`p`,{children:`Choose two different runs.`}):(0,K.jsx)(Yd,{a:v,b:y},`${v.id}-${y.id}`)]})]})]})}function Zd(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Zd(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Qd={value:()=>{}};function $d(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ef(n)}function ef(e){this._=e}function tf(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ef.prototype=$d.prototype={constructor:ef,on:function(e,t){var n=this._,r=tf(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=nf(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=rf(n[i],e.name,t);else if(t==null)for(i in n)n[i]=rf(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ef(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function nf(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function rf(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Qd,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var af={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function of(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),af.hasOwnProperty(t)?{space:af[t],local:e}:e}function sf(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function cf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function lf(e){var t=of(e);return(t.local?cf:sf)(t)}function uf(){}function df(e){return e==null?uf:function(){return this.querySelector(e)}}function ff(e){typeof e!=`function`&&(e=df(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new em(r,this._parents)}function pf(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function mf(){return[]}function hf(e){return e==null?mf:function(){return this.querySelectorAll(e)}}function gf(e){return function(){return pf(e.apply(this,arguments))}}function _f(e){e=typeof e==`function`?gf(e):hf(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new em(r,i)}function vf(e){return function(){return this.matches(e)}}function yf(e){return function(t){return t.matches(e)}}var bf=Array.prototype.find;function xf(e){return function(){return bf.call(this.children,e)}}function Sf(){return this.firstElementChild}function Cf(e){return this.select(e==null?Sf:xf(typeof e==`function`?e:yf(e)))}var wf=Array.prototype.filter;function Tf(){return Array.from(this.children)}function Ef(e){return function(){return wf.call(this.children,e)}}function Df(e){return this.selectAll(e==null?Tf:Ef(typeof e==`function`?e:yf(e)))}function Of(e){typeof e!=`function`&&(e=vf(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new em(r,this._parents)}function kf(e){return Array(e.length)}function Af(){return new em(this._enter||this._groups.map(kf),this._parents)}function jf(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}jf.prototype={constructor:jf,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Mf(e){return function(){return e}}function Nf(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new jf(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Pf(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new jf(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Ff(e){return e.__data__}function If(e,t){if(!arguments.length)return Array.from(this,Ff);var n=t?Pf:Nf,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Mf(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Lf(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new em(o,r),o._enter=s,o._exit=c,o}function Lf(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Rf(){return new em(this._exit||this._groups.map(kf),this._parents)}function zf(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Bf(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new em(s,this._parents)}function Vf(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Hf(e){e||=Uf;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new em(i,this._parents).order()}function Uf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Wf(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Gf(){return Array.from(this)}function Kf(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function qf(){let e=0;for(let t of this)++e;return e}function Jf(){return!this.node()}function Yf(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Xf(e){return function(){this.removeAttribute(e)}}function Zf(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qf(e,t){return function(){this.setAttribute(e,t)}}function $f(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ep(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tp(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function np(e,t){var n=of(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Zf:Xf:typeof t==`function`?n.local?tp:ep:n.local?$f:Qf)(n,t))}function rp(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ip(e){return function(){this.style.removeProperty(e)}}function ap(e,t,n){return function(){this.style.setProperty(e,t,n)}}function op(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function sp(e,t,n){return arguments.length>1?this.each((t==null?ip:typeof t==`function`?op:ap)(e,t,n??``)):cp(this.node(),e)}function cp(e,t){return e.style.getPropertyValue(t)||rp(e).getComputedStyle(e,null).getPropertyValue(t)}function lp(e){return function(){delete this[e]}}function up(e,t){return function(){this[e]=t}}function dp(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function fp(e,t){return arguments.length>1?this.each((t==null?lp:typeof t==`function`?dp:up)(e,t)):this.node()[e]}function pp(e){return e.trim().split(/^|\s+/)}function mp(e){return e.classList||new hp(e)}function hp(e){this._node=e,this._names=pp(e.getAttribute(`class`)||``)}hp.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function gp(e,t){for(var n=mp(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function _p(e,t){for(var n=mp(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function vp(e){return function(){gp(this,e)}}function yp(e){return function(){_p(this,e)}}function bp(e,t){return function(){(t.apply(this,arguments)?gp:_p)(this,e)}}function xp(e,t){var n=pp(e+``);if(arguments.length<2){for(var r=mp(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?bp:t?vp:yp)(n,t))}function Sp(){this.textContent=``}function Cp(e){return function(){this.textContent=e}}function wp(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Tp(e){return arguments.length?this.each(e==null?Sp:(typeof e==`function`?wp:Cp)(e)):this.node().textContent}function Ep(){this.innerHTML=``}function Dp(e){return function(){this.innerHTML=e}}function Op(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function kp(e){return arguments.length?this.each(e==null?Ep:(typeof e==`function`?Op:Dp)(e)):this.node().innerHTML}function Ap(){this.nextSibling&&this.parentNode.appendChild(this)}function jp(){return this.each(Ap)}function Mp(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Np(){return this.each(Mp)}function Pp(e){var t=typeof e==`function`?e:lf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Fp(){return null}function Ip(e,t){var n=typeof e==`function`?e:lf(e),r=t==null?Fp:typeof t==`function`?t:df(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Lp(){var e=this.parentNode;e&&e.removeChild(this)}function Rp(){return this.each(Lp)}function zp(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Bp(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vp(e){return this.select(e?Bp:zp)}function Hp(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Up(e){return function(t){e.call(this,t,this.__data__)}}function Wp(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Gp(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Kp(e,t,n){return function(){var r=this.__on,i,a=Up(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function qp(e,t,n){var r=Wp(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Kp:Gp,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Jp(e,t,n){var r=rp(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Yp(e,t){return function(){return Jp(this,e,t)}}function Xp(e,t){return function(){return Jp(this,e,t.apply(this,arguments))}}function Zp(e,t){return this.each((typeof t==`function`?Xp:Yp)(e,t))}function*Qp(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var $p=[null];function em(e,t){this._groups=e,this._parents=t}function tm(){return new em([[document.documentElement]],$p)}function nm(){return this}em.prototype=tm.prototype={constructor:em,select:ff,selectAll:_f,selectChild:Cf,selectChildren:Df,filter:Of,data:If,enter:Af,exit:Rf,join:zf,merge:Bf,selection:nm,order:Vf,sort:Hf,call:Wf,nodes:Gf,node:Kf,size:qf,empty:Jf,each:Yf,attr:np,style:sp,property:fp,classed:xp,text:Tp,html:kp,raise:jp,lower:Np,append:Pp,insert:Ip,remove:Rp,clone:Vp,datum:Hp,on:qp,dispatch:Zp,[Symbol.iterator]:Qp};function rm(e){return typeof e==`string`?new em([[document.querySelector(e)]],[document.documentElement]):new em([[e]],$p)}function im(e){let t;for(;t=e.sourceEvent;)e=t;return e}function am(e,t){if(e=im(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var om={passive:!1},sm={capture:!0,passive:!1};function cm(e){e.stopImmediatePropagation()}function lm(e){e.preventDefault(),e.stopImmediatePropagation()}function um(e){var t=e.document.documentElement,n=rm(e).on(`dragstart.drag`,lm,sm);`onselectstart`in t?n.on(`selectstart.drag`,lm,sm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function dm(e,t){var n=e.document.documentElement,r=rm(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,lm,sm),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var fm=e=>()=>e;function pm(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}pm.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mm(e){return!e.ctrlKey&&!e.button}function hm(){return this.parentNode}function gm(e,t){return t??{x:e.x,y:e.y}}function _m(){return navigator.maxTouchPoints||`ontouchstart`in this}function vm(){var e=mm,t=hm,n=gm,r=_m,i={},a=$d(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,om).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(rm(n.view).on(`mousemove.drag`,m,sm).on(`mouseup.drag`,h,sm),um(n.view),cm(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(lm(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){rm(e.view).on(`mousemove.drag mouseup.drag`,null),dm(e.view,l),lm(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(cm(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(lm(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(cm(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=am(l||r,t),p,m,h;if((h=n.call(e,new pm(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=am(l||a,t),_=o}u.call(r,e,new pm(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:fm(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:fm(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:fm(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:fm(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function ym(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xm(){}var Sm=.7,Cm=1/Sm,wm=`\\s*([+-]?\\d+)\\s*`,Tm=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Em=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Dm=/^#([0-9a-f]{3,8})$/,Om=RegExp(`^rgb\\(${wm},${wm},${wm}\\)$`),km=RegExp(`^rgb\\(${Em},${Em},${Em}\\)$`),Am=RegExp(`^rgba\\(${wm},${wm},${wm},${Tm}\\)$`),jm=RegExp(`^rgba\\(${Em},${Em},${Em},${Tm}\\)$`),Mm=RegExp(`^hsl\\(${Tm},${Em},${Em}\\)$`),Nm=RegExp(`^hsla\\(${Tm},${Em},${Em},${Tm}\\)$`),Pm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ym(xm,zm,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fm,formatHex:Fm,formatHex8:Im,formatHsl:Lm,formatRgb:Rm,toString:Rm});function Fm(){return this.rgb().formatHex()}function Im(){return this.rgb().formatHex8()}function Lm(){return Qm(this).formatHsl()}function Rm(){return this.rgb().formatRgb()}function zm(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Dm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bm(t):n===3?new Wm(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Vm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Vm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Om.exec(e))?new Wm(t[1],t[2],t[3],1):(t=km.exec(e))?new Wm(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Am.exec(e))?Vm(t[1],t[2],t[3],t[4]):(t=jm.exec(e))?Vm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Mm.exec(e))?Zm(t[1],t[2]/100,t[3]/100,1):(t=Nm.exec(e))?Zm(t[1],t[2]/100,t[3]/100,t[4]):Pm.hasOwnProperty(e)?Bm(Pm[e]):e===`transparent`?new Wm(NaN,NaN,NaN,0):null}function Bm(e){return new Wm(e>>16&255,e>>8&255,e&255,1)}function Vm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Wm(e,t,n,r)}function Hm(e){return e instanceof xm||(e=zm(e)),e?(e=e.rgb(),new Wm(e.r,e.g,e.b,e.opacity)):new Wm}function Um(e,t,n,r){return arguments.length===1?Hm(e):new Wm(e,t,n,r??1)}function Wm(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ym(Wm,Um,bm(xm,{brighter(e){return e=e==null?Cm:Cm**+e,new Wm(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sm:Sm**+e,new Wm(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wm(Ym(this.r),Ym(this.g),Ym(this.b),Jm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gm,formatHex:Gm,formatHex8:Km,formatRgb:qm,toString:qm}));function Gm(){return`#${Xm(this.r)}${Xm(this.g)}${Xm(this.b)}`}function Km(){return`#${Xm(this.r)}${Xm(this.g)}${Xm(this.b)}${Xm((isNaN(this.opacity)?1:this.opacity)*255)}`}function qm(){let e=Jm(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Ym(this.r)}, ${Ym(this.g)}, ${Ym(this.b)}${e===1?`)`:`, ${e})`}`}function Jm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ym(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xm(e){return e=Ym(e),(e<16?`0`:``)+e.toString(16)}function Zm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new eh(e,t,n,r)}function Qm(e){if(e instanceof eh)return new eh(e.h,e.s,e.l,e.opacity);if(e instanceof xm||(e=zm(e)),!e)return new eh;if(e instanceof eh)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new eh(o,s,c,e.opacity)}function $m(e,t,n,r){return arguments.length===1?Qm(e):new eh(e,t,n,r??1)}function eh(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ym(eh,$m,bm(xm,{brighter(e){return e=e==null?Cm:Cm**+e,new eh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sm:Sm**+e,new eh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Wm(rh(e>=240?e-240:e+120,i,r),rh(e,i,r),rh(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new eh(th(this.h),nh(this.s),nh(this.l),Jm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Jm(this.opacity);return`${e===1?`hsl(`:`hsla(`}${th(this.h)}, ${nh(this.s)*100}%, ${nh(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function th(e){return e=(e||0)%360,e<0?e+360:e}function nh(e){return Math.max(0,Math.min(1,e||0))}function rh(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var ih=e=>()=>e;function ah(e,t){return function(n){return e+n*t}}function oh(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function sh(e){return(e=+e)==1?ch:function(t,n){return n-t?oh(t,n,e):ih(isNaN(t)?n:t)}}function ch(e,t){var n=t-e;return n?ah(e,n):ih(isNaN(e)?t:e)}var lh=(function e(t){var n=sh(t);function r(e,t){var r=n((e=Um(e)).r,(t=Um(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=ch(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function uh(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function dh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fh(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=xh(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function ph(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function mh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function hh(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=xh(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var gh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_h=new RegExp(gh.source,`g`);function vh(e){return function(){return e}}function yh(e){return function(t){return e(t)+``}}function bh(e,t){var n=gh.lastIndex=_h.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=gh.exec(e))&&(i=_h.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:mh(r,i)})),n=_h.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?yh(c[0].x):vh(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function xh(e,t){var n=typeof t,r;return t==null||n===`boolean`?ih(t):(n===`number`?mh:n===`string`?(r=zm(t))?(t=r,lh):bh:t instanceof zm?lh:t instanceof Date?ph:dh(t)?uh:Array.isArray(t)?fh:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?hh:mh)(e,t)}var Sh=180/Math.PI,Ch={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function wh(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Sh,skewX:Math.atan(c)*Sh,scaleX:o,scaleY:s}}var Th;function Eh(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Ch:wh(t.a,t.b,t.c,t.d,t.e,t.f)}function Dh(e){return e==null||(Th||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Th.setAttribute(`transform`,e),!(e=Th.transform.baseVal.consolidate()))?Ch:(e=e.matrix,wh(e.a,e.b,e.c,e.d,e.e,e.f))}function Oh(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:mh(e,i)},{i:c-2,x:mh(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:mh(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:mh(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:mh(e,n)},{i:s-2,x:mh(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var kh=Oh(Eh,`px, `,`px)`,`deg)`),Ah=Oh(Dh,`, `,`)`,`)`),jh=1e-12;function Mh(e){return((e=Math.exp(e))+1/e)/2}function Nh(e){return((e=Math.exp(e))-1/e)/2}function Ph(e){return((e=Math.exp(2*e))-1)/(e+1)}var Fh=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<jh)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Mh(y),c=s/(n*g)*(i*Ph(t*r+y)-Nh(y));return[a+c*d,o+c*f,s*i/Mh(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),Ih=0,Lh=0,Rh=0,zh=1e3,Bh,Vh,Hh=0,Uh=0,Wh=0,Gh=typeof performance==`object`&&performance.now?performance:Date,Kh=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qh(){return Uh||=(Kh(Jh),Gh.now()+Wh)}function Jh(){Uh=0}function Yh(){this._call=this._time=this._next=null}Yh.prototype=Xh.prototype={constructor:Yh,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?qh():+n)+(t==null?0:+t),!this._next&&Vh!==this&&(Vh?Vh._next=this:Bh=this,Vh=this),this._call=e,this._time=n,tg()},stop:function(){this._call&&(this._call=null,this._time=1/0,tg())}};function Xh(e,t,n){var r=new Yh;return r.restart(e,t,n),r}function Zh(){qh(),++Ih;for(var e=Bh,t;e;)(t=Uh-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ih}function Qh(){Uh=(Hh=Gh.now())+Wh,Ih=Lh=0;try{Zh()}finally{Ih=0,eg(),Uh=0}}function $h(){var e=Gh.now(),t=e-Hh;t>zh&&(Wh-=t,Hh=e)}function eg(){for(var e,t=Bh,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Bh=n);Vh=e,tg(r)}function tg(e){Ih||(Lh&&=clearTimeout(Lh),e-Uh>24?(e<1/0&&(Lh=setTimeout(Qh,e-Gh.now()-Wh)),Rh&&=clearInterval(Rh)):(Rh||=(Hh=Gh.now(),setInterval($h,zh)),Ih=1,Kh(Qh)))}function ng(e,t,n){var r=new Yh;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var rg=$d(`start`,`end`,`cancel`,`interrupt`),ig=[];function ag(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;lg(e,n,{name:t,index:r,group:i,on:rg,tween:ig,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function og(e,t){var n=cg(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function sg(e,t){var n=cg(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function cg(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function lg(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Xh(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return ng(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(ng(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function ug(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function dg(e){return this.each(function(){ug(this,e)})}function fg(e,t){var n,r;return function(){var i=sg(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function pg(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=sg(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function mg(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=cg(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?fg:pg)(n,e,t))}function hg(e,t,n){var r=e._id;return e.each(function(){var e=sg(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return cg(e,r).value[t]}}function gg(e,t){var n;return(typeof t==`number`?mh:t instanceof zm?lh:(n=zm(t))?(t=n,lh):bh)(e,t)}function _g(e){return function(){this.removeAttribute(e)}}function vg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yg(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function bg(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function xg(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Sg(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Cg(e,t){var n=of(e),r=n===`transform`?Ah:gg;return this.attrTween(e,typeof t==`function`?(n.local?Sg:xg)(n,r,hg(this,`attr.`+e,t)):t==null?(n.local?vg:_g)(n):(n.local?bg:yg)(n,r,t))}function wg(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Tg(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Eg(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Tg(e,i)),n}return i._value=t,i}function Dg(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&wg(e,i)),n}return i._value=t,i}function Og(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=of(e);return this.tween(n,(r.local?Eg:Dg)(r,t))}function kg(e,t){return function(){og(this,e).delay=+t.apply(this,arguments)}}function Ag(e,t){return t=+t,function(){og(this,e).delay=t}}function jg(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?kg:Ag)(t,e)):cg(this.node(),t).delay}function Mg(e,t){return function(){sg(this,e).duration=+t.apply(this,arguments)}}function Ng(e,t){return t=+t,function(){sg(this,e).duration=t}}function Pg(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Mg:Ng)(t,e)):cg(this.node(),t).duration}function Fg(e,t){if(typeof t!=`function`)throw Error();return function(){sg(this,e).ease=t}}function Ig(e){var t=this._id;return arguments.length?this.each(Fg(t,e)):cg(this.node(),t).ease}function Lg(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();sg(this,e).ease=n}}function Rg(e){if(typeof e!=`function`)throw Error();return this.each(Lg(this._id,e))}function zg(e){typeof e!=`function`&&(e=vf(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new m_(r,this._parents,this._name,this._id)}function Bg(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new m_(o,this._parents,this._name,this._id)}function Vg(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Hg(e,t,n){var r,i,a=Vg(t)?og:sg;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ug(e,t){var n=this._id;return arguments.length<2?cg(this.node(),n).on.on(e):this.each(Hg(n,e,t))}function Wg(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Gg(){return this.on(`end.remove`,Wg(this._id))}function Kg(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=df(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,ag(l[f],t,n,f,l,cg(u,n)));return new m_(a,this._parents,t,n)}function qg(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=hf(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=cg(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&ag(p,t,n,h,f,m);a.push(f),o.push(u)}return new m_(a,o,t,n)}var Jg=tm.prototype.constructor;function Yg(){return new Jg(this._groups,this._parents)}function Xg(e,t){var n,r,i;return function(){var a=cp(this,e),o=(this.style.removeProperty(e),cp(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Zg(e){return function(){this.style.removeProperty(e)}}function Qg(e,t,n){var r,i=n+``,a;return function(){var o=cp(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function $g(e,t,n){var r,i,a;return function(){var o=cp(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),cp(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function e_(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=sg(this,e),l=c.on,u=c.value[a]==null?s||=Zg(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function t_(e,t,n){var r=(e+=``)==`transform`?kh:gg;return t==null?this.styleTween(e,Xg(e,r)).on(`end.style.`+e,Zg(e)):typeof t==`function`?this.styleTween(e,$g(e,r,hg(this,`style.`+e,t))).each(e_(this._id,e)):this.styleTween(e,Qg(e,r,t),n).on(`end.style.`+e,null)}function n_(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function r_(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&n_(e,a,n)),r}return a._value=t,a}function i_(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,r_(e,t,n??``))}function a_(e){return function(){this.textContent=e}}function o_(e){return function(){var t=e(this);this.textContent=t??``}}function s_(e){return this.tween(`text`,typeof e==`function`?o_(hg(this,`text`,e)):a_(e==null?``:e+``))}function c_(e){return function(t){this.textContent=e.call(this,t)}}function l_(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&c_(r)),t}return r._value=e,r}function u_(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,l_(e))}function d_(){for(var e=this._name,t=this._id,n=h_(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=cg(c,t);ag(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new m_(r,this._parents,e,n)}function f_(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=sg(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var p_=0;function m_(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function h_(){return++p_}var g_=tm.prototype;m_.prototype={constructor:m_,select:Kg,selectAll:qg,selectChild:g_.selectChild,selectChildren:g_.selectChildren,filter:zg,merge:Bg,selection:Yg,transition:d_,call:g_.call,nodes:g_.nodes,node:g_.node,size:g_.size,empty:g_.empty,each:g_.each,on:Ug,attr:Cg,attrTween:Og,style:t_,styleTween:i_,text:s_,textTween:u_,remove:Gg,tween:mg,delay:jg,duration:Pg,ease:Ig,easeVarying:Rg,end:f_,[Symbol.iterator]:g_[Symbol.iterator]};function __(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var v_={time:null,delay:0,duration:250,ease:__};function y_(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function b_(e){var t,n;e instanceof m_?(t=e._id,e=e._name):(t=h_(),(n=v_).time=qh(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&ag(c,e,t,l,o,n||y_(c,t));return new m_(r,this._parents,e,t)}tm.prototype.interrupt=dg,tm.prototype.transition=b_;var x_=e=>()=>e;function S_(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function C_(e,t,n){this.k=e,this.x=t,this.y=n}C_.prototype={constructor:C_,scale:function(e){return e===1?this:new C_(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new C_(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var w_=new C_(1,0,0);T_.prototype=C_.prototype;function T_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return w_;return e.__zoom}function E_(e){e.stopImmediatePropagation()}function D_(e){e.preventDefault(),e.stopImmediatePropagation()}function O_(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function k_(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function A_(){return this.__zoom||w_}function j_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function M_(){return navigator.maxTouchPoints||`ontouchstart`in this}function N_(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function P_(){var e=O_,t=k_,n=N_,r=j_,i=M_,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Fh,l=$d(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,A_).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,A_),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(w_.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new C_(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new C_(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new C_(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=rm(this.that).datum();l.call(e,this.that,new S_(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=am(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],ug(this),s.start();D_(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=rm(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=am(t,i),l=t.clientX,u=t.clientY;um(t.view),E_(t),a.mouse=[c,this.__zoom.invert(c)],ug(this),a.start();function d(e){if(D_(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=am(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),dm(e.view,a.moved),D_(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=am(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);D_(r),s>0?rm(this).transition().duration(s).call(x,d,c,r):rm(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(E_(t),s=0;s<i;++s)c=r[s],l=am(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),ug(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(D_(e),s=0;s<a;++s)c=i[s],l=am(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(E_(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=am(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=rm(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:x_(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:x_(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:x_(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:x_([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var F_={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},I_=[[-1/0,-1/0],[1/0,1/0]],L_=[`Enter`,` `,`Escape`],R_={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},z_;(function(e){e.Strict=`strict`,e.Loose=`loose`})(z_||={});var B_;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(B_||={});var V_;(function(e){e.Partial=`partial`,e.Full=`full`})(V_||={});var H_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},U_;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(U_||={});var W_;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(W_||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var G_={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},K_=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,q_=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),J_=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Y_=(e,t=[0,0])=>{let{width:n,height:r}=kv(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},X_=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):J_(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,lv(e,pv(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?dv(r):{x:0,y:0,width:0,height:0}},Z_=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=lv(n,pv(e)),r=!0)}),r?dv(n):{x:0,y:0,width:0,height:0}},Q_=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=hv(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},$_=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function ev(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=kv(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function tv({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Ev(Z_(ev(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function nv({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,F_.error005());else{let{width:e,height:t}=kv(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&Ov(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Ov(d)?av(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,F_.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function rv({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=$_(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var iv=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),av=(e={x:0,y:0},t,n)=>({x:iv(e.x,t[0][0],t[1][0]-(n?.width??0)),y:iv(e.y,t[0][1],t[1][1]-(n?.height??0))});function ov(e,t,n){let{width:r,height:i}=kv(n),{x:a,y:o}=n.internals.positionAbsolute;return av(e,[[a,o],[a+r,o+i]],t)}var sv=(e,t,n)=>e<t?iv(Math.abs(e-t),1,t)/t:e>n?-iv(Math.abs(e-n),1,t)/t:0,cv=(e,t,n=15,r=40)=>[sv(e.x,r,t.width-r)*n,sv(e.y,r,t.height-r)*n],lv=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),uv=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),dv=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),fv=(e,t=[0,0])=>{let{x:n,y:r}=J_(e)?e.internals.positionAbsolute:Y_(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},pv=(e,t=[0,0])=>{let{x:n,y:r}=J_(e)?e.internals.positionAbsolute:Y_(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},mv=(e,t)=>dv(lv(uv(e),uv(t))),hv=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},gv=(e,t)=>hv(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),_v=e=>vv(e.width)&&vv(e.height)&&vv(e.x)&&vv(e.y),vv=e=>!isNaN(e)&&isFinite(e),yv=(e,t)=>(e,t)=>{},bv=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xv=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?bv(s,o):s},Sv=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Cv(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function wv(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Cv(e,n),i=Cv(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Cv(e.top??e.y??0,n),i=Cv(e.bottom??e.y??0,n),a=Cv(e.left??e.x??0,t),o=Cv(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Tv(e,t,n,r,i,a){let{x:o,y:s}=Sv(e,[t,n,r]),{x:c,y:l}=Sv({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Ev=(e,t,n,r,i,a)=>{let o=wv(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=iv(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Tv(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Dv=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Ov(e){return e!=null&&e!==`parent`}function kv(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Av(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function jv(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Mv(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Nv(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Pv(e){return{...R_,...e||{}}}function Fv(e){return e===null?null:e?`valid`:`invalid`}function Iv(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Hv(e),s=xv({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?bv(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Lv=e=>({width:e.offsetWidth,height:e.offsetHeight}),Rv=e=>e?.getRootNode?.()||window?.document,zv=[`INPUT`,`SELECT`,`TEXTAREA`];function Bv(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?zv.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Vv=e=>`clientX`in e,Hv=(e,t)=>{let n=Vv(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Uv=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Lv(t)}})};function Wv({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function Gv(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Kv({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-Gv(t-r,a),n];case $.Right:return[t+Gv(r-t,a),n];case $.Top:return[t,n-Gv(n-i,a)];case $.Bottom:return[t,n+Gv(i-n,a)]}}function qv({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=Kv({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Kv({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Wv({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function Jv({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Yv({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Xv({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=lv(pv(e),pv(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),gv({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},dv(a))>0}var Zv=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Qv=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),$v=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,F_.error006()),t;let r=n.getEdgeId||Zv,i;return i=K_(e)?{...e}:{...e,id:r(e)},Qv(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ey({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=Jv({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var ty={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},ny=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},ry=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function iy({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=ty[t],c=ty[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=ny({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=Jv({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function ay(e,t,n,r){let i=Math.min(ry(e,t)/2,ry(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function oy({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=iy({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=ay(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function sy(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function cy(e){let{sourceNode:t,targetNode:n}=e;if(!sy(t)||!sy(n))return null;let r=t.internals.handleBounds||ly(t.handles),i=n.internals.handleBounds||ly(n.handles),a=dy(r?.source??[],e.sourceHandle),o=dy(e.connectionMode===z_.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,F_.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=uy(t,a,s),u=uy(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function ly(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function uy(e,t,n=$.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??kv(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function dy(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function fy(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function py(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=fy(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var my=1e3,hy=10,gy={nodeOrigin:[0,0],nodeExtent:I_,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},_y={...gy,checkEquality:!0};function vy(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function yy(e,t,n){let r=vy(gy,n);for(let n of e.values())if(n.parentId)wy(n,e,t,r);else{let e=av(Y_(n,r.nodeOrigin),Ov(n.extent)?n.extent:r.nodeExtent,kv(n));n.internals.positionAbsolute=e}}function by(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function xy(e){return e===`manual`}function Sy(e,t,n,r={}){let i=vy(_y,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!xy(i.zIndexMode)?my:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=av(Y_(u,i.nodeOrigin),Ov(u.extent)?u.extent:i.nodeExtent,kv(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:by(u,e),z:Ty(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&wy(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Cy(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function wy(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=vy(gy,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Cy(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*hy),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Ey(e,u,o,s,a&&!xy(c)?my:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function Ty(e,t,n){let r=vv(e.zIndex)?e.zIndex:0;return xy(n)?r:r+(e.selected?t:0)}function Ey(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=kv(e),l=Y_(e,n),u=Ov(e.extent)?av(l,e.extent,c):l,d=av({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=ov(d,c,t));let f=Ty(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Dy(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=mv(a.get(n.parentId)?.expandedRect??fv(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=kv(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function Oy(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=Lv(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Ov(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=ov(h,s,n))}else m&&(h=av(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Uv(`source`,r.nodeElement,p,d,e.id),target:Uv(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&wy(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:fv(g,i)}))}}if(f.length>0){let e=Dy(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function ky({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function Ay(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function jy(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;Ay(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),Ay(`target`,s,c,e,i,o),t.set(r.id,r)}}function My(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:My(n,t):!1}function Ny(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Py(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!My(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function Fy({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Iy({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=bv(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Ly({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=rm(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?uv(Z_(s)):null,x=v&&l?Iy({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:bv(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=nv({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=Fy({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=cv(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=Iv(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Py(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Fy({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=vm().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=Iv(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Hv(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Iv(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=Hv(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=Hv(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=Fy({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!Ny(t,`.${g}`,v))&&(!_||Ny(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Ry(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())gv(i,fv(e))>0&&r.push(e);return r}var zy=250;function By(e,t,n,r){let i=[],a=1/0,o=Ry(e,n,t+zy);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=uy(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Vy(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...uy(o,c,c.position,!0)}:c}function Hy(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Uy(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Wy=()=>!0;function Gy(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=Wy,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Rv(e.target),E=0,D,{x:O,y:k}=Hv(e),A=Hy(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=Vy(i,A,r,c,t);if(!N)return;let P=Hv(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=cv(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let ee={...N,nodeId:i,type:A,position:N.position},B=c.get(i),V={inProgress:!0,isValid:null,from:uy(B,ee,$.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:B,to:P,toHandle:null,toPosition:G_[ee.position],toNode:null,pointer:P};function H(){M=!0,y(V),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&H();function te(e){if(!M){let{x:t,y:n}=Hv(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;H()}if(!x()||!ee){U(e);return}let a=b();P=Hv(e,j),D=By(xv(P,a,!1,[1,1]),n,c,ee),F||=(z(),!0);let s=Ky(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=Uy(!!D,s.isValid);let u=c.get(i),f=u?uy(u,ee,$.Left,!0):V.from,p={...V,from:f,isValid:L,to:s.toHandle&&L?Sv({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:G_[ee.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),V=p}function U(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=V,r={...n,toPosition:V.toHandle?V.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,te),T.removeEventListener(`mouseup`,U),T.removeEventListener(`touchmove`,te),T.removeEventListener(`touchend`,U)}}T.addEventListener(`mousemove`,te),T.addEventListener(`mouseup`,U),T.addEventListener(`touchmove`,te),T.addEventListener(`touchend`,U)}function Ky(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Wy,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Hv(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=Hy(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===z_.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Vy(t,e,a,u,n,!0)}return _}var qy={onPointerDown:Gy,isValid:Ky};function Jy({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=rm(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Dv()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=P_().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:am}}var Yy=e=>({x:e.x,y:e.y,zoom:e.k}),Xy=({x:e,y:t,zoom:n})=>w_.translate(e,t).scale(n),Zy=(e,t)=>e.target.closest(`.${t}`),Qy=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),$y=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,eb=(e,t=0,n=$y,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},tb=e=>{let t=e.ctrlKey&&Dv()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function nb({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Zy(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=am(u),t=d*2**tb(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===B_.Vertical?0:u.deltaX*f,m=i===B_.Horizontal?0:u.deltaY*f;!Dv()&&u.shiftKey&&i!==B_.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Yy(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function rb({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=Zy(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function ib({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Yy(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function ab({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&Qy(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Yy(a.transform))}}function ob({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&Qy(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Yy(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function sb({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(Zy(f,`${u}-flow__node`)||Zy(f,`${u}-flow__edge`)||Zy(f,`${u}-flow__selection`)||Zy(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||Zy(f,c)&&h||Zy(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function cb({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=P_().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=rm(e).call(f);y({x:i.x,y:i.y,zoom:iv(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(tb);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?xh:Fh).transform(eb(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!vv(D)||D<0?0:D);let A=k?nb({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):rb({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=ib({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=ab({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let N=ob({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,N);let P=sb({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(P),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=Xy(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=Xy(e);return await g(n,t),n}function x(e){if(p){let t=Xy(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?T_(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?xh:Fh).scaleTo(eb(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?xh:Fh).scaleBy(eb(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!vv(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var lb;(function(e){e.Line=`line`,e.Handle=`handle`})(lb||={});function ub({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function db(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function fb(e,t){return Math.max(0,t-e)}function pb(e,t){return Math.max(0,e-t)}function mb(e,t,n){return Math.max(0,t-e,e-n)}function hb(e,t){return e?!t:t}function gb(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=mb(E,h,g),j=mb(D,_,v);if(o){let e=0,t=0;c&&w<0?e=fb(y+w+O,o[0][0]):!c&&w>0&&(e=pb(y+E+O,o[1][0])),l&&T<0?t=fb(b+T+k,o[0][1]):!l&&T>0&&(t=pb(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=pb(y+w,s[0][0]):!c&&w<0&&(e=fb(y+E,s[1][0])),l&&T>0?t=pb(b+T,s[0][1]):!l&&T<0&&(t=fb(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=mb(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?pb(b+k+E/C,o[1][1])*C:fb(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?fb(b+E/C,s[1][1])*C:pb(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=mb(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?pb(y+D*C+O,o[1][0])/C:fb(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?fb(y+D*C,s[1][0])/C:pb(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(hb(c,l)?-w:w)/C:w=(hb(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var _b={width:0,height:0,x:0,y:0},vb={..._b,pointerX:0,pointerY:0,aspectRatio:1};function yb(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function bb({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=rm(e),o={controlDirection:db(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={..._b},h={...vb};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:db(e)};let g,_=null,v=[],y,b,x,S=vm().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=Iv(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=Ov(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=yb(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=Iv(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:O,y:k}=gb(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),A=E!==S,j=D!==C,M=O!==u&&A,N=k!==f&&j;if(!M&&!N&&!A&&!j)return;let P={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((M||N||T[0]===1||T[1]===1)&&(w.x=M?O:m.x,w.y=N?k:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=O-u,t=k-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((A||j)&&(w.width=A&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=j&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let F=ub({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};if(p?.(e,I)===!1){m=P.prevValues,h.x=P.startX,h.y=P.startY,v.forEach((e,t)=>{e.position=P.childNodes[t].position});return}d?.(e,I),r(w,l)}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var xb=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},Sb=e=>e?xb(e):xb,{useDebugValue:Cb}=_.default,{useSyncExternalStoreWithSelector:wb}=xo.default,Tb=e=>e;function Eb(e,t=Tb,n){let r=wb(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Cb(r),r}var Db=(e,t)=>{let n=Sb(e),r=(e,r=t)=>Eb(n,e,r);return Object.assign(r,n),r},Ob=(e,t)=>e?Db(e,t):Db;function kb(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Ab=(0,_.createContext)(null),jb=Ab.Provider,Mb=F_.error001(`react`);function Nb(e,t){let n=(0,_.useContext)(Ab);if(n===null)throw Error(Mb);return Eb(n,e,t)}function Pb(){let e=(0,_.useContext)(Ab);if(e===null)throw Error(Mb);return(0,_.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Fb={display:`none`},Ib={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},Lb=`react-flow__node-desc`,Rb=`react-flow__edge-desc`,zb=`react-flow__aria-live`,Bb=e=>e.ariaLiveMessage,Vb=e=>e.ariaLabelConfig;function Hb({rfId:e}){let t=Nb(Bb);return(0,K.jsx)(`div`,{id:`${zb}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:Ib,children:t})}function Ub({rfId:e,disableKeyboardA11y:t}){let n=Nb(Vb);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{id:`${Lb}-${e}`,style:Fb,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,K.jsx)(`div`,{id:`${Rb}-${e}`,style:Fb,children:n[`edge.a11yDescription.default`]}),!t&&(0,K.jsx)(Hb,{rfId:e})]})}var Wb=(0,_.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,K.jsx)(`div`,{className:Zd([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});Wb.displayName=`Panel`;var Gb=`https://reactflow.dev?utm_source=attribution`;function Kb({proOptions:e,position:t=`bottom-right`}){return(0,_.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,K.jsx)(Wb,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Gb}`,children:(0,K.jsx)(`a`,{href:Gb,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var qb=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Jb=e=>e.id;function Yb(e,t){return kb(e.selectedNodes.map(Jb),t.selectedNodes.map(Jb))&&kb(e.selectedEdges.map(Jb),t.selectedEdges.map(Jb))}function Xb({onSelectionChange:e}){let t=Pb(),{selectedNodes:n,selectedEdges:r}=Nb(qb,Yb);return(0,_.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var Zb=e=>!!e.onSelectionChangeHandlers;function Qb({onSelectionChange:e}){let t=Nb(Zb);return e||t?(0,K.jsx)(Xb,{onSelectionChange:e}):null}var $b=[0,0],ex={x:0,y:0,zoom:1},tx=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],nx=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),rx={translateExtent:I_,nodeOrigin:$b,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function ix(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=Nb(nx,kb),l=Pb();(0,_.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=rx,s()}),[]);let u=(0,_.useRef)(rx);return(0,_.useEffect)(()=>{for(let s of tx){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Pv(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},tx.map(t=>e[t])),null}function ax(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function ox(e){let[t,n]=(0,_.useState)(e===`system`?null:e);return(0,_.useEffect)(()=>{if(e!==`system`){n(e);return}let t=ax(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?ax()?.matches?`dark`:`light`:t}var sx=typeof document<`u`?document:null;function cx(e=null,t={target:sx,actInsideInputWithModifier:!0}){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(!1),a=(0,_.useRef)(new Set([])),[o,s]=(0,_.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
|
|
20
|
+
`).replace(`
|
|
21
|
+
|
|
22
|
+
`,`
|
|
23
|
+
+`).split(`
|
|
24
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,_.useEffect)(()=>{let n=t?.target??sx,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&Bv(e))return!1;let n=ux(e.code,s);if(a.current.add(e[n]),lx(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=ux(e.code,s);lx(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function lx(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ux(e,t){return t.includes(e)?`code`:`key`}var dx=()=>{let e=Pb();return(0,_.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=Ev(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return xv(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=Sv(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function fx(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)px(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function px(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function mx(e,t){return fx(e,t)}function hx(e,t){return fx(e,t)}function gx(e,t){return{id:e,type:`select`,selected:t}}function _x(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(gx(a.id,e)))}return r}function vx({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function yx(e){return{id:e.id,type:`remove`}}var bx=yv(`React Flow`,`https://reactflow.dev/`);function xx(e,t,n={}){return $v(e,t,{...n,onError:n.onError??bx})}var Sx=e=>q_(e),Cx=e=>K_(e);function wx(e){return(0,_.forwardRef)(e)}var Tx=typeof window<`u`?_.useLayoutEffect:_.useEffect;function Ex(e){let[t,n]=(0,_.useState)(BigInt(0)),[r]=(0,_.useState)(()=>Dx(()=>n(e=>e+BigInt(1))));return Tx(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function Dx(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var Ox=(0,_.createContext)(null);function kx({children:e}){let t=Pb(),n=Ex((0,_.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=vx({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=Ex((0,_.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(vx({items:s,lookup:o}))},[])),i=(0,_.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,K.jsx)(Ox.Provider,{value:i,children:e})}function Ax(){let e=(0,_.useContext)(Ox);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var jx=e=>!!e.panZoom;function Mx(){let e=dx(),t=Pb(),n=Ax(),r=Nb(jx),i=(0,_.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=Sx(e)?e:n.get(e.id),a=i.parentId?jv(i.position,i.measured,i.parentId,n,r):i.position;return fv({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&Sx(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&Cx(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await rv({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(yx);o?.(f),c(e)}if(m){let e=d.map(yx);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=_v(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=fv(s?r:a),l=gv(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=_v(e)?e:a(e);if(!r)return!1;let i=gv(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return X_(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Nv();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,_.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var Nx=e=>e.selected,Px=typeof window<`u`?window:void 0;function Fx({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=Pb(),{deleteElements:r}=Mx(),i=cx(e,{actInsideInputWithModifier:!1}),a=cx(t,{target:Px});(0,_.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(Nx),edges:e.filter(Nx)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,_.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function Ix(e){let t=Pb();(0,_.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=Lv(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,F_.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var Lx={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Rx=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function zx({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=B_.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:v,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=Pb(),w=(0,_.useRef)(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=Nb(Rx,kb),O=cx(p),k=(0,_.useRef)();Ix(w);let A=(0,_.useCallback)(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[y,b]);return(0,_.useEffect)(()=>{if(w.current){k.current=cb({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=k.current.getViewport();return C.setState({panZoom:k.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{k.current?.destroy()}}},[]),(0,_.useEffect)(()=>{k.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:g,lib:E,onTransformChange:A,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,O,m,v,T,g,E,A,D,S,x]),(0,K.jsx)(`div`,{className:`react-flow__renderer`,ref:w,style:Lx,children:h})}var Bx=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Vx(){let{userSelectionActive:e,userSelectionRect:t}=Nb(Bx,kb);return e&&t?(0,K.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var Hx=(e,t)=>n=>{n.target===t.current&&e?.(n)},Ux=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Wx({isSelecting:e,selectionKeyPressed:t,selectionMode:n=V_.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,_.useRef)(0),v=Pb(),{userSelectionActive:y,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=Nb(Ux,kb),w=b&&(e||y),T=(0,_.useRef)(null),E=(0,_.useRef)(),D=(0,_.useRef)(new Set),O=(0,_.useRef)(new Set),k=(0,_.useRef)(!1),A=(0,_.useRef)(!1),j=(0,_.useRef)({x:0,y:0}),M=(0,_.useRef)(!1),N=e=>{if(A.current||k.current||v.getState().connection.inProgress){A.current=!1,k.current=!1;return}l?.(e),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},P=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},F=d?e=>d(e):void 0,I=e=>{A.current&&=(e.stopPropagation(),!1)},L=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=v.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),A.current=!1;let{x:c,y:l}=Hv(n.nativeEvent,E.current),u=xv({x:c,y:l},a);v.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function R(e,t){let{userSelectionRect:r}=v.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=v.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=Sv(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=O.current;D.current=new Set(Q_(a,m,i,n===V_.Partial,!0).map(e=>e.id)),O.current=new Set;let _=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??_)&&O.current.add(e)}}Mv(h,D.current)||c(_x(a,D.current,!0)),Mv(g,O.current)||l(_x(o,O.current)),v.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function z(){if(!i||!E.current)return;let[e,t]=cv(j.current,E.current,C);S({x:e,y:t}).then(e=>{if(!A.current||!e){g.current=requestAnimationFrame(z);return}let{x:t,y:n}=j.current;R(t,n),g.current=requestAnimationFrame(z)})}let ee=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};(0,_.useEffect)(()=>()=>ee(),[]);let B=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=v.getState();if(!E.current||!n)return;let{x:o,y:c}=Hv(e.nativeEvent,E.current);j.current={x:o,y:c};let l=Sv({x:n.startX,y:n.startY},r);if(!A.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}A.current=!0,M.current||=(z(),!0),R(o,c)},V=e=>{if(!w){e.target===T.current&&v.getState().connection.inProgress&&(k.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!y&&e.target===T.current&&v.getState().userSelectionRect&&N?.(e),v.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(e),v.setState({nodesSelectionActive:D.current.size>0})),ee())},H=e=>{e.target?.releasePointerCapture?.(e.pointerId),ee()},te=r===!0||Array.isArray(r)&&r.includes(0);return(0,K.jsxs)(`div`,{className:Zd([`react-flow__pane`,{draggable:te,dragging:x,selection:e}]),onClick:w?void 0:Hx(N,T),onContextMenu:Hx(P,T),onWheel:Hx(F,T),onPointerEnter:w?void 0:f,onPointerMove:w?B:p,onPointerUp:V,onPointerCancel:w?H:void 0,onPointerDownCapture:w?L:void 0,onClickCapture:w?I:void 0,onPointerLeave:m,ref:T,style:Lx,children:[h,(0,K.jsx)(Vx,{})]})}function Gx({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,F_.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function Kx({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=Pb(),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)();return(0,_.useEffect)(()=>{if(!t)return u.current=Ly({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Gx({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,_.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var qx=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Jx(){let e=Pb();return(0,_.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=qx(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=bv(t,i));let{position:a,positionAbsolute:s}=nv({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var Yx=(0,_.createContext)(null),Xx=Yx.Provider;Yx.Consumer;var Zx=()=>(0,_.useContext)(Yx),Qx=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),$x=(0,_.createContext)(null);function eS({children:e}){let t=Nb(Qx,kb);return(0,K.jsx)($x.Provider,{value:t,children:e})}function tS(){let e=(0,_.useContext)($x);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var nS={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},rS=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return nS;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===z_.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function iS({type:e=`source`,position:t=$.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=Pb(),_=Zx(),{connectOnClick:v,noPanClassName:y,rfId:b}=tS(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=Nb(rS(_,m,e),kb);_||g.getState().onError?.(`010`,F_.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(xx(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=Vv(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();qy.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,K.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Zd([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=Rv(t.target),h=n||c,{connection:v,isValid:y}=qy.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var aS=(0,_.memo)(wx(iS));function oS({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,K.jsxs)(K.Fragment,{children:[e?.label,(0,K.jsx)(aS,{type:`source`,position:n,isConnectable:t})]})}function sS({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(aS,{type:`target`,position:n,isConnectable:t}),e?.label,(0,K.jsx)(aS,{type:`source`,position:r,isConnectable:t})]})}function cS(){return null}function lS({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(aS,{type:`target`,position:n,isConnectable:t}),e?.label]})}var uS={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},dS={input:oS,default:sS,output:lS,group:cS};function fS(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var pS=e=>{let{width:t,height:n,x:r,y:i}=Z_(e.nodeLookup,{filter:e=>!!e.selected});return{width:vv(t)?t:null,height:vv(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function mS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=Pb(),{width:i,height:a,transformString:o,userSelectionActive:s}=Nb(pS,kb),c=Jx(),l=(0,_.useRef)(null);(0,_.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(Kx({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,K.jsx)(`div`,{className:Zd([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,K.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(uS,e.key)&&(e.preventDefault(),c({direction:uS[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var hS=typeof window<`u`?window:void 0,gS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _S({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:R}=Nb(gS,kb),z=cx(l,{target:hS}),ee=cx(h,{target:hS}),B=ee||w,V=ee||b,H=u&&B!==!0,te=z||R||H;return Fx({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,K.jsx)(zx,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:V,panActivationKeyPressed:ee,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!z&&B,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:H,children:(0,K.jsxs)(Wx,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:B,autoPanOnSelection:T,isSelecting:!!te,selectionMode:d,selectionKeyPressed:z,paneClickDistance:s,selectionOnDrag:H,children:[e,L&&(0,K.jsx)(mS,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}_S.displayName=`FlowRenderer`;var vS=(0,_.memo)(_S),yS=e=>t=>e?Q_(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function bS(e){return Nb((0,_.useCallback)(yS(e),[e]),kb)}var xS=e=>e.updateNodeInternals;function SS(){let e=Nb(xS),[t]=(0,_.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,_.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function CS({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=Pb(),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(e.sourcePosition),c=(0,_.useRef)(e.targetPosition),l=(0,_.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,_.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,_.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,_.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function wS({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=Nb(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},kb),S=y.type||`default`,C=g?.[S]||dS[S];C===void 0&&(v?.(`003`,F_.error003(S)),S=`default`,C=g?.default||dS.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=Pb(),k=Av(y),A=CS({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=Kx({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=Jx();if(y.hidden)return null;let N=kv(y),P=fS(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,R=i?e=>i(e,{...b.userNode}):void 0,z=a?e=>a(e,{...b.userNode}):void 0,ee=o?e=>o(e,{...b.userNode}):void 0,B=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&Gx({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},V=t=>{if(!(Bv(t.nativeEvent)||m)){if(L_.includes(t.key)&&T){let n=t.key===`Escape`;Gx({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(uS,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:uS[t.key],factor:t.shiftKey?4:1})}}},H=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Q_(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,K.jsx)(`div`,{className:Zd([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:R,onContextMenu:z,onClick:B,onDoubleClick:ee,onKeyDown:D?V:void 0,tabIndex:D?0:void 0,onFocus:D?H:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${Lb}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,K.jsx)(Xx,{value:e,children:(0,K.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var TS=(0,_.memo)(wS),ES=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function DS(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=Nb(ES,kb),a=bS(e.onlyRenderVisibleElements),o=SS();return(0,K.jsx)(`div`,{className:`react-flow__nodes`,style:Lx,children:a.map(a=>(0,K.jsx)(TS,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}DS.displayName=`NodeRenderer`;var OS=(0,_.memo)(DS);function kS(e){return Nb((0,_.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Xv({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),kb)}var AS=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,K.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},jS=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,K.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},MS={[W_.Arrow]:AS,[W_.ArrowClosed]:jS};function NS(e){let t=Pb();return(0,_.useMemo)(()=>Object.prototype.hasOwnProperty.call(MS,e)?MS[e]:(t.getState().onError?.(`009`,F_.error009(e)),null),[e])}var PS=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=NS(t);return c?(0,K.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,K.jsx)(c,{color:n,strokeWidth:o})}):null},FS=({defaultColor:e,rfId:t})=>{let n=Nb(e=>e.edges),r=Nb(e=>e.defaultEdgeOptions),i=(0,_.useMemo)(()=>py(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,K.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,K.jsx)(`defs`,{children:i.map(e=>(0,K.jsx)(PS,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};FS.displayName=`MarkerDefinitions`;var IS=(0,_.memo)(FS);function LS({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,_.useState)({x:1,y:0,width:0,height:0}),p=Zd([`react-flow__edge-textwrapper`,l]),m=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,K.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,K.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,K.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}LS.displayName=`EdgeText`;var RS=(0,_.memo)(LS);function zS({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`path`,{...u,d:e,fill:`none`,className:Zd([`react-flow__edge-path`,u.className])}),l?(0,K.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&vv(t)&&vv(n)?(0,K.jsx)(RS,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function BS({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function VS({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=BS({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=BS({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Wv({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function HS(e){return(0,_.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=VS({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,K.jsx)(zS,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var US=HS({isInternal:!1}),WS=HS({isInternal:!0});US.displayName=`SimpleBezierEdge`,WS.displayName=`SimpleBezierEdgeInternal`;function GS(e){return(0,_.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=oy({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,K.jsx)(zS,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var KS=GS({isInternal:!1}),qS=GS({isInternal:!0});KS.displayName=`SmoothStepEdge`,qS.displayName=`SmoothStepEdgeInternal`;function JS(e){return(0,_.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,K.jsx)(KS,{...n,id:r,pathOptions:(0,_.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var YS=JS({isInternal:!1}),XS=JS({isInternal:!0});YS.displayName=`StepEdge`,XS.displayName=`StepEdgeInternal`;function ZS(e){return(0,_.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=ey({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,K.jsx)(zS,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var QS=ZS({isInternal:!1}),$S=ZS({isInternal:!0});QS.displayName=`StraightEdge`,$S.displayName=`StraightEdgeInternal`;function eC(e){return(0,_.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=qv({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,K.jsx)(zS,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var tC=eC({isInternal:!1}),nC=eC({isInternal:!0});tC.displayName=`BezierEdge`,nC.displayName=`BezierEdgeInternal`;var rC={default:nC,straight:$S,step:XS,smoothstep:qS,simplebezier:WS},iC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},aC=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,oC=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,sC=`react-flow__edgeupdater`;function cC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,K.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Zd([sC,`${sC}-${s}`]),cx:aC(t,r,e),cy:oC(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function lC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=Pb(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;qy.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,K.jsxs)(K.Fragment,{children:[(e===!0||e===`source`)&&(0,K.jsx)(cC,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,K.jsx)(cC,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function uC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:v,disableKeyboardA11y:y}){let b=Nb(t=>t.edgeLookup.get(e)),x=Nb(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||rC[S];C===void 0&&(v?.(`011`,F_.error011(S)),S=`default`,C=h?.default||rC.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=(0,_.useRef)(null),[O,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(!1),M=Pb(),{zIndex:N=b.zIndex,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:R,targetPosition:z}=Nb((0,_.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return iC;let i=cy({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:v}),a=Yv({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||iC,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,v]),kb),ee=(0,_.useMemo)(()=>b.markerStart?`url('#${fy(b.markerStart,m)}')`:void 0,[b.markerStart,m]),B=(0,_.useMemo)(()=>b.markerEnd?`url('#${fy(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||P===null||F===null||I===null||L===null)return null;let V=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();E&&(M.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},H=a?e=>{a(e,{...b})}:void 0,te=o?e=>{o(e,{...b})}:void 0,U=s?e=>{s(e,{...b})}:void 0,ne=c?e=>{c(e,{...b})}:void 0,re=l?e=>{l(e,{...b})}:void 0;return(0,K.jsx)(`svg`,{style:{zIndex:N},children:(0,K.jsxs)(`g`,{className:Zd([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:O,selectable:E}]),onClick:V,onDoubleClick:H,onContextMenu:te,onMouseEnter:U,onMouseMove:ne,onMouseLeave:re,onKeyDown:w?t=>{if(!y&&L_.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${Rb}-${m}`:void 0,ref:D,...b.domAttributes,children:[!A&&(0,K.jsx)(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:R,targetPosition:z,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:ee,markerEnd:B,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&(0,K.jsx)(lC,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:R,targetPosition:z,setUpdateHover:k,setReconnecting:j})]})})}var dC=(0,_.memo)(uC),fC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function pC({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=Nb(fC,kb),b=kS(t);return(0,K.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,K.jsx)(IS,{defaultColor:e,rfId:n}),b.map(e=>(0,K.jsx)(dC,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}pC.displayName=`EdgeRenderer`;var mC=(0,_.memo)(pC),hC=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function gC({children:e}){let t=Pb(),n=(0,_.useRef)(null),[r]=(0,_.useState)(()=>t.getState().transform);return Tx(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=hC(r)))};return r(),t.subscribe(r)},[t]),(0,K.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:hC(r)},children:e})}function _C(e){let t=Mx(),n=(0,_.useRef)(!1);(0,_.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var vC=e=>e.panZoom?.syncViewport;function yC(e){let t=Nb(vC),n=Pb();return(0,_.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function bC(e){return e.connection.inProgress?{...e.connection,to:xv(e.connection.to,e.transform)}:{...e.connection}}function xC(e){return e?t=>e(bC(t)):bC}function SC(e){return Nb(xC(e),kb)}var CC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function wC({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=Nb(CC,kb);return a&&i&&c?(0,K.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,K.jsx)(`g`,{className:Zd([`react-flow__connection`,Fv(s)]),children:(0,K.jsx)(TC,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var TC=({style:e,type:t=U_.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=SC();if(!i)return;if(n)return(0,K.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:Fv(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case U_.Bezier:[m]=qv(h);break;case U_.SimpleBezier:[m]=VS(h);break;case U_.Step:[m]=oy({...h,borderRadius:0});break;case U_.SmoothStep:[m]=oy(h);break;default:[m]=ey(h)}return(0,K.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};TC.displayName=`ConnectionLine`;var EC={};function DC(e=EC){(0,_.useRef)(e),Pb(),(0,_.useEffect)(()=>{},[e])}function OC(){Pb(),(0,_.useRef)(!1),(0,_.useEffect)(()=>{},[])}function kC({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:R,panOnDrag:z,autoPanOnSelection:ee,onPaneClick:B,onPaneMouseEnter:V,onPaneMouseMove:H,onPaneMouseLeave:te,onPaneScroll:U,onPaneContextMenu:ne,paneClickDistance:re,nodeClickDistance:ie,onEdgeContextMenu:ae,onEdgeMouseEnter:oe,onEdgeMouseMove:se,onEdgeMouseLeave:ce,reconnectRadius:le,onReconnect:ue,onReconnectStart:de,onReconnectEnd:fe,noDragClassName:pe,noWheelClassName:me,noPanClassName:he,disableKeyboardA11y:ge,nodeExtent:_e,rfId:ve,viewport:ye,onViewportChange:be,nodesDraggable:xe}){return DC(e),DC(t),OC(),_C(n),yC(ye),(0,K.jsx)(vS,{onPaneClick:B,onPaneMouseEnter:V,onPaneMouseMove:H,onPaneMouseLeave:te,onPaneContextMenu:ne,onPaneScroll:U,paneClickDistance:re,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:R,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:z,autoPanOnSelection:ee,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:pe,noWheelClassName:me,noPanClassName:he,disableKeyboardA11y:ge,onViewportChange:be,isControlledViewport:!!ye,children:(0,K.jsxs)(gC,{children:[(0,K.jsx)(mC,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ue,onReconnectStart:de,onReconnectEnd:fe,onlyRenderVisibleElements:T,onEdgeContextMenu:ae,onEdgeMouseEnter:oe,onEdgeMouseMove:se,onEdgeMouseLeave:ce,reconnectRadius:le,defaultMarkerColor:M,noPanClassName:he,disableKeyboardA11y:ge,rfId:ve}),(0,K.jsx)(wC,{style:h,type:m,component:g,containerStyle:_}),(0,K.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,K.jsx)(OS,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ie,onlyRenderVisibleElements:T,noPanClassName:he,noDragClassName:pe,disableKeyboardA11y:ge,nodeExtent:_e,rfId:ve,nodesDraggable:xe}),(0,K.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}kC.displayName=`GraphView`;var AC=(0,_.memo)(kC),jC=yv(`React Flow`,`https://reactflow.dev/`),MC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??I_;jy(h,g,_);let{nodesInitialized:x}=Sy(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Ev(Z_(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:I_,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:z_.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...H_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:jC,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:R_,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},NC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>Ob((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await tv({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...MC({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=Sy(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();jy(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=Oy(e,n,r,i,a,o,l);d&&(yy(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=uy(e,o.fromHandle,$.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=Dy(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(mx(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(hx(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>gx(e,!0)));return}i(_x(r,new Set([...e]),!0)),a(_x(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>gx(e,!0)));return}a(_x(n,new Set([...e]))),i(_x(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(gx(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(gx(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,gx(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,gx(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(Sy(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return ky({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...H_}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...MC()})}},Object.is);function PC({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,_.useState)(()=>NC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,K.jsx)(jb,{value:m,children:(0,K.jsx)(kx,{children:(0,K.jsx)(eS,{children:p})})})}function FC({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,_.useContext)(Ab)?(0,K.jsx)(K.Fragment,{children:e}):(0,K.jsx)(PC,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var IC={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function LC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:v,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onBeforeDelete:L,connectionMode:R,connectionLineType:z=U_.Bezier,connectionLineStyle:ee,connectionLineComponent:B,connectionLineContainerStyle:V,deleteKeyCode:H=`Backspace`,selectionKeyCode:te=`Shift`,selectionOnDrag:U=!1,selectionMode:ne=V_.Full,panActivationKeyCode:re=`Space`,multiSelectionKeyCode:ie=Dv()?`Meta`:`Control`,zoomActivationKeyCode:ae=Dv()?`Meta`:`Control`,snapToGrid:oe,snapGrid:se,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:le,nodesDraggable:ue,autoPanOnNodeFocus:de,nodesConnectable:fe,nodesFocusable:pe,nodeOrigin:me=$b,edgesFocusable:he,edgesReconnectable:ge,elementsSelectable:_e=!0,defaultViewport:ve=ex,minZoom:ye=.5,maxZoom:be=2,translateExtent:xe=I_,preventScrolling:Se=!0,nodeExtent:Ce,defaultMarkerColor:we=`#b1b1b7`,zoomOnScroll:Te=!0,zoomOnPinch:Ee=!0,panOnScroll:De=!1,panOnScrollSpeed:Oe=.5,panOnScrollMode:ke=B_.Free,zoomOnDoubleClick:Ae=!0,panOnDrag:je=!0,onPaneClick:Me,onPaneMouseEnter:Ne,onPaneMouseMove:Pe,onPaneMouseLeave:Fe,onPaneScroll:Ie,onPaneContextMenu:Le,paneClickDistance:Re=1,nodeClickDistance:ze=0,children:Be,onReconnect:Ve,onReconnectStart:He,onReconnectEnd:Ue,onEdgeContextMenu:W,onEdgeDoubleClick:We,onEdgeMouseEnter:Ge,onEdgeMouseMove:Ke,onEdgeMouseLeave:qe,reconnectRadius:Je=10,onNodesChange:Ye,onEdgesChange:Xe,noDragClassName:Ze=`nodrag`,noWheelClassName:Qe=`nowheel`,noPanClassName:$e=`nopan`,fitView:et,fitViewOptions:tt,connectOnClick:nt,attributionPosition:rt,proOptions:it,defaultEdgeOptions:at,elevateNodesOnSelect:ot=!0,elevateEdgesOnSelect:st=!1,disableKeyboardA11y:ct=!1,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanOnSelection:dt=!0,autoPanSpeed:ft,connectionRadius:pt,isValidConnection:mt,onError:ht,style:gt,id:_t,nodeDragThreshold:vt,connectionDragThreshold:yt,viewport:bt,onViewportChange:xt,width:St,height:Ct,colorMode:wt=`light`,debug:Tt,onScroll:Et,ariaLabelConfig:Dt,zIndexMode:Ot=`basic`,...kt},At){let jt=_t||`1`,Mt=ox(wt),Nt=(0,_.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Et?.(e)},[Et]);return(0,K.jsx)(`div`,{"data-testid":`rf__wrapper`,...kt,onScroll:Nt,style:{...gt,...IC},ref:At,className:Zd([`react-flow`,i,Mt]),id:_t,role:`application`,children:(0,K.jsxs)(FC,{nodes:e,edges:t,width:St,height:Ct,fitView:et,fitViewOptions:tt,minZoom:ye,maxZoom:be,nodeOrigin:me,nodeExtent:Ce,zIndexMode:Ot,children:[(0,K.jsx)(ix,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:v,nodesDraggable:ue,autoPanOnNodeFocus:de,nodesConnectable:fe,nodesFocusable:pe,edgesFocusable:he,edgesReconnectable:ge,elementsSelectable:_e,elevateNodesOnSelect:ot,elevateEdgesOnSelect:st,minZoom:ye,maxZoom:be,nodeExtent:Ce,onNodesChange:Ye,onEdgesChange:Xe,snapToGrid:oe,snapGrid:se,connectionMode:R,translateExtent:xe,connectOnClick:nt,defaultEdgeOptions:at,fitView:et,fitViewOptions:tt,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:$e,nodeOrigin:me,rfId:jt,autoPanOnConnect:lt,autoPanOnNodeDrag:ut,autoPanSpeed:ft,onError:ht,connectionRadius:pt,isValidConnection:mt,selectNodesOnDrag:le,nodeDragThreshold:vt,connectionDragThreshold:yt,onBeforeDelete:L,debug:Tt,ariaLabelConfig:Dt,zIndexMode:Ot}),(0,K.jsx)(AC,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:z,connectionLineStyle:ee,connectionLineComponent:B,connectionLineContainerStyle:V,selectionKeyCode:te,selectionOnDrag:U,selectionMode:ne,deleteKeyCode:H,multiSelectionKeyCode:ie,panActivationKeyCode:re,zoomActivationKeyCode:ae,onlyRenderVisibleElements:ce,defaultViewport:ve,translateExtent:xe,minZoom:ye,maxZoom:be,preventScrolling:Se,zoomOnScroll:Te,zoomOnPinch:Ee,zoomOnDoubleClick:Ae,panOnScroll:De,panOnScrollSpeed:Oe,panOnScrollMode:ke,panOnDrag:je,autoPanOnSelection:dt,onPaneClick:Me,onPaneMouseEnter:Ne,onPaneMouseMove:Pe,onPaneMouseLeave:Fe,onPaneScroll:Ie,onPaneContextMenu:Le,paneClickDistance:Re,nodeClickDistance:ze,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onReconnect:Ve,onReconnectStart:He,onReconnectEnd:Ue,onEdgeContextMenu:W,onEdgeDoubleClick:We,onEdgeMouseEnter:Ge,onEdgeMouseMove:Ke,onEdgeMouseLeave:qe,reconnectRadius:Je,defaultMarkerColor:we,noDragClassName:Ze,noWheelClassName:Qe,noPanClassName:$e,rfId:jt,disableKeyboardA11y:ct,nodeExtent:Ce,viewport:bt,onViewportChange:xt,nodesDraggable:ue}),(0,K.jsx)(Qb,{onSelectionChange:A}),Be,(0,K.jsx)(Kb,{proOptions:it,position:rt}),(0,K.jsx)(Ub,{rfId:jt,disableKeyboardA11y:ct})]})})}var RC=wx(LC);F_.error014();function zC({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,K.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Zd([`react-flow__background-pattern`,n,r])})}function BC({radius:e,className:t}){return(0,K.jsx)(`circle`,{cx:e,cy:e,r:e,className:Zd([`react-flow__background-pattern`,`dots`,t])})}var VC;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(VC||={});var HC={[VC.Dots]:1,[VC.Lines]:1,[VC.Cross]:6},UC=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function WC({id:e,variant:t=VC.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,_.useRef)(null),{transform:f,patternId:p}=Nb(UC,kb),m=r||HC[t],h=t===VC.Dots,g=t===VC.Cross,v=Array.isArray(n)?n:[n,n],y=[v[0]*f[2]||1,v[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:y,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${p}${e||``}`;return(0,K.jsxs)(`svg`,{className:Zd([`react-flow__background`,l]),style:{...c,...Lx,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,K.jsx)(`pattern`,{id:w,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,K.jsx)(BC,{radius:b/2,className:u}):(0,K.jsx)(zC,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,K.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}WC.displayName=`Background`;var GC=(0,_.memo)(WC);function KC(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,K.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function qC(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,K.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function JC(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,K.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function YC(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,K.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function XC(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,K.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function ZC({children:e,className:t,...n}){return(0,K.jsx)(`button`,{type:`button`,className:Zd([`react-flow__controls-button`,t]),...n,children:e})}var QC=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function $C({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=Pb(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=Nb(QC,kb),{zoomIn:y,zoomOut:b,fitView:x}=Mx();return(0,K.jsxs)(Wb,{className:Zd([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ZC,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,K.jsx)(KC,{})}),(0,K.jsx)(ZC,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,K.jsx)(qC,{})})]}),n&&(0,K.jsx)(ZC,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,K.jsx)(JC,{})}),r&&(0,K.jsx)(ZC,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,K.jsx)(XC,{}):(0,K.jsx)(YC,{})}),u]})}$C.displayName=`Controls`;var ew=(0,_.memo)($C);function tw({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,K.jsx)(`rect`,{className:Zd([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var nw=(0,_.memo)(tw),rw=e=>e.nodes.map(e=>e.id),iw=e=>e instanceof Function?e:()=>e;function aw({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=nw,onClick:o}){let s=Nb(rw,kb),c=iw(t),l=iw(e),u=iw(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,K.jsx)(K.Fragment,{children:s.map(e=>(0,K.jsx)(sw,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function ow({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=Nb(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=kv(r);return{node:r,x:i,y:a,width:o,height:s}},kb);return!l||l.hidden||!Av(l)?null:(0,K.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var sw=(0,_.memo)(ow),cw=(0,_.memo)(aw),lw=200,uw=150,dw=e=>!e.hidden,fw=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?mv(Z_(e.nodeLookup,{filter:dw}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},pw=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,mw=(e,t)=>pw(e.viewBB,t.viewBB)&&pw(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,hw=`react-flow__minimap-desc`;function gw({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:v,inversePan:y,zoomStep:b=1,offsetScale:x=5}){let S=Pb(),C=(0,_.useRef)(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:O,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=Nb(fw,mw),M=e?.width??lw,N=e?.height??uw,P=w.width/M,F=w.height/N,I=Math.max(P,F),L=I*M,R=I*N,z=x*I,ee=w.x-(L-w.width)/2-z,B=w.y-(R-w.height)/2-z,V=L+z*2,H=R+z*2,te=`${hw}-${D}`,U=(0,_.useRef)(0),ne=(0,_.useRef)();U.current=I,(0,_.useEffect)(()=>{let e=S.getState().panZoom;if(C.current&&e)return ne.current=Jy({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>U.current}),()=>{ne.current?.destroy()}},[T]),(0,_.useEffect)(()=>{ne.current?.update({translateExtent:O,width:k,height:A,inversePan:y,pannable:h,zoomStep:b,zoomable:g})},[h,g,y,b,O,k,A]);let re=p?e=>{let[t,n]=ne.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ie=(0,_.useCallback)((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),ae=m?ie:void 0,oe=v??j[`minimap.ariaLabel`];return(0,K.jsx)(Wb,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*I:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:Zd([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,K.jsxs)(`svg`,{width:M,height:N,viewBox:`${ee} ${B} ${V} ${H}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":te,ref:C,onClick:re,children:[oe&&(0,K.jsx)(`title`,{id:te,children:oe}),(0,K.jsx)(cw,{onClick:ae,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,K.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ee-z},${B-z}h${V+z*2}v${H+z*2}h${-V-z*2}z
|
|
25
|
+
M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}gw.displayName=`MiniMap`;var _w=(0,_.memo)(gw),vw=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,yw={[lb.Line]:`right`,[lb.Handle]:`bottom-right`};function bw({nodeId:e,position:t,variant:n=lb.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:v}){let y=Zx(),b=typeof e==`string`?e:y,x=Pb(),S=(0,_.useRef)(null),C=n===lb.Handle,w=Nb((0,_.useCallback)(vw(C&&p),[C,p]),kb),T=(0,_.useRef)(null),E=t??yw[n];(0,_.useEffect)(()=>{if(S.current&&b)return T.current||=bb({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=Dy([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...jv({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:v,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,v,m]);let D=E.split(`-`);return(0,K.jsx)(`div`,{className:Zd([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,_.memo)(bw);var xw=3,Sw=60,Cw=140,ww=e=>e.replace(/\s+/g,` `).trim();function Tw(e){let t=ww(e.description||e.proposed||e.name||`Tool call`);return t.length>Sw?`${t.slice(0,59)}…`:t}function Ew(e,t){if(t?.status===`ready`&&t.text)return t.text;if(e.length){let t=[...new Set(e.map(Tw))],n=t.slice(0,xw),r=n.join(` · `)+(t.length>n.length?` · +${t.length-n.length} more`:``);return r.length>Cw?`${r.slice(0,139)}…`:r}return t?.status===`loading`?`Summarizing…`:t?.status===`error`?`Summary unavailable.`:`No tool calls in this request.`}var Dw=`raytrace-theme`;function Ow(){try{return localStorage.getItem(Dw)===`dark`?`dark`:`light`}catch{return`light`}}function kw(){return typeof document<`u`&&document.documentElement.dataset.theme===`dark`?`dark`:`light`}function Aw(e){document.documentElement.dataset.theme=e;try{localStorage.setItem(Dw,e)}catch{}}typeof document<`u`&&(document.documentElement.dataset.theme=Ow());function jw(e){let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()}function Mw(){return(0,_.useSyncExternalStore)(jw,kw,()=>`light`)}var Nw=236,Pw=300;function Fw({data:e}){let t=e.failed===null?``:e.failed?`graph-node-fail`:`graph-node-ok`;return(0,K.jsxs)(`button`,{type:`button`,className:`graph-node ${t}`,onClick:e.onClick,children:[(0,K.jsx)(aS,{type:`target`,position:$.Left,style:{opacity:0}}),(0,K.jsx)(aS,{type:`source`,position:$.Right,style:{opacity:0}}),(0,K.jsxs)(`div`,{className:`graph-node-head`,children:[(0,K.jsxs)(`span`,{className:`graph-node-num`,children:[`Request #`,e.number]}),e.failed!==null&&(0,K.jsx)(`span`,{className:`graph-node-status ${e.failed?`fail`:`ok`}`,children:e.failed?`Failed`:`OK`})]}),(0,K.jsx)(`p`,{className:`graph-node-summary`,children:e.summaryText}),(0,K.jsxs)(`div`,{className:`graph-node-meta`,children:[(0,K.jsx)(`span`,{children:id(e.cost,e.costEstimated)}),(0,K.jsx)(`span`,{children:ad(e.durationMs)}),e.totalCalls>0&&(0,K.jsxs)(`span`,{className:e.verifiedCount===e.totalCalls?`graph-node-verified-all`:`graph-node-verified-partial`,children:[e.verifiedCount,`/`,e.totalCalls,` verified`]})]})]})}var Iw={request:Fw};function Lw({trace:e,blocks:t,summaries:n,onSelectStep:r}){let i=Mw(),{nodes:a,edges:o}=(0,_.useMemo)(()=>{let i=new Map((e.requests||[]).map(e=>[e.id,e])),a=new Map;for(let t of e.callVerifications||[]){let e=a.get(t.exchange_id)||[];e.push(t),a.set(t.exchange_id,e)}let o=t.map((e,t)=>{let o=i.get(e.exchangeId),s=n[e.exchangeId],c=a.get(e.exchangeId)||[],l=e.completion?De(e.completion):null;return{id:e.exchangeId,type:`request`,position:{x:t*Pw,y:0},data:{number:e.number,summaryText:Ew(c,s),failed:l,cost:o?.cost??null,costEstimated:o?.costEstimated??!1,durationMs:o?.durationMs??null,verifiedCount:c.filter(e=>e.verified).length,totalCalls:c.length,onClick:()=>r(e.items[0]?.index??0)},style:{width:Nw}}}),s=[];for(let e=0;e<t.length-1;e++){let n=t[e],r=t[e+1],i=a.get(n.exchangeId)||[],o=i.filter(e=>e.verified).length,c=i.length>0&&o===i.length,l=o>0&&o<i.length,u=i.length?`${o}/${i.length} verified`:void 0;s.push({id:`seq-${n.exchangeId}-${r.exchangeId}`,source:n.exchangeId,target:r.exchangeId,label:u,style:{stroke:c?`#3d7a5e`:l?`#8a7233`:i.length?`#7a3d45`:`var(--line)`},labelStyle:{fill:`var(--muted)`,fontSize:10},labelBgStyle:{fill:`var(--deep)`}})}return{nodes:o,edges:s}},[e,t,n,r]);return t.length?(0,K.jsx)(`div`,{className:`graph-canvas`,children:(0,K.jsxs)(RC,{nodes:a,edges:o,nodeTypes:Iw,fitView:!0,proOptions:{hideAttribution:!0},colorMode:i,children:[(0,K.jsx)(GC,{color:i===`dark`?`#30343a`:`#d5d8dc`,gap:24}),(0,K.jsx)(ew,{showInteractive:!1}),(0,K.jsx)(_w,{pannable:!0,zoomable:!0,style:{background:`var(--deep)`},maskColor:i===`dark`?`rgba(17,19,21,0.75)`:`rgba(255,255,255,0.75)`,nodeColor:i===`dark`?`#30343a`:`#d5d8dc`})]})}):(0,K.jsx)(`div`,{className:`graph-empty`,children:`No model requests captured for this trace yet.`})}var Rw=[``,`Minimal`,`Low`,`Moderate`,`High`,`Critical`],zw=[``,`Ignore`,`Routine`,`Watch`,`Review carefully`,`Lock down`],Bw={"content-type":`application/json`,"x-raytace-experiment":`1`};async function Vw(e,t){let n=await e.json().catch(()=>({}));if(!e.ok)throw Error(n.error||t);return n}var Hw=async e=>Vw(await x().fetch(`/raytace/sandboxes/${e}/files`,{cache:`no-store`}),`The initial scan could not be loaded.`),Uw=async(e,t)=>Vw(await x().fetch(`/raytace/sandboxes/${e}/files`,{method:`POST`,headers:Bw,body:JSON.stringify({updates:t})}),`That change could not be saved.`),Ww=async(e,t,n,r)=>Vw(await x().fetch(`/raytace/sandboxes/${e}/activity${t||n?`?${t?`since=${Math.floor(t)}`:``}${t&&n?`&`:``}${n?`until=${Math.ceil(n)}`:``}`:``}`,{cache:`no-store`,signal:r}),`Sandbox activity could not be loaded.`),Gw=async e=>Vw(await x().fetch(`/raytace/alerts${e?`?sandbox=${e}`:``}`,{cache:`no-store`}),`Alerts could not be loaded.`);async function Kw(){try{let e=await x().fetch(`/raytace/me`,{cache:`no-store`});if(!e.ok)return null;let t=await e.json();return typeof t.notify_email==`boolean`?t.notify_email:null}catch{return null}}var qw=async e=>Vw(await x().fetch(`/raytace/me`,{method:`POST`,headers:Bw,body:JSON.stringify({notify_email:e})}),`That setting could not be saved.`),Jw=async e=>Vw(await x().fetch(`/raytace/alerts/seen`,{method:`POST`,headers:Bw,body:JSON.stringify({ids:e})}),`Alerts could not be marked seen.`),Yw=new Map;function Xw(e){let[t,n]=(0,_.useState)(new Map);return(0,_.useEffect)(()=>{if(!e)return;let t=!1;return Yw.has(e)||Yw.set(e,Hw(e).then(e=>new Map(e.files.map(e=>[e.path,e])),()=>(Yw.delete(e),new Map))),Yw.get(e).then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}var Zw=e=>{Yw.delete(e)},Qw={read:`Read`,created:`Created`,changed:`Changed`,emptied:`Emptied`,appended:`Appended to`,deleted:`Deleted`,renamed:`Renamed`,permissions_changed:`Permissions changed`,attempted:`Refused`,opened_for_writing:`Opened for writing, not changed`},$w={read:`a read`,write:`a write`,delete:`a delete`,rename:`a rename`,permissions:`a permission change`},eT={confirmed:[`confirmed`,`The kernel saw the call, and the file shows its effect.`],attempted:[`refused`,`The kernel refused the call. Nothing changed.`],possible:[`possible`,`The file was opened for writing and is as it was.`],one_of:[`one of several`,`More than one process made such a call at that moment; this is the likeliest.`],unattributed:[`no call seen`,`The file changed on disk and the kernel reported no call for it: events may have been lost, or it was changed another way.`]},tT={connected:[`connected`,`The connection was made.`],attempted:[`attempted`,`The program did not wait for the result, so the call says only that it tried.`],refused_by_policy:[`refused by the firewall`,`A private address: the sandbox firewall rejects it, whatever the call returned.`],failed:[`failed`,`The connection was not made.`],listening:[`listening`,`The program accepts connections here. Nothing outside the sandbox network is routed to it.`]},nT=e=>new Date(e*1e3).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`,second:`2-digit`}),rT=e=>e>1?` ×${e.toLocaleString()}`:``,iT=e=>e?e.slice(0,8):null;function aT(e){let t=e.basis??{},n=iT(t.before?.sha256),r=iT(t.after?.sha256);return[t.syscall&&`Call: ${t.syscall}${t.errno?` (${t.errno})`:``}`,t.watcher?.length&&`Seen on disk: ${t.watcher.join(`, `)}`,n&&r&&n!==r&&`SHA-256 ${n}… → ${r}…`,t.path_from&&{argv:`The file is named in the program's own arguments.`,argv_folder:`A folder in the program's arguments holds the file.`,argv_text:`The file's name appears in the program's arguments.`}[t.path_from],t.candidates?.length&&`Also at that moment: ${t.candidates.map(e=>e.process??`pid ${e.pid}`).join(`, `)}`,t.note].filter(Boolean).join(`
|
|
26
|
+
`)}function oT({fact:e,step:t,onOpenCall:n}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`td`,{title:e.command??void 0,children:e.process??(0,K.jsx)(`span`,{className:`rt-muted`,children:`–`})}),(0,K.jsx)(`td`,{className:`rt-scan-open`,children:t&&(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>n(t.trace,t.call),children:[`Open the step `,(0,K.jsx)(P,{size:11})]})})]})}function sT({fact:e}){return(0,K.jsxs)(K.Fragment,{children:[Object.entries(e.outcomes).map(([e,t],n)=>(0,K.jsxs)(`span`,{title:tT[e]?.[1],className:e===`refused_by_policy`||e===`failed`?`exec-fail`:void 0,children:[n?` · `:``,tT[e]?.[0]??e,rT(t)]},e)),e.errno&&(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` (`,e.errno,`)`]})]})}function cT({fact:e}){let[t,n]=(0,_.useState)(!1),r=t?e.packages:e.packages.slice(0,12);return(0,K.jsxs)(K.Fragment,{children:[r.map(e=>(0,K.jsxs)(`code`,{title:e.source,className:`rt-package`,children:[e.name,`@`,e.version]},`${e.name}@${e.version}`)),e.packages.length>r.length&&(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>n(!0),children:[`and `,(e.total-r.length).toLocaleString(),` more`]}),t&&e.total>e.packages.length&&(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` and `,(e.total-e.packages.length).toLocaleString(),` not listed`]})]})}function lT({box:e,stepFor:t,onOpenCall:n}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null);if((0,_.useEffect)(()=>{i(null),o(null);let t=!1,n,r=async()=>{try{let n=await Ww(e);t||(i(n),o(null))}catch(e){t||o(e instanceof Error?e.message:`Sandbox activity could not be loaded.`)}t||(n=setTimeout(r,1e4))};return r(),()=>{t=!0,clearTimeout(n)}},[e]),a&&!r)return(0,K.jsx)(`p`,{role:`alert`,className:`rt-problem`,children:a});if(!r)return(0,K.jsx)(`p`,{className:`rt-empty`,children:`Loading…`});let s=new Set(r.network.map(e=>e.host).filter(Boolean)),c=r.lookups.filter(e=>!s.has(e.name)),l=!r.network.length&&!r.packages.length&&!r.files.length&&!r.lookups.length&&!r.bulk.length&&!r.identity.length,u=[...r.network,...r.files,...r.packages].some(e=>e.coverage===`gaps`);return l?(0,K.jsx)(`p`,{className:`rt-empty`,children:`Nothing recorded yet. The kernel layer of the sandbox reports every connection the agent makes, the packages it installs, and what happens to files marked Report or Restrict. A sandbox started before this was turned on reports once it is stopped and started again.`}):(0,K.jsxs)(K.Fragment,{children:[u&&(0,K.jsxs)(`p`,{className:`rt-problem`,children:[`Some events were lost while these were recorded, so a row marked `,(0,K.jsx)(`em`,{children:`gaps`}),` may not be all that happened.`]}),(0,K.jsxs)(`div`,{className:`rt-list-head`,children:[(0,K.jsx)(`span`,{children:`NETWORK`}),(0,K.jsxs)(`small`,{children:[r.network.length,` destination`,r.network.length===1?``:`s`,r.more.includes(`network`)?`, newest shown`:``]})]}),r.network.length?(0,K.jsx)(`div`,{className:`rt-table-wrap`,children:(0,K.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`Last`}),(0,K.jsx)(`th`,{children:`Destination`}),(0,K.jsx)(`th`,{children:`Result`}),(0,K.jsx)(`th`,{children:`Program`}),(0,K.jsx)(`th`,{children:`Step`})]})}),(0,K.jsx)(`tbody`,{children:r.network.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{children:(0,K.jsx)(`time`,{children:nT(e.at)})}),(0,K.jsxs)(`td`,{children:[(0,K.jsxs)(`code`,{children:[e.host??e.ip,`:`,e.port]}),e.host&&(0,K.jsxs)(`span`,{className:`rt-muted`,title:`The address${(e.addresses?.length??1)>1?`es`:``} the program connected to. The name is the lookup that answered with ${(e.addresses?.length??1)>1?`them`:`it`}.\n${(e.addresses??[e.ip]).join(`
|
|
27
|
+
`)}`,children:[` `,e.ip,(e.addresses?.length??1)>1?` and ${e.addresses.length-1} more`:``]}),e.coverage===`gaps`&&(0,K.jsx)(`span`,{className:`rt-flag`,title:`Events were lost about then.`,children:`gaps`})]}),(0,K.jsx)(`td`,{children:(0,K.jsx)(sT,{fact:e})}),(0,K.jsx)(oT,{fact:e,step:t(e.call_id),onOpenCall:n})]},e.id))})]})}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`No connection left the sandbox.`}),c.length>0&&(0,K.jsxs)(`p`,{className:`rt-foot`,children:[`Looked up, with no connection seen: `,c.slice(0,40).map((e,t)=>(0,K.jsxs)(`span`,{title:e.failed?`The lookup failed: ${e.failed}`:e.addresses.join(`, `),children:[t?`, `:``,(0,K.jsx)(`code`,{children:e.name}),e.failed?` (${e.failed})`:``]},e.id)),c.length>40?` and ${c.length-40} more`:``,`.`]}),(0,K.jsx)(`div`,{className:`rt-list-head`,children:(0,K.jsx)(`span`,{children:`PACKAGES INSTALLED`})}),r.packages.length?(0,K.jsx)(`div`,{className:`rt-table-wrap`,children:(0,K.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`When`}),(0,K.jsx)(`th`,{children:`Manager`}),(0,K.jsx)(`th`,{children:`Packages`}),(0,K.jsx)(`th`,{children:`Basis`}),(0,K.jsx)(`th`,{children:`Program`}),(0,K.jsx)(`th`,{children:`Step`})]})}),(0,K.jsx)(`tbody`,{children:r.packages.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{children:(0,K.jsx)(`time`,{children:nT(e.at)})}),(0,K.jsxs)(`td`,{children:[e.manager,` `,(0,K.jsxs)(`span`,{className:`rt-muted`,children:[`· `,e.total.toLocaleString()]})]}),(0,K.jsx)(`td`,{className:`rt-scan-why`,children:(0,K.jsx)(cT,{fact:e})}),(0,K.jsx)(`td`,{title:e.certainty===`corroborated`?`Read from the package manager's own records in the sandbox, and a package registry was reached about then.`:`Read from the package manager's own records in the sandbox, which the agent can write. No registry connection was seen with it.`,children:e.certainty===`corroborated`?`records, registry reached`:`records only`}),(0,K.jsx)(oT,{fact:e,step:t(e.call_id),onOpenCall:n})]},e.id))})]})}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`No package manager left anything new.`}),(0,K.jsxs)(`div`,{className:`rt-list-head`,children:[(0,K.jsx)(`span`,{children:`FILES, AS THE KERNEL SAW THEM`}),(0,K.jsx)(`small`,{children:`files marked Report or Restrict, and new sensitive ones`})]}),r.files.length?(0,K.jsx)(`div`,{className:`rt-table-wrap`,children:(0,K.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`When`}),(0,K.jsx)(`th`,{children:`File`}),(0,K.jsx)(`th`,{children:`What happened`}),(0,K.jsx)(`th`,{children:`How sure`}),(0,K.jsx)(`th`,{children:`Program`}),(0,K.jsx)(`th`,{children:`Step`})]})}),(0,K.jsx)(`tbody`,{children:r.files.map(e=>(0,K.jsxs)(`tr`,{className:e.effect===`attempted`?`rt-fact-refused`:void 0,title:aT(e),children:[(0,K.jsx)(`td`,{children:(0,K.jsx)(`time`,{children:nT(e.at)})}),(0,K.jsxs)(`td`,{children:[e.path?(0,K.jsx)(`code`,{children:e.path}):(0,K.jsx)(`span`,{className:`rt-muted`,title:`gVisor reports this call by number, without its path.`,children:`file not reported`}),e.guard&&(0,K.jsx)(`span`,{className:`rt-flag`,children:e.guard})]}),(0,K.jsxs)(`td`,{children:[Qw[e.effect]??e.effect,e.effect===`attempted`&&e.intent?`: ${$w[e.intent]??e.intent}`:``,e.to?(0,K.jsxs)(K.Fragment,{children:[` to `,(0,K.jsx)(`code`,{children:e.to})]}):null,rT(e.count),e.basis?.errno&&(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` (`,e.basis.errno,`)`]})]}),(0,K.jsx)(`td`,{title:eT[e.certainty]?.[1],children:eT[e.certainty]?.[0]??e.certainty}),(0,K.jsx)(oT,{fact:e,step:t(e.call_id),onOpenCall:n})]},e.id))})]})}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`Nothing happened to a file marked Report or Restrict.`}),r.bulk.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`rt-list-head`,children:[(0,K.jsx)(`span`,{children:`BULK FILE ACCESS`}),(0,K.jsx)(`small`,{children:`counted, not kept`})]}),(0,K.jsx)(`ul`,{className:`rt-foot rt-bulk`,children:r.bulk.slice(0,20).map(e=>{let r=t(e.call_id);return(0,K.jsxs)(`li`,{children:[nT(e.at),`: `,e.process??`a step`,` opened `,e.opens.toLocaleString(),` files (`,Object.entries(e.folders).map(([e,t])=>`${t.toLocaleString()} under ${e}`).join(`, `),`)`,` `,r&&(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>n(r.trace,r.call),children:[`Open the step `,(0,K.jsx)(P,{size:11})]})]},e.id)})})]}),r.identity.length>0&&(0,K.jsxs)(`p`,{className:`rt-problem`,children:[`A program asked to change its user or group id: `,r.identity.map(e=>`${e.basis?.syscall??`setid`}(${e.ids.join(`, `)}) by ${e.process??`a process`}, ${e.effect===`changed`?`allowed`:`refused${e.basis?.errno?` (${e.basis.errno})`:``}`}`).join(`; `),`.`]}),(0,K.jsx)(`p`,{className:`rt-foot`,children:`Seen by the kernel layer of the sandbox and its host, not reported by the agent. An address is what a program connected to; the name beside it is the lookup that answered with it. HTTPS contents are not read. A file that was read is one opened for reading. A file not marked Report or Restrict is counted, not listed.`})]})}function uT(e){let t=new Map,n=new Map,r=(e,r)=>{if(e.call_id&&t.set(e.call_id,[...t.get(e.call_id)??[],r]),e.pid!=null){let t=`${e.pid}:${e.process_start_ns??``}`;n.set(t,[...n.get(t)??[],r])}};if(!e)return{byCall:t,byProcess:n};for(let t of e.network){let e=!!t.outcomes.refused_by_policy;r(t,{key:t.id,fail:e,text:`${e?`refused `:t.effect===`listen`?`listens on `:`→ `}${t.host??t.ip}:${t.port}${rT(t.count)}`,title:Object.entries(t.outcomes).map(([e,t])=>`${tT[e]?.[0]??e}${rT(t)}`).join(`, `)})}for(let t of e.packages)r(t,{key:t.id,text:`${t.manager}: ${t.total.toLocaleString()} package${t.total===1?``:`s`}`,title:t.packages.slice(0,20).map(e=>`${e.name}@${e.version}`).join(`, `)});for(let t of e.files)t.path&&r(t,{key:t.id,fail:t.effect===`attempted`,text:`${t.path.split(`/`).pop()} ${(Qw[t.effect]??t.effect).toLowerCase()}`,title:`${t.path}\n${eT[t.certainty]?.[1]??``}\n${aT(t)}`});return{byCall:t,byProcess:n}}var dT=200,fT={untested:[`no test`,`No test file is named after this file.`],unreferenced:[`not imported`,`No other file imports this one, and nothing was found that starts it.`],large:[`large`,`Over 800 lines.`],created:[`new`,`Appeared after the initial scan, so it is scored by its path alone.`]},pT={watched_changed:`Watched file changed`,restricted_changed:`Restricted file changed`,new_sensitive:`Sensitive file created`,restricted_blocked:`Change to a restricted file blocked`,restricted_read:`Restricted file read`,restricted_named:`Restricted file named in a command`,watched_read:`Watched file read`,network_refused:`Connection to a private address refused`},mT={restricted_blocked:`The agent tried to change this file and was refused.`,restricted_named:`The command mentions this file. What it does is not known: it may only read it.`,network_refused:`The sandbox firewall rejects private addresses: the VM's own services and the cloud metadata server are there.`},hT={A:`added`,M:`edited`,D:`deleted`,R:`renamed`,T:`type changed`},gT={kernel:`Seen by the sandbox's kernel layer and its host: every program, whatever started it, and nothing the agent could write.`,hook:`Reported by the sandbox's Claude Code hook: the agent's own tool said so.`};function _T(e){let t=[];for(let n of e){let e=n.at??n.created,r=t.find(t=>t.path===n.path&&t.kind===n.kind&&!t.sources.includes(n.source)&&(t.call_id&&n.call_id?t.call_id===n.call_id:Math.abs((t.at??t.created)-e)<=20));if(!r){t.push({...n,ids:[n.id],sources:[n.source],tool:n.source===`hook`?n.tool:null,by:n.source===`kernel`?n.tool:null});continue}r.ids.push(n.id),r.sources.push(n.source),r.seen=r.seen&&n.seen,r.call_id??=n.call_id,n.source===`kernel`?r.by=n.tool:(r.tool=n.tool,r.status??=n.status,r.added??=n.added,r.removed??=n.removed,r.commit??=n.commit)}return t}var vT=e=>new Date(typeof e==`number`?e*1e3:e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`});function yT({level:e,title:t}){return(0,K.jsx)(`span`,{className:`rt-level level-${e}`,title:t??`Level ${e} of 5: ${Rw[e]}`,children:e})}function bT({onSelect:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await x().fetch(`/raytace/sandboxes`,{cache:`no-store`}),r=await t.json();if(!t.ok)throw Error(r.error||`Sandbox list unavailable`);e||n((r.sandboxes??[]).filter(e=>e.status!==`deleted`))}catch(t){e||i(t instanceof Error?t.message:`Sandbox list unavailable`)}})(),()=>{e=!0}},[]),r?(0,K.jsx)(`p`,{className:`rt-empty`,children:r}):t?t.length?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`rt-list-head`,children:(0,K.jsx)(`span`,{children:`CHOOSE A SANDBOX`})}),(0,K.jsx)(`ol`,{className:`rt-prompts`,children:t.map(t=>(0,K.jsx)(`li`,{className:`rt-prompt`,children:(0,K.jsxs)(`button`,{type:`button`,className:`rt-prompt-row`,onClick:()=>e(t.id),children:[(0,K.jsx)(`time`,{children:vT(t.created)}),(0,K.jsx)(`strong`,{children:t.name}),(0,K.jsxs)(`small`,{children:[t.id.slice(0,12),`…`]})]})},t.id))})]}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`No sandboxes yet. A project is scanned when its sandbox is created.`}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`Loading…`})}function xT({box:e,traces:t,onSelect:n,onOpenCall:r,onAlertsSeen:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(`files`),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(()=>new Set([5,4,3,2,1])),[S,C]=(0,_.useState)(dT),[w,T]=(0,_.useState)([]),[E,D]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=!1;return Kw().then(t=>{e||D(t)}),()=>{e=!0}},[]),(0,_.useEffect)(()=>{if(o(null),c(null),u(null),C(dT),x(new Set([5,4,3,2,1])),!e)return;let t=!1;return Hw(e).then(e=>{t||o(e)},e=>{t||c(e.message)}),()=>{t=!0}},[e]),(0,_.useEffect)(()=>{if(T([]),!e)return;let t=!1,n,r=async()=>{try{let n=await Gw(e);t||T(n.alerts)}catch{}t||(n=setTimeout(r,1e4))};return r(),()=>{t=!0,clearTimeout(n)}},[e]);let O=(0,_.useCallback)(async(t,n)=>{u(null),o(e=>e&&{...e,files:e.files.map(e=>e.path===t.path?{...e,...n}:e)});try{let n=await Uw(e,[t]),r=new Map(n.files.map(e=>[e.path,e]));o(e=>e&&{...e,guardrails:n.guardrails??e.guardrails,files:e.files.map(e=>r.get(e.path)??e)}),Zw(e)}catch(t){u(t instanceof Error?t.message:`That change could not be saved.`),Hw(e).then(o,()=>void 0)}},[e]),k=(0,_.useMemo)(()=>a?.files??[],[a]),A=(0,_.useMemo)(()=>{let e=[0,0,0,0,0,0],t=0,n=0;for(let r of k)e[r.level]+=1,r.restricted&&(t+=1),r.notify&&(n+=1);return{byLevel:e,restricted:t,notify:n}},[k]),j=(0,_.useMemo)(()=>{let e=v.trim().toLowerCase();return k.filter(t=>(p==null||t.level===p)&&(h!==`restricted`||t.restricted)&&(h!==`notify`||t.notify)&&(!e||t.path.toLowerCase().includes(e))).sort((e,t)=>t.level-e.level||(t.reach?.score??t.reach?.dependents??0)-(e.reach?.score??e.reach?.dependents??0)||(t.reach?.dependents??0)-(e.reach?.dependents??0)||e.path.localeCompare(t.path))},[k,p,h,v]),M=!!(v.trim()||p!=null||h),N=j.slice(0,S),L=[5,4,3,2,1].map(e=>({level:e,total:j.filter(t=>t.level===e).length,files:N.filter(t=>t.level===e),closed:!M&&b.has(e)})).filter(e=>e.total>0),R=e=>{let t=(e.hazard?.level??0)>=4,n=(e.reach?.level??0)>=4;return t&&n?`Sensitive · Widely used`:t?`Sensitive`:n?`Widely used`:null},z=(0,_.useMemo)(()=>new Set(a?.guardrails?.read_only??[]),[a]),V=w.filter(e=>!e.seen),H=(0,_.useMemo)(()=>_T(w),[w]),te=n=>{if(!n)return null;let r=t.find(t=>t.sandboxId===e&&!t.forkId&&t.callVerifications?.some(e=>e.call_id===n));return r?{trace:r.id,call:n}:null},U=async e=>{D(e),u(null);try{await qw(e)}catch(t){D(!e),u(t instanceof Error?t.message:`That setting could not be saved.`)}},ne=async e=>{T(t=>t.map(t=>e.includes(t.id)?{...t,seen:!0}:t));try{await Jw(e)}catch{}i()},re=a?.scan;return(0,K.jsxs)(`section`,{className:`rt-view`,children:[(0,K.jsxs)(`header`,{className:`rt-view-head`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`INITIAL SCAN`}),(0,K.jsx)(`h1`,{children:a?.name?`How risky each file of ${a.name} is to change`:`How risky each file is to change`})]}),e&&(0,K.jsx)(`div`,{className:`rt-actions`,children:(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,onClick:()=>n(``),children:`Another sandbox`})})]}),!e&&(0,K.jsx)(bT,{onSelect:n}),e&&s&&(0,K.jsx)(`p`,{role:`alert`,className:`verify-error`,children:s}),e&&!s&&!a&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`Loading…`}),a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`dl`,{className:`rt-stats`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Files`}),(0,K.jsx)(`dd`,{children:k.length.toLocaleString()})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Level`}),(0,K.jsx)(`dd`,{className:`rt-sev-counts`,children:[5,4,3,2,1].map(e=>(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":p===e,className:`rt-level level-${e}${p===e?` rt-sev-on`:``}${p!=null&&p!==e?` rt-sev-off`:``}`,title:p===e?`Show every level`:`Show only level ${e} (${zw[e].toLowerCase()})`,onClick:()=>{m(t=>t===e?null:e),C(dT)},children:[e,` · `,A.byLevel[e]]},e))})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Reported when changed`}),(0,K.jsx)(`dd`,{children:(0,K.jsxs)(`button`,{type:`button`,className:`rt-pick${h===`notify`?` on`:``}`,"aria-pressed":h===`notify`,onClick:()=>{g(e=>e===`notify`?null:`notify`),C(dT)},children:[(0,K.jsx)(I,{size:13}),` `,A.notify]})})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Restricted`}),(0,K.jsx)(`dd`,{children:(0,K.jsxs)(`button`,{type:`button`,className:`rt-pick${h===`restricted`?` on`:``}`,"aria-pressed":h===`restricted`,onClick:()=>{g(e=>e===`restricted`?null:`restricted`),C(dT)},children:[(0,K.jsx)(se,{size:13}),` `,A.restricted]})})]})]}),(0,K.jsxs)(`div`,{className:`rt-tabs`,role:`tablist`,children:[(0,K.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":d===`files`,className:d===`files`?`on`:``,onClick:()=>f(`files`),children:`Files`}),(0,K.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":d===`alerts`,className:d===`alerts`?`on`:``,onClick:()=>f(`alerts`),children:[`Alerts`,V.length>0&&(0,K.jsx)(`span`,{className:`rt-count`,children:V.length})]}),(0,K.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":d===`activity`,className:d===`activity`?`on`:``,onClick:()=>f(`activity`),children:`Activity`})]}),l&&(0,K.jsx)(`p`,{role:`alert`,className:`rt-problem`,children:l}),d===`files`&&(0,K.jsxs)(K.Fragment,{children:[re&&`error`in re&&(0,K.jsxs)(`p`,{className:`rt-problem`,children:[re.error,`. Files the agent changes are still scored by their path.`]}),!k.length&&!(re&&`error`in re)&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`This sandbox was created before RayTrace scanned projects, so it has no scan.`}),k.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{className:`rt-search`,type:`search`,value:v,placeholder:`Filter by path`,"aria-label":`Filter files by path`,onChange:e=>{y(e.target.value),C(dT)}}),(0,K.jsx)(`div`,{className:`rt-table-wrap`,children:(0,K.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`Level`}),(0,K.jsx)(`th`,{children:`File`}),(0,K.jsx)(`th`,{children:`Why`}),(0,K.jsx)(`th`,{title:`Report it when the agent changes this file`,children:`Report`}),(0,K.jsx)(`th`,{title:`The agent may not change this file`,children:`Restrict`})]})}),L.map(e=>(0,K.jsxs)(`tbody`,{children:[(0,K.jsx)(`tr`,{className:`rt-scan-group`,children:(0,K.jsx)(`td`,{colSpan:5,children:(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":!e.closed,onClick:()=>x(t=>{let n=new Set(t);return n.has(e.level)?n.delete(e.level):n.add(e.level),n}),children:[e.closed?(0,K.jsx)(B,{size:13}):(0,K.jsx)(ee,{size:13}),(0,K.jsx)(`span`,{className:`rt-level level-${e.level}`,children:e.level}),zw[e.level],(0,K.jsxs)(`span`,{className:`rt-muted`,children:[e.total.toLocaleString(),` file`,e.total===1?``:`s`]})]})})}),!e.closed&&e.files.map(e=>(0,K.jsxs)(`tr`,{children:[(0,K.jsxs)(`td`,{className:`rt-scan-level`,children:[(0,K.jsx)(`select`,{className:`rt-level level-${e.level}`,value:e.level,"aria-label":`Level of ${e.path}`,onChange:t=>{let n=Number(t.target.value);O({path:e.path,level:n===e.scanned_level?null:n},{level:n,edited:n!==e.scanned_level,...e.notify_set?{}:{notify:n>=4}})},children:[5,4,3,2,1].map(t=>(0,K.jsxs)(`option`,{value:t,children:[t,` `,zw[t],t===e.scanned_level?` (scanned)`:``]},t))}),e.edited&&(0,K.jsx)(`button`,{type:`button`,className:`rt-undo`,title:`Back to the scanned level, ${e.scanned_level}`,"aria-label":`Put ${e.path} back to its scanned level`,onClick:()=>void O({path:e.path,level:null},{level:e.scanned_level,edited:!1,...e.notify_set?{}:{notify:e.scanned_level>=4}}),children:(0,K.jsx)(pe,{size:11})})]}),(0,K.jsx)(`td`,{children:(0,K.jsx)(`code`,{children:e.path})}),(0,K.jsxs)(`td`,{className:`rt-scan-why`,children:[e.reasons.join(` · `)||(0,K.jsx)(`span`,{className:`rt-muted`,children:`Nothing imports it, and its name marks nothing`}),R(e)&&(0,K.jsx)(`span`,{className:`rt-flag rt-driver`,title:`What put this file at its level: sensitivity of the code, weighted blast radius, or both`,children:R(e)}),e.flags.map(e=>(0,K.jsx)(`span`,{className:`rt-flag`,title:fT[e]?.[1],children:fT[e]?.[0]??e},e)),e.restricted&&(0,K.jsx)(`small`,{className:`rt-scan-lock`,children:z.has(e.path)?`Read-only in the sandbox, for every tool.`:`Claude Code edits are refused now. Read-only for every tool after the sandbox is next stopped and started.`})]}),(0,K.jsx)(`td`,{children:(0,K.jsx)(`input`,{type:`checkbox`,checked:e.notify,"aria-label":`Report changes to ${e.path}`,onChange:t=>void O({path:e.path,notify:t.target.checked},{notify:t.target.checked,notify_set:!0})})}),(0,K.jsx)(`td`,{children:(0,K.jsx)(`input`,{type:`checkbox`,checked:e.restricted,"aria-label":`Restrict ${e.path}`,onChange:t=>void O({path:e.path,restricted:t.target.checked},{restricted:t.target.checked})})})]},e.path))]},e.level))]})}),!j.length&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`No files match.`}),j.length>S&&(0,K.jsxs)(`p`,{className:`rt-foot`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>C(e=>e+dT),children:[`Show `,Math.min(dT,j.length-S),` more`]}),` `,S.toLocaleString(),` of `,j.length.toLocaleString(),` shown`]}),re&&!(`error`in re)&&(0,K.jsxs)(`p`,{className:`rt-foot`,children:[re.version===`scan-v2`?`Level is the higher of weighted blast radius and sensitivity. Direct and startup dependents count most, then each extra hop decays; reach is banded by percentile in this project, while secret, destructive, credential, payment and deploy code can be sensitive at any reach.`:`Level is the higher of how much of the project imports a file and what kind of file it is.`,` `,re.edges.toLocaleString(),` imports followed in JavaScript, TypeScript and Python; other files are scored by path. Secrets left out of the upload are scored when the agent creates them.`]})]})]}),d===`alerts`&&(0,K.jsxs)(K.Fragment,{children:[E!==null&&(0,K.jsxs)(`label`,{className:`rt-foot rt-email`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:E,onChange:e=>void U(e.target.checked)}),` Email me about alerts`,(0,K.jsx)(`span`,{className:`rt-muted`,children:` · batched, at most one message every 30 seconds per project`})]}),!w.length&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`No alerts. One is raised when the agent changes, tries to change or reads a file marked Report or Restrict, creates a sensitive one, or tries to reach a private address.`}),w.length>0&&(0,K.jsxs)(K.Fragment,{children:[V.length>0&&(0,K.jsx)(`p`,{className:`rt-foot`,children:(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,onClick:()=>void ne(V.map(e=>e.id)),children:`Mark all seen`})}),(0,K.jsx)(`div`,{className:`rt-table-wrap`,children:(0,K.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`When`}),(0,K.jsx)(`th`,{children:`Level`}),(0,K.jsx)(`th`,{children:`File or destination`}),(0,K.jsx)(`th`,{children:`What happened`}),(0,K.jsx)(`th`,{title:`Who saw it: the sandbox's kernel layer, or the agent's own tool through the sandbox's hook`,children:`Seen by`}),(0,K.jsx)(`th`,{title:`The agent's tool, and the program the kernel saw do it`,children:`Tool`}),(0,K.jsx)(`th`,{children:`Step`})]})}),(0,K.jsx)(`tbody`,{children:H.map(e=>{let t=te(e.call_id);return(0,K.jsxs)(`tr`,{className:`${e.seen?`rt-seen`:``}${e.kind===`restricted_blocked`||e.kind===`network_refused`?` rt-alert-blocked`:``}`,children:[(0,K.jsx)(`td`,{children:(0,K.jsx)(`time`,{title:e.at?`Seen at ${new Date(e.at*1e3).toISOString()}`:void 0,children:vT(e.at??e.created)})}),(0,K.jsx)(`td`,{children:(0,K.jsx)(yT,{level:e.level})}),(0,K.jsx)(`td`,{children:(0,K.jsx)(`code`,{children:e.path})}),(0,K.jsxs)(`td`,{title:mT[e.kind],children:[(e.kind===`restricted_blocked`||e.kind===`network_refused`)&&(0,K.jsx)(F,{size:12,"aria-hidden":`true`}),` `,pT[e.kind]??e.kind,e.status&&hT[e.status]?(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` · `,hT[e.status]]}):null,e.added!=null&&(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` · +`,e.added,` −`,e.removed??0]})]}),(0,K.jsx)(`td`,{children:[...e.sources].sort().reverse().map(e=>(0,K.jsx)(`span`,{className:`rt-flag rt-source-${e}`,title:gT[e],children:e},e))}),(0,K.jsx)(`td`,{children:e.tool||e.by?(0,K.jsxs)(K.Fragment,{children:[e.tool,e.tool&&e.by?` · `:``,e.by&&(0,K.jsx)(`span`,{title:`The program the kernel saw do it`,children:e.by})]}):(0,K.jsx)(`span`,{className:`rt-muted`,children:`–`})}),(0,K.jsx)(`td`,{className:`rt-scan-open`,children:t&&(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>{ne(e.ids),r(t.trace,t.call)},children:[`Open the step `,(0,K.jsx)(P,{size:11})]})})]},e.id)})})]})})]})]}),d===`activity`&&(0,K.jsx)(lT,{box:e,stepFor:te,onOpenCall:r})]})]})}function ST(e){let t=e.callVerifications??[],n=new Map,r=[],i=t.flatMap(e=>e.snapshot?[e.snapshot]:[]),a=new Set;t.forEach((e,t)=>{let i=e.snapshot;if(i){for(let e of i.too_big??[])a.add(e);i.changed&&i.changes.length&&r.push({call:e,number:t+1});for(let e of i.changes){let r=n.get(e.path)??{path:e.path,status:e.status,added:0,removed:0,calls:[]};r.status=e.status,e.added==null||r.added==null?(r.added=null,r.removed=null):(r.added+=e.added,r.removed=(r.removed??0)+(e.removed??0)),r.calls.includes(t+1)||r.calls.push(t+1),n.set(e.path,r)}}});let o=[...n.values()];return{files:o,steps:r,base:i.length?i[0].parent??`4b825dc642cb6eb9a060e54bf8d69288fbee4904`:null,final:i.at(-1)?.commit??null,hasSnapshots:i.length>0,tooBig:[...a],added:o.reduce((e,t)=>e+(t.added??0),0),removed:o.reduce((e,t)=>e+(t.removed??0),0)}}function CT(e){return/CalledProcessError|Command \[|docker|snapshot failed|exec:/i.test(e)?`The sandbox holding these snapshots could not be reached to read them. Check it under Sandboxes, then try again.`:e}var wT=(e,t)=>`raytrace-${e.id.slice(0,8)}${t?`-${t.split(`/`).at(-1)}`:``}.patch`,TT=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function ET(e){let t={hunks:[],additions:0,deletions:0,binary:!1},n=null,r=0,i=0,a=[],o=[],s=()=>{if(n){for(let e=0;e<Math.max(a.length,o.length);e+=1)n.rows.push({oldNo:a[e]?.no??null,oldText:a[e]?.text??null,newNo:o[e]?.no??null,newText:o[e]?.text??null});a=[],o=[]}},c=String(e??``).split(`
|
|
28
|
+
`);return c.forEach((e,l)=>{if(/^Binary files .* differ$/.test(e)||e===`GIT binary patch`){t.binary=!0;return}let u=TT.exec(e);if(u){s(),n={header:e.trim(),rows:[]},t.hunks.push(n),r=Number(u[1]),i=Number(u[2]);return}if(!n)return;if(e.startsWith(`\\`)){s(),n.rows.push({oldNo:null,oldText:null,newNo:null,newText:null,note:e.slice(1).trim()});return}if(e.startsWith(`-`)){a.push({no:r,text:e.slice(1)}),r+=1,t.deletions+=1;return}if(e.startsWith(`+`)){o.push({no:i,text:e.slice(1)}),i+=1,t.additions+=1;return}if(e===``&&l===c.length-1)return;s();let d=e.startsWith(` `)?e.slice(1):e;n.rows.push({oldNo:r,oldText:d,newNo:i,newText:d}),r+=1,i+=1}),s(),t}var DT=e=>/^[0-9a-f]{40}$/.test(e)||e.startsWith(`refs/forks/`);async function OT(e,t,n,r){if(!DT(t)||!DT(n))throw Error(`This snapshot cannot be diffed.`);let i=new URLSearchParams({commit:t,to:n,...r?{path:r}:{}}),a=await x().fetch(`/raytace/snapshots/${e}/diff?${i}`),o=await a.json().catch(()=>({}));if(!a.ok)throw Error(CT(o.error??`HTTP ${a.status}`));return{diff:o.diff??``,truncated:!!o.truncated}}function kT(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/plain;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=e,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}var AT=e=>e.startsWith(`+`)&&!e.startsWith(`+++`)?`add`:e.startsWith(`-`)&&!e.startsWith(`---`)?`del`:e.startsWith(`@@`)?`hunk`:``,jT=`raytace.diff-view`;function MT(){let[e,t]=(0,_.useState)(`split`);return(0,_.useEffect)(()=>{try{localStorage.getItem(jT)===`unified`&&t(`unified`)}catch{}},[]),[e,e=>{t(e);try{localStorage.setItem(jT,e)}catch{}}]}function NT({diff:e}){let t=(0,_.useMemo)(()=>ET(e),[e]),[n,r]=MT();return t.binary?(0,K.jsx)(`p`,{className:`rt-files-note`,children:`A binary file: it changed, but there are no lines to show.`}):t.hunks.length?(0,K.jsxs)(`div`,{className:`rt-diff-wrap`,children:[(0,K.jsxs)(`div`,{className:`rt-diff-bar`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsxs)(`b`,{className:`rt-diff-add-n`,children:[`+`,t.additions]}),` `,(0,K.jsxs)(`b`,{className:`rt-diff-del-n`,children:[`−`,t.deletions]})]}),(0,K.jsxs)(`span`,{className:`rt-diff-mode`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-pressed":n===`split`,className:n===`split`?`on`:``,onClick:()=>r(`split`),children:`Split`}),(0,K.jsx)(`button`,{type:`button`,"aria-pressed":n===`unified`,className:n===`unified`?`on`:``,onClick:()=>r(`unified`),children:`Unified`})]})]}),n===`unified`?(0,K.jsx)(`pre`,{className:`rt-diff`,children:e.split(`
|
|
29
|
+
`).map((e,t)=>(0,K.jsxs)(`span`,{className:AT(e),children:[e,`
|
|
30
|
+
`]},t))}):(0,K.jsx)(`div`,{className:`rt-diff-scroll`,children:(0,K.jsxs)(`table`,{className:`rt-diff-split`,children:[(0,K.jsxs)(`colgroup`,{children:[(0,K.jsx)(`col`,{className:`rt-diff-ln-col`}),(0,K.jsx)(`col`,{}),(0,K.jsx)(`col`,{className:`rt-diff-ln-col`}),(0,K.jsx)(`col`,{})]}),(0,K.jsx)(`tbody`,{children:t.hunks.map((e,t)=>(0,K.jsxs)(_.Fragment,{children:[(0,K.jsx)(`tr`,{className:`rt-diff-hunk`,children:(0,K.jsx)(`td`,{colSpan:4,children:e.header})}),e.rows.map((e,t)=>e.note?(0,K.jsx)(`tr`,{className:`rt-diff-note-row`,children:(0,K.jsx)(`td`,{colSpan:4,children:e.note})},t):(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{className:`rt-diff-ln${e.oldText!=null&&e.oldText!==e.newText?` del`:``}`,children:e.oldNo??``}),(0,K.jsx)(`td`,{className:`rt-diff-code${e.oldText==null?` empty`:e.oldText===e.newText?``:` del`}`,children:e.oldText??``}),(0,K.jsx)(`td`,{className:`rt-diff-ln${e.newText!=null&&e.oldText!==e.newText?` add`:``}`,children:e.newNo??``}),(0,K.jsx)(`td`,{className:`rt-diff-code${e.newText==null?` empty`:e.oldText===e.newText?``:` add`}`,children:e.newText??``})]},t))]},t))})]})})]}):(0,K.jsx)(`pre`,{className:`rt-diff`,children:e||`(no difference)`})}function PT({sandbox:e,from:t,to:n,path:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(``);return(0,_.useEffect)(()=>{if(!e)return;let i=!1;return OT(e,t,n,r).then(e=>{i||a(e)}).catch(e=>{i||s(`Could not load the diff: ${e.message}`)}),()=>{i=!0}},[e,t,n,r]),e?o?(0,K.jsx)(`p`,{className:`rt-files-note`,children:o}):i?(0,K.jsxs)(K.Fragment,{children:[i.diff?(0,K.jsx)(NT,{diff:i.diff}):(0,K.jsx)(`pre`,{className:`rt-diff`,children:`(no difference)`}),i.truncated&&(0,K.jsx)(`p`,{className:`rt-files-note`,children:`This diff is larger than the 500 KB the snapshot view returns, so it is cut off here — and a patch downloaded from it would be incomplete.`})]}):(0,K.jsx)(`p`,{className:`rt-files-note`,children:`Loading diff…`}):(0,K.jsx)(`p`,{className:`rt-files-note`,children:`No sandbox holds this snapshot, so there is no diff to load.`})}function FT(e){let[t,n]=(0,_.useState)({}),r=(0,_.useRef)(!1),i=(0,_.useCallback)(async e=>{n(t=>({...t,[e]:{status:`loading`}}));try{let t=await x().fetch(`/raytace/summaries/${e}`),i=t.ok?await t.json():null;if(r.current)return;if(i?.summary?.text){n(t=>({...t,[e]:{status:`ready`,text:i.summary.text}}));return}}catch{}for(let t=0,i=0;!r.current&&t<8&&i<3;t+=1){try{let t=await x().fetch(`/raytace/summaries`,{method:`POST`,headers:{"content-type":`application/json`,"x-raytace-experiment":`1`},body:JSON.stringify({exchange_id:e})});if(t.status===409){await new Promise(e=>setTimeout(e,400));continue}let i=await t.json();if(r.current)return;if(t.ok&&i.text){n(t=>({...t,[e]:{status:`ready`,text:i.text}}));return}}catch{if(r.current)return}i+=1,await new Promise(e=>setTimeout(e,600*i))}r.current||n(t=>({...t,[e]:{status:`error`}}))},[]),a=(e.requests??[]).map(e=>e.id).join(`,`);return(0,_.useEffect)(()=>{r.current=!1;let e=a&&x().summaries?a.split(`,`):[],t=0;return Promise.all(Array.from({length:4},async()=>{for(;!r.current&&t<e.length;){let n=e[t];t+=1,await i(n)}})),()=>{r.current=!0}},[a,i]),t}function IT({snapshot:e,sandbox:t}){let n={A:`added`,M:`edited`,D:`deleted`,T:`type changed`},r=Xw(t),[i,a]=(0,_.useState)(null);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`h4`,{children:[`Files changed `,(0,K.jsxs)(`span`,{className:`rt-snap-id`,title:`Snapshot of the project folder after this call`,children:[`snapshot `,e.commit.slice(0,8)]})]}),e.changes.length?(0,K.jsx)(`ul`,{className:`rt-files`,children:e.changes.map(o=>(0,K.jsxs)(_.Fragment,{children:[(0,K.jsxs)(`li`,{children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-file-toggle`,"aria-expanded":i===o.path,title:i===o.path?`Hide what changed in this file`:`Show what changed in this file`,onClick:()=>a(i===o.path?null:o.path),children:[(0,K.jsx)(B,{size:12,className:`rt-caret${i===o.path?` down`:``}`}),(0,K.jsx)(`span`,{className:`rt-file-status s-${o.status}`,children:n[o.status]??o.status}),(0,K.jsx)(`code`,{children:o.path})]}),(r.get(o.path)?.level??0)>=3&&(0,K.jsx)(yT,{level:r.get(o.path).level,title:`Level ${r.get(o.path).level} of 5 in the initial scan: ${r.get(o.path).reasons.join(`; `)||`set by its owner`}`}),r.get(o.path)?.restricted&&(0,K.jsx)(`span`,{className:`rt-flag`,title:`Its owner restricted this file: the agent was not meant to change it`,children:`restricted`}),(0,K.jsx)(`small`,{children:o.added==null?`binary`:`+${o.added} −${o.removed}`})]}),i===o.path&&(0,K.jsx)(`li`,{className:`rt-file-diff`,children:(0,K.jsx)(PT,{sandbox:t,from:e.parent??`4b825dc642cb6eb9a060e54bf8d69288fbee4904`,to:e.commit,path:o.path})})]},o.path))}):(0,K.jsx)(`p`,{className:`rt-files-note`,children:`No files changed.`}),e.too_big.length>0&&(0,K.jsxs)(`p`,{className:`rt-files-note`,children:[`Too big to keep (over 5 MB), so the snapshot has their earlier version: `,e.too_big.join(`, `)]})]})}function LT(e,t){let n=Uu(e,t);return n?JSON.stringify(n,null,2):``}var RT=`raytace.group-steps`;function zT(){let[e,t]=(0,_.useState)(!0);return(0,_.useEffect)(()=>{try{localStorage.getItem(RT)===`off`&&t(!1)}catch{}},[]),[e,e=>{t(e);try{localStorage.setItem(RT,e?`on`:`off`)}catch{}}]}function BT(e,t){let n=Uu(e,t),r=[n?.file_path,n?.notebook_path].find(e=>typeof e==`string`&&e);return typeof r==`string`?r:null}var VT=(e,t)=>Hu(e,t,Ne(e.events,t.call_id),BT(e,t));function HT({name:e,section:t}){return(0,K.jsxs)(`th`,{children:[e,(0,K.jsx)(`a`,{className:`rt-th-help`,href:`${Iu}#${t}`,target:`_blank`,rel:`noreferrer`,"aria-label":`What the ${e} labels mean (opens in a new tab)`,children:(0,K.jsx)(ae,{size:11})})]})}function UT({group:e,trace:t,open:n,onToggle:r}){let i=rd(e,t),a=e.calls.map(e=>VT(t,e)),o=a.map(e=>e.id),s=(...e)=>o.filter(t=>e.includes(t)).length,c=s(`ran`,`differs`),l=c+s(`not_seen`,`rejected`),u=s(`file_changed`),d=[c?`${c} of ${l} ran`:``,s(`differs`)?`⚠ ${s(`differs`)} differ${s(`differs`)===1?`s`:``}`:``,u?`${u} file${u===1?``:`s`} changed`:``,s(`no_change`)?`✗ ${s(`no_change`)} no change`:``].filter(Boolean).join(` · `)||(new Set(o).size===1?a[0].text:``),f=e.calls.map(e=>Du(e.ended_at)-Du(e.started_at)).filter(Number.isFinite);return(0,K.jsxs)(`tr`,{className:`rt-row rt-group-row${n?` open`:``}`,onClick:r,children:[(0,K.jsxs)(`td`,{className:`rt-num`,children:[(0,K.jsx)(B,{size:12,className:`rt-caret`}),i.range.slice(1)]}),(0,K.jsxs)(`td`,{className:`rt-tool`,children:[i.kind,(0,K.jsxs)(`small`,{className:`rt-changed`,children:[e.calls.length,` steps`]})]}),(0,K.jsxs)(`td`,{className:`rt-cmd rt-group-label`,children:[i.label,i.flags.map(e=>(0,K.jsx)(`span`,{className:`rt-group-flag`,children:e},e))]}),(0,K.jsx)(`td`,{className:`rt-reported`,children:i.outcome}),(0,K.jsx)(`td`,{children:d||`—`}),(0,K.jsx)(`td`,{className:`rt-time`,children:f.length?Ou(f.reduce((e,t)=>e+t,0)):`—`})]})}function WT({label:e,onOpen:t}){return!e.opens||!t?(0,K.jsx)(`span`,{className:`rt-ran ${e.tone}`,children:e.text}):(0,K.jsx)(`button`,{type:`button`,className:`rt-ran ${e.tone} rt-ran-link`,onClick:e=>{e.stopPropagation(),t()},children:e.text})}function GT({call:e}){let t=e.category?Lu[e.category]:null;return!t||t.toLowerCase()===e.name.toLowerCase()?(0,K.jsx)(K.Fragment,{children:e.name}):(0,K.jsxs)(K.Fragment,{children:[t,(0,K.jsxs)(`span`,{className:`rt-tool-name`,children:[` · `,e.name]})]})}function KT({trace:e,traces:t,focusCall:n,onOpenSandbox:r,onOpenContext:i,onOpenThought:a,onOpenPlayground:o}){let[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(n),[d,f]=(0,_.useState)(null);(0,_.useEffect)(()=>{if(!d)return;let e=requestAnimationFrame(()=>{document.getElementById(`files-${d}`)?.scrollIntoView({block:`nearest`,behavior:`smooth`}),f(null)});return()=>cancelAnimationFrame(e)},[d]);let p=FT(e),m=ke(e.events),h=e.callVerifications??[],[g,v]=zT(),[y,b]=(0,_.useState)(()=>new Set),x=g?td(e,h):[],S=new Map(x.filter(e=>e.calls.length>1).flatMap(e=>e.calls.map(t=>[t.call_id,e]))),C=e=>y.has(e.id)!==e.calls.some(e=>e.call_id===n),w=e=>b(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),T=e=>{let t=S.get(e.call_id);return!(!t||C(t))},E=new Map(h.map((e,t)=>[e.call_id,t+1])),D=Pe(e).forkable&&!!o,O=Pe(e).where===`sandbox`,k=(e.requests??[]).map(e=>e.id),A=e=>k[k.indexOf(e)+1],j=e.requests??[],M=[...new Set(j.map(e=>e.model))],N=[[`Round trips`,String(j.length)],[`Tool calls`,String(h.length)],[`Cost`,id(Ae(j,`cost`),j.some(e=>e.costEstimated))],[`Time`,ad(je(j))],[`Tokens in / out`,`${od(Ae(j,`input`))} / ${od(Ae(j,`output`))}`],[M.length>1?`Models`:`Model`,M.join(`, `)||e.model]];return(0,_.useEffect)(()=>{if(!n)return;let e=requestAnimationFrame(()=>document.getElementById(`call-${n}`)?.scrollIntoView({block:`center`,behavior:`smooth`}));return()=>cancelAnimationFrame(e)},[n]),(0,K.jsxs)(`section`,{className:`rt-view`,children:[(0,K.jsxs)(`header`,{className:`rt-view-head`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`TOOL CALLS`}),(0,K.jsx)(`h1`,{children:`How the agent got there`})]}),(0,K.jsxs)(`div`,{className:`rt-actions`,children:[(0,K.jsx)(Xd,{traces:t,currentId:e.id}),!s&&(0,K.jsxs)(`label`,{className:`rt-toggle`,title:`Fold runs of similar steps, such as repeated searches for the same thing, into one row`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>v(e.target.checked)}),` Group similar steps`]}),(0,K.jsxs)(`button`,{type:`button`,className:`visualize-button ${s?`active`:``}`,onClick:()=>c(!s),children:[(0,K.jsx)(Ce,{size:14}),` `,s?`Back to list`:`Graph`]}),e.sandboxId&&r&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>r(),children:[`Sandbox evidence `,(0,K.jsx)(P,{size:14})]})]})]}),(0,K.jsx)(`dl`,{className:`rt-stats`,children:N.map(([e,t])=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:e}),(0,K.jsx)(`dd`,{children:t})]},e))}),s?(0,K.jsx)(Lw,{trace:e,blocks:m,summaries:p,onSelectStep:()=>c(!1)}):(0,K.jsx)(`div`,{className:`rt-table-wrap`,children:(0,K.jsxs)(`table`,{className:`rt-table rt-calls`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`#`}),(0,K.jsx)(HT,{name:`Tool`,section:`tool-categories`}),(0,K.jsx)(`th`,{children:`Command`}),(0,K.jsx)(`th`,{children:`Agent reported`}),(0,K.jsx)(HT,{name:`Sandbox`,section:`sandbox-labels`}),(0,K.jsx)(`th`,{children:`Ran for`})]})}),(0,K.jsx)(`tbody`,{children:m.map(t=>{let s=j.find(e=>e.id===t.exchangeId),c=p[t.exchangeId],d=t.completion?De(t.completion):null,m=h.filter(e=>e.exchange_id===t.exchangeId),g=t.items.some(({event:e})=>e.title===`Model answer`);return m.length&&m.every(e=>T(e)&&S.get(e.call_id).id!==e.call_id)?null:(0,K.jsxs)(_.Fragment,{children:[(0,K.jsx)(`tr`,{className:`rt-trip`,children:(0,K.jsxs)(`td`,{colSpan:6,children:[(0,K.jsxs)(`span`,{children:[`Round trip `,t.number]}),c?.status===`ready`&&(0,K.jsx)(`em`,{children:c.text}),(0,K.jsxs)(`small`,{children:[s?`${id(s.cost,s.costEstimated)} · ${ad(s.durationMs)}`:``,d?` · failed`:``,g&&!m.length?` · answered`:``]})]})}),m.map(t=>{let s=Ne(e.events,t.call_id),c=Hu(e,t,s,BT(e,t)),d=c.opens===`files`?()=>{u(t.call_id),f(t.call_id)}:r&&(()=>r(t.call_id)),p=l===t.call_id,m=Du(t.started_at),h=Du(t.ended_at),g={exchange_id:t.exchange_id,output_index:t.output_index,title:`#${E.get(t.call_id)} ${t.name}`,detail:t.proposed??t.name},v=S.get(t.call_id),y=v&&v.id===t.call_id?(0,K.jsx)(UT,{group:v,trace:e,open:C(v),onToggle:()=>w(v)}):null;return v&&!C(v)?(0,K.jsx)(_.Fragment,{children:y},t.call_id):(0,K.jsxs)(_.Fragment,{children:[y,(0,K.jsxs)(`tr`,{id:`call-${t.call_id}`,className:`rt-row${p?` open`:``}${n===t.call_id?` rt-focus`:``}${v?` rt-in-group`:``}`,onClick:()=>u(p?null:t.call_id),children:[(0,K.jsxs)(`td`,{className:`rt-num`,children:[(0,K.jsx)(B,{size:12,className:`rt-caret`}),E.get(t.call_id)]}),(0,K.jsxs)(`td`,{className:`rt-tool`,children:[(0,K.jsx)(GT,{call:t}),t.snapshot?.changed&&(0,K.jsxs)(`small`,{className:`rt-changed`,title:`Files this call changed`,children:[t.snapshot.changes.length,` file`,t.snapshot.changes.length===1?``:`s`]})]}),(0,K.jsx)(`td`,{className:`rt-cmd`,children:t.description?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`rt-plain`,children:t.description}),(0,K.jsx)(`span`,{className:`rt-cmd-raw`,title:t.proposed??void 0,children:(0,K.jsx)(Au,{text:t.proposed||t.name})})]}):(0,K.jsx)(Au,{text:t.proposed||t.name})}),(0,K.jsx)(`td`,{className:`rt-reported ${s.state}`,children:s.state===`none`?`—`:s.state===`rejected`?`rejected`:s.code==null?s.state:`exit ${s.code}`}),(0,K.jsx)(`td`,{children:(0,K.jsx)(WT,{label:c,onOpen:d})}),(0,K.jsx)(`td`,{className:`rt-time`,children:Number.isFinite(m)&&Number.isFinite(h)?Ou(h-m):`—`})]}),p&&(0,K.jsx)(`tr`,{className:`rt-expand`,children:(0,K.jsxs)(`td`,{colSpan:6,children:[(0,K.jsx)(`h4`,{children:`Arguments`}),(0,K.jsx)(`pre`,{children:LT(e,t)}),(0,K.jsx)(`h4`,{children:`Output the agent got back`}),(0,K.jsx)(`pre`,{children:s.output.trim()||`(no result captured)`}),t.snapshot&&(0,K.jsx)(`div`,{id:`files-${t.call_id}`,children:(0,K.jsx)(IT,{snapshot:t.snapshot,sandbox:e.sandboxId})}),(0,K.jsxs)(`div`,{className:`rt-actions`,children:[t.exec_id&&r&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>r(t.call_id),children:[`Show in sandbox `,(0,K.jsx)(P,{size:14})]}),i&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>i(g),children:[(0,K.jsx)(oe,{size:14}),` What it had in context`]}),O&&a&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>a(t.call_id),children:[(0,K.jsx)(R,{size:14}),` Why?`]}),D&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,title:`Rerun from the model call that made this tool call`,onClick:()=>o?.(t.exchange_id),children:[(0,K.jsx)(ie,{size:14}),` Fork from here`]}),D&&A(t.exchange_id)&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,title:`Rerun the next step as if this call had returned nothing`,onClick:()=>o?.(A(t.exchange_id),t.call_id),children:[(0,K.jsx)(ie,{size:14}),` Rerun without this output`]})]})]})})]},t.call_id)})]},t.exchangeId)})})]})})]})}function qT(e){let[t,n]=(0,_.useState)({status:`idle`}),[r,i]=(0,_.useState)(0),a=e.callVerifications?.length??0,o=!!e.answer&&a>0;return(0,_.useEffect)(()=>{if(!o){n({status:`idle`});return}let t=!1,r=e=>{t||n(e)};return r({status:`loading`}),(async()=>{try{let t=await x().fetch(`/raytace/recap/${e.id}`),n=await t.json();if(t.ok&&n.recap)return r({status:`ready`,recap:n.recap});if(t.ok&&n.available===!1)return r({status:`idle`});let i=await x().fetch(`/raytace/recap`,{method:`POST`,headers:{"content-type":`application/json`,"x-raytace-experiment":`1`},body:JSON.stringify({trace_id:e.id})}),a=await i.json();r(i.ok?{status:`ready`,recap:a}:{status:`error`,message:a.error??`The recap could not be written.`})}catch{r({status:`error`,message:`The recap could not be loaded.`})}})(),()=>{t=!0}},[e.id,o,a,r]),{state:t,retry:()=>i(e=>e+1)}}var JT={likely:`likely`,possible:`possibly`,unclear:`unclear`};function YT({trace:e,onStep:t}){let{state:n,retry:r}=qT(e);if(n.status===`idle`)return null;let i=e.callVerifications??[],a=e=>e.steps.length>0&&(0,K.jsx)(`span`,{className:`rt-recap-steps`,children:e.steps.map(e=>t&&i[e-1]?(0,K.jsx)(`button`,{type:`button`,className:`rt-recap-step`,onClick:()=>t(i[e-1].call_id),title:`Open step ${e}`,children:e},e):(0,K.jsx)(`span`,{className:`rt-recap-step`,children:e},e))});return(0,K.jsxs)(`section`,{className:`rt-recap`,"aria-label":`Recap`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`RECAP`}),n.status===`ready`&&(0,K.jsxs)(`small`,{children:[`Written by `,n.recap.model.split(`/`).pop(),` from `,n.recap.steps_read===n.recap.total_steps?`all ${n.recap.total_steps}`:`${n.recap.steps_read} of ${n.recap.total_steps}`,` steps`]})]}),n.status===`loading`&&(0,K.jsx)(`p`,{className:`rt-muted`,children:`Reading the run…`}),n.status===`error`&&(0,K.jsxs)(`p`,{className:`rt-muted`,children:[n.message,` `,(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:r,children:[(0,K.jsx)(me,{size:11}),` Try again`]})]}),n.status===`ready`&&(0,K.jsxs)(K.Fragment,{children:[n.recap.headline&&(0,K.jsx)(`p`,{className:`rt-recap-headline`,children:n.recap.headline}),(0,K.jsx)(`h4`,{children:`What happened`}),(0,K.jsx)(`ol`,{className:`rt-recap-list`,children:n.recap.happened.map((e,t)=>(0,K.jsxs)(`li`,{children:[e.text,` `,a(e)]},t))}),n.recap.reasoning.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`h4`,{children:[`Probably why `,(0,K.jsx)(`small`,{children:`the observer's reading of the sequence, not a measurement`})]}),(0,K.jsx)(`ul`,{className:`rt-recap-list`,children:n.recap.reasoning.map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`rt-recap-sure s-${e.confidence??`possible`}`,children:JT[e.confidence??`possible`]}),` `,e.text,` `,a(e)]},t))})]}),n.recap.flags.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`h4`,{children:`Worth checking`}),(0,K.jsx)(`ul`,{className:`rt-recap-list rt-recap-flags`,children:n.recap.flags.map((e,t)=>(0,K.jsxs)(`li`,{children:[e.text,` `,a(e)]},t))})]})]})]})}var XT=e=>`${e.exchange_id}:${e.output_index}`,ZT=e=>`${Math.round(e*100)}%`,QT=.02,$T={user:`Your request`,tool_result:`Earlier result`,agent:`Agent's earlier plan`,project:`Project instructions`,habit:`Routine step`,explore:`Exploring`};function eE(e){let[t,n]=(0,_.useState)({}),r=(0,_.useRef)(new Set),i=(0,_.useCallback)(async(e,t)=>{let i=XT(e),a=e=>{e.status!==`loading`&&r.current.add(i),t()&&n(t=>({...t,[i]:e}))};a({status:`loading`});try{let t=await x().fetch(`/raytace/attribution/${encodeURIComponent(e.exchange_id)}/${e.output_index}`),n=await t.json();if(!t.ok){a({status:`error`,message:n.error??`Unavailable.`});return}if(n.attribution){a({status:`ready`,attribution:n.attribution});return}}catch{}for(let n=0,r=0;t()&&n<12&&r<3;n+=1){try{let t=await x().fetch(`/raytace/attribution`,{method:`POST`,headers:{"content-type":`application/json`,"x-raytace-experiment":`1`},body:JSON.stringify({exchange_id:e.exchange_id,output_index:e.output_index})});if(t.status===409){await new Promise(e=>setTimeout(e,700));continue}let n=await t.json();if(t.ok){a({status:`ready`,attribution:n});return}if(t.status<500){a({status:`error`,message:n.error??`Unavailable.`});return}}catch{if(!t())return}r+=1,await new Promise(e=>setTimeout(e,800*r))}t()&&a({status:`error`,message:`Could not work out this step. Reopen the view to retry.`})},[]),a=e.filter(e=>typeof e.output_index==`number`).map(XT).join(`,`);return(0,_.useEffect)(()=>{let e=!0,t=()=>e,n=(a?a.split(`,`):[]).filter(e=>!r.current.has(e)).map(e=>{let t=e.lastIndexOf(`:`);return{exchange_id:e.slice(0,t),output_index:Number(e.slice(t+1))}}),o=0;return Promise.all(Array.from({length:4},async()=>{for(;e&&o<n.length;){let e=n[o];o+=1,await i(e,t)}})),()=>{e=!1}},[a,i]),t}function tE(e,t,n,r,i){let a=new Map(t.map(e=>[e.call_id,e])),o=[],s=new Set,c=e;for(;c&&!s.has(c.call_id)&&o.length<8;){s.add(c.call_id);let l=n[XT(c)];if(l?.status!==`ready`||!l.attribution.ranked)break;let u=l.attribution.causes[0];if(!u)break;let d=u.source_call_id?a.get(u.source_call_id):void 0;if(u.kind===`tool_result`&&d){let n=r.get(d.call_id);if(n&&!n.calls.some(t=>t.call_id===e.call_id)){let e=rd(n,i);o.unshift({label:`${e.range} ${e.kind}`,callId:n.id}),c=n.calls[0]}else o.unshift({label:`#${t.indexOf(d)+1} ${d.name}`,callId:d.call_id}),c=d}else{o.unshift({label:$T[u.kind].toLowerCase(),callId:null});break}}return o.length>1||o[0]?.callId?o:null}function nE({call:e,trace:t}){let n=Ne(t.events,e.call_id),r=[];e.exec_id?(r.push(`The sandbox saw it run`),typeof e.exit_code==`number`&&r.push(`exit ${e.exit_code}`),e.descendant_count&&r.push(`${e.descendant_count} child process${e.descendant_count===1?``:`es`}`)):n.state===`rejected`?r.push(`Refused by the sandbox policy`):(e.kind?e.kind===`command`:e.name===`Bash`)?r.push(`No process was seen for it`):r.push(`Ran inside the agent, not as a separate process`),e.snapshot?.changed&&r.push(`${e.snapshot.changes.length} file${e.snapshot.changes.length===1?``:`s`} changed`);let i=e.reported_check&&e.reported_check!==`agrees`;return(0,K.jsxs)(`div`,{className:`rt-cot-ran`,children:[(0,K.jsx)(`span`,{className:`workspace-label`,children:`WHAT ACTUALLY RAN`}),` `,r.join(` · `),i&&(0,K.jsxs)(`p`,{className:`rt-cot-warn`,children:[`The agent was told something different from what the sandbox saw (`,e.reported_check===`exit_code_differs`?`exit code`:`duration`,` differs). Its next steps were based on what it was told.`]}),e.snapshot?.changed&&(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{children:`Files changed`}),(0,K.jsx)(IT,{snapshot:e.snapshot,sandbox:t.sandboxId})]})]})}function rE({attribution:e,number:t,onJump:n}){let r=e.ranked?e.causes.filter(e=>(e.probability??0)>=QT):e.causes;return(0,K.jsxs)(K.Fragment,{children:[e.ranked&&(0,K.jsx)(`div`,{className:`rt-cot-bar`,"aria-hidden":`true`,children:r.map(e=>(0,K.jsx)(`span`,{className:`k-${e.kind}`,style:{width:ZT(e.probability??0)},title:`${ZT(e.probability??0)} ${e.reason}`},e.key))}),!e.ranked&&(0,K.jsxs)(`p`,{className:`rt-cot-note`,children:[`Possible reasons, unranked`,e.unsure_reason?`: ${e.unsure_reason}`:`.`]}),(0,K.jsx)(`ol`,{className:`rt-cot-causes`,children:r.map(e=>{let r=e.source_call_id?t(e.source_call_id):null;return(0,K.jsxs)(`li`,{children:[e.probability==null?(0,K.jsx)(`span`,{"aria-hidden":`true`}):(0,K.jsx)(`strong`,{className:`rt-cot-pct`,children:ZT(e.probability)}),(0,K.jsx)(`i`,{className:`rt-cot-dot k-${e.kind}`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{children:e.reason}),(0,K.jsxs)(`small`,{children:[$T[e.kind],r&&(0,K.jsxs)(K.Fragment,{children:[` · `,(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>n(e.source_call_id),children:[`step #`,r]})]})]}),e.quote&&(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{children:`Evidence`}),(0,K.jsx)(`blockquote`,{children:e.quote})]})]})]},e.key)})})]})}function iE({call:e,index:t,trace:n,states:r,chain:i,highlight:a,number:o,onJump:s}){let c=r[XT(e)],l=c?.status===`ready`?c.attribution:null;return(0,K.jsxs)(`li`,{id:`cot-${e.call_id}`,className:`rt-cot-step${a?` rt-focus`:``}`,children:[(0,K.jsxs)(`div`,{className:`rt-cot-head`,children:[(0,K.jsxs)(`span`,{className:`rt-cot-num`,children:[`#`,t+1]}),(0,K.jsx)(`strong`,{children:e.name}),(0,K.jsx)(Au,{text:e.proposed||e.name}),l?.purpose&&(0,K.jsx)(`span`,{className:`rt-chip`,title:l.purpose.label,children:l.purpose.choice.replace(`_`,` `)}),l?.unsure&&(0,K.jsx)(`span`,{className:`rt-cot-unsure`,title:l.unsure_reason??``,children:`Unsure`})]}),(0,K.jsx)(aE,{state:c,number:o,onJump:s}),i&&(0,K.jsxs)(`p`,{className:`rt-cot-chain`,children:[(0,K.jsx)(`span`,{className:`workspace-label`,children:`CHAIN`}),i.map((e,t)=>(0,K.jsxs)(`span`,{children:[e.callId?(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>s(e.callId),children:e.label}):e.label,` → `]},t)),(0,K.jsx)(`span`,{children:`this step`})]}),(0,K.jsx)(nE,{call:e,trace:n})]})}function aE({state:e,number:t,onJump:n}){if(!e||e.status===`loading`)return(0,K.jsx)(`p`,{className:`rt-cot-note`,children:`Working out why…`});if(e.status===`error`)return(0,K.jsx)(`p`,{className:`rt-cot-note`,children:e.message});let{attribution:r}=e;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(rE,{attribution:r,number:t,onJump:n}),r.unsure&&r.unsure_reason&&(0,K.jsxs)(`p`,{className:`rt-cot-note`,children:[`Unsure: `,r.unsure_reason]})]})}function oE({trace:e,focusCall:t}){let n=Pe(e),r=n.where===`sandbox`?e.callVerifications??[]:[],i=td(e,r),a=new Map(i.filter(e=>e.calls.length>1).flatMap(e=>e.calls.map(t=>[t.call_id,e]))),[o,s]=(0,_.useState)(()=>new Set),c=e=>o.has(e.id)!==e.calls.some(e=>e.call_id===t),l=e=>s(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),u=eE(i.flatMap(e=>e.calls.length>1&&!c(e)?[e.calls[0]]:e.calls)),[d,f]=(0,_.useState)(t),p=e=>{let t=r.findIndex(t=>t.call_id===e);return t<0?null:t+1},m=e=>{let t=a.get(e);t&&!c(t)&&e!==t.id&&l(t),f(e),requestAnimationFrame(()=>(document.getElementById(`cot-${e}`)??(t?document.getElementById(`cot-group-${t.id}`):null))?.scrollIntoView({block:`center`,behavior:`smooth`}))};(0,_.useEffect)(()=>{if(!t)return;let e=requestAnimationFrame(()=>document.getElementById(`cot-${t}`)?.scrollIntoView({block:`center`,behavior:`smooth`}));return()=>cancelAnimationFrame(e)},[t]);let h=(0,K.jsx)(`header`,{className:`rt-view-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`CHAIN OF THOUGHT`}),(0,K.jsx)(`h1`,{children:`Why the agent did each step`}),(0,K.jsx)(`p`,{className:`rt-muted rt-cot-caption`,children:`Likely reasons inferred from what the agent could see. Not the model's private reasoning.`})]})});if(n.where!==`sandbox`)return(0,K.jsxs)(`section`,{className:`rt-view`,children:[h,(0,K.jsxs)(`p`,{className:`rt-empty`,children:[`Chain of thought is available for prompts run in the sandbox. Run Claude Code in a local sandbox: `,(0,K.jsx)(`code`,{children:`raytrace sandbox create --local`}),`.`]})]});if(!r.length)return(0,K.jsxs)(`section`,{className:`rt-view`,children:[h,(0,K.jsx)(`p`,{className:`rt-empty`,children:`This prompt made no tool calls.`})]});let g=Object.values(u).find(e=>e.status===`ready`),v=g?.status===`ready`?[g.attribution.proposer_model,g.attribution.jev_model].filter(Boolean).join(` + `):``,y=t=>(0,K.jsx)(iE,{call:t,index:r.indexOf(t),trace:e,states:u,chain:tE(t,r,u,a,e),highlight:d===t.call_id,number:p,onJump:m},t.call_id);return(0,K.jsxs)(`section`,{className:`rt-view`,children:[h,(0,K.jsx)(YT,{trace:e,onStep:m}),(0,K.jsx)(`ol`,{className:`rt-cot-steps`,children:i.map(t=>{if(t.calls.length===1)return y(t.calls[0]);let n=rd(t,e),r=c(t),i=t.calls[0];return(0,K.jsxs)(`li`,{id:`cot-group-${t.id}`,className:`rt-cot-step rt-cot-group${d&&t.calls.some(e=>e.call_id===d)&&!r?` rt-focus`:``}`,children:[(0,K.jsxs)(`div`,{className:`rt-cot-head`,children:[(0,K.jsx)(`span`,{className:`rt-cot-num`,children:n.range}),(0,K.jsx)(`strong`,{children:n.label}),(0,K.jsxs)(`span`,{className:`rt-chip`,children:[t.calls.length,` steps`]}),n.flags.map(e=>(0,K.jsx)(`span`,{className:`rt-group-flag`,children:e},e))]}),(0,K.jsxs)(`p`,{className:`rt-cot-note`,children:[`Why it started (step #`,t.first,`):`]}),(0,K.jsx)(aE,{state:u[XT(i)],number:p,onJump:m}),n.repeated&&(0,K.jsxs)(`p`,{className:`rt-cot-note`,children:[n.repeated,` `,n.outcome[0].toUpperCase()+n.outcome.slice(1),`.`]}),(0,K.jsx)(`button`,{type:`button`,className:`link-button rt-cot-expand`,onClick:()=>l(t),children:r?`Hide the steps`:`Show the ${t.calls.length} steps`}),r&&(0,K.jsx)(`ol`,{className:`rt-cot-steps rt-cot-members`,children:t.calls.map(y)})]},t.id)})}),v&&(0,K.jsxs)(`p`,{className:`rt-foot`,children:[`Causes proposed and ranked by `,v,`. Each step is worked out once and saved.`]})]})}var sE=`/raytace`,cE=e=>[`queued`,`running`].includes(e.status),lE=e=>e===null?`Not measured`:`${Math.round(e*100)}%`;async function uE(e,t){let n=await fetch(`${sE}${e}`,t===void 0?void 0:{method:`POST`,headers:{"content-type":`application/json`,"x-raytace-experiment":`1`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(r.error||`Request failed (${n.status})`);return r}function dE(e){return e.preview.trim().startsWith(`<skills_instructions>`)?`Codex skill instructions`:e.preview.trim().startsWith(`<environment_context>`)?`Environment context`:e.action||`${e.kind} · ${e.preview.replace(/\s+/g,` `).slice(0,55)}`}function fE({selected:e,focusCallId:t=null}){let[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(`decision`),[g,v]=(0,_.useState)(`3`),[y,b]=(0,_.useState)(`10`),[x,S]=(0,_.useState)([]),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(!!e?.exchange_id&&e.output_index!==void 0),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=!1;return uE(`/models`).then(t=>{e||(a(t.models),s(t.execution_available))}).catch(t=>{e||E(t.message)}),()=>{e=!0}},[]),(0,_.useEffect)(()=>{let n=!1;if(e?.exchange_id&&e.output_index!==void 0)return uE(`/steps/${e.exchange_id}/${e.output_index}`).then(e=>{if(n)return;r(e),l(e.model);let i=t&&e.evidence.find(e=>e.call_id===t)||e.evidence.find(t=>t.id===e.hypotheses[0]?.evidence_id)||e.evidence[0];d(i?.id||``),p(i?.content??i?.preview??``)}).catch(e=>{n||E(e.message)}).finally(()=>{n||O(!1)}),()=>{n=!0}},[e?.exchange_id,e?.output_index,t]),(0,_.useEffect)(()=>{let e=!1,t,n=async()=>{try{let t=await uE(`/experiments`);e||S(t.experiments)}catch{}e||(t=setTimeout(n,1500))};return n(),()=>{e=!0,clearTimeout(t)}},[]);let N=n?.evidence.find(e=>e.id===u),P=x.find(cE),F=x.find(e=>e.id===C),I=Number(g),L=Number(y),R=m===`decision`?Number.isInteger(I)&&I>=2&&I<=20:Number.isInteger(L)&&L>=1&&L<=20;function z(e){let t=n?.evidence.find(t=>t.id===e);d(e),p(t?.content??t?.preview??``)}async function ee(){if(n){M(!0),E(``);try{let e=await uE(`/explanations`,{exchange_id:n.exchange_id,output_index:n.output_index});r({...n,hypotheses:e.hypotheses,explanation_generated:!0,explanation_model:e.model}),e.hypotheses[0]&&z(e.hypotheses[0].evidence_id)}catch(e){E(e instanceof Error?e.message:`Could not generate explanations.`)}finally{M(!1)}}}async function B(){if(n&&N&&R){A(!0),E(``);try{let e=await uE(`/step-runs`,{exchange_id:n.exchange_id,output_index:n.output_index,evidence_id:u,context:f,model:c,mode:m,repetitions:m===`decision`?I:2,max_requests:m===`execute`?L:1});S(t=>[e,...t]),w(e.id)}catch(e){E(e instanceof Error?e.message:`Could not start run.`)}finally{A(!1)}}}return(0,K.jsxs)(`aside`,{className:`fork-panel lab decision-lab`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`COUNTERFACTUAL LAB`}),(0,K.jsx)(`h2`,{children:`Explore this decision`}),!n&&!D&&!T&&(0,K.jsx)(`p`,{children:`Select a proposed tool call or model answer in the sequence.`}),D&&(0,K.jsx)(`output`,{children:`Loading the context before this step…`}),T&&(0,K.jsx)(`p`,{className:`experiment-error`,role:`alert`,children:T}),n&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{className:`step-focus`,children:[(0,K.jsx)(`small`,{children:`SELECTED STEP`}),(0,K.jsx)(`h3`,{children:e?.title}),(0,K.jsx)(`p`,{children:e?.detail})]}),(0,K.jsx)(`h3`,{children:`Possible explanations`}),(0,K.jsx)(`p`,{className:`lab-caption`,children:n.explanation_generated?`Generated by ${n.explanation_model} from earlier context. These are hypotheses, not private reasoning.`:`Generate a short explanation using ${n.explanation_model}. One additional paid API request; saved for this step.`}),!n.explanation_generated&&(0,K.jsx)(`button`,{type:`button`,className:`run-button`,disabled:j||!o,onClick:ee,children:j?`Generating explanations…`:`Generate explanations`}),(0,K.jsx)(`ol`,{className:`hypothesis-list`,children:n.hypotheses.map((e,t)=>{let r=x.find(t=>t.kind===`step`&&t.mode===`decision`&&t.exchange_id===n.exchange_id&&t.output_index===n.output_index&&t.evidence_id===e.evidence_id&&t.model===c&&t.status===`completed`);return(0,K.jsxs)(`li`,{className:e.evidence_id===u?`chosen`:``,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>z(e.evidence_id),children:[(0,K.jsx)(`span`,{children:t+1}),(0,K.jsx)(`strong`,{children:e.title})]}),(0,K.jsx)(`p`,{children:r?`Action repeated: ${lE(r.summary.baseline.rate)} original / ${lE(r.summary.intervention.rate)} edited`:`Action repeat rate: not measured`}),(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{children:`Supporting evidence`}),(0,K.jsx)(`p`,{children:e.explanation}),(0,K.jsx)(`blockquote`,{children:e.excerpt})]})]},e.evidence_id)})}),n.explanation_generated&&!n.hypotheses.length&&(0,K.jsx)(`p`,{children:`Insufficient evidence: no explanations with verifiable supporting quotes were returned.`}),(0,K.jsx)(`h3`,{children:`Edit and rerun`}),(0,K.jsx)(`label`,{htmlFor:`step-context`,children:`Context to change`}),(0,K.jsx)(zd,{id:`step-context`,className:`lab-select`,value:u,onChange:e=>z(e.target.value),children:n.evidence.map(e=>(0,K.jsxs)(Bd,{value:e.id,children:[`#`,e.index+1,` · `,dE(e)]},e.id))}),(0,K.jsx)(`label`,{htmlFor:`edited-context`,children:`Edited context`}),(0,K.jsx)(`textarea`,{id:`edited-context`,value:f,onChange:e=>p(e.target.value),spellCheck:!1,rows:8}),(0,K.jsxs)(`div`,{className:`context-actions`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>p(N?.content??N?.preview??``),children:`Reset`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>p(``),children:`Withhold text`})]}),(0,K.jsx)(`small`,{children:`Only this context item changes. Other messages and tool history are retained.`}),(0,K.jsx)(`label`,{htmlFor:`step-model`,children:`Model`}),(0,K.jsxs)(zd,{id:`step-model`,className:`lab-select`,value:c,onChange:e=>l(e.target.value),children:[!i.some(e=>e.id===n.model)&&(0,K.jsx)(Bd,{value:n.model,children:n.model}),i.map(e=>(0,K.jsxs)(Bd,{value:e.id,children:[e.alias,` · `,e.id]},e.alias))]}),(0,K.jsx)(`label`,{htmlFor:`run-mode`,children:`Run mode`}),(0,K.jsxs)(zd,{id:`run-mode`,className:`lab-select`,value:m,onChange:e=>h(e.target.value),children:[(0,K.jsx)(Bd,{value:`decision`,children:`Replay model decision`}),(0,K.jsx)(Bd,{value:`execute`,disabled:!o,children:`Execute and continue`})]}),m===`decision`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`label`,{htmlFor:`step-count`,children:`Runs per version`}),(0,K.jsx)(`input`,{id:`step-count`,type:`number`,min:2,max:20,step:1,value:g,onChange:e=>v(e.target.value)}),(0,K.jsx)(`p`,{children:R?`${I} original + ${I} edited = ${I*2} paid API calls maximum.`:`Enter a whole number from 2 to 20.`}),(0,K.jsxs)(`details`,{className:`raw-details`,children:[(0,K.jsx)(`summary`,{children:`How this is measured`}),(0,K.jsx)(`p`,{children:`Both use the selected model. Tools are not executed.`})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`label`,{htmlFor:`step-limit`,children:`Maximum model requests`}),(0,K.jsx)(`input`,{id:`step-limit`,type:`number`,min:1,max:20,step:1,value:y,onChange:e=>b(e.target.value)}),(0,K.jsxs)(`p`,{children:[`One continuation in a separate copy of current project files, up to `,R?L:`—`,` paid requests and 3 minutes.`]}),(0,K.jsxs)(`details`,{className:`raw-details`,children:[(0,K.jsx)(`summary`,{children:`How this is measured`}),(0,K.jsx)(`p`,{children:`Tools can edit the copy; network access and approval-requiring actions are blocked. Dependencies are not copied. This reconstructs the task from edited context; it is not an exact historical session resume.`})]})]}),n.replay_reason&&(0,K.jsx)(`p`,{className:`scope-note`,children:n.replay_reason}),(0,K.jsx)(`button`,{className:`run-button`,type:`button`,disabled:k||!!P||!R||!N||!!n.replay_reason,onClick:B,children:k?`Starting…`:m===`decision`?`Compare responses`:`Execute in project copy`}),P&&(0,K.jsxs)(`div`,{className:`job-progress`,children:[(0,K.jsxs)(`p`,{children:[P.mode===`execute`?`${P.requests||0}/${P.max_requests} model requests`:`${P.trials?.length||0}/${P.max_requests} trials`,` · `,P.status]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>uE(`/experiments/${P.id}/cancel`,{}).catch(e=>E(e.message)),children:`Cancel experiment`})]}),x.some(e=>e.kind===`step`&&e.exchange_id===n.exchange_id&&e.output_index===n.output_index)&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`label`,{htmlFor:`step-run`,children:`Results for this action`}),(0,K.jsxs)(zd,{id:`step-run`,className:`lab-select`,value:C,onChange:e=>w(e.target.value),children:[(0,K.jsx)(Bd,{value:``,children:`Choose an experiment`}),x.filter(e=>e.kind===`step`&&e.exchange_id===n.exchange_id&&e.output_index===n.output_index).map(e=>(0,K.jsxs)(Bd,{value:e.id,children:[e.mode,` · `,e.model,` · `,e.status]},e.id))]})]})]}),F&&(0,K.jsxs)(`section`,{className:`trial-report`,children:[(0,K.jsx)(`h3`,{children:`Original vs rerun`}),(0,K.jsxs)(`p`,{children:[F.status,` · `,F.model]}),F.error&&(0,K.jsx)(`p`,{role:`alert`,className:`error-text`,children:F.error}),(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{children:`Original action`}),(0,K.jsx)(`pre`,{children:JSON.stringify(F.recorded,null,2)})]}),F.mode===`decision`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`frequency-grid`,children:[[`Original context`,F.summary.baseline],[`Edited context`,F.summary.intervention]].map(([e,t])=>(0,K.jsxs)(`section`,{className:`frequency`,children:[(0,K.jsx)(`h4`,{children:e}),(0,K.jsx)(`strong`,{children:lE(t.rate)}),(0,K.jsxs)(`p`,{children:[t.hits,`/`,t.successful,` successful responses repeated the selected action`]}),t.interval&&(0,K.jsxs)(`small`,{children:[`95% interval: `,lE(t.interval[0]),`–`,lE(t.interval[1])]})]},e))}),(0,K.jsx)(`p`,{className:`lab-caption`,children:`These rates measure action repetition, not the probability an explanation is true.`}),(0,K.jsxs)(`details`,{className:`raw-details`,children:[(0,K.jsx)(`summary`,{children:`How this is measured`}),(0,K.jsx)(`p`,{children:`Small samples are uncertain. Answers require exact text matches.`})]}),(0,K.jsxs)(`p`,{children:[`Reported API cost: $`,F.cost.toFixed(4)]}),F.trials.map((e,t)=>(0,K.jsxs)(`details`,{children:[(0,K.jsxs)(`summary`,{children:[t+1,`. `,e.arm===`baseline`?`Original`:`Edited`,` · `,e.status===`succeeded`?e.matches?`same action`:`different response`:e.status]}),(0,K.jsx)(`pre`,{children:e.error||JSON.stringify(e.outcome,null,2)})]},t))]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{children:F.note}),F.workspace&&(0,K.jsxs)(`p`,{children:[`Files: `,(0,K.jsx)(`code`,{children:F.workspace})]}),(0,K.jsx)(`h4`,{children:`New execution sequence`}),F.events.map((e,t)=>(0,K.jsxs)(`details`,{children:[(0,K.jsxs)(`summary`,{children:[typeof e.type==`string`?e.type:`Event`,` `,String(e.item?.type||``)]}),(0,K.jsx)(`pre`,{children:JSON.stringify(e,null,2)})]},t))]})]})]})}var pE=e=>Math.round(e/4),mE=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e);async function hE(e,t){let n=window.open(``,`_blank`);try{let r=await x().fetch(`/raytace/prompt-context/${e}/item/${t}`),i=URL.createObjectURL(new Blob([await r.text()],{type:`text/plain;charset=utf-8`}));n?n.location.replace(i):window.location.assign(i)}catch{n?.close()}}var gE=(e,t=140)=>{let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n};function _E(e){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(!1),s=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{let t=!1;return x().fetch(`/raytace/prompt-context/${e}`).then(async e=>{let r=await e.json();if(e.status===404&&r.error===`Unknown local endpoint.`)throw Error(`The proxy is running an older version without this page. Restart it (raytrace stop && raytrace start) and reload.`);if(!e.ok)throw Error(r.error||`Context unavailable`);t||n(r)}).catch(e=>{t||i(e instanceof Error?e.message:`Context unavailable`)}),()=>{t=!0}},[e]),(0,_.useEffect)(()=>{if(!t||t.summary||!t.summary_needed||s.current)return;s.current=!0;let r=!1;return o(!0),x().fetch(`/raytace/prompt-context/summary`,{method:`POST`,headers:{"content-type":`application/json`,"x-raytace-experiment":`1`},body:JSON.stringify({trace_id:e})}).then(async e=>{let t=await e.json();e.ok&&!r&&n(e=>e&&{...e,summary:t})}).catch(()=>{}).finally(()=>{r||o(!1)}),()=>{r=!0}},[t,e]),{data:t,error:r,summarizing:a}}function vE({file:e,traceId:t,onTest:n,onRerun:r}){let[i,a]=(0,_.useState)(!1),o=e.op===`wrote`?`—`:`${e.lines} line${e.lines===1?``:`s`}`;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`li`,{className:`rt-file${i?` open`:``}`,children:(0,K.jsxs)(`button`,{type:`button`,className:`rt-file-row`,onClick:()=>a(!i),"aria-expanded":i,children:[(0,K.jsx)(`span`,{className:`rt-op rt-op-${e.op}`,children:e.op}),(0,K.jsx)(`code`,{className:`rt-file-path`,title:e.path,children:e.path}),(0,K.jsxs)(`span`,{className:`rt-file-size`,title:e.shared_output?`This output came from several commands chained together, so it cannot be split between them.`:void 0,children:[o,e.shared_output?`*`:``]}),(0,K.jsx)(`span`,{className:`rt-file-tokens`,title:`Estimated tokens this file added to the context window`,children:e.op===`wrote`?``:`~${mE(pE(e.chars))} tokens`}),(0,K.jsx)(`span`,{className:`rt-file-used`,title:e.used_later.length?`Words from this output appear later in what the model wrote: ${e.used_later.join(`, `)}. A hint, not proof it mattered.`:`Nothing from this output reappears later. A hint, not proof it did not matter.`,children:e.used_later.length?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(z,{size:12}),` used`]}):``})]})}),i&&(0,K.jsxs)(`li`,{className:`rt-file-detail`,children:[(0,K.jsxs)(`p`,{className:`rt-muted`,children:[e.when===`before`?`In context before your question`:`Read while answering this prompt`,e.reads>1?` · read ${e.reads} times`:``,` · `,e.via===`tool`?`named by the tool call`:`inferred from the command`,` `,(0,K.jsx)(`code`,{children:gE(e.command,90)})]}),(0,K.jsxs)(`div`,{className:`rt-actions`,children:[e.op!==`wrote`&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>void hE(t,e.context_index),children:[`Open what the model saw `,(0,K.jsx)(te,{size:13})]}),r&&e.op!==`wrote`&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:r,title:`Open the Playground at the next step, with this output removed`,children:[(0,K.jsx)(ie,{size:14}),` Rerun without this`]}),n&&e.op!==`wrote`&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:n,children:[(0,K.jsx)(ne,{size:14}),` Test impact`]})]})]})]})}function yE({data:e}){let t=pE(e.totals.chars),n=t=>e.internals.filter(e=>e.kind===t).reduce((e,t)=>e+t.chars,0),r=e.files.filter(e=>e.op!==`wrote`).reduce((e,t)=>e+t.chars,0),i=n(`System prompt`)+n(`Tools`)+r,a=[{label:`System prompt`,chars:n(`System prompt`),tone:1},{label:`Tool definitions`,chars:n(`Tools`),tone:2},{label:`File contents`,chars:r,tone:3},{label:`Conversation and other instructions`,chars:Math.max(0,e.totals.chars-i),tone:4}].filter(e=>e.chars>0),o=e.context_window,s=o||t||1;return(0,K.jsxs)(`section`,{className:`rt-window`,"aria-label":`Context window`,children:[(0,K.jsxs)(`div`,{className:`rt-window-head`,children:[(0,K.jsxs)(`strong`,{children:[`Context window: ~`,mE(t),` tokens used`,o?` of ${mE(o)}`:``]}),(0,K.jsx)(`span`,{children:o?`${(t/o*100).toFixed(1)}% full by the final answer · ${e.model}`:`by the final answer · window size for ${e.model} unknown`})]}),(0,K.jsx)(`div`,{className:`rt-window-bar`,children:a.map(e=>(0,K.jsx)(`i`,{className:`rt-seg-${e.tone}`,style:{width:`${Math.max(.4,pE(e.chars)/s*100)}%`},title:`${e.label}: ~${mE(pE(e.chars))} tokens`},e.label))}),(0,K.jsx)(`div`,{className:`rt-window-legend`,children:a.map(e=>(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{className:`rt-seg-${e.tone}`}),e.label,` ~`,mE(pE(e.chars))]},e.label))})]})}function bE({trace:e,stepKey:t,onStep:n,onRerunWithout:r}){let{data:i,error:a,summarizing:o}=_E(e.id),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(null),f=e.callVerifications??[],p=f.map((e,t)=>({call_id:e.call_id,exchange_id:e.exchange_id,output_index:e.output_index,title:`#${t+1} ${e.name}`,detail:e.proposed??e.name})),m=e=>`${e.exchange_id}:${e.output_index}`,h=p.find(e=>m(e)===t)??p[0];function g(e){let t=p.findIndex(t=>t.call_id===e.call_id),r=t>=0?p[t+1]:void 0;r&&(u(e.call_id),c(!0),n(m(r)),requestAnimationFrame(()=>d.current?.scrollIntoView({behavior:`smooth`,block:`start`})))}let v=e=>{let t=p.findIndex(t=>t.call_id===e.call_id);return t>=0&&t<p.length-1},y=Pe(e).forkable,b=x().reruns,S=(e.requests??[]).map(e=>e.id),C=e=>{let t=f.find(t=>t.call_id===e.call_id),n=t?S[S.indexOf(t.exchange_id)+1]:void 0;return r&&y&&n?()=>r(n,e.call_id):void 0},w=i?.files.filter(e=>e.op!==`listed`)??[],T=i?.files.filter(e=>e.op===`listed`)??[],E=i?.answers.filter(e=>e.when===`before`)??[],D=i?.internals.find(e=>e.kind===`Environment`)?.fields;return(0,K.jsxs)(`section`,{className:`rt-view`,children:[(0,K.jsx)(`header`,{className:`rt-view-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`CONTEXT`}),(0,K.jsx)(`h1`,{children:`What the model was working from`}),(0,K.jsxs)(`p`,{className:`rt-muted rt-sub`,children:[gE(e.title,120),` · `,new Date(e.startedAt).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`})]})]})}),i&&(0,K.jsx)(yE,{data:i}),a&&(0,K.jsx)(`p`,{role:`alert`,className:`verify-error`,children:a}),!i&&!a&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`Loading the context…`}),i&&(0,K.jsxs)(`div`,{className:`rt-boxes`,children:[(0,K.jsxs)(`section`,{className:`rt-box`,children:[(0,K.jsxs)(`h2`,{children:[(0,K.jsx)(`span`,{children:`A`}),` You asked before`]}),i.earlierPrompts.length?(0,K.jsx)(`ol`,{className:`rt-box-list`,children:i.earlierPrompts.map((e,t)=>(0,K.jsx)(`li`,{children:i.summary?.prompts[t]??gE(e.text)},e.index))}):(0,K.jsx)(`p`,{className:`rt-muted`,children:`This was the first prompt in this conversation, so nothing you asked earlier was in context.`}),o&&(0,K.jsx)(`p`,{className:`rt-muted`,children:`Summarising…`})]}),(0,K.jsxs)(`section`,{className:`rt-box rt-box-wide`,children:[(0,K.jsxs)(`h2`,{children:[(0,K.jsx)(`span`,{children:`B`}),` The model brought`]}),(0,K.jsx)(`p`,{className:`rt-box-note`,children:E.length?i.summary?.answers||`${E.length} earlier answer${E.length===1?``:`s`}: ${gE(E.at(-1).text,120)}`:`No earlier answers: it started this conversation with your question.`}),w.length?(0,K.jsx)(`ul`,{className:`rt-files`,title:`From the agent's file tools and the commands it ran, not observed at the file level.`,children:w.map(t=>(0,K.jsx)(vE,{file:t,traceId:e.id,onRerun:C(t),onTest:b&&!y&&v(t)?()=>g(t):void 0},`${t.op}:${t.path}`))}):(0,K.jsx)(`p`,{className:`rt-muted`,children:`No file reads identified in what was captured.`}),T.length>0&&(0,K.jsxs)(`details`,{className:`rt-listed`,children:[(0,K.jsxs)(`summary`,{children:[`listed `,T.length,` location`,T.length===1?``:`s`]}),(0,K.jsx)(`ul`,{className:`rt-files`,children:T.map(t=>(0,K.jsx)(vE,{file:t,traceId:e.id},`${t.op}:${t.path}`))})]}),(0,K.jsxs)(`p`,{className:`rt-box-foot`,children:[`Tokens are estimates of what each file added to the context window. “used” means words from the file reappear in what the model wrote later. `,y?r?`Rerun without this opens the Playground with that output removed.`:``:b?`Test impact reruns the next step without it.`:``]})]}),(0,K.jsxs)(`section`,{className:`rt-box`,children:[(0,K.jsxs)(`h2`,{children:[(0,K.jsx)(`span`,{children:`C`}),` Internals`]}),(0,K.jsx)(`ul`,{className:`rt-internals`,children:i.internals.map(t=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(`details`,{children:[(0,K.jsxs)(`summary`,{children:[(0,K.jsx)(`strong`,{children:t.kind}),(0,K.jsxs)(`span`,{children:[`~`,mE(pE(t.chars)),` tokens`]})]}),t.kind===`Environment`&&D?(0,K.jsx)(`dl`,{children:Object.entries(D).map(([e,t])=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:e.replace(/_/g,` `)}),(0,K.jsx)(`dd`,{children:t})]},e))}):t.names?(0,K.jsx)(`p`,{className:`rt-muted`,children:t.names.join(`, `)}):null,(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>void hE(e.id,t.context_index),children:`Open full text ↗`})]})},t.kind))}),!i.internals.some(e=>e.kind===`AGENTS.md`)&&(0,K.jsx)(`p`,{className:`rt-muted`,children:`No AGENTS.md was loaded.`})]})]}),b&&!y&&(0,K.jsxs)(`details`,{className:`rt-test`,ref:d,open:s,onToggle:e=>c(e.currentTarget.open),children:[(0,K.jsxs)(`summary`,{children:[(0,K.jsx)(ne,{size:14}),` Test it: rerun a step with part of its context changed`]}),p.length?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`label`,{htmlFor:`lab-step`,className:`workspace-label`,children:`STEP`}),(0,K.jsx)(zd,{id:`lab-step`,className:`trace-picker`,value:h?m(h):``,onChange:e=>{u(null),n(e.target.value)},children:p.map(e=>(0,K.jsxs)(Bd,{value:m(e),children:[e.title,` · `,e.detail.slice(0,80)]},m(e)))}),s&&h&&(0,K.jsx)(`div`,{className:`rt-lab-body`,children:(0,K.jsx)(fE,{selected:h,focusCallId:l},`${m(h)}:${l??``}`)})]}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`This prompt proposed no tool calls, so there is no step to rerun.`})]})]})}var xE=e=>{try{return Number(localStorage.getItem(e))||null}catch{return null}},SE=(e,t)=>{try{t==null?localStorage.removeItem(e):localStorage.setItem(e,String(t))}catch{}};function CE({target:e,variable:t,storageKey:n,min:r,max:i,label:a}){let o=e=>Math.round(Math.min(i,Math.max(r,e))),s=n=>{n==null?e.current?.style.removeProperty(t):e.current?.style.setProperty(t,`${o(n)}px`)},c=e=>e.parentElement?.getBoundingClientRect().width??r;return(0,_.useEffect)(()=>{let a=xE(n);a&&e.current?.style.setProperty(t,`${Math.round(Math.min(i,Math.max(r,a)))}px`)},[e,t,n,r,i]),(0,K.jsx)(`button`,{type:`button`,"aria-label":`${a}: drag, or use the arrow keys, to resize`,className:`resize-handle`,title:`${a} · drag to resize, double-click to reset`,onPointerDown:e=>{let t=e.currentTarget,r=e.clientX,i=c(t);t.setPointerCapture(e.pointerId),document.body.classList.add(`resizing`);let a=e=>s(i+e.clientX-r),l=e=>{t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerup`,l),t.removeEventListener(`pointercancel`,l),document.body.classList.remove(`resizing`),SE(n,o(i+e.clientX-r))};t.addEventListener(`pointermove`,a),t.addEventListener(`pointerup`,l),t.addEventListener(`pointercancel`,l)},onKeyDown:e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault();let t=o(c(e.currentTarget)+(e.key===`ArrowRight`?24:-24));s(t),SE(n,t)},onDoubleClick:()=>{s(null),SE(n,null)}})}var wE={"content-type":`application/json`,"x-raytace-experiment":`1`},TE=[`claude-opus-5-5`,`claude-sonnet-5`,`claude-haiku-4-5`,`claude-fable-5-1`],EE=`(output removed)`,DE=(e,t=120)=>{let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n},OE=e=>new Date(e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),kE=e=>[`queued`,`creating`,`running`,`collecting`,`checking`].includes(e.status),AE={queued:`Waiting`,creating:`Starting sandbox`,running:`Running`,collecting:`Comparing`,checking:`Checking`,completed:`Done`,failed:`Failed`,interrupted:`Interrupted`,cancelled:`Cancelled`},jE=[1,3,5,10],ME=e=>e.check&&[`passed`,`failed`,`timed_out`].includes(e.check.status),NE=e=>{if(!e.length)return null;let t=[...e].sort((e,t)=>e-t),n=t.length>>1;return t.length%2?t[n]:(t[n-1]+t[n])/2},PE={pending:`Check waiting`,running:`Checking…`,passed:`Check passed`,failed:`Check failed`,timed_out:`Check timed out`,error:`Check could not run`,skipped:`Check not run`},FE=e=>e==null?``:e<1e4?`${(e/1e3).toFixed(1)} s`:`${Math.round(e/1e3)} s`;function IE({check:e}){let t=e.status===`passed`||e.status===`failed`?`exit ${e.exit_code} · ${FE(e.duration_ms)}`:e.status===`timed_out`?`stopped after ${FE(e.duration_ms)}`:e.status===`skipped`?`the fork stopped before it got there`:``;return(0,K.jsxs)(`div`,{className:`pg-check c-${e.status}`,children:[(0,K.jsxs)(`p`,{children:[e.status===`passed`?(0,K.jsx)(z,{size:14}):e.status===`failed`||e.status===`timed_out`?(0,K.jsx)(Te,{size:14}):null,(0,K.jsx)(`strong`,{children:PE[e.status]}),(0,K.jsx)(`code`,{children:e.command}),t&&(0,K.jsx)(`small`,{children:t})]}),e.output&&(0,K.jsxs)(`details`,{children:[(0,K.jsx)(`summary`,{children:`Output`}),(0,K.jsx)(`pre`,{className:`pg-diff`,children:e.output})]})]})}function LE(e){let[t,n]=(0,_.useState)([]),r=(0,_.useCallback)(async()=>{try{let e=await x().fetch(`/raytace/forks`);e.ok&&n((await e.json()).forks)}catch{}},[]);return(0,_.useEffect)(()=>{let e=!1,t,n=async()=>{await r(),e||(t=setTimeout(n,2500))};return n(),()=>{e=!0,clearTimeout(t)}},[r]),{forks:t.filter(t=>e.has(t.exchange_id)),refresh:r}}function RE(e){let[t,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(!e)return;let t=!1;return x().fetch(`/raytace/forks/preview/${e}`).then(async e=>{let r=await e.json();t||n(e.ok?r:{forkable:!1,reason:r.error??`Preview unavailable.`})}).catch(()=>{t||n({forkable:!1,reason:`RayTrace is not reachable.`})}),()=>{t=!0}},[e]),t}function zE({fork:e,path:t}){let[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(!e.comparison?.fork)return;let n=new URLSearchParams({commit:e.comparison.original,to:e.comparison.fork,path:t});x().fetch(`/raytace/snapshots/${e.parent}/diff?${n}`).then(async e=>{let t=await e.json();r(e.ok?t.diff||`(no difference)`:`Could not load the diff: ${t.error}`)}).catch(()=>r(`Could not load the diff.`))},[e,t]),n===null?(0,K.jsx)(`p`,{className:`pg-note`,children:`Loading diff…`}):n.startsWith(`Could not load`)?(0,K.jsx)(`p`,{className:`pg-note`,children:n}):(0,K.jsx)(NT,{diff:n})}function BE({fork:e,trace:t,fromIndex:n,forkTrace:r,onChanged:i,onOpenTrace:a}){let[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),u=t.requests??[],d=(t.callVerifications??[]).filter(e=>u.findIndex(t=>t.id===e.exchange_id)>=n),f=e.comparison?.changes??[],p=async t=>{l(!0);try{await x().fetch(`/raytace/forks/${e.id}/${t}`,{method:`POST`,headers:wE})}finally{l(!1),i()}},m=kE(e)?null:e.status===`completed`?e.comparison?.same_files?`Same files as the original.`:`${f.length} file${f.length===1?``:`s`} differ from the original.`:null;return(0,K.jsxs)(`article`,{className:`pg-run`,children:[(0,K.jsxs)(`header`,{className:`pg-run-head`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`span`,{className:`pg-status s-${e.status}`,children:[AE[e.status],kE(e)&&e.progress.tool_calls?` · ${e.progress.tool_calls} tool call${e.progress.tool_calls===1?``:`s`}`:``]}),(0,K.jsx)(`strong`,{children:e.model}),(0,K.jsxs)(`small`,{children:[(e.attempts??1)>1&&`Run ${e.attempt} of ${e.attempts} · `,OE(e.created_at),(()=>{let t=e.edits.excluded??[],n=t.length?0:e.edits.results.length,r=[t.length&&`excluded ${t.join(`, `)}`,!t.length&&n&&`${n} tool result${n===1?``:`s`} edited`,e.edits.files.length&&`edited ${e.edits.files.join(`, `)}`].filter(Boolean);return r.length?` · ${r.join(` · `)}`:e.message?``:` · nothing changed`})()]}),e.message&&(0,K.jsxs)(`p`,{className:`pg-told`,children:[(0,K.jsx)(`b`,{children:`You told it:`}),` `,e.message]})]}),(0,K.jsxs)(`div`,{className:`rt-actions`,children:[r&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>a(r.id),title:`The fork's steps, commands and sandbox evidence, like any recorded run`,children:[`Fork's tool calls`,` `,(0,K.jsx)(P,{size:13})]}),!e.deleted_at&&!kE(e)&&(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:c,onClick:()=>p(e.keep?`unkeep`:`keep`),title:e.keep?`Let it be deleted like any other fork`:`Keep this fork's sandbox instead of deleting it with the next run`,children:e.keep?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ue,{size:13}),` Unkeep`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(de,{size:13}),` Keep`]})}),!e.deleted_at&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,disabled:c,onClick:()=>p(`delete`),children:[(0,K.jsx)(be,{size:13}),e.status===`queued`?`Cancel this run`:kE(e)?`Stop and delete`:`Delete sandbox`]}),e.deleted_at&&e.status!==`cancelled`&&(0,K.jsx)(`span`,{className:`pg-note`,children:`Sandbox deleted · results kept`})]})]}),e.error&&(0,K.jsx)(`p`,{role:`alert`,className:`pg-error`,children:e.error}),e.check&&(0,K.jsx)(IE,{check:e.check}),m&&(0,K.jsx)(`p`,{className:`pg-verdict${e.comparison?.same_files?` same`:``}`,children:m}),(0,K.jsxs)(`div`,{className:`pg-compare`,children:[(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{children:`Original, from this step`}),(0,K.jsxs)(`ol`,{className:`pg-steps`,children:[d.map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`b`,{children:e.name}),(0,K.jsx)(`code`,{children:DE(e.proposed??``,140)})]},e.call_id)),!d.length&&(0,K.jsx)(`li`,{className:`pg-note`,children:`Answered without another tool call.`})]}),t.answer&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`h4`,{children:`Answer`}),(0,K.jsx)(`p`,{className:`pg-answer`,children:t.answer})]})]}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{children:`Fork`}),(0,K.jsxs)(`ol`,{className:`pg-steps`,children:[e.events.filter(e=>e.kind===`tool`).map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`b`,{children:e.name}),(0,K.jsx)(`code`,{children:DE(e.detail,140)})]},t)),kE(e)&&(0,K.jsx)(`li`,{className:`pg-note pg-live`,children:e.status===`queued`?`Waiting for run ${(e.attempt??2)-1} to finish…`:e.status===`creating`?`Restoring the project and starting Claude Code…`:e.status===`collecting`?`Comparing files with the original…`:e.status===`checking`?`Running ${e.check?.command??`the check`}…`:`Working…`}),!kE(e)&&!e.events.some(e=>e.kind===`tool`)&&(0,K.jsx)(`li`,{className:`pg-note`,children:`Answered without another tool call.`})]}),e.result?.text&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`h4`,{children:`Answer`}),(0,K.jsx)(`p`,{className:`pg-answer`,children:e.result.text})]}),e.result&&(0,K.jsx)(`p`,{className:`pg-note`,children:[e.result.turns!=null&&`${e.result.turns} turns`,e.result.duration_ms!=null&&`${Math.round(e.result.duration_ms/1e3)} s`,e.result.cost_usd!=null&&`≈ $${e.result.cost_usd.toFixed(4)} at API prices`].filter(Boolean).join(` · `)})]})]}),e.comparison&&(0,K.jsxs)(`section`,{className:`pg-files`,children:[(0,K.jsx)(`h3`,{children:`Files, original vs fork`}),f.length?(0,K.jsx)(`ul`,{children:f.map(t=>(0,K.jsxs)(_.Fragment,{children:[(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(o===t.path?null:t.path),"aria-expanded":o===t.path,children:[(0,K.jsx)(`span`,{className:`rt-file-status s-${t.status}`,children:{A:`only fork`,D:`only original`,M:`differs`}[t.status]??t.status}),(0,K.jsx)(`code`,{children:t.path}),(0,K.jsx)(`small`,{children:t.added==null?`binary`:`+${t.added} −${t.removed}`})]})}),o===t.path&&(0,K.jsx)(`li`,{children:(0,K.jsx)(zE,{fork:e,path:t.path})})]},t.path))}):(0,K.jsx)(`p`,{className:`pg-note`,children:e.comparison.fork?`Every file is the same.`:`The fork took no snapshot, so there is nothing to compare.`}),(e.attempts??1)===1&&(0,K.jsx)(`p`,{className:`pg-note`,children:`Models do not answer the same way twice: even a fork with nothing changed can word things differently. Run it more than once before reading much into one difference.`})]})]})}function VE(e){let t=e.filter(e=>!kE(e)&&e.status!==`cancelled`),n=e.filter(ME),r=n.filter(e=>e.check?.status===`passed`).length,i=e=>NE(t.map(e).filter(e=>typeof e==`number`));return{finished:t,checked:n,passed:r,rate:n.length?r/n.length:null,live:e.some(kE),cost:i(e=>e.result?.cost_usd),calls:i(e=>e.progress.tool_calls),time:i(e=>e.result?.duration_ms),differ:i(e=>e.comparison?.changes.length),same:t.filter(e=>e.comparison?.same_files).length}}function HE(e,t,n,r){let i=(e,t)=>{let n=1;for(let r=1;r<=t;r+=1)n=n*(e-t+r)/r;return n},a=e+t,o=e+n,s=a+n+r,c=e=>i(o,e)*i(s-o,a-e)/i(s,a),l=c(e),u=0;for(let e=Math.max(0,a-(s-o));e<=Math.min(a,o);e+=1){let t=c(e);t<=l*(1+1e-7)&&(u+=t)}return Math.min(1,u)}function UE({change:e,base:t,onShow:n}){let r=VE(e),i=VE(t),a=e=>e.rate==null?`—`:`${e.passed}/${e.checked.length}`,o;if(r.rate==null||i.rate==null)o=e[0].check?`Waiting for both sides to be checked…`:`No check, so there is no pass rate to compare: only how the runs went.`;else{let e=HE(r.passed,r.checked.length-r.passed,i.passed,i.checked.length-i.passed),t=r.live||i.live?` so far`:``;o=r.rate===i.rate?`Both passed ${Math.round(r.rate*100)}% of the time${t}: no sign the change made a difference to the check.`:`Your change passed ${r.rate>i.rate?`more`:`less`} often${t}: ${a(r)} against ${a(i)} unchanged. `+(r.live||i.live?``:e<.05?`A gap this large is unlikely to be luck.`:`At this many runs that could still be luck; more runs would tell.`)}let s=(e,t)=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:e}),(0,K.jsx)(`td`,{children:t(i)}),(0,K.jsx)(`td`,{children:t(r)})]}),c=(e,t)=>e==null?`—`:t(e);return(0,K.jsxs)(`section`,{className:`pg-baseline`,children:[(0,K.jsx)(`h3`,{children:`Against the step run unchanged`}),(0,K.jsx)(`p`,{className:`pg-baseline-verdict${r.rate!=null&&i.rate!=null&&!r.live&&!i.live?r.rate>i.rate?` good`:r.rate<i.rate?` bad`:``:``}`,children:o}),(0,K.jsxs)(`table`,{children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{scope:`col`,children:`Runs`}),(0,K.jsx)(`th`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>n(t[0].id),children:[`Unchanged ×`,t.length]})}),(0,K.jsx)(`th`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>n(e[0].id),children:[`Your change ×`,e.length]})})]})}),(0,K.jsxs)(`tbody`,{children:[s(`Check passed`,a),s(`Tool calls`,e=>c(e.calls,e=>String(Math.round(e)))),s(`Time`,e=>c(e.time,FE)),s(`Cost`,e=>c(e.cost,e=>`$${e.toFixed(4)}`)),s(`Same files as original`,e=>e.finished.length?`${e.same}/${e.finished.length}`:`—`)]})]}),(0,K.jsxs)(`p`,{className:`pg-note`,children:[`Medians over finished runs. Both started from the same point with the same check`,e[0].model===t[0].model?``:`; unchanged uses the original model, ${t[0].model}`,`.`]})]})}function WE({runs:e,shown:t,onShow:n,onChanged:r}){let[i,a]=(0,_.useState)(!1),{finished:o,checked:s,passed:c,rate:l,cost:u,calls:d,time:f,differ:p,same:m,live:h}=VE(e);return(0,K.jsxs)(`section`,{className:`pg-batch`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsxs)(`div`,{className:`pg-batch-rate`,children:[l==null?(0,K.jsxs)(`strong`,{children:[o.length,`/`,e.length,` runs done`]}):(0,K.jsxs)(`strong`,{className:l===1?`good`:l===0?`bad`:`mixed`,children:[c,`/`,s.length,` passed`]}),(0,K.jsx)(`small`,{children:l==null?e[0].check?`waiting for the first check`:`no check set, so no pass rate`:`the check, over ${s.length} of ${e.length} runs`})]}),(0,K.jsxs)(`dl`,{children:[d!=null&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Tool calls`}),(0,K.jsx)(`dd`,{children:Math.round(d)})]}),f!=null&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Time`}),(0,K.jsx)(`dd`,{children:FE(f)})]}),u!=null&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Cost`}),(0,K.jsxs)(`dd`,{children:[`$`,u.toFixed(4)]})]}),p!=null&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Files differ`}),(0,K.jsx)(`dd`,{children:Math.round(p)})]}),o.length>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Same files`}),(0,K.jsxs)(`dd`,{children:[m,`/`,o.length]})]})]}),h&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,disabled:i,onClick:async()=>{a(!0);try{await x().fetch(`/raytace/forks/${e[0].id}/stop-all`,{method:`POST`,headers:wE})}finally{a(!1),r()}},children:[(0,K.jsx)(be,{size:13}),` Stop all runs`]})]}),o.length>1&&(0,K.jsxs)(`p`,{className:`pg-note`,children:[`Typical run (median)`,u==null?``:`; cost at API prices`,`.`,l!=null&&l>0&&l<1?` Passing some of the time means the outcome depends on luck, not just on what you changed.`:``]}),(0,K.jsxs)(`table`,{className:`pg-batch-runs`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`Run`}),(0,K.jsx)(`th`,{children:`Status`}),(0,K.jsx)(`th`,{children:`Check`}),(0,K.jsx)(`th`,{children:`Tool calls`}),(0,K.jsx)(`th`,{children:`Files differ`}),(0,K.jsx)(`th`,{children:`Time`}),(0,K.jsx)(`th`,{children:`Cost`})]})}),(0,K.jsx)(`tbody`,{children:e.map(e=>(0,K.jsxs)(`tr`,{className:e.id===t?`on`:``,onClick:()=>n(e.id),children:[(0,K.jsx)(`td`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),"aria-pressed":e.id===t,children:[`#`,e.attempt??1]})}),(0,K.jsx)(`td`,{children:(0,K.jsx)(`span`,{className:`pg-status s-${e.status}`,children:AE[e.status]})}),(0,K.jsx)(`td`,{className:e.check?`c-${e.check.status}`:``,children:e.check?e.check.status===`passed`?`✓ passed`:e.check.status===`failed`?`✗ exit ${e.check.exit_code}`:e.check.status===`timed_out`?`✗ timed out`:e.check.status===`error`?`could not run`:`—`:`—`}),(0,K.jsx)(`td`,{children:e.status===`queued`||e.status===`cancelled`?`—`:e.progress.tool_calls}),(0,K.jsx)(`td`,{children:e.comparison?e.comparison.changes.length:`—`}),(0,K.jsx)(`td`,{children:FE(e.result?.duration_ms??null)||`—`}),(0,K.jsx)(`td`,{children:e.result?.cost_usd==null?`—`:`$${e.result.cost_usd.toFixed(4)}`})]},e.id))})]})]})}function GE({trace:e,stepId:t,removeCall:n,forkTraces:r,onStep:i,onOpenTrace:a}){let o=(0,_.useMemo)(()=>e.requests??[],[e.requests]),s=(0,_.useMemo)(()=>e.callVerifications??[],[e.callVerifications]),c=(0,_.useMemo)(()=>new Set(o.map(e=>e.id)),[o]),l=new Map(s.map((e,t)=>[e.call_id,t+1])),{forks:u,refresh:d}=LE(c),f=Pe(e),p=f.forkable&&t&&c.has(t)?t:null,m=p?o.findIndex(e=>e.id===p):-1,h=RE(p),[g,v]=(0,_.useState)(()=>n?{[n]:{mode:`remove`,text:EE}}:{}),[y,b]=(0,_.useState)(``),[S,C]=(0,_.useState)([]),[w,T]=(0,_.useState)(``),[E,D]=(0,_.useState)(``),[O,k]=(0,_.useState)(10),[A,j]=(0,_.useState)(1),[M,N]=(0,_.useState)(!0),[P,F]=(0,_.useState)(null),[I,L]=(0,_.useState)([]),[R,z]=(0,_.useState)(!1),[ee,B]=(0,_.useState)(``),[V,H]=(0,_.useState)(null),te=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(!h?.forkable||!h.sandbox||!h.start_snapshot)return;let e=!1;return x().fetch(`/raytace/snapshots/${h.sandbox}/files?commit=${h.start_snapshot}`).then(async t=>{let n=await t.json();!e&&t.ok&&L(n.files??[])}).catch(()=>{}),()=>{e=!0}},[h]);let U=e=>(h?.results??[]).filter(t=>{let n=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|[\\s'"=:(])(/workspace/)?${n}($|[\\s'";|&)<>])`).test(t.detail)}),ne=new Map(S.flatMap(e=>U(e).map(t=>[t.call_id,e])));function re(){let e=w.trim().replace(/^\/workspace\//,``).replace(/^\.\//,``);e&&!S.includes(e)&&C(t=>[...t,e]),T(``)}async function ae(){if(p){z(!0),B(``);try{let e=Object.fromEntries(Object.entries(g).map(([e,t])=>[e,t.text])),t=Object.fromEntries([...ne.keys()].filter(t=>!(t in e)).map(e=>[e,EE])),n=await x().fetch(`/raytace/forks`,{method:`POST`,headers:wE,body:JSON.stringify({exchange_id:p,model:E||h?.model,minutes:O,message:y,check:se,repeat:A,baseline:M&&he.length>0,exclude:S,results:{...t,...e}})}),r=await n.json();if(!n.ok)throw Error(r.error??`The fork could not start.`);H(r.id),await d()}catch(e){B(e instanceof Error?e.message:`The fork could not start.`)}finally{z(!1)}}}let oe=u.some(kE),se=(P??u.find(e=>e.parent===h?.sandbox&&e.check)?.check?.command??``).trim(),ce=[...u.filter(e=>e.exchange_id===p).reduce((e,t)=>{let n=t.group??t.id;return e.set(n,[...e.get(n)??[],t].sort((e,t)=>(e.attempt??1)-(t.attempt??1))),e},new Map).values()],le=ce.find(e=>e.some(e=>e.id===V))??ce[0]??null,ue=ce.filter(e=>e[0].unchanged&&e[0].model===h?.model&&(e[0].check?.command??``)===se&&e.filter(e=>[`completed`,`failed`].includes(e.status)).length>=A).sort((e,t)=>t.length-e.length)[0]??null,de=e=>e?.[0].baseline?ce.find(t=>t[0].group===e[0].baseline)??null:null,pe=le?.find(e=>e.id===V)??le?.find(e=>kE(e)&&e.status!==`queued`)??le?.[0]??null,me=E||h?.model||``,he=[y.trim()&&`a message`,S.length&&`${S.length} file${S.length===1?``:`s`} excluded`,Object.keys(g).length&&`${Object.keys(g).length} tool result${Object.keys(g).length===1?``:`s`} edited`,me&&me!==h?.model&&me].filter(Boolean);return(0,K.jsxs)(`section`,{className:`rt-view`,children:[(0,K.jsx)(`header`,{className:`rt-view-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`PLAYGROUND`}),(0,K.jsx)(`h1`,{children:`Rerun it from any step`}),(0,K.jsxs)(`p`,{className:`rt-muted rt-sub`,children:[DE(e.title,120),` · `,OE(e.startedAt)]})]})}),(0,K.jsxs)(`div`,{className:`pg-layout`,ref:te,children:[(0,K.jsxs)(`nav`,{className:`pg-rounds`,"aria-label":`Steps`,children:[(0,K.jsx)(`h2`,{children:`1 · Pick a step`}),(0,K.jsx)(`ol`,{children:o.map((e,t)=>{let n=s.filter(t=>t.exchange_id===e.id),r=u.filter(t=>t.exchange_id===e.id).length;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,className:e.id===p?`on`:``,onClick:()=>i(e.id),disabled:!f.forkable,children:[(0,K.jsxs)(`span`,{children:[`Round trip `,t+1,r?(0,K.jsxs)(`em`,{children:[r,` fork`,r===1?``:`s`]}):null]}),n.length?n.map(e=>(0,K.jsxs)(`code`,{children:[`#`,l.get(e.call_id),` `,e.name,` `,DE(e.proposed??``,60)]},e.call_id)):(0,K.jsx)(`small`,{children:`answered`})]})},e.id)})}),(0,K.jsx)(CE,{target:te,variable:`--pg-steps`,storageKey:`raytace.playground-steps-width`,min:220,max:760,label:`Steps width`})]}),(0,K.jsxs)(`div`,{className:`pg-main`,children:[!f.forkable&&(0,K.jsxs)(`div`,{className:`pg-unforkable`,role:`note`,children:[(0,K.jsx)(`strong`,{children:f.where===`mac`?`This run can’t be forked`:f.where===`fork`?`This is a fork`:`Not forkable yet`}),(0,K.jsx)(`p`,{children:f.reason})]}),f.forkable&&!p&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`Pick the step to rerun from. Everything before it stays as it was; from it on, the model decides again.`}),p&&!h&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`Checking whether this step can be forked…`}),p&&h&&!h.forkable&&(0,K.jsx)(`p`,{className:`pg-error`,children:h.reason}),p&&h?.forkable&&(0,K.jsxs)(`section`,{className:`pg-change`,children:[(0,K.jsxs)(`h2`,{children:[`2 · Change what it had `,(0,K.jsxs)(`small`,{children:[`then round trip `,m+1,` onward runs again, in its own sandbox`]})]}),(0,K.jsx)(`h3`,{children:`Message at this step`}),(0,K.jsx)(`textarea`,{className:`pg-message`,rows:3,value:y,maxLength:4e3,"aria-label":`Message the model gets at this step`,placeholder:`Optional. e.g. Don't use demo/package.json, read demo2/package.json instead.`,onChange:e=>b(e.target.value)}),(0,K.jsx)(`p`,{className:`pg-note`,children:y.trim()?`The fork resumes with this as your next message.`:`Empty: it resumes with only “${h.resume_prompt}”`}),(0,K.jsx)(`h3`,{children:`Exclude files`}),(0,K.jsxs)(`form`,{className:`pg-file-pick`,onSubmit:e=>{e.preventDefault(),re()},children:[(0,K.jsx)(`input`,{list:`pg-project-files`,value:w,placeholder:`path/to/file, as in the project`,"aria-label":`File to exclude`,onChange:e=>T(e.target.value)}),(0,K.jsx)(`datalist`,{id:`pg-project-files`,children:I.slice(0,2e3).map(e=>(0,K.jsx)(`option`,{value:e,children:e},e))}),(0,K.jsx)(`button`,{type:`submit`,className:`rt-button`,disabled:!w.trim(),children:`Exclude`})]}),S.length>0&&(0,K.jsx)(`ul`,{className:`pg-excluded`,children:S.map(e=>{let t=U(e),n=!I.length||I.includes(e);return(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`code`,{children:e}),(0,K.jsxs)(`span`,{children:[t.length?`output of ${t.map(e=>`#${l.get(e.call_id)??`?`}`).join(`, `)} removed · `:``,n?`not in the fork’s project`:`not in the project at this step`]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Stop excluding ${e}`,onClick:()=>C(t=>t.filter(t=>t!==e)),children:(0,K.jsx)(Te,{size:12})})]},e)})}),(0,K.jsx)(`p`,{className:`pg-note`,children:`An excluded file is taken out of the fork’s copy of the project, and anything it had already read of it is removed from what it remembers, so it can’t just read it again.`}),(0,K.jsxs)(`h3`,{children:[`Check `,(0,K.jsx)(`small`,{children:`how to tell whether it worked`})]}),(0,K.jsx)(`input`,{className:`pg-check-input`,value:P??se,maxLength:2e3,spellCheck:!1,"aria-label":`Check command`,placeholder:`Optional. e.g. npm test, or: grep -q fetchUser src/api.ts`,onChange:e=>F(e.target.value)}),(0,K.jsx)(`p`,{className:`pg-note`,children:se?`Runs in the fork’s project folder once Claude Code finishes. Exit code 0 passes; anything else fails.`:`Empty: the fork is only compared file by file with the original.`}),(0,K.jsxs)(`div`,{className:`pg-run-bar`,children:[(0,K.jsxs)(`label`,{children:[`Model `,(0,K.jsx)(`select`,{value:me,onChange:e=>D(e.target.value),children:[...new Set([h.model,...TE].filter(Boolean))].map(e=>(0,K.jsxs)(`option`,{value:e,children:[e,e===h.model?` (original)`:``]},e))})]}),(0,K.jsxs)(`label`,{children:[`Runs `,(0,K.jsx)(`select`,{value:A,onChange:e=>j(Number(e.target.value)),children:jE.filter(e=>e<=(h.limits?.max_repeat??1/0)).map(e=>(0,K.jsx)(`option`,{value:e,children:e===1?`once`:`${e} times`},e))})]}),(0,K.jsxs)(`button`,{type:`button`,className:`pg-run-button`,onClick:ae,disabled:R||oe,children:[(0,K.jsx)(fe,{size:14}),` `,oe?`A fork is running`:R?`Starting…`:`${he.length?`Run fork · ${he.join(`, `)}`:`Run fork unchanged`}${A>1?` · ×${A}`:``}${M&&he.length&&!ue?` + unchanged ×${A}`:``}`]})]}),he.length>0&&(0,K.jsxs)(`label`,{className:`pg-baseline-pick`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>N(e.target.checked)}),ue?(()=>{let e=VE(ue);return`Compare with the unchanged runs already done (×${ue.length}${e.rate==null?``:`, ${e.passed}/${e.checked.length} passed`})`})():`Also run it unchanged ×${A} to compare with, taking turns with your change`]}),A>1&&(0,K.jsxs)(`p`,{className:`pg-note`,children:[`Runs one after another, each from the same point`,se?`, each graded by the check`:``,`. `,se?``:`Without a check there is no pass rate, only how the runs compare. `,he.length&&M?``:`Tip: running it unchanged the same number of times shows how much it varies on its own.`]}),y.trim()&&S.length>0&&(0,K.jsx)(`p`,{className:`pg-note`,children:`This run both steers it and removes files: if it ends differently, you won’t know which of the two did it.`}),ee&&(0,K.jsx)(`p`,{role:`alert`,className:`pg-error`,children:ee}),(0,K.jsxs)(`details`,{className:`pg-advanced`,open:!!n||void 0,children:[(0,K.jsx)(`summary`,{children:`Advanced`}),(0,K.jsx)(`h3`,{children:`Tool results it had seen`}),h.results?.length?(0,K.jsx)(`ul`,{className:`pg-results`,children:h.results.map(e=>{let t=g[e.call_id],n=!t&&ne.has(e.call_id);return(0,K.jsxs)(`li`,{className:t?`edited ${t.mode}`:n?`edited remove`:``,children:[(0,K.jsxs)(`div`,{className:`pg-result-row`,children:[(0,K.jsxs)(`b`,{children:[`#`,l.get(e.call_id)??`?`,` `,e.name]}),(0,K.jsx)(`code`,{title:e.detail,children:DE(e.detail,90)}),(0,K.jsx)(`small`,{children:n?`removed with ${ne.get(e.call_id)}`:`~${Math.round(e.chars/4).toLocaleString()} tokens`}),(0,K.jsx)(`span`,{className:`rt-actions`,children:t?(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>v(({[e.call_id]:t,...n})=>n),children:[(0,K.jsx)(Te,{size:12}),` Undo`]}):(0,K.jsxs)(K.Fragment,{children:[!n&&(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>v(t=>({...t,[e.call_id]:{mode:`remove`,text:EE}})),children:`Remove`}),!e.truncated&&(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>v(t=>({...t,[e.call_id]:{mode:`edit`,text:e.output}})),children:`Edit`})]})})]}),t&&(0,K.jsx)(`textarea`,{"aria-label":`What ${e.name} returns in the fork`,value:t.text,rows:t.mode===`remove`?1:8,onChange:t=>{let n=t.target.value;v(t=>({...t,[e.call_id]:{...t[e.call_id],text:n}}))}})]},e.call_id)})}):(0,K.jsx)(`p`,{className:`pg-note`,children:`No tool results before this step: it comes straight after the prompt.`}),(0,K.jsxs)(`label`,{className:`pg-limit`,children:[`Safety limit `,(0,K.jsx)(`select`,{value:O,onChange:e=>k(Number(e.target.value)),children:[5,10,20,30].filter(e=>e<=(h.limits?.max_minutes??1/0)).map(e=>(0,K.jsxs)(`option`,{value:e,children:[e,` min`]},e))}),(0,K.jsx)(`span`,{className:`pg-note`,children:`The fork ends when Claude Code finishes; this only stops one that runs away.`})]})]})]}),p&&(0,K.jsxs)(`section`,{className:`pg-runs`,children:[(0,K.jsxs)(`h2`,{children:[`3 · Runs `,ce.length>1&&(0,K.jsxs)(`small`,{children:[ce.length,` from this step`]})]}),ce.length>1&&(0,K.jsx)(`div`,{className:`pg-run-tabs`,children:ce.map((e,t)=>{let n=e.filter(ME),r=e.length>1?n.length?` · ${n.filter(e=>e.check?.status===`passed`).length}/${n.length} ✓`:``:ME(e[0])?` · ${e[0].check?.status===`passed`?`✓`:`✗`}`:``;return(0,K.jsxs)(`button`,{type:`button`,className:e===le?`on`:``,onClick:()=>H(e[0].id),children:[(0,K.jsx)(ie,{size:12}),` `,ce.length-t,e[0].unchanged?` · unchanged`:``,e.length>1?` · ×${e.length}`:``,` · `,e.some(kE)?`Running`:AE[e[0].status],r,e.some(e=>e.keep)?` · kept`:``]},e[0].id)})}),le&&de(le)&&(0,K.jsx)(UE,{change:le,base:de(le),onShow:H}),le&&le.length>1&&(0,K.jsx)(WE,{runs:le,shown:pe?.id??null,onShow:H,onChanged:d}),pe?(0,K.jsx)(BE,{fork:pe,trace:e,fromIndex:m,onChanged:d,onOpenTrace:a,forkTrace:r.filter(e=>e.forkId===pe.id).at(0)??null},pe.id):(0,K.jsx)(`p`,{className:`pg-note`,children:`No forks from this step yet.`})]})]})]})]})}var KE=53,qE=[``,`Mon`,``,`Wed`,``,`Fri`,``];function JE(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}var YE=()=>()=>{},XE=()=>JE(Date.now()),ZE=e=>e===0?0:e===1?1:e<=3?2:e<=6?3:4;function QE({dates:e,selected:t,onSelect:n}){let r=(0,_.useSyncExternalStore)(YE,XE,()=>null),i=new Map;for(let t of e)i.set(JE(t),(i.get(JE(t))??0)+1);let a=new Date(`${r??`1970-01-01`}T00:00`),o=new Date(a);o.setDate(a.getDate()-a.getDay()-364);let s=[];for(let e=0;e<KE;e+=1){let t=[];for(let n=0;n<7;n+=1){let r=new Date(o);r.setDate(o.getDate()+e*7+n),t.push(r)}s.push(t)}let c=s.map((e,t)=>{let n=e.find(e=>e.getDate()===1);return n||t===0?(n??e[0]).toLocaleString(void 0,{month:`short`}):``}),l=e.length,u=[...i.keys()].length;return(0,K.jsxs)(`section`,{className:`rt-activity`,"aria-label":`Prompts per day`,children:[(0,K.jsxs)(`div`,{className:`rt-activity-head`,children:[(0,K.jsxs)(`strong`,{children:[l,` prompt`,l===1?``:`s`]}),(0,K.jsxs)(`span`,{children:[`on `,u,` day`,u===1?``:`s`,` in the last year`]})]}),r&&(0,K.jsx)(`div`,{className:`rt-activity-scroll`,children:(0,K.jsxs)(`div`,{className:`rt-activity-grid`,style:{gridTemplateColumns:`28px repeat(${KE}, 12px)`},children:[(0,K.jsx)(`span`,{}),c.map((e,t)=>(0,K.jsx)(`span`,{className:`rt-activity-month`,children:e},t)),qE.map((e,r)=>[(0,K.jsx)(`span`,{className:`rt-activity-day`,children:e},`label-${r}`),...s.map(e=>{let o=e[r];if(o>a)return(0,K.jsx)(`span`,{},JE(o));let s=JE(o),c=i.get(s)??0,l=`${c} prompt${c===1?``:`s`} · ${o.toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`})}`;return(0,K.jsx)(`button`,{type:`button`,title:l,"aria-label":l,"aria-pressed":t===s,disabled:!c,className:`rt-cell rt-cell-${ZE(c)}${t===s?` rt-cell-on`:``}`,onClick:()=>n(t===s?null:s)},s)})])]})}),(0,K.jsxs)(`div`,{className:`rt-activity-legend`,children:[`Less `,[0,1,2,3,4].map(e=>(0,K.jsx)(`i`,{className:`rt-cell rt-cell-${e}`},e)),` More`]})]})}var $E=e=>e.split(`
|
|
31
|
+
`).find(e=>e.trim())?.trim()??`(empty prompt)`;function eD({traces:e,loaded:t=!0,selectedId:n,onSelect:r,onOpen:i,onOpenStep:a,canOpen:o=()=>!0}){let[s,c]=(0,_.useState)(null),l=e.filter(e=>!s||JE(e.startedAt)===s).sort((e,t)=>t.startedAt.localeCompare(e.startedAt));return(0,K.jsxs)(`section`,{className:`rt-view`,children:[(0,K.jsx)(`header`,{className:`rt-view-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`PROMPTS`}),(0,K.jsx)(`h1`,{children:`What you asked`})]})}),(0,K.jsx)(QE,{dates:e.map(e=>e.startedAt),selected:s,onSelect:c}),(0,K.jsxs)(`div`,{className:`rt-list-head`,children:[s?(0,K.jsxs)(`button`,{type:`button`,className:`rt-chip`,onClick:()=>c(null),children:[new Date(`${s}T00:00`).toLocaleDateString(void 0,{weekday:`short`,day:`numeric`,month:`short`}),` `,(0,K.jsx)(Te,{size:12})]}):(0,K.jsx)(`span`,{children:`Recent`}),(0,K.jsxs)(`small`,{children:[l.length,` prompt`,l.length===1?``:`s`]})]}),!l.length&&(0,K.jsx)(`p`,{className:`rt-empty`,children:t?`No prompts captured yet. Send a request through the proxy and it will appear here.`:`Loading…`}),(0,K.jsx)(`ol`,{className:`rt-prompts`,children:l.map(e=>{let t=e.id===n,s=Ae(e.requests,`cost`),c=e.callVerifications?.length??0,l=Pe(e);return(0,K.jsxs)(`li`,{className:t?`rt-prompt open`:`rt-prompt`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-prompt-row`,"aria-expanded":t,onClick:()=>r(t?``:e.id),children:[(0,K.jsx)(`time`,{dateTime:e.startedAt,children:new Date(e.startedAt).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`})}),(0,K.jsxs)(`strong`,{children:[(0,K.jsx)(`span`,{className:`rt-where w-${l.where}`,title:l.forkable?`Ran in the sandbox: can be forked in the Playground`:l.reason??void 0,children:l.label}),$E(e.title)]}),(0,K.jsxs)(`small`,{children:[e.model,` · `,c,` tool call`,c===1?``:`s`,` · `,id(s,e.requests?.some(e=>e.costEstimated))]})]}),t&&(0,K.jsxs)(`div`,{className:`rt-prompt-detail`,children:[(0,K.jsx)(`h3`,{children:`Prompt`}),(0,K.jsx)(`p`,{className:`rt-text`,children:e.title}),(0,K.jsx)(`h3`,{children:`Answer`}),e.answer?(0,K.jsx)(`p`,{className:`rt-text`,children:e.answer}):(0,K.jsx)(`p`,{className:`rt-muted`,children:`No final answer was captured for this prompt.`}),(0,K.jsx)(YT,{trace:e,onStep:a&&(t=>a(e.id,t))}),(0,K.jsxs)(`div`,{className:`rt-actions`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>i(`calls`,e.id),children:[`Tool calls `,(0,K.jsx)(P,{size:14})]}),e.sandboxId&&o(`sandbox`)&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>i(`sandbox`,e.id),children:[`Sandbox evidence `,(0,K.jsx)(P,{size:14})]}),o(`context`)&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>i(`context`,e.id),children:[`Context `,(0,K.jsx)(P,{size:14})]})]})]})]},e.id)})})]})}var tD=[{id:`24h`,label:`Last 24h`,ms:864e5},{id:`7d`,label:`Last 7d`,ms:6048e5},{id:`30d`,label:`Last 30d`,ms:2592e6},{id:`all`,label:`All time`,ms:null}],nD=[`outcome:failed`,`reported:ok observed:failed`,`exit:127`,`http:>=400`,`failed | stats count by tool`,`failed | timechart count by model span=1d`],rD=[`#8a8f98`,`#b03a48`,`#13549b`,`#9e6514`,`#29996b`,`#5b4bc4`,`#33373d`,`#c06a2b`,`#777d87`];function iD(e){return e.split(/(\[[^\]]*\])/g).map((e,t)=>e.startsWith(`[`)&&e.endsWith(`]`)?(0,K.jsx)(`mark`,{children:e.slice(1,-1)},t):(0,K.jsx)(`span`,{children:e},t))}function aD(e,t,n){let r=RegExp(`(^|\\s)-?${t}:(\\S+)`,`g`);return`${e.replace(r,` `).replace(/\s+/g,` `).trim()} ${t}:${n}`.trim()}var oD=e=>new Date(e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),sD=e=>new Date(e).toLocaleDateString(void 0,{day:`numeric`,month:`short`});function cD({rows:e,series:t,height:n=110,onBucket:r}){let i=Math.max(...e.map(e=>t.reduce((t,n)=>t+(e[n.key]??0),0)),1),a=702/Math.max(e.length,1),o=Math.max(Math.min(a-2,42),1),s=n-22;return(0,K.jsxs)(`svg`,{viewBox:`0 0 720 ${n}`,width:`100%`,height:n,"aria-label":`Events over time`,children:[(0,K.jsx)(`title`,{children:`Events over time`}),e.map((c,l)=>{let u=s,d=t.reduce((e,t)=>e+(c[t.key]??0),0);return(0,K.jsxs)(`g`,{onClick:r?()=>r(c.t):void 0,style:r?{cursor:`pointer`}:void 0,children:[(0,K.jsx)(`title`,{children:`${sD(c.t)} — ${d} events`}),t.map(e=>{let t=(c[e.key]??0)/i*s;return u-=t,t>0?(0,K.jsx)(`rect`,{x:18+l*a+(a-o)/2,y:u,width:o,height:t,fill:e.color},e.key):null}),(l===0||l===e.length-1||l===Math.floor(e.length/2))&&(0,K.jsx)(`text`,{x:18+l*a+a/2,y:n-4,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,opacity:`0.55`,children:sD(c.t)})]},l)})]})}function lD({initialQuery:e=``,onQuery:t,onOpenCall:n,onOpenTrace:r,onOpenSandbox:i}){let[a,o]=(0,_.useState)(e),[s,c]=(0,_.useState)(e),[l,u]=(0,_.useState)(`7d`),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(0),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)([]),[b,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(!0),T=(0,_.useRef)(0),E=(0,_.useCallback)(()=>{if(l===`custom`&&d)return d;let e=tD.find(e=>e.id===l);return e?.ms?{from:Date.now()-e.ms,to:Date.now()}:{from:null,to:null}},[l,d]),D=(0,_.useCallback)(async(e=!1)=>{let t=++T.current;e||w(!0);let{from:n,to:r}=E(),i=new URLSearchParams({q:s,limit:`50`,offset:String(p)});n&&i.set(`from`,String(n)),r&&i.set(`to`,String(r));let a=new URLSearchParams({limit:`12`});n&&a.set(`from`,String(n)),r&&a.set(`to`,String(r));try{let[e,n]=await Promise.all([x().fetch(`/raytace/search?${i}`,{cache:`no-store`}),x().fetch(`/raytace/search/signatures?${a}`,{cache:`no-store`})]);if(t!==T.current)return;if(!e.ok)throw Error((await e.json().catch(()=>({}))).error??`Search returned ${e.status}`);g(await e.json()),n.ok&&y((await n.json()).signatures??[]),S(null)}catch(e){t===T.current&&S(e instanceof Error?e.message:`Search unavailable. Is the proxy running?`)}finally{t===T.current&&w(!1)}},[s,p,E]);(0,_.useEffect)(()=>{D()},[D]),(0,_.useEffect)(()=>{let e=setInterval(()=>void D(!0),15e3);return()=>clearInterval(e)},[D]);function O(e){o(e),c(e),m(0),t(e)}let k=h?.summary,A=(h?.histogram??[]).map(e=>({...e,other:Math.max(e.total-e.failed,0)})),j=A.length>1?A[1].t-A[0].t:864e5;return(0,K.jsxs)(`section`,{className:`rt-view rt-search-view`,children:[(0,K.jsx)(`header`,{className:`rt-view-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`SEARCH`}),(0,K.jsx)(`h1`,{children:`What the agents did`})]})}),(0,K.jsxs)(`form`,{className:`rt-search-bar`,onSubmit:e=>{e.preventDefault(),O(a)},children:[(0,K.jsx)(ge,{size:16}),(0,K.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:`outcome:failed tool:Bash "permission denied" · try failed | stats count by tool`,"aria-label":`Search agent activity`,spellCheck:!1}),a&&(0,K.jsx)(`button`,{type:`button`,className:`rt-search-clear`,onClick:()=>O(``),"aria-label":`Clear search`,children:(0,K.jsx)(Te,{size:14})}),(0,K.jsxs)(`select`,{value:l,onChange:e=>{u(e.target.value),f(null),m(0)},"aria-label":`Time range`,children:[l===`custom`&&(0,K.jsx)(`option`,{value:`custom`,children:`Selected window`}),tD.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,K.jsx)(`button`,{type:`submit`,className:`rt-button primary`,children:`Search`})]}),(0,K.jsxs)(`div`,{className:`rt-search-quick`,children:[nD.map(e=>(0,K.jsx)(`button`,{type:`button`,className:`rt-chip`,onClick:()=>O(e),children:(0,K.jsx)(`code`,{children:e})},e)),l===`custom`&&d&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-chip`,onClick:()=>{u(`7d`),f(null)},children:[oD(new Date(d.from).toISOString()),` – `,oD(new Date(d.to).toISOString()),` `,(0,K.jsx)(Te,{size:12})]})]}),b&&(0,K.jsx)(`p`,{className:`rt-search-error`,children:b}),(h?.errors??[]).map(e=>(0,K.jsx)(`p`,{className:`rt-search-error`,children:e},e)),h?.error&&(0,K.jsx)(`p`,{className:`rt-search-error`,children:h.error}),h?.mode===`events`&&k&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`rt-search-summary`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:k.total}),(0,K.jsx)(`span`,{children:`events`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{className:`rt-failed-text`,children:k.failed}),(0,K.jsx)(`span`,{children:`failed`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:k.mismatched}),(0,K.jsx)(`span`,{children:`reported ≠ observed`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:k.http_errors}),(0,K.jsx)(`span`,{children:`HTTP errors`})]}),(0,K.jsxs)(`small`,{children:[h.total,` match`,h.total===1?``:`es`,` the full query`]})]}),A.length>0&&(0,K.jsxs)(`div`,{className:`rt-search-chart`,children:[(0,K.jsx)(cD,{rows:A,height:110,series:[{key:`other`,color:`#c3c7cd`,label:`ok / unknown`},{key:`failed`,color:`#b03a48`,label:`failed`}],onBucket:e=>{f({from:e,to:e+j-1}),u(`custom`),m(0)}}),(0,K.jsx)(`small`,{children:`Grey ok/unknown, red failed. Click a bar to zoom to that window.`})]}),!s&&v.length>0&&(0,K.jsxs)(`div`,{className:`rt-search-clusters`,children:[(0,K.jsxs)(`div`,{className:`rt-list-head`,children:[(0,K.jsx)(`span`,{children:`TOP FAILURE CLUSTERS`}),(0,K.jsx)(`small`,{children:`repeat failures, grouped by signature`})]}),(0,K.jsx)(`ol`,{children:v.map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>O(`signature:${e.signature}`),children:[(0,K.jsxs)(`strong`,{children:[`×`,e.count]}),(0,K.jsx)(`span`,{className:`rt-cluster-label`,children:e.label??e.signature}),(0,K.jsxs)(`small`,{children:[e.tools.join(`, `),e.exit_codes.length?` · exit ${e.exit_codes.join(`/`)}`:``,` · last `,oD(e.last)]})]}),e.sample_turn&&(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>e.sample_call?n(e.sample_turn,e.sample_call):r(e.sample_turn),children:[`latest example `,(0,K.jsx)(P,{size:11})]})]},e.signature))})]}),(0,K.jsxs)(`div`,{className:`rt-search-body`,children:[(0,K.jsx)(`aside`,{className:`rt-search-facets`,children:Object.entries(h.facets??{}).map(([e,t])=>t.length>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{children:e.replace(`_`,` `)}),t.map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>O(aD(s,e===`tool`?`tool`:e,t.value)),children:[(0,K.jsx)(`span`,{children:t.value}),(0,K.jsx)(`small`,{children:t.count})]},t.value))]},e))}),(0,K.jsxs)(`div`,{className:`rt-search-results`,children:[(0,K.jsxs)(`div`,{className:`rt-list-head`,children:[(0,K.jsx)(`span`,{children:`EVENTS`}),(0,K.jsx)(`small`,{children:C?`Searching…`:`${h.hits?.length??0} shown`})]}),!C&&!(h.hits??[]).length&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`Nothing matches. Missing evidence reads as unknown, never as success — try widening the time range.`}),(0,K.jsx)(`ol`,{children:(h.hits??[]).map(e=>(0,K.jsxs)(`li`,{className:`rt-hit outcome-${e.outcome}`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-hit-main`,disabled:!e.turn_id,onClick:()=>{e.turn_id&&e.external_call_id?n(e.turn_id,e.external_call_id):e.turn_id&&r(e.turn_id)},children:[(0,K.jsx)(`time`,{dateTime:e.ts,children:oD(e.ts)}),(0,K.jsx)(`span`,{className:`rt-outcome outcome-${e.outcome}`,children:e.outcome}),(0,K.jsx)(`strong`,{children:e.kind===`turn`?`prompt`:e.kind===`proxy_error`?`proxy error`:`${e.tool_name??`tool`}${e.category?` · ${e.category}`:``}`}),(0,K.jsx)(`span`,{className:`rt-hit-text`,children:e.snippet?iD(e.snippet):e.command_text??e.prompt_excerpt??e.error_excerpt??``}),(0,K.jsxs)(`small`,{children:[e.model??``,e.exit_code==null?``:` · exit ${e.exit_code}`,e.http_status?` · HTTP ${e.http_status}`:``,e.kind===`call`?` · reported ${e.outcome_reported} · observed ${e.outcome_observed}`:``,e.reported_check&&e.reported_check!==`agrees`?` · ${e.reported_check.replaceAll(`_`,` `)}`:``,e.duration_ms==null?``:` · ${(e.duration_ms/1e3).toFixed(1)}s`]}),e.error_excerpt&&e.outcome===`failed`&&(0,K.jsx)(`span`,{className:`rt-hit-error`,children:e.signature_label??e.error_excerpt.split(`
|
|
32
|
+
`)[0]})]}),i&&e.kind===`call`&&e.turn_id&&e.external_call_id&&(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>i(e.turn_id,e.external_call_id),children:`sandbox evidence`})]},e.id))}),(0,K.jsxs)(`div`,{className:`rt-search-pages`,children:[(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:p===0,onClick:()=>m(Math.max(p-50,0)),children:`Newer`}),(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:p+50>=(h.total??0),onClick:()=>m(p+50),children:`Older`})]})]})]})]}),h?.mode===`stats`&&(0,K.jsxs)(`div`,{className:`rt-search-stats`,children:[(0,K.jsx)(`div`,{className:`rt-list-head`,children:(0,K.jsxs)(`span`,{children:[h.agg===`avg_duration`?`AVG DURATION (MS)`:`COUNT`,h.by?` BY ${h.by.toUpperCase()}`:``]})}),(0,K.jsx)(`table`,{children:(0,K.jsx)(`tbody`,{children:(h.rows??[]).map((e,t)=>(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`td`,{children:String(e.key??`(none)`)}),(0,K.jsx)(`td`,{className:`rt-stat-bar`,"aria-label":String(e.value??e.count??``),children:(0,K.jsx)(`span`,{style:{width:`${Math.max(2,100*Number(e.value??e.count??0)/Math.max(...(h.rows??[]).map(e=>Number(e.value??e.count??0)),1))}%`}})}),(0,K.jsx)(`td`,{children:String(e.value??e.count??``)})]},t))})}),!(h.rows??[]).length&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`No events match.`})]}),h?.mode===`timechart`&&(0,K.jsxs)(`div`,{className:`rt-search-chart`,children:[(0,K.jsx)(cD,{rows:h.rows??[],height:240,series:(h.series??[]).map((e,t)=>({key:e,label:e,color:rD[t%rD.length]}))}),(0,K.jsx)(`small`,{children:(h.series??[]).map((e,t)=>(0,K.jsxs)(`span`,{className:`rt-legend-item`,children:[(0,K.jsx)(`i`,{style:{background:rD[t%rD.length]}}),e,` `]},e))}),!(h.rows??[]).length&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`No events match.`})]}),(0,K.jsxs)(`p`,{className:`rt-search-help`,children:[`Fields: `,(0,K.jsx)(`code`,{children:`outcome reported observed tool model category kind exit http file signature session after before`}),`. Pipes: `,(0,K.jsx)(`code`,{children:`| stats count by tool`}),`, `,(0,K.jsx)(`code`,{children:`| stats avg(duration) by model`}),`, `,(0,K.jsx)(`code`,{children:`| timechart count by outcome span=1d`}),`. Prefix `,(0,K.jsx)(`code`,{children:`-`}),` negates; trailing `,(0,K.jsx)(`code`,{children:`*`}),` is a prefix match.`]})]})}var uD={read:`Read`,search:`Search`,write:`Write`,edit:`Edit`,delete:`Delete / move`,run:`Run`,test:`Test`,build:`Build / install`,git:`Git`,web:`Web`,plan:`Plan`,delegate:`Delegate`,unsure:`Not sure`};function dD(e,t){let n=e.find(e=>{if(!e.title.startsWith(`Tool result:`))return!1;try{return JSON.parse(e.raw).call_id===t}catch{return!1}});if(!n)return{state:`none`,code:null,output:``};let r=``,i=!1,a=null;try{let e=JSON.parse(n.raw),t=e.output??e.content;r=typeof t==`string`?t:JSON.stringify(t??``),i=e.is_error===!0||e.status===`failed`;let o=typeof e.exit_code==`number`?e.exit_code:t&&typeof t==`object`&&typeof t.exit_code==`number`?t.exit_code:null;typeof o==`number`&&(a=o)}catch{}if(i)return{state:`failed`,code:a,output:r};if(a!==null)return{state:a===0?`ok`:`failed`,code:a,output:r};if(/Rejected\(/.test(r))return{state:`rejected`,code:null,output:r};let o=Number(r.match(/Process exited with code (\d+)/)?.[1]??NaN);return Number.isFinite(o)?{state:o===0?`ok`:`failed`,code:o,output:r}:{state:/failed/i.test(r.slice(0,80))?`failed`:`ok`,code:null,output:r}}var fD=(e,t)=>{let n=String(e??``).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n},pD=e=>e.split(`/`).filter(Boolean).at(-1)??e,mD={delete:45,git:40,write:35,edit:35,build:30,test:28,run:22,delegate:20,web:10,plan:8,read:5,search:5,unsure:8},hD=[[/\brm\s+-[a-z]*[rf]/,`Deletes files (rm -r/-f)`],[/\bsudo\b/,`Runs with elevated privileges (sudo)`],[/\b(curl|wget)\b[^|]*\|\s*(ba|z)?sh\b/,`Pipes a download straight into a shell`],[/\bgit\s+(push|reset\s+--hard|clean\s+-[a-z]*f|checkout\s+--\s)/,`Hard-to-undo git operation`],[/\b(drop\s+(table|database)|truncate\s+table|delete\s+from)\b/i,`Deletes stored data`],[/\bkill\s+-9\b|\bmkfs\b|\bdd\s+.*of=\/dev\//,`Can destroy processes or disks`],[/\b(npm|pnpm|yarn|pip|pip3|brew|apt(-get)?)\s+(install|add|i)\b/,`Installs or changes dependencies`],[/\bchmod\s+(-R\s+)?[0-7]{3,4}\b|\bchown\s+-R\b/,`Changes file permissions or ownership`]];function gD(e){return e.snapshot?.changed?(e.snapshot.changes??[]).map(e=>e.path):[]}function _D(e,t,n){let r=gD(t[n]).map(pD).filter(e=>e.length>=3);return r.length?t.slice(n+1).filter(e=>{let t=`${e.proposed??``} ${gD(e).join(` `)}`;return r.some(e=>t.includes(e))}).length:0}function vD(e,t,n,r=e.callVerifications??[]){let i=[],a=mD[t.category??`unsure`]??8;t.category&&i.push(`${uD[t.category]} step`);let o=t.proposed??``;for(let[e,t]of hD)e.test(o)&&(a+=30,i.push(t));let s=gD(t);s.length&&(a+=Math.min(30,s.length*10),i.push(`Changed ${s.length} file${s.length===1?``:`s`}: ${s.slice(0,3).map(pD).join(`, `)}${s.length>3?`, …`:``}`));let c=dD(e.events,t.call_id);c.state===`failed`&&(a+=25,i.push(`Failed as reported to the agent${c.code==null?``:` (exit ${c.code})`}`)),c.state===`rejected`&&(a+=25,i.push(`Refused by the sandbox policy`)),t.exit_code!=null&&t.exit_code!==0&&(a+=20,i.push(`Sandbox saw exit ${t.exit_code}`)),t.reported_check&&t.reported_check!==`agrees`&&(a+=25,i.push(`What the agent was told differs from what the sandbox saw`));let l=t.descendant_count??t.descendants?.length??0;l>1&&(a+=Math.min(15,l),i.push(`Ran ${l} processes underneath it`)),(c.state===`failed`||c.state===`rejected`)&&n+1<r.length&&(a+=12,i.push(`The run changed course after this step`));let u=_D(e,r,n);return u&&(a+=Math.min(18,u*6),i.push(`${u} later step${u===1?``:`s`} built on what it produced`)),n===r.length-1&&r.length>1&&(a+=5,i.push(`Last step before the final answer`)),{score:a,reasons:i}}var yD=e=>fD((e.proposed??e.name).split(`
|
|
33
|
+
`).find(e=>e.trim())?.trim()??e.name,90);function bD(e){let t=e.callVerifications??[],n=t.map((n,r)=>({call:n,step:r+1,...vD(e,n,r,t),label:yD(n)}));if(!n.length)return[];let r=n.filter(e=>e.score>=28);return r.length>8&&(r=[...r].sort((e,t)=>t.score-e.score).slice(0,8)),r.length<3&&(r=[...n].sort((e,t)=>t.score-e.score).slice(0,Math.min(5,n.length))),r.sort((e,t)=>e.step-t.step)}function xD(e){let t=e.callVerifications??[];return t.length?t.map((n,r)=>({call:n,step:r+1,...vD(e,n,r,t),label:yD(n)})).sort((e,t)=>t.score-e.score||e.step-t.step)[0]:null}function SD(e,t){let n=e.callVerifications??[],r=n.findIndex(e=>e.call_id===t.call_id),i=r+1,a=[],o=e.events.filter(e=>e.title===`Model answer`&&e.exchange_id===t.exchange_id&&e.detail?.trim()).map(e=>e.detail).join(` `);o&&a.push({kind:`agent`,text:fD(o,300)});let s=r>0?n[r-1]:null,c=s?dD(e.events,s.call_id):null;s&&c&&(c.state!==`ok`||c.output.trim())&&a.push({kind:`result`,step:r,text:fD(c.output,260)||`Step #${r} ${c.state}`}),a.length||a.push({kind:`request`,text:fD(e.title,300)});let l=dD(e.events,t.call_id),u=[];t.exec_id||t.kernel_confirmed?u.push(`The sandbox saw it run${t.exit_code==null?``:` · exit ${t.exit_code}`}${(t.descendant_count??0)>0?` · ${t.descendant_count} child process${t.descendant_count===1?``:`es`}`:``}.`):t.snapshot?u.push(t.snapshot.changed?`The sandbox's snapshot after it shows ${t.snapshot.changes.length} file change${t.snapshot.changes.length===1?``:`s`}.`:`The sandbox's snapshot after it shows no file change.`):l.state===`rejected`?u.push(`The sandbox policy refused it; it never ran.`):e.sandboxId&&u.push(`The sandbox saw no process for this call. Missing evidence is not proof it did not run.`),l.state!==`none`&&u.push(`The agent was told: ${l.state}${l.code==null?``:` (exit ${l.code})`}${l.output.trim()?` — ${fD(l.output,180)}`:``}`),t.reported_check&&t.reported_check!==`agrees`&&u.push(`That report differs from what the sandbox observed — worth checking before trusting either.`),u.length||u.push(`No independent observation was recorded for this call.`);let d=gD(t),f=[];d.length&&f.push(`Changed ${d.map(e=>`\`${e}\``).join(`, `)}.`);let p=r>=0?_D(e,n,r):0;p&&f.push(`${p} later step${p===1?``:`s`} worked on what this produced, so later results depend on it.`);let m=r>=0?n[r+1]:void 0;m?f.push(`The next step (#${i+1}) was: ${yD(m)}.`):e.answer&&f.push(`After this, the agent answered: ${fD(e.answer,220)}`),f.length||f.push(`Nothing later in the record depends on it directly.`);let h=c&&(c.state===`failed`||c.state===`rejected`)?`Step #${r} had just ${c.state===`rejected`?`been refused`:`failed`} as the agent heard it, so this reads as a reaction to that result rather than a planned first move.`:o?`The agent said, just before proposing it: “${fD(o,180)}” That is its own account, not private reasoning.`:r<=0?`This follows directly from your request; the agent had seen nothing else yet.`:`Nothing the agent said at the time explains it beyond the sequence: it follows step #${r} and your original request.`;return{trigger:a,proposed:t.proposed??t.name,observed:u,consequence:f,why:h}}var CD={request:`Your request`,agent:`The agent said, just before`,result:`What the previous step returned`};function wD({trace:e,focusCall:t,onSelect:n,onOpenCall:r,onOpenThought:i,onOpenSandbox:a}){let o=e.callVerifications??[],s=bD(e),c=xD(e),[l,u]=(0,_.useState)(t);(0,_.useEffect)(()=>{t&&u(t)},[t]);let d=l&&o.some(e=>e.call_id===l)?l:c?.call.call_id??null,f=s.find(e=>e.call.call_id===d)??(c&&d===c.call.call_id?c:null)??s[0]??null,p=f?SD(e,f.call):null,m=(0,K.jsx)(`header`,{className:`rt-view-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`STORY`}),(0,K.jsx)(`h1`,{children:`What mattered in this run, and why`}),(0,K.jsx)(`p`,{className:`rt-muted rt-cot-caption`,children:`A timeline of the consequential steps only. Why a step happened is a reading of what the agent could see — not its private reasoning.`})]})});if(!o.length)return(0,K.jsxs)(`section`,{className:`rt-view`,children:[m,(0,K.jsx)(`p`,{className:`rt-empty`,children:`This prompt made no tool calls, so there is no story to rank. The final answer is the whole run.`})]});let h=e=>{u(e.call.call_id),n?.(e.call.call_id)},g=e=>c?.call.call_id===e.call.call_id;return(0,K.jsxs)(`section`,{className:`rt-view`,children:[m,(0,K.jsx)(YT,{trace:e,onStep:e=>{u(e),n?.(e)}}),(0,K.jsxs)(`div`,{className:`rt-story`,children:[(0,K.jsxs)(`aside`,{className:`rt-story-rail`,"aria-label":`Timeline of key moments`,children:[(0,K.jsx)(`h2`,{children:`Key moments`}),(0,K.jsxs)(`p`,{className:`rt-story-rail-note`,children:[s.length,` of `,o.length,` step`,o.length===1?``:`s`,` earned a place, ranked by files changed, failures, processes spawned, and what later steps built on.`]}),(0,K.jsx)(`ol`,{className:`rt-story-timeline`,children:s.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,"aria-label":`Step ${e.step}: ${e.label}`,className:`rt-story-node${f?.call.call_id===e.call.call_id?` active`:``}`,onClick:()=>h(e),children:[(0,K.jsx)(`span`,{className:`rt-story-dot`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:`rt-story-node-body`,children:[(0,K.jsxs)(`span`,{className:`rt-story-node-head`,children:[(0,K.jsxs)(`span`,{className:`rt-cot-num`,children:[`#`,e.step]}),g(e)&&(0,K.jsxs)(`span`,{className:`rt-story-top`,children:[(0,K.jsx)(ye,{size:11}),` Most consequential`]}),(0,K.jsx)(`span`,{className:`rt-story-score`,title:`Consequence score, from the reasons listed for this step`,children:e.score})]}),(0,K.jsx)(`span`,{className:`rt-story-node-label`,children:e.label}),(0,K.jsx)(`span`,{className:`rt-story-node-why`,children:e.reasons[1]??e.reasons[0]??``})]})]})},e.call.call_id))}),(0,K.jsx)(`p`,{className:`rt-story-rail-note`,children:`Routine reads, searches and retries that changed nothing are in Tool calls, not here.`})]}),f&&p&&(0,K.jsxs)(`article`,{className:`rt-story-main`,"aria-label":`Story of step ${f.step}`,children:[g(f)?(0,K.jsxs)(`p`,{className:`rt-story-banner`,children:[(0,K.jsx)(ye,{size:13}),` The most consequential command of this run — the one later steps and the final answer most depend on.`]}):(0,K.jsxs)(`p`,{className:`rt-story-banner rt-story-banner-quiet`,children:[`Step #`,f.step,` of `,o.length,` · consequence score `,f.score]}),(0,K.jsxs)(`h2`,{className:`rt-story-title`,children:[`Step #`,f.step,`: `,f.label]}),(0,K.jsx)(`div`,{className:`rt-story-cmd`,children:(0,K.jsx)(Au,{text:p.proposed})}),(0,K.jsx)(`h3`,{children:`Why it did that`}),(0,K.jsx)(`p`,{className:`rt-story-why`,children:p.why}),(0,K.jsx)(`ul`,{className:`rt-story-list`,children:p.trigger.map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`rt-story-tag`,children:e.step?`${CD[e.kind]} (#${e.step})`:CD[e.kind]}),` `,e.text]},t))}),(0,K.jsx)(`h3`,{children:`What actually happened`}),(0,K.jsx)(`ul`,{className:`rt-story-list`,children:p.observed.map((e,t)=>(0,K.jsx)(`li`,{children:e},t))}),(0,K.jsx)(`h3`,{children:`Why it matters`}),(0,K.jsx)(`ul`,{className:`rt-story-list`,children:p.consequence.map((e,t)=>(0,K.jsx)(`li`,{children:e},t))}),(0,K.jsx)(`h3`,{children:`What earned its place`}),(0,K.jsx)(`div`,{className:`rt-chips`,children:f.reasons.map(e=>(0,K.jsx)(`span`,{className:`rt-chip rt-story-reason`,children:e},e))}),(0,K.jsxs)(`div`,{className:`rt-story-actions`,children:[r&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>r(f.call.call_id),children:[(0,K.jsx)(we,{size:12}),` Open in Tool calls`]}),i&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>i(f.call.call_id),children:[(0,K.jsx)(R,{size:12}),` Ranked causes`]}),a&&(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>a(f.call.call_id),children:[(0,K.jsx)(ve,{size:12}),` Sandbox evidence`]})]}),(0,K.jsx)(`p`,{className:`rt-foot`,children:`Ranked from recorded facts only — files changed, exit codes, processes the sandbox saw, disagreements between the agent's report and the sandbox, and what later steps reused. No model was asked to write this.`})]})]})]})}var TD={A:`added`,M:`edited`,D:`deleted`,T:`type changed`};function ED({trace:e,onOpenCall:t}){let n=ST(e),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``),l=e.sandboxId,u=!!(l&&n.base&&n.final&&n.files.length);async function d(t){if(l&&n.base&&n.final){o(!0),c(``);try{let r=await OT(l,n.base,n.final,t);if(!r.diff){c(`That diff came back empty, so nothing was downloaded.`);return}kT(wT(e,t),r.diff),r.truncated&&c(`Downloaded, but the diff was larger than the 500 KB the snapshot view returns: this patch is incomplete.`)}catch(e){c(`Could not build the patch: ${e instanceof Error?e.message:String(e)}`)}finally{o(!1)}}}return(0,K.jsxs)(`section`,{className:`rt-view rt-changes`,children:[(0,K.jsxs)(`header`,{className:`rt-view-head`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`CHANGES`}),(0,K.jsx)(`h1`,{children:`What this prompt changed`})]}),(0,K.jsx)(`div`,{className:`rt-actions`,children:(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,disabled:!u||a,onClick:()=>void d(),title:u?`One patch file with every change this prompt made, to apply in your local copy`:`Needs a sandbox run whose file snapshots were recorded`,children:[(0,K.jsx)(H,{size:14}),` `,a?`Building patch…`:`Download patch`]})})]}),l?n.hasSnapshots?n.files.length?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`dl`,{className:`rt-stats`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Files changed`}),(0,K.jsx)(`dd`,{children:n.files.length})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Lines added`}),(0,K.jsxs)(`dd`,{children:[`+`,n.added]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Lines removed`}),(0,K.jsxs)(`dd`,{children:[`−`,n.removed]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Steps that changed files`}),(0,K.jsx)(`dd`,{children:n.steps.length})]})]}),s&&(0,K.jsx)(`p`,{role:`alert`,className:`verify-error`,children:s}),(0,K.jsx)(`h2`,{children:`Across the whole prompt`}),(0,K.jsx)(`ul`,{className:`rt-files`,children:n.files.map(e=>(0,K.jsxs)(_.Fragment,{children:[(0,K.jsxs)(`li`,{children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-file-toggle`,"aria-expanded":r===e.path,onClick:()=>i(r===e.path?null:e.path),children:[(0,K.jsx)(B,{size:12,className:`rt-caret${r===e.path?` down`:``}`}),(0,K.jsx)(`span`,{className:`rt-file-status s-${e.status}`,children:TD[e.status]??e.status}),(0,K.jsx)(`code`,{children:e.path})]}),(0,K.jsxs)(`small`,{children:[e.added==null?`binary`:`+${e.added} −${e.removed}`,` · step`,e.calls.length>1?`s`:``,` `,e.calls.map(e=>`#${e}`).join(`, `)]})]}),r===e.path&&n.base&&n.final&&(0,K.jsxs)(`li`,{className:`rt-file-diff`,children:[(0,K.jsx)(PT,{sandbox:l,from:n.base,to:n.final,path:e.path}),(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,disabled:a,onClick:()=>void d(e.path),children:[(0,K.jsx)(H,{size:13}),` `,`Download this file's patch`]})]})]},e.path))}),n.tooBig.length>0&&(0,K.jsxs)(`p`,{className:`rt-files-note`,children:[`Too big to snapshot (over 5 MB), so their changes are not in this list or the patch: `,n.tooBig.join(`, `)]}),(0,K.jsxs)(`div`,{className:`rt-changes-apply`,children:[(0,K.jsx)(`h2`,{children:`Take it into your local copy`}),(0,K.jsxs)(`p`,{children:[`Download the patch above, put it in your project folder, and check before applying:`,` `,(0,K.jsxs)(`code`,{children:[`git apply --check `,wT(e)]}),`, then `,(0,K.jsxs)(`code`,{children:[`git apply `,wT(e)]}),`. The patch is built from the sandbox's snapshots of this prompt only. It may not apply cleanly if your local copy has changed since the sandbox was created — review it like any other change.`]})]}),(0,K.jsxs)(`div`,{className:`rt-changes-steps`,children:[(0,K.jsx)(`h2`,{children:`Step by step`}),n.steps.map(({call:e,number:n})=>(0,K.jsxs)(`div`,{className:`rt-changes-step`,children:[(0,K.jsxs)(`p`,{className:`rt-files-note`,children:[`#`,n,` `,e.description??e.proposed??e.name,t&&(0,K.jsxs)(K.Fragment,{children:[` `,` `,(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>t(e.call_id),children:[`Open in Tool calls `,(0,K.jsx)(P,{size:12})]})]})]}),e.snapshot&&(0,K.jsx)(IT,{snapshot:e.snapshot,sandbox:l})]},e.call_id))]})]}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`No file changed during this prompt. The snapshots taken after its steps show the project exactly as it started.`}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`This run was recorded before file snapshots existed, so there is nothing to diff. Tool calls still shows what the agent reported.`}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`This prompt did not run in a sandbox, so RayTrace holds no snapshot of the project folder to diff.`})]})}var DD=e=>[...e].sort((e,t)=>{let n=e.started_ns?BigInt(e.started_ns):null,r=t.started_ns?BigInt(t.started_ns):null;return n!=null&&r!=null&&n!==r?n<r?-1:1:e.event_id-t.event_id}),OD=e=>Pu({observed:!0,status:e.exit_code!=null||e.signal?void 0:`running`,exitCode:e.exit_code,signal:e.signal});function kD({trace:e,focusCall:t,onOpenCall:n}){let{since:r,until:i}=Me(e.requests),{data:a,error:o,raw:s,setRaw:c}=Tu(e.sandboxId,r,i),[l,u]=(0,_.useState)(new Set),[d,f]=(0,_.useState)(null);(0,_.useEffect)(()=>{if(f(null),!e.sandboxId)return;let t=!1,n,a=new AbortController,o=async()=>{try{let n=await Ww(e.sandboxId,r,i,a.signal);t||f(n)}catch{}!t&&!i&&(n=setTimeout(o,5e3))};return o(),()=>{t=!0,a.abort(),clearTimeout(n)}},[e.sandboxId,r,i]);let p=(0,_.useMemo)(()=>uT(d),[d]),m=new Set((d?.network??[]).filter(e=>e.effect===`connect`&&!e.outcomes.refused_by_policy).map(e=>`${e.host??e.ip}:${e.port}`)),h=a?.commands??[],g=a?.call_labels??{},v=e.callVerifications??[],y=new Map(v.map((e,t)=>[e.call_id,t+1])),b=new Set(h.map(e=>e.event_id)),x=new Map,S=[];for(let e of h){let t=e.parent_event_id;if(t==null||!b.has(t)){S.push(e);continue}x.set(t,[...x.get(t)??[],e])}let C=DD(S),w=C.map(OD),T=[0,1,2,3].map(e=>C.filter(t=>t.severity?.level===e).length),[E,D]=(0,_.useState)(null),O=E==null?C:C.filter(e=>e.severity?.level===E),k=e=>!!t&&e.attribution?.call_id===t,A=C.find(k),j=A?bu(A.pid,A.process_start_ns):null;(0,_.useEffect)(()=>{if(!j)return;let e=requestAnimationFrame(()=>document.getElementById(`proc-${j.replace(`:`,`-`)}`)?.scrollIntoView({block:`center`,behavior:`smooth`}));return()=>cancelAnimationFrame(e)},[j]);let M=e=>u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});function P(e,t){let r=DD(x.get(e.event_id)??[]),i=l.has(e.event_id),a=OD(e),o=ku(e.started_ns),s=ku(e.ended_ns),c=bu(e.pid,e.process_start_ns),u=e.attribution?.call_id??null,d=e.attribution?.parent_call_id??null,f=new Map;for(let e of[...t===0&&u?p.byCall.get(u)??[]:[],...c?p.byProcess.get(c)??[]:[]])f.set(e.key,e);return(0,K.jsxs)(_.Fragment,{children:[(0,K.jsxs)(`tr`,{id:c?`proc-${c.replace(`:`,`-`)}`:void 0,className:`rt-row${t?` rt-child`:``}${a.tone===`fail`?` failed`:``}${k(e)?` rt-focus`:``}`,onClick:r.length?()=>M(e.event_id):void 0,"aria-expanded":r.length?i:void 0,children:[(0,K.jsx)(`td`,{className:`rt-time`,children:Eu(o)}),(0,K.jsxs)(`td`,{className:`rt-cmd`,children:[(0,K.jsxs)(`span`,{className:`rt-cmd-line${r.length?` rt-parent`:``}`,style:{paddingLeft:`${t*22}px`},children:[r.length?(0,K.jsx)(B,{size:14,className:`rt-caret${i?` down`:``}`,"aria-hidden":`true`}):(0,K.jsx)(`span`,{className:`rt-caret-gap`}),(0,K.jsx)(`span`,{className:`rt-cmd-text`,title:e.command,children:e.description??(0,K.jsx)(Au,{text:e.command})}),e.description_source===`model`&&(0,K.jsx)(`span`,{className:`evidence-ai`,title:`Described by a model, not derived from the command text. Treat as a reading, not an observation.`,children:`~AI`})]}),e.description&&(0,K.jsx)(`span`,{className:`rt-cmd-raw`,style:{paddingLeft:`${t*22+20}px`},title:e.command,children:(0,K.jsx)(Au,{text:e.command})}),f.size>0&&(0,K.jsxs)(`span`,{className:`rt-chips`,style:{paddingLeft:`${t*22+20}px`},children:[[...f.values()].slice(0,8).map(e=>(0,K.jsx)(`span`,{className:`rt-flag${e.fail?` rt-fail`:``}`,title:e.title,children:e.text},e.key)),f.size>8&&(0,K.jsxs)(`span`,{className:`rt-flag`,title:[...f.values()].slice(8).map(e=>e.text).join(`
|
|
34
|
+
`),children:[`+`,f.size-8]})]})]}),(0,K.jsx)(`td`,{className:`rt-pid`,children:e.pid}),(0,K.jsx)(`td`,{className:`exec-${a.tone}`,children:(0,K.jsx)(Fu,{outcome:a})}),(0,K.jsx)(`td`,{className:`rt-time`,children:Number.isFinite(o)&&Number.isFinite(s)?Ou(s-o):`—`}),(0,K.jsx)(`td`,{children:t===0?(0,K.jsx)(Cu,{severity:e.severity,flags:u?g[u]?.flags:void 0}):null}),(0,K.jsx)(`td`,{children:t>0?null:u?(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:e=>{e.stopPropagation(),n(u)},children:[`#`,y.get(u)??`?`]}):d?(0,K.jsxs)(`span`,{className:`rt-muted`,children:[`under #`,y.get(d)??`?`]}):(0,K.jsx)(`span`,{className:`rt-muted`,title:`This process ran, but matched no proposed tool call.`,children:`no tool call`})})]}),i&&r.map(e=>P(e,t+1))]},e.event_id)}return(0,K.jsxs)(`section`,{className:`rt-view`,children:[(0,K.jsxs)(`header`,{className:`rt-view-head`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`SANDBOX EVIDENCE`}),(0,K.jsx)(`h1`,{children:`What actually ran`})]}),(0,K.jsx)(`div`,{className:`rt-actions`,children:(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>n(),children:[(0,K.jsx)(N,{size:14}),` Tool calls`]})})]}),e.sandboxId?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`dl`,{className:`rt-stats`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Commands`}),(0,K.jsx)(`dd`,{children:a?C.length:`—`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Succeeded`}),(0,K.jsx)(`dd`,{className:`exec-ok`,children:a?w.filter(e=>e.tone===`ok`).length:`—`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Failed`}),(0,K.jsx)(`dd`,{className:`exec-fail`,children:a?w.filter(e=>e.tone===`fail`).length:`—`})]}),(0,K.jsxs)(`div`,{title:[...m].join(`
|
|
35
|
+
`)||void 0,children:[(0,K.jsx)(`dt`,{children:`Reached on the network`}),(0,K.jsx)(`dd`,{children:d?m.size:`—`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:`Severity`}),(0,K.jsx)(`dd`,{className:`rt-sev-counts`,children:[`none`,`low`,`high`,`severe`].map((e,t)=>(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":E===t,className:`severity-badge severity-${t}${E===t?` rt-sev-on`:``}${E!=null&&E!==t?` rt-sev-off`:``}`,title:E===t?`Show every severity`:`Show only ${e} commands`,onClick:()=>D(e=>e===t?null:t),children:[T[t],` `,e]},e))})]})]}),o&&(0,K.jsx)(`p`,{role:`alert`,className:`verify-error`,children:o}),!a&&!o&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`Loading…`}),a&&!s&&(0,K.jsxs)(K.Fragment,{children:[E!=null&&(0,K.jsxs)(`p`,{className:`rt-foot rt-filter-note`,children:[`Showing `,O.length,` of `,C.length,` commands with `,[`none`,`low`,`high`,`severe`][E],` severity.`,` `,(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>D(null),children:`Show all`})]}),C.length?O.length?(0,K.jsx)(`div`,{className:`rt-table-wrap`,children:(0,K.jsxs)(`table`,{className:`rt-table rt-sandbox`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{children:`Started`}),(0,K.jsx)(`th`,{children:`Command`}),(0,K.jsx)(`th`,{children:`pid`}),(0,K.jsx)(`th`,{children:`Result`}),(0,K.jsx)(`th`,{children:`Took`}),(0,K.jsx)(`th`,{children:`Severity`}),(0,K.jsx)(`th`,{children:`Tool call`})]})}),(0,K.jsx)(`tbody`,{children:O.map(e=>P(e,0))})]})}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`No commands with this severity.`}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`No commands were captured in the sandbox during this prompt. Missing evidence is not proof of non-execution.`}),(0,K.jsxs)(`p`,{className:`rt-foot`,children:[`Seen by the sandbox kernel layer, independent of what the agent reported. Collector gaps: `,a.gaps,`.`,` `,a.folded&&wu(a.folded)?`Folded, not shown as commands: ${wu(a.folded)}. `:``,(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>c(!0),children:`Show every raw event`})]})]}),a&&s&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`rt-foot`,children:(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>c(!1),children:`Back to commands`})}),(0,K.jsx)(`ul`,{className:`evidence-raw`,children:(a.events??[]).map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`code`,{children:e.kind===`exec_succeeded`?(e.argv??[]).join(` `):`${e.kind} exit=${e.exit_code??`unknown`}`}),(0,K.jsxs)(`small`,{children:[` pid `,e.pid,` · #`,e.event_id]})]},e.event_id))})]})]}):(0,K.jsx)(`p`,{className:`rt-empty`,children:`This prompt did not run in a sandbox, so there is no independent evidence of what ran.`})]})}var AD=1048576,jD={file:25*AD,total:200*AD,files:2e4,archive:100*AD},MD=new Set([`.git`,`.raytace`,`.raytrace`,`.ssh`,`.aws`,`.azure`,`.config`,`node_modules`,`.venv`,`__pycache__`,`.next`,`.vinext`,`dist`,`coverage`,`.wrangler`,`.DS_Store`]),ND=new Set([`.npmrc`,`.netrc`,`.pypirc`,`credentials`,`auth.json`,`id_rsa`,`id_ed25519`]),PD=/\.(pem|key|p12|pfx)$/i,FD=e=>e.startsWith(`.env`)||PD.test(e)||ND.has(e);function ID(e,t){let n=[];for(let r of e.split(/\r?\n/)){let e=r.replace(/(?<!\\)\s+$/,``);if(!e||e.startsWith(`#`))continue;let i=e.startsWith(`!`);i&&(e=e.slice(1)),e.startsWith(`\\`)&&(e=e.slice(1));let a=e.endsWith(`/`);if(a&&(e=e.slice(0,-1)),!e)continue;let o=e.includes(`/`);e.startsWith(`/`)&&(e=e.slice(1));let s=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===`*`&&e[t+1]===`*`)e[t+2]===`/`?(s+=`(?:.*/)?`,t+=2):(s+=`.*`,t+=1);else if(n===`*`)s+=`[^/]*`;else if(n===`?`)s+=`[^/]`;else if(n===`[`){let n=e.indexOf(`]`,t+2);n<0?s+=`\\[`:(s+=`[${e.slice(t+1,n).replace(/^!/,`^`).replace(/\\/g,`\\\\`)}]`,t=n)}else s+=n.replace(/[.+^${}()|\\\]]/g,`\\$&`)}try{n.push({base:t,negate:i,dirOnly:a,match:RegExp(`^${o?``:`(?:.*/)?`}${s}$`)})}catch{}}return n}function LD(e,t,n){let r=!1;for(let i of e)(!i.dirOnly||n)&&(!i.base||t.startsWith(`${i.base}/`))&&i.match.test(i.base?t.slice(i.base.length+1):t)&&(r=!i.negate);return r}function RD(e,t){let n=t.split(`/`);for(let t=1;t<n.length;t++)if(LD(e,n.slice(0,t).join(`/`),!0))return!0;return LD(e,t,!1)}function zD(e,t,n,r){let i=[],a=0,o=[];for(let e of t.sort((e,t)=>e.path.localeCompare(t.path))){if(e.file.size>jD.file){o.push(`${e.path} (${(e.file.size/AD).toFixed(0)} MiB)`);continue}i.push(e),a+=e.file.size}return o.length&&r.push(`${o.length} file${o.length===1?` is`:`s are`} over ${jD.file/AD} MiB: ${o.slice(0,5).join(`, `)}${o.length>5?`, …`:``}. Add ${o.length===1?`it`:`them`} to .gitignore, or remove ${o.length===1?`it`:`them`}.`),i.length>jD.files&&r.push(`${i.length.toLocaleString()} files; a project may have at most ${jD.files.toLocaleString()}.`),a>jD.total&&r.push(`${(a/AD).toFixed(0)} MiB in all; a project may be at most ${jD.total/AD} MiB.`),!i.length&&!r.length&&r.push(`No files to upload in this folder.`),{name:e,files:i,total:a,skipped:n,problems:r}}var BD=e=>new Promise((t,n)=>{let r=e.createReader(),i=[],a=()=>r.readEntries(e=>{e.length?(i.push(...e),a()):t(i)},n);a()}),VD=e=>new Promise((t,n)=>e.file(t,n));function HD(e){return[...e.items].map(e=>e.webkitGetAsEntry?.()??null).filter(e=>e!==null)}async function UD(e){let t={ignored:0,excluded:0,secret:[]};if(e.length!==1||!e[0].isDirectory)return{name:``,files:[],total:0,skipped:t,problems:[`Drop one project folder (not files, and not several folders).`]};let n=e[0],r=[],i=[],a=async(e,n,i)=>{let o=await BD(e),s=o.find(e=>e.isFile&&e.name===`.gitignore`),c=s?[...i,...ID(await(await VD(s)).text(),n)]:i;for(let e of o){let i=n?`${n}/${e.name}`:e.name;if(MD.has(e.name)){t.excluded+=1;continue}if(LD(c,i,e.isDirectory)){t.ignored+=1;continue}if(e.isDirectory){await a(e,i,c);continue}if(FD(e.name)){t.secret.push(i);continue}r.length>jD.files*2||r.push({path:i,file:await VD(e)})}};try{await a(n,``,[])}catch{i.push(`Some of this folder could not be read.`)}return zD(n.name,r,t,i)}async function WD(e){let t={ignored:0,excluded:0,secret:[]},n=[...e].map(e=>{let[,...t]=(e.webkitRelativePath||e.name).split(`/`);return{path:t.join(`/`)||e.name,file:e}}),r=(e[0]?.webkitRelativePath||``).split(`/`)[0]||`project`,i=new Set,a=n.filter(e=>{let t=e.path.split(`/`),n=t.findIndex(e=>MD.has(e));return n<0||(i.add(t.slice(0,n+1).join(`/`)),!1)});t.excluded=i.size;let o=a.filter(e=>e.path.split(`/`).pop()===`.gitignore`).sort((e,t)=>e.path.split(`/`).length-t.path.split(`/`).length),s=[];for(let e of o)s.push(...ID(await e.file.text(),e.path.split(`/`).slice(0,-1).join(`/`)));let c=[];for(let e of a){if(RD(s,e.path)){t.ignored+=1;continue}if(FD(e.path.split(`/`).pop())){t.secret.push(e.path);continue}c.push(e)}return zD(r,c,t,[])}var GD=new TextEncoder;function KD(e,t,n,r,i){let a=new Uint8Array(512),o=(e,t)=>a.set(typeof e==`string`?GD.encode(e):e,t),s=(e,t)=>e.toString(8).padStart(t-1,`0`)+`\0`;o(e,0),o(s(420,8),100),o(s(1e3,8),108),o(s(1e3,8),116),o(s(n,12),124),o(s(Math.max(0,Math.floor(r)),12),136),o(` `,148),o(i,156),o(`ustar\x0000`,257),o(`node`,265),o(`node`,297),o(t,345);let c=0;for(let e of a)c+=e;return o(c.toString(8).padStart(6,`0`)+`\0 `,148),a}function qD(e,t,n){let r=GD.encode(e),i=r.length===e.length;if(i&&r.length<=100)return[KD(r,new Uint8Array,t,n,`0`)];if(i){for(let i=e.lastIndexOf(`/`);i>0;i=e.lastIndexOf(`/`,i-1))if(i<=155&&r.length-i-1<=100)return[KD(r.slice(i+1),r.slice(0,i),t,n,`0`)]}let a=` path=${e}\n`,o=GD.encode(a).length,s=o+String(o).length;String(s).length!==String(o).length&&(s=o+String(s).length);let c=GD.encode(`${s}${a}`),l=new Uint8Array(Math.ceil(c.length/512)*512);l.set(c);let u=GD.encode(e.replace(/[^\x20-\x7e]/g,`_`).slice(-100));return[KD(GD.encode(`PaxHeader`),new Uint8Array,c.length,n,`x`),l,KD(u,new Uint8Array,t,n,`0`)]}async function JD(e){let t=[];for(let{path:n,file:r}of e){t.push(...qD(n,r.size,r.lastModified/1e3),r);let e=r.size%512;e&&t.push(new Uint8Array(512-e))}t.push(new Uint8Array(1024));let n=await new Response(new Blob(t).stream().pipeThrough(new CompressionStream(`gzip`))).blob();if(n.size>jD.archive)throw Error(`The packed project is ${(n.size/AD).toFixed(0)} MiB; the most allowed is ${jD.archive/AD} MiB.`);return n}var YD=1048576,XD=e=>e<YD?`${Math.max(1,Math.round(e/1024))} KiB`:`${(e/YD).toFixed(1)} MiB`,ZD=e=>e.replace(/[^A-Za-z0-9._ -]/g,`-`).slice(0,100),QD=(e,t,n=`${t}s`)=>`${e.toLocaleString()} ${e===1?t:n}`;function $D({onCreated:e}){let[t,n]=(0,_.useState)({at:`idle`}),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(!1),s=(0,_.useRef)(null),c=async e=>{n({at:`reading`});try{let t=await e;i(ZD(t.name)),n({at:`preview`,project:t})}catch{n({at:`failed`,message:`That folder could not be read.`})}},l=e=>{e.preventDefault(),o(!1),c(UD(HD(e.dataTransfer)))},u=async t=>{let i=x().createSandbox;if(i)try{n({at:`working`,step:`Packing ${QD(t.files.length,`file`)}…`});let a=await JD(t.files);n({at:`working`,step:`Uploading ${XD(a.size)} and starting the sandbox. This can take a minute…`});let o=await i(r.trim(),a),s=await o.json().catch(()=>({}));if(!o.ok||!s.id)throw Error(s.error||`The sandbox could not be created (HTTP ${o.status}).`);n({at:`idle`}),e(s.id)}catch(e){n({at:`failed`,project:t,message:e instanceof Error&&e.message!==`Failed to fetch`?e.message:`RayTrace could not be reached. Check your connection and try again.`})}},d=t.at===`preview`||t.at===`failed`?t.project:void 0,f=/^[A-Za-z0-9._ -]{1,100}$/.test(r.trim());return(0,K.jsxs)(`div`,{className:`rt-new-sandbox`,children:[(t.at===`idle`||t.at===`reading`||t.at===`failed`&&!d)&&(0,K.jsxs)(`div`,{className:a?`rt-drop over`:`rt-drop`,onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:l,children:[(0,K.jsx)(re,{size:20}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:t.at===`reading`?`Reading the folder…`:`New sandbox: drop a project folder here`}),(0,K.jsxs)(`small`,{children:[`You will see what would be uploaded first. `,(0,K.jsx)(`code`,{children:`.env`}),` files, keys, `,(0,K.jsx)(`code`,{children:`node_modules`}),` and anything your `,(0,K.jsx)(`code`,{children:`.gitignore`}),` excludes stay on this machine. Up to `,jD.total/YD,` MiB, `,jD.file/YD,` MiB a file.`]}),t.at===`failed`&&(0,K.jsx)(`p`,{className:`rt-problem`,children:t.message})]}),(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:t.at===`reading`,onClick:()=>s.current?.click(),children:`Choose folder`}),(0,K.jsx)(`input`,{ref:s,type:`file`,hidden:!0,multiple:!0,webkitdirectory:``,onChange:e=>{let t=e.target.files;t?.length&&c(WD(t)),e.target.value=``}})]}),d&&(0,K.jsxs)(`div`,{className:`rt-upload-preview`,children:[(0,K.jsxs)(`div`,{className:`rt-upload-head`,children:[(0,K.jsxs)(`label`,{children:[`Sandbox name`,(0,K.jsx)(`input`,{value:r,maxLength:100,onChange:e=>i(e.target.value)})]}),(0,K.jsx)(`button`,{type:`button`,className:`rt-icon-button`,"aria-label":`Cancel`,onClick:()=>n({at:`idle`}),children:(0,K.jsx)(Te,{size:15})})]}),(0,K.jsxs)(`dl`,{className:`rt-facts`,children:[(0,K.jsx)(`dt`,{children:`Will upload`}),(0,K.jsxs)(`dd`,{children:[QD(d.files.length,`file`),` · `,XD(d.total)]}),(0,K.jsx)(`dt`,{children:`Stays here`}),(0,K.jsxs)(`dd`,{children:[!d.skipped.ignored&&!d.skipped.excluded&&!d.skipped.secret.length&&`Nothing was left out.`,d.skipped.ignored>0&&(0,K.jsxs)(`span`,{children:[QD(d.skipped.ignored,`path`),` ignored by .gitignore. `]}),d.skipped.excluded>0&&(0,K.jsxs)(`span`,{children:[QD(d.skipped.excluded,`dependency or build folder`),` (node_modules, .git, dist…). `]}),d.skipped.secret.length>0&&(0,K.jsxs)(`span`,{children:[QD(d.skipped.secret.length,`credential file`),`: `,(0,K.jsxs)(`code`,{children:[d.skipped.secret.slice(0,6).join(`, `),d.skipped.secret.length>6?`, …`:``]})]})]}),(0,K.jsx)(`dt`,{children:`Files`}),(0,K.jsx)(`dd`,{className:`rt-upload-files`,children:(0,K.jsxs)(`code`,{children:[d.files.slice(0,12).map(e=>e.path).join(`
|
|
36
|
+
`),d.files.length>12?`\n… and ${(d.files.length-12).toLocaleString()} more`:``]})})]}),d.problems.map(e=>(0,K.jsx)(`p`,{className:`rt-problem`,children:e},e)),t.at===`failed`&&(0,K.jsx)(`p`,{className:`rt-problem`,children:t.message}),(0,K.jsxs)(`div`,{className:`rt-actions`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-button primary`,disabled:d.problems.length>0||!f,onClick:()=>void u(d),children:[(0,K.jsx)(xe,{size:13}),` Create sandbox`]}),(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,onClick:()=>n({at:`idle`}),children:`Cancel`}),!f&&(0,K.jsx)(`small`,{className:`rt-muted`,children:`Name: letters, digits, spaces, and . _ - only.`})]})]}),t.at===`working`&&(0,K.jsx)(`p`,{className:`rt-upload-working`,children:t.step})]})}var eO=e=>e.split(`
|
|
37
|
+
`).find(e=>e.trim())?.trim()??`(empty prompt)`,tO=e=>new Date(typeof e==`number`?e*1e3:e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),nO=e=>e==null?`—`:`${(e/1048576).toFixed(e<1048576?2:1)} MiB`;function rO(e){return e===`lima`?{title:`Local VM`,detail:`Lima on this machine`}:{title:`Cloud VM ${e.split(`@`).pop()}`,detail:e}}function iO(e){return e.status===`deleted`?{label:`Destroyed`,tone:`deleted`}:e.on_host?e.status===`running`?{label:`Running`,tone:`running`}:e.status===`import_failed`?{label:`Failed to create`,tone:`deleted`}:{label:`Stopped`,tone:`stopped`}:{label:`Not connected`,tone:`unknown`}}function aO({traces:e,selectedId:t,onSelect:n,onOpenTrace:r,onOpenScan:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(0),v=!!x().createSandbox;(0,_.useEffect)(()=>{let e=!1,t,n=async()=>{try{let t=await x().fetch(`/raytace/sandboxes`,{cache:`no-store`}),n=await t.json();if(!t.ok)throw Error(n.error||`Sandbox list unavailable`);e||(o(n.sandboxes??[]),c(null))}catch(t){e||c(t instanceof Error?t.message:`Proxy unavailable`)}e||(t=setTimeout(n,1e4))};return n(),()=>{e=!0,clearTimeout(t)}},[h]);let y=new Map;for(let t of e)t.sandboxId&&!t.forkId&&y.set(t.sandboxId,[...y.get(t.sandboxId)??[],t]);let b=[...new Set((a??[]).map(e=>e.host))].sort((e,t)=>{let n=e=>+!(a??[]).some(t=>t.host===e&&t.on_host);return n(e)-n(t)||e.localeCompare(t)}),S=e=>typeof e.created==`number`?e.created*1e3:Date.parse(e.created),C=e=>{navigator.clipboard?.writeText(e),u(e),setTimeout(()=>u(``),1500)},[w,T]=(0,_.useState)(null),E=async e=>{f(e.id),m(``);try{let t=await x().fetch(`/raytace/sandboxes/${e.id}`,{method:`DELETE`,headers:{"x-raytace-experiment":`1`}}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||`Destroy failed`);n(``),g(e=>e+1)}catch(e){m(e instanceof Error?e.message:`Destroy failed`)}finally{f(``),T(null)}};return(0,K.jsxs)(`section`,{className:`rt-view`,children:[(0,K.jsx)(`header`,{className:`rt-view-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`SANDBOXES`}),(0,K.jsx)(`h1`,{children:`Where your agents ran`})]})}),v&&(0,K.jsx)($D,{onCreated:e=>{g(e=>e+1),(i??n)(e)}}),s&&(0,K.jsx)(`p`,{className:`rt-empty`,children:s}),p&&(0,K.jsx)(`p`,{className:`rt-empty`,children:p}),!s&&a===null&&(0,K.jsx)(`p`,{className:`rt-empty`,children:`Loading…`}),!s&&a?.length===0&&(0,K.jsxs)(`p`,{className:`rt-empty`,children:[`No sandboxes yet. `,v?`Drop a project folder above, or from`:`From`,` a Git repository: `,(0,K.jsx)(`code`,{children:`raytrace sandbox create`})]}),b.map(e=>{let o=rO(e),s=(a??[]).filter(t=>t.host===e).sort((e,t)=>Number(e.status===`deleted`)-Number(t.status===`deleted`)||S(t)-S(e)),c=s.some(e=>e.on_host);return(0,K.jsxs)(`div`,{className:`rt-host`,children:[(0,K.jsxs)(`div`,{className:`rt-list-head`,children:[(0,K.jsxs)(`span`,{className:`rt-host-title`,children:[(0,K.jsx)(_e,{size:13}),` `,o.title.toUpperCase()]}),(0,K.jsxs)(`small`,{children:[o.detail,` · `,c?`connected`:`not connected now`,` · `,s.length,` sandbox`,s.length===1?``:`es`]})]}),(0,K.jsx)(`ol`,{className:`rt-prompts`,children:s.map(e=>{let a=e.id===t,s=(y.get(e.id)??[]).sort((e,t)=>t.startedAt.localeCompare(e.startedAt)),c=iO(e),u=`raytrace connect ${e.host===`lima`&&e.name?e.name:e.id}`;return(0,K.jsxs)(`li`,{className:a?`rt-prompt open`:`rt-prompt`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`rt-prompt-row`,"aria-expanded":a,onClick:()=>n(a?``:e.id),children:[(0,K.jsx)(`time`,{children:tO(e.created)}),(0,K.jsxs)(`strong`,{children:[(0,K.jsx)(`span`,{className:`rt-state s-${c.tone}`,children:c.label}),e.name]}),(0,K.jsxs)(`small`,{children:[s.length,` prompt`,s.length===1?``:`s`,` · `,e.id.slice(0,12),`…`]})]}),a&&(0,K.jsxs)(`div`,{className:`rt-prompt-detail`,children:[(0,K.jsxs)(`dl`,{className:`rt-facts`,children:[(0,K.jsx)(`dt`,{children:`Sandbox`}),(0,K.jsx)(`dd`,{children:(0,K.jsx)(`code`,{children:e.id})}),(0,K.jsx)(`dt`,{children:`Runs on`}),(0,K.jsxs)(`dd`,{children:[o.title,` `,(0,K.jsxs)(`span`,{className:`rt-muted`,children:[`(`,o.detail,`)`]})]}),(0,K.jsx)(`dt`,{children:`State`}),(0,K.jsxs)(`dd`,{children:[c.label,!e.on_host&&e.status!==`deleted`?(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` — the manager is connected to another VM; last recorded: `,e.status]}):null]}),(0,K.jsx)(`dt`,{children:`Created`}),(0,K.jsxs)(`dd`,{children:[tO(e.created),e.deleted?(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` · destroyed `,tO(e.deleted)]}):null]}),e.host!==`lima`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{children:`Uploaded`}),(0,K.jsxs)(`dd`,{children:[nO(e.imported_bytes),e.skipped_count?(0,K.jsxs)(`span`,{className:`rt-muted`,children:[` · `,e.skipped_count,` file`,e.skipped_count===1?``:`s`,` left out`]}):null]})]}),(0,K.jsx)(`dt`,{children:`Recording`}),(0,K.jsx)(`dd`,{children:e.transcripts===!1?`Commands only (no Claude Code transcripts)`:`Commands and Claude Code transcripts`}),i&&e.scan?.by_level&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{children:`Initial scan`}),(0,K.jsxs)(`dd`,{children:[e.scan.files,` files, `,(e.scan.by_level[4]??0)+(e.scan.by_level[5]??0),` at level 4 or 5`,` `,(0,K.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>i(e.id),children:[(0,K.jsx)(he,{size:11}),` Open the scan`]})]})]})]}),e.status!==`deleted`&&e.on_host&&(0,K.jsxs)(`div`,{className:`rt-shell-line`,children:[(0,K.jsx)(`code`,{children:u}),(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>C(u),children:[(0,K.jsx)(V,{size:13}),` `,l===u?`Copied`:`Copy`]})]}),e.host===`lima`&&(0,K.jsxs)(`div`,{className:`rt-shell-line`,children:[(0,K.jsxs)(`code`,{children:[`raytrace sandbox destroy `,e.name||e.id]}),(0,K.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>C(`raytrace sandbox destroy ${e.name||e.id}`),children:[(0,K.jsx)(V,{size:13}),` `,l===`raytrace sandbox destroy ${e.name||e.id}`?`Copied`:`Copy`]})]}),e.host===`lima`&&(0,K.jsxs)(`p`,{className:`rt-foot`,children:[`Run the first command in a terminal to open this sandbox, then start `,(0,K.jsx)(`code`,{children:`claude`}),` or `,(0,K.jsx)(`code`,{children:`codex`}),` there. The second deletes it, and asks whether to delete the logs recorded in it too.`]}),e.host!==`lima`&&e.status!==`deleted`&&e.on_host&&(0,K.jsxs)(`div`,{className:`rt-shell-line`,children:[(0,K.jsx)(`code`,{children:`Destroy this sandbox and stop anything running in it. Its recorded evidence stays.`}),(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:d===e.id,onClick:()=>T(e),children:d===e.id?`Destroying…`:`Destroy`})]}),e.host!==`lima`&&e.status!==`deleted`&&e.on_host&&(0,K.jsxs)(`p`,{className:`rt-foot`,children:[`Run it in a terminal to open this sandbox, then start `,(0,K.jsx)(`code`,{children:`claude`}),` or `,(0,K.jsx)(`code`,{children:`codex`}),` there. Needs the RayTrace CLI, signed in as this account: `,(0,K.jsx)(`code`,{children:`npm install -g @raytrace-cli/cli@latest`}),`. On CLI 0.2 the command is `,(0,K.jsxs)(`code`,{children:[`raytrace sandbox shell `,e.id]}),`.`]}),(0,K.jsx)(`h3`,{children:`History`}),!s.length&&(0,K.jsx)(`p`,{className:`rt-muted`,children:`No prompts recorded in this sandbox yet.`}),s.length>0&&(0,K.jsx)(`ol`,{className:`rt-history`,children:s.map(e=>{let t=e.callVerifications??[],n=t.filter(e=>e.exec_id||(e.kind?e.kind===`command`:e.proposed!=null)),i=n.filter(e=>e.exec_id).length,a=t.filter(e=>e.kind===`file`&&!e.exec_id).length;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),children:[(0,K.jsx)(`time`,{dateTime:e.startedAt,children:tO(e.startedAt)}),(0,K.jsx)(`span`,{children:eO(e.title)}),(0,K.jsxs)(`small`,{className:n.length&&i===n.length?`all`:``,children:[n.length?`${i} of ${n.length} command${n.length===1?``:`s`} observed in the sandbox`:`no commands`,a>0&&` · ${a} file operation${a===1?``:`s`}`]}),(0,K.jsx)(P,{size:13})]})},e.id)})})]})]},e.id)})})]},e)}),w&&(0,K.jsxs)(`dialog`,{open:!0,className:`rt-dialog`,"aria-labelledby":`rt-destroy-title`,onCancel:e=>{e.preventDefault(),d||T(null)},children:[(0,K.jsx)(`h2`,{id:`rt-destroy-title`,children:`Destroy this sandbox?`}),(0,K.jsxs)(`p`,{children:[`“`,w.name||w.id,`” stops and is deleted. Its recorded evidence stays.`]}),(0,K.jsxs)(`div`,{className:`rt-dialog-actions`,children:[(0,K.jsx)(`button`,{type:`button`,className:`rt-button`,autoFocus:!0,disabled:!!d,onClick:()=>T(null),children:`No`}),(0,K.jsx)(`button`,{type:`button`,className:`rt-button rt-danger`,disabled:!!d,onClick:()=>void E(w),children:d?`Destroying…`:`Yes, destroy`})]})]})]})}var oO=[`prompts`,`search`,`story`,`sandboxes`,`scan`,`calls`,`changes`,`sandbox`,`context`,`thought`,`playground`];function sO(e){let t=new URLSearchParams(typeof window>`u`?``:window.location.search),n=t.get(`view`),r=n===`lab`?`context`:n;return{view:r&&e.includes(r)?r:`prompts`,trace:t.get(`trace`)??``,call:t.get(`call`),step:t.get(`step`),box:t.get(`box`)??``,q:t.get(`q`)??``}}function cO(e){let t=new URLSearchParams;e.view!==`prompts`&&t.set(`view`,e.view),e.trace&&t.set(`trace`,e.trace),e.call&&t.set(`call`,e.call),e.step&&t.set(`step`,e.step),e.box&&t.set(`box`,e.box),e.view===`search`&&e.q&&t.set(`q`,e.q);let n=t.toString();window.history.pushState(null,``,n?`?${n}`:window.location.pathname)}var lO=e=>e.split(`
|
|
38
|
+
`).find(e=>e.trim())?.trim()??``,uO=e=>`${e.exchange_id}:${e.output_index}`;function dO({views:e=oO,offline:t=`PROXY OFFLINE`,footer:n=null}){let r=t=>e.includes(t),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)({view:`prompts`,trace:``,call:null,step:null,box:``,q:``}),[f,p]=(0,_.useState)(``),m=(0,_.useRef)(null),h=Mw();(0,_.useEffect)(()=>{d(sO(e));let t=()=>d(sO(e));return window.addEventListener(`popstate`,t),()=>window.removeEventListener(`popstate`,t)},[e]);let g=(0,_.useCallback)(e=>{d(t=>{let n={...t,call:null,step:null,box:``,q:``,...e};return cO(n),n})},[]);(0,_.useEffect)(()=>{let e=!1,t,n=``,r=async()=>{try{let t=await x().fetch(`/raytace/traces?scope=history`,{cache:`no-store`,headers:n?{"if-none-match":n}:{}});if(t.status===304)e||s(!0);else{if(!t.ok)throw Error(`Proxy unavailable`);let r=await t.json();n=t.headers.get(`etag`)??``,e||(a(r.traces||[]),s(!0))}}catch{e||s(!1)}e||(l(!0),t=setTimeout(r,5e3))};return r(),()=>{e=!0,clearTimeout(t)}},[]);let[v,y]=(0,_.useState)(0),[b,S]=(0,_.useState)(0),C=e.includes(`scan`);(0,_.useEffect)(()=>{if(!C)return;let e=!1,t,n=async()=>{try{let t=await Gw();e||y(t.unseen)}catch{}e||(t=setTimeout(n,1e4))};return n(),()=>{e=!0,clearTimeout(t)}},[C,b]);let w=i.find(e=>e.id===u.trace),T=[{view:`prompts`,label:`Prompts`,icon:ce},{view:`search`,label:`Search`,icon:ge},{view:`story`,label:`Story`,icon:le},{view:`sandboxes`,label:`Sandboxes`,icon:L},{view:`scan`,label:`Initial scan`,icon:he},{view:`calls`,label:`Tool calls`,icon:we},{view:`changes`,label:`Changes`,icon:U},{view:`sandbox`,label:`Sandbox evidence`,icon:ve},{view:`context`,label:`Context`,icon:oe},{view:`thought`,label:`Chain of thought`,icon:R},{view:`playground`,label:`Playground`,icon:ie}].filter(e=>r(e.view));function E(){return!c&&u.trace?(0,K.jsx)(`section`,{className:`rt-view`,children:(0,K.jsx)(`p`,{className:`rt-empty`,children:`Loading…`})}):(0,K.jsx)(`section`,{className:`rt-view`,children:(0,K.jsxs)(`p`,{className:`rt-empty`,children:[c&&u.trace&&!w?`That prompt is no longer in the loaded history.`:`Choose a prompt first.`,` `,(0,K.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>g({view:`prompts`}),children:`Go to Prompts`})]})})}return(0,K.jsxs)(`main`,{className:`rt-shell`,ref:m,children:[(0,K.jsxs)(`aside`,{className:`nav rt-nav`,children:[(0,K.jsxs)(`div`,{className:`brand`,children:[(0,K.jsx)(Se,{size:22}),` RayTrace`]}),r(`search`)&&(0,K.jsxs)(`form`,{className:`rt-nav-search`,onSubmit:e=>{e.preventDefault(),g({view:`search`,q:f})},children:[(0,K.jsx)(ge,{size:13}),(0,K.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`Search what agents did…`,"aria-label":`Search agent activity`,spellCheck:!1})]}),(0,K.jsx)(`nav`,{className:`nav-destinations`,children:T.map(({view:e,label:t,icon:n})=>(0,K.jsxs)(`button`,{type:`button`,className:`nav-item ${u.view===e?`active`:``}`,onClick:()=>g({view:e,trace:u.trace,...e===`scan`?{box:u.box||w?.sandboxId||``}:{}}),children:[(0,K.jsx)(n,{size:16}),` `,t,e===`scan`&&v>0&&(0,K.jsx)(`span`,{className:`rt-count`,title:`${v} unseen alert${v===1?``:`s`}`,children:v})]},e))}),w&&(0,K.jsxs)(`div`,{className:`rt-viewing`,children:[(0,K.jsx)(`span`,{className:`workspace-label`,children:`VIEWING`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>g({view:`prompts`,trace:w.id}),title:w.title,children:lO(w.title)}),(0,K.jsx)(`small`,{children:new Date(w.startedAt).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`})})]}),(0,K.jsxs)(`div`,{className:`nav-bottom`,children:[(0,K.jsxs)(`div`,{className:`nav-status`,children:[(0,K.jsxs)(`span`,{className:`status ${c?o?``:`offline`:`pending`}`,children:[(0,K.jsx)(`i`,{}),c?o?`CONNECTED`:t:`CONNECTING…`]}),(0,K.jsx)(`button`,{type:`button`,className:`theme-toggle`,onClick:()=>Aw(h===`light`?`dark`:`light`),"aria-pressed":h===`dark`,"aria-label":`Switch to ${h===`light`?`dark`:`light`} theme`,title:`Switch to ${h===`light`?`dark`:`light`} theme`,children:`◐`})]}),n]}),(0,K.jsx)(CE,{target:m,variable:`--nav-width`,storageKey:`raytace.nav-width`,min:180,max:480,label:`Navigation width`})]}),u.view===`prompts`&&r(`prompts`)&&(0,K.jsx)(eD,{traces:i.filter(e=>!e.forkId),loaded:c,selectedId:u.trace,onSelect:e=>g({view:`prompts`,trace:e}),onOpen:(e,t)=>g({view:e,trace:t}),onOpenStep:(e,t)=>g({view:`calls`,trace:e,call:t}),canOpen:r}),u.view===`search`&&r(`search`)&&(0,K.jsx)(lD,{initialQuery:u.q,onQuery:e=>g({view:`search`,trace:u.trace,q:e}),onOpenCall:(e,t)=>g({view:`calls`,trace:e,call:t}),onOpenTrace:e=>g({view:`prompts`,trace:e}),onOpenSandbox:r(`sandbox`)?(e,t)=>g({view:`sandbox`,trace:e,call:t}):void 0},u.q),u.view===`story`&&r(`story`)&&(w?(0,K.jsx)(wD,{trace:w,focusCall:u.call,onSelect:e=>g({view:`story`,trace:w.id,call:e}),onOpenCall:e=>g({view:`calls`,trace:w.id,call:e}),onOpenThought:r(`thought`)?e=>g({view:`thought`,trace:w.id,call:e}):void 0,onOpenSandbox:r(`sandbox`)?e=>g({view:`sandbox`,trace:w.id,call:e}):void 0},w.id):E()),u.view===`sandboxes`&&r(`sandboxes`)&&(0,K.jsx)(aO,{traces:i,selectedId:u.box,onSelect:e=>g({view:`sandboxes`,box:e}),onOpenTrace:e=>g({view:`calls`,trace:e}),onOpenScan:r(`scan`)?e=>g({view:`scan`,trace:u.trace,box:e}):void 0}),u.view===`scan`&&r(`scan`)&&(0,K.jsx)(xT,{box:u.box,traces:i,onSelect:e=>g({view:`scan`,trace:u.trace,box:e}),onOpenCall:(e,t)=>g({view:`calls`,trace:e,call:t}),onAlertsSeen:()=>S(e=>e+1)}),u.view===`calls`&&r(`calls`)&&(w?(0,K.jsx)(KT,{trace:w,traces:i,focusCall:u.call,onOpenSandbox:r(`sandbox`)?e=>g({view:`sandbox`,trace:w.id,call:e??null}):void 0,onOpenContext:r(`context`)?e=>g({view:`context`,trace:w.id,step:uO(e)}):void 0,onOpenThought:r(`thought`)?e=>g({view:`thought`,trace:w.id,call:e}):void 0,onOpenPlayground:r(`playground`)?(e,t)=>g({view:`playground`,trace:w.id,step:e,call:t??null}):void 0},w.id):E()),u.view===`changes`&&r(`changes`)&&(w?(0,K.jsx)(ED,{trace:w,onOpenCall:r(`calls`)?e=>g({view:`calls`,trace:w.id,call:e}):void 0},w.id):E()),u.view===`sandbox`&&r(`sandbox`)&&(w?(0,K.jsx)(kD,{trace:w,focusCall:u.call,onOpenCall:e=>g({view:`calls`,trace:w.id,call:e??null})},w.id):E()),u.view===`playground`&&r(`playground`)&&(w?(0,K.jsx)(GE,{trace:w,stepId:u.step,removeCall:u.call,forkTraces:i.filter(e=>e.forkId),onStep:e=>g({view:`playground`,trace:w.id,step:e}),onOpenTrace:e=>g({view:`calls`,trace:e})},`${w.id}:${u.step??``}`):E()),u.view===`context`&&r(`context`)&&(w?(0,K.jsx)(bE,{trace:w,stepKey:u.step,onStep:e=>g({view:`context`,trace:w.id,step:e}),onRerunWithout:r(`playground`)?(e,t)=>g({view:`playground`,trace:w.id,step:e,call:t}):void 0},w.id):E()),u.view===`thought`&&r(`thought`)&&(w?(0,K.jsx)(oE,{trace:w,focusCall:u.call},w.id):E())]})}var fO=[`prompts`,`search`,`story`,`sandboxes`,`calls`,`changes`,`sandbox`,`context`,`thought`,`playground`];S({fetch:(e,t)=>fetch(e,t)});var pO=4;function mO(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{fetch(`/raytace/version`).then(e=>e.ok?e.json():{api:0}).then(e=>t((Number(e.api)||0)<pO),()=>{}),fetch(`/raytace/models`).then(e=>r(e.status===401),()=>{})},[]),!e&&!n?null:(0,K.jsx)(`div`,{role:`alert`,style:{padding:`10px 16px`,background:`light-dark(#fff4d6,#3a2f12)`,color:`light-dark(#5c4300,#ffd97a)`,fontSize:13,borderBottom:`1px solid light-dark(#f0d48a,#5c4a1c)`},children:e?(0,K.jsxs)(K.Fragment,{children:[`An older RayTrace proxy is running, so parts of this page cannot load. Restart it: `,(0,K.jsx)(`code`,{children:`raytrace stop && raytrace start`})]}):(0,K.jsxs)(K.Fragment,{children:[`This browser is not signed in to RayTrace, so nothing can load. In a terminal, run: `,(0,K.jsx)(`code`,{children:`raytrace open`})]})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,K.jsxs)(_.StrictMode,{children:[(0,K.jsx)(mO,{}),(0,K.jsx)(dO,{views:fO})]}));
|