raytrace-cli 0.11.1__py3-none-win_arm64.whl

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.
Files changed (165) hide show
  1. raytrace/__init__.py +1 -0
  2. raytrace/__main__.py +33 -0
  3. raytrace/app/LICENSE +21 -0
  4. raytrace/app/README.md +599 -0
  5. raytrace/app/bin/raytrace.mjs +297 -0
  6. raytrace/app/dist/dashboard/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
  7. raytrace/app/dist/dashboard/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
  8. raytrace/app/dist/dashboard/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
  9. raytrace/app/dist/dashboard/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
  10. raytrace/app/dist/dashboard/assets/dm-sans-latin-600-normal-Aqo67rzb.woff2 +0 -0
  11. raytrace/app/dist/dashboard/assets/dm-sans-latin-600-normal-BmdmIIQ2.woff +0 -0
  12. raytrace/app/dist/dashboard/assets/dm-sans-latin-700-normal-CUSSCpQX.woff +0 -0
  13. raytrace/app/dist/dashboard/assets/dm-sans-latin-700-normal-DvUfVpUG.woff2 +0 -0
  14. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff +0 -0
  15. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2 +0 -0
  16. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2 +0 -0
  17. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff +0 -0
  18. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-600-normal-4vooXBpG.woff2 +0 -0
  19. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-600-normal-DRtaDpgU.woff +0 -0
  20. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-700-normal-BLI3TTWz.woff +0 -0
  21. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-700-normal-CJIcxD6K.woff2 +0 -0
  22. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  23. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  24. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  25. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  26. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  27. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  28. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  29. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  30. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  31. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  32. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  33. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  34. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  35. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  36. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  37. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  38. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  39. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  40. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  41. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  42. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  43. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  44. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  45. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  46. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  47. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  48. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  49. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  50. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  51. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  52. raytrace/app/dist/dashboard/assets/index-DepcI8Fi.js +38 -0
  53. raytrace/app/dist/dashboard/assets/index-H97VLD5l.css +1 -0
  54. raytrace/app/dist/dashboard/favicon.svg +6 -0
  55. raytrace/app/dist/dashboard/index.html +15 -0
  56. raytrace/app/package.json +48 -0
  57. raytrace/app/proxy/agent-intent-schema.test.mjs +142 -0
  58. raytrace/app/proxy/call-assessment.mjs +385 -0
  59. raytrace/app/proxy/call-assessment.test.mjs +167 -0
  60. raytrace/app/proxy/call-category.mjs +461 -0
  61. raytrace/app/proxy/capture-health.mjs +30 -0
  62. raytrace/app/proxy/capture-health.test.mjs +44 -0
  63. raytrace/app/proxy/capture.mjs +38 -0
  64. raytrace/app/proxy/capture.test.mjs +49 -0
  65. raytrace/app/proxy/claude-code-adapter.mjs +301 -0
  66. raytrace/app/proxy/claude-code-hook.mjs +22 -0
  67. raytrace/app/proxy/codex-config.mjs +36 -0
  68. raytrace/app/proxy/codex.mjs +14 -0
  69. raytrace/app/proxy/evidence-schema.test.mjs +240 -0
  70. raytrace/app/proxy/evidence-store.mjs +993 -0
  71. raytrace/app/proxy/evidence-store.test.mjs +301 -0
  72. raytrace/app/proxy/exec-narrative.mjs +625 -0
  73. raytrace/app/proxy/exec-narrative.test.mjs +262 -0
  74. raytrace/app/proxy/execution-correlation.mjs +185 -0
  75. raytrace/app/proxy/execution-correlation.test.mjs +146 -0
  76. raytrace/app/proxy/execution-runner.mjs +89 -0
  77. raytrace/app/proxy/execution-runner.test.mjs +38 -0
  78. raytrace/app/proxy/experiment-engine.mjs +195 -0
  79. raytrace/app/proxy/experiment-engine.test.mjs +93 -0
  80. raytrace/app/proxy/explanations.mjs +36 -0
  81. raytrace/app/proxy/explanations.test.mjs +20 -0
  82. raytrace/app/proxy/failure-signature.mjs +56 -0
  83. raytrace/app/proxy/gvisor-forwarder.mjs +493 -0
  84. raytrace/app/proxy/gvisor-forwarder.test.mjs +433 -0
  85. raytrace/app/proxy/init-evidence-db.mjs +227 -0
  86. raytrace/app/proxy/local-sandboxes.mjs +94 -0
  87. raytrace/app/proxy/local-token.mjs +30 -0
  88. raytrace/app/proxy/playground-recovery.test.mjs +130 -0
  89. raytrace/app/proxy/playground.mjs +439 -0
  90. raytrace/app/proxy/prompt-context.mjs +278 -0
  91. raytrace/app/proxy/prompt-traces.mjs +40 -0
  92. raytrace/app/proxy/prompt-traces.test.mjs +32 -0
  93. raytrace/app/proxy/providers.mjs +65 -0
  94. raytrace/app/proxy/providers.test.mjs +76 -0
  95. raytrace/app/proxy/proxy.integration.test.mjs +135 -0
  96. raytrace/app/proxy/raytace-proxy.mjs +941 -0
  97. raytrace/app/proxy/request-metrics.mjs +13 -0
  98. raytrace/app/proxy/request-metrics.test.mjs +19 -0
  99. raytrace/app/proxy/request-policy.mjs +45 -0
  100. raytrace/app/proxy/request-policy.test.mjs +47 -0
  101. raytrace/app/proxy/run-recap.mjs +139 -0
  102. raytrace/app/proxy/runtime-attribution.mjs +110 -0
  103. raytrace/app/proxy/sandbox-bridge.mjs +49 -0
  104. raytrace/app/proxy/schema/EVIDENCE_DATABASE.md +276 -0
  105. raytrace/app/proxy/schema/agent_intent.sql +101 -0
  106. raytrace/app/proxy/schema/auxiliary.sql +90 -0
  107. raytrace/app/proxy/schema/capture_health.sql +14 -0
  108. raytrace/app/proxy/schema/classification.sql +89 -0
  109. raytrace/app/proxy/schema/file_context.sql +53 -0
  110. raytrace/app/proxy/schema/runtime_evidence.sql +201 -0
  111. raytrace/app/proxy/schema/search.sql +66 -0
  112. raytrace/app/proxy/schema/shared_storage.sql +21 -0
  113. raytrace/app/proxy/search.mjs +418 -0
  114. raytrace/app/proxy/search.test.mjs +161 -0
  115. raytrace/app/proxy/smoke.test.mjs +93 -0
  116. raytrace/app/proxy/step-attribution.mjs +380 -0
  117. raytrace/app/proxy/step-lab.mjs +78 -0
  118. raytrace/app/proxy/step-lab.test.mjs +38 -0
  119. raytrace/app/proxy/summaries.mjs +151 -0
  120. raytrace/app/proxy/summaries.test.mjs +69 -0
  121. raytrace/app/proxy/tool-metadata.mjs +111 -0
  122. raytrace/app/proxy/tool-metadata.test.mjs +38 -0
  123. raytrace/app/proxy/trace-view.mjs +324 -0
  124. raytrace/app/proxy/trace-view.test.mjs +92 -0
  125. raytrace/app/proxy/typesafe.mjs +63 -0
  126. raytrace/app/proxy/typesafe.test.mjs +39 -0
  127. raytrace/app/src/agents.mjs +7 -0
  128. raytrace/app/src/api.mjs +57 -0
  129. raytrace/app/src/auth.mjs +205 -0
  130. raytrace/app/src/beta.mjs +96 -0
  131. raytrace/app/src/claude-code.mjs +93 -0
  132. raytrace/app/src/commands.mjs +285 -0
  133. raytrace/app/src/config.mjs +49 -0
  134. raytrace/app/src/export.mjs +200 -0
  135. raytrace/app/src/lima.mjs +176 -0
  136. raytrace/app/src/local-sandbox.mjs +358 -0
  137. raytrace/app/src/mcp.mjs +688 -0
  138. raytrace/app/src/paths.mjs +33 -0
  139. raytrace/app/src/prompt.mjs +42 -0
  140. raytrace/app/src/proxy-process.mjs +143 -0
  141. raytrace/app/src/sandbox.mjs +306 -0
  142. raytrace/app/src/share.mjs +86 -0
  143. raytrace/app/src/terminal.mjs +68 -0
  144. raytrace/app/src/upload.mjs +198 -0
  145. raytrace/app/worker/sandbox/Dockerfile +8 -0
  146. raytrace/app/worker/sandbox/SYSCALL_CATALOG.md +197 -0
  147. raytrace/app/worker/sandbox/claude-hook.mjs +364 -0
  148. raytrace/app/worker/sandbox/collector.py +405 -0
  149. raytrace/app/worker/sandbox/dns_forwarder.py +255 -0
  150. raytrace/app/worker/sandbox/engine.py +940 -0
  151. raytrace/app/worker/sandbox/file_scan.py +491 -0
  152. raytrace/app/worker/sandbox/lima.yaml +29 -0
  153. raytrace/app/worker/sandbox/network.py +90 -0
  154. raytrace/app/worker/sandbox/projects.py +702 -0
  155. raytrace/app/worker/sandbox/setup.py +159 -0
  156. raytrace/app/worker/sandbox/syscall_catalog.sql +985 -0
  157. raytrace/app/worker/sandbox/transcript-delivery.test.mjs +153 -0
  158. raytrace/app/worker/sandbox/viewer.py +195 -0
  159. raytrace/node/LICENSE +2946 -0
  160. raytrace/node/node.exe +4 -0
  161. raytrace_cli-0.11.1.dist-info/LICENSE +21 -0
  162. raytrace_cli-0.11.1.dist-info/METADATA +42 -0
  163. raytrace_cli-0.11.1.dist-info/RECORD +165 -0
  164. raytrace_cli-0.11.1.dist-info/WHEEL +4 -0
  165. raytrace_cli-0.11.1.dist-info/entry_points.txt +2 -0
@@ -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 W=256,Ie=262144,Le=4194304;function Re(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 ze(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=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(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 Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(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 He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(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 G(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 qe(e,t){var n=t&-t;return n=n&42?1:Je(n),(n&(e.suspendedLanes|t))===0?n:0}function Je(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 Ye(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Xe(){var e=L.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function Ze(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var Qe=Math.random().toString(36).slice(2),$e=`__reactFiber$`+Qe,et=`__reactProps$`+Qe,tt=`__reactContainer$`+Qe,nt=`__reactEvents$`+Qe,rt=`__reactListeners$`+Qe,it=`__reactHandles$`+Qe,at=`__reactResources$`+Qe,ot=`__reactMarker$`+Qe;function st(e){delete e[$e],delete e[et],delete e[nt],delete e[rt],delete e[it]}function ct(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tt]||n[$e]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[$e])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function lt(e){if(e=e[$e]||e[tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ut(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function dt(e){var t=e[at];return t||=e[at]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ft(e){e[ot]=!0}var pt=new Set,mt={};function ht(e,t){gt(e,t),gt(e+`Capture`,t)}function gt(e,t){for(mt[e]=t,e=0;e<t.length;e++)pt.add(t[e])}var _t=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]*$`),vt={},yt={};function bt(e){return he.call(yt,e)?!0:he.call(vt,e)?!1:_t.test(e)?yt[e]=!0:(vt[e]=!0,!1)}function xt(e,t,n){if(bt(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 St(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 Ct(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 wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Tt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Et(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 Dt(e){if(!e._valueTracker){var t=Tt(e)?`checked`:`value`;e._valueTracker=Et(e,t,``+e[t])}}function Ot(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Tt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function kt(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 At=/[\n"\\]/g;function jt(e){return e.replace(At,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Mt(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=``+wt(t)):e.value!==``+wt(t)&&(e.value=``+wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Pt(e,o,wt(n)):Pt(e,o,wt(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=``+wt(s):e.removeAttribute(`name`)}function Nt(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)){Dt(e);return}n=n==null?``:``+wt(n),t=t==null?n:``+wt(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),Dt(e)}function Pt(e,t,n){t===`number`&&kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ft(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=``+wt(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 It(e,t,n){if(t!=null&&(t=``+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+wt(n)}function Lt(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=wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Dt(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 K(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 Vt(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 Ht=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`]]),Ut=/^[\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 Wt(e){return Ut.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Gt(){}var Kt=null;function qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jt=null,Yt=null;function Xt(e){var t=lt(e);if(t&&(e=t.stateNode)){var n=e[et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Mt(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="`+jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[et]||null;if(!a)throw Error(i(90));Mt(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&&Ot(r)}break a;case`textarea`:It(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ft(e,!!n.multiple,t,!1)}}}var Zt=!1;function Qt(e,t,n){if(Zt)return e(t,n);Zt=!0;try{return e(t)}finally{if(Zt=!1,(Jt!==null||Yt!==null)&&(vu(),Jt&&(t=Jt,e=Yt,Yt=Jt=null,Xt(t),e)))for(t=0;t<e.length;t++)Xt(e[t])}}function $t(e,t){var n=e.stateNode;if(n===null)return null;var r=n[et]||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 en=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,tn=!1;if(en)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){tn=!0}}),window.addEventListener(`test`,nn,nn),window.removeEventListener(`test`,nn,nn)}catch{tn=!1}var rn=null,an=null,on=null;function sn(){if(on)return on;var e,t=an,n=t.length,r,i=`value`in rn?rn.value:rn.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 on=i.slice(e,1<r?1-r:void 0)}function cn(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 ln(){return!0}function un(){return!1}function dn(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)?ln:un,this.isPropagationStopped=un,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=ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=ln)},persist:function(){},isPersistent:ln}),t}var fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=dn(fn),mn=h({},fn,{view:0,detail:0}),hn=dn(mn),gn,_n,vn,yn=h({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,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!==vn&&(vn&&e.type===`mousemove`?(gn=e.screenX-vn.screenX,_n=e.screenY-vn.screenY):_n=gn=0,vn=e),gn)},movementY:function(e){return`movementY`in e?e.movementY:_n}}),bn=dn(yn),xn=dn(h({},yn,{dataTransfer:0})),Sn=dn(h({},mn,{relatedTarget:0})),Cn=dn(h({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=dn(h({},fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Tn=dn(h({},fn,{data:0})),En={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Dn={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`},On={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=On[e])?!!t[e]:!1}function An(){return kn}var jn=dn(h({},mn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Dn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return e.type===`keypress`?cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Mn=dn(h({},yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=dn(h({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),Pn=dn(h({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Fn=dn(h({},yn,{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=dn(h({},fn,{newState:0,oldState:0})),Ln=[9,13,27,32],Rn=en&&`CompositionEvent`in window,zn=null;en&&`documentMode`in document&&(zn=document.documentMode);var Bn=en&&`TextEvent`in window&&!zn,Vn=en&&(!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=sn(),on=an=rn=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){Jt?Yt?Yt.push(r):Yt=[r]:Jt=r,t=Ed(t,`onChange`),0<t.length&&(n=new pn(`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(Ot(ut(e)))return e}function nr(e,t){if(e===`change`)return t}var rr=!1;if(en){var ir;if(en){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,qt(e)),Qt(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=kt(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=kt(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=en&&`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!==kt(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 pn(`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={};en&&(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),ht(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[$e]=e,t[et]=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),Nt(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),Lt(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=Gt),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){Q=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?Ll.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(Gt,Gt),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(Gt,Gt);else{if(e=Ll,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,J&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,G(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?(X&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),Gl|=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:(X&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,Gl|=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,Gl|=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),Ll===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=Ll.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(J&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&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),q.lanes|=e,Gl|=e,n)}function _s(e,t,n,r){return mr(n,t)?n:Ga.current===null?!(ao&42)||ao&1073741824&&!(X&261930)?($s=!0,e.memoizedState=n):(e=fu(),q.lanes|=e,Gl|=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),Ll===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,G(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(),Ll===null)throw Error(i(349));X&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=Ll.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(J&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=Ll,r!==null&&(s=qe(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=Ll,s!==null&&(r=qe(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),Gl|=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[$e]=t,r[et]=e,Fd(r,n,e),ft(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=Ll,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:He(),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[$e]=t,o[et]=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[$e]=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[$e]=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[$e]=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[$e]=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[et]=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=Gt));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[$e]=e,t[et]=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&&st(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[ot]||o[$e]||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[$e]=e,ft(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[$e]=e,ft(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)&&(Ql=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}},Il=typeof WeakMap==`function`?WeakMap:Map,J=0,Ll=null,Y=null,X=0,Rl=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Z=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,Q=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 J&2&&X!==0?X&-X:I.T===null?Xe():ud()}function fu(){if(ql===0){if(!(X&536870912)||Di){var e=Ie;Ie<<=1,!(Ie&3932160)&&(Ie=262144),ql=e}else ql=536870912}return e=Xa.current,e!==null&&(e.flags|=32),ql}function pu(e,t,n){(e===Ll&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,X,ql,!1)),We(e,n),(!(J&2)||e!==Ll)&&(e===Ll&&(!(J&2)&&(Z|=n),Wl===4&&_u(e,X,ql,!1)),nd(e))}function mu(e,t,n){if(J&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Be(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,Z|=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=Ql+300-be(),10<a)){if(_u(r,t,ql,!Bl),ze(r,0,!0)!==0)break a;au=t,r.timeoutHandle=qd(hu.bind(null,r,n,Xl,eu,Zl,t,ql,Z,Jl,Bl,o,`Throttled`,-0,0),a);break a}hu(r,n,Xl,eu,Zl,t,ql,Z,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:Gt},kl(t,a,d);var m=(a&62914560)===a?Ql-be():(a&4194048)===a?Q-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&=~Z,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 J&6?!0:(rd(0,!1),!1)}function yu(){if(Y!==null){if(Rl===0)var e=Y.return;else e=Y,Bi=zi=null,wo(e),Ta=null,Ea=0,e=Y;for(;e!==null;)Lc(e.alternate,e),e=e.return;Y=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(),Ll=e,Y=n=ni(e.current,null),X=t,Rl=0,zl=null,Bl=!1,Vl=Be(e,t),Hl=!1,Jl=ql=Kl=Z=Gl=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,Y===null&&(Wl=1,Ks(e,ui(t,e.current)))}function Su(){var e=Xa.current;return e===null?!0:(X&4194048)===X?Za===null:(X&62914560)===X||X&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||(X&4194048)!==X&&Xa.current!==null||(Vl=!0),!(Gl&134217727)&&!(Z&134217727)||Ll===null||_u(Ll,X,ql,!1)}function Eu(e,t,n){var r=J;J|=2;var i=Cu(),a=wu();(Ll!==e||X!==t)&&(eu=null,bu(e,t)),t=!1;var o=Wl;a:do try{if(Rl!==0&&Y!==null){var s=Y,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,J=r,I.H=i,I.A=a,Y===null&&(Ll=null,X=0,Kr()),o}function Du(){for(;Y!==null;)Au(Y)}function Ou(e,t){var n=J;J|=2;var r=Cu(),a=wu();Ll!==e||X!==t?(eu=null,$l=be()+500,bu(e,t)):Vl=Be(e,t);a:do try{if(Rl!==0&&Y!==null){t=Y;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||Ll!==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(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Gf(s):c.stateNode.complete){Rl=0,zl=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=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,J=n,Y===null?(Ll=null,X=0,Kr(),Wl):0}function ku(){for(;Y!==null&&!ve();)Au(Y)}function Au(e){var t=Oc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Nu(e):Y=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,X);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:wo(t);default:Lc(n,t),t=Y=ri(t,Ul),t=Oc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Y=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,X)){Wl=1,Ks(e,ui(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;Wl=1,Ks(e,ui(n,e.current)),Y=null;return}t.flags&32768?(Di||r===1?e=!0:Vl||X&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){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=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,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);Wl=6,Y=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(J&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===Ll&&(Y=Ll=null,X=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=J,J|=4;try{nl(e,t,n)}finally{J=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=J;J|=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{J=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=J;J|=4;try{rl(e,t.alternate,t)}finally{J=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),Ye(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=Ye(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,J&6)throw Error(i(331));var c=J;if(J|=4,Ml(o.current),wl(o,o.current,s,n),J=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 Il;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,Ll===e&&(X&n)===n&&(Wl===4||Wl===3&&(X&62914560)===X&&300>be()-Ql?!(J&2)&&bu(e,0):Kl|=n,Jl===X&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=He()),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=X,a=ze(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(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]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=X,n=ze(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)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Ye(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=X;return r=ze(e,e===Ll?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(){J&6?ge(Se,id):ad()})}function ud(){if(td===0){var e=aa;e===0&&(e=W,W<<=1,!(W&261888)&&(W=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Wt(``+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[et]||null).action),o=r.submitter;o&&(t=(t=o[et]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new pn(`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`),gt(`onMouseEnter`,[`mouseout`,`mouseover`]),gt(`onMouseLeave`,[`mouseout`,`mouseover`]),gt(`onPointerEnter`,[`pointerout`,`pointerover`]),gt(`onPointerLeave`,[`pointerout`,`pointerover`]),ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ht(`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[nt];n===void 0&&(n=t[nt]=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,pt.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,!tn||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=ct(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}Qt(function(){var r=a,i=qt(n),s=[];a:{var c=zr.get(e);if(c!==void 0){var l=pn,u=e;switch(e){case`keypress`:if(cn(n)===0)break a;case`keydown`:case`keyup`:l=jn;break;case`focusin`:u=`focus`,l=Sn;break;case`focusout`:u=`blur`,l=Sn;break;case`beforeblur`:case`afterblur`:l=Sn;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=bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Nn;break;case Mr:case Nr:case Pr:l=Cn;break;case Rr:l=Pn;break;case`scroll`:case`scrollend`:l=hn;break;case`wheel`:l=Fn;break;case`copy`:case`cut`:case`paste`:l=wn;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=$t(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!==Kt&&(u=n.relatedTarget||n.fromElement)&&(ct(u)||u[tt]))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?ct(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=bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Mn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ut(l),h=u==null?c:ut(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ct(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?ut(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&&Vt(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&&Pt(c,`number`,c.value)}switch(y=r?ut(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=sn()):(rn=i,an=`value`in rn?rn.value:rn.textContent,Kn=!0)),y=Ed(r,x),0<y.length&&(x=new Tn(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 Tn(`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=$t(e,n),i!=null&&r.unshift(Td(e,i,a)),i=$t(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=$t(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=$t(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`:St(e,`class`,r);break;case`tabIndex`:St(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:St(e,n,r);break;case`style`:K(e,r,o);break;case`data`:if(t!==`object`){St(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=Wt(``+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=Wt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Gt);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=Wt(``+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),xt(e,`popover`,r);break;case`xlinkActuate`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:xt(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=Ht.get(n)||n,xt(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:K(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=Gt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!mt.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[et]||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,``):xt(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)}}Nt(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&&Ft(e,!!r,n,!0):Ft(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)}Lt(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(Vt(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)}}Mt(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?Ft(e,!!n,n?[]:``,!1):Ft(e,!!n,t,!0)):Ft(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)}It(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(Vt(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[ot]||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),st(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[ot])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]);st(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=lt(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=jt(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),ft(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="`+jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+jt(n.imageSizes)+`"]`)):i+=`[href="`+jt(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),ft(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="`+jt(r)+`"][href="`+jt(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),ft(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=dt(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`);ft(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=dt(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`),ft(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=dt(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`),ft(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=dt(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=dt(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=dt(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="`+jt(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),ft(t),e.head.appendChild(t))}function Ff(e){return`[src="`+jt(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~="`+jt(n.href)+`"]`);if(r)return t.instance=r,ft(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`),ft(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,ft(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),ft(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,ft(a),a):(r=n,(a=hf.get(o))&&(r=h({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ft(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[ot]||a[$e]||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,ft(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),ft(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=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(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=Je(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=lt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(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),!(J&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=qt(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=ct(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=lt(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=ct(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,Ze(e.priority,function(){sp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ze(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);Kt=r,n.target.dispatchEvent(r),Kt=null}else return t=lt(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=lt(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[et]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[et]||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[tt]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xe();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[tt]=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=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})),W=o(((e,t)=>{t.exports=Fe()}))(),Ie={reporting:`Reporting`,catching_up:`Catching up`,not_reporting:`Not reporting`,ended:`Stream ended`,unknown:`Unknown`,not_applicable:`No sandbox recording`,gaps_detected:`Gaps detected`,no_known_gaps:`No gaps reported`};function Le({health:e}){let[t,n]=(0,_.useState)(()=>Date.now());(0,_.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),5e3);return()=>clearInterval(e)},[]);let r=(e?.live===`reporting`||e?.live===`catching_up`)&&e.lastHeartbeatAt&&t-e.lastHeartbeatAt>15e3?`not_reporting`:e?.live??`unknown`,i=e?.issues.find(e=>e.reason===`collector_disconnected`);return(0,W.jsxs)(`div`,{className:`capture-health`,role:`status`,"aria-live":`polite`,children:[(0,W.jsxs)(`strong`,{children:[`Recording: `,Ie[e?.history??`unknown`]]}),` · `,(0,W.jsxs)(`span`,{children:[`Now: `,Ie[r]]}),(0,W.jsx)(`small`,{children:` Selected recorded events; completeness is not certified.`}),i&&(0,W.jsxs)(`p`,{children:[`Recorder disconnected at `,new Date(i.at).toLocaleTimeString(),` during this run. Commands may be missing from the recording.`]}),e?.capabilities&&(!e.capabilities.files||!e.capabilities.network)&&(0,W.jsx)(`small`,{children:` File or network recording is unavailable for part of this capture.`}),!!e?.issues.length&&(0,W.jsxs)(`details`,{children:[(0,W.jsxs)(`summary`,{children:[`Recording issues (`,e.issues.length,`)`]}),(0,W.jsx)(`ul`,{children:e.issues.map((e,t)=>(0,W.jsxs)(`li`,{children:[e.reason,` · `,new Date(e.at).toLocaleString()]},t))})]})]})}var Re={};function ze(e,t){let n=_.useRef(Re);return n.current===Re&&(n.current=e(t)),n}function Be(){}var Ve=Object.freeze([]),He=Object.freeze({});function Ue(e){_.useEffect(e,Ve)}var We=0,Ge=class e{static create(){return new e}currentId=We;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=We,t()},e)}isStarted(){return this.currentId!==We}clear=()=>{this.currentId!==We&&(clearTimeout(this.currentId),this.currentId=We)};disposeEffect=()=>this.clear};function Ke(){let e=ze(Ge.create).current;return Ue(e.disposeEffect),e}var G=typeof document<`u`?_.useLayoutEffect:()=>{};function qe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Je,platform:Ye,maxTouchPoints:Xe}=qe(),Ze=Je.toLowerCase(),Qe=Ye.toLowerCase(),$e=/^i(os$|p)/.test(Qe)||Qe===`macintel`&&Xe>1,et=`android`,tt=Qe===et||Ze.includes(et),nt=!$e&&Qe.startsWith(`mac`);Qe.startsWith(`win`),!tt&&/^(linux|chrome os)/.test(Qe);var rt=nt||$e,it=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!it&&Ze.includes(`firefox`),!it&&Ze.includes(`chrom`);var at=rt,ot=/jsdom|happydom/.test(Ze);function st(e){e.preventDefault(),e.stopPropagation()}function ct(e){return`nativeEvent`in e}function lt(e){return e.pointerType===``&&e.isTrusted?!0:tt&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ut(e){return ot?!1:!tt&&e.width===0&&e.height===0||tt&&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 dt(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ft(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function pt(){return typeof window<`u`}function mt(e){return _t(e)?(e.nodeName||``).toLowerCase():`#document`}function ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){return((_t(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _t(e){return pt()?e instanceof Node||e instanceof ht(e).Node:!1}function vt(e){return pt()?e instanceof Element||e instanceof ht(e).Element:!1}function yt(e){return pt()?e instanceof HTMLElement||e instanceof ht(e).HTMLElement:!1}function bt(e){return!pt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ht(e).ShadowRoot}function xt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function St(e){return/^(table|td|th)$/.test(mt(e))}function Ct(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var wt=/transform|translate|scale|rotate|perspective|filter/,Tt=/paint|layout|strict|content/,Et=e=>!!e&&e!==`none`,Dt;function Ot(e){let t=vt(e)?Mt(e):e;return Et(t.transform)||Et(t.translate)||Et(t.scale)||Et(t.rotate)||Et(t.perspective)||!At()&&(Et(t.backdropFilter)||Et(t.filter))||wt.test(t.willChange||``)||Tt.test(t.contain||``)}function kt(e){let t=Pt(e);for(;yt(t)&&!jt(t);){if(Ot(t))return t;if(Ct(t))return null;t=Pt(t)}return null}function At(){return Dt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Dt}function jt(e){return/^(html|body|#document)$/.test(mt(e))}function Mt(e){return ht(e).getComputedStyle(e)}function Nt(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pt(e){if(mt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||bt(e)&&e.host||gt(e);return bt(t)?t.host:t}function Ft(e){let t=Pt(e);return jt(t)?(e.ownerDocument||e).body:yt(t)&&xt(t)?t:Ft(t)}function It(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ft(e),i=r===e.ownerDocument?.body,a=ht(r);if(i){let e=Lt(a);return t.concat(a,a.visualViewport||[],xt(r)?r:[],e&&n?It(e):[])}return t.concat(r,It(r,[],n))}function Lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Rt=`data-base-ui-focusable`,zt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Bt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function K(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&bt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Vt(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ht(e,t){if(!vt(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(K(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ut(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 Wt(e){return e.matches(`html,body`)}function Gt(e){return yt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Kt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${zt}`)!=null}function qt(e){return e?e.getAttribute(`role`)===`combobox`&&Gt(e):!1}function Jt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Yt(e,t){return t!=null&&!dt(t)?0:typeof e==`function`?e():e}function Xt(e,t,n){let r=Yt(e,n);return typeof r==`number`?r:r?.[t]}function Zt(e){return typeof e==`function`?e():e}function Qt(e,t){return t||e===`click`||e===`mousedown`}function $t(e){return e?.includes(`mouse`)&&e!==`mousedown`}var en=`none`,tn=`trigger-press`,nn=`trigger-hover`,rn=`outside-press`,an=`close-press`,on=`focus-out`,sn=`escape-key`,cn=`imperative-action`;function ln(e,t,n,r){let i=!1,a=!1,o=r??He;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}}function un(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function dn(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function fn(e,t,n,r){let i=ze(mn).current;return hn(i,e,t,n,r)&&_n(i,[e,t,n,r]),i.callback}function pn(e){let t=ze(mn).current;return gn(t,e)&&_n(t,e),t.callback}function mn(){return{callback:null,cleanup:null,refs:[]}}function hn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function gn(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function _n(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 vn(e){let t=ze(yn,e).current;return t.next=e,G(t.effect),t}function yn(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var bn={..._},xn=bn.useInsertionEffect,Sn=xn&&xn!==bn.useLayoutEffect?xn:e=>e();function Cn(e){let t=ze(wn).current;return t.next=e,Sn(t.effect),t.trampoline}function wn(){let e={next:void 0,callback:Tn,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Tn(){}var En=null;globalThis.requestAnimationFrame;var Dn=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)}},On=class e{static create(){return new e}static request(e){return Dn.request(e)}static cancel(e){return Dn.cancel(e)}currentId=En;request(e){this.cancel(),this.currentId=Dn.request(()=>{this.currentId=En,e()})}cancel=()=>{this.currentId!==En&&(Dn.cancel(this.currentId),this.currentId=En)};disposeEffect=()=>this.cancel};function kn(){let e=ze(On.create).current;return Ue(e.disposeEffect),e}function An(e){return e?.ownerDocument||document}var jn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Mn={...jn,position:`fixed`,top:0,left:0};({...jn});var Nn=_.forwardRef(function(e,t){let[n,r]=_.useState();G(()=>{at&&it&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,W.jsx)(`span`,{...e,ref:t,style:Mn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Pn=Math.min,Fn=Math.max,In=Math.round,Ln=Math.floor,Rn=e=>({x:e,y:e}),zn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Bn(e,t,n){return Fn(e,Pn(t,n))}function Vn(e,t){return typeof e==`function`?e(t):e}function Hn(e){return e.split(`-`)[0]}function Un(e){return e.split(`-`)[1]}function Wn(e){return e===`x`?`y`:`x`}function Gn(e){return e===`y`?`height`:`width`}function Kn(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function qn(e){return Wn(Kn(e))}function Jn(e,t,n){n===void 0&&(n=!1);let r=Un(e),i=qn(e),a=Gn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=rr(o)),[o,rr(o)]}function Yn(e){let t=rr(e);return[Xn(e),t,Xn(t)]}function Xn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Zn=[`left`,`right`],Qn=[`right`,`left`],$n=[`top`,`bottom`],er=[`bottom`,`top`];function tr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Qn:Zn:t?Zn:Qn;case`left`:case`right`:return t?$n:er;default:return[]}}function nr(e,t,n,r){let i=Un(e),a=tr(Hn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Xn)))),a}function rr(e){let t=Hn(e);return zn[t]+e.slice(t.length)}function ir(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ar(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ir(e)}function or(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 sr(e){return e.visibility===`hidden`||e.visibility===`collapse`}function cr(e,t=e?Mt(e):null){return!e||!e.isConnected||!t||sr(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var lr=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ur(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return bt(n)?n.host:null}function dr(e){for(let t of Array.from(e.children))if(mt(t)===`summary`)return t;return null}function fr(e,t){let n=dr(t);return!!n&&(e===n||K(n,e))}function pr(e){let t=e?mt(e):``;return e!=null&&e.matches(lr)&&(t!==`summary`||e.parentElement!=null&&mt(e.parentElement)===`details`&&dr(e.parentElement)===e)&&(t!==`details`||dr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function mr(e){if(!pr(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ur(t)){let n=t!==e,r=mt(t)===`slot`;if(t.hasAttribute(`inert`)||n&&mt(t)===`details`&&!t.open&&!fr(e,t)||t.hasAttribute(`hidden`)||!r&&!hr(t,n))return!1}return!0}function hr(e,t){let n=Mt(e);return t?n.display!==`none`:cr(e,n)}function gr(e){let t=e.tabIndex;if(t<0){let t=mt(e);if(t===`details`||t===`audio`||t===`video`||yt(e)&&e.isContentEditable)return 0}return t}function _r(e){if(mt(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function vr(e,t){let n=_r(e);if(!n)return!0;let r=t.find(e=>{let t=_r(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=_r(e);return t?.name===n.name&&t.form===n.form})===n}function yr(e){if(yt(e)&&mt(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return yt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function br(e,t){yr(e).forEach(e=>{pr(e)&&t.push(e),br(e,t)})}function xr(e,t,n){yr(e).forEach(e=>{yt(e)&&e.matches(t)&&n.push(e),xr(e,t,n)})}function Sr(e){return mr(e)&&gr(e)>=0}function Cr(e){let t=[];return br(e,t),t.filter(mr)}function wr(e){let t=Cr(e);return t.filter(e=>gr(e)>=0&&vr(e,t))}function Tr(e,t){let n=wr(e),r=n.length;if(r===0)return;let i=Bt(An(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Er(e){return Tr(An(e).body,1)||e}function Dr(e){return Tr(An(e).body,-1)||e}function Or(e,t){if(!e)return null;let n=wr(An(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 kr(e){return Or(e,1)}function Ar(e){return Or(e,-1)}function jr(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!K(n,r)}function Mr(e){wr(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Nr(e){let t=[];xr(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 Pr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Pr(e,t.id,n)])}function Fr(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 Ir(e){return`data-base-ui-${e}`}var Lr=0;function Rr(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Lr);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Be;let o=requestAnimationFrame(a);return Lr=o,()=>{Lr===o&&(cancelAnimationFrame(o),Lr=0)}}var zr={inert:new WeakMap,"aria-hidden":new WeakMap},Br=`data-base-ui-inert`,Vr={inert:new WeakSet,"aria-hidden":new WeakSet},Hr=new WeakMap,Ur=0;function Wr(e){return Vr[e]}function Gr(e){return e?bt(e)?e.host:Gr(e.parentNode):null}var Kr=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Gr(t);return e.contains(n)?n:null}).filter(e=>e!=null),qr=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Jr=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{mt(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Yr(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Kr(t,e),l=i?Jr(t,qr(c),new Set(c)):[],u=[],d=[];if(a){let e=zr[a],n=Wr(a);s=n,o=e;let r=Kr(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Jr(t,qr(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=(Hr.get(e)||0)+1;Hr.set(e,t),d.push(e),t===1&&e.setAttribute(Br,``)}),Ur+=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=(Hr.get(e)||0)-1;Hr.set(e,t),t||e.removeAttribute(Br)}),--Ur,Ur||(zr.inert=new WeakMap,zr[`aria-hidden`]=new WeakMap,Vr.inert=new WeakSet,Vr[`aria-hidden`]=new WeakSet,Hr=new WeakMap)}}function Xr(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=An(e[0]).body;return Yr(e,a,n,r,{mark:i})}var Zr=0;function Qr(e,t=`mui`){let[n,r]=_.useState(e),i=e||n;return _.useEffect(()=>{n??(Zr+=1,r(`${t}-${Zr}`))},[n,t]),i}var $r=bn.useId;function ei(e,t){if($r!==void 0){let n=$r();return e??(t?`${t}-${n}`:n)}return Qr(e,t)}function ti(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 ni=ti(`https://base-ui.com/production-error`,`Base UI`),ri=19;function ii(e){return ri>=e}function ai(e){if(!_.isValidElement(e))return null;let t=e,n=t.props;return(ii(19)?n?.ref:t.ref)??null}function oi(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function si(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 ci(e,t){return typeof e==`function`?e(t):e}function li(e,t){return typeof e==`function`?e(t):e}var ui={};function di(e,t,n,r,i){if(!n&&!r&&!i&&!e)return pi(t);let a=pi(e);return t&&(a=mi(a,t)),n&&(a=mi(a,n)),r&&(a=mi(a,r)),i&&(a=mi(a,i)),a}function fi(e){if(e.length===0)return ui;if(e.length===1)return pi(e[0]);let t=pi(e[0]);for(let n=1;n<e.length;n+=1)t=mi(t,e[n]);return t}function pi(e){return vi(e)?{...yi(e,ui)}:hi(e)}function mi(e,t){return vi(t)?yi(t,e):gi(e,t)}function hi(e){let t={...e};for(let e in t){let n=t[e];_i(e,n)&&(t[e]=xi(n))}return t}function gi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=oi(e.style,r);break;case`className`:e[n]=Ci(e.className,r);break;default:e[n]=_i(n,r)?bi(e[n],r):r}}return e}function _i(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 vi(e){return typeof e==`function`}function yi(e,t){return vi(e)?e(t):e??ui}function bi(e,t){return t?e?(...n)=>{let r=n[0];if(wi(r)){let i=r;Si(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:xi(t):e}function xi(e){return e&&((...t)=>{let n=t[0];return wi(n)&&Si(n),e(...t)})}function Si(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ci(e,t){return t?e?t+` `+e:t:e}function wi(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Ti(e,t,n={}){let r=t.render,i=Ei(t,n);return n.enabled===!1?null:ki(e,r,i,n.state??He)}function Ei(e,t={}){let{className:n,style:r,render:i}=e,{state:a=He,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ci(n,a):void 0,d=l?li(r,a):void 0,f=l?si(a,c):He,p=l&&s?Di(s):void 0,m=l?oi(f,p)??{}:He;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?pn([m.ref,ai(i),...o]):fn(m.ref,ai(i),o):fn(null,null)),l?(u!==void 0&&(m.className=Ci(m.className,u)),d!==void 0&&(m.style=oi(m.style,d)),m):He}function Di(e){return Array.isArray(e)?fi(e):di(void 0,e)}var Oi=Symbol.for(`react.lazy`);function ki(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=di(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Oi&&(i=_.Children.toArray(t)[0]),_.cloneElement(i,e)}if(e&&typeof e==`string`)return Ai(e,n);throw Error(ni(8))}function Ai(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 ji={style:{transition:`none`}},Mi=`data-base-ui-click-trigger`,Ni={fallbackAxisSide:`end`},Pi={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Fi=c(m(),1),Ii=_.createContext(null),Li=()=>_.useContext(Ii),Ri=Ir(`portal`);function zi(e={}){let{ref:t,container:n,componentProps:r=He,elementProps:i}=e,a=ei(),o=Li()?.portalNode,[s,c]=_.useState(null),[l,u]=_.useState(null),d=Cn(e=>{e!==null&&u(e)}),f=_.useRef(null);G(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(_t(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=Ti(`div`,r,{ref:[t,d],props:[{id:a,[Ri]:``},i]}),m=s&&p?Fi.createPortal(p,s):null;return{node:l,nodeId:_.isValidElement(p)?p.props.id:void 0,subtree:m}}var Bi=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=zi({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&&jr(e)&&(e.type===`focusin`?v.current&&=(Nr(c),!1):(Mr(c),v.current=!0))}return dn(un(c,`focusin`,e,!0),un(c,`focusout`,e,!0))},[c,y]),G(()=>{c&&b===!0&&v.current&&(Nr(c),v.current=!1)},[b,c]);let S=_.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,W.jsxs)(_.Fragment,{children:[u,(0,W.jsxs)(Ii.Provider,{value:S,children:[x&&c&&(0,W.jsx)(Nn,{"data-type":`outside`,ref:d,onFocus:e=>{jr(e,c)?p.current?.focus():Dr(h?h.domReference:null)?.focus()}}),x&&c&&(0,W.jsx)(`span`,{"aria-owns":l,style:Pi}),c&&Fi.createPortal(a,c),x&&c&&(0,W.jsx)(Nn,{"data-type":`outside`,ref:f,onFocus:e=>{jr(e,c)?m.current?.focus():(Er(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ln(`focus-out`,e.nativeEvent)))}})]})]})});function Vi(){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 Hi=class{nodesRef={current:[]};events=Vi();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)}},Ui=_.createContext(null),Wi=_.createContext(null),Gi=()=>_.useContext(Ui)?.id||null,Ki=e=>{let t=_.useContext(Wi);return e??t};function qi(e){let t=ei(),n=Ki(e),r=Gi();return G(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Ji(e){let{children:t,id:n}=e,r=Gi();return(0,W.jsx)(Ui.Provider,{value:_.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Yi(e){let{children:t,externalTree:n}=e,r=ze(()=>n??new Hi).current;return(0,W.jsx)(Wi.Provider,{value:r,children:t})}function Xi(e){return e==null?e:`current`in e?e.current:e}function Zi(e,t){let n=ht(Vt(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 Qi=20,$i=[];function ea(){$i=$i.filter(e=>e.deref()?.isConnected)}function ta(e){ea(),e&&mt(e)!==`body`&&($i.push(new WeakRef(e)),$i.length>Qi&&($i=$i.slice(-20)))}function na(){return ea(),$i[$i.length-1]?.deref()}function ra(e){return e?Sr(e)?e:wr(e)[0]||e:null}function ia(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Cr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Sr(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 aa(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=Cn(()=>x.current.floatingContext?.nodeId),C=i===!1,w=qt(v)&&C,T=vn(i),E=vn(a),D=vn(l),O=vn(g),k=Ki(p),A=Li(),j=_.useRef(!1),M=_.useRef(!1),N=_.useRef(!1),P=_.useRef(null),F=_.useRef(``),I=_.useRef(``),L=_.useRef(null),R=_.useRef(null),z=fn(L,f,A?.beforeInsideRef),ee=fn(R,A?.afterInsideRef),B=Ke(),V=Ke(),H=kn(),te=A!=null,U=Jt(y),ne=Cn((e=U)=>e?wr(e):[]),re=Cn(()=>m?.().filter(e=>e!=null)??[]);_.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&K(U,Bt(An(U)))&&ne().length===0&&!w&&st(e)}return un(An(U),`keydown`,e)},[r,U,s,w,ne]),_.useEffect(()=>{if(r||!g)return;let e=An(U);function t(){N.current=!1}function n(e){let t=Vt(e),n=re(),r=K(y,t)||K(v,t)||K(A?.portalNode,t)||n.some(e=>e===t||K(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 dn(un(e,`pointerdown`,n,!0),un(e,`pointerup`,t,!0),un(e,`pointercancel`,t,!0),un(e,`keydown`,i,!0),t)},[r,y,v,U,g,A,V,re]),_.useEffect(()=>{if(r||!c)return;let e=An(U);function t(){M.current=!0,V.start(0,()=>{M.current=!1})}function n(e){let t=Vt(e);Sr(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Vt(t);s&&n==null&&i!=null&&K(y,i)&&ta(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=re(),f=n?.hasAttribute(Ir(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Xi(d),Xi(u)].includes(n),p=!(K(v,n)||K(y,n)||K(n,y)||K(A?.portalNode,n)||l.some(e=>e===n||K(e,n))||c.hasMatchingElement(e=>K(e,n))||f||k&&(Pr(k.nodesRef.current,a).find(e=>K(e.context?.elements.floating,n)||K(e.context?.elements.domReference,n))||Fr(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Jt(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&U&&ia(U),o&&r!==v&&!cr(i)&&Bt(e)===e.body){if(yt(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;yt(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==na())&&(j.current=!0,h.setOpen(!1,ln(on,t)))})}function a(){N.current||(x.current.insideReactTree=!0,B.start(0,()=>{x.current.insideReactTree=!1}))}let l=yt(v)?v:null;if(y||l)return dn(l&&un(l,`focusout`,i),l&&un(l,`pointerdown`,t),y&&un(y,`focusin`,n),y&&un(y,`focusout`,i),y&&A&&un(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(`[${Ir(`portal`)}]`)||[]),t=(k?Fr(k.nodesRef.current,S()):[]).find(e=>qt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Xr([y,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...re(),t,Xi(d),Xi(u),w?v:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=Xr([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,v,y,s,A,w,k,S,u,d,re]),G(()=>{if(!g||r||!yt(U))return;F.current=``,I.current=``;let e=An(U),t=Bt(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||K(U,t))return;let i=null,a=()=>(i??=ne(U),i[0]||U),o;o=r===!0||r===null?a():Xi(r),o||=a();let s=K(U,Bt(e));Rr(o,{preventScroll:o===U,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Bt(e);return!(t!==o&&K(U,t))}})})},[r,g,U,ne,T,D,O]),G(()=>{if(r||!U)return;let e=An(U),t=Bt(e),n=D.current==null;ta(t);function i(e){if(e.open||(F.current=Zi(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(lt(e.nativeEvent)||ut(e.nativeEvent))j.current=!1;else{let e=!1;An(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&&mt(t)!==`body`?t:null,s=n?o||a:a||o;return s||=na()||null,typeof i==`boolean`?s:Xi(i)||s||null}return()=>{b.off(`openchange`,i);let t=Bt(e),n=re(),r=K(y,t)||n.some(e=>e===t||K(e,t))||k&&Pr(k.nodesRef.current,S(),!1).some(e=>K(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=ra(c),i=typeof o!=`boolean`;if(o&&!j.current&&yt(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]),G(()=>{if(!it||g||!y)return;let e=Bt(An(y));yt(e)&&Gt(e)&&K(y,e)&&e.blur()},[g,y]),G(()=>{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]),G(()=>{if(!r&&U)return ia(U),()=>{queueMicrotask(ea)}},[r,U]);let ie=!r&&(!s||!w)&&(te||s);return(0,W.jsxs)(_.Fragment,{children:[ie&&(0,W.jsx)(Nn,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=ne();Rr(e[e.length-1])}else A?.portalNode&&(j.current=!1,jr(e,A.portalNode)?Er(v)?.focus():Xi(d??A.beforeOutsideRef)?.focus())}}),n,ie&&(0,W.jsx)(Nn,{"data-type":`inside`,ref:ee,onFocus:e=>{s?Rr(ne()[0]):A?.portalNode&&(c&&(j.current=!0),jr(e,A.portalNode)?Dr(v)?.focus():Xi(u??A.afterOutsideRef)?.focus())}})]})}function oa(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=tn}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=_.useRef(void 0),f=kn(),p=Ke(),m=_.useMemo(()=>{function e(e,t,n,r){let i=ln(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=dt(e.pointerType,!0)&&ut(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||dt(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Vt(o);if(Gt(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}dt(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}:He,[n,m])}function sa(){return!1}function ca(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function la(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=sa,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=Ki(c),m=Cn(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,v=Cn(()=>a),{escapeKey:y,outsidePress:b}=ca(s),x=_.useRef(!1),S=_.useRef(!1),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(``),E=_.useRef(null),D=Ke(),O=Ke(),k=Cn(()=>{O.clear(),f.current.insideReactTree=!1}),A=Cn(e=>{let t=f.current.floatingContext?.nodeId;return(p?Pr(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=Cn(e=>Ut(e,l.select(`floatingElement`))||Ut(e,l.select(`domReferenceElement`))),M=Cn(e=>{o()&&l.setOpen(!1,ln(tn,e.nativeEvent))}),N=Cn(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=ln(sn,ct(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=Cn(()=>{f.current.insideReactTree=!0,O.start(0,k)}),F=Cn(e=>{if(!u||!n||e.button!==0)return;let t=Vt(e.nativeEvent);K(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=Cn(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 Ge,t=new Ge;function i(){e.clear(),w.current=!0}function a(){e.start(it?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&&Pr(p.nodesRef.current,t).some(t=>Ut(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=Vt(e),r=`[${Ir(`inert`)}]`,i=vt(n)?n.getRootNode():null,a=Array.from((bt(i)?i:An(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>K(e,n))))return;let s=vt(n)?n:null;for(;s&&!jt(s);){let e=Pt(s);if(jt(e)||!vt(e))break;s=e}if(!(a.length&&vt(n)&&!Wt(n)&&!K(n,l.select(`floatingElement`))&&a.every(e=>!K(s,e)))){if(yt(n)&&!(`touches`in e)){let t=jt(n),r=Mt(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,ln(rn,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=Vt(e);if(!n)return;let r=un(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=An(d),te=dn(r&&dn(un(H,`keydown`,N),un(H,`compositionstart`,i),un(H,`compositionend`,a)),g&&dn(un(H,`click`,L,!0),un(H,`pointerdown`,L,!0),un(H,`pointerup`,R,!0),un(H,`pointercancel`,R,!0),un(H,`mousedown`,L,!0),un(H,`mouseup`,R,!0),un(H,`touchstart`,I,!0),un(H,`touchmove`,ee,!0),un(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 ua(e,t,n){let{reference:r,floating:i}=e,a=Kn(t),o=qn(t),s=Gn(o),c=Hn(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=Un(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function da(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}=Vn(t,e),p=ar(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=or(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=or(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 fa=50,pa=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:da},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ua(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<fa&&(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}=ua(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ma=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}=Vn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Hn(r),_=Kn(o),v=Hn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[rr(o)]:Yn(o)),x=p!==`none`;!d&&x&&b.push(...nr(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=Jn(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`||_===Kn(t)||T.every(e=>Kn(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=Kn(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{}}}},ha=new Set([`left`,`top`]);async function ga(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Hn(n),s=Un(n),c=Kn(n)===`y`,l=ha.has(o)?-1:1,u=a&&c?-1:1,d=Vn(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 _a=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 ga(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}}}}},va=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}=Vn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Kn(i),p=Wn(f),m=u[p],h=u[f],g=(e,t)=>Bn(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}}}}}},ya=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}=Vn(e,t),u={x:n,y:r},d=Kn(i),f=Wn(d),p=u[f],m=u[d],h=Vn(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=ha.has(Hn(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}}}},ba=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}=Vn(e,t),c=await i.detectOverflow(t,s),l=Hn(n),u=Un(n),d=Kn(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=Pn(p-c[m],g),y=Pn(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*Fn(c.left,c.right):S=p-2*Fn(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 xa(e){let t=Mt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=yt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=In(n)!==a||In(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Sa(e){return vt(e)?e:e.contextElement}function Ca(e){let t=Sa(e);if(!yt(t))return Rn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=xa(t),o=(a?In(n.width):n.width)/r,s=(a?In(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var wa=Rn(0);function Ta(e){let t=ht(e);return!At()||!t.visualViewport?wa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ea(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ht(e)}function Da(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Sa(e),o=Rn(1);t&&(r?vt(r)&&(o=Ca(r)):o=Ca(e));let s=Ea(a,n,r)?Ta(a):Rn(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=ht(a),t=vt(r)?ht(r):r,n=e,i=Lt(n);for(;i&&t!==n;){let e=Ca(i),t=i.getBoundingClientRect(),r=Mt(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=ht(i),i=Lt(n)}}return or({width:u,height:d,x:c,y:l})}function Oa(e,t){let n=Nt(e).scrollLeft;return t?t.left+n:Da(gt(e)).left+n}function ka(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Oa(e,n),y:n.top+t.scrollTop}}function Aa(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=gt(r),s=t?Ct(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Rn(1),u=Rn(0),d=yt(r);if((d||!a)&&((mt(r)!==`body`||xt(o))&&(c=Nt(r)),d)){let e=Da(r);l=Ca(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ka(o,c):Rn(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 ja(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ma(e){let t=Nt(e),n=e.ownerDocument.body,r=Fn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Oa(e),o=-t.scrollTop;return Mt(n).direction===`rtl`&&(a+=Fn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Na=25;function Pa(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ht(e),a=gt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!At()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Oa(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<=Na&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Fa(e,t){let n=Da(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ca(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ia(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Pa(e,n,t);else if(t===`document`)r=Ma(gt(e));else if(vt(t))r=Fa(t,n);else{let n=Ta(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return or(r)}function La(e,t){let n=t.get(e);if(n)return n;let r=It(e,[],!1).filter(e=>vt(e)&&mt(e)!==`body`),i=null,a=Mt(e).position===`fixed`,o=a?Pt(e):e;for(;vt(o)&&!jt(o);){let e=Mt(o),t=Ot(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Pt(o)}return t.set(e,r),r}function Ra(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ct(t)?[]:La(t,this._c):[].concat(n),r],o=Ia(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=Ia(t,a[e],i);s=Fn(n.top,s),c=Pn(n.right,c),l=Pn(n.bottom,l),u=Fn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function za(e){let{width:t,height:n}=xa(e);return{width:t,height:n}}function Ba(e,t,n){let r=yt(t),i=gt(t),a=n===`fixed`,o=Da(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Rn(0);if((r||!a)&&((mt(t)!==`body`||xt(i))&&(s=Nt(t)),r)){let e=Da(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Oa(i));let l=i&&!r&&!a?ka(i,s):Rn(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 Va(e){return Mt(e).position===`static`}function Ha(e,t){if(!yt(e)||Mt(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function Ua(e,t){let n=ht(e);if(Ct(e))return n;if(!yt(e)){let t=Pt(e);for(;t&&!jt(t);){if(vt(t)&&!Va(t))return t;t=Pt(t)}return n}let r=Ha(e,t);for(;r&&St(r)&&Va(r);)r=Ha(r,t);return r&&jt(r)&&Va(r)&&!Ot(r)?n:r||kt(e)||n}var Wa=async function(e){let t=this.getOffsetParent||Ua,n=this.getDimensions,r=await n(e.floating);return{reference:Ba(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ga(e){return Mt(e).direction===`rtl`}var Ka={convertOffsetParentRelativeRectToViewportRelativeRect:Aa,getDocumentElement:gt,getClippingRect:Ra,getOffsetParent:Ua,getElementRects:Wa,getClientRects:ja,getDimensions:za,getScale:Ca,isElement:vt,isRTL:Ga};function qa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ja(e,t,n){let r=null,i,a=gt(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=Ln(d),h=Ln(a.clientWidth-(u+f)),g=Ln(a.clientHeight-(d+p)),_=Ln(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fn(0,Pn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!qa(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=ht(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ya(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=Sa(e),u=i||a?[...l?It(l):[],...t?It(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ja(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?Da(e):null;c&&g();function g(){let t=Da(e);h&&!qa(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 Xa=_a,Za=va,Qa=ma,$a=ba,eo=ya,to=(e,t,n)=>{let r=new Map,i=n??{},a={...Ka,...i.platform,_c:r};return pa(e,t,{...i,platform:a})},no=typeof document<`u`?_.useLayoutEffect:function(){};function ro(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(!ro(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)&&!ro(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function io(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ao(e,t){let n=io(e);return Math.round(t*n)/n}function q(e){let t=_.useRef(e);return no(()=>{t.current=e}),t}function oo(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);ro(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=q(c),O=q(i),k=q(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),to(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ro(T.current,t)&&(T.current=t,Fi.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);no(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);no(()=>(j.current=!0,()=>{j.current=!1}),[]),no(()=>{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=ao(N.floating,u.x),r=ao(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...io(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 so=(e,t)=>{let n=Xa(e);return{name:n.name,fn:n.fn,options:[e,t]}},co=(e,t)=>{let n=Za(e);return{name:n.name,fn:n.fn,options:[e,t]}},lo=(e,t)=>({fn:eo(e).fn,options:[e,t]}),uo=(e,t)=>{let n=Qa(e);return{name:n.name,fn:n.fn,options:[e,t]}},fo=(e,t)=>{let n=$a(e);return{name:n.name,fn:n.fn,options:[e,t]}},po=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})),mo=o(((e,t)=>{t.exports=po()})),ho=o((e=>{var t=u(),n=mo();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}})),go=o(((e,t)=>{t.exports=ho()})),_o=[],vo=void 0;function yo(){return vo}function bo(e){_o.push(e)}var xo=mo(),So=c(go(),1),Co=ii(19)?Eo:Do;function wo(e,t,n,r,i){return Co(e,t,n,r,i)}function To(e,t,n,r,i){let a=_.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,xo.useSyncExternalStore)(e.subscribe,a,a)}bo({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,xo.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Eo(e,t,n,r,i){let a=yo();if(!a)return To(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 Do(e,t,n,r,i){return(0,So.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Oo=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 wo(this,e,t,n,r)}},ko=class extends Oo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){_.useDebugValue(e);let n=this;G(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;G(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;G(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){_.useDebugValue(e);let n=this,r=t!==void 0;G(()=>{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),wo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){_.useDebugValue(e);let n=Cn(t??Be);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)}})}},Ao={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},jo=class extends ko{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:Vi(),nested:n,triggerElements:i},Ao),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ft(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 Mo(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 jo({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),G(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};vt(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 No(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),G(()=>{if(!e&&a&&r!==`ending`&&n){let e=On.request(()=>{i(`ending`)});return()=>{On.cancel(e)}}},[e,a,r,n]),G(()=>{if(!e||t)return;let n=On.request(()=>{i(void 0)});return()=>{On.cancel(n)}},[t,e]),G(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=On.request(()=>{i(`idle`)});return()=>{On.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Po(e,t=!1){let n=kn();return Cn((r,i=null)=>{n.cancel();let a=Xi(e);if(a==null)return;let o=a,s=()=>{Fi.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 Fo(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Cn(i),o=Po(r,n);_.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Io={tabIndex:-1,[Rt]:``};function Lo(e){return t=>t!==`touch`||e.current}function Ro(e,t=!1){let n=ei(),r=Gi()!=null,i=ze(()=>e(n,r)).current;return Mo({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function zo({handle:e,store:t}){return G(()=>e.attachStore(t),[e,t]),null}function Bo(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 Vo(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 Ho(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Uo(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Bo(e,n),o=Cn(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 G(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Wo(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=_.useRef(null),i=e.useState(`open`);G(()=>{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=ln(en);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 Go(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=No(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Cn(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Fo({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Ko(e,t){e.useSyncedValues(t),G(()=>()=>{e.update({activeTriggerProps:He,inactiveTriggerProps:He,popupProps:He})},[e])}function qo(e,t){G(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),G(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Jo=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 Yo(){return new jo({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Jo,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Xo(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Yo(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:He,inactiveTriggerProps:He,popupProps:He}}function Zo(e,t,n=!1){return new jo({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var Qo=e=>e.triggerIdProp??e.activeTriggerId,$o=e=>e.openProp??e.open,es=e=>(e.popupElement?.id??e.floatingId)||void 0;function ts(e,t){return t!==void 0&&$o(e)&&Qo(e)===t}function ns(e,t){return ts(e,t)?!0:t!==void 0&&$o(e)&&Qo(e)==null&&e.triggerCount===1}var rs={open:$o,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:Qo,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:es,isTriggerActive:(e,t)=>t!==void 0&&Qo(e)===t,isOpenedByTrigger:(e,t)=>ts(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Qo(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>ns(e,t)?es(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function is(e){let t=_.useCallback(t=>e===void 0?Be:e.subscribeStore(t),[e]),n=_.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,xo.useSyncExternalStore)(t,n,()=>e?.serverStore)}function as(e){return os(e,e.rootContext)}function os(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=Ki(r),v=_.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=oo({...e,elements:{...v,...l&&{reference:l}}}),b=vt(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=vt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=_.useCallback(e=>{(vt(e)||e===null)&&(h.current=e,f(e)),(vt(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!vt(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 G(()=>{o&&(h.current=o)},[o]),G(()=>{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 ss=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 Ge,this.restTimeout=new Ge,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},cs=new WeakMap;function ls(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&cs.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),cs.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function us(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=cs.get(n);a&&a!==e&&ls(a),ls(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,cs.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function ds(e){let t=e.context.dataRef.current,n=ze(()=>t.hoverInteractionState??ss.create()).current;return t.hoverInteractionState||=n,Ue(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function fs(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=Ki(),d=Gi(),f=ds(a),p=Ke(),m=Cn(()=>Qt(l.current.openEvent?.type,f.interactedInside)),h=Cn(()=>$t(l.current.openEvent?.type)),g=Cn(()=>{ls(f)});G(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),_.useEffect(()=>g,[g]),G(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&vt(c)&&s){let e=c,t=s,n=An(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 us(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&&Pr(u.nodesRef.current,d).length>0)}function t(e){let t=Xt(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,ln(nn,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Vt(e);if(!Kt(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(Ht(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&vt(o)&&Pr(u.nodesRef.current,r,!1).some(e=>K(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,ln(nn,t)),u.events.emit(`floating.closed`,t)})}let y=s;return dn(y&&un(y,`mouseenter`,c),y&&un(y,`mouseleave`,_),y&&un(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var ps={current:null};function ms(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ps,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=Ki(l),b=ds(h),x=_.useRef(!1),S=vn(i),C=vn(r),w=vn(o),T=vn(n),E=vn(p),D=vn(f),O=Cn(()=>Qt(g.current.openEvent?.type,b.interactedInside)),k=Cn(()=>E.current?.()!==!1),A=Cn((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!K(e,t);if(!vt(n))return!1;let i=n;return r.hasMatchingElement(e=>K(e,i))&&(!e||!K(e,i))}),j=Cn(()=>{b.handler&&=(An(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=Cn(()=>{ls(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===nn,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=Xt(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,ln(nn,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,ln(nn,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!vt(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!dt(b.pointerType))return;let t=Zt(w.current),n=Xt(C.current,`open`,b.pointerType),r=Vt(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(vt(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(K(e,r)){s=e;break}}vt(i)&&vt(o)&&!h.context.triggerElements.hasElement(i)&&K(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&&vt(s)&&vt(o)&&K(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,ln(nn,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,ln(nn,e,s))}):g&&k()&&h.setOpen(!0,ln(nn,e,s)))}function i(t){if(O()){M();return}j();let n=An(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Ht(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`||!K(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){K(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?un(t,`mouseout`,o):void 0;return s?dn(un(t,`mousemove`,r,{once:!0}),un(t,`mouseenter`,r),un(t,`mouseleave`,i),l):dn(un(t,`mouseenter`,r),un(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&&!dt(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;us(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Zt(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,ln(nn,t,n))}b.pointerType===`touch`?Fi.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var hs=.1,gs=hs*hs,_s=.5;function vs(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function ys(e,t,n,r,i,a,o,s,c,l){let u=!1;return vs(e,t,n,r,i,a)&&(u=!u),vs(e,t,i,a,o,s)&&(u=!u),vs(e,t,o,s,c,l)&&(u=!u),vs(e,t,c,l,n,r)&&(u=!u),u}function bs(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function xs(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 Ss(e={}){let{blockPointerEvents:t=!1}=e,n=new Ge,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*gs;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=Vt(r),g=r.type===`mouseleave`,_=K(u,h),v=K(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&vt(r.relatedTarget)&&K(u,r.relatedTarget))return;function y(){return!!(s&&Pr(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=xs(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=xs(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=xs(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=xs(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!bs(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?_s/2:_s*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+_s+1,o=C||T?S.bottom-_s:S.top,s=C?T?S.bottom-_s:S.top:S.bottom-_s;M=ys(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?_s/2:_s*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-_s,o=C||T?S.top+_s:S.bottom,s=C?T?S.top+_s:S.bottom:S.top+_s;M=ys(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?_s/2:_s*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+_s+1,o=w||E?S.right-_s:S.left,s=w?E?S.right-_s:S.left:S.right-_s;M=ys(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?_s/2:_s*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-_s,o=w||E?S.left+_s:S.right,s=w?E?S.left+_s:S.right:S.left+_s;M=ys(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 Cs=_.createContext(void 0);function ws(e){let t=_.useContext(Cs);if(t===void 0&&!e)throw Error(ni(47));return t}var Ts={...rs,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},Es=class extends ko{constructor(e,t,n){let r=new Jo;super(Ds(e,r,t,n),Os(r),Ts)}setOpen=(e,t)=>{let n=t.reason===nn,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Ho(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};Vo(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Fi.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Ds(e,t,n,r=!1){let i={...Xo(),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=Zo(t,n,r),i}function Os(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),stickIfOpenTimeout:new Ge,triggerElements:e}}function ks({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=js(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),qo(u,d),Wo(u);let{forceUnmount:m}=Go(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,ln(cn))}),[m,u]);let h=d||f;return(0,W.jsxs)(Cs.Provider,{value:u,children:[s&&(0,W.jsx)(zo,{handle:s,store:u}),h&&(0,W.jsx)(Ms,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function As(e){return ws(!0)?(0,W.jsx)(ks,{props:e}):(0,W.jsx)(Yi,{children:(0,W.jsx)(ks,{props:e})})}function js(e,t){let n=Ro((e,n)=>new Es(t,e,n));return _.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Ms({store:e,modal:t}){let n=la(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return Ko(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var Ns=_.createContext(void 0);function Ps(e=!1){let t=_.useContext(Ns);if(t===void 0&&!e)throw Error(ni(16));return t}function Fs(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 Is(e,t,{detail:n=0}={}){e.dispatchEvent(new(ht(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ls(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=_.useRef(null),s=Ps(!0),c=a??s!==void 0,{props:l}=Fs({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=_.useCallback(()=>{let e=o.current;Rs(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return G(u,[u]),{getButtonProps:_.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return di({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Si(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Rs(r),s=!i&&zs(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(),Is(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Is(r,e)))},onKeyUp(e){if(!t){if(Si(e),a?.(e),e.target===e.currentTarget&&i&&c&&Rs(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Is(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Cn(e=>{o.current=e,u()})}}function Rs(e){return yt(e)&&e.tagName===`BUTTON`}function zs(e){return yt(e)&&e.tagName===`A`&&!!e.href}var Bs=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Vs={"data-starting-style":``},Hs={"data-ending-style":``},Us={transitionStatus(e){return e===`starting`?Vs:e===`ending`?Hs:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Bs.startingStyle]=`startingStyle`,e[e.endingStyle=Bs.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var Ws={"data-popup-open":``},Gs={"data-popup-open":``,"data-pressed":``},Ks={"data-open":``},qs={"data-closed":``},Js={"data-anchor-hidden":``},Ys={open(e){return e?Ws:null}},Xs={open(e){return e?Gs:null}},Zs={open(e){return e?Ks:qs},anchorHidden(e){return e?Js:null}},Qs={...Zs,...Us};function $s(e){return ei(e,`base-ui`)}function ec(e,t){let n=_.useRef(null);function r(t){Fi.flushSync(()=>{e.setOpen(!1,ln(on,t.nativeEvent,t.currentTarget))}),Ar(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&jr(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Fi.flushSync(()=>{e.setOpen(!1,ln(on,n.nativeEvent,n.currentTarget))});let i=kr(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&K(r,i);){let e=i;if(i=Er(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function tc(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 nc(e,t){let{onClick:n,onPointerDown:r}=tc(Cn((n,r)=>{(typeof e==`function`?e():e)||t(r||($e?`touch`:``))}));return _.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}var rc=_.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=ws(!0),h=is(s)??m;if(!h)throw Error(ni(74));let g=$s(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}=Uo(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=ms(y,{enabled:!a&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Ss(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=oa(y,{stickIfOpen:E}),j=nc(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=Ls({disabled:a,native:o}),F={open(e){return e&&T===`trigger-press`?Xs.open(e):Ys.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=ec(h,S),z=Ti(`button`,e,{state:{disabled:a,open:b},ref:[P,t,C,S],props:[A.reference,k,M,j,{[Mi]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,N],stateAttributesMapping:F}),ee=(0,W.jsx)(_.Fragment,{children:z},g);return w&&!O?(0,W.jsxs)(_.Fragment,{children:[(0,W.jsx)(Nn,{ref:I,onFocus:L}),ee,(0,W.jsx)(Nn,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):ee}),ic=_.createContext(void 0);function ac(){let e=_.useContext(ic);if(e===void 0)throw Error(ni(45));return e}var oc=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return ws().useState(`mounted`)||n?(0,W.jsx)(ic.Provider,{value:n,children:(0,W.jsx)(Bi,{ref:t,...r})}):null});function sc(e){return ii(19)?e:e?`true`:void 0}var cc=_.createContext(void 0);function lc(){let e=_.useContext(cc);if(!e)throw Error(ni(46));return e}var uc=_.createContext(void 0);function dc(){return _.useContext(uc)?.direction??`ltr`}var fc=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`}=Vn(e,t)||{};if(l==null)return{};let f=ar(u),p={x:n,y:r},m=qn(i),h=Gn(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=Bn(k,j,A),N=!c.arrow&&Un(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}}}),pc=(e,t)=>({...fc(e),options:[e,t]}),mc={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}}}},hc={sideX:`left`,sideY:`top`},gc=`--available-width`,_c=`--available-height`;function vc(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 yc(e,t,n){let{rects:r,placement:i}=e;return{side:vc(t,Hn(i),n),align:Un(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function bc(e){return xc(e,as)}function xc(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=Cn(j),N=j?M:n,P=vn(n),F=vn(g),I=dc()===`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=vn(a),re=vn(s),ie=typeof a==`function`?0:a,ae=typeof s==`function`?0:s,oe=[];p&&oe.push(p),oe.push(so(e=>{let t=yc(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:uo({...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:co({...te,rootBoundary:A,mainAxis:D!==`none`,crossAxis:ce,limiter:u||k?void 0:lo(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=Kn(Hn(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(fo({...te,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(gc,`${t}px`),i.setProperty(_c,`${n}px`);let a=ht(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`)}}),pc(e=>({element:U.current||An(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=Hn(r),l=Kn(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(yc(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),{}}},mc,x),G(()=>{!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)=>Ya(...e,de),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||hc,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[gc]=`100vw`,e[_c]=`100vh`,be||(e.opacity=0),e},[x,we,Se,me,Ce,he,xe,be]),Ee=_.useRef(null);G(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(Sc(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`&&Sc(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 Ya(pe.reference,pe.floating,_e,de)},[m,g,pe,_e,de]);let De=Hn(ve),Oe=vc(i,De,I),ke=Un(ve)||`center`,Ae=!!ge.hide?.referenceHidden;G(()=>{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 Sc(e){return e!=null&&`current`in e}var Cc=_.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,W.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function wc(e){return e===`starting`?ji:He}function Tc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Ti(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},wc(r),i],stateAttributesMapping:Zs})}var Ec={},Dc={},Oc=``;function kc(e,t){return xt(e)?e:t}function Ac(e,t,n){return/hidden|clip/.test(e.getComputedStyle(kc(t,n)).overflowY)}function jc(e){if(typeof document>`u`)return!1;let t=An(e);return ht(t).innerWidth-t.documentElement.clientWidth>0}function Mc(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=An(e),n=t.documentElement,r=t.body,i=kc(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 Nc(e){let t=An(e),n=t.documentElement,r=t.body,i=kc(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 Pc(e){let t=An(e),n=t.documentElement,r=t.body,i=ht(n),a=0,o=0,s=!1,c=On.create();if(it&&(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,Ec={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Oc=n.style.scrollBehavior,Dc={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=kc(n,r);if(s=Mc(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,Ec),Object.assign(r.style,Dc),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Oc)}function d(){u(),c.request(l)}l();let f=un(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Fc=new class{lockCount=0;restore=null;timeoutLock=Ge.create();timeoutUnlock=Ge.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=An(e),n=t.documentElement,r=t.body,i=ht(n);if(Ac(i,n,r)){let t=new i.MutationObserver(()=>{Ac(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=$e||!jc(e);this.restore=a?Nc(e):Pc(e)}};function Ic(e=!0,t=null){G(()=>{if(e)return Fc.acquire(t)},[e,t])}var Lc=20;function Rc(e,t,n,r){let[i,a]=_.useState(!1);G(()=>{if(!e||!t||n==null){a(!1);return}let r=An(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Lc)},[e,t,n]),Ic(e&&(!t||i),r)}var zc=_.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=Ni,...v}=e,y=ws(),b=ac(),x=qi(),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=Po(k),F=bc({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`);G(()=>{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`;Rc(w&&L,O===`touch`,k,E);let R=y.useStateSetter(`positionerElement`),z=Tc(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,W.jsxs)(cc.Provider,{value:F,children:[C&&L&&(0,W.jsx)(Cc,{inert:sc(!w),cutout:E}),(0,W.jsx)(Ji,{id:x,children:z})]})}),Bc=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Vc=_.createContext(void 0);function Hc(e){let t=_.useContext(Vc);if(t===void 0&&!e)throw Error(ni(69));return t}var Uc=_.createContext(void 0);function Wc(){let[e,t]=_.useState(0),n=Cn(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:_.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Gc=_.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=ws(),l=lc(),u=Hc(!0)!=null,{context:d,hasClosePart:f}=Wc(),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`);Fo({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),fs(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?Lo(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Ti(`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`,...Io,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&Bc.has(e.key)&&e.stopPropagation()}},wc(g),s],stateAttributesMapping:Qs});return(0,W.jsx)(aa,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:yt(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,W.jsx)(Uc.Provider,{value:d,children:M})})});function Kc(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=Kc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function qc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Kc(e))&&(r&&(r+=` `),r+=t);return r}var Jc=(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},Yc=(e,t)=>({classGroupId:e,validator:t}),Xc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Zc=`-`,Qc=[],$c=`arbitrary..`,el=e=>{let t=rl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return nl(e);let n=e.split(Zc);return tl(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Jc(i,t):t:i||Qc}return n[e]||Qc}}},tl=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=tl(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Zc):e.slice(t).join(Zc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},nl=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?$c+r:void 0})(),rl=e=>{let{theme:t,classGroups:n}=e;return il(n,t)},il=(e,t)=>{let n=Xc();for(let r in e){let i=e[r];al(i,n,r,t)}return n},al=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ol(i,t,n,r)}},ol=(e,t,n,r)=>{if(typeof e==`string`){sl(e,t,n);return}if(typeof e==`function`){cl(e,t,n,r);return}ll(e,t,n,r)},sl=(e,t,n)=>{let r=e===``?t:ul(t,e);r.classGroupId=n},cl=(e,t,n,r)=>{if(dl(e)){al(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Yc(n,e))},ll=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];al(o,ul(t,a),n,r)}},ul=(e,t)=>{let n=e,r=t.split(Zc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Xc(),n.nextPart.set(t,i)),n=i}return n},dl=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,fl=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)}}},pl=`!`,ml=`:`,hl=[],gl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),_l=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===ml){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(pl)?(c=s.slice(0,-1),l=!0):s.startsWith(pl)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return gl(t,l,c,u)};if(t){let e=t+ml,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):gl(hl,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},vl=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}},yl=e=>({cache:fl(e.cacheSize),parseClassName:_l(e),sortModifiers:vl(e),postfixLookupClassGroupIds:bl(e),...el(e)}),bl=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},xl=/\s+/,Sl=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(xl),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?_+pl:_,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},Cl=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=wl(n))&&(i&&(i+=` `),i+=r);return i},wl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=wl(e[r]))&&(n&&(n+=` `),n+=t);return n},Tl=(e,...t)=>{let n,r,i,a,o=o=>(n=yl(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=Sl(e,n);return i(e,a),a};return a=o,(...e)=>a(Cl(...e))},El=[],Dl=e=>{let t=t=>t[e]||El;return t.isThemeGetter=!0,t},Ol=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Al=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ml=/\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$/,Nl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Il=e=>Al.test(e),J=e=>!!e&&!Number.isNaN(Number(e)),Ll=e=>!!e&&Number.isInteger(Number(e)),Y=e=>e.endsWith(`%`)&&J(e.slice(0,-1)),X=e=>jl.test(e),Rl=()=>!0,zl=e=>Ml.test(e)&&!Nl.test(e),Bl=()=>!1,Vl=e=>Pl.test(e),Hl=e=>Fl.test(e),Ul=e=>!Z(e)&&!Q(e),Wl=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)),Gl=e=>ou(e,uu,Bl),Z=e=>Ol.test(e),Kl=e=>ou(e,du,zl),ql=e=>ou(e,fu,J),Jl=e=>ou(e,mu,Rl),Yl=e=>ou(e,pu,Bl),Xl=e=>ou(e,cu,Bl),Zl=e=>ou(e,lu,Hl),Ql=e=>ou(e,hu,Vl),Q=e=>kl.test(e),$l=e=>su(e,du),eu=e=>su(e,pu),tu=e=>su(e,cu),nu=e=>su(e,uu),ru=e=>su(e,lu),iu=e=>su(e,hu,!0),au=e=>su(e,mu,!0),ou=(e,t,n)=>{let r=Ol.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},su=(e,t,n=!1)=>{let r=kl.exec(e);return r?r[1]?t(r[1]):n:!1},cu=e=>e===`position`||e===`percentage`,lu=e=>e===`image`||e===`url`,uu=e=>e===`length`||e===`size`||e===`bg-size`,du=e=>e===`length`,fu=e=>e===`number`,pu=e=>e===`family-name`,mu=e=>e===`number`||e===`weight`,hu=e=>e===`shadow`,gu=Tl(()=>{let e=Dl(`color`),t=Dl(`font`),n=Dl(`text`),r=Dl(`font-weight`),i=Dl(`tracking`),a=Dl(`leading`),o=Dl(`breakpoint`),s=Dl(`container`),c=Dl(`spacing`),l=Dl(`radius`),u=Dl(`shadow`),d=Dl(`inset-shadow`),f=Dl(`text-shadow`),p=Dl(`drop-shadow`),m=Dl(`blur`),h=Dl(`perspective`),g=Dl(`aspect`),_=Dl(`ease`),v=Dl(`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=()=>[Il,`full`,`auto`,...w()],E=()=>[Ll,`none`,`subgrid`,Q,Z],D=()=>[`auto`,{span:[`full`,Ll,Q,Z]},Ll,Q,Z],O=()=>[Ll,`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=()=>[Il,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Il,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Il,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Q,Z],L=()=>[...b(),tu,Xl,{position:[Q,Z]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,nu,Gl,{size:[Q,Z]}],ee=()=>[Y,$l,Kl],B=()=>[``,`none`,`full`,l,Q,Z],V=()=>[``,J,$l,Kl],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,Y,tu,Xl],ne=()=>[``,`none`,m,Q,Z],re=()=>[`none`,J,Q,Z],ie=()=>[`none`,J,Q,Z],ae=()=>[J,Q,Z],oe=()=>[Il,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[X],breakpoint:[X],color:[Rl],container:[X],"drop-shadow":[X],ease:[`in`,`out`,`in-out`],font:[Ul],"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`,Il,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[Wl],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:[Ll,`auto`,Q,Z]}],basis:[{basis:[Il,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[J,Il,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,J,Q,Z]}],shrink:[{shrink:[``,J,Q,Z]}],order:[{order:[Ll,`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,$l,Kl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,au,Jl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Y,Z]}],"font-family":[{font:[eu,Yl,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,ql]}],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,Kl]}],"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:[Ll,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`]},Ll,Q,Z],radial:[``,Q,Z],conic:[Ll,Q,Z]},ru,Zl]}],"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,$l,Kl]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,iu,Ql]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,iu,Ql]}],"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,Kl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,iu,Ql]}],"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,iu,Ql]}],"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:[Ll,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,$l,Kl,ql]}],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 _u(...e){return gu(qc(e))}function vu({...e}){return(0,W.jsx)(As,{"data-slot":`popover`,...e})}function yu({...e}){return(0,W.jsx)(rc,{"data-slot":`popover-trigger`,...e})}function bu({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,W.jsx)(oc,{children:(0,W.jsx)(zc,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,W.jsx)(Gc,{"data-slot":`popover-content`,className:_u(`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 xu=(e,t)=>e==null?null:`${e}:${t??``}`,Su={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`},Cu=.7;function wu({severity:e,flags:t}){if(!e)return(0,W.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)<Cu,a=[`none`,`low`,`high`,`severe`],o=Object.entries(t??{});return(0,W.jsxs)(vu,{children:[(0,W.jsxs)(yu,{className:`severity-badge severity-${e.level} rt-sev`,children:[e.label,i?`?`:``,r?` (rule)`:``]}),(0,W.jsxs)(bu,{className:`rt-sev-pop`,align:`end`,children:[(0,W.jsxs)(`strong`,{children:[e.label,r?`, set by a rule`:``]}),e.rule&&(0,W.jsxs)(`p`,{children:[`Rule: `,e.rule]}),n?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{children:[`Jev: `,n.score.toFixed(2),` of 3, `,Math.round((n.confidence??0)*100),`% confident`]}),n.probabilities&&(0,W.jsx)(`ul`,{className:`rt-dist`,children:a.map((e,t)=>{let r=n.probabilities?.[String(t)]??0;return(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`i`,{children:(0,W.jsx)(`b`,{className:`severity-${t}`,style:{width:`${Math.round(r*100)}%`}})}),(0,W.jsx)(`em`,{children:r.toFixed(2)})]},e)})})]}):(0,W.jsx)(`p`,{children:`Jev did not rate this command.`}),o.length>0&&(0,W.jsxs)(`p`,{children:[`Flags: `,o.map(([e,t])=>`${Su[e]??e}${Number.isFinite(Number(t))?` ${Number(t).toFixed(2)}`:``}`).join(`, `)]})]})]})}function Tu(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 Eu(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 Du(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 Ou=e=>e?Date.parse(e):NaN;function ku(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 Au=e=>e?Number(BigInt(e)/BigInt(1e6)):NaN;function ju({text:e}){let t=e.replace(/\s*\n\s*/g,` ⏎ `);return(0,W.jsx)(`code`,{className:`exec-cmd`,title:e,children:t})}var Mu="The program reported success. That is not proof it did what was intended: `rm -f` also succeeds when there was nothing to delete.",Nu={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.`]},Pu={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 Fu({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]=Pu[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:Mu};if(s!=null){let[e,t]=Nu[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 Iu({outcome:e}){return(0,W.jsxs)(`span`,{title:e.title,children:[e.label,e.code&&(0,W.jsxs)(`span`,{className:`exec-code`,children:[` `,e.code]})]})}var Lu=`https://raytracer.si/reading-a-trace.html`,Ru={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`},zu={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`}},Bu=new Set([`Write`,`Edit`,`MultiEdit`,`NotebookEdit`,`apply_patch`]),Vu=`/workspace`;function Hu(e){return!!e.sandboxId||(e.callVerifications??[]).some(e=>e.exec_id)}function Uu(e,t,n,r){if(t.exec_id)return t.reported_check&&t.reported_check!==`agrees`?zu.differs:zu.ran;if(n.state===`rejected`)return zu.rejected;let i=Hu(e);if(t.kind!==`file`&&t.kind!==`agent`)return i?zu.not_seen:zu.not_covered;if(!Bu.has(t.name))return zu.in_agent;if(!i||!t.snapshot)return zu.not_covered;if(r===null)return t.snapshot.changed?zu.file_changed:n.state===`ok`?zu.no_change:zu.in_agent;if(r.startsWith(`/`)&&r!==Vu&&!r.startsWith(`${Vu}/`))return zu.not_covered;let a=r.startsWith(`${Vu}/`)?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)))?zu.file_changed:s.some(e=>e.snapshot.too_big.some(o))?zu.not_covered:n.state===`ok`?zu.no_change:zu.in_agent}function Wu(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 Gu(e){return[...e.matchAll(/"((?:\\.|[^"\\])*)"|'([^']*)'|(\S+)/g)].map(e=>e[1]??e[2]??e[3])}var Ku=e=>e.replace(/[`'"),;]+$/,``).split(`/`).filter(Boolean).pop()??``,qu=e=>/\/|\.[A-Za-z0-9]{1,8}$/.test(e)&&!e.startsWith(`-`)&&!/^\d/.test(e);function Ju(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 Yu=new Set([`grep`,`egrep`,`rg`,`ag`,`ack`,`find`,`fd`]),Xu=new Set([`cat`,`head`,`tail`,`less`,`nl`,`wc`]),Zu=/^(?:npm (?:test|run test\S*)|pnpm (?:test|run test\S*)|yarn test\S*|node(?: \S+)* --test|pytest|vitest|jest|go test|cargo test)/;function Qu(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 $u(e){for(let t of Qu(e)){let e=Gu(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 ed(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=Ju(e.name===`Glob`&&Ku(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=Ku(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=$u(a),s=o[0]?.split(`/`).pop()??``,c=o.join(` `);if(Zu.test(c)){let e=c.match(Zu)[0].replace(/ --?\S+/g,``).trim();return{kind:`test`,targets:[e],display:[e],wide:!1}}if(Yu.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=Ju(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||Xu.has(s)||s===`sed`&&o.includes(`-n`)){let e=[...new Set(Gu(a.split(/<<-?\s*['"]?\w+['"]?/)[0]).filter(qu).map(Ku).filter(Boolean))];return e.length?{kind:l?`edit`:`read`,targets:e.map(e=>e.toLowerCase()),display:e,wide:!1}:n}return n}var td=(e,t)=>e.some(e=>t.some(t=>e===t||Math.min(e.length,t.length)>=4&&(e.includes(t)||t.includes(e))));function nd(e,t){let n=[];return t.forEach((t,r)=>{let i=ed(t,Wu(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&&td(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 rd={search:`Searched`,read:`Read`,write:`Wrote`,edit:`Edited`,delete:`Removed or moved`,web:`Fetched`};function id(e,t){let n=e.calls.length,r=e.display.slice(0,3).join(`, `)+(e.display.length>3?`, …`:``),i=e.kind===`search`?`${rd.search} ${n} times for ${r}`:`${(e.kind&&rd[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?Ru[e.kind]:`Step`,label:i,outcome:c,flags:d,repeated:m}}var ad=(e,t=!1)=>e===null?`Unavailable`:`${t?`≈ `:``}${e===0?`$0`:e<1e-6?`<$0.000001`:`$${e.toFixed(6)}`}`,od=e=>e===null?`Unavailable`:`${(e/1e3).toFixed(2)} s`,sd=e=>e===null?`—`:e.toLocaleString(),cd=_.createContext(void 0);function ld(e){let t=_.useContext(cd);if(!e&&t===void 0)throw Error(ni(27));return t}var ud=_.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=ld(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Ti(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Qs,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),dd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=ld(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Ls({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,ln(an,e.nativeEvent))}return Ti(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),fd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ld(),c=$s(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Ti(`p`,e,{ref:t,props:[{id:c},o]})}),pd=_.createContext(void 0);function md(){let e=_.useContext(pd);if(e===void 0)throw Error(ni(26));return e}var hd={...Zs,...Us,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},gd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=ld(),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`);md(),Fo({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Lo(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Ti(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Io,hidden:!m,onKeyDown(e){Bc.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:hd});return(0,W.jsx)(aa,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),_d=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=ld(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,W.jsx)(pd.Provider,{value:n,children:(0,W.jsxs)(Bi,{ref:t,...r,children:[a&&o===!0&&(0,W.jsx)(Cc,{ref:i.context.internalBackdropRef,inert:sc(!s)}),e.children]})}):null});function vd({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=la(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=Vt(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||K(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Ic(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),G(()=>(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]),Ko(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var yd={...rs,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},bd=class extends ko{constructor(e,t,n){let r=new Jo,i=xd(e,r,t,n);super(i,Sd(r),yd)}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};Vo(n,e,t.trigger),this.update(n)}};function xd(e,t,n,r=!1){let i={...Xo(),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=Zo(t,n,r),i}function Sd(e){return{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Cd(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=ld(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:v},x=Ro((e,t)=>new bd({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`);qo(x,S),Wo(x);let{forceUnmount:T}=Go(S,x);_.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,ln(cn))}),[T,x]);let E=S||C;return(0,W.jsxs)(cd.Provider,{value:x,children:[u&&(0,W.jsx)(zo,{handle:u,store:x}),E&&(0,W.jsx)(vd,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}function wd(e){return Cd(`dialog`,e)}var Td=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ld(),c=$s(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Ti(`h2`,e,{ref:t,props:[{id:c},o]})}),Ed=_.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=ld(!0),f=is(l)??d;if(!f)throw Error(ni(79));let p=$s(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),v=_.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Uo(p,v,f,{payload:c}),{getButtonProps:x,buttonRef:S}=Ls({disabled:a,native:o}),C=oa(m),w=nc(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return Ti(`button`,e,{state:T,ref:[S,t,y,v],props:[C.reference,E,w,{[Mi]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:Ys})}),Dd=_.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}=Ls({disabled:i,focusableWhenDisabled:a,native:o});return Ti(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Od=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,kd=qc,Ad=((e,t)=>n=>{if(t?.variants==null)return kd(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=Od(t)||Od(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 kd(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 jd({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,W.jsx)(Dd,{"data-slot":`button`,className:_u(Ad({variant:t,size:n,className:e})),...r})}function Md({...e}){return(0,W.jsx)(wd,{"data-slot":`sheet`,...e})}function Nd({...e}){return(0,W.jsx)(Ed,{"data-slot":`sheet-trigger`,...e})}function Pd({...e}){return(0,W.jsx)(_d,{"data-slot":`sheet-portal`,...e})}function Fd({className:e,...t}){return(0,W.jsx)(ud,{"data-slot":`sheet-overlay`,className:_u(`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 Id({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,W.jsxs)(Pd,{children:[(0,W.jsx)(Fd,{}),(0,W.jsxs)(gd,{"data-slot":`sheet-content`,"data-side":n,className:_u(`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,W.jsxs)(dd,{"data-slot":`sheet-close`,render:(0,W.jsx)(jd,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,W.jsx)(Te,{}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Ld({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`sheet-header`,className:_u(`gap-0.5 p-4 flex flex-col`,e),...t})}function Rd({className:e,...t}){return(0,W.jsx)(Td,{"data-slot":`sheet-title`,className:_u(`text-foreground text-base font-medium cn-font-heading`,e),...t})}function zd({className:e,...t}){return(0,W.jsx)(fd,{"data-slot":`sheet-description`,className:_u(`text-muted-foreground text-sm`,e),...t})}function Bd({className:e,size:t=`default`,...n}){return(0,W.jsxs)(`div`,{className:_u(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,W.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,W.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 Vd({className:e,...t}){return(0,W.jsx)(`option`,{"data-slot":`native-select-option`,className:_u(`bg-[Canvas] text-[CanvasText]`,e),...t})}function Hd(e){try{return JSON.parse(e)}catch{return{}}}function Ud(e){return Array.isArray(e)?`[${e.map(Ud).join(`,`)}]`:e&&typeof e==`object`?`{${Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${JSON.stringify(e)}:${Ud(t)}`).join(`,`)}}`:JSON.stringify(e)??``}function Wd(e){return e.events.filter(e=>e.title.startsWith(`Tool call:`)).map(t=>{let n=Hd(t.raw),r=n.arguments??n.input??n.function?.arguments??``;if(typeof r==`string`)try{r=JSON.parse(r)}catch{}let i=t.exchange_id&&Number.isInteger(t.output_index)?{exchangeId:t.exchange_id,outputIndex:t.output_index,callId:n.call_id}:{},a=e.events.filter(e=>e.title.startsWith(`Tool result:`)&&i.exchangeId&&e.exchange_id===i.exchangeId&&e.output_index===i.outputIndex),o=e.callVerifications?.find(e=>e.exchange_id===i.exchangeId&&e.output_index===i.outputIndex),s=a.length===1?Hd(a[0].raw):null;return{name:n.name??n.function?.name??t.title.slice(11),args:Ud(r),...i,...s?{result:Xd(s.output??s.content),reportedExit:Zd(s),reportedFailure:typeof s.is_error==`boolean`?s.is_error:s.status===`failed`||null}:{},...o?{observedExit:o.exit_code??null}:{},...a.length>1?{ambiguous:!0}:{}}})}function Gd(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 Kd(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:Wd(e).length}}function qd(e){let t=e.events.findLast(e=>e.title===`Model answer`);if(!t)return`No model answer captured.`;let n=Hd(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 Jd(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.`}var Yd=/^(?:Chunk ID: [^\r\n]+\r?\n)?(?:Wall time: [^\r\n]+\r?\n)?Process exited with code (-?\d+)(?:\r?\n(?:Original token count: \d+\r?\n)?(?:Final output|Output):\r?\n|$)/;function Xd(e){return(typeof e==`string`?e:Ud(e)).replace(Yd,``)}function Zd(e){if(typeof e.exit_code==`number`)return e.exit_code;let t=e.output;if(t&&typeof t==`object`&&`exit_code`in t&&typeof t.exit_code==`number`)return t.exit_code;let n=typeof t==`string`&&Yd.exec(t);return n?Number(n[1]):null}function Qd(e,t){let n=e.promptRaw,r=t.promptRaw;if(n!==void 0&&r!==void 0&&n!==r)return{kind:`prompt`,summary:`Starting prompts differ.`,baselineEvidence:n,comparisonEvidence:r};if(e.provider!==t.provider)return{kind:`settings`,summary:`Model providers differ.`,baselineEvidence:e.provider,comparisonEvidence:t.provider};let i=e.comparisonRequests??[],a=t.comparisonRequests??[],o=e=>({model:e.model,settings:e.settings,instructions:e.instructions,tools:e.tools});if(i[0]&&a[0]&&Ud(o(i[0]))!==Ud(o(a[0])))return{kind:`settings`,summary:`Starting model, instructions, or tool definitions differ.`,baselineEvidence:o(i[0]),comparisonEvidence:o(a[0])};let s=e=>e.context.map(e=>({kind:e.kind,content:e.content}));if(i[0]&&a[0]&&i[0].context.every(e=>e.content!==void 0)&&a[0].context.every(e=>e.content!==void 0)&&Ud(s(i[0]))!==Ud(s(a[0])))return{kind:`context`,summary:`Starting recorded context differs.`,baselineEvidence:s(i[0]),comparisonEvidence:s(a[0])};let c=Wd(e),l=Wd(t);if(c.length*l.length>25e4)return{kind:`unavailable`,summary:`Runs exceed the alignment limit; first difference is unavailable.`};let u=Gd(c,l),d=new Set;for(let[e,t]of u.entries()){let n={a:t.a,b:t.b,step:e+1};if(t.a?.ambiguous||t.b?.ambiguous)return{kind:`unavailable`,summary:`A repeated call has ambiguous result evidence.`,...n};let r=i.find(e=>e.exchangeId===t.a?.exchangeId),s=a.find(e=>e.exchangeId===t.b?.exchangeId);if(r&&s&&!d.has(r.exchangeId+`|`+s.exchangeId)){if(d.add(r.exchangeId+`|`+s.exchangeId),Ud(o(r))!==Ud(o(s)))return{kind:`settings`,summary:`Request settings differ before step ${e+1}.`,...n};let t=e=>e.context.map(e=>({kind:e.kind,content:e.content}));if(r.context.every(e=>e.content!==void 0)&&s.context.every(e=>e.content!==void 0)&&Ud(t(r))!==Ud(t(s)))return{kind:`context`,summary:`Recorded context differs before step ${e+1}.`,...n}}if(t.status===`Arguments changed`&&(c.filter(e=>e.name===t.a?.name).length>1||l.filter(e=>e.name===t.b?.name).length>1))return{kind:`unavailable`,summary:`Repeated calls cannot be paired confidently across these changed steps.`,...n};if(t.status!==`Same`)return{kind:`call`,summary:`Step ${e+1}: ${t.status.toLowerCase()}.`,...n};let u=t.a,f=t.b;if(u.observedExit!=null&&f.observedExit!=null&&u.observedExit!==f.observedExit)return{kind:`exit`,summary:`Step ${e+1}: command same; observed exit ${u.observedExit} → ${f.observedExit}.`,...n};if(u.reportedExit!=null&&f.reportedExit!=null&&u.reportedExit!==f.reportedExit)return{kind:`result`,summary:`Step ${e+1}: command same; reported exit ${u.reportedExit} → ${f.reportedExit}.`,...n};if(u.reportedFailure!=null&&f.reportedFailure!=null&&u.reportedFailure!==f.reportedFailure)return{kind:`result`,summary:`Step ${e+1}: the tool's reported error status changed.`,...n};if(u.result!==void 0&&f.result!==void 0&&u.result!==f.result)return{kind:`result`,summary:`Step ${e+1}: ${/^(?:read|read_file|readfile|read_text_file|read_multiple_files)$/i.test(u.name)?`Captured file content`:`Tool output`} changed.`,...n}}return qd(e)===qd(t)?null:{kind:`answer`,summary:`Last captured model answers differ.`,baselineEvidence:qd(e),comparisonEvidence:qd(t)}}function $d(e,t){let n=[];for(let[r,i]of[[`Baseline`,e],[`Comparison`,t]])i.captureComplete!==!0&&n.push(`${r}: full run detail is unavailable or truncated.`),(i.promptRaw===void 0||!i.comparisonRequests?.length)&&n.push(`${r}: full prompt or request settings unavailable.`),i.evidence.some(e=>e.content===void 0&&!e.content_of)&&n.push(`${r}: some content is preview only.`),Wd(i).some(e=>e.result===void 0)&&n.push(`${r}: some tool results were not captured.`),i.captureHealth?.history!==`no_known_gaps`&&n.push(`${r}: sandbox recording has gaps or is unverified.`);return n}function ef({title:e,a:t,b:n}){let r=new Set(t.split(`
16
+ `)),i=new Set(n.split(`
17
+ `));return(0,W.jsxs)(`details`,{className:`compare-detail`,children:[(0,W.jsxs)(`summary`,{children:[e,` · `,t===n?`Same`:`Different`]}),(0,W.jsx)(`p`,{children:`Highlighted lines occur only on that side.`}),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`How this is measured`}),(0,W.jsx)(`p`,{children:`Line order is preserved; this is not a word-level diff.`})]}),(0,W.jsx)(`div`,{className:`compare-pair`,children:[t,n].map((e,t)=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h4`,{children:t?`Comparison`:`Baseline`}),(0,W.jsx)(`pre`,{children:e.split(`
18
+ `).map((e,n)=>(0,W.jsxs)(`span`,{className:(t?r:i).has(e)?``:`diff-line`,children:[e||` `,` `,`
19
+ `]},n))})]},t))})]})}function tf({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=Qd(e,t),f=$d(e,t),p=Kd(e),m=Kd(t),h=Wd(e),g=Wd(t),v=Gd(h,g),y=g.findIndex(e=>e.reportedFailure||[e.observedExit,e.reportedExit].some(e=>e!=null&&e!==0)),b=g[y],x=(e,t)=>e===null?`Unavailable`:t===`$`?`$${e.toFixed(6)}`:t===`s`?`${(e/1e3).toFixed(2)} s`:e.toLocaleString();return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`section`,{"aria-label":`First recorded difference`,children:[(0,W.jsx)(`h3`,{children:`First recorded difference`}),(0,W.jsx)(`p`,{children:d?.summary??`No difference found in the available recording.`}),b&&(0,W.jsxs)(`section`,{"aria-label":`Failed tool call`,children:[(0,W.jsxs)(`h4`,{children:[`Failed tool call `,y+1,`: `,b.name]}),b.result?(0,W.jsx)(`pre`,{children:b.result}):(0,W.jsx)(`p`,{children:`No output was captured for this call.`})]}),(0,W.jsx)(`p`,{children:`This is the first recorded difference. It does not establish why the run failed.`}),(0,W.jsx)(`div`,{className:`compare-pair`,children:[e,t].map((e,t)=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(Le,{health:e.captureHealth}),(0,W.jsxs)(`a`,{href:`?view=calls&trace=${encodeURIComponent(e.id)}${(t?d?.b:d?.a)?.callId?`&call=${encodeURIComponent((t?d?.b:d?.a).callId)}`:``}`,children:[`Open `,t?`comparison`:`baseline`,` evidence`]}),d&&(0,W.jsx)(`pre`,{children:JSON.stringify((t?d.b:d.a)??(t?d.comparisonEvidence:d.baselineEvidence),null,2)})]},e.id))}),!!f.length&&(0,W.jsxs)(`details`,{open:!0,children:[(0,W.jsx)(`summary`,{children:`Limits of this comparison`}),(0,W.jsx)(`ul`,{children:f.map(e=>(0,W.jsx)(`li`,{children:e},e))})]})]}),(0,W.jsx)(`div`,{className:`compare-pair compare-identities`,children:[e,t].map((e,t)=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{children:t?`Comparison`:`Baseline`}),(0,W.jsxs)(`p`,{children:[e.provider,` · `,[...new Set(e.requests?.map(e=>e.model)??[e.model])].join(`, `)]}),(0,W.jsx)(`small`,{children:new Date(e.startedAt).toLocaleString()})]},e.id))}),(0,W.jsx)(`p`,{className:`compare-notice`,children:e.promptRaw!==void 0&&t.promptRaw!==void 0?e.promptRaw===t.promptRaw?`Starting prompts match.`:`Starting prompts differ.`:`Full starting prompts unavailable.`}),(0,W.jsxs)(`details`,{className:`compare-detail`,children:[(0,W.jsx)(`summary`,{children:`How this is measured`}),(0,W.jsx)(`p`,{className:`compare-note`,children:`Review captured context below before interpreting changes. Lower cost or time does not establish answer quality.`})]}),(0,W.jsx)(`div`,{className:`metrics-table`,children:(0,W.jsxs)(`table`,{children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`Metric`}),(0,W.jsx)(`th`,{children:`Baseline`}),(0,W.jsx)(`th`,{children:`Comparison`}),(0,W.jsx)(`th`,{children:`Change (B − A)`})]})}),(0,W.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=p[e],i=m[e],a=r===null||i===null?null:i-r;return(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t}),(0,W.jsx)(`td`,{children:x(r,n)}),(0,W.jsx)(`td`,{children:x(i,n)}),(0,W.jsx)(`td`,{children:a===null?`Unavailable`:`${a>0?`+`:``}${x(a,n)}${r===0?` · % unavailable`:` (${a>0?`+`:``}${(a/r*100).toFixed(1)}%)`}`})]},e)})})]})}),(0,W.jsx)(`p`,{className:`compare-note`,children:`Totals require every call to report the metric.`}),(0,W.jsxs)(`details`,{className:`compare-detail`,children:[(0,W.jsx)(`summary`,{children:`How this is measured`}),(0,W.jsx)(`p`,{className:`compare-note`,children:`Elapsed time spans the first request to the last response; summed time can include overlapping calls.`})]}),(0,W.jsx)(ef,{title:`Starting prompt`,a:e.promptRaw??`Full prompt unavailable`,b:t.promptRaw??`Full prompt unavailable`}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{children:`Execution differences`}),(0,W.jsxs)(`p`,{children:[v.filter(e=>e.status===`Same`).length,` matching · `,v.filter(e=>e.status===`Added`).length,` added · `,v.filter(e=>e.status===`Removed`).length,` removed · `,v.filter(e=>e.status===`Arguments changed`).length,` changed`]}),(0,W.jsx)(`p`,{className:`compare-note`,children:`Exact tool names and arguments anchor matches.`}),(0,W.jsxs)(`details`,{className:`compare-detail`,children:[(0,W.jsx)(`summary`,{children:`How this is measured`}),(0,W.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.`})]}),h.length*g.length>25e4&&(0,W.jsx)(`p`,{children:`These runs exceed the alignment limit. Calls are listed separately.`}),v.length?v.map((e,t)=>(0,W.jsxs)(`details`,{className:`compare-detail`,children:[(0,W.jsxs)(`summary`,{children:[e.status===`Same`?`Same call; compare captured results below`:e.status,` · `,e.a?.name??e.b?.name]}),(0,W.jsxs)(`div`,{className:`compare-pair`,children:[(0,W.jsx)(`pre`,{children:JSON.stringify(e.a??`No call`,null,2)}),(0,W.jsx)(`pre`,{children:JSON.stringify(e.b??`No call`,null,2)})]})]},t)):(0,W.jsx)(`p`,{children:`No proposed tool calls captured.`})]}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{children:`Captured context by request`}),(0,W.jsx)(`div`,{className:`compare-pair`,children:[s,c].map((e,t)=>(0,W.jsxs)(`label`,{children:[t?`Comparison request`:`Baseline request`,(0,W.jsxs)(Bd,{value:t?u:l,onChange:e=>(t?a:r)(e.target.value),children:[!e.length&&(0,W.jsx)(Vd,{value:``,children:`No requests`}),e.map((e,t)=>(0,W.jsxs)(Vd,{value:e,children:[`Request `,t+1]},e))]})]},t))}),(0,W.jsx)(ef,{title:`Instructions, messages, and tool results`,a:Jd(e,l),b:Jd(t,u)})]}),(0,W.jsx)(ef,{title:`Last captured model answer`,a:qd(e),b:qd(t)})]})}function nf({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)([]),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1),[b,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(``);(0,_.useEffect)(()=>{if(!v)return;let e=new AbortController;return a(!0),s(``),x().fetch(`/raytace/traces?scope=history`,{signal:e.signal}).then(async t=>{if(!t.ok)throw Error(`Could not load saved runs. Check that the proxy is running with the latest version.`);let n=await t.json();if(!Array.isArray(n.traces))throw Error(`Invalid saved-run response.`);e.signal.aborted||r(n.traces)}).catch(t=>{e.signal.aborted||s(t.message)}).finally(()=>{e.signal.aborted||a(!1)}),()=>e.abort()},[v,c]),(0,_.useEffect)(()=>{if(!v||!b||!C||b===C)return;let e=!1,t=new AbortController;return f([]),m(!0),g(``),(async()=>{try{let n=await Promise.all([b,C].map(async e=>{let n=await x().fetch(`/raytace/traces?trace=${encodeURIComponent(e)}`,{signal:t.signal,cache:`no-store`});if(!n.ok)throw Error(`Could not load complete selected runs. Update the proxy, or retry.`);let r=(await n.json()).traces?.find(t=>t.id===e);if(!r)throw Error(`Selected run was not returned.`);return r}));e||(f(n),g(``))}catch(t){e||g(t instanceof Error?t.message:String(t))}finally{e||m(!1)}})(),()=>{e=!0,t.abort()}},[v,b,C,c]);let T=t=>{let n=d.find(e=>e.id===t);return n?{...n,captureHealth:e.find(e=>e.id===t)?.captureHealth??n.captureHealth}:void 0},E=T(b),D=T(C);return(0,W.jsxs)(Md,{open:v,onOpenChange:e=>{y(e),e&&(S(t||u[0]?.id||``),w(``))},children:[(0,W.jsx)(Nd,{className:`graph-open-button`,children:`Compare runs`}),(0,W.jsxs)(Id,{className:`run-compare-panel`,children:[(0,W.jsxs)(Ld,{children:[(0,W.jsx)(Rd,{children:`Compare runs`}),(0,W.jsx)(zd,{children:`Compare saved captures. No new model calls are made.`})]}),(0,W.jsxs)(`div`,{className:`compare-body`,children:[i&&(0,W.jsx)(`output`,{children:`Loading saved runs…`}),o&&(0,W.jsxs)(`p`,{role:`alert`,children:[o,` `,(0,W.jsx)(`button`,{className:`graph-open-button`,onClick:()=>l(e=>e+1),children:`Retry`})]}),(0,W.jsx)(`p`,{className:`compare-note`,children:`Most recent 100 saved runs across sessions. Reopen to refresh history.`}),(0,W.jsx)(`div`,{className:`compare-pair`,children:[b,C].map((e,t)=>(0,W.jsxs)(`label`,{children:[t?`Comparison run`:`Baseline run`,(0,W.jsxs)(Bd,{value:e,onChange:e=>(t?w:S)(e.target.value),children:[(0,W.jsx)(Vd,{value:``,children:`Choose a captured run`}),u.map(e=>(0,W.jsxs)(Vd,{value:e.id,children:[new Date(e.startedAt).toLocaleString(),` · `,e.model,` · `,e.title.slice(0,90)]},e.id))]})]},t))}),h&&(0,W.jsx)(`p`,{role:`alert`,children:h}),b&&C&&(0,W.jsx)(`button`,{type:`button`,className:`graph-open-button`,onClick:()=>l(e=>e+1),children:`Refresh selected runs`}),p&&(0,W.jsx)(`output`,{children:`Loading selected runs…`}),i||p?null:u.length<2?(0,W.jsx)(`p`,{children:`Capture at least two runs to compare them. Try the same task with a different prompt or model.`}):!E||!D?(0,W.jsx)(`p`,{children:`Select two saved runs to see cost, timing, execution, context, and answer differences.`}):E.id===D.id?(0,W.jsx)(`p`,{children:`Choose two different runs.`}):(0,W.jsx)(tf,{a:E,b:D},`${E.id}-${D.id}`)]})]})]})}function rf(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=rf(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var af={value:()=>{}};function of(){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 sf(n)}function sf(e){this._=e}function cf(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}})}sf.prototype=of.prototype={constructor:sf,on:function(e,t){var n=this._,r=cf(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=lf(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]=uf(n[i],e.name,t);else if(t==null)for(i in n)n[i]=uf(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 sf(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 lf(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function uf(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=af,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var df={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 ff(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),df.hasOwnProperty(t)?{space:df[t],local:e}:e}function pf(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 mf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hf(e){var t=ff(e);return(t.local?mf:pf)(t)}function gf(){}function _f(e){return e==null?gf:function(){return this.querySelector(e)}}function vf(e){typeof e!=`function`&&(e=_f(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 om(r,this._parents)}function yf(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bf(){return[]}function xf(e){return e==null?bf:function(){return this.querySelectorAll(e)}}function Sf(e){return function(){return yf(e.apply(this,arguments))}}function Cf(e){e=typeof e==`function`?Sf(e):xf(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 om(r,i)}function wf(e){return function(){return this.matches(e)}}function Tf(e){return function(t){return t.matches(e)}}var Ef=Array.prototype.find;function Df(e){return function(){return Ef.call(this.children,e)}}function Of(){return this.firstElementChild}function kf(e){return this.select(e==null?Of:Df(typeof e==`function`?e:Tf(e)))}var Af=Array.prototype.filter;function jf(){return Array.from(this.children)}function Mf(e){return function(){return Af.call(this.children,e)}}function Nf(e){return this.selectAll(e==null?jf:Mf(typeof e==`function`?e:Tf(e)))}function Pf(e){typeof e!=`function`&&(e=wf(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 om(r,this._parents)}function Ff(e){return Array(e.length)}function If(){return new om(this._enter||this._groups.map(Ff),this._parents)}function Lf(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Lf.prototype={constructor:Lf,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 Rf(e){return function(){return e}}function zf(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 Lf(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Bf(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 Lf(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Vf(e){return e.__data__}function Hf(e,t){if(!arguments.length)return Array.from(this,Vf);var n=t?Bf:zf,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Rf(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=Uf(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 om(o,r),o._enter=s,o._exit=c,o}function Uf(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Wf(){return new om(this._exit||this._groups.map(Ff),this._parents)}function Gf(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 Kf(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 om(s,this._parents)}function qf(){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 Jf(e){e||=Yf;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 om(i,this._parents).order()}function Yf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xf(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Zf(){return Array.from(this)}function Qf(){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 $f(){let e=0;for(let t of this)++e;return e}function ep(){return!this.node()}function tp(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 np(e){return function(){this.removeAttribute(e)}}function rp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ip(e,t){return function(){this.setAttribute(e,t)}}function ap(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function op(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sp(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 cp(e,t){var n=ff(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?rp:np:typeof t==`function`?n.local?sp:op:n.local?ap:ip)(n,t))}function lp(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function up(e){return function(){this.style.removeProperty(e)}}function dp(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fp(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pp(e,t,n){return arguments.length>1?this.each((t==null?up:typeof t==`function`?fp:dp)(e,t,n??``)):mp(this.node(),e)}function mp(e,t){return e.style.getPropertyValue(t)||lp(e).getComputedStyle(e,null).getPropertyValue(t)}function hp(e){return function(){delete this[e]}}function gp(e,t){return function(){this[e]=t}}function _p(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function vp(e,t){return arguments.length>1?this.each((t==null?hp:typeof t==`function`?_p:gp)(e,t)):this.node()[e]}function yp(e){return e.trim().split(/^|\s+/)}function bp(e){return e.classList||new xp(e)}function xp(e){this._node=e,this._names=yp(e.getAttribute(`class`)||``)}xp.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 Sp(e,t){for(var n=bp(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Cp(e,t){for(var n=bp(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function wp(e){return function(){Sp(this,e)}}function Tp(e){return function(){Cp(this,e)}}function Ep(e,t){return function(){(t.apply(this,arguments)?Sp:Cp)(this,e)}}function Dp(e,t){var n=yp(e+``);if(arguments.length<2){for(var r=bp(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Ep:t?wp:Tp)(n,t))}function Op(){this.textContent=``}function kp(e){return function(){this.textContent=e}}function Ap(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function jp(e){return arguments.length?this.each(e==null?Op:(typeof e==`function`?Ap:kp)(e)):this.node().textContent}function Mp(){this.innerHTML=``}function Np(e){return function(){this.innerHTML=e}}function Pp(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Fp(e){return arguments.length?this.each(e==null?Mp:(typeof e==`function`?Pp:Np)(e)):this.node().innerHTML}function Ip(){this.nextSibling&&this.parentNode.appendChild(this)}function Lp(){return this.each(Ip)}function Rp(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zp(){return this.each(Rp)}function Bp(e){var t=typeof e==`function`?e:hf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Vp(){return null}function Hp(e,t){var n=typeof e==`function`?e:hf(e),r=t==null?Vp:typeof t==`function`?t:_f(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Up(){var e=this.parentNode;e&&e.removeChild(this)}function Wp(){return this.each(Up)}function Gp(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Kp(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qp(e){return this.select(e?Kp:Gp)}function Jp(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Yp(e){return function(t){e.call(this,t,this.__data__)}}function Xp(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 Zp(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 Qp(e,t,n){return function(){var r=this.__on,i,a=Yp(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 $p(e,t,n){var r=Xp(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?Qp:Zp,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function em(e,t,n){var r=lp(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 tm(e,t){return function(){return em(this,e,t)}}function nm(e,t){return function(){return em(this,e,t.apply(this,arguments))}}function rm(e,t){return this.each((typeof t==`function`?nm:tm)(e,t))}function*im(){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 am=[null];function om(e,t){this._groups=e,this._parents=t}function sm(){return new om([[document.documentElement]],am)}function cm(){return this}om.prototype=sm.prototype={constructor:om,select:vf,selectAll:Cf,selectChild:kf,selectChildren:Nf,filter:Pf,data:Hf,enter:If,exit:Wf,join:Gf,merge:Kf,selection:cm,order:qf,sort:Jf,call:Xf,nodes:Zf,node:Qf,size:$f,empty:ep,each:tp,attr:cp,style:pp,property:vp,classed:Dp,text:jp,html:Fp,raise:Lp,lower:zp,append:Bp,insert:Hp,remove:Wp,clone:qp,datum:Jp,on:$p,dispatch:rm,[Symbol.iterator]:im};function lm(e){return typeof e==`string`?new om([[document.querySelector(e)]],[document.documentElement]):new om([[e]],am)}function um(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dm(e,t){if(e=um(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 fm={passive:!1},pm={capture:!0,passive:!1};function mm(e){e.stopImmediatePropagation()}function hm(e){e.preventDefault(),e.stopImmediatePropagation()}function gm(e){var t=e.document.documentElement,n=lm(e).on(`dragstart.drag`,hm,pm);`onselectstart`in t?n.on(`selectstart.drag`,hm,pm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function _m(e,t){var n=e.document.documentElement,r=lm(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,hm,pm),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 vm=e=>()=>e;function ym(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}})}ym.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function bm(e){return!e.ctrlKey&&!e.button}function xm(){return this.parentNode}function Sm(e,t){return t??{x:e.x,y:e.y}}function Cm(){return navigator.maxTouchPoints||`ontouchstart`in this}function wm(){var e=bm,t=xm,n=Sm,r=Cm,i={},a=of(`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`,_,fm).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&&(lm(n.view).on(`mousemove.drag`,m,pm).on(`mouseup.drag`,h,pm),gm(n.view),mm(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(hm(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){lm(e.view).on(`mousemove.drag mouseup.drag`,null),_m(e.view,l),hm(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]))&&(mm(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])&&(hm(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])&&(mm(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=dm(l||r,t),p,m,h;if((h=n.call(e,new ym(`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=dm(l||a,t),_=o}u.call(r,e,new ym(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:vm(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:vm(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:vm(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:vm(!!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 Tm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Em(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Dm(){}var Om=.7,km=1/Om,Am=`\\s*([+-]?\\d+)\\s*`,jm=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Mm=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Nm=/^#([0-9a-f]{3,8})$/,Pm=RegExp(`^rgb\\(${Am},${Am},${Am}\\)$`),Fm=RegExp(`^rgb\\(${Mm},${Mm},${Mm}\\)$`),Im=RegExp(`^rgba\\(${Am},${Am},${Am},${jm}\\)$`),Lm=RegExp(`^rgba\\(${Mm},${Mm},${Mm},${jm}\\)$`),Rm=RegExp(`^hsl\\(${jm},${Mm},${Mm}\\)$`),zm=RegExp(`^hsla\\(${jm},${Mm},${Mm},${jm}\\)$`),Bm={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};Tm(Dm,Gm,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vm,formatHex:Vm,formatHex8:Hm,formatHsl:Um,formatRgb:Wm,toString:Wm});function Vm(){return this.rgb().formatHex()}function Hm(){return this.rgb().formatHex8()}function Um(){return ih(this).formatHsl()}function Wm(){return this.rgb().formatRgb()}function Gm(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Nm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Km(t):n===3?new Xm(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qm(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=Pm.exec(e))?new Xm(t[1],t[2],t[3],1):(t=Fm.exec(e))?new Xm(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Im.exec(e))?qm(t[1],t[2],t[3],t[4]):(t=Lm.exec(e))?qm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Rm.exec(e))?rh(t[1],t[2]/100,t[3]/100,1):(t=zm.exec(e))?rh(t[1],t[2]/100,t[3]/100,t[4]):Bm.hasOwnProperty(e)?Km(Bm[e]):e===`transparent`?new Xm(NaN,NaN,NaN,0):null}function Km(e){return new Xm(e>>16&255,e>>8&255,e&255,1)}function qm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Xm(e,t,n,r)}function Jm(e){return e instanceof Dm||(e=Gm(e)),e?(e=e.rgb(),new Xm(e.r,e.g,e.b,e.opacity)):new Xm}function Ym(e,t,n,r){return arguments.length===1?Jm(e):new Xm(e,t,n,r??1)}function Xm(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Tm(Xm,Ym,Em(Dm,{brighter(e){return e=e==null?km:km**+e,new Xm(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Om:Om**+e,new Xm(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xm(th(this.r),th(this.g),th(this.b),eh(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:Zm,formatHex:Zm,formatHex8:Qm,formatRgb:$m,toString:$m}));function Zm(){return`#${nh(this.r)}${nh(this.g)}${nh(this.b)}`}function Qm(){return`#${nh(this.r)}${nh(this.g)}${nh(this.b)}${nh((isNaN(this.opacity)?1:this.opacity)*255)}`}function $m(){let e=eh(this.opacity);return`${e===1?`rgb(`:`rgba(`}${th(this.r)}, ${th(this.g)}, ${th(this.b)}${e===1?`)`:`, ${e})`}`}function eh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function th(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nh(e){return e=th(e),(e<16?`0`:``)+e.toString(16)}function rh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oh(e,t,n,r)}function ih(e){if(e instanceof oh)return new oh(e.h,e.s,e.l,e.opacity);if(e instanceof Dm||(e=Gm(e)),!e)return new oh;if(e instanceof oh)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 oh(o,s,c,e.opacity)}function ah(e,t,n,r){return arguments.length===1?ih(e):new oh(e,t,n,r??1)}function oh(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Tm(oh,ah,Em(Dm,{brighter(e){return e=e==null?km:km**+e,new oh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Om:Om**+e,new oh(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 Xm(lh(e>=240?e-240:e+120,i,r),lh(e,i,r),lh(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new oh(sh(this.h),ch(this.s),ch(this.l),eh(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=eh(this.opacity);return`${e===1?`hsl(`:`hsla(`}${sh(this.h)}, ${ch(this.s)*100}%, ${ch(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function sh(e){return e=(e||0)%360,e<0?e+360:e}function ch(e){return Math.max(0,Math.min(1,e||0))}function lh(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 uh=e=>()=>e;function dh(e,t){return function(n){return e+n*t}}function fh(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function ph(e){return(e=+e)==1?mh:function(t,n){return n-t?fh(t,n,e):uh(isNaN(t)?n:t)}}function mh(e,t){var n=t-e;return n?dh(e,n):uh(isNaN(e)?t:e)}var hh=(function e(t){var n=ph(t);function r(e,t){var r=n((e=Ym(e)).r,(t=Ym(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=mh(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 gh(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 _h(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vh(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]=Dh(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 yh(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function bh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xh(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]=Dh(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Sh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ch=new RegExp(Sh.source,`g`);function wh(e){return function(){return e}}function Th(e){return function(t){return e(t)+``}}function Eh(e,t){var n=Sh.lastIndex=Ch.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Sh.exec(e))&&(i=Ch.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:bh(r,i)})),n=Ch.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Th(c[0].x):wh(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 Dh(e,t){var n=typeof t,r;return t==null||n===`boolean`?uh(t):(n===`number`?bh:n===`string`?(r=Gm(t))?(t=r,hh):Eh:t instanceof Gm?hh:t instanceof Date?yh:_h(t)?gh:Array.isArray(t)?vh:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?xh:bh)(e,t)}var Oh=180/Math.PI,kh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ah(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)*Oh,skewX:Math.atan(c)*Oh,scaleX:o,scaleY:s}}var jh;function Mh(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?kh:Ah(t.a,t.b,t.c,t.d,t.e,t.f)}function Nh(e){return e==null||(jh||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),jh.setAttribute(`transform`,e),!(e=jh.transform.baseVal.consolidate()))?kh:(e=e.matrix,Ah(e.a,e.b,e.c,e.d,e.e,e.f))}function Ph(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:bh(e,i)},{i:c-2,x:bh(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:bh(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:bh(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:bh(e,n)},{i:s-2,x:bh(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 Fh=Ph(Mh,`px, `,`px)`,`deg)`),Ih=Ph(Nh,`, `,`)`,`)`),Lh=1e-12;function Rh(e){return((e=Math.exp(e))+1/e)/2}function zh(e){return((e=Math.exp(e))-1/e)/2}function Bh(e){return((e=Math.exp(2*e))-1)/(e+1)}var Vh=(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<Lh)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=Rh(y),c=s/(n*g)*(i*Bh(t*r+y)-zh(y));return[a+c*d,o+c*f,s*i/Rh(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),Hh=0,Uh=0,Wh=0,Gh=1e3,Kh,qh,Jh=0,Yh=0,Xh=0,Zh=typeof performance==`object`&&performance.now?performance:Date,Qh=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $h(){return Yh||=(Qh(eg),Zh.now()+Xh)}function eg(){Yh=0}function tg(){this._call=this._time=this._next=null}tg.prototype=ng.prototype={constructor:tg,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?$h():+n)+(t==null?0:+t),!this._next&&qh!==this&&(qh?qh._next=this:Kh=this,qh=this),this._call=e,this._time=n,sg()},stop:function(){this._call&&(this._call=null,this._time=1/0,sg())}};function ng(e,t,n){var r=new tg;return r.restart(e,t,n),r}function rg(){$h(),++Hh;for(var e=Kh,t;e;)(t=Yh-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hh}function ig(){Yh=(Jh=Zh.now())+Xh,Hh=Uh=0;try{rg()}finally{Hh=0,og(),Yh=0}}function ag(){var e=Zh.now(),t=e-Jh;t>Gh&&(Xh-=t,Jh=e)}function og(){for(var e,t=Kh,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:Kh=n);qh=e,sg(r)}function sg(e){Hh||(Uh&&=clearTimeout(Uh),e-Yh>24?(e<1/0&&(Uh=setTimeout(ig,e-Zh.now()-Xh)),Wh&&=clearInterval(Wh)):(Wh||=(Jh=Zh.now(),setInterval(ag,Gh)),Hh=1,Qh(ig)))}function cg(e,t,n){var r=new tg;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var lg=of(`start`,`end`,`cancel`,`interrupt`),ug=[];function dg(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;hg(e,n,{name:t,index:r,group:i,on:lg,tween:ug,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function fg(e,t){var n=mg(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function pg(e,t){var n=mg(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function mg(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function hg(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ng(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 cg(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(cg(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 gg(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 _g(e){return this.each(function(){gg(this,e)})}function vg(e,t){var n,r;return function(){var i=pg(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 yg(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=pg(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 bg(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=mg(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?vg:yg)(n,e,t))}function xg(e,t,n){var r=e._id;return e.each(function(){var e=pg(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return mg(e,r).value[t]}}function Sg(e,t){var n;return(typeof t==`number`?bh:t instanceof Gm?hh:(n=Gm(t))?(t=n,hh):Eh)(e,t)}function Cg(e){return function(){this.removeAttribute(e)}}function wg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tg(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 Eg(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 Dg(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 Og(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 kg(e,t){var n=ff(e),r=n===`transform`?Ih:Sg;return this.attrTween(e,typeof t==`function`?(n.local?Og:Dg)(n,r,xg(this,`attr.`+e,t)):t==null?(n.local?wg:Cg)(n):(n.local?Eg:Tg)(n,r,t))}function Ag(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function jg(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Mg(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&jg(e,i)),n}return i._value=t,i}function Ng(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ag(e,i)),n}return i._value=t,i}function Pg(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=ff(e);return this.tween(n,(r.local?Mg:Ng)(r,t))}function Fg(e,t){return function(){fg(this,e).delay=+t.apply(this,arguments)}}function Ig(e,t){return t=+t,function(){fg(this,e).delay=t}}function Lg(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Fg:Ig)(t,e)):mg(this.node(),t).delay}function Rg(e,t){return function(){pg(this,e).duration=+t.apply(this,arguments)}}function zg(e,t){return t=+t,function(){pg(this,e).duration=t}}function Bg(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Rg:zg)(t,e)):mg(this.node(),t).duration}function Vg(e,t){if(typeof t!=`function`)throw Error();return function(){pg(this,e).ease=t}}function Hg(e){var t=this._id;return arguments.length?this.each(Vg(t,e)):mg(this.node(),t).ease}function Ug(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();pg(this,e).ease=n}}function Wg(e){if(typeof e!=`function`)throw Error();return this.each(Ug(this._id,e))}function Gg(e){typeof e!=`function`&&(e=wf(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 b_(r,this._parents,this._name,this._id)}function Kg(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 b_(o,this._parents,this._name,this._id)}function qg(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 Jg(e,t,n){var r,i,a=qg(t)?fg:pg;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Yg(e,t){var n=this._id;return arguments.length<2?mg(this.node(),n).on.on(e):this.each(Jg(n,e,t))}function Xg(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Zg(){return this.on(`end.remove`,Xg(this._id))}function Qg(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=_f(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,dg(l[f],t,n,f,l,mg(u,n)));return new b_(a,this._parents,t,n)}function $g(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=xf(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=mg(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&dg(p,t,n,h,f,m);a.push(f),o.push(u)}return new b_(a,o,t,n)}var e_=sm.prototype.constructor;function t_(){return new e_(this._groups,this._parents)}function n_(e,t){var n,r,i;return function(){var a=mp(this,e),o=(this.style.removeProperty(e),mp(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function r_(e){return function(){this.style.removeProperty(e)}}function i_(e,t,n){var r,i=n+``,a;return function(){var o=mp(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function a_(e,t,n){var r,i,a;return function(){var o=mp(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),mp(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function o_(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=pg(this,e),l=c.on,u=c.value[a]==null?s||=r_(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function s_(e,t,n){var r=(e+=``)==`transform`?Fh:Sg;return t==null?this.styleTween(e,n_(e,r)).on(`end.style.`+e,r_(e)):typeof t==`function`?this.styleTween(e,a_(e,r,xg(this,`style.`+e,t))).each(o_(this._id,e)):this.styleTween(e,i_(e,r,t),n).on(`end.style.`+e,null)}function c_(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function l_(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&c_(e,a,n)),r}return a._value=t,a}function u_(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,l_(e,t,n??``))}function d_(e){return function(){this.textContent=e}}function f_(e){return function(){var t=e(this);this.textContent=t??``}}function p_(e){return this.tween(`text`,typeof e==`function`?f_(xg(this,`text`,e)):d_(e==null?``:e+``))}function m_(e){return function(t){this.textContent=e.call(this,t)}}function h_(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&m_(r)),t}return r._value=e,r}function g_(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,h_(e))}function __(){for(var e=this._name,t=this._id,n=x_(),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=mg(c,t);dg(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new b_(r,this._parents,e,n)}function v_(){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=pg(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 y_=0;function b_(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function x_(){return++y_}var S_=sm.prototype;b_.prototype={constructor:b_,select:Qg,selectAll:$g,selectChild:S_.selectChild,selectChildren:S_.selectChildren,filter:Gg,merge:Kg,selection:t_,transition:__,call:S_.call,nodes:S_.nodes,node:S_.node,size:S_.size,empty:S_.empty,each:S_.each,on:Yg,attr:kg,attrTween:Pg,style:s_,styleTween:u_,text:p_,textTween:g_,remove:Zg,tween:bg,delay:Lg,duration:Bg,ease:Hg,easeVarying:Wg,end:v_,[Symbol.iterator]:S_[Symbol.iterator]};function C_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var w_={time:null,delay:0,duration:250,ease:C_};function T_(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function E_(e){var t,n;e instanceof b_?(t=e._id,e=e._name):(t=x_(),(n=w_).time=$h(),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])&&dg(c,e,t,l,o,n||T_(c,t));return new b_(r,this._parents,e,t)}sm.prototype.interrupt=_g,sm.prototype.transition=E_;var D_=e=>()=>e;function O_(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 k_(e,t,n){this.k=e,this.x=t,this.y=n}k_.prototype={constructor:k_,scale:function(e){return e===1?this:new k_(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new k_(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 A_=new k_(1,0,0);j_.prototype=k_.prototype;function j_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return A_;return e.__zoom}function M_(e){e.stopImmediatePropagation()}function N_(e){e.preventDefault(),e.stopImmediatePropagation()}function P_(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function F_(){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 I_(){return this.__zoom||A_}function L_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function R_(){return navigator.maxTouchPoints||`ontouchstart`in this}function z_(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 B_(){var e=P_,t=F_,n=z_,r=L_,i=R_,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Vh,l=of(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,I_).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`,I_),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(A_.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 k_(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 k_(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 k_(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=lm(this.that).datum();l.call(e,this.that,new O_(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=dm(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)],gg(this),s.start();N_(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=lm(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=dm(t,i),l=t.clientX,u=t.clientY;gm(t.view),M_(t),a.mouse=[c,this.__zoom.invert(c)],gg(this),a.start();function d(e){if(N_(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]=dm(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),_m(e.view,a.moved),N_(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=dm(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);N_(r),s>0?lm(this).transition().duration(s).call(x,d,c,r):lm(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(M_(t),s=0;s<i;++s)c=r[s],l=dm(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)),gg(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(N_(e),s=0;s<a;++s)c=i[s],l=dm(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(M_(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=dm(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=lm(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:D_(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:D_(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:D_(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:D_([[+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 V_={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.`},H_=[[-1/0,-1/0],[1/0,1/0]],U_=[`Enter`,` `,`Escape`],W_={"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`},G_;(function(e){e.Strict=`strict`,e.Loose=`loose`})(G_||={});var K_;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(K_||={});var q_;(function(e){e.Partial=`partial`,e.Full=`full`})(q_||={});var J_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Y_;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Y_||={});var X_;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(X_||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var Z_={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},Q_=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,$_=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),ev=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),tv=(e,t=[0,0])=>{let{width:n,height:r}=Fv(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},nv=(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):ev(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,hv(e,yv(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?_v(r):{x:0,y:0,width:0,height:0}},rv=(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=hv(n,yv(e)),r=!0)}),r?_v(n):{x:0,y:0,width:0,height:0}},iv=(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=xv(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},av=(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 ov(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}=Fv(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 sv({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Mv(rv(ov(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 cv({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`,V_.error005());else{let{width:e,height:t}=Fv(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&Pv(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=Pv(d)?dv(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,V_.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 lv({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=av(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 uv=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),dv=(e={x:0,y:0},t,n)=>({x:uv(e.x,t[0][0],t[1][0]-(n?.width??0)),y:uv(e.y,t[0][1],t[1][1]-(n?.height??0))});function fv(e,t,n){let{width:r,height:i}=Fv(n),{x:a,y:o}=n.internals.positionAbsolute;return dv(e,[[a,o],[a+r,o+i]],t)}var pv=(e,t,n)=>e<t?uv(Math.abs(e-t),1,t)/t:e>n?-uv(Math.abs(e-n),1,t)/t:0,mv=(e,t,n=15,r=40)=>[pv(e.x,r,t.width-r)*n,pv(e.y,r,t.height-r)*n],hv=(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)}),gv=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),_v=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),vv=(e,t=[0,0])=>{let{x:n,y:r}=ev(e)?e.internals.positionAbsolute:tv(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}},yv=(e,t=[0,0])=>{let{x:n,y:r}=ev(e)?e.internals.positionAbsolute:tv(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)}},bv=(e,t)=>_v(hv(gv(e),gv(t))),xv=(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)},Sv=(e,t)=>xv(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Cv=e=>wv(e.width)&&wv(e.height)&&wv(e.x)&&wv(e.y),wv=e=>!isNaN(e)&&isFinite(e),Tv=(e,t)=>(e,t)=>{},Ev=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Dv=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Ev(s,o):s},Ov=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function kv(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 Av(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=kv(e,n),i=kv(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=kv(e.top??e.y??0,n),i=kv(e.bottom??e.y??0,n),a=kv(e.left??e.x??0,t),o=kv(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 jv(e,t,n,r,i,a){let{x:o,y:s}=Ov(e,[t,n,r]),{x:c,y:l}=Ov({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 Mv=(e,t,n,r,i,a)=>{let o=Av(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=uv(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=jv(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}},Nv=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Pv(e){return e!=null&&e!==`parent`}function Fv(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Iv(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Lv(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 Rv(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function zv(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Bv(e){return{...W_,...e||{}}}function Vv(e){return e===null?null:e?`valid`:`invalid`}function Hv(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Jv(e),s=Dv({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Ev(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Uv=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wv=e=>e?.getRootNode?.()||window?.document,Gv=[`INPUT`,`SELECT`,`TEXTAREA`];function Kv(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Gv.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var qv=e=>`clientX`in e,Jv=(e,t)=>{let n=qv(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)}},Yv=(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,...Uv(t)}})};function Xv({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 Zv(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Qv({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-Zv(t-r,a),n];case $.Right:return[t+Zv(r-t,a),n];case $.Top:return[t,n-Zv(n-i,a)];case $.Bottom:return[t,n+Zv(i-n,a)]}}function $v({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=Qv({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Qv({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Xv({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 ey({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 ty({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 ny({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=hv(yv(e),yv(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Sv({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},_v(a))>0}var ry=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,iy=(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)),ay=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,V_.error006()),t;let r=n.getEdgeId||ry,i;return i=Q_(e)?{...e}:{...e,id:r(e)},iy(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function oy({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=ey({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var sy={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},cy=({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},ly=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function uy({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=sy[t],c=sy[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=cy({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]=ey({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 dy(e,t,n,r){let i=Math.min(ly(e,t)/2,ly(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 fy({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]=uy({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+=dy(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 py(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function my(e){let{sourceNode:t,targetNode:n}=e;if(!py(t)||!py(n))return null;let r=t.internals.handleBounds||hy(t.handles),i=n.internals.handleBounds||hy(n.handles),a=_y(r?.source??[],e.sourceHandle),o=_y(e.connectionMode===G_.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,V_.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=gy(t,a,s),u=gy(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function hy(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 gy(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??Fv(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 _y(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function vy(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function yy(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=vy(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 by=1e3,xy=10,Sy={nodeOrigin:[0,0],nodeExtent:H_,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Cy={...Sy,checkEquality:!0};function wy(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Ty(e,t,n){let r=wy(Sy,n);for(let n of e.values())if(n.parentId)Ay(n,e,t,r);else{let e=dv(tv(n,r.nodeOrigin),Pv(n.extent)?n.extent:r.nodeExtent,Fv(n));n.internals.positionAbsolute=e}}function Ey(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 Dy(e){return e===`manual`}function Oy(e,t,n,r={}){let i=wy(Cy,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Dy(i.zIndexMode)?by: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=dv(tv(u,i.nodeOrigin),Pv(u.extent)?u.extent:i.nodeExtent,Fv(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Ey(u,e),z:jy(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&&Ay(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function ky(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 Ay(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=wy(Sy,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}ky(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*xy),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=My(e,u,o,s,a&&!Dy(c)?by: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 jy(e,t,n){let r=wv(e.zIndex)?e.zIndex:0;return Dy(n)?r:r+(e.selected?t:0)}function My(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Fv(e),l=tv(e,n),u=Pv(e.extent)?dv(l,e.extent,c):l,d=dv({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=fv(d,c,t));let f=jy(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Ny(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=bv(a.get(n.parentId)?.expandedRect??vv(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=Fv(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 Py(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=Uv(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=Pv(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=fv(h,s,n))}else m&&(h=dv(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Yv(`source`,r.nodeElement,p,d,e.id),target:Yv(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&Ay(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:vv(g,i)}))}}if(f.length>0){let e=Ny(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Fy({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 Iy(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 Ly(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}`;Iy(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),Iy(`target`,s,c,e,i,o),t.set(r.id,r)}}function Ry(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Ry(n,t):!1}function zy(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 By(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Ry(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 Vy({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 Hy({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=Ev(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Uy({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=lm(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?gv(rv(s)):null,x=v&&l?Hy({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)}:Ev(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}=cv({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]=Vy({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]=mv(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=Hv(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=By(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Vy({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=wm().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=Hv(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Jv(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Hv(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=Jv(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=Jv(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]=Vy({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||!zy(t,`.${g}`,v))&&(!_||zy(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Wy(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())Sv(i,vv(e))>0&&r.push(e);return r}var Gy=250;function Ky(e,t,n,r){let i=[],a=1/0,o=Wy(e,n,t+Gy);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}=gy(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 qy(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,...gy(o,c,c.position,!0)}:c}function Jy(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Yy(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Xy=()=>!0;function Zy(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:_=Xy,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Wv(e.target),E=0,D,{x:O,y:k}=Jv(e),A=Jy(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=qy(i,A,r,c,t);if(!N)return;let P=Jv(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=mv(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:gy(B,ee,$.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:B,to:P,toHandle:null,toPosition:Z_[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}=Jv(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=Jv(e,j),D=Ky(Dv(P,a,!1,[1,1]),n,c,ee),F||=(z(),!0);let s=Qy(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=Yy(!!D,s.isValid);let u=c.get(i),f=u?gy(u,ee,$.Left,!0):V.from,p={...V,from:f,isValid:L,to:s.toHandle&&L?Ov({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:Z_[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 Qy(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Xy,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}=Jv(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=Jy(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===G_.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=qy(t,e,a,u,n,!0)}return _}var $y={onPointerDown:Zy,isValid:Qy};function eb({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=lm(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&&Nv()?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=B_().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:dm}}var tb=e=>({x:e.x,y:e.y,zoom:e.k}),nb=({x:e,y:t,zoom:n})=>A_.translate(e,t).scale(n),rb=(e,t)=>e.target.closest(`.${t}`),ib=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),ab=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ob=(e,t=0,n=ab,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},sb=e=>{let t=e.ctrlKey&&Nv()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function cb({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(rb(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=dm(u),t=d*2**sb(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===K_.Vertical?0:u.deltaX*f,m=i===K_.Horizontal?0:u.deltaY*f;!Nv()&&u.shiftKey&&i!==K_.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=tb(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 lb({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=rb(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function ub({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=tb(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 db({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&ib(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,tb(a.transform))}}function fb({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&ib(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=tb(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function pb({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`&&(rb(f,`${u}-flow__node`)||rb(f,`${u}-flow__edge`)||rb(f,`${u}-flow__selection`)||rb(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||rb(f,c)&&h||rb(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 mb({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=B_().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=lm(e).call(f);y({x:i.x,y:i.y,zoom:uv(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(sb);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Dh:Vh).transform(ob(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:!wv(D)||D<0?0:D);let A=k?cb({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):lb({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=ub({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=db({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let N=fb({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,N);let P=pb({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=nb(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=nb(e);return await g(n,t),n}function x(e){if(p){let t=nb(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?j_(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`?Dh:Vh).scaleTo(ob(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?Dh:Vh).scaleBy(ob(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=!wv(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 hb;(function(e){e.Line=`line`,e.Handle=`handle`})(hb||={});function gb({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 _b(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 vb(e,t){return Math.max(0,t-e)}function yb(e,t){return Math.max(0,e-t)}function bb(e,t,n){return Math.max(0,t-e,e-n)}function xb(e,t){return e?!t:t}function Sb(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=bb(E,h,g),j=bb(D,_,v);if(o){let e=0,t=0;c&&w<0?e=vb(y+w+O,o[0][0]):!c&&w>0&&(e=yb(y+E+O,o[1][0])),l&&T<0?t=vb(b+T+k,o[0][1]):!l&&T>0&&(t=yb(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=yb(y+w,s[0][0]):!c&&w<0&&(e=vb(y+E,s[1][0])),l&&T>0?t=yb(b+T,s[0][1]):!l&&T<0&&(t=vb(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=bb(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?yb(b+k+E/C,o[1][1])*C:vb(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?vb(b+E/C,s[1][1])*C:yb(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=bb(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?yb(y+D*C+O,o[1][0])/C:vb(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?vb(y+D*C,s[1][0])/C:yb(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=(xb(c,l)?-w:w)/C:w=(xb(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 Cb={width:0,height:0,x:0,y:0},wb={...Cb,pointerX:0,pointerY:0,aspectRatio:1};function Tb(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 Eb({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=lm(e),o={controlDirection:_b(`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={...Cb},h={...wb};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:_b(e)};let g,_=null,v=[],y,b,x,S=wm().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}=Hv(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=Pv(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=Tb(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=Hv(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}=Sb(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=gb({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 Db=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},Ob=e=>e?Db(e):Db,{useDebugValue:kb}=_.default,{useSyncExternalStoreWithSelector:Ab}=So.default,jb=e=>e;function Mb(e,t=jb,n){let r=Ab(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return kb(r),r}var Nb=(e,t)=>{let n=Ob(e),r=(e,r=t)=>Mb(n,e,r);return Object.assign(r,n),r},Pb=(e,t)=>e?Nb(e,t):Nb;function Fb(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 Ib=(0,_.createContext)(null),Lb=Ib.Provider,Rb=V_.error001(`react`);function zb(e,t){let n=(0,_.useContext)(Ib);if(n===null)throw Error(Rb);return Mb(n,e,t)}function Bb(){let e=(0,_.useContext)(Ib);if(e===null)throw Error(Rb);return(0,_.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Vb={display:`none`},Hb={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},Ub=`react-flow__node-desc`,Wb=`react-flow__edge-desc`,Gb=`react-flow__aria-live`,Kb=e=>e.ariaLiveMessage,qb=e=>e.ariaLabelConfig;function Jb({rfId:e}){let t=zb(Kb);return(0,W.jsx)(`div`,{id:`${Gb}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:Hb,children:t})}function Yb({rfId:e,disableKeyboardA11y:t}){let n=zb(qb);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{id:`${Ub}-${e}`,style:Vb,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,W.jsx)(`div`,{id:`${Wb}-${e}`,style:Vb,children:n[`edge.a11yDescription.default`]}),!t&&(0,W.jsx)(Jb,{rfId:e})]})}var Xb=(0,_.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,W.jsx)(`div`,{className:rf([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});Xb.displayName=`Panel`;var Zb=`https://reactflow.dev?utm_source=attribution`;function Qb({proOptions:e,position:t=`bottom-right`}){return(0,_.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,W.jsx)(Xb,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Zb}`,children:(0,W.jsx)(`a`,{href:Zb,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var $b=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}},ex=e=>e.id;function tx(e,t){return Fb(e.selectedNodes.map(ex),t.selectedNodes.map(ex))&&Fb(e.selectedEdges.map(ex),t.selectedEdges.map(ex))}function nx({onSelectionChange:e}){let t=Bb(),{selectedNodes:n,selectedEdges:r}=zb($b,tx);return(0,_.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var rx=e=>!!e.onSelectionChangeHandlers;function ix({onSelectionChange:e}){let t=zb(rx);return e||t?(0,W.jsx)(nx,{onSelectionChange:e}):null}var ax=[0,0],ox={x:0,y:0,zoom:1},sx=[...`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`],cx=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}),lx={translateExtent:H_,nodeOrigin:ax,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function ux(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=zb(cx,Fb),l=Bb();(0,_.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=lx,s()}),[]);let u=(0,_.useRef)(lx);return(0,_.useEffect)(()=>{for(let s of sx){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:Bv(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},sx.map(t=>e[t])),null}function dx(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function fx(e){let[t,n]=(0,_.useState)(e===`system`?null:e);return(0,_.useEffect)(()=>{if(e!==`system`){n(e);return}let t=dx(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?dx()?.matches?`dark`:`light`:t}var px=typeof document<`u`?document:null;function mx(e=null,t={target:px,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??px,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)&&Kv(e))return!1;let n=gx(e.code,s);if(a.current.add(e[n]),hx(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=gx(e.code,s);hx(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 hx(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function gx(e,t){return t.includes(e)?`code`:`key`}var _x=()=>{let e=Bb();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=Mv(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 Dv(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=Ov(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function vx(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)yx(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 yx(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 bx(e,t){return vx(e,t)}function xx(e,t){return vx(e,t)}function Sx(e,t){return{id:e,type:`select`,selected:t}}function Cx(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(Sx(a.id,e)))}return r}function wx({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 Tx(e){return{id:e.id,type:`remove`}}var Ex=Tv(`React Flow`,`https://reactflow.dev/`);function Dx(e,t,n={}){return ay(e,t,{...n,onError:n.onError??Ex})}var Ox=e=>$_(e),kx=e=>Q_(e);function Ax(e){return(0,_.forwardRef)(e)}var jx=typeof window<`u`?_.useLayoutEffect:_.useEffect;function Mx(e){let[t,n]=(0,_.useState)(BigInt(0)),[r]=(0,_.useState)(()=>Nx(()=>n(e=>e+BigInt(1))));return jx(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function Nx(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var Px=(0,_.createContext)(null);function Fx({children:e}){let t=Bb(),n=Mx((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=wx({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=Mx((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(wx({items:s,lookup:o}))},[])),i=(0,_.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,W.jsx)(Px.Provider,{value:i,children:e})}function Ix(){let e=(0,_.useContext)(Px);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var Lx=e=>!!e.panZoom;function Rx(){let e=_x(),t=Bb(),n=Ix(),r=zb(Lx),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=Ox(e)?e:n.get(e.id),a=i.parentId?Lv(i.position,i.measured,i.parentId,n,r):i.position;return vv({...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&&Ox(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&&kx(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 lv({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(Tx);o?.(f),c(e)}if(m){let e=d.map(Tx);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Cv(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=vv(s?r:a),l=Sv(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Cv(e)?e:a(e);if(!r)return!1;let i=Sv(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 nv(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??zv();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 zx=e=>e.selected,Bx=typeof window<`u`?window:void 0;function Vx({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=Bb(),{deleteElements:r}=Rx(),i=mx(e,{actInsideInputWithModifier:!1}),a=mx(t,{target:Bx});(0,_.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(zx),edges:e.filter(zx)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,_.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function Hx(e){let t=Bb();(0,_.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=Uv(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,V_.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 Ux={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Wx=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Gx({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=K_.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=Bb(),w=(0,_.useRef)(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=zb(Wx,Fb),O=mx(p),k=(0,_.useRef)();Hx(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=mb({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,W.jsx)(`div`,{className:`react-flow__renderer`,ref:w,style:Ux,children:h})}var Kx=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qx(){let{userSelectionActive:e,userSelectionRect:t}=zb(Kx,Fb);return e&&t?(0,W.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 Jx=(e,t)=>n=>{n.target===t.current&&e?.(n)},Yx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Xx({isSelecting:e,selectionKeyPressed:t,selectionMode:n=q_.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=Bb(),{userSelectionActive:y,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=zb(Yx,Fb),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}=Jv(n.nativeEvent,E.current),u=Dv({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}=Ov(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(iv(a,m,i,n===q_.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)}}Rv(h,D.current)||c(Cx(a,D.current,!0)),Rv(g,O.current)||l(Cx(o,O.current)),v.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function z(){if(!i||!E.current)return;let[e,t]=mv(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}=Jv(e.nativeEvent,E.current);j.current={x:o,y:c};let l=Ov({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,W.jsxs)(`div`,{className:rf([`react-flow__pane`,{draggable:te,dragging:x,selection:e}]),onClick:w?void 0:Jx(N,T),onContextMenu:Jx(P,T),onWheel:Jx(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:Ux,children:[h,(0,W.jsx)(qx,{})]})}function Zx({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`,V_.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function Qx({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=Bb(),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)();return(0,_.useEffect)(()=>{if(!t)return u.current=Uy({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Zx({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 $x=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function eS(){let e=Bb();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=$x(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=Ev(t,i));let{position:a,positionAbsolute:s}=cv({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 tS=(0,_.createContext)(null),nS=tS.Provider;tS.Consumer;var rS=()=>(0,_.useContext)(tS),iS=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),aS=(0,_.createContext)(null);function oS({children:e}){let t=zb(iS,Fb);return(0,W.jsx)(aS.Provider,{value:t,children:e})}function sS(){let e=(0,_.useContext)(aS);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var cS={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},lS=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return cS;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===G_.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function uS({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=Bb(),_=rS(),{connectOnClick:v,noPanClassName:y,rfId:b}=sS(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=zb(lS(_,m,e),Fb);_||g.getState().onError?.(`010`,V_.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(Dx(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=qv(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();$y.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,W.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:rf([`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=Wv(t.target),h=n||c,{connection:v,isValid:y}=$y.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 dS=(0,_.memo)(Ax(uS));function fS({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,W.jsxs)(W.Fragment,{children:[e?.label,(0,W.jsx)(dS,{type:`source`,position:n,isConnectable:t})]})}function pS({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(dS,{type:`target`,position:n,isConnectable:t}),e?.label,(0,W.jsx)(dS,{type:`source`,position:r,isConnectable:t})]})}function mS(){return null}function hS({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(dS,{type:`target`,position:n,isConnectable:t}),e?.label]})}var gS={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},_S={input:fS,default:pS,output:hS,group:mS};function vS(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 yS=e=>{let{width:t,height:n,x:r,y:i}=rv(e.nodeLookup,{filter:e=>!!e.selected});return{width:wv(t)?t:null,height:wv(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 bS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=Bb(),{width:i,height:a,transformString:o,userSelectionActive:s}=zb(yS,Fb),c=eS(),l=(0,_.useRef)(null);(0,_.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(Qx({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,W.jsx)(`div`,{className:rf([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,W.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(gS,e.key)&&(e.preventDefault(),c({direction:gS[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var xS=typeof window<`u`?window:void 0,SS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function CS({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}=zb(SS,Fb),z=mx(l,{target:xS}),ee=mx(h,{target:xS}),B=ee||w,V=ee||b,H=u&&B!==!0,te=z||R||H;return Vx({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,W.jsx)(Gx,{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,W.jsxs)(Xx,{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,W.jsx)(bS,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}CS.displayName=`FlowRenderer`;var wS=(0,_.memo)(CS),TS=e=>t=>e?iv(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 ES(e){return zb((0,_.useCallback)(TS(e),[e]),Fb)}var DS=e=>e.updateNodeInternals;function OS(){let e=zb(DS),[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 kS({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=Bb(),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 AS({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}=zb(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},Fb),S=y.type||`default`,C=g?.[S]||_S[S];C===void 0&&(v?.(`003`,V_.error003(S)),S=`default`,C=g?.default||_S.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=Bb(),k=Iv(y),A=kS({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=Qx({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=eS();if(y.hidden)return null;let N=Fv(y),P=vS(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)&&Zx({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},V=t=>{if(!(Kv(t.nativeEvent)||m)){if(U_.includes(t.key)&&T){let n=t.key===`Escape`;Zx({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(gS,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:gS[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&&(iv(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,W.jsx)(`div`,{className:rf([`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:`${Ub}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,W.jsx)(nS,{value:e,children:(0,W.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 jS=(0,_.memo)(AS),MS=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function NS(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=zb(MS,Fb),a=ES(e.onlyRenderVisibleElements),o=OS();return(0,W.jsx)(`div`,{className:`react-flow__nodes`,style:Ux,children:a.map(a=>(0,W.jsx)(jS,{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))})}NS.displayName=`NodeRenderer`;var PS=(0,_.memo)(NS);function FS(e){return zb((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&&ny({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),Fb)}var IS=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,W.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},LS=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,W.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},RS={[X_.Arrow]:IS,[X_.ArrowClosed]:LS};function zS(e){let t=Bb();return(0,_.useMemo)(()=>Object.prototype.hasOwnProperty.call(RS,e)?RS[e]:(t.getState().onError?.(`009`,V_.error009(e)),null),[e])}var BS=({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=zS(t);return c?(0,W.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,W.jsx)(c,{color:n,strokeWidth:o})}):null},VS=({defaultColor:e,rfId:t})=>{let n=zb(e=>e.edges),r=zb(e=>e.defaultEdgeOptions),i=(0,_.useMemo)(()=>yy(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,W.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,W.jsx)(`defs`,{children:i.map(e=>(0,W.jsx)(BS,{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};VS.displayName=`MarkerDefinitions`;var HS=(0,_.memo)(VS);function US({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=rf([`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,W.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,W.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,W.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}US.displayName=`EdgeText`;var WS=(0,_.memo)(US);function GS({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`path`,{...u,d:e,fill:`none`,className:rf([`react-flow__edge-path`,u.className])}),l?(0,W.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&wv(t)&&wv(n)?(0,W.jsx)(WS,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function KS({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function qS({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=KS({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=KS({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Xv({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 JS(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]=qS({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,W.jsx)(GS,{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 YS=JS({isInternal:!1}),XS=JS({isInternal:!0});YS.displayName=`SimpleBezierEdge`,XS.displayName=`SimpleBezierEdgeInternal`;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,sourcePosition:p=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=fy({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,W.jsx)(GS,{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 QS=ZS({isInternal:!1}),$S=ZS({isInternal:!0});QS.displayName=`SmoothStepEdge`,$S.displayName=`SmoothStepEdgeInternal`;function eC(e){return(0,_.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,W.jsx)(QS,{...n,id:r,pathOptions:(0,_.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var tC=eC({isInternal:!1}),nC=eC({isInternal:!0});tC.displayName=`StepEdge`,nC.displayName=`StepEdgeInternal`;function rC(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]=oy({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,W.jsx)(GS,{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 iC=rC({isInternal:!1}),aC=rC({isInternal:!0});iC.displayName=`StraightEdge`,aC.displayName=`StraightEdgeInternal`;function oC(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]=$v({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,W.jsx)(GS,{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 sC=oC({isInternal:!1}),cC=oC({isInternal:!0});sC.displayName=`BezierEdge`,cC.displayName=`BezierEdgeInternal`;var lC={default:cC,straight:aC,step:nC,smoothstep:$S,simplebezier:XS},uC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},dC=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,fC=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,pC=`react-flow__edgeupdater`;function mC({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,W.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:rf([pC,`${pC}-${s}`]),cx:dC(t,r,e),cy:fC(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function hC({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=Bb(),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`;$y.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,W.jsxs)(W.Fragment,{children:[(e===!0||e===`source`)&&(0,W.jsx)(mC,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,W.jsx)(mC,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function gC({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=zb(t=>t.edgeLookup.get(e)),x=zb(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||lC[S];C===void 0&&(v?.(`011`,V_.error011(S)),S=`default`,C=h?.default||lC.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=Bb(),{zIndex:N=b.zIndex,sourceX:P,sourceY:F,targetX:I,targetY:L,sourcePosition:R,targetPosition:z}=zb((0,_.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return uC;let i=my({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:v}),a=ty({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||uC,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,v]),Fb),ee=(0,_.useMemo)(()=>b.markerStart?`url('#${vy(b.markerStart,m)}')`:void 0,[b.markerStart,m]),B=(0,_.useMemo)(()=>b.markerEnd?`url('#${vy(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,W.jsx)(`svg`,{style:{zIndex:N},children:(0,W.jsxs)(`g`,{className:rf([`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&&U_.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?`${Wb}-${m}`:void 0,ref:D,...b.domAttributes,children:[!A&&(0,W.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,W.jsx)(hC,{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 _C=(0,_.memo)(gC),vC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function yC({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}=zb(vC,Fb),b=FS(t);return(0,W.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,W.jsx)(HS,{defaultColor:e,rfId:n}),b.map(e=>(0,W.jsx)(_C,{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))]})}yC.displayName=`EdgeRenderer`;var bC=(0,_.memo)(yC),xC=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function SC({children:e}){let t=Bb(),n=(0,_.useRef)(null),[r]=(0,_.useState)(()=>t.getState().transform);return jx(()=>{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=xC(r)))};return r(),t.subscribe(r)},[t]),(0,W.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:xC(r)},children:e})}function CC(e){let t=Rx(),n=(0,_.useRef)(!1);(0,_.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var wC=e=>e.panZoom?.syncViewport;function TC(e){let t=zb(wC),n=Bb();return(0,_.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function EC(e){return e.connection.inProgress?{...e.connection,to:Dv(e.connection.to,e.transform)}:{...e.connection}}function DC(e){return e?t=>e(EC(t)):EC}function OC(e){return zb(DC(e),Fb)}var kC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function AC({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=zb(kC,Fb);return a&&i&&c?(0,W.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,W.jsx)(`g`,{className:rf([`react-flow__connection`,Vv(s)]),children:(0,W.jsx)(jC,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var jC=({style:e,type:t=Y_.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}=OC();if(!i)return;if(n)return(0,W.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:Vv(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 Y_.Bezier:[m]=$v(h);break;case Y_.SimpleBezier:[m]=qS(h);break;case Y_.Step:[m]=fy({...h,borderRadius:0});break;case Y_.SmoothStep:[m]=fy(h);break;default:[m]=oy(h)}return(0,W.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};jC.displayName=`ConnectionLine`;var MC={};function NC(e=MC){(0,_.useRef)(e),Bb(),(0,_.useEffect)(()=>{},[e])}function PC(){Bb(),(0,_.useRef)(!1),(0,_.useEffect)(()=>{},[])}function FC({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 NC(e),NC(t),PC(),CC(n),TC(ye),(0,W.jsx)(wS,{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,W.jsxs)(SC,{children:[(0,W.jsx)(bC,{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,W.jsx)(AC,{style:h,type:m,component:g,containerStyle:_}),(0,W.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,W.jsx)(PS,{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,W.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}FC.displayName=`GraphView`;var IC=(0,_.memo)(FC),LC=Tv(`React Flow`,`https://reactflow.dev/`),RC=({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??H_;Ly(h,g,_);let{nodesInitialized:x}=Oy(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Mv(rv(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:H_,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:G_.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:{...J_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:LC,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:W_,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}},zC=({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})=>Pb((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 sv({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...RC({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}=Oy(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();Ly(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}=Py(e,n,r,i,a,o,l);d&&(Ty(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=gy(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=Ny(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(bx(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(xx(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=>Sx(e,!0)));return}i(Cx(r,new Set([...e]),!0)),a(Cx(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>Sx(e,!0)));return}a(Cx(n,new Set([...e]))),i(Cx(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(Sx(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(Sx(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,Sx(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,Sx(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])&&(Oy(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 Fy({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:{...J_}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...RC()})}},Object.is);function BC({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)(()=>zC({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,W.jsx)(Lb,{value:m,children:(0,W.jsx)(Fx,{children:(0,W.jsx)(oS,{children:p})})})}function VC({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)(Ib)?(0,W.jsx)(W.Fragment,{children:e}):(0,W.jsx)(BC,{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 HC={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function UC({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=Y_.Bezier,connectionLineStyle:ee,connectionLineComponent:B,connectionLineContainerStyle:V,deleteKeyCode:H=`Backspace`,selectionKeyCode:te=`Shift`,selectionOnDrag:U=!1,selectionMode:ne=q_.Full,panActivationKeyCode:re=`Space`,multiSelectionKeyCode:ie=Nv()?`Meta`:`Control`,zoomActivationKeyCode:ae=Nv()?`Meta`:`Control`,snapToGrid:oe,snapGrid:se,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:le,nodesDraggable:ue,autoPanOnNodeFocus:de,nodesConnectable:fe,nodesFocusable:pe,nodeOrigin:me=ax,edgesFocusable:he,edgesReconnectable:ge,elementsSelectable:_e=!0,defaultViewport:ve=ox,minZoom:ye=.5,maxZoom:be=2,translateExtent:xe=H_,preventScrolling:Se=!0,nodeExtent:Ce,defaultMarkerColor:we=`#b1b1b7`,zoomOnScroll:Te=!0,zoomOnPinch:Ee=!0,panOnScroll:De=!1,panOnScrollSpeed:Oe=.5,panOnScrollMode:ke=K_.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:We,onEdgeDoubleClick:Ge,onEdgeMouseEnter:Ke,onEdgeMouseMove:G,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=fx(wt),Nt=(0,_.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Et?.(e)},[Et]);return(0,W.jsx)(`div`,{"data-testid":`rf__wrapper`,...kt,onScroll:Nt,style:{...gt,...HC},ref:At,className:rf([`react-flow`,i,Mt]),id:_t,role:`application`,children:(0,W.jsxs)(VC,{nodes:e,edges:t,width:St,height:Ct,fitView:et,fitViewOptions:tt,minZoom:ye,maxZoom:be,nodeOrigin:me,nodeExtent:Ce,zIndexMode:Ot,children:[(0,W.jsx)(ux,{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,W.jsx)(IC,{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:We,onEdgeDoubleClick:Ge,onEdgeMouseEnter:Ke,onEdgeMouseMove:G,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,W.jsx)(ix,{onSelectionChange:A}),Be,(0,W.jsx)(Qb,{proOptions:it,position:rt}),(0,W.jsx)(Yb,{rfId:jt,disableKeyboardA11y:ct})]})})}var WC=Ax(UC);V_.error014();function GC({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,W.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rf([`react-flow__background-pattern`,n,r])})}function KC({radius:e,className:t}){return(0,W.jsx)(`circle`,{cx:e,cy:e,r:e,className:rf([`react-flow__background-pattern`,`dots`,t])})}var qC;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(qC||={});var JC={[qC.Dots]:1,[qC.Lines]:1,[qC.Cross]:6},YC=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function XC({id:e,variant:t=qC.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}=zb(YC,Fb),m=r||JC[t],h=t===qC.Dots,g=t===qC.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,W.jsxs)(`svg`,{className:rf([`react-flow__background`,l]),style:{...c,...Ux,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,W.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,W.jsx)(KC,{radius:b/2,className:u}):(0,W.jsx)(GC,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,W.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}XC.displayName=`Background`;var ZC=(0,_.memo)(XC);function QC(){return(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,W.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function $C(){return(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,W.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function ew(){return(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,W.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 tw(){return(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,W.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 nw(){return(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,W.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 rw({children:e,className:t,...n}){return(0,W.jsx)(`button`,{type:`button`,className:rf([`react-flow__controls-button`,t]),...n,children:e})}var iw=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function aw({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=Bb(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=zb(iw,Fb),{zoomIn:y,zoomOut:b,fitView:x}=Rx();return(0,W.jsxs)(Xb,{className:rf([`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,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(rw,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,W.jsx)(QC,{})}),(0,W.jsx)(rw,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,W.jsx)($C,{})})]}),n&&(0,W.jsx)(rw,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,W.jsx)(ew,{})}),r&&(0,W.jsx)(rw,{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,W.jsx)(nw,{}):(0,W.jsx)(tw,{})}),u]})}aw.displayName=`Controls`;var ow=(0,_.memo)(aw);function sw({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,W.jsx)(`rect`,{className:rf([`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 cw=(0,_.memo)(sw),lw=e=>e.nodes.map(e=>e.id),uw=e=>e instanceof Function?e:()=>e;function dw({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=cw,onClick:o}){let s=zb(lw,Fb),c=uw(t),l=uw(e),u=uw(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,W.jsx)(W.Fragment,{children:s.map(e=>(0,W.jsx)(pw,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function fw({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}=zb(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}=Fv(r);return{node:r,x:i,y:a,width:o,height:s}},Fb);return!l||l.hidden||!Iv(l)?null:(0,W.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 pw=(0,_.memo)(fw),mw=(0,_.memo)(dw),hw=200,gw=150,_w=e=>!e.hidden,vw=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?bv(rv(e.nodeLookup,{filter:_w}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},yw=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,bw=(e,t)=>yw(e.viewBB,t.viewBB)&&yw(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,xw=`react-flow__minimap-desc`;function Sw({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=Bb(),C=(0,_.useRef)(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:O,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=zb(vw,bw),M=e?.width??hw,N=e?.height??gw,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=`${xw}-${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=eb({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,W.jsx)(Xb,{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:rf([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,W.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,W.jsx)(`title`,{id:te,children:oe}),(0,W.jsx)(mw,{onClick:ae,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,W.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`})]})})}Sw.displayName=`MiniMap`;var Cw=(0,_.memo)(Sw),ww=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Tw={[hb.Line]:`right`,[hb.Handle]:`bottom-right`};function Ew({nodeId:e,position:t,variant:n=hb.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=rS(),b=typeof e==`string`?e:y,x=Bb(),S=(0,_.useRef)(null),C=n===hb.Handle,w=zb((0,_.useCallback)(ww(C&&p),[C,p]),Fb),T=(0,_.useRef)(null),E=t??Tw[n];(0,_.useEffect)(()=>{if(S.current&&b)return T.current||=Eb({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=Ny([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Lv({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,W.jsx)(`div`,{className:rf([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,_.memo)(Ew);var Dw=3,Ow=60,kw=140,Aw=e=>e.replace(/\s+/g,` `).trim();function jw(e){let t=Aw(e.description||e.proposed||e.name||`Tool call`);return t.length>Ow?`${t.slice(0,59)}…`:t}function Mw(e,t){if(t?.status===`ready`&&t.text)return t.text;if(e.length){let t=[...new Set(e.map(jw))],n=t.slice(0,Dw),r=n.join(` · `)+(t.length>n.length?` · +${t.length-n.length} more`:``);return r.length>kw?`${r.slice(0,139)}…`:r}return t?.status===`loading`?`Summarizing…`:t?.status===`error`?`Summary unavailable.`:`No tool calls in this request.`}var Nw=`raytrace-theme`;function Pw(){try{return localStorage.getItem(Nw)===`dark`?`dark`:`light`}catch{return`light`}}function Fw(){return typeof document<`u`&&document.documentElement.dataset.theme===`dark`?`dark`:`light`}function Iw(e){document.documentElement.dataset.theme=e;try{localStorage.setItem(Nw,e)}catch{}}typeof document<`u`&&(document.documentElement.dataset.theme=Pw());function Lw(e){let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()}function Rw(){return(0,_.useSyncExternalStore)(Lw,Fw,()=>`light`)}var zw=236,Bw=300;function Vw({data:e}){let t=e.failed===null?``:e.failed?`graph-node-fail`:`graph-node-ok`;return(0,W.jsxs)(`button`,{type:`button`,className:`graph-node ${t}`,onClick:e.onClick,children:[(0,W.jsx)(dS,{type:`target`,position:$.Left,style:{opacity:0}}),(0,W.jsx)(dS,{type:`source`,position:$.Right,style:{opacity:0}}),(0,W.jsxs)(`div`,{className:`graph-node-head`,children:[(0,W.jsxs)(`span`,{className:`graph-node-num`,children:[`Request #`,e.number]}),e.failed!==null&&(0,W.jsx)(`span`,{className:`graph-node-status ${e.failed?`fail`:`ok`}`,children:e.failed?`Failed`:`OK`})]}),(0,W.jsx)(`p`,{className:`graph-node-summary`,children:e.summaryText}),(0,W.jsxs)(`div`,{className:`graph-node-meta`,children:[(0,W.jsx)(`span`,{children:ad(e.cost,e.costEstimated)}),(0,W.jsx)(`span`,{children:od(e.durationMs)}),e.totalCalls>0&&(0,W.jsxs)(`span`,{className:e.verifiedCount===e.totalCalls?`graph-node-verified-all`:`graph-node-verified-partial`,children:[e.verifiedCount,`/`,e.totalCalls,` verified`]})]})]})}var Hw={request:Vw};function Uw({trace:e,blocks:t,summaries:n,onSelectStep:r}){let i=Rw(),{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*Bw,y:0},data:{number:e.number,summaryText:Mw(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:zw}}}),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,W.jsx)(`div`,{className:`graph-canvas`,children:(0,W.jsxs)(WC,{nodes:a,edges:o,nodeTypes:Hw,fitView:!0,proOptions:{hideAttribution:!0},colorMode:i,children:[(0,W.jsx)(ZC,{color:i===`dark`?`#30343a`:`#d5d8dc`,gap:24}),(0,W.jsx)(ow,{showInteractive:!1}),(0,W.jsx)(Cw,{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,W.jsx)(`div`,{className:`graph-empty`,children:`No model requests captured for this trace yet.`})}var Ww=[``,`Minimal`,`Low`,`Moderate`,`High`,`Critical`],Gw=[``,`Ignore`,`Routine`,`Watch`,`Review carefully`,`Lock down`],Kw={"content-type":`application/json`,"x-raytace-experiment":`1`};async function qw(e,t){let n=await e.json().catch(()=>({}));if(!e.ok)throw Error(n.error||t);return n}var Jw=async e=>qw(await x().fetch(`/raytace/sandboxes/${e}/files`,{cache:`no-store`}),`The initial scan could not be loaded.`),Yw=async(e,t)=>qw(await x().fetch(`/raytace/sandboxes/${e}/files`,{method:`POST`,headers:Kw,body:JSON.stringify({updates:t})}),`That change could not be saved.`),Xw=async(e,t,n,r)=>qw(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.`),Zw=async e=>qw(await x().fetch(`/raytace/alerts${e?`?sandbox=${e}`:``}`,{cache:`no-store`}),`Alerts could not be loaded.`);async function Qw(){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 $w=async e=>qw(await x().fetch(`/raytace/me`,{method:`POST`,headers:Kw,body:JSON.stringify({notify_email:e})}),`That setting could not be saved.`),eT=async e=>qw(await x().fetch(`/raytace/alerts/seen`,{method:`POST`,headers:Kw,body:JSON.stringify({ids:e})}),`Alerts could not be marked seen.`),tT=new Map;function nT(e){let[t,n]=(0,_.useState)(new Map);return(0,_.useEffect)(()=>{if(!e)return;let t=!1;return tT.has(e)||tT.set(e,Jw(e).then(e=>new Map(e.files.map(e=>[e.path,e])),()=>(tT.delete(e),new Map))),tT.get(e).then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}var rT=e=>{tT.delete(e)},iT={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`},aT={read:`a read`,write:`a write`,delete:`a delete`,rename:`a rename`,permissions:`a permission change`},oT={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.`]},sT={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.`]},cT=e=>new Date(e*1e3).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`,second:`2-digit`}),lT=e=>e>1?` ×${e.toLocaleString()}`:``,uT=e=>e?e.slice(0,8):null;function dT(e){let t=e.basis??{},n=uT(t.before?.sha256),r=uT(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 fT({fact:e,step:t,onOpenCall:n}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`td`,{title:e.command??void 0,children:e.process??(0,W.jsx)(`span`,{className:`rt-muted`,children:`–`})}),(0,W.jsx)(`td`,{className:`rt-scan-open`,children:t&&(0,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>n(t.trace,t.call),children:[`Open the step `,(0,W.jsx)(P,{size:11})]})})]})}function pT({fact:e}){return(0,W.jsxs)(W.Fragment,{children:[Object.entries(e.outcomes).map(([e,t],n)=>(0,W.jsxs)(`span`,{title:sT[e]?.[1],className:e===`refused_by_policy`||e===`failed`?`exec-fail`:void 0,children:[n?` · `:``,sT[e]?.[0]??e,lT(t)]},e)),e.errno&&(0,W.jsxs)(`span`,{className:`rt-muted`,children:[` (`,e.errno,`)`]})]})}function mT({fact:e}){let[t,n]=(0,_.useState)(!1),r=t?e.packages:e.packages.slice(0,12);return(0,W.jsxs)(W.Fragment,{children:[r.map(e=>(0,W.jsxs)(`code`,{title:e.source,className:`rt-package`,children:[e.name,`@`,e.version]},`${e.name}@${e.version}`)),e.packages.length>r.length&&(0,W.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,W.jsxs)(`span`,{className:`rt-muted`,children:[` and `,(e.total-e.packages.length).toLocaleString(),` not listed`]})]})}function hT({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 Xw(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,W.jsx)(`p`,{role:`alert`,className:`rt-problem`,children:a});if(!r)return(0,W.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,W.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,W.jsxs)(W.Fragment,{children:[u&&(0,W.jsxs)(`p`,{className:`rt-problem`,children:[`Some events were lost while these were recorded, so a row marked `,(0,W.jsx)(`em`,{children:`gaps`}),` may not be all that happened.`]}),(0,W.jsxs)(`div`,{className:`rt-list-head`,children:[(0,W.jsx)(`span`,{children:`NETWORK`}),(0,W.jsxs)(`small`,{children:[r.network.length,` destination`,r.network.length===1?``:`s`,r.more.includes(`network`)?`, newest shown`:``]})]}),r.network.length?(0,W.jsx)(`div`,{className:`rt-table-wrap`,children:(0,W.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`Last`}),(0,W.jsx)(`th`,{children:`Destination`}),(0,W.jsx)(`th`,{children:`Result`}),(0,W.jsx)(`th`,{children:`Program`}),(0,W.jsx)(`th`,{children:`Step`})]})}),(0,W.jsx)(`tbody`,{children:r.network.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(`time`,{children:cT(e.at)})}),(0,W.jsxs)(`td`,{children:[(0,W.jsxs)(`code`,{children:[e.host??e.ip,`:`,e.port]}),e.host&&(0,W.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,W.jsx)(`span`,{className:`rt-flag`,title:`Events were lost about then.`,children:`gaps`})]}),(0,W.jsx)(`td`,{children:(0,W.jsx)(pT,{fact:e})}),(0,W.jsx)(fT,{fact:e,step:t(e.call_id),onOpenCall:n})]},e.id))})]})}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`No connection left the sandbox.`}),c.length>0&&(0,W.jsxs)(`p`,{className:`rt-foot`,children:[`Looked up, with no connection seen: `,c.slice(0,40).map((e,t)=>(0,W.jsxs)(`span`,{title:e.failed?`The lookup failed: ${e.failed}`:e.addresses.join(`, `),children:[t?`, `:``,(0,W.jsx)(`code`,{children:e.name}),e.failed?` (${e.failed})`:``]},e.id)),c.length>40?` and ${c.length-40} more`:``,`.`]}),(0,W.jsx)(`div`,{className:`rt-list-head`,children:(0,W.jsx)(`span`,{children:`PACKAGES INSTALLED`})}),r.packages.length?(0,W.jsx)(`div`,{className:`rt-table-wrap`,children:(0,W.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`When`}),(0,W.jsx)(`th`,{children:`Manager`}),(0,W.jsx)(`th`,{children:`Packages`}),(0,W.jsx)(`th`,{children:`Basis`}),(0,W.jsx)(`th`,{children:`Program`}),(0,W.jsx)(`th`,{children:`Step`})]})}),(0,W.jsx)(`tbody`,{children:r.packages.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(`time`,{children:cT(e.at)})}),(0,W.jsxs)(`td`,{children:[e.manager,` `,(0,W.jsxs)(`span`,{className:`rt-muted`,children:[`· `,e.total.toLocaleString()]})]}),(0,W.jsx)(`td`,{className:`rt-scan-why`,children:(0,W.jsx)(mT,{fact:e})}),(0,W.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,W.jsx)(fT,{fact:e,step:t(e.call_id),onOpenCall:n})]},e.id))})]})}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`No package manager left anything new.`}),(0,W.jsxs)(`div`,{className:`rt-list-head`,children:[(0,W.jsx)(`span`,{children:`FILES, AS THE KERNEL SAW THEM`}),(0,W.jsx)(`small`,{children:`files marked Report or Restrict, and new sensitive ones`})]}),r.files.length?(0,W.jsx)(`div`,{className:`rt-table-wrap`,children:(0,W.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`When`}),(0,W.jsx)(`th`,{children:`File`}),(0,W.jsx)(`th`,{children:`What happened`}),(0,W.jsx)(`th`,{children:`How sure`}),(0,W.jsx)(`th`,{children:`Program`}),(0,W.jsx)(`th`,{children:`Step`})]})}),(0,W.jsx)(`tbody`,{children:r.files.map(e=>(0,W.jsxs)(`tr`,{className:e.effect===`attempted`?`rt-fact-refused`:void 0,title:dT(e),children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(`time`,{children:cT(e.at)})}),(0,W.jsxs)(`td`,{children:[e.path?(0,W.jsx)(`code`,{children:e.path}):(0,W.jsx)(`span`,{className:`rt-muted`,title:`gVisor reports this call by number, without its path.`,children:`file not reported`}),e.guard&&(0,W.jsx)(`span`,{className:`rt-flag`,children:e.guard})]}),(0,W.jsxs)(`td`,{children:[iT[e.effect]??e.effect,e.effect===`attempted`&&e.intent?`: ${aT[e.intent]??e.intent}`:``,e.to?(0,W.jsxs)(W.Fragment,{children:[` to `,(0,W.jsx)(`code`,{children:e.to})]}):null,lT(e.count),e.basis?.errno&&(0,W.jsxs)(`span`,{className:`rt-muted`,children:[` (`,e.basis.errno,`)`]})]}),(0,W.jsx)(`td`,{title:oT[e.certainty]?.[1],children:oT[e.certainty]?.[0]??e.certainty}),(0,W.jsx)(fT,{fact:e,step:t(e.call_id),onOpenCall:n})]},e.id))})]})}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`Nothing happened to a file marked Report or Restrict.`}),r.bulk.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`rt-list-head`,children:[(0,W.jsx)(`span`,{children:`BULK FILE ACCESS`}),(0,W.jsx)(`small`,{children:`counted, not kept`})]}),(0,W.jsx)(`ul`,{className:`rt-foot rt-bulk`,children:r.bulk.slice(0,20).map(e=>{let r=t(e.call_id);return(0,W.jsxs)(`li`,{children:[cT(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,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>n(r.trace,r.call),children:[`Open the step `,(0,W.jsx)(P,{size:11})]})]},e.id)})})]}),r.identity.length>0&&(0,W.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,W.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 gT(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}${lT(t.count)}`,title:Object.entries(t.outcomes).map(([e,t])=>`${sT[e]?.[0]??e}${lT(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()} ${(iT[t.effect]??t.effect).toLowerCase()}`,title:`${t.path}\n${oT[t.certainty]?.[1]??``}\n${dT(t)}`});return{byCall:t,byProcess:n}}var _T=200,vT={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.`]},yT={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`},bT={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.`},xT={A:`added`,M:`edited`,D:`deleted`,R:`renamed`,T:`type changed`},ST={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 CT(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 wT=e=>new Date(typeof e==`number`?e*1e3:e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`});function TT({level:e,title:t}){return(0,W.jsx)(`span`,{className:`rt-level level-${e}`,title:t??`Level ${e} of 5: ${Ww[e]}`,children:e})}function ET({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,W.jsx)(`p`,{className:`rt-empty`,children:r}):t?t.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`rt-list-head`,children:(0,W.jsx)(`span`,{children:`CHOOSE A SANDBOX`})}),(0,W.jsx)(`ol`,{className:`rt-prompts`,children:t.map(t=>(0,W.jsx)(`li`,{className:`rt-prompt`,children:(0,W.jsxs)(`button`,{type:`button`,className:`rt-prompt-row`,onClick:()=>e(t.id),children:[(0,W.jsx)(`time`,{children:wT(t.created)}),(0,W.jsx)(`strong`,{children:t.name}),(0,W.jsxs)(`small`,{children:[t.id.slice(0,12),`…`]})]})},t.id))})]}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`No sandboxes yet. A project is scanned when its sandbox is created.`}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`Loading…`})}function DT({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)(_T),[w,T]=(0,_.useState)([]),[E,D]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=!1;return Qw().then(t=>{e||D(t)}),()=>{e=!0}},[]),(0,_.useEffect)(()=>{if(o(null),c(null),u(null),C(_T),x(new Set([5,4,3,2,1])),!e)return;let t=!1;return Jw(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 Zw(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 Yw(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)}),rT(e)}catch(t){u(t instanceof Error?t.message:`That change could not be saved.`),Jw(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)(()=>CT(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 $w(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 eT(e)}catch{}i()},re=a?.scan;return(0,W.jsxs)(`section`,{className:`rt-view`,children:[(0,W.jsxs)(`header`,{className:`rt-view-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`INITIAL SCAN`}),(0,W.jsx)(`h1`,{children:a?.name?`How risky each file of ${a.name} is to change`:`How risky each file is to change`})]}),e&&(0,W.jsx)(`div`,{className:`rt-actions`,children:(0,W.jsx)(`button`,{type:`button`,className:`rt-button`,onClick:()=>n(``),children:`Another sandbox`})})]}),!e&&(0,W.jsx)(ET,{onSelect:n}),e&&s&&(0,W.jsx)(`p`,{role:`alert`,className:`verify-error`,children:s}),e&&!s&&!a&&(0,W.jsx)(`p`,{className:`rt-empty`,children:`Loading…`}),a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`dl`,{className:`rt-stats`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Files`}),(0,W.jsx)(`dd`,{children:k.length.toLocaleString()})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Level`}),(0,W.jsx)(`dd`,{className:`rt-sev-counts`,children:[5,4,3,2,1].map(e=>(0,W.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} (${Gw[e].toLowerCase()})`,onClick:()=>{m(t=>t===e?null:e),C(_T)},children:[e,` · `,A.byLevel[e]]},e))})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Reported when changed`}),(0,W.jsx)(`dd`,{children:(0,W.jsxs)(`button`,{type:`button`,className:`rt-pick${h===`notify`?` on`:``}`,"aria-pressed":h===`notify`,onClick:()=>{g(e=>e===`notify`?null:`notify`),C(_T)},children:[(0,W.jsx)(I,{size:13}),` `,A.notify]})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Restricted`}),(0,W.jsx)(`dd`,{children:(0,W.jsxs)(`button`,{type:`button`,className:`rt-pick${h===`restricted`?` on`:``}`,"aria-pressed":h===`restricted`,onClick:()=>{g(e=>e===`restricted`?null:`restricted`),C(_T)},children:[(0,W.jsx)(se,{size:13}),` `,A.restricted]})})]})]}),(0,W.jsxs)(`div`,{className:`rt-tabs`,role:`tablist`,children:[(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":d===`files`,className:d===`files`?`on`:``,onClick:()=>f(`files`),children:`Files`}),(0,W.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":d===`alerts`,className:d===`alerts`?`on`:``,onClick:()=>f(`alerts`),children:[`Alerts`,V.length>0&&(0,W.jsx)(`span`,{className:`rt-count`,children:V.length})]}),(0,W.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":d===`activity`,className:d===`activity`?`on`:``,onClick:()=>f(`activity`),children:`Activity`})]}),l&&(0,W.jsx)(`p`,{role:`alert`,className:`rt-problem`,children:l}),d===`files`&&(0,W.jsxs)(W.Fragment,{children:[re&&`error`in re&&(0,W.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,W.jsx)(`p`,{className:`rt-empty`,children:`This sandbox was created before RayTrace scanned projects, so it has no scan.`}),k.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.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(_T)}}),(0,W.jsx)(`div`,{className:`rt-table-wrap`,children:(0,W.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`Level`}),(0,W.jsx)(`th`,{children:`File`}),(0,W.jsx)(`th`,{children:`Why`}),(0,W.jsx)(`th`,{title:`Report it when the agent changes this file`,children:`Report`}),(0,W.jsx)(`th`,{title:`The agent may not change this file`,children:`Restrict`})]})}),L.map(e=>(0,W.jsxs)(`tbody`,{children:[(0,W.jsx)(`tr`,{className:`rt-scan-group`,children:(0,W.jsx)(`td`,{colSpan:5,children:(0,W.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,W.jsx)(B,{size:13}):(0,W.jsx)(ee,{size:13}),(0,W.jsx)(`span`,{className:`rt-level level-${e.level}`,children:e.level}),Gw[e.level],(0,W.jsxs)(`span`,{className:`rt-muted`,children:[e.total.toLocaleString(),` file`,e.total===1?``:`s`]})]})})}),!e.closed&&e.files.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsxs)(`td`,{className:`rt-scan-level`,children:[(0,W.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,W.jsxs)(`option`,{value:t,children:[t,` `,Gw[t],t===e.scanned_level?` (scanned)`:``]},t))}),e.edited&&(0,W.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,W.jsx)(pe,{size:11})})]}),(0,W.jsx)(`td`,{children:(0,W.jsx)(`code`,{children:e.path})}),(0,W.jsxs)(`td`,{className:`rt-scan-why`,children:[e.reasons.join(` · `)||(0,W.jsx)(`span`,{className:`rt-muted`,children:`Nothing imports it, and its name marks nothing`}),R(e)&&(0,W.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,W.jsx)(`span`,{className:`rt-flag`,title:vT[e]?.[1],children:vT[e]?.[0]??e},e)),e.restricted&&(0,W.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,W.jsx)(`td`,{children:(0,W.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,W.jsx)(`td`,{children:(0,W.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,W.jsx)(`p`,{className:`rt-empty`,children:`No files match.`}),j.length>S&&(0,W.jsxs)(`p`,{className:`rt-foot`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>C(e=>e+_T),children:[`Show `,Math.min(_T,j.length-S),` more`]}),` `,S.toLocaleString(),` of `,j.length.toLocaleString(),` shown`]}),re&&!(`error`in re)&&(0,W.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,W.jsxs)(W.Fragment,{children:[E!==null&&(0,W.jsxs)(`label`,{className:`rt-foot rt-email`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:E,onChange:e=>void U(e.target.checked)}),` Email me about alerts`,(0,W.jsx)(`span`,{className:`rt-muted`,children:` · batched, at most one message every 30 seconds per project`})]}),!w.length&&(0,W.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,W.jsxs)(W.Fragment,{children:[V.length>0&&(0,W.jsx)(`p`,{className:`rt-foot`,children:(0,W.jsx)(`button`,{type:`button`,className:`rt-button`,onClick:()=>void ne(V.map(e=>e.id)),children:`Mark all seen`})}),(0,W.jsx)(`div`,{className:`rt-table-wrap`,children:(0,W.jsxs)(`table`,{className:`rt-table rt-scan`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`When`}),(0,W.jsx)(`th`,{children:`Level`}),(0,W.jsx)(`th`,{children:`File or destination`}),(0,W.jsx)(`th`,{children:`What happened`}),(0,W.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,W.jsx)(`th`,{title:`The agent's tool, and the program the kernel saw do it`,children:`Tool`}),(0,W.jsx)(`th`,{children:`Step`})]})}),(0,W.jsx)(`tbody`,{children:H.map(e=>{let t=te(e.call_id);return(0,W.jsxs)(`tr`,{className:`${e.seen?`rt-seen`:``}${e.kind===`restricted_blocked`||e.kind===`network_refused`?` rt-alert-blocked`:``}`,children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(`time`,{title:e.at?`Seen at ${new Date(e.at*1e3).toISOString()}`:void 0,children:wT(e.at??e.created)})}),(0,W.jsx)(`td`,{children:(0,W.jsx)(TT,{level:e.level})}),(0,W.jsx)(`td`,{children:(0,W.jsx)(`code`,{children:e.path})}),(0,W.jsxs)(`td`,{title:bT[e.kind],children:[(e.kind===`restricted_blocked`||e.kind===`network_refused`)&&(0,W.jsx)(F,{size:12,"aria-hidden":`true`}),` `,yT[e.kind]??e.kind,e.status&&xT[e.status]?(0,W.jsxs)(`span`,{className:`rt-muted`,children:[` · `,xT[e.status]]}):null,e.added!=null&&(0,W.jsxs)(`span`,{className:`rt-muted`,children:[` · +`,e.added,` −`,e.removed??0]})]}),(0,W.jsx)(`td`,{children:[...e.sources].sort().reverse().map(e=>(0,W.jsx)(`span`,{className:`rt-flag rt-source-${e}`,title:ST[e],children:e},e))}),(0,W.jsx)(`td`,{children:e.tool||e.by?(0,W.jsxs)(W.Fragment,{children:[e.tool,e.tool&&e.by?` · `:``,e.by&&(0,W.jsx)(`span`,{title:`The program the kernel saw do it`,children:e.by})]}):(0,W.jsx)(`span`,{className:`rt-muted`,children:`–`})}),(0,W.jsx)(`td`,{className:`rt-scan-open`,children:t&&(0,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>{ne(e.ids),r(t.trace,t.call)},children:[`Open the step `,(0,W.jsx)(P,{size:11})]})})]},e.id)})})]})})]})]}),d===`activity`&&(0,W.jsx)(hT,{box:e,stepFor:te,onOpenCall:r})]})]})}function OT(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 kT(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 AT=(e,t)=>`raytrace-${e.id.slice(0,8)}${t?`-${t.split(`/`).at(-1)}`:``}.patch`,jT=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function MT(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=jT.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 NT=e=>/^[0-9a-f]{40}$/.test(e)||e.startsWith(`refs/forks/`);async function PT(e,t,n,r){if(!NT(t)||!NT(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(kT(o.error??`HTTP ${a.status}`));return{diff:o.diff??``,truncated:!!o.truncated}}function FT(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 IT=e=>e.startsWith(`+`)&&!e.startsWith(`+++`)?`add`:e.startsWith(`-`)&&!e.startsWith(`---`)?`del`:e.startsWith(`@@`)?`hunk`:``,LT=`raytace.diff-view`;function RT(){let[e,t]=(0,_.useState)(`split`);return(0,_.useEffect)(()=>{try{localStorage.getItem(LT)===`unified`&&t(`unified`)}catch{}},[]),[e,e=>{t(e);try{localStorage.setItem(LT,e)}catch{}}]}function zT({diff:e}){let t=(0,_.useMemo)(()=>MT(e),[e]),[n,r]=RT();return t.binary?(0,W.jsx)(`p`,{className:`rt-files-note`,children:`A binary file: it changed, but there are no lines to show.`}):t.hunks.length?(0,W.jsxs)(`div`,{className:`rt-diff-wrap`,children:[(0,W.jsxs)(`div`,{className:`rt-diff-bar`,children:[(0,W.jsxs)(`span`,{children:[(0,W.jsxs)(`b`,{className:`rt-diff-add-n`,children:[`+`,t.additions]}),` `,(0,W.jsxs)(`b`,{className:`rt-diff-del-n`,children:[`−`,t.deletions]})]}),(0,W.jsxs)(`span`,{className:`rt-diff-mode`,children:[(0,W.jsx)(`button`,{type:`button`,"aria-pressed":n===`split`,className:n===`split`?`on`:``,onClick:()=>r(`split`),children:`Split`}),(0,W.jsx)(`button`,{type:`button`,"aria-pressed":n===`unified`,className:n===`unified`?`on`:``,onClick:()=>r(`unified`),children:`Unified`})]})]}),n===`unified`?(0,W.jsx)(`pre`,{className:`rt-diff`,children:e.split(`
29
+ `).map((e,t)=>(0,W.jsxs)(`span`,{className:IT(e),children:[e,`
30
+ `]},t))}):(0,W.jsx)(`div`,{className:`rt-diff-scroll`,children:(0,W.jsxs)(`table`,{className:`rt-diff-split`,children:[(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`rt-diff-ln-col`}),(0,W.jsx)(`col`,{}),(0,W.jsx)(`col`,{className:`rt-diff-ln-col`}),(0,W.jsx)(`col`,{})]}),(0,W.jsx)(`tbody`,{children:t.hunks.map((e,t)=>(0,W.jsxs)(_.Fragment,{children:[(0,W.jsx)(`tr`,{className:`rt-diff-hunk`,children:(0,W.jsx)(`td`,{colSpan:4,children:e.header})}),e.rows.map((e,t)=>e.note?(0,W.jsx)(`tr`,{className:`rt-diff-note-row`,children:(0,W.jsx)(`td`,{colSpan:4,children:e.note})},t):(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`rt-diff-ln${e.oldText!=null&&e.oldText!==e.newText?` del`:``}`,children:e.oldNo??``}),(0,W.jsx)(`td`,{className:`rt-diff-code${e.oldText==null?` empty`:e.oldText===e.newText?``:` del`}`,children:e.oldText??``}),(0,W.jsx)(`td`,{className:`rt-diff-ln${e.newText!=null&&e.oldText!==e.newText?` add`:``}`,children:e.newNo??``}),(0,W.jsx)(`td`,{className:`rt-diff-code${e.newText==null?` empty`:e.oldText===e.newText?``:` add`}`,children:e.newText??``})]},t))]},t))})]})})]}):(0,W.jsx)(`pre`,{className:`rt-diff`,children:e||`(no difference)`})}function BT({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 PT(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,W.jsx)(`p`,{className:`rt-files-note`,children:o}):i?(0,W.jsxs)(W.Fragment,{children:[i.diff?(0,W.jsx)(zT,{diff:i.diff}):(0,W.jsx)(`pre`,{className:`rt-diff`,children:`(no difference)`}),i.truncated&&(0,W.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,W.jsx)(`p`,{className:`rt-files-note`,children:`Loading diff…`}):(0,W.jsx)(`p`,{className:`rt-files-note`,children:`No sandbox holds this snapshot, so there is no diff to load.`})}function VT(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 HT({snapshot:e,sandbox:t}){let n={A:`added`,M:`edited`,D:`deleted`,T:`type changed`},r=nT(t),[i,a]=(0,_.useState)(null);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`h4`,{children:[`Files changed `,(0,W.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,W.jsx)(`ul`,{className:`rt-files`,children:e.changes.map(o=>(0,W.jsxs)(_.Fragment,{children:[(0,W.jsxs)(`li`,{children:[(0,W.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,W.jsx)(B,{size:12,className:`rt-caret${i===o.path?` down`:``}`}),(0,W.jsx)(`span`,{className:`rt-file-status s-${o.status}`,children:n[o.status]??o.status}),(0,W.jsx)(`code`,{children:o.path})]}),(r.get(o.path)?.level??0)>=3&&(0,W.jsx)(TT,{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,W.jsx)(`span`,{className:`rt-flag`,title:`Its owner restricted this file: the agent was not meant to change it`,children:`restricted`}),(0,W.jsx)(`small`,{children:o.added==null?`binary`:`+${o.added} −${o.removed}`})]}),i===o.path&&(0,W.jsx)(`li`,{className:`rt-file-diff`,children:(0,W.jsx)(BT,{sandbox:t,from:e.parent??`4b825dc642cb6eb9a060e54bf8d69288fbee4904`,to:e.commit,path:o.path})})]},o.path))}):(0,W.jsx)(`p`,{className:`rt-files-note`,children:`No files changed.`}),e.too_big.length>0&&(0,W.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 UT(e,t){let n=Wu(e,t);return n?JSON.stringify(n,null,2):``}var WT=`raytace.group-steps`;function GT(){let[e,t]=(0,_.useState)(!0);return(0,_.useEffect)(()=>{try{localStorage.getItem(WT)===`off`&&t(!1)}catch{}},[]),[e,e=>{t(e);try{localStorage.setItem(WT,e?`on`:`off`)}catch{}}]}function KT(e,t){let n=Wu(e,t),r=[n?.file_path,n?.notebook_path].find(e=>typeof e==`string`&&e);return typeof r==`string`?r:null}var qT=(e,t)=>Uu(e,t,Ne(e.events,t.call_id),KT(e,t));function JT({name:e,section:t}){return(0,W.jsxs)(`th`,{children:[e,(0,W.jsx)(`a`,{className:`rt-th-help`,href:`${Lu}#${t}`,target:`_blank`,rel:`noreferrer`,"aria-label":`What the ${e} labels mean (opens in a new tab)`,children:(0,W.jsx)(ae,{size:11})})]})}function YT({group:e,trace:t,open:n,onToggle:r}){let i=id(e,t),a=e.calls.map(e=>qT(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=>Ou(e.ended_at)-Ou(e.started_at)).filter(Number.isFinite);return(0,W.jsxs)(`tr`,{className:`rt-row rt-group-row${n?` open`:``}`,onClick:r,children:[(0,W.jsxs)(`td`,{className:`rt-num`,children:[(0,W.jsx)(B,{size:12,className:`rt-caret`}),i.range.slice(1)]}),(0,W.jsxs)(`td`,{className:`rt-tool`,children:[i.kind,(0,W.jsxs)(`small`,{className:`rt-changed`,children:[e.calls.length,` steps`]})]}),(0,W.jsxs)(`td`,{className:`rt-cmd rt-group-label`,children:[i.label,i.flags.map(e=>(0,W.jsx)(`span`,{className:`rt-group-flag`,children:e},e))]}),(0,W.jsx)(`td`,{className:`rt-reported`,children:i.outcome}),(0,W.jsx)(`td`,{children:d||`—`}),(0,W.jsx)(`td`,{className:`rt-time`,children:f.length?ku(f.reduce((e,t)=>e+t,0)):`—`})]})}function XT({label:e,onOpen:t}){return!e.opens||!t?(0,W.jsx)(`span`,{className:`rt-ran ${e.tone}`,children:e.text}):(0,W.jsx)(`button`,{type:`button`,className:`rt-ran ${e.tone} rt-ran-link`,onClick:e=>{e.stopPropagation(),t()},children:e.text})}function ZT({call:e}){let t=e.category?Ru[e.category]:null;return!t||t.toLowerCase()===e.name.toLowerCase()?(0,W.jsx)(W.Fragment,{children:e.name}):(0,W.jsxs)(W.Fragment,{children:[t,(0,W.jsxs)(`span`,{className:`rt-tool-name`,children:[` · `,e.name]})]})}function QT({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=VT(e),m=ke(e.events),h=e.callVerifications??[],[g,v]=GT(),[y,b]=(0,_.useState)(()=>new Set),x=g?nd(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`,ad(Ae(j,`cost`),j.some(e=>e.costEstimated))],[`Time`,od(je(j))],[`Tokens in / out`,`${sd(Ae(j,`input`))} / ${sd(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,W.jsxs)(`section`,{className:`rt-view`,children:[(0,W.jsxs)(`header`,{className:`rt-view-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`TOOL CALLS`}),(0,W.jsx)(`h1`,{children:`How the agent got there`})]}),(0,W.jsxs)(`div`,{className:`rt-actions`,children:[(0,W.jsx)(nf,{traces:t,currentId:e.id}),!s&&(0,W.jsxs)(`label`,{className:`rt-toggle`,title:`Fold runs of similar steps, such as repeated searches for the same thing, into one row`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>v(e.target.checked)}),` Group similar steps`]}),(0,W.jsxs)(`button`,{type:`button`,className:`visualize-button ${s?`active`:``}`,onClick:()=>c(!s),children:[(0,W.jsx)(Ce,{size:14}),` `,s?`Back to list`:`Graph`]}),e.sandboxId&&r&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>r(),children:[`Sandbox evidence `,(0,W.jsx)(P,{size:14})]})]})]}),(0,W.jsx)(`dl`,{className:`rt-stats`,children:N.map(([e,t])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:e}),(0,W.jsx)(`dd`,{children:t})]},e))}),s?(0,W.jsx)(Uw,{trace:e,blocks:m,summaries:p,onSelectStep:()=>c(!1)}):(0,W.jsx)(`div`,{className:`rt-table-wrap`,children:(0,W.jsxs)(`table`,{className:`rt-table rt-calls`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`#`}),(0,W.jsx)(JT,{name:`Tool`,section:`tool-categories`}),(0,W.jsx)(`th`,{children:`Command`}),(0,W.jsx)(`th`,{children:`Agent reported`}),(0,W.jsx)(JT,{name:`Sandbox`,section:`sandbox-labels`}),(0,W.jsx)(`th`,{children:`Ran for`})]})}),(0,W.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,W.jsxs)(_.Fragment,{children:[(0,W.jsx)(`tr`,{className:`rt-trip`,children:(0,W.jsxs)(`td`,{colSpan:6,children:[(0,W.jsxs)(`span`,{children:[`Round trip `,t.number]}),c?.status===`ready`&&(0,W.jsx)(`em`,{children:c.text}),(0,W.jsxs)(`small`,{children:[s?`${ad(s.cost,s.costEstimated)} · ${od(s.durationMs)}`:``,d?` · failed`:``,g&&!m.length?` · answered`:``]})]})}),m.map(t=>{let s=Ne(e.events,t.call_id),c=Uu(e,t,s,KT(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=Ou(t.started_at),h=Ou(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,W.jsx)(YT,{group:v,trace:e,open:C(v),onToggle:()=>w(v)}):null;return v&&!C(v)?(0,W.jsx)(_.Fragment,{children:y},t.call_id):(0,W.jsxs)(_.Fragment,{children:[y,(0,W.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,W.jsxs)(`td`,{className:`rt-num`,children:[(0,W.jsx)(B,{size:12,className:`rt-caret`}),E.get(t.call_id)]}),(0,W.jsxs)(`td`,{className:`rt-tool`,children:[(0,W.jsx)(ZT,{call:t}),t.snapshot?.changed&&(0,W.jsxs)(`small`,{className:`rt-changed`,title:`Files this call changed`,children:[t.snapshot.changes.length,` file`,t.snapshot.changes.length===1?``:`s`]})]}),(0,W.jsx)(`td`,{className:`rt-cmd`,children:t.description?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`rt-plain`,children:t.description}),(0,W.jsx)(`span`,{className:`rt-cmd-raw`,title:t.proposed??void 0,children:(0,W.jsx)(ju,{text:t.proposed||t.name})})]}):(0,W.jsx)(ju,{text:t.proposed||t.name})}),(0,W.jsx)(`td`,{className:`rt-reported ${s.state}`,children:s.state===`none`?`—`:s.state===`rejected`?`rejected`:s.code==null?s.state:`exit ${s.code}`}),(0,W.jsx)(`td`,{children:(0,W.jsx)(XT,{label:c,onOpen:d})}),(0,W.jsx)(`td`,{className:`rt-time`,children:Number.isFinite(m)&&Number.isFinite(h)?ku(h-m):`—`})]}),p&&(0,W.jsx)(`tr`,{className:`rt-expand`,children:(0,W.jsxs)(`td`,{colSpan:6,children:[(0,W.jsx)(`h4`,{children:`Arguments`}),(0,W.jsx)(`pre`,{children:UT(e,t)}),(0,W.jsx)(`h4`,{children:`Output the agent got back`}),(0,W.jsx)(`pre`,{children:s.output.trim()||`(no result captured)`}),t.snapshot&&(0,W.jsx)(`div`,{id:`files-${t.call_id}`,children:(0,W.jsx)(HT,{snapshot:t.snapshot,sandbox:e.sandboxId})}),(0,W.jsxs)(`div`,{className:`rt-actions`,children:[t.exec_id&&r&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>r(t.call_id),children:[`Show in sandbox `,(0,W.jsx)(P,{size:14})]}),i&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>i(g),children:[(0,W.jsx)(oe,{size:14}),` What it had in context`]}),O&&a&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>a(t.call_id),children:[(0,W.jsx)(R,{size:14}),` Why?`]}),D&&(0,W.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,W.jsx)(ie,{size:14}),` Fork from here`]}),D&&A(t.exchange_id)&&(0,W.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,W.jsx)(ie,{size:14}),` Rerun without this output`]})]})]})})]},t.call_id)})]},t.exchangeId)})})]})})]})}function $T(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 eE={likely:`likely`,possible:`possibly`,unclear:`unclear`};function tE({trace:e,onStep:t}){let{state:n,retry:r}=$T(e);if(n.status===`idle`)return null;let i=e.callVerifications??[],a=e=>e.steps.length>0&&(0,W.jsx)(`span`,{className:`rt-recap-steps`,children:e.steps.map(e=>t&&i[e-1]?(0,W.jsx)(`button`,{type:`button`,className:`rt-recap-step`,onClick:()=>t(i[e-1].call_id),title:`Open step ${e}`,children:e},e):(0,W.jsx)(`span`,{className:`rt-recap-step`,children:e},e))});return(0,W.jsxs)(`section`,{className:`rt-recap`,"aria-label":`Recap`,children:[(0,W.jsxs)(`header`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`RECAP`}),n.status===`ready`&&(0,W.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,W.jsx)(`p`,{className:`rt-muted`,children:`Reading the run…`}),n.status===`error`&&(0,W.jsxs)(`p`,{className:`rt-muted`,children:[n.message,` `,(0,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:r,children:[(0,W.jsx)(me,{size:11}),` Try again`]})]}),n.status===`ready`&&(0,W.jsxs)(W.Fragment,{children:[n.recap.headline&&(0,W.jsx)(`p`,{className:`rt-recap-headline`,children:n.recap.headline}),(0,W.jsx)(`h4`,{children:`What happened`}),(0,W.jsx)(`ol`,{className:`rt-recap-list`,children:n.recap.happened.map((e,t)=>(0,W.jsxs)(`li`,{children:[e.text,` `,a(e)]},t))}),n.recap.reasoning.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`h4`,{children:[`Probably why `,(0,W.jsx)(`small`,{children:`the observer's reading of the sequence, not a measurement`})]}),(0,W.jsx)(`ul`,{className:`rt-recap-list`,children:n.recap.reasoning.map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`rt-recap-sure s-${e.confidence??`possible`}`,children:eE[e.confidence??`possible`]}),` `,e.text,` `,a(e)]},t))})]}),n.recap.flags.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{children:`Worth checking`}),(0,W.jsx)(`ul`,{className:`rt-recap-list rt-recap-flags`,children:n.recap.flags.map((e,t)=>(0,W.jsxs)(`li`,{children:[e.text,` `,a(e)]},t))})]})]})]})}var nE=e=>`${e.exchange_id}:${e.output_index}`,rE=e=>`${Math.round(e*100)}%`,iE=.02,aE={user:`Your request`,tool_result:`Earlier result`,agent:`Agent's earlier plan`,project:`Project instructions`,habit:`Routine step`,explore:`Exploring`};function oE(e){let[t,n]=(0,_.useState)({}),r=(0,_.useRef)(new Set),i=(0,_.useCallback)(async(e,t)=>{let i=nE(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(nE).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 sE(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[nE(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=id(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:aE[u.kind].toLowerCase(),callId:null});break}}return o.length>1||o[0]?.callId?o:null}function cE({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,W.jsxs)(`div`,{className:`rt-cot-ran`,children:[(0,W.jsx)(`span`,{className:`workspace-label`,children:`WHAT ACTUALLY RAN`}),` `,r.join(` · `),i&&(0,W.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,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`Files changed`}),(0,W.jsx)(HT,{snapshot:e.snapshot,sandbox:t.sandboxId})]})]})}function lE({attribution:e,number:t,onJump:n}){let r=e.ranked?e.causes.filter(e=>(e.probability??0)>=iE):e.causes;return(0,W.jsxs)(W.Fragment,{children:[e.ranked&&(0,W.jsx)(`div`,{className:`rt-cot-bar`,"aria-hidden":`true`,children:r.map(e=>(0,W.jsx)(`span`,{className:`k-${e.kind}`,style:{width:rE(e.probability??0)},title:`${rE(e.probability??0)} ${e.reason}`},e.key))}),!e.ranked&&(0,W.jsxs)(`p`,{className:`rt-cot-note`,children:[`Possible reasons, unranked`,e.unsure_reason?`: ${e.unsure_reason}`:`.`]}),(0,W.jsx)(`ol`,{className:`rt-cot-causes`,children:r.map(e=>{let r=e.source_call_id?t(e.source_call_id):null;return(0,W.jsxs)(`li`,{children:[e.probability==null?(0,W.jsx)(`span`,{"aria-hidden":`true`}):(0,W.jsx)(`strong`,{className:`rt-cot-pct`,children:rE(e.probability)}),(0,W.jsx)(`i`,{className:`rt-cot-dot k-${e.kind}`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{children:e.reason}),(0,W.jsxs)(`small`,{children:[aE[e.kind],r&&(0,W.jsxs)(W.Fragment,{children:[` · `,(0,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>n(e.source_call_id),children:[`step #`,r]})]})]}),e.quote&&(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`Evidence`}),(0,W.jsx)(`blockquote`,{children:e.quote})]})]})]},e.key)})})]})}function uE({call:e,index:t,trace:n,states:r,chain:i,highlight:a,number:o,onJump:s}){let c=r[nE(e)],l=c?.status===`ready`?c.attribution:null;return(0,W.jsxs)(`li`,{id:`cot-${e.call_id}`,className:`rt-cot-step${a?` rt-focus`:``}`,children:[(0,W.jsxs)(`div`,{className:`rt-cot-head`,children:[(0,W.jsxs)(`span`,{className:`rt-cot-num`,children:[`#`,t+1]}),(0,W.jsx)(`strong`,{children:e.name}),(0,W.jsx)(ju,{text:e.proposed||e.name}),l?.purpose&&(0,W.jsx)(`span`,{className:`rt-chip`,title:l.purpose.label,children:l.purpose.choice.replace(`_`,` `)}),l?.unsure&&(0,W.jsx)(`span`,{className:`rt-cot-unsure`,title:l.unsure_reason??``,children:`Unsure`})]}),(0,W.jsx)(dE,{state:c,number:o,onJump:s}),i&&(0,W.jsxs)(`p`,{className:`rt-cot-chain`,children:[(0,W.jsx)(`span`,{className:`workspace-label`,children:`CHAIN`}),i.map((e,t)=>(0,W.jsxs)(`span`,{children:[e.callId?(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>s(e.callId),children:e.label}):e.label,` → `]},t)),(0,W.jsx)(`span`,{children:`this step`})]}),(0,W.jsx)(cE,{call:e,trace:n})]})}function dE({state:e,number:t,onJump:n}){if(!e||e.status===`loading`)return(0,W.jsx)(`p`,{className:`rt-cot-note`,children:`Working out why…`});if(e.status===`error`)return(0,W.jsx)(`p`,{className:`rt-cot-note`,children:e.message});let{attribution:r}=e;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lE,{attribution:r,number:t,onJump:n}),r.unsure&&r.unsure_reason&&(0,W.jsxs)(`p`,{className:`rt-cot-note`,children:[`Unsure: `,r.unsure_reason]})]})}function fE({trace:e,focusCall:t}){let n=Pe(e),r=n.where===`sandbox`?e.callVerifications??[]:[],i=nd(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=oE(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,W.jsx)(`header`,{className:`rt-view-head`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`CHAIN OF THOUGHT`}),(0,W.jsx)(`h1`,{children:`Why the agent did each step`}),(0,W.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,W.jsxs)(`section`,{className:`rt-view`,children:[h,(0,W.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,W.jsx)(`code`,{children:`raytrace sandbox create --local`}),`.`]})]});if(!r.length)return(0,W.jsxs)(`section`,{className:`rt-view`,children:[h,(0,W.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,W.jsx)(uE,{call:t,index:r.indexOf(t),trace:e,states:u,chain:sE(t,r,u,a,e),highlight:d===t.call_id,number:p,onJump:m},t.call_id);return(0,W.jsxs)(`section`,{className:`rt-view`,children:[h,(0,W.jsx)(tE,{trace:e,onStep:m}),(0,W.jsx)(`ol`,{className:`rt-cot-steps`,children:i.map(t=>{if(t.calls.length===1)return y(t.calls[0]);let n=id(t,e),r=c(t),i=t.calls[0];return(0,W.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,W.jsxs)(`div`,{className:`rt-cot-head`,children:[(0,W.jsx)(`span`,{className:`rt-cot-num`,children:n.range}),(0,W.jsx)(`strong`,{children:n.label}),(0,W.jsxs)(`span`,{className:`rt-chip`,children:[t.calls.length,` steps`]}),n.flags.map(e=>(0,W.jsx)(`span`,{className:`rt-group-flag`,children:e},e))]}),(0,W.jsxs)(`p`,{className:`rt-cot-note`,children:[`Why it started (step #`,t.first,`):`]}),(0,W.jsx)(dE,{state:u[nE(i)],number:p,onJump:m}),n.repeated&&(0,W.jsxs)(`p`,{className:`rt-cot-note`,children:[n.repeated,` `,n.outcome[0].toUpperCase()+n.outcome.slice(1),`.`]}),(0,W.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,W.jsx)(`ol`,{className:`rt-cot-steps rt-cot-members`,children:t.calls.map(y)})]},t.id)})}),v&&(0,W.jsxs)(`p`,{className:`rt-foot`,children:[`Causes proposed and ranked by `,v,`. Each step is worked out once and saved.`]})]})}var pE=`/raytace`,mE=e=>[`queued`,`running`].includes(e.status),hE=e=>e===null?`Not measured`:`${Math.round(e*100)}%`;async function gE(e,t){let n=await fetch(`${pE}${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 _E(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 vE({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 gE(`/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 gE(`/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 gE(`/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(mE),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 gE(`/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 gE(`/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,W.jsxs)(`aside`,{className:`fork-panel lab decision-lab`,children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`COUNTERFACTUAL LAB`}),(0,W.jsx)(`h2`,{children:`Explore this decision`}),!n&&!D&&!T&&(0,W.jsx)(`p`,{children:`Select a proposed tool call or model answer in the sequence.`}),D&&(0,W.jsx)(`output`,{children:`Loading the context before this step…`}),T&&(0,W.jsx)(`p`,{className:`experiment-error`,role:`alert`,children:T}),n&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`section`,{className:`step-focus`,children:[(0,W.jsx)(`small`,{children:`SELECTED STEP`}),(0,W.jsx)(`h3`,{children:e?.title}),(0,W.jsx)(`p`,{children:e?.detail})]}),(0,W.jsx)(`h3`,{children:`Possible explanations`}),(0,W.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,W.jsx)(`button`,{type:`button`,className:`run-button`,disabled:j||!o,onClick:ee,children:j?`Generating explanations…`:`Generate explanations`}),(0,W.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,W.jsxs)(`li`,{className:e.evidence_id===u?`chosen`:``,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>z(e.evidence_id),children:[(0,W.jsx)(`span`,{children:t+1}),(0,W.jsx)(`strong`,{children:e.title})]}),(0,W.jsx)(`p`,{children:r?`Action repeated: ${hE(r.summary.baseline.rate)} original / ${hE(r.summary.intervention.rate)} edited`:`Action repeat rate: not measured`}),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`Supporting evidence`}),(0,W.jsx)(`p`,{children:e.explanation}),(0,W.jsx)(`blockquote`,{children:e.excerpt})]})]},e.evidence_id)})}),n.explanation_generated&&!n.hypotheses.length&&(0,W.jsx)(`p`,{children:`Insufficient evidence: no explanations with verifiable supporting quotes were returned.`}),(0,W.jsx)(`h3`,{children:`Edit and rerun`}),(0,W.jsx)(`label`,{htmlFor:`step-context`,children:`Context to change`}),(0,W.jsx)(Bd,{id:`step-context`,className:`lab-select`,value:u,onChange:e=>z(e.target.value),children:n.evidence.map(e=>(0,W.jsxs)(Vd,{value:e.id,children:[`#`,e.index+1,` · `,_E(e)]},e.id))}),(0,W.jsx)(`label`,{htmlFor:`edited-context`,children:`Edited context`}),(0,W.jsx)(`textarea`,{id:`edited-context`,value:f,onChange:e=>p(e.target.value),spellCheck:!1,rows:8}),(0,W.jsxs)(`div`,{className:`context-actions`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>p(N?.content??N?.preview??``),children:`Reset`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>p(``),children:`Withhold text`})]}),(0,W.jsx)(`small`,{children:`Only this context item changes. Other messages and tool history are retained.`}),(0,W.jsx)(`label`,{htmlFor:`step-model`,children:`Model`}),(0,W.jsxs)(Bd,{id:`step-model`,className:`lab-select`,value:c,onChange:e=>l(e.target.value),children:[!i.some(e=>e.id===n.model)&&(0,W.jsx)(Vd,{value:n.model,children:n.model}),i.map(e=>(0,W.jsxs)(Vd,{value:e.id,children:[e.alias,` · `,e.id]},e.alias))]}),(0,W.jsx)(`label`,{htmlFor:`run-mode`,children:`Run mode`}),(0,W.jsxs)(Bd,{id:`run-mode`,className:`lab-select`,value:m,onChange:e=>h(e.target.value),children:[(0,W.jsx)(Vd,{value:`decision`,children:`Replay model decision`}),(0,W.jsx)(Vd,{value:`execute`,disabled:!o,children:`Execute and continue`})]}),m===`decision`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`label`,{htmlFor:`step-count`,children:`Runs per version`}),(0,W.jsx)(`input`,{id:`step-count`,type:`number`,min:2,max:20,step:1,value:g,onChange:e=>v(e.target.value)}),(0,W.jsx)(`p`,{children:R?`${I} original + ${I} edited = ${I*2} paid API calls maximum.`:`Enter a whole number from 2 to 20.`}),(0,W.jsxs)(`details`,{className:`raw-details`,children:[(0,W.jsx)(`summary`,{children:`How this is measured`}),(0,W.jsx)(`p`,{children:`Both use the selected model. Tools are not executed.`})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`label`,{htmlFor:`step-limit`,children:`Maximum model requests`}),(0,W.jsx)(`input`,{id:`step-limit`,type:`number`,min:1,max:20,step:1,value:y,onChange:e=>b(e.target.value)}),(0,W.jsxs)(`p`,{children:[`One continuation in a separate copy of current project files, up to `,R?L:`—`,` paid requests and 3 minutes.`]}),(0,W.jsxs)(`details`,{className:`raw-details`,children:[(0,W.jsx)(`summary`,{children:`How this is measured`}),(0,W.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,W.jsx)(`p`,{className:`scope-note`,children:n.replay_reason}),(0,W.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,W.jsxs)(`div`,{className:`job-progress`,children:[(0,W.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,W.jsx)(`button`,{type:`button`,onClick:()=>gE(`/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,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`label`,{htmlFor:`step-run`,children:`Results for this action`}),(0,W.jsxs)(Bd,{id:`step-run`,className:`lab-select`,value:C,onChange:e=>w(e.target.value),children:[(0,W.jsx)(Vd,{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,W.jsxs)(Vd,{value:e.id,children:[e.mode,` · `,e.model,` · `,e.status]},e.id))]})]})]}),F&&(0,W.jsxs)(`section`,{className:`trial-report`,children:[(0,W.jsx)(`h3`,{children:`Original vs rerun`}),(0,W.jsxs)(`p`,{children:[F.status,` · `,F.model]}),F.error&&(0,W.jsx)(`p`,{role:`alert`,className:`error-text`,children:F.error}),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`Original action`}),(0,W.jsx)(`pre`,{children:JSON.stringify(F.recorded,null,2)})]}),F.mode===`decision`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`frequency-grid`,children:[[`Original context`,F.summary.baseline],[`Edited context`,F.summary.intervention]].map(([e,t])=>(0,W.jsxs)(`section`,{className:`frequency`,children:[(0,W.jsx)(`h4`,{children:e}),(0,W.jsx)(`strong`,{children:hE(t.rate)}),(0,W.jsxs)(`p`,{children:[t.hits,`/`,t.successful,` successful responses repeated the selected action`]}),t.interval&&(0,W.jsxs)(`small`,{children:[`95% interval: `,hE(t.interval[0]),`–`,hE(t.interval[1])]})]},e))}),(0,W.jsx)(`p`,{className:`lab-caption`,children:`These rates measure action repetition, not the probability an explanation is true.`}),(0,W.jsxs)(`details`,{className:`raw-details`,children:[(0,W.jsx)(`summary`,{children:`How this is measured`}),(0,W.jsx)(`p`,{children:`Small samples are uncertain. Answers require exact text matches.`})]}),(0,W.jsxs)(`p`,{children:[`Reported API cost: $`,F.cost.toFixed(4)]}),F.trials.map((e,t)=>(0,W.jsxs)(`details`,{children:[(0,W.jsxs)(`summary`,{children:[t+1,`. `,e.arm===`baseline`?`Original`:`Edited`,` · `,e.status===`succeeded`?e.matches?`same action`:`different response`:e.status]}),(0,W.jsx)(`pre`,{children:e.error||JSON.stringify(e.outcome,null,2)})]},t))]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:F.note}),F.workspace&&(0,W.jsxs)(`p`,{children:[`Files: `,(0,W.jsx)(`code`,{children:F.workspace})]}),(0,W.jsx)(`h4`,{children:`New execution sequence`}),F.events.map((e,t)=>(0,W.jsxs)(`details`,{children:[(0,W.jsxs)(`summary`,{children:[typeof e.type==`string`?e.type:`Event`,` `,String(e.item?.type||``)]}),(0,W.jsx)(`pre`,{children:JSON.stringify(e,null,2)})]},t))]})]})]})}var yE=e=>Math.round(e/4),bE=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e);async function xE(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 SE=(e,t=140)=>{let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n};function CE(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 wE({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,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`li`,{className:`rt-file${i?` open`:``}`,children:(0,W.jsxs)(`button`,{type:`button`,className:`rt-file-row`,onClick:()=>a(!i),"aria-expanded":i,children:[(0,W.jsx)(`span`,{className:`rt-op rt-op-${e.op}`,children:e.op}),(0,W.jsx)(`code`,{className:`rt-file-path`,title:e.path,children:e.path}),(0,W.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,W.jsx)(`span`,{className:`rt-file-tokens`,title:`Estimated tokens this file added to the context window`,children:e.op===`wrote`?``:`~${bE(yE(e.chars))} tokens`}),(0,W.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,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(z,{size:12}),` used`]}):``})]})}),i&&(0,W.jsxs)(`li`,{className:`rt-file-detail`,children:[(0,W.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,W.jsx)(`code`,{children:SE(e.command,90)})]}),(0,W.jsxs)(`div`,{className:`rt-actions`,children:[e.op!==`wrote`&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>void xE(t,e.context_index),children:[`Open what the model saw `,(0,W.jsx)(te,{size:13})]}),r&&e.op!==`wrote`&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:r,title:`Open the Playground at the next step, with this output removed`,children:[(0,W.jsx)(ie,{size:14}),` Rerun without this`]}),n&&e.op!==`wrote`&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:n,children:[(0,W.jsx)(ne,{size:14}),` Test impact`]})]})]})]})}function TE({data:e}){let t=yE(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,W.jsxs)(`section`,{className:`rt-window`,"aria-label":`Context window`,children:[(0,W.jsxs)(`div`,{className:`rt-window-head`,children:[(0,W.jsxs)(`strong`,{children:[`Context window: ~`,bE(t),` tokens used`,o?` of ${bE(o)}`:``]}),(0,W.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,W.jsx)(`div`,{className:`rt-window-bar`,children:a.map(e=>(0,W.jsx)(`i`,{className:`rt-seg-${e.tone}`,style:{width:`${Math.max(.4,yE(e.chars)/s*100)}%`},title:`${e.label}: ~${bE(yE(e.chars))} tokens`},e.label))}),(0,W.jsx)(`div`,{className:`rt-window-legend`,children:a.map(e=>(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`i`,{className:`rt-seg-${e.tone}`}),e.label,` ~`,bE(yE(e.chars))]},e.label))})]})}function EE({trace:e,stepKey:t,onStep:n,onRerunWithout:r}){let{data:i,error:a,summarizing:o}=CE(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,W.jsxs)(`section`,{className:`rt-view`,children:[(0,W.jsx)(`header`,{className:`rt-view-head`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`CONTEXT`}),(0,W.jsx)(`h1`,{children:`What the model was working from`}),(0,W.jsxs)(`p`,{className:`rt-muted rt-sub`,children:[SE(e.title,120),` · `,new Date(e.startedAt).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`})]})]})}),i&&(0,W.jsx)(TE,{data:i}),a&&(0,W.jsx)(`p`,{role:`alert`,className:`verify-error`,children:a}),!i&&!a&&(0,W.jsx)(`p`,{className:`rt-empty`,children:`Loading the context…`}),i&&(0,W.jsxs)(`div`,{className:`rt-boxes`,children:[(0,W.jsxs)(`section`,{className:`rt-box`,children:[(0,W.jsxs)(`h2`,{children:[(0,W.jsx)(`span`,{children:`A`}),` You asked before`]}),i.earlierPrompts.length?(0,W.jsx)(`ol`,{className:`rt-box-list`,children:i.earlierPrompts.map((e,t)=>(0,W.jsx)(`li`,{children:i.summary?.prompts[t]??SE(e.text)},e.index))}):(0,W.jsx)(`p`,{className:`rt-muted`,children:`This was the first prompt in this conversation, so nothing you asked earlier was in context.`}),o&&(0,W.jsx)(`p`,{className:`rt-muted`,children:`Summarising…`})]}),(0,W.jsxs)(`section`,{className:`rt-box rt-box-wide`,children:[(0,W.jsxs)(`h2`,{children:[(0,W.jsx)(`span`,{children:`B`}),` The model brought`]}),(0,W.jsx)(`p`,{className:`rt-box-note`,children:E.length?i.summary?.answers||`${E.length} earlier answer${E.length===1?``:`s`}: ${SE(E.at(-1).text,120)}`:`No earlier answers: it started this conversation with your question.`}),w.length?(0,W.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,W.jsx)(wE,{file:t,traceId:e.id,onRerun:C(t),onTest:b&&!y&&v(t)?()=>g(t):void 0},`${t.op}:${t.path}`))}):(0,W.jsx)(`p`,{className:`rt-muted`,children:`No file reads identified in what was captured.`}),T.length>0&&(0,W.jsxs)(`details`,{className:`rt-listed`,children:[(0,W.jsxs)(`summary`,{children:[`listed `,T.length,` location`,T.length===1?``:`s`]}),(0,W.jsx)(`ul`,{className:`rt-files`,children:T.map(t=>(0,W.jsx)(wE,{file:t,traceId:e.id},`${t.op}:${t.path}`))})]}),(0,W.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,W.jsxs)(`section`,{className:`rt-box`,children:[(0,W.jsxs)(`h2`,{children:[(0,W.jsx)(`span`,{children:`C`}),` Internals`]}),(0,W.jsx)(`ul`,{className:`rt-internals`,children:i.internals.map(t=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`details`,{children:[(0,W.jsxs)(`summary`,{children:[(0,W.jsx)(`strong`,{children:t.kind}),(0,W.jsxs)(`span`,{children:[`~`,bE(yE(t.chars)),` tokens`]})]}),t.kind===`Environment`&&D?(0,W.jsx)(`dl`,{children:Object.entries(D).map(([e,t])=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:e.replace(/_/g,` `)}),(0,W.jsx)(`dd`,{children:t})]},e))}):t.names?(0,W.jsx)(`p`,{className:`rt-muted`,children:t.names.join(`, `)}):null,(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>void xE(e.id,t.context_index),children:`Open full text ↗`})]})},t.kind))}),!i.internals.some(e=>e.kind===`AGENTS.md`)&&(0,W.jsx)(`p`,{className:`rt-muted`,children:`No AGENTS.md was loaded.`})]})]}),b&&!y&&(0,W.jsxs)(`details`,{className:`rt-test`,ref:d,open:s,onToggle:e=>c(e.currentTarget.open),children:[(0,W.jsxs)(`summary`,{children:[(0,W.jsx)(ne,{size:14}),` Test it: rerun a step with part of its context changed`]}),p.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`label`,{htmlFor:`lab-step`,className:`workspace-label`,children:`STEP`}),(0,W.jsx)(Bd,{id:`lab-step`,className:`trace-picker`,value:h?m(h):``,onChange:e=>{u(null),n(e.target.value)},children:p.map(e=>(0,W.jsxs)(Vd,{value:m(e),children:[e.title,` · `,e.detail.slice(0,80)]},m(e)))}),s&&h&&(0,W.jsx)(`div`,{className:`rt-lab-body`,children:(0,W.jsx)(vE,{selected:h,focusCallId:l},`${m(h)}:${l??``}`)})]}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`This prompt proposed no tool calls, so there is no step to rerun.`})]})]})}var DE=e=>{try{return Number(localStorage.getItem(e))||null}catch{return null}},OE=(e,t)=>{try{t==null?localStorage.removeItem(e):localStorage.setItem(e,String(t))}catch{}};function kE({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=DE(n);a&&e.current?.style.setProperty(t,`${Math.round(Math.min(i,Math.max(r,a)))}px`)},[e,t,n,r,i]),(0,W.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`),OE(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),OE(n,t)},onDoubleClick:()=>{s(null),OE(n,null)}})}var AE={"content-type":`application/json`,"x-raytace-experiment":`1`},jE=[`claude-opus-5-5`,`claude-sonnet-5`,`claude-haiku-4-5`,`claude-fable-5-1`],ME=`(output removed)`,NE=(e,t=120)=>{let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n},PE=e=>new Date(e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),FE=e=>[`queued`,`creating`,`running`,`collecting`,`checking`].includes(e.status),IE={queued:`Waiting`,creating:`Starting sandbox`,running:`Running`,collecting:`Comparing`,checking:`Checking`,completed:`Done`,failed:`Failed`,interrupted:`Interrupted`,cancelled:`Cancelled`},LE=[1,3,5,10],RE=e=>e.check&&[`passed`,`failed`,`timed_out`].includes(e.check.status),zE=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},BE={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`},VE=e=>e==null?``:e<1e4?`${(e/1e3).toFixed(1)} s`:`${Math.round(e/1e3)} s`;function HE({check:e}){let t=e.status===`passed`||e.status===`failed`?`exit ${e.exit_code} · ${VE(e.duration_ms)}`:e.status===`timed_out`?`stopped after ${VE(e.duration_ms)}`:e.status===`skipped`?`the fork stopped before it got there`:``;return(0,W.jsxs)(`div`,{className:`pg-check c-${e.status}`,children:[(0,W.jsxs)(`p`,{children:[e.status===`passed`?(0,W.jsx)(z,{size:14}):e.status===`failed`||e.status===`timed_out`?(0,W.jsx)(Te,{size:14}):null,(0,W.jsx)(`strong`,{children:BE[e.status]}),(0,W.jsx)(`code`,{children:e.command}),t&&(0,W.jsx)(`small`,{children:t})]}),e.output&&(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`Output`}),(0,W.jsx)(`pre`,{className:`pg-diff`,children:e.output})]})]})}function UE(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 WE(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 GE({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,W.jsx)(`p`,{className:`pg-note`,children:`Loading diff…`}):n.startsWith(`Could not load`)?(0,W.jsx)(`p`,{className:`pg-note`,children:n}):(0,W.jsx)(zT,{diff:n})}function KE({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:AE})}finally{l(!1),i()}},m=FE(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,W.jsxs)(`article`,{className:`pg-run`,children:[(0,W.jsxs)(`header`,{className:`pg-run-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`span`,{className:`pg-status s-${e.status}`,children:[IE[e.status],FE(e)&&e.progress.tool_calls?` · ${e.progress.tool_calls} tool call${e.progress.tool_calls===1?``:`s`}`:``]}),(0,W.jsx)(`strong`,{children:e.model}),(0,W.jsxs)(`small`,{children:[(e.attempts??1)>1&&`Run ${e.attempt} of ${e.attempts} · `,PE(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,W.jsxs)(`p`,{className:`pg-told`,children:[(0,W.jsx)(`b`,{children:`You told it:`}),` `,e.message]})]}),(0,W.jsxs)(`div`,{className:`rt-actions`,children:[r&&(0,W.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,W.jsx)(P,{size:13})]}),!e.deleted_at&&!FE(e)&&(0,W.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,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ue,{size:13}),` Unkeep`]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(de,{size:13}),` Keep`]})}),!e.deleted_at&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,disabled:c,onClick:()=>p(`delete`),children:[(0,W.jsx)(be,{size:13}),e.status===`queued`?`Cancel this run`:FE(e)?`Stop and delete`:`Delete sandbox`]}),e.deleted_at&&e.status!==`cancelled`&&(0,W.jsx)(`span`,{className:`pg-note`,children:`Sandbox deleted · results kept`})]})]}),e.error&&(0,W.jsx)(`p`,{role:`alert`,className:`pg-error`,children:e.error}),e.check&&(0,W.jsx)(HE,{check:e.check}),m&&(0,W.jsx)(`p`,{className:`pg-verdict${e.comparison?.same_files?` same`:``}`,children:m}),(0,W.jsxs)(`div`,{className:`pg-compare`,children:[(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{children:`Original, from this step`}),(0,W.jsxs)(`ol`,{className:`pg-steps`,children:[d.map(e=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`b`,{children:e.name}),(0,W.jsx)(`code`,{children:NE(e.proposed??``,140)})]},e.call_id)),!d.length&&(0,W.jsx)(`li`,{className:`pg-note`,children:`Answered without another tool call.`})]}),t.answer&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{children:`Answer`}),(0,W.jsx)(`p`,{className:`pg-answer`,children:t.answer})]})]}),(0,W.jsxs)(`section`,{children:[(0,W.jsx)(`h3`,{children:`Fork`}),(0,W.jsxs)(`ol`,{className:`pg-steps`,children:[e.events.filter(e=>e.kind===`tool`).map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`b`,{children:e.name}),(0,W.jsx)(`code`,{children:NE(e.detail,140)})]},t)),FE(e)&&(0,W.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…`}),!FE(e)&&!e.events.some(e=>e.kind===`tool`)&&(0,W.jsx)(`li`,{className:`pg-note`,children:`Answered without another tool call.`})]}),e.result?.text&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{children:`Answer`}),(0,W.jsx)(`p`,{className:`pg-answer`,children:e.result.text})]}),e.result&&(0,W.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,W.jsxs)(`section`,{className:`pg-files`,children:[(0,W.jsx)(`h3`,{children:`Files, original vs fork`}),f.length?(0,W.jsx)(`ul`,{children:f.map(t=>(0,W.jsxs)(_.Fragment,{children:[(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>s(o===t.path?null:t.path),"aria-expanded":o===t.path,children:[(0,W.jsx)(`span`,{className:`rt-file-status s-${t.status}`,children:{A:`only fork`,D:`only original`,M:`differs`}[t.status]??t.status}),(0,W.jsx)(`code`,{children:t.path}),(0,W.jsx)(`small`,{children:t.added==null?`binary`:`+${t.added} −${t.removed}`})]})}),o===t.path&&(0,W.jsx)(`li`,{children:(0,W.jsx)(GE,{fork:e,path:t.path})})]},t.path))}):(0,W.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,W.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 qE(e){let t=e.filter(e=>!FE(e)&&e.status!==`cancelled`),n=e.filter(RE),r=n.filter(e=>e.check?.status===`passed`).length,i=e=>zE(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(FE),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 JE(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 YE({change:e,base:t,onShow:n}){let r=qE(e),i=qE(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=JE(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,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:e}),(0,W.jsx)(`td`,{children:t(i)}),(0,W.jsx)(`td`,{children:t(r)})]}),c=(e,t)=>e==null?`—`:t(e);return(0,W.jsxs)(`section`,{className:`pg-baseline`,children:[(0,W.jsx)(`h3`,{children:`Against the step run unchanged`}),(0,W.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,W.jsxs)(`table`,{children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{scope:`col`,children:`Runs`}),(0,W.jsx)(`th`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n(t[0].id),children:[`Unchanged ×`,t.length]})}),(0,W.jsx)(`th`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n(e[0].id),children:[`Your change ×`,e.length]})})]})}),(0,W.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,VE)),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,W.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 XE({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}=qE(e);return(0,W.jsxs)(`section`,{className:`pg-batch`,children:[(0,W.jsxs)(`header`,{children:[(0,W.jsxs)(`div`,{className:`pg-batch-rate`,children:[l==null?(0,W.jsxs)(`strong`,{children:[o.length,`/`,e.length,` runs done`]}):(0,W.jsxs)(`strong`,{className:l===1?`good`:l===0?`bad`:`mixed`,children:[c,`/`,s.length,` passed`]}),(0,W.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,W.jsxs)(`dl`,{children:[d!=null&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Tool calls`}),(0,W.jsx)(`dd`,{children:Math.round(d)})]}),f!=null&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Time`}),(0,W.jsx)(`dd`,{children:VE(f)})]}),u!=null&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Cost`}),(0,W.jsxs)(`dd`,{children:[`$`,u.toFixed(4)]})]}),p!=null&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Files differ`}),(0,W.jsx)(`dd`,{children:Math.round(p)})]}),o.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Same files`}),(0,W.jsxs)(`dd`,{children:[m,`/`,o.length]})]})]}),h&&(0,W.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:AE})}finally{a(!1),r()}},children:[(0,W.jsx)(be,{size:13}),` Stop all runs`]})]}),o.length>1&&(0,W.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,W.jsxs)(`table`,{className:`pg-batch-runs`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`Run`}),(0,W.jsx)(`th`,{children:`Status`}),(0,W.jsx)(`th`,{children:`Check`}),(0,W.jsx)(`th`,{children:`Tool calls`}),(0,W.jsx)(`th`,{children:`Files differ`}),(0,W.jsx)(`th`,{children:`Time`}),(0,W.jsx)(`th`,{children:`Cost`})]})}),(0,W.jsx)(`tbody`,{children:e.map(e=>(0,W.jsxs)(`tr`,{className:e.id===t?`on`:``,onClick:()=>n(e.id),children:[(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),"aria-pressed":e.id===t,children:[`#`,e.attempt??1]})}),(0,W.jsx)(`td`,{children:(0,W.jsx)(`span`,{className:`pg-status s-${e.status}`,children:IE[e.status]})}),(0,W.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,W.jsx)(`td`,{children:e.status===`queued`||e.status===`cancelled`?`—`:e.progress.tool_calls}),(0,W.jsx)(`td`,{children:e.comparison?e.comparison.changes.length:`—`}),(0,W.jsx)(`td`,{children:VE(e.result?.duration_ms??null)||`—`}),(0,W.jsx)(`td`,{children:e.result?.cost_usd==null?`—`:`$${e.result.cost_usd.toFixed(4)}`})]},e.id))})]})]})}function ZE({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}=UE(c),f=Pe(e),p=f.forkable&&t&&c.has(t)?t:null,m=p?o.findIndex(e=>e.id===p):-1,h=WE(p),[g,v]=(0,_.useState)(()=>n?{[n]:{mode:`remove`,text:ME}}:{}),[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,ME])),n=await x().fetch(`/raytace/forks`,{method:`POST`,headers:AE,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(FE),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=>FE(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,W.jsxs)(`section`,{className:`rt-view`,children:[(0,W.jsx)(`header`,{className:`rt-view-head`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`PLAYGROUND`}),(0,W.jsx)(`h1`,{children:`Rerun it from any step`}),(0,W.jsxs)(`p`,{className:`rt-muted rt-sub`,children:[NE(e.title,120),` · `,PE(e.startedAt)]})]})}),(0,W.jsxs)(`div`,{className:`pg-layout`,ref:te,children:[(0,W.jsxs)(`nav`,{className:`pg-rounds`,"aria-label":`Steps`,children:[(0,W.jsx)(`h2`,{children:`1 · Pick a step`}),(0,W.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,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,className:e.id===p?`on`:``,onClick:()=>i(e.id),disabled:!f.forkable,children:[(0,W.jsxs)(`span`,{children:[`Round trip `,t+1,r?(0,W.jsxs)(`em`,{children:[r,` fork`,r===1?``:`s`]}):null]}),n.length?n.map(e=>(0,W.jsxs)(`code`,{children:[`#`,l.get(e.call_id),` `,e.name,` `,NE(e.proposed??``,60)]},e.call_id)):(0,W.jsx)(`small`,{children:`answered`})]})},e.id)})}),(0,W.jsx)(kE,{target:te,variable:`--pg-steps`,storageKey:`raytace.playground-steps-width`,min:220,max:760,label:`Steps width`})]}),(0,W.jsxs)(`div`,{className:`pg-main`,children:[!f.forkable&&(0,W.jsxs)(`div`,{className:`pg-unforkable`,role:`note`,children:[(0,W.jsx)(`strong`,{children:f.where===`mac`?`This run can’t be forked`:f.where===`fork`?`This is a fork`:`Not forkable yet`}),(0,W.jsx)(`p`,{children:f.reason})]}),f.forkable&&!p&&(0,W.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,W.jsx)(`p`,{className:`rt-empty`,children:`Checking whether this step can be forked…`}),p&&h&&!h.forkable&&(0,W.jsx)(`p`,{className:`pg-error`,children:h.reason}),p&&h?.forkable&&(0,W.jsxs)(`section`,{className:`pg-change`,children:[(0,W.jsxs)(`h2`,{children:[`2 · Change what it had `,(0,W.jsxs)(`small`,{children:[`then round trip `,m+1,` onward runs again, in its own sandbox`]})]}),(0,W.jsx)(`h3`,{children:`Message at this step`}),(0,W.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,W.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,W.jsx)(`h3`,{children:`Exclude files`}),(0,W.jsxs)(`form`,{className:`pg-file-pick`,onSubmit:e=>{e.preventDefault(),re()},children:[(0,W.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,W.jsx)(`datalist`,{id:`pg-project-files`,children:I.slice(0,2e3).map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))}),(0,W.jsx)(`button`,{type:`submit`,className:`rt-button`,disabled:!w.trim(),children:`Exclude`})]}),S.length>0&&(0,W.jsx)(`ul`,{className:`pg-excluded`,children:S.map(e=>{let t=U(e),n=!I.length||I.includes(e);return(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`code`,{children:e}),(0,W.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,W.jsx)(`button`,{type:`button`,"aria-label":`Stop excluding ${e}`,onClick:()=>C(t=>t.filter(t=>t!==e)),children:(0,W.jsx)(Te,{size:12})})]},e)})}),(0,W.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,W.jsxs)(`h3`,{children:[`Check `,(0,W.jsx)(`small`,{children:`how to tell whether it worked`})]}),(0,W.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,W.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,W.jsxs)(`div`,{className:`pg-run-bar`,children:[(0,W.jsxs)(`label`,{children:[`Model `,(0,W.jsx)(`select`,{value:me,onChange:e=>D(e.target.value),children:[...new Set([h.model,...jE].filter(Boolean))].map(e=>(0,W.jsxs)(`option`,{value:e,children:[e,e===h.model?` (original)`:``]},e))})]}),(0,W.jsxs)(`label`,{children:[`Runs `,(0,W.jsx)(`select`,{value:A,onChange:e=>j(Number(e.target.value)),children:LE.filter(e=>e<=(h.limits?.max_repeat??1/0)).map(e=>(0,W.jsx)(`option`,{value:e,children:e===1?`once`:`${e} times`},e))})]}),(0,W.jsxs)(`button`,{type:`button`,className:`pg-run-button`,onClick:ae,disabled:R||oe,children:[(0,W.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,W.jsxs)(`label`,{className:`pg-baseline-pick`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>N(e.target.checked)}),ue?(()=>{let e=qE(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,W.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,W.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,W.jsx)(`p`,{role:`alert`,className:`pg-error`,children:ee}),(0,W.jsxs)(`details`,{className:`pg-advanced`,open:!!n||void 0,children:[(0,W.jsx)(`summary`,{children:`Advanced`}),(0,W.jsx)(`h3`,{children:`Tool results it had seen`}),h.results?.length?(0,W.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,W.jsxs)(`li`,{className:t?`edited ${t.mode}`:n?`edited remove`:``,children:[(0,W.jsxs)(`div`,{className:`pg-result-row`,children:[(0,W.jsxs)(`b`,{children:[`#`,l.get(e.call_id)??`?`,` `,e.name]}),(0,W.jsx)(`code`,{title:e.detail,children:NE(e.detail,90)}),(0,W.jsx)(`small`,{children:n?`removed with ${ne.get(e.call_id)}`:`~${Math.round(e.chars/4).toLocaleString()} tokens`}),(0,W.jsx)(`span`,{className:`rt-actions`,children:t?(0,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>v(({[e.call_id]:t,...n})=>n),children:[(0,W.jsx)(Te,{size:12}),` Undo`]}):(0,W.jsxs)(W.Fragment,{children:[!n&&(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>v(t=>({...t,[e.call_id]:{mode:`remove`,text:ME}})),children:`Remove`}),!e.truncated&&(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>v(t=>({...t,[e.call_id]:{mode:`edit`,text:e.output}})),children:`Edit`})]})})]}),t&&(0,W.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,W.jsx)(`p`,{className:`pg-note`,children:`No tool results before this step: it comes straight after the prompt.`}),(0,W.jsxs)(`label`,{className:`pg-limit`,children:[`Safety limit `,(0,W.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,W.jsxs)(`option`,{value:e,children:[e,` min`]},e))}),(0,W.jsx)(`span`,{className:`pg-note`,children:`The fork ends when Claude Code finishes; this only stops one that runs away.`})]})]})]}),p&&(0,W.jsxs)(`section`,{className:`pg-runs`,children:[(0,W.jsxs)(`h2`,{children:[`3 · Runs `,ce.length>1&&(0,W.jsxs)(`small`,{children:[ce.length,` from this step`]})]}),ce.length>1&&(0,W.jsx)(`div`,{className:`pg-run-tabs`,children:ce.map((e,t)=>{let n=e.filter(RE),r=e.length>1?n.length?` · ${n.filter(e=>e.check?.status===`passed`).length}/${n.length} ✓`:``:RE(e[0])?` · ${e[0].check?.status===`passed`?`✓`:`✗`}`:``;return(0,W.jsxs)(`button`,{type:`button`,className:e===le?`on`:``,onClick:()=>H(e[0].id),children:[(0,W.jsx)(ie,{size:12}),` `,ce.length-t,e[0].unchanged?` · unchanged`:``,e.length>1?` · ×${e.length}`:``,` · `,e.some(FE)?`Running`:IE[e[0].status],r,e.some(e=>e.keep)?` · kept`:``]},e[0].id)})}),le&&de(le)&&(0,W.jsx)(YE,{change:le,base:de(le),onShow:H}),le&&le.length>1&&(0,W.jsx)(XE,{runs:le,shown:pe?.id??null,onShow:H,onChanged:d}),pe?(0,W.jsx)(KE,{fork:pe,trace:e,fromIndex:m,onChanged:d,onOpenTrace:a,forkTrace:r.filter(e=>e.forkId===pe.id).at(0)??null},pe.id):(0,W.jsx)(`p`,{className:`pg-note`,children:`No forks from this step yet.`})]})]})]})]})}var QE=53,$E=[``,`Mon`,``,`Wed`,``,`Fri`,``];function eD(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}var tD=()=>()=>{},nD=()=>eD(Date.now()),rD=e=>e===0?0:e===1?1:e<=3?2:e<=6?3:4;function iD({dates:e,selected:t,onSelect:n}){let r=(0,_.useSyncExternalStore)(tD,nD,()=>null),i=new Map;for(let t of e)i.set(eD(t),(i.get(eD(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<QE;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,W.jsxs)(`section`,{className:`rt-activity`,"aria-label":`Prompts per day`,children:[(0,W.jsxs)(`div`,{className:`rt-activity-head`,children:[(0,W.jsxs)(`strong`,{children:[l,` prompt`,l===1?``:`s`]}),(0,W.jsxs)(`span`,{children:[`on `,u,` day`,u===1?``:`s`,` in the last year`]})]}),r&&(0,W.jsx)(`div`,{className:`rt-activity-scroll`,children:(0,W.jsxs)(`div`,{className:`rt-activity-grid`,style:{gridTemplateColumns:`28px repeat(${QE}, 12px)`},children:[(0,W.jsx)(`span`,{}),c.map((e,t)=>(0,W.jsx)(`span`,{className:`rt-activity-month`,children:e},t)),$E.map((e,r)=>[(0,W.jsx)(`span`,{className:`rt-activity-day`,children:e},`label-${r}`),...s.map(e=>{let o=e[r];if(o>a)return(0,W.jsx)(`span`,{},eD(o));let s=eD(o),c=i.get(s)??0,l=`${c} prompt${c===1?``:`s`} · ${o.toLocaleDateString(void 0,{day:`numeric`,month:`short`,year:`numeric`})}`;return(0,W.jsx)(`button`,{type:`button`,title:l,"aria-label":l,"aria-pressed":t===s,disabled:!c,className:`rt-cell rt-cell-${rD(c)}${t===s?` rt-cell-on`:``}`,onClick:()=>n(t===s?null:s)},s)})])]})}),(0,W.jsxs)(`div`,{className:`rt-activity-legend`,children:[`Less `,[0,1,2,3,4].map(e=>(0,W.jsx)(`i`,{className:`rt-cell rt-cell-${e}`},e)),` More`]})]})}var aD=e=>e.split(`
31
+ `).find(e=>e.trim())?.trim()??`(empty prompt)`;function oD({traces:e,loaded:t=!0,box:n=``,onBox:r,selectedId:i,onSelect:a,onOpen:o,onOpenStep:s,canOpen:c=()=>!0}){let[l,u]=(0,_.useState)(null),d=n?e.filter(e=>e.sandboxId===n):e,f=d.filter(e=>!l||eD(e.startedAt)===l).sort((e,t)=>t.startedAt.localeCompare(e.startedAt));return(0,W.jsxs)(`section`,{className:`rt-view`,children:[(0,W.jsx)(`header`,{className:`rt-view-head`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`PROMPTS`}),(0,W.jsx)(`h1`,{children:`What you asked`})]})}),(0,W.jsx)(iD,{dates:d.map(e=>e.startedAt),selected:l,onSelect:u}),(0,W.jsxs)(`div`,{className:`rt-list-head`,children:[(0,W.jsxs)(`span`,{className:`rt-chips`,children:[n&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-chip`,title:`Show prompts from everywhere`,onClick:()=>r?.(``),children:[`Sandbox `,n,` `,(0,W.jsx)(Te,{size:12})]}),l?(0,W.jsxs)(`button`,{type:`button`,className:`rt-chip`,onClick:()=>u(null),children:[new Date(`${l}T00:00`).toLocaleDateString(void 0,{weekday:`short`,day:`numeric`,month:`short`}),` `,(0,W.jsx)(Te,{size:12})]}):!n&&(0,W.jsx)(`span`,{children:`Recent`})]}),(0,W.jsxs)(`small`,{children:[f.length,` prompt`,f.length===1?``:`s`]})]}),!f.length&&(0,W.jsx)(`p`,{className:`rt-empty`,children:t?n?`No prompts from this sandbox yet. Ask Claude Code something in it and it will appear here.`:`No prompts captured yet. Send a request through the proxy and it will appear here.`:`Loading…`}),(0,W.jsx)(`ol`,{className:`rt-prompts`,children:f.map(e=>{let t=e.id===i,n=Ae(e.requests,`cost`),r=e.callVerifications?.length??0,l=Pe(e);return(0,W.jsxs)(`li`,{className:t?`rt-prompt open`:`rt-prompt`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`rt-prompt-row`,"aria-expanded":t,onClick:()=>a(t?``:e.id),children:[(0,W.jsx)(`time`,{dateTime:e.startedAt,children:new Date(e.startedAt).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`})}),(0,W.jsxs)(`strong`,{children:[(0,W.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}),aD(e.title)]}),(0,W.jsxs)(`small`,{children:[e.model,` · `,r,` tool call`,r===1?``:`s`,` · `,ad(n,e.requests?.some(e=>e.costEstimated))]})]}),t&&(0,W.jsxs)(`div`,{className:`rt-prompt-detail`,children:[(0,W.jsx)(Le,{health:e.captureHealth}),(0,W.jsx)(`h3`,{children:`Prompt`}),(0,W.jsx)(`p`,{className:`rt-text`,children:e.title}),(0,W.jsx)(`h3`,{children:`Answer`}),e.answer?(0,W.jsx)(`p`,{className:`rt-text`,children:e.answer}):(0,W.jsx)(`p`,{className:`rt-muted`,children:`No final answer was captured for this prompt.`}),(0,W.jsx)(tE,{trace:e,onStep:s&&(t=>s(e.id,t))}),(0,W.jsxs)(`div`,{className:`rt-actions`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>o(`calls`,e.id),children:[`Tool calls `,(0,W.jsx)(P,{size:14})]}),e.sandboxId&&c(`sandbox`)&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>o(`sandbox`,e.id),children:[`Sandbox evidence `,(0,W.jsx)(P,{size:14})]}),c(`context`)&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>o(`context`,e.id),children:[`Context `,(0,W.jsx)(P,{size:14})]})]})]})]},e.id)})})]})}var sD=[{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}],cD=[`outcome:failed`,`reported:ok observed:failed`,`exit:127`,`http:>=400`,`failed | stats count by tool`,`failed | timechart count by model span=1d`],lD=[`#8a8f98`,`#b03a48`,`#13549b`,`#9e6514`,`#29996b`,`#5b4bc4`,`#33373d`,`#c06a2b`,`#777d87`];function uD(e){return e.split(/(\[[^\]]*\])/g).map((e,t)=>e.startsWith(`[`)&&e.endsWith(`]`)?(0,W.jsx)(`mark`,{children:e.slice(1,-1)},t):(0,W.jsx)(`span`,{children:e},t))}function dD(e,t,n){let r=RegExp(`(^|\\s)-?${t}:(\\S+)`,`g`);return`${e.replace(r,` `).replace(/\s+/g,` `).trim()} ${t}:${n}`.trim()}var fD=e=>new Date(e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),pD=e=>new Date(e).toLocaleDateString(void 0,{day:`numeric`,month:`short`});function mD({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,W.jsxs)(`svg`,{viewBox:`0 0 720 ${n}`,width:`100%`,height:n,"aria-label":`Events over time`,children:[(0,W.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,W.jsxs)(`g`,{onClick:r?()=>r(c.t):void 0,style:r?{cursor:`pointer`}:void 0,children:[(0,W.jsx)(`title`,{children:`${pD(c.t)} — ${d} events`}),t.map(e=>{let t=(c[e.key]??0)/i*s;return u-=t,t>0?(0,W.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,W.jsx)(`text`,{x:18+l*a+a/2,y:n-4,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,opacity:`0.55`,children:pD(c.t)})]},l)})]})}function hD({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=sD.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,W.jsxs)(`section`,{className:`rt-view rt-search-view`,children:[(0,W.jsx)(`header`,{className:`rt-view-head`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`SEARCH`}),(0,W.jsx)(`h1`,{children:`What the agents did`})]})}),(0,W.jsxs)(`form`,{className:`rt-search-bar`,onSubmit:e=>{e.preventDefault(),O(a)},children:[(0,W.jsx)(ge,{size:16}),(0,W.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,W.jsx)(`button`,{type:`button`,className:`rt-search-clear`,onClick:()=>O(``),"aria-label":`Clear search`,children:(0,W.jsx)(Te,{size:14})}),(0,W.jsxs)(`select`,{value:l,onChange:e=>{u(e.target.value),f(null),m(0)},"aria-label":`Time range`,children:[l===`custom`&&(0,W.jsx)(`option`,{value:`custom`,children:`Selected window`}),sD.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,W.jsx)(`button`,{type:`submit`,className:`rt-button primary`,children:`Search`})]}),(0,W.jsxs)(`div`,{className:`rt-search-quick`,children:[cD.map(e=>(0,W.jsx)(`button`,{type:`button`,className:`rt-chip`,onClick:()=>O(e),children:(0,W.jsx)(`code`,{children:e})},e)),l===`custom`&&d&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-chip`,onClick:()=>{u(`7d`),f(null)},children:[fD(new Date(d.from).toISOString()),` – `,fD(new Date(d.to).toISOString()),` `,(0,W.jsx)(Te,{size:12})]})]}),b&&(0,W.jsx)(`p`,{className:`rt-search-error`,children:b}),(h?.errors??[]).map(e=>(0,W.jsx)(`p`,{className:`rt-search-error`,children:e},e)),h?.error&&(0,W.jsx)(`p`,{className:`rt-search-error`,children:h.error}),h?.mode===`events`&&k&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`rt-search-summary`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:k.total}),(0,W.jsx)(`span`,{children:`events`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{className:`rt-failed-text`,children:k.failed}),(0,W.jsx)(`span`,{children:`failed`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:k.mismatched}),(0,W.jsx)(`span`,{children:`reported ≠ observed`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:k.http_errors}),(0,W.jsx)(`span`,{children:`HTTP errors`})]}),(0,W.jsxs)(`small`,{children:[h.total,` match`,h.total===1?``:`es`,` the full query`]})]}),A.length>0&&(0,W.jsxs)(`div`,{className:`rt-search-chart`,children:[(0,W.jsx)(mD,{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,W.jsx)(`small`,{children:`Grey ok/unknown, red failed. Click a bar to zoom to that window.`})]}),!s&&v.length>0&&(0,W.jsxs)(`div`,{className:`rt-search-clusters`,children:[(0,W.jsxs)(`div`,{className:`rt-list-head`,children:[(0,W.jsx)(`span`,{children:`TOP FAILURE CLUSTERS`}),(0,W.jsx)(`small`,{children:`repeat failures, grouped by signature`})]}),(0,W.jsx)(`ol`,{children:v.map(e=>(0,W.jsxs)(`li`,{children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>O(`signature:${e.signature}`),children:[(0,W.jsxs)(`strong`,{children:[`×`,e.count]}),(0,W.jsx)(`span`,{className:`rt-cluster-label`,children:e.label??e.signature}),(0,W.jsxs)(`small`,{children:[e.tools.join(`, `),e.exit_codes.length?` · exit ${e.exit_codes.join(`/`)}`:``,` · last `,fD(e.last)]})]}),e.sample_turn&&(0,W.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,W.jsx)(P,{size:11})]})]},e.signature))})]}),(0,W.jsxs)(`div`,{className:`rt-search-body`,children:[(0,W.jsx)(`aside`,{className:`rt-search-facets`,children:Object.entries(h.facets??{}).map(([e,t])=>t.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{children:e.replace(`_`,` `)}),t.map(t=>(0,W.jsxs)(`button`,{type:`button`,onClick:()=>O(dD(s,e===`tool`?`tool`:e,t.value)),children:[(0,W.jsx)(`span`,{children:t.value}),(0,W.jsx)(`small`,{children:t.count})]},t.value))]},e))}),(0,W.jsxs)(`div`,{className:`rt-search-results`,children:[(0,W.jsxs)(`div`,{className:`rt-list-head`,children:[(0,W.jsx)(`span`,{children:`EVENTS`}),(0,W.jsx)(`small`,{children:C?`Searching…`:`${h.hits?.length??0} shown`})]}),!C&&!(h.hits??[]).length&&(0,W.jsx)(`p`,{className:`rt-empty`,children:`Nothing matches. Missing evidence reads as unknown, never as success — try widening the time range.`}),(0,W.jsx)(`ol`,{children:(h.hits??[]).map(e=>(0,W.jsxs)(`li`,{className:`rt-hit outcome-${e.outcome}`,children:[(0,W.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,W.jsx)(`time`,{dateTime:e.ts,children:fD(e.ts)}),(0,W.jsx)(`span`,{className:`rt-outcome outcome-${e.outcome}`,children:e.outcome}),(0,W.jsx)(`strong`,{children:e.kind===`turn`?`prompt`:e.kind===`proxy_error`?`proxy error`:`${e.tool_name??`tool`}${e.category?` · ${e.category}`:``}`}),(0,W.jsx)(`span`,{className:`rt-hit-text`,children:e.snippet?uD(e.snippet):e.command_text??e.prompt_excerpt??e.error_excerpt??``}),(0,W.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,W.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,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>i(e.turn_id,e.external_call_id),children:`sandbox evidence`})]},e.id))}),(0,W.jsxs)(`div`,{className:`rt-search-pages`,children:[(0,W.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:p===0,onClick:()=>m(Math.max(p-50,0)),children:`Newer`}),(0,W.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:p+50>=(h.total??0),onClick:()=>m(p+50),children:`Older`})]})]})]})]}),h?.mode===`stats`&&(0,W.jsxs)(`div`,{className:`rt-search-stats`,children:[(0,W.jsx)(`div`,{className:`rt-list-head`,children:(0,W.jsxs)(`span`,{children:[h.agg===`avg_duration`?`AVG DURATION (MS)`:`COUNT`,h.by?` BY ${h.by.toUpperCase()}`:``]})}),(0,W.jsx)(`table`,{children:(0,W.jsx)(`tbody`,{children:(h.rows??[]).map((e,t)=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:String(e.key??`(none)`)}),(0,W.jsx)(`td`,{className:`rt-stat-bar`,"aria-label":String(e.value??e.count??``),children:(0,W.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,W.jsx)(`td`,{children:String(e.value??e.count??``)})]},t))})}),!(h.rows??[]).length&&(0,W.jsx)(`p`,{className:`rt-empty`,children:`No events match.`})]}),h?.mode===`timechart`&&(0,W.jsxs)(`div`,{className:`rt-search-chart`,children:[(0,W.jsx)(mD,{rows:h.rows??[],height:240,series:(h.series??[]).map((e,t)=>({key:e,label:e,color:lD[t%lD.length]}))}),(0,W.jsx)(`small`,{children:(h.series??[]).map((e,t)=>(0,W.jsxs)(`span`,{className:`rt-legend-item`,children:[(0,W.jsx)(`i`,{style:{background:lD[t%lD.length]}}),e,` `]},e))}),!(h.rows??[]).length&&(0,W.jsx)(`p`,{className:`rt-empty`,children:`No events match.`})]}),(0,W.jsxs)(`p`,{className:`rt-search-help`,children:[`Fields: `,(0,W.jsx)(`code`,{children:`outcome reported observed tool model category kind exit http file signature session after before`}),`. Pipes: `,(0,W.jsx)(`code`,{children:`| stats count by tool`}),`, `,(0,W.jsx)(`code`,{children:`| stats avg(duration) by model`}),`, `,(0,W.jsx)(`code`,{children:`| timechart count by outcome span=1d`}),`. Prefix `,(0,W.jsx)(`code`,{children:`-`}),` negates; trailing `,(0,W.jsx)(`code`,{children:`*`}),` is a prefix match.`]})]})}var gD={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 _D(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 vD=(e,t)=>{let n=String(e??``).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n},yD=e=>e.split(`/`).filter(Boolean).at(-1)??e,bD={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},xD=[[/\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 SD(e){return e.snapshot?.changed?(e.snapshot.changes??[]).map(e=>e.path):[]}function CD(e,t,n){let r=SD(t[n]).map(yD).filter(e=>e.length>=3);return r.length?t.slice(n+1).filter(e=>{let t=`${e.proposed??``} ${SD(e).join(` `)}`;return r.some(e=>t.includes(e))}).length:0}function wD(e,t,n,r=e.callVerifications??[]){let i=[],a=bD[t.category??`unsure`]??8;t.category&&i.push(`${gD[t.category]} step`);let o=t.proposed??``;for(let[e,t]of xD)e.test(o)&&(a+=30,i.push(t));let s=SD(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(yD).join(`, `)}${s.length>3?`, …`:``}`));let c=_D(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=CD(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 TD=e=>vD((e.proposed??e.name).split(`
33
+ `).find(e=>e.trim())?.trim()??e.name,90);function ED(e){let t=e.callVerifications??[],n=t.map((n,r)=>({call:n,step:r+1,...wD(e,n,r,t),label:TD(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 DD(e){let t=e.callVerifications??[];return t.length?t.map((n,r)=>({call:n,step:r+1,...wD(e,n,r,t),label:TD(n)})).sort((e,t)=>t.score-e.score||e.step-t.step)[0]:null}function OD(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:vD(o,300)});let s=r>0?n[r-1]:null,c=s?_D(e.events,s.call_id):null;s&&c&&(c.state!==`ok`||c.output.trim())&&a.push({kind:`result`,step:r,text:vD(c.output,260)||`Step #${r} ${c.state}`}),a.length||a.push({kind:`request`,text:vD(e.title,300)});let l=_D(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()?` — ${vD(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=SD(t),f=[];d.length&&f.push(`Changed ${d.map(e=>`\`${e}\``).join(`, `)}.`);let p=r>=0?CD(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: ${TD(m)}.`):e.answer&&f.push(`After this, the agent answered: ${vD(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: “${vD(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 kD={request:`Your request`,agent:`The agent said, just before`,result:`What the previous step returned`};function AD({trace:e,focusCall:t,onSelect:n,onOpenCall:r,onOpenThought:i,onOpenSandbox:a}){let o=e.callVerifications??[],s=ED(e),c=DD(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?OD(e,f.call):null,m=(0,W.jsx)(`header`,{className:`rt-view-head`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`STORY`}),(0,W.jsx)(`h1`,{children:`What mattered in this run, and why`}),(0,W.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,W.jsxs)(`section`,{className:`rt-view`,children:[m,(0,W.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,W.jsxs)(`section`,{className:`rt-view`,children:[m,(0,W.jsx)(tE,{trace:e,onStep:e=>{u(e),n?.(e)}}),(0,W.jsxs)(`div`,{className:`rt-story`,children:[(0,W.jsxs)(`aside`,{className:`rt-story-rail`,"aria-label":`Timeline of key moments`,children:[(0,W.jsx)(`h2`,{children:`Key moments`}),(0,W.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,W.jsx)(`ol`,{className:`rt-story-timeline`,children:s.map(e=>(0,W.jsx)(`li`,{children:(0,W.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,W.jsx)(`span`,{className:`rt-story-dot`,"aria-hidden":!0}),(0,W.jsxs)(`span`,{className:`rt-story-node-body`,children:[(0,W.jsxs)(`span`,{className:`rt-story-node-head`,children:[(0,W.jsxs)(`span`,{className:`rt-cot-num`,children:[`#`,e.step]}),g(e)&&(0,W.jsxs)(`span`,{className:`rt-story-top`,children:[(0,W.jsx)(ye,{size:11}),` Most consequential`]}),(0,W.jsx)(`span`,{className:`rt-story-score`,title:`Consequence score, from the reasons listed for this step`,children:e.score})]}),(0,W.jsx)(`span`,{className:`rt-story-node-label`,children:e.label}),(0,W.jsx)(`span`,{className:`rt-story-node-why`,children:e.reasons[1]??e.reasons[0]??``})]})]})},e.call.call_id))}),(0,W.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,W.jsxs)(`article`,{className:`rt-story-main`,"aria-label":`Story of step ${f.step}`,children:[g(f)?(0,W.jsxs)(`p`,{className:`rt-story-banner`,children:[(0,W.jsx)(ye,{size:13}),` The most consequential command of this run — the one later steps and the final answer most depend on.`]}):(0,W.jsxs)(`p`,{className:`rt-story-banner rt-story-banner-quiet`,children:[`Step #`,f.step,` of `,o.length,` · consequence score `,f.score]}),(0,W.jsxs)(`h2`,{className:`rt-story-title`,children:[`Step #`,f.step,`: `,f.label]}),(0,W.jsx)(`div`,{className:`rt-story-cmd`,children:(0,W.jsx)(ju,{text:p.proposed})}),(0,W.jsx)(`h3`,{children:`Why it did that`}),(0,W.jsx)(`p`,{className:`rt-story-why`,children:p.why}),(0,W.jsx)(`ul`,{className:`rt-story-list`,children:p.trigger.map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`rt-story-tag`,children:e.step?`${kD[e.kind]} (#${e.step})`:kD[e.kind]}),` `,e.text]},t))}),(0,W.jsx)(`h3`,{children:`What actually happened`}),(0,W.jsx)(`ul`,{className:`rt-story-list`,children:p.observed.map((e,t)=>(0,W.jsx)(`li`,{children:e},t))}),(0,W.jsx)(`h3`,{children:`Why it matters`}),(0,W.jsx)(`ul`,{className:`rt-story-list`,children:p.consequence.map((e,t)=>(0,W.jsx)(`li`,{children:e},t))}),(0,W.jsx)(`h3`,{children:`What earned its place`}),(0,W.jsx)(`div`,{className:`rt-chips`,children:f.reasons.map(e=>(0,W.jsx)(`span`,{className:`rt-chip rt-story-reason`,children:e},e))}),(0,W.jsxs)(`div`,{className:`rt-story-actions`,children:[r&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>r(f.call.call_id),children:[(0,W.jsx)(we,{size:12}),` Open in Tool calls`]}),i&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>i(f.call.call_id),children:[(0,W.jsx)(R,{size:12}),` Ranked causes`]}),a&&(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>a(f.call.call_id),children:[(0,W.jsx)(ve,{size:12}),` Sandbox evidence`]})]}),(0,W.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 jD={A:`added`,M:`edited`,D:`deleted`,T:`type changed`};function MD({trace:e,onOpenCall:t}){let n=OT(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 PT(l,n.base,n.final,t);if(!r.diff){c(`That diff came back empty, so nothing was downloaded.`);return}FT(AT(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,W.jsxs)(`section`,{className:`rt-view rt-changes`,children:[(0,W.jsxs)(`header`,{className:`rt-view-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`CHANGES`}),(0,W.jsx)(`h1`,{children:`What this prompt changed`})]}),(0,W.jsx)(`div`,{className:`rt-actions`,children:(0,W.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,W.jsx)(H,{size:14}),` `,a?`Building patch…`:`Download patch`]})})]}),l?n.hasSnapshots?n.files.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`dl`,{className:`rt-stats`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Files changed`}),(0,W.jsx)(`dd`,{children:n.files.length})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Lines added`}),(0,W.jsxs)(`dd`,{children:[`+`,n.added]})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Lines removed`}),(0,W.jsxs)(`dd`,{children:[`−`,n.removed]})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Steps that changed files`}),(0,W.jsx)(`dd`,{children:n.steps.length})]})]}),s&&(0,W.jsx)(`p`,{role:`alert`,className:`verify-error`,children:s}),(0,W.jsx)(`h2`,{children:`Across the whole prompt`}),(0,W.jsx)(`ul`,{className:`rt-files`,children:n.files.map(e=>(0,W.jsxs)(_.Fragment,{children:[(0,W.jsxs)(`li`,{children:[(0,W.jsxs)(`button`,{type:`button`,className:`rt-file-toggle`,"aria-expanded":r===e.path,onClick:()=>i(r===e.path?null:e.path),children:[(0,W.jsx)(B,{size:12,className:`rt-caret${r===e.path?` down`:``}`}),(0,W.jsx)(`span`,{className:`rt-file-status s-${e.status}`,children:jD[e.status]??e.status}),(0,W.jsx)(`code`,{children:e.path})]}),(0,W.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,W.jsxs)(`li`,{className:`rt-file-diff`,children:[(0,W.jsx)(BT,{sandbox:l,from:n.base,to:n.final,path:e.path}),(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,disabled:a,onClick:()=>void d(e.path),children:[(0,W.jsx)(H,{size:13}),` `,`Download this file's patch`]})]})]},e.path))}),n.tooBig.length>0&&(0,W.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,W.jsxs)(`div`,{className:`rt-changes-apply`,children:[(0,W.jsx)(`h2`,{children:`Take it into your local copy`}),(0,W.jsxs)(`p`,{children:[`Download the patch above, put it in your project folder, and check before applying:`,` `,(0,W.jsxs)(`code`,{children:[`git apply --check `,AT(e)]}),`, then `,(0,W.jsxs)(`code`,{children:[`git apply `,AT(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,W.jsxs)(`div`,{className:`rt-changes-steps`,children:[(0,W.jsx)(`h2`,{children:`Step by step`}),n.steps.map(({call:e,number:n})=>(0,W.jsxs)(`div`,{className:`rt-changes-step`,children:[(0,W.jsxs)(`p`,{className:`rt-files-note`,children:[`#`,n,` `,e.description??e.proposed??e.name,t&&(0,W.jsxs)(W.Fragment,{children:[` `,` `,(0,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>t(e.call_id),children:[`Open in Tool calls `,(0,W.jsx)(P,{size:12})]})]})]}),e.snapshot&&(0,W.jsx)(HT,{snapshot:e.snapshot,sandbox:l})]},e.call_id))]})]}):(0,W.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,W.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,W.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 ND=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}),PD=e=>Fu({observed:!0,status:e.exit_code!=null||e.signal?void 0:`running`,exitCode:e.exit_code,signal:e.signal});function FD({trace:e,focusCall:t,onOpenCall:n}){let{since:r,until:i}=Me(e.requests),{data:a,error:o,raw:s,setRaw:c}=Eu(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 Xw(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)(()=>gT(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=ND(S),w=C.map(PD),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?xu(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=ND(x.get(e.event_id)??[]),i=l.has(e.event_id),a=PD(e),o=Au(e.started_ns),s=Au(e.ended_ns),c=xu(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,W.jsxs)(_.Fragment,{children:[(0,W.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,W.jsx)(`td`,{className:`rt-time`,children:Du(o)}),(0,W.jsxs)(`td`,{className:`rt-cmd`,children:[(0,W.jsxs)(`span`,{className:`rt-cmd-line${r.length?` rt-parent`:``}`,style:{paddingLeft:`${t*22}px`},children:[r.length?(0,W.jsx)(B,{size:14,className:`rt-caret${i?` down`:``}`,"aria-hidden":`true`}):(0,W.jsx)(`span`,{className:`rt-caret-gap`}),(0,W.jsx)(`span`,{className:`rt-cmd-text`,title:e.command,children:e.description??(0,W.jsx)(ju,{text:e.command})}),e.description_source===`model`&&(0,W.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,W.jsx)(`span`,{className:`rt-cmd-raw`,style:{paddingLeft:`${t*22+20}px`},title:e.command,children:(0,W.jsx)(ju,{text:e.command})}),f.size>0&&(0,W.jsxs)(`span`,{className:`rt-chips`,style:{paddingLeft:`${t*22+20}px`},children:[[...f.values()].slice(0,8).map(e=>(0,W.jsx)(`span`,{className:`rt-flag${e.fail?` rt-fail`:``}`,title:e.title,children:e.text},e.key)),f.size>8&&(0,W.jsxs)(`span`,{className:`rt-flag`,title:[...f.values()].slice(8).map(e=>e.text).join(`
34
+ `),children:[`+`,f.size-8]})]})]}),(0,W.jsx)(`td`,{className:`rt-pid`,children:e.pid}),(0,W.jsx)(`td`,{className:`exec-${a.tone}`,children:(0,W.jsx)(Iu,{outcome:a})}),(0,W.jsx)(`td`,{className:`rt-time`,children:Number.isFinite(o)&&Number.isFinite(s)?ku(s-o):`—`}),(0,W.jsx)(`td`,{children:t===0?(0,W.jsx)(wu,{severity:e.severity,flags:u?g[u]?.flags:void 0}):null}),(0,W.jsx)(`td`,{children:t>0?null:u?(0,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:e=>{e.stopPropagation(),n(u)},children:[`#`,y.get(u)??`?`]}):d?(0,W.jsxs)(`span`,{className:`rt-muted`,children:[`under #`,y.get(d)??`?`]}):(0,W.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,W.jsxs)(`section`,{className:`rt-view`,children:[(0,W.jsxs)(`header`,{className:`rt-view-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`SANDBOX EVIDENCE`}),(0,W.jsx)(`h1`,{children:`What actually ran`})]}),(0,W.jsx)(`div`,{className:`rt-actions`,children:(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>n(),children:[(0,W.jsx)(N,{size:14}),` Tool calls`]})})]}),e.sandboxId?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`dl`,{className:`rt-stats`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Commands`}),(0,W.jsx)(`dd`,{children:a?C.length:`—`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Succeeded`}),(0,W.jsx)(`dd`,{className:`exec-ok`,children:a?w.filter(e=>e.tone===`ok`).length:`—`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Failed`}),(0,W.jsx)(`dd`,{className:`exec-fail`,children:a?w.filter(e=>e.tone===`fail`).length:`—`})]}),(0,W.jsxs)(`div`,{title:[...m].join(`
35
+ `)||void 0,children:[(0,W.jsx)(`dt`,{children:`Reached on the network`}),(0,W.jsx)(`dd`,{children:d?m.size:`—`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:`Severity`}),(0,W.jsx)(`dd`,{className:`rt-sev-counts`,children:[`none`,`low`,`high`,`severe`].map((e,t)=>(0,W.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,W.jsx)(`p`,{role:`alert`,className:`verify-error`,children:o}),!a&&!o&&(0,W.jsx)(`p`,{className:`rt-empty`,children:`Loading…`}),a&&!s&&(0,W.jsxs)(W.Fragment,{children:[E!=null&&(0,W.jsxs)(`p`,{className:`rt-foot rt-filter-note`,children:[`Showing `,O.length,` of `,C.length,` commands with `,[`none`,`low`,`high`,`severe`][E],` severity.`,` `,(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>D(null),children:`Show all`})]}),C.length?O.length?(0,W.jsx)(`div`,{className:`rt-table-wrap`,children:(0,W.jsxs)(`table`,{className:`rt-table rt-sandbox`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`Started`}),(0,W.jsx)(`th`,{children:`Command`}),(0,W.jsx)(`th`,{children:`pid`}),(0,W.jsx)(`th`,{children:`Result`}),(0,W.jsx)(`th`,{children:`Took`}),(0,W.jsx)(`th`,{children:`Severity`}),(0,W.jsx)(`th`,{children:`Tool call`})]})}),(0,W.jsx)(`tbody`,{children:O.map(e=>P(e,0))})]})}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`No commands with this severity.`}):(0,W.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,W.jsxs)(`p`,{className:`rt-foot`,children:[`Seen by the sandbox kernel layer, independent of what the agent reported. Collector gaps: `,a.gaps,`.`,` `,a.folded&&Tu(a.folded)?`Folded, not shown as commands: ${Tu(a.folded)}. `:``,(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>c(!0),children:`Show every raw event`})]})]}),a&&s&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`rt-foot`,children:(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>c(!1),children:`Back to commands`})}),(0,W.jsx)(`ul`,{className:`evidence-raw`,children:(a.events??[]).map(e=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`code`,{children:e.kind===`exec_succeeded`?(e.argv??[]).join(` `):`${e.kind} exit=${e.exit_code??`unknown`}`}),(0,W.jsxs)(`small`,{children:[` pid `,e.pid,` · #`,e.event_id]})]},e.event_id))})]})]}):(0,W.jsx)(`p`,{className:`rt-empty`,children:`This prompt did not run in a sandbox, so there is no independent evidence of what ran.`})]})}var ID=1048576,LD={file:25*ID,total:200*ID,files:2e4,archive:100*ID},RD=new Set([`.git`,`.raytace`,`.raytrace`,`.ssh`,`.aws`,`.azure`,`.config`,`.claude`,`node_modules`,`.venv`,`__pycache__`,`.next`,`.vinext`,`dist`,`coverage`,`.wrangler`,`.DS_Store`]),zD=new Set([`.npmrc`,`.netrc`,`.pypirc`,`.htpasswd`,`.dockercfg`,`credentials`,`credentials.json`,`credentials.ini`,`auth.json`,`service-account.json`,`service_account.json`,`serviceAccountKey.json`,`client_secret.json`,`client_secrets.json`,`token.json`,`id_rsa`,`id_dsa`,`id_ecdsa`,`id_ed25519`,`id_ecdsa_sk`,`id_ed25519_sk`,`known_hosts`]),BD=/\.(pem|key|p12|pfx)$/i,VD=e=>{let t=e.toLowerCase();return t.startsWith(`.env`)||t.startsWith(`.secret`)||BD.test(e)||zD.has(t)};function HD(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 UD(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 WD(e,t){let n=t.split(`/`);for(let t=1;t<n.length;t++)if(UD(e,n.slice(0,t).join(`/`),!0))return!0;return UD(e,t,!1)}function GD(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>LD.file){o.push(`${e.path} (${(e.file.size/ID).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 ${LD.file/ID} 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>LD.files&&r.push(`${i.length.toLocaleString()} files; a project may have at most ${LD.files.toLocaleString()}.`),a>LD.total&&r.push(`${(a/ID).toFixed(0)} MiB in all; a project may be at most ${LD.total/ID} 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 KD=e=>new Promise((t,n)=>{let r=e.createReader(),i=[],a=()=>r.readEntries(e=>{e.length?(i.push(...e),a()):t(i)},n);a()}),qD=e=>new Promise((t,n)=>e.file(t,n));function JD(e){return[...e.items].map(e=>e.webkitGetAsEntry?.()??null).filter(e=>e!==null)}async function YD(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 KD(e),s=o.find(e=>e.isFile&&e.name===`.gitignore`),c=s?[...i,...HD(await(await qD(s)).text(),n)]:i;for(let e of o){let i=n?`${n}/${e.name}`:e.name;if(RD.has(e.name)){t.excluded+=1;continue}if(UD(c,i,e.isDirectory)){t.ignored+=1;continue}if(e.isDirectory){await a(e,i,c);continue}if(VD(e.name)){t.secret.push(i);continue}r.length>LD.files*2||r.push({path:i,file:await qD(e)})}};try{await a(n,``,[])}catch{i.push(`Some of this folder could not be read.`)}return GD(n.name,r,t,i)}async function XD(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=>RD.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(...HD(await e.file.text(),e.path.split(`/`).slice(0,-1).join(`/`)));let c=[];for(let e of a){if(WD(s,e.path)){t.ignored+=1;continue}if(VD(e.path.split(`/`).pop())){t.secret.push(e.path);continue}c.push(e)}return GD(r,c,t,[])}var ZD=new TextEncoder;function QD(e,t,n,r,i){let a=new Uint8Array(512),o=(e,t)=>a.set(typeof e==`string`?ZD.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 $D(e,t,n){let r=ZD.encode(e),i=r.length===e.length;if(i&&r.length<=100)return[QD(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[QD(r.slice(i+1),r.slice(0,i),t,n,`0`)]}let a=` path=${e}\n`,o=ZD.encode(a).length,s=o+String(o).length;String(s).length!==String(o).length&&(s=o+String(s).length);let c=ZD.encode(`${s}${a}`),l=new Uint8Array(Math.ceil(c.length/512)*512);l.set(c);let u=ZD.encode(e.replace(/[^\x20-\x7e]/g,`_`).slice(-100));return[QD(ZD.encode(`PaxHeader`),new Uint8Array,c.length,n,`x`),l,QD(u,new Uint8Array,t,n,`0`)]}async function eO(e){let t=[];for(let{path:n,file:r}of e){t.push(...$D(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>LD.archive)throw Error(`The packed project is ${(n.size/ID).toFixed(0)} MiB; the most allowed is ${LD.archive/ID} MiB.`);return n}var tO=1048576,nO=e=>e<tO?`${Math.max(1,Math.round(e/1024))} KiB`:`${(e/tO).toFixed(1)} MiB`,rO=e=>e.replace(/[^A-Za-z0-9._ -]/g,`-`).slice(0,100),iO=(e,t,n=`${t}s`)=>`${e.toLocaleString()} ${e===1?t:n}`;function aO({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(rO(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(YD(JD(e.dataTransfer)))},u=async t=>{let i=x().createSandbox;if(i)try{n({at:`working`,step:`Packing ${iO(t.files.length,`file`)}…`});let a=await eO(t.files);n({at:`working`,step:`Uploading ${nO(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,W.jsxs)(`div`,{className:`rt-new-sandbox`,children:[(t.at===`idle`||t.at===`reading`||t.at===`failed`&&!d)&&(0,W.jsxs)(`div`,{className:a?`rt-drop over`:`rt-drop`,onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:l,children:[(0,W.jsx)(re,{size:20}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:t.at===`reading`?`Reading the folder…`:`New sandbox: drop a project folder here`}),(0,W.jsxs)(`small`,{children:[`You will see what would be uploaded first. `,(0,W.jsx)(`code`,{children:`.env`}),` files, keys, `,(0,W.jsx)(`code`,{children:`node_modules`}),` and anything your `,(0,W.jsx)(`code`,{children:`.gitignore`}),` excludes stay on this machine. Up to `,LD.total/tO,` MiB, `,LD.file/tO,` MiB a file.`]}),t.at===`failed`&&(0,W.jsx)(`p`,{className:`rt-problem`,children:t.message})]}),(0,W.jsx)(`button`,{type:`button`,className:`rt-button`,disabled:t.at===`reading`,onClick:()=>s.current?.click(),children:`Choose folder`}),(0,W.jsx)(`input`,{ref:s,type:`file`,hidden:!0,multiple:!0,webkitdirectory:``,onChange:e=>{let t=e.target.files;t?.length&&c(XD(t)),e.target.value=``}})]}),d&&(0,W.jsxs)(`div`,{className:`rt-upload-preview`,children:[(0,W.jsxs)(`div`,{className:`rt-upload-head`,children:[(0,W.jsxs)(`label`,{children:[`Sandbox name`,(0,W.jsx)(`input`,{value:r,maxLength:100,onChange:e=>i(e.target.value)})]}),(0,W.jsx)(`button`,{type:`button`,className:`rt-icon-button`,"aria-label":`Cancel`,onClick:()=>n({at:`idle`}),children:(0,W.jsx)(Te,{size:15})})]}),(0,W.jsxs)(`dl`,{className:`rt-facts`,children:[(0,W.jsx)(`dt`,{children:`Will upload`}),(0,W.jsxs)(`dd`,{children:[iO(d.files.length,`file`),` · `,nO(d.total)]}),(0,W.jsx)(`dt`,{children:`Stays here`}),(0,W.jsxs)(`dd`,{children:[!d.skipped.ignored&&!d.skipped.excluded&&!d.skipped.secret.length&&`Nothing was left out.`,d.skipped.ignored>0&&(0,W.jsxs)(`span`,{children:[iO(d.skipped.ignored,`path`),` ignored by .gitignore. `]}),d.skipped.excluded>0&&(0,W.jsxs)(`span`,{children:[iO(d.skipped.excluded,`dependency or build folder`),` (node_modules, .git, dist…). `]}),d.skipped.secret.length>0&&(0,W.jsxs)(`span`,{children:[iO(d.skipped.secret.length,`credential file`),`: `,(0,W.jsxs)(`code`,{children:[d.skipped.secret.slice(0,6).join(`, `),d.skipped.secret.length>6?`, …`:``]})]})]}),(0,W.jsx)(`dt`,{children:`Files`}),(0,W.jsx)(`dd`,{className:`rt-upload-files`,children:(0,W.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,W.jsx)(`p`,{className:`rt-problem`,children:e},e)),t.at===`failed`&&(0,W.jsx)(`p`,{className:`rt-problem`,children:t.message}),(0,W.jsxs)(`div`,{className:`rt-actions`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`rt-button primary`,disabled:d.problems.length>0||!f,onClick:()=>void u(d),children:[(0,W.jsx)(xe,{size:13}),` Create sandbox`]}),(0,W.jsx)(`button`,{type:`button`,className:`rt-button`,onClick:()=>n({at:`idle`}),children:`Cancel`}),!f&&(0,W.jsx)(`small`,{className:`rt-muted`,children:`Name: letters, digits, spaces, and . _ - only.`})]})]}),t.at===`working`&&(0,W.jsx)(`p`,{className:`rt-upload-working`,children:t.step})]})}var oO=e=>e.split(`
37
+ `).find(e=>e.trim())?.trim()??`(empty prompt)`,sO=e=>new Date(typeof e==`number`?e*1e3:e).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),cO=e=>e==null?`—`:`${(e/1048576).toFixed(e<1048576?2:1)} MiB`;function lO(e){return e===`lima`?{title:`Local VM`,detail:`Lima on this machine`}:{title:`Cloud VM ${e.split(`@`).pop()}`,detail:e}}function uO(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 dO({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,W.jsxs)(`section`,{className:`rt-view`,children:[(0,W.jsx)(`header`,{className:`rt-view-head`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`eyebrow`,children:`SANDBOXES`}),(0,W.jsx)(`h1`,{children:`Where your agents ran`})]})}),v&&(0,W.jsx)(aO,{onCreated:e=>{g(e=>e+1),(i??n)(e)}}),s&&(0,W.jsx)(`p`,{className:`rt-empty`,children:s}),p&&(0,W.jsx)(`p`,{className:`rt-empty`,children:p}),!s&&a===null&&(0,W.jsx)(`p`,{className:`rt-empty`,children:`Loading…`}),!s&&a?.length===0&&(0,W.jsxs)(`p`,{className:`rt-empty`,children:[`No sandboxes yet. `,v?`Drop a project folder above, or from`:`From`,` a Git repository: `,(0,W.jsx)(`code`,{children:`raytrace sandbox create`})]}),b.map(e=>{let o=lO(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,W.jsxs)(`div`,{className:`rt-host`,children:[(0,W.jsxs)(`div`,{className:`rt-list-head`,children:[(0,W.jsxs)(`span`,{className:`rt-host-title`,children:[(0,W.jsx)(_e,{size:13}),` `,o.title.toUpperCase()]}),(0,W.jsxs)(`small`,{children:[o.detail,` · `,c?`connected`:`not connected now`,` · `,s.length,` sandbox`,s.length===1?``:`es`]})]}),(0,W.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=uO(e),u=`raytrace connect ${e.host===`lima`&&e.name?e.name:e.id}`;return(0,W.jsxs)(`li`,{className:a?`rt-prompt open`:`rt-prompt`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`rt-prompt-row`,"aria-expanded":a,onClick:()=>n(a?``:e.id),children:[(0,W.jsx)(`time`,{children:sO(e.created)}),(0,W.jsxs)(`strong`,{children:[(0,W.jsx)(`span`,{className:`rt-state s-${c.tone}`,children:c.label}),e.name]}),(0,W.jsxs)(`small`,{children:[s.length,` prompt`,s.length===1?``:`s`,` · `,e.id.slice(0,12),`…`]})]}),a&&(0,W.jsxs)(`div`,{className:`rt-prompt-detail`,children:[(0,W.jsxs)(`dl`,{className:`rt-facts`,children:[(0,W.jsx)(`dt`,{children:`Sandbox`}),(0,W.jsx)(`dd`,{children:(0,W.jsx)(`code`,{children:e.id})}),(0,W.jsx)(`dt`,{children:`Runs on`}),(0,W.jsxs)(`dd`,{children:[o.title,` `,(0,W.jsxs)(`span`,{className:`rt-muted`,children:[`(`,o.detail,`)`]})]}),(0,W.jsx)(`dt`,{children:`State`}),(0,W.jsxs)(`dd`,{children:[c.label,!e.on_host&&e.status!==`deleted`?(0,W.jsxs)(`span`,{className:`rt-muted`,children:[` — the manager is connected to another VM; last recorded: `,e.status]}):null]}),(0,W.jsx)(`dt`,{children:`Created`}),(0,W.jsxs)(`dd`,{children:[sO(e.created),e.deleted?(0,W.jsxs)(`span`,{className:`rt-muted`,children:[` · destroyed `,sO(e.deleted)]}):null]}),e.host!==`lima`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Uploaded`}),(0,W.jsxs)(`dd`,{children:[cO(e.imported_bytes),e.skipped_count?(0,W.jsxs)(`span`,{className:`rt-muted`,children:[` · `,e.skipped_count,` file`,e.skipped_count===1?``:`s`,` left out`]}):null]})]}),(0,W.jsx)(`dt`,{children:`Recording`}),(0,W.jsx)(`dd`,{children:e.transcripts===!1?`Commands only (no Claude Code transcripts)`:`Commands and Claude Code transcripts`}),i&&e.scan?.by_level&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:`Initial scan`}),(0,W.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,W.jsxs)(`button`,{type:`button`,className:`link-button`,onClick:()=>i(e.id),children:[(0,W.jsx)(he,{size:11}),` Open the scan`]})]})]})]}),e.status!==`deleted`&&e.on_host&&(0,W.jsxs)(`div`,{className:`rt-shell-line`,children:[(0,W.jsx)(`code`,{children:u}),(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>C(u),children:[(0,W.jsx)(V,{size:13}),` `,l===u?`Copied`:`Copy`]})]}),e.host===`lima`&&(0,W.jsxs)(`div`,{className:`rt-shell-line`,children:[(0,W.jsxs)(`code`,{children:[`raytrace sandbox destroy `,e.name||e.id]}),(0,W.jsxs)(`button`,{type:`button`,className:`rt-button`,onClick:()=>C(`raytrace sandbox destroy ${e.name||e.id}`),children:[(0,W.jsx)(V,{size:13}),` `,l===`raytrace sandbox destroy ${e.name||e.id}`?`Copied`:`Copy`]})]}),e.host===`lima`&&(0,W.jsxs)(`p`,{className:`rt-foot`,children:[`Run the first command in a terminal to open this sandbox, then start `,(0,W.jsx)(`code`,{children:`claude`}),` or `,(0,W.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,W.jsxs)(`div`,{className:`rt-shell-line`,children:[(0,W.jsx)(`code`,{children:`Destroy this sandbox and stop anything running in it. Its recorded evidence stays.`}),(0,W.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,W.jsxs)(`p`,{className:`rt-foot`,children:[`Run it in a terminal to open this sandbox, then start `,(0,W.jsx)(`code`,{children:`claude`}),` or `,(0,W.jsx)(`code`,{children:`codex`}),` there. Needs the RayTrace CLI, signed in as this account: `,(0,W.jsx)(`code`,{children:`npm install -g @raytrace-cli/cli@latest`}),`. On CLI 0.2 the command is `,(0,W.jsxs)(`code`,{children:[`raytrace sandbox shell `,e.id]}),`.`]}),(0,W.jsx)(`h3`,{children:`History`}),!s.length&&(0,W.jsx)(`p`,{className:`rt-muted`,children:`No prompts recorded in this sandbox yet.`}),s.length>0&&(0,W.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,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),children:[(0,W.jsx)(`time`,{dateTime:e.startedAt,children:sO(e.startedAt)}),(0,W.jsx)(`span`,{children:oO(e.title)}),(0,W.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,W.jsx)(P,{size:13})]})},e.id)})})]})]},e.id)})})]},e)}),w&&(0,W.jsxs)(`dialog`,{open:!0,className:`rt-dialog`,"aria-labelledby":`rt-destroy-title`,onCancel:e=>{e.preventDefault(),d||T(null)},children:[(0,W.jsx)(`h2`,{id:`rt-destroy-title`,children:`Destroy this sandbox?`}),(0,W.jsxs)(`p`,{children:[`“`,w.name||w.id,`” stops and is deleted. Its recorded evidence stays.`]}),(0,W.jsxs)(`div`,{className:`rt-dialog-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`rt-button`,autoFocus:!0,disabled:!!d,onClick:()=>T(null),children:`No`}),(0,W.jsx)(`button`,{type:`button`,className:`rt-button rt-danger`,disabled:!!d,onClick:()=>void E(w),children:d?`Destroying…`:`Yes, destroy`})]})]})]})}var fO=[`prompts`,`search`,`story`,`sandboxes`,`scan`,`calls`,`changes`,`sandbox`,`context`,`thought`,`playground`];function pO(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 mO(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 hO=e=>e.split(`
38
+ `).find(e=>e.trim())?.trim()??``,gO=e=>`${e.exchange_id}:${e.output_index}`;function _O({views:e=fO,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=Rw();(0,_.useEffect)(()=>{d(pO(e));let t=()=>d(pO(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 mO(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 Zw();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,W.jsx)(`section`,{className:`rt-view`,children:(0,W.jsx)(`p`,{className:`rt-empty`,children:`Loading…`})}):(0,W.jsx)(`section`,{className:`rt-view`,children:(0,W.jsxs)(`p`,{className:`rt-empty`,children:[c&&u.trace&&!w?`That prompt is no longer in the loaded history.`:`Choose a prompt first.`,` `,(0,W.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>g({view:`prompts`}),children:`Go to Prompts`})]})})}return(0,W.jsxs)(`main`,{className:`rt-shell`,ref:m,children:[(0,W.jsxs)(`aside`,{className:`nav rt-nav`,children:[(0,W.jsxs)(`div`,{className:`brand`,children:[(0,W.jsx)(Se,{size:22}),` RayTrace`]}),r(`search`)&&(0,W.jsxs)(`form`,{className:`rt-nav-search`,onSubmit:e=>{e.preventDefault(),g({view:`search`,q:f})},children:[(0,W.jsx)(ge,{size:13}),(0,W.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`Search what agents did…`,"aria-label":`Search agent activity`,spellCheck:!1})]}),(0,W.jsx)(`nav`,{className:`nav-destinations`,children:T.map(({view:e,label:t,icon:n})=>(0,W.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,W.jsx)(n,{size:16}),` `,t,e===`scan`&&v>0&&(0,W.jsx)(`span`,{className:`rt-count`,title:`${v} unseen alert${v===1?``:`s`}`,children:v})]},e))}),w&&(0,W.jsxs)(`div`,{className:`rt-viewing`,children:[(0,W.jsx)(`span`,{className:`workspace-label`,children:`VIEWING`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>g({view:`prompts`,trace:w.id}),title:w.title,children:hO(w.title)}),(0,W.jsx)(`small`,{children:new Date(w.startedAt).toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`})})]}),(0,W.jsxs)(`div`,{className:`nav-bottom`,children:[(0,W.jsxs)(`div`,{className:`nav-status`,children:[(0,W.jsxs)(`span`,{className:`status ${c?o?``:`offline`:`pending`}`,children:[(0,W.jsx)(`i`,{}),c?o?`CONNECTED`:t:`CONNECTING…`]}),(0,W.jsx)(`button`,{type:`button`,className:`theme-toggle`,onClick:()=>Iw(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,W.jsx)(kE,{target:m,variable:`--nav-width`,storageKey:`raytace.nav-width`,min:180,max:480,label:`Navigation width`})]}),u.view===`prompts`&&r(`prompts`)&&(0,W.jsx)(oD,{traces:i.filter(e=>!e.forkId),loaded:c,selectedId:u.trace,box:u.box,onBox:e=>g({view:`prompts`,box:e}),onSelect:e=>g({view:`prompts`,trace:e,box:u.box}),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,W.jsx)(hD,{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,W.jsx)(AD,{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,W.jsx)(dO,{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,W.jsx)(DT,{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,W.jsx)(QT,{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:gO(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,W.jsx)(MD,{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,W.jsx)(FD,{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,W.jsx)(ZE,{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,W.jsx)(EE,{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,W.jsx)(fE,{trace:w,focusCall:u.call},w.id):E())]})}var vO=[`prompts`,`search`,`story`,`sandboxes`,`calls`,`changes`,`sandbox`,`context`,`thought`,`playground`];S({fetch:(e,t)=>fetch(e,t)});var yO=5;function bO(){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)<yO),()=>{}),fetch(`/raytace/models`).then(e=>r(e.status===401),()=>{})},[]),!e&&!n?null:(0,W.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,W.jsxs)(W.Fragment,{children:[`An older RayTrace proxy is running, so parts of this page cannot load. Restart it: `,(0,W.jsx)(`code`,{children:`raytrace stop && raytrace start`})]}):(0,W.jsxs)(W.Fragment,{children:[`This browser is not signed in to RayTrace, so nothing can load. In a terminal, run: `,(0,W.jsx)(`code`,{children:`raytrace open`})]})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,W.jsxs)(_.StrictMode,{children:[(0,W.jsx)(bO,{}),(0,W.jsx)(_O,{views:vO})]}));