@rainmanhhh/pi-web 0.17.3 → 0.17.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.mjs +1 -1
- package/dist/static/assets/{CodeMirrorEditor-CacsGocn.js → CodeMirrorEditor-Ch5CyAol.js} +1 -1
- package/dist/static/assets/{abnfDiagram-VCTEODGH-C1O9QuBb.js → abnfDiagram-VCTEODGH-DdPNXM0s.js} +1 -1
- package/dist/static/assets/architecture-7GRP2DOG-BE8qK6CC.js +1 -0
- package/dist/static/assets/{architectureDiagram-5GKGNRK7-D4ZPi1aB.js → architectureDiagram-5GKGNRK7-Byg2xfDi.js} +1 -1
- package/dist/static/assets/{blockDiagram-I7D4REHJ-C3o_TFge.js → blockDiagram-I7D4REHJ-1GprO5l9.js} +1 -1
- package/dist/static/assets/{c4Diagram-7LVT6UL2-BdKyc7gE.js → c4Diagram-7LVT6UL2-Db_06j_i.js} +1 -1
- package/dist/static/assets/channel-C48bArYM.js +1 -0
- package/dist/static/assets/{chunk-4HAMMTFA-Bu_hjV1a.js → chunk-4HAMMTFA-B6qkrdd3.js} +1 -1
- package/dist/static/assets/{chunk-75Z2AOVW-B5Tu2ZlA.js → chunk-75Z2AOVW-BNdZStjG.js} +1 -1
- package/dist/static/assets/{chunk-DU6HZSFF-DOtyLN95.js → chunk-DU6HZSFF-BlR7iuue.js} +1 -1
- package/dist/static/assets/{chunk-F27PBJKO-C27ol9V3.js → chunk-F27PBJKO-CCU74QxW.js} +1 -1
- package/dist/static/assets/{chunk-GMAD6QVW-BNG6oDn-.js → chunk-GMAD6QVW-DC26FXkD.js} +1 -1
- package/dist/static/assets/{chunk-GVQU2GXP-D2lr0Jbe.js → chunk-GVQU2GXP-DzYKTnu8.js} +1 -1
- package/dist/static/assets/{chunk-IMKFNOWR-B9PWw0Qa.js → chunk-IMKFNOWR-CzNABsSs.js} +1 -1
- package/dist/static/assets/{chunk-L3NEJ4N5-D6z43dCn.js → chunk-L3NEJ4N5-B7JcCIrh.js} +1 -1
- package/dist/static/assets/{chunk-OSK3NFVY-4Qd9EA77.js → chunk-OSK3NFVY-DoLXkqL9.js} +1 -1
- package/dist/static/assets/{chunk-P2QGCYS3-ct6iPBvk.js → chunk-P2QGCYS3-CMVFi_Wb.js} +1 -1
- package/dist/static/assets/{chunk-POPQ4Y6H-Cz-yr6-Q.js → chunk-POPQ4Y6H-D29DCSQx.js} +1 -1
- package/dist/static/assets/{chunk-PWAF6VOD-CsWJZkBf.js → chunk-PWAF6VOD-CP3Av6hC.js} +1 -1
- package/dist/static/assets/{chunk-SHT3W25Y-CF2RMkj_.js → chunk-SHT3W25Y-CMXtML9B.js} +1 -1
- package/dist/static/assets/{chunk-SVP7TREG-BKYgyNxP.js → chunk-SVP7TREG-C16h1m6A.js} +1 -1
- package/dist/static/assets/{chunk-TICWLB2K-Nah63Thv.js → chunk-TICWLB2K-CZGyc8q4.js} +1 -1
- package/dist/static/assets/classDiagram-ZZMXUADV-pj3EPqRT.js +1 -0
- package/dist/static/assets/classDiagram-v2-VYDZK3BY-pj3EPqRT.js +1 -0
- package/dist/static/assets/{cynefin-OW5HDTMX-DH5xQATR.js → cynefin-OW5HDTMX-B9ELr43c.js} +1 -1
- package/dist/static/assets/{cynefinDiagram-5FMLGOSQ-CA3cm31s.js → cynefinDiagram-5FMLGOSQ-8BrnApqF.js} +1 -1
- package/dist/static/assets/{dagre-GXQ25YYZ-Bpu6ajv6.js → dagre-GXQ25YYZ-6PrtCmE0.js} +1 -1
- package/dist/static/assets/{diagram-S7CK7UJ4-CjgvO_Db.js → diagram-S7CK7UJ4-CvU4tdBn.js} +1 -1
- package/dist/static/assets/{diagram-UQ7AKVKN-CH05JSo2.js → diagram-UQ7AKVKN-PaxWMmxh.js} +1 -1
- package/dist/static/assets/{diagram-VSXAHHWV-BR9RhCXI.js → diagram-VSXAHHWV-BXLnbCYL.js} +1 -1
- package/dist/static/assets/{diagram-VX7I27RA-gyLpA7_S.js → diagram-VX7I27RA-SeFivQ7z.js} +1 -1
- package/dist/static/assets/{diagram-Z3DM3KII-Bsvsr9am.js → diagram-Z3DM3KII-rYlu9LOG.js} +1 -1
- package/dist/static/assets/{ebnfDiagram-PWID7BFC-CZmt2pTg.js → ebnfDiagram-PWID7BFC-DqevTAL8.js} +1 -1
- package/dist/static/assets/{erDiagram-RLTQ6QDP-CSs2lpXs.js → erDiagram-RLTQ6QDP-DE63UJHZ.js} +1 -1
- package/dist/static/assets/eventmodeling-NTZA5JFV-D_Qv4OkY.js +1 -0
- package/dist/static/assets/flowDiagram-HODETNUW-BTXa32xK.js +1 -0
- package/dist/static/assets/{ganttDiagram-EL5Y4UJY-CI95B0TI.js → ganttDiagram-EL5Y4UJY-BeuLeJt8.js} +1 -1
- package/dist/static/assets/{gitGraph-4MIJSDKK-Bvov2Slz.js → gitGraph-4MIJSDKK-C0IIZPvN.js} +1 -1
- package/dist/static/assets/{gitGraphDiagram-WWUBYQGX-Dmgy46EU.js → gitGraphDiagram-WWUBYQGX-Bbdesrto.js} +1 -1
- package/dist/static/assets/{highlighted-body-KPVGNVTW-BSMkF-ni.js → highlighted-body-KPVGNVTW-DfzVF_Dn.js} +1 -1
- package/dist/static/assets/{index-1K2MCA-Q.js → index-Cpmv5QD4.js} +13 -13
- package/dist/static/assets/{index-BPNQKbZL.css → index-DS6AWCX8.css} +1 -1
- package/dist/static/assets/{info-A6RAGUB7-BPZ7shys.js → info-A6RAGUB7-E88RlCiu.js} +1 -1
- package/dist/static/assets/{infoDiagram-27XIBGKW-k4Xg2qkT.js → infoDiagram-27XIBGKW-DjahuX1W.js} +1 -1
- package/dist/static/assets/{ishikawaDiagram-5VMMS53U-hzERLDMN.js → ishikawaDiagram-5VMMS53U-D8eS0PIk.js} +1 -1
- package/dist/static/assets/{journeyDiagram-3NMN7TZE-D3rlZm7i.js → journeyDiagram-3NMN7TZE-BiuAqdsB.js} +1 -1
- package/dist/static/assets/{kanban-definition-UXKFOSKX-DxTX8lBy.js → kanban-definition-UXKFOSKX-Bgub28XJ.js} +1 -1
- package/dist/static/assets/{line-CGm9_-3H.js → line-BcdRDj2I.js} +1 -1
- package/dist/static/assets/mermaid-HWGCJPDP-Gez0laAL.js +1 -0
- package/dist/static/assets/{mermaid-parser.core-ozZzYX2g.js → mermaid-parser.core-kRcmX23u.js} +3 -3
- package/dist/static/assets/{mermaid.core-CHsjoxqB.js → mermaid.core-ClvptCwB.js} +4 -4
- package/dist/static/assets/{mindmap-definition-YA3MSWOX-D0lXlIXw.js → mindmap-definition-YA3MSWOX-B3BCNcQP.js} +1 -1
- package/dist/static/assets/{packet-AYTQ26CC-CJKMarvZ.js → packet-AYTQ26CC-D8jzpWAZ.js} +1 -1
- package/dist/static/assets/{pegDiagram-XKGWAZYB-CdsO1Vq8.js → pegDiagram-XKGWAZYB-BwbzR2RJ.js} +1 -1
- package/dist/static/assets/{pie-WAS4IAKB-C4QTXcM0.js → pie-WAS4IAKB-CM122BCb.js} +1 -1
- package/dist/static/assets/{pieDiagram-E7YTZNPT-s1onVVSu.js → pieDiagram-E7YTZNPT-CTZz4LkW.js} +1 -1
- package/dist/static/assets/{quadrantDiagram-AXDQQJYC-BO25kw-c.js → quadrantDiagram-AXDQQJYC-By7OXgip.js} +1 -1
- package/dist/static/assets/{radar-RG4KPBEZ-CHwHpExO.js → radar-RG4KPBEZ-DANOuxUS.js} +1 -1
- package/dist/static/assets/{railroad-74A4TZTK-CsFeTDT7.js → railroad-74A4TZTK-DrxXgWTM.js} +1 -1
- package/dist/static/assets/railroad-abnf-HS5TGJTU-WIvbuzxk.js +1 -0
- package/dist/static/assets/railroad-ebnf-LZEXJU2U-Hm1gROR7.js +1 -0
- package/dist/static/assets/railroad-peg-WCYAUIDC-CLR1eVcC.js +1 -0
- package/dist/static/assets/{railroadDiagram-O6MQD6OU-swHG6oO7.js → railroadDiagram-O6MQD6OU-Cjr19nik.js} +1 -1
- package/dist/static/assets/{requirementDiagram-BXWQKSXE-DIHxxBtu.js → requirementDiagram-BXWQKSXE-7UuwvFdC.js} +1 -1
- package/dist/static/assets/{sankeyDiagram-P5KCCOFB-Drtk-MSO.js → sankeyDiagram-P5KCCOFB-CJWaTEoe.js} +1 -1
- package/dist/static/assets/{sequenceDiagram-WJ2MYXX4-DwPQMqAD.js → sequenceDiagram-WJ2MYXX4-DkbrOL40.js} +1 -1
- package/dist/static/assets/{stateDiagram-D77RDMKH-n7mUwr2C.js → stateDiagram-D77RDMKH-CxRQts1t.js} +1 -1
- package/dist/static/assets/stateDiagram-v2-MP3YSRHH-KoaQ2qB3.js +1 -0
- package/dist/static/assets/{swimlanes-42K2YHIH-B_djaOZ4.js → swimlanes-42K2YHIH-BSnvefe1.js} +1 -1
- package/dist/static/assets/swimlanesDiagram-VR7AAH4N-Cr6eDFZE.js +8 -0
- package/dist/static/assets/{timeline-definition-24CTP7MA-_v7-nCPT.js → timeline-definition-24CTP7MA-D2JqL0qx.js} +1 -1
- package/dist/static/assets/{treeView-Q6P3EWNA-DBxj05tD.js → treeView-Q6P3EWNA-B6TpxV6i.js} +1 -1
- package/dist/static/assets/{treemap-WGGIJYW6-CY5LInQU.js → treemap-WGGIJYW6-CQjCmel8.js} +1 -1
- package/dist/static/assets/{vennDiagram-4TSXK5OY-SHp2AYii.js → vennDiagram-4TSXK5OY-C29ZdtUH.js} +1 -1
- package/dist/static/assets/{wardley-WFR3VGLG-shRQ194z.js → wardley-WFR3VGLG-DeYTrfJ7.js} +1 -1
- package/dist/static/assets/{wardleyDiagram-VM6X3IG4-CBECyxlv.js → wardleyDiagram-VM6X3IG4-CGANwwyo.js} +1 -1
- package/dist/static/assets/{xychartDiagram-S5SC5T6Z-8RXO8gNj.js → xychartDiagram-S5SC5T6Z-Dy6j_CYY.js} +1 -1
- package/dist/static/index.html +2 -2
- package/package.json +5 -5
- package/dist/static/assets/architecture-7GRP2DOG-BKfZsKuR.js +0 -1
- package/dist/static/assets/channel-BLSr36oN.js +0 -1
- package/dist/static/assets/classDiagram-ZZMXUADV-DKDMjXJ1.js +0 -1
- package/dist/static/assets/classDiagram-v2-VYDZK3BY-DKDMjXJ1.js +0 -1
- package/dist/static/assets/eventmodeling-NTZA5JFV-BI5Ml4GZ.js +0 -1
- package/dist/static/assets/flowDiagram-HODETNUW-D2v5qUGL.js +0 -1
- package/dist/static/assets/mermaid-HWGCJPDP-mpro8vee.js +0 -1
- package/dist/static/assets/railroad-abnf-HS5TGJTU-CL9Hw1KV.js +0 -1
- package/dist/static/assets/railroad-ebnf-LZEXJU2U-BZgjNnFc.js +0 -1
- package/dist/static/assets/railroad-peg-WCYAUIDC-TMEi97ys.js +0 -1
- package/dist/static/assets/stateDiagram-v2-MP3YSRHH-BJeY_WTv.js +0 -1
- package/dist/static/assets/swimlanesDiagram-VR7AAH4N-l2yWfM_i.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-KPVGNVTW-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-KPVGNVTW-DfzVF_Dn.js","assets/rolldown-runtime-hePW80VL.js","assets/mermaid.core-ClvptCwB.js","assets/chunk-75Z2AOVW-BNdZStjG.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-B6xuSHsQ.js","assets/chunk-DU6HZSFF-BlR7iuue.js","assets/dist-v5Q1xZ2K.js","assets/chunk-PWAF6VOD-CP3Av6hC.js","assets/chunk-GMAD6QVW-DC26FXkD.js","assets/chunk-P2QGCYS3-CMVFi_Wb.js","assets/chunk-4HAMMTFA-B6qkrdd3.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-GVQU2GXP-DzYKTnu8.js","assets/chunk-OSK3NFVY-DoLXkqL9.js","assets/line-BcdRDj2I.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/graphlib-DS17s2tU.js","assets/chunk-L3NEJ4N5-B7JcCIrh.js","assets/CodeMirrorEditor-Ch5CyAol.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";(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 r=n((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 ee(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 te(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 P=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)},ne={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(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=ne,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:te}},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,P)}catch(e){P(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.8`})),i=n(((e,t)=>{t.exports=r()})),a=n((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}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i();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 a={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},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(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=a,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 s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.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,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,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=l(t.as,t.crossOrigin);a.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??a.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=l(n,t.crossOrigin);a.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=l(t.as,t.crossOrigin);a.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 a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),c=n(((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=s()})),l=n((e=>{var t=o(),n=i(),r=c();function a(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 s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(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 u(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 d(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 f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(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 ee(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?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function se(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function ce(e,t){ae++,ie[ae]=e.current,e.current=t}var le=oe(null),ue=oe(null),de=oe(null),fe=oe(null);function pe(e,t){switch(ce(de,t),ce(ue,e),ce(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}se(le),ce(le,e)}function me(){se(le),se(ue),se(de)}function he(e){e.memoizedState!==null&&ce(fe,e);var t=le.current,n=nf(t,e.type);t!==n&&(ce(ue,e),ce(le,n))}function ge(e){ue.current===e&&(se(le),se(ue)),fe.current===e&&(se(fe),fp._currentValue=re)}var _e,ve;function F(e){if(_e===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||``,ve=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+_e+e+ve}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!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(`
|
|
@@ -7,7 +7,7 @@ import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";(function(){let
|
|
|
7
7
|
`+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{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?F(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return F(e.type);case 16:return F(`Lazy`);case 13:return e.child!==t&&t!==null?F(`Suspense Fallback`):F(`Suspense`);case 19:return F(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return F(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
9
|
`+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:He,I=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(I(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(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 qe(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=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(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 Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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 Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(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-Be(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&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(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 it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=ne.p;return e===0?(e=window.event,e===void 0?32:Op(e.type)):e}function ot(e,t){var n=ne.p;try{return ne.p=e,t()}finally{ne.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tf(e);e!==null;){if(n=e[ct])return n;e=Tf(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=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]*$`),Dt={},Ot={};function kt(e){return Ce.call(Ot,e)?!0:Ce.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(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 jt(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 Mt(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 Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(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 It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Rt(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 zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(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=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(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=``+Nt(s):e.removeAttribute(`name`)}function Ht(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)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(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),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(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=``+Nt(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 Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(te(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=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 Yt(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||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(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 i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Yt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(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 Qt=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`]]),$t=/^[\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 en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(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="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[lt]||null;if(!i)throw Error(a(90));Vt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(Mu(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||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(a(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.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 gn=i.slice(e,1<r?1-r:void 0)}function vn(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 yn(){return!0}function bn(){return!1}function xn(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)?yn:bn,this.isPropagationStopped=bn,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=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=h({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=h({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,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!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(h({},kn,{dataTransfer:0})),Mn=xn(h({},wn,{relatedTarget:0})),Nn=xn(h({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(h({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(h({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=xn(h({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=xn(h({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=xn(h({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=xn(h({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=xn(h({},kn,{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})),Kn=xn(h({},Sn,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=dn&&`CompositionEvent`in window,Yn=null;dn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=dn&&`TextEvent`in window&&!Yn,Zn=dn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=_n(),gn=hn=mn=null,nr=!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 Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=zd(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){jd(e,0)}function dr(e){if(Lt(yt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(dn){var mr;if(dn){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,rn(e)),ln(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(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(!Ce.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(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=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(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=Rt(e.document)}return t}function Ar(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 jr=dn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==Rt(r)||(r=Mr,`selectionStart`in r&&Ar(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}),Pr&&Tr(Pr,r)||(Pr=r,r=zd(Nr,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Rr={animationend:Lr(`Animation`,`AnimationEnd`),animationiteration:Lr(`Animation`,`AnimationIteration`),animationstart:Lr(`Animation`,`AnimationStart`),transitionrun:Lr(`Transition`,`TransitionRun`),transitionstart:Lr(`Transition`,`TransitionStart`),transitioncancel:Lr(`Transition`,`TransitionCancel`),transitionend:Lr(`Transition`,`TransitionEnd`)},zr={},Br={};dn&&(Br=document.createElement(`div`).style,`AnimationEvent`in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),`TransitionEvent`in window||delete Rr.transitionend.transition);function Vr(e){if(zr[e])return zr[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Br)return zr[e]=t[n];return e}var Hr=Vr(`animationend`),Ur=Vr(`animationiteration`),Wr=Vr(`animationstart`),Gr=Vr(`transitionrun`),Kr=Vr(`transitionstart`),qr=Vr(`transitioncancel`),Jr=Vr(`transitionend`),Yr=new Map,Xr=`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(` `);Xr.push(`scrollEnd`);function L(e,t){Yr.set(e,t),wt(t,[e])}var Zr=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)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[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&&R(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),ai(e)}function ii(e,t){return ni(e,null,null,t),ai(e)}function R(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-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<Cu)throw Cu=0,wu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(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 ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(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 di(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 fi(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=rp(e,n,le.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ci(31,n,t,i),e.elementType=k,e.lanes=o,e;case y:return pi(n.children,i,o,t);case b:s=8,i|=24;break;case x:return e=ci(12,n,t,i|2),e.elementType=x,e.lanes=o,e;case T:return e=ci(13,n,t,i),e.elementType=T,e.lanes=o,e;case E:return e=ci(19,n,t,i),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(a(130,e===null?`null`:typeof e,``)),r=null}return t=ci(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function pi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function mi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function hi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function gi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _i=new WeakMap;function vi(e,t){if(typeof e==`object`&&e){var n=_i.get(e);return n===void 0?(t={value:e,source:t,stack:Se(t)},_i.set(e,t),t):n}return{value:e,source:t,stack:Se(t)}}var yi=[],bi=0,xi=null,Si=0,Ci=[],wi=0,Ti=null,Ei=1,Di=``;function Oi(e,t){yi[bi++]=Si,yi[bi++]=xi,xi=e,Si=t}function ki(e,t,n){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ti=e;var r=Ei;e=Di;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ei=1<<32-Be(t)+i|n<<i|r,Di=a+e}else Ei=1<<a|n<<i|r,Di=e}function Ai(e){e.return!==null&&(Oi(e,1),ki(e,1,0))}function ji(e){for(;e===xi;)xi=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null;for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Di=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null}function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ei=t.id,Di=t.overflow,Ti=e}var Ni=null,Pi=null,Fi=!1,Ii=null,Li=!1,Ri=Error(a(519));function zi(e){throw Gi(vi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Md(`cancel`,t),Md(`close`,t);break;case`iframe`:case`object`:case`embed`:Md(`load`,t);break;case`video`:case`audio`:for(n=0;n<kd.length;n++)Md(kd[n],t);break;case`source`:Md(`error`,t);break;case`img`:case`image`:case`link`:Md(`error`,t),Md(`load`,t);break;case`details`:Md(`toggle`,t);break;case`input`:Md(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Md(`invalid`,t);break;case`textarea`:Md(`invalid`,t),Kt(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||Gd(t.textContent,n)?(r.popover!=null&&(Md(`beforetoggle`,t),Md(`toggle`,t)),r.onScroll!=null&&Md(`scroll`,t),r.onScrollEnd!=null&&Md(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Ni=Ni.return}}function Hi(e){if(e!==Ni)return!1;if(!Fi)return Vi(e),Fi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||rf(e.type,e.memoizedProps)),n=!n),n&&Pi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Pi=wf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Pi=wf(e)}else t===27?(t=Pi,ff(e.type)?(e=Cf,Cf=null,Pi=e):Pi=t):Pi=Ni?Sf(e.stateNode.nextSibling):null;return!0}function Ui(){Pi=Ni=null,Fi=!1}function Wi(){var e=Ii;return e!==null&&(lu===null?lu=e:lu.push.apply(lu,e),Ii=null),e}function Gi(e){Ii===null?Ii=[e]:Ii.push(e)}var Ki=oe(null),qi=null,Ji=null;function Yi(e,t,n){ce(Ki,t._currentValue),t._currentValue=n}function Xi(e){e._currentValue=Ki.current,se(Ki)}function Zi(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 Qi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Zi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Zi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function $i(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;wr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===fe.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[fp]:e.push(fp))}i=i.return}e!==null&&Qi(t,e,n,r),t.flags|=262144}function ea(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ta(e){qi=e,Ji=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function na(e){return ia(qi,e)}function ra(e,t){return qi===null&&ta(e),ia(e,t)}function ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ji===null){if(e===null)throw Error(a(308));Ji=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ji=Ji.next=t;return n}var aa=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()})}},oa=t.unstable_scheduleCallback,sa=t.unstable_NormalPriority,ca={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new aa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&oa(sa,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=Cd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(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 va=P.S;P.S=function(e,t){fu=Oe(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=oe(null);function ba(){var e=ya.current;return e===null?ql.pooledCache:e}function xa(e,t){t===null?ce(ya,ya.current):ce(ya,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:ca._currentValue,pool:e}}var Ca=Error(a(460)),wa=Error(a(474)),Ta=Error(a(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=ql,e!==null&&100<e.shellSuspendCounter)throw Error(a(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,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(a(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(a(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(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 i(e,t){return e=ui(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=mi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===O&&ka(a)===t.type)?(t=i(t,n.props),Ia(t,n),t.return=e,t):(t=fi(n.type,n.key,n.props,null,e.mode,r),Ia(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=gi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=pi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=fi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case v:return t=gi(t,e.mode,n),t.return=e,t;case O:return t=ka(t),f(e,t,n)}if(te(t)||M(t))return t=pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===C)return f(e,ra(e,t),n);La(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=ka(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===C)return p(e,t,ra(e,n),r);La(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=ka(r),m(e,t,n,r,i)}if(te(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,Fa(r),i);if(r.$$typeof===C)return m(e,t,n,ra(t,r),i);La(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),Fi&&Oi(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 Fi&&Oi(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)}),Fi&&Oi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(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(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Fi&&Oi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Fi&&Oi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,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(i,e)}),Fi&&Oi(i,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=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ka(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=pi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=fi(o.type,o.key,o.props,null,e.mode,c),Ia(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=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=gi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ka(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===C)return b(e,r,ra(e,o),c);La(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=i(r,o),c.return=e,e=c):(n(e,r),c=mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(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 Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Kl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),R(e,null,n),t}return ni(e,r,t,n),ai(e)}function Ka(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,tt(e,n)}}function qa(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 Ja=!1;function Ya(){if(Ja){var e=ma;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!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?(Yl&f)===f:(r&f)===f){f!==0&&f===pa&&(Ja=!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:Va=!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),ru|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Za(n[e],t)}var $a=oe(null),eo=oe(0);function to(e,t){e=tu,ce(eo,e),ce($a,t),tu=e|t.baseLanes}function no(){ce(eo,tu),ce($a,$a.current)}function ro(){tu=eo.current,se($a),se(eo)}var io=oe(null),ao=null;function oo(e){var t=e.alternate;ce(fo,fo.current&1),ce(io,e),ao===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(ao=e)}function so(e){ce(fo,fo.current),ce(io,e),ao===null&&(ao=e)}function co(e){e.tag===22?(ce(fo,fo.current),ce(io,e),ao===null&&(ao=e)):lo(e)}function lo(){ce(fo,fo.current),ce(io,io.current)}function uo(e){se(io),ao===e&&(ao=null),se(fo)}var fo=oe(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yf(n)||bf(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 mo=0,ho=null,go=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(a(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return mo=a,ho=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Ws:Gs,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){P.H=Us;var t=go!==null&&go.next!==null;if(mo=0,_o=go=ho=null,vo=!1,So=0,Co=null,t)throw Error(a(300));e===null||cc||(e=e.dependencies,e!==null&&ea(e)&&(cc=!0))}function ko(e,t,n,r){ho=e;var i=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=i)throw Error(a(301));if(i+=1,_o=go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ks,o=t(n,r)}while(yo);return o}function Ao(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(go===null?null:go.memoizedState)!==e&&(ho.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}mo=0,_o=go=ho=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?ho.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(go===null){var e=ho.alternate;e=e===null?null:e.memoizedState}else e=go.next;var t=_o===null?ho.memoizedState:_o.next;if(t!==null)_o=t,go=e;else{if(e===null)throw ho.alternate===null?Error(a(467)):Error(a(310));go=e,e={memoizedState:go.memoizedState,baseState:go.baseState,baseQueue:go.baseQueue,queue:go.queue,next:null},_o===null?ho.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=Oa(Co,e,t),t=ho,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Ws:Gs),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===C)return na(e)}throw Error(a(438,String(e)))}function zo(e){var t=null,n=ho.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=ho.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=Io(),ho.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 Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),go,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(mo&f)===f:(Yl&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===pa&&(d=!0);else if((mo&p)===p){u=u.next,p===pa&&(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,ho.lanes|=p,ru|=p;f=u.action,bo&&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,ho.lanes|=f,ru|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(cc=!0,d&&(n=ma,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);wr(o,t.memoizedState)||(cc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wo(e,t,n){var r=ho,i=Fo(),o=Fi;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!wr((go||i).memoizedState,n);if(s&&(i.memoizedState=n,cc=!0),i=i.queue,hs(qo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,i,n,t),null),ql===null)throw Error(a(349));o||mo&127||Go(r,t,n)}return n}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ho.updateQueue,t===null?(t=Io(),ho.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&Yo(e)}function qo(e,t,n){return n(function(){Jo(t)&&Yo(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function Yo(e){var t=ii(e,2);t!==null&&Du(t,e,2)}function Xo(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Zo(e,t,n,r){return e.baseState=n,Ho(e,go,typeof r==`function`?r:Bo)}function Qo(e,t,n,r,i){if(Bs(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,$o(t,o)):(o.next=n.next,t.pending=n.next=o)}}function $o(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),es(e,t,s)}catch(n){ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),es(e,t,a)}catch(n){ns(e,t,n)}}function es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ts(e,t,n)},function(n){return ns(e,t,n)}):ts(e,t,n)}function ts(e,t,n){t.status=`fulfilled`,t.value=n,rs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$o(e,n)))}function ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,rs(t),t=t.next;while(t!==r)}e.action=null}function rs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function is(e,t){return t}function as(e,t){if(Fi){var n=ql.formState;if(n!==null){a:{var r=ho;if(Fi){if(Pi){b:{for(var i=Pi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=Sf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=Sf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:t},n.queue=r,n=Ls.bind(null,ho,r),r.dispatch=n,r=Xo(!1),a=zs.bind(null,ho,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Qo.bind(null,ho,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function os(e){return ss(Fo(),go,e)}function ss(e,t,n){if(t=Ho(e,t,is)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(ho.flags|=2048,us(9,{destroy:void 0},cs.bind(null,i,n),null)),[r,a,e]}function cs(e,t){e.action=t}function ls(e){var t=Fo(),n=go;if(n!==null)return ss(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=ho.updateQueue,t===null&&(t=Io(),ho.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 ds(){return Fo().memoizedState}function fs(e,t,n,r){var i=Po();ho.flags|=e,i.memoizedState=us(1|t,{destroy:void 0},n,r===void 0?null:r)}function ps(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;go!==null&&r!==null&&Eo(r,go.memoizedState.deps)?i.memoizedState=us(t,a,n,r):(ho.flags|=e,i.memoizedState=us(1|t,a,n,r))}function ms(e,t){fs(8390656,8,e,t)}function hs(e,t){ps(2048,8,e,t)}function gs(e){ho.flags|=4;var t=ho.updateQueue;if(t===null)t=Io(),ho.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _s(e){var t=Fo().memoizedState;return gs({ref:t,nextImpl:e}),function(){if(Kl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function vs(e,t){return ps(4,2,e,t)}function ys(e,t){return ps(4,4,e,t)}function bs(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 xs(e,t,n){n=n==null?null:n.concat([e]),ps(4,4,bs.bind(null,t,e),n)}function Ss(){}function Cs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ws(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function Ts(e,t,n){return n===void 0||mo&1073741824&&!(Yl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Eu(),ho.lanes|=e,ru|=e,n)}function Es(e,t,n,r){return wr(n,t)?n:$a.current===null?!(mo&42)||mo&1073741824&&!(Yl&261930)?(cc=!0,e.memoizedState=n):(e=Eu(),ho.lanes|=e,ru|=e,t):(e=Ts(e,n,r),wr(e,t)||(cc=!0),e)}function Ds(e,t,n,r,i){var a=ne.p;ne.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,zs(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Rs(e,t,_a(c,r),Tu(e)):Rs(e,t,r,Tu(e))}catch(n){Rs(e,t,{then:function(){},status:`rejected`,reason:n},Tu())}finally{ne.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Os(){}function ks(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=As(e).queue;Ds(e,i,t,re,n===null?Os:function(){return js(e),n(r)})}function As(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function js(e){var t=As(e);t.next===null&&(t=e.alternate.memoizedState),Rs(e,t.next.queue,{},Tu())}function Ms(){return na(fp)}function Ns(){return Fo().memoizedState}function Ps(){return Fo().memoizedState}function Fs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(Du(r,t,n),Ka(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Is(e,t,n){var r=Tu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Vs(t,n):(n=ri(e,t,n,r),n!==null&&(Du(n,e,r),Hs(n,t,r)))}function Ls(e,t,n){Rs(e,t,n,Tu())}function Rs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Vs(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,wr(s,o))return ni(e,t,i,0),ql===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return Du(n,e,r),Hs(n,t,r),!0}return!1}function zs(e,t,n,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(a(479))}else t=ri(e,n,r,2),t!==null&&Du(t,e,2)}function Bs(e){var t=e.alternate;return e===ho||t!==null&&t===ho}function Vs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Us={readContext:na,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};Us.useEffectEvent=To;var Ws={readContext:na,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:na,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){ze(!0);try{n(t)}finally{ze(!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=Is.bind(null,ho,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Xo(e);var t=e.queue,n=Ls.bind(null,ho,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(Po(),e,t)},useTransition:function(){var e=Xo(!1);return e=Ds.bind(null,ho,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ho,i=Po();if(Fi){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),ql===null)throw Error(a(349));Yl&127||Go(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ms(qo.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=ql.identifierPrefix;if(Fi){var n=Di,r=Ei;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ms,useFormState:as,useActionState:as,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zs.bind(null,ho,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=Fs.bind(null,ho)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(Kl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:na,use:Ro,useCallback:Cs,useContext:na,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Vo,useRef:ds,useState:function(){return Vo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){return Es(Fo(),go.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:os,useActionState:os,useOptimistic:function(e,t){return Zo(Fo(),go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Gs.useEffectEvent=_s;var Ks={readContext:na,use:Ro,useCallback:Cs,useContext:na,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Uo,useRef:ds,useState:function(){return Uo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){var n=Fo();return go===null?Ts(n,e,t):Es(n,go.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){var n=Fo();return go===null?(n.baseState=e,[e,n.queue.dispatch]):Zo(n,go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Ks.useEffectEvent=_s;function qs(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 Js={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tu(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Du(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tu(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Du(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tu(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(Du(t,e,n),Ka(t,e,n))}};function Ys(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?!Tr(n,r)||!Tr(i,a):!0}function Xs(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&&Js.enqueueReplaceState(t,t.state,null)}function Zs(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 Qs(e){Zr(e)}function $s(e){console.error(e)}function ec(e){Zr(e)}function tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function nc(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 rc(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){tc(e,t)},n}function ic(e){return e=Wa(e),e.tag=3,e}function ac(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(){nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){nc(t,n,r),typeof i!=`function`&&(hu===null?hu=new Set([this]):hu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function oc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&$i(t,n,i,!0),n=io.current,n!==null){switch(n.tag){case 31:case 13:return ao===null?zu():n.alternate===null&&nu===0&&(nu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),id(e,r,i)),!1;case 22:return n.flags|=65536,r===Ea?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)),id(e,r,i)),!1}throw Error(a(435,n.tag))}return id(e,r,i),zu(),!1}if(Fi)return t=io.current,t===null?(r!==Ri&&(t=Error(a(423),{cause:r}),Gi(vi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=vi(r,n),i=rc(e.stateNode,r,i),qa(e,i),nu!==4&&(nu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ri&&(e=Error(a(422),{cause:r}),Gi(vi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=vi(o,n),cu===null?cu=[o]:cu.push(o),nu!==4&&(nu=2),t===null)return!0;r=vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=rc(n.stateNode,r,e),qa(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`&&(hu===null||!hu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=ic(i),ac(i,e,n,r),qa(n,i),!1}n=n.return}while(n!==null);return!1}var sc=Error(a(461)),cc=!1;function lc(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function uc(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 ta(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(Fi&&s&&Ai(t),t.flags|=1,lc(e,t,r,i),t.child)}function dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,fc(e,t,a,r,i)):(e=fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Fc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return Pc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref){if(cc=!1,t.pendingProps=r=a,Fc(e,i))e.flags&131072&&(cc=!0);else return t.lanes=e.lanes,Pc(e,t,i)}}return bc(e,t,n,r,i)}function pc(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 hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?no():to(t,a),co(t);else return r=t.lanes=536870912,hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),no(),lo(t)):(xa(t,a.cachePool),to(t,a),lo(t),t.memoizedState=null);return lc(e,t,i,n),t.child}function mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),no(),co(t),e!==null&&$i(e,t,r,!0),t.childLanes=i,null}function gc(e,t){return t=kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _c(e,t,n){return za(t,e.child,null,n),e=gc(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function vc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(Fi){if(r.mode===`hidden`)return e=gc(t,r),t.lanes=536870912,mc(null,e);if(so(t),(e=Pi)?(e=vf(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return gc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(so(t),i){if(t.flags&256)t.flags&=-257,t=_c(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(cc||$i(e,t,n,!1),i=(n&e.childLanes)!==0,cc||i){if(r=ql,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),Du(r,e,s),sc;zu(),t=_c(e,t,n)}else e=o.treeContext,Pi=Sf(s.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=gc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function yc(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(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bc(e,t,n,r,i){return ta(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(Fi&&r&&Ai(t),t.flags|=1,lc(e,t,n,i),t.child)}function xc(e,t,n,r,i,a){return ta(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!cc?(Mo(e,t,a),Pc(e,t,a)):(Fi&&r&&Ai(t),t.flags|=1,lc(e,t,n,a),t.child)}function Sc(e,t,n,r,i){if(ta(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=na(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Js,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?na(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(qs(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&&Js.enqueueReplaceState(a,a.state,null),Xa(t,r,a,i),Ya(),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=Zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=na(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)&&Xs(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,Xa(t,r,a,i),Ya(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(qs(t,n,d,r),l=t.memoizedState),(c=Va||Ys(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,Ua(e,t),o=t.memoizedProps,u=Zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=na(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)&&Xs(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,Xa(t,r,a,i),Ya();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&ea(e.dependencies)?(typeof s==`function`&&(qs(t,n,s,r),p=t.memoizedState),(u=Va||Ys(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ea(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,yc(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=za(t,e.child,null,i),t.child=za(t,null,n,i)):lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Pc(e,t,i),e}function Cc(e,t,n,r){return Ui(),t.flags|=256,lc(e,t,n,r),t.child}var wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tc(e){return{baseLanes:e,cachePool:Sa()}}function Ec(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ou),e}function Dc(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(fo.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Fi){if(i?oo(t):lo(t),(e=Pi)?(e=vf(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return bf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(lo(t),i=t.mode,c=kc({mode:`hidden`,children:c},i),r=pi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(null,r)):(oo(t),Oc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(oo(t),t.flags&=-257,t=Ac(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,i=t.mode,r=kc({mode:`visible`,children:r.children},i),c=pi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,t=mc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(oo(t),bf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Gi({value:r,source:null,stack:null}),t=Ac(e,t,n)}else if(cc||$i(e,t,n,!1),s=(n&e.childLanes)!==0,cc||s){if(s=ql,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),Du(s,e,r),sc;yf(c)||zu(),t=Ac(e,t,n)}else yf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=Sf(c.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=Oc(t,r.children),t.flags|=4096);return t}return i?(lo(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=pi(c,i,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,mc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Tc(n):(i=c.cachePool,i===null?i=Sa():(l=ca._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(e.child,r)):(oo(t),n=e.child,e=n.sibling,n=ui(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 Oc(e,t){return t=kc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function kc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Ac(e,t,n){return za(t,e.child,null,n),e=Oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zi(e.return,t,n)}function Mc(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 Nc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ce(fo,o),lc(e,t,r,n),r=Fi?Si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jc(e,n,t);else if(e.tag===19)jc(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&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Mc(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&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Mc(t,!0,n,null,a,r);break;case`together`:Mc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Pc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ru|=t.lanes,(n&t.childLanes)===0){if(e!==null){if($i(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ea(e)))}function Ic(e,t,n){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),Yi(t,ca,e.memoizedState.cache),Ui();break;case 27:case 5:he(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,so(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(oo(t),e=Pc(e,t,n),e===null?null:e.sibling):Dc(e,t,n):(oo(t),t.flags|=128,null);oo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=($i(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Nc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ce(fo,fo.current),r)break;return null;case 22:return t.lanes=0,pc(e,t,n,t.pendingProps);case 24:Yi(t,ca,e.memoizedState.cache)}return Pc(e,t,n)}function Lc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)cc=!0;else{if(!Fc(e,n)&&!(t.flags&128))return cc=!1,Ic(e,t,n);cc=!!(e.flags&131072)}}else cc=!1,Fi&&t.flags&1048576&&ki(t,Si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Zs(e,r),t.tag=1,t=Sc(null,t,e,r,n)):(t.tag=0,t=bc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=uc(null,t,e,r,n);break a}if(i===D){t.tag=14,t=dc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(a(306,t,``))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Zs(r,t.pendingProps),Sc(e,t,r,i,n);case 3:a:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ua(e,t),Xa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Yi(t,ca,r),r!==o.cache&&Qi(t,[ca],n,!0),Ya(),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=Cc(e,t,r,n);break a}if(r!==i){i=vi(Error(a(424)),t),Gi(i),t=Cc(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(Pi=Sf(e.firstChild),Ni=t,Fi=!0,Ii=null,Li=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ui(),r===i){t=Pc(e,t,n);break a}lc(e,t,r,n)}t=t.child}return t;case 26:return yc(e,t),e===null?(n=Uf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fi||(n=t.type,e=t.pendingProps,r=ef(de.current).createElement(n),r[ct]=t,r[lt]=e,Jd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=Uf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return he(t),e===null&&Fi&&(r=t.stateNode=Ef(t.type,t.pendingProps,de.current),Ni=t,Li=!0,i=Pi,ff(t.type)?(Cf=i,Pi=Sf(r.firstChild)):Pi=i),lc(e,t,t.pendingProps.children,n),yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fi&&((i=r=Pi)&&(r=gf(r,t.type,t.pendingProps,Li),r===null?i=!1:(t.stateNode=r,Ni=t,Pi=Sf(r.firstChild),Li=!1,i=!0)),i||zi(t)),he(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,rf(i,o)?r=null:s!==null&&rf(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Do(e,t,Ao,null,null,n),fp._currentValue=i),yc(e,t),lc(e,t,r,n),t.child;case 6:return e===null&&Fi&&((e=n=Pi)&&(n=_f(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||zi(t)),null;case 13:return Dc(e,t,n);case 4:return pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):lc(e,t,r,n),t.child;case 11:return uc(e,t,t.type,t.pendingProps,n);case 7:return lc(e,t,t.pendingProps,n),t.child;case 8:return lc(e,t,t.pendingProps.children,n),t.child;case 12:return lc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Yi(t,t.type,r.value),lc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ta(t),i=na(i),r=r(i),t.flags|=1,lc(e,t,r,n),t.child;case 14:return dc(e,t,t.type,t.pendingProps,n);case 15:return fc(e,t,t.type,t.pendingProps,n);case 19:return Nc(e,t,n);case 31:return vc(e,t,n);case 22:return pc(e,t,n,t.pendingProps);case 24:return ta(t),r=na(ca),e===null?(i=ba(),i===null&&(i=ql,o=la(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ha(t),Yi(t,ca,i)):((e.lanes&n)!==0&&(Ua(e,t),Xa(t,null,null,n),Ya()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Yi(t,ca,r),r!==i.cache&&Qi(t,[ca],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Yi(t,ca,r))),lc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Rc(e){e.flags|=4}function zc(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(Iu())e.flags|=8192;else throw Aa=Ea,wa}}else e.flags&=-16777217}function Bc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ip(t)){if(Iu())e.flags|=8192;else throw Aa=Ea,wa}}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,su|=t)}function Hc(e,t){if(!Fi)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 Uc(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 Wc(e,t,n){var r=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Uc(t),null;case 1:return Uc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Xi(ca),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Rc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wi())),Uc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Rc(t),o===null?(Uc(t),zc(t,i,null,r,n)):(Uc(t),Bc(t,o))):o?o===e.memoizedState?(Uc(t),t.flags&=-16777217):(Rc(t),Uc(t),Bc(t,o)):(e=e.memoizedProps,e!==r&&Rc(t),Uc(t),zc(t,i,e,r,n)),null;case 27:if(ge(t),n=de.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Uc(t),null}e=le.current,Hi(t)?Bi(t,e):(e=Ef(i,r,n),t.stateNode=e,Rc(t))}return Uc(t),null;case 5:if(ge(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Uc(t),null}if(o=le.current,Hi(t))Bi(t,o);else{var s=ef(de.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);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(i,{is:r.is}):s.createElement(i)}}o[ct]=t,o[lt]=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(Jd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Rc(t)}}return Uc(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=de.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ni,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Gd(e.nodeValue,n)),e||zi(t,!0)}else e=ef(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Uc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[ct]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(a(558))}return Uc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[ct]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),i=!1}else i=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vc(t,t.updateQueue),Uc(t),null);case 4:return me(),e===null&&Fd(t.stateNode.containerInfo),Uc(t),null;case 10:return Xi(t.type),Uc(t),null;case 19:if(se(fo),r=t.memoizedState,r===null)return Uc(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Hc(r,!1);else{if(nu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Hc(r,!1),e=o.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return ce(fo,fo.current&1|2),Fi&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Oe()>pu&&(t.flags|=128,i=!0,Hc(r,!1),t.lanes=4194304)}}else{if(!i){if(e=po(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Hc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Fi)return Uc(t),null}else 2*Oe()-r.renderingStartTime>pu&&n!==536870912&&(t.flags|=128,i=!0,Hc(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?(Uc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Oe(),e.sibling=null,n=fo.current,ce(fo,i?n&1|2:n&1),Fi&&Oi(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Uc(t),t.subtreeFlags&6&&(t.flags|=8192)):Uc(t),n=t.updateQueue,n!==null&&Vc(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&&se(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(ca),Uc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Gc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(ca),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(a(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(fo),null;case 4:return me(),null;case 10:return Xi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&se(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(ca),null;case 25:return null;default:return null}}function Kc(e,t){switch(ji(t),t.tag){case 3:Xi(ca),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:se(fo);break;case 10:Xi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&se(ya);break;case 24:Xi(ca)}}function qc(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){rd(t,t.return,e)}}function Jc(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){rd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){rd(t,t.return,e)}}function Yc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){rd(e,e.return,t)}}}function Xc(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){rd(e,t,n)}}function Zc(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){rd(e,t,n)}}function Qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){rd(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){rd(e,t,n)}else n.current=null}}function $c(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){rd(e,e.return,t)}}function el(e,t,n){try{var r=e.stateNode;Yd(r,e.type,n,t),r[lt]=t}catch(t){rd(e,e.return,t)}}function tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ff(e.type)||e.tag===4}function nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||tl(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&&ff(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 rl(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=tn));else if(r!==4&&(r===27&&ff(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(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&&ff(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Jd(t,r,n),t[ct]=e,t[lt]=n}catch(t){rd(e,e.return,t)}}var ol=!1,sl=!1,cl=!1,ll=typeof WeakSet==`function`?WeakSet:Set,ul=null;function dl(e,t){if(e=e.containerInfo,Qd=xp,e=kr(e),Ar(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 i=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||i!==0&&f.nodeType!==3||(c=s+i),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===i&&(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($d={focusedElem:e,selectionRange:n},xp=!1,ul=t;ul!==null;)if(t=ul,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ul=e;else for(;ul!==null;){switch(t=ul,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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Zs(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){rd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)hf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:hf(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(a(163))}if(e=t.sibling,e!==null){e.return=t.return,ul=e;break}ul=t.return}}function fl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Dl(e,n),r&4&&qc(5,n);break;case 1:if(Dl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){rd(n,n.return,e)}else{var i=Zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){rd(n,n.return,e)}}}r&64&&Yc(n),r&512&&Zc(n,n.return);break;case 3:if(Dl(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{Qa(e,t)}catch(e){rd(n,n.return,e)}}break;case 27:t===null&&r&4&&al(n);case 26:case 5:Dl(e,n),t===null&&r&4&&$c(n),r&512&&Zc(n,n.return);break;case 12:Dl(e,n);break;case 31:Dl(e,n),r&4&&vl(e,n);break;case 13:Dl(e,n),r&4&&yl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=sd.bind(null,n),xf(e,n))));break;case 22:if(r=n.memoizedState!==null||ol,!r){t=t!==null&&t.memoizedState!==null||sl,i=ol;var a=sl;ol=r,(sl=t)&&!a?kl(e,n,!!(n.subtreeFlags&8772)):Dl(e,n),ol=i,sl=a}break;case 30:break;default:Dl(e,n)}}function pl(e){var t=e.alternate;t!==null&&(e.alternate=null,pl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&>(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 ml=null,hl=!1;function gl(e,t,n){for(n=n.child;n!==null;)_l(e,t,n),n=n.sibling}function _l(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:sl||Qc(n,t),gl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:sl||Qc(n,t);var r=ml,i=hl;ff(n.type)&&(ml=n.stateNode,hl=!1),gl(e,t,n),Df(n.stateNode),ml=r,hl=i;break;case 5:sl||Qc(n,t);case 6:if(r=ml,i=hl,ml=null,gl(e,t,n),ml=r,hl=i,ml!==null){if(hl)try{(ml.nodeType===9?ml.body:ml.nodeName===`HTML`?ml.ownerDocument.body:ml).removeChild(n.stateNode)}catch(e){rd(n,t,e)}else try{ml.removeChild(n.stateNode)}catch(e){rd(n,t,e)}}break;case 18:ml!==null&&(hl?(e=ml,pf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qp(e)):pf(ml,n.stateNode));break;case 4:r=ml,i=hl,ml=n.stateNode.containerInfo,hl=!0,gl(e,t,n),ml=r,hl=i;break;case 0:case 11:case 14:case 15:Jc(2,n,t),sl||Jc(4,n,t),gl(e,t,n);break;case 1:sl||(Qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Xc(n,t,r)),gl(e,t,n);break;case 21:gl(e,t,n);break;case 22:sl=(r=sl)||n.memoizedState!==null,gl(e,t,n),sl=r;break;default:gl(e,t,n)}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qp(e)}catch(e){rd(t,t.return,e)}}}function yl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qp(e)}catch(e){rd(t,t.return,e)}}function bl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ll),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ll),t;default:throw Error(a(435,e.tag))}}function xl(e,t){var n=bl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=cd.bind(null,e,t);t.then(r,r)}})}function Sl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ff(c.type)){ml=c.stateNode,hl=!1;break a}break;case 5:ml=c.stateNode,hl=!1;break a;case 3:case 4:ml=c.stateNode.containerInfo,hl=!0;break a}c=c.return}if(ml===null)throw Error(a(160));_l(o,s,i),ml=null,hl=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wl(t,e),t=t.sibling}var Cl=null;function wl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sl(t,e),Tl(e),r&4&&(Jc(3,e,e.return),qc(3,e),Jc(5,e,e.return));break;case 1:Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&64&&ol&&(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 i=Cl;if(Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(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,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[ht]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Jd(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=tp(`link`,`href`,i).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=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=tp(`meta`,`content`,i).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=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[ct]=e,xt(o),r=o}e.stateNode=r}else np(i,e.type,e.stateNode)}else e.stateNode=Xf(i,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&el(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?np(i,e.type,e.stateNode):Xf(i,r,e.memoizedProps))}break;case 27:Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),n!==null&&r&4&&el(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),e.flags&32){i=e.stateNode;try{qt(i,``)}catch(t){rd(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,el(e,i,n===null?i:n.memoizedProps)),r&1024&&(cl=!0);break;case 6:if(Sl(t,e),Tl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){rd(e,e.return,t)}}break;case 3:if(ep=null,i=Cl,Cl=Af(t.containerInfo),Sl(t,e),Cl=i,Tl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qp(t.containerInfo)}catch(t){rd(e,e.return,t)}cl&&(cl=!1,El(e));break;case 4:r=Cl,Cl=Af(e.stateNode.containerInfo),Sl(t,e),Tl(e),Cl=r;break;case 12:Sl(t,e),Tl(e);break;case 31:Sl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 13:Sl(t,e),Tl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(du=Oe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=ol,d=sl;if(ol=u||i,sl=d||l,Sl(t,e),sl=d,ol=u,Tl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||ol||sl||Ol(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)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){rd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){rd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?mf(m,!0):mf(l.stateNode,!1)}catch(e){rd(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,xl(e,n))));break;case 19:Sl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 30:break;case 21:break;default:Sl(t,e),Tl(e)}}function Tl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(tl(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;il(e,nl(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),il(e,nl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;rl(e,nl(e),s);break;default:throw Error(a(161))}}catch(t){rd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function El(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;El(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Dl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fl(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Jc(4,t,t.return),Ol(t);break;case 1:Qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Xc(t,t.return,n),Ol(t);break;case 27:Df(t.stateNode);case 26:case 5:Qc(t,t.return),Ol(t);break;case 22:t.memoizedState===null&&Ol(t);break;case 30:Ol(t);break;default:Ol(t)}e=e.sibling}}function kl(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:kl(i,a,n),qc(4,a);break;case 1:if(kl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){rd(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++)Za(c[i],s)}catch(e){rd(r,r.return,e)}}n&&o&64&&Yc(a),Zc(a,a.return);break;case 27:al(a);case 26:case 5:kl(i,a,n),n&&r===null&&o&4&&$c(a),Zc(a,a.return);break;case 12:kl(i,a,n);break;case 31:kl(i,a,n),n&&o&4&&vl(i,a);break;case 13:kl(i,a,n),n&&o&4&&yl(i,a);break;case 22:a.memoizedState===null&&kl(i,a,n),Zc(a,a.return);break;case 30:break;default:kl(i,a,n)}t=t.sibling}}function Al(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&&ua(n))}function jl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function Ml(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nl(e,t,n,r),t=t.sibling}function Nl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ml(e,t,n,r),i&2048&&qc(9,t);break;case 1:Ml(e,t,n,r);break;case 3:Ml(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&&ua(e)));break;case 12:if(i&2048){Ml(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){rd(t,t.return,e)}}else Ml(e,t,n,r);break;case 31:Ml(e,t,n,r);break;case 13:Ml(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ml(e,t,n,r):(a._visibility|=2,Pl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Ml(e,t,n,r):Fl(e,t),i&2048&&Al(o,t);break;case 24:Ml(e,t,n,r),i&2048&&jl(t.alternate,t);break;default:Ml(e,t,n,r)}}function Pl(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:Pl(a,o,s,c,i),qc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Pl(a,o,s,c,i)):u._visibility&2?Pl(a,o,s,c,i):Fl(a,o),i&&l&2048&&Al(o.alternate,o);break;case 24:Pl(a,o,s,c,i),i&&l&2048&&jl(o.alternate,o);break;default:Pl(a,o,s,c,i)}t=t.sibling}}function Fl(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:Fl(n,r),i&2048&&Al(r.alternate,r);break;case 24:Fl(n,r),i&2048&&jl(r.alternate,r);break;default:Fl(n,r)}t=t.sibling}}var Il=8192;function Ll(e,t,n){if(e.subtreeFlags&Il)for(e=e.child;e!==null;)Rl(e,t,n),e=e.sibling}function Rl(e,t,n){switch(e.tag){case 26:Ll(e,t,n),e.flags&Il&&e.memoizedState!==null&&ap(n,Cl,e.memoizedState,e.memoizedProps);break;case 5:Ll(e,t,n);break;case 3:case 4:var r=Cl;Cl=Af(e.stateNode.containerInfo),Ll(e,t,n),Cl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Il,Il=16777216,Ll(e,t,n),Il=r):Ll(e,t,n));break;default:Ll(e,t,n)}}function zl(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 Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Ul(r,e)}zl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vl(e),e=e.sibling}function Vl(e){switch(e.tag){case 0:case 11:case 15:Bl(e),e.flags&2048&&Jc(9,e,e.return);break;case 3:Bl(e);break;case 12:Bl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hl(e)):Bl(e);break;default:Bl(e)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Ul(r,e)}zl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Jc(8,t,t.return),Hl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hl(t));break;default:Hl(t)}e=e.sibling}}function Ul(e,t){for(;ul!==null;){var n=ul;switch(n.tag){case 0:case 11:case 15:Jc(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:ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ul=r;else a:for(n=e;ul!==null;){r=ul;var i=r.sibling,a=r.return;if(pl(r),r===n){ul=null;break a}if(i!==null){i.return=a,ul=i;break a}ul=a}}}var Wl={getCacheForType:function(e){var t=na(ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return na(ca).controller.signal}},Gl=typeof WeakMap==`function`?WeakMap:Map,Kl=0,ql=null,Jl=null,Yl=0,Xl=0,Zl=null,Ql=!1,$l=!1,eu=!1,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=0,cu=null,lu=null,uu=!1,du=0,fu=0,pu=1/0,mu=null,hu=null,gu=0,_u=null,vu=null,yu=0,bu=0,xu=null,Su=null,Cu=0,wu=null;function Tu(){return Kl&2&&Yl!==0?Yl&-Yl:P.T===null?at():Cd()}function Eu(){if(ou===0){if(!(Yl&536870912)||Fi){var e=We;We<<=1,!(We&3932160)&&(We=262144),ou=e}else ou=536870912}return e=io.current,e!==null&&(e.flags|=32),ou}function Du(e,t,n){(e===ql&&(Xl===2||Xl===9)||e.cancelPendingCommit!==null)&&(Pu(e,0),ju(e,Yl,ou,!1)),Qe(e,n),(!(Kl&2)||e!==ql)&&(e===ql&&(!(Kl&2)&&(iu|=n),nu===4&&ju(e,Yl,ou,!1)),gd(e))}function Ou(e,t,n){if(Kl&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Je(e,t),i=r?Hu(e,t):Bu(e,t,!0),o=r;do{if(i===0){$l&&!r&&ju(e,t,0,!1);break}if(n=e.current.alternate,o&&!Au(n)){i=Bu(e,t,!1),o=!1;continue}if(i===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;i=cu;var l=c.current.memoizedState.isDehydrated;if(l&&(Pu(c,s).flags|=256),s=Bu(c,s,!1),s!==2){if(eu&&!l){c.errorRecoveryDisabledLanes|=o,iu|=o,i=4;break a}o=lu,lu=i,o!==null&&(lu===null?lu=o:lu.push.apply(lu,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Pu(e,0),ju(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:ju(r,t,ou,!Ql);break a;case 2:lu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=du+300-Oe(),10<i)){if(ju(r,t,ou,!Ql),qe(r,0,!0)!==0)break a;yu=t,r.timeoutHandle=sf(ku.bind(null,r,n,lu,mu,uu,t,ou,iu,su,Ql,o,`Throttled`,-0,0),i);break a}ku(r,n,lu,mu,uu,t,ou,iu,su,Ql,o,null,-0,0)}break}while(1);gd(e)}function ku(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:tn},Rl(t,a,d);var m=(a&62914560)===a?du-Oe():(a&4194048)===a?fu-Oe():0;if(m=sp(d,m),m!==null){yu=a,e.cancelPendingCommit=m(Yu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ju(e,a,o,!l);return}}Yu(e,t,a,n,r,i,o,s,c)}function Au(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(!wr(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 ju(e,t,n,r){t&=~au,t&=~iu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function Mu(){return Kl&6?!0:(_d(0,!1),!1)}function Nu(){if(Jl!==null){if(Xl===0)var e=Jl.return;else e=Jl,Ji=qi=null,No(e),Na=null,Pa=0,e=Jl;for(;e!==null;)Kc(e.alternate,e),e=e.return;Jl=null}}function Pu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yu=0,Nu(),ql=e,Jl=n=ui(e.current,null),Yl=t,Xl=0,Zl=null,Ql=!1,$l=Je(e,t),eu=!1,su=ou=au=iu=ru=nu=0,lu=cu=null,uu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return tu=t,ti(),n}function Fu(e,t){ho=null,P.H=Us,t===Ca||t===Ta?(t=ja(),Xl=3):t===wa?(t=ja(),Xl=4):Xl=t===sc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Zl=t,Jl===null&&(nu=1,tc(e,vi(t,e.current)))}function Iu(){var e=io.current;return e===null?!0:(Yl&4194048)===Yl?ao===null:(Yl&62914560)===Yl||Yl&536870912?e===ao:!1}function Lu(){var e=P.H;return P.H=Us,e===null?Us:e}function Ru(){var e=P.A;return P.A=Wl,e}function zu(){nu=4,Ql||(Yl&4194048)!==Yl&&io.current!==null||($l=!0),!(ru&134217727)&&!(iu&134217727)||ql===null||ju(ql,Yl,ou,!1)}function Bu(e,t,n){var r=Kl;Kl|=2;var i=Lu(),a=Ru();(ql!==e||Yl!==t)&&(mu=null,Pu(e,t)),t=!1;var o=nu;a:do try{if(Xl!==0&&Jl!==null){var s=Jl,c=Zl;switch(Xl){case 8:Nu(),o=6;break a;case 3:case 2:case 9:case 6:io.current===null&&(t=!0);var l=Xl;if(Xl=0,Zl=null,Ku(e,s,c,l),n&&$l){o=0;break a}break;default:l=Xl,Xl=0,Zl=null,Ku(e,s,c,l)}}Vu(),o=nu;break}catch(t){Fu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ji=qi=null,Kl=r,P.H=i,P.A=a,Jl===null&&(ql=null,Yl=0,ti()),o}function Vu(){for(;Jl!==null;)Wu(Jl)}function Hu(e,t){var n=Kl;Kl|=2;var r=Lu(),i=Ru();ql!==e||Yl!==t?(mu=null,pu=Oe()+500,Pu(e,t)):$l=Je(e,t);a:do try{if(Xl!==0&&Jl!==null){t=Jl;var o=Zl;b:switch(Xl){case 1:Xl=0,Zl=null,Ku(e,t,o,1);break;case 2:case 9:if(Da(o)){Xl=0,Zl=null,Gu(t);break}t=function(){Xl!==2&&Xl!==9||ql!==e||(Xl=7),gd(e)},o.then(t,t);break a;case 3:Xl=7;break a;case 4:Xl=5;break a;case 7:Da(o)?(Xl=0,Zl=null,Gu(t)):(Xl=0,Zl=null,Ku(e,t,o,7));break;case 5:var s=null;switch(Jl.tag){case 26:s=Jl.memoizedState;case 5:case 27:var c=Jl;if(s?ip(s):c.stateNode.complete){Xl=0,Zl=null;var l=c.sibling;if(l!==null)Jl=l;else{var u=c.return;u===null?Jl=null:(Jl=u,qu(u))}break b}}Xl=0,Zl=null,Ku(e,t,o,5);break;case 6:Xl=0,Zl=null,Ku(e,t,o,6);break;case 8:Nu(),nu=6;break a;default:throw Error(a(462))}}Uu();break}catch(t){Fu(e,t)}while(1);return Ji=qi=null,P.H=r,P.A=i,Kl=n,Jl===null?(ql=null,Yl=0,ti(),nu):0}function Uu(){for(;Jl!==null&&!Ee();)Wu(Jl)}function Wu(e){var t=Lc(e.alternate,e,tu);e.memoizedProps=e.pendingProps,t===null?qu(e):Jl=t}function Gu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=xc(n,t,t.pendingProps,t.type,void 0,Yl);break;case 11:t=xc(n,t,t.pendingProps,t.type.render,t.ref,Yl);break;case 5:No(t);default:Kc(n,t),t=Jl=di(t,tu),t=Lc(n,t,tu)}e.memoizedProps=e.pendingProps,t===null?qu(e):Jl=t}function Ku(e,t,n,r){Ji=qi=null,No(t),Na=null,Pa=0;var i=t.return;try{if(oc(e,i,t,n,Yl)){nu=1,tc(e,vi(n,e.current)),Jl=null;return}}catch(t){if(i!==null)throw Jl=i,t;nu=1,tc(e,vi(n,e.current)),Jl=null;return}t.flags&32768?(Fi||r===1?e=!0:$l||Yl&536870912?e=!1:(Ql=e=!0,(r===2||r===9||r===3||r===6)&&(r=io.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ju(t,e)):qu(t)}function qu(e){var t=e;do{if(t.flags&32768){Ju(t,Ql);return}e=t.return;var n=Wc(t.alternate,t,tu);if(n!==null){Jl=n;return}if(t=t.sibling,t!==null){Jl=t;return}Jl=t=e}while(t!==null);nu===0&&(nu=5)}function Ju(e,t){do{var n=Gc(e.alternate,e);if(n!==null){n.flags&=32767,Jl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Jl=e;return}Jl=e=n}while(e!==null);nu=6,Jl=null}function Yu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do ed();while(gu!==0);if(Kl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=ei,$e(e,n,o,s,c,l),e===ql&&(Jl=ql=null,Yl=0),vu=t,_u=e,yu=n,bu=o,xu=i,Su=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ld(Me,function(){return td(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=ne.p,ne.p=2,s=Kl,Kl|=4;try{dl(e,t,n)}finally{Kl=s,ne.p=i,P.T=r}}gu=1,Xu(),Zu(),Qu()}}function Xu(){if(gu===1){gu=0;var e=_u,t=vu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=ne.p;ne.p=2;var i=Kl;Kl|=4;try{wl(t,e);var a=$d,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(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 _=Dr(s,h),v=Dr(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}}xp=!!Qd,$d=Qd=null}finally{Kl=i,ne.p=r,P.T=n}}e.current=t,gu=2}}function Zu(){if(gu===2){gu=0;var e=_u,t=vu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=ne.p;ne.p=2;var i=Kl;Kl|=4;try{fl(e,t.alternate,t)}finally{Kl=i,ne.p=r,P.T=n}}gu=3}}function Qu(){if(gu===4||gu===3){gu=0,De();var e=_u,t=vu,n=yu,r=Su;t.subtreeFlags&10256||t.flags&10256?gu=5:(gu=0,vu=_u=null,$u(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(hu=null),it(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=ne.p,ne.p=2,P.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{P.T=t,ne.p=i}}yu&3&&ed(),gd(e),i=e.pendingLanes,n&261930&&i&42?e===wu?Cu++:(Cu=0,wu=e):Cu=0,_d(0,!1)}}function $u(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function ed(){return Xu(),Zu(),Qu(),td()}function td(){if(gu!==5)return!1;var e=_u,t=bu;bu=0;var n=it(yu),r=P.T,i=ne.p;try{ne.p=32>n?32:n,P.T=null,n=xu,xu=null;var o=_u,s=yu;if(gu=0,vu=_u=null,yu=0,Kl&6)throw Error(a(331));var c=Kl;if(Kl|=4,Vl(o.current),Nl(o,o.current,s,n),Kl=c,_d(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{ne.p=i,P.T=r,$u(e,t)}}function nd(e,t,n){t=vi(n,t),t=rc(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Qe(e,2),gd(e))}function rd(e,t,n){if(e.tag===3)nd(e,e,n);else for(;t!==null;){if(t.tag===3){nd(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hu===null||!hu.has(r))){e=vi(n,e),n=ic(2),r=Ga(t,n,2),r!==null&&(ac(n,r,t,e),Qe(r,2),gd(r));break}}t=t.return}}function id(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gl;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)||(eu=!0,i.add(n),e=ad.bind(null,e,t,n),t.then(e,e))}function ad(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ql===e&&(Yl&n)===n&&(nu===4||nu===3&&(Yl&62914560)===Yl&&300>Oe()-du?!(Kl&2)&&Pu(e,0):au|=n,su===Yl&&(su=0)),gd(e)}function od(e,t){t===0&&(t=Xe()),e=ii(e,t),e!==null&&(Qe(e,t),gd(e))}function sd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),od(e,n)}function cd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),od(e,n)}function ld(e,t){return we(e,t)}var ud=null,dd=null,fd=!1,pd=!1,md=!1,hd=0;function gd(e){e!==dd&&e.next===null&&(dd===null?ud=dd=e:dd=dd.next=e),pd=!0,fd||(fd=!0,eee())}function _d(e,t){if(!md&&pd){md=!0;do for(var n=!1,r=ud;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-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Sd(r,a))}else a=Yl,a=qe(r,r===ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,Sd(r,a))}r=r.next}while(n);md=!1}}function vd(){yd()}function yd(){pd=fd=!1;var e=0;hd!==0&&of()&&(e=hd);for(var t=Oe(),n=null,r=ud;r!==null;){var i=r.next,a=bd(r,t);a===0?(r.next=null,n===null?ud=i:n.next=i,i===null&&(dd=n)):(n=r,(e!==0||a&3)&&(pd=!0)),r=i}gu!==0&&gu!==5||_d(e,!1),hd!==0&&(hd=0)}function bd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ql,n=Yl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Xl===2||Xl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),it(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=xd.bind(null,e),n=we(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function xd(e,t){if(gu!==0&&gu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ed()&&e.callbackNode!==n)return null;var r=Yl;return r=qe(e,e===ql?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ou(e,r,t),bd(e,Oe()),e.callbackNode!=null&&e.callbackNode===n?xd.bind(null,e):null)}function Sd(e,t){if(ed())return null;Ou(e,t,!0)}function eee(){uf(function(){Kl&6?we(Ae,vd):yd()})}function Cd(){if(hd===0){var e=pa;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),hd=e}return hd}function wd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function Td(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 Ed(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=wd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?wd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(hd!==0){var e=o?Td(i,o):new FormData(i);ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Td(i,o):new FormData(i),ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Dd=0;Dd<Xr.length;Dd++){var Od=Xr[Dd];L(Od.toLowerCase(),`on`+(Od[0].toUpperCase()+Od.slice(1)))}L(Hr,`onAnimationEnd`),L(Ur,`onAnimationIteration`),L(Wr,`onAnimationStart`),L(`dblclick`,`onDoubleClick`),L(`focusin`,`onFocus`),L(`focusout`,`onBlur`),L(Gr,`onTransitionRun`),L(Kr,`onTransitionStart`),L(qr,`onTransitionCancel`),L(Jr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var kd=`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(` `),Ad=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(kd));function jd(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){Zr(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){Zr(e)}i.currentTarget=null,a=c}}}}function Md(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Id(t,e,2,!1),n.add(r))}function Nd(e,t,n){var r=0;t&&(r|=4),Id(n,e,r,t)}var Pd=`_reactListening`+Math.random().toString(36).slice(2);function Fd(e){if(!e[Pd]){e[Pd]=!0,St.forEach(function(t){t!==`selectionchange`&&(Ad.has(t)||Nd(t,!1,e),Nd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pd]||(t[Pd]=!0,Nd(`selectionchange`,!1,t))}}function Id(e,t,n,r){switch(Op(t)){case 2:var i=Sp;break;case 8:i=Cp;break;default:i=wp}n=i.bind(null,t,n,e),i=void 0,!fn||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 Ld(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=_t(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),o=[];a:{var s=Yr.get(e);if(s!==void 0){var c=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:c=Vn;break;case`focusin`:u=`focus`,c=Mn;break;case`focusout`:u=`blur`,c=Mn;break;case`beforeblur`:case`afterblur`:c=Mn;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`:c=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Un;break;case Hr:case Ur:case Wr:c=Nn;break;case Jr:c=Wn;break;case`scroll`:case`scrollend`:c=Tn;break;case`wheel`:c=Gn;break;case`copy`:case`cut`:case`paste`:c=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Hn;break;case`toggle`:case`beforetoggle`:c=Kn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;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=un(m,p),g!=null&&d.push(Rd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,u=u?_t(u):null,u!==null&&(f=l(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(c=null,u=r),c!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?s:yt(c),h=u==null?s:yt(u),s=new d(g,m+`leave`,c,n,i),s.target=f,s.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,c&&u)b:{for(d=Bd,p=c,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;c!==null&&Vd(o,s,c,d,!1),u!==null&&f!==null&&Vd(o,f,u,d,!0)}}a:{if(s=r?yt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var v=fr;else if(or(s)){if(pr)v=Sr;else{v=br;var y=yr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Zt(r.elementType)&&(v=fr):v=xr;if(v&&=v(e,r)){sr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Ut(s,`number`,s.value)}switch(y=r?yt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(Mr=y,Nr=r,Pr=null);break;case`focusout`:Pr=Nr=Mr=null;break;case`mousedown`:Fr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Fr=!1,Ir(o,n,i);break;case`selectionchange`:if(jr)break;case`keydown`:case`keyup`:Ir(o,n,i)}var b;if(Jn)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 nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,nr=!0)),y=zd(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=zd(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Ed(o,e,r,n,i)}jd(o,t)})}function Rd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zd(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=un(e,n),i!=null&&r.unshift(Rd(e,i,a)),i=un(e,t),i!=null&&r.push(Rd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Bd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vd(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=un(n,a),l!=null&&o.unshift(Rd(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Rd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Hd=/\r\n?/g,Ud=/\u0000|\uFFFD/g;function Wd(e){return(typeof e==`string`?e:``+e).replace(Hd,`
|
|
10
|
-
`).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(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=en(``+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`&&Kd(e,t,`name`,i.name,i,null),Kd(e,t,`formEncType`,i.formEncType,i,null),Kd(e,t,`formMethod`,i.formMethod,i,null),Kd(e,t,`formTarget`,i.formTarget,i,null)):(Kd(e,t,`encType`,i.encType,i,null),Kd(e,t,`method`,i.method,i,null),Kd(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(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=en(``+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`:Md(`beforetoggle`,e),Md(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(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=Qt.get(n)||n,At(e,n,r))}}function qd(e,t,n,r,i,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`load`,e);var r=!1,i=!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`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,o,s,n,null)}}i&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:Md(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=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(a(137,t));break;default:Kd(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Md(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Kd(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in Md(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Kd(e,t,s,c,n,null)}Kt(e,r,i,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:Kd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`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(a(137,t));default:Kd(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(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 i=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)||Kd(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`:i=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(a(137,t));break;default:m!==f&&Kd(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,i);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)||Kd(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Kd(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Kd(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Kd(e,t,s,i,r,o)}Gt(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:Kd(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:Kd(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)&&Kd(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(a(137,t));break;default:Kd(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(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||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(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||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){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&&Xd(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&&Xd(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 Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(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 nf(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 rf(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 af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e!==af&&(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function ff(e){return e===`head`}function pf(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),qp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Df(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Df(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Df(e.ownerDocument.body)}n=i}while(n);qp(t)}function mf(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 hf(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`:hf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function gf(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[ht])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=Sf(e.nextSibling),e===null)break}return null}function _f(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Sf(e.nextSibling),e===null))return null;return e}function vf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Sf(e.nextSibling),e===null))return null;return e}function yf(e){return e.data===`$?`||e.data===`$~`}function bf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function xf(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 Sf(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 Cf=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Tf(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 Ef(e,t,n){switch(t=ef(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Df(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var Of=new Map,kf=new Set;function Af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jf=ne.d;ne.d={f:Mf,r:Nf,D:If,C:Lf,L:Rf,m:zf,X:Vf,S:Bf,M:Hf};function Mf(){var e=jf.f(),t=Mu();return e||t}function Nf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?js(t):jf.r(e)}var Pf=typeof document>`u`?null:document;function Ff(e,t,n){var r=Pf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),kf.has(i)||(kf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function If(e){jf.D(e),Ff(`dns-prefetch`,e,null)}function Lf(e,t){jf.C(e,t),Ff(`preconnect`,e,t)}function Rf(e,t,n){jf.L(e,t,n);var r=Pf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Wf(e);break;case`script`:a=Jf(e)}Of.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Of.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gf(a))||t===`script`&&r.querySelector(Yf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function zf(e,t){jf.m(e,t);var n=Pf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jf(e)}if(!Of.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Of.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Yf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Bf(e,t,n){jf.S(e,t,n);var r=Pf;if(r&&e){var i=bt(r).hoistableStyles,a=Wf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Of.get(a))&&Qf(e,n);var c=o=r.createElement(`link`);xt(c),Jd(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,Zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vf(e,t){jf.X(e,t);var n=Pf;if(n&&e){var r=bt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),xt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t){jf.M(e,t);var n=Pf;if(n&&e){var r=bt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),xt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t,n,r){var i=(i=de.current)?Af(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Wf(n.href),n=bt(i).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=Wf(n.href);var o=bt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Gf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Of.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},Of.set(e,n),o||qf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Jf(n),n=bt(i).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(a(444,e))}}function Wf(e){return`href="`+Bt(e)+`"`}function Gf(e){return`link[rel="stylesheet"][`+e+`]`}function Kf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function qf(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}),Jd(t,`link`,n),xt(t),e.head.appendChild(t))}function Jf(e){return`[src="`+Bt(e)+`"]`}function Yf(e){return`script[async]`+e}function Xf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Jd(r,`style`,i),Zf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Wf(n.href);var o=e.querySelector(Gf(i));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Kf(n),(i=Of.get(i))&&Qf(r,i),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Zf(o,n.precedence,e),t.instance=o;case`script`:return o=Jf(n.src),(i=e.querySelector(Yf(o)))?(t.instance=i,xt(i),i):(r=n,(i=Of.get(o))&&(r=h({},n),$f(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),xt(i),Jd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zf(r,n.precedence,e));return t.instance}function Zf(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 Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $f(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ep=null;function tp(e,t,n){if(ep===null){var r=new Map,i=ep=new Map;i.set(n,r)}else i=ep,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[ht]||a[ct]||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 np(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rp(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 ip(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ap(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=Wf(r.href),a=t.querySelector(Gf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=cp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Kf(r),(i=Of.get(i))&&Qf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(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=cp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var op=0;function sp(e,t){return e.stylesheets&&e.count===0&&up(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&up(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&op===0&&(op=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&up(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>op?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lp=null;function up(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lp=new Map,t.forEach(dp,e),lp=null,cp.call(e))}function dp(e,t){if(!(t.state.loading&4)){var n=lp.get(e);if(n)var r=n.get(null);else{n=new Map,lp.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=cp.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 fp={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function pp(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(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 mp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new pp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function hp(e){return e?(e=oi,e):oi}function gp(e,t,n,r,i,a){i=hp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(Du(n,e,t),Ka(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vp(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function yp(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&Du(t,e,67108864),vp(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=Tu();t=rt(t);var n=ii(e,t);n!==null&&Du(n,e,t),vp(e,t)}}var xp=!0;function Sp(e,t,n,r){var i=P.T;P.T=null;var a=ne.p;try{ne.p=2,wp(e,t,n,r)}finally{ne.p=a,P.T=i}}function Cp(e,t,n,r){var i=P.T;P.T=null;var a=ne.p;try{ne.p=8,wp(e,t,n,r)}finally{ne.p=a,P.T=i}}function wp(e,t,n,r){if(xp){var i=Tp(r);if(i===null)Ld(e,t,r,Ep,n),Lp(e,r);else if(zp(i,e,t,n,r))r.stopPropagation();else if(Lp(e,r),t&4&&-1<Ip.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}gd(a),!(Kl&6)&&(pu=Oe()+500,_d(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&Du(s,a,2),Mu(),vp(a,2)}if(a=Tp(r),a===null&&Ld(e,t,r,Ep,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Tp(e){return e=rn(e),Dp(e)}var Ep=null;function Dp(e){if(Ep=null,e=_t(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(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 Ep=e,null}function Op(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(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var kp=!1,Ap=null,jp=null,Mp=null,Np=new Map,Pp=new Map,Fp=[],Ip=`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 Lp(e,t){switch(e){case`focusin`:case`focusout`:Ap=null;break;case`dragenter`:case`dragleave`:jp=null;break;case`mouseover`:case`mouseout`:Mp=null;break;case`pointerover`:case`pointerout`:Np.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Pp.delete(t.pointerId)}}function Rp(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=vt(t),t!==null&&yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zp(e,t,n,r,i){switch(t){case`focusin`:return Ap=Rp(Ap,e,t,n,r,i),!0;case`dragenter`:return jp=Rp(jp,e,t,n,r,i),!0;case`mouseover`:return Mp=Rp(Mp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Np.set(a,Rp(Np.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Pp.set(a,Rp(Pp.get(a)||null,e,t,n,r,i)),!0}return!1}function Bp(e){var t=_t(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,ot(e.priority,function(){bp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,ot(e.priority,function(){bp(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 Vp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&yp(t),e.blockedOn=n,!1;t.shift()}return!0}function Hp(e,t,n){Vp(e)&&n.delete(t)}function Up(){kp=!1,Ap!==null&&Vp(Ap)&&(Ap=null),jp!==null&&Vp(jp)&&(jp=null),Mp!==null&&Vp(Mp)&&(Mp=null),Np.forEach(Hp),Pp.forEach(Hp)}function Wp(e,n){e.blockedOn===n&&(e.blockedOn=null,kp||(kp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Up)))}var Gp=null;function Kp(e){Gp!==e&&(Gp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gp===e&&(Gp=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(Dp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qp(e){function t(t){return Wp(t,e)}Ap!==null&&Wp(Ap,e),jp!==null&&Wp(jp,e),Mp!==null&&Wp(Mp,e),Np.forEach(t),Pp.forEach(t);for(var n=0;n<Fp.length;n++){var r=Fp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fp.length&&(n=Fp[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Fp.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[lt]||null;if(typeof a==`function`)o||Kp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(Dp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kp(n)}}}function Jp(){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 Yp(e){this._internalRoot=e}Xp.prototype.render=Yp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;gp(n,Tu(),e,t,null,null)},Xp.prototype.unmount=Yp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gp(e.current,2,null,e,null,null),Mu(),t[ut]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fp.length&&t!==0&&t<Fp[n].priority;n++);Fp.splice(n,0,e),n===0&&Bp(e)}};var Zp=n.version;if(Zp!==`19.2.8`)throw Error(a(527,Zp,`19.2.8`));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$p.isDisabled&&$p.supportsFiber)try{Le=$p.inject(Qp),Re=$p}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Qs,o=$s,c=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mp(e,1,!1,null,null,n,r,null,i,o,c,Jp),e[ut]=t.current,Fd(e),new Yp(t)}})),u=n(((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=l()})),d=t(i(),1),f=u(),p=/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1B\\))/g,m=/^\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1B\\))/,h=/\x1B\[([0-9;]*)m/g,g=/\x1B_pi:c\x07/g,_=[`#1f2937`,`#dc2626`,`#16a34a`,`#d97706`,`#2563eb`,`#9333ea`,`#0891b2`,`#6b7280`],v=[`#9ca3af`,`#ef4444`,`#22c55e`,`#f59e0b`,`#3b82f6`,`#a855f7`,`#06b6d4`,`#e5e7eb`];function y(e){return e.replace(g,``).replace(p,``)}function b(e){let t=[],n=0;for(;n<e.length;){if(e.charCodeAt(n)===27){let t=e.slice(n).match(m);if(t){n+=t[0].length;continue}}let r=e.codePointAt(n);if(r===void 0)break;let i=String.fromCodePoint(r);t.push({start:n,end:n+i.length,char:i}),n+=i.length}return t}function x(e,t){let n=b(e)[t];return n?e.slice(0,n.start)+e.slice(n.end):e}function S(e){return b(e)[0]?.char}function C(e){let t=b(e);for(let e=t.length-1;e>=0;e--)if(t[e].char.trim()!==``)return e;return-1}function w(e){let t=e;for(;;){let e=b(t),n=e[e.length-1];if(n?.char.trim()!==``)return t;t=t.slice(0,n.start)+t.slice(n.end)}}function T(e){let t=/^[┌├└╭╰][─┬┴┼]+[┐┤┘╮╯]$/,n=[];for(let r of e){let e=r.replace(g,``),i=y(e).trimEnd();if(t.test(i))continue;let a=e,o=S(a);(o===`│`||o===`┃`)&&(a=x(a,0),S(a)===` `&&(a=x(a,0)));let s=C(a),c=s>=0?b(a)[s]?.char:void 0;(c===`│`||c===`┃`)&&(a=x(a,s)),n.push(w(a))}for(;n.length>0&&y(n[0]).trim()===``;)n.shift();for(;n.length>0&&y(n[n.length-1]).trim()===``;)n.pop();return n.length?n:e}function E(e){if(e>=0&&e<8)return _[e];if(e>=8&&e<16)return v[e-8];if(e>=16&&e<=231){let t=e-16,n=Math.floor(t/36),r=Math.floor(t%36/6),i=t%6,a=e=>e===0?0:55+e*40;return`rgb(${a(n)}, ${a(r)}, ${a(i)})`}if(e>=232&&e<=255){let t=8+(e-232)*10;return`rgb(${t}, ${t}, ${t})`}}var D={0:e=>{for(let t of Object.keys(e))delete e[t]},1:e=>{e.fontWeight=700},2:e=>{e.opacity=.65},3:e=>{e.fontStyle=`italic`},4:e=>{e.textDecoration=`underline`},22:e=>{delete e.fontWeight,delete e.opacity},23:e=>{delete e.fontStyle},24:e=>{delete e.textDecoration},39:e=>{delete e.color},49:e=>{delete e.backgroundColor}},O=[{min:30,max:37,target:`color`,palette:_},{min:90,max:97,target:`color`,palette:v},{min:40,max:47,target:`backgroundColor`,palette:_},{min:100,max:107,target:`backgroundColor`,palette:v}];function k(e,t,n,r){if(t!==38&&t!==48)return 0;if(n[r+1]===2){let[i,a,o]=[n[r+2],n[r+3],n[r+4]];if([i,a,o].every(e=>typeof e==`number`&&Number.isFinite(e))){let n=`rgb(${i}, ${a}, ${o})`;t===38?e.color=n:e.backgroundColor=n}return 4}if(n[r+1]===5){let i=E(n[r+2]);return i&&(t===38?e.color=i:e.backgroundColor=i),2}return 0}function A(e,t){let n={...e};for(let e=0;e<t.length;e++){let r=t[e],i=D[r];if(i){i(n);continue}let a=!1;for(let e of O)if(r>=e.min&&r<=e.max){n[e.target]=e.palette[r-e.min],a=!0;break}a||(e+=k(n,r,t,e))}return n}function j(e){let t=[],n={},r=0,i;for(h.lastIndex=0;(i=h.exec(e))!==null;){i.index>r&&t.push({text:e.slice(r,i.index),style:n});let a=i[1]?i[1].split(`;`).map(e=>Number(e||`0`)):[0];n=A(n,a),r=i.index+i[0].length}return r<e.length&&t.push({text:e.slice(r),style:n}),t}var M=new Map,N=new Map,ee=3e4,te=75e3,P=1e3,ne=15e3,re=1,ie=3,ae=null,oe=0,se=0,ce=P;function le(e){return e.ch===`agent`?`agent:${e.sessionId??``}`:e.ch===`watch`?`watch:${e.filePath??``}`:e.ch}function ue(){return`${location.protocol===`https:`?`wss://`:`ws://`}${location.host}/api/ws`}function de(e,t){e.send(JSON.stringify({type:`sub`,...t}))}function fe(){ae&&ae.close();let e=++se,t;try{t=new WebSocket(ue())}catch{pe(e);return}ae=t,t.onopen=()=>{ce=P,oe=Date.now();for(let e of N.values())try{de(t,e)}catch{break}},t.onmessage=n=>{if(e!==se||ae!==t||(oe=Date.now(),typeof n.data!=`string`))return;let r;try{r=JSON.parse(n.data)}catch{return}if(r.ch)for(let e of M.get(r.ch)??[])e(r.data)},t.onclose=()=>{e===se&&ae===t&&(ae=null,pe(e))},t.onerror=()=>{}}function pe(e){setTimeout(()=>{e!==se||ae||fe()},ce),ce=Math.min(ce*2,ne)}function me(){if(!ae||ae.readyState!==re||Date.now()-oe<=te)return;se+=1;let e=ae;ae=null;try{e.close()}catch{}fe()}typeof window<`u`&&(setInterval(me,ee),window.addEventListener(`online`,()=>{!ae||ae.readyState===ie?fe():me()}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&(!ae||ae.readyState===ie?fe():me())}));function he(e){if(e&&ae?.readyState===re)try{ae.send(JSON.stringify({type:`unseen`,sessionId:e}))}catch{}}function ge(e,t){let n=le(e),r=M.get(n);r||(r=new Set,M.set(n,r)),r.add(t);let i=!N.has(n);if(N.set(n,e),ae?.readyState===re&&i)try{de(ae,e)}catch{}else ae||fe();return()=>{let e=M.get(n);if(e?.delete(t),e&&e.size===0&&(M.delete(n),N.delete(n),ae?.readyState===re))try{ae.send(JSON.stringify({type:`unsub`,ch:n}))}catch{}}}var _e=n((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})),ve=n(((e,t)=>{t.exports=_e()})),F=ve(),ye=`pi.notification-log.v1`;function be(){try{let e=window.sessionStorage.getItem(ye);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&typeof e.message==`string`&&(e.notifyType===`warning`||e.notifyType===`error`)&&typeof e.createdAt==`number`):[]}catch{return[]}}function xe(e){try{window.sessionStorage.setItem(ye,JSON.stringify(e))}catch{}}var Se=(0,d.createContext)(null);function Ce({children:e}){let[t,n]=(0,d.useState)(be);(0,d.useEffect)(()=>{xe(t)},[t]),(0,d.useEffect)(()=>ge({ch:`global`},e=>{let t=e;if(t?.type!==`extension_ui_request`||t.method!==`notify`||t.notifyType!==`warning`&&t.notifyType!==`error`)return;let r=typeof t.message==`string`?y(t.message):``;if(!r)return;let i={id:typeof t.id==`string`&&t.id?t.id:typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,message:r,notifyType:t.notifyType,sessionId:typeof t.sessionId==`string`&&t.sessionId?t.sessionId:null,createdAt:Date.now()};n(e=>[i,...e].slice(0,30))}),[]);let r=(0,d.useMemo)(()=>({entries:t}),[t]);return(0,F.jsx)(Se.Provider,{value:r,children:e})}function we(){let e=(0,d.useContext)(Se);if(!e)throw Error(`useNotificationLog must be used within NotificationLogProvider`);return e}function Te(e,t={}){return e.replace(/\{([\w.-]+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:String(r)})}function Ee(e,t,n,r={}){let i=n[e]?.[t]??n.en?.[t];return i===void 0?t:Te(i,r)}function De(e,t,n=new Date){let r=(e instanceof Date?e:new Date(e)).getTime()-n.getTime(),i=Math.abs(r),[a,o]=i<6e4?[`second`,1e3]:i<36e5?[`minute`,6e4]:i<864e5?[`hour`,36e5]:[`day`,864e5],s=Math.round(r/o);return new Intl.RelativeTimeFormat(t,{numeric:`always`}).format(s,a)}var Oe={id:`en`,label:`English`,messages:{"common.ok":`OK`,"common.language":`Language`,"common.models":`Models`,"common.skills":`Skills`,"common.plugins":`Plugins`,"sidebar.hide":`Collapse sidebar`,"sidebar.show":`Expand sidebar`,"theme.light":`Switch to light mode`,"preferences.defaultThinkingLevel":`Default thinking level`,"preferences.thinkingLevelHint":"Global default for new sessions (settings.json `defaultThinkingLevel`). Not set = field removed, falls back to pi default.","preferences.thinkingLevelNotSet":`Not set (use model default)`,"preferences.compaction":`Auto compaction`,"preferences.compactionHint":"Automatically compact long sessions (settings.json `compaction`). When not configured the pi defaults are shown; any edit writes the full object.","preferences.compactionEnabled":`Enabled`,"preferences.compactionReserveTokens":`Reserve tokens`,"preferences.compactionReserveTokensHint":`Tokens reserved for model output, keeping reply space after compaction`,"preferences.compactionKeepRecentTokens":`Keep recent tokens`,"preferences.compactionKeepRecentTokensHint":`Tokens kept after compaction, counted backwards from the most recent messages`,"preferences.retry":`API retry`,"preferences.retryHint":"Retry settings for provider API calls (settings.json `retry`). When not configured the pi defaults are shown; any edit writes the full object. Provider sub-fields left empty are not written.","preferences.retryEnabled":`Enabled`,"preferences.retryEnabledHint":`Enable retries for failed API calls`,"preferences.retryMaxRetries":`Max retries`,"preferences.retryBaseDelayMs":`Base delay (ms)`,"preferences.retryBaseDelayMsHint":`Initial delay before the first retry, in milliseconds`,"preferences.retryProviderTimeoutMs":`Provider timeout (ms)`,"preferences.retryProviderMaxRetries":`Provider max retries`,"preferences.retryProviderMaxRetryDelayMs":`Provider max delay (ms)`,"preferences.defaultProjectTrust":`Default project trust`,"preferences.projectTrustHint":"Default trust for new projects (settings.json `defaultProjectTrust`). Not set = field removed (falls back to ask).","preferences.projectTrustNotSet":`Not set (ask)`,"preferences.projectTrustAsk":`Ask`,"preferences.projectTrustAlways":`Always trust`,"preferences.projectTrustNever":`Never trust`,"preferences.notifyEvents":`Notifications`,"preferences.notifyEventsHint":`Browser notifications when the tab is not active. Permission is requested on first interaction.`,"notify.permission.request":`Enable notifications`,"notify.permission.requestHint":`Click to enable browser notifications — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.granted":`Notifications on`,"notify.permission.grantedHint":`Browser notifications are enabled — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.bannerHintBefore":`Click the`,"notify.permission.bannerHintAfter":`button in the top-left toolbar to enable notifications — you'll be alerted when a task completes, errors, or asks a question. Fine-tune in Config Center → Session → Notifications`,"notify.permission.denied":`Notifications blocked`,"notify.permission.deniedHint":`Notifications are blocked by the browser. Click the icon next to the address bar → Site settings, switch notifications to Allow, then try again`,"preferences.notifyWhileActive":`Notify while page active`,"preferences.notifyTaskComplete":`Task complete`,"preferences.notifyErrors":`Errors`,"preferences.notifyQuestions":`Questions`,"preferences.subagentsDefaultModel":`Subagent default model`,"preferences.subagentsDefaultThinking":`Subagent default thinking level`,"preferences.subagentsHint":"Defaults for subagents (settings.json `subagents`). defaultThinking not set = sub-field removed (falls back to pi default).","preferences.subagentsModelPlaceholder":`provider/model-id`,"theme.dark":`Switch to dark mode`,"theme.toggleTheme":`Switch theme`,"theme.darkMode":`Dark`,"theme.lightMode":`Light`,"theme.fontSize":`Font size`,"theme.scrollStep":`Hover scroll step`,"scrollStep.hint":`Pixels scrolled per hover tick on the edge scroll arrows (shared by the panel scroll arrows and the minimap).`,"scrollStep.range":`per hover tick (1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`Auto-reload chat messages interval`,"autoReload.off":`Off (0) — do not auto-reload`,"autoReload.range":`seconds (0 — 3600)`,"autoReload.unit":`s`,"autoReload.hint":`Interval in seconds for re-reading the session file; 0 = off. Keep 0 for single-client use (messages arrive via SSE in real time); set it above 0 for multi-client collaboration (several browsers on the same session) so each client refreshes periodically and picks up chat messages generated by the others.`,"recentBlocks.hint":`Streaming blocks and the just-completed block are not counted (the newest completed block always stays expanded). This is how many additional recent completed blocks stay expanded.`,"autoReload.reset":`Reset to default ({n} s)`,"chat.reloadFromDisk":`Reload session from disk`,"chat.reloadFromDiskHint":`Use when multiple clients read/write the same session jsonl at the same time. You can set automatic timed reloading under Config Center → Session.`,"scrollStep.reset":`Reset to default ({n} px)`,"theme.recentBlocksExpanded":`Recent completed blocks kept expanded`,"layout.sidebarWidth":`Left panel width`,"layout.widgetPanelWidth":`Right panel width`,"layout.widthRange":`px ({min}–{max})`,"layout.widthReset":`Reset to default ({value} px)`,"longBlock.blocks":`blocks`,"recentBlocks.reset":`Reset to default ({n})`,"recentBlocks.range":`0-20, excludes the newest completed block`,"history.full":`Full history`,"history.unsaved":`Full history is available after the session is saved`,"title.generating":`Generating...`,"title.updated":`Title updated`,"title.failed":`Generation failed`,"title.generate":`Generate title`,"title.unsaved":`Title generation is available after the session is saved`,"title.noMessages":`Send a message before naming this session`,"title.generateSession":`Generate a session title`,"system.prompt":`System prompt`,"system.empty":`System prompt is empty (tools are disabled)`,"system.load":`Send a message to load the system prompt`,"notices.title":`Notifications`,"notices.empty":`No warnings or errors yet`,"notices.fromSession":`From session`,"session.info":`Session info`,"session.reload":`Reload session (re-read config and resources)`,"session.name":`Name`,"session.file":`File`,"session.inMemory":`In-memory`,"session.id":`ID`,"session.user":`User`,"session.assistant":`Assistant`,"session.toolCalls":`Tool Calls`,"session.toolResults":`Tool Results`,"session.total":`Total`,"session.input":`Input`,"session.output":`Output`,"session.cacheRead":`Cache Read`,"session.cacheWrite":`Cache Write`,"session.inputHint":`Prompt tokens NOT served from cache: system prompt, history and tool definitions sent to the model, minus the cached portion`,"session.outputHint":`Tokens generated by the model (answers and thinking)`,"session.cacheReadHint":`Tokens served from prompt cache: unchanged context re-read from the previous request at a discounted rate`,"session.cacheWriteHint":`Tokens written to cache for the first time (billed on write, Anthropic-style)`,"session.totalHint":`input + output + cacheRead + cacheWrite`,"session.cacheReadRate":`Cache hit rate: cache-read tokens as a share of all input prompt tokens (input + cacheRead + cacheWrite), the official formula cacheRead / (input + cacheRead + cacheWrite)`,"session.cost":`Cost`,"session.context":`Context`,"session.copy":`Copy {value}`,"session.copied":`Copied`,"session.title":`Session info`,"session.load":`Send a message or run /session to load session info`,"session.infoSection":`Session Info`,"session.messages":`Messages`,"session.tokens":`Tokens`,"session.copyFile":`Copy file path`,"session.copyId":`Copy session ID`,"workspace.opening":`Opening workspace...`,"workspace.unable":`Unable to open workspace`,"workspace.selectSession":`Select a session from the sidebar`,"workspace.selectWorkspace":`Please select a workspace`,"workspace.stepProject":`Select a project directory from the sidebar`,"workspace.stepModels":`Add models via the Models button at the bottom`,"tabs.chat":`Chat`,"tabs.widgets":`Widgets`,"config.title":`Settings`,"config.section.session":`Session`,"config.section.appearance":`Appearance`,"config.section.advanced":`Advanced`,"config.section.startScreen":`Start screen`,"config.section.git":`Git`,"config.section.updates":`Updates`,"config.section.modelThinking":`Thinking Levels`,"config.section.requiresCwd":`Select a project directory from the sidebar first to browse plugins / skills`,"updates.check":`Check for updates`,"updates.checking":`Checking…`,"updates.checkedAt":`Last checked`,"updates.upToDate":`Up to date`,"updates.updateAvailable":`Update available`,"updates.unavailable":`Check failed`,"updates.noPluginUpdates":`All plugins are up to date`,"updates.banner":`Update available: {items}`,"updates.view":`View`,"updates.copied":`Copied`,"updates.copyCommand":`Copy command`,"updates.restartNote":`Also upgrades the bundled pi SDK; restart pi-web to load it.`,"updates.enableChecking":`Enable update checks`,"updates.disabled":`Update checks disabled`,"updates.ignoreVersion":`Ignore this version`,"updates.ignored":`Ignored {version}`,"updates.ignoredPlugin":`Ignored`,"updates.unignore":`Unignore`,"preferences.pi.unset":`pi default`,"preferences.pi.enableAnalytics":`Enable analytics`,"preferences.pi.enableAnalyticsHint":"Send anonymous usage analytics (settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`Enable install telemetry`,"preferences.pi.enableInstallTelemetryHint":"Send anonymous install telemetry (settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP proxy`,"preferences.pi.httpProxyHint":"Proxy URL for HTTP requests (settings.json `httpProxy`). Empty input cannot clear an already-set value.","preferences.pi.trackingId":`Analytics tracking ID`,"preferences.pi.trackingIdHint":"Custom analytics tracking ID (settings.json `trackingId`). Empty input cannot clear an already-set value.","preferences.pi.httpIdleTimeoutMs":`HTTP idle timeout (ms)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP idle timeout in ms (settings.json `httpIdleTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.websocketConnectTimeoutMs":`WebSocket connect timeout (ms)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket connect timeout in ms (settings.json `websocketConnectTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.branchSummary":`Branch summary`,"preferences.pi.branchSummaryHint":"Branch summary auto-compaction (settings.json `branchSummary`)","preferences.pi.reserveTokens":`Reserve tokens`,"preferences.pi.skipPrompt":`Skip prompt`,"preferences.pi.images":`Image handling`,"preferences.pi.imagesHint":"How the pi engine handles images (settings.json `images`)","preferences.pi.autoResize":`Auto-resize`,"preferences.pi.autoResizeHint":"Downscale images returned by tools such as `read` to save tokens.","preferences.pi.blockImages":`Block images`,"preferences.pi.blockImagesHint":`Strip all image content from messages before they reach the model.`,"config.files.hint":`Edit pi's config files (JSON) directly. Validated before save; backed up automatically (last 10 kept).`,"config.widgets.empty":`No widget configurations yet. Widgets appear here automatically when an extension pops one up.`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`w`,"config.widgets.height":`h`,"config.widgets.bind":`Bind message`,"config.widgets.bindTitle":`Bind custom message`,"config.widgets.bindHint":`Bind a quick message to widget "{key}"`,"config.widgets.editTitle":`Edit quick message`,"config.widgets.editHint":`Edit the label, content, and send mode.`,"config.widgets.label":`Label`,"config.widgets.labelPlaceholder":`Button text (e.g. Reload)`,"config.widgets.message":`Message`,"config.widgets.messagePlaceholder":`A slash command or any text (e.g. /reload)`,"config.widgets.messageTooltip":`Type / to see built-in, global plugin and Skill commands. Project-level plugin commands won't appear in suggestions but can still be entered and saved manually.`,"config.widgets.sendImmediately":`Send immediately`,"config.widgets.sendMode":`Send mode`,"config.widgets.fillToChatInput":`Fill into chat input`,"config.widgets.sendImmediatelyTooltip":`Send immediately: `,"config.widgets.fillToChatInputTooltip":`Fill into chat input: `,"config.widgets.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.hint":`Quick actions shown on the new-session start screen (below the Pi logo); clicking sends the message immediately or fills it into the chat input, depending on each entry's send mode.`,"config.startScreen.bind":`Bind message`,"config.startScreen.bindTitle":`Bind quick message`,"config.startScreen.bindHint":`Bind a quick message to the start screen.`,"config.startScreen.empty":`No quick messages yet; the start screen will show no quick actions.`,"config.startScreen.unbindTitle":`Unbind message`,"config.startScreen.unbindConfirm":`Unbind "{label}"?`,"config.startScreen.unbind":`Unbind`,"config.widgets.confirm":`Confirm`,"config.widgets.unbindTitle":`Unbind message`,"config.widgets.unbindConfirm":`Unbind "{label}"?`,"config.widgets.unbind":`Unbind`,"config.startScreen.editTitle":`Edit quick message`,"config.startScreen.editHint":`Edit the label, content, and send mode.`,"config.startScreen.reset":`Reset`,"config.startScreen.resetHint":`Restore the built-in default quick messages; keep your own bound messages (ones with the same label as a default are replaced by the default).`,"config.files.save":`Save`,"config.files.saving":`Saving...`,"config.files.saved":`Saved`,"config.files.missing":`Not created yet`,"config.files.placeholder":`Select a config file from the list on the left`,"layout.resizeSidebar":`Resize sidebar`,"layout.resizeWidgetPanel":`Resize widgets panel`,"layout.resizeHint":`Drag to resize. Double-click or press Enter to reset.`,"sidebar.newWorkspace":`New workspace`,"sidebar.searchSessions":`Search sessions`,"sidebar.searchSessionsPlaceholder":`Search sessions…`,"sidebar.justNow":`just now`,"sidebar.minutesAgo":`{count}m ago`,"sidebar.hoursAgo":`{count}h ago`,"sidebar.daysAgo":`{count}d ago`,"sidebar.searchSessionsNoResults":`No matching sessions`,"sidebar.newSessionTitle":`New session in {path}`,"sidebar.refresh":`Refresh`,"directoryPicker.selectDirectory":`Select directory`,"directoryPicker.goToParent":`Go to parent directory`,"directoryPicker.directoryPath":`Directory path`,"directoryPicker.goToDirectory":`Go to directory`,"directoryPicker.go":`Go`,"directoryPicker.loadingDirectories":`Loading directories…`,"directoryPicker.noSubdirectories":`No subdirectories`,"directoryPicker.openBeforeSelecting":`Open this path before selecting it`,"directoryPicker.selectCurrentDirectory":`Select current directory`,"directoryPicker.selectThisFolder":`Select this folder`,"directoryPicker.noDrives":`No drives found`,"directoryPicker.search":`Filter folders`,"directoryPicker.noMatches":`No folders match your filter`,"sidebar.checking":`Checking…`,"sidebar.open":`Open`,"sidebar.cancel":`Cancel`,"sidebar.openRepoRoot":`Worktree switch unavailable`,"sidebar.openRepoRootTitle":`Worktree switching is unavailable here — switch the current working directory to the Git repository root first (from the sidebar).`,"sidebar.gitRepoRootOnly":`Git repo root only`,"sidebar.gitRepoRootOnlyTitle":`Worktrees are available in Git repository roots.`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`Checking worktrees for this directory.`,"sidebar.filterWorktrees":`Filter worktrees…`,"sidebar.noMatchingWorktrees":`No matching worktrees`,"sidebar.switchWorktree":`Switch worktree`,"sidebar.switchWorktreeTitle":`Switch worktree: {path}`,"sidebar.main":`main`,"sidebar.forceRemoveCheckout":`Uncommitted changes. Force remove checkout?`,"sidebar.force":`Force`,"sidebar.createWorktreeTitle":`Create a worktree checkout for a branch`,"sidebar.newWorktree":`New worktree…`,"sidebar.branchName":`branch name`,"sidebar.creating":`Creating…`,"sidebar.create":`Create`,"sidebar.uploadFilesTitle":`Upload files to project root`,"sidebar.uploadFiles":`Upload files`,"sidebar.refreshExplorer":`Refresh explorer`,"sidebar.changedFiles":`{count} changed files`,"sidebar.loading":`Loading...`,"sidebar.sessionDeleted":`Session deleted — pick another session`,"sidebar.noSessions":`No sessions found`,"sidebar.workspace":`Workspace`,"sidebar.newActivity":`New activity`,"sidebar.newSessionActivity":`New session activity`,"sidebar.interactionBadge":`Session waiting for interaction`,"sidebar.deleteSession":`Delete {title}?`,"sidebar.deleteWorkspace":`Delete workspace ({count} sessions)?`,"sidebar.deleteWorkspaceTitle":`Delete this workspace and all its sessions`,"sidebar.copyPath":`Copy full path`,"sidebar.rename":`Rename`,"sidebar.delete":`Delete`,"sidebar.deleteWithShiftClick":`Delete (Shift+click to delete without confirmation)`,"sidebar.expandForks":`Expand forks`,"sidebar.collapseForks":`Collapse forks`,"sidebar.disconnect":`Disconnect`,"sidebar.messagesCount":`{count} msgs`,"sidebar.worktreePath":`Worktree: {path}`,"sidebar.removeWorktreeTitle":`Remove worktree checkout {path}; the branch is kept`,"files.modified":`Modified`,"files.added":`Added`,"files.deleted":`Deleted`,"files.renamed":`Renamed`,"files.untracked":`Untracked`,"files.conflict":`Conflict`,"files.newlyUploaded":`Newly uploaded`,"files.containsChangedFiles":`Contains changed files`,"files.insertPath":`Insert path into chat`,"files.mention":`mention`,"files.download":`Download file`,"files.dismissError":`Dismiss error`,"files.addUploadedFile":`Add uploaded file to chat`,"files.addAllUploadedFiles":`Add all uploaded files to chat`,"files.openInSystemApp":`Open with system app`,"files.chooseOtherApp":`Choose another app…`,"files.openLaunched":`Launched with the system app`,"files.fileTooLargeForPreview":`File too large for preview (>{limit})`,"files.docTooLargeForPreview":`DOCX too large for preview (>{limit})`,"files.dismissUploadResults":`Dismiss upload results`,"files.loading":`Loading files...`,"files.noFiles":`No files found`,"files.find":`Find`,"files.findNext":`Next match (Enter)`,"files.findPrev":`Previous match (Shift+Enter)`,"files.findNoResults":`No results`,"files.findClose":`Close (Esc)`,"loading.inProgress":`Working…`,"loading.more":`{count} more…`,"errors.title":`Error`,"errors.titleCount":`Errors ({count})`,"errors.close":`Close`,"errors.clearAll":`Clear all`,"files.notFound":`Not found`,"files.accessDenied":`Access denied`,"files.empty":`Empty`,"files.uploadFailed":`{count} failed`,"files.explorer":`Explorer`,"files.changedCount":`{count} files`,"files.stagedPrefix":`Staged: `,"files.unstagedPrefix":`Unstaged: `,"files.noStagedChanges":`No staged files`,"files.noUnstagedChanges":`No unstaged changes`,"files.commitMessagePlaceholder":`Commit message`,"files.commit":`Commit`,"files.push":`Push to remote (with tags)`,"files.pushing":`Pushing...`,"files.pushSuccess":`Push succeeded`,"files.pushFailed":`Push failed`,"files.pushUpToDate":`Already up to date — nothing to push`,"files.pull":`Pull from remote`,"files.pulling":`Pulling...`,"files.pullSuccess":`Pull succeeded`,"files.pullFailed":`Pull failed`,"files.pullUpToDate":`Already up to date — nothing to pull`,"files.pullNonFastForward":`Pull rejected — local and remote have diverged. Use git pull --rebase or --merge in terminal.`,"files.committing":`Committing…`,"files.commitMessageRequired":`Enter a commit message first`,"files.commitTitle":`Commit changes`,"files.confirmStageAllCommit":`{count} changed files are not staged. Stage them all and commit?`,"files.stageAllAndCommit":`Stage & commit`,"files.stageFile":`Stage file`,"files.unstageFile":`Unstage file`,"files.changeStats":`{count} changed files, {additions} lines added, {deletions} lines deleted`,"git.autoFetchInterval":`Auto fetch interval (seconds)`,"git.autoFetchIntervalHint":`How often the server fetches remotes for active session workspaces (shared by all clients). 0 disables the timer — one fetch runs when a session connects.`,"git.groupTitle":`Smart Commit Message Generation`,"git.commitModel.followCurrent":`Follow current session model`,"git.commitModel.followCurrentHint":`When on, the commit generation follows the current chat's main model. When off, the fixed model below is used (recommended for a cheap dedicated model).`,"git.commitModel.followCurrentOn":`On: follow current session`,"git.commitModel.followCurrentOff":`Off: use fixed model`,"git.commitModel.fixedModel":`Fixed model`,"git.commitModel.fixedModelHint":`Model used when "follow current session" is off (choose a cheap fixed model; note it may have only ~50k context).`,"git.commitModel.selectPlaceholder":`Select a model`,"git.commitModel.noModels":`No models available`,"git.commitModel.notConfiguredHint":`No fixed model selected. Pick a model before using AI generate.`,"git.ai.generate":`Smart generate`,"git.ai.generating":`Generating…`,"git.ai.notConfiguredTitle":`Model not configured`,"git.ai.notConfiguredDesc":`No model is set for Smart generate. Go to Config Center → Git to set one.`,"git.ai.goToConfig":`Go to settings`,"git.ai.noSession":`Follow-current mode requires an active session`,"git.ai.noSessionModel":`Current session has no model. Select a model in chat first`,"git.commitModel.maxTokens":`Max output tokens`,"git.commitModel.maxTokensHint":`Max output tokens for one generation (64–4096, default 512). Reasoning is minimized: disabled when the model supports it, otherwise reduced to the lowest level.`,"git.commitModel.autoGenerateOnEmpty":`Auto-generate when commit box is empty`,"git.commitModel.autoGenerateOnEmptyHint":`When on, clicking Commit with an empty box auto-generates a message first, then commits. Only when a model is configured; otherwise empty stays disabled. On by default.`,"git.ai.invalidModel":`Configured model is invalid. Reselect it in Config Center.`,"git.ai.autoGenerateOn":`On: auto-generate when empty`,"git.ai.usingCurrentModel":`Using current chat model`,"git.ai.usingModel":`Using {model}`,"git.ai.generateAndCommit":`Smart generate & commit`,"git.ai.autoGenerateOff":`Off`,"git.commitSectionTitle":`Commit`,"git.commitConfirmStageAll":`Confirm “stage all” on commit`,"git.commitConfirmStageAllHint":`When on, committing with only unstaged changes shows a “Stage all & commit” confirmation. When off, it stages all and commits directly. On by default.`,"git.commitConfirmStageAllOn":`On: confirm before staging all`,"git.commitConfirmStageAllOff":`Off: stage all directly`,"modelThinking.desc":`Remember the last thinking level per model or provider. When switching models, the selector restores the remembered level; if the model's available levels don't include it, it falls back to auto (use default). All 7 levels supported: off / minimal / low / medium / high / xhigh / max.`,"modelThinking.byModel":`By model`,"modelThinking.byProvider":`By provider`,"modelThinking.byProviderHint":`Provider fallback: models without a per-model entry use this value.`,"modelThinking.emptyModel":`No per-model memory yet. Selecting a thinking level after switching models will remember it automatically; you can also add one here.`,"modelThinking.emptyProvider":`No per-provider memory yet.`,"modelThinking.selectModelPlaceholder":`Select a model`,"modelThinking.selectProviderPlaceholder":`Select a provider`,"modelThinking.providerInputPlaceholder":`or type a provider name`,"modelThinking.footerHint":`Stored in a standalone file pi-web/model-thinking.json, not the main config. UI-only — pi's set_thinking_level is not intercepted.`,"common.add":`Add`,"common.delete":`Delete`,"files.conflictSummary":`{count} file{countSuffix} already exist: {files}`,"files.cannotReplace":`Cannot replace: {files}`,"files.replace":`Replace`,"files.skipExisting":`Skip existing`,"files.cancel":`Cancel`,"files.checking":`Checking files`,"files.uploading":`Uploading, {progress}%`,"files.search":`Search files`,"files.searchPlaceholder":`Search files...`,"chat.loadingSession":`Loading session...`,"chat.noSessionSelected":`Create or select a session in the left panel`,"chat.loadingWindow":`Loading messages...`,"chat.runningTool":`Running tool...`,"chat.runningNamedTool":`Running {name}...`,"chat.runningTools":`Running {names}...`,"chat.runningToolsMore":`Running {names} (+{count})...`,"chat.waitingModel":`Waiting for model...`,"chat.aiQuestion":`AI question`,"chat.runningCommand":`Running command...`,"chat.totalElapsed":`total {total}`,"chat.thinking":`Thinking...`,"chat.message":`message`,"chat.messages":`messages`,"chat.toolCall":`tool call`,"chat.toolCalls":`tool calls`,"chat.collapseProcess":`Collapse process details`,"chat.expandProcess":`Expand process details`,"chat.loadEarlier":`Scroll up to load earlier messages ({count} hidden)`,"chat.searchMessages":`Search messages`,"chat.clearSearch":`Clear search query`,"chat.scrollToLatest":`Scroll to latest message`,"chat.expandMessage":`Expand full content`,"chat.searchPlaceholder":`Search chat messages…`,"chat.searchNoResults":`No results`,"chat.searchResults":`{count} results`,"chat.extensionRequest":`extension request`,"chat.cancel":`Cancel`,"chat.skipped":`Skipped`,"chat.confirm":`Confirm`,"chat.submit":`Submit`,"chat.extensionInput":`Extension terminal input`,"chat.extensionSelect":`Select an option`,"chat.extensionConfirm":`Confirm`,"chat.extensionEditor":`Edit`,"chat.extensionPanel":`Extension panel`,"chat.close":`Close`,"chat.notifyInfoTitle":`Info`,"chat.notifySuccessTitle":`Success`,"chat.notifyErrorTitle":`Error`,"chat.notifyWarningTitle":`Warning`,"chat.queued":`Queued · {count}`,"chat.recall":`Recall to input`,"chat.recallTitle":`Remove all queued messages and put them back into the input box for editing (also triggered by pressing Enter while the input is empty)`,"chat.retrying":`Retrying ({attempt}/{max})…`,"chat.loadingCommands":`Loading commands...`,"chat.slashCommands":`Slash commands · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`No extension, prompt, or skill commands found`,"chat.match":`1 match`,"chat.matches":`{count} matches`,"chat.command":`1 command`,"chat.commands":`{count} commands`,"chat.loadingFiles":`Loading files...`,"chat.files":`Files · {label}{hint}`,"chat.searching":`Searching…`,"chat.noMatchingFiles":`No matching files`,"chat.searchingAll":` · searching all files…`,"chat.indexTruncated":` · index truncated`,"chat.steerPlaceholder":`Steer now / queue follow-up...`,"chat.recallPlaceholder":`Press Enter to recall queued messages, or type a new message…`,"chat.agentPlaceholder":`Agent is running…`,"chat.messagePlaceholder":`Message… Type / for commands, @ for files, ! for shell`,"chat.questionNotificationTitle":`Pi — Question Asked`,"chat.taskCompleteNotificationTitle":`Pi — Task Complete`,"chat.taskErrorNotificationTitle":`Pi — Error`,"chat.sessionCompletedNotificationBody":`Session {name} completed`,"chat.questionNotificationDenied":`Notifications denied: allow them in the browser's site settings to get question alerts while the tab is hidden.`,"chat.steer":`Steer`,"chat.followUp":`Follow-up`,"chat.queueImageBlocked":`Image attachments cannot be queued while the agent is running`,"chat.steerTooltip":`Send this message immediately after the current call finishes`,"chat.followUpTooltip":`Queue this message after the agent finishes`,"chat.send":`Send`,"chat.attachImage":`Attach image`,"chat.attachmentOnDisk":`Too large to inline; saved to disk and referenced by path (the agent reads it on demand)`,"chat.filterModels":`Filter models…`,"chat.noMatchingModels":`No matching models`,"chat.moreControls":`More controls`,"chat.collapseControls":`Collapse controls`,"chat.shell":`Shell`,"chat.outputLocal":`output stays local`,"chat.outputModel":`output sent to model`,"chat.noTools":`No tools, read-only`,"chat.builtInTools":`{count} built-in tools`,"chat.allBuiltInTools":`All built-in tools`,"chat.changeReasoning":`Change reasoning level: {level}`,"chat.changeReasoningLabel":`Change reasoning level`,"chat.changeToolPreset":`Change tool preset`,"chat.stopCompaction":`Stop compaction`,"chat.compactContext":`Compact context`,"chat.compacting":`Compacting…`,"chat.compactionDisabledByExtension":`Native context compaction is taken over by an extension, so it can't run here.`,"chat.compact":`Compact`,"chat.stopAgent":`Stop agent`,"chat.stop":`Stop`,"chat.disableSound":`Disable completion sound`,"chat.enableSound":`Enable completion sound`,"chat.thinkingUseDefault":`Use pi default`,"chat.thinkingOff":`Reasoning off`,"chat.thinkingMinimal":`Minimal reasoning`,"chat.thinkingLow":`Low reasoning`,"chat.thinkingMedium":`Medium reasoning`,"chat.thinkingHigh":`High reasoning`,"chat.thinkingXhigh":`Extra-high reasoning`,"chat.thinkingMax":`Max reasoning`,"chat.thinkingMapTitle":`Higher thinking levels not configured`,"chat.thinkingMapBody":`pi supports up to high thinking by default. To enable {level} level reasoning, configure the "Thinking Level Map" for this model in Config → Models.`,"chat.thinkingMapGo":`Go to settings`,"chat.builtIn":`Built-in`,"chat.extensions":`Extensions`,"chat.prompts":`Prompts`,"chat.skills":`Skills`,"chat.dormant":`dormant`,"chat.commandCompact":`Compress context, optionally with instructions`,"chat.commandReload":`Reload extensions, skills, prompts, and tools`,"chat.commandName":`Set the session display name`,"chat.commandSession":`Show session message, token, and cost stats`,"chat.commandCopy":`Copy the last assistant message`,"chat.compacted":`Compacted`,"chat.tokensSaved":`{saved} saved`,"i18n.close":`Close`,"i18n.resizeList":`Resize {name} list`,"widgets.title":`Widgets`,"widgets.reopen":`Reopen widget`,"widgets.expandedToChat":`Widget [{key}] expanded to the chat view`,"widgets.collapse":`Collapse`,"widgets.open":`Open widgets`,"i18n.copy":`Copy`,"i18n.copied":`Copied`,"i18n.copyToolInput":`Copy raw JSON`,"i18n.cancel":`Cancel`,"i18n.save":`Save`,"i18n.saving":`Saving…`,"i18n.saved":`Saved`,"i18n.saveChanges":`Save changes`,"i18n.noThinking":`No thinking content`,"i18n.remove":`Remove`,"i18n.removing":`Removing…`,"i18n.delete":`Delete`,"i18n.loading":`Loading...`,"i18n.searchPlaceholder":`Search…`,"i18n.noMatch":`No matches`,"i18n.search":`Search`,"i18n.refresh":`Refresh`,"i18n.update":`Update`,"i18n.updating":`Updating...`,"i18n.check":`Check`,"i18n.checking":`Checking...`,"i18n.install":`Install`,"i18n.installing":`Installing...`,"i18n.noResults":`No results`,"i18n.searchProviders":`Search providers…`,"i18n.noProviders":`No providers match`,"i18n.newModel":`new model`,"i18n.addProvider":`Add provider`,"i18n.selectProviderModel":`Select a provider or model`,"i18n.visibleInPrompt":`Visible in model prompt — click to disable`,"i18n.hiddenFromPrompt":`Hidden from model prompt — click to enable`,"i18n.dormant":`Dormant`,"i18n.hiddenButInvocable":`Hidden from model, still manually invocable`,"i18n.skillSearchPlaceholder":`e.g. react, testing, deploy`,"i18n.searching":`Searching…`,"i18n.noSkills":`No skills found`,"i18n.checkUpdates":`Check updates`,"i18n.updates":`updates`,"i18n.noResolvedResources":`No resolved resources`,"i18n.enablePackage":`Enable package`,"i18n.disablePackage":`Disable package`,"i18n.filtered":`filtered`,"i18n.openSessionToReload":`Open a session to reload`,"i18n.notFound":`Not found`,"i18n.noPlugins":`No plugins configured`,"trust.resourcesNotLoaded":`Restricted mode`,"trust.trustProject":`Trust project`,"trust.trusting":`Trusting...`,"trust.cancel":`Cancel`,"trust.dialogTitle":`Trust this project?`,"trust.dialogBody":`Project resources can run local code. Trust only projects whose contents you know.`,"trust.skillsNotLoaded":`Project skills are not loaded because this project is not trusted.`,"trust.pluginsNotLoaded":`Project plugins are not loaded because this project is not trusted.`,"trust.projectScopeUnavailable":`Project installs are unavailable while project resources are not loaded.`,"i18n.creatingSession":`Creating new session…`,"i18n.creating":`Creating…`,"i18n.subscription":`Subscription`,"i18n.subscriptions":`Subscriptions`,"i18n.customEndpoint":`Custom endpoint format`,"i18n.noChanges":`No changes`,"i18n.branches":`Branches`,"i18n.noActiveSession":`No active session`,"i18n.noActiveSessionToCompact":`No active session to compact`,"i18n.noActiveSessionToReload":`No active session to reload`,"i18n.noActiveSessionToName":`No active session to name`,"i18n.noAssistantMessageToCopy":`No assistant message to copy`,"i18n.commandCompleted":`Command completed`,"i18n.commandFailed":`Command failed`,"i18n.extensionCommandFailed":`Extension command failed`,"i18n.compactedContext":`Compacted context`,"i18n.reloadedSessionResources":`Reloaded session resources`,"i18n.usageName":`Usage: /name <name>`,"i18n.sessionRenamedTo":`Session renamed to {name}`,"i18n.copiedLastAssistantMessage":`Copied last assistant message`,"i18n.failedToRecallQueuedMessages":`Failed to recall queued messages`,"i18n.noBranches":`This session has no branches`,"i18n.source":`Source`,"i18n.preview":`Preview`,"i18n.diff":`Diff`,"i18n.downloadFile":`Download file`,"i18n.liveSync":`Live sync active`,"i18n.notWatching":`Not watching`,"i18n.fileViewMode":`File view mode`,"i18n.editMode":`Edit mode`,"i18n.viewMode":`View mode`,"i18n.compareHead":`Compare working tree with HEAD`,"i18n.mentionSelectedLines":`Mention selected lines`,"i18n.disableWrap":`Disable word wrap`,"i18n.enableWrap":`Enable word wrap`,"i18n.editFile":`Edit file`,"i18n.saveFile":`Save`,"i18n.saveFileShortcut":`Save (Ctrl/Cmd+S)`,"i18n.cancelEdit":`Cancel`,"i18n.saveFailed":`Save failed: {error}`,"i18n.unsavedChanges":`Unsaved changes`,"i18n.htmlPreview":`HTML preview`,"i18n.previewFile":`Preview {file}`,"i18n.invalidMermaid":`Invalid Mermaid diagram`,"i18n.renderingMermaid":`Rendering Mermaid diagram`,"i18n.previewAfterStreaming":`Preview available after streaming`,"i18n.showMermaidSource":`Show Mermaid source`,"i18n.previewMermaid":`Preview Mermaid diagram`,"i18n.openMermaidViewer":`Open diagram viewer`,"i18n.mermaidViewer":`Mermaid diagram viewer`,"i18n.mermaidDiagram":`Mermaid diagram`,"i18n.zoomOut":`Zoom out`,"i18n.zoomIn":`Zoom in`,"i18n.fitToWidth":`Fit to width`,"models.discoveryFetching":`Importing models…`,"models.deleteProviderConfirm":`Delete provider "{name}"? This writes to models.json immediately — all its settings (including the API key) will be removed and cannot be recovered.`,"models.renameProviderDialogTitle":`Rename Provider`,"models.renameProviderHint":`Renaming writes to models.json immediately and migrates this provider's API key and login credential; other unsaved edits are not saved with it.`,"models.renameProviderConflict":`Provider "{name}" already exists — pick another name.`,"models.renameProviderBuiltin":`"{name}" is a built-in provider — it can't be used as a custom provider name.`,"models.renameProviderEmpty":`Name must not be empty.`,"models.removeModelConfirm":`Remove model "{model}"? This writes to models.json immediately and cannot be recovered.`,"models.discoveryTitle":`Import models`,"models.discoveryFetch":`Import models…`,"models.discoveryFilterPlaceholder":`Filter {count} models…`,"models.discoveryFilter":`Filter upstream models`,"models.discoverySelectShown":`Select shown`,"models.discoveryNoMatches":`No matching models.`,"models.discoveryAdded":`added`,"models.discoveryShowing":`Showing first {shown} of {total}`,"models.discoveryFetched":`{count} models fetched`,"models.discoveryAddSelected":`Add selected`,"models.setDefault":`Set as default`,"models.defaultModel":`Default model`,"models.defaultModelUnavailable":`Default model {model} is unavailable (deleted or hidden). Please select a model.`,"models.syncEndpoint":`Sync from endpoint`,"models.lastSyncedAt":`Last synced {time}`,"models.neverSynced":`Never synced`,"models.discoveryFetchTooltip":`Imports from the local cache first: {path}. If absent, syncs from the endpoint once and writes the cache there.`,"models.syncingModels":`Syncing…`,"models.syncedModels":`Synced {count} models`,"models.syncEndpointTooltip":`Fetch the latest model list from {endpoint} and cache it locally; the cached list replaces the built-in one.`,"models.syncEndpointTooltipGeneric":`Fetch the latest model list from this provider's models endpoint and cache it locally; the cached list replaces the built-in one.`,"models.refreshFromCache":`Refresh from synced cache`,"models.refreshing":`Refreshing…`,"models.refreshFromCacheTooltip":`Re-read pi-web/provider/{provider}/models.json and update only the fields that differ from the current effective definition (manual fields like headers are kept).`,"models.refreshNoDiff":`Synced cache matches the effective definition — nothing to update.`,"models.refreshDone":`Override updated from synced cache.`,"models.refreshTimeout":`Refresh timed out — try again later.`,"models.builtinProviders":`Built-in providers`,"models.customProviders":`Custom providers`,"models.syncSaveFailed":`Save draft before sync failed — sync aborted.`,"models.visibleInChat":`Visible in chat`,"models.visibleModels":`Model list`,"models.visibleModelsCount":`{visible} / {total} selected`,"models.visibilityCustomized":` · Customized`,"models.visibilityUncustomized":` · Not customized (all visible by default)`,"models.showAll":`Reset`,"models.showAllHint":`All models visible`,"models.filterLabel":`Filter:`,"models.invertSelection":`Invert checks`,"models.searchModels":`Search models…`,"models.noModels":`No models for this provider.`,"models.noMatchingModels":`No matching models.`,"models.filterAll":`All`,"models.filterVisible":`Visible only`,"models.filterHidden":`Hidden only`,"models.invertDisabledTooltip":`All models are already visible; inverting changes nothing`,"models.openOverride":`Override model params`,"models.overrideHint":`Values shown are the effective definition (built-in merged with saved overrides). Only fields you change are saved as overrides; everything else keeps inheriting the built-in definition.`,"models.overrideOrphanedHint":`This model no longer exists upstream. The local override is still saved — you can remove it here. Saving will also clean up its visibility entry.`,"models.removeOverride":`Remove override`,"models.providerNameCollision":`Provider "{provider}" conflicts with built-in "{builtin}" (case-insensitive); model visibility cannot be applied. Rename or remove the provider.`,"models.providerNameCollisionShort":`Name conflicts with built-in provider`,"models.builtinVisibilityBlocked":`Model visibility is disabled: custom provider "{custom}" conflicts with "{builtin}" (case-insensitive). Rename or remove the custom provider.`,"models.discoveryAddSelectedCount":`Add selected ({count})`,"models.dataSourceLabel":`Data source:`,"models.catalogSourceEndpoint":`Models endpoint`,"models.catalogSourceDev":`models.dev catalog`,"models.catalogSourceEndpointTooltip":`Source: Provider's /models endpoint`,"models.catalogSourceDevTooltip":`Source: models.dev built-in catalog (https://models.dev)`,"models.catalogEndpointNotFound":`Model ID not found in the models endpoint response`,"models.catalogOverwriteTitle":`Overwrite existing fields?`,"models.catalogOverwriteBody":`{{count}} field(s) already have values that overwriting would change: {{fields}}. Cancel to fill empty fields only.`,"models.catalogOverwriteConfirm":`Overwrite & fill`,"models.catalogOverwriteCancel":`Fill empty only`,"models.catalogFilling":`Filling details…`,"models.catalogFill":`Fill model details`,"models.catalogFilled":`{count} fields filled`,"models.catalogNoEmptyFields":`No empty fields to fill`,"models.catalogNoExactMatch":`No exact models.dev match`,"models.catalogPriceProvider":`Price matched Provider {provider}`,"models.catalogPriceBaseUrl":`Price matched Base URL to {provider}`,"models.catalogPriceConsensus":`Price agreed by {support}/{total} records`,"models.catalogPriceUnreliable":`No reliable price found`,"models.catalogUndo":`Undo`,"models.baseUrl":`Base URL`,"models.apiKey":`API Key`,"models.api":`API Format`,"models.modelId":`ID *`,"models.name":`Name`,"models.apiOverride":`API format`,"models.reasoningThinking":`Reasoning / thinking`,"models.inputFormat":`Input formats`,"models.inputFormatPlaceholder":`Search and add, multiple allowed (Enter to confirm)`,"models.inputFormat.text":`Text`,"models.inputFormat.image":`Image`,"models.badgeReasoning":`Supports reasoning (thinking levels selectable in the chat input)`,"models.badgeInput":`Accepts {format} input`,"models.nameHint":`Leaving empty removes the name field (falls back to the model id).`,"models.apiOverrideHint":`Leaving empty or picking default removes the api field (falls back to the provider's default api).`,"models.reasoningHint":`Unchecking removes the reasoning field (falls back to off).`,"models.thinkingLevelMapHint":`Per level: Default = removes that mapping (falls back to the model's default level); Disabled = writes null; Custom = writes a custom level string.`,"models.compatSection":`Compatibility`,"models.compatInheritHint":`Fields not set on the model show values inherited from this provider (highlighted in dim color); the inherited value is what actually takes effect until overridden here.`,"models.compatHint.supportsDeveloperRole":`Whether to use the developer role for system prompts (used by reasoning models). Set to false for servers that don't support it (Ollama, vLLM, SGLang) to send system messages instead.`,"models.compatHint.supportsLongCacheRetention":`Whether the provider accepts long cache retention: prompt_cache_options.ttl "30m" for GPT-5.6+ Responses models, prompt_cache_retention "24h" for older OpenAI models, or cache_control.ttl "1h" with the anthropic cache format.`,"models.compatHint.supportsUsageInStreaming":`Whether streamed responses support stream_options: {include_usage: true} for token usage reporting.`,"models.compatHint.supportsFinishReason":`Whether streamed responses include finish_reason. When false, pi infers stop or toolUse when the stream ends.`,"models.compatHint.supportsEagerToolInputStreaming":`Whether the provider accepts per-tool eager_input_streaming. Set to false to omit that field and use the legacy fine-grained-tool-streaming beta header.`,"models.compatHint.supportsCacheControlOnTools":`Whether the provider accepts Anthropic-style cache_control markers on tool definitions (tool prompt caching).`,"models.compatHint.supportsTemperature":`Whether the provider accepts the temperature parameter. Set to false for endpoints that reject non-default temperatures (e.g. Claude Opus 4.7+).`,"models.compatHint.requiresToolResultName":`Whether tool result messages must include the name field (required by some endpoints).`,"models.compatHint.requiresAssistantAfterToolResult":`Whether an empty assistant message must be inserted after tool results and before the next user message (required by some endpoints).`,"models.compatHint.requiresThinkingAsText":`Whether thinking blocks should be converted to plain text (for endpoints without thinking block support).`,"models.compatHint.zaiToolStream":`Whether z.ai supports the top-level tool_stream: true parameter for streaming tool call deltas.`,"models.compatHint.supportsThinkingTokenBudget":`Whether the provider supports the top-level thinking_token_budget field to cap reasoning tokens (vLLM-compatible endpoints).`,"models.compatHint.supportsOpenAIGrammarTools":`Whether OpenAI-compatible APIs emit custom Lark/regex grammar tools. When false, grammar-constrained tools fall back to normal function tools.`,"models.compatHint.supportsToolSearch":`Whether the model supports client-executed tool search for deferred tools.`,"models.compatHint.supportsExplicitPromptCacheMode":`Whether the model accepts the prompt_cache_options parameter (OpenAI GPT-5.6+ prompt caching). Older OpenAI models reject it.`,"models.compatHint.forceAdaptiveThinking":`Whether to force adaptive thinking (thinking.type: "adaptive" + output_config.effort) instead of the legacy budget-based thinking payload. Built-in adaptive models set this automatically.`,"models.compatHint.allowEmptySignature":`Whether to replay empty thinking signatures as signature: "". Enable only for Anthropic-compatible endpoints that require it; real Anthropic rejects empty signatures.`,"models.compatHint.supportsStrictTools":`Whether the endpoint accepts strict JSON-schema tool definitions (Anthropic). Built-in Anthropic models enable it.`,"models.compatHint.supportsStore":`Whether the OpenAI endpoint supports the store field.`,"models.compatHint.supportsReasoningEffort":`Whether the endpoint supports the reasoning_effort parameter (often unsupported by Ollama, vLLM, SGLang).`,"models.compatHint.supportsStrictMode":`Whether the endpoint accepts strict JSON-schema function tool definitions. Defaults depend on the API; built-in OpenAI models carry explicit capability metadata.`,"models.compatHint.supportsToolReferences":`Whether tool references in tool results are supported. Default true for first-party Anthropic models except Haiku and models older than Claude 4.5.`,"models.compatHint.maxTokensField":`Field name for the max output token parameter: max_completion_tokens (new API) or max_tokens (legacy API).`,"models.compatHint.sessionAffinityFormat":`Session affinity (caching): sends the session id as an affinity key so requests from one session tend to hit the same backend replica, raising the prompt-cache hit rate — endpoints like Fireworks route prompt caches by session affinity, so leaving it off can spread a session across replicas and waste cache reuse (it does not affect the prompt_cache_key body param, which is governed by cache retention). pi sends these headers only when compat.sendSessionAffinityHeaders is true (openai-responses keys off the format alone); this dropdown writes both fields. auto = enabled with the format auto-detected from the URL; off = explicit disable (overrides a provider-level enable at model level); openai = session_id/x-client-request-id/x-session-affinity; openai-nosession = x-client-request-id/x-session-affinity; openrouter = x-session-id.`,"models.compatHint.deferredToolsMode":`Provider-specific deferred tool serialization. Currently only kimi (Kimi's OpenAI-compatible Chat Completions format).`,"models.compatHint.cacheControlFormat":`Prompt cache marker format. Currently only anthropic: adds cache_control markers on the system prompt, last tool definition, and last text content.`,"models.inheritedFromProvider":`from provider (inherited, override at model level)`,"models.thinkingFormatDeepseekHint":`Selecting "deepseek" also writes requiresReasoningContentOnAssistantMessages: true; any other value removes it.`,"models.samplingParams":`Sampling params`,"models.headers":`Headers`,"models.modelOverrides":`Model overrides`,"models.supportsDeveloperRole":`Developer role`,"models.supportsLongCacheRetention":`Long cache retention`,"models.supportsUsageInStreaming":`Usage in streaming`,"models.supportsFinishReason":`Finish reason in stream`,"models.supportsEagerToolInputStreaming":`Eager tool input streaming`,"models.supportsCacheControlOnTools":`Cache control on tools`,"models.supportsTemperature":`Temperature param`,"models.requiresToolResultName":`Tool result name required`,"models.requiresAssistantAfterToolResult":`Assistant after tool result`,"models.requiresThinkingAsText":`Thinking as text`,"models.requiresReasoningContentOnAssistantMessages":`Reasoning content on assistant`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`Thinking token budget`,"models.supportsOpenAIGrammarTools":`OpenAI grammar tools`,"models.supportsToolSearch":`Tool search`,"models.supportsExplicitPromptCacheMode":`Explicit prompt cache`,"models.forceAdaptiveThinking":`Adaptive thinking`,"models.allowEmptySignature":`Empty thinking signature`,"models.supportsStrictTools":`Strict tool schemas`,"models.supportsStore":`Store param`,"models.supportsReasoningEffort":`Reasoning effort`,"models.supportsStrictMode":`Strict mode`,"models.supportsToolReferences":`Tool references`,"models.maxTokensField":`Max tokens field`,"models.sessionAffinityFormat":`Session affinity`,"models.deferredToolsMode":`Deferred tools mode`,"models.cacheControlFormat":`Cache control format`,"models.thinkingFormat":`Thinking format`,"models.chatTemplateKwargs":`Chat template kwargs`,"models.chatTemplateArgs":`Chat template args`,"models.openRouterRouting":`OpenRouter routing`,"models.vercelGatewayRouting":`Vercel gateway routing`,"models.thinkingLevelMap":`Thinking level`,"models.thinkingLevelMapReset":`Reset (clear)`,"models.thinkingLevelMapResetHint":`Clears the entire thinkingLevelMap: off, minimal, low, medium, high fall back to their defaults; xhigh and max are disabled by default.`,"models.thinkingLevelMapNone":`All disabled`,"models.contextWindow":`Context window (tokens)`,"models.maxOutputTokens":`Max output tokens`,"models.costPerMillion":`Cost (per million tokens)`,"models.cost.input":`Input`,"models.cost.output":`Output`,"models.cost.cacheRead":`Cache read`,"models.cost.cacheWrite":`Cache write`,"models.costNotSet":`Not set`,"models.costAllRequired":`All four rates are required`,"models.costClear":`Clear`,"models.apiKeyPlaceholder":`ENV_VAR_NAME, !shell-command, or literal key`,"models.apiKeyHint":`Literal keys are written to auth.json on save (shared with CLI /login, takes precedence over this field); !shell-command and $ENV references stay in models.json.`,"models.authJsonConnected":`API key provided via auth.json`,"models.authJsonRemove":`Remove`,"models.apiKeyPrompt":`Enter your {provider} API key to enable {count} model{s}.`,"models.oauthAlreadyConnected":`Already connected. You can re-login or disconnect.`,"models.oauthConnectPrompt":`Connect your {provider} account.`,"models.enterValue":`Enter value…`,"models.displayNamePlaceholder":`Display name`,"models.connectionLost":`Connection lost`,"models.networkError":`Network error`,"i18n.testingModel":`Testing model connection...`,"i18n.connected":`Connected`,"i18n.failed":`Failed`,"i18n.test":`Test`,"i18n.testConnection":`Test model connection`,"i18n.provider":`Provider`,"i18n.providers":`Providers`,"i18n.model":`Model`,"i18n.providerName":`Name`,"i18n.rename":`Rename`,"i18n.default":`Default`,"i18n.disabled":`Disabled`,"plugins.statusLoaded":`Loaded and active`,"plugins.statusInstalled":`Installed, not yet loaded`,"plugins.statusDisabled":`Disabled`,"plugins.statusMissing":`Configured but package not found`,"plugins.extensionFilters":`Extension filters`,"plugins.filterRules":`Filter rules`,"plugins.managePlugins":`Plugins`,"plugins.extensionFiltersHint":`Filters for auto-discovered extensions in ~/.pi/agent/extensions/ and .pi/extensions/. Only patterns starting with !, +, or - take effect; plain paths do nothing.`,"plugins.noExtensionFilters":`No filters configured`,"plugins.addFilter":`Add filter`,"plugins.filterPatternLabel":`Pattern`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`Pattern must start with !, +, or -; plain paths have no effect in the extensions field.`,"plugins.filterPrefixExclude":`Exclude matching extensions`,"plugins.filterPrefixForceInclude":`Force-include exact path`,"plugins.filterPrefixForceExclude":`Force-exclude exact path`,"plugins.filterEffect":`Effect`,"plugins.removeFilter":`Remove filter`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`Package installed.`,"plugins.packageUpdated":`Package updated.`,"plugins.packageRemoved":`Package removed.`,"plugins.packageDisabled":`Package disabled.`,"plugins.packageEnabled":`Package enabled.`,"plugins.extensionFilterAdded":`Extension filter added.`,"plugins.extensionFilterRemoved":`Extension filter removed.`,"plugins.sessionReloaded":`Session reloaded.`,"i18n.noResources":`No resources`,"i18n.unknown":`Unknown`,"i18n.installedVersion":`installed {version}`,"i18n.configuredVersion":`configured {version}`,"i18n.extensions":`Extensions`,"i18n.prompts":`Prompts`,"i18n.themes":`Themes`,"i18n.resourceCount":`{count} {label}`,"i18n.extensionShort":`ext`,"i18n.versionShort":`ver`,"i18n.skillShort":`skills`,"i18n.promptShort":`prompts`,"i18n.themeShort":`themes`,"i18n.custom":`Custom`,"i18n.clearAll":`clear all`,"i18n.connectedSuccessfully":`Connected successfully.`,"i18n.notConnected":`not connected`,"i18n.configured":`configured`,"i18n.notConfigured":`not configured`,"i18n.openingBrowser":`Opening browser…`,"i18n.submit":`Submit`,"i18n.login":`Login`,"i18n.relogin":`Re-login`,"i18n.disconnect":`Disconnect`,"i18n.networkError":`Network error`,"i18n.continuing":`Continuing…`,"i18n.skills":`Skills`,"i18n.plugins":`Plugins`,"i18n.addSkill":`Add skill`,"i18n.addPlugin":`Add plugin`,"i18n.recommendedPlugins":`Recommended`,"i18n.selectSkill":`Select a skill`,"i18n.selectPackage":`Select a package`,"i18n.configBindings":`Bound config files`,"i18n.addBinding":`Add`,"i18n.configFileNote":`Note (optional)`,"i18n.bindConfigFile":`Bind config file`,"i18n.selectFile":`Select a file`,"i18n.noConfigBindings":`No config files bound`,"i18n.noFiles":`No files`,"i18n.allFiles":`All files`,"i18n.filterByType":`Filter by type`,"i18n.removeBinding":`Remove binding`,"i18n.confirm":`Confirm`,"i18n.updateAvailable":`Update available`,"i18n.upToDate":`Up to date`,"i18n.automaticChecksUnavailable":`Automatic checks unavailable`,"i18n.checkFailed":`Check failed`,"i18n.installed":`Installed`,"i18n.status":`Status`,"i18n.version":`Version`,"i18n.package":`Package`,"i18n.resources":`Resources`,"i18n.installedPath":`Installed path`,"i18n.readme":`README`,"i18n.readmeDetails":`Details`,"i18n.unsafeLinkBlocked":`Blocked unsafe link (only same-directory or sub-directory relative links are allowed): {href}`,"i18n.resolvedResources":`Resolved Resources`,"i18n.reloadSession":`Reload session`,"i18n.reloading":`Reloading...`,"i18n.packageRemoved":`Package removed.`,"i18n.packageInstalled":`Package installed.`,"i18n.packageUpdated":`Package updated.`,"i18n.packageDisabled":`Package disabled.`,"i18n.packageEnabled":`Package enabled.`,"i18n.sessionReloaded":`Session reloaded.`,"i18n.thinking":`Thinking`,"i18n.loadingThinking":`Loading thinking...`,"i18n.copyMessage":`Copy message`,"i18n.editFromHere":`Edit from here`,"i18n.editFromHereTitle":`Edit from here — branches within this session`,"i18n.newSession":`New session`,"i18n.newSessionTitle":`New session — creates an independent copy from here`,"i18n.estimatedTokens":`Estimated token count while streaming`,"i18n.noOutput":`(no output)`,"i18n.noSummary":`(no summary)`,"i18n.conversationCompacted":`Conversation compacted`,"i18n.compactionDescription":`The conversation history before this point was compacted into the following summary:`,"i18n.fileContext":`File context: {details}`,"i18n.readFiles":`Read files`,"i18n.modifiedFiles":`Modified files`,"i18n.hiddenExtensionMessage":`hidden extension message`,"i18n.noMessage":`(no message)`,"i18n.showExtensionMessage":`Show extension message`,"i18n.collapse":`Collapse`,"i18n.expand":`Expand`,"i18n.hideDetails":`Hide details`,"i18n.showDetails":`Show details`,"i18n.thinkingUnavailable":`Thinking content unavailable`,"i18n.thinkingEncrypted":`Thinking content is encrypted (provider-encrypted for context continuity, plaintext not available)`,"i18n.before":`Before`,"i18n.after":`After`}},ke={id:`zh-CN`,label:`简体中文`,messages:{"common.ok":`确定`,"common.language":`语言`,"common.models":`模型`,"common.skills":`技能`,"common.plugins":`插件`,"sidebar.hide":`收起侧边栏`,"sidebar.show":`展开侧边栏`,"theme.light":`切换到浅色模式`,"preferences.defaultThinkingLevel":`默认思考级别`,"preferences.thinkingLevelHint":"新会话的全局默认思考级别(settings.json `defaultThinkingLevel`)。未设置=删除该字段(回落 pi 默认)。","preferences.thinkingLevelNotSet":`未设置(跟随模型默认)`,"preferences.compaction":`自动压缩`,"preferences.compactionHint":"自动压缩长会话(settings.json `compaction`)。未配置时按 pi 默认值展示,改动即写入完整对象。","preferences.compactionEnabled":`启用`,"preferences.compactionReserveTokens":`输出预留词元数`,"preferences.compactionReserveTokensHint":`为模型输出预留的词元数,压缩时保留这部分空间供回复使用`,"preferences.compactionKeepRecentTokens":`压缩后保留词元数`,"preferences.compactionKeepRecentTokensHint":`压缩后保留的词元数,从最近聊天记录开始逆向往前计算`,"preferences.retry":`API 重试`,"preferences.retryHint":"供应商 API 调用的重试设置(settings.json `retry`)。未配置时按 pi 默认值展示,改动即写入完整对象;provider 子字段留空则不写入。","preferences.retryEnabled":`启用重试`,"preferences.retryEnabledHint":`是否对失败的 API 调用启用重试`,"preferences.retryMaxRetries":`最大重试次数`,"preferences.retryBaseDelayMs":`基础延迟(毫秒)`,"preferences.retryBaseDelayMsHint":`首次重试前的初始延迟,单位毫秒`,"preferences.retryProviderTimeoutMs":`供应商超时(毫秒)`,"preferences.retryProviderMaxRetries":`供应商最大重试次数`,"preferences.retryProviderMaxRetryDelayMs":`供应商最大延迟(毫秒)`,"preferences.defaultProjectTrust":`新项目默认信任`,"preferences.projectTrustHint":"新项目的默认信任策略(settings.json `defaultProjectTrust`)。未设置=删除该字段(回落「询问」)。","preferences.projectTrustNotSet":`未设置(询问)`,"preferences.projectTrustAsk":`询问`,"preferences.projectTrustAlways":`总是信任`,"preferences.projectTrustNever":`从不信任`,"preferences.notifyEvents":`通知`,"preferences.notifyEventsHint":`标签页非激活时发浏览器通知。权限在首次交互时请求。`,"notify.permission.request":`开启通知`,"notify.permission.requestHint":`点击开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.granted":`通知已开启`,"notify.permission.grantedHint":`已开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.bannerHintBefore":`点击左上工具栏的`,"notify.permission.bannerHintAfter":`按钮开启通知权限,任务完成、出错或提问时都能收到浏览器通知,详细设置可在 配置中心 → 会话 → 通知 栏目中调整`,"notify.permission.denied":`通知被阻止`,"notify.permission.deniedHint":`浏览器阻止了通知。请点击地址栏左侧图标 → 站点设置,将通知改为允许后重试`,"preferences.notifyWhileActive":`页面激活时也通知`,"preferences.notifyTaskComplete":`任务完成`,"preferences.notifyErrors":`运行出错`,"preferences.notifyQuestions":`提问`,"preferences.subagentsDefaultModel":`子代理默认模型`,"preferences.subagentsDefaultThinking":`子代理默认思考级别`,"preferences.subagentsHint":"子代理默认配置(settings.json `subagents`)。defaultThinking 未设置=删除该子字段(回落 pi 默认)。","preferences.subagentsModelPlaceholder":`供应商/模型-id`,"theme.dark":`切换到深色模式`,"theme.toggleTheme":`切换主题`,"theme.darkMode":`深色`,"theme.lightMode":`浅色`,"theme.fontSize":`字体大小`,"theme.scrollStep":`悬停滚动步长`,"scrollStep.hint":`悬停滚动方向箭头时,内容每次滚动的像素数(面板滚动箭头与消息地图共用此步长)。`,"scrollStep.range":`每次悬停滚动像素(1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`自动重载聊天消息间隔`,"autoReload.off":`关闭(0)— 不自动刷新`,"autoReload.range":`秒(0 — 3600)`,"autoReload.unit":`秒`,"autoReload.hint":`自动重新读取会话文件的间隔秒数;0 = 关闭。单客户端场景(消息经 SSE 实时推送)保持 0 即可;多客户端协作(多个浏览器同时操作同一会话)时设为大于 0,各客户端定时刷新以读取其他客户端生成的新聊天消息。`,"recentBlocks.hint":`流式渲染过程中和刚刚完成的块不计入数量(最新完成的块始终展开)。本值表示除此之外,额外保持展开的最近已完成块数。`,"autoReload.reset":`恢复默认({n} 秒)`,"chat.reloadFromDisk":`从磁盘重新加载会话`,"chat.reloadFromDiskHint":`当多个客户端同时读写同一个会话 jsonl 时使用。可在 配置中心 → 会话 页面设置自动定时重载。`,"scrollStep.reset":`恢复默认({n} px)`,"theme.recentBlocksExpanded":`最近完成块保持展开数`,"layout.sidebarWidth":`左侧面板宽度`,"layout.widgetPanelWidth":`右侧面板宽度`,"layout.widthRange":`px({min}–{max})`,"layout.widthReset":`恢复默认({value} px)`,"longBlock.blocks":`个`,"recentBlocks.reset":`恢复默认({n} 个)`,"recentBlocks.range":`0-20,不含最新完成的块`,"history.full":`完整历史`,"history.unsaved":`会话保存后才能查看完整历史`,"title.generating":`正在生成...`,"title.updated":`标题已更新`,"title.failed":`生成失败`,"title.generate":`生成标题`,"title.unsaved":`会话保存后才能生成标题`,"title.noMessages":`请先发送消息,再为会话命名`,"title.generateSession":`生成会话标题`,"system.prompt":`系统提示词`,"system.empty":`系统提示词为空(工具已禁用)`,"system.load":`发送消息以加载系统提示词`,"notices.title":`通知`,"notices.empty":`暂无警告或错误消息`,"notices.fromSession":`来自会话`,"session.info":`会话信息`,"session.reload":`重载会话(重读配置与资源)`,"session.name":`名称`,"session.file":`文件`,"session.inMemory":`内存中`,"session.id":`ID`,"session.user":`用户`,"session.assistant":`助手`,"session.toolCalls":`工具调用`,"session.toolResults":`工具结果`,"session.total":`总计`,"session.input":`输入`,"session.output":`输出`,"session.cacheRead":`缓存读取`,"session.cacheWrite":`缓存写入`,"session.inputHint":`未命中缓存的输入 token 数:系统提示、会话历史、工具定义等发送给模型的上下文,减去命中缓存的部分`,"session.outputHint":`模型生成回复的 token 数(回答与思考)`,"session.cacheReadHint":`命中 prompt 缓存的 token 数:与上一请求未变的上下文直接从缓存读取,按折扣价计费`,"session.cacheWriteHint":`首次写入缓存的 token 数(Anthropic 风格按写入计费)`,"session.totalHint":`输入 + 输出 + 缓存读取 + 缓存写入`,"session.cacheReadRate":`缓存命中率:命中缓存的 token(缓存读取)占全部输入 prompt(输入 + 缓存读取 + 缓存写入)的比例,即官方口径 cacheRead ÷ (input + cacheRead + cacheWrite)`,"session.cost":`费用`,"session.context":`上下文`,"session.copy":`复制{value}`,"session.copied":`已复制`,"session.title":`会话信息`,"session.load":`发送消息或运行 /session 以加载会话信息`,"session.infoSection":`会话信息`,"session.messages":`消息`,"session.tokens":`Token`,"session.copyFile":`复制文件路径`,"session.copyId":`复制会话 ID`,"workspace.opening":`正在打开工作区...`,"workspace.unable":`无法打开工作区`,"workspace.selectSession":`从侧边栏选择一个会话`,"workspace.selectWorkspace":`请选择工作区`,"workspace.stepProject":`从侧边栏选择项目目录`,"workspace.stepModels":`点击底部的“模型”按钮添加模型`,"tabs.chat":`聊天`,"tabs.widgets":`小组件`,"config.title":`配置`,"config.section.session":`会话`,"config.section.appearance":`外观`,"config.section.advanced":`高级`,"config.section.startScreen":`开始屏幕`,"config.section.git":`Git`,"config.section.updates":`更新`,"config.section.modelThinking":`思考级别`,"config.section.requiresCwd":`请先从侧边栏选择项目目录,再浏览插件 / 技能`,"updates.check":`检查更新`,"updates.checking":`检查中…`,"updates.checkedAt":`上次检查`,"updates.upToDate":`已是最新`,"updates.updateAvailable":`有新版本`,"updates.unavailable":`检查失败`,"updates.noPluginUpdates":`全部插件已是最新`,"updates.banner":`有可用更新:{items}`,"updates.view":`查看`,"updates.copied":`已复制`,"updates.copyCommand":`复制命令`,"updates.restartNote":`更新后将同时升级内置 pi SDK,重启服务生效。`,"updates.enableChecking":`启用更新检测`,"updates.disabled":`更新检测已关闭`,"updates.ignoreVersion":`忽略此版本`,"updates.ignored":`已忽略 {version}`,"updates.ignoredPlugin":`已忽略`,"updates.unignore":`取消忽略`,"preferences.pi.unset":`pi 默认`,"preferences.pi.enableAnalytics":`启用分析`,"preferences.pi.enableAnalyticsHint":"发送匿名使用分析(settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`启用安装遥测`,"preferences.pi.enableInstallTelemetryHint":"发送匿名安装遥测(settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP 代理`,"preferences.pi.httpProxyHint":"HTTP 请求的代理地址(settings.json `httpProxy`)。留空无法清除已设置的值。","preferences.pi.trackingId":`分析跟踪 ID`,"preferences.pi.trackingIdHint":"自定义分析跟踪 ID(settings.json `trackingId`)。留空无法清除已设置的值。","preferences.pi.httpIdleTimeoutMs":`HTTP 空闲超时(毫秒)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP 空闲超时毫秒数(settings.json `httpIdleTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.websocketConnectTimeoutMs":`WebSocket 连接超时(毫秒)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket 连接超时毫秒数(settings.json `websocketConnectTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.branchSummary":`分支摘要`,"preferences.pi.branchSummaryHint":"分支摘要自动压缩(settings.json `branchSummary`)","preferences.pi.reserveTokens":`预留 token`,"preferences.pi.skipPrompt":`跳过提示`,"preferences.pi.images":`图片处理`,"preferences.pi.imagesHint":"pi 引擎如何处理图片(settings.json `images`)","preferences.pi.autoResize":`自动缩放`,"preferences.pi.autoResizeHint":"压缩 `read` 等工具返回的图片以节省 token。","preferences.pi.blockImages":`阻止图片`,"preferences.pi.blockImagesHint":`在消息发送给模型前移除所有图片内容。`,"config.files.hint":`直接编辑 pi 的配置文件(JSON)。保存前校验,写前自动备份(保留最近 10 份)。`,"config.widgets.empty":`暂无小组件配置。插件弹出小组件时会自动在此创建条目。`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`宽`,"config.widgets.height":`高`,"config.widgets.bind":`绑定消息`,"config.widgets.bindTitle":`绑定自定义消息`,"config.widgets.bindHint":`为小组件「{key}」绑定一条快捷消息`,"config.widgets.editTitle":`编辑快捷消息`,"config.widgets.editHint":`修改标题、内容与发送方式。`,"config.widgets.label":`描述`,"config.widgets.labelPlaceholder":`按钮显示的文字(如:重载)`,"config.widgets.message":`消息内容`,"config.widgets.messagePlaceholder":`斜杠命令或任意文本(如 /reload)`,"config.widgets.messageTooltip":`以 / 开头时仅提示内置、全局插件与 Skill 命令;项目级插件命令不会出现在列表中,但可手动输入后保存`,"config.widgets.sendImmediately":`立即发送`,"config.widgets.sendMode":`发送方式`,"config.widgets.fillToChatInput":`填充到聊天框`,"config.widgets.sendImmediatelyTooltip":`立即发送:`,"config.widgets.fillToChatInputTooltip":`填充到聊天框:`,"config.widgets.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.startScreen.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.widgets.confirm":`确认`,"config.widgets.unbindTitle":`解绑消息`,"config.widgets.unbindConfirm":`确定解绑「{label}」?`,"config.widgets.unbind":`解绑`,"config.startScreen.hint":`新会话开始屏幕(Pi Logo 下方)展示的快捷入口;点击后按各条绑定的发送方式立即发送或填充到聊天输入框。`,"config.startScreen.bind":`绑定消息`,"config.startScreen.bindTitle":`绑定快捷消息`,"config.startScreen.bindHint":`为开始屏幕绑定一条快捷消息。`,"config.startScreen.editTitle":`编辑快捷消息`,"config.startScreen.editHint":`修改标题、内容与发送方式。`,"config.startScreen.empty":`暂无快捷消息,开始屏幕不会显示快捷入口。`,"config.startScreen.unbindTitle":`解绑消息`,"config.startScreen.unbindConfirm":`确定解绑「{label}」?`,"config.startScreen.unbind":`解绑`,"config.startScreen.reset":`重置`,"config.startScreen.resetHint":`恢复内置默认快捷消息;保留你自绑定的消息(与默认同名的会被默认项覆盖)。`,"config.files.save":`保存`,"config.files.saving":`保存中...`,"config.files.saved":`已保存`,"config.files.missing":`尚未创建`,"config.files.placeholder":`从左侧选择要编辑的配置文件`,"layout.resizeSidebar":`调整侧边栏宽度`,"layout.resizeWidgetPanel":`调整小组件面板宽度`,"layout.resizeHint":`拖动调整宽度。双击或按 Enter 恢复默认值。`,"sidebar.newWorkspace":`新增工作区`,"sidebar.searchSessions":`搜索会话`,"sidebar.searchSessionsPlaceholder":`搜索会话…`,"sidebar.justNow":`刚刚`,"sidebar.minutesAgo":`{count} 分钟前`,"sidebar.hoursAgo":`{count} 小时前`,"sidebar.daysAgo":`{count} 天前`,"sidebar.searchSessionsNoResults":`无匹配会话`,"sidebar.newSessionTitle":`在 {path} 中新建会话`,"sidebar.refresh":`刷新`,"directoryPicker.selectDirectory":`选择目录`,"directoryPicker.goToParent":`转到上级目录`,"directoryPicker.directoryPath":`目录路径`,"directoryPicker.goToDirectory":`转到目录`,"directoryPicker.go":`转到`,"directoryPicker.loadingDirectories":`正在加载目录…`,"directoryPicker.noSubdirectories":`没有子目录`,"directoryPicker.openBeforeSelecting":`选择前请先打开此路径`,"directoryPicker.selectCurrentDirectory":`选择当前目录`,"directoryPicker.selectThisFolder":`选择此文件夹`,"directoryPicker.noDrives":`未找到盘符`,"directoryPicker.search":`筛选文件夹`,"directoryPicker.noMatches":`没有匹配的文件夹`,"sidebar.checking":`检查中…`,"sidebar.open":`打开`,"sidebar.cancel":`取消`,"sidebar.openRepoRoot":`worktree 切换不可用`,"sidebar.openRepoRootTitle":`worktree 切换功能当前不可用:请先在侧栏将当前工作目录切换到 Git 仓库根目录。`,"sidebar.gitRepoRootOnly":`仅 Git 仓库根目录`,"sidebar.gitRepoRootOnlyTitle":`只能在 Git 仓库根目录使用 worktree。`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`正在检查此目录的 worktree。`,"sidebar.filterWorktrees":`筛选 worktree…`,"sidebar.noMatchingWorktrees":`没有匹配的 worktree`,"sidebar.switchWorktree":`切换 worktree`,"sidebar.switchWorktreeTitle":`切换 worktree:{path}`,"sidebar.main":`主分支`,"sidebar.forceRemoveCheckout":`存在未提交的更改。强制移除 checkout?`,"sidebar.force":`强制移除`,"sidebar.createWorktreeTitle":`为分支创建 worktree checkout`,"sidebar.newWorktree":`新建 worktree…`,"sidebar.branchName":`分支名称`,"sidebar.creating":`创建中…`,"sidebar.create":`创建`,"sidebar.uploadFilesTitle":`将文件上传到项目根目录`,"sidebar.uploadFiles":`上传文件`,"sidebar.refreshExplorer":`刷新文件浏览器`,"sidebar.changedFiles":`{count} 个变更文件`,"sidebar.loading":`加载中...`,"sidebar.sessionDeleted":`会话已删除,请选择其他会话`,"sidebar.noSessions":`未找到会话`,"sidebar.workspace":`工作区`,"sidebar.newActivity":`有新活动`,"sidebar.newSessionActivity":`会话有新活动`,"sidebar.interactionBadge":`会话等待交互响应`,"sidebar.deleteSession":`删除 {title}?`,"sidebar.deleteWorkspace":`删除工作区({count} 个会话)?`,"sidebar.deleteWorkspaceTitle":`删除此工作区及其所有会话`,"sidebar.copyPath":`复制完整路径`,"sidebar.rename":`重命名`,"sidebar.delete":`删除`,"sidebar.deleteWithShiftClick":`删除(按住 Shift 点击可跳过确认)`,"sidebar.expandForks":`展开分叉`,"sidebar.collapseForks":`折叠分叉`,"sidebar.disconnect":`断开`,"sidebar.messagesCount":`{count} 条消息`,"sidebar.worktreePath":`Worktree:{path}`,"sidebar.removeWorktreeTitle":`移除 worktree checkout {path};保留分支`,"files.modified":`已修改`,"files.added":`已添加`,"files.deleted":`已删除`,"files.renamed":`已重命名`,"files.untracked":`未跟踪`,"files.conflict":`冲突`,"files.newlyUploaded":`刚上传`,"files.containsChangedFiles":`包含已更改文件`,"files.insertPath":`将路径插入聊天`,"files.mention":`提及`,"files.download":`下载文件`,"files.dismissError":`关闭错误`,"files.addUploadedFile":`将上传的文件添加到聊天`,"files.addAllUploadedFiles":`将所有上传的文件添加到聊天`,"files.openInSystemApp":`用系统应用打开`,"files.chooseOtherApp":`选择其他应用…`,"files.openLaunched":`已调用系统应用打开(如无窗口弹出,请检查文件关联)`,"files.fileTooLargeForPreview":`文件太大,无法预览(>{limit})`,"files.docTooLargeForPreview":`DOCX 太大,无法预览(>{limit})`,"files.dismissUploadResults":`关闭上传结果`,"files.loading":`正在加载文件...`,"files.noFiles":`未找到文件`,"files.find":`查找`,"files.findNext":`下一个匹配(Enter)`,"files.findPrev":`上一个匹配(Shift+Enter)`,"files.findNoResults":`无结果`,"files.findClose":`关闭(Esc)`,"loading.inProgress":`处理中…`,"loading.more":`还有 {count} 项…`,"errors.title":`错误`,"errors.titleCount":`错误({count})`,"errors.close":`关闭`,"errors.clearAll":`全部清除`,"files.notFound":`(暂无文件)`,"files.accessDenied":`访问被拒绝`,"files.empty":`(空)`,"files.uploadFailed":`{count} 个失败`,"files.explorer":`文件浏览器`,"files.changedCount":`{count} 个文件`,"files.stagedPrefix":`已暂存:`,"files.unstagedPrefix":`未暂存:`,"files.noStagedChanges":`暂无已暂存文件`,"files.noUnstagedChanges":`暂无变更文件`,"files.commitMessagePlaceholder":`提交信息`,"files.commit":`提交`,"files.push":`推送到远端(含 tag)`,"files.pushing":`推送中...`,"files.pushSuccess":`推送成功`,"files.pushFailed":`推送失败`,"files.pushUpToDate":`已与远端同步,无需推送`,"files.pull":`从远端拉取`,"files.pulling":`拉取中...`,"files.pullSuccess":`拉取成功`,"files.pullFailed":`拉取失败`,"files.pullUpToDate":`已与远端同步,无需拉取`,"files.pullNonFastForward":`拉取被拒绝——本地与远端已分叉。请在终端使用 git pull --rebase 或 --merge 处理。`,"files.committing":`提交中…`,"files.commitMessageRequired":`请先填写 commit message`,"files.commitTitle":`提交更改`,"files.confirmStageAllCommit":`是否暂存全部 {count} 个改动文件并提交?`,"files.stageAllAndCommit":`暂存并提交`,"files.stageFile":`暂存文件`,"files.unstageFile":`取消暂存`,"files.changeStats":`{count} 个变更文件,新增 {additions} 行,删除 {deletions} 行`,"git.autoFetchInterval":`自动 fetch 间隔(秒)`,"git.autoFetchIntervalHint":`服务端定时为活动会话的工作区执行 git fetch(所有客户端共享结果)。0 表示关闭定时——仅在连接会话时触发一次。`,"git.groupTitle":`智能提交信息生成`,"git.commitModel.followCurrent":`跟随当前会话模型`,"git.commitModel.followCurrentHint":`开启后,生成提交信息时动态使用当前聊天的主模型;关闭则使用下方固定的模型(推荐使用免费小模型)。`,"git.commitModel.followCurrentOn":`已开启:跟随当前会话`,"git.commitModel.followCurrentOff":`已关闭:使用固定模型`,"git.commitModel.fixedModel":`固定模型`,"git.commitModel.fixedModelHint":`关闭“跟随当前会话”时使用的模型(建议选择固定的免费小模型,注意其上下文可能仅 5 万)。`,"git.commitModel.selectPlaceholder":`选择模型`,"git.commitModel.noModels":`暂无可用模型`,"git.commitModel.notConfiguredHint":`尚未选择固定模型,请先选择一个模型后再使用智能生成。`,"git.ai.generate":`智能生成`,"git.ai.generating":`生成中…`,"git.ai.notConfiguredTitle":`未配置模型`,"git.ai.notConfiguredDesc":`尚未为智能生成指定模型,请前往配置中心 → Git 指定模型后再试。`,"git.ai.goToConfig":`前往配置`,"git.ai.noSession":`跟随模式需要先选择一个会话`,"git.ai.noSessionModel":`当前会话无可用模型,请先在聊天中选择模型`,"git.commitModel.maxTokens":`最大输出长度`,"git.commitModel.maxTokensHint":`单次智能生成允许的最大输出 token 数(64–4096,默认 512)。已尽量降低推理开销:支持关闭的模型会关闭推理,不支持的会降至最低档位。`,"git.commitModel.autoGenerateOnEmpty":`空输入框时提交自动先智能生成`,"git.commitModel.autoGenerateOnEmptyHint":`开启后,点击提交时若输入框为空,会先自动调用智能生成填入信息再提交;仅在已指定模型时生效,未指定模型时空输入框仍禁用提交。默认开启。`,"git.ai.invalidModel":`已配置的模型格式无效,请前往配置中心重新选择`,"git.ai.autoGenerateOn":`已开启:空输入框自动生成`,"git.ai.usingCurrentModel":`使用聊天主模型`,"git.ai.usingModel":`使用 {model}`,"git.ai.generateAndCommit":`智能生成信息并提交`,"git.ai.autoGenerateOff":`已关闭`,"git.commitSectionTitle":`提交`,"git.commitConfirmStageAll":`提交时需确认“暂存全部”`,"git.commitConfirmStageAllHint":`开启后,未暂存时点击提交会先弹出“暂存全部并提交”确认框;关闭则直接暂存全部并提交。默认开启。`,"git.commitConfirmStageAllOn":`已开启:提交前确认`,"git.commitConfirmStageAllOff":`已关闭:直接暂存全部`,"modelThinking.desc":`为每个模型或 Provider 记忆上次选择的思考级别。切换模型时自动选中记忆的档位;若该模型的可用档位不含记忆值则回退到 auto(跟随默认)。支持全部 7 档:off / minimal / low / medium / high / xhigh / max。`,"modelThinking.byModel":`按模型`,"modelThinking.byProvider":`按 Provider`,"modelThinking.byProviderHint":`Provider 级别为回退:同 Provider 下未单独记忆的模型会使用此值。`,"modelThinking.emptyModel":`暂无按模型的记忆。切换模型后用下方思考级别下拉选择,自动记忆;也可在此添加。`,"modelThinking.emptyProvider":`暂无按 Provider 的记忆。`,"modelThinking.selectModelPlaceholder":`选择模型`,"modelThinking.selectProviderPlaceholder":`选择 Provider`,"modelThinking.providerInputPlaceholder":`或输入 Provider 名称`,"modelThinking.footerHint":`配置保存到独立文件 pi-web/model-thinking.json,不影响主配置;仅作用于 UI 下拉,不拦截 pi 的 thinking 调用。`,"common.add":`添加`,"common.delete":`删除`,"files.conflictSummary":`已有 {count} 个文件:{files}`,"files.cannotReplace":`无法替换:{files}`,"files.replace":`替换`,"files.skipExisting":`跳过已有文件`,"files.cancel":`取消`,"files.checking":`正在检查文件`,"files.uploading":`正在上传,{progress}%`,"files.search":`搜索文件`,"files.searchPlaceholder":`搜索文件...`,"chat.loadingSession":`正在加载会话...`,"chat.noSessionSelected":`请在左侧面板新增/选择任意会话`,"chat.loadingWindow":`正在加载消息...`,"chat.runningTool":`正在运行工具...`,"chat.runningNamedTool":`正在运行 {name}...`,"chat.runningTools":`正在运行 {names}...`,"chat.runningToolsMore":`正在运行 {names}(另有 {count} 个)...`,"chat.waitingModel":`正在等待模型...`,"chat.aiQuestion":`AI 提问`,"chat.runningCommand":`正在运行命令...`,"chat.totalElapsed":`总计 {total}`,"chat.thinking":`正在思考...`,"chat.message":`条消息`,"chat.messages":`条消息`,"chat.toolCall":`次工具调用`,"chat.toolCalls":`次工具调用`,"chat.collapseProcess":`收起处理详情`,"chat.expandProcess":`展开处理详情`,"chat.loadEarlier":`向上滚动以加载更早的消息(隐藏 {count} 条)`,"chat.searchMessages":`搜索消息`,"chat.clearSearch":`清空搜索关键字`,"chat.scrollToLatest":`滚动到最新消息`,"chat.expandMessage":`展开完整内容`,"chat.searchPlaceholder":`搜索聊天消息…`,"chat.searchNoResults":`没有结果`,"chat.searchResults":`{count} 个结果`,"chat.extensionRequest":`扩展请求`,"chat.cancel":`取消`,"chat.skipped":`已跳过`,"chat.confirm":`确认`,"chat.submit":`提交`,"chat.extensionInput":`扩展终端输入`,"chat.extensionSelect":`请选择`,"chat.extensionConfirm":`确认`,"chat.extensionEditor":`编辑`,"chat.extensionPanel":`扩展面板`,"chat.close":`关闭`,"chat.notifyInfoTitle":`信息`,"chat.notifySuccessTitle":`成功`,"chat.notifyErrorTitle":`错误`,"chat.notifyWarningTitle":`警告`,"chat.queued":`已排队 · {count}`,"chat.recall":`移回输入框`,"chat.recallTitle":`移除所有排队消息并放回输入框编辑(输入框为空时按回车也可触发)`,"chat.retrying":`正在重试({attempt}/{max})…`,"chat.loadingCommands":`正在加载命令...`,"chat.slashCommands":`斜杠命令 · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`未找到扩展、提示词或技能命令`,"chat.match":`1 个匹配项`,"chat.matches":`{count} 个匹配项`,"chat.command":`1 个命令`,"chat.commands":`{count} 个命令`,"chat.loadingFiles":`正在加载文件...`,"chat.files":`文件 · {label}{hint}`,"chat.searching":`搜索中…`,"chat.noMatchingFiles":`未找到匹配的文件`,"chat.searchingAll":` · 正在搜索所有文件…`,"chat.indexTruncated":` · 索引不完整`,"chat.steerPlaceholder":`立即引导 / 排队后续消息...`,"chat.recallPlaceholder":`回车撤回排队消息到输入框编辑,或输入新消息…`,"chat.agentPlaceholder":`Agent 运行中…`,"chat.messagePlaceholder":`消息…输入 / 使用命令,@ 引用文件,! 执行命令`,"chat.questionNotificationTitle":`Pi — 提问`,"chat.taskCompleteNotificationTitle":`Pi — 任务完成`,"chat.taskErrorNotificationTitle":`Pi — 出错`,"chat.sessionCompletedNotificationBody":`会话 {name} 已完成`,"chat.questionNotificationDenied":`通知被拒绝:在浏览器站点设置中允许后,切走页面时才会收到提问提醒。`,"chat.steer":`引导`,"chat.followUp":`后续消息`,"chat.queueImageBlocked":`运行中无法排队发送带图片的附件`,"chat.steerTooltip":`在当前调用结束后立即发送这条消息`,"chat.followUpTooltip":`在智能体结束后排队发送这条消息`,"chat.send":`发送`,"chat.attachImage":`附加图片`,"chat.attachmentOnDisk":`体积过大,已存到磁盘并以路径引用(由智能体按需读取)`,"chat.filterModels":`筛选模型…`,"chat.noMatchingModels":`没有匹配的模型`,"chat.moreControls":`更多控件`,"chat.collapseControls":`收起控件`,"chat.shell":`Shell`,"chat.outputLocal":`输出保留在本地`,"chat.outputModel":`输出发送给模型`,"chat.noTools":`不使用工具,仅只读`,"chat.builtInTools":`{count} 个内置工具`,"chat.allBuiltInTools":`全部内置工具`,"chat.changeReasoning":`更改推理级别:{level}`,"chat.changeReasoningLabel":`更改推理级别`,"chat.changeToolPreset":`更改工具预设`,"chat.stopCompaction":`停止压缩`,"chat.compactContext":`压缩上下文`,"chat.compacting":`正在压缩…`,"chat.compactionDisabledByExtension":`原生上下文压缩已被某个扩展接管,无法在这里执行。`,"chat.compact":`压缩`,"chat.stopAgent":`停止 Agent`,"chat.stop":`停止`,"chat.disableSound":`关闭完成提示音`,"chat.enableSound":`开启完成提示音`,"chat.thinkingUseDefault":`使用 pi 默认设置`,"chat.thinkingOff":`关闭推理`,"chat.thinkingMinimal":`最低限度推理`,"chat.thinkingLow":`低强度推理`,"chat.thinkingMedium":`中等强度推理`,"chat.thinkingHigh":`高强度推理`,"chat.thinkingXhigh":`超高强度推理`,"chat.thinkingMax":`最高强度推理`,"chat.thinkingMapTitle":`高级思考级别未配置`,"chat.thinkingMapBody":`pi 默认只支持 high 级别。若要开启 {level} 级别推理,请在 配置 → 模型 页面为该模型配置「推理级别映射」。`,"chat.thinkingMapGo":`立即前往`,"chat.builtIn":`内置`,"chat.extensions":`扩展`,"chat.prompts":`提示词`,"chat.skills":`技能`,"chat.dormant":`休眠`,"chat.commandCompact":`压缩上下文,可选附加说明`,"chat.commandReload":`重新加载扩展、技能、提示词和工具`,"chat.commandName":`设置会话显示名称`,"chat.commandSession":`显示会话消息、Token 和费用统计`,"chat.commandCopy":`复制最后一条助手消息`,"chat.compacted":`已压缩`,"chat.tokensSaved":`节省 {saved}`,"i18n.close":`关闭`,"i18n.resizeList":`调整 {name} 列表大小`,"widgets.title":`小组件`,"widgets.reopen":`重新弹出`,"widgets.expandedToChat":`小组件[{key}]已展开到聊天页面`,"widgets.collapse":`收起`,"widgets.open":`展开小组件`,"i18n.copy":`复制`,"i18n.copied":`已复制`,"i18n.copyToolInput":`复制原始 JSON`,"i18n.cancel":`取消`,"i18n.save":`保存`,"i18n.saving":`保存中…`,"i18n.saved":`已保存`,"i18n.saveChanges":`保存更改`,"i18n.noThinking":`无思考内容`,"i18n.remove":`移除`,"i18n.removing":`移除中…`,"i18n.delete":`删除`,"i18n.loading":`加载中...`,"i18n.searchPlaceholder":`搜索…`,"i18n.noMatch":`无匹配`,"i18n.search":`搜索`,"i18n.refresh":`刷新`,"i18n.update":`更新`,"i18n.updating":`更新中...`,"i18n.check":`检查`,"i18n.checking":`检查中...`,"i18n.install":`安装`,"i18n.installing":`安装中...`,"i18n.noResults":`没有结果`,"i18n.searchProviders":`搜索 Provider…`,"i18n.noProviders":`没有匹配的 Provider`,"i18n.newModel":`新模型`,"i18n.addProvider":`添加 Provider`,"i18n.selectProviderModel":`选择 Provider 或模型`,"i18n.visibleInPrompt":`在模型提示词中可见,点击以禁用`,"i18n.hiddenFromPrompt":`在模型提示词中隐藏,点击以启用`,"i18n.dormant":`休眠`,"i18n.hiddenButInvocable":`对模型隐藏,仍可手动调用`,"i18n.skillSearchPlaceholder":`例如 react、testing、deploy`,"i18n.searching":`搜索中…`,"i18n.noSkills":`未找到技能`,"i18n.checkUpdates":`检查更新`,"i18n.updates":`项更新`,"i18n.noResolvedResources":`没有已解析资源`,"i18n.enablePackage":`启用包`,"i18n.disablePackage":`禁用包`,"i18n.filtered":`已筛选`,"i18n.openSessionToReload":`打开会话后才能重新加载`,"i18n.notFound":`未找到`,"i18n.noPlugins":`未配置插件`,"trust.resourcesNotLoaded":`受限模式`,"trust.trustProject":`信任项目`,"trust.trusting":`正在信任...`,"trust.cancel":`取消`,"trust.dialogTitle":`信任此项目?`,"trust.dialogBody":`项目资源可以运行本地代码。请仅信任你了解其内容的项目。`,"trust.skillsNotLoaded":`此项目尚未受信任,项目技能未加载。`,"trust.pluginsNotLoaded":`此项目尚未受信任,项目插件未加载。`,"trust.projectScopeUnavailable":`项目资源未加载时,无法安装到项目范围。`,"i18n.creatingSession":`正在创建新会话…`,"i18n.creating":`创建中…`,"i18n.subscription":`订阅`,"i18n.subscriptions":`订阅服务`,"i18n.customEndpoint":`自定义端点格式`,"i18n.noChanges":`没有更改`,"i18n.branches":`分支`,"i18n.noActiveSession":`没有活动会话`,"i18n.noActiveSessionToCompact":`没有活动会话可压缩`,"i18n.noActiveSessionToReload":`没有活动会话可重新加载`,"i18n.noActiveSessionToName":`没有活动会话可命名`,"i18n.noAssistantMessageToCopy":`没有可复制的助手消息`,"i18n.commandCompleted":`命令已完成`,"i18n.commandFailed":`命令失败`,"i18n.extensionCommandFailed":`扩展命令失败`,"i18n.compactedContext":`上下文已压缩`,"i18n.reloadedSessionResources":`会话资源已重新加载`,"i18n.usageName":`用法:/name <名称>`,"i18n.sessionRenamedTo":`会话已重命名为 {name}`,"i18n.copiedLastAssistantMessage":`已复制最后一条助手消息`,"i18n.failedToRecallQueuedMessages":`恢复排队消息失败`,"i18n.noBranches":`此会话没有分支`,"i18n.source":`源代码`,"i18n.preview":`预览`,"i18n.diff":`Diff`,"i18n.downloadFile":`下载文件`,"i18n.liveSync":`实时同步已启用`,"i18n.notWatching":`未监视`,"i18n.fileViewMode":`文件视图模式`,"i18n.editMode":`编辑模式`,"i18n.viewMode":`查看模式`,"i18n.compareHead":`比较工作区与 HEAD`,"i18n.mentionSelectedLines":`提及所选行`,"i18n.disableWrap":`禁用自动换行`,"i18n.enableWrap":`启用自动换行`,"i18n.editFile":`编辑文件`,"i18n.saveFile":`保存`,"i18n.saveFileShortcut":`保存(Ctrl/Cmd+S)`,"i18n.cancelEdit":`取消`,"i18n.saveFailed":`保存失败:{error}`,"i18n.unsavedChanges":`有未保存的修改`,"i18n.htmlPreview":`HTML 预览`,"i18n.previewFile":`预览 {file}`,"i18n.invalidMermaid":`Mermaid 图表无效`,"i18n.renderingMermaid":`正在渲染 Mermaid 图表`,"i18n.previewAfterStreaming":`流式输出完成后可预览`,"i18n.showMermaidSource":`显示 Mermaid 源码`,"i18n.previewMermaid":`预览 Mermaid 图表`,"i18n.openMermaidViewer":`打开图表查看器`,"i18n.mermaidViewer":`Mermaid 图表查看器`,"i18n.mermaidDiagram":`Mermaid 图表`,"i18n.zoomOut":`缩小`,"i18n.zoomIn":`放大`,"i18n.fitToWidth":`适应宽度`,"models.discoveryFetching":`正在导入模型…`,"models.deleteProviderConfirm":`确定删除 provider「{name}」?该操作会立即写入 models.json,其全部配置(含 API key)将被移除且无法恢复。`,"models.renameProviderDialogTitle":`重命名 Provider`,"models.renameProviderHint":`重命名会立即写入 models.json,并同步迁移该 provider 的 API 密钥与登录凭证;其他未保存的修改不会一并保存。`,"models.renameProviderConflict":`Provider「{name}」已存在,请换一个名称。`,"models.renameProviderBuiltin":`「{name}」是内置 provider,不能作为自定义 provider 名。`,"models.renameProviderEmpty":`名称不能为空。`,"models.removeModelConfirm":`确定移除模型「{model}」?该操作会立即写入 models.json 且无法恢复。`,"models.discoveryTitle":`导入模型`,"models.discoveryFetch":`导入模型…`,"models.discoveryFilterPlaceholder":`筛选 {count} 个模型…`,"models.discoveryFilter":`筛选上游模型`,"models.discoverySelectShown":`选择当前结果`,"models.discoveryNoMatches":`没有匹配的模型。`,"models.discoveryAdded":`已添加`,"models.discoveryShowing":`显示前 {shown} 个,共 {total} 个`,"models.discoveryFetched":`已获取 {count} 个模型`,"models.discoveryAddSelected":`添加所选模型`,"models.setDefault":`设为默认`,"models.defaultModel":`默认模型`,"models.defaultModelUnavailable":`默认模型 {model} 不可用(已删除或已隐藏),请选择模型。`,"models.syncEndpoint":`从端点同步`,"models.lastSyncedAt":`上次同步:{time}`,"models.neverSynced":`未同步过`,"models.discoveryFetchTooltip":`优先从本地缓存导入:{path};无缓存时自动执行一次从端点同步并写入该缓存。`,"models.syncingModels":`同步中…`,"models.syncedModels":`已同步 {count} 个模型`,"models.syncEndpointTooltip":`从 {endpoint} 拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.syncEndpointTooltipGeneric":`从该供应商的 models 端点拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.refreshFromCache":`从同步缓存刷新`,"models.refreshing":`刷新中…`,"models.refreshFromCacheTooltip":`重新读取 pi-web/provider/{provider}/models.json,只更新与当前生效定义不同的字段(headers 等手动字段保留)。`,"models.refreshNoDiff":`同步缓存与当前生效定义一致,无需更新。`,"models.refreshDone":`已从同步缓存更新覆写字段。`,"models.refreshTimeout":`刷新超时,请稍后重试。`,"models.builtinProviders":`内置 Provider`,"models.customProviders":`自定义 Provider`,"models.syncSaveFailed":`同步前保存草稿失败,已中止同步。`,"models.visibleInChat":`聊天可见`,"models.visibleModels":`模型列表`,"models.visibleModelsCount":`已勾选 {visible} / 共 {total}`,"models.visibilityCustomized":` · 已自定义`,"models.visibilityUncustomized":` · 未自定义(默认全部可见)`,"models.showAll":`重置`,"models.showAllHint":`所有模型可见`,"models.filterLabel":`筛选:`,"models.invertSelection":`反向勾选`,"models.searchModels":`搜索模型…`,"models.noModels":`该 provider 暂无模型。`,"models.noMatchingModels":`无匹配模型。`,"models.filterAll":`全部`,"models.filterVisible":`仅可见`,"models.filterHidden":`仅隐藏`,"models.invertDisabledTooltip":`所有模型均已可见,反选不会改变任何状态`,"models.openOverride":`覆写模型参数`,"models.overrideHint":`当前显示为合并后的有效值(内置定义 + 已保存的覆写)。只有你修改过的字段会作为覆写保存,其余字段继续继承内置定义。`,"models.overrideOrphanedHint":`该模型已从上游删除,覆写仍保留在本地。可在此删除覆写,保存后会一并清理可见性配置。`,"models.removeOverride":`移除覆写`,"models.providerNameCollision":`Provider "{provider}" 与内置 "{builtin}"(大小写不敏感)冲突,模型可见性无法生效,请重命名或删除该 provider。`,"models.providerNameCollisionShort":`与内置 provider 撞名`,"models.builtinVisibilityBlocked":`模型可见性已禁用:自定义 provider "{custom}" 与 "{builtin}"(大小写不敏感)冲突,请重命名或删除该自定义 provider。`,"models.discoveryAddSelectedCount":`添加所选模型({count})`,"models.dataSourceLabel":`数据来源:`,"models.catalogSourceEndpoint":`模型端点`,"models.catalogSourceDev":`models.dev 目录`,"models.catalogSourceEndpointTooltip":`数据来源:Provider 的 /models 端点`,"models.catalogSourceDevTooltip":`数据来源:models.dev 内置目录(https://models.dev)`,"models.catalogEndpointNotFound":`模型端点返回中未找到该模型 ID`,"models.catalogOverwriteTitle":`覆盖已有字段?`,"models.catalogOverwriteBody":`以下 {{count}} 个字段已有值,覆盖填入将修改它们:{{fields}}。取消则仅填充空字段。`,"models.catalogOverwriteConfirm":`覆盖并填入`,"models.catalogOverwriteCancel":`仅填空字段`,"models.catalogFilling":`正在填入模型信息…`,"models.catalogFill":`填入模型信息`,"models.catalogFilled":`已填入 {count} 个字段`,"models.catalogNoEmptyFields":`没有需要填入的空字段`,"models.catalogNoExactMatch":`models.dev 中没有精确匹配`,"models.catalogPriceProvider":`价格已匹配 Provider {provider}`,"models.catalogPriceBaseUrl":`价格已按 Base URL 匹配 {provider}`,"models.catalogPriceConsensus":`价格得到 {support}/{total} 条记录支持`,"models.catalogPriceUnreliable":`未找到可靠价格`,"models.catalogUndo":`撤销`,"models.baseUrl":`Base URL`,"models.apiKey":`API 密钥`,"models.api":`API 格式`,"models.modelId":`ID *`,"models.name":`名称`,"models.apiOverride":`API 格式`,"models.reasoningThinking":`推理 / 思考`,"models.inputFormat":`输入格式`,"models.inputFormatPlaceholder":`搜索添加,可多选(回车确认)`,"models.inputFormat.text":`文本`,"models.inputFormat.image":`图片`,"models.badgeReasoning":`支持思考 / 推理(聊天输入框可选思考级别)`,"models.badgeInput":`支持{format}输入`,"models.nameHint":`留空删除 name 字段(回落使用模型 id)。`,"models.apiOverrideHint":`留空或选默认删除 api 字段(回落使用 provider 默认 api)。`,"models.reasoningHint":`取消勾选删除 reasoning 字段(回落关闭)。`,"models.thinkingLevelMapHint":`每个级别三种状态:默认=删除该级别映射(回落模型默认级别);已禁用=写入 null 禁用;自定义=写入自定义级别字符串。`,"models.compatSection":`兼容性`,"models.compatInheritHint":`模型自身未设置的项显示从 provider 继承的生效值(以弱化颜色标注);在模型级设置后将覆盖继承值。`,"models.compatHint.supportsDeveloperRole":`是否使用 developer 角色发送系统提示(推理模型常用)。Ollama、vLLM、SGLang 等不支持该角色的服务器设为 false,改为发送 system 消息。`,"models.compatHint.supportsLongCacheRetention":`是否支持长缓存保留:GPT-5.6+ 用 prompt_cache_options.ttl(30m),旧 OpenAI 用 prompt_cache_retention(24h),Anthropic 格式用 cache_control.ttl(1h)。`,"models.compatHint.supportsUsageInStreaming":`流式响应是否支持 stream_options: {include_usage: true},用于统计 token 用量。`,"models.compatHint.supportsFinishReason":`流式响应是否包含 finish_reason。设为 false 时,pi 在流结束时自行推断 stop 或 toolUse。`,"models.compatHint.supportsEagerToolInputStreaming":`是否接受逐工具的 eager_input_streaming。设为 false 时省略该字段,改用旧版 fine-grained-tool-streaming beta 请求头。`,"models.compatHint.supportsCacheControlOnTools":`是否接受工具定义上的 Anthropic 风格 cache_control 标记(用于工具提示词缓存)。`,"models.compatHint.supportsTemperature":`是否接受 temperature 采样参数。Claude Opus 4.7+ 等拒绝非默认温度值的端点需设为 false。`,"models.compatHint.requiresToolResultName":`工具结果消息是否必须包含 name 字段(某些端点要求)。`,"models.compatHint.requiresAssistantAfterToolResult":`工具结果之后、下一条用户消息之前是否需要插入一条空 assistant 消息(某些端点要求)。`,"models.compatHint.requiresThinkingAsText":`是否将思考块转换为纯文本发送(用于不支持思考块的端点)。`,"models.compatHint.zaiToolStream":`z.ai 端点是否支持顶层 tool_stream: true 参数(流式工具调用增量)。`,"models.compatHint.supportsThinkingTokenBudget":`是否支持用顶层 thinking_token_budget 字段限制思考 token(vLLM 兼容端点)。`,"models.compatHint.supportsOpenAIGrammarTools":`OpenAI 兼容 API 是否支持 Lark/regex grammar 工具。设为 false 时,受语法约束的工具回退为普通 function 工具。`,"models.compatHint.supportsToolSearch":`模型是否支持客户端执行的工具搜索(用于延迟工具)。`,"models.compatHint.supportsExplicitPromptCacheMode":`是否接受 prompt_cache_options 参数(OpenAI GPT-5.6+ 提示缓存)。旧 OpenAI 模型会拒绝该参数。`,"models.compatHint.forceAdaptiveThinking":`是否强制 adaptive thinking(thinking.type: "adaptive" + output_config.effort)替代旧版 budget 思考格式。内置自适应模型会自动设置。`,"models.compatHint.allowEmptySignature":`是否将空思考签名重放为 signature: ""。仅对确实需要的 Anthropic 兼容端点开启;真正的 Anthropic API 拒绝空签名。`,"models.compatHint.supportsStrictTools":`端点是否接受 strict JSON-schema 工具定义(Anthropic)。内置 Anthropic 模型已启用。`,"models.compatHint.supportsStore":`OpenAI 端点是否支持 store 字段。`,"models.compatHint.supportsReasoningEffort":`端点是否支持 reasoning_effort 参数(Ollama、vLLM、SGLang 等常不支持)。`,"models.compatHint.supportsStrictMode":`端点是否接受 strict JSON-schema 函数工具定义。默认依 API 而定;内置 OpenAI 模型自带能力元数据。`,"models.compatHint.supportsToolReferences":`是否支持工具结果中的工具引用块。Anthropic 一方模型默认支持(Haiku 与 Claude 4.5 之前的模型除外)。`,"models.compatHint.maxTokensField":`最大输出 token 参数名:max_completion_tokens(新 API)或 max_tokens(旧 API)。`,"models.compatHint.sessionAffinityFormat":`会话亲和(缓存相关):把 session id 当亲和键发给端点,让同一会话的请求尽量命中同一个后端副本,以提高提示缓存命中率——Fireworks 等端点就是靠它做 prompt cache 路由,不开时同一会话的请求可能落到不同副本、缓存复用变差(不影响请求体的 prompt_cache_key,那由缓存保留策略决定)。pi 仅在 compat.sendSessionAffinityHeaders 为 true 时发送(openai-responses 只看格式),本下拉框会联动写入两个字段。auto=开启并按 URL 自动探测格式;off=显式关闭(模型级可覆盖 provider 的开启);openai=session_id/x-client-request-id/x-session-affinity;openai-nosession=x-client-request-id/x-session-affinity;openrouter=x-session-id。`,"models.compatHint.deferredToolsMode":`延迟工具的专用序列化格式。目前仅支持 kimi(Kimi 的 OpenAI 兼容 Chat Completions 格式)。`,"models.compatHint.cacheControlFormat":`提示缓存标记格式。目前仅支持 anthropic:在系统提示、最后一个工具定义及最后一条文本内容上添加 cache_control 标记。`,"models.inheritedFromProvider":`来自 provider(继承值,可在模型级覆盖)`,"models.thinkingFormatDeepseekHint":`选中 deepseek 时会额外写入 requiresReasoningContentOnAssistantMessages: true;选中其他值则移除。`,"models.samplingParams":`采样参数`,"models.headers":`请求头`,"models.modelOverrides":`模型覆盖`,"models.supportsDeveloperRole":`支持 developer role`,"models.supportsLongCacheRetention":`支持长缓存保留`,"models.supportsUsageInStreaming":`流式返回 token 用量`,"models.supportsFinishReason":`流式返回 finish_reason`,"models.supportsEagerToolInputStreaming":`工具输入流式预读`,"models.supportsCacheControlOnTools":`工具定义缓存控制`,"models.supportsTemperature":`支持 temperature 参数`,"models.requiresToolResultName":`工具结果需带 name`,"models.requiresAssistantAfterToolResult":`工具结果后需 assistant 消息`,"models.requiresThinkingAsText":`思考块转为文本`,"models.requiresReasoningContentOnAssistantMessages":`assistant 消息需 reasoning_content`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`支持思考 token 预算`,"models.supportsOpenAIGrammarTools":`支持 OpenAI 语法工具`,"models.supportsToolSearch":`支持工具搜索`,"models.supportsExplicitPromptCacheMode":`显式提示缓存模式`,"models.forceAdaptiveThinking":`强制自适应思考`,"models.allowEmptySignature":`允许空思考签名`,"models.supportsStrictTools":`严格工具 schema`,"models.supportsStore":`支持 store 参数`,"models.supportsReasoningEffort":`支持 reasoning_effort`,"models.supportsStrictMode":`严格模式`,"models.supportsToolReferences":`支持工具引用`,"models.maxTokensField":`最大 token 字段`,"models.sessionAffinityFormat":`会话亲和`,"models.deferredToolsMode":`延迟工具模式`,"models.cacheControlFormat":`缓存控制格式`,"models.thinkingFormat":`思考格式`,"models.chatTemplateKwargs":`聊天模板 kwargs`,"models.chatTemplateArgs":`聊天模板 args`,"models.openRouterRouting":`OpenRouter 路由`,"models.vercelGatewayRouting":`Vercel 网关路由`,"models.thinkingLevelMap":`思考级别`,"models.thinkingLevelMapReset":`重置(清空)`,"models.thinkingLevelMapResetHint":`清空整个 thinkingLevelMap:off、minimal、low、medium、high 回落各自默认,xhigh、max 默认禁用。`,"models.thinkingLevelMapNone":`全部禁用`,"models.contextWindow":`上下文窗口(tokens)`,"models.maxOutputTokens":`最大输出 tokens`,"models.costPerMillion":`成本(每百万 tokens)`,"models.cost.input":`输入`,"models.cost.output":`输出`,"models.cost.cacheRead":`缓存读取`,"models.cost.cacheWrite":`缓存写入`,"models.costNotSet":`未设置`,"models.costAllRequired":`四项费率必须全部填写`,"models.costClear":`清除`,"models.apiKeyPlaceholder":`ENV_VAR_NAME、!shell-command 或字面密钥`,"models.apiKeyHint":`字面量密钥在保存时自动写入 auth.json(与 CLI /login 共享,优先于此处配置);以 ! 开头的 shell 命令和 $ENV 插值保留在 models.json。`,"models.authJsonConnected":`已通过 auth.json 提供密钥`,"models.authJsonRemove":`移除`,"models.apiKeyPrompt":`输入 {provider} 的 API 密钥以启用 {count} 个模型。`,"models.oauthAlreadyConnected":`已连接。可重新登录或断开连接。`,"models.oauthConnectPrompt":`连接你的 {provider} 账户。`,"models.enterValue":`输入值…`,"models.displayNamePlaceholder":`显示名称`,"models.connectionLost":`连接已断开`,"models.networkError":`网络错误`,"i18n.testingModel":`正在测试模型连接...`,"i18n.connected":`已连接`,"i18n.failed":`失败`,"i18n.test":`测试`,"i18n.testConnection":`测试模型连接`,"i18n.provider":`Provider`,"i18n.providers":`提供商`,"i18n.model":`模型`,"i18n.providerName":`名称`,"i18n.rename":`重命名`,"i18n.default":`默认`,"i18n.disabled":`已禁用`,"plugins.statusLoaded":`已加载并生效`,"plugins.statusInstalled":`已安装,尚未加载`,"plugins.statusDisabled":`已禁用`,"plugins.statusMissing":`已配置但包未找到`,"plugins.extensionFilters":`扩展过滤`,"plugins.filterRules":`过滤规则`,"plugins.managePlugins":`插件管理`,"plugins.extensionFiltersHint":`对 ~/.pi/agent/extensions/ 与 .pi/extensions/ 自动发现目录内扩展的过滤规则。仅以 !、+、- 开头的规则生效;纯路径填写无效。`,"plugins.noExtensionFilters":`未配置过滤规则`,"plugins.addFilter":`添加过滤`,"plugins.filterPatternLabel":`规则`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`规则必须以 !、+ 或 - 开头;纯路径在 extensions 字段中无效。`,"plugins.filterPrefixExclude":`排除匹配的扩展`,"plugins.filterPrefixForceInclude":`强制包含精确路径`,"plugins.filterPrefixForceExclude":`强制排除精确路径`,"plugins.filterEffect":`效果`,"plugins.removeFilter":`移除过滤`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`包已安装。`,"plugins.packageUpdated":`包已更新。`,"plugins.packageRemoved":`包已移除。`,"plugins.packageDisabled":`包已禁用。`,"plugins.packageEnabled":`包已启用。`,"plugins.extensionFilterAdded":`扩展过滤已添加。`,"plugins.extensionFilterRemoved":`扩展过滤已移除。`,"plugins.sessionReloaded":`会话已重载。`,"i18n.noResources":`没有资源`,"i18n.unknown":`未知`,"i18n.installedVersion":`已安装 {version}`,"i18n.configuredVersion":`已配置 {version}`,"i18n.extensions":`扩展`,"i18n.prompts":`提示词`,"i18n.themes":`主题`,"i18n.resourceCount":`{count}{label}`,"i18n.extensionShort":`扩展`,"i18n.versionShort":`版本`,"i18n.skillShort":`技能`,"i18n.promptShort":`提示词`,"i18n.themeShort":`主题`,"i18n.custom":`自定义`,"i18n.clearAll":`清除全部`,"i18n.connectedSuccessfully":`连接成功。`,"i18n.notConnected":`未连接`,"i18n.configured":`已配置`,"i18n.notConfigured":`未配置`,"i18n.openingBrowser":`正在打开浏览器…`,"i18n.submit":`提交`,"i18n.login":`登录`,"i18n.relogin":`重新登录`,"i18n.disconnect":`断开连接`,"i18n.networkError":`网络错误`,"i18n.continuing":`继续中…`,"i18n.skills":`技能`,"i18n.plugins":`插件`,"i18n.addSkill":`添加技能`,"i18n.addPlugin":`添加插件`,"i18n.recommendedPlugins":`推荐插件`,"i18n.selectSkill":`选择技能`,"i18n.selectPackage":`选择包`,"i18n.configBindings":`绑定的配置文件`,"i18n.addBinding":`添加`,"i18n.configFileNote":`备注(可选)`,"i18n.bindConfigFile":`绑定配置文件`,"i18n.selectFile":`选择文件`,"i18n.noConfigBindings":`尚未绑定配置文件`,"i18n.noFiles":`没有文件`,"i18n.allFiles":`全部文件`,"i18n.filterByType":`按类型筛选`,"i18n.removeBinding":`删除绑定`,"i18n.confirm":`确认`,"i18n.updateAvailable":`有可用更新`,"i18n.upToDate":`已是最新`,"i18n.automaticChecksUnavailable":`自动检查不可用`,"i18n.checkFailed":`检查失败`,"i18n.installed":`已安装`,"i18n.status":`状态`,"i18n.version":`版本`,"i18n.package":`包`,"i18n.resources":`资源`,"i18n.installedPath":`安装路径`,"i18n.readme":`README`,"i18n.readmeDetails":`详情`,"i18n.unsafeLinkBlocked":`已阻止不安全链接(仅允许同目录或子目录的相对链接):{href}`,"i18n.resolvedResources":`已解析资源`,"i18n.reloadSession":`重新加载会话`,"i18n.reloading":`重新加载中...`,"i18n.packageRemoved":`包已移除。`,"i18n.packageInstalled":`包已安装。`,"i18n.packageUpdated":`包已更新。`,"i18n.packageDisabled":`包已禁用。`,"i18n.packageEnabled":`包已启用。`,"i18n.sessionReloaded":`会话已重新加载。`,"i18n.thinking":`思考`,"i18n.loadingThinking":`正在加载思考内容...`,"i18n.copyMessage":`复制消息`,"i18n.editFromHere":`从此处编辑`,"i18n.editFromHereTitle":`从此处编辑,此会话内创建分支`,"i18n.newSession":`新会话`,"i18n.newSessionTitle":`新会话,从此处创建独立副本`,"i18n.estimatedTokens":`流式输出期间的估算 Token 数`,"i18n.noOutput":`(无输出)`,"i18n.noSummary":`(无摘要)`,"i18n.conversationCompacted":`会话已压缩`,"i18n.compactionDescription":`此处之前的会话历史已压缩为以下摘要:`,"i18n.fileContext":`文件上下文:{details}`,"i18n.readFiles":`读取的文件`,"i18n.modifiedFiles":`修改的文件`,"i18n.hiddenExtensionMessage":`隐藏的扩展消息`,"i18n.noMessage":`(无消息)`,"i18n.showExtensionMessage":`显示扩展消息`,"i18n.collapse":`收起`,"i18n.expand":`展开`,"i18n.hideDetails":`隐藏详情`,"i18n.showDetails":`显示详情`,"i18n.thinkingUnavailable":`思考内容不可用`,"i18n.thinkingEncrypted":`思考内容已加密(提供方加密,仅用于上下文连续,无法显示明文)`,"i18n.before":`之前`,"i18n.after":`之后`}},Ae=new Map;function je(e){if(!e.id.trim())throw Error(`Locale id must not be empty`);if(Ae.has(e.id))throw Error(`Locale already registered: ${e.id}`);Ae.set(e.id,e)}function Me(e){return Ae.get(e)}function Ne(){return[...Ae.keys()]}function Pe(e){for(let t of e){let e=t.toLowerCase();if(e===`en`||e.startsWith(`en-`))return`en`;if(e===`zh`||e.startsWith(`zh-`))return`zh-CN`}return`en`}je(Oe),je(ke);var Fe=`pi-locale`,Ie=`en`,Le=(0,d.createContext)(null);function Re(){return Object.fromEntries(Ne().flatMap(e=>{let t=Me(e);return t?[[e,t.messages]]:[]}))}function ze(){try{let e=window.localStorage.getItem(Fe);if(e===`en`||e===`zh-CN`)return e}catch{}return null}function Be({children:e,initialLocale:t=null}){let[n,r]=(0,d.useState)(()=>typeof window>`u`?t??Ie:ze()??t??Pe(window.navigator.languages.length?window.navigator.languages:[window.navigator.language])),i=(0,d.useMemo)(()=>Ne().map(e=>Me(e)).filter(e=>!!e),[]),a=(0,d.useMemo)(()=>Re(),[]),o=(0,d.useCallback)(e=>{if(Me(e)){r(e),document.documentElement.lang=e;try{window.localStorage.setItem(Fe,e)}catch{}fetch(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{locale:e}})}).catch(e=>console.error(`[pi-web] save locale:`,e))}},[]),s=(0,d.useCallback)((e,t)=>Ee(n,e,a,t),[n,a]),c=(0,d.useMemo)(()=>({locale:n,setLocale:o,t:s,supportedLocales:i}),[n,o,s,i]);return(0,F.jsx)(Le.Provider,{value:c,children:e})}function I(){let e=(0,d.useContext)(Le);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}var Ve=`(max-width: 640px)`;function He(e){if(typeof window>`u`||!window.matchMedia)return()=>{};let t=window.matchMedia(Ve);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function Ue(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(Ve).matches}function We(){return!1}function Ge(){return(0,d.useSyncExternalStore)(He,Ue,We)}var Ke=null;function qe(e){Ke=e}function Je(e){let{onNewSession:t,activeCwd:n}=e;(0,d.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(!Ke)return;let t=e.target?.tagName;if(t===`TEXTAREA`||t===`INPUT`)return;e.preventDefault(),Ke();return}if(e.key===`n`&&e.ctrlKey&&e.altKey){if(!n||!t)return;e.preventDefault(),t(n)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,t])}function Ye(){let[e,t]=(0,d.useState)(()=>typeof Notification>`u`?`unsupported`:Notification.permission);return(0,d.useEffect)(()=>{if(typeof Notification>`u`)return;let e=!1,n,r=()=>{e||t(Notification.permission)};return typeof navigator.permissions?.query==`function`&&navigator.permissions.query({name:`notifications`}).then(t=>{e||(n=t,r(),t.addEventListener(`change`,r))}).catch(()=>{}),()=>{e=!0,n?.removeEventListener(`change`,r)}},[]),e}function Xe(e){let{fetcher:t,ttlMs:n=6e4}=e,r=null,i=null,a=0,o=null,s=new Set,c=()=>{for(let e of[...s])try{e()}catch{}},l=async e=>{try{let o=await t(e);return r=o,i=null,a=Date.now()+n,o}catch(e){throw i=e instanceof Error?e.message:String(e),e}finally{o=null}},u=e=>(o||=l(e).then(e=>(c(),e)),o),d=(e,t)=>new Promise((n,r)=>{if(e.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=()=>r(new DOMException(`Aborted`,`AbortError`));e.addEventListener(`abort`,i,{once:!0}),t.then(n,r).finally(()=>e.removeEventListener(`abort`,i))});return{get:()=>r,getError:()=>i,load:e=>{if(r!==null&&Date.now()<a)return Promise.resolve(r);let t=u(!1);return e?d(e,t):t},refresh:e=>{a=0;let t=u(!0);return e?d(e,t):t},subscribe:e=>(s.add(e),()=>s.delete(e)),clear:()=>{r=null,i=null,a=0}}}async function Ze(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(`HTTP ${n.status}`);return await n.json()}function Qe(){return`/api/sessions`}var $e=Xe({fetcher:()=>Ze(`/api/models`)}),et=Xe({fetcher:()=>Ze(Qe(),{cache:`no-store`})}),tt=Xe({fetcher:()=>Ze(`/api/preferences`)}),nt=Xe({fetcher:()=>Ze(`/api/models-config`)}),rt=Xe({fetcher:()=>Ze(`/api/plugins/global`)}),it=null;function at(e){it=e}var ot=Xe({fetcher:e=>{let t=it?`?cwd=${encodeURIComponent(it)}`:``;return Ze(`/api/updates${t}${t?`&`:`?`}refresh=${e?`1`:`0`}`)}}),st=Xe({fetcher:e=>Ze(`/api/skills/global`,e?{cache:`no-store`}:void 0)}),ct=Xe({fetcher:e=>Ze(`/api/commands/global`,e?{cache:`no-store`}:void 0)}),lt=Xe({fetcher:()=>Ze(`/api/model-thinking`)}),ut=Xe({fetcher:async()=>{let[e,t]=await Promise.all([Ze(`/api/auth/providers`),Ze(`/api/auth/all-providers`)]);return{oauth:e.providers,apiKey:t.providers}}});function dt(){return`/api/preferences`}var ft=new Map,pt=2e3;function mt(e){let t=JSON.stringify(e),n=Date.now(),r=ft.get(t);r!==void 0&&n-r<pt||(ft.set(t,n),fetch(dt(),{method:`PUT`,headers:{"Content-Type":`application/json`},body:t}).catch(e=>console.error(`[pi-web] save preferences:`,e)).finally(()=>{tt.refresh().catch(e=>console.error(`[pi-web] refresh preferences:`,e))}))}var ht={defaultModel:``,defaultThinking:``};function gt(){let[e,t]=(0,d.useState)(()=>tt.get()?.defaultThinkingLevel??``);(0,d.useEffect)(()=>tt.subscribe(()=>t(tt.get()?.defaultThinkingLevel??``)),[]),(0,d.useEffect)(()=>{e&&mt({firstPaint:{defaultThinkingLevel:e}})},[e]);let n=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.compaction??null),r=(0,d.useMemo)(()=>JSON.stringify(n),[n]);(0,d.useEffect)(()=>{r&&mt({firstPaint:{compaction:tt.get()?.compaction??null}})},[r]);let i=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.retry??null),a=(0,d.useMemo)(()=>JSON.stringify(i),[i]);(0,d.useEffect)(()=>{a&&mt({firstPaint:{retry:tt.get()?.retry??null}})},[a]);let[o,s]=(0,d.useState)(()=>tt.get()?.defaultProjectTrust??``);(0,d.useEffect)(()=>tt.subscribe(()=>s(tt.get()?.defaultProjectTrust??``)),[]),(0,d.useEffect)(()=>{o&&mt({firstPaint:{defaultProjectTrust:o}})},[o]);let c=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.subagents??ht),l=(0,d.useMemo)(()=>({defaultModel:c.defaultModel??``,defaultThinking:c.defaultThinking??``}),[c]);return(0,d.useEffect)(()=>{!l.defaultModel&&!l.defaultThinking||mt({firstPaint:{subagents:{defaultModel:l.defaultModel||void 0,defaultThinking:l.defaultThinking||void 0}}})},[l]),{defaultThinkingLevel:e,setDefaultThinkingLevel:t,compaction:n,retry:i,defaultProjectTrust:o,setDefaultProjectTrust:s,subagents:l}}var _t=`pi-web-auto-reload-seconds`,vt=3600;function yt(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isInteger(n)||n<0||n>3600?null:n}function bt(){if(typeof window>`u`)return 0;let e=window.localStorage.getItem(_t);if(e===null)return 0;let t=yt(e);return t===null?0:t}var xt=`pi-web-long-block-recent-expanded`;function St(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<0||n>20?null:n}function Ct(){if(typeof window>`u`)return 0;try{return St(window.localStorage.getItem(`pi-web-long-block-recent-expanded`)??``)??0}catch{return 0}}function wt(e,t,n,r){return e===`toolCall`?`tool:${n}`:`thinking:${t}:${r}`}var Tt=`pi-web-notify-events`,Et={taskComplete:!0,errors:!0,questions:!0,notifyWhileActive:!1};function Dt(){if(typeof window>`u`)return Et;try{let e=window.localStorage.getItem(Tt);if(!e)return Et;let t=JSON.parse(e);return{taskComplete:t.taskComplete??Et.taskComplete,errors:t.errors??Et.errors,questions:t.questions??Et.questions,notifyWhileActive:t.notifyWhileActive??Et.notifyWhileActive}}catch{return Et}}function Ot(e){window.localStorage.setItem(Tt,JSON.stringify(e))}var kt=`pluginConfigBindings`;function At(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(kt);if(!e)return{};let t=JSON.parse(e);if(t&&typeof t==`object`)return t}catch{}return{}}var jt=1e3,Mt=`pi-web-scroll-step-px`;function Nt(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<1||n>1e3?null:n}function Pt(){if(typeof window>`u`)return 200;try{return Nt(window.localStorage.getItem(`pi-web-scroll-step-px`)??``)??200}catch{return 200}}var Ft=`pi-web-font-scale`,It=1,Lt=19.2;function Rt(){let[e,t]=(0,d.useState)(()=>{if(typeof window>`u`)return It;let e=window.localStorage.getItem(Ft),t=e===null?NaN:Number(e);return Number.isFinite(t)&&t>=.85&&t<=1.3?t:It}),[n,r]=(0,d.useState)(()=>Pt()),[i,a]=(0,d.useState)(()=>bt()),[o,s]=(0,d.useState)(()=>Ct()),[c,l]=(0,d.useState)(()=>Dt());(0,d.useEffect)(()=>{Ot(c),mt({preferences:{notifyEvents:c}})},[c]);let[u,f]=(0,d.useState)(()=>At()),p=(0,d.useCallback)((e,t)=>{f(n=>{let r=n[e]??[];return r.some(e=>e.path===t.path)?n:{...n,[e]:[...r,t]}})},[]),m=(0,d.useCallback)((e,t)=>{f(n=>{let r=n[e];if(!r)return n;let i=r.filter(e=>e.path!==t),a={...n};return i.length===0?delete a[e]:a[e]=i,a})},[]);return(0,d.useEffect)(()=>{try{window.localStorage.setItem(kt,JSON.stringify(u))}catch{}mt({preferences:{pluginConfigBindings:u}})},[u]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(_t,String(i))}catch{}mt({preferences:{autoReloadSeconds:i}})},[i]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(Mt,String(n))}catch{}mt({preferences:{minimapScrollStepPx:n}})},[n]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(xt,String(o))}catch{}mt({preferences:{recentBlocksExpanded:o}})},[o]),(0,d.useEffect)(()=>{document.documentElement.style.fontSize=`${e*Lt}px`;try{window.localStorage.setItem(Ft,String(e))}catch{}mt({firstPaint:{fontScale:e}})},[e]),{fontScale:e,setFontScale:t,scrollStepPx:n,setScrollStepPx:r,autoReloadSeconds:i,setAutoReloadSeconds:a,recentBlocksExpanded:o,setRecentBlocksExpanded:s,notifyEvents:c,setNotifyEvents:l,pluginConfigBindings:u,addPluginConfigBinding:p,removePluginConfigBinding:m}}var zt=[{label:{en:`Explore project`,"zh-CN":`阅读项目`},message:{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`}},{label:{en:`Review workspace changes`,"zh-CN":`审查工作区改动`},message:{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`审查当前工作区的所有改动,指出潜在问题与改进点。`}},{label:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},message:{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}}];function Bt(e,t){return typeof e==`string`?e:t===`zh-CN`?e[`zh-CN`]??e.zh??e.en??``:e.en??e[`zh-CN`]??e.zh??``}function Vt(e){let t=e.trim();return{en:t,"zh-CN":t}}function Ht(e,t,n){let r=t.trim();if(typeof e==`string`){let t=e.trim();return n===`zh-CN`?{en:t,"zh-CN":r}:{en:r,"zh-CN":t}}let i=typeof e.en==`string`?e.en:``,a=e[`zh-CN`]??e.zh??i;return n===`zh-CN`?{en:i,"zh-CN":r}:{en:r,"zh-CN":a}}function Ut(e,t){let n=Bt(e,`en`),r=Bt(e,`zh-CN`),i=Bt(t,`en`),a=Bt(t,`zh-CN`);return n===i||r===a}var Wt={阅读项目:{en:`Explore project`,"zh-CN":`阅读项目`},review工作区改动:{en:`Review workspace changes`,"zh-CN":`review工作区改动`},寻找并修复bug:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},"阅读当前项目,总结整体目录结构与核心模块的职责。":{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`},"review 当前工作区的所有改动,指出潜在问题与改进点。":{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`review 当前工作区的所有改动,指出潜在问题与改进点。`},"检查当前代码,寻找并修复其中存在的 bug。":{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}};function Gt(e){if(typeof e==`string`){let t=e.trim();return t===``?null:Wt[t]??Vt(t)}if(typeof e==`object`&&e){let t=e,n=t.en,r=t[`zh-CN`]??t.zh,i=typeof n==`string`?n.trim():``,a=typeof r==`string`?r.trim():``;return i===``&&a===``?null:{en:i===``?a:i,"zh-CN":a===``?i:a}}return null}function Kt(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let{label:e,message:r,allowAppend:i}=n,a=Gt(e),o=Gt(r);if(!a||!o)continue;let s={label:a,message:o};i===!0&&(s.allowAppend=!0),t.push(s)}return t}function qt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``)continue;let e=Kt(r);e&&e.length>0&&(t[n]=e)}return t}function Jt({put:e}){let[t,n]=(0,d.useState)(()=>Kt(tt.get()?.preferences?.startScreenMessages)??zt),r=(0,d.useCallback)(e=>{if(t.some(t=>Ut(t.label,e.label))){let t=typeof e.label==`string`?e.label:e.label?.en??e.label[`zh-CN`]??JSON.stringify(e.label);throw Error(`Name conflict: "${t}"`)}n(t=>[...t,e])},[t]),i=(0,d.useCallback)(e=>{n(t=>e<0||e>=t.length?t:t.filter((t,n)=>n!==e))},[]),a=(0,d.useCallback)((e,r)=>{if(t.some((t,n)=>n!==e&&Ut(t.label,r.label))){let e=typeof r.label==`string`?r.label:r.label?.en??r.label[`zh-CN`]??JSON.stringify(r.label);throw Error(`Name conflict: "${e}"`)}n(t=>{if(e<0||e>=t.length)return t;let n=[...t];return n[e]=r,n})},[t]),o=(0,d.useCallback)(()=>{n(e=>{let t=e.filter(e=>!zt.some(t=>Ut(t.label,e.label)));return[...zt,...t]})},[]);return(0,d.useEffect)(()=>tt.subscribe(()=>n(Kt(tt.get()?.preferences?.startScreenMessages)??zt)),[]),(0,d.useEffect)(()=>{e({preferences:{startScreenMessages:t}})},[t,e]),{startScreenMessages:t,addStartScreenMessage:r,removeStartScreenMessage:i,updateStartScreenMessage:a,resetStartScreenMessages:o}}function Yt(e){return typeof e==`number`&&Number.isFinite(e)}function Xt(e){if(typeof e!=`object`||!e)return null;let{x:t,y:n,width:r,height:i,collapsed:a}=e;return!Yt(t)||!Yt(n)||!Yt(r)||r<=0||!Yt(i)||i<=0?null:{x:t,y:n,width:r,height:i,collapsed:typeof a==`boolean`?a:void 0}}function Zt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``)continue;let e=Xt(r);e&&(t[n]=e)}return t}function Qt(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function $t({put:e}){let[t,n]=(0,d.useState)(()=>Zt(tt.get()?.preferences?.widgets)??{}),r=(0,d.useRef)(!1),[i,a]=(0,d.useState)(()=>qt(tt.get()?.preferences?.widgetMessages)??{}),[o,s]=(0,d.useState)(()=>Qt(tt.get()?.preferences?.workspaces));(0,d.useEffect)(()=>{let e=!1;return tt.load().then(()=>{if(e)return;r.current=!0;let t=tt.get()?.preferences;n(Zt(t?.widgets)??{}),a(qt(t?.widgetMessages)??{}),s(Qt(t?.workspaces))}).catch(()=>{r.current=!0}),()=>{e=!0}},[]);let c=(0,d.useCallback)((e,t)=>{n(n=>{let r=n[e];return r&&r.x===t.x&&r.y===t.y&&r.width===t.width&&r.height===t.height&&r.collapsed===t.collapsed?n:{...n,[e]:t}})},[]);(0,d.useEffect)(()=>{r.current&&e({preferences:{widgets:t}})},[t,e]);let l=(0,d.useCallback)((e,t)=>{if((i[e]??[]).some(e=>Ut(e.label,t.label))){let e=typeof t.label==`string`?t.label:t.label?.en??t.label[`zh-CN`]??JSON.stringify(t.label);throw Error(`Name conflict: "${e}"`)}a(n=>({...n,[e]:[...n[e]??[],t]}))},[i,a]),u=(0,d.useCallback)((e,t)=>{a(n=>{let r=n[e];if(!r||t<0||t>=r.length)return n;let i={...n},a=r.filter((e,n)=>n!==t);return a.length===0?delete i[e]:i[e]=a,i})},[a]),f=(0,d.useCallback)((e,t,n)=>{if((i[e]??[]).some((e,r)=>r!==t&&Ut(e.label,n.label))){let e=typeof n.label==`string`?n.label:n.label?.en??n.label[`zh-CN`]??JSON.stringify(n.label);throw Error(`Name conflict: "${e}"`)}a(r=>{let i=r[e];if(!i||t<0||t>=i.length)return r;let a={...r},o=[...i];return o[t]=n,a[e]=o,a})},[i,a]);return(0,d.useEffect)(()=>{r.current&&e({preferences:{widgetMessages:i}})},[i,e]),{widgetGeometries:t,widgetMessages:i,savedWorkspaces:o,setWidgetGeometry:c,addWidgetMessage:l,removeWidgetMessage:u,updateWidgetMessage:f,handleSavedWorkspacesChange:(0,d.useCallback)(t=>{s(t),e({preferences:{workspaces:t}})},[s,e])}}function en({isDark:e,toggleTheme:t}){let{fontScale:n,setFontScale:r,scrollStepPx:i,setScrollStepPx:a,autoReloadSeconds:o,setAutoReloadSeconds:s,recentBlocksExpanded:c,setRecentBlocksExpanded:l,notifyEvents:u,setNotifyEvents:f,pluginConfigBindings:p,addPluginConfigBinding:m,removePluginConfigBinding:h}=Rt(),{widgetGeometries:g,widgetMessages:_,savedWorkspaces:v,setWidgetGeometry:y,addWidgetMessage:b,removeWidgetMessage:x,updateWidgetMessage:S,handleSavedWorkspacesChange:C}=$t({put:mt}),{startScreenMessages:w,addStartScreenMessage:T,removeStartScreenMessage:E,updateStartScreenMessage:D,resetStartScreenMessages:O}=Jt({put:mt}),{defaultThinkingLevel:k,setDefaultThinkingLevel:A,compaction:j,retry:M,defaultProjectTrust:N,setDefaultProjectTrust:ee,subagents:te}=gt();return tt.load().catch(e=>console.error(`[pi-web] load preferences:`,e)),{settingsValue:(0,d.useMemo)(()=>({isDark:e,toggleTheme:t,fontScale:n,setFontScale:r,scrollStepPx:i,setScrollStepPx:a,autoReloadSeconds:o,setAutoReloadSeconds:s,recentBlocksExpanded:c,setRecentBlocksExpanded:l,notifyEvents:u,setNotifyEvents:f,widgetGeometries:g,setWidgetGeometry:y,widgetMessages:_,addWidgetMessage:b,removeWidgetMessage:x,updateWidgetMessage:S,startScreenMessages:w,addStartScreenMessage:T,removeStartScreenMessage:E,updateStartScreenMessage:D,resetStartScreenMessages:O,pluginConfigBindings:p,addPluginConfigBinding:m,removePluginConfigBinding:h}),[e,t,n,i,o,c,u,g,y,_,b,x,S,w,T,E,D,O,p,m,h,s,r,f,l,a]),defaultThinkingLevel:k,setDefaultThinkingLevel:A,compaction:j,retry:M,defaultProjectTrust:N,setDefaultProjectTrust:ee,subagents:te,savedWorkspaces:v,handleSavedWorkspacesChange:C,widgetGeometries:g,setWidgetGeometry:y,widgetMessages:_,addWidgetMessage:b,removeWidgetMessage:x,updateWidgetMessage:S,fontScale:n,setFontScale:r}}function tn({projectTrustCwd:e,onTrusted:t}){let[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(r(null),a(!1),l(null),!e)return;let t=new AbortController,n=new URLSearchParams(window.location.search).get(`piE2eTrustCwd`);return fetch(`/api/project-trust?cwd=${encodeURIComponent(e)}${n?`&piE2eTrustCwd=${encodeURIComponent(n)}`:``}`,{signal:t.signal}).then(async e=>{let t=await e.json();if(!e.ok||t.error)throw Error(t.error??`HTTP ${e.status}`);r(t)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||console.error(`Failed to load project trust:`,e)}),()=>t.abort()},[e]),{projectTrust:n,projectTrustDialogOpen:i,setProjectTrustDialogOpen:a,projectTrustBusy:o,projectTrustError:c,setProjectTrustError:l,handleTrustProject:(0,d.useCallback)(async()=>{if(!(!e||o)){s(!0),l(null);try{let n=await fetch(`/api/project-trust`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:e})}),i=await n.json();if(!n.ok||i.error)throw Error(i.error??`HTTP ${n.status}`);r(i),a(!1),t?.()}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}},[o,e,t])}}var nn=class extends Error{constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.body=n}},rn=[],an=1,on=new Set;function sn(){for(let e of on)e()}function cn(e){return on.add(e),()=>{on.delete(e)}}function ln(){return rn}function un(e){let t={id:an++,label:e??``};rn=[...rn,t],sn();let n=!1;return()=>{n||(n=!0,rn=rn.filter(e=>e.id!==t.id),sn())}}var dn=new WeakMap;function fn(e){if(!e.isConnected)return()=>{};let t=dn.get(e);if(!t){let n=document.createElement(`div`);n.style.cssText=`position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--bg) 50%, transparent);z-index:5;`,n.innerHTML=`<div style="width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--text-dim);border-radius:50%;animation:spin 0.8s linear infinite;"></div>`;let r=null;getComputedStyle(e).position===`static`&&(r=e.style.position,e.style.position=`relative`),e.appendChild(n),t={count:0,el:n,prevPosition:r},dn.set(e,t)}t.count++;let n=!1;return()=>{n||(n=!0,t.count--,t.count<=0&&(t.el.remove(),t.prevPosition!==null&&(t.prevPosition?e.style.position=t.prevPosition:e.style.removeProperty(`position`)),dn.delete(e)))}}async function pn(e){try{return await e.json()}catch{return null}}function mn(e,t){return e===`fullscreen`?un(t):e instanceof HTMLElement?fn(e):null}function hn(e,t){return e instanceof Error?e.message:t}function gn(e,t){return e&&typeof e==`object`&&`error`in e&&typeof e.error==`string`?e.error:`HTTP ${t}`}async function _n(e,t,n){let r=mn(n?.loading??`fullscreen`,n?.label);try{let n;try{n=await fetch(e,t)}catch(e){throw new nn(hn(e,`Network error`),0)}if(!n.ok){let e=await pn(n);throw new nn(gn(e,n.status),n.status,e)}let r=await n.text();return r?JSON.parse(r):void 0}catch(e){throw e instanceof nn?e:new nn(hn(e,String(e)),0)}finally{r?.()}}var vn=e=>window.history.replaceState(null,``,e);function yn(e){let{selectedSession:t,setSelectedSession:n,setNewSessionCwd:r,setSessionKey:i,setRefreshKey:a,hydrateSelectedSession:o,extensionDialogActiveRef:s,suppressCwdBumpRef:c,setInitialSessionRestored:l,onSessionSelected:u,onTopPanelReset:f}=e,p=(0,d.useCallback)((e,t=!1)=>{!t&&s.current||(r(null),n(e),i(e=>e+1),l(!0),t&&(c.current=!0),t||vn(`?session=${encodeURIComponent(e.id)}`),u?.(t))},[s,c,r,n,i,l,u]),m=(0,d.useCallback)(async(e,t)=>{await _n(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t})},{loading:`silent`}),n(null),r(t),i(e=>e+1),f?.(),u?.(!1),vn(`/`)},[u,f,r,n,i]),h=(0,d.useCallback)(e=>{r(null),n(e),a(e=>e+1),o(e.id),vn(`?session=${encodeURIComponent(e.id)}`)},[o,r,a,n]),g=(0,d.useCallback)((e,t)=>{n(n=>n&&n.id===e?{...n,name:t}:n),a(e=>e+1)},[a,n]),_=(0,d.useCallback)(()=>{l(!0)},[l]);return{handleSelectSession:p,handleNewSession:m,handleSessionCreated:h,handleSessionRenamed:g,handleSessionForked:(0,d.useCallback)(e=>{a(e=>e+1),i(e=>e+1),r(null),n(t=>({...t??{path:``,cwd:``,created:``,modified:``,messageCount:0,firstMessage:``},id:e})),o(e),vn(`?session=${encodeURIComponent(e)}`)},[o,r,a,n,i]),handleSessionDeleted:(0,d.useCallback)(e=>{if(a(e=>e+1),t?.id===e){let e=t.cwd;n(null),r(e??null),i(e=>e+1),f?.(),vn(`/`)}},[t,f,r,a,n,i]),handleInitialRestoreDone:_}}function bn(){let[e,t]=(0,d.useState)(0),[n,r]=(0,d.useState)(0),[i,a]=(0,d.useState)(0),[o,s]=(0,d.useState)(0);return{refreshKey:e,setRefreshKey:t,sessionKey:n,setSessionKey:r,explorerRefreshKey:i,setExplorerRefreshKey:a,modelsRefreshKey:o,setModelsRefreshKey:s,handleAgentEnd:(0,d.useCallback)(()=>{t(e=>e+1),a(e=>e+1)},[]),handleExplorerRefresh:(0,d.useCallback)(()=>{a(e=>e+1)},[])}}var xn=e=>window.history.replaceState(null,``,e);function Sn({initialNavigation:e,onProjectSwitch:t,onSessionSelected:n,onTopPanelReset:r}){let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(()=>e.requestedCwd?`validating`:`idle`),[u,f]=(0,d.useState)(null),{refreshKey:p,setRefreshKey:m,sessionKey:h,setSessionKey:g,explorerRefreshKey:_,setExplorerRefreshKey:v,modelsRefreshKey:y,setModelsRefreshKey:b,handleAgentEnd:x,handleExplorerRefresh:S}=bn(),[C,w]=(0,d.useState)(()=>!e.sessionId),[T,E]=(0,d.useState)(null),D=(0,d.useRef)(null),O=(0,d.useRef)(!1),k=(0,d.useRef)(!1);(0,d.useEffect)(()=>{let t=e.requestedCwd;if(!t)return;let n=new AbortController;return l(`validating`),f(null),fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t}),signal:n.signal}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok||!t.cwd)throw Error(t.error??`HTTP ${e.status}`);O.current=!0,s(t.cwd),l(`ready`)}).catch(e=>{n.signal.aborted||(f(e instanceof Error?e.message:String(e)),l(`error`))}),()=>n.abort()},[e]);let A=o??(i===null&&T?T:null),j=i!==null||A!==null,M=i?.cwd??A,{projectTrust:N,projectTrustDialogOpen:ee,setProjectTrustDialogOpen:te,projectTrustBusy:P,projectTrustError:ne,setProjectTrustError:re,handleTrustProject:ie}=tn({projectTrustCwd:M,onTrusted:()=>{b(e=>e+1),g(e=>e+1)}}),{handleSelectSession:ae,handleNewSession:oe,handleSessionCreated:se,handleSessionRenamed:ce,handleSessionForked:le,handleSessionDeleted:ue,handleInitialRestoreDone:de}=yn({selectedSession:i,setSelectedSession:a,setNewSessionCwd:s,setSessionKey:g,setRefreshKey:m,hydrateSelectedSession:(0,d.useCallback)(e=>{et.load().then(t=>{let n=t.sessions.find(t=>t.id===e);n&&a(t=>t&&t.id===e&&!t.projectRoot?n:t)}).catch(e=>console.error(`[pi-web] hydrate session:`,e))},[]),extensionDialogActiveRef:k,suppressCwdBumpRef:O,setInitialSessionRestored:w,onSessionSelected:n,onTopPanelReset:r});return{selectedSession:i,setSelectedSession:a,newSessionCwd:o,effectiveNewSessionCwd:A,showChat:j,projectTrustCwd:M,refreshKey:p,setRefreshKey:m,explorerRefreshKey:_,setExplorerRefreshKey:v,modelsRefreshKey:y,setModelsRefreshKey:b,sessionKey:h,activeCwd:T,initialCwdStatus:c,initialCwdError:u,initialSessionRestored:C,projectTrust:N,projectTrustDialogOpen:ee,setProjectTrustDialogOpen:te,projectTrustBusy:P,projectTrustError:ne,setProjectTrustError:re,extensionDialogActiveRef:k,handleSelectSession:ae,handleNewSession:oe,handleSessionCreated:se,handleAgentEnd:x,handleSessionRenamed:ce,handleSessionForked:le,handleSessionDeleted:ue,handleSessionUnseen:(0,d.useCallback)(e=>{i?.id===e&&(a(null),g(e=>e+1),r?.(),xn(`/`))},[i,r,g]),handleCwdChange:(0,d.useCallback)((e,n)=>{if(E(e),!e)return;let r=n??e,o=D.current??(i?i.projectRoot??i.cwd:null);if(!o){D.current=r;return}if(D.current=r,O.current){O.current=!1;return}o!==r&&(i?i.projectRoot??i.cwd:null)!==r&&(a(null),s(t=>t&&t!==e?null:t),g(e=>e+1),t?.())},[i,t,s,g,a]),handleTrustProject:ie,handleExplorerRefresh:S,handleInitialRestoreDone:de}}var Cn=(0,d.createContext)(null);function wn({value:e,children:t}){return(0,F.jsx)(Cn.Provider,{value:e,children:t})}function Tn(){let e=(0,d.useContext)(Cn);if(!e)throw Error(`useSettings must be used within SettingsProvider`);return e}function En(e,t,n){let[r,i]=(0,d.useState)(()=>{try{let t=localStorage.getItem(e);if(t!==null){let e=JSON.parse(t);return n?n(e):e}}catch{}return typeof t==`function`?t():t});return(0,d.useEffect)(()=>{try{localStorage.setItem(e,JSON.stringify(r))}catch{}},[e,r]),[r,i]}var Dn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),On=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),kn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),An=e=>{let t=kn(e);return t.charAt(0).toUpperCase()+t.slice(1)},jn={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`},Mn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Nn=(0,d.createContext)({}),Pn=()=>(0,d.useContext)(Nn),Fn=(0,d.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:f=!1,color:p=`currentColor`,className:m=``}=Pn()??{},h=r??f?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...jn,width:t??l??jn.width,height:t??l??jn.height,stroke:e??p,strokeWidth:h,className:Dn(`lucide`,m,i),...!a&&!Mn(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),In=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(Fn,{ref:i,iconNode:t,className:Dn(`lucide-${On(An(e))}`,`lucide-${e}`,n),...r}));return n.displayName=An(e),n},Ln=In(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Rn=In(`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`}]]),zn=In(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Bn=In(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Vn=In(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Hn=In(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]]),Un=In(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Wn=In(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Gn=In(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Kn=In(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),qn=In(`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`}]]),Jn=In(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Yn=In(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Xn=In(`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`}]]),Zn=In(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),Qn=In(`file-text`,[[`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:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),$n=In(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),er=In(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`}]]),tr=In(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),nr=In(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),rr=In(`hard-drive-upload`,[[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),ir=In(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),ar=In(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),or=In(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),sr=In(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),cr=In(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),lr=In(`list-end`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M16 12H3`,key:`1a2rj7`}],[`path`,{d:`M9 19H3`,key:`s61nz1`}],[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M21 5v12a2 2 0 0 1-2 2h-6`,key:`hey24a`}]]),ur=In(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),dr=In(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),fr=In(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),pr=In(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),mr=In(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),hr=In(`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`}]]),gr=In(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),_r=In(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),vr=In(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),yr=In(`rotate-ccw-clock`,[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),br=In(`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`}]]),xr=In(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Sr=In(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Cr=In(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),wr=In(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Tr=In(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Er=In(`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`}]]),Dr=In(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Or=In(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),kr=In(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ar=In(`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`}]]),jr=In(`trash`,[[`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`}]]),Mr=In(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Nr=In(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Pr=In(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Fr=In(`volume-x`,[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]),Ir=In(`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`}]]),Lr=In(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Rr=In(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]);function zr(e){return{value:(0,d.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get(),()=>e.get()),error:e.getError()}}var Br=`pi-web`;function Vr(e,t){let n=Hr(e),r=Hr(t),i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=n[e]??0,i=r[e]??0;if(t>i)return 1;if(t<i)return-1}return 0}function Hr(e){return e.replace(/^v/i,``).split(/[-+]/)[0].split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t})}function Ur({current:e,latest:t},n){return t!==null&&t!==n&&Vr(t,e)>0}function Wr(e){return e.enabled!==!1}function Gr(e,t){return t[e]===`*`}function Kr(e){if(!Wr(e))return 0;let t=e.ignored??{};return+!!Ur(e.piWeb,t[`pi-web`])+e.plugins.filter(e=>!Gr(e.source,t)).length}function qr(e,t){if(!Wr(e))return[];let n=e.ignored??{},r=[];Ur(e.piWeb,n[`pi-web`])&&r.push(`pi-web`);let i=e.plugins.filter(e=>!Gr(e.source,n)).length;return i>0&&r.push(`${i} ${t}`),r}function Jr(e,t){let n=(0,d.useRef)(t);(n.current.length!==t.length||n.current.some((e,n)=>e!==t[n]))&&e(),n.current=t}var Yr=t(c(),1);function Xr({children:e}){return(0,F.jsx)(F.Fragment,{children:e})}function L({label:e,wrapperStyle:t,hoverOnly:n,children:r}){let i=(0,d.useRef)(null),a=(0,d.useRef)(null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),[u,f]=(0,d.useState)({top:0,left:0,placement:`bottom`});if((0,d.useLayoutEffect)(()=>{if(!e||!o||!c)return;let t=i.current?.getBoundingClientRect(),n=a.current;if(!t||!n)return;let r=n.offsetWidth,s=n.offsetHeight;if(!r)return;let l=t.left+t.width/2,u=r/2,d=window.innerWidth,p=window.innerHeight,m=Math.max(u+8,Math.min(l,d-u-8)),h=t.bottom+6+s<=p-8,g=t.top-6-s>=8,_=h||!g?`bottom`:`top`;f({top:_===`bottom`?t.bottom+6:t.top-6,left:m,placement:_})},[e,o,c]),!e)return(0,F.jsx)(F.Fragment,{children:r});let p=()=>{let e=i.current?.getBoundingClientRect();e&&f({top:e.bottom+6,left:e.left+e.width/2,placement:`bottom`})},m=()=>{p(),l(!0),s(!0)},h=()=>s(!1),g=c&&typeof document<`u`?(0,Yr.createPortal)((0,F.jsx)(`div`,{ref:a,role:`tooltip`,"data-slot":`tooltip-content`,style:{position:`fixed`,top:u.top,left:u.left,transform:u.placement===`top`?`translate(-50%, -100%)`:`translateX(-50%)`,zIndex:9999,width:`max-content`,maxWidth:`min(20rem, calc(100vw - 16px))`,whiteSpace:`pre-line`,overflowWrap:`break-word`,background:`var(--bg-panel)`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md, 6px)`,padding:`4px 8px`,fontSize:`var(--text-sm)`,lineHeight:1.5,boxShadow:`0 4px 16px -2px var(--shadow-strong)`,pointerEvents:`none`,display:o?`block`:`none`},children:e}),document.body):null;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{ref:i,"data-slot":`tooltip-trigger`,title:``,onPointerEnter:m,onPointerLeave:h,onMouseEnter:m,onMouseLeave:h,onFocus:n?void 0:m,onBlur:n?void 0:h,onPointerMove:e=>e.stopPropagation(),style:{display:`inline-flex`,...t},children:r}),g]})}function Zr({label:e,hint:t,children:n}){return(0,F.jsxs)(Qr,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,minWidth:0},children:[(0,F.jsx)(`span`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500,whiteSpace:`nowrap`},children:e}),t&&(0,F.jsx)(L,{label:t,children:(0,F.jsx)(`span`,{role:`img`,"aria-label":t,style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,cursor:`help`,lineHeight:1,flexShrink:0},children:`ⓘ`})})]}),(0,F.jsx)(`div`,{style:{flex:1,minWidth:0,maxWidth:320},children:n})]})}function Qr({children:e}){return(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`10px 14px`,border:`1px solid var(--border)`,borderRadius:10,background:`var(--bg-panel)`},children:e})}var $r=[{key:`enableAnalytics`,kind:`bool`},{key:`enableInstallTelemetry`,kind:`bool`,default:!0},{key:`httpProxy`,kind:`string`},{key:`trackingId`,kind:`string`},{key:`httpIdleTimeoutMs`,kind:`int`},{key:`websocketConnectTimeoutMs`,kind:`int`},{key:`branchSummary`,kind:`object`,fields:[{key:`reserveTokens`,kind:`int`},{key:`skipPrompt`,kind:`bool`}]},{key:`images`,kind:`object`,fields:[{key:`autoResize`,kind:`bool`,default:!0,hint:`preferences.pi.autoResizeHint`},{key:`blockImages`,kind:`bool`,hint:`preferences.pi.blockImagesHint`}]}],ei={};function ti(){let{t:e}=I(),t=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.piSettings??ei),n=e=>{_n(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{piSettings:e}})},{loading:`silent`}).finally(()=>void tt.refresh().catch(e=>console.error(`[pi-web] refresh preferences:`,e)))},r=(e,t)=>n({[e]:t}),i=(e,r,i)=>{let a=t[e]??{};n({[e]:{...a,[r]:i}})};return(0,F.jsx)(`div`,{style:{height:`100%`,overflowY:`auto`,padding:`18px 20px 40px`,display:`flex`,flexDirection:`column`,gap:8,maxWidth:640},children:$r.map(n=>(0,F.jsx)(ni,{spec:n,value:t[n.key],t:e,setValue:r,setSub:i},n.key))})}function ni({spec:e,value:t,t:n,setValue:r,setSub:i}){return(0,F.jsx)(Zr,{label:n(`preferences.pi.${e.key}`),hint:n(`preferences.pi.${e.key}Hint`),children:(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,width:`100%`},children:[e.kind===`bool`&&(0,F.jsx)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text-muted)`,whiteSpace:`nowrap`},children:(0,F.jsx)(`input`,{type:`checkbox`,checked:(t??e.default)===!0,onChange:t=>r(e.key,t.target.checked),"aria-label":n(`preferences.pi.${e.key}`)})}),e.kind===`string`&&(0,F.jsx)(ii,{value:typeof t==`string`?t:``,placeholder:n(`preferences.pi.unset`),onCommit:t=>r(e.key,t),ariaLabel:n(`preferences.pi.${e.key}`)}),e.kind===`int`&&(0,F.jsx)(ii,{value:typeof t==`number`?String(t):``,placeholder:n(`preferences.pi.unset`),numeric:!0,onCommit:t=>r(e.key,Number(t)),ariaLabel:n(`preferences.pi.${e.key}`)}),e.kind===`object`&&e.fields?.map(r=>(0,F.jsx)(ri,{sub:r,value:t?.[r.key],t:n,setSub:i,specKey:e.key},r.key))]})})}function ri({specKey:e,sub:t,value:n,t:r,setSub:i}){let a=n=>i(e,t.key,n),o=r(`preferences.pi.${t.key}`);return(0,F.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text-muted)`,whiteSpace:`nowrap`},children:[(0,F.jsx)(`span`,{style:{minWidth:120},children:o}),t.hint&&(0,F.jsx)(L,{label:r(t.hint),children:(0,F.jsx)(`span`,{role:`img`,"aria-label":r(t.hint),style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,cursor:`help`,lineHeight:1,flexShrink:0},children:`ⓘ`})}),t.kind===`bool`&&(0,F.jsx)(`input`,{type:`checkbox`,checked:(n??t.default)===!0,onChange:e=>a(e.target.checked),"aria-label":o}),t.kind===`string`&&(0,F.jsx)(ii,{value:typeof n==`string`?n:``,placeholder:r(`preferences.pi.unset`),onCommit:a,ariaLabel:o}),t.kind===`int`&&(0,F.jsx)(ii,{value:typeof n==`number`?String(n):``,placeholder:r(`preferences.pi.unset`),numeric:!0,onCommit:e=>a(Number(e)),ariaLabel:o})]})}function ii({value:e,placeholder:t,numeric:n,onCommit:r,ariaLabel:i}){let[a,o]=(0,d.useState)(e);return Jr(()=>o(e),[e]),(0,F.jsx)(`input`,{type:n?`number`:`text`,min:n?1:void 0,placeholder:t,value:a,onChange:e=>o(e.target.value),onBlur:()=>{let e=a.trim();if(e!==``){if(n){let t=Number(e);if(!Number.isInteger(t)||t<=0)return}r(e)}},"aria-label":i,style:{width:200,padding:`4px 6px`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`,color:`var(--text)`,background:`var(--bg-input)`,border:`1px solid var(--border)`,borderRadius:6,outline:`none`}})}var R={xs:10,sm:11,base:12,lg:13,xl:14,"2xl":15,"3xl":16,"4xl":18,"5xl":20},ai=1200,oi=320,si=420;function ci(e,t,n){return Math.round(Math.max(t,Math.min(Math.max(t,n),Number.isFinite(e)?e:t)))}function li(e){let{viewportWidth:t,rightPanelOpen:n,rightPanelWidth:r}=e;if(t<=640)return 480;let i=t<960,a=i?oi:si,o=!i&&n?r:0;return Math.min(480,t-a-o)}function ui(e){let{viewportWidth:t,sidebarOpen:n,sidebarWidth:r}=e;if(t<960)return ai;let i=n?r:0;return Math.min(ai,t-si-i)}var di={boxSizing:`border-box`,background:`var(--bg-input, var(--bg))`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:4,padding:`4px 8px`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`},fi={display:`flex`,alignItems:`center`,justifyContent:`center`,width:22,height:22,padding:0,background:`none`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,lineHeight:1,flexShrink:0};function pi({value:e,onChange:t,parse:n}){let[r,i]=(0,d.useState)(String(e));return Jr(()=>{i(String(e))},[e]),{draft:r,commit:e=>{i(e);let r=n(e);r!==null&&t(r)}}}function mi({tooltip:e=!1,offText:t,...n}){let{t:r,labelKey:i,unitText:a,rangeText:o,resetText:s,defaultValue:c,min:l,max:u}=n,{draft:d,commit:f}=pi(n),p=t!=null&&n.value===c?t:o,m=(0,F.jsx)(`input`,{type:`number`,min:l,max:u,step:1,value:d,onChange:e=>f(e.target.value),"aria-label":r(i),...e?{}:{title:p},style:{flex:1,minWidth:0,...di}}),h=(0,F.jsx)(`button`,{type:`button`,onClick:()=>n.onChange(c),"aria-label":s,...e?{}:{title:s},style:fi,children:`↺`});return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`},children:[e?(0,F.jsx)(L,{label:p,wrapperStyle:{flex:1,display:`flex`},children:m}):m,(0,F.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,whiteSpace:`nowrap`},children:a}),e?(0,F.jsx)(L,{label:s,children:h}):h]})}function hi({unitSuffix:e,offText:t,tooltip:n=!0,...r}){let{t:i,labelKey:a,rangeText:o,resetText:s,value:c,defaultValue:l,min:u,max:d}=r,{draft:f,commit:p}=pi(r);return(0,F.jsxs)(`div`,{role:`menu`,"aria-label":i(a),style:{background:`var(--bg-panel)`,borderLeft:`1px solid var(--border)`,borderRight:`1px solid var(--border)`,borderBottom:`1px solid var(--border)`,padding:`10px 12px 12px`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`var(--text-base)`,color:`var(--text-muted)`,marginBottom:8},children:[(0,F.jsx)(`span`,{children:i(a)}),(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,F.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600},children:[c,e]}),(()=>{let e=(0,F.jsx)(`button`,{type:`button`,onClick:()=>r.onChange(l),"aria-label":s,...n?{}:{title:s},style:fi,children:`↺`});return n?(0,F.jsx)(L,{label:s,children:e}):e})()]})]}),(0,F.jsx)(`input`,{type:`number`,min:u,max:d,step:1,value:f,onChange:e=>p(e.target.value),"aria-label":i(a),style:{width:`100%`,...di}}),(0,F.jsx)(`div`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginTop:4,textAlign:`center`},children:t!=null&&c===l?t:o})]})}function gi({value:e,onChange:t,t:n,embedded:r}){let i={value:e,onChange:t,parse:Nt,min:1,max:jt,defaultValue:200,t:n,labelKey:`theme.scrollStep`,unitText:n(`scrollStep.unit`),rangeText:n(`scrollStep.range`),resetText:n(`scrollStep.reset`,{n:200})};return r?(0,F.jsx)(mi,{...i,tooltip:!0}):(0,F.jsx)(hi,{...i,unitSuffix:`px`})}function _i({sidebarWidth:e,onSidebarWidthChange:t,widgetPanelWidth:n,onWidgetPanelWidthChange:r}){let{t:i}=I(),{isDark:a,toggleTheme:o,fontScale:s,setFontScale:c,scrollStepPx:l,setScrollStepPx:u,recentBlocksExpanded:d,setRecentBlocksExpanded:f}=Tn();return(0,F.jsxs)(`div`,{style:{height:`100%`,overflowY:`auto`,padding:`18px 20px 40px`,display:`flex`,flexDirection:`column`,gap:8,maxWidth:640},children:[(0,F.jsx)(Zr,{label:i(`theme.toggleTheme`),children:(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[{value:!0,key:`dark`,labelKey:`theme.darkMode`},{value:!1,key:`light`,labelKey:`theme.lightMode`}].map(({value:e,key:t,labelKey:n})=>(0,F.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text)`,cursor:`pointer`,whiteSpace:`nowrap`},children:[(0,F.jsx)(`input`,{type:`radio`,name:`theme-mode`,checked:a===e,onChange:e=>{let t=e.currentTarget.getBoundingClientRect();o({x:t.left+t.width/2,y:t.top+t.height/2})},style:{accentColor:`var(--accent)`,cursor:`pointer`,margin:0}}),i(n)]},t))})}),(0,F.jsx)(Zr,{label:i(`theme.fontSize`),children:(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,width:`100%`},children:[(0,F.jsx)(`input`,{type:`range`,min:.85,max:1.3,step:.05,value:s,onChange:e=>c(Number(e.target.value)),"aria-label":i(`theme.fontSize`),style:{flex:1,accentColor:`var(--accent)`,cursor:`pointer`}}),(0,F.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,color:`var(--text)`,fontWeight:600,minWidth:44,textAlign:`right`},children:[Math.round(s*100),`%`]})]})}),(0,F.jsx)(Zr,{label:i(`theme.scrollStep`),hint:i(`scrollStep.hint`),children:(0,F.jsx)(gi,{value:l,onChange:u,t:i,embedded:!0})}),(0,F.jsx)(Zr,{label:i(`theme.recentBlocksExpanded`),hint:i(`recentBlocks.hint`),children:(0,F.jsx)(yi,{value:d,onChange:f,t:i})}),(0,F.jsx)(Zr,{label:i(`layout.sidebarWidth`),hint:i(`layout.widthRange`,{min:180,max:480}),children:(0,F.jsx)(vi,{value:e,onChange:t,min:180,max:480,resetTo:280,label:i(`layout.sidebarWidth`),t:i})}),(0,F.jsx)(Zr,{label:i(`layout.widgetPanelWidth`),hint:i(`layout.widthRange`,{min:200,max:560}),children:(0,F.jsx)(vi,{value:n,onChange:r,min:200,max:560,resetTo:280,label:i(`layout.widgetPanelWidth`),t:i})}),` `]})}function vi({value:e,onChange:t,min:n,max:r,resetTo:i,label:a,t:o}){return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,F.jsx)(`input`,{type:`number`,value:e,min:n,max:r,onChange:e=>{let i=Number.parseInt(e.target.value,10);Number.isFinite(i)&&t(Math.min(r,Math.max(n,i)))},onBlur:()=>t(e),"aria-label":a,style:{width:80,padding:`5px 8px`,border:`1px solid var(--border)`,borderRadius:7,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-lg)`,fontVariantNumeric:`tabular-nums`,outline:`none`}}),(0,F.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:`px`}),(0,F.jsx)(L,{label:o(`layout.widthReset`,{value:i}),children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>t(i),"aria-label":o(`layout.widthReset`,{value:i}),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:26,height:26,padding:0,background:`none`,border:`none`,borderRadius:5,color:`var(--text-dim)`,cursor:`pointer`},children:(0,F.jsxs)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,F.jsx)(`path`,{d:`M3 3v5h5`})]})})})]})}function yi({value:e,onChange:t,t:n}){return(0,F.jsx)(mi,{tooltip:!0,value:e,onChange:t,parse:St,min:0,max:20,defaultValue:0,t:n,labelKey:`theme.recentBlocksExpanded`,unitText:n(`longBlock.blocks`),rangeText:n(`recentBlocks.range`),resetText:n(`recentBlocks.reset`,{n:0})})}function bi(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=bi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function xi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bi(e))&&(r&&(r+=` `),r+=t);return r}var Si=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ci=xi,wi=(e,t)=>n=>{if(t?.variants==null)return Ci(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=Si(t)||Si(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 Ci(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)},Ti=Object.defineProperty,Ei=(e,t)=>Ti(e,`name`,{value:t,configurable:!0});function Di(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ei(Di,`setRef`);function Oi(...e){return t=>{let n=!1,r=e.map(e=>{let r=Di(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Di(e[t],null)}}}}Ei(Oi,`composeRefs`);function ki(...e){return d.useCallback(Oi(...e),e)}Ei(ki,`useComposedRefs`);var Ai=Object.defineProperty,ji=(e,t)=>Ai(e,`name`,{value:t,configurable:!0});function Mi(e){let t=d.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Vi(r)&&typeof Gi==`function`&&(r=Gi(r._payload)),d.Children.forEach(r,e=>{if(zi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Vi(n)&&typeof Gi==`function`&&(n=Gi(n._payload)),a=Ii(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=d.cloneElement(a,void 0,s):!o&&d.Children.count(r)===1&&d.isValidElement(r)&&(a=r);let c=a?Ri(a):void 0,l=ki(n,c);if(!a){if(r||r===0)throw Error(o?Wi(e):Ui(e));return r}let u=Li(i,a.props??{});return a.type!==d.Fragment&&(u.ref=n?l:c),d.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}ji(Mi,`createSlot`);var Ni=Mi(`Slot`),Pi=Symbol.for(`radix.slottable`);function Fi(e){let t=ji(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Pi,t}ji(Fi,`createSlottable`);var Ii=ji((e,t)=>{if(`child`in e.props){let t=e.props.child;return d.isValidElement(t)?d.cloneElement(t,void 0,e.props.children(t.props.children)):null}return d.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Li(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}ji(Li,`mergeProps`);function Ri(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ji(Ri,`getElementRef`);function zi(e){return d.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Pi}ji(zi,`isSlottable`);var Bi=Symbol.for(`react.lazy`);function Vi(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Bi&&`_payload`in e&&Hi(e._payload)}ji(Vi,`isLazyComponent`);function Hi(e){return typeof e==`object`&&!!e&&`then`in e}ji(Hi,`isPromiseLike`);var Ui=ji(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Wi=ji(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Gi=d.use,Ki=Object.defineProperty,qi=(e,t)=>Ki(e,`name`,{value:t,configurable:!0}),Ji=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Mi(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,F.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yi(e,t){e&&Yr.flushSync(()=>e.dispatchEvent(t))}qi(Yi,`dispatchDiscreteCustomEvent`);var Xi=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0});function $i(e,t){let n=d.createContext(t);n.displayName=e+`Context`;let r=Qi(e=>{let{children:t,...r}=e,i=d.useMemo(()=>r,Object.values(r));return(0,F.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=d.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Qi(i,`useContext`),[r,i]}Qi($i,`createContext`);function ea(e,t=[]){let n=[];function r(t,r){let i=d.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Qi(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=d.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=d.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Qi(s,`useContext`),[o,s]}Qi(r,`createContext`);let i=Qi(()=>{let t=n.map(e=>d.createContext(e));return Qi(function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ta(i,...t)]}Qi(ea,`createContextScope`);function ta(...e){let t=e[0];if(e.length===1)return t;let n=Qi(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Qi(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Qi(ta,`composeContextScopes`);var na=Object.defineProperty,ra=(e,t)=>na(e,`name`,{value:t,configurable:!0});function ia(e){let t=e+`CollectionProvider`,[n,r]=ea(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ra(e=>{let{scope:t,children:n}=e,r=d.useRef(null),a=d.useRef(new Map).current;return(0,F.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Mi(s),l=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ki(t,a(s,n).collectionRef);return(0,F.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Mi(u),m=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),s=ki(t,o),c=a(u,n);return d.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,F.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ra(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:m},h,r]}ra(ia,`createCollection`);var aa=new WeakMap,oa=class e extends Map{static{ra(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],aa.set(this,!0)}set(e,t){return aa.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=la(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=sa(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=sa(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return sa(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function sa(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ca(e,t);return n===-1?void 0:e[n]}ra(sa,`at`);function ca(e,t){let n=e.length,r=la(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ra(ca,`toSafeIndex`);function la(e){return e!==e||e===0?0:Math.trunc(e)}ra(la,`toSafeInteger`);function ua(e){let t=e+`CollectionProvider`,[n,r]=ea(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new oa,setItemMap:ra(()=>void 0,`setItemMap`)}),o=ra(({state:e,...t})=>e?(0,F.jsx)(c,{...t,state:e}):(0,F.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=ra(e=>{let t=g();return(0,F.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=ra(e=>{let{scope:t,children:n,state:r}=e,a=d.useRef(null),[o,s]=d.useState(null),c=ki(a,s),[l,u]=r;return d.useEffect(()=>{if(!o)return;let e=ma(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,F.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Mi(l),f=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ki(t,a(l,n).collectionRef);return(0,F.jsx)(u,{ref:i,children:r})});f.displayName=l;let p=e+`CollectionItemSlot`,m=Mi(p),h=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),[s,c]=d.useState(null),l=ki(t,o,c),{setItemMap:u}=a(p,n),f=d.useRef(i);da(f.current,i)||(f.current=i);let h=f.current;return d.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(pa):(t.set(s,{...e,element:s}),t.toSorted(pa)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new oa(e)))}},[s,h,u]),(0,F.jsx)(m,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=p;function g(){return d.useState(new oa)}ra(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return ra(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}ra(ua,`createCollection`);function da(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ra(da,`shallowEqual`);function fa(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ra(fa,`isElementPreceding`);function pa(e,t){return!e[1].element||!t[1].element?0:fa(e[1].element,t[1].element)?-1:1}ra(pa,`sortByDocumentPosition`);function ma(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ra(ma,`getChildListObserver`);var ha=Object.defineProperty,ga=(e,t)=>ha(e,`name`,{value:t,configurable:!0}),_a=!!(typeof window<`u`&&window.document&&window.document.createElement);function va(e,t,{checkForDefaultPrevented:n=!0}={}){return ga(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ga(va,`composeEventHandlers`);function ya(e){if(!_a)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ga(ya,`getOwnerWindow`);function ba(e){if(!_a)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ga(ba,`getOwnerDocument`);function xa(e,t=!1){let{activeElement:n}=ba(e);if(!n?.nodeName)return null;if(Sa(n)&&n.contentDocument)return xa(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ba(n).getElementById(e);if(t)return t}}return n}ga(xa,`getActiveElement`);function Sa(e){return e.tagName===`IFRAME`}ga(Sa,`isFrame`);var Ca=globalThis?.document?d.useLayoutEffect:()=>{},wa=Object.defineProperty,Ta=(e,t)=>wa(e,`name`,{value:t,configurable:!0}),Ea=d.useEffectEvent,Da=d.useInsertionEffect;function Oa(e){if(typeof Ea==`function`)return Ea(e);let t=d.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Da==`function`?Da(()=>{t.current=e}):Ca(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ta(Oa,`useEffectEvent`);var ka=Object.defineProperty,Aa=(e,t)=>ka(e,`name`,{value:t,configurable:!0}),ja=d.useInsertionEffect||Ca;function Ma({prop:e,defaultProp:t,onChange:n=Aa(()=>{},`onChange`),caller:r}){let[i,a,o]=Na({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,d.useCallback(t=>{if(s){let n=Pa(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Aa(Ma,`useControllableState`);function Na({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),i=d.useRef(n),a=d.useRef(t);return ja(()=>{a.current=t},[t]),d.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Aa(Na,`useUncontrolledState`);function Pa(e){return typeof e==`function`}Aa(Pa,`isFunction`);var Fa=Symbol(`RADIX:SYNC_STATE`);function Ia(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Oa(o),u=[{...n,state:a}];r&&u.push(r);let[f,p]=d.useReducer((t,n)=>{if(n.type===Fa)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=f.state,h=d.useRef(m);d.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=d.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return d.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Fa,state:i})},[i,f.state,c]),[g,p]}Aa(Ia,`useControllableStateReducer`);var La=Object.defineProperty,Ra=(e,t)=>La(e,`name`,{value:t,configurable:!0});function za(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}Ra(za,`useStateMachine`);var Ba=Ra(e=>{let{present:t,children:n}=e,r=Va(t),i=typeof n==`function`?n({present:r.isPresent}):d.Children.only(n),a=Ua(r.ref,Ga(i));return typeof n==`function`||r.isPresent?d.cloneElement(i,{ref:a}):null},`Presence`);function Va(e){let[t,n]=d.useState(),r=d.useRef(null),i=d.useRef(e),a=d.useRef(`none`),o=d.useRef(void 0),[s,c]=za(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return d.useEffect(()=>{s===`mounted`?(a.current=o.current??Wa(r.current),o.current=void 0):a.current=`none`},[s]),Ca(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Wa(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Ca(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ra(a=>{let o=Wa(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ra(e=>{e.target===t&&(a.current=Wa(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:d.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Wa(t)}else r.current=null;n(e)},[])}}Ra(Va,`usePresence`);function Ha(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ra(Ha,`setRef`);function Ua(...e){let t=d.useRef(e);return t.current=e,d.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ha(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ha(n[e],null)}}},[])}Ra(Ua,`useStableComposedRefs`);function Wa(e){return e?.animationName||`none`}Ra(Wa,`getAnimationName`);function Ga(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ra(Ga,`getElementRef`);var Ka=Object.defineProperty,qa=(e,t)=>Ka(e,`name`,{value:t,configurable:!0}),Ja=d.useId||(()=>void 0),Ya=0;function Xa(e){let[t,n]=d.useState(Ja());return Ca(()=>{e||n(e=>e??String(Ya++))},[e]),e||(t?`radix-${t}`:``)}qa(Xa,`useId`);var Za=Object.defineProperty,Qa=(e,t)=>Za(e,`name`,{value:t,configurable:!0}),$a=`Collapsible`,[eo,to]=ea($a),[no,ro]=eo($a),io=d.forwardRef(Qa(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Ma({prop:r,defaultProp:i??!1,onChange:o,caller:$a});return(0,F.jsx)(no,{scope:n,disabled:a,contentId:Xa(),open:c,onOpenToggle:d.useCallback(()=>l(e=>!e),[l]),children:(0,F.jsx)(Ji.div,{"data-state":uo(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),ao=`CollapsibleTrigger`,oo=d.forwardRef(Qa(function(e,t){let{__scopeCollapsible:n,...r}=e,i=ro(ao,n);return(0,F.jsx)(Ji.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":uo(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:va(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),so=`CollapsibleContent`,co=d.forwardRef(Qa(function(e,t){let{forceMount:n,...r}=e,i=ro(so,e.__scopeCollapsible);return(0,F.jsx)(Ba,{present:n||i.open,children:({present:e})=>(0,F.jsx)(lo,{...r,ref:t,present:e})})},`CollapsibleContent`)),lo=d.forwardRef(Qa(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=ro(so,n),[s,c]=d.useState(r),l=d.useRef(null),u=ki(t,l),f=d.useRef(0),p=f.current,m=d.useRef(0),h=m.current,g=o.open||s,_=d.useRef(g),v=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Ca(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,F.jsx)(Ji.div,{"data-state":uo(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function uo(e){return e?`open`:`closed`}Qa(uo,`getState`);var fo=io,po=Object.defineProperty,mo=(e,t)=>po(e,`name`,{value:t,configurable:!0}),ho=d.createContext(void 0);function go(e){let t=d.useContext(ho);return e||t||`ltr`}mo(go,`useDirection`);var _o=Object.defineProperty,vo=(e,t)=>_o(e,`name`,{value:t,configurable:!0});function yo(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}vo(yo,`useCallbackRef`);var bo=Object.defineProperty,xo=(e,t)=>bo(e,`name`,{value:t,configurable:!0}),So=`dismissableLayer.update`,Co=`dismissableLayer.pointerDownOutside`,wo=`dismissableLayer.focusOutside`,To,Eo=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Do=d.forwardRef(xo(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=d.useContext(Eo),[f,p]=d.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=d.useState({}),g=ki(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=d.useRef(!1),w=Ao(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:d.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=jo(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=f?b===_.length-1:!1,D=yo(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return d.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(To=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Mo(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(f),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=To))}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Mo())},[f,u]),d.useEffect(()=>{let e=xo(()=>h({}),`handleUpdate`);return document.addEventListener(So,e),()=>document.removeEventListener(So,e)},[]),(0,F.jsx)(Ji.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:va(e.onFocusCapture,T.onFocusCapture),onBlurCapture:va(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:va(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Oo(){let e=d.useContext(Eo),[t,n]=d.useState(null);return d.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}xo(Oo,`useDismissableLayerSurface`);var ko=xo(()=>!0,`IS_TRUE`);function Ao(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ko}=t,s=yo(e),c=d.useRef(!1),l=d.useRef(!1),u=d.useRef(new Map),f=d.useRef(()=>{});return d.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}xo(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}xo(t,`isOutsideInteractionIntercepted`);function d(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}xo(d,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}xo(p,`handleInteractionBubble`);let m=xo(a=>{if(a.target&&!c.current){let d=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||No(Co,s,p,{discrete:!0})};if(xo(d,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?d():(n.removeEventListener(`click`,f.current),f.current=d,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,d,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,d,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:xo(()=>c.current=!0,`onPointerDownCapture`)}}xo(Ao,`usePointerDownOutside`);function jo(e,t=globalThis?.document){let n=yo(e),r=d.useRef(!1);return d.useEffect(()=>{let e=xo(e=>{e.target&&!r.current&&No(wo,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:xo(()=>r.current=!0,`onFocusCapture`),onBlurCapture:xo(()=>r.current=!1,`onBlurCapture`)}}xo(jo,`useFocusOutside`);function Mo(){let e=new CustomEvent(So);document.dispatchEvent(e)}xo(Mo,`dispatchUpdate`);function No(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Yi(i,a):i.dispatchEvent(a)}xo(No,`handleAndDispatchCustomEvent`);var Po=Object.defineProperty,Fo=(e,t)=>Po(e,`name`,{value:t,configurable:!0}),Io=`focusScope.autoFocusOnMount`,Lo=`focusScope.autoFocusOnUnmount`,Ro={bubbles:!1,cancelable:!0},zo=d.forwardRef(Fo(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=d.useState(null),l=yo(i),u=yo(a),f=d.useRef(null),p=ki(t,c),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:Ko(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Ko(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ko(s)};Fo(e,`handleFocusIn`),Fo(t,`handleFocusOut`),Fo(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),d.useEffect(()=>{if(s){qo.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Io,Ro);s.addEventListener(Io,l),s.dispatchEvent(t),t.defaultPrevented||(Bo(Xo(Ho(s)),{select:!0}),document.activeElement===e&&Ko(s))}return()=>{s.removeEventListener(Io,l),setTimeout(()=>{let t=new CustomEvent(Lo,Ro);s.addEventListener(Lo,u),s.dispatchEvent(t),t.defaultPrevented||Ko(e??document.body,{select:!0}),s.removeEventListener(Lo,u),qo.remove(m)},0)}}},[s,l,u,m]);let h=d.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Vo(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ko(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ko(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,F.jsx)(Ji.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Bo(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ko(r,{select:t}),document.activeElement!==n)return}Fo(Bo,`focusFirst`);function Vo(e){let t=Ho(e);return[Uo(t,e),Uo(t.reverse(),e)]}Fo(Vo,`getTabbableEdges`);function Ho(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Fo(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Fo(Ho,`getTabbableCandidates`);function Uo(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Wo(r,{upTo:t})))return r}Fo(Uo,`findVisible`);function Wo(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Fo(Wo,`isHidden`);function Go(e){return e instanceof HTMLInputElement&&`select`in e}Fo(Go,`isSelectableInput`);function Ko(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Go(e)&&t&&e.select()}}Fo(Ko,`focus`);var qo=Jo();function Jo(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Yo(e,t),e.unshift(t)},remove(t){e=Yo(e,t),e[0]?.resume()}}}Fo(Jo,`createFocusScopesStack`);function Yo(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Fo(Yo,`arrayRemove`);function Xo(e){return e.filter(e=>e.tagName!==`A`)}Fo(Xo,`removeLinks`);var Zo=Object.defineProperty,Qo=d.forwardRef(((e,t)=>Zo(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=d.useState(!1);Ca(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Yr.createPortal((0,F.jsx)(Ji.div,{...r,ref:t}),o):null},`Portal`)),$o=Object.defineProperty,es=(e,t)=>$o(e,`name`,{value:t,configurable:!0}),ts=0,ns=null;function rs(e){return is(),e.children}es(rs,`FocusGuards`);function is(){d.useEffect(()=>{ns||={start:as(),end:as()};let{start:e,end:t}=ns;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ts++,()=>{ts===1&&(ns?.start.remove(),ns?.end.remove(),ns=null),ts=Math.max(0,ts-1)}},[])}es(is,`useFocusGuards`);function as(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}es(as,`createFocusGuard`);var os=function(){return os=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},os.apply(this,arguments)};function ss(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function cs(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ls=`right-scroll-bar-position`,us=`width-before-scroll-bar`,ds=`with-scroll-bars-hidden`,fs=`--removed-body-scroll-bar-size`;function ps(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ms(e,t){var n=(0,d.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var hs=typeof window<`u`?d.useLayoutEffect:d.useEffect,gs=new WeakMap;function _s(e,t){var n=ms(t||null,function(t){return e.forEach(function(e){return ps(e,t)})});return hs(function(){var t=gs.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ps(e,null)}),i.forEach(function(e){r.has(e)||ps(e,a)})}gs.set(n,e)},[e]),n}function vs(e){return e}function ys(e,t){t===void 0&&(t=vs);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function bs(e){e===void 0&&(e={});var t=ys(null);return t.options=os({async:!0,ssr:!1},e),t}var xs=function(e){var t=e.sideCar,n=ss(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return d.createElement(r,os({},n))};xs.isSideCarExport=!0;function Ss(e,t){return e.useMedium(t),xs}var Cs=bs(),ws=function(){},Ts=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ws,onWheelCapture:ws,onTouchMoveCapture:ws}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ss(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=_s([n,t]),w=os(os({},x),i);return d.createElement(d.Fragment,null,u&&d.createElement(S,{sideCar:Cs,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?d.cloneElement(d.Children.only(s),os(os({},w),{ref:C})):d.createElement(y,os({},w,{className:c,ref:C}),s))});Ts.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ts.classNames={fullWidth:us,zeroRight:ls};var Es=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ds(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Es();return t&&e.setAttribute(`nonce`,t),e}function Os(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ks(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var As=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ds())&&(Os(t,n),ks(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},js=function(){var e=As();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ms=function(){var e=js();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ns={left:0,top:0,right:0,gap:0},Ps=function(e){return parseInt(e||``,10)||0},Fs=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ps(n),Ps(r),Ps(i)]},Is=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ns;var t=Fs(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ls=Ms(),Rs=`data-scroll-locked`,zs=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
10
|
+
`).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(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=en(``+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`&&Kd(e,t,`name`,i.name,i,null),Kd(e,t,`formEncType`,i.formEncType,i,null),Kd(e,t,`formMethod`,i.formMethod,i,null),Kd(e,t,`formTarget`,i.formTarget,i,null)):(Kd(e,t,`encType`,i.encType,i,null),Kd(e,t,`method`,i.method,i,null),Kd(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(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=en(``+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`:Md(`beforetoggle`,e),Md(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(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=Qt.get(n)||n,At(e,n,r))}}function qd(e,t,n,r,i,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`load`,e);var r=!1,i=!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`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,o,s,n,null)}}i&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:Md(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=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(a(137,t));break;default:Kd(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Md(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Kd(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in Md(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Kd(e,t,s,c,n,null)}Kt(e,r,i,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:Kd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`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(a(137,t));default:Kd(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(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 i=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)||Kd(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`:i=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(a(137,t));break;default:m!==f&&Kd(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,i);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)||Kd(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Kd(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Kd(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Kd(e,t,s,i,r,o)}Gt(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:Kd(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:Kd(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)&&Kd(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(a(137,t));break;default:Kd(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(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||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(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||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){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&&Xd(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&&Xd(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 Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(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 nf(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 rf(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 af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e!==af&&(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function ff(e){return e===`head`}function pf(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),qp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Df(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Df(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Df(e.ownerDocument.body)}n=i}while(n);qp(t)}function mf(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 hf(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`:hf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function gf(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[ht])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=Sf(e.nextSibling),e===null)break}return null}function _f(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Sf(e.nextSibling),e===null))return null;return e}function vf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Sf(e.nextSibling),e===null))return null;return e}function yf(e){return e.data===`$?`||e.data===`$~`}function bf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function xf(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 Sf(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 Cf=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Tf(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 Ef(e,t,n){switch(t=ef(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Df(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var Of=new Map,kf=new Set;function Af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jf=ne.d;ne.d={f:Mf,r:Nf,D:If,C:Lf,L:Rf,m:zf,X:Vf,S:Bf,M:Hf};function Mf(){var e=jf.f(),t=Mu();return e||t}function Nf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?js(t):jf.r(e)}var Pf=typeof document>`u`?null:document;function Ff(e,t,n){var r=Pf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),kf.has(i)||(kf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function If(e){jf.D(e),Ff(`dns-prefetch`,e,null)}function Lf(e,t){jf.C(e,t),Ff(`preconnect`,e,t)}function Rf(e,t,n){jf.L(e,t,n);var r=Pf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Wf(e);break;case`script`:a=Jf(e)}Of.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Of.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gf(a))||t===`script`&&r.querySelector(Yf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function zf(e,t){jf.m(e,t);var n=Pf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jf(e)}if(!Of.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Of.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Yf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Bf(e,t,n){jf.S(e,t,n);var r=Pf;if(r&&e){var i=bt(r).hoistableStyles,a=Wf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Of.get(a))&&Qf(e,n);var c=o=r.createElement(`link`);xt(c),Jd(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,Zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vf(e,t){jf.X(e,t);var n=Pf;if(n&&e){var r=bt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),xt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t){jf.M(e,t);var n=Pf;if(n&&e){var r=bt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),xt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t,n,r){var i=(i=de.current)?Af(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Wf(n.href),n=bt(i).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=Wf(n.href);var o=bt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Gf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Of.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},Of.set(e,n),o||qf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Jf(n),n=bt(i).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(a(444,e))}}function Wf(e){return`href="`+Bt(e)+`"`}function Gf(e){return`link[rel="stylesheet"][`+e+`]`}function Kf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function qf(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}),Jd(t,`link`,n),xt(t),e.head.appendChild(t))}function Jf(e){return`[src="`+Bt(e)+`"]`}function Yf(e){return`script[async]`+e}function Xf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Jd(r,`style`,i),Zf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Wf(n.href);var o=e.querySelector(Gf(i));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Kf(n),(i=Of.get(i))&&Qf(r,i),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Zf(o,n.precedence,e),t.instance=o;case`script`:return o=Jf(n.src),(i=e.querySelector(Yf(o)))?(t.instance=i,xt(i),i):(r=n,(i=Of.get(o))&&(r=h({},n),$f(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),xt(i),Jd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zf(r,n.precedence,e));return t.instance}function Zf(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 Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $f(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ep=null;function tp(e,t,n){if(ep===null){var r=new Map,i=ep=new Map;i.set(n,r)}else i=ep,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[ht]||a[ct]||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 np(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rp(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 ip(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ap(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=Wf(r.href),a=t.querySelector(Gf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=cp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Kf(r),(i=Of.get(i))&&Qf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(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=cp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var op=0;function sp(e,t){return e.stylesheets&&e.count===0&&up(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&up(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&op===0&&(op=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&up(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>op?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lp=null;function up(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lp=new Map,t.forEach(dp,e),lp=null,cp.call(e))}function dp(e,t){if(!(t.state.loading&4)){var n=lp.get(e);if(n)var r=n.get(null);else{n=new Map,lp.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=cp.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 fp={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function pp(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(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 mp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new pp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function hp(e){return e?(e=oi,e):oi}function gp(e,t,n,r,i,a){i=hp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(Du(n,e,t),Ka(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vp(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function yp(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&Du(t,e,67108864),vp(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=Tu();t=rt(t);var n=ii(e,t);n!==null&&Du(n,e,t),vp(e,t)}}var xp=!0;function Sp(e,t,n,r){var i=P.T;P.T=null;var a=ne.p;try{ne.p=2,wp(e,t,n,r)}finally{ne.p=a,P.T=i}}function Cp(e,t,n,r){var i=P.T;P.T=null;var a=ne.p;try{ne.p=8,wp(e,t,n,r)}finally{ne.p=a,P.T=i}}function wp(e,t,n,r){if(xp){var i=Tp(r);if(i===null)Ld(e,t,r,Ep,n),Lp(e,r);else if(zp(i,e,t,n,r))r.stopPropagation();else if(Lp(e,r),t&4&&-1<Ip.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}gd(a),!(Kl&6)&&(pu=Oe()+500,_d(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&Du(s,a,2),Mu(),vp(a,2)}if(a=Tp(r),a===null&&Ld(e,t,r,Ep,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Tp(e){return e=rn(e),Dp(e)}var Ep=null;function Dp(e){if(Ep=null,e=_t(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(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 Ep=e,null}function Op(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(ke()){case Ae:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var kp=!1,Ap=null,jp=null,Mp=null,Np=new Map,Pp=new Map,Fp=[],Ip=`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 Lp(e,t){switch(e){case`focusin`:case`focusout`:Ap=null;break;case`dragenter`:case`dragleave`:jp=null;break;case`mouseover`:case`mouseout`:Mp=null;break;case`pointerover`:case`pointerout`:Np.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Pp.delete(t.pointerId)}}function Rp(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=vt(t),t!==null&&yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zp(e,t,n,r,i){switch(t){case`focusin`:return Ap=Rp(Ap,e,t,n,r,i),!0;case`dragenter`:return jp=Rp(jp,e,t,n,r,i),!0;case`mouseover`:return Mp=Rp(Mp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Np.set(a,Rp(Np.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Pp.set(a,Rp(Pp.get(a)||null,e,t,n,r,i)),!0}return!1}function Bp(e){var t=_t(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,ot(e.priority,function(){bp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,ot(e.priority,function(){bp(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 Vp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&yp(t),e.blockedOn=n,!1;t.shift()}return!0}function Hp(e,t,n){Vp(e)&&n.delete(t)}function Up(){kp=!1,Ap!==null&&Vp(Ap)&&(Ap=null),jp!==null&&Vp(jp)&&(jp=null),Mp!==null&&Vp(Mp)&&(Mp=null),Np.forEach(Hp),Pp.forEach(Hp)}function Wp(e,n){e.blockedOn===n&&(e.blockedOn=null,kp||(kp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Up)))}var Gp=null;function Kp(e){Gp!==e&&(Gp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gp===e&&(Gp=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(Dp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qp(e){function t(t){return Wp(t,e)}Ap!==null&&Wp(Ap,e),jp!==null&&Wp(jp,e),Mp!==null&&Wp(Mp,e),Np.forEach(t),Pp.forEach(t);for(var n=0;n<Fp.length;n++){var r=Fp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fp.length&&(n=Fp[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Fp.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[lt]||null;if(typeof a==`function`)o||Kp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(Dp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kp(n)}}}function Jp(){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 Yp(e){this._internalRoot=e}Xp.prototype.render=Yp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;gp(n,Tu(),e,t,null,null)},Xp.prototype.unmount=Yp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gp(e.current,2,null,e,null,null),Mu(),t[ut]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fp.length&&t!==0&&t<Fp[n].priority;n++);Fp.splice(n,0,e),n===0&&Bp(e)}};var Zp=n.version;if(Zp!==`19.2.8`)throw Error(a(527,Zp,`19.2.8`));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$p.isDisabled&&$p.supportsFiber)try{Le=$p.inject(Qp),Re=$p}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Qs,o=$s,c=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mp(e,1,!1,null,null,n,r,null,i,o,c,Jp),e[ut]=t.current,Fd(e),new Yp(t)}})),u=n(((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=l()})),d=t(i(),1),f=u(),p=/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1B\\))/g,m=/^\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1B\\))/,h=/\x1B\[([0-9;]*)m/g,g=/\x1B_pi:c\x07/g,_=[`#1f2937`,`#dc2626`,`#16a34a`,`#d97706`,`#2563eb`,`#9333ea`,`#0891b2`,`#6b7280`],v=[`#9ca3af`,`#ef4444`,`#22c55e`,`#f59e0b`,`#3b82f6`,`#a855f7`,`#06b6d4`,`#e5e7eb`];function y(e){return e.replace(g,``).replace(p,``)}function b(e){let t=[],n=0;for(;n<e.length;){if(e.charCodeAt(n)===27){let t=e.slice(n).match(m);if(t){n+=t[0].length;continue}}let r=e.codePointAt(n);if(r===void 0)break;let i=String.fromCodePoint(r);t.push({start:n,end:n+i.length,char:i}),n+=i.length}return t}function x(e,t){let n=b(e)[t];return n?e.slice(0,n.start)+e.slice(n.end):e}function S(e){return b(e)[0]?.char}function C(e){let t=b(e);for(let e=t.length-1;e>=0;e--)if(t[e].char.trim()!==``)return e;return-1}function w(e){let t=e;for(;;){let e=b(t),n=e[e.length-1];if(n?.char.trim()!==``)return t;t=t.slice(0,n.start)+t.slice(n.end)}}function T(e){let t=/^[┌├└╭╰][─┬┴┼]+[┐┤┘╮╯]$/,n=[];for(let r of e){let e=r.replace(g,``),i=y(e).trimEnd();if(t.test(i))continue;let a=e,o=S(a);(o===`│`||o===`┃`)&&(a=x(a,0),S(a)===` `&&(a=x(a,0)));let s=C(a),c=s>=0?b(a)[s]?.char:void 0;(c===`│`||c===`┃`)&&(a=x(a,s)),n.push(w(a))}for(;n.length>0&&y(n[0]).trim()===``;)n.shift();for(;n.length>0&&y(n[n.length-1]).trim()===``;)n.pop();return n.length?n:e}function E(e){if(e>=0&&e<8)return _[e];if(e>=8&&e<16)return v[e-8];if(e>=16&&e<=231){let t=e-16,n=Math.floor(t/36),r=Math.floor(t%36/6),i=t%6,a=e=>e===0?0:55+e*40;return`rgb(${a(n)}, ${a(r)}, ${a(i)})`}if(e>=232&&e<=255){let t=8+(e-232)*10;return`rgb(${t}, ${t}, ${t})`}}var D={0:e=>{for(let t of Object.keys(e))delete e[t]},1:e=>{e.fontWeight=700},2:e=>{e.opacity=.65},3:e=>{e.fontStyle=`italic`},4:e=>{e.textDecoration=`underline`},22:e=>{delete e.fontWeight,delete e.opacity},23:e=>{delete e.fontStyle},24:e=>{delete e.textDecoration},39:e=>{delete e.color},49:e=>{delete e.backgroundColor}},O=[{min:30,max:37,target:`color`,palette:_},{min:90,max:97,target:`color`,palette:v},{min:40,max:47,target:`backgroundColor`,palette:_},{min:100,max:107,target:`backgroundColor`,palette:v}];function k(e,t,n,r){if(t!==38&&t!==48)return 0;if(n[r+1]===2){let[i,a,o]=[n[r+2],n[r+3],n[r+4]];if([i,a,o].every(e=>typeof e==`number`&&Number.isFinite(e))){let n=`rgb(${i}, ${a}, ${o})`;t===38?e.color=n:e.backgroundColor=n}return 4}if(n[r+1]===5){let i=E(n[r+2]);return i&&(t===38?e.color=i:e.backgroundColor=i),2}return 0}function A(e,t){let n={...e};for(let e=0;e<t.length;e++){let r=t[e],i=D[r];if(i){i(n);continue}let a=!1;for(let e of O)if(r>=e.min&&r<=e.max){n[e.target]=e.palette[r-e.min],a=!0;break}a||(e+=k(n,r,t,e))}return n}function j(e){let t=[],n={},r=0,i;for(h.lastIndex=0;(i=h.exec(e))!==null;){i.index>r&&t.push({text:e.slice(r,i.index),style:n});let a=i[1]?i[1].split(`;`).map(e=>Number(e||`0`)):[0];n=A(n,a),r=i.index+i[0].length}return r<e.length&&t.push({text:e.slice(r),style:n}),t}var M=new Map,N=new Map,ee=3e4,te=75e3,P=1e3,ne=15e3,re=1,ie=3,ae=null,oe=0,se=0,ce=P;function le(e){return e.ch===`agent`?`agent:${e.sessionId??``}`:e.ch===`watch`?`watch:${e.filePath??``}`:e.ch}function ue(){return`${location.protocol===`https:`?`wss://`:`ws://`}${location.host}/api/ws`}function de(e,t){e.send(JSON.stringify({type:`sub`,...t}))}function fe(){ae&&ae.close();let e=++se,t;try{t=new WebSocket(ue())}catch{pe(e);return}ae=t,t.onopen=()=>{ce=P,oe=Date.now();for(let e of N.values())try{de(t,e)}catch{break}},t.onmessage=n=>{if(e!==se||ae!==t||(oe=Date.now(),typeof n.data!=`string`))return;let r;try{r=JSON.parse(n.data)}catch{return}if(r.ch)for(let e of M.get(r.ch)??[])e(r.data)},t.onclose=()=>{e===se&&ae===t&&(ae=null,pe(e))},t.onerror=()=>{}}function pe(e){setTimeout(()=>{e!==se||ae||fe()},ce),ce=Math.min(ce*2,ne)}function me(){if(!ae||ae.readyState!==re||Date.now()-oe<=te)return;se+=1;let e=ae;ae=null;try{e.close()}catch{}fe()}typeof window<`u`&&(setInterval(me,ee),window.addEventListener(`online`,()=>{!ae||ae.readyState===ie?fe():me()}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&(!ae||ae.readyState===ie?fe():me())}));function he(e){if(e&&ae?.readyState===re)try{ae.send(JSON.stringify({type:`unseen`,sessionId:e}))}catch{}}function ge(e,t){let n=le(e),r=M.get(n);r||(r=new Set,M.set(n,r)),r.add(t);let i=!N.has(n);if(N.set(n,e),ae?.readyState===re&&i)try{de(ae,e)}catch{}else ae||fe();return()=>{let e=M.get(n);if(e?.delete(t),e&&e.size===0&&(M.delete(n),N.delete(n),ae?.readyState===re))try{ae.send(JSON.stringify({type:`unsub`,ch:n}))}catch{}}}var _e=n((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})),ve=n(((e,t)=>{t.exports=_e()})),F=ve(),ye=`pi.notification-log.v1`;function be(){try{let e=window.sessionStorage.getItem(ye);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&typeof e.message==`string`&&(e.notifyType===`warning`||e.notifyType===`error`)&&typeof e.createdAt==`number`):[]}catch{return[]}}function xe(e){try{window.sessionStorage.setItem(ye,JSON.stringify(e))}catch{}}var Se=(0,d.createContext)(null);function Ce({children:e}){let[t,n]=(0,d.useState)(be);(0,d.useEffect)(()=>{xe(t)},[t]),(0,d.useEffect)(()=>ge({ch:`global`},e=>{let t=e;if(t?.type!==`extension_ui_request`||t.method!==`notify`||t.notifyType!==`warning`&&t.notifyType!==`error`)return;let r=typeof t.message==`string`?y(t.message):``;if(!r)return;let i={id:typeof t.id==`string`&&t.id?t.id:typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,message:r,notifyType:t.notifyType,sessionId:typeof t.sessionId==`string`&&t.sessionId?t.sessionId:null,createdAt:Date.now()};n(e=>[i,...e].slice(0,30))}),[]);let r=(0,d.useMemo)(()=>({entries:t}),[t]);return(0,F.jsx)(Se.Provider,{value:r,children:e})}function we(){let e=(0,d.useContext)(Se);if(!e)throw Error(`useNotificationLog must be used within NotificationLogProvider`);return e}function Te(e,t={}){return e.replace(/\{([\w.-]+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:String(r)})}function Ee(e,t,n,r={}){let i=n[e]?.[t]??n.en?.[t];return i===void 0?t:Te(i,r)}function De(e,t,n=new Date){let r=(e instanceof Date?e:new Date(e)).getTime()-n.getTime(),i=Math.abs(r),[a,o]=i<6e4?[`second`,1e3]:i<36e5?[`minute`,6e4]:i<864e5?[`hour`,36e5]:[`day`,864e5],s=Math.round(r/o);return new Intl.RelativeTimeFormat(t,{numeric:`always`}).format(s,a)}var Oe={id:`en`,label:`English`,messages:{"common.ok":`OK`,"common.language":`Language`,"common.models":`Models`,"common.skills":`Skills`,"common.plugins":`Plugins`,"sidebar.hide":`Collapse sidebar`,"sidebar.show":`Expand sidebar`,"theme.light":`Switch to light mode`,"preferences.defaultThinkingLevel":`Default thinking level`,"preferences.thinkingLevelHint":"Global default for new sessions (settings.json `defaultThinkingLevel`). Not set = field removed, falls back to pi default.","preferences.thinkingLevelNotSet":`Not set (use model default)`,"preferences.compaction":`Auto compaction`,"preferences.compactionHint":"Automatically compact long sessions (settings.json `compaction`). When not configured the pi defaults are shown; any edit writes the full object.","preferences.compactionEnabled":`Enabled`,"preferences.compactionReserveTokens":`Reserve tokens`,"preferences.compactionReserveTokensHint":`Tokens reserved for model output, keeping reply space after compaction`,"preferences.compactionKeepRecentTokens":`Keep recent tokens`,"preferences.compactionKeepRecentTokensHint":`Tokens kept after compaction, counted backwards from the most recent messages`,"preferences.retry":`API retry`,"preferences.retryHint":"Retry settings for provider API calls (settings.json `retry`). When not configured the pi defaults are shown; any edit writes the full object. Provider sub-fields left empty are not written.","preferences.retryEnabled":`Enabled`,"preferences.retryEnabledHint":`Enable retries for failed API calls`,"preferences.retryMaxRetries":`Max retries`,"preferences.retryBaseDelayMs":`Base delay (ms)`,"preferences.retryBaseDelayMsHint":`Initial delay before the first retry, in milliseconds`,"preferences.retryProviderTimeoutMs":`Provider timeout (ms)`,"preferences.retryProviderMaxRetries":`Provider max retries`,"preferences.retryProviderMaxRetryDelayMs":`Provider max delay (ms)`,"preferences.defaultProjectTrust":`Default project trust`,"preferences.projectTrustHint":"Default trust for new projects (settings.json `defaultProjectTrust`). Not set = field removed (falls back to ask).","preferences.projectTrustNotSet":`Not set (ask)`,"preferences.projectTrustAsk":`Ask`,"preferences.projectTrustAlways":`Always trust`,"preferences.projectTrustNever":`Never trust`,"preferences.notifyEvents":`Notifications`,"preferences.notifyEventsHint":`Browser notifications when the tab is not active. Permission is requested on first interaction.`,"notify.permission.request":`Enable notifications`,"notify.permission.requestHint":`Click to enable browser notifications — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.granted":`Notifications on`,"notify.permission.grantedHint":`Browser notifications are enabled — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.bannerHintBefore":`Click the`,"notify.permission.bannerHintAfter":`button in the top-left toolbar to enable notifications — you'll be alerted when a task completes, errors, or asks a question. Fine-tune in Config Center → Session → Notifications`,"notify.permission.denied":`Notifications blocked`,"notify.permission.deniedHint":`Notifications are blocked by the browser. Click the icon next to the address bar → Site settings, switch notifications to Allow, then try again`,"preferences.notifyWhileActive":`Notify while page active`,"preferences.notifyTaskComplete":`Task complete`,"preferences.notifyErrors":`Errors`,"preferences.notifyQuestions":`Questions`,"preferences.subagentsDefaultModel":`Subagent default model`,"preferences.subagentsDefaultThinking":`Subagent default thinking level`,"preferences.subagentsHint":"Defaults for subagents (settings.json `subagents`). defaultThinking not set = sub-field removed (falls back to pi default).","preferences.subagentsModelPlaceholder":`provider/model-id`,"theme.dark":`Switch to dark mode`,"theme.toggleTheme":`Switch theme`,"theme.darkMode":`Dark`,"theme.lightMode":`Light`,"theme.fontSize":`Font size`,"theme.scrollStep":`Hover scroll step`,"scrollStep.hint":`Pixels scrolled per hover tick on the edge scroll arrows (shared by the panel scroll arrows and the minimap).`,"scrollStep.range":`per hover tick (1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`Auto-reload chat messages interval`,"autoReload.off":`Off (0) — do not auto-reload`,"autoReload.range":`seconds (0 — 3600)`,"autoReload.unit":`s`,"autoReload.hint":`Interval in seconds for re-reading the session file; 0 = off. Keep 0 for single-client use (messages arrive via SSE in real time); set it above 0 for multi-client collaboration (several browsers on the same session) so each client refreshes periodically and picks up chat messages generated by the others.`,"recentBlocks.hint":`How many recent completed blocks stay expanded, including the newest one (default 0: completed blocks collapse by default, hover to preview or click to expand).`,"autoReload.reset":`Reset to default ({n} s)`,"chat.reloadFromDisk":`Reload session from disk`,"chat.reloadFromDiskHint":`Use when multiple clients read/write the same session jsonl at the same time. You can set automatic timed reloading under Config Center → Session.`,"scrollStep.reset":`Reset to default ({n} px)`,"theme.recentBlocksExpanded":`Recent completed blocks kept expanded`,"layout.sidebarWidth":`Left panel width`,"layout.widgetPanelWidth":`Right panel width`,"layout.widthRange":`px ({min}–{max})`,"layout.widthReset":`Reset to default ({value} px)`,"longBlock.blocks":`blocks`,"recentBlocks.reset":`Reset to default ({n})`,"recentBlocks.range":`0-20, includes the newest completed block`,"history.full":`Full history`,"history.unsaved":`Full history is available after the session is saved`,"title.generating":`Generating...`,"title.updated":`Title updated`,"title.failed":`Generation failed`,"title.generate":`Generate title`,"title.unsaved":`Title generation is available after the session is saved`,"title.noMessages":`Send a message before naming this session`,"title.generateSession":`Generate a session title`,"system.prompt":`System prompt`,"system.empty":`System prompt is empty (tools are disabled)`,"system.load":`Send a message to load the system prompt`,"notices.title":`Notifications`,"notices.empty":`No warnings or errors yet`,"notices.fromSession":`From session`,"session.info":`Session info`,"session.reload":`Reload session (re-read config and resources)`,"session.name":`Name`,"session.file":`File`,"session.inMemory":`In-memory`,"session.id":`ID`,"session.user":`User`,"session.assistant":`Assistant`,"session.toolCalls":`Tool Calls`,"session.toolResults":`Tool Results`,"session.total":`Total`,"session.input":`Input`,"session.output":`Output`,"session.cacheRead":`Cache Read`,"session.cacheWrite":`Cache Write`,"session.inputHint":`Prompt tokens NOT served from cache: system prompt, history and tool definitions sent to the model, minus the cached portion`,"session.outputHint":`Tokens generated by the model (answers and thinking)`,"session.cacheReadHint":`Tokens served from prompt cache: unchanged context re-read from the previous request at a discounted rate`,"session.cacheWriteHint":`Tokens written to cache for the first time (billed on write, Anthropic-style)`,"session.totalHint":`input + output + cacheRead + cacheWrite`,"session.cacheReadRate":`Cache hit rate: cache-read tokens as a share of all input prompt tokens (input + cacheRead + cacheWrite), the official formula cacheRead / (input + cacheRead + cacheWrite)`,"session.cost":`Cost`,"session.context":`Context`,"session.copy":`Copy {value}`,"session.copied":`Copied`,"session.title":`Session info`,"session.load":`Send a message or run /session to load session info`,"session.infoSection":`Session Info`,"session.messages":`Messages`,"session.tokens":`Tokens`,"session.copyFile":`Copy file path`,"session.copyId":`Copy session ID`,"workspace.opening":`Opening workspace...`,"workspace.unable":`Unable to open workspace`,"workspace.selectSession":`Select a session from the sidebar`,"workspace.selectWorkspace":`Please select a workspace`,"workspace.stepProject":`Select a project directory from the sidebar`,"workspace.stepModels":`Add models via the Models button at the bottom`,"tabs.chat":`Chat`,"tabs.widgets":`Widgets`,"config.title":`Settings`,"config.section.session":`Session`,"config.section.appearance":`Appearance`,"config.section.advanced":`Advanced`,"config.section.startScreen":`Start screen`,"config.section.git":`Git`,"config.section.updates":`Updates`,"config.section.modelThinking":`Thinking Levels`,"config.section.requiresCwd":`Select a project directory from the sidebar first to browse plugins / skills`,"updates.check":`Check for updates`,"updates.checking":`Checking…`,"updates.checkedAt":`Last checked`,"updates.upToDate":`Up to date`,"updates.updateAvailable":`Update available`,"updates.unavailable":`Check failed`,"updates.noPluginUpdates":`All plugins are up to date`,"updates.banner":`Update available: {items}`,"updates.view":`View`,"updates.copied":`Copied`,"updates.copyCommand":`Copy command`,"updates.restartNote":`Also upgrades the bundled pi SDK; restart pi-web to load it.`,"updates.enableChecking":`Enable update checks`,"updates.disabled":`Update checks disabled`,"updates.ignoreVersion":`Ignore this version`,"updates.ignored":`Ignored {version}`,"updates.ignoredPlugin":`Ignored`,"updates.unignore":`Unignore`,"preferences.pi.unset":`pi default`,"preferences.pi.enableAnalytics":`Enable analytics`,"preferences.pi.enableAnalyticsHint":"Send anonymous usage analytics (settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`Enable install telemetry`,"preferences.pi.enableInstallTelemetryHint":"Send anonymous install telemetry (settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP proxy`,"preferences.pi.httpProxyHint":"Proxy URL for HTTP requests (settings.json `httpProxy`). Empty input cannot clear an already-set value.","preferences.pi.trackingId":`Analytics tracking ID`,"preferences.pi.trackingIdHint":"Custom analytics tracking ID (settings.json `trackingId`). Empty input cannot clear an already-set value.","preferences.pi.httpIdleTimeoutMs":`HTTP idle timeout (ms)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP idle timeout in ms (settings.json `httpIdleTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.websocketConnectTimeoutMs":`WebSocket connect timeout (ms)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket connect timeout in ms (settings.json `websocketConnectTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.branchSummary":`Branch summary`,"preferences.pi.branchSummaryHint":"Branch summary auto-compaction (settings.json `branchSummary`)","preferences.pi.reserveTokens":`Reserve tokens`,"preferences.pi.skipPrompt":`Skip prompt`,"preferences.pi.images":`Image handling`,"preferences.pi.imagesHint":"How the pi engine handles images (settings.json `images`)","preferences.pi.autoResize":`Auto-resize`,"preferences.pi.autoResizeHint":"Downscale images returned by tools such as `read` to save tokens.","preferences.pi.blockImages":`Block images`,"preferences.pi.blockImagesHint":`Strip all image content from messages before they reach the model.`,"config.files.hint":`Edit pi's config files (JSON) directly. Validated before save; backed up automatically (last 10 kept).`,"config.widgets.empty":`No widget configurations yet. Widgets appear here automatically when an extension pops one up.`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`w`,"config.widgets.height":`h`,"config.widgets.bind":`Bind message`,"config.widgets.bindTitle":`Bind custom message`,"config.widgets.bindHint":`Bind a quick message to widget "{key}"`,"config.widgets.editTitle":`Edit quick message`,"config.widgets.editHint":`Edit the label, content, and send mode.`,"config.widgets.label":`Label`,"config.widgets.labelPlaceholder":`Button text (e.g. Reload)`,"config.widgets.message":`Message`,"config.widgets.messagePlaceholder":`A slash command or any text (e.g. /reload)`,"config.widgets.messageTooltip":`Type / to see built-in, global plugin and Skill commands. Project-level plugin commands won't appear in suggestions but can still be entered and saved manually.`,"config.widgets.sendImmediately":`Send immediately`,"config.widgets.sendMode":`Send mode`,"config.widgets.fillToChatInput":`Fill into chat input`,"config.widgets.sendImmediatelyTooltip":`Send immediately: `,"config.widgets.fillToChatInputTooltip":`Fill into chat input: `,"config.widgets.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.hint":`Quick actions shown on the new-session start screen (below the Pi logo); clicking sends the message immediately or fills it into the chat input, depending on each entry's send mode.`,"config.startScreen.bind":`Bind message`,"config.startScreen.bindTitle":`Bind quick message`,"config.startScreen.bindHint":`Bind a quick message to the start screen.`,"config.startScreen.empty":`No quick messages yet; the start screen will show no quick actions.`,"config.startScreen.unbindTitle":`Unbind message`,"config.startScreen.unbindConfirm":`Unbind "{label}"?`,"config.startScreen.unbind":`Unbind`,"config.widgets.confirm":`Confirm`,"config.widgets.unbindTitle":`Unbind message`,"config.widgets.unbindConfirm":`Unbind "{label}"?`,"config.widgets.unbind":`Unbind`,"config.startScreen.editTitle":`Edit quick message`,"config.startScreen.editHint":`Edit the label, content, and send mode.`,"config.startScreen.reset":`Reset`,"config.startScreen.resetHint":`Restore the built-in default quick messages; keep your own bound messages (ones with the same label as a default are replaced by the default).`,"config.files.save":`Save`,"config.files.saving":`Saving...`,"config.files.saved":`Saved`,"config.files.missing":`Not created yet`,"config.files.placeholder":`Select a config file from the list on the left`,"layout.resizeSidebar":`Resize sidebar`,"layout.resizeWidgetPanel":`Resize widgets panel`,"layout.resizeHint":`Drag to resize. Double-click or press Enter to reset.`,"sidebar.newWorkspace":`New workspace`,"sidebar.searchSessions":`Search sessions`,"sidebar.searchSessionsPlaceholder":`Search sessions…`,"sidebar.justNow":`just now`,"sidebar.minutesAgo":`{count}m ago`,"sidebar.hoursAgo":`{count}h ago`,"sidebar.daysAgo":`{count}d ago`,"sidebar.searchSessionsNoResults":`No matching sessions`,"sidebar.newSessionTitle":`New session in {path}`,"sidebar.refresh":`Refresh`,"directoryPicker.selectDirectory":`Select directory`,"directoryPicker.goToParent":`Go to parent directory`,"directoryPicker.directoryPath":`Directory path`,"directoryPicker.goToDirectory":`Go to directory`,"directoryPicker.go":`Go`,"directoryPicker.loadingDirectories":`Loading directories…`,"directoryPicker.noSubdirectories":`No subdirectories`,"directoryPicker.openBeforeSelecting":`Open this path before selecting it`,"directoryPicker.selectCurrentDirectory":`Select current directory`,"directoryPicker.selectThisFolder":`Select this folder`,"directoryPicker.noDrives":`No drives found`,"directoryPicker.search":`Filter folders`,"directoryPicker.noMatches":`No folders match your filter`,"sidebar.checking":`Checking…`,"sidebar.open":`Open`,"sidebar.cancel":`Cancel`,"sidebar.openRepoRoot":`Worktree switch unavailable`,"sidebar.openRepoRootTitle":`Worktree switching is unavailable here — switch the current working directory to the Git repository root first (from the sidebar).`,"sidebar.gitRepoRootOnly":`Git repo root only`,"sidebar.gitRepoRootOnlyTitle":`Worktrees are available in Git repository roots.`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`Checking worktrees for this directory.`,"sidebar.filterWorktrees":`Filter worktrees…`,"sidebar.noMatchingWorktrees":`No matching worktrees`,"sidebar.switchWorktree":`Switch worktree`,"sidebar.switchWorktreeTitle":`Switch worktree: {path}`,"sidebar.main":`main`,"sidebar.forceRemoveCheckout":`Uncommitted changes. Force remove checkout?`,"sidebar.force":`Force`,"sidebar.createWorktreeTitle":`Create a worktree checkout for a branch`,"sidebar.newWorktree":`New worktree…`,"sidebar.branchName":`branch name`,"sidebar.creating":`Creating…`,"sidebar.create":`Create`,"sidebar.uploadFilesTitle":`Upload files to project root`,"sidebar.uploadFiles":`Upload files`,"sidebar.refreshExplorer":`Refresh explorer`,"sidebar.changedFiles":`{count} changed files`,"sidebar.loading":`Loading...`,"sidebar.sessionDeleted":`Session deleted — pick another session`,"sidebar.noSessions":`No sessions found`,"sidebar.workspace":`Workspace`,"sidebar.newActivity":`New activity`,"sidebar.newSessionActivity":`New session activity`,"sidebar.interactionBadge":`Session waiting for interaction`,"sidebar.deleteSession":`Delete {title}?`,"sidebar.deleteWorkspace":`Delete workspace ({count} sessions)?`,"sidebar.deleteWorkspaceTitle":`Delete this workspace and all its sessions`,"sidebar.copyPath":`Copy full path`,"sidebar.rename":`Rename`,"sidebar.delete":`Delete`,"sidebar.deleteWithShiftClick":`Delete (Shift+click to delete without confirmation)`,"sidebar.expandForks":`Expand forks`,"sidebar.collapseForks":`Collapse forks`,"sidebar.disconnect":`Disconnect`,"sidebar.messagesCount":`{count} msgs`,"sidebar.worktreePath":`Worktree: {path}`,"sidebar.removeWorktreeTitle":`Remove worktree checkout {path}; the branch is kept`,"files.modified":`Modified`,"files.added":`Added`,"files.deleted":`Deleted`,"files.renamed":`Renamed`,"files.untracked":`Untracked`,"files.conflict":`Conflict`,"files.newlyUploaded":`Newly uploaded`,"files.containsChangedFiles":`Contains changed files`,"files.insertPath":`Insert path into chat`,"files.mention":`mention`,"files.download":`Download file`,"files.dismissError":`Dismiss error`,"files.addUploadedFile":`Add uploaded file to chat`,"files.addAllUploadedFiles":`Add all uploaded files to chat`,"files.openInSystemApp":`Open with system app`,"files.chooseOtherApp":`Choose another app…`,"files.openLaunched":`Launched with the system app`,"files.fileTooLargeForPreview":`File too large for preview (>{limit})`,"files.docTooLargeForPreview":`DOCX too large for preview (>{limit})`,"files.dismissUploadResults":`Dismiss upload results`,"files.loading":`Loading files...`,"files.noFiles":`No files found`,"files.find":`Find`,"files.findNext":`Next match (Enter)`,"files.findPrev":`Previous match (Shift+Enter)`,"files.findNoResults":`No results`,"files.findClose":`Close (Esc)`,"loading.inProgress":`Working…`,"loading.more":`{count} more…`,"errors.title":`Error`,"errors.titleCount":`Errors ({count})`,"errors.close":`Close`,"errors.clearAll":`Clear all`,"files.notFound":`Not found`,"files.accessDenied":`Access denied`,"files.empty":`Empty`,"files.uploadFailed":`{count} failed`,"files.explorer":`Explorer`,"files.changedCount":`{count} files`,"files.stagedPrefix":`Staged: `,"files.unstagedPrefix":`Unstaged: `,"files.noStagedChanges":`No staged files`,"files.noUnstagedChanges":`No unstaged changes`,"files.commitMessagePlaceholder":`Commit message`,"files.commit":`Commit`,"files.push":`Push to remote (with tags)`,"files.pushing":`Pushing...`,"files.pushSuccess":`Push succeeded`,"files.pushFailed":`Push failed`,"files.pushUpToDate":`Already up to date — nothing to push`,"files.pull":`Pull from remote`,"files.pulling":`Pulling...`,"files.pullSuccess":`Pull succeeded`,"files.pullFailed":`Pull failed`,"files.pullUpToDate":`Already up to date — nothing to pull`,"files.pullNonFastForward":`Pull rejected — local and remote have diverged. Use git pull --rebase or --merge in terminal.`,"files.committing":`Committing…`,"files.commitMessageRequired":`Enter a commit message first`,"files.commitTitle":`Commit changes`,"files.confirmStageAllCommit":`{count} changed files are not staged. Stage them all and commit?`,"files.stageAllAndCommit":`Stage & commit`,"files.stageFile":`Stage file`,"files.unstageFile":`Unstage file`,"files.changeStats":`{count} changed files, {additions} lines added, {deletions} lines deleted`,"git.autoFetchInterval":`Auto fetch interval (seconds)`,"git.autoFetchIntervalHint":`How often the server fetches remotes for active session workspaces (shared by all clients). 0 disables the timer — one fetch runs when a session connects.`,"git.groupTitle":`Smart Commit Message Generation`,"git.commitModel.followCurrent":`Follow current session model`,"git.commitModel.followCurrentHint":`When on, the commit generation follows the current chat's main model. When off, the fixed model below is used (recommended for a cheap dedicated model).`,"git.commitModel.followCurrentOn":`On: follow current session`,"git.commitModel.followCurrentOff":`Off: use fixed model`,"git.commitModel.fixedModel":`Fixed model`,"git.commitModel.fixedModelHint":`Model used when "follow current session" is off (choose a cheap fixed model; note it may have only ~50k context).`,"git.commitModel.selectPlaceholder":`Select a model`,"git.commitModel.noModels":`No models available`,"git.commitModel.notConfiguredHint":`No fixed model selected. Pick a model before using AI generate.`,"git.ai.generate":`Smart generate`,"git.ai.generating":`Generating…`,"git.ai.notConfiguredTitle":`Model not configured`,"git.ai.notConfiguredDesc":`No model is set for Smart generate. Go to Config Center → Git to set one.`,"git.ai.goToConfig":`Go to settings`,"git.ai.noSession":`Follow-current mode requires an active session`,"git.ai.noSessionModel":`Current session has no model. Select a model in chat first`,"git.commitModel.maxTokens":`Max output tokens`,"git.commitModel.maxTokensHint":`Max output tokens for one generation (64–4096, default 512). Reasoning is minimized: disabled when the model supports it, otherwise reduced to the lowest level.`,"git.commitModel.autoGenerateOnEmpty":`Auto-generate when commit box is empty`,"git.commitModel.autoGenerateOnEmptyHint":`When on, clicking Commit with an empty box auto-generates a message first, then commits. Only when a model is configured; otherwise empty stays disabled. On by default.`,"git.ai.invalidModel":`Configured model is invalid. Reselect it in Config Center.`,"git.ai.autoGenerateOn":`On: auto-generate when empty`,"git.ai.usingCurrentModel":`Using current chat model`,"git.ai.usingModel":`Using {model}`,"git.ai.generateAndCommit":`Smart generate & commit`,"git.ai.autoGenerateOff":`Off`,"git.commitSectionTitle":`Commit`,"git.commitConfirmStageAll":`Confirm “stage all” on commit`,"git.commitConfirmStageAllHint":`When on, committing with only unstaged changes shows a “Stage all & commit” confirmation. When off, it stages all and commits directly. On by default.`,"git.commitConfirmStageAllOn":`On: confirm before staging all`,"git.commitConfirmStageAllOff":`Off: stage all directly`,"modelThinking.desc":`Remember the last thinking level per model or provider. When switching models, the selector restores the remembered level; if the model's available levels don't include it, it falls back to auto (use default). All 7 levels supported: off / minimal / low / medium / high / xhigh / max.`,"modelThinking.byModel":`By model`,"modelThinking.byProvider":`By provider`,"modelThinking.byProviderHint":`Provider fallback: models without a per-model entry use this value.`,"modelThinking.emptyModel":`No per-model memory yet. Selecting a thinking level after switching models will remember it automatically; you can also add one here.`,"modelThinking.emptyProvider":`No per-provider memory yet.`,"modelThinking.selectModelPlaceholder":`Select a model`,"modelThinking.selectProviderPlaceholder":`Select a provider`,"modelThinking.providerInputPlaceholder":`or type a provider name`,"modelThinking.footerHint":`Stored in a standalone file pi-web/model-thinking.json, not the main config. UI-only — pi's set_thinking_level is not intercepted.`,"common.add":`Add`,"common.delete":`Delete`,"files.conflictSummary":`{count} file{countSuffix} already exist: {files}`,"files.cannotReplace":`Cannot replace: {files}`,"files.replace":`Replace`,"files.skipExisting":`Skip existing`,"files.cancel":`Cancel`,"files.checking":`Checking files`,"files.uploading":`Uploading, {progress}%`,"files.search":`Search files`,"files.searchPlaceholder":`Search files...`,"chat.loadingSession":`Loading session...`,"chat.noSessionSelected":`Create or select a session in the left panel`,"chat.loadingWindow":`Loading messages...`,"chat.runningTool":`Running tool...`,"chat.runningNamedTool":`Running {name}...`,"chat.runningTools":`Running {names}...`,"chat.runningToolsMore":`Running {names} (+{count})...`,"chat.waitingModel":`Waiting for model...`,"chat.aiQuestion":`AI question`,"chat.runningCommand":`Running command...`,"chat.totalElapsed":`total {total}`,"chat.thinking":`Thinking...`,"chat.message":`message`,"chat.messages":`messages`,"chat.toolCall":`tool call`,"chat.toolCalls":`tool calls`,"chat.collapseProcess":`Collapse process details`,"chat.expandProcess":`Expand process details`,"chat.loadEarlier":`Scroll up to load earlier messages ({count} hidden)`,"chat.searchMessages":`Search messages`,"chat.clearSearch":`Clear search query`,"chat.scrollToLatest":`Scroll to latest message`,"chat.expandMessage":`Expand full content`,"chat.searchPlaceholder":`Search chat messages…`,"chat.searchNoResults":`No results`,"chat.searchResults":`{count} results`,"chat.extensionRequest":`extension request`,"chat.cancel":`Cancel`,"chat.skipped":`Skipped`,"chat.confirm":`Confirm`,"chat.submit":`Submit`,"chat.extensionInput":`Extension terminal input`,"chat.extensionSelect":`Select an option`,"chat.extensionConfirm":`Confirm`,"chat.extensionEditor":`Edit`,"chat.extensionPanel":`Extension panel`,"chat.close":`Close`,"chat.notifyInfoTitle":`Info`,"chat.notifySuccessTitle":`Success`,"chat.notifyErrorTitle":`Error`,"chat.notifyWarningTitle":`Warning`,"chat.queued":`Queued · {count}`,"chat.recall":`Recall to input`,"chat.recallTitle":`Remove all queued messages and put them back into the input box for editing (also triggered by pressing Enter while the input is empty)`,"chat.retrying":`Retrying ({attempt}/{max})…`,"chat.loadingCommands":`Loading commands...`,"chat.slashCommands":`Slash commands · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`No extension, prompt, or skill commands found`,"chat.match":`1 match`,"chat.matches":`{count} matches`,"chat.command":`1 command`,"chat.commands":`{count} commands`,"chat.loadingFiles":`Loading files...`,"chat.files":`Files · {label}{hint}`,"chat.searching":`Searching…`,"chat.noMatchingFiles":`No matching files`,"chat.searchingAll":` · searching all files…`,"chat.indexTruncated":` · index truncated`,"chat.steerPlaceholder":`Steer now / queue follow-up...`,"chat.recallPlaceholder":`Press Enter to recall queued messages, or type a new message…`,"chat.agentPlaceholder":`Agent is running…`,"chat.messagePlaceholder":`Message… Type / for commands, @ for files, ! for shell`,"chat.questionNotificationTitle":`Pi — Question Asked`,"chat.taskCompleteNotificationTitle":`Pi — Task Complete`,"chat.taskErrorNotificationTitle":`Pi — Error`,"chat.sessionCompletedNotificationBody":`Session {name} completed`,"chat.questionNotificationDenied":`Notifications denied: allow them in the browser's site settings to get question alerts while the tab is hidden.`,"chat.steer":`Steer`,"chat.followUp":`Follow-up`,"chat.queueImageBlocked":`Image attachments cannot be queued while the agent is running`,"chat.steerTooltip":`Send this message immediately after the current call finishes`,"chat.followUpTooltip":`Queue this message after the agent finishes`,"chat.send":`Send`,"chat.attachImage":`Attach image`,"chat.attachmentOnDisk":`Too large to inline; saved to disk and referenced by path (the agent reads it on demand)`,"chat.filterModels":`Filter models…`,"chat.noMatchingModels":`No matching models`,"chat.moreControls":`More controls`,"chat.collapseControls":`Collapse controls`,"chat.shell":`Shell`,"chat.outputLocal":`output stays local`,"chat.outputModel":`output sent to model`,"chat.noTools":`No tools, read-only`,"chat.builtInTools":`{count} built-in tools`,"chat.allBuiltInTools":`All built-in tools`,"chat.changeReasoning":`Change reasoning level: {level}`,"chat.changeReasoningLabel":`Change reasoning level`,"chat.changeToolPreset":`Change tool preset`,"chat.stopCompaction":`Stop compaction`,"chat.compactContext":`Compact context`,"chat.compacting":`Compacting…`,"chat.compactionDisabledByExtension":`Native context compaction is taken over by an extension, so it can't run here.`,"chat.compact":`Compact`,"chat.stopAgent":`Stop agent`,"chat.stop":`Stop`,"chat.disableSound":`Disable completion sound`,"chat.enableSound":`Enable completion sound`,"chat.thinkingUseDefault":`Use pi default`,"chat.thinkingOff":`Reasoning off`,"chat.thinkingMinimal":`Minimal reasoning`,"chat.thinkingLow":`Low reasoning`,"chat.thinkingMedium":`Medium reasoning`,"chat.thinkingHigh":`High reasoning`,"chat.thinkingXhigh":`Extra-high reasoning`,"chat.thinkingMax":`Max reasoning`,"chat.thinkingMapTitle":`Higher thinking levels not configured`,"chat.thinkingMapBody":`pi supports up to high thinking by default. To enable {level} level reasoning, configure the "Thinking Level Map" for this model in Config → Models.`,"chat.thinkingMapGo":`Go to settings`,"chat.builtIn":`Built-in`,"chat.extensions":`Extensions`,"chat.prompts":`Prompts`,"chat.skills":`Skills`,"chat.dormant":`dormant`,"chat.commandCompact":`Compress context, optionally with instructions`,"chat.commandReload":`Reload extensions, skills, prompts, and tools`,"chat.commandName":`Set the session display name`,"chat.commandSession":`Show session message, token, and cost stats`,"chat.commandCopy":`Copy the last assistant message`,"chat.compacted":`Compacted`,"chat.tokensSaved":`{saved} saved`,"i18n.close":`Close`,"i18n.resizeList":`Resize {name} list`,"widgets.title":`Widgets`,"widgets.reopen":`Reopen widget`,"widgets.expandedToChat":`Widget [{key}] expanded to the chat view`,"widgets.collapse":`Collapse`,"widgets.open":`Open widgets`,"i18n.copy":`Copy`,"i18n.copied":`Copied`,"i18n.copyToolInput":`Copy raw JSON`,"i18n.cancel":`Cancel`,"i18n.save":`Save`,"i18n.saving":`Saving…`,"i18n.saved":`Saved`,"i18n.saveChanges":`Save changes`,"i18n.noThinking":`No thinking content`,"i18n.remove":`Remove`,"i18n.removing":`Removing…`,"i18n.delete":`Delete`,"i18n.loading":`Loading...`,"i18n.searchPlaceholder":`Search…`,"i18n.noMatch":`No matches`,"i18n.search":`Search`,"i18n.refresh":`Refresh`,"i18n.update":`Update`,"i18n.updating":`Updating...`,"i18n.check":`Check`,"i18n.checking":`Checking...`,"i18n.install":`Install`,"i18n.installing":`Installing...`,"i18n.noResults":`No results`,"i18n.searchProviders":`Search providers…`,"i18n.noProviders":`No providers match`,"i18n.newModel":`new model`,"i18n.addProvider":`Add provider`,"i18n.selectProviderModel":`Select a provider or model`,"i18n.visibleInPrompt":`Visible in model prompt — click to disable`,"i18n.hiddenFromPrompt":`Hidden from model prompt — click to enable`,"i18n.dormant":`Dormant`,"i18n.hiddenButInvocable":`Hidden from model, still manually invocable`,"i18n.skillSearchPlaceholder":`e.g. react, testing, deploy`,"i18n.searching":`Searching…`,"i18n.noSkills":`No skills found`,"i18n.checkUpdates":`Check updates`,"i18n.updates":`updates`,"i18n.noResolvedResources":`No resolved resources`,"i18n.enablePackage":`Enable package`,"i18n.disablePackage":`Disable package`,"i18n.filtered":`filtered`,"i18n.openSessionToReload":`Open a session to reload`,"i18n.notFound":`Not found`,"i18n.noPlugins":`No plugins configured`,"trust.resourcesNotLoaded":`Restricted mode`,"trust.trustProject":`Trust project`,"trust.trusting":`Trusting...`,"trust.cancel":`Cancel`,"trust.dialogTitle":`Trust this project?`,"trust.dialogBody":`Project resources can run local code. Trust only projects whose contents you know.`,"trust.skillsNotLoaded":`Project skills are not loaded because this project is not trusted.`,"trust.pluginsNotLoaded":`Project plugins are not loaded because this project is not trusted.`,"trust.projectScopeUnavailable":`Project installs are unavailable while project resources are not loaded.`,"i18n.creatingSession":`Creating new session…`,"i18n.creating":`Creating…`,"i18n.subscription":`Subscription`,"i18n.subscriptions":`Subscriptions`,"i18n.customEndpoint":`Custom endpoint format`,"i18n.noChanges":`No changes`,"i18n.branches":`Branches`,"i18n.noActiveSession":`No active session`,"i18n.noActiveSessionToCompact":`No active session to compact`,"i18n.noActiveSessionToReload":`No active session to reload`,"i18n.noActiveSessionToName":`No active session to name`,"i18n.noAssistantMessageToCopy":`No assistant message to copy`,"i18n.commandCompleted":`Command completed`,"i18n.commandFailed":`Command failed`,"i18n.extensionCommandFailed":`Extension command failed`,"i18n.compactedContext":`Compacted context`,"i18n.reloadedSessionResources":`Reloaded session resources`,"i18n.usageName":`Usage: /name <name>`,"i18n.sessionRenamedTo":`Session renamed to {name}`,"i18n.copiedLastAssistantMessage":`Copied last assistant message`,"i18n.failedToRecallQueuedMessages":`Failed to recall queued messages`,"i18n.noBranches":`This session has no branches`,"i18n.source":`Source`,"i18n.preview":`Preview`,"i18n.diff":`Diff`,"i18n.downloadFile":`Download file`,"i18n.liveSync":`Live sync active`,"i18n.notWatching":`Not watching`,"i18n.fileViewMode":`File view mode`,"i18n.editMode":`Edit mode`,"i18n.viewMode":`View mode`,"i18n.compareHead":`Compare working tree with HEAD`,"i18n.mentionSelectedLines":`Mention selected lines`,"i18n.disableWrap":`Disable word wrap`,"i18n.enableWrap":`Enable word wrap`,"i18n.editFile":`Edit file`,"i18n.saveFile":`Save`,"i18n.saveFileShortcut":`Save (Ctrl/Cmd+S)`,"i18n.cancelEdit":`Cancel`,"i18n.saveFailed":`Save failed: {error}`,"i18n.unsavedChanges":`Unsaved changes`,"i18n.htmlPreview":`HTML preview`,"i18n.previewFile":`Preview {file}`,"i18n.invalidMermaid":`Invalid Mermaid diagram`,"i18n.renderingMermaid":`Rendering Mermaid diagram`,"i18n.previewAfterStreaming":`Preview available after streaming`,"i18n.showMermaidSource":`Show Mermaid source`,"i18n.previewMermaid":`Preview Mermaid diagram`,"i18n.openMermaidViewer":`Open diagram viewer`,"i18n.mermaidViewer":`Mermaid diagram viewer`,"i18n.mermaidDiagram":`Mermaid diagram`,"i18n.zoomOut":`Zoom out`,"i18n.zoomIn":`Zoom in`,"i18n.fitToWidth":`Fit to width`,"models.discoveryFetching":`Importing models…`,"models.deleteProviderConfirm":`Delete provider "{name}"? This writes to models.json immediately — all its settings (including the API key) will be removed and cannot be recovered.`,"models.renameProviderDialogTitle":`Rename Provider`,"models.renameProviderHint":`Renaming writes to models.json immediately and migrates this provider's API key and login credential; other unsaved edits are not saved with it.`,"models.renameProviderConflict":`Provider "{name}" already exists — pick another name.`,"models.renameProviderBuiltin":`"{name}" is a built-in provider — it can't be used as a custom provider name.`,"models.renameProviderEmpty":`Name must not be empty.`,"models.removeModelConfirm":`Remove model "{model}"? This writes to models.json immediately and cannot be recovered.`,"models.discoveryTitle":`Import models`,"models.discoveryFetch":`Import models…`,"models.discoveryFilterPlaceholder":`Filter {count} models…`,"models.discoveryFilter":`Filter upstream models`,"models.discoverySelectShown":`Select shown`,"models.discoveryNoMatches":`No matching models.`,"models.discoveryAdded":`added`,"models.discoveryShowing":`Showing first {shown} of {total}`,"models.discoveryFetched":`{count} models fetched`,"models.discoveryAddSelected":`Add selected`,"models.setDefault":`Set as default`,"models.defaultModel":`Default model`,"models.defaultModelUnavailable":`Default model {model} is unavailable (deleted or hidden). Please select a model.`,"models.syncEndpoint":`Sync from endpoint`,"models.lastSyncedAt":`Last synced {time}`,"models.neverSynced":`Never synced`,"models.discoveryFetchTooltip":`Imports from the local cache first: {path}. If absent, syncs from the endpoint once and writes the cache there.`,"models.syncingModels":`Syncing…`,"models.syncedModels":`Synced {count} models`,"models.syncEndpointTooltip":`Fetch the latest model list from {endpoint} and cache it locally; the cached list replaces the built-in one.`,"models.syncEndpointTooltipGeneric":`Fetch the latest model list from this provider's models endpoint and cache it locally; the cached list replaces the built-in one.`,"models.refreshFromCache":`Refresh from synced cache`,"models.refreshing":`Refreshing…`,"models.refreshFromCacheTooltip":`Re-read pi-web/provider/{provider}/models.json and update only the fields that differ from the current effective definition (manual fields like headers are kept).`,"models.refreshNoDiff":`Synced cache matches the effective definition — nothing to update.`,"models.refreshDone":`Override updated from synced cache.`,"models.refreshTimeout":`Refresh timed out — try again later.`,"models.builtinProviders":`Built-in providers`,"models.customProviders":`Custom providers`,"models.syncSaveFailed":`Save draft before sync failed — sync aborted.`,"models.visibleInChat":`Visible in chat`,"models.visibleModels":`Model list`,"models.visibleModelsCount":`{visible} / {total} selected`,"models.visibilityCustomized":` · Customized`,"models.visibilityUncustomized":` · Not customized (all visible by default)`,"models.showAll":`Reset`,"models.showAllHint":`All models visible`,"models.filterLabel":`Filter:`,"models.invertSelection":`Invert checks`,"models.searchModels":`Search models…`,"models.noModels":`No models for this provider.`,"models.noMatchingModels":`No matching models.`,"models.filterAll":`All`,"models.filterVisible":`Visible only`,"models.filterHidden":`Hidden only`,"models.invertDisabledTooltip":`All models are already visible; inverting changes nothing`,"models.openOverride":`Override model params`,"models.overrideHint":`Values shown are the effective definition (built-in merged with saved overrides). Only fields you change are saved as overrides; everything else keeps inheriting the built-in definition.`,"models.overrideOrphanedHint":`This model no longer exists upstream. The local override is still saved — you can remove it here. Saving will also clean up its visibility entry.`,"models.removeOverride":`Remove override`,"models.providerNameCollision":`Provider "{provider}" conflicts with built-in "{builtin}" (case-insensitive); model visibility cannot be applied. Rename or remove the provider.`,"models.providerNameCollisionShort":`Name conflicts with built-in provider`,"models.builtinVisibilityBlocked":`Model visibility is disabled: custom provider "{custom}" conflicts with "{builtin}" (case-insensitive). Rename or remove the custom provider.`,"models.discoveryAddSelectedCount":`Add selected ({count})`,"models.dataSourceLabel":`Data source:`,"models.catalogSourceEndpoint":`Models endpoint`,"models.catalogSourceDev":`models.dev catalog`,"models.catalogSourceEndpointTooltip":`Source: Provider's /models endpoint`,"models.catalogSourceDevTooltip":`Source: models.dev built-in catalog (https://models.dev)`,"models.catalogEndpointNotFound":`Model ID not found in the models endpoint response`,"models.catalogOverwriteTitle":`Overwrite existing fields?`,"models.catalogOverwriteBody":`{{count}} field(s) already have values that overwriting would change: {{fields}}. Cancel to fill empty fields only.`,"models.catalogOverwriteConfirm":`Overwrite & fill`,"models.catalogOverwriteCancel":`Fill empty only`,"models.catalogFilling":`Filling details…`,"models.catalogFill":`Fill model details`,"models.catalogFilled":`{count} fields filled`,"models.catalogNoEmptyFields":`No empty fields to fill`,"models.catalogNoExactMatch":`No exact models.dev match`,"models.catalogPriceProvider":`Price matched Provider {provider}`,"models.catalogPriceBaseUrl":`Price matched Base URL to {provider}`,"models.catalogPriceConsensus":`Price agreed by {support}/{total} records`,"models.catalogPriceUnreliable":`No reliable price found`,"models.catalogUndo":`Undo`,"models.baseUrl":`Base URL`,"models.apiKey":`API Key`,"models.api":`API Format`,"models.modelId":`ID *`,"models.name":`Name`,"models.apiOverride":`API format`,"models.reasoningThinking":`Reasoning / thinking`,"models.inputFormat":`Input formats`,"models.inputFormatPlaceholder":`Search and add, multiple allowed (Enter to confirm)`,"models.inputFormat.text":`Text`,"models.inputFormat.image":`Image`,"models.badgeReasoning":`Supports reasoning (thinking levels selectable in the chat input)`,"models.badgeInput":`Accepts {format} input`,"models.nameHint":`Leaving empty removes the name field (falls back to the model id).`,"models.apiOverrideHint":`Leaving empty or picking default removes the api field (falls back to the provider's default api).`,"models.reasoningHint":`Unchecking removes the reasoning field (falls back to off).`,"models.thinkingLevelMapHint":`Per level: Default = removes that mapping (falls back to the model's default level); Disabled = writes null; Custom = writes a custom level string.`,"models.compatSection":`Compatibility`,"models.compatInheritHint":`Fields not set on the model show values inherited from this provider (highlighted in dim color); the inherited value is what actually takes effect until overridden here.`,"models.compatHint.supportsDeveloperRole":`Whether to use the developer role for system prompts (used by reasoning models). Set to false for servers that don't support it (Ollama, vLLM, SGLang) to send system messages instead.`,"models.compatHint.supportsLongCacheRetention":`Whether the provider accepts long cache retention: prompt_cache_options.ttl "30m" for GPT-5.6+ Responses models, prompt_cache_retention "24h" for older OpenAI models, or cache_control.ttl "1h" with the anthropic cache format.`,"models.compatHint.supportsUsageInStreaming":`Whether streamed responses support stream_options: {include_usage: true} for token usage reporting.`,"models.compatHint.supportsFinishReason":`Whether streamed responses include finish_reason. When false, pi infers stop or toolUse when the stream ends.`,"models.compatHint.supportsEagerToolInputStreaming":`Whether the provider accepts per-tool eager_input_streaming. Set to false to omit that field and use the legacy fine-grained-tool-streaming beta header.`,"models.compatHint.supportsCacheControlOnTools":`Whether the provider accepts Anthropic-style cache_control markers on tool definitions (tool prompt caching).`,"models.compatHint.supportsTemperature":`Whether the provider accepts the temperature parameter. Set to false for endpoints that reject non-default temperatures (e.g. Claude Opus 4.7+).`,"models.compatHint.requiresToolResultName":`Whether tool result messages must include the name field (required by some endpoints).`,"models.compatHint.requiresAssistantAfterToolResult":`Whether an empty assistant message must be inserted after tool results and before the next user message (required by some endpoints).`,"models.compatHint.requiresThinkingAsText":`Whether thinking blocks should be converted to plain text (for endpoints without thinking block support).`,"models.compatHint.zaiToolStream":`Whether z.ai supports the top-level tool_stream: true parameter for streaming tool call deltas.`,"models.compatHint.supportsThinkingTokenBudget":`Whether the provider supports the top-level thinking_token_budget field to cap reasoning tokens (vLLM-compatible endpoints).`,"models.compatHint.supportsOpenAIGrammarTools":`Whether OpenAI-compatible APIs emit custom Lark/regex grammar tools. When false, grammar-constrained tools fall back to normal function tools.`,"models.compatHint.supportsToolSearch":`Whether the model supports client-executed tool search for deferred tools.`,"models.compatHint.supportsExplicitPromptCacheMode":`Whether the model accepts the prompt_cache_options parameter (OpenAI GPT-5.6+ prompt caching). Older OpenAI models reject it.`,"models.compatHint.forceAdaptiveThinking":`Whether to force adaptive thinking (thinking.type: "adaptive" + output_config.effort) instead of the legacy budget-based thinking payload. Built-in adaptive models set this automatically.`,"models.compatHint.allowEmptySignature":`Whether to replay empty thinking signatures as signature: "". Enable only for Anthropic-compatible endpoints that require it; real Anthropic rejects empty signatures.`,"models.compatHint.supportsStrictTools":`Whether the endpoint accepts strict JSON-schema tool definitions (Anthropic). Built-in Anthropic models enable it.`,"models.compatHint.supportsStore":`Whether the OpenAI endpoint supports the store field.`,"models.compatHint.supportsReasoningEffort":`Whether the endpoint supports the reasoning_effort parameter (often unsupported by Ollama, vLLM, SGLang).`,"models.compatHint.supportsStrictMode":`Whether the endpoint accepts strict JSON-schema function tool definitions. Defaults depend on the API; built-in OpenAI models carry explicit capability metadata.`,"models.compatHint.supportsToolReferences":`Whether tool references in tool results are supported. Default true for first-party Anthropic models except Haiku and models older than Claude 4.5.`,"models.compatHint.maxTokensField":`Field name for the max output token parameter: max_completion_tokens (new API) or max_tokens (legacy API).`,"models.compatHint.sessionAffinityFormat":`Session affinity (caching): sends the session id as an affinity key so requests from one session tend to hit the same backend replica, raising the prompt-cache hit rate — endpoints like Fireworks route prompt caches by session affinity, so leaving it off can spread a session across replicas and waste cache reuse (it does not affect the prompt_cache_key body param, which is governed by cache retention). pi sends these headers only when compat.sendSessionAffinityHeaders is true (openai-responses keys off the format alone); this dropdown writes both fields. auto = enabled with the format auto-detected from the URL; off = explicit disable (overrides a provider-level enable at model level); openai = session_id/x-client-request-id/x-session-affinity; openai-nosession = x-client-request-id/x-session-affinity; openrouter = x-session-id.`,"models.compatHint.deferredToolsMode":`Provider-specific deferred tool serialization. Currently only kimi (Kimi's OpenAI-compatible Chat Completions format).`,"models.compatHint.cacheControlFormat":`Prompt cache marker format. Currently only anthropic: adds cache_control markers on the system prompt, last tool definition, and last text content.`,"models.inheritedFromProvider":`from provider (inherited, override at model level)`,"models.thinkingFormatDeepseekHint":`Selecting "deepseek" also writes requiresReasoningContentOnAssistantMessages: true; any other value removes it.`,"models.samplingParams":`Sampling params`,"models.headers":`Headers`,"models.modelOverrides":`Model overrides`,"models.supportsDeveloperRole":`Developer role`,"models.supportsLongCacheRetention":`Long cache retention`,"models.supportsUsageInStreaming":`Usage in streaming`,"models.supportsFinishReason":`Finish reason in stream`,"models.supportsEagerToolInputStreaming":`Eager tool input streaming`,"models.supportsCacheControlOnTools":`Cache control on tools`,"models.supportsTemperature":`Temperature param`,"models.requiresToolResultName":`Tool result name required`,"models.requiresAssistantAfterToolResult":`Assistant after tool result`,"models.requiresThinkingAsText":`Thinking as text`,"models.requiresReasoningContentOnAssistantMessages":`Reasoning content on assistant`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`Thinking token budget`,"models.supportsOpenAIGrammarTools":`OpenAI grammar tools`,"models.supportsToolSearch":`Tool search`,"models.supportsExplicitPromptCacheMode":`Explicit prompt cache`,"models.forceAdaptiveThinking":`Adaptive thinking`,"models.allowEmptySignature":`Empty thinking signature`,"models.supportsStrictTools":`Strict tool schemas`,"models.supportsStore":`Store param`,"models.supportsReasoningEffort":`Reasoning effort`,"models.supportsStrictMode":`Strict mode`,"models.supportsToolReferences":`Tool references`,"models.maxTokensField":`Max tokens field`,"models.sessionAffinityFormat":`Session affinity`,"models.deferredToolsMode":`Deferred tools mode`,"models.cacheControlFormat":`Cache control format`,"models.thinkingFormat":`Thinking format`,"models.chatTemplateKwargs":`Chat template kwargs`,"models.chatTemplateArgs":`Chat template args`,"models.openRouterRouting":`OpenRouter routing`,"models.vercelGatewayRouting":`Vercel gateway routing`,"models.thinkingLevelMap":`Thinking level`,"models.thinkingLevelMapReset":`Reset (clear)`,"models.thinkingLevelMapResetHint":`Clears the entire thinkingLevelMap: off, minimal, low, medium, high fall back to their defaults; xhigh and max are disabled by default.`,"models.thinkingLevelMapNone":`All disabled`,"models.contextWindow":`Context window (tokens)`,"models.maxOutputTokens":`Max output tokens`,"models.costPerMillion":`Cost (per million tokens)`,"models.cost.input":`Input`,"models.cost.output":`Output`,"models.cost.cacheRead":`Cache read`,"models.cost.cacheWrite":`Cache write`,"models.costNotSet":`Not set`,"models.costAllRequired":`All four rates are required`,"models.costClear":`Clear`,"models.apiKeyPlaceholder":`ENV_VAR_NAME, !shell-command, or literal key`,"models.apiKeyHint":`Literal keys are written to auth.json on save (shared with CLI /login, takes precedence over this field); !shell-command and $ENV references stay in models.json.`,"models.authJsonConnected":`API key provided via auth.json`,"models.authJsonRemove":`Remove`,"models.apiKeyPrompt":`Enter your {provider} API key to enable {count} model{s}.`,"models.oauthAlreadyConnected":`Already connected. You can re-login or disconnect.`,"models.oauthConnectPrompt":`Connect your {provider} account.`,"models.enterValue":`Enter value…`,"models.displayNamePlaceholder":`Display name`,"models.connectionLost":`Connection lost`,"models.networkError":`Network error`,"i18n.testingModel":`Testing model connection...`,"i18n.connected":`Connected`,"i18n.failed":`Failed`,"i18n.test":`Test`,"i18n.testConnection":`Test model connection`,"i18n.provider":`Provider`,"i18n.providers":`Providers`,"i18n.model":`Model`,"i18n.providerName":`Name`,"i18n.rename":`Rename`,"i18n.default":`Default`,"i18n.disabled":`Disabled`,"plugins.statusLoaded":`Loaded and active`,"plugins.statusInstalled":`Installed, not yet loaded`,"plugins.statusDisabled":`Disabled`,"plugins.statusMissing":`Configured but package not found`,"plugins.extensionFilters":`Extension filters`,"plugins.filterRules":`Filter rules`,"plugins.managePlugins":`Plugins`,"plugins.extensionFiltersHint":`Filters for auto-discovered extensions in ~/.pi/agent/extensions/ and .pi/extensions/. Only patterns starting with !, +, or - take effect; plain paths do nothing.`,"plugins.noExtensionFilters":`No filters configured`,"plugins.addFilter":`Add filter`,"plugins.filterPatternLabel":`Pattern`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`Pattern must start with !, +, or -; plain paths have no effect in the extensions field.`,"plugins.filterPrefixExclude":`Exclude matching extensions`,"plugins.filterPrefixForceInclude":`Force-include exact path`,"plugins.filterPrefixForceExclude":`Force-exclude exact path`,"plugins.filterEffect":`Effect`,"plugins.removeFilter":`Remove filter`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`Package installed.`,"plugins.packageUpdated":`Package updated.`,"plugins.packageRemoved":`Package removed.`,"plugins.packageDisabled":`Package disabled.`,"plugins.packageEnabled":`Package enabled.`,"plugins.extensionFilterAdded":`Extension filter added.`,"plugins.extensionFilterRemoved":`Extension filter removed.`,"plugins.sessionReloaded":`Session reloaded.`,"i18n.noResources":`No resources`,"i18n.unknown":`Unknown`,"i18n.installedVersion":`installed {version}`,"i18n.configuredVersion":`configured {version}`,"i18n.extensions":`Extensions`,"i18n.prompts":`Prompts`,"i18n.themes":`Themes`,"i18n.resourceCount":`{count} {label}`,"i18n.extensionShort":`ext`,"i18n.versionShort":`ver`,"i18n.skillShort":`skills`,"i18n.promptShort":`prompts`,"i18n.themeShort":`themes`,"i18n.custom":`Custom`,"i18n.clearAll":`clear all`,"i18n.connectedSuccessfully":`Connected successfully.`,"i18n.notConnected":`not connected`,"i18n.configured":`configured`,"i18n.notConfigured":`not configured`,"i18n.openingBrowser":`Opening browser…`,"i18n.submit":`Submit`,"i18n.login":`Login`,"i18n.relogin":`Re-login`,"i18n.disconnect":`Disconnect`,"i18n.networkError":`Network error`,"i18n.continuing":`Continuing…`,"i18n.skills":`Skills`,"i18n.plugins":`Plugins`,"i18n.addSkill":`Add skill`,"i18n.addPlugin":`Add plugin`,"i18n.recommendedPlugins":`Recommended`,"i18n.selectSkill":`Select a skill`,"i18n.selectPackage":`Select a package`,"i18n.configBindings":`Bound config files`,"i18n.addBinding":`Add`,"i18n.configFileNote":`Note (optional)`,"i18n.bindConfigFile":`Bind config file`,"i18n.selectFile":`Select a file`,"i18n.noConfigBindings":`No config files bound`,"i18n.noFiles":`No files`,"i18n.allFiles":`All files`,"i18n.filterByType":`Filter by type`,"i18n.removeBinding":`Remove binding`,"i18n.confirm":`Confirm`,"i18n.updateAvailable":`Update available`,"i18n.upToDate":`Up to date`,"i18n.automaticChecksUnavailable":`Automatic checks unavailable`,"i18n.checkFailed":`Check failed`,"i18n.installed":`Installed`,"i18n.status":`Status`,"i18n.version":`Version`,"i18n.package":`Package`,"i18n.resources":`Resources`,"i18n.installedPath":`Installed path`,"i18n.readme":`README`,"i18n.readmeDetails":`Details`,"i18n.unsafeLinkBlocked":`Blocked unsafe link (only same-directory or sub-directory relative links are allowed): {href}`,"i18n.resolvedResources":`Resolved Resources`,"i18n.reloadSession":`Reload session`,"i18n.reloading":`Reloading...`,"i18n.packageRemoved":`Package removed.`,"i18n.packageInstalled":`Package installed.`,"i18n.packageUpdated":`Package updated.`,"i18n.packageDisabled":`Package disabled.`,"i18n.packageEnabled":`Package enabled.`,"i18n.sessionReloaded":`Session reloaded.`,"i18n.thinking":`Thinking`,"i18n.loadingThinking":`Loading thinking...`,"i18n.copyMessage":`Copy message`,"i18n.editFromHere":`Edit from here`,"i18n.editFromHereTitle":`Edit from here — branches within this session`,"i18n.newSession":`New session`,"i18n.newSessionTitle":`New session — creates an independent copy from here`,"i18n.estimatedTokens":`Estimated token count while streaming`,"i18n.noOutput":`(no output)`,"i18n.noSummary":`(no summary)`,"i18n.conversationCompacted":`Conversation compacted`,"i18n.compactionDescription":`The conversation history before this point was compacted into the following summary:`,"i18n.fileContext":`File context: {details}`,"i18n.readFiles":`Read files`,"i18n.modifiedFiles":`Modified files`,"i18n.hiddenExtensionMessage":`hidden extension message`,"i18n.noMessage":`(no message)`,"i18n.showExtensionMessage":`Show extension message`,"i18n.collapse":`Collapse`,"i18n.expand":`Expand`,"i18n.hideDetails":`Hide details`,"i18n.showDetails":`Show details`,"i18n.thinkingUnavailable":`Thinking content unavailable`,"i18n.thinkingEncrypted":`Thinking content is encrypted (provider-encrypted for context continuity, plaintext not available)`,"i18n.before":`Before`,"i18n.after":`After`}},ke={id:`zh-CN`,label:`简体中文`,messages:{"common.ok":`确定`,"common.language":`语言`,"common.models":`模型`,"common.skills":`技能`,"common.plugins":`插件`,"sidebar.hide":`收起侧边栏`,"sidebar.show":`展开侧边栏`,"theme.light":`切换到浅色模式`,"preferences.defaultThinkingLevel":`默认思考级别`,"preferences.thinkingLevelHint":"新会话的全局默认思考级别(settings.json `defaultThinkingLevel`)。未设置=删除该字段(回落 pi 默认)。","preferences.thinkingLevelNotSet":`未设置(跟随模型默认)`,"preferences.compaction":`自动压缩`,"preferences.compactionHint":"自动压缩长会话(settings.json `compaction`)。未配置时按 pi 默认值展示,改动即写入完整对象。","preferences.compactionEnabled":`启用`,"preferences.compactionReserveTokens":`输出预留词元数`,"preferences.compactionReserveTokensHint":`为模型输出预留的词元数,压缩时保留这部分空间供回复使用`,"preferences.compactionKeepRecentTokens":`压缩后保留词元数`,"preferences.compactionKeepRecentTokensHint":`压缩后保留的词元数,从最近聊天记录开始逆向往前计算`,"preferences.retry":`API 重试`,"preferences.retryHint":"供应商 API 调用的重试设置(settings.json `retry`)。未配置时按 pi 默认值展示,改动即写入完整对象;provider 子字段留空则不写入。","preferences.retryEnabled":`启用重试`,"preferences.retryEnabledHint":`是否对失败的 API 调用启用重试`,"preferences.retryMaxRetries":`最大重试次数`,"preferences.retryBaseDelayMs":`基础延迟(毫秒)`,"preferences.retryBaseDelayMsHint":`首次重试前的初始延迟,单位毫秒`,"preferences.retryProviderTimeoutMs":`供应商超时(毫秒)`,"preferences.retryProviderMaxRetries":`供应商最大重试次数`,"preferences.retryProviderMaxRetryDelayMs":`供应商最大延迟(毫秒)`,"preferences.defaultProjectTrust":`新项目默认信任`,"preferences.projectTrustHint":"新项目的默认信任策略(settings.json `defaultProjectTrust`)。未设置=删除该字段(回落「询问」)。","preferences.projectTrustNotSet":`未设置(询问)`,"preferences.projectTrustAsk":`询问`,"preferences.projectTrustAlways":`总是信任`,"preferences.projectTrustNever":`从不信任`,"preferences.notifyEvents":`通知`,"preferences.notifyEventsHint":`标签页非激活时发浏览器通知。权限在首次交互时请求。`,"notify.permission.request":`开启通知`,"notify.permission.requestHint":`点击开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.granted":`通知已开启`,"notify.permission.grantedHint":`已开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.bannerHintBefore":`点击左上工具栏的`,"notify.permission.bannerHintAfter":`按钮开启通知权限,任务完成、出错或提问时都能收到浏览器通知,详细设置可在 配置中心 → 会话 → 通知 栏目中调整`,"notify.permission.denied":`通知被阻止`,"notify.permission.deniedHint":`浏览器阻止了通知。请点击地址栏左侧图标 → 站点设置,将通知改为允许后重试`,"preferences.notifyWhileActive":`页面激活时也通知`,"preferences.notifyTaskComplete":`任务完成`,"preferences.notifyErrors":`运行出错`,"preferences.notifyQuestions":`提问`,"preferences.subagentsDefaultModel":`子代理默认模型`,"preferences.subagentsDefaultThinking":`子代理默认思考级别`,"preferences.subagentsHint":"子代理默认配置(settings.json `subagents`)。defaultThinking 未设置=删除该子字段(回落 pi 默认)。","preferences.subagentsModelPlaceholder":`供应商/模型-id`,"theme.dark":`切换到深色模式`,"theme.toggleTheme":`切换主题`,"theme.darkMode":`深色`,"theme.lightMode":`浅色`,"theme.fontSize":`字体大小`,"theme.scrollStep":`悬停滚动步长`,"scrollStep.hint":`悬停滚动方向箭头时,内容每次滚动的像素数(面板滚动箭头与消息地图共用此步长)。`,"scrollStep.range":`每次悬停滚动像素(1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`自动重载聊天消息间隔`,"autoReload.off":`关闭(0)— 不自动刷新`,"autoReload.range":`秒(0 — 3600)`,"autoReload.unit":`秒`,"autoReload.hint":`自动重新读取会话文件的间隔秒数;0 = 关闭。单客户端场景(消息经 SSE 实时推送)保持 0 即可;多客户端协作(多个浏览器同时操作同一会话)时设为大于 0,各客户端定时刷新以读取其他客户端生成的新聊天消息。`,"recentBlocks.hint":`保持展开的最近已完成块数(含最新完成的块本身;默认 0,即所有已完成块默认收起,可悬停预览/点击展开)。`,"autoReload.reset":`恢复默认({n} 秒)`,"chat.reloadFromDisk":`从磁盘重新加载会话`,"chat.reloadFromDiskHint":`当多个客户端同时读写同一个会话 jsonl 时使用。可在 配置中心 → 会话 页面设置自动定时重载。`,"scrollStep.reset":`恢复默认({n} px)`,"theme.recentBlocksExpanded":`最近完成块保持展开数`,"layout.sidebarWidth":`左侧面板宽度`,"layout.widgetPanelWidth":`右侧面板宽度`,"layout.widthRange":`px({min}–{max})`,"layout.widthReset":`恢复默认({value} px)`,"longBlock.blocks":`个`,"recentBlocks.reset":`恢复默认({n} 个)`,"recentBlocks.range":`0-20,含最新完成的块`,"history.full":`完整历史`,"history.unsaved":`会话保存后才能查看完整历史`,"title.generating":`正在生成...`,"title.updated":`标题已更新`,"title.failed":`生成失败`,"title.generate":`生成标题`,"title.unsaved":`会话保存后才能生成标题`,"title.noMessages":`请先发送消息,再为会话命名`,"title.generateSession":`生成会话标题`,"system.prompt":`系统提示词`,"system.empty":`系统提示词为空(工具已禁用)`,"system.load":`发送消息以加载系统提示词`,"notices.title":`通知`,"notices.empty":`暂无警告或错误消息`,"notices.fromSession":`来自会话`,"session.info":`会话信息`,"session.reload":`重载会话(重读配置与资源)`,"session.name":`名称`,"session.file":`文件`,"session.inMemory":`内存中`,"session.id":`ID`,"session.user":`用户`,"session.assistant":`助手`,"session.toolCalls":`工具调用`,"session.toolResults":`工具结果`,"session.total":`总计`,"session.input":`输入`,"session.output":`输出`,"session.cacheRead":`缓存读取`,"session.cacheWrite":`缓存写入`,"session.inputHint":`未命中缓存的输入 token 数:系统提示、会话历史、工具定义等发送给模型的上下文,减去命中缓存的部分`,"session.outputHint":`模型生成回复的 token 数(回答与思考)`,"session.cacheReadHint":`命中 prompt 缓存的 token 数:与上一请求未变的上下文直接从缓存读取,按折扣价计费`,"session.cacheWriteHint":`首次写入缓存的 token 数(Anthropic 风格按写入计费)`,"session.totalHint":`输入 + 输出 + 缓存读取 + 缓存写入`,"session.cacheReadRate":`缓存命中率:命中缓存的 token(缓存读取)占全部输入 prompt(输入 + 缓存读取 + 缓存写入)的比例,即官方口径 cacheRead ÷ (input + cacheRead + cacheWrite)`,"session.cost":`费用`,"session.context":`上下文`,"session.copy":`复制{value}`,"session.copied":`已复制`,"session.title":`会话信息`,"session.load":`发送消息或运行 /session 以加载会话信息`,"session.infoSection":`会话信息`,"session.messages":`消息`,"session.tokens":`Token`,"session.copyFile":`复制文件路径`,"session.copyId":`复制会话 ID`,"workspace.opening":`正在打开工作区...`,"workspace.unable":`无法打开工作区`,"workspace.selectSession":`从侧边栏选择一个会话`,"workspace.selectWorkspace":`请选择工作区`,"workspace.stepProject":`从侧边栏选择项目目录`,"workspace.stepModels":`点击底部的“模型”按钮添加模型`,"tabs.chat":`聊天`,"tabs.widgets":`小组件`,"config.title":`配置`,"config.section.session":`会话`,"config.section.appearance":`外观`,"config.section.advanced":`高级`,"config.section.startScreen":`开始屏幕`,"config.section.git":`Git`,"config.section.updates":`更新`,"config.section.modelThinking":`思考级别`,"config.section.requiresCwd":`请先从侧边栏选择项目目录,再浏览插件 / 技能`,"updates.check":`检查更新`,"updates.checking":`检查中…`,"updates.checkedAt":`上次检查`,"updates.upToDate":`已是最新`,"updates.updateAvailable":`有新版本`,"updates.unavailable":`检查失败`,"updates.noPluginUpdates":`全部插件已是最新`,"updates.banner":`有可用更新:{items}`,"updates.view":`查看`,"updates.copied":`已复制`,"updates.copyCommand":`复制命令`,"updates.restartNote":`更新后将同时升级内置 pi SDK,重启服务生效。`,"updates.enableChecking":`启用更新检测`,"updates.disabled":`更新检测已关闭`,"updates.ignoreVersion":`忽略此版本`,"updates.ignored":`已忽略 {version}`,"updates.ignoredPlugin":`已忽略`,"updates.unignore":`取消忽略`,"preferences.pi.unset":`pi 默认`,"preferences.pi.enableAnalytics":`启用分析`,"preferences.pi.enableAnalyticsHint":"发送匿名使用分析(settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`启用安装遥测`,"preferences.pi.enableInstallTelemetryHint":"发送匿名安装遥测(settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP 代理`,"preferences.pi.httpProxyHint":"HTTP 请求的代理地址(settings.json `httpProxy`)。留空无法清除已设置的值。","preferences.pi.trackingId":`分析跟踪 ID`,"preferences.pi.trackingIdHint":"自定义分析跟踪 ID(settings.json `trackingId`)。留空无法清除已设置的值。","preferences.pi.httpIdleTimeoutMs":`HTTP 空闲超时(毫秒)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP 空闲超时毫秒数(settings.json `httpIdleTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.websocketConnectTimeoutMs":`WebSocket 连接超时(毫秒)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket 连接超时毫秒数(settings.json `websocketConnectTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.branchSummary":`分支摘要`,"preferences.pi.branchSummaryHint":"分支摘要自动压缩(settings.json `branchSummary`)","preferences.pi.reserveTokens":`预留 token`,"preferences.pi.skipPrompt":`跳过提示`,"preferences.pi.images":`图片处理`,"preferences.pi.imagesHint":"pi 引擎如何处理图片(settings.json `images`)","preferences.pi.autoResize":`自动缩放`,"preferences.pi.autoResizeHint":"压缩 `read` 等工具返回的图片以节省 token。","preferences.pi.blockImages":`阻止图片`,"preferences.pi.blockImagesHint":`在消息发送给模型前移除所有图片内容。`,"config.files.hint":`直接编辑 pi 的配置文件(JSON)。保存前校验,写前自动备份(保留最近 10 份)。`,"config.widgets.empty":`暂无小组件配置。插件弹出小组件时会自动在此创建条目。`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`宽`,"config.widgets.height":`高`,"config.widgets.bind":`绑定消息`,"config.widgets.bindTitle":`绑定自定义消息`,"config.widgets.bindHint":`为小组件「{key}」绑定一条快捷消息`,"config.widgets.editTitle":`编辑快捷消息`,"config.widgets.editHint":`修改标题、内容与发送方式。`,"config.widgets.label":`描述`,"config.widgets.labelPlaceholder":`按钮显示的文字(如:重载)`,"config.widgets.message":`消息内容`,"config.widgets.messagePlaceholder":`斜杠命令或任意文本(如 /reload)`,"config.widgets.messageTooltip":`以 / 开头时仅提示内置、全局插件与 Skill 命令;项目级插件命令不会出现在列表中,但可手动输入后保存`,"config.widgets.sendImmediately":`立即发送`,"config.widgets.sendMode":`发送方式`,"config.widgets.fillToChatInput":`填充到聊天框`,"config.widgets.sendImmediatelyTooltip":`立即发送:`,"config.widgets.fillToChatInputTooltip":`填充到聊天框:`,"config.widgets.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.startScreen.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.widgets.confirm":`确认`,"config.widgets.unbindTitle":`解绑消息`,"config.widgets.unbindConfirm":`确定解绑「{label}」?`,"config.widgets.unbind":`解绑`,"config.startScreen.hint":`新会话开始屏幕(Pi Logo 下方)展示的快捷入口;点击后按各条绑定的发送方式立即发送或填充到聊天输入框。`,"config.startScreen.bind":`绑定消息`,"config.startScreen.bindTitle":`绑定快捷消息`,"config.startScreen.bindHint":`为开始屏幕绑定一条快捷消息。`,"config.startScreen.editTitle":`编辑快捷消息`,"config.startScreen.editHint":`修改标题、内容与发送方式。`,"config.startScreen.empty":`暂无快捷消息,开始屏幕不会显示快捷入口。`,"config.startScreen.unbindTitle":`解绑消息`,"config.startScreen.unbindConfirm":`确定解绑「{label}」?`,"config.startScreen.unbind":`解绑`,"config.startScreen.reset":`重置`,"config.startScreen.resetHint":`恢复内置默认快捷消息;保留你自绑定的消息(与默认同名的会被默认项覆盖)。`,"config.files.save":`保存`,"config.files.saving":`保存中...`,"config.files.saved":`已保存`,"config.files.missing":`尚未创建`,"config.files.placeholder":`从左侧选择要编辑的配置文件`,"layout.resizeSidebar":`调整侧边栏宽度`,"layout.resizeWidgetPanel":`调整小组件面板宽度`,"layout.resizeHint":`拖动调整宽度。双击或按 Enter 恢复默认值。`,"sidebar.newWorkspace":`新增工作区`,"sidebar.searchSessions":`搜索会话`,"sidebar.searchSessionsPlaceholder":`搜索会话…`,"sidebar.justNow":`刚刚`,"sidebar.minutesAgo":`{count} 分钟前`,"sidebar.hoursAgo":`{count} 小时前`,"sidebar.daysAgo":`{count} 天前`,"sidebar.searchSessionsNoResults":`无匹配会话`,"sidebar.newSessionTitle":`在 {path} 中新建会话`,"sidebar.refresh":`刷新`,"directoryPicker.selectDirectory":`选择目录`,"directoryPicker.goToParent":`转到上级目录`,"directoryPicker.directoryPath":`目录路径`,"directoryPicker.goToDirectory":`转到目录`,"directoryPicker.go":`转到`,"directoryPicker.loadingDirectories":`正在加载目录…`,"directoryPicker.noSubdirectories":`没有子目录`,"directoryPicker.openBeforeSelecting":`选择前请先打开此路径`,"directoryPicker.selectCurrentDirectory":`选择当前目录`,"directoryPicker.selectThisFolder":`选择此文件夹`,"directoryPicker.noDrives":`未找到盘符`,"directoryPicker.search":`筛选文件夹`,"directoryPicker.noMatches":`没有匹配的文件夹`,"sidebar.checking":`检查中…`,"sidebar.open":`打开`,"sidebar.cancel":`取消`,"sidebar.openRepoRoot":`worktree 切换不可用`,"sidebar.openRepoRootTitle":`worktree 切换功能当前不可用:请先在侧栏将当前工作目录切换到 Git 仓库根目录。`,"sidebar.gitRepoRootOnly":`仅 Git 仓库根目录`,"sidebar.gitRepoRootOnlyTitle":`只能在 Git 仓库根目录使用 worktree。`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`正在检查此目录的 worktree。`,"sidebar.filterWorktrees":`筛选 worktree…`,"sidebar.noMatchingWorktrees":`没有匹配的 worktree`,"sidebar.switchWorktree":`切换 worktree`,"sidebar.switchWorktreeTitle":`切换 worktree:{path}`,"sidebar.main":`主分支`,"sidebar.forceRemoveCheckout":`存在未提交的更改。强制移除 checkout?`,"sidebar.force":`强制移除`,"sidebar.createWorktreeTitle":`为分支创建 worktree checkout`,"sidebar.newWorktree":`新建 worktree…`,"sidebar.branchName":`分支名称`,"sidebar.creating":`创建中…`,"sidebar.create":`创建`,"sidebar.uploadFilesTitle":`将文件上传到项目根目录`,"sidebar.uploadFiles":`上传文件`,"sidebar.refreshExplorer":`刷新文件浏览器`,"sidebar.changedFiles":`{count} 个变更文件`,"sidebar.loading":`加载中...`,"sidebar.sessionDeleted":`会话已删除,请选择其他会话`,"sidebar.noSessions":`未找到会话`,"sidebar.workspace":`工作区`,"sidebar.newActivity":`有新活动`,"sidebar.newSessionActivity":`会话有新活动`,"sidebar.interactionBadge":`会话等待交互响应`,"sidebar.deleteSession":`删除 {title}?`,"sidebar.deleteWorkspace":`删除工作区({count} 个会话)?`,"sidebar.deleteWorkspaceTitle":`删除此工作区及其所有会话`,"sidebar.copyPath":`复制完整路径`,"sidebar.rename":`重命名`,"sidebar.delete":`删除`,"sidebar.deleteWithShiftClick":`删除(按住 Shift 点击可跳过确认)`,"sidebar.expandForks":`展开分叉`,"sidebar.collapseForks":`折叠分叉`,"sidebar.disconnect":`断开`,"sidebar.messagesCount":`{count} 条消息`,"sidebar.worktreePath":`Worktree:{path}`,"sidebar.removeWorktreeTitle":`移除 worktree checkout {path};保留分支`,"files.modified":`已修改`,"files.added":`已添加`,"files.deleted":`已删除`,"files.renamed":`已重命名`,"files.untracked":`未跟踪`,"files.conflict":`冲突`,"files.newlyUploaded":`刚上传`,"files.containsChangedFiles":`包含已更改文件`,"files.insertPath":`将路径插入聊天`,"files.mention":`提及`,"files.download":`下载文件`,"files.dismissError":`关闭错误`,"files.addUploadedFile":`将上传的文件添加到聊天`,"files.addAllUploadedFiles":`将所有上传的文件添加到聊天`,"files.openInSystemApp":`用系统应用打开`,"files.chooseOtherApp":`选择其他应用…`,"files.openLaunched":`已调用系统应用打开(如无窗口弹出,请检查文件关联)`,"files.fileTooLargeForPreview":`文件太大,无法预览(>{limit})`,"files.docTooLargeForPreview":`DOCX 太大,无法预览(>{limit})`,"files.dismissUploadResults":`关闭上传结果`,"files.loading":`正在加载文件...`,"files.noFiles":`未找到文件`,"files.find":`查找`,"files.findNext":`下一个匹配(Enter)`,"files.findPrev":`上一个匹配(Shift+Enter)`,"files.findNoResults":`无结果`,"files.findClose":`关闭(Esc)`,"loading.inProgress":`处理中…`,"loading.more":`还有 {count} 项…`,"errors.title":`错误`,"errors.titleCount":`错误({count})`,"errors.close":`关闭`,"errors.clearAll":`全部清除`,"files.notFound":`(暂无文件)`,"files.accessDenied":`访问被拒绝`,"files.empty":`(空)`,"files.uploadFailed":`{count} 个失败`,"files.explorer":`文件浏览器`,"files.changedCount":`{count} 个文件`,"files.stagedPrefix":`已暂存:`,"files.unstagedPrefix":`未暂存:`,"files.noStagedChanges":`暂无已暂存文件`,"files.noUnstagedChanges":`暂无变更文件`,"files.commitMessagePlaceholder":`提交信息`,"files.commit":`提交`,"files.push":`推送到远端(含 tag)`,"files.pushing":`推送中...`,"files.pushSuccess":`推送成功`,"files.pushFailed":`推送失败`,"files.pushUpToDate":`已与远端同步,无需推送`,"files.pull":`从远端拉取`,"files.pulling":`拉取中...`,"files.pullSuccess":`拉取成功`,"files.pullFailed":`拉取失败`,"files.pullUpToDate":`已与远端同步,无需拉取`,"files.pullNonFastForward":`拉取被拒绝——本地与远端已分叉。请在终端使用 git pull --rebase 或 --merge 处理。`,"files.committing":`提交中…`,"files.commitMessageRequired":`请先填写 commit message`,"files.commitTitle":`提交更改`,"files.confirmStageAllCommit":`是否暂存全部 {count} 个改动文件并提交?`,"files.stageAllAndCommit":`暂存并提交`,"files.stageFile":`暂存文件`,"files.unstageFile":`取消暂存`,"files.changeStats":`{count} 个变更文件,新增 {additions} 行,删除 {deletions} 行`,"git.autoFetchInterval":`自动 fetch 间隔(秒)`,"git.autoFetchIntervalHint":`服务端定时为活动会话的工作区执行 git fetch(所有客户端共享结果)。0 表示关闭定时——仅在连接会话时触发一次。`,"git.groupTitle":`智能提交信息生成`,"git.commitModel.followCurrent":`跟随当前会话模型`,"git.commitModel.followCurrentHint":`开启后,生成提交信息时动态使用当前聊天的主模型;关闭则使用下方固定的模型(推荐使用免费小模型)。`,"git.commitModel.followCurrentOn":`已开启:跟随当前会话`,"git.commitModel.followCurrentOff":`已关闭:使用固定模型`,"git.commitModel.fixedModel":`固定模型`,"git.commitModel.fixedModelHint":`关闭“跟随当前会话”时使用的模型(建议选择固定的免费小模型,注意其上下文可能仅 5 万)。`,"git.commitModel.selectPlaceholder":`选择模型`,"git.commitModel.noModels":`暂无可用模型`,"git.commitModel.notConfiguredHint":`尚未选择固定模型,请先选择一个模型后再使用智能生成。`,"git.ai.generate":`智能生成`,"git.ai.generating":`生成中…`,"git.ai.notConfiguredTitle":`未配置模型`,"git.ai.notConfiguredDesc":`尚未为智能生成指定模型,请前往配置中心 → Git 指定模型后再试。`,"git.ai.goToConfig":`前往配置`,"git.ai.noSession":`跟随模式需要先选择一个会话`,"git.ai.noSessionModel":`当前会话无可用模型,请先在聊天中选择模型`,"git.commitModel.maxTokens":`最大输出长度`,"git.commitModel.maxTokensHint":`单次智能生成允许的最大输出 token 数(64–4096,默认 512)。已尽量降低推理开销:支持关闭的模型会关闭推理,不支持的会降至最低档位。`,"git.commitModel.autoGenerateOnEmpty":`空输入框时提交自动先智能生成`,"git.commitModel.autoGenerateOnEmptyHint":`开启后,点击提交时若输入框为空,会先自动调用智能生成填入信息再提交;仅在已指定模型时生效,未指定模型时空输入框仍禁用提交。默认开启。`,"git.ai.invalidModel":`已配置的模型格式无效,请前往配置中心重新选择`,"git.ai.autoGenerateOn":`已开启:空输入框自动生成`,"git.ai.usingCurrentModel":`使用聊天主模型`,"git.ai.usingModel":`使用 {model}`,"git.ai.generateAndCommit":`智能生成信息并提交`,"git.ai.autoGenerateOff":`已关闭`,"git.commitSectionTitle":`提交`,"git.commitConfirmStageAll":`提交时需确认“暂存全部”`,"git.commitConfirmStageAllHint":`开启后,未暂存时点击提交会先弹出“暂存全部并提交”确认框;关闭则直接暂存全部并提交。默认开启。`,"git.commitConfirmStageAllOn":`已开启:提交前确认`,"git.commitConfirmStageAllOff":`已关闭:直接暂存全部`,"modelThinking.desc":`为每个模型或 Provider 记忆上次选择的思考级别。切换模型时自动选中记忆的档位;若该模型的可用档位不含记忆值则回退到 auto(跟随默认)。支持全部 7 档:off / minimal / low / medium / high / xhigh / max。`,"modelThinking.byModel":`按模型`,"modelThinking.byProvider":`按 Provider`,"modelThinking.byProviderHint":`Provider 级别为回退:同 Provider 下未单独记忆的模型会使用此值。`,"modelThinking.emptyModel":`暂无按模型的记忆。切换模型后用下方思考级别下拉选择,自动记忆;也可在此添加。`,"modelThinking.emptyProvider":`暂无按 Provider 的记忆。`,"modelThinking.selectModelPlaceholder":`选择模型`,"modelThinking.selectProviderPlaceholder":`选择 Provider`,"modelThinking.providerInputPlaceholder":`或输入 Provider 名称`,"modelThinking.footerHint":`配置保存到独立文件 pi-web/model-thinking.json,不影响主配置;仅作用于 UI 下拉,不拦截 pi 的 thinking 调用。`,"common.add":`添加`,"common.delete":`删除`,"files.conflictSummary":`已有 {count} 个文件:{files}`,"files.cannotReplace":`无法替换:{files}`,"files.replace":`替换`,"files.skipExisting":`跳过已有文件`,"files.cancel":`取消`,"files.checking":`正在检查文件`,"files.uploading":`正在上传,{progress}%`,"files.search":`搜索文件`,"files.searchPlaceholder":`搜索文件...`,"chat.loadingSession":`正在加载会话...`,"chat.noSessionSelected":`请在左侧面板新增/选择任意会话`,"chat.loadingWindow":`正在加载消息...`,"chat.runningTool":`正在运行工具...`,"chat.runningNamedTool":`正在运行 {name}...`,"chat.runningTools":`正在运行 {names}...`,"chat.runningToolsMore":`正在运行 {names}(另有 {count} 个)...`,"chat.waitingModel":`正在等待模型...`,"chat.aiQuestion":`AI 提问`,"chat.runningCommand":`正在运行命令...`,"chat.totalElapsed":`总计 {total}`,"chat.thinking":`正在思考...`,"chat.message":`条消息`,"chat.messages":`条消息`,"chat.toolCall":`次工具调用`,"chat.toolCalls":`次工具调用`,"chat.collapseProcess":`收起处理详情`,"chat.expandProcess":`展开处理详情`,"chat.loadEarlier":`向上滚动以加载更早的消息(隐藏 {count} 条)`,"chat.searchMessages":`搜索消息`,"chat.clearSearch":`清空搜索关键字`,"chat.scrollToLatest":`滚动到最新消息`,"chat.expandMessage":`展开完整内容`,"chat.searchPlaceholder":`搜索聊天消息…`,"chat.searchNoResults":`没有结果`,"chat.searchResults":`{count} 个结果`,"chat.extensionRequest":`扩展请求`,"chat.cancel":`取消`,"chat.skipped":`已跳过`,"chat.confirm":`确认`,"chat.submit":`提交`,"chat.extensionInput":`扩展终端输入`,"chat.extensionSelect":`请选择`,"chat.extensionConfirm":`确认`,"chat.extensionEditor":`编辑`,"chat.extensionPanel":`扩展面板`,"chat.close":`关闭`,"chat.notifyInfoTitle":`信息`,"chat.notifySuccessTitle":`成功`,"chat.notifyErrorTitle":`错误`,"chat.notifyWarningTitle":`警告`,"chat.queued":`已排队 · {count}`,"chat.recall":`移回输入框`,"chat.recallTitle":`移除所有排队消息并放回输入框编辑(输入框为空时按回车也可触发)`,"chat.retrying":`正在重试({attempt}/{max})…`,"chat.loadingCommands":`正在加载命令...`,"chat.slashCommands":`斜杠命令 · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`未找到扩展、提示词或技能命令`,"chat.match":`1 个匹配项`,"chat.matches":`{count} 个匹配项`,"chat.command":`1 个命令`,"chat.commands":`{count} 个命令`,"chat.loadingFiles":`正在加载文件...`,"chat.files":`文件 · {label}{hint}`,"chat.searching":`搜索中…`,"chat.noMatchingFiles":`未找到匹配的文件`,"chat.searchingAll":` · 正在搜索所有文件…`,"chat.indexTruncated":` · 索引不完整`,"chat.steerPlaceholder":`立即引导 / 排队后续消息...`,"chat.recallPlaceholder":`回车撤回排队消息到输入框编辑,或输入新消息…`,"chat.agentPlaceholder":`Agent 运行中…`,"chat.messagePlaceholder":`消息…输入 / 使用命令,@ 引用文件,! 执行命令`,"chat.questionNotificationTitle":`Pi — 提问`,"chat.taskCompleteNotificationTitle":`Pi — 任务完成`,"chat.taskErrorNotificationTitle":`Pi — 出错`,"chat.sessionCompletedNotificationBody":`会话 {name} 已完成`,"chat.questionNotificationDenied":`通知被拒绝:在浏览器站点设置中允许后,切走页面时才会收到提问提醒。`,"chat.steer":`引导`,"chat.followUp":`后续消息`,"chat.queueImageBlocked":`运行中无法排队发送带图片的附件`,"chat.steerTooltip":`在当前调用结束后立即发送这条消息`,"chat.followUpTooltip":`在智能体结束后排队发送这条消息`,"chat.send":`发送`,"chat.attachImage":`附加图片`,"chat.attachmentOnDisk":`体积过大,已存到磁盘并以路径引用(由智能体按需读取)`,"chat.filterModels":`筛选模型…`,"chat.noMatchingModels":`没有匹配的模型`,"chat.moreControls":`更多控件`,"chat.collapseControls":`收起控件`,"chat.shell":`Shell`,"chat.outputLocal":`输出保留在本地`,"chat.outputModel":`输出发送给模型`,"chat.noTools":`不使用工具,仅只读`,"chat.builtInTools":`{count} 个内置工具`,"chat.allBuiltInTools":`全部内置工具`,"chat.changeReasoning":`更改推理级别:{level}`,"chat.changeReasoningLabel":`更改推理级别`,"chat.changeToolPreset":`更改工具预设`,"chat.stopCompaction":`停止压缩`,"chat.compactContext":`压缩上下文`,"chat.compacting":`正在压缩…`,"chat.compactionDisabledByExtension":`原生上下文压缩已被某个扩展接管,无法在这里执行。`,"chat.compact":`压缩`,"chat.stopAgent":`停止 Agent`,"chat.stop":`停止`,"chat.disableSound":`关闭完成提示音`,"chat.enableSound":`开启完成提示音`,"chat.thinkingUseDefault":`使用 pi 默认设置`,"chat.thinkingOff":`关闭推理`,"chat.thinkingMinimal":`最低限度推理`,"chat.thinkingLow":`低强度推理`,"chat.thinkingMedium":`中等强度推理`,"chat.thinkingHigh":`高强度推理`,"chat.thinkingXhigh":`超高强度推理`,"chat.thinkingMax":`最高强度推理`,"chat.thinkingMapTitle":`高级思考级别未配置`,"chat.thinkingMapBody":`pi 默认只支持 high 级别。若要开启 {level} 级别推理,请在 配置 → 模型 页面为该模型配置「推理级别映射」。`,"chat.thinkingMapGo":`立即前往`,"chat.builtIn":`内置`,"chat.extensions":`扩展`,"chat.prompts":`提示词`,"chat.skills":`技能`,"chat.dormant":`休眠`,"chat.commandCompact":`压缩上下文,可选附加说明`,"chat.commandReload":`重新加载扩展、技能、提示词和工具`,"chat.commandName":`设置会话显示名称`,"chat.commandSession":`显示会话消息、Token 和费用统计`,"chat.commandCopy":`复制最后一条助手消息`,"chat.compacted":`已压缩`,"chat.tokensSaved":`节省 {saved}`,"i18n.close":`关闭`,"i18n.resizeList":`调整 {name} 列表大小`,"widgets.title":`小组件`,"widgets.reopen":`重新弹出`,"widgets.expandedToChat":`小组件[{key}]已展开到聊天页面`,"widgets.collapse":`收起`,"widgets.open":`展开小组件`,"i18n.copy":`复制`,"i18n.copied":`已复制`,"i18n.copyToolInput":`复制原始 JSON`,"i18n.cancel":`取消`,"i18n.save":`保存`,"i18n.saving":`保存中…`,"i18n.saved":`已保存`,"i18n.saveChanges":`保存更改`,"i18n.noThinking":`无思考内容`,"i18n.remove":`移除`,"i18n.removing":`移除中…`,"i18n.delete":`删除`,"i18n.loading":`加载中...`,"i18n.searchPlaceholder":`搜索…`,"i18n.noMatch":`无匹配`,"i18n.search":`搜索`,"i18n.refresh":`刷新`,"i18n.update":`更新`,"i18n.updating":`更新中...`,"i18n.check":`检查`,"i18n.checking":`检查中...`,"i18n.install":`安装`,"i18n.installing":`安装中...`,"i18n.noResults":`没有结果`,"i18n.searchProviders":`搜索 Provider…`,"i18n.noProviders":`没有匹配的 Provider`,"i18n.newModel":`新模型`,"i18n.addProvider":`添加 Provider`,"i18n.selectProviderModel":`选择 Provider 或模型`,"i18n.visibleInPrompt":`在模型提示词中可见,点击以禁用`,"i18n.hiddenFromPrompt":`在模型提示词中隐藏,点击以启用`,"i18n.dormant":`休眠`,"i18n.hiddenButInvocable":`对模型隐藏,仍可手动调用`,"i18n.skillSearchPlaceholder":`例如 react、testing、deploy`,"i18n.searching":`搜索中…`,"i18n.noSkills":`未找到技能`,"i18n.checkUpdates":`检查更新`,"i18n.updates":`项更新`,"i18n.noResolvedResources":`没有已解析资源`,"i18n.enablePackage":`启用包`,"i18n.disablePackage":`禁用包`,"i18n.filtered":`已筛选`,"i18n.openSessionToReload":`打开会话后才能重新加载`,"i18n.notFound":`未找到`,"i18n.noPlugins":`未配置插件`,"trust.resourcesNotLoaded":`受限模式`,"trust.trustProject":`信任项目`,"trust.trusting":`正在信任...`,"trust.cancel":`取消`,"trust.dialogTitle":`信任此项目?`,"trust.dialogBody":`项目资源可以运行本地代码。请仅信任你了解其内容的项目。`,"trust.skillsNotLoaded":`此项目尚未受信任,项目技能未加载。`,"trust.pluginsNotLoaded":`此项目尚未受信任,项目插件未加载。`,"trust.projectScopeUnavailable":`项目资源未加载时,无法安装到项目范围。`,"i18n.creatingSession":`正在创建新会话…`,"i18n.creating":`创建中…`,"i18n.subscription":`订阅`,"i18n.subscriptions":`订阅服务`,"i18n.customEndpoint":`自定义端点格式`,"i18n.noChanges":`没有更改`,"i18n.branches":`分支`,"i18n.noActiveSession":`没有活动会话`,"i18n.noActiveSessionToCompact":`没有活动会话可压缩`,"i18n.noActiveSessionToReload":`没有活动会话可重新加载`,"i18n.noActiveSessionToName":`没有活动会话可命名`,"i18n.noAssistantMessageToCopy":`没有可复制的助手消息`,"i18n.commandCompleted":`命令已完成`,"i18n.commandFailed":`命令失败`,"i18n.extensionCommandFailed":`扩展命令失败`,"i18n.compactedContext":`上下文已压缩`,"i18n.reloadedSessionResources":`会话资源已重新加载`,"i18n.usageName":`用法:/name <名称>`,"i18n.sessionRenamedTo":`会话已重命名为 {name}`,"i18n.copiedLastAssistantMessage":`已复制最后一条助手消息`,"i18n.failedToRecallQueuedMessages":`恢复排队消息失败`,"i18n.noBranches":`此会话没有分支`,"i18n.source":`源代码`,"i18n.preview":`预览`,"i18n.diff":`Diff`,"i18n.downloadFile":`下载文件`,"i18n.liveSync":`实时同步已启用`,"i18n.notWatching":`未监视`,"i18n.fileViewMode":`文件视图模式`,"i18n.editMode":`编辑模式`,"i18n.viewMode":`查看模式`,"i18n.compareHead":`比较工作区与 HEAD`,"i18n.mentionSelectedLines":`提及所选行`,"i18n.disableWrap":`禁用自动换行`,"i18n.enableWrap":`启用自动换行`,"i18n.editFile":`编辑文件`,"i18n.saveFile":`保存`,"i18n.saveFileShortcut":`保存(Ctrl/Cmd+S)`,"i18n.cancelEdit":`取消`,"i18n.saveFailed":`保存失败:{error}`,"i18n.unsavedChanges":`有未保存的修改`,"i18n.htmlPreview":`HTML 预览`,"i18n.previewFile":`预览 {file}`,"i18n.invalidMermaid":`Mermaid 图表无效`,"i18n.renderingMermaid":`正在渲染 Mermaid 图表`,"i18n.previewAfterStreaming":`流式输出完成后可预览`,"i18n.showMermaidSource":`显示 Mermaid 源码`,"i18n.previewMermaid":`预览 Mermaid 图表`,"i18n.openMermaidViewer":`打开图表查看器`,"i18n.mermaidViewer":`Mermaid 图表查看器`,"i18n.mermaidDiagram":`Mermaid 图表`,"i18n.zoomOut":`缩小`,"i18n.zoomIn":`放大`,"i18n.fitToWidth":`适应宽度`,"models.discoveryFetching":`正在导入模型…`,"models.deleteProviderConfirm":`确定删除 provider「{name}」?该操作会立即写入 models.json,其全部配置(含 API key)将被移除且无法恢复。`,"models.renameProviderDialogTitle":`重命名 Provider`,"models.renameProviderHint":`重命名会立即写入 models.json,并同步迁移该 provider 的 API 密钥与登录凭证;其他未保存的修改不会一并保存。`,"models.renameProviderConflict":`Provider「{name}」已存在,请换一个名称。`,"models.renameProviderBuiltin":`「{name}」是内置 provider,不能作为自定义 provider 名。`,"models.renameProviderEmpty":`名称不能为空。`,"models.removeModelConfirm":`确定移除模型「{model}」?该操作会立即写入 models.json 且无法恢复。`,"models.discoveryTitle":`导入模型`,"models.discoveryFetch":`导入模型…`,"models.discoveryFilterPlaceholder":`筛选 {count} 个模型…`,"models.discoveryFilter":`筛选上游模型`,"models.discoverySelectShown":`选择当前结果`,"models.discoveryNoMatches":`没有匹配的模型。`,"models.discoveryAdded":`已添加`,"models.discoveryShowing":`显示前 {shown} 个,共 {total} 个`,"models.discoveryFetched":`已获取 {count} 个模型`,"models.discoveryAddSelected":`添加所选模型`,"models.setDefault":`设为默认`,"models.defaultModel":`默认模型`,"models.defaultModelUnavailable":`默认模型 {model} 不可用(已删除或已隐藏),请选择模型。`,"models.syncEndpoint":`从端点同步`,"models.lastSyncedAt":`上次同步:{time}`,"models.neverSynced":`未同步过`,"models.discoveryFetchTooltip":`优先从本地缓存导入:{path};无缓存时自动执行一次从端点同步并写入该缓存。`,"models.syncingModels":`同步中…`,"models.syncedModels":`已同步 {count} 个模型`,"models.syncEndpointTooltip":`从 {endpoint} 拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.syncEndpointTooltipGeneric":`从该供应商的 models 端点拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.refreshFromCache":`从同步缓存刷新`,"models.refreshing":`刷新中…`,"models.refreshFromCacheTooltip":`重新读取 pi-web/provider/{provider}/models.json,只更新与当前生效定义不同的字段(headers 等手动字段保留)。`,"models.refreshNoDiff":`同步缓存与当前生效定义一致,无需更新。`,"models.refreshDone":`已从同步缓存更新覆写字段。`,"models.refreshTimeout":`刷新超时,请稍后重试。`,"models.builtinProviders":`内置 Provider`,"models.customProviders":`自定义 Provider`,"models.syncSaveFailed":`同步前保存草稿失败,已中止同步。`,"models.visibleInChat":`聊天可见`,"models.visibleModels":`模型列表`,"models.visibleModelsCount":`已勾选 {visible} / 共 {total}`,"models.visibilityCustomized":` · 已自定义`,"models.visibilityUncustomized":` · 未自定义(默认全部可见)`,"models.showAll":`重置`,"models.showAllHint":`所有模型可见`,"models.filterLabel":`筛选:`,"models.invertSelection":`反向勾选`,"models.searchModels":`搜索模型…`,"models.noModels":`该 provider 暂无模型。`,"models.noMatchingModels":`无匹配模型。`,"models.filterAll":`全部`,"models.filterVisible":`仅可见`,"models.filterHidden":`仅隐藏`,"models.invertDisabledTooltip":`所有模型均已可见,反选不会改变任何状态`,"models.openOverride":`覆写模型参数`,"models.overrideHint":`当前显示为合并后的有效值(内置定义 + 已保存的覆写)。只有你修改过的字段会作为覆写保存,其余字段继续继承内置定义。`,"models.overrideOrphanedHint":`该模型已从上游删除,覆写仍保留在本地。可在此删除覆写,保存后会一并清理可见性配置。`,"models.removeOverride":`移除覆写`,"models.providerNameCollision":`Provider "{provider}" 与内置 "{builtin}"(大小写不敏感)冲突,模型可见性无法生效,请重命名或删除该 provider。`,"models.providerNameCollisionShort":`与内置 provider 撞名`,"models.builtinVisibilityBlocked":`模型可见性已禁用:自定义 provider "{custom}" 与 "{builtin}"(大小写不敏感)冲突,请重命名或删除该自定义 provider。`,"models.discoveryAddSelectedCount":`添加所选模型({count})`,"models.dataSourceLabel":`数据来源:`,"models.catalogSourceEndpoint":`模型端点`,"models.catalogSourceDev":`models.dev 目录`,"models.catalogSourceEndpointTooltip":`数据来源:Provider 的 /models 端点`,"models.catalogSourceDevTooltip":`数据来源:models.dev 内置目录(https://models.dev)`,"models.catalogEndpointNotFound":`模型端点返回中未找到该模型 ID`,"models.catalogOverwriteTitle":`覆盖已有字段?`,"models.catalogOverwriteBody":`以下 {{count}} 个字段已有值,覆盖填入将修改它们:{{fields}}。取消则仅填充空字段。`,"models.catalogOverwriteConfirm":`覆盖并填入`,"models.catalogOverwriteCancel":`仅填空字段`,"models.catalogFilling":`正在填入模型信息…`,"models.catalogFill":`填入模型信息`,"models.catalogFilled":`已填入 {count} 个字段`,"models.catalogNoEmptyFields":`没有需要填入的空字段`,"models.catalogNoExactMatch":`models.dev 中没有精确匹配`,"models.catalogPriceProvider":`价格已匹配 Provider {provider}`,"models.catalogPriceBaseUrl":`价格已按 Base URL 匹配 {provider}`,"models.catalogPriceConsensus":`价格得到 {support}/{total} 条记录支持`,"models.catalogPriceUnreliable":`未找到可靠价格`,"models.catalogUndo":`撤销`,"models.baseUrl":`Base URL`,"models.apiKey":`API 密钥`,"models.api":`API 格式`,"models.modelId":`ID *`,"models.name":`名称`,"models.apiOverride":`API 格式`,"models.reasoningThinking":`推理 / 思考`,"models.inputFormat":`输入格式`,"models.inputFormatPlaceholder":`搜索添加,可多选(回车确认)`,"models.inputFormat.text":`文本`,"models.inputFormat.image":`图片`,"models.badgeReasoning":`支持思考 / 推理(聊天输入框可选思考级别)`,"models.badgeInput":`支持{format}输入`,"models.nameHint":`留空删除 name 字段(回落使用模型 id)。`,"models.apiOverrideHint":`留空或选默认删除 api 字段(回落使用 provider 默认 api)。`,"models.reasoningHint":`取消勾选删除 reasoning 字段(回落关闭)。`,"models.thinkingLevelMapHint":`每个级别三种状态:默认=删除该级别映射(回落模型默认级别);已禁用=写入 null 禁用;自定义=写入自定义级别字符串。`,"models.compatSection":`兼容性`,"models.compatInheritHint":`模型自身未设置的项显示从 provider 继承的生效值(以弱化颜色标注);在模型级设置后将覆盖继承值。`,"models.compatHint.supportsDeveloperRole":`是否使用 developer 角色发送系统提示(推理模型常用)。Ollama、vLLM、SGLang 等不支持该角色的服务器设为 false,改为发送 system 消息。`,"models.compatHint.supportsLongCacheRetention":`是否支持长缓存保留:GPT-5.6+ 用 prompt_cache_options.ttl(30m),旧 OpenAI 用 prompt_cache_retention(24h),Anthropic 格式用 cache_control.ttl(1h)。`,"models.compatHint.supportsUsageInStreaming":`流式响应是否支持 stream_options: {include_usage: true},用于统计 token 用量。`,"models.compatHint.supportsFinishReason":`流式响应是否包含 finish_reason。设为 false 时,pi 在流结束时自行推断 stop 或 toolUse。`,"models.compatHint.supportsEagerToolInputStreaming":`是否接受逐工具的 eager_input_streaming。设为 false 时省略该字段,改用旧版 fine-grained-tool-streaming beta 请求头。`,"models.compatHint.supportsCacheControlOnTools":`是否接受工具定义上的 Anthropic 风格 cache_control 标记(用于工具提示词缓存)。`,"models.compatHint.supportsTemperature":`是否接受 temperature 采样参数。Claude Opus 4.7+ 等拒绝非默认温度值的端点需设为 false。`,"models.compatHint.requiresToolResultName":`工具结果消息是否必须包含 name 字段(某些端点要求)。`,"models.compatHint.requiresAssistantAfterToolResult":`工具结果之后、下一条用户消息之前是否需要插入一条空 assistant 消息(某些端点要求)。`,"models.compatHint.requiresThinkingAsText":`是否将思考块转换为纯文本发送(用于不支持思考块的端点)。`,"models.compatHint.zaiToolStream":`z.ai 端点是否支持顶层 tool_stream: true 参数(流式工具调用增量)。`,"models.compatHint.supportsThinkingTokenBudget":`是否支持用顶层 thinking_token_budget 字段限制思考 token(vLLM 兼容端点)。`,"models.compatHint.supportsOpenAIGrammarTools":`OpenAI 兼容 API 是否支持 Lark/regex grammar 工具。设为 false 时,受语法约束的工具回退为普通 function 工具。`,"models.compatHint.supportsToolSearch":`模型是否支持客户端执行的工具搜索(用于延迟工具)。`,"models.compatHint.supportsExplicitPromptCacheMode":`是否接受 prompt_cache_options 参数(OpenAI GPT-5.6+ 提示缓存)。旧 OpenAI 模型会拒绝该参数。`,"models.compatHint.forceAdaptiveThinking":`是否强制 adaptive thinking(thinking.type: "adaptive" + output_config.effort)替代旧版 budget 思考格式。内置自适应模型会自动设置。`,"models.compatHint.allowEmptySignature":`是否将空思考签名重放为 signature: ""。仅对确实需要的 Anthropic 兼容端点开启;真正的 Anthropic API 拒绝空签名。`,"models.compatHint.supportsStrictTools":`端点是否接受 strict JSON-schema 工具定义(Anthropic)。内置 Anthropic 模型已启用。`,"models.compatHint.supportsStore":`OpenAI 端点是否支持 store 字段。`,"models.compatHint.supportsReasoningEffort":`端点是否支持 reasoning_effort 参数(Ollama、vLLM、SGLang 等常不支持)。`,"models.compatHint.supportsStrictMode":`端点是否接受 strict JSON-schema 函数工具定义。默认依 API 而定;内置 OpenAI 模型自带能力元数据。`,"models.compatHint.supportsToolReferences":`是否支持工具结果中的工具引用块。Anthropic 一方模型默认支持(Haiku 与 Claude 4.5 之前的模型除外)。`,"models.compatHint.maxTokensField":`最大输出 token 参数名:max_completion_tokens(新 API)或 max_tokens(旧 API)。`,"models.compatHint.sessionAffinityFormat":`会话亲和(缓存相关):把 session id 当亲和键发给端点,让同一会话的请求尽量命中同一个后端副本,以提高提示缓存命中率——Fireworks 等端点就是靠它做 prompt cache 路由,不开时同一会话的请求可能落到不同副本、缓存复用变差(不影响请求体的 prompt_cache_key,那由缓存保留策略决定)。pi 仅在 compat.sendSessionAffinityHeaders 为 true 时发送(openai-responses 只看格式),本下拉框会联动写入两个字段。auto=开启并按 URL 自动探测格式;off=显式关闭(模型级可覆盖 provider 的开启);openai=session_id/x-client-request-id/x-session-affinity;openai-nosession=x-client-request-id/x-session-affinity;openrouter=x-session-id。`,"models.compatHint.deferredToolsMode":`延迟工具的专用序列化格式。目前仅支持 kimi(Kimi 的 OpenAI 兼容 Chat Completions 格式)。`,"models.compatHint.cacheControlFormat":`提示缓存标记格式。目前仅支持 anthropic:在系统提示、最后一个工具定义及最后一条文本内容上添加 cache_control 标记。`,"models.inheritedFromProvider":`来自 provider(继承值,可在模型级覆盖)`,"models.thinkingFormatDeepseekHint":`选中 deepseek 时会额外写入 requiresReasoningContentOnAssistantMessages: true;选中其他值则移除。`,"models.samplingParams":`采样参数`,"models.headers":`请求头`,"models.modelOverrides":`模型覆盖`,"models.supportsDeveloperRole":`支持 developer role`,"models.supportsLongCacheRetention":`支持长缓存保留`,"models.supportsUsageInStreaming":`流式返回 token 用量`,"models.supportsFinishReason":`流式返回 finish_reason`,"models.supportsEagerToolInputStreaming":`工具输入流式预读`,"models.supportsCacheControlOnTools":`工具定义缓存控制`,"models.supportsTemperature":`支持 temperature 参数`,"models.requiresToolResultName":`工具结果需带 name`,"models.requiresAssistantAfterToolResult":`工具结果后需 assistant 消息`,"models.requiresThinkingAsText":`思考块转为文本`,"models.requiresReasoningContentOnAssistantMessages":`assistant 消息需 reasoning_content`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`支持思考 token 预算`,"models.supportsOpenAIGrammarTools":`支持 OpenAI 语法工具`,"models.supportsToolSearch":`支持工具搜索`,"models.supportsExplicitPromptCacheMode":`显式提示缓存模式`,"models.forceAdaptiveThinking":`强制自适应思考`,"models.allowEmptySignature":`允许空思考签名`,"models.supportsStrictTools":`严格工具 schema`,"models.supportsStore":`支持 store 参数`,"models.supportsReasoningEffort":`支持 reasoning_effort`,"models.supportsStrictMode":`严格模式`,"models.supportsToolReferences":`支持工具引用`,"models.maxTokensField":`最大 token 字段`,"models.sessionAffinityFormat":`会话亲和`,"models.deferredToolsMode":`延迟工具模式`,"models.cacheControlFormat":`缓存控制格式`,"models.thinkingFormat":`思考格式`,"models.chatTemplateKwargs":`聊天模板 kwargs`,"models.chatTemplateArgs":`聊天模板 args`,"models.openRouterRouting":`OpenRouter 路由`,"models.vercelGatewayRouting":`Vercel 网关路由`,"models.thinkingLevelMap":`思考级别`,"models.thinkingLevelMapReset":`重置(清空)`,"models.thinkingLevelMapResetHint":`清空整个 thinkingLevelMap:off、minimal、low、medium、high 回落各自默认,xhigh、max 默认禁用。`,"models.thinkingLevelMapNone":`全部禁用`,"models.contextWindow":`上下文窗口(tokens)`,"models.maxOutputTokens":`最大输出 tokens`,"models.costPerMillion":`成本(每百万 tokens)`,"models.cost.input":`输入`,"models.cost.output":`输出`,"models.cost.cacheRead":`缓存读取`,"models.cost.cacheWrite":`缓存写入`,"models.costNotSet":`未设置`,"models.costAllRequired":`四项费率必须全部填写`,"models.costClear":`清除`,"models.apiKeyPlaceholder":`ENV_VAR_NAME、!shell-command 或字面密钥`,"models.apiKeyHint":`字面量密钥在保存时自动写入 auth.json(与 CLI /login 共享,优先于此处配置);以 ! 开头的 shell 命令和 $ENV 插值保留在 models.json。`,"models.authJsonConnected":`已通过 auth.json 提供密钥`,"models.authJsonRemove":`移除`,"models.apiKeyPrompt":`输入 {provider} 的 API 密钥以启用 {count} 个模型。`,"models.oauthAlreadyConnected":`已连接。可重新登录或断开连接。`,"models.oauthConnectPrompt":`连接你的 {provider} 账户。`,"models.enterValue":`输入值…`,"models.displayNamePlaceholder":`显示名称`,"models.connectionLost":`连接已断开`,"models.networkError":`网络错误`,"i18n.testingModel":`正在测试模型连接...`,"i18n.connected":`已连接`,"i18n.failed":`失败`,"i18n.test":`测试`,"i18n.testConnection":`测试模型连接`,"i18n.provider":`Provider`,"i18n.providers":`提供商`,"i18n.model":`模型`,"i18n.providerName":`名称`,"i18n.rename":`重命名`,"i18n.default":`默认`,"i18n.disabled":`已禁用`,"plugins.statusLoaded":`已加载并生效`,"plugins.statusInstalled":`已安装,尚未加载`,"plugins.statusDisabled":`已禁用`,"plugins.statusMissing":`已配置但包未找到`,"plugins.extensionFilters":`扩展过滤`,"plugins.filterRules":`过滤规则`,"plugins.managePlugins":`插件管理`,"plugins.extensionFiltersHint":`对 ~/.pi/agent/extensions/ 与 .pi/extensions/ 自动发现目录内扩展的过滤规则。仅以 !、+、- 开头的规则生效;纯路径填写无效。`,"plugins.noExtensionFilters":`未配置过滤规则`,"plugins.addFilter":`添加过滤`,"plugins.filterPatternLabel":`规则`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`规则必须以 !、+ 或 - 开头;纯路径在 extensions 字段中无效。`,"plugins.filterPrefixExclude":`排除匹配的扩展`,"plugins.filterPrefixForceInclude":`强制包含精确路径`,"plugins.filterPrefixForceExclude":`强制排除精确路径`,"plugins.filterEffect":`效果`,"plugins.removeFilter":`移除过滤`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`包已安装。`,"plugins.packageUpdated":`包已更新。`,"plugins.packageRemoved":`包已移除。`,"plugins.packageDisabled":`包已禁用。`,"plugins.packageEnabled":`包已启用。`,"plugins.extensionFilterAdded":`扩展过滤已添加。`,"plugins.extensionFilterRemoved":`扩展过滤已移除。`,"plugins.sessionReloaded":`会话已重载。`,"i18n.noResources":`没有资源`,"i18n.unknown":`未知`,"i18n.installedVersion":`已安装 {version}`,"i18n.configuredVersion":`已配置 {version}`,"i18n.extensions":`扩展`,"i18n.prompts":`提示词`,"i18n.themes":`主题`,"i18n.resourceCount":`{count}{label}`,"i18n.extensionShort":`扩展`,"i18n.versionShort":`版本`,"i18n.skillShort":`技能`,"i18n.promptShort":`提示词`,"i18n.themeShort":`主题`,"i18n.custom":`自定义`,"i18n.clearAll":`清除全部`,"i18n.connectedSuccessfully":`连接成功。`,"i18n.notConnected":`未连接`,"i18n.configured":`已配置`,"i18n.notConfigured":`未配置`,"i18n.openingBrowser":`正在打开浏览器…`,"i18n.submit":`提交`,"i18n.login":`登录`,"i18n.relogin":`重新登录`,"i18n.disconnect":`断开连接`,"i18n.networkError":`网络错误`,"i18n.continuing":`继续中…`,"i18n.skills":`技能`,"i18n.plugins":`插件`,"i18n.addSkill":`添加技能`,"i18n.addPlugin":`添加插件`,"i18n.recommendedPlugins":`推荐插件`,"i18n.selectSkill":`选择技能`,"i18n.selectPackage":`选择包`,"i18n.configBindings":`绑定的配置文件`,"i18n.addBinding":`添加`,"i18n.configFileNote":`备注(可选)`,"i18n.bindConfigFile":`绑定配置文件`,"i18n.selectFile":`选择文件`,"i18n.noConfigBindings":`尚未绑定配置文件`,"i18n.noFiles":`没有文件`,"i18n.allFiles":`全部文件`,"i18n.filterByType":`按类型筛选`,"i18n.removeBinding":`删除绑定`,"i18n.confirm":`确认`,"i18n.updateAvailable":`有可用更新`,"i18n.upToDate":`已是最新`,"i18n.automaticChecksUnavailable":`自动检查不可用`,"i18n.checkFailed":`检查失败`,"i18n.installed":`已安装`,"i18n.status":`状态`,"i18n.version":`版本`,"i18n.package":`包`,"i18n.resources":`资源`,"i18n.installedPath":`安装路径`,"i18n.readme":`README`,"i18n.readmeDetails":`详情`,"i18n.unsafeLinkBlocked":`已阻止不安全链接(仅允许同目录或子目录的相对链接):{href}`,"i18n.resolvedResources":`已解析资源`,"i18n.reloadSession":`重新加载会话`,"i18n.reloading":`重新加载中...`,"i18n.packageRemoved":`包已移除。`,"i18n.packageInstalled":`包已安装。`,"i18n.packageUpdated":`包已更新。`,"i18n.packageDisabled":`包已禁用。`,"i18n.packageEnabled":`包已启用。`,"i18n.sessionReloaded":`会话已重新加载。`,"i18n.thinking":`思考`,"i18n.loadingThinking":`正在加载思考内容...`,"i18n.copyMessage":`复制消息`,"i18n.editFromHere":`从此处编辑`,"i18n.editFromHereTitle":`从此处编辑,此会话内创建分支`,"i18n.newSession":`新会话`,"i18n.newSessionTitle":`新会话,从此处创建独立副本`,"i18n.estimatedTokens":`流式输出期间的估算 Token 数`,"i18n.noOutput":`(无输出)`,"i18n.noSummary":`(无摘要)`,"i18n.conversationCompacted":`会话已压缩`,"i18n.compactionDescription":`此处之前的会话历史已压缩为以下摘要:`,"i18n.fileContext":`文件上下文:{details}`,"i18n.readFiles":`读取的文件`,"i18n.modifiedFiles":`修改的文件`,"i18n.hiddenExtensionMessage":`隐藏的扩展消息`,"i18n.noMessage":`(无消息)`,"i18n.showExtensionMessage":`显示扩展消息`,"i18n.collapse":`收起`,"i18n.expand":`展开`,"i18n.hideDetails":`隐藏详情`,"i18n.showDetails":`显示详情`,"i18n.thinkingUnavailable":`思考内容不可用`,"i18n.thinkingEncrypted":`思考内容已加密(提供方加密,仅用于上下文连续,无法显示明文)`,"i18n.before":`之前`,"i18n.after":`之后`}},Ae=new Map;function je(e){if(!e.id.trim())throw Error(`Locale id must not be empty`);if(Ae.has(e.id))throw Error(`Locale already registered: ${e.id}`);Ae.set(e.id,e)}function Me(e){return Ae.get(e)}function Ne(){return[...Ae.keys()]}function Pe(e){for(let t of e){let e=t.toLowerCase();if(e===`en`||e.startsWith(`en-`))return`en`;if(e===`zh`||e.startsWith(`zh-`))return`zh-CN`}return`en`}je(Oe),je(ke);var Fe=`pi-locale`,Ie=`en`,Le=(0,d.createContext)(null);function Re(){return Object.fromEntries(Ne().flatMap(e=>{let t=Me(e);return t?[[e,t.messages]]:[]}))}function ze(){try{let e=window.localStorage.getItem(Fe);if(e===`en`||e===`zh-CN`)return e}catch{}return null}function Be({children:e,initialLocale:t=null}){let[n,r]=(0,d.useState)(()=>typeof window>`u`?t??Ie:ze()??t??Pe(window.navigator.languages.length?window.navigator.languages:[window.navigator.language])),i=(0,d.useMemo)(()=>Ne().map(e=>Me(e)).filter(e=>!!e),[]),a=(0,d.useMemo)(()=>Re(),[]),o=(0,d.useCallback)(e=>{if(Me(e)){r(e),document.documentElement.lang=e;try{window.localStorage.setItem(Fe,e)}catch{}fetch(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{locale:e}})}).catch(e=>console.error(`[pi-web] save locale:`,e))}},[]),s=(0,d.useCallback)((e,t)=>Ee(n,e,a,t),[n,a]),c=(0,d.useMemo)(()=>({locale:n,setLocale:o,t:s,supportedLocales:i}),[n,o,s,i]);return(0,F.jsx)(Le.Provider,{value:c,children:e})}function I(){let e=(0,d.useContext)(Le);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}var Ve=`(max-width: 640px)`;function He(e){if(typeof window>`u`||!window.matchMedia)return()=>{};let t=window.matchMedia(Ve);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function Ue(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(Ve).matches}function We(){return!1}function Ge(){return(0,d.useSyncExternalStore)(He,Ue,We)}var Ke=null;function qe(e){Ke=e}function Je(e){let{onNewSession:t,activeCwd:n}=e;(0,d.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(!Ke)return;let t=e.target?.tagName;if(t===`TEXTAREA`||t===`INPUT`)return;e.preventDefault(),Ke();return}if(e.key===`n`&&e.ctrlKey&&e.altKey){if(!n||!t)return;e.preventDefault(),t(n)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,t])}function Ye(){let[e,t]=(0,d.useState)(()=>typeof Notification>`u`?`unsupported`:Notification.permission);return(0,d.useEffect)(()=>{if(typeof Notification>`u`)return;let e=!1,n,r=()=>{e||t(Notification.permission)};return typeof navigator.permissions?.query==`function`&&navigator.permissions.query({name:`notifications`}).then(t=>{e||(n=t,r(),t.addEventListener(`change`,r))}).catch(()=>{}),()=>{e=!0,n?.removeEventListener(`change`,r)}},[]),e}function Xe(e){let{fetcher:t,ttlMs:n=6e4}=e,r=null,i=null,a=0,o=null,s=new Set,c=()=>{for(let e of[...s])try{e()}catch{}},l=async e=>{try{let o=await t(e);return r=o,i=null,a=Date.now()+n,o}catch(e){throw i=e instanceof Error?e.message:String(e),e}finally{o=null}},u=e=>(o||=l(e).then(e=>(c(),e)),o),d=(e,t)=>new Promise((n,r)=>{if(e.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=()=>r(new DOMException(`Aborted`,`AbortError`));e.addEventListener(`abort`,i,{once:!0}),t.then(n,r).finally(()=>e.removeEventListener(`abort`,i))});return{get:()=>r,getError:()=>i,load:e=>{if(r!==null&&Date.now()<a)return Promise.resolve(r);let t=u(!1);return e?d(e,t):t},refresh:e=>{a=0;let t=u(!0);return e?d(e,t):t},subscribe:e=>(s.add(e),()=>s.delete(e)),clear:()=>{r=null,i=null,a=0}}}async function Ze(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(`HTTP ${n.status}`);return await n.json()}function Qe(){return`/api/sessions`}var $e=Xe({fetcher:()=>Ze(`/api/models`)}),et=Xe({fetcher:()=>Ze(Qe(),{cache:`no-store`})}),tt=Xe({fetcher:()=>Ze(`/api/preferences`)}),nt=Xe({fetcher:()=>Ze(`/api/models-config`)}),rt=Xe({fetcher:()=>Ze(`/api/plugins/global`)}),it=null;function at(e){it=e}var ot=Xe({fetcher:e=>{let t=it?`?cwd=${encodeURIComponent(it)}`:``;return Ze(`/api/updates${t}${t?`&`:`?`}refresh=${e?`1`:`0`}`)}}),st=Xe({fetcher:e=>Ze(`/api/skills/global`,e?{cache:`no-store`}:void 0)}),ct=Xe({fetcher:e=>Ze(`/api/commands/global`,e?{cache:`no-store`}:void 0)}),lt=Xe({fetcher:()=>Ze(`/api/model-thinking`)}),ut=Xe({fetcher:async()=>{let[e,t]=await Promise.all([Ze(`/api/auth/providers`),Ze(`/api/auth/all-providers`)]);return{oauth:e.providers,apiKey:t.providers}}});function dt(){return`/api/preferences`}var ft=new Map,pt=2e3;function mt(e){let t=JSON.stringify(e),n=Date.now(),r=ft.get(t);r!==void 0&&n-r<pt||(ft.set(t,n),fetch(dt(),{method:`PUT`,headers:{"Content-Type":`application/json`},body:t}).catch(e=>console.error(`[pi-web] save preferences:`,e)).finally(()=>{tt.refresh().catch(e=>console.error(`[pi-web] refresh preferences:`,e))}))}var ht={defaultModel:``,defaultThinking:``};function gt(){let[e,t]=(0,d.useState)(()=>tt.get()?.defaultThinkingLevel??``);(0,d.useEffect)(()=>tt.subscribe(()=>t(tt.get()?.defaultThinkingLevel??``)),[]),(0,d.useEffect)(()=>{e&&mt({firstPaint:{defaultThinkingLevel:e}})},[e]);let n=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.compaction??null),r=(0,d.useMemo)(()=>JSON.stringify(n),[n]);(0,d.useEffect)(()=>{r&&mt({firstPaint:{compaction:tt.get()?.compaction??null}})},[r]);let i=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.retry??null),a=(0,d.useMemo)(()=>JSON.stringify(i),[i]);(0,d.useEffect)(()=>{a&&mt({firstPaint:{retry:tt.get()?.retry??null}})},[a]);let[o,s]=(0,d.useState)(()=>tt.get()?.defaultProjectTrust??``);(0,d.useEffect)(()=>tt.subscribe(()=>s(tt.get()?.defaultProjectTrust??``)),[]),(0,d.useEffect)(()=>{o&&mt({firstPaint:{defaultProjectTrust:o}})},[o]);let c=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.subagents??ht),l=(0,d.useMemo)(()=>({defaultModel:c.defaultModel??``,defaultThinking:c.defaultThinking??``}),[c]);return(0,d.useEffect)(()=>{!l.defaultModel&&!l.defaultThinking||mt({firstPaint:{subagents:{defaultModel:l.defaultModel||void 0,defaultThinking:l.defaultThinking||void 0}}})},[l]),{defaultThinkingLevel:e,setDefaultThinkingLevel:t,compaction:n,retry:i,defaultProjectTrust:o,setDefaultProjectTrust:s,subagents:l}}var _t=`pi-web-auto-reload-seconds`,vt=3600;function yt(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isInteger(n)||n<0||n>3600?null:n}function bt(){if(typeof window>`u`)return 0;let e=window.localStorage.getItem(_t);if(e===null)return 0;let t=yt(e);return t===null?0:t}var xt=`pi-web-long-block-recent-expanded`;function St(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<0||n>20?null:n}function Ct(){if(typeof window>`u`)return 0;try{return St(window.localStorage.getItem(`pi-web-long-block-recent-expanded`)??``)??0}catch{return 0}}function wt(e,t,n,r){return e===`toolCall`?`tool:${n}`:`thinking:${t}:${r}`}var Tt=`pi-web-notify-events`,Et={taskComplete:!0,errors:!0,questions:!0,notifyWhileActive:!1};function Dt(){if(typeof window>`u`)return Et;try{let e=window.localStorage.getItem(Tt);if(!e)return Et;let t=JSON.parse(e);return{taskComplete:t.taskComplete??Et.taskComplete,errors:t.errors??Et.errors,questions:t.questions??Et.questions,notifyWhileActive:t.notifyWhileActive??Et.notifyWhileActive}}catch{return Et}}function Ot(e){window.localStorage.setItem(Tt,JSON.stringify(e))}var kt=`pluginConfigBindings`;function At(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(kt);if(!e)return{};let t=JSON.parse(e);if(t&&typeof t==`object`)return t}catch{}return{}}var jt=1e3,Mt=`pi-web-scroll-step-px`;function Nt(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<1||n>1e3?null:n}function Pt(){if(typeof window>`u`)return 200;try{return Nt(window.localStorage.getItem(`pi-web-scroll-step-px`)??``)??200}catch{return 200}}var Ft=`pi-web-font-scale`,It=1,Lt=19.2;function Rt(){let[e,t]=(0,d.useState)(()=>{if(typeof window>`u`)return It;let e=window.localStorage.getItem(Ft),t=e===null?NaN:Number(e);return Number.isFinite(t)&&t>=.85&&t<=1.3?t:It}),[n,r]=(0,d.useState)(()=>Pt()),[i,a]=(0,d.useState)(()=>bt()),[o,s]=(0,d.useState)(()=>Ct()),[c,l]=(0,d.useState)(()=>Dt());(0,d.useEffect)(()=>{Ot(c),mt({preferences:{notifyEvents:c}})},[c]);let[u,f]=(0,d.useState)(()=>At()),p=(0,d.useCallback)((e,t)=>{f(n=>{let r=n[e]??[];return r.some(e=>e.path===t.path)?n:{...n,[e]:[...r,t]}})},[]),m=(0,d.useCallback)((e,t)=>{f(n=>{let r=n[e];if(!r)return n;let i=r.filter(e=>e.path!==t),a={...n};return i.length===0?delete a[e]:a[e]=i,a})},[]);return(0,d.useEffect)(()=>{try{window.localStorage.setItem(kt,JSON.stringify(u))}catch{}mt({preferences:{pluginConfigBindings:u}})},[u]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(_t,String(i))}catch{}mt({preferences:{autoReloadSeconds:i}})},[i]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(Mt,String(n))}catch{}mt({preferences:{minimapScrollStepPx:n}})},[n]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(xt,String(o))}catch{}mt({preferences:{recentBlocksExpanded:o}})},[o]),(0,d.useEffect)(()=>{document.documentElement.style.fontSize=`${e*Lt}px`;try{window.localStorage.setItem(Ft,String(e))}catch{}mt({firstPaint:{fontScale:e}})},[e]),{fontScale:e,setFontScale:t,scrollStepPx:n,setScrollStepPx:r,autoReloadSeconds:i,setAutoReloadSeconds:a,recentBlocksExpanded:o,setRecentBlocksExpanded:s,notifyEvents:c,setNotifyEvents:l,pluginConfigBindings:u,addPluginConfigBinding:p,removePluginConfigBinding:m}}var zt=[{label:{en:`Explore project`,"zh-CN":`阅读项目`},message:{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`}},{label:{en:`Review workspace changes`,"zh-CN":`审查工作区改动`},message:{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`审查当前工作区的所有改动,指出潜在问题与改进点。`}},{label:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},message:{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}}];function Bt(e,t){return typeof e==`string`?e:t===`zh-CN`?e[`zh-CN`]??e.zh??e.en??``:e.en??e[`zh-CN`]??e.zh??``}function Vt(e){let t=e.trim();return{en:t,"zh-CN":t}}function Ht(e,t,n){let r=t.trim();if(typeof e==`string`){let t=e.trim();return n===`zh-CN`?{en:t,"zh-CN":r}:{en:r,"zh-CN":t}}let i=typeof e.en==`string`?e.en:``,a=e[`zh-CN`]??e.zh??i;return n===`zh-CN`?{en:i,"zh-CN":r}:{en:r,"zh-CN":a}}function Ut(e,t){let n=Bt(e,`en`),r=Bt(e,`zh-CN`),i=Bt(t,`en`),a=Bt(t,`zh-CN`);return n===i||r===a}var Wt={阅读项目:{en:`Explore project`,"zh-CN":`阅读项目`},review工作区改动:{en:`Review workspace changes`,"zh-CN":`review工作区改动`},寻找并修复bug:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},"阅读当前项目,总结整体目录结构与核心模块的职责。":{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`},"review 当前工作区的所有改动,指出潜在问题与改进点。":{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`review 当前工作区的所有改动,指出潜在问题与改进点。`},"检查当前代码,寻找并修复其中存在的 bug。":{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}};function Gt(e){if(typeof e==`string`){let t=e.trim();return t===``?null:Wt[t]??Vt(t)}if(typeof e==`object`&&e){let t=e,n=t.en,r=t[`zh-CN`]??t.zh,i=typeof n==`string`?n.trim():``,a=typeof r==`string`?r.trim():``;return i===``&&a===``?null:{en:i===``?a:i,"zh-CN":a===``?i:a}}return null}function Kt(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let{label:e,message:r,allowAppend:i}=n,a=Gt(e),o=Gt(r);if(!a||!o)continue;let s={label:a,message:o};i===!0&&(s.allowAppend=!0),t.push(s)}return t}function qt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``)continue;let e=Kt(r);e&&e.length>0&&(t[n]=e)}return t}function Jt({put:e}){let[t,n]=(0,d.useState)(()=>Kt(tt.get()?.preferences?.startScreenMessages)??zt),r=(0,d.useCallback)(e=>{if(t.some(t=>Ut(t.label,e.label))){let t=typeof e.label==`string`?e.label:e.label?.en??e.label[`zh-CN`]??JSON.stringify(e.label);throw Error(`Name conflict: "${t}"`)}n(t=>[...t,e])},[t]),i=(0,d.useCallback)(e=>{n(t=>e<0||e>=t.length?t:t.filter((t,n)=>n!==e))},[]),a=(0,d.useCallback)((e,r)=>{if(t.some((t,n)=>n!==e&&Ut(t.label,r.label))){let e=typeof r.label==`string`?r.label:r.label?.en??r.label[`zh-CN`]??JSON.stringify(r.label);throw Error(`Name conflict: "${e}"`)}n(t=>{if(e<0||e>=t.length)return t;let n=[...t];return n[e]=r,n})},[t]),o=(0,d.useCallback)(()=>{n(e=>{let t=e.filter(e=>!zt.some(t=>Ut(t.label,e.label)));return[...zt,...t]})},[]);return(0,d.useEffect)(()=>tt.subscribe(()=>n(Kt(tt.get()?.preferences?.startScreenMessages)??zt)),[]),(0,d.useEffect)(()=>{e({preferences:{startScreenMessages:t}})},[t,e]),{startScreenMessages:t,addStartScreenMessage:r,removeStartScreenMessage:i,updateStartScreenMessage:a,resetStartScreenMessages:o}}function Yt(e){return typeof e==`number`&&Number.isFinite(e)}function Xt(e){if(typeof e!=`object`||!e)return null;let{x:t,y:n,width:r,height:i,collapsed:a}=e;return!Yt(t)||!Yt(n)||!Yt(r)||r<=0||!Yt(i)||i<=0?null:{x:t,y:n,width:r,height:i,collapsed:typeof a==`boolean`?a:void 0}}function Zt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``)continue;let e=Xt(r);e&&(t[n]=e)}return t}function Qt(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function $t({put:e}){let[t,n]=(0,d.useState)(()=>Zt(tt.get()?.preferences?.widgets)??{}),r=(0,d.useRef)(!1),[i,a]=(0,d.useState)(()=>qt(tt.get()?.preferences?.widgetMessages)??{}),[o,s]=(0,d.useState)(()=>Qt(tt.get()?.preferences?.workspaces));(0,d.useEffect)(()=>{let e=!1;return tt.load().then(()=>{if(e)return;r.current=!0;let t=tt.get()?.preferences;n(Zt(t?.widgets)??{}),a(qt(t?.widgetMessages)??{}),s(Qt(t?.workspaces))}).catch(()=>{r.current=!0}),()=>{e=!0}},[]);let c=(0,d.useCallback)((e,t)=>{n(n=>{let r=n[e];return r&&r.x===t.x&&r.y===t.y&&r.width===t.width&&r.height===t.height&&r.collapsed===t.collapsed?n:{...n,[e]:t}})},[]);(0,d.useEffect)(()=>{r.current&&e({preferences:{widgets:t}})},[t,e]);let l=(0,d.useCallback)((e,t)=>{if((i[e]??[]).some(e=>Ut(e.label,t.label))){let e=typeof t.label==`string`?t.label:t.label?.en??t.label[`zh-CN`]??JSON.stringify(t.label);throw Error(`Name conflict: "${e}"`)}a(n=>({...n,[e]:[...n[e]??[],t]}))},[i,a]),u=(0,d.useCallback)((e,t)=>{a(n=>{let r=n[e];if(!r||t<0||t>=r.length)return n;let i={...n},a=r.filter((e,n)=>n!==t);return a.length===0?delete i[e]:i[e]=a,i})},[a]),f=(0,d.useCallback)((e,t,n)=>{if((i[e]??[]).some((e,r)=>r!==t&&Ut(e.label,n.label))){let e=typeof n.label==`string`?n.label:n.label?.en??n.label[`zh-CN`]??JSON.stringify(n.label);throw Error(`Name conflict: "${e}"`)}a(r=>{let i=r[e];if(!i||t<0||t>=i.length)return r;let a={...r},o=[...i];return o[t]=n,a[e]=o,a})},[i,a]);return(0,d.useEffect)(()=>{r.current&&e({preferences:{widgetMessages:i}})},[i,e]),{widgetGeometries:t,widgetMessages:i,savedWorkspaces:o,setWidgetGeometry:c,addWidgetMessage:l,removeWidgetMessage:u,updateWidgetMessage:f,handleSavedWorkspacesChange:(0,d.useCallback)(t=>{s(t),e({preferences:{workspaces:t}})},[s,e])}}function en({isDark:e,toggleTheme:t}){let{fontScale:n,setFontScale:r,scrollStepPx:i,setScrollStepPx:a,autoReloadSeconds:o,setAutoReloadSeconds:s,recentBlocksExpanded:c,setRecentBlocksExpanded:l,notifyEvents:u,setNotifyEvents:f,pluginConfigBindings:p,addPluginConfigBinding:m,removePluginConfigBinding:h}=Rt(),{widgetGeometries:g,widgetMessages:_,savedWorkspaces:v,setWidgetGeometry:y,addWidgetMessage:b,removeWidgetMessage:x,updateWidgetMessage:S,handleSavedWorkspacesChange:C}=$t({put:mt}),{startScreenMessages:w,addStartScreenMessage:T,removeStartScreenMessage:E,updateStartScreenMessage:D,resetStartScreenMessages:O}=Jt({put:mt}),{defaultThinkingLevel:k,setDefaultThinkingLevel:A,compaction:j,retry:M,defaultProjectTrust:N,setDefaultProjectTrust:ee,subagents:te}=gt();return tt.load().catch(e=>console.error(`[pi-web] load preferences:`,e)),{settingsValue:(0,d.useMemo)(()=>({isDark:e,toggleTheme:t,fontScale:n,setFontScale:r,scrollStepPx:i,setScrollStepPx:a,autoReloadSeconds:o,setAutoReloadSeconds:s,recentBlocksExpanded:c,setRecentBlocksExpanded:l,notifyEvents:u,setNotifyEvents:f,widgetGeometries:g,setWidgetGeometry:y,widgetMessages:_,addWidgetMessage:b,removeWidgetMessage:x,updateWidgetMessage:S,startScreenMessages:w,addStartScreenMessage:T,removeStartScreenMessage:E,updateStartScreenMessage:D,resetStartScreenMessages:O,pluginConfigBindings:p,addPluginConfigBinding:m,removePluginConfigBinding:h}),[e,t,n,i,o,c,u,g,y,_,b,x,S,w,T,E,D,O,p,m,h,s,r,f,l,a]),defaultThinkingLevel:k,setDefaultThinkingLevel:A,compaction:j,retry:M,defaultProjectTrust:N,setDefaultProjectTrust:ee,subagents:te,savedWorkspaces:v,handleSavedWorkspacesChange:C,widgetGeometries:g,setWidgetGeometry:y,widgetMessages:_,addWidgetMessage:b,removeWidgetMessage:x,updateWidgetMessage:S,fontScale:n,setFontScale:r}}function tn({projectTrustCwd:e,onTrusted:t}){let[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(r(null),a(!1),l(null),!e)return;let t=new AbortController,n=new URLSearchParams(window.location.search).get(`piE2eTrustCwd`);return fetch(`/api/project-trust?cwd=${encodeURIComponent(e)}${n?`&piE2eTrustCwd=${encodeURIComponent(n)}`:``}`,{signal:t.signal}).then(async e=>{let t=await e.json();if(!e.ok||t.error)throw Error(t.error??`HTTP ${e.status}`);r(t)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||console.error(`Failed to load project trust:`,e)}),()=>t.abort()},[e]),{projectTrust:n,projectTrustDialogOpen:i,setProjectTrustDialogOpen:a,projectTrustBusy:o,projectTrustError:c,setProjectTrustError:l,handleTrustProject:(0,d.useCallback)(async()=>{if(!(!e||o)){s(!0),l(null);try{let n=await fetch(`/api/project-trust`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:e})}),i=await n.json();if(!n.ok||i.error)throw Error(i.error??`HTTP ${n.status}`);r(i),a(!1),t?.()}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}},[o,e,t])}}var nn=class extends Error{constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.body=n}},rn=[],an=1,on=new Set;function sn(){for(let e of on)e()}function cn(e){return on.add(e),()=>{on.delete(e)}}function ln(){return rn}function un(e){let t={id:an++,label:e??``};rn=[...rn,t],sn();let n=!1;return()=>{n||(n=!0,rn=rn.filter(e=>e.id!==t.id),sn())}}var dn=new WeakMap;function fn(e){if(!e.isConnected)return()=>{};let t=dn.get(e);if(!t){let n=document.createElement(`div`);n.style.cssText=`position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--bg) 50%, transparent);z-index:5;`,n.innerHTML=`<div style="width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--text-dim);border-radius:50%;animation:spin 0.8s linear infinite;"></div>`;let r=null;getComputedStyle(e).position===`static`&&(r=e.style.position,e.style.position=`relative`),e.appendChild(n),t={count:0,el:n,prevPosition:r},dn.set(e,t)}t.count++;let n=!1;return()=>{n||(n=!0,t.count--,t.count<=0&&(t.el.remove(),t.prevPosition!==null&&(t.prevPosition?e.style.position=t.prevPosition:e.style.removeProperty(`position`)),dn.delete(e)))}}async function pn(e){try{return await e.json()}catch{return null}}function mn(e,t){return e===`fullscreen`?un(t):e instanceof HTMLElement?fn(e):null}function hn(e,t){return e instanceof Error?e.message:t}function gn(e,t){return e&&typeof e==`object`&&`error`in e&&typeof e.error==`string`?e.error:`HTTP ${t}`}async function _n(e,t,n){let r=mn(n?.loading??`fullscreen`,n?.label);try{let n;try{n=await fetch(e,t)}catch(e){throw new nn(hn(e,`Network error`),0)}if(!n.ok){let e=await pn(n);throw new nn(gn(e,n.status),n.status,e)}let r=await n.text();return r?JSON.parse(r):void 0}catch(e){throw e instanceof nn?e:new nn(hn(e,String(e)),0)}finally{r?.()}}var vn=e=>window.history.replaceState(null,``,e);function yn(e){let{selectedSession:t,setSelectedSession:n,setNewSessionCwd:r,setSessionKey:i,setRefreshKey:a,hydrateSelectedSession:o,extensionDialogActiveRef:s,suppressCwdBumpRef:c,setInitialSessionRestored:l,onSessionSelected:u,onTopPanelReset:f}=e,p=(0,d.useCallback)((e,t=!1)=>{!t&&s.current||(r(null),n(e),i(e=>e+1),l(!0),t&&(c.current=!0),t||vn(`?session=${encodeURIComponent(e.id)}`),u?.(t))},[s,c,r,n,i,l,u]),m=(0,d.useCallback)(async(e,t)=>{await _n(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t})},{loading:`silent`}),n(null),r(t),i(e=>e+1),f?.(),u?.(!1),vn(`/`)},[u,f,r,n,i]),h=(0,d.useCallback)(e=>{r(null),n(e),a(e=>e+1),o(e.id),vn(`?session=${encodeURIComponent(e.id)}`)},[o,r,a,n]),g=(0,d.useCallback)((e,t)=>{n(n=>n&&n.id===e?{...n,name:t}:n),a(e=>e+1)},[a,n]),_=(0,d.useCallback)(()=>{l(!0)},[l]);return{handleSelectSession:p,handleNewSession:m,handleSessionCreated:h,handleSessionRenamed:g,handleSessionForked:(0,d.useCallback)(e=>{a(e=>e+1),i(e=>e+1),r(null),n(t=>({...t??{path:``,cwd:``,created:``,modified:``,messageCount:0,firstMessage:``},id:e})),o(e),vn(`?session=${encodeURIComponent(e)}`)},[o,r,a,n,i]),handleSessionDeleted:(0,d.useCallback)(e=>{if(a(e=>e+1),t?.id===e){let e=t.cwd;n(null),r(e??null),i(e=>e+1),f?.(),vn(`/`)}},[t,f,r,a,n,i]),handleInitialRestoreDone:_}}function bn(){let[e,t]=(0,d.useState)(0),[n,r]=(0,d.useState)(0),[i,a]=(0,d.useState)(0),[o,s]=(0,d.useState)(0);return{refreshKey:e,setRefreshKey:t,sessionKey:n,setSessionKey:r,explorerRefreshKey:i,setExplorerRefreshKey:a,modelsRefreshKey:o,setModelsRefreshKey:s,handleAgentEnd:(0,d.useCallback)(()=>{t(e=>e+1),a(e=>e+1)},[]),handleExplorerRefresh:(0,d.useCallback)(()=>{a(e=>e+1)},[])}}var xn=e=>window.history.replaceState(null,``,e);function Sn({initialNavigation:e,onProjectSwitch:t,onSessionSelected:n,onTopPanelReset:r}){let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(()=>e.requestedCwd?`validating`:`idle`),[u,f]=(0,d.useState)(null),{refreshKey:p,setRefreshKey:m,sessionKey:h,setSessionKey:g,explorerRefreshKey:_,setExplorerRefreshKey:v,modelsRefreshKey:y,setModelsRefreshKey:b,handleAgentEnd:x,handleExplorerRefresh:S}=bn(),[C,w]=(0,d.useState)(()=>!e.sessionId),[T,E]=(0,d.useState)(null),D=(0,d.useRef)(null),O=(0,d.useRef)(!1),k=(0,d.useRef)(!1);(0,d.useEffect)(()=>{let t=e.requestedCwd;if(!t)return;let n=new AbortController;return l(`validating`),f(null),fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t}),signal:n.signal}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok||!t.cwd)throw Error(t.error??`HTTP ${e.status}`);O.current=!0,s(t.cwd),l(`ready`)}).catch(e=>{n.signal.aborted||(f(e instanceof Error?e.message:String(e)),l(`error`))}),()=>n.abort()},[e]);let A=o??(i===null&&T?T:null),j=i!==null||A!==null,M=i?.cwd??A,{projectTrust:N,projectTrustDialogOpen:ee,setProjectTrustDialogOpen:te,projectTrustBusy:P,projectTrustError:ne,setProjectTrustError:re,handleTrustProject:ie}=tn({projectTrustCwd:M,onTrusted:()=>{b(e=>e+1),g(e=>e+1)}}),{handleSelectSession:ae,handleNewSession:oe,handleSessionCreated:se,handleSessionRenamed:ce,handleSessionForked:le,handleSessionDeleted:ue,handleInitialRestoreDone:de}=yn({selectedSession:i,setSelectedSession:a,setNewSessionCwd:s,setSessionKey:g,setRefreshKey:m,hydrateSelectedSession:(0,d.useCallback)(e=>{et.load().then(t=>{let n=t.sessions.find(t=>t.id===e);n&&a(t=>t&&t.id===e&&!t.projectRoot?n:t)}).catch(e=>console.error(`[pi-web] hydrate session:`,e))},[]),extensionDialogActiveRef:k,suppressCwdBumpRef:O,setInitialSessionRestored:w,onSessionSelected:n,onTopPanelReset:r});return{selectedSession:i,setSelectedSession:a,newSessionCwd:o,effectiveNewSessionCwd:A,showChat:j,projectTrustCwd:M,refreshKey:p,setRefreshKey:m,explorerRefreshKey:_,setExplorerRefreshKey:v,modelsRefreshKey:y,setModelsRefreshKey:b,sessionKey:h,activeCwd:T,initialCwdStatus:c,initialCwdError:u,initialSessionRestored:C,projectTrust:N,projectTrustDialogOpen:ee,setProjectTrustDialogOpen:te,projectTrustBusy:P,projectTrustError:ne,setProjectTrustError:re,extensionDialogActiveRef:k,handleSelectSession:ae,handleNewSession:oe,handleSessionCreated:se,handleAgentEnd:x,handleSessionRenamed:ce,handleSessionForked:le,handleSessionDeleted:ue,handleSessionUnseen:(0,d.useCallback)(e=>{i?.id===e&&(a(null),g(e=>e+1),r?.(),xn(`/`))},[i,r,g]),handleCwdChange:(0,d.useCallback)((e,n)=>{if(E(e),!e)return;let r=n??e,o=D.current??(i?i.projectRoot??i.cwd:null);if(!o){D.current=r;return}if(D.current=r,O.current){O.current=!1;return}o!==r&&(i?i.projectRoot??i.cwd:null)!==r&&(a(null),s(t=>t&&t!==e?null:t),g(e=>e+1),t?.())},[i,t,s,g,a]),handleTrustProject:ie,handleExplorerRefresh:S,handleInitialRestoreDone:de}}var Cn=(0,d.createContext)(null);function wn({value:e,children:t}){return(0,F.jsx)(Cn.Provider,{value:e,children:t})}function Tn(){let e=(0,d.useContext)(Cn);if(!e)throw Error(`useSettings must be used within SettingsProvider`);return e}function En(e,t,n){let[r,i]=(0,d.useState)(()=>{try{let t=localStorage.getItem(e);if(t!==null){let e=JSON.parse(t);return n?n(e):e}}catch{}return typeof t==`function`?t():t});return(0,d.useEffect)(()=>{try{localStorage.setItem(e,JSON.stringify(r))}catch{}},[e,r]),[r,i]}var Dn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),On=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),kn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),An=e=>{let t=kn(e);return t.charAt(0).toUpperCase()+t.slice(1)},jn={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`},Mn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Nn=(0,d.createContext)({}),Pn=()=>(0,d.useContext)(Nn),Fn=(0,d.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:f=!1,color:p=`currentColor`,className:m=``}=Pn()??{},h=r??f?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...jn,width:t??l??jn.width,height:t??l??jn.height,stroke:e??p,strokeWidth:h,className:Dn(`lucide`,m,i),...!a&&!Mn(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),In=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(Fn,{ref:i,iconNode:t,className:Dn(`lucide-${On(An(e))}`,`lucide-${e}`,n),...r}));return n.displayName=An(e),n},Ln=In(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Rn=In(`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`}]]),zn=In(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Bn=In(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Vn=In(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Hn=In(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]]),Un=In(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Wn=In(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Gn=In(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Kn=In(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),qn=In(`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`}]]),Jn=In(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Yn=In(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Xn=In(`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`}]]),Zn=In(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),Qn=In(`file-text`,[[`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:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),$n=In(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),er=In(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`}]]),tr=In(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),nr=In(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),rr=In(`hard-drive-upload`,[[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),ir=In(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),ar=In(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),or=In(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),sr=In(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),cr=In(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),lr=In(`list-end`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M16 12H3`,key:`1a2rj7`}],[`path`,{d:`M9 19H3`,key:`s61nz1`}],[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M21 5v12a2 2 0 0 1-2 2h-6`,key:`hey24a`}]]),ur=In(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),dr=In(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),fr=In(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),pr=In(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),mr=In(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),hr=In(`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`}]]),gr=In(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),_r=In(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),vr=In(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),yr=In(`rotate-ccw-clock`,[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),br=In(`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`}]]),xr=In(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Sr=In(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Cr=In(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),wr=In(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Tr=In(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Er=In(`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`}]]),Dr=In(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Or=In(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),kr=In(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ar=In(`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`}]]),jr=In(`trash`,[[`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`}]]),Mr=In(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Nr=In(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Pr=In(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Fr=In(`volume-x`,[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]),Ir=In(`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`}]]),Lr=In(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Rr=In(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]);function zr(e){return{value:(0,d.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get(),()=>e.get()),error:e.getError()}}var Br=`pi-web`;function Vr(e,t){let n=Hr(e),r=Hr(t),i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=n[e]??0,i=r[e]??0;if(t>i)return 1;if(t<i)return-1}return 0}function Hr(e){return e.replace(/^v/i,``).split(/[-+]/)[0].split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t})}function Ur({current:e,latest:t},n){return t!==null&&t!==n&&Vr(t,e)>0}function Wr(e){return e.enabled!==!1}function Gr(e,t){return t[e]===`*`}function Kr(e){if(!Wr(e))return 0;let t=e.ignored??{};return+!!Ur(e.piWeb,t[`pi-web`])+e.plugins.filter(e=>!Gr(e.source,t)).length}function qr(e,t){if(!Wr(e))return[];let n=e.ignored??{},r=[];Ur(e.piWeb,n[`pi-web`])&&r.push(`pi-web`);let i=e.plugins.filter(e=>!Gr(e.source,n)).length;return i>0&&r.push(`${i} ${t}`),r}function Jr(e,t){let n=(0,d.useRef)(t);(n.current.length!==t.length||n.current.some((e,n)=>e!==t[n]))&&e(),n.current=t}var Yr=t(c(),1);function Xr({children:e}){return(0,F.jsx)(F.Fragment,{children:e})}function L({label:e,wrapperStyle:t,hoverOnly:n,children:r}){let i=(0,d.useRef)(null),a=(0,d.useRef)(null),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),[u,f]=(0,d.useState)({top:0,left:0,placement:`bottom`});if((0,d.useLayoutEffect)(()=>{if(!e||!o||!c)return;let t=i.current?.getBoundingClientRect(),n=a.current;if(!t||!n)return;let r=n.offsetWidth,s=n.offsetHeight;if(!r)return;let l=t.left+t.width/2,u=r/2,d=window.innerWidth,p=window.innerHeight,m=Math.max(u+8,Math.min(l,d-u-8)),h=t.bottom+6+s<=p-8,g=t.top-6-s>=8,_=h||!g?`bottom`:`top`;f({top:_===`bottom`?t.bottom+6:t.top-6,left:m,placement:_})},[e,o,c]),!e)return(0,F.jsx)(F.Fragment,{children:r});let p=()=>{let e=i.current?.getBoundingClientRect();e&&f({top:e.bottom+6,left:e.left+e.width/2,placement:`bottom`})},m=()=>{p(),l(!0),s(!0)},h=()=>s(!1),g=c&&typeof document<`u`?(0,Yr.createPortal)((0,F.jsx)(`div`,{ref:a,role:`tooltip`,"data-slot":`tooltip-content`,style:{position:`fixed`,top:u.top,left:u.left,transform:u.placement===`top`?`translate(-50%, -100%)`:`translateX(-50%)`,zIndex:9999,width:`max-content`,maxWidth:`min(20rem, calc(100vw - 16px))`,whiteSpace:`pre-line`,overflowWrap:`break-word`,background:`var(--bg-panel)`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md, 6px)`,padding:`4px 8px`,fontSize:`var(--text-sm)`,lineHeight:1.5,boxShadow:`0 4px 16px -2px var(--shadow-strong)`,pointerEvents:`none`,display:o?`block`:`none`},children:e}),document.body):null;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{ref:i,"data-slot":`tooltip-trigger`,title:``,onPointerEnter:m,onPointerLeave:h,onMouseEnter:m,onMouseLeave:h,onFocus:n?void 0:m,onBlur:n?void 0:h,onPointerMove:e=>e.stopPropagation(),style:{display:`inline-flex`,...t},children:r}),g]})}function Zr({label:e,hint:t,children:n}){return(0,F.jsxs)(Qr,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,minWidth:0},children:[(0,F.jsx)(`span`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500,whiteSpace:`nowrap`},children:e}),t&&(0,F.jsx)(L,{label:t,children:(0,F.jsx)(`span`,{role:`img`,"aria-label":t,style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,cursor:`help`,lineHeight:1,flexShrink:0},children:`ⓘ`})})]}),(0,F.jsx)(`div`,{style:{flex:1,minWidth:0,maxWidth:320},children:n})]})}function Qr({children:e}){return(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`10px 14px`,border:`1px solid var(--border)`,borderRadius:10,background:`var(--bg-panel)`},children:e})}var $r=[{key:`enableAnalytics`,kind:`bool`},{key:`enableInstallTelemetry`,kind:`bool`,default:!0},{key:`httpProxy`,kind:`string`},{key:`trackingId`,kind:`string`},{key:`httpIdleTimeoutMs`,kind:`int`},{key:`websocketConnectTimeoutMs`,kind:`int`},{key:`branchSummary`,kind:`object`,fields:[{key:`reserveTokens`,kind:`int`},{key:`skipPrompt`,kind:`bool`}]},{key:`images`,kind:`object`,fields:[{key:`autoResize`,kind:`bool`,default:!0,hint:`preferences.pi.autoResizeHint`},{key:`blockImages`,kind:`bool`,hint:`preferences.pi.blockImagesHint`}]}],ei={};function ti(){let{t:e}=I(),t=(0,d.useSyncExternalStore)(tt.subscribe,()=>tt.get()?.piSettings??ei),n=e=>{_n(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{piSettings:e}})},{loading:`silent`}).finally(()=>void tt.refresh().catch(e=>console.error(`[pi-web] refresh preferences:`,e)))},r=(e,t)=>n({[e]:t}),i=(e,r,i)=>{let a=t[e]??{};n({[e]:{...a,[r]:i}})};return(0,F.jsx)(`div`,{style:{height:`100%`,overflowY:`auto`,padding:`18px 20px 40px`,display:`flex`,flexDirection:`column`,gap:8,maxWidth:640},children:$r.map(n=>(0,F.jsx)(ni,{spec:n,value:t[n.key],t:e,setValue:r,setSub:i},n.key))})}function ni({spec:e,value:t,t:n,setValue:r,setSub:i}){return(0,F.jsx)(Zr,{label:n(`preferences.pi.${e.key}`),hint:n(`preferences.pi.${e.key}Hint`),children:(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,width:`100%`},children:[e.kind===`bool`&&(0,F.jsx)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text-muted)`,whiteSpace:`nowrap`},children:(0,F.jsx)(`input`,{type:`checkbox`,checked:(t??e.default)===!0,onChange:t=>r(e.key,t.target.checked),"aria-label":n(`preferences.pi.${e.key}`)})}),e.kind===`string`&&(0,F.jsx)(ii,{value:typeof t==`string`?t:``,placeholder:n(`preferences.pi.unset`),onCommit:t=>r(e.key,t),ariaLabel:n(`preferences.pi.${e.key}`)}),e.kind===`int`&&(0,F.jsx)(ii,{value:typeof t==`number`?String(t):``,placeholder:n(`preferences.pi.unset`),numeric:!0,onCommit:t=>r(e.key,Number(t)),ariaLabel:n(`preferences.pi.${e.key}`)}),e.kind===`object`&&e.fields?.map(r=>(0,F.jsx)(ri,{sub:r,value:t?.[r.key],t:n,setSub:i,specKey:e.key},r.key))]})})}function ri({specKey:e,sub:t,value:n,t:r,setSub:i}){let a=n=>i(e,t.key,n),o=r(`preferences.pi.${t.key}`);return(0,F.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text-muted)`,whiteSpace:`nowrap`},children:[(0,F.jsx)(`span`,{style:{minWidth:120},children:o}),t.hint&&(0,F.jsx)(L,{label:r(t.hint),children:(0,F.jsx)(`span`,{role:`img`,"aria-label":r(t.hint),style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,cursor:`help`,lineHeight:1,flexShrink:0},children:`ⓘ`})}),t.kind===`bool`&&(0,F.jsx)(`input`,{type:`checkbox`,checked:(n??t.default)===!0,onChange:e=>a(e.target.checked),"aria-label":o}),t.kind===`string`&&(0,F.jsx)(ii,{value:typeof n==`string`?n:``,placeholder:r(`preferences.pi.unset`),onCommit:a,ariaLabel:o}),t.kind===`int`&&(0,F.jsx)(ii,{value:typeof n==`number`?String(n):``,placeholder:r(`preferences.pi.unset`),numeric:!0,onCommit:e=>a(Number(e)),ariaLabel:o})]})}function ii({value:e,placeholder:t,numeric:n,onCommit:r,ariaLabel:i}){let[a,o]=(0,d.useState)(e);return Jr(()=>o(e),[e]),(0,F.jsx)(`input`,{type:n?`number`:`text`,min:n?1:void 0,placeholder:t,value:a,onChange:e=>o(e.target.value),onBlur:()=>{let e=a.trim();if(e!==``){if(n){let t=Number(e);if(!Number.isInteger(t)||t<=0)return}r(e)}},"aria-label":i,style:{width:200,padding:`4px 6px`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`,color:`var(--text)`,background:`var(--bg-input)`,border:`1px solid var(--border)`,borderRadius:6,outline:`none`}})}var R={xs:10,sm:11,base:12,lg:13,xl:14,"2xl":15,"3xl":16,"4xl":18,"5xl":20},ai=1200,oi=320,si=420;function ci(e,t,n){return Math.round(Math.max(t,Math.min(Math.max(t,n),Number.isFinite(e)?e:t)))}function li(e){let{viewportWidth:t,rightPanelOpen:n,rightPanelWidth:r}=e;if(t<=640)return 480;let i=t<960,a=i?oi:si,o=!i&&n?r:0;return Math.min(480,t-a-o)}function ui(e){let{viewportWidth:t,sidebarOpen:n,sidebarWidth:r}=e;if(t<960)return ai;let i=n?r:0;return Math.min(ai,t-si-i)}var di={boxSizing:`border-box`,background:`var(--bg-input, var(--bg))`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:4,padding:`4px 8px`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`},fi={display:`flex`,alignItems:`center`,justifyContent:`center`,width:22,height:22,padding:0,background:`none`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,lineHeight:1,flexShrink:0};function pi({value:e,onChange:t,parse:n}){let[r,i]=(0,d.useState)(String(e));return Jr(()=>{i(String(e))},[e]),{draft:r,commit:e=>{i(e);let r=n(e);r!==null&&t(r)}}}function mi({tooltip:e=!1,offText:t,...n}){let{t:r,labelKey:i,unitText:a,rangeText:o,resetText:s,defaultValue:c,min:l,max:u}=n,{draft:d,commit:f}=pi(n),p=t!=null&&n.value===c?t:o,m=(0,F.jsx)(`input`,{type:`number`,min:l,max:u,step:1,value:d,onChange:e=>f(e.target.value),"aria-label":r(i),...e?{}:{title:p},style:{flex:1,minWidth:0,...di}}),h=(0,F.jsx)(`button`,{type:`button`,onClick:()=>n.onChange(c),"aria-label":s,...e?{}:{title:s},style:fi,children:`↺`});return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`},children:[e?(0,F.jsx)(L,{label:p,wrapperStyle:{flex:1,display:`flex`},children:m}):m,(0,F.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,whiteSpace:`nowrap`},children:a}),e?(0,F.jsx)(L,{label:s,children:h}):h]})}function hi({unitSuffix:e,offText:t,tooltip:n=!0,...r}){let{t:i,labelKey:a,rangeText:o,resetText:s,value:c,defaultValue:l,min:u,max:d}=r,{draft:f,commit:p}=pi(r);return(0,F.jsxs)(`div`,{role:`menu`,"aria-label":i(a),style:{background:`var(--bg-panel)`,borderLeft:`1px solid var(--border)`,borderRight:`1px solid var(--border)`,borderBottom:`1px solid var(--border)`,padding:`10px 12px 12px`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`var(--text-base)`,color:`var(--text-muted)`,marginBottom:8},children:[(0,F.jsx)(`span`,{children:i(a)}),(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,F.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600},children:[c,e]}),(()=>{let e=(0,F.jsx)(`button`,{type:`button`,onClick:()=>r.onChange(l),"aria-label":s,...n?{}:{title:s},style:fi,children:`↺`});return n?(0,F.jsx)(L,{label:s,children:e}):e})()]})]}),(0,F.jsx)(`input`,{type:`number`,min:u,max:d,step:1,value:f,onChange:e=>p(e.target.value),"aria-label":i(a),style:{width:`100%`,...di}}),(0,F.jsx)(`div`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginTop:4,textAlign:`center`},children:t!=null&&c===l?t:o})]})}function gi({value:e,onChange:t,t:n,embedded:r}){let i={value:e,onChange:t,parse:Nt,min:1,max:jt,defaultValue:200,t:n,labelKey:`theme.scrollStep`,unitText:n(`scrollStep.unit`),rangeText:n(`scrollStep.range`),resetText:n(`scrollStep.reset`,{n:200})};return r?(0,F.jsx)(mi,{...i,tooltip:!0}):(0,F.jsx)(hi,{...i,unitSuffix:`px`})}function _i({sidebarWidth:e,onSidebarWidthChange:t,widgetPanelWidth:n,onWidgetPanelWidthChange:r}){let{t:i}=I(),{isDark:a,toggleTheme:o,fontScale:s,setFontScale:c,scrollStepPx:l,setScrollStepPx:u,recentBlocksExpanded:d,setRecentBlocksExpanded:f}=Tn();return(0,F.jsxs)(`div`,{style:{height:`100%`,overflowY:`auto`,padding:`18px 20px 40px`,display:`flex`,flexDirection:`column`,gap:8,maxWidth:640},children:[(0,F.jsx)(Zr,{label:i(`theme.toggleTheme`),children:(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[{value:!0,key:`dark`,labelKey:`theme.darkMode`},{value:!1,key:`light`,labelKey:`theme.lightMode`}].map(({value:e,key:t,labelKey:n})=>(0,F.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text)`,cursor:`pointer`,whiteSpace:`nowrap`},children:[(0,F.jsx)(`input`,{type:`radio`,name:`theme-mode`,checked:a===e,onChange:e=>{let t=e.currentTarget.getBoundingClientRect();o({x:t.left+t.width/2,y:t.top+t.height/2})},style:{accentColor:`var(--accent)`,cursor:`pointer`,margin:0}}),i(n)]},t))})}),(0,F.jsx)(Zr,{label:i(`theme.fontSize`),children:(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,width:`100%`},children:[(0,F.jsx)(`input`,{type:`range`,min:.85,max:1.3,step:.05,value:s,onChange:e=>c(Number(e.target.value)),"aria-label":i(`theme.fontSize`),style:{flex:1,accentColor:`var(--accent)`,cursor:`pointer`}}),(0,F.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,color:`var(--text)`,fontWeight:600,minWidth:44,textAlign:`right`},children:[Math.round(s*100),`%`]})]})}),(0,F.jsx)(Zr,{label:i(`theme.scrollStep`),hint:i(`scrollStep.hint`),children:(0,F.jsx)(gi,{value:l,onChange:u,t:i,embedded:!0})}),(0,F.jsx)(Zr,{label:i(`theme.recentBlocksExpanded`),hint:i(`recentBlocks.hint`),children:(0,F.jsx)(yi,{value:d,onChange:f,t:i})}),(0,F.jsx)(Zr,{label:i(`layout.sidebarWidth`),hint:i(`layout.widthRange`,{min:180,max:480}),children:(0,F.jsx)(vi,{value:e,onChange:t,min:180,max:480,resetTo:280,label:i(`layout.sidebarWidth`),t:i})}),(0,F.jsx)(Zr,{label:i(`layout.widgetPanelWidth`),hint:i(`layout.widthRange`,{min:200,max:560}),children:(0,F.jsx)(vi,{value:n,onChange:r,min:200,max:560,resetTo:280,label:i(`layout.widgetPanelWidth`),t:i})}),` `]})}function vi({value:e,onChange:t,min:n,max:r,resetTo:i,label:a,t:o}){return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,F.jsx)(`input`,{type:`number`,value:e,min:n,max:r,onChange:e=>{let i=Number.parseInt(e.target.value,10);Number.isFinite(i)&&t(Math.min(r,Math.max(n,i)))},onBlur:()=>t(e),"aria-label":a,style:{width:80,padding:`5px 8px`,border:`1px solid var(--border)`,borderRadius:7,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-lg)`,fontVariantNumeric:`tabular-nums`,outline:`none`}}),(0,F.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:`px`}),(0,F.jsx)(L,{label:o(`layout.widthReset`,{value:i}),children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>t(i),"aria-label":o(`layout.widthReset`,{value:i}),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:26,height:26,padding:0,background:`none`,border:`none`,borderRadius:5,color:`var(--text-dim)`,cursor:`pointer`},children:(0,F.jsxs)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,F.jsx)(`path`,{d:`M3 3v5h5`})]})})})]})}function yi({value:e,onChange:t,t:n}){return(0,F.jsx)(mi,{tooltip:!0,value:e,onChange:t,parse:St,min:0,max:20,defaultValue:0,t:n,labelKey:`theme.recentBlocksExpanded`,unitText:n(`longBlock.blocks`),rangeText:n(`recentBlocks.range`),resetText:n(`recentBlocks.reset`,{n:0})})}function bi(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=bi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function xi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bi(e))&&(r&&(r+=` `),r+=t);return r}var Si=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ci=xi,wi=(e,t)=>n=>{if(t?.variants==null)return Ci(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=Si(t)||Si(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 Ci(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)},Ti=Object.defineProperty,Ei=(e,t)=>Ti(e,`name`,{value:t,configurable:!0});function Di(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ei(Di,`setRef`);function Oi(...e){return t=>{let n=!1,r=e.map(e=>{let r=Di(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Di(e[t],null)}}}}Ei(Oi,`composeRefs`);function ki(...e){return d.useCallback(Oi(...e),e)}Ei(ki,`useComposedRefs`);var Ai=Object.defineProperty,ji=(e,t)=>Ai(e,`name`,{value:t,configurable:!0});function Mi(e){let t=d.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Vi(r)&&typeof Gi==`function`&&(r=Gi(r._payload)),d.Children.forEach(r,e=>{if(zi(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Vi(n)&&typeof Gi==`function`&&(n=Gi(n._payload)),a=Ii(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=d.cloneElement(a,void 0,s):!o&&d.Children.count(r)===1&&d.isValidElement(r)&&(a=r);let c=a?Ri(a):void 0,l=ki(n,c);if(!a){if(r||r===0)throw Error(o?Wi(e):Ui(e));return r}let u=Li(i,a.props??{});return a.type!==d.Fragment&&(u.ref=n?l:c),d.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}ji(Mi,`createSlot`);var Ni=Mi(`Slot`),Pi=Symbol.for(`radix.slottable`);function Fi(e){let t=ji(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Pi,t}ji(Fi,`createSlottable`);var Ii=ji((e,t)=>{if(`child`in e.props){let t=e.props.child;return d.isValidElement(t)?d.cloneElement(t,void 0,e.props.children(t.props.children)):null}return d.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Li(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}ji(Li,`mergeProps`);function Ri(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ji(Ri,`getElementRef`);function zi(e){return d.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Pi}ji(zi,`isSlottable`);var Bi=Symbol.for(`react.lazy`);function Vi(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Bi&&`_payload`in e&&Hi(e._payload)}ji(Vi,`isLazyComponent`);function Hi(e){return typeof e==`object`&&!!e&&`then`in e}ji(Hi,`isPromiseLike`);var Ui=ji(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Wi=ji(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Gi=d.use,Ki=Object.defineProperty,qi=(e,t)=>Ki(e,`name`,{value:t,configurable:!0}),Ji=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Mi(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,F.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yi(e,t){e&&Yr.flushSync(()=>e.dispatchEvent(t))}qi(Yi,`dispatchDiscreteCustomEvent`);var Xi=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Zi=Object.defineProperty,Qi=(e,t)=>Zi(e,`name`,{value:t,configurable:!0});function $i(e,t){let n=d.createContext(t);n.displayName=e+`Context`;let r=Qi(e=>{let{children:t,...r}=e,i=d.useMemo(()=>r,Object.values(r));return(0,F.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=d.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Qi(i,`useContext`),[r,i]}Qi($i,`createContext`);function ea(e,t=[]){let n=[];function r(t,r){let i=d.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Qi(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=d.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=d.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Qi(s,`useContext`),[o,s]}Qi(r,`createContext`);let i=Qi(()=>{let t=n.map(e=>d.createContext(e));return Qi(function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ta(i,...t)]}Qi(ea,`createContextScope`);function ta(...e){let t=e[0];if(e.length===1)return t;let n=Qi(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Qi(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Qi(ta,`composeContextScopes`);var na=Object.defineProperty,ra=(e,t)=>na(e,`name`,{value:t,configurable:!0});function ia(e){let t=e+`CollectionProvider`,[n,r]=ea(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ra(e=>{let{scope:t,children:n}=e,r=d.useRef(null),a=d.useRef(new Map).current;return(0,F.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Mi(s),l=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ki(t,a(s,n).collectionRef);return(0,F.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Mi(u),m=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),s=ki(t,o),c=a(u,n);return d.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,F.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ra(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:m},h,r]}ra(ia,`createCollection`);var aa=new WeakMap,oa=class e extends Map{static{ra(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],aa.set(this,!0)}set(e,t){return aa.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=la(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=sa(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=sa(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return sa(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function sa(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ca(e,t);return n===-1?void 0:e[n]}ra(sa,`at`);function ca(e,t){let n=e.length,r=la(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ra(ca,`toSafeIndex`);function la(e){return e!==e||e===0?0:Math.trunc(e)}ra(la,`toSafeInteger`);function ua(e){let t=e+`CollectionProvider`,[n,r]=ea(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new oa,setItemMap:ra(()=>void 0,`setItemMap`)}),o=ra(({state:e,...t})=>e?(0,F.jsx)(c,{...t,state:e}):(0,F.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=ra(e=>{let t=g();return(0,F.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=ra(e=>{let{scope:t,children:n,state:r}=e,a=d.useRef(null),[o,s]=d.useState(null),c=ki(a,s),[l,u]=r;return d.useEffect(()=>{if(!o)return;let e=ma(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,F.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Mi(l),f=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ki(t,a(l,n).collectionRef);return(0,F.jsx)(u,{ref:i,children:r})});f.displayName=l;let p=e+`CollectionItemSlot`,m=Mi(p),h=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),[s,c]=d.useState(null),l=ki(t,o,c),{setItemMap:u}=a(p,n),f=d.useRef(i);da(f.current,i)||(f.current=i);let h=f.current;return d.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(pa):(t.set(s,{...e,element:s}),t.toSorted(pa)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new oa(e)))}},[s,h,u]),(0,F.jsx)(m,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=p;function g(){return d.useState(new oa)}ra(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return ra(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}ra(ua,`createCollection`);function da(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ra(da,`shallowEqual`);function fa(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ra(fa,`isElementPreceding`);function pa(e,t){return!e[1].element||!t[1].element?0:fa(e[1].element,t[1].element)?-1:1}ra(pa,`sortByDocumentPosition`);function ma(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ra(ma,`getChildListObserver`);var ha=Object.defineProperty,ga=(e,t)=>ha(e,`name`,{value:t,configurable:!0}),_a=!!(typeof window<`u`&&window.document&&window.document.createElement);function va(e,t,{checkForDefaultPrevented:n=!0}={}){return ga(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ga(va,`composeEventHandlers`);function ya(e){if(!_a)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ga(ya,`getOwnerWindow`);function ba(e){if(!_a)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ga(ba,`getOwnerDocument`);function xa(e,t=!1){let{activeElement:n}=ba(e);if(!n?.nodeName)return null;if(Sa(n)&&n.contentDocument)return xa(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ba(n).getElementById(e);if(t)return t}}return n}ga(xa,`getActiveElement`);function Sa(e){return e.tagName===`IFRAME`}ga(Sa,`isFrame`);var Ca=globalThis?.document?d.useLayoutEffect:()=>{},wa=Object.defineProperty,Ta=(e,t)=>wa(e,`name`,{value:t,configurable:!0}),Ea=d.useEffectEvent,Da=d.useInsertionEffect;function Oa(e){if(typeof Ea==`function`)return Ea(e);let t=d.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Da==`function`?Da(()=>{t.current=e}):Ca(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ta(Oa,`useEffectEvent`);var ka=Object.defineProperty,Aa=(e,t)=>ka(e,`name`,{value:t,configurable:!0}),ja=d.useInsertionEffect||Ca;function Ma({prop:e,defaultProp:t,onChange:n=Aa(()=>{},`onChange`),caller:r}){let[i,a,o]=Na({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,d.useCallback(t=>{if(s){let n=Pa(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Aa(Ma,`useControllableState`);function Na({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),i=d.useRef(n),a=d.useRef(t);return ja(()=>{a.current=t},[t]),d.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Aa(Na,`useUncontrolledState`);function Pa(e){return typeof e==`function`}Aa(Pa,`isFunction`);var Fa=Symbol(`RADIX:SYNC_STATE`);function Ia(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Oa(o),u=[{...n,state:a}];r&&u.push(r);let[f,p]=d.useReducer((t,n)=>{if(n.type===Fa)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=f.state,h=d.useRef(m);d.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=d.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return d.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Fa,state:i})},[i,f.state,c]),[g,p]}Aa(Ia,`useControllableStateReducer`);var La=Object.defineProperty,Ra=(e,t)=>La(e,`name`,{value:t,configurable:!0});function za(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}Ra(za,`useStateMachine`);var Ba=Ra(e=>{let{present:t,children:n}=e,r=Va(t),i=typeof n==`function`?n({present:r.isPresent}):d.Children.only(n),a=Ua(r.ref,Ga(i));return typeof n==`function`||r.isPresent?d.cloneElement(i,{ref:a}):null},`Presence`);function Va(e){let[t,n]=d.useState(),r=d.useRef(null),i=d.useRef(e),a=d.useRef(`none`),o=d.useRef(void 0),[s,c]=za(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return d.useEffect(()=>{s===`mounted`?(a.current=o.current??Wa(r.current),o.current=void 0):a.current=`none`},[s]),Ca(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Wa(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Ca(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ra(a=>{let o=Wa(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ra(e=>{e.target===t&&(a.current=Wa(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:d.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Wa(t)}else r.current=null;n(e)},[])}}Ra(Va,`usePresence`);function Ha(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ra(Ha,`setRef`);function Ua(...e){let t=d.useRef(e);return t.current=e,d.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ha(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ha(n[e],null)}}},[])}Ra(Ua,`useStableComposedRefs`);function Wa(e){return e?.animationName||`none`}Ra(Wa,`getAnimationName`);function Ga(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ra(Ga,`getElementRef`);var Ka=Object.defineProperty,qa=(e,t)=>Ka(e,`name`,{value:t,configurable:!0}),Ja=d.useId||(()=>void 0),Ya=0;function Xa(e){let[t,n]=d.useState(Ja());return Ca(()=>{e||n(e=>e??String(Ya++))},[e]),e||(t?`radix-${t}`:``)}qa(Xa,`useId`);var Za=Object.defineProperty,Qa=(e,t)=>Za(e,`name`,{value:t,configurable:!0}),$a=`Collapsible`,[eo,to]=ea($a),[no,ro]=eo($a),io=d.forwardRef(Qa(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Ma({prop:r,defaultProp:i??!1,onChange:o,caller:$a});return(0,F.jsx)(no,{scope:n,disabled:a,contentId:Xa(),open:c,onOpenToggle:d.useCallback(()=>l(e=>!e),[l]),children:(0,F.jsx)(Ji.div,{"data-state":uo(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),ao=`CollapsibleTrigger`,oo=d.forwardRef(Qa(function(e,t){let{__scopeCollapsible:n,...r}=e,i=ro(ao,n);return(0,F.jsx)(Ji.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":uo(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:va(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),so=`CollapsibleContent`,co=d.forwardRef(Qa(function(e,t){let{forceMount:n,...r}=e,i=ro(so,e.__scopeCollapsible);return(0,F.jsx)(Ba,{present:n||i.open,children:({present:e})=>(0,F.jsx)(lo,{...r,ref:t,present:e})})},`CollapsibleContent`)),lo=d.forwardRef(Qa(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=ro(so,n),[s,c]=d.useState(r),l=d.useRef(null),u=ki(t,l),f=d.useRef(0),p=f.current,m=d.useRef(0),h=m.current,g=o.open||s,_=d.useRef(g),v=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Ca(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,F.jsx)(Ji.div,{"data-state":uo(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function uo(e){return e?`open`:`closed`}Qa(uo,`getState`);var fo=io,po=Object.defineProperty,mo=(e,t)=>po(e,`name`,{value:t,configurable:!0}),ho=d.createContext(void 0);function go(e){let t=d.useContext(ho);return e||t||`ltr`}mo(go,`useDirection`);var _o=Object.defineProperty,vo=(e,t)=>_o(e,`name`,{value:t,configurable:!0});function yo(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}vo(yo,`useCallbackRef`);var bo=Object.defineProperty,xo=(e,t)=>bo(e,`name`,{value:t,configurable:!0}),So=`dismissableLayer.update`,Co=`dismissableLayer.pointerDownOutside`,wo=`dismissableLayer.focusOutside`,To,Eo=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Do=d.forwardRef(xo(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=d.useContext(Eo),[f,p]=d.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=d.useState({}),g=ki(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=d.useRef(!1),w=Ao(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:d.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=jo(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=f?b===_.length-1:!1,D=yo(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return d.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(To=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Mo(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(f),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=To))}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Mo())},[f,u]),d.useEffect(()=>{let e=xo(()=>h({}),`handleUpdate`);return document.addEventListener(So,e),()=>document.removeEventListener(So,e)},[]),(0,F.jsx)(Ji.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:va(e.onFocusCapture,T.onFocusCapture),onBlurCapture:va(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:va(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Oo(){let e=d.useContext(Eo),[t,n]=d.useState(null);return d.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}xo(Oo,`useDismissableLayerSurface`);var ko=xo(()=>!0,`IS_TRUE`);function Ao(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ko}=t,s=yo(e),c=d.useRef(!1),l=d.useRef(!1),u=d.useRef(new Map),f=d.useRef(()=>{});return d.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}xo(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}xo(t,`isOutsideInteractionIntercepted`);function d(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}xo(d,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}xo(p,`handleInteractionBubble`);let m=xo(a=>{if(a.target&&!c.current){let d=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||No(Co,s,p,{discrete:!0})};if(xo(d,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?d():(n.removeEventListener(`click`,f.current),f.current=d,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,d,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,d,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:xo(()=>c.current=!0,`onPointerDownCapture`)}}xo(Ao,`usePointerDownOutside`);function jo(e,t=globalThis?.document){let n=yo(e),r=d.useRef(!1);return d.useEffect(()=>{let e=xo(e=>{e.target&&!r.current&&No(wo,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:xo(()=>r.current=!0,`onFocusCapture`),onBlurCapture:xo(()=>r.current=!1,`onBlurCapture`)}}xo(jo,`useFocusOutside`);function Mo(){let e=new CustomEvent(So);document.dispatchEvent(e)}xo(Mo,`dispatchUpdate`);function No(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Yi(i,a):i.dispatchEvent(a)}xo(No,`handleAndDispatchCustomEvent`);var Po=Object.defineProperty,Fo=(e,t)=>Po(e,`name`,{value:t,configurable:!0}),Io=`focusScope.autoFocusOnMount`,Lo=`focusScope.autoFocusOnUnmount`,Ro={bubbles:!1,cancelable:!0},zo=d.forwardRef(Fo(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=d.useState(null),l=yo(i),u=yo(a),f=d.useRef(null),p=ki(t,c),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:Ko(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Ko(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ko(s)};Fo(e,`handleFocusIn`),Fo(t,`handleFocusOut`),Fo(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),d.useEffect(()=>{if(s){qo.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Io,Ro);s.addEventListener(Io,l),s.dispatchEvent(t),t.defaultPrevented||(Bo(Xo(Ho(s)),{select:!0}),document.activeElement===e&&Ko(s))}return()=>{s.removeEventListener(Io,l),setTimeout(()=>{let t=new CustomEvent(Lo,Ro);s.addEventListener(Lo,u),s.dispatchEvent(t),t.defaultPrevented||Ko(e??document.body,{select:!0}),s.removeEventListener(Lo,u),qo.remove(m)},0)}}},[s,l,u,m]);let h=d.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Vo(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ko(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ko(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,F.jsx)(Ji.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Bo(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ko(r,{select:t}),document.activeElement!==n)return}Fo(Bo,`focusFirst`);function Vo(e){let t=Ho(e);return[Uo(t,e),Uo(t.reverse(),e)]}Fo(Vo,`getTabbableEdges`);function Ho(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Fo(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Fo(Ho,`getTabbableCandidates`);function Uo(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Wo(r,{upTo:t})))return r}Fo(Uo,`findVisible`);function Wo(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Fo(Wo,`isHidden`);function Go(e){return e instanceof HTMLInputElement&&`select`in e}Fo(Go,`isSelectableInput`);function Ko(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Go(e)&&t&&e.select()}}Fo(Ko,`focus`);var qo=Jo();function Jo(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Yo(e,t),e.unshift(t)},remove(t){e=Yo(e,t),e[0]?.resume()}}}Fo(Jo,`createFocusScopesStack`);function Yo(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Fo(Yo,`arrayRemove`);function Xo(e){return e.filter(e=>e.tagName!==`A`)}Fo(Xo,`removeLinks`);var Zo=Object.defineProperty,Qo=d.forwardRef(((e,t)=>Zo(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=d.useState(!1);Ca(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Yr.createPortal((0,F.jsx)(Ji.div,{...r,ref:t}),o):null},`Portal`)),$o=Object.defineProperty,es=(e,t)=>$o(e,`name`,{value:t,configurable:!0}),ts=0,ns=null;function rs(e){return is(),e.children}es(rs,`FocusGuards`);function is(){d.useEffect(()=>{ns||={start:as(),end:as()};let{start:e,end:t}=ns;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ts++,()=>{ts===1&&(ns?.start.remove(),ns?.end.remove(),ns=null),ts=Math.max(0,ts-1)}},[])}es(is,`useFocusGuards`);function as(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}es(as,`createFocusGuard`);var os=function(){return os=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},os.apply(this,arguments)};function ss(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function cs(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ls=`right-scroll-bar-position`,us=`width-before-scroll-bar`,ds=`with-scroll-bars-hidden`,fs=`--removed-body-scroll-bar-size`;function ps(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ms(e,t){var n=(0,d.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var hs=typeof window<`u`?d.useLayoutEffect:d.useEffect,gs=new WeakMap;function _s(e,t){var n=ms(t||null,function(t){return e.forEach(function(e){return ps(e,t)})});return hs(function(){var t=gs.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ps(e,null)}),i.forEach(function(e){r.has(e)||ps(e,a)})}gs.set(n,e)},[e]),n}function vs(e){return e}function ys(e,t){t===void 0&&(t=vs);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function bs(e){e===void 0&&(e={});var t=ys(null);return t.options=os({async:!0,ssr:!1},e),t}var xs=function(e){var t=e.sideCar,n=ss(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return d.createElement(r,os({},n))};xs.isSideCarExport=!0;function Ss(e,t){return e.useMedium(t),xs}var Cs=bs(),ws=function(){},Ts=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:ws,onWheelCapture:ws,onTouchMoveCapture:ws}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ss(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=_s([n,t]),w=os(os({},x),i);return d.createElement(d.Fragment,null,u&&d.createElement(S,{sideCar:Cs,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?d.cloneElement(d.Children.only(s),os(os({},w),{ref:C})):d.createElement(y,os({},w,{className:c,ref:C}),s))});Ts.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ts.classNames={fullWidth:us,zeroRight:ls};var Es=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ds(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Es();return t&&e.setAttribute(`nonce`,t),e}function Os(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ks(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var As=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ds())&&(Os(t,n),ks(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},js=function(){var e=As();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ms=function(){var e=js();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ns={left:0,top:0,right:0,gap:0},Ps=function(e){return parseInt(e||``,10)||0},Fs=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ps(n),Ps(r),Ps(i)]},Is=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ns;var t=Fs(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ls=Ms(),Rs=`data-scroll-locked`,zs=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
11
11
|
.${ds} {
|
|
12
12
|
overflow: hidden ${r};
|
|
13
13
|
padding-right: ${s}px ${r};
|
|
@@ -437,7 +437,7 @@ ${e}</tr>
|
|
|
437
437
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${J2(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Y2(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+J2(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Y2(e);if(i===null)return J2(n);e=i;let a=`<img src="${e}" alt="${J2(n)}"`;return t&&(a+=` title="${J2(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:J2(e.text)}},a4=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},o4=class e{options;renderer;textRenderer;constructor(e){this.options=e||I0,this.options.renderer=this.options.renderer||new i4,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new a4}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},s4=class{options;block;constructor(e){this.options=e||I0}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?r4.lex:r4.lexInline}provideParser(e=this.block){return e?o4.parse:o4.parseInline}},c4=new class{defaults=F0();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=o4;Renderer=i4;TextRenderer=a4;Lexer=r4;Tokenizer=n4;Hooks=s4;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new i4(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new n4(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new s4;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=s4.passThroughHooks.has(n)?e=>{if(this.defaults.async&&s4.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return r4.lex(e,t??this.defaults)}parser(e,t){return o4.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?r4.lex:r4.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?o4.parse:o4.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?r4.lex:r4.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?o4.parse:o4.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
438
438
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+J2(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function l4(e,t){return c4.parse(e,t)}l4.options=l4.setOptions=function(e){return c4.setOptions(e),l4.defaults=c4.defaults,L0(l4.defaults),l4},l4.getDefaults=F0,l4.defaults=I0,l4.use=function(...e){return c4.use(...e),l4.defaults=c4.defaults,L0(l4.defaults),l4},l4.walkTokens=function(e,t){return c4.walkTokens(e,t)},l4.parseInline=c4.parseInline,l4.Parser=o4,l4.parser=o4.parse,l4.Renderer=i4,l4.TextRenderer=a4,l4.Lexer=r4,l4.lexer=r4.lex,l4.Tokenizer=n4,l4.Hooks=s4,l4.parse=l4,l4.options,l4.setOptions,l4.use,l4.walkTokens,l4.parseInline,o4.parse,r4.lex;var u4=`modulepreload`,d4=function(e){return`/`+e},f4={},p4=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=d4(t,n),t=s(t),t in f4)return;f4[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:u4,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},m4=300,h4=`300px`,g4=500;function _4(e={}){let{immediate:t=!1,debounceDelay:n=m4,rootMargin:r=h4,idleTimeout:i=g4}=e,[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),c=(0,d.useRef)(null),l=(0,d.useRef)(null),u=(0,d.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),f=(0,d.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),p=(0,d.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,d.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(p(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(p(l.current),null)},u=e=>{l.current=f(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=f(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},d=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?d(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&p(l.current),h.disconnect()}},[t,n,r,i,p,f]),{shouldRender:a,containerRef:s}}var v4=320,y4=4,b4=()=>typeof performance>`u`?Date.now():performance.now();function x4(e){let t=e?.now??b4,n=e?.maxBacklogMs??v4,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,y4),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var S4=/\s/,C4=/^\s+$/,w4=new Set([`pre`,`svg`,`math`,`annotation`]),T4=new Set([`img`,`hr`]),E4=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,D4=e=>e.some(e=>E4(e)&&w4.has(e.tagName)),O4=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(E4(n)&&n.tagName===`li`)return n}},k4=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},A4=new Set([`ul`,`ol`,`li`]),j4=e=>{for(let t of e.children)if(E4(t)){if(t.tagName===`input`)return t;if(A4.has(t.tagName))continue;let e=j4(t);if(e)return e}},M4=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},N4=(e,t,n,r)=>{let i=j4(e);i&&M4(i,t,n,r)},P4=(e,t,n,r,i,a)=>{if(D4(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;M4(e,n,c?0:n.duration,l)},F4=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(E4(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},I4=e=>{let t=[],n=``,r=!1;for(let i of e){let e=S4.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},L4=e=>{let t=[],n=``;for(let r of e)S4.test(r)?t.length>0&&!C4.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},R4=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},z4=(e,t)=>!(e>0&&t<e),B4=e=>E4(e)&&T4.has(e.tagName),V4=(e,t,n)=>{let r=0,i=0;return aO(e,e=>e.type===`text`||B4(e),(e,a)=>{if(D4(a))return iO;if(B4(e)){z4(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?L4(o):I4(o);for(let e of s){let t=i;i+=e.length,!C4.test(e)&&z4(n,t)&&(r+=1)}}),r},H4=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(D4(t))return iO;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?L4(u):I4(u),f=r.prevContentLength,p=!1,m=O4(t),h=!!(m&&!((o=m.properties)!=null&&o[`data-sd-animate-marker`])),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,C4.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;k4(m,e,o,n.easing),N4(m,n,e,o),g=!0}return R4(e,n.animation,n.duration,n.easing,r,o)});return p&&F4(t),c.children.splice(l,1,..._),l+_.length},U4=0;function W4(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=U4++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??b4();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(V4(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};aO(e,e=>e.type===`text`||B4(e),(e,i)=>{if(e.type===`text`)return H4(e,i,t,n,r,o);P4(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}W4();var G4=(0,d.createContext)(!1),K4=()=>(0,d.useContext)(G4),q4=(...e)=>gm(xi(e)),J4=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Y4=e=>e?(...t)=>J4(e,gm(xi(t))):q4,X4=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Z4=(0,d.createContext)(q4),Q4=()=>(0,d.useContext)(Z4),$4=8,e3=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},t3=(e,t,n)=>{let r=(0,d.useRef)(null),i=(0,d.useRef)(!0),a=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<$4;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,d.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,d.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},n3=q4(`block`),r3=q4(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),i3=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},a3=(0,d.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=Q4(),{isAnimating:l}=(0,d.useContext)(y8),u=e3(i),f=t3(l,!!u,t),p=(0,d.useMemo)(()=>c(r3),[c]),m=(0,d.useMemo)(()=>c(n3),[c]),h=(0,d.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,i3(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,F.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:f,style:u?{maxHeight:u}:void 0,...s,children:(0,F.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:h,children:(0,F.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,F.jsx)(`span`,{className:o?p:m,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
439
439
|
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,F.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),o3=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=Q4();return(0,F.jsx)(`div`,{className:a(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i})},s3=(0,d.createContext)({code:``}),c3=()=>(0,d.useContext)(s3),l3=({language:e})=>{let t=Q4();return(0,F.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,F.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},u3=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
440
|
-
`;)t--;return e.slice(0,t)},d3=(0,d.lazy)(()=>p4(()=>import(`./highlighted-body-KPVGNVTW-
|
|
440
|
+
`;)t--;return e.slice(0,t)},d3=(0,d.lazy)(()=>p4(()=>import(`./highlighted-body-KPVGNVTW-DfzVF_Dn.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1]))),f3=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=Q4(),{codeBlockMaxHeight:l}=(0,d.useContext)(y8),u=(0,d.useMemo)(()=>u3(e),[e]),f=(0,d.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
|
|
441
441
|
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,F.jsx)(s3.Provider,{value:{code:e},children:(0,F.jsxs)(o3,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,F.jsx)(l3,{language:t}),r?(0,F.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,F.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,F.jsx)(d.Suspense,{fallback:(0,F.jsx)(a3,{className:n,language:t,lineNumbers:o,maxHeight:l,result:f,startLine:a,...s}),children:(0,F.jsx)(d3,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:f,startLine:a,...s})})]})})},p3={CheckIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,F.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,F.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,F.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},m3=(0,d.createContext)(p3),h3=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])},g3=({icons:e,children:t})=>{let n=(0,d.useRef)(e),r=(0,d.useRef)(e?{...p3,...e}:p3);h3(n.current,e)||(n.current=e,r.current=e?{...p3,...e}:p3);let i=r.current;return(0,F.jsx)(m3.Provider,{value:i,children:t})},_3=()=>(0,d.useContext)(m3),v3={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},y3=(0,d.createContext)(v3),b3=()=>(0,d.useContext)(y3),x3=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=Q4(),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(0),{code:f}=c3(),{isAnimating:p}=(0,d.useContext)(y8),m=b3(),h=a??f,g=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(h),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,d.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let _=_3(),v=c?_.CheckIcon:_.CopyIcon;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{"aria-label":m.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:p,onClick:g,title:m.copyCode,type:`button`,...o,children:r??(0,F.jsx)(v,{"aria-hidden":`true`,size:14})}),c&&(0,F.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:m.copied})]})},S3=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},C3={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},w3=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=Q4(),{code:c}=c3(),{isAnimating:l,controls:u}=(0,d.useContext)(y8),f=b3(),p=_3(),m=a??c,h=n&&n in C3?C3[n]:`txt`,g=`${S3(u,`code`,`file`)}.${h}`;return(0,F.jsx)(`button`,{"aria-label":f.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{X4(g,m,`text/plain`),e?.()}catch(e){t?.(e)}},title:f.downloadFile,type:`button`,...o,children:r??(0,F.jsx)(p.DownloadIcon,{size:14})})},T3=()=>{let{Loader2Icon:e}=_3(),t=Q4();return(0,F.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,F.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,F.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,F.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},E3=/\.[^/.]+$/,D3=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=_3(),u=Q4(),f=(0,d.useRef)(null),[p,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(!1),_=b3(),v=c.width!=null||c.height!=null,y=(p||v)&&!h&&o&&s,b=h&&!v;(0,d.useEffect)(()=>{let e=f.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;m(t),g(!t)}},[]);let x=(0,d.useCallback)(e=>{m(!0),g(!1),i?.(e)},[i]),S=(0,d.useCallback)(e=>{m(!1),g(!0),a?.(e)},[a]),C=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(E3,``)}.${i}`}X4(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,F.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,F.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,b&&`hidden`,t),"data-streamdown":`image`,onError:S,onLoad:x,ref:f,src:n,...c}),b&&(0,F.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:_.imageNotAvailable}),o&&(0,F.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),y&&(0,F.jsx)(`button`,{className:u(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:C,title:_.downloadImage,type:`button`,children:(0,F.jsx)(l,{size:14})})]}):null},O3=0,k3=()=>{O3+=1,O3===1&&(document.body.style.overflow=`hidden`)},A3=()=>{O3=Math.max(0,O3-1),O3===0&&(document.body.style.overflow=``)},j3=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=_3(),c=Q4(),[l,u]=(0,d.useState)(!1),f=b3(),p=(0,d.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),m=(0,d.useCallback)(()=>{r(),n()},[r,n]);if((0,d.useEffect)(()=>{if(t){k3();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),A3()}}},[t,n]),!t||typeof document>`u`)return null;let h=(0,F.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,F.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,F.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:f.close,type:`button`,children:(0,F.jsx)(s,{size:16})}),(0,F.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,F.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,F.jsx)(o,{size:20}),(0,F.jsx)(`span`,{children:f.openExternalLink})]}),(0,F.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:f.externalLinkWarning})]}),(0,F.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,F.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,F.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:p,type:`button`,children:l?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(i,{size:14}),(0,F.jsx)(`span`,{children:f.copied})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(a,{size:14}),(0,F.jsx)(`span`,{children:f.copyLink})]})}),(0,F.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:m,type:`button`,children:[(0,F.jsx)(o,{size:14}),(0,F.jsx)(`span`,{children:f.openLink})]})]})]})});return(0,Yr.createPortal)(h,document.body)},M3=(0,d.createContext)(null),N3=()=>(0,d.useContext)(M3),P3=()=>N3()?.code??null,F3=()=>N3()?.mermaid??null,I3=e=>{var t;let n=N3();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},L3=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},R3=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),z3=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=Q4(),[s,c]=(0,d.useState)(!1),l=(0,d.useRef)(null),{isAnimating:u,controls:f}=(0,d.useContext)(y8),p=_3(),m=F3(),h=b3(),g=S3(f,`mermaid`,`diagram`),_=async t=>{try{if(t===`mmd`){X4(`${g}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!m){a?.(Error(`Mermaid plugin not available`));return}let n=m.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=L3(l);if(t===`svg`){X4(`${g}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await R3(u);X4(`${g}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,F.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,F.jsx)(`button`,{"aria-label":h.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:h.downloadDiagram,type:`button`,children:t??(0,F.jsx)(p.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,F.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{"aria-label":h.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`svg`),title:h.downloadDiagramAsSvg,type:`button`,children:h.mermaidFormatSvg}),(0,F.jsx)(`button`,{"aria-label":h.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`png`),title:h.downloadDiagramAsPng,type:`button`,children:h.mermaidFormatPng}),(0,F.jsx)(`button`,{"aria-label":h.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`mmd`),title:h.downloadDiagramAsMmd,type:`button`,children:h.mermaidFormatMmd})]}):null]})},B3=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=_3(),c=Q4(),[l,u]=(0,d.useState)(!1),{isAnimating:f,controls:p}=(0,d.useContext)(y8),m=b3(),h=(()=>{if(typeof p==`boolean`)return p;let e=p.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),g=(()=>{if(typeof p==`boolean`)return p;let e=p.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),_=(()=>{if(typeof p==`boolean`)return p;let e=p.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),v=()=>{u(!l)};return(0,d.useEffect)(()=>{if(l){k3();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),A3()}}},[l]),(0,d.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:f,onClick:v,title:m.viewFullscreen,type:`button`,...a,"aria-label":m.viewFullscreen,children:(0,F.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,Yr.createPortal)((0,F.jsxs)(`div`,{"aria-label":m.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:v,onKeyDown:e=>{e.key===`Escape`&&v()},role:`dialog`,children:[(0,F.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[g?(0,F.jsx)(z3,{chart:e,config:t}):null,_?(0,F.jsx)(x3,{code:e}):null,(0,F.jsx)(`button`,{"aria-label":m.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:v,title:m.exitFullscreen,type:`button`,children:(0,F.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,F.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,F.jsx)(S8,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:h})})]}),document.body):null]})};function V3(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
|
|
442
442
|
`:Array.from(t.childNodes).map(V3).join(``)}var H3=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(V3(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(V3(e).trim());n.push(t)}return{headers:t,rows:n}},U3=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},W3=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
|
|
443
443
|
`||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
|
|
@@ -447,7 +447,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
447
447
|
`)},K3=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
|
|
448
448
|
`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
|
|
449
449
|
`?n.push(`<br>`):n.push(t);return n.join(``)},q3=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>K3(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?K3(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>K3(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
|
|
450
|
-
`)},J3=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Q4(),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(null),f=(0,d.useRef)(0),{isAnimating:p,controls:m}=(0,d.useContext)(y8),h=b3(),g=U3(m),_=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=H3(t),o=``;o=e===`csv`?W3(a,g):e===`tsv`?G3(a):q3(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),f.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(f.current)}},[]);let v=_3(),y=c?v.CheckIcon:v.CopyIcon;return(0,F.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,F.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:p,onClick:()=>s(!o),title:h.copyTable,type:`button`,children:e??(0,F.jsx)(y,{height:14,width:14})}),o?(0,F.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`md`),title:h.copyTableAsMarkdown,type:`button`,children:h.tableFormatMarkdown}),(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`csv`),title:h.copyTableAsCsv,type:`button`,children:h.tableFormatCsv}),(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`tsv`),title:h.copyTableAsTsv,type:`button`,children:h.tableFormatTsv})]}):null]})},Y3=({children:e,className:t,onDownload:n,onError:r})=>{let i=Q4(),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),{isAnimating:c,controls:l}=(0,d.useContext)(y8),u=b3(),f=_3(),p=U3(l),m=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=H3(t),a=e===`csv`?W3(i,p):q3(i),c=e===`csv`?`csv`:`md`;X4(`${S3(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,F.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,F.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,F.jsx)(f.DownloadIcon,{size:14})}),a?(0,F.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,F.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},X3=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=_3(),o=Q4(),[s,c]=(0,d.useState)(!1),{isAnimating:l}=(0,d.useContext)(y8),u=b3(),f=()=>{c(!0)},p=()=>{c(!1)};return(0,d.useEffect)(()=>{if(s){k3();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),A3()}}},[s]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:f,title:u.viewFullscreen,type:`button`,children:(0,F.jsx)(i,{size:14})}),s?(0,Yr.createPortal)((0,F.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:p,onKeyDown:e=>{e.key===`Escape`&&p()},role:`dialog`,children:(0,F.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,F.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,F.jsx)(J3,{}):null,r?(0,F.jsx)(Y3,{}):null,(0,F.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:p,title:u.exitFullscreen,type:`button`,children:(0,F.jsx)(a,{size:20})})]}),(0,F.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,F.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},Z3=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=Q4(),{isAnimating:l}=(0,d.useContext)(y8),u=e3(n),f=t3(l,!!u,e),p=r&&i,m=r&&a,h=r&&o,g=p||m||h;return(0,F.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[g?(0,F.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[p?(0,F.jsx)(J3,{}):null,m?(0,F.jsx)(Y3,{}):null,h?(0,F.jsx)(X3,{showCopy:p,showDownload:m,children:e}):null]}):null,(0,F.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:f,style:u?{maxHeight:u}:void 0,children:(0,F.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},Q3=/startLine=(\d+)/,$3=/\bnoLineNumbers\b/,e6=(0,d.lazy)(()=>p4(()=>import(`./mermaid-HWGCJPDP-mpro8vee.js`).then(e=>({default:e.Mermaid})),[])),t6=/language-([^\s]+)/,n6=`node`;function r6(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==n6&&!Object.is(r[e],i[e]))return!1;return!0}function i6(e,t){return e?.properties?.metastring===t?.properties?.metastring}var a6=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,o6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},s6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},c6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},l6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},u6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>r6(e,t));u6.displayName=`MarkdownOl`;var d6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>r6(e,t));d6.displayName=`MarkdownLi`;var f6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>r6(e,t));f6.displayName=`MarkdownUl`;var p6=(0,d.memo)(({className:e,node:t,...n})=>{let r=Q4();return(0,F.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>r6(e,t));p6.displayName=`MarkdownHr`;var m6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>r6(e,t));m6.displayName=`MarkdownStrong`;var h6=(0,d.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Q4(),{linkSafety:o}=(0,d.useContext)(y8),[s,c]=(0,d.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,d.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),f=(0,d.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),p=(0,d.useCallback)(()=>{c(!1)},[]),m={url:n??``,isOpen:s,onClose:p,onConfirm:f};return o!=null&&o.enabled&&n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(m):(0,F.jsx)(j3,{...m})]}):(0,F.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>r6(e,t));h6.displayName=`MarkdownA`;var g6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>r6(e,t));g6.displayName=`MarkdownH1`;var _6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>r6(e,t));_6.displayName=`MarkdownH2`;var v6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>r6(e,t));v6.displayName=`MarkdownH3`;var y6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>r6(e,t));y6.displayName=`MarkdownH4`;var b6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>r6(e,t));b6.displayName=`MarkdownH5`;var x6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>r6(e,t));x6.displayName=`MarkdownH6`;var S6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,d.useContext)(y8),o=a6(i,`table`),s=o6(i,`copy`),c=o6(i,`download`),l=o6(i,`fullscreen`);return(0,F.jsx)(Z3,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>r6(e,t));S6.displayName=`MarkdownTable`;var C6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>r6(e,t));C6.displayName=`MarkdownThead`;var w6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>r6(e,t));w6.displayName=`MarkdownTbody`;var T6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>r6(e,t));T6.displayName=`MarkdownTr`;var E6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>r6(e,t));E6.displayName=`MarkdownTh`;var D6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>r6(e,t));D6.displayName=`MarkdownTd`;var O6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>r6(e,t));O6.displayName=`MarkdownBlockquote`;var k6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>r6(e,t));k6.displayName=`MarkdownSup`;var A6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>r6(e,t));A6.displayName=`MarkdownSub`;var j6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,d.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,d.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,d.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,d.isValidElement)(e))return e;if(e.type===u6){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,F.jsx)(`section`,{className:t,...r,children:i}):null}return(0,F.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>r6(e,t));j6.displayName=`MarkdownSection`;var M6=(0,d.memo)(({node:e,className:t,children:n,...r})=>{let i=Q4(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,d.useContext)(y8),l=F3(),u=K4(),f=(t?.match(t6))?.at(1)??``,p=I3(f);if(a)return(0,F.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let m=e?.properties?.metastring,h=m?.match(Q3),g=h?Number.parseInt(h[1],10):void 0,_=g!==void 0&&g>=1?g:void 0,v=!(m&&$3.test(m))&&c!==!1,y=``;if((0,d.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?y=n.props.children:typeof n==`string`&&(y=n),p){let e=p.component;return(0,F.jsx)(d.Suspense,{fallback:(0,F.jsx)(T3,{}),children:(0,F.jsx)(e,{code:y,isIncomplete:u,language:f,meta:m})})}if(f===`mermaid`&&l){let e=a6(s,`mermaid`),n=c6(s,`download`),r=c6(s,`copy`),a=c6(s,`fullscreen`),c=c6(s,`panZoom`),l=e&&(n||r||a);return(0,F.jsx)(d.Suspense,{fallback:(0,F.jsx)(T3,{}),children:(0,F.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,F.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,F.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,F.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,F.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,F.jsx)(z3,{chart:y,config:o?.config}):null,r?(0,F.jsx)(x3,{code:y}):null,a?(0,F.jsx)(B3,{chart:y,config:o?.config}):null]})}):null,(0,F.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,F.jsx)(e6,{chart:y,config:o?.config,showControls:c})})]})})}let b=a6(s,`code`),x=s6(s,`download`),S=s6(s,`copy`),{"data-block":C,...w}=r;return(0,F.jsx)(f3,{className:t,code:y,isIncomplete:u,language:f,lineNumbers:v,startLine:_,...w,children:b?(0,F.jsxs)(F.Fragment,{children:[x?(0,F.jsx)(w3,{code:y,language:f}):null,S?(0,F.jsx)(x3,{}):null]}):null})},(e,t)=>r6(e,t)&&i6(e.node,t.node));M6.displayName=`MarkdownCode`;var N6=(0,d.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,d.useContext)(y8),i=a6(r,`image`),a=i&&l6(r,`download`);return(0,F.jsx)(D3,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>r6(e,t));N6.displayName=`MarkdownImg`;var P6=(0,d.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,d.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,F.jsx)(F.Fragment,{children:e})}return(0,F.jsx)(`p`,{...n,children:e})},(e,t)=>r6(e,t));P6.displayName=`MarkdownParagraph`;var F6={ol:u6,li:d6,ul:f6,hr:p6,strong:m6,a:h6,h1:g6,h2:_6,h3:v6,h4:y6,h5:b6,h6:x6,table:S6,thead:C6,tbody:w6,tr:T6,th:E6,td:D6,blockquote:O6,code:M6,img:N6,pre:({children:e})=>(0,d.isValidElement)(e)?(0,d.cloneElement)(e,{"data-block":`true`}):e,sup:k6,sub:A6,p:P6,section:j6},I6=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,L6=/\p{L}/u;function R6(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(I6.test(e)){n??=`rtl`,i+=1;continue}L6.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var z6=/^[ \t]{0,3}(`{3,}|~{3,})/,B6=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,V6=e=>{let t=e.split(`
|
|
450
|
+
`)},J3=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Q4(),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(null),f=(0,d.useRef)(0),{isAnimating:p,controls:m}=(0,d.useContext)(y8),h=b3(),g=U3(m),_=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=H3(t),o=``;o=e===`csv`?W3(a,g):e===`tsv`?G3(a):q3(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),f.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(f.current)}},[]);let v=_3(),y=c?v.CheckIcon:v.CopyIcon;return(0,F.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,F.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:p,onClick:()=>s(!o),title:h.copyTable,type:`button`,children:e??(0,F.jsx)(y,{height:14,width:14})}),o?(0,F.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`md`),title:h.copyTableAsMarkdown,type:`button`,children:h.tableFormatMarkdown}),(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`csv`),title:h.copyTableAsCsv,type:`button`,children:h.tableFormatCsv}),(0,F.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`tsv`),title:h.copyTableAsTsv,type:`button`,children:h.tableFormatTsv})]}):null]})},Y3=({children:e,className:t,onDownload:n,onError:r})=>{let i=Q4(),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),{isAnimating:c,controls:l}=(0,d.useContext)(y8),u=b3(),f=_3(),p=U3(l),m=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=H3(t),a=e===`csv`?W3(i,p):q3(i),c=e===`csv`?`csv`:`md`;X4(`${S3(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,F.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,F.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,F.jsx)(f.DownloadIcon,{size:14})}),a?(0,F.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,F.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,F.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},X3=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=_3(),o=Q4(),[s,c]=(0,d.useState)(!1),{isAnimating:l}=(0,d.useContext)(y8),u=b3(),f=()=>{c(!0)},p=()=>{c(!1)};return(0,d.useEffect)(()=>{if(s){k3();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),A3()}}},[s]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:f,title:u.viewFullscreen,type:`button`,children:(0,F.jsx)(i,{size:14})}),s?(0,Yr.createPortal)((0,F.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:p,onKeyDown:e=>{e.key===`Escape`&&p()},role:`dialog`,children:(0,F.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,F.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,F.jsx)(J3,{}):null,r?(0,F.jsx)(Y3,{}):null,(0,F.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:p,title:u.exitFullscreen,type:`button`,children:(0,F.jsx)(a,{size:20})})]}),(0,F.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,F.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},Z3=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=Q4(),{isAnimating:l}=(0,d.useContext)(y8),u=e3(n),f=t3(l,!!u,e),p=r&&i,m=r&&a,h=r&&o,g=p||m||h;return(0,F.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[g?(0,F.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[p?(0,F.jsx)(J3,{}):null,m?(0,F.jsx)(Y3,{}):null,h?(0,F.jsx)(X3,{showCopy:p,showDownload:m,children:e}):null]}):null,(0,F.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:f,style:u?{maxHeight:u}:void 0,children:(0,F.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},Q3=/startLine=(\d+)/,$3=/\bnoLineNumbers\b/,e6=(0,d.lazy)(()=>p4(()=>import(`./mermaid-HWGCJPDP-Gez0laAL.js`).then(e=>({default:e.Mermaid})),[])),t6=/language-([^\s]+)/,n6=`node`;function r6(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==n6&&!Object.is(r[e],i[e]))return!1;return!0}function i6(e,t){return e?.properties?.metastring===t?.properties?.metastring}var a6=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,o6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},s6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},c6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},l6=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},u6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>r6(e,t));u6.displayName=`MarkdownOl`;var d6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>r6(e,t));d6.displayName=`MarkdownLi`;var f6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>r6(e,t));f6.displayName=`MarkdownUl`;var p6=(0,d.memo)(({className:e,node:t,...n})=>{let r=Q4();return(0,F.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>r6(e,t));p6.displayName=`MarkdownHr`;var m6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>r6(e,t));m6.displayName=`MarkdownStrong`;var h6=(0,d.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Q4(),{linkSafety:o}=(0,d.useContext)(y8),[s,c]=(0,d.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,d.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),f=(0,d.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),p=(0,d.useCallback)(()=>{c(!1)},[]),m={url:n??``,isOpen:s,onClose:p,onConfirm:f};return o!=null&&o.enabled&&n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(m):(0,F.jsx)(j3,{...m})]}):(0,F.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>r6(e,t));h6.displayName=`MarkdownA`;var g6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>r6(e,t));g6.displayName=`MarkdownH1`;var _6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>r6(e,t));_6.displayName=`MarkdownH2`;var v6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>r6(e,t));v6.displayName=`MarkdownH3`;var y6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>r6(e,t));y6.displayName=`MarkdownH4`;var b6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>r6(e,t));b6.displayName=`MarkdownH5`;var x6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>r6(e,t));x6.displayName=`MarkdownH6`;var S6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,d.useContext)(y8),o=a6(i,`table`),s=o6(i,`copy`),c=o6(i,`download`),l=o6(i,`fullscreen`);return(0,F.jsx)(Z3,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>r6(e,t));S6.displayName=`MarkdownTable`;var C6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>r6(e,t));C6.displayName=`MarkdownThead`;var w6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>r6(e,t));w6.displayName=`MarkdownTbody`;var T6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>r6(e,t));T6.displayName=`MarkdownTr`;var E6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>r6(e,t));E6.displayName=`MarkdownTh`;var D6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>r6(e,t));D6.displayName=`MarkdownTd`;var O6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>r6(e,t));O6.displayName=`MarkdownBlockquote`;var k6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>r6(e,t));k6.displayName=`MarkdownSup`;var A6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=Q4();return(0,F.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>r6(e,t));A6.displayName=`MarkdownSub`;var j6=(0,d.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,d.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,d.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,d.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,d.isValidElement)(e))return e;if(e.type===u6){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,F.jsx)(`section`,{className:t,...r,children:i}):null}return(0,F.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>r6(e,t));j6.displayName=`MarkdownSection`;var M6=(0,d.memo)(({node:e,className:t,children:n,...r})=>{let i=Q4(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,d.useContext)(y8),l=F3(),u=K4(),f=(t?.match(t6))?.at(1)??``,p=I3(f);if(a)return(0,F.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let m=e?.properties?.metastring,h=m?.match(Q3),g=h?Number.parseInt(h[1],10):void 0,_=g!==void 0&&g>=1?g:void 0,v=!(m&&$3.test(m))&&c!==!1,y=``;if((0,d.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?y=n.props.children:typeof n==`string`&&(y=n),p){let e=p.component;return(0,F.jsx)(d.Suspense,{fallback:(0,F.jsx)(T3,{}),children:(0,F.jsx)(e,{code:y,isIncomplete:u,language:f,meta:m})})}if(f===`mermaid`&&l){let e=a6(s,`mermaid`),n=c6(s,`download`),r=c6(s,`copy`),a=c6(s,`fullscreen`),c=c6(s,`panZoom`),l=e&&(n||r||a);return(0,F.jsx)(d.Suspense,{fallback:(0,F.jsx)(T3,{}),children:(0,F.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,F.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,F.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,F.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,F.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,F.jsx)(z3,{chart:y,config:o?.config}):null,r?(0,F.jsx)(x3,{code:y}):null,a?(0,F.jsx)(B3,{chart:y,config:o?.config}):null]})}):null,(0,F.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,F.jsx)(e6,{chart:y,config:o?.config,showControls:c})})]})})}let b=a6(s,`code`),x=s6(s,`download`),S=s6(s,`copy`),{"data-block":C,...w}=r;return(0,F.jsx)(f3,{className:t,code:y,isIncomplete:u,language:f,lineNumbers:v,startLine:_,...w,children:b?(0,F.jsxs)(F.Fragment,{children:[x?(0,F.jsx)(w3,{code:y,language:f}):null,S?(0,F.jsx)(x3,{}):null]}):null})},(e,t)=>r6(e,t)&&i6(e.node,t.node));M6.displayName=`MarkdownCode`;var N6=(0,d.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,d.useContext)(y8),i=a6(r,`image`),a=i&&l6(r,`download`);return(0,F.jsx)(D3,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>r6(e,t));N6.displayName=`MarkdownImg`;var P6=(0,d.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,d.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,F.jsx)(F.Fragment,{children:e})}return(0,F.jsx)(`p`,{...n,children:e})},(e,t)=>r6(e,t));P6.displayName=`MarkdownParagraph`;var F6={ol:u6,li:d6,ul:f6,hr:p6,strong:m6,a:h6,h1:g6,h2:_6,h3:v6,h4:y6,h5:b6,h6:x6,table:S6,thead:C6,tbody:w6,tr:T6,th:E6,td:D6,blockquote:O6,code:M6,img:N6,pre:({children:e})=>(0,d.isValidElement)(e)?(0,d.cloneElement)(e,{"data-block":`true`}):e,sup:k6,sub:A6,p:P6,section:j6},I6=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,L6=/\p{L}/u;function R6(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(I6.test(e)){n??=`rtl`,i+=1;continue}L6.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var z6=/^[ \t]{0,3}(`{3,}|~{3,})/,B6=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,V6=e=>{let t=e.split(`
|
|
451
451
|
`),n=null,r=0;for(let e of t){let t=z6.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},H6=e=>{let t=e.split(`
|
|
452
452
|
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&B6.test(t))return!0}return!1},U6=()=>e=>{sO(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},W6=[],G6={allowDangerousHtml:!0},K6=new WeakMap,q6=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=K6.get(e);n||(n=e.name,K6.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=K6.get(r);e||(e=r.name,K6.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},J6=e=>{let t=Y6(e),n=e.children||``;return n8(t.runSync(t.parse(n),n),e)},Y6=e=>{let t=q6.get(e);if(t)return t;let n=Z6(e);return q6.set(e,n),n},X6=e=>e.some(e=>Array.isArray(e)?e[0]===aB:e===aB),Z6=e=>{let t=e.rehypePlugins||W6,n=e.remarkPlugins||W6,r=X6(t)?n:[...n,U6],i=e.remarkRehypeOptions?{...G6,...e.remarkRehypeOptions}:G6;return GO().use($E).use(r).use(_O,i).use(t)},Q6=e=>e,$6=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},e8=(e,t)=>{for(let n in ZC)if(Object.hasOwn(ZC,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=ZC[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},t8=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},n8=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||Q6;sO(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return $6(c,s,a,e.value),s;if(e.type===`element`&&(e8(e,t),t8(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return kC(e,{Fragment:F.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0})},r8=/\[\^[\w-]{1,200}\](?!:)/,i8=/\[\^[\w-]{1,200}\]:/,a8=/<([A-Za-z][\w:-]*)[\s>/]/,Yre=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),o8=new Map,s8=new Map,Xre=e=>{let t=e.toLowerCase(),n=o8.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return o8.set(t,r),r},Zre=e=>{let t=e.toLowerCase(),n=s8.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return s8.set(t,r),r},c8=(e,t)=>{if(Yre.has(t.toLowerCase()))return 0;let n=e.match(Xre(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},l8=(e,t)=>{let n=e.match(Zre(t));return n?n.length:0},Qre=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},$re=e=>{let t=r8.test(e),n=i8.test(e);if(t||n)return[e];let r=r4.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=c8(t,e),o=l8(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(a8);if(e){let n=e[1];c8(t,n)>l8(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(Qre(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},eie=/^\n*/,tie=/\n*$/,u8=/\n\n/g,nie=(e,t,n)=>t.includes(`
|
|
453
453
|
`)?`${e}${t.replace(u8,`
|
|
@@ -477,14 +477,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
477
477
|
`);n.forEach(function(t,i){var o=r&&d.length+a,s={type:`text`,value:`${t}
|
|
478
478
|
`};if(i===0){var c=g(u.slice(f+1,p).concat(L8({children:[s],className:e.properties.className})),o);d.push(c)}else if(i===n.length-1){var l=u[p+1]&&u[p+1].children&&u[p+1].children[0],m={type:`text`,value:`${t}`};if(l){var h=L8({children:[m],className:e.properties.className});u.splice(p+1,0,h)}else{var _=g([m],o,e.properties.className);d.push(_)}}else{var v=g([s],o,e.properties.className);d.push(v)}}),f=p}p++};p<u.length;)_();if(f!==u.length-1){var v=u.slice(f+1,u.length);if(v&&v.length){var y=g(v,r&&d.length+a);d.push(y)}}return t?d:(l=[]).concat.apply(l,d)}function Hie(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(e,t){return M8({node:e,stylesheet:n,useInlineStyles:r,key:`code-segment-${t}`})})}function z8(e){return e&&e.highlightAuto!==void 0}function Uie(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(z8(t)){var a=Pie(t,n);return n===`text`?{value:i,language:`text`}:a?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!==`text`?{value:t.highlight(r,n)}:{value:i}}catch{return{value:i}}}function Wie(e,t){return function(n){var r=n.language,i=n.children,a=n.style,o=a===void 0?t:a,s=n.customStyle,c=s===void 0?{}:s,l=n.codeTagProps,u=l===void 0?{className:r?`language-${r}`:void 0,style:P8(P8({},o[`code[class*="language-"]`]),o[`code[class*="language-${r}"]`])}:l,f=n.useInlineStyles,p=f===void 0||f,m=n.showLineNumbers,h=m!==void 0&&m,g=n.showInlineLineNumbers,_=g===void 0||g,v=n.startingLineNumber,y=v===void 0?1:v,b=n.lineNumberContainerStyle,x=n.lineNumberStyle,S=x===void 0?{}:x,C=n.wrapLines,w=n.wrapLongLines,T=w!==void 0&&w,E=n.lineProps,D=E===void 0?{}:E,O=n.renderer,k=n.PreTag,A=k===void 0?`pre`:k,j=n.CodeTag,M=j===void 0?`code`:j,N=n.code,ee=N===void 0?(Array.isArray(i)?i[0]:i)||``:N,te=n.astGenerator,P=Cie(n,Fie);te||=e;var ne=h?d.createElement(zie,{containerStyle:b,codeStyle:u.style||{},numberStyle:S,startingLineNumber:y,codeString:ee}):null,re=o.hljs||o[`pre[class*="language-"]`]||{backgroundColor:`#fff`},ie=z8(te)?`hljs`:`prismjs`,ae=p?Object.assign({},P,{style:Object.assign({},re,c)}):Object.assign({},P,{className:P.className?`${ie} ${P.className}`:ie,style:Object.assign({},c)});if(u.style=P8(T?{whiteSpace:`pre-wrap`}:{whiteSpace:`pre`},u.style),!te)return d.createElement(A,ae,ne,d.createElement(M,u,ee));(C===void 0&&O||T)&&(C=!0),O||=Hie;var oe=[{type:`text`,value:ee}],se=Uie({astGenerator:te,language:r,code:ee,defaultCodeValue:oe});se.language===null&&(se.value=oe);var ce=y+(ee.match(/\n/g)?.length??0),le=Vie(se,C,D,h,_,y,ce,S,T);return d.createElement(A,ae,d.createElement(M,u,!_&&ne,O({rows:le,stylesheet:o,useInlineStyles:p})))}}var Gie=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),B8={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function V8(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Kie(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function qie(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function H8(e){return qie(e)||V8(e)}var Jie=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Yie(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?H8:u===`decimal`?V8:Kie;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Gie.includes(y)&&(_=y,v=iw(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&iw(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1)){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):H8(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Xie(e))h(7,S),C=`�`;else if(e in B8)h(6,S),C=B8[e];else{let t=``;Zie(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Jie[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Xie(e){return e>=55296&&e<=57343||e>1114111}function Zie(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var Qie=0,U8={},W8={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Qie}),e.__id},clone:function e(t,n){n||={};var r,i;switch(W8.util.type(t)){case`Object`:if(i=W8.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case`Array`:return i=W8.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:U8,plaintext:U8,text:U8,txt:U8,extend:function(e,t){var n=W8.util.clone(W8.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=W8.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);n.hasOwnProperty(o)||(a[o]=i[o])}var c=r[e];return r[e]=a,W8.languages.DFS(W8.languages,function(t,n){n===c&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i||={};var a=W8.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var s=t[o],c=W8.util.type(s);c===`Object`&&!i[a(s)]?(i[a(s)]=!0,e(s,n,null,i)):c===`Array`&&!i[a(s)]&&(i[a(s)]=!0,e(s,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(W8.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=W8.tokenize(r.code,r.grammar),W8.hooks.run(`after-tokenize`,r),G8.stringify(W8.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new $ie;return J8(i,i.head,e),q8(e,i,t,i.head,0),tae(i)},hooks:{all:{},add:function(e,t){var n=W8.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=W8.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:G8};function G8(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}function K8(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function q8(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var s=n[o];s=Array.isArray(s)?s:[s];for(var c=0;c<s.length;++c){if(a&&a.cause==o+`,`+c)return;var l=s[c],u=l.inside,d=!!l.lookbehind,f=!!l.greedy,p=l.alias;if(f&&!l.pattern.global){var m=l.pattern.toString().match(/[imsuy]*$/)[0];l.pattern=RegExp(l.pattern.source,m+`g`)}for(var h=l.pattern||l,g=r.next,_=i;g!==t.tail&&!(a&&_>=a.reach);_+=g.value.length,g=g.next){var v=g.value;if(t.length>e.length)return;if(!(v instanceof G8)){var y=1,b;if(f){if(b=K8(h,_,e,d),!b||b.index>=e.length)break;var x=b.index,S=b.index+b[0].length,C=_;for(C+=g.value.length;x>=C;)g=g.next,C+=g.value.length;if(C-=g.value.length,_=C,g.value instanceof G8)continue;for(var w=g;w!==t.tail&&(C<S||typeof w.value==`string`);w=w.next)y++,C+=w.value.length;y--,v=e.slice(_,C),b.index-=_}else if(b=K8(h,0,v,d),!b)continue;var x=b.index,T=b[0],E=v.slice(0,x),D=v.slice(x+T.length),O=_+v.length;a&&O>a.reach&&(a.reach=O);var k=g.prev;E&&(k=J8(t,k,E),_+=E.length),eae(t,k,y);var A=new G8(o,u?W8.tokenize(T,u):T,p,T);if(g=J8(t,k,A),D&&J8(t,g,D),y>1){var j={cause:o+`,`+c,reach:O};q8(e,t,n,g.prev,_,j),a&&j.reach>a.reach&&(a.reach=j.reach)}}}}}}function $ie(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function J8(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function eae(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function tae(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}var Y8=W8;function X8(){}X8.prototype=Y8;var Z8=new X8;Z8.highlight=nae,Z8.register=rae,Z8.alias=iae,Z8.registered=aae,Z8.listLanguages=oae,Z8.util.encode=sae,Z8.Token.stringify=Q8;function nae(e,t){if(typeof e!=`string`)throw TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t==`object`)n=t;else{if(r=t,typeof r!=`string`)throw TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(Z8.languages,r))n=Z8.languages[r];else throw Error("Unknown language: `"+r+"` is not registered")}return{type:`root`,children:Y8.highlight.call(Z8,e,n,r)}}function rae(e){if(typeof e!=`function`||!e.displayName)throw Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(Z8.languages,e.displayName)||e(Z8)}function iae(e,t){let n=Z8.languages,r={};typeof e==`string`?t&&(r[e]=t):r=e;let i;for(i in r)if(Object.hasOwn(r,i)){let e=r[i],t=typeof e==`string`?[e]:e,a=-1;for(;++a<t.length;)n[t[a]]=n[i]}}function aae(e){if(typeof e!=`string`)throw TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(Z8.languages,e)}function oae(){let e=Z8.languages,t=[],n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]==`object`&&t.push(n);return t}function Q8(e,t){if(typeof e==`string`)return{type:`text`,value:e};if(Array.isArray(e)){let n=[],r=-1;for(;++r<e.length;)e[r]!==null&&e[r]!==void 0&&e[r]!==``&&n.push(Q8(e[r],t));return n}let n={attributes:{},classes:[`token`,e.type],content:Q8(e.content,t),language:t,tag:`span`,type:e.type};return e.alias&&n.classes.push(...typeof e.alias==`string`?[e.alias]:e.alias),Z8.hooks.run(`wrap`,n),bk(n.tag+`.`+n.classes.join(`.`),cae(n.attributes),n.content)}function sae(e){return e}function cae(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=Yie(e[t]));return e}var $8=Wie(Z8,{});$8.registerLanguage=function(e,t){return Z8.register(t)},$8.alias=function(e,t){return Z8.alias(e,t)},e5.displayName=`markup`,e5.aliases=[`atom`,`html`,`mathml`,`rss`,`ssml`,`svg`,`xml`];function e5(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside[`attr-value`].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside[`internal-subset`].inside=e.languages.markup,e.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.value.replace(/&/,`&`))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r[`language-`+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return t}),`i`),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+t+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,`language-`+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend(`markup`,{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}t5.displayName=`css`,t5.aliases=[];function t5(e){(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(e)}n5.displayName=`clike`,n5.aliases=[];function n5(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}r5.displayName=`javascript`,r5.aliases=[`js`];function r5(e){e.register(n5),e.languages.javascript=e.languages.extend(`clike`,{"class-name":[e.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),e.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),e.languages.markup&&(e.languages.markup.tag.addInlined(`script`,`javascript`),e.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),e.languages.js=e.languages.javascript}i5.displayName=`sql`,i5.aliases=[];function i5(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}a5.displayName=`c`,a5.aliases=[];function a5(e){e.register(n5),e.languages.c=e.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}o5.displayName=`cpp`,o5.aliases=[];function o5(e){e.register(a5),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(e)}s5.displayName=`bash`,s5.aliases=[`sh`,`shell`];function s5(e){(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(e)}c5.displayName=`yaml`,c5.aliases=[`yml`];function c5(e){(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(e)}l5.displayName=`markdown`,l5.aliases=[`md`];function l5(e){e.register(e5),(function(e){function t(e){return e=e.replace(/<inner>/g,function(){return`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var n="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",r=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return n}),i=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+r+i+`(?:`+r+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+r+i+`)(?:`+r+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+r+`)`+i+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+r+`$`),inside:{"table-header":{pattern:RegExp(n),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:t(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:t(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(t.content.value,s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}}),RegExp(e.languages.markup.tag.pattern.source,`gi`),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown})(e)}u5.displayName=`csharp`,u5.aliases=[`cs`,`dotnet`];function u5(e){e.register(n5),(function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return`(?:`+t[+n]+`)`})}function n(e,n,r){return RegExp(t(e,n),r||``)}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,function(){return`(?:`+e+`)`});return e.replace(/<<self>>/g,`[^\\s\\S]`)}var i={type:`bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void`,typeDeclaration:`class enum interface record struct`,contextual:`add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)`,other:`abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield`};function a(e){return`\\b(?:`+e.trim().replace(/ /g,`|`)+`)\\b`}var o=a(i.typeDeclaration),s=RegExp(a(i.type+` `+i.typeDeclaration+` `+i.contextual+` `+i.other)),c=a(i.typeDeclaration+` `+i.contextual+` `+i.other),l=a(i.type+` `+i.typeDeclaration+` `+i.other),u=r(`<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>`,2),d=r(`\\((?:[^()]|<<self>>)*\\)`,2),f=`@?\\b[A-Za-z_]\\w*\\b`,p=t(`<<0>>(?:\\s*<<1>>)?`,[f,u]),m=t(`(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*`,[c,p]),h=`\\[\\s*(?:,\\s*)*\\]`,g=t(`<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?`,[m,h]),_=t(`(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?`,[t(`\\(<<0>>+(?:,<<0>>+)+\\)`,[t(`[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>`,[u,d,h])]),m,h]),v={keyword:s,punctuation:/[<>()?,.:[\]]/},y=`'(?:[^\\r\\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'`,b=`"(?:\\\\.|[^\\\\"\\r\\n])*"`,x=`@"(?:""|\\\\[\\s\\S]|[^\\\\"])*"(?!")`;e.languages.csharp=e.languages.extend(`clike`,{string:[{pattern:n(`(^|[^$\\\\])<<0>>`,[x]),lookbehind:!0,greedy:!0},{pattern:n(`(^|[^@$\\\\])<<0>>`,[b]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(`(\\busing\\s+static\\s+)<<0>>(?=\\s*;)`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)`,[f,_]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+)<<0>>(?=\\s*=)`,[f]),lookbehind:!0},{pattern:n(`(\\b<<0>>\\s+)<<1>>`,[o,p]),lookbehind:!0,inside:v},{pattern:n(`(\\bcatch\\s*\\(\\s*)<<0>>`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\bwhere\\s+)<<0>>`,[f]),lookbehind:!0},{pattern:n(`(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>`,[g]),lookbehind:!0,inside:v},{pattern:n(`\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))`,[_,l,f]),inside:v}],keyword:s,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore(`csharp`,`number`,{range:{pattern:/\.\./,alias:`operator`}}),e.languages.insertBefore(`csharp`,`punctuation`,{"named-parameter":{pattern:n(`([(,]\\s*)<<0>>(?=\\s*:)`,[f]),lookbehind:!0,alias:`punctuation`}}),e.languages.insertBefore(`csharp`,`class-name`,{namespace:{pattern:n(`(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])`,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(`(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))`,[d]),lookbehind:!0,alias:`class-name`,inside:v},"return-type":{pattern:n(`<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))`,[_,m]),inside:v,alias:`class-name`},"constructor-invocation":{pattern:n(`(\\bnew\\s+)<<0>>(?=\\s*[[({])`,[_]),lookbehind:!0,inside:v,alias:`class-name`},"generic-method":{pattern:n(`<<0>>\\s*<<1>>(?=\\s*\\()`,[f,u]),inside:{function:n(`^<<0>>`,[f]),generic:{pattern:RegExp(u),alias:`class-name`,inside:v}}},"type-list":{pattern:n(`\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))`,[o,p,f,_,s.source,d,`\\bnew\\s*\\(\\s*\\)`]),lookbehind:!0,inside:{"record-arguments":{pattern:n(`(^(?!new\\s*\\()<<0>>\\s*)<<1>>`,[p,d]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:s,"class-name":{pattern:RegExp(_),greedy:!0,inside:v},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:`property`,inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:`keyword`}}}});var S=b+`|`+y,C=t(`\\/(?![*/])|\\/\\/[^\\r\\n]*[\\r\\n]|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>`,[S]),w=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),T=`\\b(?:assembly|event|field|method|module|param|property|return|type)\\b`,E=t(`<<0>>(?:\\s*\\(<<1>>*\\))?`,[m,w]);e.languages.insertBefore(`csharp`,`class-name`,{attribute:{pattern:n(`((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])`,[T,E]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(`^<<0>>(?=\\s*:)`,[T]),alias:`keyword`},"attribute-arguments":{pattern:n(`\\(<<0>>*\\)`,[w]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var D=`:[^}\\r\\n]+`,O=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),k=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[O,D]),A=r(t(`[^"'/()]|\\/(?!\\*)|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>|\\(<<self>>*\\)`,[S]),2),j=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[A,D]);function M(t,r){return{interpolation:{pattern:n(`((?:^|[^{])(?:\\{\\{)*)<<0>>`,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(`(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)`,[r,D]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:`language-csharp`,inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore(`csharp`,`string`,{"interpolation-string":[{pattern:n(`(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[\\s\\S]|\\{\\{|<<0>>|[^\\\\{"])*"`,[k]),lookbehind:!0,greedy:!0,inside:M(k,O)},{pattern:n(`(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"`,[j]),lookbehind:!0,greedy:!0,inside:M(j,A)}],char:{pattern:RegExp(y),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp})(e)}d5.displayName=`diff`,d5.aliases=[];function d5(e){(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
|
|
479
479
|
?|
|
|
480
|
-
|(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(e)}f5.displayName=`docker`,f5.aliases=[`dockerfile`];function f5(e){(function(e){var t=`(?:[ \\t]+(?![ \\t])(?:<SP_BS>)?|<SP_BS>)`.replace(/<SP_BS>/g,function(){return`\\\\[\\r\\n](?:\\s|\\\\[\\r\\n]|#.*(?!.))*(?![\\s#]|\\\\[\\r\\n])`}),n=`"(?:[^"\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*"|'(?:[^'\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*'`,r=`--[\\w-]+=(?:<STR>|(?!["'])(?:[^\\s\\\\]|\\\\.)+)`.replace(/<STR>/g,function(){return n}),i={pattern:RegExp(n),greedy:!0},a={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function o(e,n){return e=e.replace(/<OPT>/g,function(){return r}).replace(/<SP>/g,function(){return t}),RegExp(e,n)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:o(`(^(?:ONBUILD<SP>)?\\w+<SP>)<OPT>(?:<SP><OPT>)*`,`i`),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[i,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:o(`(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\\b`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \\t\\\\]+<SP>)AS`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^ONBUILD<SP>)\\w+`,`i`),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:a,string:i,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:a},e.languages.dockerfile=e.languages.docker})(e)}p5.displayName=`go`,p5.aliases=[];function p5(e){e.register(n5),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}m5.displayName=`scss`,m5.aliases=[];function m5(e){e.register(t5),e.languages.scss=e.languages.extend(`css`,{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:`important`},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore(`scss`,`atrule`,{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore(`scss`,`important`,{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore(`scss`,`function`,{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:`keyword`},placeholder:{pattern:/%[-\w]+/,alias:`selector`},statement:{pattern:/\B!(?:default|optional)\b/i,alias:`keyword`},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}h5.displayName=`json`,h5.aliases=[`webmanifest`];function h5(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}g5.displayName=`java`,g5.aliases=[];function g5(e){e.register(n5),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}_5.displayName=`typescript`,_5.aliases=[`ts`];function _5(e){e.register(r5),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}v5.displayName=`python`,v5.aliases=[`py`];function v5(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}y5.displayName=`jsx`,y5.aliases=[];function y5(e){e.register(r5),e.register(e5),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){(e.language===`jsx`||e.language===`tsx`)&&s(e.tokens)})})(e)}b5.displayName=`tsx`,b5.aliases=[];function b5(e){e.register(y5),e.register(_5),(function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`];var n=e.languages.tsx.tag;n.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+n.pattern.source+`)`,n.pattern.flags),n.lookbehind=!0})(e)}x5.displayName=`rust`,x5.aliases=[];function x5(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}var lae=s5,uae=a5,dae=o5,fae=u5,pae=t5,mae=d5,hae=f5,gae=p5,_ae=g5,vae=r5,yae=h5,bae=y5,xae=l5,Sae=e5,Cae=v5,wae=x5,Tae=m5,Eae=i5,Dae=b5,Oae=_5,kae=c5,S5={'code[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,border:`1px solid #dddddd`,backgroundColor:`white`},'pre > code[class*="language-"]':{fontSize:`1em`},'pre[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"]::selection':{background:`#C1DEF1`},'pre[class*="language-"] ::selection':{background:`#C1DEF1`},'code[class*="language-"]::selection':{background:`#C1DEF1`},'code[class*="language-"] ::selection':{background:`#C1DEF1`},':not(pre) > code[class*="language-"]':{padding:`.2em`,paddingTop:`1px`,paddingBottom:`1px`,background:`#f8f8f8`,border:`1px solid #dddddd`},comment:{color:`#008000`,fontStyle:`italic`},prolog:{color:`#008000`,fontStyle:`italic`},doctype:{color:`#008000`,fontStyle:`italic`},cdata:{color:`#008000`,fontStyle:`italic`},namespace:{Opacity:`.7`},string:{color:`#A31515`},punctuation:{color:`#393A34`},operator:{color:`#393A34`},url:{color:`#36acaa`},symbol:{color:`#36acaa`},number:{color:`#36acaa`},boolean:{color:`#36acaa`},variable:{color:`#36acaa`},constant:{color:`#36acaa`},inserted:{color:`#36acaa`},atrule:{color:`#0000ff`},keyword:{color:`#0000ff`},"attr-value":{color:`#0000ff`},".language-autohotkey .token.selector":{color:`#0000ff`},".language-json .token.boolean":{color:`#0000ff`},".language-json .token.number":{color:`#0000ff`},'code[class*="language-css"]':{color:`#0000ff`},function:{color:`#393A34`},deleted:{color:`#9a050f`},".language-autohotkey .token.tag":{color:`#9a050f`},selector:{color:`#800000`},".language-autohotkey .token.keyword":{color:`#00009f`},important:{color:`#e90`,fontWeight:`bold`},bold:{fontWeight:`bold`},italic:{fontStyle:`italic`},"class-name":{color:`#2B91AF`},".language-json .token.property":{color:`#2B91AF`},tag:{color:`#800000`},"attr-name":{color:`#ff0000`},property:{color:`#ff0000`},regex:{color:`#ff0000`},entity:{color:`#ff0000`},"directive.tag.tag":{background:`#ffff00`,color:`#393A34`},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:`#a5a5a5`},".line-numbers .line-numbers-rows > span:before":{color:`#2B91AF`},".line-highlight.line-highlight":{background:`linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0))`}},C5={'pre[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,background:`#1e1e1e`},'code[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'pre[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},':not(pre) > code[class*="language-"]':{padding:`.1em .3em`,borderRadius:`.3em`,color:`#db4c69`,background:`#1e1e1e`},".namespace":{Opacity:`.7`},"doctype.doctype-tag":{color:`#569CD6`},"doctype.name":{color:`#9cdcfe`},comment:{color:`#6a9955`},prolog:{color:`#6a9955`},punctuation:{color:`#d4d4d4`},".language-html .language-css .token.punctuation":{color:`#d4d4d4`},".language-html .language-javascript .token.punctuation":{color:`#d4d4d4`},property:{color:`#9cdcfe`},tag:{color:`#569cd6`},boolean:{color:`#569cd6`},number:{color:`#b5cea8`},constant:{color:`#9cdcfe`},symbol:{color:`#b5cea8`},inserted:{color:`#b5cea8`},unit:{color:`#b5cea8`},selector:{color:`#d7ba7d`},"attr-name":{color:`#9cdcfe`},string:{color:`#ce9178`},char:{color:`#ce9178`},builtin:{color:`#ce9178`},deleted:{color:`#ce9178`},".language-css .token.string.url":{textDecoration:`underline`},operator:{color:`#d4d4d4`},entity:{color:`#569cd6`},"operator.arrow":{color:`#569CD6`},atrule:{color:`#ce9178`},"atrule.rule":{color:`#c586c0`},"atrule.url":{color:`#9cdcfe`},"atrule.url.function":{color:`#dcdcaa`},"atrule.url.punctuation":{color:`#d4d4d4`},keyword:{color:`#569CD6`},"keyword.module":{color:`#c586c0`},"keyword.control-flow":{color:`#c586c0`},function:{color:`#dcdcaa`},"function.maybe-class-name":{color:`#dcdcaa`},regex:{color:`#d16969`},important:{color:`#569cd6`},italic:{fontStyle:`italic`},"class-name":{color:`#4ec9b0`},"maybe-class-name":{color:`#4ec9b0`},console:{color:`#9cdcfe`},parameter:{color:`#9cdcfe`},interpolation:{color:`#9cdcfe`},"punctuation.interpolation-punctuation":{color:`#569cd6`},variable:{color:`#9cdcfe`},"imports.maybe-class-name":{color:`#9cdcfe`},"exports.maybe-class-name":{color:`#9cdcfe`},escape:{color:`#d7ba7d`},"tag.punctuation":{color:`#808080`},cdata:{color:`#808080`},"attr-value":{color:`#ce9178`},"attr-value.punctuation":{color:`#ce9178`},"attr-value.punctuation.attr-equals":{color:`#d4d4d4`},namespace:{color:`#4ec9b0`},'pre[class*="language-javascript"]':{color:`#9cdcfe`},'code[class*="language-javascript"]':{color:`#9cdcfe`},'pre[class*="language-jsx"]':{color:`#9cdcfe`},'code[class*="language-jsx"]':{color:`#9cdcfe`},'pre[class*="language-typescript"]':{color:`#9cdcfe`},'code[class*="language-typescript"]':{color:`#9cdcfe`},'pre[class*="language-tsx"]':{color:`#9cdcfe`},'code[class*="language-tsx"]':{color:`#9cdcfe`},'pre[class*="language-css"]':{color:`#ce9178`},'code[class*="language-css"]':{color:`#ce9178`},'pre[class*="language-html"]':{color:`#d4d4d4`},'code[class*="language-html"]':{color:`#d4d4d4`},".language-regex .token.anchor":{color:`#dcdcaa`},".language-html .token.punctuation":{color:`#808080`},'pre[class*="language-"] > code[class*="language-"]':{position:`relative`,zIndex:`1`},".line-highlight.line-highlight":{background:`#f7ebc6`,boxShadow:`inset 5px 0 0 #f7d87c`,zIndex:`0`}},Aae={bash:lae,c:uae,cpp:dae,csharp:fae,css:pae,diff:mae,docker:hae,go:gae,java:_ae,javascript:vae,json:yae,jsx:bae,markdown:xae,markup:Sae,python:Cae,rust:wae,scss:Tae,sql:Eae,tsx:Dae,typescript:Oae,yaml:kae};for(let[e,t]of Object.entries(Aae))$8.registerLanguage(e,t);var jae=5e3,Mae=800;function w5({code:e,lang:t,headerAction:n,isStreaming:r}){let{isDark:i}=WK(),{t:a}=I(),[o,s]=(0,d.useState)(!1),c=()=>{gK(e).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},l=e.length>jae||r===!0&&e.length>Mae;return(0,F.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,F.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,F.jsx)(`span`,{className:`markdown-code-lang`,children:t||`text`}),(0,F.jsxs)(`div`,{className:`markdown-code-actions`,children:[n,(0,F.jsx)(`button`,{onClick:c,className:`markdown-code-action`,children:a(o?`i18n.copied`:`i18n.copy`)})]})]}),l?(0,F.jsx)(`pre`,{className:`markdown-code-plain`,style:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`,overflow:`auto`},children:(0,F.jsx)(`code`,{style:{fontFamily:`var(--font-mono)`},children:e})}):(0,F.jsx)($8,{language:t||`text`,style:i?C5:S5,showLineNumbers:!0,lineNumberStyle:{color:`var(--text-dim)`,fontStyle:`normal`},customStyle:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`},codeTagProps:{style:{fontFamily:`var(--font-mono)`}},children:e})]})}var T5=.25,E5=.5;function Nae({svg:e,onClose:t}){let{t:n}=I(),r=(0,d.useRef)(null),[i,a]=(0,d.useState)(1);return(0,d.useEffect)(()=>{let e=r.current;if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,e.showModal(),()=>{document.body.style.overflow=t,e.open&&e.close()}},[]),(0,F.jsx)(`dialog`,{ref:r,className:`mermaid-zoom-dialog`,"aria-label":n(`i18n.mermaidViewer`),onCancel:e=>{e.preventDefault(),t()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),t())},children:(0,F.jsxs)(`div`,{className:`mermaid-zoom-layout`,children:[(0,F.jsxs)(`div`,{className:`mermaid-zoom-toolbar`,children:[(0,F.jsx)(`span`,{className:`mermaid-zoom-title`,children:n(`i18n.mermaidDiagram`)}),(0,F.jsxs)(`div`,{className:`mermaid-zoom-actions`,children:[(0,F.jsxs)(`div`,{className:`mermaid-zoom-stepper`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.max(E5,e-T5)),disabled:i<=E5,title:n(`i18n.zoomOut`),"aria-label":n(`i18n.zoomOut`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M5 12h14`})})}),(0,F.jsxs)(`span`,{className:`mermaid-zoom-value`,children:[Math.round(i*100),`%`]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.min(3,e+T5)),disabled:i>=3,title:n(`i18n.zoomIn`),"aria-label":n(`i18n.zoomIn`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M12 5v14M5 12h14`})})})]}),(0,F.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:()=>a(1),title:n(`i18n.fitToWidth`),"aria-label":n(`i18n.fitToWidth`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5`})})}),(0,F.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:t,title:n(`i18n.close`),"aria-label":n(`i18n.close`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})})]})]}),(0,F.jsx)(`div`,{className:`mermaid-zoom-viewport`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,F.jsx)(`div`,{className:`mermaid-zoom-canvas`,style:{width:`${i*100}%`},dangerouslySetInnerHTML:{__html:e}})})]})})}function Pae({renderState:e,currentKey:t,t:n,zoomOpen:r,setZoomOpen:i}){return e?.key===t&&e.status===`error`?(0,F.jsx)(`div`,{className:`mermaid-block mermaid-block-error`,children:n(`i18n.invalidMermaid`)}):e?.key!==t||e.status!==`ready`?(0,F.jsx)(`div`,{className:`mermaid-block mermaid-block-loading`,"aria-label":n(`i18n.renderingMermaid`)}):(0,F.jsxs)(F.Fragment,{children:[!r&&(0,F.jsx)(`button`,{type:`button`,className:`mermaid-block mermaid-preview-button`,title:n(`i18n.openMermaidViewer`),"aria-label":n(`i18n.openMermaidViewer`),onClick:()=>i(!0),dangerouslySetInnerHTML:{__html:e.svg}}),r&&(0,F.jsx)(Nae,{svg:e.svg,onClose:()=>i(!1)})]})}function D5({code:e,isStreaming:t,defaultPreview:n=!1}){let{isDark:r}=WK(),{t:i}=I(),[a,o]=(0,d.useState)(n),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(!1),f=`${r?`dark`:`light`}\n${e}`,p=a&&!t;(0,d.useEffect)(()=>{if(!p)return;let t=!1;return c({key:f,status:`loading`}),(async()=>{let{default:n}=await p4(async()=>{let{default:e}=await import(`./mermaid.core-CHsjoxqB.js`);return{default:e}},__vite__mapDeps([2,3,4,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(n.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,theme:r?`dark`:`default`}),!await n.parse(e,{suppressErrors:!0}))throw Error(`Invalid Mermaid diagram`);let i=typeof crypto<`u`&&`randomUUID`in crypto?`mermaid-${crypto.randomUUID()}`:`mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}`,a=await n.render(i,e);t||c({key:f,status:`ready`,svg:a.svg})})().catch(()=>{t||c({key:f,status:`error`})}),()=>{t=!0}},[e,f,r,p]);let m=(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),disabled:t,title:i(t?`i18n.previewAfterStreaming`:p?`i18n.showMermaidSource`:`i18n.previewMermaid`),className:[`markdown-code-action`,p?`is-active`:``].filter(Boolean).join(` `),children:i(p?`i18n.source`:`i18n.preview`)});return p?(0,F.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,F.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,F.jsx)(`span`,{className:`markdown-code-lang`,children:`mermaid`}),m]}),(0,F.jsx)(Pae,{renderState:s,currentKey:f,t:i,zoomOpen:l,setZoomOpen:u})]}):(0,F.jsx)(w5,{code:e,lang:`mermaid`,headerAction:m})}function O5({children:e,className:t,isStreaming:n,cwd:r,onOpenFile:i}){let{t:a}=I(),[o,s]=(0,d.useState)(!1),c=!o&&e.length>1e5,l=(0,d.useMemo)(()=>c?xie(e):e,[c,e]),u=(0,d.useMemo)(()=>RU(l),[l]),f=(0,d.useMemo)(()=>({code({className:e,children:t,...r}){let i=e?.replace(`language-`,``).toLowerCase()??``,a=String(t);return e?.includes(`language-`)||a.includes(`
|
|
481
|
-
`)?i===`mermaid`?(0,F.jsx)(D5,{code:a.replace(/\n$/,``),isStreaming:n}):(0,F.jsx)(w5,{code:a.replace(/\n$/,``),lang:i,isStreaming:n}):(0,F.jsx)(`code`,{className:`markdown-inline-code`,...r,children:t})},pre({children:e}){return(0,F.jsx)(F.Fragment,{children:e})},a({href:e,children:t,...n}){delete n.node;let a=i?rW(e,r):null,o=i;if(!a||!o)return(0,F.jsx)(`a`,{href:e,...n,target:`_blank`,rel:`noopener noreferrer`,children:t});let s=e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.currentTarget.getAttribute(`target`);t&&t!==`_self`||(e.preventDefault(),o(a))};return(0,F.jsx)(`a`,{href:e,...n,onClick:s,children:t})},img({src:e,alt:t,...n}){delete n.node;let i=typeof e==`string`?rW(e,r):null,a=i?`/api/files/${dS(i)}?type=read`:e;return(0,F.jsx)(`img`,{src:a,alt:t??``,loading:`lazy`,...n})},table({children:e}){return(0,F.jsx)(`div`,{className:`markdown-table-wrap`,children:(0,F.jsx)(`table`,{children:e})})},blockquote({children:e}){return(0,F.jsx)(`blockquote`,{children:e})}}),[r,n,i]);return(0,F.jsxs)(`div`,{className:[`markdown-body`,t].filter(Boolean).join(` `),style:{whiteSpace:`pre-wrap`},children:[(0,F.jsx)(x8,{remarkPlugins:WU??void 0,rehypePlugins:KU??void 0,components:f,children:u}),c&&(0,F.jsxs)(`button`,{type:`button`,"aria-label":a(`chat.expandMessage`),title:a(`chat.expandMessage`),onClick:()=>s(!0),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:6,width:`100%`,marginTop:6,padding:`5px 0`,border:`none`,borderTop:`1px solid var(--border)`,background:`var(--bg-subtle)`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`…`}),(0,F.jsx)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]})]})}var k5={display:`flex`,alignItems:`center`,gap:4},A5={display:`flex`,alignItems:`center`,color:`var(--text)`,fontWeight:500},j5={width:R.base,height:R.base,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`};function M5(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function N5(e){return e<=0?null:e>=.01?`$${e.toFixed(2)}`:`<$0.01`}function P5({svg:e,value:t,badge:n}){return(0,F.jsxs)(`span`,{style:k5,children:[e,t,n]})}var F5=[{key:`input`,color:`var(--accent)`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`line`,{x1:`5`,y1:`8.5`,x2:`5`,y2:`1.5`}),(0,F.jsx)(`polyline`,{points:`2 4 5 1.5 8 4`})]})},{key:`output`,color:`var(--status-info)`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`line`,{x1:`5`,y1:`1.5`,x2:`5`,y2:`8.5`}),(0,F.jsx)(`polyline`,{points:`2 6 5 8.5 8 6`})]})},{key:`cacheRead`,color:`var(--status-success)`,rateHint:`session.cacheReadRate`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`path`,{d:`M8.5 5a3.5 3.5 0 1 1-1-2.45`}),(0,F.jsx)(`polyline`,{points:`6.5 1.5 8.5 2.5 7.5 4.5`})]})},{key:`cacheWrite`,color:`var(--status-warning)`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`path`,{d:`M8.5 5a3.5 3.5 0 1 0-1-2.45`}),(0,F.jsx)(`polyline`,{points:`2.5 1.5 4.5 2.5 3.5 4.5`})]})}];function Fae(e,t,n){let r=[],i=(e,n)=>{n>0&&r.push(`${e}: ${n.toLocaleString(t)}`)};return i(n(`session.input`),e.input),i(n(`session.output`),e.output),i(n(`session.cacheRead`),e.cacheRead),i(n(`session.cacheWrite`),e.cacheWrite),e.cost?.total>0&&r.push(`${n(`session.cost`)}: $${e.cost.total.toFixed(4)}`),r.join(` · `)}function I5({usage:e}){let{t,locale:n}=I();return(0,F.jsx)(L,{label:Fae(e,n,t),children:(0,F.jsxs)(`div`,{"data-testid":`message-usage-stats`,style:{display:`flex`,alignItems:`center`,gap:10,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,fontVariantNumeric:`tabular-nums`},children:[F5.map(t=>{let n=e[t.key];return n<=0?null:(0,F.jsx)(P5,{svg:(0,F.jsx)(`svg`,{...j5,style:{color:t.color},children:t.svg}),value:M5(n)},t.key)}),e.cost?.total>0&&(0,F.jsx)(`span`,{style:A5,children:N5(e.cost.total)})]})})}function Iae({textContent:e}){let{t}=I(),[n,r]=(0,d.useState)(!1);return(0,F.jsxs)(`button`,{onClick:()=>{gK(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},title:t(`i18n.copyMessage`),"aria-label":t(`i18n.copyMessage`),style:{display:`inline-flex`,alignItems:`center`,gap:4,padding:`2px 8px`,height:22,flexShrink:0,background:`none`,border:`none`,borderRadius:5,color:n?`var(--accent)`:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`},children:[n?(0,F.jsx)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:R.lg,height:R.lg,rx:`2`,ry:`2`}),(0,F.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),t(n?`i18n.copied`:`i18n.copy`)]})}function Lae({secs:e,timestamp:t,marginLeftAuto:n=!1}){let r=(0,F.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:4,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginLeft:n?`auto`:void 0,fontVariantNumeric:`tabular-nums`},children:[(0,F.jsx)(Wn,{size:R.sm}),e!==void 0&&sZ(e)]});return t===void 0?r:(0,F.jsx)(L,{wrapperStyle:n?{marginLeft:`auto`}:void 0,label:new Date(t).toLocaleString([],{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),children:r})}function Rae({usage:e,isStreaming:t,textContent:n,timestamp:r,turnDurationSecs:i,showUsage:a=!0,showTurnDuration:o=!0}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[e&&a&&!t&&(0,F.jsx)(I5,{usage:e}),r&&!t&&o&&(0,F.jsx)(L,{label:new Date(r).toLocaleString([],{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),children:(0,F.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:4,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginLeft:`auto`,fontVariantNumeric:`tabular-nums`},children:[(0,F.jsx)(Wn,{size:R.sm}),o&&i!==void 0&&(0,F.jsx)(F.Fragment,{children:sZ(i)})]})})]})})}function zae({message:e,modelNames:t,isStreaming:n,blocks:r,turnNumber:i,tps:a}){let{t:o}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,marginBottom:4,display:`flex`,alignItems:`center`,gap:6},children:[i!==void 0&&(0,F.jsx)(D$,{number:i}),e.provider&&(0,F.jsxs)(`span`,{title:`${e.provider}/${e.model}`,style:{whiteSpace:`nowrap`},children:[(0,F.jsxs)(`span`,{style:{color:`var(--text-dim)`},children:[e.provider,`/`]}),(0,F.jsx)(`span`,{style:{color:`var(--text)`,fontWeight:700},children:t?.[`${e.provider}/${e.model}`]??t?.[e.model]??e.model})]}),n&&(()=>{let e=0;for(let t of r)t.type===`text`?e+=t.text?.length??0:t.type===`thinking`?e+=t.thinking?.length??0:t.type===`toolCall`&&(e+=JSON.stringify(t.input??{}).length);let t=Math.round(e/4);return(0,F.jsx)(F.Fragment,{children:t>0&&(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,color:`var(--text)`},title:o(`i18n.estimatedTokens`),children:[(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:2,fontSize:`var(--text-sm)`,fontWeight:400},children:[(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`line`,{x1:`5`,y1:`1.5`,x2:`5`,y2:`8.5`}),(0,F.jsx)(`polyline`,{points:`2 6 5 8.5 8 6`})]}),t]}),a!==null&&(0,F.jsxs)(`span`,{style:{marginLeft:6,padding:`1px 6px`,borderRadius:4,background:a>=50?`#53b3cb`:a>=30?`#9bc53d`:a>=15?`#f9c22e`:`#e01a4f`,color:`#fff`,fontSize:`var(--text-sm)`,fontWeight:400},children:[a.toFixed(1),` t/s`]})]})})})()]})})}var Bae=50,Vae=400;function L5(e,t,n){let r=(0,d.useRef)(!1),i=(0,d.useRef)(0),a=()=>{i.current=Date.now()};return(0,d.useLayoutEffect)(()=>{let n=e.current;if(!t||!n||r.current)return;let i=0,a=()=>{if(r.current)return;let e=n.scrollHeight,t=n.clientHeight;n.scrollTop!==e-t&&(n.scrollTop=e-t),typeof requestAnimationFrame==`function`&&(i=requestAnimationFrame(()=>{n.scrollHeight!==e&&a()}))};return a(),()=>cancelAnimationFrame(i)},[t,...n]),(0,d.useLayoutEffect)(()=>{let t=e.current;if(t)return t.addEventListener(`wheel`,a,{passive:!0}),t.addEventListener(`touchstart`,a,{passive:!0}),t.addEventListener(`touchmove`,a,{passive:!0}),t.addEventListener(`keydown`,a),t.addEventListener(`pointerdown`,a),()=>{t.removeEventListener(`wheel`,a),t.removeEventListener(`touchstart`,a),t.removeEventListener(`touchmove`,a),t.removeEventListener(`keydown`,a),t.removeEventListener(`pointerdown`,a)}},[e]),()=>{let t=e.current;if(!t)return;let n=t.scrollHeight-t.scrollTop-t.clientHeight>Bae;n&&Date.now()-i.current<=Vae?r.current=!0:n||(r.current=!1)}}var{min:R5,max:z5,abs:B5,floor:Hae}=Math,V5=(e,t,n)=>R5(n,z5(t,e)),H5=e=>[...e].sort((e,t)=>e-t),U5=setTimeout,W5=clearTimeout,G5=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)},K5=()=>{let e;return[new Promise(t=>{e=t}),e]},q5=e=>{let t;return()=>(e&&=(t=e(),void 0),t)},Uae=typeof window<`u`,Wae=e=>e.documentElement,Gae=e=>e.ownerDocument,Kae=e=>e.defaultView,J5=q5(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>0),qae=q5(()=>`scrollBehavior`in Wae(document).style),Jae=e=>z5(e.t(),e.o()),Yae=({i:e,l:t,u:n,h:r,v:i,S:a,t:o,$:s,m:c,p:l},u=0)=>{let d=!!l,f=!!u,p=1,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=null,C=[0,f?z5(u-1,0):-1],w=0,T=!1,E=new Set,D=()=>g-h,O=()=>D()+v+_,k=(e,t)=>{let i=n(e)-v;return t?o()-i-r(e):i},A=e=>{e&&(J5()&&b!==0||S&&x===1?v+=e:_+=e)};return{_:()=>{E.clear()},I:()=>p,i:(t=200)=>{if(!T||f)return C;let n,r;if(y)[n,r]=C;else{let i=z5(0,O()),a=i+m;d||(t=z5(0,t),b!==1&&(i-=t),b!==2&&(a+=t)),[n,r]=C=e(z5(0,i),z5(0,a)),S&&(n=R5(n,S[0]),r=z5(r,S[1]))}return[z5(n,0),R5(r,s()-1)]},k:e=>t(e-h),R:a,u:k,h:r,C:s,T:()=>g,M:()=>b!==0,o:()=>m,O:()=>h,t:o,L:()=>(y=_,_=0,[y,x===2]),H:(e,t)=>{let n=[e,t];return E.add(n),()=>{E.delete(n)}},W:(n,s)=>{let u,C,j=0;switch(n){case 1:{if(s===g&&x===0)break;let e=y;y=0;let t=s-g,n=B5(t);e&&n<B5(e)+1||x!==0||(b=t<0?2:1),f&&=!1,g=s,j=4;let r=D();r>=-m&&r<=o()&&(j+=1,C=n>m);break}case 2:j=8,b!==0&&(u=!0,j+=1),b=0,x=0,S=null;break;case 3:{let e=s.filter(([e,t])=>!a(e,t));if(!e.length)break;A(e.reduce((e,[t,n])=>{let i;if(x===2)i=!0;else if(S&&x===1)i=t<S[0];else{let e=D(),n=k(t),a=r(t);i=b!==1&&x===0?n+a<=e:n<e&&n+a<e+m}return i&&(e+=n-r(t)),e},0));for(let[t,n]of e){let e=r(t),a=i(t,n);d&&(w+=a?n:n-e)}d&&m&&w>m&&(A(l(t(O()))),d=!1),j=3,C=!0;break}case 4:m!==s&&(m||(T=C=!0),m=s,j=3);break;case 5:s[1]?(A(c(s[0],!0)),x=2,j=1):(c(s[0]),j=1);break;case 6:h=s;break;case 7:x=1;break;case 8:S=e(s,s+m),j=1}j&&(p=1+(2147483647&p),u&&v&&(_+=v,v=0),E.forEach(([e,t])=>{j&e&&t(C)}))}}},Y5=(e,t,n,r=0,i=t-1)=>{let a=r;for(;r<=i;){let t=Hae((r+i)/2);e(t)<=n?(a=t,r=t+1):i=t-1}return V5(a,0,t-1)},X5=(e,t,n)=>{let r=n?`unshift`:`push`;for(let n=0;n<t;n++)e[r](-1);return e},Xae=(e,t,n)=>{let r=n&&n[1]||t||40,i=-1,a=0,o=n&&n[0],s=o?X5(o.slice(0,R5(e,o.length)),z5(0,e-o.length)):X5([],e),c=X5([],e+1),l=e=>{let t=s[e];return t===-1?r:t},u=t=>{if(!e)return 0;if(i>=t)return c[t];i<0&&(c[0]=0,i=0);let n=i,r=c[n];for(;n<t;)r+=l(n),c[++n]=r;return i=t,r};return{i:(t,n)=>{let r,i;return a=R5(a,e-1),u(a)<=t?(i=Y5(u,e,n,a),r=Y5(u,e,t,a,i)):(r=Y5(u,e,t,void 0,a),i=Y5(u,e,n,r)),a=r,[r,i]},l:t=>Y5(u,e,t),u,h:l,v:(e,t)=>{let n=s[e]===-1;return s[e]=t,i=R5(e,i),n},S:(e,t=-1)=>s[e]===t,t:()=>u(e),$:()=>e,m:(t,n)=>{let a=t-e;return i=n?-1:R5(t-1,i),e=t,a>0?(X5(c,a),X5(s,a,n),r*a):(c.splice(a),(n?s.splice(0,-a):s.splice(a)).reduce((e,t)=>e-(t===-1?r:t),0))},p:t?void 0:e=>{let t=0,n=[];s.forEach((r,i)=>{r!==-1&&(r&&n.push(r),i<e&&t++)}),i=-1;let a=H5(n),o=a.length,c=o/2|0,l=o%2==0?(a[c-1]+a[c])/2:a[c],u=r;return((r=l)-u)*z5(e-t,0)},B:()=>[s.slice(),r]}},Zae=e=>{let t;return{X(n){(t||=new(Kae(Gae(n))).ResizeObserver(e)).observe(n)},Y(e){t.unobserve(e)},q(){t&&t.disconnect()}}},Z5=(e,t)=>t?-e:e,Qae=(e,t,n,r,i,a)=>{let o,s=0,c=!1,l=!1,u=!1,d=!1,f=Date.now,p=()=>{if(c||l)return c=!1,void m();u=!1,e.W(2)},m=()=>{W5(o),o=U5(p,150)},h=()=>{s=f(),u&&(d=!0),a&&e.W(6,a()),e.W(1,r()),m()},g=t=>{if(c||!e.M()||t.ctrlKey)return;let r=f()-s;150>r&&50<r&&(n?t.deltaX:t.deltaY)&&(c=!0)},_=()=>{l=!0,u=d=!1},v=()=>{l=!1,J5()&&(u=!0)};return t.addEventListener(`scroll`,h),t.addEventListener(`wheel`,g,{passive:!0}),t.addEventListener(`touchstart`,_,{passive:!0}),t.addEventListener(`touchend`,v,{passive:!0}),{q:()=>{t.removeEventListener(`scroll`,h),t.removeEventListener(`wheel`,g),t.removeEventListener(`touchstart`,_),t.removeEventListener(`touchend`,v),W5(o)},A:()=>{let[t,n]=e.L();t&&(i(t,n,d),d=!1,n&&e.o()>e.t()&&e.W(1,r()))}}},$ae=(e,t,n)=>{let r;return[async(i,a)=>{if(!await t())return;let o,s,c;r&&r();let l=a&&qae(),u=r=()=>{o=!0,W5(s),c&&c()},d=()=>{if(!o){if(e.o()&&(W5(s),s=U5(u,150)),l){for(let[t,n]=e.i(0);t<=n;t++)if(e.R(t))return;u()}e.W(7),n(i(),l)}},f=()=>{if(o)return;let t;c=e.H(2,()=>{t||(t=!0,G5(()=>{t=!1,d()}))}),d()};l?(e.W(8,i()),G5(f)):f()},()=>{r&&r()}]},eoe=(e,t)=>{let n,r,i=K5(),a=!1,o=t?`scrollLeft`:`scrollTop`,s=t?`overflowX`:`overflowY`,[c,l]=$ae(e,()=>i[0],(e,r)=>{e=Z5(e,a),r?n.scrollTo({[t?`left`:`top`]:e,behavior:`smooth`}):n[o]=e}),u=t?`width`:`height`,d=new WeakMap,f=Zae(t=>{let r=[];for(let{target:i,contentRect:a}of t)if(i.offsetParent){if(i===n)e.W(4,a[u]);else{let e=d.get(i);e!=null&&r.push([e,a[u]])}}r.length&&e.W(3,r)});return{D(c,u=c.parentElement){f.X(n=u),t&&(a=getComputedStyle(u).direction===`rtl`),r=Qae(e,u,t,()=>Z5(u[o],a),(t,n,r)=>{if(r){let e=u.style,t=e[s];e[s]=`hidden`,U5(()=>{e[s]=t})}u[o]=Z5(e.T()+t,a),n&&l()}),i[1](!0)},_(){f.q(),r&&r.q(),i[1](!1),i=K5()},N:(e,t)=>(d.set(e,t),f.X(e),()=>{d.delete(e),f.Y(e)}),P:()=>a,V:c,J(){r&&r.A()},j:e.O,G:()=>0}},Q5=(e,t)=>{e.V(()=>t)},toe=(e,t,n,{align:r,smooth:i,offset:a=0}={})=>{if(n=V5(n,0,t.C()-1),r===`nearest`){let e=t.u(n),i=t.T();if(e<i)r=`start`;else{if(!(e+t.h(n)>i+t.o()))return;r=`end`}}e.V(()=>a+e.j()+t.u(n)+(r===`end`?t.h(n)-(t.o()-e.G()):r===`center`?(t.h(n)-(t.o()-e.G()))/2:0),i)},$5=Uae?d.useLayoutEffect:d.useEffect,e7=`current`,t7=(e,t)=>{if(Array.isArray(e))for(let n of e)t7(n,t);else e==null||typeof e==`boolean`||t.push(e)},noe=(e,t)=>e.key??`_`+t,roe=e=>{let t=(0,d.useRef)(null);return t.current||=e()},n7=e=>{let t=(0,d.useRef)(e);return $5(()=>{t[e7]=e},[e]),t},ioe=(0,d.memo)(({ee:e,te:t,oe:n,ne:r,re:i,ie:a,se:o,le:s})=>{let c=(0,d.useRef)(null);$5(()=>t(c[e7],n),[n]);let l=(0,d.useMemo)(()=>{let e={contain:`layout style`,position:i&&s?void 0:`absolute`,[o?`height`:`width`]:`100%`,[o?`top`:`left`]:0,[o?`left`:`top`]:r,visibility:!i||s?void 0:`hidden`};return o&&(e.display=`inline-flex`),e},[r,i,s,o]);return(0,F.jsx)(a,typeof a==`string`?{ref:c,style:l,children:e}:{ref:c,style:l,index:n,children:e})}),aoe=(e,t)=>(0,d.useMemo)(()=>{if(typeof e==`function`)return[n=>e(t[n],n),t.length];let n=(e=>{let t=[];return t7(e,t),t})(e);return[e=>n[e],n.length]},[e,t]),r7=(0,d.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:a,keepMounted:o,cache:s,startMargin:c=0,ssrCount:l,as:u=`div`,item:f=`div`,scrollRef:p,onScroll:m,onScrollEnd:h},g)=>{let[_,v]=aoe(e,t),y=(0,d.useRef)(null),b=(0,d.useRef)(!!l),x=n7(m),S=n7(h),[C,w,T,E]=roe(()=>{let e=!!a,t=Xae(v,r,s),n=Yae(t,l);return[n,t,eoe(n,e),e]});v!==C.C()&&C.W(5,[v,i]),c!==C.O()&&C.W(6,c);let[D,O]=(0,d.useReducer)(C.I,void 0,C.I),k=C.M(),A=C.t(),j=T.P(),M=[],N=e=>{let t=_(e);return(0,F.jsx)(ioe,{te:T.N,oe:e,ne:C.u(e,j),re:C.R(e),ie:f,ee:t,se:E,le:b[e7]},noe(t,e))};if($5(()=>{b[e7]=!1,C.H(1,e=>{e?(0,Yr.flushSync)(O):O()}),C.H(4,()=>{x.current&&x.current(C.T())}),C.H(8,()=>{S.current&&S.current()});let e=y[e7];return p?G5(()=>{p.current&&T.D(e,p[e7])}):T.D(e),()=>{C._(),T._()}},[]),$5(()=>{T.J()},[D]),(0,d.useImperativeHandle)(g,()=>({get cache(){return w.B()},get scrollOffset(){return C.T()},get scrollSize(){return Jae(C)},get viewportSize(){return C.o()},findItemIndex:C.k,getItemOffset:C.u,getItemSize:C.h,scrollToIndex:(e,t)=>toe(T,C,e,t),scrollTo:e=>Q5(T,e),scrollBy:e=>((e,t,n)=>{Q5(e,n+t.T())})(T,C,e)}),[]),o){let e=new Set(o);for(let[t,r]=C.i(n);t<=r;t++)e.add(t);H5([...e]).forEach(e=>{M.push(N(e))})}else for(let[e,t]=C.i(n);e<=t;e++)M.push(N(e));return(0,F.jsx)(u,{ref:y,style:{contain:`size style`,overflowAnchor:`none`,flex:`none`,position:`relative`,width:E?A:`100%`,height:E?`100%`:A,pointerEvents:k?`none`:void 0},children:M})}),i7=24;function a7({text:e}){let t=(0,d.useMemo)(()=>e.split(/\r?\n/),[e]);return typeof ResizeObserver>`u`||t.length<50&&e.length<5e3?(0,F.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e}):(0,F.jsx)(r7,{data:t,itemSize:i7,children:e=>(0,F.jsx)(`div`,{style:{minHeight:i7,lineHeight:`${i7}px`,whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e})})}function o7({header:e,body:t,isStreaming:n=!1,defaultExpanded:r=!1,preview:i,footer:a}){let[o,s]=(0,d.useState)(r),[c,l]=(0,d.useState)(!1);return n?(0,F.jsxs)(F.Fragment,{children:[e(ooe,{collapsed:!1}),t()]}):o?(0,F.jsxs)(F.Fragment,{children:[e({onClick:()=>s(!1),onPointerEnter:s7,onPointerLeave:s7,"aria-expanded":!0,"data-long-block-toggle":``,style:{cursor:`pointer`}},{collapsed:!1}),t(),a?(0,F.jsx)(`div`,{style:{padding:`2px 10px 4px`},children:a}):null]}):(0,F.jsx)(soe,{open:c,onOpen:()=>l(!0),onClose:()=>l(!1),preview:(0,F.jsxs)(F.Fragment,{children:[i?i():t(),a]}),children:e({onClick:()=>{l(!1),s(!0)},onPointerEnter:()=>l(!0),onPointerLeave:()=>l(!1),"aria-expanded":!1,"data-long-block-toggle":``,style:{cursor:`pointer`}},{collapsed:!0})})}var s7=()=>{},ooe={onClick:s7,onPointerEnter:s7,onPointerLeave:s7,"aria-expanded":!0,style:{cursor:`default`}},c7=6,l7=8;function soe({open:e,onOpen:t,onClose:n,preview:r,children:i}){let a=(0,d.useRef)(null),o=(0,d.useRef)(null),[s,c]=(0,d.useState)({top:0,left:0});(0,d.useLayoutEffect)(()=>{if(!e)return;let t=a.current?.getBoundingClientRect(),n=o.current;if(!t||!n)return;let r=n.offsetWidth,i=n.offsetHeight,s=window.innerWidth,l=window.innerHeight,u=Math.max(l7,Math.min(t.left,s-r-l7)),d=t.bottom+c7+i<=l-l7,f=t.top-c7-i>=l7,p=t.top>l/2&&f?t.top-c7-i:d?t.bottom+c7:t.top-c7-i;c({top:p,left:u})},[e]);let l=e&&typeof document<`u`?(0,Yr.createPortal)((0,F.jsx)(`div`,{ref:o,role:`tooltip`,className:`hover-preview-panel`,style:{position:`fixed`,top:s.top,left:s.left,width:`min(48rem, calc(100vw - 16px))`,maxHeight:`calc(50vh - 32px)`,overflowY:`auto`,background:`var(--bg)`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md, 6px)`,padding:`8px 10px`,fontSize:`var(--text-base)`,lineHeight:1.5,boxShadow:`0 4px 16px -2px var(--shadow-strong)`,zIndex:9999,pointerEvents:`none`},children:r}),document.body):null;return(0,F.jsxs)(`span`,{ref:a,onPointerEnter:t,onPointerLeave:n,style:{display:`block`,minWidth:0},children:[i,l]})}var coe=100,u7=new Map;function loe(e,t,n){let r=`${e}:${t}:${n}`,i=u7.get(r);if(i)return u7.delete(r),u7.set(r,i),i;let a=fetch(`/api/sessions/${encodeURIComponent(e)}/entries/${encodeURIComponent(t)}/thinking?blockIndex=${n}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(typeof t.thinking!=`string`)throw Error(`Invalid thinking response`);return t.thinking}).catch(e=>{throw u7.delete(r),e});if(u7.set(r,a),u7.size>coe){let e=u7.keys().next().value;e&&u7.delete(e)}return a}function uoe({block:e,sessionId:t,entryId:n,blockIndex:r,isStreaming:i=!1,keepExpanded:a=!1,footer:o}){let{t:s}=I(),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(null),h=(0,d.useRef)(!1),g=(0,d.useRef)(null);(0,d.useEffect)(()=>{e.deferred&&!h.current&&(h.current=!0,_())},[]);let _=async()=>{if(!(!e.deferred||c!==null)){if(!t||!n){m(s(`i18n.thinkingUnavailable`));return}f(!0),m(null);try{l(await loe(t,n,r))}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}},v=e.deferred?c:e.thinking,y=L5(g,i,[v]),b={padding:`4px 10px 8px 28px`,borderTop:`1px solid var(--border)`,fontSize:`var(--text-lg)`,lineHeight:1.6,color:`var(--text-muted)`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,fontFamily:`var(--font-mono)`,maxHeight:400,overflowY:`auto`,contentVisibility:`auto`,containIntrinsicBlockSize:400},x=u?(0,F.jsxs)(`span`,{style:{color:`var(--text-dim)`},children:[s(`i18n.loading`),`...`]}):p?(0,F.jsx)(`span`,{style:{color:`var(--status-error)`},children:p}):v?(0,F.jsx)(a7,{text:v}):i$(e)?(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontStyle:`italic`},children:s(`i18n.thinkingEncrypted`)}):null;return(0,F.jsx)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:6,overflow:`hidden`,fontSize:`var(--text-base)`},children:(0,F.jsx)(o7,{isStreaming:i,defaultExpanded:a,footer:o,header:(e,{collapsed:t})=>(0,F.jsxs)(`div`,{...e,style:{...e.style,display:`flex`,alignItems:`center`,gap:6,padding:`6px 10px`,color:`var(--status-warning)`,fontSize:`var(--text-base)`,minWidth:0},children:[(0,F.jsx)(sr,{size:R.base,fill:`currentColor`,style:{flexShrink:0,color:`var(--bulb-warning)`}}),(0,F.jsx)(`span`,{style:{flexShrink:0},children:s(`i18n.thinking`)}),t&&v&&(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:v.slice(0,160)})]}),body:()=>(0,F.jsx)(`div`,{ref:g,onScroll:y,style:b,children:x??(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`},children:s(`i18n.noThinking`)})})})})}function doe(e){let t=d7(e);if(t){let e=0,n=0;for(let r of t)for(let t of r.rows)t.type===`line`&&(t.left.type===`removed`&&(n+=1),t.right.type===`added`&&(e+=1));return{additions:e,deletions:n}}let n=0,r=0;for(let t of e.split(/\r?\n/))t.startsWith(`+`)&&!t.startsWith(`+++`)?n+=1:t.startsWith(`-`)&&!t.startsWith(`---`)&&(r+=1);return{additions:n,deletions:r}}function d7(e){let t=[],n=null,r,i=0,a=0,o=[],s=[],c=()=>({lineNo:null,text:``,type:`empty`}),l=()=>{if(!n){o=[],s=[];return}let e=Math.max(o.length,s.length);for(let t=0;t<e;t++){let e=o[t]?{lineNo:o[t].lineNo,text:o[t].text,type:`removed`}:c(),r=s[t]?{lineNo:s[t].lineNo,text:s[t].text,type:`added`}:c();n.rows.push({type:`line`,left:e,right:r})}o=[],s=[]};for(let c of e.split(/\r?\n/)){if(c.startsWith(`--- `)){l(),r=f7(c.slice(4));continue}if(c.startsWith(`+++ `)){l(),n={oldPath:r,newPath:f7(c.slice(4)),rows:[]},t.push(n);continue}let e=c.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(e){n||(n={rows:[]},t.push(n)),l(),i=Number(e[1]),a=Number(e[2]),n.rows.push({type:`hunk`,text:c});continue}if(!n)continue;if(c.startsWith(`\\ `)){l(),n.rows.push({type:`hunk`,text:c});continue}let u=c[0],d=c.slice(1);u===` `?(l(),n.rows.push({type:`line`,left:{lineNo:i++,text:d,type:`context`},right:{lineNo:a++,text:d,type:`context`}})):u===`-`?o.push({lineNo:i++,text:d}):u===`+`?s.push({lineNo:a++,text:d}):c!==``&&(l(),n.rows.push({type:`hunk`,text:c}))}l();let u=t.filter(e=>e.rows.some(e=>e.type===`line`));return u.length>0?u:null}function f7(e){return e.split(` `)[0].trim()}function foe(e){let t=e.details;if(!wh(t))return null;let n=typeof t.patch==`string`?t.patch:null;if(n)return{text:n};let r=typeof t.diff==`string`?t.diff:null;return r?{text:r}:null}function poe(e){if(typeof e!=`string`||!e)return!1;let t=e.toLowerCase();return t===`edit`||t.startsWith(`edit_`)||t.endsWith(`.edit`)||t.endsWith(`_edit`)||t.includes(`str_replace`)||t.includes(`replace_editor`)}function moe({diff:e}){return(0,F.jsx)(`div`,{style:{borderRadius:`var(--radius-md, 6px)`,overflow:`hidden`,background:`var(--bg-subtle)`},children:(0,F.jsx)(hoe,{text:e.text})})}function hoe({text:e}){let{t}=I(),n=(0,d.useMemo)(()=>d7(e),[e]);if(!n)return(0,F.jsx)(voe,{text:e});let r=n.length>1;return(0,F.jsx)(`div`,{style:{maxHeight:560,overflowY:`auto`,overflowX:`hidden`,background:`var(--bg)`,contentVisibility:`auto`,containIntrinsicBlockSize:560},children:n.map((e,n)=>(0,F.jsxs)(`div`,{style:{minWidth:0,borderTop:n===0?`none`:`1px solid var(--border)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,lineHeight:1.55},children:[r&&(0,F.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(0, 1fr) minmax(0, 1fr)`,position:`sticky`,top:0,zIndex:1,background:`var(--bg)`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsx)(p7,{title:e.oldPath||t(`i18n.before`),side:`left`}),(0,F.jsx)(p7,{title:e.newPath||t(`i18n.after`),side:`right`})]}),(0,F.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(0, 1fr) minmax(0, 1fr)`},children:e.rows.map((e,t)=>e.type===`hunk`?null:(0,F.jsxs)(`div`,{style:{display:`contents`},children:[(0,F.jsx)(m7,{cell:e.left,side:`left`}),(0,F.jsx)(m7,{cell:e.right,side:`right`})]},t))})]},n))})}function p7({title:e,side:t}){return(0,F.jsx)(`div`,{title:e,style:{padding:`5px 10px`,color:`var(--text-dim)`,borderRight:t===`left`?`1px solid var(--border)`:`none`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e})}function m7({cell:e,side:t}){let n=e.type===`added`?`color-mix(in srgb, var(--status-success) 12%, transparent)`:e.type===`removed`?`color-mix(in srgb, var(--status-error) 13%, transparent)`:e.type===`empty`?`var(--bg-subtle)`:`transparent`,r=e.type===`added`?`+`:e.type===`removed`?`-`:` `,i=e.type===`added`?`var(--status-success)`:e.type===`removed`?`var(--status-error)`:`var(--text-dim)`;return(0,F.jsxs)(`div`,{style:{display:`flex`,minWidth:0,background:n,borderRight:t===`left`?`1px solid var(--border)`:`none`},children:[(0,F.jsx)(`span`,{style:{width:42,padding:`0 6px`,textAlign:`right`,color:`var(--text-dim)`,userSelect:`none`,background:`var(--bg)`,borderRight:`1px solid var(--border)`,flexShrink:0},children:e.lineNo??``}),(0,F.jsx)(`span`,{style:{width:18,padding:`0 5px`,color:i,userSelect:`none`,fontWeight:e.type===`context`||e.type===`empty`?400:700,flexShrink:0},children:r}),(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,padding:`0 10px 0 0`,color:e.type===`empty`?`var(--text-dim)`:`var(--text)`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:e.text||`\xA0`})]})}var goe={added:{bg:`color-mix(in srgb, var(--status-success) 12%, transparent)`,color:`var(--status-success)`,borderLeft:`3px solid var(--status-success)`},removed:{bg:`color-mix(in srgb, var(--status-error) 13%, transparent)`,color:`var(--status-error)`,borderLeft:`3px solid var(--status-error)`},hunk:{bg:`color-mix(in srgb, var(--accent) 12%, transparent)`,color:`var(--accent)`,borderLeft:`3px solid var(--accent)`},context:{bg:`transparent`,color:`var(--text)`,borderLeft:`3px solid transparent`}};function _oe(e){return e.startsWith(`@@`)?`hunk`:e.startsWith(`+`)&&!e.startsWith(`+++`)?`added`:e.startsWith(`-`)&&!e.startsWith(`---`)?`removed`:`context`}function voe({text:e}){let t=e.split(/\r?\n/);return(0,F.jsx)(`div`,{style:{maxHeight:520,overflowY:`auto`,overflowX:`hidden`,fontFamily:`var(--font-mono)`,contentVisibility:`auto`,containIntrinsicBlockSize:520,fontSize:`var(--text-base)`,lineHeight:1.55,minWidth:0},children:t.map((e,t)=>{let{bg:n,color:r,borderLeft:i}=goe[_oe(e)];return(0,F.jsxs)(`div`,{style:{display:`flex`,background:n,borderLeft:i},children:[(0,F.jsx)(`span`,{style:{width:48,padding:`0 8px`,color:`var(--text-dim)`,background:`var(--bg)`,borderRight:`1px solid var(--border)`,textAlign:`right`,userSelect:`none`,flexShrink:0},children:t+1}),(0,F.jsx)(`span`,{style:{padding:`0 10px`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,color:r},children:e||`\xA0`})]},t)})})}var yoe=`用户输入: `;function h7(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:null}function g7(e){return Array.isArray(e)?e.map((e,t)=>{let n=h7(e);return{label:typeof n?.label==`string`?n.label:`#${t+1}`,description:typeof n?.description==`string`?n.description:null,value:typeof n?.value==`string`?n.value:null}}):[]}function boe(e){return Array.isArray(e.questions)?e.questions.map((e,t)=>{let n=h7(e);return{id:typeof n?.id==`string`?n.id:`#${t}`,question:typeof n?.question==`string`?n.question:typeof n?.label==`string`?n.label:null,options:g7(n?.options)}}):typeof e.question==`string`?[{id:null,question:e.question,options:g7(e.options)}]:[]}function xoe(e){let t=h7(e);if(!t)return[];if(Array.isArray(t.answers))return t.answers.map((e,t)=>{let n=h7(e),r=Array.isArray(n?.selections)?n.selections:[];return{id:typeof n?.id==`string`?n.id:`#${t}`,values:r.map(e=>h7(e)?.value??``).filter(Boolean),labels:r.map(e=>h7(e)?.label??``).filter(Boolean),customAnswer:typeof n?.customAnswer==`string`&&n.customAnswer?n.customAnswer:null,skipped:n?.skipped===!0}});let n=Array.isArray(t.selections)?t.selections:[],r=n.map(e=>h7(e)?.value??``).filter(Boolean),i=n.map(e=>h7(e)?.label??``).filter(Boolean),a=typeof t.customAnswer==`string`&&t.customAnswer?t.customAnswer:null;return r.length||i.length||a||t.skipped===!0?[{id:null,values:r,labels:i,customAnswer:a,skipped:t.skipped===!0}]:[]}function Soe({block:e,result:t,duration:n,isStreaming:r=!1,footer:i}){let{t:a}=I(),o=boe(e.input??{}),s=Coe(t),c=woe(t),l=c.text,u=c.isError,d=o.find(e=>e.question)?.question??null,f=d?o.length>1?`${a(`chat.aiQuestion`)} ${o.length}: ${d}`:d:l??a(`chat.aiQuestion`),p=h7(t?.details)?.cancelled===!0,m=s.flatMap(e=>[...e.labels,...e.customAnswer?[e.customAnswer]:[]]).join(` · `);return(0,F.jsx)(`div`,{style:{borderRadius:7,fontSize:`var(--text-base)`,...Toe(u)},children:(0,F.jsx)(o7,{isStreaming:r,footer:i,header:(e,{collapsed:t})=>(0,F.jsxs)(`div`,{...e,style:{...e.style,display:`flex`,alignItems:`center`,gap:7,padding:`6px 10px`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,minWidth:0},children:[(0,F.jsx)(`span`,{style:{color:u?`var(--status-error)`:`var(--status-info)`,fontFamily:`var(--font-mono)`,fontWeight:600,flexShrink:0},children:`pi_menu`}),t?(0,F.jsxs)(`span`,{style:{flex:1,minWidth:0,display:`flex`,alignItems:`baseline`,gap:6,overflow:`hidden`},children:[(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`var(--text)`},children:f}),m&&(0,F.jsx)(`span`,{style:{color:`var(--accent)`,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flexShrink:0,maxWidth:`55%`},children:`→ ${m}`})]}):(0,F.jsx)(`span`,{children:a(`chat.aiQuestion`)}),n!==void 0&&(0,F.jsxs)(`span`,{style:{marginLeft:`auto`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,fontVariantNumeric:`tabular-nums`,flexShrink:0},children:[n,`s`]})]}),body:()=>(0,F.jsxs)(`div`,{style:{padding:`8px 10px`,borderTop:`1px solid var(--border)`,fontSize:`var(--text-base)`,lineHeight:1.5,color:`var(--text-muted)`},children:[o.map((e,t)=>{let n=s.find(n=>n.id===(e.id??`#${t}`))??s[t]??null;return(0,F.jsxs)(`div`,{style:t>0?{marginTop:10}:void 0,children:[e.question&&(0,F.jsx)(`div`,{style:{fontWeight:600,color:`var(--text)`,marginBottom:6},children:e.question}),e.options.length>0&&(0,F.jsx)(Eoe,{options:e.options,chosenValues:n?.values??[]}),n?.customAnswer&&(0,F.jsx)(`div`,{style:{color:`var(--text)`,fontWeight:600,whiteSpace:`pre-wrap`},children:`${yoe}${n.customAnswer}`}),n?.skipped&&(0,F.jsx)(`div`,{style:{color:`var(--text-dim)`,fontWeight:600},children:a(`chat.skipped`)})]},e.id??t)}),p&&l&&(0,F.jsx)(`div`,{style:{color:`var(--text-dim)`,fontWeight:600,whiteSpace:`pre-wrap`},children:l}),o.length===0&&l&&(0,F.jsx)(`div`,{style:{color:u?`var(--status-error)`:`var(--text-muted)`,fontWeight:600,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:l})]})})})}function Coe(e){return e?xoe(e.details):[]}function woe(e){return{text:(e?e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
482
|
-
`).trim():null)||null,isError:e?.isError??!1}}function Toe(e){return{border:e?`1px solid color-mix(in srgb, var(--status-error) 45%, transparent)`:`1px solid var(--border)`,background
|
|
483
|
-
`)}function Ooe(e){return typeof e==`string`?[]:e.filter(e=>e.type===`image`)}function y7(e){let t=e;return e.source?e.source.type===`base64`?`data:${e.source.media_type};base64,${e.source.data}`:e.source.url??``:t.data?`data:${t.mimeType};base64,${t.data}`:``}function koe(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Aoe(e){return e||`extension`}function joe(e){return e<1?`${e.toFixed(1)}s`:`${Math.round(e)}s`}function Moe(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,140)}...`:t:`Show extension message`}function Noe(e){let t=e.input;if(!t||typeof t!=`object`)return``;let n=Object.keys(t);if(n.length===0)return``;if(`command`in t)return String(t.command).slice(0,120);if(`path`in t)return String(t.path).slice(0,120);if(`file_path`in t)return String(t.file_path).slice(0,120);if(`pattern`in t)return String(t.pattern).slice(0,120);if(`query`in t)return String(t.query).slice(0,120);let r=t[n[0]];if(Array.isArray(r)){let e=r.map(e=>typeof e==`object`&&e&&`topic`in e?String(e.topic):null).filter(e=>e!==null&&e.length>0);return e.length>0?e.join(` | `).slice(0,120):`[${r.length} items]`}return String(r).slice(0,120)}function Poe({block:e,isError:t,duration:n,lineStats:r}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:7,width:`100%`,padding:`6px 10px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`,minWidth:0},children:[(0,F.jsx)(Ir,{size:R.base,style:{flexShrink:0,color:t?`var(--status-error)`:`var(--status-info)`}}),(0,F.jsx)(`span`,{style:{color:t?`var(--status-error)`:`var(--status-info)`,fontFamily:`var(--font-mono)`,fontWeight:600,fontSize:`var(--text-sm)`,flexShrink:0},children:e.toolName}),(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,minWidth:0},children:Noe(e)}),r&&(r.additions>0||r.deletions>0)&&(0,F.jsxs)(`span`,{"data-testid":`tool-diff-stats`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`,fontVariantNumeric:`tabular-nums`},children:[r.additions>0&&(0,F.jsxs)(`span`,{style:{color:`var(--status-success)`},children:[`+`,r.additions]}),r.deletions>0&&(0,F.jsxs)(`span`,{style:{color:`var(--status-error)`},children:[`-`,r.deletions]})]}),n!==void 0&&(0,F.jsxs)(`span`,{"data-testid":`tool-duration`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontVariantNumeric:`tabular-nums`,color:`var(--text-dim)`},children:[(0,F.jsx)(Wn,{size:R.sm}),joe(n)]})]})})}function b7({block:e,result:t,duration:n,isStreaming:r=!1,keepExpanded:i=!1,streamingOutput:a,footer:o}){let s=a??e.streamingOutput,c=(0,d.useRef)(null),l=L5(c,r,[s]);if(e.toolName===`pi_menu`)return(0,F.jsx)(Soe,{block:e,result:t,duration:n,isStreaming:r,footer:o});let u=t?.isError??!1,f=t&&!t.isError?foe(t):null,p=f?doe(f.text):null,m=!!s;return(0,F.jsx)(`div`,{style:{borderRadius:7,fontSize:`var(--text-base)`,...Foe(u)},children:(0,F.jsx)(o7,{isStreaming:r||m,defaultExpanded:i,footer:o,header:t=>(0,F.jsx)(`div`,{...t,style:{...t.style,minWidth:0},children:(0,F.jsx)(Poe,{block:e,isError:u,duration:n,lineStats:p})}),body:()=>(0,F.jsx)(`div`,{style:{padding:`8px
|
|
484
|
-
`):null}function Loe(e){if(e===null)return!1;let t=e.trim();return t===`(no output)`||t===``}function Roe({input:e}){let{t}=I(),[n,r]=(0,d.useState)(!1),i=(0,d.useMemo)(()=>JSON.stringify(e,null,2),[e]),a=()=>{gK(i).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return(0,F.jsxs)(`div`,{onClick:a,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},"aria-label":t(`i18n.copyToolInput`),title:t(n?`i18n.copied`:`i18n.copyToolInput`),style:{position:`relative`,margin:`0 0 6px`,padding:`8px 10px`,background:`var(--bg-subtle)`,borderRadius:`var(--radius-md, 6px)`,color:`var(--text-muted)`,fontFamily:`var(--font-mono, monospace)`,fontSize:`var(--text-base)`,lineHeight:1.5,overflowWrap:`break-word`,whiteSpace:`pre-wrap`,cursor:`pointer`,userSelect:`none`},children:[n&&(0,F.jsxs)(`span`,{style:{position:`absolute`,top:4,right:8,color:`var(--accent)`,fontSize:`var(--text-sm)`,fontWeight:600,pointerEvents:`none`},children:[`✓ `,t(`i18n.copied`)]}),(0,F.jsx)(x7,{input:e})]})}function x7({input:e,depth:t=0}){return(0,F.jsx)(F.Fragment,{children:Object.entries(e).map(([e,n])=>(0,F.jsxs)(`div`,{style:{paddingLeft:t>0?12:0},children:[(0,F.jsx)(`span`,{style:{color:`var(--text)`,fontWeight:600},children:e}),`: `,(0,F.jsx)(S7,{value:n,depth:t})]},e))})}function S7({value:e,depth:t}){return e===null?(0,F.jsx)(`span`,{children:`null`}):typeof e==`string`?(0,F.jsx)(`span`,{children:e}):typeof e==`number`||typeof e==`boolean`?(0,F.jsx)(`span`,{children:String(e)}):Array.isArray(e)?e.length===0?(0,F.jsx)(`span`,{children:`[]`}):(0,F.jsx)(F.Fragment,{children:e.map((e,n)=>(0,F.jsxs)(`div`,{style:{paddingLeft:12},children:[(0,F.jsx)(`span`,{style:{color:`var(--text)`,fontWeight:600},children:`- `}),(0,F.jsx)(S7,{value:e,depth:t+1})]},n))}):typeof e==`object`?(0,F.jsx)(x7,{input:e,depth:t+1}):(0,F.jsx)(`span`,{children:String(e)})}function zoe({block:e,result:t,resultDiff:n,isError:r,liveOutput:i,streamScrollRef:a,onStreamScroll:o}){let s=poe(e.toolName),c=Ioe(t),l=Loe(c),u=(!s||r)&&e.input!==null&&typeof e.input==`object`;return(0,F.jsxs)(F.Fragment,{children:[u&&(0,F.jsx)(Roe,{input:e.input}),t&&(n?(0,F.jsx)(moe,{diff:n}):(0,F.jsx)(C7,{text:c??``,isEmpty:l,isError:r})),!t&&i!==void 0&&i!==``&&(0,F.jsx)(`div`,{"data-testid":`tool-stream-output`,children:(0,F.jsx)(C7,{text:i,isEmpty:!1,isError:!1,streamRef:a,onStreamScroll:o})})]})}function C7({text:e,isEmpty:t,isError:n,streamRef:r,onStreamScroll:i}){let{t:a}=I();return(0,F.jsx)(`div`,{style:{borderRadius:`var(--radius-md, 6px)`,overflow:`hidden`,border:n?`1px solid color-mix(in srgb, var(--status-error) 30%, transparent)`:`
|
|
485
|
-
`),S=[...m].reverse().find(({block:e})=>e.type===`text`)?.originalIndex,C=e.usage&&!t?(0,F.jsx)(I5,{usage:e.usage}):void 0,w=h.length>0&&e.usage&&!t?C:void 0;return h.length===0&&!t&&!g?null:(0,F.jsxs)(`div`,{className:`msg-row`,style:{marginBottom:16},children:[d&&(0,F.jsx)(zae,{message:e,modelNames:r,isStreaming:t,blocks:h,turnNumber:f,tps:b}),(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:m.map(({block:r,originalIndex:o})=>(0,F.jsx)(Goe,{block:r,usageFooter:w,toolResults:n,isStreaming:t,streamingDuration:y.get(o),toolCallDurations:v,cwd:i,onOpenFile:a,sessionId:c,entryId:l,blockIndex:o,recentExpandedBlockKeys:u,showCopy:o===S,copyText:x,usageNode:o===S?C:void 0,turnDurationSecs:r.type===`text`&&o===S&&p?_:void 0,timestamp:r.type===`text`&&o===S&&p?e.timestamp:void 0},`${l??`stream`}-${o}`))}),g&&(0,F.jsxs)(`div`,{role:`alert`,style:{marginTop:h.length>0?8:0,padding:`7px 10px`,border:`1px solid color-mix(in srgb, var(--status-error) 30%, transparent)`,borderRadius:6,background:`color-mix(in srgb, var(--status-error) 7%, transparent)`,color:`var(--status-error)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[`Error: `,g]}),(0,F.jsx)(Rae,{usage:e.usage,isStreaming:t,textContent:x,timestamp:o?e.timestamp:void 0,turnDurationSecs:_,showUsage:h.length===0,showTurnDuration:h.length===0})]})}function Goe({block:e,toolResults:t,isStreaming:n,streamingDuration:r,toolCallDurations:i,cwd:a,onOpenFile:o,sessionId:s,entryId:c,blockIndex:l,recentExpandedBlockKeys:u,usageFooter:d,showCopy:f,copyText:p,usageNode:m,turnDurationSecs:h,timestamp:g}){let _=!n&&c!==void 0&&(e.type===`thinking`||e.type===`toolCall`)&&u?.has(wt(e.type,c,e.type===`toolCall`?e.toolCallId:void 0,e.type===`thinking`?l:void 0))===!0;if(e.type===`text`)return(0,F.jsx)(Koe,{block:e,isStreaming:n,cwd:a,onOpenFile:o,showCopy:f,copyText:p,usageNode:m,turnDurationSecs:h,timestamp:g});if(e.type===`thinking`)return(0,F.jsx)(uoe,{block:e,sessionId:s,entryId:c,blockIndex:l,isStreaming:n,keepExpanded:_,footer:d});if(e.type===`toolCall`){let a=e,o=t?.get(`${c}:${a.toolCallId}`),s=a.durationSecs??i?.get(a.toolCallId)??r;return(0,F.jsx)(b7,{block:a,result:o,duration:s,isStreaming:n,keepExpanded:_,footer:d})}return null}function Koe({block:e,isStreaming:t,cwd:n,onOpenFile:r,showCopy:i,copyText:a,usageNode:o,turnDurationSecs:s,timestamp:c}){let l=i&&!t&&(a||o||s!==void 0||c!==void 0);return(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:6},children:(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,F.jsx)(O5,{isStreaming:t,cwd:n,onOpenFile:r,children:e.text}),l&&(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:2},children:[o,a&&(0,F.jsx)(Iae,{textContent:a}),s!==void 0&&(0,F.jsx)(Lae,{secs:s,timestamp:c,marginLeftAuto:!0})]})]})})}function qoe({message:e,sessionId:t,streamingOutput:n}){let[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(null),l=Joe(e),u=Yoe(e),f=Xoe(t,e),p=!!(e.truncated&&f)&&r===null,{block:m,result:h}=Zoe(e,{isPending:l,isError:u,displayOutput:r??e.output});async function g(){if(f){o(!0),c(null);try{let e=await(await fetch(f)).json();e.success?i(e.data?.output??``):c(e.error??`failed`)}catch(e){c(String(e))}finally{o(!1)}}}return(0,F.jsxs)(`div`,{style:{margin:`6px 0`},children:[(0,F.jsx)(b7,{block:m,result:h,streamingOutput:l?n:void 0}),e.truncated&&f&&(0,F.jsx)(Qoe,{showFullButton:p,loadingFull:a,fullError:s,fullOutputUrl:f,onLoadFull:g})]})}function Joe(e){return!e.output&&e.exitCode===void 0&&!e.cancelled}function Yoe(e){return e.cancelled||e.exitCode!==void 0&&e.exitCode!==0}function Xoe(e,t){return!e||!t.fullOutputPath?null:`/api/agent/${encodeURIComponent(e)}/bash-output?path=${encodeURIComponent(t.fullOutputPath)}`}function Zoe(e,t){let n=e.excludeFromContext?`bash (local)`:`bash`,r={type:`toolCall`,toolCallId:`bash-${e.timestamp??``}`,toolName:n,input:{command:e.command}};return{block:r,result:t.isPending?void 0:{role:`toolResult`,toolCallId:r.toolCallId,toolName:n,content:t.displayOutput?[{type:`text`,text:t.displayOutput}]:[],isError:t.isError,timestamp:e.timestamp}}}function Qoe({showFullButton:e,loadingFull:t,fullError:n,fullOutputUrl:r,onLoadFull:i}){return(0,F.jsxs)(`div`,{style:{padding:`4px 10px`,fontSize:`var(--text-sm)`,marginTop:-1},children:[e&&(0,F.jsx)(`button`,{onClick:i,disabled:t,style:{background:`none`,border:`none`,color:`var(--accent)`,cursor:t?`default`:`pointer`,fontSize:`var(--text-sm)`,padding:0,textDecoration:`underline`},children:t?`loading…`:`view full output`}),(0,F.jsx)(`a`,{href:`${r}&download=1`,style:{marginLeft:e?10:0,color:`var(--accent)`,fontSize:`var(--text-sm)`,textDecoration:`underline`},children:`download full output`}),n&&(0,F.jsxs)(`span`,{style:{marginLeft:6,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:[`(`,n,`)`]})]})}var $oe=/<(read-files|modified-files)>\s*([\s\S]*?)\s*<\/\1>/g,ese=/(?:\r?\n){2,}((?:[ \t]*<(?:read-files|modified-files)>[ \t]*\r?\n[\s\S]*?\r?\n[ \t]*<\/(?:read-files|modified-files)>[ \t]*(?:\r?\n)?)+)\s*$/;function tse(e){let t=[],n=[],r=e.match(ese),i=r?.[1]??``,a=r?.index===void 0?e:e.slice(0,r.index);return i.replace($oe,(e,r,i)=>{let a=i.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);return r===`read-files`?t.push(...a):n.push(...a),``}),{body:a.trim(),readFiles:t,modifiedFiles:n}}function nse({message:e}){let{t}=I(),n=v7(e.content),r=(0,d.useMemo)(()=>tse(n),[n]),i=_7(e.timestamp);return(0,F.jsx)(`div`,{style:{marginBottom:16},children:(0,F.jsxs)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:8,overflow:`hidden`,background:`var(--bg)`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderBottom:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`},children:[(0,F.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:650},children:`compaction`}),i&&(0,F.jsx)(`span`,{style:{marginLeft:`auto`,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:i})]}),(0,F.jsxs)(`div`,{style:{padding:`11px 13px 12px`},children:[(0,F.jsx)(`div`,{style:{color:`var(--text)`,fontSize:`var(--text-2xl)`,fontWeight:700,lineHeight:1.35},children:t(`i18n.conversationCompacted`)}),(0,F.jsx)(`div`,{style:{marginTop:3,marginBottom:10,color:`var(--text)`,fontSize:`var(--text-2xl)`,lineHeight:1.5},children:t(`i18n.compactionDescription`)}),r.body?(0,F.jsx)(O5,{className:`markdown-compaction-message`,children:r.body}):(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-base)`},children:t(`i18n.noSummary`)}),(0,F.jsx)(rse,{readFiles:r.readFiles,modifiedFiles:r.modifiedFiles})]})]})})}function rse({readFiles:e,modifiedFiles:t}){let{t:n}=I();if(e.length+t.length===0)return null;let r=[];return e.length>0&&r.push(`${e.length} read`),t.length>0&&r.push(`${t.length} modified`),(0,F.jsxs)(`details`,{className:`compaction-file-details`,children:[(0,F.jsx)(`summary`,{children:n(`i18n.fileContext`,{details:r.join(`, `)})}),t.length>0&&(0,F.jsx)(w7,{title:n(`i18n.modifiedFiles`),files:t}),e.length>0&&(0,F.jsx)(w7,{title:n(`i18n.readFiles`),files:e})]})}function w7({title:e,files:t}){return(0,F.jsxs)(`div`,{className:`compaction-file-section`,children:[(0,F.jsx)(`div`,{className:`compaction-file-title`,children:e}),(0,F.jsx)(`ul`,{className:`compaction-file-list`,children:t.map(e=>(0,F.jsx)(`li`,{children:e},e))})]})}function ise({message:e,cwd:t,onOpenFile:n}){let r=e.display===!1,[i,a]=(0,d.useState)(!r),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),u=v7(e.content),f=Ooe(e.content),p=e.details!==void 0,m=p?koe(e.details):``,h=Aoe(e.customType),g=_7(e.timestamp),_=p&&(r&&i||!r&&o);return(0,F.jsx)(`div`,{style:{marginBottom:16},children:(0,F.jsxs)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:8,overflow:`hidden`,background:r?`var(--bg-subtle)`:`var(--bg)`,opacity:ase(r,i)},children:[(0,F.jsx)(ose,{isHiddenDisplay:r,title:h,time:g}),i?(0,F.jsx)(sse,{text:u,images:f,cwd:t,onOpenFile:n}):(0,F.jsx)(cse,{text:u,onExpand:()=>a(!0)}),(0,F.jsx)(lse,{text:u,detailsText:m,isHiddenDisplay:r,hasDetails:p,contentExpanded:i,detailsExpanded:o,copied:c,onCopy:()=>{gK(u||m).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},onToggle:()=>{r?a(e=>!e):s(e=>!e)}}),_&&(0,F.jsx)(use,{detailsText:m})]})})}function ase(e,t){return e&&!t?.82:1}function ose({isHiddenDisplay:e,title:t,time:n}){let{t:r}=I();return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderBottom:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:650},children:t}),e&&(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:r(`i18n.hiddenExtensionMessage`)}),n&&(0,F.jsx)(`span`,{style:{marginLeft:`auto`,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:n})]})}function sse({text:e,images:t,cwd:n,onOpenFile:r}){let{t:i}=I();return(0,F.jsxs)(`div`,{style:{padding:`6px 9px`},children:[t.length>0&&(0,F.jsx)(`div`,{style:{display:`flex`,gap:6,flexWrap:`wrap`,marginBottom:e?8:0},children:t.map((e,t)=>{let n=y7(e);return n?(0,F.jsx)(`img`,{src:n,alt:``,style:{maxWidth:240,maxHeight:240,borderRadius:6,objectFit:`contain`,display:`block`,border:`1px solid var(--border)`}},t):null})}),e?(0,F.jsx)(O5,{className:`markdown-custom-message`,cwd:n,onOpenFile:r,children:e}):(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-base)`},children:i(`i18n.noMessage`)})]})}function cse({text:e,onExpand:t}){let{t:n}=I();return(0,F.jsx)(`button`,{onClick:t,style:{display:`block`,width:`100%`,padding:`8px 10px`,border:`none`,background:`transparent`,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-base)`,textAlign:`left`},children:e?Moe(e):n(`i18n.showExtensionMessage`)})}function lse({text:e,detailsText:t,isHiddenDisplay:n,hasDetails:r,contentExpanded:i,detailsExpanded:a,copied:o,onCopy:s,onToggle:c}){let{t:l}=I();return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`4px 9px`,borderTop:`1px solid var(--border)`,background:`var(--bg-subtle)`},children:[e||t?(0,F.jsx)(`button`,{onClick:s,style:{padding:`3px 7px`,border:`none`,background:`none`,color:o?`var(--accent)`:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`},children:l(o?`i18n.copied`:`i18n.copy`)}):null,(r||n)&&(0,F.jsx)(`button`,{onClick:c,style:{marginLeft:`auto`,padding:`3px 7px`,border:`none`,background:`none`,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`},children:l(n?i?`i18n.collapse`:`i18n.expand`:a?`i18n.hideDetails`:`i18n.showDetails`)})]})}function use({detailsText:e}){return(0,F.jsx)(`pre`,{style:{margin:0,padding:`9px 10px`,borderTop:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,wordBreak:`break-word`,maxHeight:360,overflow:`auto`,fontFamily:`var(--font-mono)`,contentVisibility:`auto`,containIntrinsicBlockSize:360},children:e})}function dse({message:e,entryId:t,onFork:n,forking:r,onNavigate:i,prevAssistantEntryId:a,onEditContent:o,turnNumber:s}){let[c,l]=(0,d.useState)(!1),{text:u,images:f}=fse(e),p=_7(e.timestamp),m=!!t&&!!n,h=!!a&&!!i;return(0,F.jsxs)(`div`,{className:`msg-row`,style:{marginBottom:16,display:`flex`,flexDirection:`column`,alignItems:`flex-end`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,maxWidth:`85%`},children:[s!==void 0&&(0,F.jsx)(D$,{number:s}),(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0,position:`relative`,background:`var(--user-bg)`,border:`1px solid color-mix(in srgb, var(--accent) 20%, transparent)`,borderRadius:12,padding:`8px 12px`,fontSize:`var(--text-2xl)`,fontFamily:`var(--font-mono)`,lineHeight:1.6,color:`var(--text)`,wordBreak:`break-word`},children:[f.length>0&&(0,F.jsx)(pse,{images:f,content:u}),u&&(0,F.jsx)(`div`,{"data-testid":`user-message`,style:{whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:u})]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:6,marginTop:3},children:[(0,F.jsx)(mse,{copied:c,canFork:m,canNavigate:h,forking:r,onCopy:()=>{gK(u).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},onEditFromHere:()=>{i(a),o?.(u)},onFork:()=>{n(t)}}),p&&(0,F.jsx)(`span`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`},children:p})]})]})}function fse(e){return typeof e.content==`string`?{text:e.content,images:[]}:{text:e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
480
|
+
|(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(e)}f5.displayName=`docker`,f5.aliases=[`dockerfile`];function f5(e){(function(e){var t=`(?:[ \\t]+(?![ \\t])(?:<SP_BS>)?|<SP_BS>)`.replace(/<SP_BS>/g,function(){return`\\\\[\\r\\n](?:\\s|\\\\[\\r\\n]|#.*(?!.))*(?![\\s#]|\\\\[\\r\\n])`}),n=`"(?:[^"\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*"|'(?:[^'\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*'`,r=`--[\\w-]+=(?:<STR>|(?!["'])(?:[^\\s\\\\]|\\\\.)+)`.replace(/<STR>/g,function(){return n}),i={pattern:RegExp(n),greedy:!0},a={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function o(e,n){return e=e.replace(/<OPT>/g,function(){return r}).replace(/<SP>/g,function(){return t}),RegExp(e,n)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:o(`(^(?:ONBUILD<SP>)?\\w+<SP>)<OPT>(?:<SP><OPT>)*`,`i`),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[i,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:o(`(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\\b`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \\t\\\\]+<SP>)AS`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^ONBUILD<SP>)\\w+`,`i`),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:a,string:i,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:a},e.languages.dockerfile=e.languages.docker})(e)}p5.displayName=`go`,p5.aliases=[];function p5(e){e.register(n5),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}m5.displayName=`scss`,m5.aliases=[];function m5(e){e.register(t5),e.languages.scss=e.languages.extend(`css`,{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:`important`},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore(`scss`,`atrule`,{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore(`scss`,`important`,{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore(`scss`,`function`,{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:`keyword`},placeholder:{pattern:/%[-\w]+/,alias:`selector`},statement:{pattern:/\B!(?:default|optional)\b/i,alias:`keyword`},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}h5.displayName=`json`,h5.aliases=[`webmanifest`];function h5(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}g5.displayName=`java`,g5.aliases=[];function g5(e){e.register(n5),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}_5.displayName=`typescript`,_5.aliases=[`ts`];function _5(e){e.register(r5),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}v5.displayName=`python`,v5.aliases=[`py`];function v5(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}y5.displayName=`jsx`,y5.aliases=[];function y5(e){e.register(r5),e.register(e5),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){(e.language===`jsx`||e.language===`tsx`)&&s(e.tokens)})})(e)}b5.displayName=`tsx`,b5.aliases=[];function b5(e){e.register(y5),e.register(_5),(function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`];var n=e.languages.tsx.tag;n.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+n.pattern.source+`)`,n.pattern.flags),n.lookbehind=!0})(e)}x5.displayName=`rust`,x5.aliases=[];function x5(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}var lae=s5,uae=a5,dae=o5,fae=u5,pae=t5,mae=d5,hae=f5,gae=p5,_ae=g5,vae=r5,yae=h5,bae=y5,xae=l5,Sae=e5,Cae=v5,wae=x5,Tae=m5,Eae=i5,Dae=b5,Oae=_5,kae=c5,S5={'code[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,border:`1px solid #dddddd`,backgroundColor:`white`},'pre > code[class*="language-"]':{fontSize:`1em`},'pre[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"]::selection':{background:`#C1DEF1`},'pre[class*="language-"] ::selection':{background:`#C1DEF1`},'code[class*="language-"]::selection':{background:`#C1DEF1`},'code[class*="language-"] ::selection':{background:`#C1DEF1`},':not(pre) > code[class*="language-"]':{padding:`.2em`,paddingTop:`1px`,paddingBottom:`1px`,background:`#f8f8f8`,border:`1px solid #dddddd`},comment:{color:`#008000`,fontStyle:`italic`},prolog:{color:`#008000`,fontStyle:`italic`},doctype:{color:`#008000`,fontStyle:`italic`},cdata:{color:`#008000`,fontStyle:`italic`},namespace:{Opacity:`.7`},string:{color:`#A31515`},punctuation:{color:`#393A34`},operator:{color:`#393A34`},url:{color:`#36acaa`},symbol:{color:`#36acaa`},number:{color:`#36acaa`},boolean:{color:`#36acaa`},variable:{color:`#36acaa`},constant:{color:`#36acaa`},inserted:{color:`#36acaa`},atrule:{color:`#0000ff`},keyword:{color:`#0000ff`},"attr-value":{color:`#0000ff`},".language-autohotkey .token.selector":{color:`#0000ff`},".language-json .token.boolean":{color:`#0000ff`},".language-json .token.number":{color:`#0000ff`},'code[class*="language-css"]':{color:`#0000ff`},function:{color:`#393A34`},deleted:{color:`#9a050f`},".language-autohotkey .token.tag":{color:`#9a050f`},selector:{color:`#800000`},".language-autohotkey .token.keyword":{color:`#00009f`},important:{color:`#e90`,fontWeight:`bold`},bold:{fontWeight:`bold`},italic:{fontStyle:`italic`},"class-name":{color:`#2B91AF`},".language-json .token.property":{color:`#2B91AF`},tag:{color:`#800000`},"attr-name":{color:`#ff0000`},property:{color:`#ff0000`},regex:{color:`#ff0000`},entity:{color:`#ff0000`},"directive.tag.tag":{background:`#ffff00`,color:`#393A34`},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:`#a5a5a5`},".line-numbers .line-numbers-rows > span:before":{color:`#2B91AF`},".line-highlight.line-highlight":{background:`linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0))`}},C5={'pre[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,background:`#1e1e1e`},'code[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'pre[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},':not(pre) > code[class*="language-"]':{padding:`.1em .3em`,borderRadius:`.3em`,color:`#db4c69`,background:`#1e1e1e`},".namespace":{Opacity:`.7`},"doctype.doctype-tag":{color:`#569CD6`},"doctype.name":{color:`#9cdcfe`},comment:{color:`#6a9955`},prolog:{color:`#6a9955`},punctuation:{color:`#d4d4d4`},".language-html .language-css .token.punctuation":{color:`#d4d4d4`},".language-html .language-javascript .token.punctuation":{color:`#d4d4d4`},property:{color:`#9cdcfe`},tag:{color:`#569cd6`},boolean:{color:`#569cd6`},number:{color:`#b5cea8`},constant:{color:`#9cdcfe`},symbol:{color:`#b5cea8`},inserted:{color:`#b5cea8`},unit:{color:`#b5cea8`},selector:{color:`#d7ba7d`},"attr-name":{color:`#9cdcfe`},string:{color:`#ce9178`},char:{color:`#ce9178`},builtin:{color:`#ce9178`},deleted:{color:`#ce9178`},".language-css .token.string.url":{textDecoration:`underline`},operator:{color:`#d4d4d4`},entity:{color:`#569cd6`},"operator.arrow":{color:`#569CD6`},atrule:{color:`#ce9178`},"atrule.rule":{color:`#c586c0`},"atrule.url":{color:`#9cdcfe`},"atrule.url.function":{color:`#dcdcaa`},"atrule.url.punctuation":{color:`#d4d4d4`},keyword:{color:`#569CD6`},"keyword.module":{color:`#c586c0`},"keyword.control-flow":{color:`#c586c0`},function:{color:`#dcdcaa`},"function.maybe-class-name":{color:`#dcdcaa`},regex:{color:`#d16969`},important:{color:`#569cd6`},italic:{fontStyle:`italic`},"class-name":{color:`#4ec9b0`},"maybe-class-name":{color:`#4ec9b0`},console:{color:`#9cdcfe`},parameter:{color:`#9cdcfe`},interpolation:{color:`#9cdcfe`},"punctuation.interpolation-punctuation":{color:`#569cd6`},variable:{color:`#9cdcfe`},"imports.maybe-class-name":{color:`#9cdcfe`},"exports.maybe-class-name":{color:`#9cdcfe`},escape:{color:`#d7ba7d`},"tag.punctuation":{color:`#808080`},cdata:{color:`#808080`},"attr-value":{color:`#ce9178`},"attr-value.punctuation":{color:`#ce9178`},"attr-value.punctuation.attr-equals":{color:`#d4d4d4`},namespace:{color:`#4ec9b0`},'pre[class*="language-javascript"]':{color:`#9cdcfe`},'code[class*="language-javascript"]':{color:`#9cdcfe`},'pre[class*="language-jsx"]':{color:`#9cdcfe`},'code[class*="language-jsx"]':{color:`#9cdcfe`},'pre[class*="language-typescript"]':{color:`#9cdcfe`},'code[class*="language-typescript"]':{color:`#9cdcfe`},'pre[class*="language-tsx"]':{color:`#9cdcfe`},'code[class*="language-tsx"]':{color:`#9cdcfe`},'pre[class*="language-css"]':{color:`#ce9178`},'code[class*="language-css"]':{color:`#ce9178`},'pre[class*="language-html"]':{color:`#d4d4d4`},'code[class*="language-html"]':{color:`#d4d4d4`},".language-regex .token.anchor":{color:`#dcdcaa`},".language-html .token.punctuation":{color:`#808080`},'pre[class*="language-"] > code[class*="language-"]':{position:`relative`,zIndex:`1`},".line-highlight.line-highlight":{background:`#f7ebc6`,boxShadow:`inset 5px 0 0 #f7d87c`,zIndex:`0`}},Aae={bash:lae,c:uae,cpp:dae,csharp:fae,css:pae,diff:mae,docker:hae,go:gae,java:_ae,javascript:vae,json:yae,jsx:bae,markdown:xae,markup:Sae,python:Cae,rust:wae,scss:Tae,sql:Eae,tsx:Dae,typescript:Oae,yaml:kae};for(let[e,t]of Object.entries(Aae))$8.registerLanguage(e,t);var jae=5e3,Mae=800;function w5({code:e,lang:t,headerAction:n,isStreaming:r}){let{isDark:i}=WK(),{t:a}=I(),[o,s]=(0,d.useState)(!1),c=()=>{gK(e).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},l=e.length>jae||r===!0&&e.length>Mae;return(0,F.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,F.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,F.jsx)(`span`,{className:`markdown-code-lang`,children:t||`text`}),(0,F.jsxs)(`div`,{className:`markdown-code-actions`,children:[n,(0,F.jsx)(`button`,{onClick:c,className:`markdown-code-action`,children:a(o?`i18n.copied`:`i18n.copy`)})]})]}),l?(0,F.jsx)(`pre`,{className:`markdown-code-plain`,style:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`,overflow:`auto`},children:(0,F.jsx)(`code`,{style:{fontFamily:`var(--font-mono)`},children:e})}):(0,F.jsx)($8,{language:t||`text`,style:i?C5:S5,showLineNumbers:!0,lineNumberStyle:{color:`var(--text-dim)`,fontStyle:`normal`},customStyle:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`},codeTagProps:{style:{fontFamily:`var(--font-mono)`}},children:e})]})}var T5=.25,E5=.5;function Nae({svg:e,onClose:t}){let{t:n}=I(),r=(0,d.useRef)(null),[i,a]=(0,d.useState)(1);return(0,d.useEffect)(()=>{let e=r.current;if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,e.showModal(),()=>{document.body.style.overflow=t,e.open&&e.close()}},[]),(0,F.jsx)(`dialog`,{ref:r,className:`mermaid-zoom-dialog`,"aria-label":n(`i18n.mermaidViewer`),onCancel:e=>{e.preventDefault(),t()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),t())},children:(0,F.jsxs)(`div`,{className:`mermaid-zoom-layout`,children:[(0,F.jsxs)(`div`,{className:`mermaid-zoom-toolbar`,children:[(0,F.jsx)(`span`,{className:`mermaid-zoom-title`,children:n(`i18n.mermaidDiagram`)}),(0,F.jsxs)(`div`,{className:`mermaid-zoom-actions`,children:[(0,F.jsxs)(`div`,{className:`mermaid-zoom-stepper`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.max(E5,e-T5)),disabled:i<=E5,title:n(`i18n.zoomOut`),"aria-label":n(`i18n.zoomOut`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M5 12h14`})})}),(0,F.jsxs)(`span`,{className:`mermaid-zoom-value`,children:[Math.round(i*100),`%`]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.min(3,e+T5)),disabled:i>=3,title:n(`i18n.zoomIn`),"aria-label":n(`i18n.zoomIn`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M12 5v14M5 12h14`})})})]}),(0,F.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:()=>a(1),title:n(`i18n.fitToWidth`),"aria-label":n(`i18n.fitToWidth`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5`})})}),(0,F.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:t,title:n(`i18n.close`),"aria-label":n(`i18n.close`),children:(0,F.jsx)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})})]})]}),(0,F.jsx)(`div`,{className:`mermaid-zoom-viewport`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,F.jsx)(`div`,{className:`mermaid-zoom-canvas`,style:{width:`${i*100}%`},dangerouslySetInnerHTML:{__html:e}})})]})})}function Pae({renderState:e,currentKey:t,t:n,zoomOpen:r,setZoomOpen:i}){return e?.key===t&&e.status===`error`?(0,F.jsx)(`div`,{className:`mermaid-block mermaid-block-error`,children:n(`i18n.invalidMermaid`)}):e?.key!==t||e.status!==`ready`?(0,F.jsx)(`div`,{className:`mermaid-block mermaid-block-loading`,"aria-label":n(`i18n.renderingMermaid`)}):(0,F.jsxs)(F.Fragment,{children:[!r&&(0,F.jsx)(`button`,{type:`button`,className:`mermaid-block mermaid-preview-button`,title:n(`i18n.openMermaidViewer`),"aria-label":n(`i18n.openMermaidViewer`),onClick:()=>i(!0),dangerouslySetInnerHTML:{__html:e.svg}}),r&&(0,F.jsx)(Nae,{svg:e.svg,onClose:()=>i(!1)})]})}function D5({code:e,isStreaming:t,defaultPreview:n=!1}){let{isDark:r}=WK(),{t:i}=I(),[a,o]=(0,d.useState)(n),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(!1),f=`${r?`dark`:`light`}\n${e}`,p=a&&!t;(0,d.useEffect)(()=>{if(!p)return;let t=!1;return c({key:f,status:`loading`}),(async()=>{let{default:n}=await p4(async()=>{let{default:e}=await import(`./mermaid.core-ClvptCwB.js`);return{default:e}},__vite__mapDeps([2,3,4,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(n.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,theme:r?`dark`:`default`}),!await n.parse(e,{suppressErrors:!0}))throw Error(`Invalid Mermaid diagram`);let i=typeof crypto<`u`&&`randomUUID`in crypto?`mermaid-${crypto.randomUUID()}`:`mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}`,a=await n.render(i,e);t||c({key:f,status:`ready`,svg:a.svg})})().catch(()=>{t||c({key:f,status:`error`})}),()=>{t=!0}},[e,f,r,p]);let m=(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),disabled:t,title:i(t?`i18n.previewAfterStreaming`:p?`i18n.showMermaidSource`:`i18n.previewMermaid`),className:[`markdown-code-action`,p?`is-active`:``].filter(Boolean).join(` `),children:i(p?`i18n.source`:`i18n.preview`)});return p?(0,F.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,F.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,F.jsx)(`span`,{className:`markdown-code-lang`,children:`mermaid`}),m]}),(0,F.jsx)(Pae,{renderState:s,currentKey:f,t:i,zoomOpen:l,setZoomOpen:u})]}):(0,F.jsx)(w5,{code:e,lang:`mermaid`,headerAction:m})}function O5({children:e,className:t,isStreaming:n,cwd:r,onOpenFile:i}){let{t:a}=I(),[o,s]=(0,d.useState)(!1),c=!o&&e.length>1e5,l=(0,d.useMemo)(()=>c?xie(e):e,[c,e]),u=(0,d.useMemo)(()=>RU(l),[l]),f=(0,d.useMemo)(()=>({code({className:e,children:t,...r}){let i=e?.replace(`language-`,``).toLowerCase()??``,a=String(t);return e?.includes(`language-`)||a.includes(`
|
|
481
|
+
`)?i===`mermaid`?(0,F.jsx)(D5,{code:a.replace(/\n$/,``),isStreaming:n}):(0,F.jsx)(w5,{code:a.replace(/\n$/,``),lang:i,isStreaming:n}):(0,F.jsx)(`code`,{className:`markdown-inline-code`,...r,children:t})},pre({children:e}){return(0,F.jsx)(F.Fragment,{children:e})},a({href:e,children:t,...n}){delete n.node;let a=i?rW(e,r):null,o=i;if(!a||!o)return(0,F.jsx)(`a`,{href:e,...n,target:`_blank`,rel:`noopener noreferrer`,children:t});let s=e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.currentTarget.getAttribute(`target`);t&&t!==`_self`||(e.preventDefault(),o(a))};return(0,F.jsx)(`a`,{href:e,...n,onClick:s,children:t})},img({src:e,alt:t,...n}){delete n.node;let i=typeof e==`string`?rW(e,r):null,a=i?`/api/files/${dS(i)}?type=read`:e;return(0,F.jsx)(`img`,{src:a,alt:t??``,loading:`lazy`,...n})},table({children:e}){return(0,F.jsx)(`div`,{className:`markdown-table-wrap`,children:(0,F.jsx)(`table`,{children:e})})},blockquote({children:e}){return(0,F.jsx)(`blockquote`,{children:e})}}),[r,n,i]);return(0,F.jsxs)(`div`,{className:[`markdown-body`,t].filter(Boolean).join(` `),style:{whiteSpace:`pre-wrap`},children:[(0,F.jsx)(x8,{remarkPlugins:WU??void 0,rehypePlugins:KU??void 0,components:f,children:u}),c&&(0,F.jsxs)(`button`,{type:`button`,"aria-label":a(`chat.expandMessage`),title:a(`chat.expandMessage`),onClick:()=>s(!0),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:6,width:`100%`,marginTop:6,padding:`5px 0`,border:`none`,borderTop:`1px solid var(--border)`,background:`var(--bg-subtle)`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`…`}),(0,F.jsx)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]})]})}var k5={display:`flex`,alignItems:`center`,gap:4},A5={display:`flex`,alignItems:`center`,color:`var(--text)`,fontWeight:500},j5={width:R.base,height:R.base,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`};function M5(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e)}function N5(e){return e<=0?null:e>=.01?`$${e.toFixed(2)}`:`<$0.01`}function P5({svg:e,value:t,badge:n}){return(0,F.jsxs)(`span`,{style:k5,children:[e,t,n]})}var F5=[{key:`input`,color:`var(--accent)`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`line`,{x1:`5`,y1:`8.5`,x2:`5`,y2:`1.5`}),(0,F.jsx)(`polyline`,{points:`2 4 5 1.5 8 4`})]})},{key:`output`,color:`var(--status-info)`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`line`,{x1:`5`,y1:`1.5`,x2:`5`,y2:`8.5`}),(0,F.jsx)(`polyline`,{points:`2 6 5 8.5 8 6`})]})},{key:`cacheRead`,color:`var(--status-success)`,rateHint:`session.cacheReadRate`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`path`,{d:`M8.5 5a3.5 3.5 0 1 1-1-2.45`}),(0,F.jsx)(`polyline`,{points:`6.5 1.5 8.5 2.5 7.5 4.5`})]})},{key:`cacheWrite`,color:`var(--status-warning)`,svg:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`path`,{d:`M8.5 5a3.5 3.5 0 1 0-1-2.45`}),(0,F.jsx)(`polyline`,{points:`2.5 1.5 4.5 2.5 3.5 4.5`})]})}];function Fae(e,t,n){let r=[],i=(e,n)=>{n>0&&r.push(`${e}: ${n.toLocaleString(t)}`)};return i(n(`session.input`),e.input),i(n(`session.output`),e.output),i(n(`session.cacheRead`),e.cacheRead),i(n(`session.cacheWrite`),e.cacheWrite),e.cost?.total>0&&r.push(`${n(`session.cost`)}: $${e.cost.total.toFixed(4)}`),r.join(` · `)}function I5({usage:e}){let{t,locale:n}=I();return(0,F.jsx)(L,{label:Fae(e,n,t),children:(0,F.jsxs)(`div`,{"data-testid":`message-usage-stats`,style:{display:`flex`,alignItems:`center`,gap:10,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,fontVariantNumeric:`tabular-nums`},children:[F5.map(t=>{let n=e[t.key];return n<=0?null:(0,F.jsx)(P5,{svg:(0,F.jsx)(`svg`,{...j5,style:{color:t.color},children:t.svg}),value:M5(n)},t.key)}),e.cost?.total>0&&(0,F.jsx)(`span`,{style:A5,children:N5(e.cost.total)})]})})}function Iae({textContent:e}){let{t}=I(),[n,r]=(0,d.useState)(!1);return(0,F.jsxs)(`button`,{onClick:()=>{gK(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},title:t(`i18n.copyMessage`),"aria-label":t(`i18n.copyMessage`),style:{display:`inline-flex`,alignItems:`center`,gap:4,padding:`2px 8px`,height:22,flexShrink:0,background:`none`,border:`none`,borderRadius:5,color:n?`var(--accent)`:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`},children:[n?(0,F.jsx)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:R.lg,height:R.lg,rx:`2`,ry:`2`}),(0,F.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),t(n?`i18n.copied`:`i18n.copy`)]})}function Lae({secs:e,timestamp:t,marginLeftAuto:n=!1}){let r=(0,F.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:4,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginLeft:n?`auto`:void 0,fontVariantNumeric:`tabular-nums`},children:[(0,F.jsx)(Wn,{size:R.sm}),e!==void 0&&sZ(e)]});return t===void 0?r:(0,F.jsx)(L,{wrapperStyle:n?{marginLeft:`auto`}:void 0,label:new Date(t).toLocaleString([],{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),children:r})}function Rae({usage:e,isStreaming:t,textContent:n,timestamp:r,turnDurationSecs:i,showUsage:a=!0,showTurnDuration:o=!0}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[e&&a&&!t&&(0,F.jsx)(I5,{usage:e}),r&&!t&&o&&(0,F.jsx)(L,{label:new Date(r).toLocaleString([],{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),children:(0,F.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:4,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginLeft:`auto`,fontVariantNumeric:`tabular-nums`},children:[(0,F.jsx)(Wn,{size:R.sm}),o&&i!==void 0&&(0,F.jsx)(F.Fragment,{children:sZ(i)})]})})]})})}function zae({message:e,modelNames:t,isStreaming:n,blocks:r,turnNumber:i,tps:a}){let{t:o}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,marginBottom:4,display:`flex`,alignItems:`center`,gap:6},children:[i!==void 0&&(0,F.jsx)(D$,{number:i}),e.provider&&(0,F.jsxs)(`span`,{title:`${e.provider}/${e.model}`,style:{whiteSpace:`nowrap`},children:[(0,F.jsxs)(`span`,{style:{color:`var(--text-dim)`},children:[e.provider,`/`]}),(0,F.jsx)(`span`,{style:{color:`var(--text)`,fontWeight:700},children:t?.[`${e.provider}/${e.model}`]??t?.[e.model]??e.model})]}),n&&(()=>{let e=0;for(let t of r)t.type===`text`?e+=t.text?.length??0:t.type===`thinking`?e+=t.thinking?.length??0:t.type===`toolCall`&&(e+=JSON.stringify(t.input??{}).length);let t=Math.round(e/4);return(0,F.jsx)(F.Fragment,{children:t>0&&(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,color:`var(--text)`},title:o(`i18n.estimatedTokens`),children:[(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:2,fontSize:`var(--text-sm)`,fontWeight:400},children:[(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`line`,{x1:`5`,y1:`1.5`,x2:`5`,y2:`8.5`}),(0,F.jsx)(`polyline`,{points:`2 6 5 8.5 8 6`})]}),t]}),a!==null&&(0,F.jsxs)(`span`,{style:{marginLeft:6,padding:`1px 6px`,borderRadius:4,background:a>=50?`#53b3cb`:a>=30?`#9bc53d`:a>=15?`#f9c22e`:`#e01a4f`,color:`#fff`,fontSize:`var(--text-sm)`,fontWeight:400},children:[a.toFixed(1),` t/s`]})]})})})()]})})}var Bae=50,Vae=400;function L5(e,t,n){let r=(0,d.useRef)(!1),i=(0,d.useRef)(0),a=()=>{i.current=Date.now()};return(0,d.useLayoutEffect)(()=>{let n=e.current;if(!t||!n||r.current)return;let i=0,a=()=>{if(r.current)return;let e=n.scrollHeight,t=n.clientHeight;n.scrollTop!==e-t&&(n.scrollTop=e-t),typeof requestAnimationFrame==`function`&&(i=requestAnimationFrame(()=>{n.scrollHeight!==e&&a()}))};return a(),()=>cancelAnimationFrame(i)},[t,...n]),(0,d.useLayoutEffect)(()=>{let t=e.current;if(t)return t.addEventListener(`wheel`,a,{passive:!0}),t.addEventListener(`touchstart`,a,{passive:!0}),t.addEventListener(`touchmove`,a,{passive:!0}),t.addEventListener(`keydown`,a),t.addEventListener(`pointerdown`,a),()=>{t.removeEventListener(`wheel`,a),t.removeEventListener(`touchstart`,a),t.removeEventListener(`touchmove`,a),t.removeEventListener(`keydown`,a),t.removeEventListener(`pointerdown`,a)}},[e]),()=>{let t=e.current;if(!t)return;let n=t.scrollHeight-t.scrollTop-t.clientHeight>Bae;n&&Date.now()-i.current<=Vae?r.current=!0:n||(r.current=!1)}}var{min:R5,max:z5,abs:B5,floor:Hae}=Math,V5=(e,t,n)=>R5(n,z5(t,e)),H5=e=>[...e].sort((e,t)=>e-t),U5=setTimeout,W5=clearTimeout,G5=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)},K5=()=>{let e;return[new Promise(t=>{e=t}),e]},q5=e=>{let t;return()=>(e&&=(t=e(),void 0),t)},Uae=typeof window<`u`,Wae=e=>e.documentElement,Gae=e=>e.ownerDocument,Kae=e=>e.defaultView,J5=q5(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>0),qae=q5(()=>`scrollBehavior`in Wae(document).style),Jae=e=>z5(e.t(),e.o()),Yae=({i:e,l:t,u:n,h:r,v:i,S:a,t:o,$:s,m:c,p:l},u=0)=>{let d=!!l,f=!!u,p=1,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=null,C=[0,f?z5(u-1,0):-1],w=0,T=!1,E=new Set,D=()=>g-h,O=()=>D()+v+_,k=(e,t)=>{let i=n(e)-v;return t?o()-i-r(e):i},A=e=>{e&&(J5()&&b!==0||S&&x===1?v+=e:_+=e)};return{_:()=>{E.clear()},I:()=>p,i:(t=200)=>{if(!T||f)return C;let n,r;if(y)[n,r]=C;else{let i=z5(0,O()),a=i+m;d||(t=z5(0,t),b!==1&&(i-=t),b!==2&&(a+=t)),[n,r]=C=e(z5(0,i),z5(0,a)),S&&(n=R5(n,S[0]),r=z5(r,S[1]))}return[z5(n,0),R5(r,s()-1)]},k:e=>t(e-h),R:a,u:k,h:r,C:s,T:()=>g,M:()=>b!==0,o:()=>m,O:()=>h,t:o,L:()=>(y=_,_=0,[y,x===2]),H:(e,t)=>{let n=[e,t];return E.add(n),()=>{E.delete(n)}},W:(n,s)=>{let u,C,j=0;switch(n){case 1:{if(s===g&&x===0)break;let e=y;y=0;let t=s-g,n=B5(t);e&&n<B5(e)+1||x!==0||(b=t<0?2:1),f&&=!1,g=s,j=4;let r=D();r>=-m&&r<=o()&&(j+=1,C=n>m);break}case 2:j=8,b!==0&&(u=!0,j+=1),b=0,x=0,S=null;break;case 3:{let e=s.filter(([e,t])=>!a(e,t));if(!e.length)break;A(e.reduce((e,[t,n])=>{let i;if(x===2)i=!0;else if(S&&x===1)i=t<S[0];else{let e=D(),n=k(t),a=r(t);i=b!==1&&x===0?n+a<=e:n<e&&n+a<e+m}return i&&(e+=n-r(t)),e},0));for(let[t,n]of e){let e=r(t),a=i(t,n);d&&(w+=a?n:n-e)}d&&m&&w>m&&(A(l(t(O()))),d=!1),j=3,C=!0;break}case 4:m!==s&&(m||(T=C=!0),m=s,j=3);break;case 5:s[1]?(A(c(s[0],!0)),x=2,j=1):(c(s[0]),j=1);break;case 6:h=s;break;case 7:x=1;break;case 8:S=e(s,s+m),j=1}j&&(p=1+(2147483647&p),u&&v&&(_+=v,v=0),E.forEach(([e,t])=>{j&e&&t(C)}))}}},Y5=(e,t,n,r=0,i=t-1)=>{let a=r;for(;r<=i;){let t=Hae((r+i)/2);e(t)<=n?(a=t,r=t+1):i=t-1}return V5(a,0,t-1)},X5=(e,t,n)=>{let r=n?`unshift`:`push`;for(let n=0;n<t;n++)e[r](-1);return e},Xae=(e,t,n)=>{let r=n&&n[1]||t||40,i=-1,a=0,o=n&&n[0],s=o?X5(o.slice(0,R5(e,o.length)),z5(0,e-o.length)):X5([],e),c=X5([],e+1),l=e=>{let t=s[e];return t===-1?r:t},u=t=>{if(!e)return 0;if(i>=t)return c[t];i<0&&(c[0]=0,i=0);let n=i,r=c[n];for(;n<t;)r+=l(n),c[++n]=r;return i=t,r};return{i:(t,n)=>{let r,i;return a=R5(a,e-1),u(a)<=t?(i=Y5(u,e,n,a),r=Y5(u,e,t,a,i)):(r=Y5(u,e,t,void 0,a),i=Y5(u,e,n,r)),a=r,[r,i]},l:t=>Y5(u,e,t),u,h:l,v:(e,t)=>{let n=s[e]===-1;return s[e]=t,i=R5(e,i),n},S:(e,t=-1)=>s[e]===t,t:()=>u(e),$:()=>e,m:(t,n)=>{let a=t-e;return i=n?-1:R5(t-1,i),e=t,a>0?(X5(c,a),X5(s,a,n),r*a):(c.splice(a),(n?s.splice(0,-a):s.splice(a)).reduce((e,t)=>e-(t===-1?r:t),0))},p:t?void 0:e=>{let t=0,n=[];s.forEach((r,i)=>{r!==-1&&(r&&n.push(r),i<e&&t++)}),i=-1;let a=H5(n),o=a.length,c=o/2|0,l=o%2==0?(a[c-1]+a[c])/2:a[c],u=r;return((r=l)-u)*z5(e-t,0)},B:()=>[s.slice(),r]}},Zae=e=>{let t;return{X(n){(t||=new(Kae(Gae(n))).ResizeObserver(e)).observe(n)},Y(e){t.unobserve(e)},q(){t&&t.disconnect()}}},Z5=(e,t)=>t?-e:e,Qae=(e,t,n,r,i,a)=>{let o,s=0,c=!1,l=!1,u=!1,d=!1,f=Date.now,p=()=>{if(c||l)return c=!1,void m();u=!1,e.W(2)},m=()=>{W5(o),o=U5(p,150)},h=()=>{s=f(),u&&(d=!0),a&&e.W(6,a()),e.W(1,r()),m()},g=t=>{if(c||!e.M()||t.ctrlKey)return;let r=f()-s;150>r&&50<r&&(n?t.deltaX:t.deltaY)&&(c=!0)},_=()=>{l=!0,u=d=!1},v=()=>{l=!1,J5()&&(u=!0)};return t.addEventListener(`scroll`,h),t.addEventListener(`wheel`,g,{passive:!0}),t.addEventListener(`touchstart`,_,{passive:!0}),t.addEventListener(`touchend`,v,{passive:!0}),{q:()=>{t.removeEventListener(`scroll`,h),t.removeEventListener(`wheel`,g),t.removeEventListener(`touchstart`,_),t.removeEventListener(`touchend`,v),W5(o)},A:()=>{let[t,n]=e.L();t&&(i(t,n,d),d=!1,n&&e.o()>e.t()&&e.W(1,r()))}}},$ae=(e,t,n)=>{let r;return[async(i,a)=>{if(!await t())return;let o,s,c;r&&r();let l=a&&qae(),u=r=()=>{o=!0,W5(s),c&&c()},d=()=>{if(!o){if(e.o()&&(W5(s),s=U5(u,150)),l){for(let[t,n]=e.i(0);t<=n;t++)if(e.R(t))return;u()}e.W(7),n(i(),l)}},f=()=>{if(o)return;let t;c=e.H(2,()=>{t||(t=!0,G5(()=>{t=!1,d()}))}),d()};l?(e.W(8,i()),G5(f)):f()},()=>{r&&r()}]},eoe=(e,t)=>{let n,r,i=K5(),a=!1,o=t?`scrollLeft`:`scrollTop`,s=t?`overflowX`:`overflowY`,[c,l]=$ae(e,()=>i[0],(e,r)=>{e=Z5(e,a),r?n.scrollTo({[t?`left`:`top`]:e,behavior:`smooth`}):n[o]=e}),u=t?`width`:`height`,d=new WeakMap,f=Zae(t=>{let r=[];for(let{target:i,contentRect:a}of t)if(i.offsetParent){if(i===n)e.W(4,a[u]);else{let e=d.get(i);e!=null&&r.push([e,a[u]])}}r.length&&e.W(3,r)});return{D(c,u=c.parentElement){f.X(n=u),t&&(a=getComputedStyle(u).direction===`rtl`),r=Qae(e,u,t,()=>Z5(u[o],a),(t,n,r)=>{if(r){let e=u.style,t=e[s];e[s]=`hidden`,U5(()=>{e[s]=t})}u[o]=Z5(e.T()+t,a),n&&l()}),i[1](!0)},_(){f.q(),r&&r.q(),i[1](!1),i=K5()},N:(e,t)=>(d.set(e,t),f.X(e),()=>{d.delete(e),f.Y(e)}),P:()=>a,V:c,J(){r&&r.A()},j:e.O,G:()=>0}},Q5=(e,t)=>{e.V(()=>t)},toe=(e,t,n,{align:r,smooth:i,offset:a=0}={})=>{if(n=V5(n,0,t.C()-1),r===`nearest`){let e=t.u(n),i=t.T();if(e<i)r=`start`;else{if(!(e+t.h(n)>i+t.o()))return;r=`end`}}e.V(()=>a+e.j()+t.u(n)+(r===`end`?t.h(n)-(t.o()-e.G()):r===`center`?(t.h(n)-(t.o()-e.G()))/2:0),i)},$5=Uae?d.useLayoutEffect:d.useEffect,e7=`current`,t7=(e,t)=>{if(Array.isArray(e))for(let n of e)t7(n,t);else e==null||typeof e==`boolean`||t.push(e)},noe=(e,t)=>e.key??`_`+t,roe=e=>{let t=(0,d.useRef)(null);return t.current||=e()},n7=e=>{let t=(0,d.useRef)(e);return $5(()=>{t[e7]=e},[e]),t},ioe=(0,d.memo)(({ee:e,te:t,oe:n,ne:r,re:i,ie:a,se:o,le:s})=>{let c=(0,d.useRef)(null);$5(()=>t(c[e7],n),[n]);let l=(0,d.useMemo)(()=>{let e={contain:`layout style`,position:i&&s?void 0:`absolute`,[o?`height`:`width`]:`100%`,[o?`top`:`left`]:0,[o?`left`:`top`]:r,visibility:!i||s?void 0:`hidden`};return o&&(e.display=`inline-flex`),e},[r,i,s,o]);return(0,F.jsx)(a,typeof a==`string`?{ref:c,style:l,children:e}:{ref:c,style:l,index:n,children:e})}),aoe=(e,t)=>(0,d.useMemo)(()=>{if(typeof e==`function`)return[n=>e(t[n],n),t.length];let n=(e=>{let t=[];return t7(e,t),t})(e);return[e=>n[e],n.length]},[e,t]),r7=(0,d.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:a,keepMounted:o,cache:s,startMargin:c=0,ssrCount:l,as:u=`div`,item:f=`div`,scrollRef:p,onScroll:m,onScrollEnd:h},g)=>{let[_,v]=aoe(e,t),y=(0,d.useRef)(null),b=(0,d.useRef)(!!l),x=n7(m),S=n7(h),[C,w,T,E]=roe(()=>{let e=!!a,t=Xae(v,r,s),n=Yae(t,l);return[n,t,eoe(n,e),e]});v!==C.C()&&C.W(5,[v,i]),c!==C.O()&&C.W(6,c);let[D,O]=(0,d.useReducer)(C.I,void 0,C.I),k=C.M(),A=C.t(),j=T.P(),M=[],N=e=>{let t=_(e);return(0,F.jsx)(ioe,{te:T.N,oe:e,ne:C.u(e,j),re:C.R(e),ie:f,ee:t,se:E,le:b[e7]},noe(t,e))};if($5(()=>{b[e7]=!1,C.H(1,e=>{e?(0,Yr.flushSync)(O):O()}),C.H(4,()=>{x.current&&x.current(C.T())}),C.H(8,()=>{S.current&&S.current()});let e=y[e7];return p?G5(()=>{p.current&&T.D(e,p[e7])}):T.D(e),()=>{C._(),T._()}},[]),$5(()=>{T.J()},[D]),(0,d.useImperativeHandle)(g,()=>({get cache(){return w.B()},get scrollOffset(){return C.T()},get scrollSize(){return Jae(C)},get viewportSize(){return C.o()},findItemIndex:C.k,getItemOffset:C.u,getItemSize:C.h,scrollToIndex:(e,t)=>toe(T,C,e,t),scrollTo:e=>Q5(T,e),scrollBy:e=>((e,t,n)=>{Q5(e,n+t.T())})(T,C,e)}),[]),o){let e=new Set(o);for(let[t,r]=C.i(n);t<=r;t++)e.add(t);H5([...e]).forEach(e=>{M.push(N(e))})}else for(let[e,t]=C.i(n);e<=t;e++)M.push(N(e));return(0,F.jsx)(u,{ref:y,style:{contain:`size style`,overflowAnchor:`none`,flex:`none`,position:`relative`,width:E?A:`100%`,height:E?`100%`:A,pointerEvents:k?`none`:void 0},children:M})}),i7=24;function a7({text:e}){let t=(0,d.useMemo)(()=>e.split(/\r?\n/),[e]);return typeof ResizeObserver>`u`||t.length<50&&e.length<5e3?(0,F.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e}):(0,F.jsx)(r7,{data:t,itemSize:i7,children:e=>(0,F.jsx)(`div`,{style:{minHeight:i7,lineHeight:`${i7}px`,whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e})})}function o7({header:e,body:t,isStreaming:n=!1,defaultExpanded:r=!1,preview:i,footer:a,footerPadding:o}){let[s,c]=(0,d.useState)(r),[l,u]=(0,d.useState)(!1);return n?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`streaming-header-sweep`,style:{position:`relative`,overflow:`hidden`},children:e(ooe,{collapsed:!1})}),t()]}):s?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:n?`streaming-header-sweep`:void 0,style:n?{position:`relative`,overflow:`hidden`}:void 0,children:e({onClick:()=>c(!1),onPointerEnter:s7,onPointerLeave:s7,"aria-expanded":!0,"data-long-block-toggle":``,style:{cursor:`pointer`}},{collapsed:!1})}),t(),a?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{"aria-hidden":!0,style:{height:1,marginTop:4,flexShrink:0,background:`linear-gradient(90deg, transparent 0, var(--border) 24px, var(--border) calc(100% - 24px), transparent 100%)`}}),(0,F.jsx)(`div`,{style:{padding:o??`2px 14px 4px`},children:a})]}):null]}):(0,F.jsx)(soe,{open:l,onOpen:()=>u(!0),onClose:()=>u(!1),footer:a,footerPadding:o,preview:(0,F.jsx)(`div`,{className:`preview-body`,style:{flex:`0 1 auto`,minHeight:0,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:i?i():t()}),children:e({onClick:()=>{u(!1),c(!0)},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),"aria-expanded":!1,"data-long-block-toggle":``,style:{cursor:`pointer`}},{collapsed:!0})})}var s7=()=>{},ooe={onClick:s7,onPointerEnter:s7,onPointerLeave:s7,"aria-expanded":!0,style:{cursor:`default`}},c7=6,l7=8;function soe({open:e,onOpen:t,onClose:n,preview:r,footer:i,footerPadding:a,children:o}){let s=(0,d.useRef)(null),c=(0,d.useRef)(null),[l,u]=(0,d.useState)({top:0,left:0});(0,d.useLayoutEffect)(()=>{if(!e)return;let t=s.current?.getBoundingClientRect(),n=c.current;if(!t||!n)return;let r=n.offsetWidth,i=n.offsetHeight,a=window.innerWidth,o=window.innerHeight,l=Math.max(l7,Math.min(t.left,a-r-l7)),d=t.bottom+c7+i<=o-l7,f=t.top-c7-i>=l7,p=t.top>o/2&&f?t.top-c7-i:d?t.bottom+c7:t.top-c7-i;u({top:p,left:l})},[e]);let f=e&&typeof document<`u`?(0,Yr.createPortal)((0,F.jsxs)(`div`,{ref:c,role:`tooltip`,className:`hover-preview-panel`,style:{position:`fixed`,top:l.top,left:l.left,width:`min(48rem, calc(100vw - 16px))`,maxHeight:`calc(50vh - 32px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,background:`var(--bg)`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md, 6px)`,padding:`2px 14px 6px`,fontSize:`var(--text-base)`,lineHeight:1.5,boxShadow:`0 4px 16px -2px var(--shadow-strong)`,zIndex:9999,pointerEvents:`none`},children:[r,i?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{"aria-hidden":!0,style:{height:1,marginTop:4,flexShrink:0,background:`linear-gradient(90deg, transparent 0, var(--border) 24px, var(--border) calc(100% - 24px), transparent 100%)`}}),(0,F.jsx)(`div`,{style:{padding:`4px 0 2px`},children:i})]}):null]}),document.body):null;return(0,F.jsxs)(`span`,{ref:s,onPointerEnter:t,onPointerLeave:n,style:{display:`block`,minWidth:0},children:[o,f]})}var coe=100,u7=new Map;function loe(e,t,n){let r=`${e}:${t}:${n}`,i=u7.get(r);if(i)return u7.delete(r),u7.set(r,i),i;let a=fetch(`/api/sessions/${encodeURIComponent(e)}/entries/${encodeURIComponent(t)}/thinking?blockIndex=${n}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(typeof t.thinking!=`string`)throw Error(`Invalid thinking response`);return t.thinking}).catch(e=>{throw u7.delete(r),e});if(u7.set(r,a),u7.size>coe){let e=u7.keys().next().value;e&&u7.delete(e)}return a}function uoe({block:e,sessionId:t,entryId:n,blockIndex:r,isStreaming:i=!1,keepExpanded:a=!1,footer:o}){let{t:s}=I(),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(null),h=(0,d.useRef)(!1),g=(0,d.useRef)(null);(0,d.useEffect)(()=>{e.deferred&&!h.current&&(h.current=!0,_())},[]);let _=async()=>{if(!(!e.deferred||c!==null)){if(!t||!n){m(s(`i18n.thinkingUnavailable`));return}f(!0),m(null);try{l(await loe(t,n,r))}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}},v=e.deferred?c:e.thinking,y=L5(g,i,[v]),b={padding:`4px 14px 8px 14px`,borderTop:`1px solid var(--border)`,fontSize:`var(--text-lg)`,lineHeight:1.6,color:`var(--text-muted)`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,fontFamily:`var(--font-mono)`,maxHeight:400,overflowY:`auto`,contentVisibility:`auto`,containIntrinsicBlockSize:400},x=u?(0,F.jsxs)(`span`,{style:{color:`var(--text-dim)`},children:[s(`i18n.loading`),`...`]}):p?(0,F.jsx)(`span`,{style:{color:`var(--status-error)`},children:p}):v?(0,F.jsx)(a7,{text:v}):i$(e)?(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontStyle:`italic`},children:s(`i18n.thinkingEncrypted`)}):null;return(0,F.jsx)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:6,overflow:`hidden`,fontSize:`var(--text-base)`},children:(0,F.jsx)(o7,{isStreaming:i,defaultExpanded:a,footer:o,footerPadding:`2px 14px 4px`,header:(e,{collapsed:t})=>(0,F.jsxs)(`div`,{...e,style:{...e.style,display:`flex`,alignItems:`center`,gap:6,padding:`6px 10px`,color:`var(--status-warning)`,fontSize:`var(--text-base)`,minWidth:0},children:[(0,F.jsx)(sr,{size:R.base,fill:`currentColor`,style:{flexShrink:0,color:`var(--bulb-warning)`}}),(0,F.jsx)(`span`,{style:{flexShrink:0},children:s(`i18n.thinking`)}),t&&v&&(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:v.slice(0,160)})]}),body:()=>(0,F.jsx)(`div`,{ref:g,onScroll:y,className:`pv-shrink`,style:b,children:x??(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`},children:s(`i18n.noThinking`)})})})})}function doe(e){let t=d7(e);if(t){let e=0,n=0;for(let r of t)for(let t of r.rows)t.type===`line`&&(t.left.type===`removed`&&(n+=1),t.right.type===`added`&&(e+=1));return{additions:e,deletions:n}}let n=0,r=0;for(let t of e.split(/\r?\n/))t.startsWith(`+`)&&!t.startsWith(`+++`)?n+=1:t.startsWith(`-`)&&!t.startsWith(`---`)&&(r+=1);return{additions:n,deletions:r}}function d7(e){let t=[],n=null,r,i=0,a=0,o=[],s=[],c=()=>({lineNo:null,text:``,type:`empty`}),l=()=>{if(!n){o=[],s=[];return}let e=Math.max(o.length,s.length);for(let t=0;t<e;t++){let e=o[t]?{lineNo:o[t].lineNo,text:o[t].text,type:`removed`}:c(),r=s[t]?{lineNo:s[t].lineNo,text:s[t].text,type:`added`}:c();n.rows.push({type:`line`,left:e,right:r})}o=[],s=[]};for(let c of e.split(/\r?\n/)){if(c.startsWith(`--- `)){l(),r=f7(c.slice(4));continue}if(c.startsWith(`+++ `)){l(),n={oldPath:r,newPath:f7(c.slice(4)),rows:[]},t.push(n);continue}let e=c.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(e){n||(n={rows:[]},t.push(n)),l(),i=Number(e[1]),a=Number(e[2]),n.rows.push({type:`hunk`,text:c});continue}if(!n)continue;if(c.startsWith(`\\ `)){l(),n.rows.push({type:`hunk`,text:c});continue}let u=c[0],d=c.slice(1);u===` `?(l(),n.rows.push({type:`line`,left:{lineNo:i++,text:d,type:`context`},right:{lineNo:a++,text:d,type:`context`}})):u===`-`?o.push({lineNo:i++,text:d}):u===`+`?s.push({lineNo:a++,text:d}):c!==``&&(l(),n.rows.push({type:`hunk`,text:c}))}l();let u=t.filter(e=>e.rows.some(e=>e.type===`line`));return u.length>0?u:null}function f7(e){return e.split(` `)[0].trim()}function foe(e){let t=e.details;if(!wh(t))return null;let n=typeof t.patch==`string`?t.patch:null;if(n)return{text:n};let r=typeof t.diff==`string`?t.diff:null;return r?{text:r}:null}function poe(e){if(typeof e!=`string`||!e)return!1;let t=e.toLowerCase();return t===`edit`||t.startsWith(`edit_`)||t.endsWith(`.edit`)||t.endsWith(`_edit`)||t.includes(`str_replace`)||t.includes(`replace_editor`)}function moe({diff:e}){return(0,F.jsx)(`div`,{style:{marginTop:6,borderRadius:`var(--radius-md, 6px)`,overflow:`hidden`,background:`var(--bg-subtle)`},children:(0,F.jsx)(hoe,{text:e.text})})}function hoe({text:e}){let{t}=I(),n=(0,d.useMemo)(()=>d7(e),[e]);if(!n)return(0,F.jsx)(voe,{text:e});let r=n.length>1;return(0,F.jsx)(`div`,{style:{maxHeight:560,overflowY:`auto`,overflowX:`hidden`,background:`transparent`,contentVisibility:`auto`,containIntrinsicBlockSize:560},children:n.map((e,n)=>(0,F.jsxs)(`div`,{style:{minWidth:0,borderTop:n===0?`none`:`1px solid var(--border)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,lineHeight:1.55},children:[r&&(0,F.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(0, 1fr) minmax(0, 1fr)`,position:`sticky`,top:0,zIndex:1,background:`var(--bg-subtle)`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsx)(p7,{title:e.oldPath||t(`i18n.before`),side:`left`}),(0,F.jsx)(p7,{title:e.newPath||t(`i18n.after`),side:`right`})]}),(0,F.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(0, 1fr) minmax(0, 1fr)`},children:e.rows.map((e,t)=>e.type===`hunk`?null:(0,F.jsxs)(`div`,{style:{display:`contents`},children:[(0,F.jsx)(m7,{cell:e.left,side:`left`}),(0,F.jsx)(m7,{cell:e.right,side:`right`})]},t))})]},n))})}function p7({title:e,side:t}){return(0,F.jsx)(`div`,{title:e,style:{padding:`5px 10px`,color:`var(--text-dim)`,borderRight:t===`left`?`1px solid var(--border)`:`none`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e})}function m7({cell:e,side:t}){let n=e.type===`added`?`color-mix(in srgb, var(--status-success) 12%, transparent)`:e.type===`removed`?`color-mix(in srgb, var(--status-error) 13%, transparent)`:e.type===`empty`?`var(--bg-subtle)`:`transparent`,r=e.type===`added`?`+`:e.type===`removed`?`-`:` `,i=e.type===`added`?`var(--status-success)`:e.type===`removed`?`var(--status-error)`:`var(--text-dim)`;return(0,F.jsxs)(`div`,{style:{display:`flex`,minWidth:0,background:n,borderRight:t===`left`?`1px solid var(--border)`:`none`},children:[(0,F.jsx)(`span`,{style:{width:42,padding:`0 6px`,textAlign:`right`,color:`var(--text-dim)`,userSelect:`none`,background:`var(--bg)`,borderRight:`1px solid var(--border)`,flexShrink:0},children:e.lineNo??``}),(0,F.jsx)(`span`,{style:{width:18,padding:`0 5px`,color:i,userSelect:`none`,fontWeight:e.type===`context`||e.type===`empty`?400:700,flexShrink:0},children:r}),(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,padding:`0 10px 0 0`,color:e.type===`empty`?`var(--text-dim)`:`var(--text)`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:e.text||`\xA0`})]})}var goe={added:{bg:`color-mix(in srgb, var(--status-success) 12%, transparent)`,color:`var(--status-success)`,borderLeft:`3px solid var(--status-success)`},removed:{bg:`color-mix(in srgb, var(--status-error) 13%, transparent)`,color:`var(--status-error)`,borderLeft:`3px solid var(--status-error)`},hunk:{bg:`color-mix(in srgb, var(--accent) 12%, transparent)`,color:`var(--accent)`,borderLeft:`3px solid var(--accent)`},context:{bg:`transparent`,color:`var(--text)`,borderLeft:`3px solid transparent`}};function _oe(e){return e.startsWith(`@@`)?`hunk`:e.startsWith(`+`)&&!e.startsWith(`+++`)?`added`:e.startsWith(`-`)&&!e.startsWith(`---`)?`removed`:`context`}function voe({text:e}){let t=e.split(/\r?\n/);return(0,F.jsx)(`div`,{style:{maxHeight:520,overflowY:`auto`,overflowX:`hidden`,fontFamily:`var(--font-mono)`,contentVisibility:`auto`,containIntrinsicBlockSize:520,fontSize:`var(--text-base)`,lineHeight:1.55,minWidth:0},children:t.map((e,t)=>{let{bg:n,color:r,borderLeft:i}=goe[_oe(e)];return(0,F.jsxs)(`div`,{style:{display:`flex`,background:n,borderLeft:i},children:[(0,F.jsx)(`span`,{style:{width:48,padding:`0 8px`,color:`var(--text-dim)`,background:`var(--bg)`,borderRight:`1px solid var(--border)`,textAlign:`right`,userSelect:`none`,flexShrink:0},children:t+1}),(0,F.jsx)(`span`,{style:{padding:`0 10px`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,color:r},children:e||`\xA0`})]},t)})})}var yoe=`用户输入: `;function h7(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:null}function g7(e){return Array.isArray(e)?e.map((e,t)=>{let n=h7(e);return{label:typeof n?.label==`string`?n.label:`#${t+1}`,description:typeof n?.description==`string`?n.description:null,value:typeof n?.value==`string`?n.value:null}}):[]}function boe(e){return Array.isArray(e.questions)?e.questions.map((e,t)=>{let n=h7(e);return{id:typeof n?.id==`string`?n.id:`#${t}`,question:typeof n?.question==`string`?n.question:typeof n?.label==`string`?n.label:null,options:g7(n?.options)}}):typeof e.question==`string`?[{id:null,question:e.question,options:g7(e.options)}]:[]}function xoe(e){let t=h7(e);if(!t)return[];if(Array.isArray(t.answers))return t.answers.map((e,t)=>{let n=h7(e),r=Array.isArray(n?.selections)?n.selections:[];return{id:typeof n?.id==`string`?n.id:`#${t}`,values:r.map(e=>h7(e)?.value??``).filter(Boolean),labels:r.map(e=>h7(e)?.label??``).filter(Boolean),customAnswer:typeof n?.customAnswer==`string`&&n.customAnswer?n.customAnswer:null,skipped:n?.skipped===!0}});let n=Array.isArray(t.selections)?t.selections:[],r=n.map(e=>h7(e)?.value??``).filter(Boolean),i=n.map(e=>h7(e)?.label??``).filter(Boolean),a=typeof t.customAnswer==`string`&&t.customAnswer?t.customAnswer:null;return r.length||i.length||a||t.skipped===!0?[{id:null,values:r,labels:i,customAnswer:a,skipped:t.skipped===!0}]:[]}function Soe({block:e,result:t,duration:n,isStreaming:r=!1,footer:i}){let{t:a}=I(),o=boe(e.input??{}),s=Coe(t),c=woe(t),l=c.text,u=c.isError,d=o.find(e=>e.question)?.question??null,f=d?o.length>1?`${a(`chat.aiQuestion`)} ${o.length}: ${d}`:d:l??a(`chat.aiQuestion`),p=h7(t?.details)?.cancelled===!0,m=s.flatMap(e=>[...e.labels,...e.customAnswer?[e.customAnswer]:[]]).join(` · `);return(0,F.jsx)(`div`,{style:{borderRadius:7,fontSize:`var(--text-base)`,...Toe(u)},children:(0,F.jsx)(o7,{isStreaming:r,footer:i,header:(e,{collapsed:t})=>(0,F.jsxs)(`div`,{...e,style:{...e.style,display:`flex`,alignItems:`center`,gap:7,padding:`6px 10px`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,minWidth:0},children:[(0,F.jsx)(`span`,{style:{color:u?`var(--status-error)`:`var(--status-info)`,fontFamily:`var(--font-mono)`,fontWeight:600,flexShrink:0},children:`pi_menu`}),t?(0,F.jsxs)(`span`,{style:{flex:1,minWidth:0,display:`flex`,alignItems:`baseline`,gap:6,overflow:`hidden`},children:[(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`var(--text)`},children:f}),m&&(0,F.jsx)(`span`,{style:{color:`var(--accent)`,fontWeight:600,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flexShrink:0,maxWidth:`55%`},children:`→ ${m}`})]}):(0,F.jsx)(`span`,{children:a(`chat.aiQuestion`)}),n!==void 0&&(0,F.jsxs)(`span`,{style:{marginLeft:`auto`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,fontVariantNumeric:`tabular-nums`,flexShrink:0},children:[n,`s`]})]}),body:()=>(0,F.jsxs)(`div`,{className:`pv-shrink`,style:{padding:`8px 14px`,borderTop:`1px solid var(--border)`,fontSize:`var(--text-base)`,lineHeight:1.5,color:`var(--text-muted)`},children:[o.map((e,t)=>{let n=s.find(n=>n.id===(e.id??`#${t}`))??s[t]??null;return(0,F.jsxs)(`div`,{style:t>0?{marginTop:10}:void 0,children:[e.question&&(0,F.jsx)(`div`,{style:{fontWeight:600,color:`var(--text)`,marginBottom:6},children:e.question}),e.options.length>0&&(0,F.jsx)(Eoe,{options:e.options,chosenValues:n?.values??[]}),n?.customAnswer&&(0,F.jsx)(`div`,{style:{color:`var(--text)`,fontWeight:600,whiteSpace:`pre-wrap`},children:`${yoe}${n.customAnswer}`}),n?.skipped&&(0,F.jsx)(`div`,{style:{color:`var(--text-dim)`,fontWeight:600},children:a(`chat.skipped`)})]},e.id??t)}),p&&l&&(0,F.jsx)(`div`,{style:{color:`var(--text-dim)`,fontWeight:600,whiteSpace:`pre-wrap`},children:l}),o.length===0&&l&&(0,F.jsx)(`div`,{style:{color:u?`var(--status-error)`:`var(--text-muted)`,fontWeight:600,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:l})]})})})}function Coe(e){return e?xoe(e.details):[]}function woe(e){return{text:(e?e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
482
|
+
`).trim():null)||null,isError:e?.isError??!1}}function Toe(e){return{border:e?`1px solid color-mix(in srgb, var(--status-error) 45%, transparent)`:`1px solid var(--border)`,background:`var(--bg-panel)`}}function Eoe({options:e,chosenValues:t}){return(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:3},children:e.map((e,n)=>(0,F.jsx)(Doe,{opt:e,index:n,chosenValues:t},n))})}function Doe({opt:e,index:t,chosenValues:n}){let r=e.value!==null&&n.includes(e.value)||n.includes(e.label);return(0,F.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`baseline`},children:[(0,F.jsx)(`span`,{style:{color:r?`var(--accent)`:`var(--text-dim)`},children:r?`●`:`○`}),(0,F.jsx)(`span`,{style:{color:r?`var(--accent)`:`var(--text)`,fontWeight:r?600:400},children:e.label}),e.description&&(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:e.description})]})}function _7(e){if(!e)return null;let t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),i=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});return r?i:`${t.toLocaleDateString([],{month:`short`,day:`numeric`,year:t.getFullYear()===n.getFullYear()?void 0:`numeric`})} ${i}`}function v7(e){return typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
483
|
+
`)}function Ooe(e){return typeof e==`string`?[]:e.filter(e=>e.type===`image`)}function y7(e){let t=e;return e.source?e.source.type===`base64`?`data:${e.source.media_type};base64,${e.source.data}`:e.source.url??``:t.data?`data:${t.mimeType};base64,${t.data}`:``}function koe(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Aoe(e){return e||`extension`}function joe(e){return e<1?`${e.toFixed(1)}s`:`${Math.round(e)}s`}function Moe(e){let t=e.replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,140)}...`:t:`Show extension message`}function Noe(e){let t=e.input;if(!t||typeof t!=`object`)return``;let n=Object.keys(t);if(n.length===0)return``;if(`command`in t)return String(t.command).slice(0,120);if(`path`in t)return String(t.path).slice(0,120);if(`file_path`in t)return String(t.file_path).slice(0,120);if(`pattern`in t)return String(t.pattern).slice(0,120);if(`query`in t)return String(t.query).slice(0,120);let r=t[n[0]];if(Array.isArray(r)){let e=r.map(e=>typeof e==`object`&&e&&`topic`in e?String(e.topic):null).filter(e=>e!==null&&e.length>0);return e.length>0?e.join(` | `).slice(0,120):`[${r.length} items]`}return String(r).slice(0,120)}function Poe({block:e,isError:t,duration:n,lineStats:r}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:7,width:`100%`,padding:`6px 10px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`,minWidth:0},children:[(0,F.jsx)(Ir,{size:R.base,style:{flexShrink:0,color:t?`var(--status-error)`:`var(--status-info)`}}),(0,F.jsx)(`span`,{style:{color:t?`var(--status-error)`:`var(--status-info)`,fontFamily:`var(--font-mono)`,fontWeight:600,fontSize:`var(--text-sm)`,flexShrink:0},children:e.toolName}),(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,minWidth:0},children:Noe(e)}),r&&(r.additions>0||r.deletions>0)&&(0,F.jsxs)(`span`,{"data-testid":`tool-diff-stats`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`,fontVariantNumeric:`tabular-nums`},children:[r.additions>0&&(0,F.jsxs)(`span`,{style:{color:`var(--status-success)`},children:[`+`,r.additions]}),r.deletions>0&&(0,F.jsxs)(`span`,{style:{color:`var(--status-error)`},children:[`-`,r.deletions]})]}),n!==void 0&&(0,F.jsxs)(`span`,{"data-testid":`tool-duration`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontVariantNumeric:`tabular-nums`,color:`var(--text-dim)`},children:[(0,F.jsx)(Wn,{size:R.sm}),joe(n)]})]})})}function b7({block:e,result:t,duration:n,isStreaming:r=!1,keepExpanded:i=!1,streamingOutput:a,footer:o}){let s=a??e.streamingOutput,c=(0,d.useRef)(null),l=L5(c,r,[s]);if(e.toolName===`pi_menu`)return(0,F.jsx)(Soe,{block:e,result:t,duration:n,isStreaming:r,footer:o});let u=t?.isError??!1,f=t&&!t.isError?foe(t):null,p=f?doe(f.text):null,m=!!s;return(0,F.jsx)(`div`,{style:{borderRadius:7,fontSize:`var(--text-base)`,...Foe(u)},children:(0,F.jsx)(o7,{isStreaming:r||m,defaultExpanded:i,footer:o,header:t=>(0,F.jsx)(`div`,{...t,style:{...t.style,minWidth:0},children:(0,F.jsx)(Poe,{block:e,isError:u,duration:n,lineStats:p})}),body:()=>(0,F.jsx)(`div`,{className:`pv-flex`,style:{padding:`8px 14px`,borderTop:`1px solid var(--border)`,fontSize:`var(--text-base)`,lineHeight:1.5,color:`var(--text-muted)`},children:(0,F.jsx)(zoe,{block:e,result:t,resultDiff:f,isError:u,liveOutput:s,streamScrollRef:c,onStreamScroll:l})})})})}function Foe(e){return{border:e?`1px solid color-mix(in srgb, var(--status-error) 45%, transparent)`:`1px solid var(--border)`,background:`var(--bg)`}}function Ioe(e){return e?e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
484
|
+
`):null}function Loe(e){if(e===null)return!1;let t=e.trim();return t===`(no output)`||t===``}function Roe({input:e}){let{t}=I(),[n,r]=(0,d.useState)(!1),i=(0,d.useMemo)(()=>JSON.stringify(e,null,2),[e]),a=()=>{gK(i).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return(0,F.jsxs)(`div`,{onClick:a,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},"aria-label":t(`i18n.copyToolInput`),"data-testid":`tool-call-input`,title:t(n?`i18n.copied`:`i18n.copyToolInput`),style:{position:`relative`,margin:`0 0 6px`,padding:`8px 10px`,background:`var(--bg-subtle)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md, 6px)`,color:`var(--text-muted)`,fontFamily:`var(--font-mono, monospace)`,fontSize:`var(--text-base)`,lineHeight:1.5,overflowWrap:`break-word`,whiteSpace:`pre-wrap`,cursor:`pointer`,userSelect:`none`},children:[n&&(0,F.jsxs)(`span`,{style:{position:`absolute`,top:4,right:8,color:`var(--accent)`,fontSize:`var(--text-sm)`,fontWeight:600,pointerEvents:`none`},children:[`✓ `,t(`i18n.copied`)]}),(0,F.jsx)(x7,{input:e})]})}function x7({input:e,depth:t=0}){return(0,F.jsx)(F.Fragment,{children:Object.entries(e).map(([e,n])=>(0,F.jsxs)(`div`,{style:{paddingLeft:t>0?12:0},children:[(0,F.jsx)(`span`,{style:{color:`var(--text)`,fontWeight:600},children:e}),`: `,(0,F.jsx)(S7,{value:n,depth:t})]},e))})}function S7({value:e,depth:t}){return e===null?(0,F.jsx)(`span`,{children:`null`}):typeof e==`string`?(0,F.jsx)(`span`,{children:e}):typeof e==`number`||typeof e==`boolean`?(0,F.jsx)(`span`,{children:String(e)}):Array.isArray(e)?e.length===0?(0,F.jsx)(`span`,{children:`[]`}):(0,F.jsx)(F.Fragment,{children:e.map((e,n)=>(0,F.jsxs)(`div`,{style:{paddingLeft:12},children:[(0,F.jsx)(`span`,{style:{color:`var(--text)`,fontWeight:600},children:`- `}),(0,F.jsx)(S7,{value:e,depth:t+1})]},n))}):typeof e==`object`?(0,F.jsx)(x7,{input:e,depth:t+1}):(0,F.jsx)(`span`,{children:String(e)})}function zoe({block:e,result:t,resultDiff:n,isError:r,liveOutput:i,streamScrollRef:a,onStreamScroll:o}){let s=poe(e.toolName),c=Ioe(t),l=Loe(c),u=(!s||r)&&e.input!==null&&typeof e.input==`object`;return(0,F.jsxs)(F.Fragment,{children:[u&&(0,F.jsx)(Roe,{input:e.input}),t&&(n?(0,F.jsx)(moe,{diff:n}):(0,F.jsx)(C7,{text:c??``,isEmpty:l,isError:r})),!t&&i!==void 0&&i!==``&&(0,F.jsx)(`div`,{"data-testid":`tool-stream-output`,children:(0,F.jsx)(C7,{text:i,isEmpty:!1,isError:!1,streamRef:a,onStreamScroll:o})})]})}function C7({text:e,isEmpty:t,isError:n,streamRef:r,onStreamScroll:i}){let{t:a}=I();return(0,F.jsx)(`div`,{style:{marginTop:6,borderRadius:`var(--radius-md, 6px)`,overflow:`hidden`,border:n?`1px solid color-mix(in srgb, var(--status-error) 30%, transparent)`:`1px solid color-mix(in srgb, var(--status-info) 35%, transparent)`,background:n?`color-mix(in srgb, var(--status-error) 4%, transparent)`:`var(--bg-subtle)`},children:(0,F.jsx)(`pre`,{ref:r,onScroll:i,style:{margin:0,padding:`8px 10px`,color:n?`var(--status-error)`:t?`var(--text-dim)`:`var(--text-muted)`,fontSize:`var(--text-base)`,lineHeight:1.5,overflow:`auto`,maxHeight:400,background:`transparent`,whiteSpace:`pre-wrap`,wordBreak:`break-all`,fontStyle:t?`italic`:`normal`,opacity:t?.6:1,contentVisibility:`auto`,containIntrinsicBlockSize:400},children:t?a(`i18n.noOutput`):(0,F.jsx)(a7,{text:e})})})}function Boe(e,t,n,r){let i=!1,a=new Map(r);for(let r=0;r<e.length-1;r++){let o=e[r].originalIndex,s=e[r+1].originalIndex;if(!a.has(o)&&t.has(o)){let e=t.get(o),r=t.get(s)??n;a.set(o,Math.round((r-e)/100)/10),i=!0}}return i?a:r}function Voe(e,t,n,r){if(e.block.type!==`toolCall`)return r;let i=t.get(e.originalIndex);if(i===void 0)return r;let a=Math.round((n-i)/100)/10;if(r.get(e.originalIndex)===a)return r;let o=new Map(r);return o.set(e.originalIndex,a),o}function Hoe(e){let t=0;for(let n of e)n.type===`text`?t+=n.text?.length??0:n.type===`thinking`?t+=n.thinking?.length??0:n.type===`toolCall`&&(t+=JSON.stringify(n.input??{}).length);return t}function Uoe({message:e,turnStartTimestamp:t,toolResults:n,isStreaming:r,blockItems:i,entryId:a}){let o=(0,d.useRef)(null),[s,c]=(0,d.useState)(null),l=(0,d.useRef)(i);(0,d.useEffect)(()=>{l.current=i});let u=(0,d.useRef)(new Map),[f,p]=(0,d.useState)(new Map),m=(0,d.useMemo)(()=>{if(!e.timestamp||!t)return;let n=Math.round((e.timestamp-t)/1e3);return n>0?n:void 0},[e.timestamp,t]),h=(0,d.useMemo)(()=>{let t=new Map;if(!n||!e.timestamp)return t;let r=a?`${a}:`:``;for(let[i,a]of n){if(r&&!i.startsWith(r))continue;let n=r?i.slice(r.length):i;if(a.timestamp&&e.timestamp){let r=Math.max(.1,Math.round((a.timestamp-e.timestamp)/100)/10);r>0&&t.set(n,r)}}return t},[n,e.timestamp,a]);return(0,d.useEffect)(()=>{if(!r)return;let e=setInterval(()=>{if(document.hidden)return;let e=l.current,t=e.map(({block:e})=>e),n=Date.now();e.forEach(({originalIndex:e})=>{u.current.has(e)||u.current.set(e,n)}),p(t=>Boe(e,u.current,n,t));let r=e[e.length-1];r&&p(e=>Voe(r,u.current,n,e));let i=Hoe(t);if(i===0)return;o.current===null&&(o.current=n);let a=(n-o.current)/1e3;a>.5&&c(i/4/a)},300);return()=>{clearInterval(e),o.current=null,c(null)}},[r,p,c,l,u,o]),{turnDurationSecs:m,toolCallDurations:h,streamingDurations:f,tps:s}}function Woe({message:e,isStreaming:t,toolResults:n,modelNames:r,cwd:i,onOpenFile:a,showTimestamp:o,turnStartTimestamp:s,sessionId:c,entryId:l,recentExpandedBlockKeys:u,modelLabelVisible:d=!0,turnNumber:f,isTurnFinalAssistant:p}){let m=(e.content??[]).map((e,t)=>({block:e,originalIndex:t})).filter(({block:e})=>!a$(e,{isStreaming:t})),h=m.map(({block:e})=>e),g=s$(e,{isStreaming:t}),{turnDurationSecs:_,toolCallDurations:v,streamingDurations:y,tps:b}=Uoe({message:e,turnStartTimestamp:s,toolResults:n,isStreaming:t,blockItems:m,entryId:l}),x=h.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
485
|
+
`),S=[...m].reverse().find(({block:e})=>e.type===`text`)?.originalIndex,C=e.usage&&!t?(0,F.jsx)(I5,{usage:e.usage}):void 0,w=h.length>0&&e.usage&&!t?C:void 0,T=d&&(t||h.some(e=>e.type===`text`));return h.length===0&&!t&&!g?null:(0,F.jsxs)(`div`,{className:`msg-row`,style:{marginBottom:16},children:[T&&(0,F.jsx)(zae,{message:e,modelNames:r,isStreaming:t,blocks:h,turnNumber:f,tps:b}),(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:m.map(({block:r,originalIndex:o})=>(0,F.jsx)(Goe,{block:r,usageFooter:w,toolResults:n,isStreaming:t,streamingDuration:y.get(o),toolCallDurations:v,cwd:i,onOpenFile:a,sessionId:c,entryId:l,blockIndex:o,recentExpandedBlockKeys:u,showCopy:o===S,copyText:x,usageNode:o===S?C:void 0,turnDurationSecs:r.type===`text`&&o===S&&p?_:void 0,timestamp:r.type===`text`&&o===S&&p?e.timestamp:void 0},`${l??`stream`}-${o}`))}),g&&(0,F.jsxs)(`div`,{role:`alert`,style:{marginTop:h.length>0?8:0,padding:`7px 10px`,border:`1px solid color-mix(in srgb, var(--status-error) 30%, transparent)`,borderRadius:6,background:`color-mix(in srgb, var(--status-error) 7%, transparent)`,color:`var(--status-error)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[`Error: `,g]}),(0,F.jsx)(Rae,{usage:e.usage,isStreaming:t,textContent:x,timestamp:o?e.timestamp:void 0,turnDurationSecs:_,showUsage:h.length===0,showTurnDuration:h.length===0})]})}function Goe({block:e,toolResults:t,isStreaming:n,streamingDuration:r,toolCallDurations:i,cwd:a,onOpenFile:o,sessionId:s,entryId:c,blockIndex:l,recentExpandedBlockKeys:u,usageFooter:d,showCopy:f,copyText:p,usageNode:m,turnDurationSecs:h,timestamp:g}){let _=!n&&c!==void 0&&(e.type===`thinking`||e.type===`toolCall`)&&u?.has(wt(e.type,c,e.type===`toolCall`?e.toolCallId:void 0,e.type===`thinking`?l:void 0))===!0;if(e.type===`text`)return(0,F.jsx)(Koe,{block:e,isStreaming:n,cwd:a,onOpenFile:o,showCopy:f,copyText:p,usageNode:m,turnDurationSecs:h,timestamp:g});if(e.type===`thinking`)return(0,F.jsx)(uoe,{block:e,sessionId:s,entryId:c,blockIndex:l,isStreaming:n,keepExpanded:_,footer:d});if(e.type===`toolCall`){let a=e,o=t?.get(`${c}:${a.toolCallId}`),s=a.durationSecs??i?.get(a.toolCallId)??r;return(0,F.jsx)(b7,{block:a,result:o,duration:s,isStreaming:n,keepExpanded:_,footer:d})}return null}function Koe({block:e,isStreaming:t,cwd:n,onOpenFile:r,showCopy:i,copyText:a,usageNode:o,turnDurationSecs:s,timestamp:c}){let l=i&&!t&&(a||o||s!==void 0||c!==void 0);return(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:6},children:(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,F.jsx)(O5,{isStreaming:t,cwd:n,onOpenFile:r,children:e.text}),l&&(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:2},children:[o,a&&(0,F.jsx)(Iae,{textContent:a}),s!==void 0&&(0,F.jsx)(Lae,{secs:s,timestamp:c,marginLeftAuto:!0})]})]})})}function qoe({message:e,sessionId:t,streamingOutput:n}){let[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(null),l=Joe(e),u=Yoe(e),f=Xoe(t,e),p=!!(e.truncated&&f)&&r===null,{block:m,result:h}=Zoe(e,{isPending:l,isError:u,displayOutput:r??e.output});async function g(){if(f){o(!0),c(null);try{let e=await(await fetch(f)).json();e.success?i(e.data?.output??``):c(e.error??`failed`)}catch(e){c(String(e))}finally{o(!1)}}}return(0,F.jsxs)(`div`,{style:{margin:`6px 0`},children:[(0,F.jsx)(b7,{block:m,result:h,streamingOutput:l?n:void 0}),e.truncated&&f&&(0,F.jsx)(Qoe,{showFullButton:p,loadingFull:a,fullError:s,fullOutputUrl:f,onLoadFull:g})]})}function Joe(e){return!e.output&&e.exitCode===void 0&&!e.cancelled}function Yoe(e){return e.cancelled||e.exitCode!==void 0&&e.exitCode!==0}function Xoe(e,t){return!e||!t.fullOutputPath?null:`/api/agent/${encodeURIComponent(e)}/bash-output?path=${encodeURIComponent(t.fullOutputPath)}`}function Zoe(e,t){let n=e.excludeFromContext?`bash (local)`:`bash`,r={type:`toolCall`,toolCallId:`bash-${e.timestamp??``}`,toolName:n,input:{command:e.command}};return{block:r,result:t.isPending?void 0:{role:`toolResult`,toolCallId:r.toolCallId,toolName:n,content:t.displayOutput?[{type:`text`,text:t.displayOutput}]:[],isError:t.isError,timestamp:e.timestamp}}}function Qoe({showFullButton:e,loadingFull:t,fullError:n,fullOutputUrl:r,onLoadFull:i}){return(0,F.jsxs)(`div`,{style:{padding:`4px 10px`,fontSize:`var(--text-sm)`,marginTop:-1},children:[e&&(0,F.jsx)(`button`,{onClick:i,disabled:t,style:{background:`none`,border:`none`,color:`var(--accent)`,cursor:t?`default`:`pointer`,fontSize:`var(--text-sm)`,padding:0,textDecoration:`underline`},children:t?`loading…`:`view full output`}),(0,F.jsx)(`a`,{href:`${r}&download=1`,style:{marginLeft:e?10:0,color:`var(--accent)`,fontSize:`var(--text-sm)`,textDecoration:`underline`},children:`download full output`}),n&&(0,F.jsxs)(`span`,{style:{marginLeft:6,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:[`(`,n,`)`]})]})}var $oe=/<(read-files|modified-files)>\s*([\s\S]*?)\s*<\/\1>/g,ese=/(?:\r?\n){2,}((?:[ \t]*<(?:read-files|modified-files)>[ \t]*\r?\n[\s\S]*?\r?\n[ \t]*<\/(?:read-files|modified-files)>[ \t]*(?:\r?\n)?)+)\s*$/;function tse(e){let t=[],n=[],r=e.match(ese),i=r?.[1]??``,a=r?.index===void 0?e:e.slice(0,r.index);return i.replace($oe,(e,r,i)=>{let a=i.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);return r===`read-files`?t.push(...a):n.push(...a),``}),{body:a.trim(),readFiles:t,modifiedFiles:n}}function nse({message:e}){let{t}=I(),n=v7(e.content),r=(0,d.useMemo)(()=>tse(n),[n]),i=_7(e.timestamp);return(0,F.jsx)(`div`,{style:{marginBottom:16},children:(0,F.jsxs)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:8,overflow:`hidden`,background:`var(--bg)`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderBottom:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`},children:[(0,F.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:650},children:`compaction`}),i&&(0,F.jsx)(`span`,{style:{marginLeft:`auto`,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:i})]}),(0,F.jsxs)(`div`,{style:{padding:`11px 13px 12px`},children:[(0,F.jsx)(`div`,{style:{color:`var(--text)`,fontSize:`var(--text-2xl)`,fontWeight:700,lineHeight:1.35},children:t(`i18n.conversationCompacted`)}),(0,F.jsx)(`div`,{style:{marginTop:3,marginBottom:10,color:`var(--text)`,fontSize:`var(--text-2xl)`,lineHeight:1.5},children:t(`i18n.compactionDescription`)}),r.body?(0,F.jsx)(O5,{className:`markdown-compaction-message`,children:r.body}):(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-base)`},children:t(`i18n.noSummary`)}),(0,F.jsx)(rse,{readFiles:r.readFiles,modifiedFiles:r.modifiedFiles})]})]})})}function rse({readFiles:e,modifiedFiles:t}){let{t:n}=I();if(e.length+t.length===0)return null;let r=[];return e.length>0&&r.push(`${e.length} read`),t.length>0&&r.push(`${t.length} modified`),(0,F.jsxs)(`details`,{className:`compaction-file-details`,children:[(0,F.jsx)(`summary`,{children:n(`i18n.fileContext`,{details:r.join(`, `)})}),t.length>0&&(0,F.jsx)(w7,{title:n(`i18n.modifiedFiles`),files:t}),e.length>0&&(0,F.jsx)(w7,{title:n(`i18n.readFiles`),files:e})]})}function w7({title:e,files:t}){return(0,F.jsxs)(`div`,{className:`compaction-file-section`,children:[(0,F.jsx)(`div`,{className:`compaction-file-title`,children:e}),(0,F.jsx)(`ul`,{className:`compaction-file-list`,children:t.map(e=>(0,F.jsx)(`li`,{children:e},e))})]})}function ise({message:e,cwd:t,onOpenFile:n}){let r=e.display===!1,[i,a]=(0,d.useState)(!r),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),u=v7(e.content),f=Ooe(e.content),p=e.details!==void 0,m=p?koe(e.details):``,h=Aoe(e.customType),g=_7(e.timestamp),_=p&&(r&&i||!r&&o);return(0,F.jsx)(`div`,{style:{marginBottom:16},children:(0,F.jsxs)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:8,overflow:`hidden`,background:r?`var(--bg-subtle)`:`var(--bg)`,opacity:ase(r,i)},children:[(0,F.jsx)(ose,{isHiddenDisplay:r,title:h,time:g}),i?(0,F.jsx)(sse,{text:u,images:f,cwd:t,onOpenFile:n}):(0,F.jsx)(cse,{text:u,onExpand:()=>a(!0)}),(0,F.jsx)(lse,{text:u,detailsText:m,isHiddenDisplay:r,hasDetails:p,contentExpanded:i,detailsExpanded:o,copied:c,onCopy:()=>{gK(u||m).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},onToggle:()=>{r?a(e=>!e):s(e=>!e)}}),_&&(0,F.jsx)(use,{detailsText:m})]})})}function ase(e,t){return e&&!t?.82:1}function ose({isHiddenDisplay:e,title:t,time:n}){let{t:r}=I();return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderBottom:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:650},children:t}),e&&(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:r(`i18n.hiddenExtensionMessage`)}),n&&(0,F.jsx)(`span`,{style:{marginLeft:`auto`,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:n})]})}function sse({text:e,images:t,cwd:n,onOpenFile:r}){let{t:i}=I();return(0,F.jsxs)(`div`,{style:{padding:`6px 9px`},children:[t.length>0&&(0,F.jsx)(`div`,{style:{display:`flex`,gap:6,flexWrap:`wrap`,marginBottom:e?8:0},children:t.map((e,t)=>{let n=y7(e);return n?(0,F.jsx)(`img`,{src:n,alt:``,style:{maxWidth:240,maxHeight:240,borderRadius:6,objectFit:`contain`,display:`block`,border:`1px solid var(--border)`}},t):null})}),e?(0,F.jsx)(O5,{className:`markdown-custom-message`,cwd:n,onOpenFile:r,children:e}):(0,F.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-base)`},children:i(`i18n.noMessage`)})]})}function cse({text:e,onExpand:t}){let{t:n}=I();return(0,F.jsx)(`button`,{onClick:t,style:{display:`block`,width:`100%`,padding:`8px 10px`,border:`none`,background:`transparent`,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-base)`,textAlign:`left`},children:e?Moe(e):n(`i18n.showExtensionMessage`)})}function lse({text:e,detailsText:t,isHiddenDisplay:n,hasDetails:r,contentExpanded:i,detailsExpanded:a,copied:o,onCopy:s,onToggle:c}){let{t:l}=I();return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`4px 9px`,borderTop:`1px solid var(--border)`,background:`var(--bg-subtle)`},children:[e||t?(0,F.jsx)(`button`,{onClick:s,style:{padding:`3px 7px`,border:`none`,background:`none`,color:o?`var(--accent)`:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`},children:l(o?`i18n.copied`:`i18n.copy`)}):null,(r||n)&&(0,F.jsx)(`button`,{onClick:c,style:{marginLeft:`auto`,padding:`3px 7px`,border:`none`,background:`none`,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`},children:l(n?i?`i18n.collapse`:`i18n.expand`:a?`i18n.hideDetails`:`i18n.showDetails`)})]})}function use({detailsText:e}){return(0,F.jsx)(`pre`,{style:{margin:0,padding:`9px 10px`,borderTop:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,wordBreak:`break-word`,maxHeight:360,overflow:`auto`,fontFamily:`var(--font-mono)`,contentVisibility:`auto`,containIntrinsicBlockSize:360},children:e})}function dse({message:e,entryId:t,onFork:n,forking:r,onNavigate:i,prevAssistantEntryId:a,onEditContent:o,turnNumber:s}){let[c,l]=(0,d.useState)(!1),{text:u,images:f}=fse(e),p=_7(e.timestamp),m=!!t&&!!n,h=!!a&&!!i;return(0,F.jsxs)(`div`,{className:`msg-row`,style:{marginBottom:16,display:`flex`,flexDirection:`column`,alignItems:`flex-end`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,maxWidth:`85%`},children:[s!==void 0&&(0,F.jsx)(D$,{number:s}),(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0,position:`relative`,background:`var(--user-bg)`,border:`1px solid color-mix(in srgb, var(--accent) 20%, transparent)`,borderRadius:12,padding:`8px 12px`,fontSize:`var(--text-2xl)`,fontFamily:`var(--font-mono)`,lineHeight:1.6,color:`var(--text)`,wordBreak:`break-word`},children:[f.length>0&&(0,F.jsx)(pse,{images:f,content:u}),u&&(0,F.jsx)(`div`,{"data-testid":`user-message`,style:{whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:u})]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:6,marginTop:3},children:[(0,F.jsx)(mse,{copied:c,canFork:m,canNavigate:h,forking:r,onCopy:()=>{gK(u).then(()=>{l(!0),setTimeout(()=>l(!1),1500)})},onEditFromHere:()=>{i(a),o?.(u)},onFork:()=>{n(t)}}),p&&(0,F.jsx)(`span`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`},children:p})]})]})}function fse(e){return typeof e.content==`string`?{text:e.content,images:[]}:{text:e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
486
486
|
`),images:e.content.filter(e=>e.type===`image`)}}function pse({images:e,content:t}){return(0,F.jsx)(`div`,{style:{display:`flex`,gap:6,flexWrap:`wrap`,marginBottom:t?8:0},children:e.map((e,t)=>{let n=y7(e);return(0,F.jsx)(`img`,{src:n,alt:``,style:{maxWidth:240,maxHeight:240,borderRadius:6,objectFit:`contain`,display:`block`,border:`1px solid color-mix(in srgb, var(--accent) 15%, transparent)`}},t)})})}function mse({copied:e,canFork:t,canNavigate:n,forking:r,onCopy:i,onEditFromHere:a,onFork:o}){let{t:s}=I();return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`msg-row-actions`,style:{display:`flex`,gap:3,transition:`opacity 0.12s`},children:(0,F.jsxs)(`button`,{onClick:i,title:s(`i18n.copyMessage`),style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,height:22,background:`none`,border:`none`,borderRadius:5,color:e?`var(--accent)`:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`,"--hover-color":`var(--accent)`,"--hover-bg":`transparent`},className:e?void 0:`hover-shift`,children:[e?(0,F.jsx)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:R.lg,height:R.lg,rx:`2`,ry:`2`}),(0,F.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),s(e?`i18n.copied`:`i18n.copy`)]})}),(t||n)&&(0,F.jsxs)(`div`,{className:r?`msg-row-actions msg-actions-force`:`msg-row-actions`,style:{display:`flex`,gap:3,transition:`opacity 0.12s`},children:[n&&(0,F.jsxs)(`button`,{onClick:a,title:s(`i18n.editFromHereTitle`),style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,height:22,background:`none`,border:`none`,borderRadius:5,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`,"--hover-color":`var(--accent)`,"--hover-bg":`transparent`},className:`hover-shift`,children:[(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`polyline`,{points:`15 10 20 15 15 20`}),(0,F.jsx)(`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`})]}),s(`i18n.editFromHere`)]}),t&&(0,F.jsxs)(`button`,{onClick:o,disabled:r,title:s(r?`i18n.creatingSession`:`i18n.newSessionTitle`),style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,height:22,background:`none`,border:`none`,borderRadius:5,color:r?`var(--accent)`:`var(--text-dim)`,cursor:r?`not-allowed`:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`,"--hover-color":`var(--accent)`,"--hover-bg":`transparent`},className:r?void 0:`hover-shift`,children:[(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),s(r?`i18n.creating`:`i18n.newSession`)]})]})]})}function hse(e,t,n,r){if(n===r||t.role!==`assistant`)return!0;for(let i of t.content??[])if(i.type===`toolCall`&&n?.get(`${e}:${i.toolCallId}`)!==r?.get(`${e}:${i.toolCallId}`))return!1;return!0}function gse(e,t){return e.message===t.message&&e.isStreaming===t.isStreaming&&hse(e.entryId,e.message,e.toolResults,t.toolResults)&&e.modelNames===t.modelNames&&e.cwd===t.cwd&&e.showTimestamp===t.showTimestamp&&e.modelLabelVisible===t.modelLabelVisible&&e.recentExpandedBlockKeys===t.recentExpandedBlockKeys}function _se(e,t){return e.onOpenFile===t.onOpenFile&&e.entryId===t.entryId&&e.onFork===t.onFork&&e.forking===t.forking&&e.onNavigate===t.onNavigate&&e.prevAssistantEntryId===t.prevAssistantEntryId&&e.onEditContent===t.onEditContent&&e.sessionId===t.sessionId&&e.streamingBashOutput===t.streamingBashOutput}var T7=(0,d.memo)(function({message:e,isStreaming:t,toolResults:n,modelNames:r,cwd:i,onOpenFile:a,entryId:o,onFork:s,forking:c,onNavigate:l,prevAssistantEntryId:u,onEditContent:d,showTimestamp:f,turnStartTimestamp:p,sessionId:m,streamingBashOutput:h,recentExpandedBlockKeys:g,modelLabelVisible:_,turnNumber:v,isTurnFinalAssistant:y}){return e.role===`user`?(0,F.jsx)(dse,{message:e,entryId:o,onFork:s,forking:c,onNavigate:l,prevAssistantEntryId:u,onEditContent:d,turnNumber:v}):e.role===`assistant`?(0,F.jsx)(Woe,{message:e,isStreaming:t,toolResults:n,modelNames:r,cwd:i,onOpenFile:a,showTimestamp:f,turnStartTimestamp:p,sessionId:m,entryId:o,recentExpandedBlockKeys:g,modelLabelVisible:_,turnNumber:v,isTurnFinalAssistant:y}):e.role===`toolResult`?null:e.role===`custom`?e.customType===`compaction`?(0,F.jsx)(nse,{message:e}):(0,F.jsx)(ise,{message:e,cwd:i,onOpenFile:a}):e.role===`bashExecution`?(0,F.jsx)(qoe,{message:e,sessionId:m,streamingOutput:h}):null},(e,t)=>gse(e,t)&&_se(e,t));function vse(e,t){let n=new Map,r;for(let i=0;i<e.length;i++)e[i].role===`assistant`?r=t[i]:e[i].role===`toolResult`&&n.set(`${r}:${e[i].toolCallId}`,e[i]);return n}function yse(e){let t=new Map;{let n=0;for(let r=0;r<e.length;r++)e[r].role===`user`?(n+=1,t.set(r,n)):e[r].role===`assistant`&&n>0&&t.set(r,n)}return t}function bse(e,t){if(e[t]?.role!==`assistant`)return!1;for(let n=t+1;n<e.length;n++){let t=e[n].role;if(t===`user`)break;if(t===`assistant`)return!1}return!0}function xse(e){let t=-1;for(let n=e.length-1;n>=0;n--)if(e[n].role===`user`){t=n;break}return t}function Sse({messageRefs:e,lastUserMsgRef:t,lastUserIdx:n}){return(r,i)=>a=>{e.current[i]=a,r===n&&(t.current=a)}}function Cse({models:e,messageCount:t,toolCallCount:n,t:r}){let i=[`${t} ${r(t===1?`chat.message`:`chat.messages`)}`];return n>0&&i.push(`${n} ${r(n===1?`chat.toolCall`:`chat.toolCalls`)}`),(0,F.jsxs)(`div`,{"data-testid":`pd-group-header`,style:{display:`flex`,alignItems:`center`,gap:8,width:`auto`,minHeight:24,padding:`3px 10px`,border:`1px solid var(--border)`,borderRadius:8,background:`var(--bg-panel)`,color:`var(--text-muted)`,fontSize:`var(--text-base)`,lineHeight:1.6},children:[e.length>0&&(0,F.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:e.map((e,t)=>(0,F.jsxs)(`span`,{style:{whiteSpace:`nowrap`},children:[t>0&&(0,F.jsx)(`span`,{style:{color:`var(--text-muted)`},children:` / `}),(0,F.jsxs)(`span`,{style:{color:`var(--text-dim)`},children:[e.provider,`/`]}),(0,F.jsx)(`span`,{style:{fontWeight:700,color:`var(--text)`},children:e.name})]},`${e.provider}/${e.name}`))}),(0,F.jsx)(`span`,{style:{minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:i.join(` · `)})]})}function wse({messages:e,modelNames:t,t:n,renderMessage:r}){let i=e=>e.role!==`assistant`||!e.provider||!e.model?null:{provider:e.provider,name:t?.[`${e.provider}/${e.model}`]??t?.[e.model]??e.model};return{renderRow:t=>{if(t.kind===`groupHeader`){let r=[];for(let n=t.groupUserIdx+1;n<=t.finalAssistantIdx;n++){let t=e[n];if(t?.role!==`assistant`)continue;let a=i(t);a&&!r.some(e=>`${e.provider}/${e.name}`==`${a.provider}/${a.name}`)&&r.push(a)}return(0,F.jsx)(Cse,{models:r,messageCount:t.messageCount,toolCallCount:t.toolCallCount,t:n})}return r(t.msgIdx,{attachRef:t.attachRef,messageOverride:t.messageOverride,showTimestamp:t.showTimestamp,modelLabelVisible:t.isProcess||t.isProcessFinal?!1:void 0,isAnswer:t.isAnswer})},rowMargin:e=>e.kind===`groupHeader`?8:e.isProcess||e.isProcessFinal?e.groupLast?14:8:0}}function Tse(e,t,n,r){if(!(t.role!==`user`&&!(t.role===`assistant`&&n)))return r.get(e)}function Ese(e,t,n,r,i){if(n.showTimestamp!==void 0)return n.showTimestamp;if(t.role!==`assistant`)return!1;let a=!0;for(let t=e+1;t<r.length;t++){let e=r[t].role;if(e===`user`)break;if(e===`assistant`){a=!1;break}}return a&&i&&e===r.length-1?!1:a}function Dse(e,t){if(t[e]?.role===`assistant`){for(let n=e-1;n>=0;n--)if(t[n].role===`user`)return t[n].timestamp}}function Ose(e,t,n,r){return t.role===`user`&&e>0&&n[e-1].role===`assistant`?r[e-1]:void 0}function kse(e,t,n,r){return e||t||n===0&&r.role===`user`}function Ase(e){let{rows:t,messages:n,entryIds:r,modelNames:i,messageCwd:a,onOpenFile:o,sessionBusy:s,isNew:c,handleFork:l,forkingEntryId:u,handleNavigate:f,handleEditContent:p,sessionId:m,recentExpandedBlockKeys:h,isStreaming:g,flashKey:_,itemRef:v,t:y,messageRefs:b,lastUserMsgRef:x,visibleRefIndexByMessage:S,scrollContainerRef:C,virtualizerRef:w,initialCache:T}=e,E=(0,d.useRef)(!1);(0,d.useLayoutEffect)(()=>{if(E.current)return;E.current=!0;let e=C.current;e&&e.scrollHeight>e.clientHeight&&(e.scrollTop=e.scrollHeight)},[C]);let D=vse(n,r),O=yse(n),k=Sse({messageRefs:b,lastUserMsgRef:x,lastUserIdx:xse(n)}),{renderRow:A,rowMargin:j}=wse({messages:n,modelNames:i,t:y,renderMessage:(e,t={})=>{let d=t.messageOverride??n[e],_=Ose(e,d,n,r),v=d.role===`user`||d.role===`assistant`,y=S.get(e),b=Ese(e,d,t,n,g),x=Dse(e,n),C=kse(s,c,e,d),w=(0,F.jsx)(T7,{message:d,toolResults:D,modelNames:i,cwd:a,onOpenFile:o,entryId:r[e],onFork:C?void 0:l,forking:u===r[e],onNavigate:s?void 0:f,prevAssistantEntryId:s?void 0:_,onEditContent:p,showTimestamp:b,turnStartTimestamp:x,sessionId:m,recentExpandedBlockKeys:h,modelLabelVisible:t.modelLabelVisible,turnNumber:Tse(e,d,t.isAnswer,O),isTurnFinalAssistant:bse(n,e)},`message-view-${e}`);return!v||t.attachRef===!1||y===void 0?w:(0,F.jsx)(`div`,{ref:k(e,y),children:w},`message-ref-${e}`)}});return(0,F.jsx)(r7,{ref:w,data:t,cache:T,itemSize:200,bufferSize:400,scrollRef:C,children:e=>{let t=e.kind===`groupHeader`&&e.processRefIdx!==void 0?t=>{b.current[e.processRefIdx]=t}:void 0;return(0,F.jsx)(`div`,{className:_===e.key?`search-flash`:void 0,ref:v(e.key,t),style:{marginBottom:j(e)},children:A(e)},e.key)}})}function E7({msg:e,onSend:t,onFillInput:n,testId:r}){let{t:i,locale:a}=I(),o=Bt(e.message,a),s=Bt(e.label,a),c=()=>{if(e.allowAppend&&n){n(`${o} `);return}t(o)},l=`${e.allowAppend?i(`config.widgets.fillToChatInputTooltip`):i(`config.widgets.sendImmediatelyTooltip`)}${o}`;return(0,F.jsx)(L,{label:l,children:(0,F.jsx)(Vm,{label:s,title:l,onClick:c,testId:r})})}function D7({messages:e,onSend:t,onFillInput:n,testIdPrefix:r=`quick-msg`,wrapperTestId:i=`quick-message-buttons`,center:a=!1}){return e.length===0?null:(0,F.jsx)(`div`,{"data-testid":i,style:{display:`flex`,flexWrap:`wrap`,gap:6,justifyContent:a?`center`:`flex-start`,paddingTop:8,borderTop:a?`1px solid var(--border)`:void 0},children:e.map((e,i)=>(0,F.jsx)(E7,{msg:e,onSend:t,onFillInput:n,testId:`${r}-${i}`},i))})}function jse({chatInputElement:e,startScreenMessages:t,aiIdle:n,isMobile:r,onQuickMessageSend:i,onFillInput:a}){return(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{style:{padding:`0 16px`,paddingRight:r?16:64},children:(0,F.jsx)(`div`,{style:{maxWidth:820,margin:`0 auto`}})}),t.length>0&&n&&(0,F.jsx)(`div`,{style:{padding:`0 16px`,paddingRight:r?16:64},children:(0,F.jsx)(`div`,{style:{maxWidth:820,margin:`0 auto`,paddingBottom:8},children:(0,F.jsx)(D7,{messages:t,onSend:i,onFillInput:a,testIdPrefix:`start-screen-msg`,wrapperTestId:`start-screen-messages`})})}),e]})}var O7=null,k7=new Set,A7=null;function j7(){return!A7&&typeof PointerEvent<`u`&&(A7=new PointerEvent(`pointermove`)),A7}var M7=[],N7=0;function P7(){O7===null&&(O7=requestAnimationFrame(()=>{if(O7=null,k7.size===0)return;let e=0;for(let t of k7)M7[e++]=t;M7.length=e,k7.clear();for(let t=0;t<e;t++)M7[t].update();for(let t=0;t<e;t++)M7[t]=null;M7.length=0,k7.size>0&&P7()}))}var F7=class e{get enabled(){return this._enabled}set enabled(e){this._enabled=e,!e&&this.isActive&&this.cancel()}cancel(){if(!this.isActive&&this.pointers.size===0)return;let t=this.isActive,n=j7(),r=t?this.createEvent(n):null;this.pointers.clear(),this.pointersCache.length=0,this.isActive=!1,t&&N7>0&&N7--,k7.delete(this),e.activeInstance.get(this.element)===this&&e.activeInstance.set(this.element,null),this.clearHoldTimers(),this.removeDocumentListeners(),r&&(this.options.onCancel?.(r),this.options.onEnd?.(r))}clearHoldTimers(){this.holdTimer&&=(clearTimeout(this.holdTimer),null),this.holdEventTimer&&=(clearTimeout(this.holdEventTimer),null)}removeDocumentListeners(){document.removeEventListener(`pointermove`,this.onPointerMove),document.removeEventListener(`pointerup`,this.onPointerUp),document.removeEventListener(`pointercancel`,this.onPointerUp)}getRect(e=this.element){return this.options.rectChecker?this.options.rectChecker(e):e.getBoundingClientRect()}getOrigin(){let e={x:0,y:0};return this.resolveOriginInto(e),e}resolveOriginInto(e){let t=this.options.origin;if(!t){e.x=0,e.y=0;return}if(t===`parent`){let t=this.element.offsetParent;if(!t){e.x=0,e.y=0;return}let n=this.getRect(t);e.x=n.left,e.y=n.top;return}if(t instanceof HTMLElement){let n=this.getRect(t);e.x=n.left,e.y=n.top;return}e.x=t.x,e.y=t.y}rebuildPointersCache(){let e=this.pointersCache;e.length=0;for(let t of this.pointers.values())e.push(t)}updateOptions(e){Object.assign(this.options,e),`touchAction`in e&&(this.element.style.touchAction=this.options.touchAction??`none`)}get interacting(){return this.isActive}static{this.elementInstances=new WeakMap}static{this.activeInstance=new WeakMap}static{this.elementListeners=new WeakMap}constructor(t,n={}){this.pointers=new Map,this.pointersCache=[],this.isActive=!1,this.lastUpdate=0,this.priority=0,this._enabled=!0,this.holdTimer=null,this.holdEventTimer=null,this.lastTapTime=0,this.lastTapTarget=null,this._originScratch={x:0,y:0},this._cachedEvent={target:null,pointers:[],isPrimary:!0,originalEvent:null},this.element=t,this.options={threshold:3,preventScroll:!0,styleCursor:!0,...n},this.registerInstance();let r=e.elementInstances.get(t);if(r&&r.length===1&&(t.style.touchAction=this.options.touchAction??`none`,t.style.userSelect=`none`,t.style.webkitUserSelect=`none`),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),r&&r.length===1){let n=n=>e.handleElementPointerDown(t,n);e.elementListeners.set(t,n),t.addEventListener(`pointerdown`,n)}}registerInstance(){let t=e.elementInstances.get(this.element);t?t.push(this):e.elementInstances.set(this.element,[this])}unregisterInstance(){let t=e.elementInstances.get(this.element);if(!t)return;let n=t.indexOf(this);n>=0&&(t.splice(n,1),t.length===0?(e.elementInstances.delete(this.element),e.activeInstance.delete(this.element),e.elementListeners.delete(this.element)):e.elementInstances.set(this.element,t))}shouldHandleEvent(e){return!0}checkEventFilters(e){let t=e.target;return!t||!(this.options.ignoreFrom&&t.closest(this.options.ignoreFrom)||this.options.allowFrom&&!t.closest(this.options.allowFrom))}static handleElementPointerDown(t,n){let r=e.elementInstances.get(t);if(!r)return;let i=e.activeInstance.get(t);if(i){i.onPointerDown(n);return}let a=null,o=-1;for(let e of r)e.checkEventFilters(n)&&e.shouldHandleEvent(n)&&e.enabled&&e.priority>o&&(a=e,o=e.priority);a&&(e.activeInstance.set(t,a),a.handlePointerDown(n))}onPointerDown(e){this.handlePointerDown(e)}handlePointerDown(e){if(this.options.mouseButtons&&!(e.buttons&this.options.mouseButtons))return;this.options.preventScroll&&e.preventDefault(),this.resolveOriginInto(this._originScratch);let t=e.clientX-this._originScratch.x,n=e.clientY-this._originScratch.y,r={id:e.pointerId,start:{x:t,y:n},current:{x:t,y:n},previous:{x:t,y:n},delta:{x:0,y:0},total:{x:0,y:0},velocity:{x:0,y:0},timestamp:e.timeStamp};this.pointers.set(e.pointerId,r),this.rebuildPointersCache(),this.pointers.size===1&&(document.addEventListener(`pointermove`,this.onPointerMove,{passive:!this.options.preventScroll}),document.addEventListener(`pointerup`,this.onPointerUp),document.addEventListener(`pointercancel`,this.onPointerUp)),this.options.onHold&&(this.holdEventTimer&&clearTimeout(this.holdEventTimer),this.holdEventTimer=setTimeout(()=>{this.holdEventTimer=null,this.pointers.size>0&&!this.isActive&&this.options.onHold(this.createEvent(e))},this.options.holdDuration??600));let i=this.options.holdDelay??0;i>0?(this.holdTimer&&clearTimeout(this.holdTimer),this.holdTimer=setTimeout(()=>{this.holdTimer=null,!this.isActive&&this.pointers.size>0&&this.start(e)},i)):this.options.threshold===0&&this.start(e)}onPointerMove(e){let t=this.pointers.get(e.pointerId);if(!t)return;this.resolveOriginInto(this._originScratch);let n=e.clientX-this._originScratch.x,r=e.clientY-this._originScratch.y;if(t.current.x!==n||t.current.y!==r){if(t.current.x=n,t.current.y=r,!this.isActive){let n=t.current.x-t.start.x,r=t.current.y-t.start.y;Math.sqrt(n*n+r*r)>=(this.options.threshold||3)&&(this.holdTimer&&=(clearTimeout(this.holdTimer),null),this.holdEventTimer&&=(clearTimeout(this.holdEventTimer),null),this.start(e))}this.isActive&&(this.options.preventScroll&&e.preventDefault(),k7.add(this),P7())}}onPointerUp(e){if(this.pointers.get(e.pointerId)&&(this.pointers.delete(e.pointerId),this.rebuildPointersCache(),this.clearHoldTimers(),this.pointers.size===0)){if(this.removeDocumentListeners(),this.isActive)this.end(e);else{let t=this.createEvent(e);this.options.onTap&&this.options.onTap(t);let n=e.timeStamp,r=this.options.doubleTapDelay??300;this.options.onDoubleTap&&n-this.lastTapTime<r&&this.lastTapTarget===e.target&&this.options.onDoubleTap(t),this.lastTapTime=n,this.lastTapTarget=e.target}}}start(e){this.isActive=!0,N7++;let t=this.createEvent(e);this.options.onStart&&this.options.onStart(t)}startFromEvent(t){this.isActive||this.pointers.has(t.pointerId)||(e.activeInstance.set(this.element,this),this.handlePointerDown(t),this.isActive||this.start(t))}end(t){this.isActive=!1,k7.delete(this),N7>0&&N7--,e.activeInstance.get(this.element)===this&&e.activeInstance.set(this.element,null);let n=this.createEvent(t);this.options.onEnd&&this.options.onEnd(n)}update(){if(!this.isActive||this.pointers.size===0)return;let e=performance.now(),t=this.lastUpdate===0?16:e-this.lastUpdate;this.lastUpdate=e;let n=t>0?1-Math.exp(-t/50):.3,r=!1;for(let e of this.pointers.values()){let i=e.current.x-e.previous.x,a=e.current.y-e.previous.y;if(i!==0||a!==0){if(r=!0,e.delta.x=i,e.delta.y=a,e.total.x=e.current.x-e.start.x,e.total.y=e.current.y-e.start.y,t>0){let r=i/t*1e3,o=a/t*1e3;e.velocity.x=e.velocity.x*(1-n)+r*n,e.velocity.y=e.velocity.y*(1-n)+o*n}e.previous.x=e.current.x,e.previous.y=e.current.y}else t>0&&(e.velocity.x*=1-n,e.velocity.y*=1-n)}r&&this.options.onMove&&this.options.onMove(this.populateEvent(j7()))}populateEvent(e){let t=this._cachedEvent;return t.target=this.element,t.pointers=this.pointersCache,t.isPrimary=e.isPrimary,t.originalEvent=e,t}createEvent(e){return this.populateEvent(e)}destroy(){this.clearHoldTimers(),this.unregisterInstance();let t=e.elementInstances.get(this.element);if(!t||t.length===0){let t=e.elementListeners.get(this.element);t&&(this.element.removeEventListener(`pointerdown`,t),e.elementListeners.delete(this.element)),this.element.style.touchAction=``,this.element.style.userSelect=``,this.element.style.webkitUserSelect=``}this.pointers.size>0&&this.removeDocumentListeners(),k7.delete(this),this.pointers.clear(),this.pointersCache.length=0}},I7=null;function Mse(){if(I7!==null)return I7;if(typeof window>`u`||!window.matchMedia)return I7=!1,!1;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);return I7=e.matches,typeof e.addEventListener==`function`&&e.addEventListener(`change`,e=>{I7=e.matches}),I7}function L7(e,t){for(let n=0;n<e.length;n++)e[n].modify(t);return t}var R7={instructions:`Press Space or Enter to pick up. Use arrow keys to move. Press Space or Enter to drop. Press Escape to cancel.`,pickedUp:(e,t,n)=>`Picked up ${e}, position ${t} of ${n}`,movedTo:(e,t)=>`Moved to position ${e} of ${t}`,dropped:(e,t,n)=>`Dropped ${e} in position ${t} of ${n}`,dragPickedUp:`Picked up`,dragDropped:`Dropped`};function z7(){return R7}var B7=null;function Nse(){return B7&&B7.isConnected?B7:(B7=document.createElement(`div`),B7.setAttribute(`aria-live`,`assertive`),B7.setAttribute(`aria-atomic`,`true`),B7.setAttribute(`role`,`status`),B7.style.cssText=`position:fixed;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,document.body.appendChild(B7),B7)}var V7=``;function H7(e){let t=Nse();t.textContent=e===V7?e+`\xA0`:e,V7=e}var U7=null,W7=`pointrix-instructions`;function Pse(){return U7&&U7.isConnected?(U7.textContent=R7.instructions,W7):(U7=document.createElement(`div`),U7.id=W7,U7.style.cssText=`position:fixed;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,U7.textContent=R7.instructions,document.body.appendChild(U7),W7)}function Fse(e){e.hasAttribute(`tabindex`)||e.setAttribute(`tabindex`,`0`),e.hasAttribute(`role`)||e.setAttribute(`role`,`button`),e.setAttribute(`aria-roledescription`,`draggable`),e.setAttribute(`aria-describedby`,Pse())}function G7(e,t){e.setAttribute(`aria-grabbed`,String(t))}function Ise(e){e.removeAttribute(`aria-roledescription`),e.removeAttribute(`aria-grabbed`),e.removeAttribute(`aria-describedby`)}var K7=new class{constructor(){this.zones=new Set,this._activeDragCount=0,this._refreshBound=()=>this.refreshRects()}register(e){this.zones.add(e)}unregister(e){this.zones.delete(e)}refreshRects(){for(let e of this.zones)e.isActive&&e.refreshRect()}onDragStart(e){for(let t of this.zones)t.accepts(e)&&(t.activate(e),t.refreshRect());this._activeDragCount===0&&typeof window<`u`&&(window.addEventListener(`scroll`,this._refreshBound,{passive:!0,capture:!0}),window.addEventListener(`resize`,this._refreshBound,{passive:!0})),this._activeDragCount++}onDragMove(e,t,n,r){let i,a=!1;for(let e of this.zones)if(e.isActive&&(e.options.overlap??`pointer`)!==`pointer`){a=!0;break}a&&(i=r?r():e.getBoundingClientRect());for(let r of this.zones){if(!r.isActive)continue;let a=r.checkOverlap(e,t,i);a>0?(r.isOver||r.enter(e,a,n),r.over(e,a,n)):r.isOver&&r.leave(e,n)}}onDragEnd(e,t,n,r){for(let i of this.zones)if(i.isActive){if(i.isOver){let a=r?.(),o=i.checkOverlap(e,t,a);i.drop(e,o>0?o:1,n)}i.deactivate(e),i.clearRect()}this._activeDragCount>0&&this._activeDragCount--,this._activeDragCount===0&&typeof window<`u`&&(window.removeEventListener(`scroll`,this._refreshBound,{capture:!0}),window.removeEventListener(`resize`,this._refreshBound))}getActiveZones(){let e=[];for(let t of this.zones)t.isActive&&e.push(t);return e}getHoveredZones(){let e=[];for(let t of this.zones)t.isOver&&e.push(t);return e}},Lse=class extends F7{constructor(e,t={}){super(e,{...t,onStart:e=>{this.handleDragStart(e),t.onStart?.(e)},onMove:e=>{this.handleDragMove(e),t.onMove?.(e)},onEnd:e=>{this.handleDragEnd(e),t.onEnd?.(e)}}),this.transform={x:0,y:0},this.startTransform={x:0,y:0},this.bounds=null,this.momentum={vx:0,vy:0,active:!1},this.transformNormalized=!1,this.detectedAxis=null,this.cachedSize={width:0,height:0},this._boundGetRect=()=>this.getRect(),this.modifierContext={position:{x:0,y:0},velocity:{x:0,y:0},element:null,startPosition:{x:0,y:0},delta:{x:0,y:0},size:{width:0,height:0}},this.cachedDragEvent={target:null,originalEvent:null,pointers:[],isPrimary:!0,dx:0,dy:0,totalX:0,totalY:0,velocityX:0,velocityY:0},this.dragOptions=t,this.priority=5,t.styleCursor!==!1&&(e.style.cursor=t.cursorChecker?t.cursorChecker(`idle`):`grab`),t.aria!==!1&&Fse(e)}shouldHandleEvent(e){if(!this.dragOptions.handle)return!0;let t=null;return t=typeof this.dragOptions.handle==`string`?this.element.querySelector(this.dragOptions.handle):this.dragOptions.handle,t?t.contains(e.target):!1}readCurrentTransform(e){let t=window.getComputedStyle(e).transform;if(t&&t!==`none`){let e=t.match(/matrix.*\((.+)\)/);if(e){let t=e[1].split(`, `);this.transform.x=parseFloat(t[4])||0,this.transform.y=parseFloat(t[5])||0}}else this.transformNormalized||(this.transform.x=0,this.transform.y=0);this.transformNormalized||=(e.style.transform=`translate3d(${this.transform.x}px, ${this.transform.y}px, 0)`,!0)}handleDragStart(e){let t=e.target;if(this.dragOptions.aria!==!1&&(G7(t,!0),H7(z7().dragPickedUp)),this.detectedAxis=null,this.readCurrentTransform(t),this.dragOptions.styleCursor!==!1&&(t.style.cursor=this.dragOptions.cursorChecker?this.dragOptions.cursorChecker(`grabbing`):`grabbing`),t.style.willChange=`transform`,this.startTransform.x=this.transform.x,this.startTransform.y=this.transform.y,this.dragOptions.bounds){let e=this.getRect(t),n=this.startTransform.x,r=this.startTransform.y,i;if(this.dragOptions.bounds===`parent`){let e=t.offsetParent||document.body,n=this.getRect(e);i={left:n.left,top:n.top,right:n.right,bottom:n.bottom}}else if(this.dragOptions.bounds instanceof HTMLElement){let e=this.getRect(this.dragOptions.bounds);i={left:e.left,top:e.top,right:e.right,bottom:e.bottom}}else{let e=this.dragOptions.bounds;i={left:e.left??-1/0,top:e.top??-1/0,right:e.right??1/0,bottom:e.bottom??1/0}}let a=i.left-e.left+n,o=i.top-e.top+r,s=i.right-e.right+n,c=i.bottom-e.bottom+r;this.bounds=new DOMRect(a,o,s-a,c-o)}this.momentum.active=!1;let n=this.getRect(e.target);if(this.cachedSize.width=n.width,this.cachedSize.height=n.height,this.dragOptions.modifiers?.length){let t=this.modifierContext;t.position.x=this.startTransform.x,t.position.y=this.startTransform.y,t.velocity.x=0,t.velocity.y=0,t.element=e.target,t.startPosition.x=this.startTransform.x,t.startPosition.y=this.startTransform.y,t.delta.x=0,t.delta.y=0,t.size.width=this.cachedSize.width,t.size.height=this.cachedSize.height;for(let e of this.dragOptions.modifiers)e.onStart?.(t)}this.dragOptions.onDragStart&&this.dragOptions.onDragStart(this.createDragEvent(e,0,0)),this.dragOptions.droppable&&K7.onDragStart(e.target)}handleDragMove(e){let t=e.pointers[0],n=t.total.x,r=t.total.y;if(this.dragOptions.axis===`auto`&&this.detectedAxis===null){let e=Math.abs(n),t=Math.abs(r);(e>0||t>0)&&(this.detectedAxis=e>t?`x`:`y`)}let i=this.dragOptions.axis===`auto`?this.detectedAxis:this.dragOptions.axis;i===`x`?r=0:i===`y`&&(n=0);let a=this.startTransform.x+n,o=this.startTransform.y+r;if(this.dragOptions.grid&&(a=Math.round(a/this.dragOptions.grid.x)*this.dragOptions.grid.x,o=Math.round(o/this.dragOptions.grid.y)*this.dragOptions.grid.y),this.bounds&&(a=Math.max(this.bounds.left,Math.min(a,this.bounds.right)),o=Math.max(this.bounds.top,Math.min(o,this.bounds.bottom))),this.dragOptions.modifiers?.length){let n=this.modifierContext;n.position.x=a,n.position.y=o,n.velocity.x=t.velocity.x,n.velocity.y=t.velocity.y,n.element=e.target,n.startPosition.x=this.startTransform.x,n.startPosition.y=this.startTransform.y,n.delta.x=t.delta.x,n.delta.y=t.delta.y,n.size.width=this.cachedSize.width,n.size.height=this.cachedSize.height,L7(this.dragOptions.modifiers,n),a=n.position.x,o=n.position.y}this.transform.x=a,this.transform.y=o,this.applyTransform(e.target),this.dragOptions.momentum&&(this.momentum.vx=t.velocity.x,this.momentum.vy=t.velocity.y);let s=this.createDragEvent(e,n,r);this.dragOptions.onDragMove&&this.dragOptions.onDragMove(s),this.dragOptions.droppable&&K7.onDragMove(e.target,t.current,s,this._boundGetRect)}handleDragEnd(e){let t=e.target;this.dragOptions.aria!==!1&&(G7(t,!1),H7(z7().dragDropped)),this.dragOptions.styleCursor!==!1&&(t.style.cursor=this.dragOptions.cursorChecker?this.dragOptions.cursorChecker(`grab`):`grab`);let n=this.transform.x-this.startTransform.x,r=this.transform.y-this.startTransform.y,i=this.dragOptions.momentum,a=typeof i==`object`?i.minVelocity??10:10;if(i&&(Math.abs(this.momentum.vx)>a||Math.abs(this.momentum.vy)>a)?this.startMomentum():t.style.willChange=``,this.dragOptions.modifiers?.length){let i=e.pointers[0],a=this.modifierContext;a.position.x=this.transform.x,a.position.y=this.transform.y,a.velocity.x=i?.velocity.x??0,a.velocity.y=i?.velocity.y??0,a.element=e.target,a.startPosition.x=this.startTransform.x,a.startPosition.y=this.startTransform.y,a.delta.x=n,a.delta.y=r,a.size.width=this.cachedSize.width,a.size.height=this.cachedSize.height;for(let e of this.dragOptions.modifiers)e.onEnd?.(a);let o=a.position.x,s=a.position.y;if(o!==this.transform.x||s!==this.transform.y){if(this.transform.x=o,this.transform.y=s,Mse())this.applyTransform(t);else{t.style.transition=`transform 300ms cubic-bezier(0.25, 1, 0.5, 1)`,this.applyTransform(t);let e=()=>{t.style.transition=``,t.removeEventListener(`transitionend`,e)};t.addEventListener(`transitionend`,e)}}}if(this.dragOptions.droppable){let t=e.pointers[0]?.current??{x:0,y:0};K7.onDragEnd(e.target,t,this.createDragEvent(e,n,r),this._boundGetRect)}this.dragOptions.onDragEnd&&this.dragOptions.onDragEnd(this.createDragEvent(e,n,r))}startMomentum(){this.momentum.active=!0;let e=this.dragOptions.momentum,t=typeof e==`object`?e.friction??.95:.95,n=typeof e==`object`?e.minSpeed??.1:.1,r=performance.now(),i=e=>{if(!this.momentum.active)return;let a=Math.min(100,e-r)/1e3;r=e;let o=t**+a;if(this.momentum.vx*=o,this.momentum.vy*=o,Math.abs(this.momentum.vx)<n&&Math.abs(this.momentum.vy)<n){this.momentum.active=!1,this.element.style.willChange=``;return}this.transform.x+=this.momentum.vx*a,this.transform.y+=this.momentum.vy*a,this.bounds&&((this.transform.x<this.bounds.left||this.transform.x>this.bounds.right)&&(this.momentum.vx*=-.5,this.transform.x=Math.max(this.bounds.left,Math.min(this.transform.x,this.bounds.right))),(this.transform.y<this.bounds.top||this.transform.y>this.bounds.bottom)&&(this.momentum.vy*=-.5,this.transform.y=Math.max(this.bounds.top,Math.min(this.transform.y,this.bounds.bottom)))),this.applyTransform(this.element),requestAnimationFrame(i)};requestAnimationFrame(i)}applyTransform(e){e.style.transform=`translate3d(${this.transform.x}px, ${this.transform.y}px, 0)`}createDragEvent(e,t,n){let r=e.pointers[0],i=this.cachedDragEvent;return i.target=e.target,i.originalEvent=e.originalEvent,i.pointers=e.pointers,i.isPrimary=e.isPrimary,i.dx=r?.delta.x||0,i.dy=r?.delta.y||0,i.totalX=t,i.totalY=n,i.velocityX=r?.velocity.x||0,i.velocityY=r?.velocity.y||0,i}setPosition(e,t){this.transform.x=e,this.transform.y=t,this.applyTransform(this.element)}getPosition(){return{...this.transform}}updateOptions(e){super.updateOptions(e),Object.assign(this.dragOptions,e),(`cursorChecker`in e||`styleCursor`in e)&&!this.interacting&&(this.dragOptions.styleCursor===!1?this.element.style.cursor=``:this.element.style.cursor=this.dragOptions.cursorChecker?this.dragOptions.cursorChecker(`idle`):`grab`)}destroy(){super.destroy(),this.element.style.cursor=``,this.element.style.willChange=``,this.momentum.active=!1,this.dragOptions.aria!==!1&&Ise(this.element)}},Rse=class extends F7{constructor(e,t={}){let n={edges:{top:!0,right:!0,bottom:!0,left:!0},handleSize:10,minWidth:50,minHeight:50,...t};super(e,{...n,threshold:0,onStart:e=>{this.handleResizeStart(e),t.onStart?.(e)},onMove:e=>{this.handleResizeMove(e),t.onMove?.(e)},onEnd:e=>{this.handleResizeEnd(e),t.onEnd?.(e)}}),this.startSize={width:0,height:0},this.startPos={x:0,y:0},this.currentSize={width:0,height:0},this.currentPos={x:0,y:0},this.activeEdge=null,this.edgeFlags={top:!1,right:!1,bottom:!1,left:!1},this.aspectRatio=null,this.transformNormalized=!1,this.modifierContext={position:{x:0,y:0},velocity:{x:0,y:0},element:null,startPosition:{x:0,y:0},delta:{x:0,y:0},edges:{top:!1,right:!1,bottom:!1,left:!1},size:{width:0,height:0},startSize:{width:0,height:0}},this.cachedResizeEvent={target:null,originalEvent:null,pointers:[],isPrimary:!0,width:0,height:0,deltaWidth:0,deltaHeight:0,edges:{top:!1,right:!1,bottom:!1,left:!1}},this.resizeOptions=n,this.resizeOptions.square&&(this.resizeOptions.aspectRatio=1),this.priority=10,this.boundUpdateCursor=this.updateCursor.bind(this),e.addEventListener(`pointermove`,this.boundUpdateCursor),e.style.position=`relative`}normalizeInitialTransform(e){let t=window.getComputedStyle(e).transform;if(t&&t!==`none`){let n=t.match(/matrix.*\((.+)\)/);if(n){let t=n[1].split(`, `),r=parseFloat(t[4])||0,i=parseFloat(t[5])||0;e.style.transform=`translate3d(${r}px, ${i}px, 0)`}}}shouldHandleEvent(e){return this.detectEdge(e)!==null}updateCursor(e){if(this.activeEdge)return;let t=this.detectEdge(e);this.element.style.cursor=this.resizeOptions.cursorChecker?this.resizeOptions.cursorChecker(t):this.getCursor(t)}detectEdge(e){let t=this.getRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=this.resizeOptions.handleSize||10,a=this.resizeOptions.edges||{},o=a.top&&r<i,s=a.bottom&&r>t.height-i,c=a.left&&n<i,l=a.right&&n>t.width-i;return o&&c?`top-left`:o&&l?`top-right`:s&&c?`bottom-left`:s&&l?`bottom-right`:o?`top`:s?`bottom`:c?`left`:l?`right`:null}getCursor(e){switch(e){case`top`:case`bottom`:return`ns-resize`;case`left`:case`right`:return`ew-resize`;case`top-left`:case`bottom-right`:return`nwse-resize`;case`top-right`:case`bottom-left`:return`nesw-resize`;default:return``}}handleResizeStart(e){this.transformNormalized||=(this.normalizeInitialTransform(this.element),!0);let t=this.getRect(),n=window.getComputedStyle(this.element);if(this.activeEdge=this.detectEdge(e.originalEvent),!this.activeEdge)return;this.edgeFlags.top=this.activeEdge.includes(`top`),this.edgeFlags.right=this.activeEdge.includes(`right`),this.edgeFlags.bottom=this.activeEdge.includes(`bottom`),this.edgeFlags.left=this.activeEdge.includes(`left`),this.startSize={width:parseFloat(n.width)||t.width,height:parseFloat(n.height)||t.height},this.currentSize={...this.startSize};let r=n.transform;if(r&&r!==`none`){let e=r.match(/matrix.*\((.+)\)/);if(e){let t=e[1].split(`, `);this.startPos.x=parseFloat(t[4])||0,this.startPos.y=parseFloat(t[5])||0}}else this.startPos.x=0,this.startPos.y=0;this.currentPos={...this.startPos},this.resizeOptions.aspectRatio===`preserve`?this.aspectRatio=this.startSize.width/this.startSize.height:typeof this.resizeOptions.aspectRatio==`number`&&(this.aspectRatio=this.resizeOptions.aspectRatio),this.element.style.willChange=`width, height, transform`,this.resizeOptions.onResizeStart&&this.resizeOptions.onResizeStart(this.createResizeEvent(e,0,0))}handleResizeMove(e){if(!this.activeEdge)return;let t=e.pointers[0],n=t.total.x,r=t.total.y,i=this.startSize.width,a=this.startSize.height,o=this.startPos.x,s=this.startPos.y;this.edgeFlags.right&&(i+=n),this.edgeFlags.left&&(i-=n,o+=n),this.edgeFlags.bottom&&(a+=r),this.edgeFlags.top&&(a-=r,s+=r);let c=this.resizeOptions.invert||`none`;c===`reposition`&&(i<0&&(o+=i,i=-i),a<0&&(s+=a,a=-a));let l=c===`negate`?-1/0:this.resizeOptions.minWidth||0,u=c===`negate`?-1/0:this.resizeOptions.minHeight||0,d=this.resizeOptions.maxWidth||1/0,f=this.resizeOptions.maxHeight||1/0,p=c===`reposition`?1:l||50,m=c===`reposition`?1:u||50;if(this.aspectRatio&&(this.activeEdge===`left`||this.activeEdge===`right`?a=i/this.aspectRatio:this.activeEdge===`top`||this.activeEdge===`bottom`?i=a*this.aspectRatio:Math.abs(i-this.startSize.width)>Math.abs(a-this.startSize.height)?a=i/this.aspectRatio:i=a*this.aspectRatio),i<p&&(this.edgeFlags.left&&(o+=i-p),i=p,this.aspectRatio&&(a=i/this.aspectRatio)),i>d&&(this.edgeFlags.left&&(o+=i-d),i=d,this.aspectRatio&&(a=i/this.aspectRatio)),a<m&&(this.edgeFlags.top&&(s+=a-m),a=m,this.aspectRatio&&(i=a*this.aspectRatio)),a>f&&(this.edgeFlags.top&&(s+=a-f),a=f,this.aspectRatio&&(i=a*this.aspectRatio)),this.resizeOptions.grid&&(i=Math.round(i/this.resizeOptions.grid.width)*this.resizeOptions.grid.width,a=Math.round(a/this.resizeOptions.grid.height)*this.resizeOptions.grid.height),this.resizeOptions.modifiers?.length){let e=this.modifierContext;e.position.x=o,e.position.y=s,e.velocity.x=t.velocity?.x??0,e.velocity.y=t.velocity?.y??0,e.element=this.element,e.startPosition.x=this.startPos.x,e.startPosition.y=this.startPos.y,e.delta.x=n,e.delta.y=r,e.edges.top=this.edgeFlags.top,e.edges.right=this.edgeFlags.right,e.edges.bottom=this.edgeFlags.bottom,e.edges.left=this.edgeFlags.left,e.size.width=i,e.size.height=a,e.startSize.width=this.startSize.width,e.startSize.height=this.startSize.height,L7(this.resizeOptions.modifiers,e),o=e.position.x,s=e.position.y,i=e.size.width,a=e.size.height}if(this.currentSize={width:i,height:a},this.currentPos={x:o,y:s},this.element.style.width=`${i}px`,this.element.style.height=`${a}px`,(o!==this.startPos.x||s!==this.startPos.y)&&(this.element.style.transform=`translate3d(${o}px, ${s}px, 0)`),this.resizeOptions.onResizeMove){let t=i-this.startSize.width,n=a-this.startSize.height;this.resizeOptions.onResizeMove(this.createResizeEvent(e,t,n))}}handleResizeEnd(e){if(this.element.style.willChange=``,this.activeEdge=null,this.resizeOptions.onResizeEnd){let t=this.currentSize.width-this.startSize.width,n=this.currentSize.height-this.startSize.height;this.resizeOptions.onResizeEnd(this.createResizeEvent(e,t,n))}}createResizeEvent(e,t,n){let r=this.cachedResizeEvent;return r.target=e.target,r.originalEvent=e.originalEvent,r.pointers=e.pointers,r.isPrimary=e.isPrimary,r.width=this.currentSize.width,r.height=this.currentSize.height,r.deltaWidth=t,r.deltaHeight=n,r.edges.top=this.edgeFlags.top,r.edges.right=this.edgeFlags.right,r.edges.bottom=this.edgeFlags.bottom,r.edges.left=this.edgeFlags.left,r}setSize(e,t){this.currentSize={width:e,height:t},this.element.style.width=`${e}px`,this.element.style.height=`${t}px`}getSize(){return{...this.currentSize}}updateOptions(e){super.updateOptions(e),Object.assign(this.resizeOptions,e),`square`in e&&this.resizeOptions.square&&(this.resizeOptions.aspectRatio=1)}destroy(){super.destroy(),this.element.removeEventListener(`pointermove`,this.boundUpdateCursor),this.element.style.cursor=``,this.element.style.willChange=``}},zse=180/Math.PI,Bse=class extends F7{constructor(e,t={}){super(e,{...t,threshold:0}),this.gestureActive=!1,this.startDistance=0,this.startAngle=0,this.prevScale=1,this.prevAngle=0,this._p1=null,this._p2=null,this._cachedGestureEvent={target:null,pointers:[],isPrimary:!1,originalEvent:null,scale:1,rotation:0,distance:0,angle:0,center:{x:0,y:0},deltaScale:0,deltaAngle:0},this.gestureOptions=t,this.minPointers=t.minPointers??2,this.priority=15}shouldHandleEvent(e){return!0}selectTwoPointers(){if(this.pointers.size<2)return this._p1=this._p2=null,!1;let e=this.pointers.values();return this._p1=e.next().value,this._p2=e.next().value,!0}distanceBetween(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}angleBetween(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*zse}normalizeAngleDelta(e){for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}buildEvent(e,t,n,r,i,a,o,s){let c=this._cachedGestureEvent;return c.target=this.element,c.pointers=this.pointersCache,c.isPrimary=!1,c.originalEvent=c.originalEvent??{},c.scale=n,c.rotation=r,c.distance=e,c.angle=t,c.center.x=o,c.center.y=s,c.deltaScale=i,c.deltaAngle=a,c}update(){if(!this.isActive||this.pointers.size===0)return;let e=this.selectTwoPointers();if(!this.gestureActive&&e&&this.pointers.size>=this.minPointers){this.gestureActive=!0;let e=this._p1.current,t=this._p2.current;this.startDistance=this.distanceBetween(e,t),this.startAngle=this.angleBetween(e,t),this.prevScale=1,this.prevAngle=0;let n=this.buildEvent(this.startDistance,this.startAngle,1,0,0,0,(e.x+t.x)/2,(e.y+t.y)/2);this.gestureOptions.onGestureStart&&this.gestureOptions.onGestureStart(n);return}if(this.gestureActive&&this.pointers.size<this.minPointers){this.endGesture(),super.update();return}if(this.gestureActive&&e){let e=this._p1.current,t=this._p2.current,n=this.distanceBetween(e,t),r=this.angleBetween(e,t),i=this.startDistance>0?n/this.startDistance:1,a=this.normalizeAngleDelta(r-this.startAngle),o=i-this.prevScale,s=this.normalizeAngleDelta(a-this.prevAngle);this.prevScale=i,this.prevAngle=a,this.gestureOptions.onGestureMove&&this.gestureOptions.onGestureMove(this.buildEvent(n,r,i,a,o,s,(e.x+t.x)/2,(e.y+t.y)/2))}super.update()}endGesture(){if(!this.gestureActive)return;this.gestureActive=!1;let e=this.selectTwoPointers(),t=e?this._p1.current:null,n=e?this._p2.current:null,r=t&&n?this.distanceBetween(t,n):0,i=t&&n?this.angleBetween(t,n):0,a=t&&n?(t.x+n.x)/2:0,o=t&&n?(t.y+n.y)/2:0,s=this.startDistance>0&&r>0?r/this.startDistance:this.prevScale;this.gestureOptions.onGestureEnd&&this.gestureOptions.onGestureEnd(this.buildEvent(r,i,s,this.prevAngle,0,0,a,o))}updateOptions(e){super.updateOptions(e),Object.assign(this.gestureOptions,e),e.minPointers!==void 0&&(this.minPointers=e.minPointers)}destroy(){this.gestureActive&&this.endGesture(),super.destroy()}},Vse=typeof window<`u`?d.useLayoutEffect:d.useEffect;function q7(e){let t={};for(let n in e){let r=e[n];typeof r!=`function`&&(t[n]=r)}return t}function Hse(e={},t){let n=(0,d.useRef)(e);n.current=e;let r=(0,d.useRef)(null),i=(0,d.useRef)(null),a=(0,d.useRef)(void 0),o=(0,d.useCallback)(o=>{if(o===i.current||(r.current&&(r.current.drag?.destroy(),r.current.resize?.destroy(),r.current.gesture?.destroy(),r.current=null,t&&(t.current=null)),i.current=o,!o))return;let s=n.current,c={drag:s.drag?new Lse(o,typeof s.drag==`object`?J7(n,`drag`):{}):null,resize:s.resize?new Rse(o,typeof s.resize==`object`?J7(n,`resize`):{}):null,gesture:s.gesture?new Bse(o,typeof s.gesture==`object`?J7(n,`gesture`):{}):null};r.current=c,t&&(t.current=c),a.current=e},[]);return Vse(()=>{let t=r.current;if(!t||a.current===e)return;let i=n.current;t.drag&&typeof i.drag==`object`&&t.drag.updateOptions(q7(i.drag)),t.resize&&typeof i.resize==`object`&&t.resize.updateOptions(q7(i.resize)),t.gesture&&typeof i.gesture==`object`&&t.gesture.updateOptions(q7(i.gesture)),a.current=e}),o}function J7(e,t){let n=e.current[t];if(typeof n!=`object`)return{};let r={};for(let i in n){let a=n[i];r[i]=typeof a==`function`?(...n)=>{let r=e.current[t];if(typeof r!=`object`)return;let a=r[i];return a?.(...n)}:a}return r}function Use(e){switch(e){case`info`:return`var(--accent)`;case`success`:return`var(--status-success)`;case`warning`:return`var(--status-warning)`;case`error`:return`var(--status-error)`;default:return`var(--text)`}}function Wse(e){let{instRef:t,contentRef:n,initial:r,maxWidth:i}=e;if(t.current?.resize?.setSize(r.w,r.h),!i||!n.current)return;let a=n.current;a.style.width=`max-content`;let o=Math.ceil(a.scrollWidth);a.style.width=``;let s=Math.min(Math.max(o,r.w),i);s!==r.w&&t.current?.resize?.setSize(s,r.h)}function Gse(e){let{instRef:t,elRef:n,contentRef:r,initial:i,maxWidth:a,maxHeightPx:o}=e,s=n.current;if(!s)return;let c=s.style.height,l=s.style.maxHeight;s.style.height=`auto`,s.style.maxHeight=`none`;let u=s.scrollHeight;s.style.height=c,s.style.maxHeight=l;let d=Math.min(u,o);if(a&&r.current){let e=r.current;e.style.width=`max-content`;let n=Math.ceil(e.scrollWidth);e.style.width=``;let o=Math.min(Math.max(n,i.w),a);t.current?.resize?.setSize(o,d)}else t.current?.resize?.setSize(i.w,d)}function Kse(e){let{instRef:t,initial:n}=e;t.current?.drag?.setPosition(n.x,n.y),n.h==null?Gse(e):Wse(e)}function qse({title:e,subtitle:t,variant:n,flashHeader:r,headerExtra:i}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`dd-drag-handle`,style:{padding:`12px 14px`,borderBottom:`1px solid var(--border)`,cursor:`move`,touchAction:`none`,userSelect:`none`,flexShrink:0,...n===`normal`?null:{background:Use(n)},...r?{animation:`interaction-bg-blink 0.85s ease-in-out infinite`}:null},children:[(0,F.jsx)(`div`,{style:{color:n===`normal`?`var(--text)`:`var(--on-accent, #fff)`,fontSize:`var(--text-2xl)`,fontWeight:650,paddingRight:i?34:0},children:e}),t&&(0,F.jsx)(`div`,{style:{marginTop:3,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`},children:t})]}),i&&(0,F.jsx)(`div`,{style:{position:`absolute`,top:8,right:10,zIndex:2,display:`flex`,alignItems:`center`},children:i})]})}function Y7({title:e,subtitle:t,children:n,footer:r,width:i=560,align:a=`bottom`,height:o,variant:s=`normal`,initialOffset:c,position:l,size:u,maxWidth:f,onDragStop:p,onResizeStop:m,testId:h,style:g,portalTarget:_,headerExtra:v,flashHeader:y}){let[b,x]=(0,d.useState)(!1),S=Math.round(window.innerHeight*.8),[C]=(0,d.useState)(()=>({x:l?.x??c?.dx??0,y:l?.y??c?.dy??0,w:u?.width??i,h:u?.height??o??null})),w=(0,d.useRef)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(null),D=(0,d.useRef)(p);D.current=p;let O=(0,d.useRef)(m);O.current=m;let k=Hse((0,d.useMemo)(()=>({drag:{handle:`.dd-drag-handle`,onDragEnd:()=>{let e=E.current?.drag?.getPosition();e&&D.current?.(e.x,e.y)}},resize:{edges:{top:!0,right:!0,bottom:!0,left:!0},minWidth:160,minHeight:100,onResizeEnd:e=>{let t=w.current?.style.transform.match(/translate3?d?\((-?[\d.]+)px,\s*(-?[\d.]+)px/);O.current?.(e.width,e.height,t?Number(t[1]):0,t?Number(t[2]):0)}}}),[]),E);(0,d.useEffect)(()=>()=>{E.current?.drag?.cancel(),E.current?.resize?.cancel()},[]);let A=(0,d.useCallback)(e=>{w.current=e,k(e)},[k]);(0,d.useEffect)(()=>{Kse({instRef:E,elRef:w,contentRef:T,initial:C,maxWidth:f,maxHeightPx:S})},[]);let j=s===`error`?1200:1e3,M=b?j+100:j;return(0,Yr.createPortal)((0,F.jsx)(`div`,{"data-testid":h,onPointerDownCapture:()=>x(!0),style:{position:`fixed`,inset:0,zIndex:M,display:`flex`,alignItems:a===`bottom`?`flex-end`:`center`,justifyContent:`center`,padding:a===`bottom`?`0 20px 16px`:0,pointerEvents:`none`,...g},children:(0,F.jsxs)(`div`,{ref:A,role:`dialog`,"aria-modal":`true`,style:{transform:`translate(${C.x}px, ${C.y}px)`,width:C.w,...C.h==null?{maxHeight:S}:{height:C.h},display:`flex`,flexDirection:`column`,position:`relative`,border:`1px solid color-mix(in srgb, var(--foreground) 14%, transparent)`,borderRadius:12,background:`var(--bg)`,boxShadow:`0 -4px 24px var(--shadow-strong), 0 8px 28px var(--shadow-color), 0 2px 8px var(--shadow-color)`,overflow:`hidden`,pointerEvents:`auto`},children:[(0,F.jsx)(qse,{title:e,subtitle:t,variant:s,flashHeader:y,headerExtra:v}),(0,F.jsx)(`div`,{ref:T,style:{padding:14,overflowY:`auto`,minHeight:0,flexGrow:1,userSelect:`text`},children:n}),r&&(0,F.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`10px 14px`,borderTop:`1px solid var(--border)`,background:`var(--bg-panel)`,flexShrink:0},children:r})]})}),_??document.body)}var X7={padding:`10px 16px`,fontSize:`var(--text-base)`,color:`var(--text-muted)`,fontStyle:`italic`};function Jse(e){if(e.role!==`user`)return null;if(typeof e.content==`string`){let t=e.content.trim();return t.length>0?t:null}let t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
487
|
-
`).trim();return t.length>0?t:null}function Yse(e,t){if(t?.role!==`assistant`)return;let n=0;for(let t of e)t.role===`user`&&(n+=1);return n>0?n:void 0}function Xse(e,t,n){if(n==null)return;let r=[];e.forEach((e,n)=>{e.role===`assistant`&&(e.content??[]).forEach((e,i)=>{e.type===`thinking`?r.push(wt(`thinking`,t[n]??``,void 0,i)):e.type===`toolCall`&&r.push(wt(`toolCall`,``,e.toolCallId))})});let i=r.slice(-((n??0)+1));return new Set(i)}function Z7(e,t){return t?e:void 0}function Q7(e,t){return t?e:void 0}function Zse(e,t,n,r){return e&&t.length===0&&!n&&!r}function Qse(e,t,n,r){return!e&&!t&&!n&&!r}function $se(e,t,n,r){return e||t||n||r}function ece(e,t){return e??t??void 0}function tce(e,t){return e??t??void 0}function nce(e,t){return e??(t?`new:${t}`:void 0)}function $7(e,t){return e?t?.[`${e.provider}/${e.modelId}`]??null:null}function rce(e,t){return e??t??``}function ice(e,t){return!!e||t}function ace(e,t,n){t||e?.current?.addImages(n)}var e9={position:`absolute`,top:`100%`,left:0,right:0,zIndex:1500,background:`var(--bg)`,borderBottom:`1px solid var(--border)`,boxShadow:`0 10px 28px var(--shadow-color)`,maxHeight:`calc(100dvh - 80px)`,overflowY:`auto`},oce={position:`relative`,display:`flex`,alignItems:`stretch`,flexShrink:0,width:`100%`,minWidth:0,height:36,gap:4,paddingLeft:4,paddingRight:4,borderBottom:`1px solid var(--border)`,background:`var(--bg)`},t9={display:`flex`,alignItems:`center`,justifyContent:`center`,alignSelf:`center`,width:32,height:32,padding:0,background:`transparent`,border:`1px solid var(--border)`,borderRadius:7,color:`var(--text-muted)`,flexShrink:0,cursor:`pointer`,transition:`color 0.12s, background 0.12s, border-color 0.12s`,"--hover-color":`var(--text)`,"--hover-bg":`var(--bg-selected)`,"--hover-border":`color-mix(in srgb, var(--accent) 35%, transparent)`},n9={flexShrink:0},r9={fontSize:`var(--text-sm)`,fontWeight:700,color:`var(--text)`,marginBottom:6},sce={fontSize:`var(--text-xs)`,borderRadius:8,border:`1px solid color-mix(in srgb, var(--accent) 45%, transparent)`,background:`color-mix(in srgb, var(--accent) 10%, transparent)`,color:`var(--accent)`,whiteSpace:`nowrap`};function i9({notices:e,floating:t=!1,align:n=`left`}){return e.length===0?null:(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:n===`right`?`flex-end`:`stretch`,marginBottom:t?0:10},children:e.map((n,r)=>{let i=n.type===`error`?`var(--status-error)`:n.type===`warning`?`var(--status-warning)`:n.type===`success`?`var(--status-success)`:`var(--accent)`;return(0,F.jsxs)(`div`,{className:`notice-shelf-item`,style:{display:`flex`,alignItems:`center`,gap:10,minHeight:60,marginBottom:r===e.length-1?0:6,borderRadius:14,border:`1px solid color-mix(in srgb, var(--border) 70%, transparent)`,background:`var(--bg)`,color:`var(--text-muted)`,width:`fit-content`,maxWidth:`min(100%, 620px)`,boxShadow:t?`0 1px 2px var(--shadow-color), 0 10px 28px -14px var(--shadow-color)`:`0 1px 2px var(--shadow-color), 0 8px 24px -12px var(--shadow-color)`,fontSize:`var(--text-4xl)`,lineHeight:1.45,transformOrigin:`top center`,animation:n.exiting?`notice-shelf-out 0.18s ease-in forwards`:`notice-shelf-in 0.18s ease-out both`,padding:`0 12px`},children:[(0,F.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:i,flexShrink:0}}),(0,F.jsx)(`span`,{style:{padding:`14px 0`,minWidth:0,maxWidth:`100%`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:n.message})]},n.id)})})}var a9={info:or,success:Hn,warning:Mr,error:Un},cce={info:`chat.notifyInfoTitle`,success:`chat.notifySuccessTitle`,warning:`chat.notifyWarningTitle`,error:`chat.notifyErrorTitle`};function lce({modals:e,onDismiss:t}){let{t:n}=I();return(0,F.jsx)(F.Fragment,{children:e.map((e,r)=>(0,F.jsx)(Y7,{variant:e.type,align:`center`,width:520,height:320,initialOffset:{dx:r%3*24,dy:r%3*24},title:(()=>{let t=a9[e.type];return(0,F.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[(0,F.jsx)(t,{size:R[`4xl`]}),n(cce[e.type])]})})(),footer:(0,F.jsx)(`button`,{onClick:()=>t(e.id),style:{padding:`6px 14px`,borderRadius:6,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text)`,cursor:`pointer`},children:n(`chat.close`)}),children:(0,F.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,fontSize:`var(--text-lg)`,lineHeight:1.6,color:`var(--text)`},children:e.message})},e.id))})}function uce({onMouseEnter:e,onMouseLeave:t}){let{t:n,locale:r}=I(),{entries:i}=we(),a=e=>new Date(e).toLocaleTimeString(r===`zh-CN`?`zh-CN`:void 0,{hour:`2-digit`,minute:`2-digit`});return(0,F.jsxs)(`div`,{onMouseEnter:e,onMouseLeave:t,style:e9,children:[(0,F.jsx)(`div`,{style:{padding:`10px 16px`,fontSize:`var(--text-sm)`,fontWeight:700,color:`var(--text)`,borderBottom:`1px solid var(--border)`},children:n(`notices.title`)}),i.length===0?(0,F.jsx)(`div`,{style:X7,children:n(`notices.empty`)}):i.map(e=>{let t=a9[e.notifyType],r=e.notifyType===`error`?`var(--status-error)`:`var(--status-warning)`;return(0,F.jsxs)(`div`,{style:{display:`flex`,gap:10,padding:`10px 16px`,borderBottom:`1px solid var(--border)`,alignItems:`flex-start`},children:[(0,F.jsx)(t,{size:R.base,style:{color:r,flexShrink:0,marginTop:2}}),(0,F.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,F.jsx)(`div`,{style:{color:`var(--text)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:e.message}),(0,F.jsxs)(`div`,{style:{marginTop:4,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,display:`flex`,gap:8,alignItems:`center`},children:[e.sessionId&&(0,F.jsxs)(`span`,{children:[n(`notices.fromSession`),` #`,e.sessionId.slice(0,8)]}),(0,F.jsx)(`span`,{children:a(e.createdAt)})]})]})]},e.id)})]})}function dce({show:e,onClick:t}){let{t:n}=I();return e?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{style:{position:`absolute`,left:0,right:0,bottom:0,height:30,background:`linear-gradient(to bottom, transparent, var(--bg))`,pointerEvents:`none`,zIndex:49}}),(0,F.jsx)(`button`,{type:`button`,onClick:t,"aria-label":n(`chat.scrollToLatest`),"data-testid":`scroll-to-latest`,style:{position:`absolute`,bottom:0,left:`50%`,transform:`translateX(-50%)`,width:`min(100% / 3, 260px)`,zIndex:50,cursor:`pointer`,background:`transparent`,border:`none`,padding:0,height:30,display:`flex`,alignItems:`flex-end`,justifyContent:`center`},children:(0,F.jsx)(L,{label:n(`chat.scrollToLatest`),children:(0,F.jsx)(`span`,{style:{position:`absolute`,bottom:4,left:`50%`,transform:`translateX(-50%)`,width:12,height:11,display:`flex`,alignItems:`flex-end`,justifyContent:`center`,cursor:`pointer`},children:(0,F.jsx)(`span`,{style:{position:`relative`,width:0,height:0,borderLeft:`6px solid transparent`,borderRight:`6px solid transparent`,borderTop:`7px solid var(--text-muted)`,pointerEvents:`none`}})})})})]}):null}function fce({plainStatusLine:e}){return(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,flexShrink:0,minWidth:0,height:36,padding:`0 12px`,borderTop:`1px solid var(--border)`,gap:8},children:(0,F.jsx)(L,{label:e,wrapperStyle:{display:`flex`,flex:1,minWidth:0},children:(0,F.jsx)(`div`,{role:`status`,"aria-label":e,style:{alignSelf:`stretch`,display:`flex`,alignItems:`center`,flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,color:`var(--text-dim)`},children:e})})})}var pce={background:`linear-gradient(90deg, var(--accent) 0%, var(--accent) 47%, var(--shine-highlight) 53%, var(--shine-highlight) 100%)`,backgroundSize:`200% 100%`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,animation:`pi-status-shine 1.5s linear infinite`},mce={animation:`pi-status-icon-pulse 1.5s ease-in-out infinite`};function hce(e,t){if(e?.kind===`running_tools`){let n=e.tools.map(e=>e.name);return n.length===0?t(`chat.runningTool`):n.length===1?t(`chat.runningNamedTool`,{name:n[0]}):n.length<=3?t(`chat.runningTools`,{names:n.join(`, `)}):t(`chat.runningToolsMore`,{names:n.slice(0,2).join(`, `),count:n.length-2})}return e?.kind===`thinking`?t(`chat.thinking`):e?.kind===`waiting_model`?t(`chat.waitingModel`):e?.kind===`running_command`?t(`chat.runningCommand`):e?.kind===`retrying`?t(`chat.retrying`,{attempt:e.attempt,max:e.maxAttempts}):null}function gce(e){return e?.kind===`running_tools`?(0,F.jsx)(Ir,{size:R.lg}):e?.kind===`running_command`?(0,F.jsx)(kr,{size:R.lg}):e?.kind===`thinking`?(0,F.jsx)(sr,{size:R.lg,fill:`currentColor`,style:{color:`var(--bulb-warning)`}}):e?.kind===`retrying`?(0,F.jsx)(Mr,{size:R.lg,style:{color:`var(--status-warning)`}}):(0,F.jsx)(ir,{size:R.lg})}function o9({phase:e,elapsed:t,totalElapsed:n}){let{t:r}=I(),i=hce(e,r)??r(`chat.runningCommand`);return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,style:{...pce,minWidth:0,maxWidth:`100%`},children:[(0,F.jsx)(`span`,{className:`inline-flex flex-shrink-0`,style:mce,children:gce(e)}),(0,F.jsxs)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},children:[i,t!=null&&(0,F.jsxs)(F.Fragment,{children:[` · `,t]}),n!=null&&(0,F.jsxs)(F.Fragment,{children:[` · `,r(`chat.totalElapsed`,{total:n})]})]})]})}function _ce({agentRunning:e,commandBusy:t,agentPhase:n,streamState:r}){return!!((e||t)&&(n?.kind===`waiting_model`||n?.kind===`thinking`||!r.streamingMessage)&&(n||t))}function vce({streamState:e,agentRunning:t,commandBusy:n,agentPhase:r,phaseElapsed:i,totalElapsed:a,bashRunning:o,pendingBash:s,bashOutput:c,session:l,sessionIdRef:u}){return(0,F.jsxs)(F.Fragment,{children:[_ce({agentRunning:t,commandBusy:n,agentPhase:r,streamState:e})&&(0,F.jsx)(`div`,{className:`py-2 text-[0.8125rem] text-text-muted`,children:(0,F.jsx)(o9,{phase:r??{kind:`running_command`},elapsed:i,totalElapsed:a})}),o&&(0,F.jsx)(`div`,{className:`py-2 text-[0.8125rem] text-text-muted`,children:(0,F.jsx)(o9,{phase:{kind:`running_command`},elapsed:i,totalElapsed:a})}),s&&(0,F.jsx)(T7,{message:{role:`bashExecution`,command:s.command,output:``,excludeFromContext:s.excludeFromContext},streamingBashOutput:c,sessionId:l?.id??u.current??void 0}),t&&(0,F.jsx)(`div`,{style:{height:48}})]})}function yce({isMobile:e,notices:t,scrollContainerRef:n,handleListScroll:r,canMountList:i,sessionIdForCache:a,sessionId:o,rows:s,messages:c,entryIds:l,modelNames:u,messageCwd:d,onOpenFile:f,sessionBusy:p,isNew:m,handleFork:h,forkingEntryId:g,handleNavigate:_,handleEditContent:v,sessionIdRef:y,session:b,recentExpandedBlockKeys:x,streamState:S,flashKey:C,itemRef:w,t:T,messageRefs:E,lastUserMsgRef:D,visibleRefIndexByMessage:O,virtualizerRef:k,initialCache:A,streamTurnNumber:j,agentRunning:M,commandBusy:N,agentPhase:ee,phaseElapsed:te,totalElapsed:P,bashRunning:ne,pendingBash:re,bashOutput:ie,messagesEndRef:ae,nearBottom:oe,scrollToBottom:se,resolveMessageOffset:ce,previewScrollStepPx:le,handleWindowJumpTo:ue,chatInputElement:de,startScreenMessages:fe,aiIdle:pe,onQuickMessageSend:me,onFillInput:he,plainStatusLine:ge}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,F.jsx)(`div`,{style:{position:`absolute`,top:12,left:0,right:e?0:`calc(${t$} + 48px)`,zIndex:40,padding:`0 16px`,pointerEvents:`none`},children:(0,F.jsx)(`div`,{style:{maxWidth:820,margin:`0 auto`},children:(0,F.jsx)(i9,{notices:t,floating:!0,align:`right`})})}),(0,F.jsx)(`div`,{ref:n,onScroll:r,className:`min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto pt-4 [scrollbar-width:none] [overflow-anchor:none]`,style:{paddingRight:48},"data-testid":`message-list`,children:(0,F.jsx)(`div`,{style:{minWidth:0,padding:`0 16px`},children:(0,F.jsxs)(`div`,{style:{width:`100%`,minWidth:0,maxWidth:820,margin:`0 auto`},children:[i&&(0,F.jsx)(Ase,{rows:s,messages:c,entryIds:l,modelNames:u,messageCwd:d,onOpenFile:f,sessionBusy:p,isNew:m,handleFork:h,forkingEntryId:g,handleNavigate:_,handleEditContent:v,sessionId:b?.id??y.current??void 0,recentExpandedBlockKeys:x,isStreaming:S.isStreaming,flashKey:C,itemRef:w,t:T,messageRefs:E,lastUserMsgRef:D,visibleRefIndexByMessage:O,scrollContainerRef:n,virtualizerRef:k,initialCache:A},a||`empty`),S.isStreaming&&S.streamingMessage&&(0,F.jsx)(`div`,{children:(0,F.jsx)(T7,{message:S.streamingMessage,isStreaming:!0,modelNames:u,cwd:d,onOpenFile:f,recentExpandedBlockKeys:x,turnNumber:j})}),(0,F.jsx)(vce,{streamState:S,agentRunning:M,commandBusy:N,agentPhase:ee,phaseElapsed:te,totalElapsed:P,bashRunning:ne,pendingBash:re,bashOutput:ie,session:b,sessionIdRef:y}),(0,F.jsx)(`div`,{ref:ae})]})})}),(0,F.jsx)(dce,{show:!oe,onClick:se}),e?null:(0,F.jsx)(N$,{messages:c,streamingMessage:S.streamingMessage,scrollContainer:n,messageRefs:E,resolveMessageOffset:ce,scrollStepPx:le,onWindowJumpTo:ue})]}),(0,F.jsx)(jse,{chatInputElement:de,startScreenMessages:fe,aiIdle:pe,isMobile:e,onQuickMessageSend:me,onFillInput:he}),(0,F.jsx)(fce,{plainStatusLine:ge})]})}function bce({show:e}){return e?(0,F.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 z-50 flex animate-[drop-zone-in_0.15s_ease_both] items-center justify-center bg-[color-mix(in_srgb,var(--accent)_6%,transparent)] backdrop-blur-[1px]`,children:[(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:[0,.8,1.6].map(e=>(0,F.jsx)(`div`,{className:`absolute h-[720px] w-[720px] rounded-full border-[1.5px] border-solid border-[color-mix(in_srgb,var(--accent)_50%,transparent)] animate-[drop-ripple_2.4s_ease-out_infinite_backwards]`,style:{transformOrigin:`center`,animationDelay:`${e}s`}},e))}),(0,F.jsxs)(`svg`,{width:`280`,height:`280`,viewBox:`0 0 140 140`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`drop-shadow-[0_6px_18px_var(--accent-glow)]`,children:[(0,F.jsx)(`rect`,{x:`28`,y:`44`,width:`84`,height:`60`,rx:`8`,fill:`color-mix(in srgb, var(--accent) 8%, transparent)`,stroke:`color-mix(in srgb, var(--accent) 50%, transparent)`,strokeWidth:`1.8`}),(0,F.jsx)(`path`,{d:`M36 100 L54 72 L68 88 L80 74 L104 100Z`,fill:`color-mix(in srgb, var(--accent) 16%, transparent)`,stroke:`color-mix(in srgb, var(--accent) 40%, transparent)`,strokeWidth:`1.4`,strokeLinejoin:`round`}),(0,F.jsx)(`circle`,{cx:`96`,cy:`58`,r:`8`,fill:`color-mix(in srgb, var(--accent) 22%, transparent)`,stroke:`color-mix(in srgb, var(--accent) 55%, transparent)`,strokeWidth:`1.6`}),(0,F.jsxs)(`g`,{stroke:`color-mix(in srgb, var(--accent) 45%, transparent)`,strokeWidth:`1.4`,strokeLinecap:`round`,children:[(0,F.jsx)(`line`,{x1:`96`,y1:`46`,x2:`96`,y2:`43`}),(0,F.jsx)(`line`,{x1:`96`,y1:`70`,x2:`96`,y2:`73`}),(0,F.jsx)(`line`,{x1:`84`,y1:`58`,x2:`81`,y2:`58`}),(0,F.jsx)(`line`,{x1:`108`,y1:`58`,x2:`111`,y2:`58`}),(0,F.jsx)(`line`,{x1:`87.5`,y1:`49.5`,x2:`85.4`,y2:`47.4`}),(0,F.jsx)(`line`,{x1:`104.5`,y1:`66.5`,x2:`106.6`,y2:`68.6`}),(0,F.jsx)(`line`,{x1:`104.5`,y1:`49.5`,x2:`106.6`,y2:`47.4`}),(0,F.jsx)(`line`,{x1:`87.5`,y1:`66.5`,x2:`85.4`,y2:`68.6`})]})]})]}):null}var xce={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`,ArrowRight:`\x1B[C`,ArrowLeft:`\x1B[D`,Home:`\x1B[H`,End:`\x1B[F`,Insert:`\x1B[2~`,Delete:`\x1B[3~`,PageUp:`\x1B[5~`,PageDown:`\x1B[6~`,Escape:`\x1B`,Backspace:``},Sce={ArrowLeft:`\x1Bb`,ArrowRight:`\x1Bf`,ArrowUp:`\x1Bp`,ArrowDown:`\x1Bn`};function Cce(e){if(e.length!==1)return null;let t=e.toUpperCase().charCodeAt(0);return t>=64&&t<=95?String.fromCharCode(t&31):e===`?`?``:null}function wce(e){if(e.ctrlKey&&!e.altKey){let t=Cce(e.key);if(t)return t}if(e.altKey&&!e.ctrlKey){if(e.key===`Backspace`)return`\x1B`;let t=Sce[e.key];if(t)return t;if(e.key.length===1)return`\x1b${e.key}`}return null}function Tce(e){return e.metaKey||e.ctrlKey&&!e.altKey&&e.key.toLowerCase()===`v`?null:wce(e)||(e.key===`Enter`?e.shiftKey?`
|
|
487
|
+
`).trim();return t.length>0?t:null}function Yse(e,t){if(t?.role!==`assistant`)return;let n=0;for(let t of e)t.role===`user`&&(n+=1);return n>0?n:void 0}function Xse(e,t,n){if(n==null)return;let r=[];e.forEach((e,n)=>{e.role===`assistant`&&(e.content??[]).forEach((e,i)=>{e.type===`thinking`?r.push(wt(`thinking`,t[n]??``,void 0,i)):e.type===`toolCall`&&r.push(wt(`toolCall`,``,e.toolCallId))})});let i=n??0,a=i>0?r.slice(-i):[];return new Set(a)}function Z7(e,t){return t?e:void 0}function Q7(e,t){return t?e:void 0}function Zse(e,t,n,r){return e&&t.length===0&&!n&&!r}function Qse(e,t,n,r){return!e&&!t&&!n&&!r}function $se(e,t,n,r){return e||t||n||r}function ece(e,t){return e??t??void 0}function tce(e,t){return e??t??void 0}function nce(e,t){return e??(t?`new:${t}`:void 0)}function $7(e,t){return e?t?.[`${e.provider}/${e.modelId}`]??null:null}function rce(e,t){return e??t??``}function ice(e,t){return!!e||t}function ace(e,t,n){t||e?.current?.addImages(n)}var e9={position:`absolute`,top:`100%`,left:0,right:0,zIndex:1500,background:`var(--bg)`,borderBottom:`1px solid var(--border)`,boxShadow:`0 10px 28px var(--shadow-color)`,maxHeight:`calc(100dvh - 80px)`,overflowY:`auto`},oce={position:`relative`,display:`flex`,alignItems:`stretch`,flexShrink:0,width:`100%`,minWidth:0,height:36,gap:4,paddingLeft:4,paddingRight:4,borderBottom:`1px solid var(--border)`,background:`var(--bg)`},t9={display:`flex`,alignItems:`center`,justifyContent:`center`,alignSelf:`center`,width:32,height:32,padding:0,background:`transparent`,border:`1px solid var(--border)`,borderRadius:7,color:`var(--text-muted)`,flexShrink:0,cursor:`pointer`,transition:`color 0.12s, background 0.12s, border-color 0.12s`,"--hover-color":`var(--text)`,"--hover-bg":`var(--bg-selected)`,"--hover-border":`color-mix(in srgb, var(--accent) 35%, transparent)`},n9={flexShrink:0},r9={fontSize:`var(--text-sm)`,fontWeight:700,color:`var(--text)`,marginBottom:6},sce={fontSize:`var(--text-xs)`,borderRadius:8,border:`1px solid color-mix(in srgb, var(--accent) 45%, transparent)`,background:`color-mix(in srgb, var(--accent) 10%, transparent)`,color:`var(--accent)`,whiteSpace:`nowrap`};function i9({notices:e,floating:t=!1,align:n=`left`}){return e.length===0?null:(0,F.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:n===`right`?`flex-end`:`stretch`,marginBottom:t?0:10},children:e.map((n,r)=>{let i=n.type===`error`?`var(--status-error)`:n.type===`warning`?`var(--status-warning)`:n.type===`success`?`var(--status-success)`:`var(--accent)`;return(0,F.jsxs)(`div`,{className:`notice-shelf-item`,style:{display:`flex`,alignItems:`center`,gap:10,minHeight:60,marginBottom:r===e.length-1?0:6,borderRadius:14,border:`1px solid color-mix(in srgb, var(--border) 70%, transparent)`,background:`var(--bg)`,color:`var(--text-muted)`,width:`fit-content`,maxWidth:`min(100%, 620px)`,boxShadow:t?`0 1px 2px var(--shadow-color), 0 10px 28px -14px var(--shadow-color)`:`0 1px 2px var(--shadow-color), 0 8px 24px -12px var(--shadow-color)`,fontSize:`var(--text-4xl)`,lineHeight:1.45,transformOrigin:`top center`,animation:n.exiting?`notice-shelf-out 0.18s ease-in forwards`:`notice-shelf-in 0.18s ease-out both`,padding:`0 12px`},children:[(0,F.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:i,flexShrink:0}}),(0,F.jsx)(`span`,{style:{padding:`14px 0`,minWidth:0,maxWidth:`100%`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:n.message})]},n.id)})})}var a9={info:or,success:Hn,warning:Mr,error:Un},cce={info:`chat.notifyInfoTitle`,success:`chat.notifySuccessTitle`,warning:`chat.notifyWarningTitle`,error:`chat.notifyErrorTitle`};function lce({modals:e,onDismiss:t}){let{t:n}=I();return(0,F.jsx)(F.Fragment,{children:e.map((e,r)=>(0,F.jsx)(Y7,{variant:e.type,align:`center`,width:520,height:320,initialOffset:{dx:r%3*24,dy:r%3*24},title:(()=>{let t=a9[e.type];return(0,F.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[(0,F.jsx)(t,{size:R[`4xl`]}),n(cce[e.type])]})})(),footer:(0,F.jsx)(`button`,{onClick:()=>t(e.id),style:{padding:`6px 14px`,borderRadius:6,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text)`,cursor:`pointer`},children:n(`chat.close`)}),children:(0,F.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,fontSize:`var(--text-lg)`,lineHeight:1.6,color:`var(--text)`},children:e.message})},e.id))})}function uce({onMouseEnter:e,onMouseLeave:t}){let{t:n,locale:r}=I(),{entries:i}=we(),a=e=>new Date(e).toLocaleTimeString(r===`zh-CN`?`zh-CN`:void 0,{hour:`2-digit`,minute:`2-digit`});return(0,F.jsxs)(`div`,{onMouseEnter:e,onMouseLeave:t,style:e9,children:[(0,F.jsx)(`div`,{style:{padding:`10px 16px`,fontSize:`var(--text-sm)`,fontWeight:700,color:`var(--text)`,borderBottom:`1px solid var(--border)`},children:n(`notices.title`)}),i.length===0?(0,F.jsx)(`div`,{style:X7,children:n(`notices.empty`)}):i.map(e=>{let t=a9[e.notifyType],r=e.notifyType===`error`?`var(--status-error)`:`var(--status-warning)`;return(0,F.jsxs)(`div`,{style:{display:`flex`,gap:10,padding:`10px 16px`,borderBottom:`1px solid var(--border)`,alignItems:`flex-start`},children:[(0,F.jsx)(t,{size:R.base,style:{color:r,flexShrink:0,marginTop:2}}),(0,F.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,F.jsx)(`div`,{style:{color:`var(--text)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:e.message}),(0,F.jsxs)(`div`,{style:{marginTop:4,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,display:`flex`,gap:8,alignItems:`center`},children:[e.sessionId&&(0,F.jsxs)(`span`,{children:[n(`notices.fromSession`),` #`,e.sessionId.slice(0,8)]}),(0,F.jsx)(`span`,{children:a(e.createdAt)})]})]})]},e.id)})]})}function dce({show:e,onClick:t}){let{t:n}=I();return e?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{style:{position:`absolute`,left:0,right:0,bottom:0,height:30,background:`linear-gradient(to bottom, transparent, var(--bg))`,pointerEvents:`none`,zIndex:49}}),(0,F.jsx)(`button`,{type:`button`,onClick:t,"aria-label":n(`chat.scrollToLatest`),"data-testid":`scroll-to-latest`,style:{position:`absolute`,bottom:0,left:`50%`,transform:`translateX(-50%)`,width:`min(100% / 3, 260px)`,zIndex:50,cursor:`pointer`,background:`transparent`,border:`none`,padding:0,height:30,display:`flex`,alignItems:`flex-end`,justifyContent:`center`},children:(0,F.jsx)(L,{label:n(`chat.scrollToLatest`),children:(0,F.jsx)(`span`,{style:{position:`absolute`,bottom:4,left:`50%`,transform:`translateX(-50%)`,width:12,height:11,display:`flex`,alignItems:`flex-end`,justifyContent:`center`,cursor:`pointer`},children:(0,F.jsx)(`span`,{style:{position:`relative`,width:0,height:0,borderLeft:`6px solid transparent`,borderRight:`6px solid transparent`,borderTop:`7px solid var(--text-muted)`,pointerEvents:`none`}})})})})]}):null}function fce({plainStatusLine:e}){return(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,flexShrink:0,minWidth:0,height:36,padding:`0 12px`,borderTop:`1px solid var(--border)`,gap:8},children:(0,F.jsx)(L,{label:e,wrapperStyle:{display:`flex`,flex:1,minWidth:0},children:(0,F.jsx)(`div`,{role:`status`,"aria-label":e,style:{alignSelf:`stretch`,display:`flex`,alignItems:`center`,flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,color:`var(--text-dim)`},children:e})})})}var pce={background:`linear-gradient(90deg, var(--accent) 0%, var(--accent) 47%, var(--shine-highlight) 53%, var(--shine-highlight) 100%)`,backgroundSize:`200% 100%`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,animation:`pi-status-shine 1.5s linear infinite`},mce={animation:`pi-status-icon-pulse 1.5s ease-in-out infinite`};function hce(e,t){if(e?.kind===`running_tools`){let n=e.tools.map(e=>e.name);return n.length===0?t(`chat.runningTool`):n.length===1?t(`chat.runningNamedTool`,{name:n[0]}):n.length<=3?t(`chat.runningTools`,{names:n.join(`, `)}):t(`chat.runningToolsMore`,{names:n.slice(0,2).join(`, `),count:n.length-2})}return e?.kind===`thinking`?t(`chat.thinking`):e?.kind===`waiting_model`?t(`chat.waitingModel`):e?.kind===`running_command`?t(`chat.runningCommand`):e?.kind===`retrying`?t(`chat.retrying`,{attempt:e.attempt,max:e.maxAttempts}):null}function gce(e){return e?.kind===`running_tools`?(0,F.jsx)(Ir,{size:R.lg}):e?.kind===`running_command`?(0,F.jsx)(kr,{size:R.lg}):e?.kind===`thinking`?(0,F.jsx)(sr,{size:R.lg,fill:`currentColor`,style:{color:`var(--bulb-warning)`}}):e?.kind===`retrying`?(0,F.jsx)(Mr,{size:R.lg,style:{color:`var(--status-warning)`}}):(0,F.jsx)(ir,{size:R.lg})}function o9({phase:e,elapsed:t,totalElapsed:n}){let{t:r}=I(),i=hce(e,r)??r(`chat.runningCommand`);return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,style:{...pce,minWidth:0,maxWidth:`100%`},children:[(0,F.jsx)(`span`,{className:`inline-flex flex-shrink-0`,style:mce,children:gce(e)}),(0,F.jsxs)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},children:[i,t!=null&&(0,F.jsxs)(F.Fragment,{children:[` · `,t]}),n!=null&&(0,F.jsxs)(F.Fragment,{children:[` · `,r(`chat.totalElapsed`,{total:n})]})]})]})}function _ce({agentRunning:e,commandBusy:t,agentPhase:n,streamState:r}){return!!((e||t)&&(n?.kind===`waiting_model`||n?.kind===`thinking`||!r.streamingMessage)&&(n||t))}function vce({streamState:e,agentRunning:t,commandBusy:n,agentPhase:r,phaseElapsed:i,totalElapsed:a,bashRunning:o,pendingBash:s,bashOutput:c,session:l,sessionIdRef:u}){return(0,F.jsxs)(F.Fragment,{children:[_ce({agentRunning:t,commandBusy:n,agentPhase:r,streamState:e})&&(0,F.jsx)(`div`,{className:`py-2 text-[0.8125rem] text-text-muted`,children:(0,F.jsx)(o9,{phase:r??{kind:`running_command`},elapsed:i,totalElapsed:a})}),o&&(0,F.jsx)(`div`,{className:`py-2 text-[0.8125rem] text-text-muted`,children:(0,F.jsx)(o9,{phase:{kind:`running_command`},elapsed:i,totalElapsed:a})}),s&&(0,F.jsx)(T7,{message:{role:`bashExecution`,command:s.command,output:``,excludeFromContext:s.excludeFromContext},streamingBashOutput:c,sessionId:l?.id??u.current??void 0}),t&&(0,F.jsx)(`div`,{style:{height:48}})]})}function yce({isMobile:e,notices:t,scrollContainerRef:n,handleListScroll:r,canMountList:i,sessionIdForCache:a,sessionId:o,rows:s,messages:c,entryIds:l,modelNames:u,messageCwd:d,onOpenFile:f,sessionBusy:p,isNew:m,handleFork:h,forkingEntryId:g,handleNavigate:_,handleEditContent:v,sessionIdRef:y,session:b,recentExpandedBlockKeys:x,streamState:S,flashKey:C,itemRef:w,t:T,messageRefs:E,lastUserMsgRef:D,visibleRefIndexByMessage:O,virtualizerRef:k,initialCache:A,streamTurnNumber:j,agentRunning:M,commandBusy:N,agentPhase:ee,phaseElapsed:te,totalElapsed:P,bashRunning:ne,pendingBash:re,bashOutput:ie,messagesEndRef:ae,nearBottom:oe,scrollToBottom:se,resolveMessageOffset:ce,previewScrollStepPx:le,handleWindowJumpTo:ue,chatInputElement:de,startScreenMessages:fe,aiIdle:pe,onQuickMessageSend:me,onFillInput:he,plainStatusLine:ge}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,F.jsx)(`div`,{style:{position:`absolute`,top:12,left:0,right:e?0:`calc(${t$} + 48px)`,zIndex:40,padding:`0 16px`,pointerEvents:`none`},children:(0,F.jsx)(`div`,{style:{maxWidth:820,margin:`0 auto`},children:(0,F.jsx)(i9,{notices:t,floating:!0,align:`right`})})}),(0,F.jsx)(`div`,{ref:n,onScroll:r,className:`min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto pt-4 [scrollbar-width:none] [overflow-anchor:none]`,style:{paddingRight:48},"data-testid":`message-list`,children:(0,F.jsx)(`div`,{style:{minWidth:0,padding:`0 16px`},children:(0,F.jsxs)(`div`,{style:{width:`100%`,minWidth:0,maxWidth:820,margin:`0 auto`},children:[i&&(0,F.jsx)(Ase,{rows:s,messages:c,entryIds:l,modelNames:u,messageCwd:d,onOpenFile:f,sessionBusy:p,isNew:m,handleFork:h,forkingEntryId:g,handleNavigate:_,handleEditContent:v,sessionId:b?.id??y.current??void 0,recentExpandedBlockKeys:x,isStreaming:S.isStreaming,flashKey:C,itemRef:w,t:T,messageRefs:E,lastUserMsgRef:D,visibleRefIndexByMessage:O,scrollContainerRef:n,virtualizerRef:k,initialCache:A},a||`empty`),S.isStreaming&&S.streamingMessage&&(0,F.jsx)(`div`,{children:(0,F.jsx)(T7,{message:S.streamingMessage,isStreaming:!0,modelNames:u,cwd:d,onOpenFile:f,recentExpandedBlockKeys:x,turnNumber:j})}),(0,F.jsx)(vce,{streamState:S,agentRunning:M,commandBusy:N,agentPhase:ee,phaseElapsed:te,totalElapsed:P,bashRunning:ne,pendingBash:re,bashOutput:ie,session:b,sessionIdRef:y}),(0,F.jsx)(`div`,{ref:ae})]})})}),(0,F.jsx)(dce,{show:!oe,onClick:se}),e?null:(0,F.jsx)(N$,{messages:c,streamingMessage:S.streamingMessage,scrollContainer:n,messageRefs:E,resolveMessageOffset:ce,scrollStepPx:le,onWindowJumpTo:ue})]}),(0,F.jsx)(jse,{chatInputElement:de,startScreenMessages:fe,aiIdle:pe,isMobile:e,onQuickMessageSend:me,onFillInput:he}),(0,F.jsx)(fce,{plainStatusLine:ge})]})}function bce({show:e}){return e?(0,F.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 z-50 flex animate-[drop-zone-in_0.15s_ease_both] items-center justify-center bg-[color-mix(in_srgb,var(--accent)_6%,transparent)] backdrop-blur-[1px]`,children:[(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:[0,.8,1.6].map(e=>(0,F.jsx)(`div`,{className:`absolute h-[720px] w-[720px] rounded-full border-[1.5px] border-solid border-[color-mix(in_srgb,var(--accent)_50%,transparent)] animate-[drop-ripple_2.4s_ease-out_infinite_backwards]`,style:{transformOrigin:`center`,animationDelay:`${e}s`}},e))}),(0,F.jsxs)(`svg`,{width:`280`,height:`280`,viewBox:`0 0 140 140`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`drop-shadow-[0_6px_18px_var(--accent-glow)]`,children:[(0,F.jsx)(`rect`,{x:`28`,y:`44`,width:`84`,height:`60`,rx:`8`,fill:`color-mix(in srgb, var(--accent) 8%, transparent)`,stroke:`color-mix(in srgb, var(--accent) 50%, transparent)`,strokeWidth:`1.8`}),(0,F.jsx)(`path`,{d:`M36 100 L54 72 L68 88 L80 74 L104 100Z`,fill:`color-mix(in srgb, var(--accent) 16%, transparent)`,stroke:`color-mix(in srgb, var(--accent) 40%, transparent)`,strokeWidth:`1.4`,strokeLinejoin:`round`}),(0,F.jsx)(`circle`,{cx:`96`,cy:`58`,r:`8`,fill:`color-mix(in srgb, var(--accent) 22%, transparent)`,stroke:`color-mix(in srgb, var(--accent) 55%, transparent)`,strokeWidth:`1.6`}),(0,F.jsxs)(`g`,{stroke:`color-mix(in srgb, var(--accent) 45%, transparent)`,strokeWidth:`1.4`,strokeLinecap:`round`,children:[(0,F.jsx)(`line`,{x1:`96`,y1:`46`,x2:`96`,y2:`43`}),(0,F.jsx)(`line`,{x1:`96`,y1:`70`,x2:`96`,y2:`73`}),(0,F.jsx)(`line`,{x1:`84`,y1:`58`,x2:`81`,y2:`58`}),(0,F.jsx)(`line`,{x1:`108`,y1:`58`,x2:`111`,y2:`58`}),(0,F.jsx)(`line`,{x1:`87.5`,y1:`49.5`,x2:`85.4`,y2:`47.4`}),(0,F.jsx)(`line`,{x1:`104.5`,y1:`66.5`,x2:`106.6`,y2:`68.6`}),(0,F.jsx)(`line`,{x1:`104.5`,y1:`49.5`,x2:`106.6`,y2:`47.4`}),(0,F.jsx)(`line`,{x1:`87.5`,y1:`66.5`,x2:`85.4`,y2:`68.6`})]})]})]}):null}var xce={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`,ArrowRight:`\x1B[C`,ArrowLeft:`\x1B[D`,Home:`\x1B[H`,End:`\x1B[F`,Insert:`\x1B[2~`,Delete:`\x1B[3~`,PageUp:`\x1B[5~`,PageDown:`\x1B[6~`,Escape:`\x1B`,Backspace:``},Sce={ArrowLeft:`\x1Bb`,ArrowRight:`\x1Bf`,ArrowUp:`\x1Bp`,ArrowDown:`\x1Bn`};function Cce(e){if(e.length!==1)return null;let t=e.toUpperCase().charCodeAt(0);return t>=64&&t<=95?String.fromCharCode(t&31):e===`?`?``:null}function wce(e){if(e.ctrlKey&&!e.altKey){let t=Cce(e.key);if(t)return t}if(e.altKey&&!e.ctrlKey){if(e.key===`Backspace`)return`\x1B`;let t=Sce[e.key];if(t)return t;if(e.key.length===1)return`\x1b${e.key}`}return null}function Tce(e){return e.metaKey||e.ctrlKey&&!e.altKey&&e.key.toLowerCase()===`v`?null:wce(e)||(e.key===`Enter`?e.shiftKey?`
|
|
488
488
|
`:`\r`:e.key===`Tab`?e.shiftKey?`\x1B[Z`:` `:xce[e.key]??null)}function Ece(e){return`\x1b[200~${e}\x1b[201~`}function Dce(e,t){return j(e).map((e,n)=>Object.keys(e.style).length>0?(0,F.jsx)(`span`,{style:e.style,children:e.text},`${t}-${n}`):e.text)}function Oce({request:e,onInput:t}){let{t:n}=I(),r=(0,d.useRef)(null),i=(0,d.useRef)(!1),a=T(e.lines);return(0,d.useEffect)(()=>{r.current?.focus()},[e.id]),(0,F.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:95,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:20,background:`rgba(0,0,0,0.18)`},children:(0,F.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:e=>{e.target.closest(`button`)||r.current?.focus()},style:{position:`relative`,width:`min(920px, 100%)`,maxHeight:`min(760px, calc(100vh - 40px))`,border:`1px solid var(--border)`,borderRadius:8,background:`var(--bg)`,boxShadow:`0 20px 60px var(--shadow-strong)`,overflow:`hidden`,outline:`none`},children:[(0,F.jsx)(`textarea`,{ref:r,"aria-label":n(`chat.extensionInput`),autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,onKeyDown:n=>{if(i.current||n.nativeEvent.isComposing)return;let r=Tce(n);r&&(n.preventDefault(),n.stopPropagation(),t(e,r))},onInput:n=>{if(i.current||n.nativeEvent.isComposing)return;let r=n.currentTarget.value;n.currentTarget.value=``,r&&t(e,r)},onCompositionStart:()=>{i.current=!0},onCompositionEnd:n=>{i.current=!1;let r=n.currentTarget;queueMicrotask(()=>{let n=r.value;r.value=``,n&&t(e,n)})},onPaste:n=>{n.preventDefault();let r=n.clipboardData.getData(`text`);r&&t(e,Ece(r))},style:{position:`absolute`,width:1,height:1,padding:0,border:0,opacity:0,pointerEvents:`none`}}),(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`10px 12px`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsx)(`div`,{style:{color:`var(--text)`,fontSize:`var(--text-lg)`,fontWeight:650},children:n(`chat.extensionPanel`)}),(0,F.jsx)(`button`,{onClick:()=>t(e,``),style:{padding:`5px 9px`,borderRadius:6,border:`1px solid var(--border)`,background:`var(--bg-panel)`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-base)`},children:n(`chat.close`)})]}),(0,F.jsx)(`pre`,{style:{margin:0,padding:14,maxHeight:`calc(min(760px, 100vh - 40px) - 48px)`,overflow:`auto`,background:`var(--bg-panel)`,color:`var(--text)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-lg)`,lineHeight:1.45,whiteSpace:`pre`},children:(a.length?a:[``]).map((e,t,n)=>(0,F.jsxs)(d.Fragment,{children:[Dce(e,`line-${t}`),t<n.length-1?`
|
|
489
489
|
`:null]},t))})]})})}function kce({request:e,onRespond:t}){let{t:n}=I(),[r,i]=(0,d.useState)(e.method===`editor`?e.prefill??``:``),[a,o]=(0,d.useState)(()=>Date.now());(0,d.useEffect)(()=>{i(e.method===`editor`?e.prefill??``:``),o(Date.now())},[e]),(0,d.useEffect)(()=>{if(!e.expiresAt)return;let t=setInterval(()=>{document.hidden||o(Date.now())},1e3),n=()=>{document.hidden||o(Date.now())};return document.addEventListener(`visibilitychange`,n),()=>{clearInterval(t),document.removeEventListener(`visibilitychange`,n)}},[e.expiresAt]);let s=e.expiresAt?Math.max(0,Math.ceil((e.expiresAt-a)/1e3)):null;(0,d.useEffect)(()=>{s===0&&t(e,{cancelled:!0})},[s===0,e.id]);let c=()=>{e.method===`confirm`?t(e,{confirmed:!0}):t(e,{value:r})},l={select:n(`chat.extensionSelect`),confirm:n(`chat.extensionConfirm`),editor:n(`chat.extensionEditor`),input:n(`chat.extensionInput`)}[e.method];return(0,F.jsxs)(Y7,{testId:`extension-dialog`,flashHeader:!0,title:(0,F.jsxs)(F.Fragment,{children:[l,s!==null&&(0,F.jsxs)(`span`,{style:{color:`var(--text-muted)`,marginLeft:6,fontVariantNumeric:`tabular-nums`},children:[`(`,s,`s)`]})]}),subtitle:n(`chat.extensionRequest`),maxWidth:Math.round(window.innerWidth*.6),footer:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{onClick:()=>t(e,{cancelled:!0}),style:{padding:`6px 10px`,borderRadius:6,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,cursor:`pointer`},children:n(`chat.cancel`)}),e.method===`confirm`?(0,F.jsx)(`button`,{onClick:c,style:{padding:`6px 10px`,borderRadius:6,border:`1px solid var(--accent)`,background:`var(--accent)`,color:`var(--on-accent)`,cursor:`pointer`},children:n(`chat.confirm`)}):e.method===`select`?null:(0,F.jsx)(`button`,{onClick:c,style:{padding:`6px 10px`,borderRadius:6,border:`1px solid var(--accent)`,background:`var(--accent)`,color:`var(--on-accent)`,cursor:`pointer`},children:n(`chat.submit`)})]}),children:[(0,F.jsx)(`div`,{style:{marginBottom:12,padding:`9px 10px`,borderRadius:7,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-lg)`,lineHeight:1.6,whiteSpace:`pre-wrap`,maxHeight:360,overflowY:`auto`},children:e.title}),`Notification`in window&&Notification.permission===`denied`&&(0,F.jsx)(`div`,{style:{marginBottom:10,padding:`7px 10px`,borderRadius:7,border:`1px solid var(--border-warning, var(--border))`,background:`var(--bg-panel)`,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,lineHeight:1.5},children:n(`chat.questionNotificationDenied`)}),e.method===`confirm`&&(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,fontSize:`var(--text-lg)`,lineHeight:1.6,whiteSpace:`pre-wrap`},children:e.message}),e.method===`select`&&(0,F.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:e.options.map(n=>(0,F.jsx)(`button`,{onClick:()=>t(e,{value:n}),style:{flex:`1 1 auto`,padding:`9px 10px`,borderRadius:7,border:`1px solid var(--border)`,background:`var(--bg-panel)`,color:`var(--text)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-lg)`},children:n},n))}),e.method===`input`&&(0,F.jsx)(`input`,{autoFocus:!0,value:r,placeholder:e.placeholder,onChange:e=>i(e.target.value),onKeyDown:n=>{n.key===`Enter`&&c(),n.key===`Escape`&&t(e,{cancelled:!0})},style:{width:`100%`,padding:`9px 10px`,borderRadius:7,border:`1px solid var(--border)`,background:`var(--bg-panel)`,color:`var(--text)`,outline:`none`,fontSize:`var(--text-2xl)`}}),e.method===`editor`&&(0,F.jsx)(`textarea`,{autoFocus:!0,value:r,onChange:e=>i(e.target.value),onKeyDown:n=>{n.key===`Escape`&&t(e,{cancelled:!0}),(n.metaKey||n.ctrlKey)&&n.key===`Enter`&&c()},style:{width:`100%`,minHeight:220,padding:10,borderRadius:7,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text)`,outline:`none`,resize:`vertical`,fontSize:`var(--text-2xl)`,lineHeight:1.55,fontFamily:`var(--font-mono)`}})]},e.id)}function Ace({widget:e,saved:t,messages:n,defaultOffset:r,onCloseWidget:i,setWidgetGeometry:a,onSend:o,fillChatInput:s,portalTarget:c}){let{t:l}=I(),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(null),h=(0,d.useRef)(null),g=(0,d.useCallback)(t=>{if(u)return;let n=()=>i(e.key,e.lines.join(`
|
|
490
490
|
`));if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){n();return}let r=document.querySelector(`[data-tab-id="widgets"]`)??document.querySelector(`[data-testid="tab-bar"]`);if(!r){n();return}let a=t.currentTarget.getBoundingClientRect(),o=r.getBoundingClientRect(),s=`M ${a.left+a.width/2} ${a.top+a.height/2} L ${o.left+o.width/2} ${o.top+o.height/2}`;f(!0),m(s),window.setTimeout(n,280)},[u,i,e.key,e.lines]);return(0,d.useLayoutEffect)(()=>{if(!p||!h.current)return;let e=h.current;e.style.setProperty(`offset-path`,`path('${p}')`),e.style.setProperty(`offset-rotate`,`0deg`),e.animate([{offsetDistance:`0%`,r:28},{offsetDistance:`100%`,r:2}],{duration:240,easing:`cubic-bezier(0.22, 1, 0.36, 1)`,fill:`forwards`})},[p]),(0,d.useEffect)(()=>{t===void 0?a(e.key,{x:r.dx,y:r.dy,width:560,height:Math.round(window.innerHeight*.6)}):t.collapsed&&i(e.key,e.lines.join(`
|
|
@@ -493,5 +493,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
493
493
|
`)}if(e.role===`assistant`){let t=[];for(let n of e.content)n.type===`text`?t.push(n.text):n.type===`thinking`?t.push(n.thinking??``):n.type===`toolCall`&&t.push(`${n.toolName}(${JSON.stringify(n.input??{})})`);return t.join(`
|
|
494
494
|
`)}if(e.role===`toolResult`)return e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
495
495
|
`);if(e.role===`bashExecution`){let t=e;return`${t.command}\n${t.output??``}`}return``}var d9=100,f9=44;function Gce({messages:e,t,onJump:n}){let[r,i]=(0,d.useState)(``),[a,o]=(0,d.useState)(0),s=(0,d.useRef)(null),c=(0,d.useRef)(null),l=(0,d.useMemo)(()=>e.map((e,t)=>({msgIdx:t,role:e.role,text:Wce(e)})),[e]),u=(0,d.useMemo)(()=>{let e=r.trim().toLowerCase();if(!e)return[];let t=[];for(let{msgIdx:n,role:r,text:i}of l){let a=0,o=i.toLowerCase().indexOf(e,a);for(;o!==-1&&t.length<d9;)t.push({msgIdx:n,role:r,text:i,start:o}),a=o+1,o=i.toLowerCase().indexOf(e,a);if(t.length>=d9)break}return t},[l,r]);Jr(()=>o(e=>Math.min(e,Math.max(0,u.length-1))),[u.length]);let f=(0,d.useCallback)(e=>{let t=u[e];t&&(n(t.msgIdx),o(e))},[u,n]),p=(0,d.useCallback)(e=>{if(u.length!==0){if(e.key===`Enter`){e.preventDefault();let t=e.shiftKey?-1:1,n=(a+t+u.length)%u.length;f(n)}else e.key===`ArrowDown`?(e.preventDefault(),f(Math.min(a+1,u.length-1))):e.key===`ArrowUp`&&(e.preventDefault(),f(Math.max(a-1,0)))}},[a,f,u.length]);return(0,d.useEffect)(()=>{(c.current?.children[a])?.scrollIntoView({block:`nearest`})},[a]),(0,F.jsxs)(`div`,{style:{position:`relative`,flex:`1 1 0`,minWidth:0,maxWidth:2040},"data-testid":`search-box`,children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`0 6px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:6,height:30,boxSizing:`border-box`},children:[(0,F.jsx)(Sr,{size:R.xl,color:`var(--text-muted)`,style:{flexShrink:0}}),(0,F.jsx)(`input`,{ref:s,value:r,onChange:e=>i(e.target.value),onKeyDown:p,placeholder:t(`chat.searchPlaceholder`),style:{flex:1,minWidth:0,background:`transparent`,border:`none`,outline:`none`,color:`var(--text)`,fontSize:`var(--text-sm)`}}),r&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>{i(``),s.current?.focus()},"aria-label":t(`chat.clearSearch`),style:{border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0,padding:0},children:`✕`})]}),r.trim()&&(0,F.jsx)(`div`,{ref:c,style:{position:`absolute`,top:`calc(100% + 6px)`,left:0,right:0,maxHeight:`min(55vh, 480px)`,overflowY:`auto`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:8,boxShadow:`0 8px 24px var(--shadow-color)`,zIndex:60},children:u.length===0?(0,F.jsx)(`div`,{style:{padding:`10px 12px`,fontSize:`var(--text-base)`,color:`var(--text-muted)`},children:t(`chat.searchNoResults`)}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{style:{padding:`6px 12px`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,borderBottom:`1px solid var(--border)`},children:t(`chat.searchResults`,{count:u.length})}),u.map((e,t)=>{let n=r.trim(),i=Math.max(0,e.start-f9),o=Math.min(e.text.length,e.start+n.length+f9),s=i>0?`…`:``,c=o<e.text.length?`…`:``,l=`${s}${e.text.slice(i,o)}${c}`;return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>f(t),"data-testid":`search-result`,style:{display:`block`,width:`100%`,textAlign:`left`,padding:`8px 12px`,border:`none`,borderBottom:`1px solid var(--border)`,background:t===a?`var(--bg-selected)`:`transparent`,color:`var(--text)`,cursor:`pointer`,fontSize:`var(--text-base)`,lineHeight:1.5},children:[(0,F.jsxs)(`span`,{style:{color:`var(--text-dim)`,marginRight:6,fontSize:`var(--text-sm)`},children:[`#`,e.msgIdx]}),(0,F.jsx)(`span`,{children:Kce(l,n)})]},`${e.msgIdx}-${e.start}`)})]})})]})}function Kce(e,t){let n=[],r=e,i=0;for(;r.length>0;){let e=r.toLowerCase().indexOf(t.toLowerCase());if(e===-1){n.push(r);break}e>0&&n.push(r.slice(0,e)),n.push((0,F.jsx)(`mark`,{children:r.slice(e,e+t.length)},i++)),r=r.slice(e+t.length)}return n}function qce(e,t){switch(e){case`naming`:return t(`title.generating`);case`success`:return t(`title.updated`);case`error`:return t(`title.failed`);default:return t(`title.generate`)}}function Jce(e,t,n,r){return t?n?e.kind===`error`?e.message:r(`title.generateSession`):r(`title.noMessages`):r(`title.unsaved`)}function Yce({session:e,hasMessages:t,onRenamed:n,onStart:r}){let{t:i}=I(),[a,o]=(0,d.useState)({kind:`idle`}),s=Fx(),c=(0,d.useRef)(null);(0,d.useEffect)(()=>{s.cancel(),o({kind:`idle`}),c.current=e?.id??null},[e?.id,s]);let l=(0,d.useCallback)(async()=>{let t=e?.id;if(!(!t||a.kind===`naming`)){s.cancel(),r?.(),o({kind:`naming`});try{let e=await fetch(`/api/sessions/${encodeURIComponent(t)}/auto-name`,{method:`POST`}),r=await e.json().catch(()=>({}));if(!e.ok||!r.title)throw Error(r.error||`HTTP ${e.status}`);let i=r.title.trim();if(c.current!==t)return;n?.(t,i),o({kind:`success`}),s.schedule(()=>o({kind:`idle`}),1800)}catch(e){if(c.current!==t)return;let n=e instanceof Error?e.message:String(e);o({kind:`error`,message:n}),s.schedule(()=>o({kind:`idle`}),5e3)}}},[a.kind,s,e?.id,n,r]),u=!e||!t||a.kind===`naming`,f=a.kind===`success`,p=a.kind===`error`,m=qce(a.kind,i),h=Jce(a,e,t,i);return(0,F.jsx)(L,{label:h,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>void l(),disabled:u,"aria-label":m,style:{...t9,color:p?`var(--status-error)`:f?`var(--status-success)`:u?`var(--text-dim)`:`var(--text-muted)`,cursor:u?`not-allowed`:`pointer`,opacity:u&&a.kind!==`naming`?.45:1,"--hover-color":p?`var(--status-error)`:`var(--text)`},className:u?void 0:`hover-shift`,children:a.kind===`naming`?(0,F.jsx)(ur,{className:`animate-spin`,size:R.lg,"aria-hidden":`true`}):f?(0,F.jsx)(zn,{size:R.lg,"aria-hidden":`true`}):(0,F.jsx)(pr,{size:R.lg,"aria-hidden":`true`,style:n9})})})}var Xce={display:`flex`,alignItems:`center`,gap:10,alignSelf:`center`,height:32,paddingLeft:12,paddingRight:12,border:`1px solid var(--border)`,borderRadius:7,fontSize:`var(--text-sm)`,color:`var(--text-muted)`,whiteSpace:`nowrap`,cursor:`pointer`,fontVariantNumeric:`tabular-nums`,transition:`color 0.12s, background 0.12s, border-color 0.12s`,"--hover-color":`var(--text)`,"--hover-bg":`var(--bg-selected)`,"--hover-border":`color-mix(in srgb, var(--accent) 35%, transparent)`};function Zce(e){let t={color:`var(--text-muted)`,str:null};if(!e?.contextWindow)return t;let n=e.percent,r=`var(--text-muted)`;return n!==null&&n>90?r=`var(--status-error)`:n!==null&&n>70&&(r=`color-mix(in srgb, var(--status-warning) 95%, transparent)`),{color:r,str:n===null?`? / ${M5(e.contextWindow)}`:`${n.toFixed(0)}% / ${M5(e.contextWindow)}`}}function Qce(e){if(!e)return null;let t=e.input+e.cacheRead+e.cacheWrite;return t>0?e.cacheRead/t*100:null}function $ce(e,t,n,r,i){let a=[];if(e&&(a.push(`${i(`session.input`)}: ${e.input.toLocaleString(r)}`),a.push(`${i(`session.output`)}: ${e.output.toLocaleString(r)}`),a.push(`${i(`session.cacheRead`)}: ${e.cacheRead.toLocaleString(r)}`),a.push(`${i(`session.cacheWrite`)}: ${e.cacheWrite.toLocaleString(r)}`),t>0&&a.push(`${i(`session.cost`)}: $${t.toFixed(4)}`)),n?.contextWindow){let e=n.percent;a.push(`${i(`session.context`)}: ${e===null?`?`:`${e.toFixed(1)}%`} / ${M5(n.contextWindow)}`)}return a.join(` · `)}function ele(e,t,n){return e===null?null:(0,F.jsx)(L,{label:`${n(t)} · ${e.toFixed(1)}%`,children:(0,F.jsxs)(`span`,{style:{fontSize:`var(--text-xs)`,padding:`0 4px`,borderRadius:8,border:`1px solid color-mix(in srgb, var(--accent) 45%, transparent)`,background:`color-mix(in srgb, var(--accent) 10%, transparent)`,color:`var(--accent)`},children:[e.toFixed(1),`%`]})})}function tle({sessionStats:e,contextUsage:t,activeTopPanel:n,toggleTopPanel:r,isMobile:i,t:a,locale:o}){let s=e?.tokens,c=e?.cost??0,l=N5(c),u=Zce(t),d=Qce(s),f=$ce(s,c,t,o,a)||a(`session.title`);return(0,F.jsx)(L,{label:f,wrapperStyle:{marginLeft:`auto`,flex:`0 0 auto`},children:(0,F.jsxs)(`button`,{type:`button`,"data-testid":`chat-toolbar-session`,onClick:()=>r(`session`),"aria-label":a(`session.title`),"aria-pressed":n===`session`,style:{...Xce,background:n===`session`?`var(--bg-selected)`:`transparent`,borderColor:n===`session`?`var(--accent)`:`var(--border)`},className:`hover-shift`,children:[i&&(0,F.jsxs)(`svg`,{width:R.xl,height:R.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,F.jsx)(`line`,{x1:`12`,y1:`16`,x2:`12`,y2:`12`}),(0,F.jsx)(`line`,{x1:`12`,y1:`8`,x2:`12.01`,y2:`8`})]}),!i&&s&&F5.map(e=>{let t=s[e.key];return t<=0?null:(0,F.jsx)(P5,{svg:(0,F.jsx)(`svg`,{...j5,style:{color:e.color},children:e.svg}),value:M5(t),badge:e.rateHint?ele(d,e.rateHint,a):null},e.key)}),!i&&l!==null&&(0,F.jsx)(`span`,{style:A5,children:l}),u.str!==null&&(0,F.jsxs)(`span`,{style:{...k5,color:u.color},children:[(0,F.jsxs)(`svg`,{...j5,children:[(0,F.jsx)(`path`,{d:`M1 9 L1 5 Q1 1 5 1 Q9 1 9 5 L9 9`}),(0,F.jsx)(`line`,{x1:`1`,y1:`9`,x2:`9`,y2:`9`})]}),u.str]})]})})}function p9({title:e,rows:t,valueAlign:n=`left`,compact:r=!1}){return(0,F.jsxs)(`div`,{style:{minWidth:0},children:[(0,F.jsx)(`div`,{style:r9,children:e}),(0,F.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:r?`max-content max-content max-content`:`auto minmax(0, 1fr) max-content`,columnGap:r?14:12,rowGap:4,justifyContent:r?`start`:void 0},children:t.map(([t,i,a])=>(0,F.jsxs)(`div`,{style:{display:`contents`},children:[(0,F.jsx)(L,{label:a?.title,wrapperStyle:{display:`flex`,color:`var(--text-dim)`,whiteSpace:`nowrap`},children:(0,F.jsx)(`div`,{style:{color:`var(--text-dim)`,whiteSpace:`nowrap`},children:t})}),(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,minWidth:0,overflowWrap:r?`normal`:`anywhere`,textAlign:n,whiteSpace:n===`right`?`nowrap`:`normal`},children:i}),(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,minWidth:0},children:a?.badge&&(0,F.jsx)(L,{label:`${a.badgeTitle??``}${a.badgeTitle?` · `:``}${a.badge}`,children:(0,F.jsx)(`span`,{style:{padding:`0 5px`,...sce},children:a.badge})})})]},`${e}:${t}`))})]})}function nle({field:e,value:t,copied:n,onCopy:r,t:i}){return(0,F.jsx)(L,{label:i(n?`session.copied`:e===`file`?`session.copyFile`:`session.copyId`),children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>r(e,t),style:{alignSelf:`start`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:22,height:22,marginTop:-2,color:n?`var(--accent)`:`var(--text-dim)`,background:`transparent`,border:`1px solid var(--border)`,borderRadius:4,cursor:`pointer`,flex:`0 0 auto`,transition:`color 0.12s, border-color 0.12s, background 0.12s`,"--hover-color":`var(--accent)`,"--hover-border":`var(--accent)`,"--hover-bg":`var(--bg-hover)`},className:`hover-shift`,children:n?(0,F.jsx)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,F.jsxs)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:R.lg,height:R.lg,rx:`2`,ry:`2`}),(0,F.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})})})}function rle({sessionStats:e,displayContextUsage:t,isMobile:n,locale:r,t:i,copiedSessionField:a,onCopySessionField:o,onMouseEnter:s,onMouseLeave:c}){return e?(0,F.jsxs)(`div`,{onMouseEnter:s,onMouseLeave:c,style:ile,children:[(0,F.jsx)(ole,{sessionStats:e,locale:r,t:i,copiedSessionField:a,onCopySessionField:o}),(0,F.jsx)(p9,{title:i(`session.messages`),rows:sle(e,r,i)}),(0,F.jsx)(p9,{title:i(`session.tokens`),rows:cle(e,t,r,i),valueAlign:`right`,compact:!0})]}):(0,F.jsx)(`div`,{onMouseEnter:s,onMouseLeave:c,style:{...ale},children:(0,F.jsx)(`div`,{style:{fontSize:`var(--text-base)`,color:`var(--text-muted)`,fontStyle:`italic`},children:i(`session.load`)})})}var ile={position:`absolute`,top:`100%`,left:0,right:0,zIndex:1500,background:`var(--bg)`,borderBottom:`1px solid var(--border)`,boxShadow:`0 10px 28px var(--shadow-color)`,maxHeight:`calc(100dvh - 80px)`,overflowY:`auto`,display:`grid`,gridTemplateColumns:`minmax(360px, 1.7fr) minmax(140px, 0.55fr) minmax(190px, 0.75fr)`,gap:24,padding:`12px 16px`,fontSize:`var(--text-base)`,lineHeight:1.5,fontFamily:`var(--font-mono)`},ale={padding:`12px 16px`,...r9};function ole({sessionStats:e,locale:t,t:n,copiedSessionField:r,onCopySessionField:i}){let a=[...e.sessionName?[{label:n(`session.name`),value:e.sessionName,copyField:null}]:[],{label:n(`session.file`),value:e.sessionFile??n(`session.inMemory`),copyField:`file`},{label:n(`session.id`),value:e.sessionId,copyField:`id`}];return(0,F.jsxs)(`div`,{style:{minWidth:0},children:[(0,F.jsx)(`div`,{style:r9,children:n(`session.infoSection`)}),(0,F.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`auto minmax(0, 1fr) auto`,columnGap:12,rowGap:8,alignItems:`start`},children:a.map(e=>(0,F.jsxs)(`div`,{style:{display:`contents`},children:[(0,F.jsx)(`div`,{style:{color:`var(--text-dim)`,whiteSpace:`nowrap`},children:e.label}),(0,F.jsx)(`div`,{style:{color:`var(--text-muted)`,minWidth:0,overflowWrap:`anywhere`,wordBreak:`break-word`,whiteSpace:`normal`},children:e.value}),(0,F.jsx)(`div`,{children:e.copyField?(0,F.jsx)(nle,{field:e.copyField,value:e.value,copied:r===e.copyField,onCopy:i,t:n}):null})]},`session-info:${e.label}`))})]})}function sle(e,t,n){return[[n(`session.user`),e.userMessages.toLocaleString(t)],[n(`session.assistant`),e.assistantMessages.toLocaleString(t)],[n(`session.toolCalls`),e.toolCalls.toLocaleString(t)],[n(`session.toolResults`),e.toolResults.toLocaleString(t)],[n(`session.total`),e.totalMessages.toLocaleString(t)]]}function cle(e,t,n,r){let i=e.tokens.input+e.tokens.cacheRead+e.tokens.cacheWrite,a=e=>`${e.toFixed(1)}%`,o=[[r(`session.input`),e.tokens.input.toLocaleString(n),{title:r(`session.inputHint`)}],[r(`session.output`),e.tokens.output.toLocaleString(n),{title:r(`session.outputHint`)}]];e.tokens.cacheRead>0&&o.push([r(`session.cacheRead`),e.tokens.cacheRead.toLocaleString(n),{title:r(`session.cacheReadHint`),badge:i>0?a(e.tokens.cacheRead/i*100):void 0,badgeTitle:r(`session.cacheReadRate`)}]),e.tokens.cacheWrite>0&&o.push([r(`session.cacheWrite`),e.tokens.cacheWrite.toLocaleString(n),{title:r(`session.cacheWriteHint`)}]),o.push([r(`session.total`),e.tokens.total.toLocaleString(n),{title:r(`session.totalHint`)}]);let s=t??e.contextUsage;return e.cost>0&&o.push([r(`session.cost`),`$${e.cost.toFixed(4)}`]),s?.contextWindow&&o.push([r(`session.context`),`${s.percent===null?`?`:`${s.percent.toFixed(1)}%`} / ${(e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}k`:String(e))(s.contextWindow)}`]),o}function lle({session:e,onViewFullHistory:t,t:n}){return(0,F.jsx)(L,{label:n(e?`history.full`:`history.unsaved`),children:(0,F.jsx)(`button`,{onClick:t,disabled:!e,"aria-label":n(`history.full`),style:{...t9,color:e?`var(--text-muted)`:`var(--text-dim)`,cursor:e?`pointer`:`not-allowed`,opacity:e?1:.45},className:e?`hover-shift`:void 0,children:(0,F.jsx)(yr,{size:R.base,style:n9})})})}function ule({chatToolbarRef:e,systemBtnRef:t,session:n,sessionStats:r,displayContextUsage:i,activeTopPanel:a,toggleTopPanel:o,closeTopPanel:s,systemPrompt:c,copiedSessionField:l,toolbarExtra:u,handleViewFullHistory:d,handleAutoNameRenamed:f,handleCopySessionField:p,handleBuiltinSlashCommand:m,tree:h,activeLeafId:g,handleLeafChange:_,handleSearchJump:v,scheduleCloseTopPanel:y,cancelCloseTopPanel:b,commandBusy:x,messages:S,isMobile:C,locale:w,t:T}){return(0,F.jsxs)(`div`,{ref:e,"data-testid":`chat-toolbar`,style:oce,children:[(0,F.jsx)(lle,{session:n,onViewFullHistory:d,t:T}),(0,F.jsx)(Yce,{session:n,hasMessages:!!(n&&(r?.userMessages??n.messageCount)>0),onRenamed:f,onStart:s}),(0,F.jsx)(L,{label:T(`i18n.branches`),children:(0,F.jsx)(Vce,{tree:h,activeLeafId:g,onLeafChange:_,inline:!0,compact:!0,containerRef:e,open:a===`branches`,onToggle:()=>o(`branches`),hasSession:!0})}),(0,F.jsx)(L,{label:T(`system.prompt`),children:(0,F.jsx)(`button`,{ref:t,onClick:()=>o(`system`),"aria-label":T(`system.prompt`),"aria-pressed":a===`system`,style:{...t9,background:a===`system`?`var(--bg-selected)`:`transparent`,borderColor:a===`system`?`var(--accent)`:`var(--border)`,cursor:`pointer`,color:a===`system`?`var(--text)`:`var(--text-muted)`,"--hover-color":`var(--text)`},className:`hover-shift`,children:(0,F.jsx)(Qn,{size:R.base,style:n9})})}),(0,F.jsx)(L,{label:T(`session.reload`),children:(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-toolbar-reload`,onClick:()=>void m(`/reload`),"aria-label":T(`session.reload`),style:{...t9,background:`transparent`,borderColor:`var(--border)`,cursor:`pointer`,color:`var(--text-muted)`,"--hover-color":`var(--text)`},className:`hover-shift`,children:x?(0,F.jsx)(ur,{className:`animate-spin`,size:R.base,style:n9}):(0,F.jsx)(vr,{size:R.base,style:n9})})}),(0,F.jsx)(`div`,{style:{marginLeft:8,display:`flex`,alignItems:`center`,flex:1,minWidth:0},children:(0,F.jsx)(Gce,{messages:S,t:T,onJump:v})}),r||i?(0,F.jsx)(tle,{sessionStats:r,contextUsage:i,activeTopPanel:a,toggleTopPanel:o,isMobile:C,t:T,locale:w}):null,(0,F.jsx)(L,{label:T(`notices.title`),children:(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-toolbar-notices`,onClick:()=>o(`notices`),"aria-label":T(`notices.title`),"aria-pressed":a===`notices`,style:{...t9,background:a===`notices`?`var(--bg-selected)`:`transparent`,borderColor:a===`notices`?`var(--accent)`:`var(--border)`,cursor:`pointer`,color:a===`notices`?`var(--text)`:`var(--text-muted)`,"--hover-color":`var(--text)`},className:`hover-shift`,children:(0,F.jsx)(Rn,{size:R.base,style:n9})})}),u,a===`system`&&(0,F.jsx)(`div`,{onMouseEnter:b,onMouseLeave:y,style:e9,children:c?(0,F.jsx)(`div`,{style:{padding:`12px 16px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`,lineHeight:1.6,whiteSpace:`pre-wrap`,fontFamily:`var(--font-mono)`},children:c}):c===``?(0,F.jsx)(`div`,{style:X7,children:T(`system.empty`)}):(0,F.jsx)(`div`,{style:X7,children:T(`system.load`)})}),a===`session`&&(0,F.jsx)(rle,{sessionStats:r,displayContextUsage:i,isMobile:C,locale:w,t:T,copiedSessionField:l,onCopySessionField:p,onMouseEnter:b,onMouseLeave:y}),a===`notices`&&(0,F.jsx)(uce,{onMouseEnter:b,onMouseLeave:y})]})}function dle({sessionIdForCache:e,scrollContainerRef:t,resetItemObservers:n,onResetCache:r,messageRefs:i,lastUserMsgRef:a}){(0,d.useEffect)(()=>{if(r(),n(),i.current=[],a.current=null,t.current){t.current.scrollTop=0;let e=t.current.firstElementChild;if(e&&e.children.length===1){let t=e.firstElementChild;t?.style.height&&(t.style.height=`0px`)}}},[e])}function fle({extensionDialog:e,soundedIdRef:t,playRef:n}){(0,d.useEffect)(()=>{e&&t.current!==e.id&&(t.current=e.id,IJ(`ui-chain`,`4b ExtensionDialog mounted, play sound`,`${e.method} id=${e.id.slice(0,8)} title=${JSON.stringify(e.title)}`),n.current?.())},[e,t,n])}function ple({startScreenMessages:e,aiIdle:t,isPinnedToBottom:n,scrollContainerRef:r}){(0,d.useLayoutEffect)(()=>{if(!e.length||!t||!n())return;let i=r.current;i&&(i.scrollTop=i.scrollHeight)},[e.length,t,r,n])}function mle({notifyPermission:e,newSessionCwd:t,startScreenMessages:n,handleQuickMessageSend:r,fillChatInput:i,notices:a,chatInputElement:o,t:s}){return(0,F.jsx)(`div`,{className:`relative flex flex-1 flex-col items-center justify-center overflow-y-auto px-4 py-8`,children:(0,F.jsxs)(`div`,{className:`w-full max-w-[820px]`,children:[(0,F.jsxs)(`div`,{className:`mb-3`,style:{textAlign:`center`,padding:`40px 0`},children:[e==="default"?(0,F.jsxs)(`div`,{style:{marginBottom:20,fontSize:`var(--text-sm)`,color:`var(--text-muted)`,lineHeight:1.6},children:[s(`notify.permission.bannerHintBefore`),` `,(0,F.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{display:`inline-block`,verticalAlign:-2},children:[(0,F.jsx)(`path`,{d:`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`}),(0,F.jsx)(`path`,{d:`M10.3 21a1.94 1.94 0 0 0 3.4 0`})]}),` `,s(`notify.permission.bannerHintAfter`)]}):null,(0,F.jsx)(`div`,{style:{fontSize:`var(--text-6xl)`,fontWeight:700,fontStyle:`italic`,color:`var(--accent)`},children:`Pi Web`}),t?(0,F.jsx)(`div`,{style:{marginTop:6,fontSize:`var(--text-3xl)`,color:`var(--text-muted)`,fontFamily:`var(--font-mono)`},children:t}):null]}),n.length>0&&(0,F.jsx)(`div`,{style:{marginBottom:28},children:(0,F.jsx)(D7,{messages:n,onSend:r,onFillInput:i,testIdPrefix:`start-screen-msg`,wrapperTestId:`start-screen-messages`,center:!0})}),(0,F.jsx)(`div`,{style:{position:`absolute`,top:12,left:0,right:0,zIndex:40,padding:`0 16px`,pointerEvents:`none`},children:(0,F.jsx)(`div`,{style:{maxWidth:820,margin:`0 auto`},children:(0,F.jsx)(i9,{notices:a,floating:!0,align:`right`})})}),o]})})}function m9(e){return e>=1e6?`${(e/1e6).toPrecision(3)}M`:e>=1e3?`${(e/1e3).toPrecision(3)}K`:String(e)}function hle(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!(n.role!==`assistant`||!n.timestamp)){for(let r=t-1;r>=0;r--){let t=e[r];if(t.role===`user`&&t.timestamp){let e=Math.round((n.timestamp-t.timestamp)/1e3);return e>0?e:void 0}}return}}}var gle={running_tools:`🔧`,running_command:`💻`,thinking:`💡`};function _le(e){let t=[...e].reverse().find(e=>e.role===`assistant`),n=t&&t.role===`assistant`?t.usage:void 0;return`⬇ ${m9(n?.input??0)}↑ ${m9(n?.output??0)}↓`}function vle(e){let{agentPhase:t,isStreaming:n,messages:r,elapsed:i}=e,a=i??``,o=t?.kind;return o===`waiting_model`&&n?_le(r):`${gle[o??``]??`⏳`} ${a}`.trimEnd()}function h9(e){let{extensionDialogOpen:t,sessionBusy:n,messages:r,elapsed:i,agentPhase:a,isStreaming:o}=e;if(t)return`❓`;if(n)return vle({agentPhase:a,isStreaming:o,messages:r,elapsed:i});let s=hle(r);return s===void 0?null:`✅ ${sZ(s)}`}function yle({sessionBusy:e,extensionDialogOpen:t,agentPhase:n,isStreaming:r,messages:i,windowTitleBase:a,busyElapsed:o,busySinceMs:s}){let c=(0,d.useRef)(``);(0,d.useEffect)(()=>{let s=()=>{if(document.hidden||document.hasFocus())return;let s=h9({extensionDialogOpen:t,sessionBusy:e,agentPhase:n,isStreaming:r,messages:i,elapsed:o});if(s===null)return;let l=a?`${s} · ${a}`:s;l!==c.current&&(c.current=l,eq(l))};s();let l=()=>{document.visibilityState===`hidden`&&s()};return document.addEventListener(`visibilitychange`,l),window.addEventListener(`blur`,s),()=>{document.removeEventListener(`visibilitychange`,l),window.removeEventListener(`blur`,s)}},[n,r,o,i,e,a,t]),(0,d.useEffect)(()=>{if(!e&&!t)return;let l=()=>{if(!document.hidden||document.hasFocus())return;let l=h9({extensionDialogOpen:t,sessionBusy:e,agentPhase:n,isStreaming:r,messages:i,elapsed:s===void 0?o:sZ((Date.now()-s)/1e3)});if(l===null)return;let u=a?`${l} · ${a}`:l;u!==c.current&&(c.current=u,eq(u))},u=setInterval(l,1e3);return document.addEventListener(`visibilitychange`,l),()=>{clearInterval(u),document.removeEventListener(`visibilitychange`,l)}},[e,t,n,r,i,a,o,s])}function ble({sessionBusy:e,handleSteer:t,handlePromptWithStreamingBehavior:n,handleSend:r,onSessionRenamed:i,setSessionStatsOverride:a,handleBuiltinSlashCommand:o,toggleTopPanel:s}){return{handleQuickMessageSend:(0,d.useCallback)(i=>{e?i.startsWith(`/`)?n(i,`steer`):t(i):r(i)},[e,t,n,r]),handleAutoNameRenamed:(0,d.useCallback)((e,t)=>{i?.(e,t),a(n=>n?.sessionId===e?{...n,sessionName:t}:n)},[i,a]),wrappedHandleBuiltinSlashCommand:(0,d.useCallback)(async e=>{let t=await o(e);return t.handled&&t.action===`openSessionStats`&&s(`session`),t},[o,s])}}function xle({playDoneSound:e,soundEnabled:t,onAgentEnd:n}){let r=(0,d.useRef)(e);(0,d.useEffect)(()=>{r.current=e});let i=(0,d.useRef)(t);(0,d.useEffect)(()=>{i.current=t});let a=(0,d.useRef)(null);return{wrappedOnAgentEnd:(0,d.useCallback)(()=>{i.current&&r.current(),n?.()},[n]),soundedExtensionDialogIdRef:a,playDoneSoundRef:r}}function Sle({scrollContainerRef:e}){let t=(0,d.useRef)(new Map),n=(0,d.useRef)(new Map),r=(0,d.useRef)(null),[i,a]=(0,d.useState)(!0),o=(0,d.useRef)(!0),s=(0,d.useRef)(0),c=(0,d.useCallback)(t=>{let n=e.current;n&&(n.scrollTop=t)},[e]),l=(0,d.useCallback)(()=>{let t=e.current;t&&(t.scrollTop=t.scrollHeight),o.current=!0,a(!0)},[e]),u=(0,d.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.scrollHeight-t.scrollTop-t.clientHeight;if(o.current&&n>0&&t.scrollHeight!==s.current){s.current=t.scrollHeight,t.scrollTop=t.scrollHeight;return}n<16?(o.current=!0,a(!0)):n>64&&(o.current=!1,a(!1)),s.current=t.scrollHeight},[e]),f=(0,d.useRef)(new Map),p=(0,d.useCallback)((r,i)=>{f.current.set(r,i);let a=n.current.get(r);return a||(a=n=>{if(f.current.get(r)?.(n),!n){t.current.get(r)?.disconnect(),t.current.delete(r),f.current.delete(r);return}let i=t.current.get(r);i?i.disconnect():(i=new ResizeObserver(()=>{document.hidden||o.current&&requestAnimationFrame(()=>{if(document.hidden)return;let t=e.current;t&&o.current&&(t.scrollTop=t.scrollHeight)})}),t.current.set(r,i)),i.observe(n)},n.current.set(r,a)),a},[e]),m=(0,d.useCallback)(()=>{t.current.forEach(e=>e.disconnect()),t.current.clear(),n.current.clear(),f.current.clear()},[]);return(0,d.useEffect)(()=>()=>m(),[m]),(0,d.useEffect)(()=>{let t=e.current;if(!t)return;let n=new ResizeObserver(()=>{document.hidden||o.current&&requestAnimationFrame(()=>{if(document.hidden)return;let t=e.current;t&&o.current&&(t.scrollTop=t.scrollHeight)})});return n.observe(t),()=>n.disconnect()},[e]),{nearBottom:i,virtualizerRef:r,scrollToBottom:l,handleListScroll:u,handleWindowJumpTo:c,itemRef:p,resetItemObservers:m,isPinnedToBottom:(0,d.useCallback)(()=>o.current,[])}}function Cle({autoReloadSeconds:e,activeLeafId:t,loadContext:n,sessionIdRef:r,extensionDialog:i,onExtensionDialogChange:a,sessionBusy:o,handleAbort:s}){let c=(0,d.useCallback)(()=>{let e=r.current;e&&n(e,t,!0)},[t,n,r]);return(0,d.useEffect)(()=>{if(!e||e<=0)return;let i=setInterval(()=>{let e=r.current;e&&n(e,t,!0)},e*1e3);return()=>clearInterval(i)},[e,t,n,r]),(0,d.useEffect)(()=>{a?.(i!==null)},[i,a]),(0,d.useEffect)(()=>{vJ()},[]),(0,d.useEffect)(()=>{qe(o?s:null)},[o,s]),{handleReloadFromDisk:c}}function wle({session:e}){let[t,n]=(0,d.useState)(null),r=Fx(),i=(0,d.useRef)(null),a=(0,d.useRef)(null),{activeTopPanel:o,toggleTopPanel:s,closeTopPanel:c}=qK(),l=Fx(),u=(0,d.useCallback)(()=>{l.schedule(()=>{c()},150)},[l,c]),f=l.cancel;(0,d.useEffect)(()=>{n(null)},[e?.id]);let p=(0,d.useCallback)(()=>{e&&window.open(`/api/sessions/${encodeURIComponent(e.id)}/export?inline=1`,`_blank`,`noopener,noreferrer`)},[e]);return{activeTopPanel:o,cancelCloseTopPanel:f,chatToolbarRef:i,closeTopPanel:c,copiedSessionField:t,handleCopySessionField:(0,d.useCallback)((e,t)=>{gK(t).then(()=>{r.cancel(),n(e),r.schedule(()=>n(null),1400)})},[r]),handleViewFullHistory:p,scheduleCloseTopPanel:u,systemBtnRef:a,toggleTopPanel:s}}function g9(e){return e.role===`user`?96:e.role===`assistant`?260:120}function Tle(e){return e.role===`assistant`&&l$(e).answerBlocks.some(e=>e.type===`image`||e.type===`text`&&e.text.trim().length>0)}function Ele(e,t,n){for(let r=n-1;r>t;r--)if(Tle(e[r]))return r;for(let r=n-1;r>t;r--)if(e[r]?.role===`assistant`)return r;return-1}function Dle(e,t){let n=0;for(let r of t){let t=e[r];t?.role===`assistant`&&(n+=u$(o$(t)))}return n}function Ole(e){return e.role===`assistant`?o$(e).length>0:e.role===`custom`}function _9(e){return e.role===`user`||e.role===`custom`&&e.customType===`compaction`}function v9(e,t,n={}){let r={...e,content:t};return n.omitUsage&&(r.usage=void 0),r}function kle({messages:e,userIdx:t,endIdx:n,finalAssistantIdx:r,isLiveTail:i,lastAnchorIdx:a}){return!!(r===-1||i&&n===e.length&&t===a)}function Ale(e,t){let{messages:n,userIdx:r,endIdx:i,finalAssistantIdx:a,visibleRefIndexByMessage:o,pushMessage:s}=t;s(r);let c=[];for(let e=r+1;e<a;e++)c.push(e);let l=c.filter(e=>Ole(n[e])),u=n[a],d=l$(u),f=d.processBlocks.length>0?v9(u,d.processBlocks,{omitUsage:!0}):null,p=d.answerBlocks.length>0||s$(u)?v9(u,d.answerBlocks):null,m=l.length+ +!!f;if(m>0){let t=l.map(e=>o.get(e)).find(e=>typeof e==`number`)??(p?void 0:o.get(a));e.push({key:`group-header-${r}-${a}`,kind:`groupHeader`,groupUserIdx:r,finalAssistantIdx:a,messageCount:m,toolCallCount:Dle(n,l)+u$(d.processBlocks),processRefIdx:t,estimate:40}),l.forEach((e,t)=>{s(e,{isProcess:!0,attachRef:!1,groupLast:!f&&t===l.length-1})}),f&&s(a,{isProcessFinal:!0,attachRef:!1,messageOverride:f,showTimestamp:!1,groupLast:!0})}p&&e.push({key:`message-${a}-answer`,kind:`message`,msgIdx:a,estimate:g9(n[a]),messageOverride:p,isAnswer:!0});for(let e=a+1;e<i;e++)s(e)}function jle(e,t){let{isLiveTail:n,lastAnchorIdx:r,visibleRefIndexByMessage:i}=t,a=[],o=(t,n={})=>{a.push({key:`message-${t}`,kind:`message`,msgIdx:t,estimate:g9(e[t]),...n})};for(let t=0;t<e.length;){let s=e[t];if(!_9(s)){o(t),t+=1;continue}let c=t,l=c+1;for(;l<e.length&&!_9(e[l]);)l+=1;let u=Ele(e,c,l);if(kle({messages:e,userIdx:c,endIdx:l,finalAssistantIdx:u,isLiveTail:n,lastAnchorIdx:r})){for(let e=c;e<l;e++)o(e);t=l;continue}Ale(a,{messages:e,userIdx:c,endIdx:l,finalAssistantIdx:u,visibleRefIndexByMessage:i,pushMessage:o}),t=l}return a}function Mle(e){let t=new Map;return e.forEach((e,n)=>{e.kind===`message`&&t.set(e.msgIdx,n)}),t}function Nle({messages:e,sessionBusy:t,isStreaming:n,virtualizerRef:r,scrollContainerRef:i,canMountList:a,setCanMountList:o,initialSizesRef:s}){let c=(0,d.useMemo)(()=>{let t=new Set,n=[];for(let r=e.length-1;r>=0;--r){let i=Jse(e[r]);if(!(!i||t.has(i))&&(t.add(i),n.push(i),n.length>=50))break}return n.reverse()},[e]),l=(0,d.useMemo)(()=>{for(let t=e.length-1;t>=0;t--)if(_9(e[t]))return t;return-1},[e]),u=(0,d.useMemo)(()=>{let t=new Map,n=0;return e.forEach((e,r)=>{(e.role===`user`||e.role===`assistant`)&&t.set(r,n++)}),t},[e]),f=(0,d.useMemo)(()=>jle(e,{isLiveTail:(t||n)&&l>=0,lastAnchorIdx:l,visibleRefIndexByMessage:u}),[e,t,n,l,u]),p=(0,d.useMemo)(()=>Mle(f),[f]),m=(0,d.useCallback)(e=>{let t=p.get(e);if(t===void 0)return null;let n=r.current;return n?n.getItemOffset(t):null},[p,r]),h=a&&s.current?[s.current,200]:void 0;(0,d.useLayoutEffect)(()=>{a||f.length!==0&&i.current&&(s.current=f.map(e=>e.estimate),o(!0))},[a,f,i,o,s]);let[g,_]=(0,d.useState)(null),v=(0,d.useRef)(null);return{inputHistory:c,rows:f,visibleRefIndexByMessage:u,initialCache:h,resolveMessageOffset:m,handleSearchJump:(0,d.useCallback)(e=>{let t=p.get(e);if(t===void 0)return;let n=r.current;if(!n)return;n.scrollToIndex(t,{align:`start`,offset:-24,smooth:!0});let i=f[t].key;_(i),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{v.current=null,_(e=>e===i?null:e)},1700)},[f,p,r]),flashKey:g}}function Ple(e){return e.replace(/[\r\n\t]/g,` `).replace(/ +/g,` `).trim()}function Fle(e){return[...e].sort((e,t)=>e.key.localeCompare(t.key)).map(({text:e})=>Ple(e)).join(` `)}function Ile({session:e,newSessionCwd:t,onAgentEnd:n,onSessionCreated:r,onSessionForked:i,modelsRefreshKey:a,chatInputRef:o,onOpenModelConfig:s,onSessionRenamed:c,windowTitleBase:l,onOpenFile:u,toolbarExtra:f,closedWidgetKeys:p,onCloseWidget:m,onExtensionWidgetsChange:h,onExtensionDialogChange:g}){let{t:_,locale:v}=I(),{scrollStepPx:b,autoReloadSeconds:x,recentBlocksExpanded:S,widgetGeometries:C,setWidgetGeometry:w,widgetMessages:T,startScreenMessages:E}=Tn(),{soundEnabled:D,onSoundToggle:O,playDoneSound:k,unlockAudio:A}=aZ(),j=Ge(),M=Ye(),{wrappedOnAgentEnd:N,soundedExtensionDialogIdRef:ee,playDoneSoundRef:te}=xle({playDoneSound:k,soundEnabled:D,onAgentEnd:n}),P=(0,d.useCallback)(e=>{o?.current?.insertIfEmpty(e)},[o]),ne=(0,d.useCallback)(e=>{o?.current?.fillInput(e)},[o]),{activeTopPanel:re,cancelCloseTopPanel:ie,chatToolbarRef:ae,closeTopPanel:oe,copiedSessionField:se,handleCopySessionField:ce,handleViewFullHistory:le,scheduleCloseTopPanel:ue,systemBtnRef:de,toggleTopPanel:fe}=wle({session:e}),{loading:pe,error:me,messages:he,entryIds:ge,streamState:_e,agentRunning:ve,bashRunning:ye,bashOutput:be,pendingBash:xe,modelNames:Se,modelList:Ce,modelError:we,modelScopeWarnings:Te,modelThinkingLevels:Ee,modelThinkingLevelMaps:De,toolPreset:Oe,thinkingLevel:ke,retryInfo:Ae,displayContextUsage:je,forkingEntryId:Me,isCompacting:Ne,compactResult:Pe,displayModel:Fe,sessionStats:Ie,systemPrompt:Le,slashCommands:Re,slashCommandsLoading:ze,queuedMessages:Be,notices:Ve,noticeModals:He,dismissNoticeModal:Ue,extensionDialog:We,extensionCustomUi:Ke,extensionStatuses:qe,extensionWidgets:Je,respondToExtensionUi:Xe,sendExtensionCustomInput:Ze,isAutoModelSelection:Qe,agentPhase:$e,commandBusy:et,isNew:tt,tree:nt,sessionIdRef:rt,activeLeafId:it,loadContext:at,messagesEndRef:ot,scrollContainerRef:st,lastUserMsgRef:ct,handleSend:lt,handleAbort:ut,handleFork:dt,handleNavigate:ft,handleLeafChange:pt,handleModelChange:mt,handleCompact:ht,handleSteer:gt,handleFollowUp:_t,handlePromptWithStreamingBehavior:vt,handleAbortCompaction:yt,handleRecallQueue:bt,handleBuiltinSlashCommand:xt,handleToolPresetChange:St,handleThinkingLevelChange:Ct,loadSlashCommands:wt,setSessionStatsOverride:Tt}=rZ({session:e,newSessionCwd:t,onAgentEnd:N,onSessionCreated:r,onSessionForked:i,modelsRefreshKey:a,chatInputRef:o});(0,d.useEffect)(()=>{h?.(Je)},[Je,h]);let Et=ve||ye,{handleQuickMessageSend:Dt,handleAutoNameRenamed:Ot,wrappedHandleBuiltinSlashCommand:kt}=ble({sessionBusy:Et,handleSteer:gt,handlePromptWithStreamingBehavior:vt,handleSend:lt,onSessionRenamed:c,setSessionStatsOverride:Tt,handleBuiltinSlashCommand:xt,toggleTopPanel:fe}),At=(0,d.useMemo)(()=>Yse(he,_e.streamingMessage),[he,_e.streamingMessage]),jt=(0,d.useMemo)(()=>Xse(he,ge,S),[he,ge,S]),{runningSessionIds:Mt,runningPhaseSince:Nt,runningBusySince:Pt}=vZ(),Ft=rce(e?.id,rt.current),It=$se(Mt.has(Ft),ve,et,ye),Lt=yZ(It,Nt[Ft]),Rt=yZ(It,Pt[Ft]),zt=y(Fle(qe));yle({sessionBusy:Et,extensionDialogOpen:We!==null,agentPhase:$e,isStreaming:_e.isStreaming,messages:he,windowTitleBase:l,busyElapsed:Rt,busySinceMs:Pt[Ft]});let{handleReloadFromDisk:Bt}=Cle({autoReloadSeconds:x,activeLeafId:it,loadContext:at,sessionIdRef:rt,extensionDialog:We,onExtensionDialogChange:g,sessionBusy:Et,handleAbort:ut});fle({extensionDialog:We,soundedIdRef:ee,playRef:te});let[Vt,Ht]=(0,d.useState)(null),{nearBottom:Ut,virtualizerRef:Wt,scrollToBottom:Gt,handleListScroll:Kt,handleWindowJumpTo:qt,itemRef:Jt,resetItemObservers:Yt,isPinnedToBottom:Xt}=Sle({scrollContainerRef:st}),Zt=P$(he.filter(e=>e.role===`user`||e.role===`assistant`).length),[Qt,$t]=(0,d.useState)(!1),en=e?.id??t??``;(0,d.useEffect)(()=>()=>{},[]);let{isDragOver:tn,handleDragEnter:nn,handleDragOver:rn,handleDragLeave:an,handleDrop:on}=oZ((0,d.useCallback)(e=>ace(o,Et,e),[Et,o])),sn=(0,d.useRef)(null),{inputHistory:cn,rows:ln,visibleRefIndexByMessage:un,initialCache:dn,resolveMessageOffset:fn,handleSearchJump:pn,flashKey:mn}=Nle({messages:he,sessionBusy:Et,isStreaming:_e.isStreaming,virtualizerRef:Wt,scrollContainerRef:st,canMountList:Qt,setCanMountList:$t,initialSizesRef:sn});dle({sessionIdForCache:en,scrollContainerRef:st,resetItemObservers:Yt,onResetCache:(0,d.useCallback)(()=>{$t(!1),sn.current=null},[]),messageRefs:Zt,lastUserMsgRef:ct});let hn=Zse(tt,he,_e.isStreaming,Et),gn=Qse(ve,_e.isStreaming,et,ye);ple({startScreenMessages:E,aiIdle:gn,isPinnedToBottom:Xt,scrollContainerRef:st});let _n=tce(e?.cwd,t),vn=$7(Fe,Ee),yn=$7(Fe,De),bn=ice(e,tt),xn=nce(e?.id,t),Sn=(0,F.jsx)(e$,{ref:o,onSend:lt,onAbort:ut,onSteer:Q7(gt,ve),onFollowUp:Q7(_t,ve),onPromptWithStreamingBehavior:Q7(vt,ve),isStreaming:Et,commandBusy:et,model:Fe,isAutoModelSelection:Qe,modelNames:Se,modelList:Ce,modelError:we,modelScopeWarnings:Te,onModelChange:mt,onCompact:Z7(ht,bn),onReloadFromDisk:Bt,onAbortCompaction:yt,isCompacting:Ne,compactResult:Pe,toolPreset:Oe,onToolPresetChange:Z7(St,bn),thinkingLevel:ke,onThinkingLevelChange:Z7(Ct,bn),availableThinkingLevels:vn,thinkingLevelMap:yn,onOpenModelConfig:s,retryInfo:Ae,queuedMessages:Be,inputHistory:cn,onRecallQueue:bt,slashCommands:Re,slashCommandsLoading:ze,onLoadSlashCommands:wt,onBuiltinCommand:kt,soundEnabled:D,onSoundToggle:O,onAudioUnlock:A,draftKey:xn,cwd:e?.cwd??t});return pe?(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center text-text-muted`,children:_(e?`chat.loadingSession`:`chat.noSessionSelected`)}):me?(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center text-red-400`,children:me}):(0,F.jsxs)(`div`,{ref:Ht,className:`relative flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,style:{paddingBottom:`env(safe-area-inset-bottom)`},onDragEnter:nn,onDragOver:rn,onDragLeave:an,onDrop:on,children:[(0,F.jsx)(jce,{isDragOver:tn,sessionBusy:Et,extensionDialog:We,onExtensionRespond:Xe,noticeModals:He,onDismissNotice:Ue,extensionCustomUi:Ke,onExtensionCustomInput:Ze,extensionWidgets:Je,closedWidgetKeys:p,widgetGeometries:C,widgetMessages:T,onCloseWidget:m,onSetWidgetGeometry:w,onQuickMessageSend:Dt,fillChatInput:ne,chatRoot:Vt}),(0,F.jsx)(ule,{chatToolbarRef:ae,systemBtnRef:de,session:e,sessionStats:Ie,displayContextUsage:je,activeTopPanel:re,toggleTopPanel:fe,closeTopPanel:oe,systemPrompt:Le,copiedSessionField:se,toolbarExtra:f,handleViewFullHistory:le,handleAutoNameRenamed:Ot,handleCopySessionField:ce,handleBuiltinSlashCommand:xt,tree:nt,activeLeafId:it,handleLeafChange:pt,handleSearchJump:pn,scheduleCloseTopPanel:ue,cancelCloseTopPanel:ie,commandBusy:et,messages:he,isMobile:j,locale:v,t:_}),hn?(0,F.jsx)(mle,{notifyPermission:M,newSessionCwd:t,startScreenMessages:E,handleQuickMessageSend:Dt,fillChatInput:ne,notices:Ve,chatInputElement:Sn,t:_}):(0,F.jsx)(yce,{isMobile:j,notices:Ve,scrollContainerRef:st,handleListScroll:Kt,canMountList:Qt,sessionIdForCache:en,sessionId:ece(e?.id,rt.current),rows:ln,messages:he,entryIds:ge,session:e,modelNames:Se,messageCwd:_n,onOpenFile:u,sessionBusy:Et,isNew:tt,handleFork:dt,forkingEntryId:Me,handleNavigate:ft,handleEditContent:P,sessionIdRef:rt,recentExpandedBlockKeys:jt,streamState:_e,flashKey:mn,itemRef:Jt,t:_,messageRefs:Zt,lastUserMsgRef:ct,visibleRefIndexByMessage:un,virtualizerRef:Wt,initialCache:dn,streamTurnNumber:At,agentRunning:ve,commandBusy:et,agentPhase:$e,phaseElapsed:Lt,totalElapsed:Rt,bashRunning:ye,pendingBash:xe,bashOutput:be,messagesEndRef:ot,nearBottom:Ut,scrollToBottom:Gt,resolveMessageOffset:fn,previewScrollStepPx:b,handleWindowJumpTo:qt,chatInputElement:Sn,startScreenMessages:E,aiIdle:gn,onQuickMessageSend:Dt,onFillInput:ne,plainStatusLine:zt})]})}function Lle({sessionKey:e,selectedSession:t,effectiveNewSessionCwd:n,handleAgentEnd:r,handleSessionCreated:i,handleSessionForked:a,modelsRefreshKey:o,handleOpenModelConfig:s,chatInputRef:c,handleOpenLinkedFile:l,handleSessionRenamed:u,activeCwdName:d,trustWarningElement:f,closedWidgets:p,handleCloseWidget:m,handleExtensionWidgetsChange:h,extensionDialogActiveRef:g}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(`div`,{style:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:(0,F.jsx)(Ile,{session:t,newSessionCwd:n,onAgentEnd:r,onSessionCreated:i,onSessionForked:a,modelsRefreshKey:o,onOpenModelConfig:s,chatInputRef:c,onOpenFile:l,onSessionRenamed:u,windowTitleBase:d,toolbarExtra:f,closedWidgetKeys:p,onCloseWidget:m,onExtensionWidgetsChange:h,onExtensionDialogChange:e=>{g.current=e}},e)})})}function Rle({configSection:e,setConfigSection:t,projectTrustCwd:n,sessionId:r,closeConfigTab:i,handleOpenFile:a,sidebarResizer:o,widgetPanelResizer:s,modelConfigFocus:c,defaultThinkingLevel:l,setDefaultThinkingLevel:u,compaction:d,retry:f,defaultProjectTrust:p,setDefaultProjectTrust:m,subagents:h}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(DK,{section:e,onSectionChange:t,cwd:n,sessionId:r,onClose:i,onOpenFile:a,sidebarWidth:o.width,onSidebarWidthChange:o.setWidth,widgetPanelWidth:s.width,onWidgetPanelWidthChange:s.setWidth,modelConfigFocus:c,defaultThinkingLevel:l,onDefaultThinkingLevelChange:u,compaction:d,onCompactionChange:e=>mt({firstPaint:{compaction:e}}),retry:f,onRetryChange:e=>mt({firstPaint:{retry:e}}),defaultProjectTrust:p,onDefaultProjectTrustChange:m,subagents:h,onSubagentsChange:e=>mt({firstPaint:{subagents:{defaultModel:e.defaultModel||void 0,defaultThinking:e.defaultThinking||void 0}}})})})}var zle=262144,y9=10485760,Ble={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,ico:`image/x-icon`,avif:`image/avif`},Vle={mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,oga:`audio/ogg`,opus:`audio/ogg`,m4a:`audio/mp4`,aac:`audio/aac`,flac:`audio/flac`,weba:`audio/webm`,webm:`audio/webm`};function Hle(e){return e.replace(/\\/g,`/`).split(`/`).pop()??``}function b9(e){return Hle(e).toLowerCase().split(`.`).pop()??``}function Ule(e){return Ble[b9(e)]??null}function Wle(e){return Vle[b9(e)]??null}function Gle(e){let t=b9(e);return t===`pdf`||t===`docx`?t:null}function Kle(e){return Ule(e)!==null}function qle(e){return Wle(e)!==null}function Jle(e){return Gle(e)!==null}function x9(e,t,n,r={}){let i=dS(e),a=new URLSearchParams({type:t});n&&a.set(`sessionId`,n);for(let[e,t]of Object.entries(r))t!==void 0&&a.set(e,String(t));return`/api/files/${i}?${a.toString()}`}function S9(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var Yle={source:`Source`,preview:`Preview`,diff:`Diff`},C9={fontFamily:`var(--font-mono)`,fontSize:`var(--text-lg)`,lineHeight:1.6},w9={width:48,minWidth:48,padding:`0 10px`,textAlign:`right`,color:`var(--text-dim)`,background:`var(--bg-panel)`,borderRight:`1px solid var(--border)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontStyle:`normal`,fontVariantNumeric:`tabular-nums`,lineHeight:`20.8px`,userSelect:`none`,flexShrink:0,verticalAlign:`top`};function T9({filePath:e,sourceSessionId:t}){let{t:n}=I();return(0,F.jsx)(L,{label:n(`i18n.downloadFile`),children:(0,F.jsx)(`a`,{href:x9(e,`download`,t),download:fS(e),"aria-label":n(`i18n.downloadFile`),className:`file-viewer-icon-button`,children:(0,F.jsxs)(`svg`,{width:R.xl,height:R.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,F.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,F.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})})})}function E9(e,t,n){let[r,i]=(0,d.useState)(!1),a=(0,d.useRef)(n);(0,d.useEffect)(()=>{a.current=n});let o=(0,d.useRef)(null);return(0,d.useEffect)(()=>(i(!1),o.current?.(),o.current=ge({ch:`watch`,filePath:e},e=>{e.event===`connected`?i(!0):e.event===`error`?i(!1):a.current(e)}),()=>{o.current?.(),o.current=null}),[e]),{watching:r,closeWatch:(0,d.useCallback)(()=>{o.current?.(),o.current=null,i(!1)},[])}}function D9({filePath:e,cwd:t,extLabel:n,watching:r,sourceSessionId:i,ellipsis:a,children:o}){let{t:s}=I();return(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`4px 16px`,borderBottom:`1px solid var(--border)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,background:`var(--bg)`,flexShrink:0},children:[(0,F.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,...a?{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}:{}},title:e,children:mS(e,t)}),(0,F.jsx)(`span`,{style:{marginLeft:`auto`},children:n}),o,(0,F.jsxs)(`span`,{title:s(r?`i18n.liveSync`:`i18n.notWatching`),style:{display:`flex`,alignItems:`center`,gap:4,color:r?`var(--status-success)`:`var(--text-dim)`},children:[(0,F.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:r?`var(--status-success)`:`var(--border)`,display:`inline-block`,boxShadow:r?`0 0 4px var(--status-success)`:`none`}}),r?`live`:`static`]}),(0,F.jsx)(T9,{filePath:e,sourceSessionId:i})]})}function O9({filePath:e,sourceSessionId:t,cwd:n}){let{t:r}=I(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(null),c=typeof n==`string`&&/^[a-zA-Z]:[\\/]/.test(n)||typeof n==`string`&&n.startsWith(`\\\\`),l=(0,d.useCallback)(async n=>{a(!0),s(null);try{let i=await fetch(x9(e,`open`,t,n?{chooseApp:1}:void 0),{method:`POST`}),a=await i.json().catch(()=>null);i.ok?s({ok:!0,text:r(`files.openLaunched`)}):s({ok:!1,text:a?.error??`HTTP ${i.status}`})}catch(e){s({ok:!1,text:String(e)})}finally{a(!1)}},[e,t,r]);return(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:10,marginTop:16},children:[o&&(0,F.jsx)(`div`,{style:{color:o.ok?`var(--text-muted)`:`var(--status-error)`,fontSize:`var(--text-sm)`,maxWidth:460,textAlign:`center`,lineHeight:1.5},children:o.text}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,F.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>l(!1),className:`file-viewer-mode-button file-open-action-button`,children:r(`files.openInSystemApp`)}),c&&(0,F.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>l(!0),className:`file-viewer-mode-button file-open-action-button`,children:r(`files.chooseOtherApp`)})]})]})}function Xle({filePath:e,cwd:t,sourceSessionId:n}){let[r,i]=(0,d.useState)(0),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=fS(e).toLowerCase().split(`.`).pop()??``;Jr(()=>{i(0),o(null),c(null),u(null)},[e,n]);let{watching:p}=E9(e,n,e=>{typeof e.size==`number`&&o(e.size),i(e=>e+1)}),m=x9(e,`read`,n,r?{v:r}:void 0),h=a==null?null:S9(a);return(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,F.jsxs)(D9,{filePath:e,cwd:t,extLabel:f||`image`,watching:p,sourceSessionId:n,children:[s&&(0,F.jsxs)(`span`,{children:[s.w,` × `,s.h]}),h&&(0,F.jsx)(`span`,{children:h})]}),(0,F.jsx)(`div`,{style:{flex:1,overflow:`auto`,backgroundColor:`var(--bg-panel)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16,backgroundImage:`linear-gradient(45deg, var(--bg) 25%, transparent 25%), linear-gradient(-45deg, var(--bg) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--bg) 75%), linear-gradient(-45deg, transparent 75%, var(--bg) 75%)`,backgroundSize:`16px 16px`,backgroundPosition:`0 0, 0 8px, 8px -8px, -8px 0px`},children:l?(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:4},children:[(0,F.jsx)(`div`,{style:{color:`var(--status-error)`,fontSize:`var(--text-lg)`},children:l}),(0,F.jsx)(O9,{filePath:e,sourceSessionId:n,cwd:t})]}):(0,F.jsx)(`img`,{src:m,alt:e,onLoad:e=>{let t=e.currentTarget;c({w:t.naturalWidth,h:t.naturalHeight})},onError:()=>u(`Failed to load image`),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,boxShadow:`0 2px 8px var(--shadow-color)`}})})]})}function Zle({filePath:e,cwd:t,sourceSessionId:n}){let[r,i]=(0,d.useState)(0),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=fS(e).toLowerCase().split(`.`).pop()??``;Jr(()=>{i(0),o(null),c(null),u(null)},[e,n]);let{watching:p}=E9(e,n,e=>{typeof e.size==`number`&&o(e.size),c(null),u(null),i(e=>e+1)}),m=x9(e,`read`,n,r?{v:r}:void 0);return(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,F.jsxs)(D9,{filePath:e,cwd:t,extLabel:f||`audio`,watching:p,sourceSessionId:n,children:[s!=null&&(0,F.jsx)(`span`,{children:sZ(s)}),a!=null&&(0,F.jsx)(`span`,{children:S9(a)})]}),(0,F.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,background:`var(--bg-panel)`},children:(0,F.jsxs)(`div`,{style:{width:`min(680px, 100%)`},children:[l&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{style:{color:`var(--status-error)`,fontSize:`var(--text-lg)`,marginBottom:12,textAlign:`center`},children:l}),(0,F.jsx)(O9,{filePath:e,sourceSessionId:n,cwd:t})]}),(0,F.jsx)(`audio`,{controls:!0,preload:`metadata`,src:m,onLoadedMetadata:e=>c(e.currentTarget.duration),onError:()=>u(`Failed to load audio`),style:{width:`100%`}},m)]})})]})}function Qle({filePath:e,cwd:t,sourceSessionId:n}){let{t:r}=I(),[i,a]=(0,d.useState)(0),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),u=b9(e),f=u===`pdf`,p=f?x9(e,`read`,n,i?{v:i}:void 0):x9(e,`preview`,n,i?{v:i}:void 0);(0,d.useEffect)(()=>{a(0),s(null),l(null),fetch(x9(e,`meta`,n)).then(e=>e.json()).then(e=>{e.error&&l(e.error),typeof e.size==`number`&&(s(e.size),!f&&e.size>10485760&&l(r(`files.docTooLargeForPreview`,{limit:S9(y9)})))}).catch(e=>l(String(e)))},[e,f,n,r]);let{watching:m}=E9(e,n,e=>{if(typeof e.size==`number`&&(s(e.size),!f&&e.size>10485760)){l(r(`files.docTooLargeForPreview`,{limit:S9(y9)}));return}l(null),a(e=>e+1)});return(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,F.jsx)(D9,{filePath:e,cwd:t,extLabel:u===`docx`?`docx preview`:`pdf`,watching:m,sourceSessionId:n,ellipsis:!0,children:o!=null&&(0,F.jsx)(`span`,{children:S9(o)})}),(0,F.jsx)(`div`,{style:{flex:1,minHeight:0,background:`var(--bg-panel)`},children:c?(0,F.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24,color:`var(--status-error)`,fontSize:`var(--text-lg)`,textAlign:`center`},children:[(0,F.jsx)(`div`,{children:c}),(0,F.jsx)(O9,{filePath:e,sourceSessionId:n,cwd:t})]}):(0,F.jsx)(`iframe`,{src:p,sandbox:f?void 0:`allow-same-origin`,title:r(`i18n.previewFile`,{file:fS(e)}),style:{width:`100%`,height:`100%`,border:`none`,background:f?`var(--bg)`:`#eef1f5`}},p)})]})}function $le(){return(0,F.jsxs)(`svg`,{width:R.xl,height:R.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,F.jsx)(`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`})]})}function eue({displayModes:e,effectiveDisplayMode:t,setDisplayMode:n,t:r}){return e.length<=1?null:(0,F.jsx)(`div`,{className:`file-viewer-mode-switch`,"aria-label":r(`i18n.fileViewMode`),children:e.map(e=>{let i=t===e;return(0,F.jsx)(L,{label:e===`diff`?r(`i18n.compareHead`):void 0,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(e),"aria-pressed":i,className:`file-viewer-mode-button`,style:{background:i?`var(--bg-selected)`:`transparent`,color:i?`var(--text)`:`var(--text-muted)`},children:Yle[e]})},e)})})}function tue({wrapLines:e,setWrapLines:t,selectedLineRange:n,handleMentionSelectedLines:r,filePath:i,sourceSessionId:a,t:o,highlightReady:s,editMode:c}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(L,{label:o(`i18n.mentionSelectedLines`),children:(0,F.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:r,"aria-label":o(`i18n.mentionSelectedLines`),disabled:!n,className:`file-viewer-icon-button`,children:(0,F.jsx)($le,{})})}),(0,F.jsx)(L,{label:o(e?`i18n.disableWrap`:`i18n.enableWrap`),children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>t(e=>!e),"aria-label":o(e?`i18n.disableWrap`:`i18n.enableWrap`),"aria-pressed":e,className:`file-viewer-icon-button`,style:{background:e?`var(--bg-selected)`:`transparent`,color:e?`var(--text)`:`var(--text-muted)`},children:(0,F.jsxs)(`svg`,{width:R.xl,height:R.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`path`,{d:`M4 7V4h16v3`}),(0,F.jsx)(`path`,{d:`M9 20h6`}),(0,F.jsx)(`path`,{d:`M12 4v16`})]})})}),s&&!c&&(0,F.jsx)(`a`,{href:x9(i,`download`,a),download:fS(i),"aria-label":o(`i18n.downloadFile`),className:`file-viewer-icon-button`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,textDecoration:`none`},children:(0,F.jsxs)(`svg`,{width:R.xl,height:R.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,F.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,F.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})})]})}function nue({editMode:e,dirty:t,handleSave:n,saveState:r,saveError:i,enterEdit:a,cancelEdit:o,t:s}){return e?(0,F.jsxs)(F.Fragment,{children:[t&&(0,F.jsx)(L,{label:s(`i18n.unsavedChanges`),children:(0,F.jsx)(`span`,{"aria-label":s(`i18n.unsavedChanges`),style:{color:`var(--status-warning)`,fontWeight:700},children:`●`})}),(0,F.jsx)(L,{label:s(`i18n.saveFileShortcut`),children:(0,F.jsx)(`button`,{type:`button`,onClick:n,disabled:!t||r===`saving`,"aria-label":s(`i18n.saveFile`),className:`file-viewer-icon-button`,style:{background:t?`var(--accent)`:`transparent`,color:t?`var(--bg)`:`var(--text-muted)`},children:r===`saving`?(0,F.jsx)(ur,{size:R.lg,className:`animate-spin`}):(0,F.jsx)(xr,{size:R.lg})})}),(0,F.jsx)(L,{label:s(`i18n.cancelEdit`),children:(0,F.jsx)(`button`,{type:`button`,onClick:o,"aria-label":s(`i18n.cancelEdit`),className:`file-viewer-icon-button`,children:(0,F.jsx)(Lr,{size:R.lg})})}),r===`error`&&i&&(0,F.jsx)(`span`,{style:{color:`var(--status-error)`,fontSize:`var(--text-sm)`},children:s(`i18n.saveFailed`,{error:i})}),r===`saved`&&!t&&(0,F.jsx)(`span`,{style:{color:`var(--status-success)`,fontSize:`var(--text-sm)`},children:s(`i18n.saved`)})]}):(0,F.jsx)(L,{label:s(`i18n.editFile`),children:(0,F.jsx)(`button`,{type:`button`,onClick:a,"aria-label":s(`i18n.editFile`),className:`file-viewer-icon-button`,children:(0,F.jsx)(mr,{size:R.lg})})})}function rue({filePath:e,cwd:t,metadata:n,watching:r,isDeletedDiff:i,displayModes:a,effectiveDisplayMode:o,setDisplayMode:s,wrapLines:c,setWrapLines:l,editMode:u,dirty:d,handleSave:f,saveState:p,highlightReady:m,selectedLineRange:h,handleMentionSelectedLines:g,fileContent:_,sourceSessionId:v,t:y,saveError:b,enterEdit:x,cancelEdit:S}){return(0,F.jsxs)(`div`,{className:`file-viewer-toolbar`,style:{display:`flex`,alignItems:`center`,gap:8,padding:`5px 12px`,borderBottom:`1px solid var(--border)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,background:`var(--bg)`,flexShrink:0},children:[(0,F.jsx)(L,{label:e,children:(0,F.jsx)(`span`,{className:`file-viewer-path`,style:{fontFamily:`var(--font-mono)`},children:mS(e,t)})}),(0,F.jsx)(L,{label:n,children:(0,F.jsx)(`span`,{className:`file-viewer-meta`,children:n})}),!i&&(0,F.jsx)(L,{label:y(r?`i18n.liveSync`:`i18n.notWatching`),children:(0,F.jsx)(`span`,{"aria-label":y(r?`i18n.liveSync`:`i18n.notWatching`),className:`file-viewer-live-indicator`,style:{background:r?`var(--status-success)`:`var(--border)`,boxShadow:r?`0 0 4px var(--status-success)`:`none`}})}),(0,F.jsxs)(`div`,{className:`file-viewer-controls`,children:[(0,F.jsx)(eue,{displayModes:a,effectiveDisplayMode:o,setDisplayMode:s,t:y}),(0,F.jsxs)(`div`,{className:`file-viewer-actions`,children:[o===`source`&&(0,F.jsx)(tue,{wrapLines:c,setWrapLines:l,selectedLineRange:h,handleMentionSelectedLines:g,filePath:e,sourceSessionId:v,t:y,highlightReady:m,editMode:u}),!i&&o===`source`&&(0,F.jsx)(`div`,{className:`file-viewer-edit-controls`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:8},children:(0,F.jsx)(nue,{editMode:u,dirty:d,handleSave:f,saveState:p,saveError:b,enterEdit:x,cancelEdit:S,t:y})}),!i&&(0,F.jsx)(T9,{filePath:e,sourceSessionId:v})]})]})]})}function iue({filePath:e,sourceSessionId:t,onFileChange:n}){let[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!0),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=(0,d.useCallback)(e=>fetch(x9(e,`read`,t)).then(async e=>{let t=await e.json();return t.error?(c(t.error),u(e.status),null):(c(null),u(null),i(t),t)}).catch(e=>(c(String(e)),null)),[t]);return(0,d.useEffect)(()=>{o(!0),c(null),u(null),i(null),n?.(),f(e).finally(()=>o(!1))},[e,f]),{data:r,setData:i,loading:a,error:s,loadStatus:l,fetchContent:f}}function aue({cwd:e,filePath:t,gitRefreshKey:n}){let[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(0),c=(0,d.useCallback)(async t=>{let n=++s.current;if(o(!0),!e){i(null),o(!1);return}try{let r=new URLSearchParams({cwd:e,path:t}),a=await fetch(`/api/git/diff?${r.toString()}`),o=await a.json();if(n!==s.current)return;i(a.ok&&o.supported&&typeof o.patch==`string`?o:null)}catch{n===s.current&&i(null)}finally{n===s.current&&o(!1)}},[e]);return(0,d.useEffect)(()=>{c(t)},[c,t,n]),{gitDiff:r,gitDiffLoading:a,fetchGitDiff:c,resetGitDiff:(0,d.useCallback)(()=>i(null),[])}}function oue(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(`.file-source-line[data-line-number]`)??null}function sue(e,t){if(!t||t.isCollapsed||t.rangeCount===0)return null;let n=t.getRangeAt(0);return!e.contains(n.startContainer)||!e.contains(n.endContainer)?null:n}function k9(e,t){let n=oue(t);if(!n||!e.contains(n))return null;let r=Number(n.dataset.lineNumber);return Number.isInteger(r)?{element:n,line:r}:null}function cue(e,t,n){let r=e.querySelector(`.file-source-line-content`),i=n===`start`?t.startContainer:t.endContainer,a=n===`start`?t.startOffset:t.endOffset;if(!r?.contains(i))return!1;let o=document.createRange();return o.selectNodeContents(r),n===`start`?o.setStart(i,a):o.setEnd(i,a),o.toString().length===0}function A9(e,t,n){if(!cue(e,t,n))return null;let r=n===`start`?e.nextElementSibling:e.previousElementSibling;return!(r instanceof HTMLElement)||!r.matches(`.file-source-line[data-line-number]`)?null:{element:r,line:Number(r.dataset.lineNumber)}}function j9(e,t){let n=sue(e,t);if(!n)return null;let r=k9(e,n.startContainer),i=k9(e,n.endContainer);if(!r||!i)return null;let a=r.element,o=i.element,s=r.line,c=i.line;if(s<c){let e=A9(a,n,`start`);e&&(a=e.element,s=e.line);let t=A9(o,n,`end`);t&&(o=t.element,c=t.line)}return s>c?null:{startLine:s,endLine:c}}function lue({rows:e,stylesheet:t,useInlineStyles:n,wrapLines:r}){return e.map((e,i)=>{let a=e.children??[],o=a[0]?.properties?.className,s=Array.isArray(o)&&o.includes(`react-syntax-highlighter-line-number`),c=s?a[0]:null,l=s?a.slice(1):a;return(0,F.jsxs)(`span`,{className:`file-source-line`,"data-line-number":i+1,style:{display:`flex`,minWidth:`100%`},children:[c&&M8({node:c,stylesheet:t,useInlineStyles:n,key:`source-line-number-${i}`}),(0,F.jsx)(`span`,{className:`file-source-line-content`,style:{flex:`1 1 auto`,minWidth:0,overflowWrap:r?`anywhere`:`normal`,whiteSpace:r?`pre-wrap`:`pre`},children:l.map((e,r)=>M8({node:e,stylesheet:t,useInlineStyles:n,key:`source-token-${i}-${r}`}))})]},`source-line-${i}`)})}function uue({filePath:e,cwd:t,content:n,displayMode:r,onMentionLines:i}){let a=(0,d.useRef)(null),[o,s]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=()=>{let e=a.current;s(i&&r===`source`&&e?j9(e,window.getSelection()):null)};if(e(),!(!i||r!==`source`))return document.addEventListener(`selectionchange`,e),()=>document.removeEventListener(`selectionchange`,e)},[n,r,i]);let c=(0,d.useCallback)(n=>{!i||!n||i(mS(e,t),n.startLine,n.endLine)},[t,e,i]),l=(0,d.useCallback)(()=>{c(o)},[c,o]);return(0,d.useEffect)(()=>{if(!i||r!==`source`)return;let e=e=>{if(e.repeat||e.key.toLowerCase()!==`i`||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey)return;let t=e.target;if(t instanceof Element&&t.closest(`input, textarea, [contenteditable='true']`))return;let n=a.current,r=n?j9(n,window.getSelection()):null;r&&(e.preventDefault(),c(r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,c,i]),{contentRef:a,selectedLineRange:o,handleMentionSelectedLines:l}}async function due(e,t){let n=e.split(/[\\/]/).filter(Boolean),r=n.pop();if(!r)throw Error(`Invalid file path`);let i=n.join(`/`)||`/`,a=new FormData;a.append(`files`,new File([t],r,{type:`text/plain`}));let o=await fetch(`/api/files/${dS(i)}?type=upload&conflict=overwrite`,{method:`POST`,body:a});if(!o.ok){let e=`Save failed (${o.status})`;try{let t=await o.json();t?.error&&(e=t.error)}catch{}throw Error(e)}}function fue({filePath:e,onSaved:t,content:n,applySavedContent:r,reload:i}){let[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(`idle`),[m,h]=(0,d.useState)(null),g=(0,d.useRef)(!1);g.current=a;let _=(0,d.useCallback)(()=>{o(!1),c(``),u(!1),p(`idle`),h(null)},[]);return{editMode:a,draft:s,dirty:l,saveState:f,saveError:m,editModeRef:g,enterEdit:(0,d.useCallback)(()=>{c(n),u(!1),p(`idle`),h(null),o(!0)},[n]),cancelEdit:(0,d.useCallback)(()=>{o(!1),u(!1),p(`idle`),h(null),i()},[i]),handleEditorChange:(0,d.useCallback)(e=>{c(e),u(e!==n)},[n]),handleSave:(0,d.useCallback)(async()=>{if(l){p(`saving`),h(null);try{await due(e,s),r(s),u(!1),p(`saved`),t?.(e)}catch(e){p(`error`),h(e instanceof Error?e.message:String(e))}}},[l,s,e,t,r]),resetEditState:_}}function pue(e){let t=d7(e);return t?t.flatMap(e=>e.rows.flatMap(e=>{if(e.type===`hunk`)return[];if(e.left.type===`context`&&e.right.type===`context`)return[{type:`unchanged`,text:e.right.text,oldLineNo:e.left.lineNo,newLineNo:e.right.lineNo}];let t=[];return e.left.type===`removed`&&t.push({type:`removed`,text:e.left.text,oldLineNo:e.left.lineNo,newLineNo:null}),e.right.type===`added`&&t.push({type:`added`,text:e.right.text,oldLineNo:null,newLineNo:e.right.lineNo}),t})):[]}function mue({patch:e}){let{t}=I(),n=pue(e);if(!n.some(e=>e.type!==`unchanged`))return(0,F.jsx)(`div`,{style:{padding:`12px 16px`,fontSize:`var(--text-base)`,color:`var(--text-dim)`,fontFamily:`var(--font-mono)`},children:t(`i18n.noChanges`)});let r=new Set(n.flatMap((e,t)=>e.type===`unchanged`?[]:[t])),i=new Set;for(let e of r)for(let t=Math.max(0,e-3);t<=Math.min(n.length-1,e+3);t++)i.add(t);let a=[],o=0;for(;o<n.length;)if(i.has(o)){let e=[];for(;o<n.length&&i.has(o);)e.push(n[o]),o++;a.push({hidden:!1,lines:e})}else{let e=0;for(;o<n.length&&!i.has(o);)e++,o++;a.push({hidden:!0,count:e})}return(0,F.jsx)(`div`,{className:`file-diff-view`,style:{width:`max-content`,minWidth:`100%`,...C9},children:a.map((e,t)=>{if(e.hidden)return(0,F.jsxs)(`div`,{style:{padding:`2px 16px`,color:`var(--text-dim)`,background:`var(--bg-panel)`,fontSize:`var(--text-sm)`,borderTop:`1px solid var(--border)`,borderBottom:`1px solid var(--border)`},children:[`... `,e.count,` unchanged lines ...`]},t);let n=e.lines.map((e,t)=>{let n=e.type===`added`?`color-mix(in srgb, var(--status-success) 12%, transparent)`:e.type===`removed`?`color-mix(in srgb, var(--status-error) 14%, transparent)`:`transparent`,r=e.type===`added`?`+`:e.type===`removed`?`-`:` `,i=e.type===`added`?`var(--status-success)`:e.type===`removed`?`var(--status-error)`:`var(--text-dim)`;return(0,F.jsxs)(`div`,{className:`file-diff-line`,style:{display:`flex`,minWidth:`100%`,background:n,borderLeft:e.type===`added`?`3px solid var(--status-success)`:e.type===`removed`?`3px solid var(--status-error)`:`3px solid transparent`},children:[(0,F.jsx)(`span`,{style:w9,children:e.type===`removed`?e.oldLineNo:e.newLineNo}),(0,F.jsx)(`span`,{style:{minWidth:16,padding:`0 6px`,color:i,userSelect:`none`,flexShrink:0,fontWeight:600},children:r}),(0,F.jsx)(`span`,{className:`file-diff-line-content`,style:{flexShrink:0,padding:`0 8px 0 0`,whiteSpace:`pre`,color:`var(--text)`},children:e.text||`\xA0`})]},t)});return(0,F.jsx)(`div`,{children:n},t)})})}function hue({preview:e,markdownDir:t,onOpenFile:n,cwd:r,sourceSessionId:i}){return(0,F.jsx)(`div`,{className:`markdown-body markdown-file-preview`,style:{padding:`24px 32px`},children:(0,F.jsx)(ak,{remarkPlugins:GU,rehypePlugins:qU,components:{code({className:e,children:t,...n}){let r=e?.replace(`language-`,``).toLowerCase()??``,i=String(t);return e?.includes(`language-`)||i.includes(`
|
|
496
|
-
`)?r===`mermaid`?(0,F.jsx)(D5,{code:i.replace(/\n$/,``),defaultPreview:!0}):(0,F.jsx)(w5,{code:i.replace(/\n$/,``),lang:r}):(0,F.jsx)(`code`,{className:e,...n,children:t})},pre({children:e}){return(0,F.jsx)(F.Fragment,{children:e})},a({href:e,children:r,...i}){return delete i.node,(0,F.jsx)(aW,{href:e,markdownDir:t,onOpenFile:n,...i,children:r})},img({src:e,alt:n,...a}){delete a.node;let o=typeof e==`string`?rW(e,t,r??t):null,s=o?x9(o,`read`,i):e;return(0,F.jsx)(`img`,{src:s,alt:n??``,loading:`lazy`,...a})}},children:e})})}var M9=`file-find-hits`,N9=`file-find-current`,gue=1e4;function _ue(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){if(!(e.nodeValue??``).trim())return NodeFilter.FILTER_REJECT;let t=e.parentElement;return!t||t.closest(`.file-source-line, .file-diff-line`)&&!t.closest(`.file-source-line-content, .file-diff-line-content`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),r=n.nextNode();for(;r;)t.push(r),r=n.nextNode();return t}function vue(e){let t=_ue(e),n=[],r=[],i=0;for(let e of t)r.push(i),n.push(e.nodeValue??``),i+=e.nodeValue?.length??0;return{text:n.join(``),nodes:t,starts:r}}function P9(e,t){let n=0,r=e.starts.length-1;for(;n<r;){let i=n+r+1>>1;e.starts[i]<=t?n=i:r=i-1}return{node:e.nodes[n],offset:t-e.starts[n]}}function yue(e,t){let n=vue(e),r=n.text.toLowerCase(),i=t.toLowerCase(),a=[],o=r.indexOf(i);for(;o!==-1&&a.length<gue;){let e=document.createRange(),t=P9(n,o),s=P9(n,o+i.length);e.setStart(t.node,t.offset),e.setEnd(s.node,s.offset),a.push(e),o=r.indexOf(i,o+i.length)}return a}function bue({open:e,onClose:t,reindexKey:n,containerRef:r}){let{t:i}=I(),a=(0,d.useRef)(null),[o,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(0),[u,f]=(0,d.useState)(0),p=(0,d.useRef)([]);(0,d.useEffect)(()=>{e&&a.current?.focus()},[e]),(0,d.useEffect)(()=>{let t=r.current,n=o.trim();if(!e||!t||!n){CSS.highlights.delete(M9),CSS.highlights.delete(N9),p.current=[],l(0),f(0);return}let i=yue(t,n);return p.current=i,CSS.highlights.set(M9,new Highlight(...i)),l(i.length),f(e=>i.length?Math.min(e,i.length-1):0),()=>{CSS.highlights.delete(M9),CSS.highlights.delete(N9)}},[e,o,n,r]),(0,d.useEffect)(()=>{let e=p.current[u];if(!e){CSS.highlights.delete(N9);return}CSS.highlights.set(N9,new Highlight(e)),e.startContainer.parentElement?.scrollIntoView({block:`center`})},[u,c,n]);let m=e=>{c&&f(t=>(t+e+c)%c)};return e?(0,F.jsxs)(`div`,{className:`file-find-bar`,role:`search`,children:[(0,F.jsx)(`input`,{ref:a,className:`file-find-input`,type:`text`,value:o,placeholder:i(`files.find`),"aria-label":i(`files.find`),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),m(e.shiftKey?-1:1)):e.key===`Escape`&&(e.preventDefault(),t())}}),(0,F.jsx)(`span`,{className:`file-find-count`,children:o.trim()?c>0?`${u+1}/${c}`:i(`files.findNoResults`):``}),(0,F.jsx)(`button`,{type:`button`,className:`file-find-btn`,"aria-label":i(`files.findPrev`),disabled:!c,onClick:()=>m(-1),children:(0,F.jsx)(Vn,{size:R.base})}),(0,F.jsx)(`button`,{type:`button`,className:`file-find-btn`,"aria-label":i(`files.findNext`),disabled:!c,onClick:()=>m(1),children:(0,F.jsx)(Bn,{size:R.base})}),(0,F.jsx)(`button`,{type:`button`,className:`file-find-btn`,"aria-label":i(`files.findClose`),onClick:t,children:(0,F.jsx)(Lr,{size:R.base})})]}):null}var xue=(0,d.lazy)(()=>p4(()=>import(`./CodeMirrorEditor-
|
|
497
|
-
`);return{language:o,isHtml:s,isMarkdown:c,hasPreview:l,markdownDirectory:u,lines:d,effectiveDisplayMode:t?`diff`:n,displayModes:t?[`diff`]:[`source`,...l?[`preview`]:[],`diff`],metadata:t?a(`files.deleted`):`${o} · ${d.length} lines · ${S9(e?.size??0)}`}}function Oue({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){let{isDark:c}=WK(),{t:l}=I(),[u,f]=(0,d.useState)(`source`),[p,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(!1),{data:_,setData:v,loading:y,error:b,loadStatus:x,fetchContent:S}=iue({filePath:e,sourceSessionId:n,onFileChange:()=>{f(s===`diff`?`diff`:`source`),g(!1),ee(),re()}}),C=_?.content??``,{editMode:w,draft:T,dirty:E,saveState:D,saveError:O,editModeRef:k,enterEdit:A,cancelEdit:j,handleEditorChange:M,handleSave:N,resetEditState:ee}=fue({filePath:e,onSaved:a,content:C,applySavedContent:e=>v(t=>t&&{...t,content:e}),reload:()=>{S(e)}}),{gitDiff:te,gitDiffLoading:P,fetchGitDiff:ne,resetGitDiff:re}=aue({cwd:t,filePath:e,gitRefreshKey:o}),{watching:ie,closeWatch:ae}=E9(e,n,()=>{k.current||(S(e),ne(e))});(0,d.useEffect)(()=>{_?.language===`markdown`&&s!==`diff`&&f(`preview`)},[_?.language,s]);let oe=te?.supported===!0&&typeof te.patch==`string`,se=oe&&te.status===`deleted`;(0,d.useEffect)(()=>{se&&ae()},[se,ae]);let ce=(0,d.useMemo)(()=>Eue(_),[_]),{contentRef:le,selectedLineRange:ue,handleMentionSelectedLines:de}=uue({filePath:e,cwd:t,content:C,displayMode:u,onMentionLines:i});return(0,d.useEffect)(()=>{m(!1)},[C]),(0,d.useEffect)(()=>{if((se?`diff`:u)!==`source`||p)return;let e=setTimeout(()=>m(!0),0);return()=>clearTimeout(e)},[se,u,p]),(0,F.jsx)(kue,{filePath:e,cwd:t??void 0,sourceSessionId:n??void 0,onOpenFile:r,isDark:c,t:l,loading:y,error:b,loadStatus:x,displayMode:u,setDisplayMode:f,gitDiffLoading:P,data:_,watching:ie,isDeletedDiff:se,hasGitDiff:oe,wrapLines:h,setWrapLines:g,content:C,editMode:w,dirty:E,handleSave:N,saveState:D,saveError:O,enterEdit:A,cancelEdit:j,highlightReady:p,selectedLineRange:ue,handleMentionSelectedLines:de,draft:T,handleEditorChange:M,markdownPreview:ce,gitDiffPatch:oe?te.patch:null,contentRef:le})}function kue({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,isDark:i,t:a,loading:o,error:s,loadStatus:c,displayMode:l,setDisplayMode:u,gitDiffLoading:d,data:f,watching:p,isDeletedDiff:m,hasGitDiff:h,wrapLines:g,setWrapLines:_,content:v,editMode:y,dirty:b,handleSave:x,saveState:S,saveError:C,enterEdit:w,cancelEdit:T,highlightReady:E,selectedLineRange:D,handleMentionSelectedLines:O,draft:k,handleEditorChange:A,markdownPreview:j,gitDiffPatch:M,contentRef:N}){if(o||l===`diff`&&d)return(0,F.jsx)(Aue,{t:a});if(s&&!m)return(0,F.jsx)(jue,{loadStatus:c,error:s,filePath:e,sourceSessionId:n,cwd:t,t:a});if(!f&&!m)return null;let{language:ee,isHtml:te,isMarkdown:P,markdownDirectory:ne,effectiveDisplayMode:re,displayModes:ie,metadata:ae}=Due({data:f,isDeletedDiff:m,displayMode:l,content:v,filePath:e,t:a});return(0,F.jsxs)(`div`,{className:`file-viewer-shell`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,F.jsx)(rue,{filePath:e,cwd:t,metadata:ae,watching:p,isDeletedDiff:m,displayModes:ie,effectiveDisplayMode:re,setDisplayMode:u,wrapLines:g,setWrapLines:_,editMode:y,dirty:b,handleSave:x,saveState:S,saveError:C,enterEdit:w,cancelEdit:T,highlightReady:E,selectedLineRange:D,handleMentionSelectedLines:O,fileContent:v,sourceSessionId:n,t:a}),(0,F.jsx)(Tue,{contentRef:N,filePath:e,effectiveDisplayMode:re,editMode:y,draft:k,language:ee,isDark:i,handleEditorChange:A,handleSave:x,highlightReady:E,wrapLines:g,content:v,hasGitDiff:h,gitDiffPatch:M,t:a,isHtml:te,isMarkdown:P,markdownPreview:j,markdownDirectory:ne,onOpenFile:r,cwd:t??void 0,sourceSessionId:n})]})}function Aue({t:e}){return(0,F.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,color:`var(--text-muted)`,fontSize:`var(--text-lg)`},children:[(0,F.jsx)(ur,{size:R.lg,className:`animate-spin`,"aria-hidden":`true`}),e(`i18n.loading`)]})}function jue({loadStatus:e,error:t,filePath:n,sourceSessionId:r,cwd:i,t:a}){return(0,F.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24,color:`var(--status-error)`,fontSize:`var(--text-lg)`,textAlign:`center`},children:[(0,F.jsx)(`div`,{children:e===413?a(`files.fileTooLargeForPreview`,{limit:S9(zle)}):t}),e===413&&(0,F.jsx)(O9,{filePath:n,sourceSessionId:r,cwd:i})]})}function Mue({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){return Kle(e)?(0,F.jsx)(Xle,{filePath:e,cwd:t,sourceSessionId:n}):qle(e)?(0,F.jsx)(Zle,{filePath:e,cwd:t,sourceSessionId:n}):Jle(e)?(0,F.jsx)(Qle,{filePath:e,cwd:t,sourceSessionId:n}):(0,F.jsx)(Oue,{filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s})}function Nue({activeFileTab:e,activeCwd:t,explorerRefreshKey:n,setExplorerRefreshKey:r,handleFileLineMention:i,handleOpenFile:a}){return(0,F.jsx)(F.Fragment,{children:e&&(0,F.jsx)(Mue,{filePath:e.filePath,cwd:t??void 0,sourceSessionId:e.sourceSessionId,gitRefreshKey:n,initialDisplayMode:e.initialDisplayMode,onMentionLines:i,onSaved:()=>r(e=>e+1),onOpenFile:t=>a(t,fS(t),{sourceSessionId:e.sourceSessionId})})})}function Pue({geometries:e,messages:t,onAddMessage:n,onRemoveMessage:r,onUpdateMessage:i,widgets:a,closedKeys:o,onReopen:s}){let{t:c}=I(),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),m=(0,d.useRef)(null);(0,d.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]);let h=e=>a.find(t=>t.key===e)?.lines[0],g=(e,t,n)=>{s(e),p({key:e,x:t,y:n}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>p(null),2500)},_=[...new Set([...Object.keys(e),...o.keys()])].map(t=>[t,e[t]]);return(0,F.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,background:`var(--bg)`},children:[_.length===0?(0,F.jsx)(`div`,{style:{padding:`32px 16px`,textAlign:`center`,color:`var(--text-dim)`,fontSize:`var(--text-lg)`,lineHeight:1.6},children:c(`config.widgets.empty`)}):(0,F.jsx)(`div`,{style:{flex:1,minHeight:0,overflowY:`auto`,padding:10,display:`flex`,flexDirection:`row`,flexWrap:`wrap`,alignContent:`flex-start`,gap:6},children:_.map(([e,a])=>{let s=t[e]??[],d=o.has(e),f=h(e);return(0,F.jsxs)(`div`,{"data-testid":`widget-config-item-${e}`,style:{flex:`1 1 200px`,boxSizing:`border-box`,padding:`8px 10px`,borderRadius:5,background:`var(--bg-panel)`,border:`1px solid var(--border)`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:7,flexWrap:`wrap`},children:[(0,F.jsxs)(`div`,{style:{minWidth:0,flex:`1 1 120px`},children:[(0,F.jsx)(`div`,{style:{fontSize:`var(--text-base)`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),a&&(0,F.jsxs)(`div`,{style:{marginTop:2,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,color:`var(--text-dim)`},children:[c(`config.widgets.x`),`: `,a.x,` `,c(`config.widgets.y`),`: `,a.y,` ·`,` `,c(`config.widgets.width`),`: `,a.width,` `,c(`config.widgets.height`),`:`,` `,a.height]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[d&&(0,F.jsxs)(`button`,{type:`button`,"data-testid":`widget-expand-${e}`,"aria-label":c(`widgets.reopen`),title:c(`widgets.reopen`),onClick:t=>g(e,t.clientX,t.clientY),style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 8px`,borderRadius:5,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},className:`hover-shift`,children:[(0,F.jsx)(Zn,{size:13,"aria-hidden":!0}),c(`widgets.reopen`)]}),(0,F.jsxs)(`button`,{type:`button`,"data-testid":`widget-bind-${e}`,onClick:()=>u(e),style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 8px`,borderRadius:5,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:[(0,F.jsx)(cr,{size:13,"aria-hidden":!0}),c(`config.widgets.bind`)]})]})]}),f&&(0,F.jsx)(`div`,{style:{marginTop:4,fontSize:`var(--text-sm)`,color:`var(--text-muted)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:f}),(0,F.jsx)(CG,{messages:s,onAdd:t=>n(e,t),onRemove:t=>r(e,t),onUpdate:(t,n)=>i(e,t,n),bindOpen:l===e,onBindOpenChange:e=>{e||u(null)},ns:`widgets`,bindTestIdPrefix:`widget-bind`,editTestIdPrefix:`widget-edit`,chipTestIdPrefix:`widget-bound-${e}`,bindHintArgs:{key:e}})]},e)})}),f&&(0,F.jsx)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":`widget-expanded-toast`,style:{position:`fixed`,left:Math.min(f.x,window.innerWidth-180),top:f.y+12,transform:`translateX(-50%)`,zIndex:2e3,padding:`8px 12px`,borderRadius:7,border:`1px solid var(--status-success)`,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-base)`,boxShadow:`0 4px 16px var(--shadow-strong)`,whiteSpace:`nowrap`},children:c(`widgets.expandedToChat`,{key:f.key})})]})}function Fue({widgetGeometries:e,widgetMessages:t,addWidgetMessage:n,removeWidgetMessage:r,updateWidgetMessage:i,extensionWidgets:a,closedWidgets:o,handleReopenWidget:s}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(Pue,{geometries:e,messages:t,onAddMessage:n,onRemoveMessage:r,onUpdateMessage:i,widgets:a,closedKeys:o,onReopen:s})})}function Iue({items:e,openConfigTab:t,setConfigSection:n,onDismiss:r}){let{t:i}=I();return(0,F.jsxs)(`div`,{role:`status`,"data-testid":`update-banner`,style:{display:`flex`,alignItems:`center`,gap:8,padding:`6px 12px`,borderBottom:`1px solid var(--border)`,background:`color-mix(in srgb, var(--status-warning) 10%, var(--bg-panel))`,fontSize:`var(--text-sm)`,color:`var(--text)`,flexShrink:0},children:[(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:i(`updates.banner`,{items:e.join(`, `)})}),(0,F.jsx)(`button`,{type:`button`,"data-testid":`update-banner-view`,onClick:()=>{t(),n(`updates`)},style:{padding:`3px 10px`,border:`1px solid var(--border)`,borderRadius:6,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0},children:i(`updates.view`)}),(0,F.jsx)(`button`,{type:`button`,"aria-label":i(`i18n.close`),onClick:r,style:{padding:`2px 6px`,border:`none`,background:`none`,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0},children:`✕`})]})}function Lue(){let e=(0,d.useRef)(null);return{chatInputRef:e,handleAtMention:(0,d.useCallback)((t,n)=>{e.current?.insertText(IQ(t,n))},[]),handleAtMentions:(0,d.useCallback)(t=>{let n=RQ(t);n&&e.current?.insertText(n)},[]),handleFileLineMention:(0,d.useCallback)((t,n,r)=>{e.current?.insertText(LQ(t,n,r))},[])}}function Rue(e){try{let t=window.localStorage.getItem(e);if(t===null)return null;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:null}catch{return null}}function I9(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function L9(e){let{ariaLabel:t,cssVariable:n,defaultWidth:r,getDefaultWidth:i,getMaxWidth:a,growthDirection:o,maxWidth:s,minWidth:c,storageKey:l,widthRef:u}=e,f=(0,d.useRef)(null),p=(0,d.useRef)(null),m=(0,d.useRef)(!1),[h,g]=(0,d.useState)(r),[_,v]=(0,d.useState)(!1),y=(0,d.useCallback)(()=>Math.min(s,Math.max(c,a())),[a,s,c]),b=(0,d.useCallback)(e=>ci(e,c,y()),[y,c]),x=(0,d.useCallback)(e=>{u.current=e,f.current?.style.setProperty(n,`${e}px`)},[n,u]),S=(0,d.useCallback)((e,t={})=>{let{forcePersist:n=!1,persist:r=!0}=t,i=b(e),a=i!==u.current;return x(i),g(i),r&&(a||n)&&I9(l,i),i},[x,b,l,u]),C=(0,d.useCallback)(e=>{document.body.style.cursor=e.previousCursor,document.body.style.userSelect=e.previousUserSelect},[]),w=(0,d.useCallback)(e=>{let t=p.current;if(!(!t||t.pointerId!==e)){p.current=null,C(t),v(!1),S(u.current,{forcePersist:!0});try{t.target.hasPointerCapture(e)&&t.target.releasePointerCapture(e)}catch{}}},[S,C,u]),T=(0,d.useCallback)(e=>{if(e.pointerType===`mouse`&&e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=p.current;t&&w(t.pointerId);let n=e.currentTarget;n.focus({preventScroll:!0}),n.setPointerCapture(e.pointerId),p.current={pointerId:e.pointerId,startX:e.clientX,startWidth:u.current,target:n,previousCursor:document.body.style.cursor,previousUserSelect:document.body.style.userSelect},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,v(!0)},[w,u]),E=(0,d.useCallback)(e=>{let t=p.current;if(!t||t.pointerId!==e.pointerId)return;if(e.pointerType===`mouse`&&e.buttons===0){w(e.pointerId);return}e.preventDefault();let n=o===`right`?1:-1,r=b(t.startWidth+(e.clientX-t.startX)*n);x(r),e.currentTarget.setAttribute(`aria-valuenow`,String(r)),e.currentTarget.setAttribute(`aria-valuetext`,`${r} px`)},[x,b,w,o]),D=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),O=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),k=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),A=(0,d.useCallback)(()=>{let e=i?.()??r;S(e,{forcePersist:!0})},[S,r,i]),j=(0,d.useCallback)(()=>{S(u.current)},[S,u]),M=(0,d.useCallback)(e=>{let t=e.shiftKey?32:12,n=o===`right`?`ArrowRight`:`ArrowLeft`,r=o===`right`?`ArrowLeft`:`ArrowRight`;e.key===n?(e.preventDefault(),S(u.current+t,{forcePersist:!0})):e.key===r?(e.preventDefault(),S(u.current-t,{forcePersist:!0})):e.key===`Home`?(e.preventDefault(),S(c,{forcePersist:!0})):e.key===`End`?(e.preventDefault(),S(y(),{forcePersist:!0})):e.key===`Enter`&&(e.preventDefault(),A())},[S,y,o,c,A,u]);return(0,d.useEffect)(()=>{if(m.current)return;m.current=!0;let e=Rue(l),t=e??i?.()??r,n=S(t,{persist:!1});e!==null&&e!==n&&I9(l,n)},[S,r,i,l]),(0,d.useEffect)(()=>{if(!m.current)return;S(u.current);let e=()=>{S(u.current)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[S,u]),(0,d.useEffect)(()=>{if(!_)return;let e=()=>{let e=p.current;e&&w(e.pointerId)},t=()=>{document.visibilityState!==`visible`&&e()};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,t)}},[w,_]),(0,d.useEffect)(()=>()=>{let e=p.current;e&&(p.current=null,C(e))},[C]),{isResizing:_,panelRef:f,reclampWidth:j,resetWidth:A,setWidth:e=>S(e,{forcePersist:!0}),separatorProps:{"aria-label":t,"aria-orientation":`vertical`,"aria-valuemax":y(),"aria-valuemin":c,"aria-valuenow":h,"aria-valuetext":`${h} px`,onDoubleClick:A,onKeyDown:M,onLostPointerCapture:k,onPointerCancel:O,onPointerDown:T,onPointerMove:E,onPointerUp:D,role:`separator`,tabIndex:0},width:h}}function zue({isMobile:e,sidebarOpen:t,setSidebarOpen:n,translate:r}){let[i,a]=(0,d.useState)(!1),o=(0,d.useRef)(280),s=(0,d.useRef)(280),c=(0,d.useCallback)(()=>typeof window>`u`?480:li({viewportWidth:window.innerWidth,rightPanelOpen:!1,rightPanelWidth:0}),[]),l=L9({ariaLabel:r(`layout.resizeSidebar`),cssVariable:`--sidebar-width`,defaultWidth:280,getMaxWidth:c,growthDirection:`right`,maxWidth:480,minWidth:180,storageKey:`pi-sidebar-width`,widthRef:o}),u=l.reclampWidth,f=L9({ariaLabel:r(`layout.resizeWidgetPanel`),cssVariable:`--widget-panel-width`,defaultWidth:280,getMaxWidth:()=>typeof window>`u`?560:ui({viewportWidth:window.innerWidth,sidebarOpen:t,sidebarWidth:l.width}),growthDirection:`left`,maxWidth:560,minWidth:200,storageKey:`pi-widget-panel-width`,widthRef:s});return(0,d.useEffect)(()=>{e&&n(!1)},[e,n]),(0,d.useEffect)(()=>{a(!0)},[]),(0,d.useEffect)(()=>{u()},[u]),{sidebarResizer:l,widgetPanelResizer:f,mobileSidebarReady:i}}var Bue=176,Vue=224,Hue=86,Uue=116;function R9(e){let t=e.button.getBoundingClientRect(),n=e.row?.getBoundingClientRect(),r=n?.top??t.top,i=n?.bottom??t.bottom,a=Math.min(e.menuWidth,n?.width??e.tabRect.width),o=Math.min(t.left-1,Math.max(n?.left??e.tabRect.left,(n?.right??e.tabRect.right)-a)),s=i+4;return{top:s+e.estHeight>window.innerHeight-4?r-e.estHeight:s,left:o,width:a}}function Wue({activeTopPanel:e,isMobile:t,tabBarRef:n,sidebarTopBarRef:r,languageBtnRef:i,fontScaleBtnRef:a}){let[o,s]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!e)return;let o=()=>{if(document.hidden)return;let o=n.current?.getBoundingClientRect();if(o){if(e===`language`&&!t&&i.current){let e=R9({menuWidth:Bue,estHeight:Hue,button:i.current,row:r.current,tabRect:o});s(e);return}if(e===`fontSize`&&!t&&a.current){let e=R9({menuWidth:Vue,estHeight:Uue,button:a.current,row:r.current,tabRect:o});s(e);return}s({top:o.bottom,left:o.left,width:o.width})}};o();let c=new ResizeObserver(o);return n.current&&c.observe(n.current),i.current&&c.observe(i.current),a.current&&c.observe(a.current),()=>c.disconnect()},[e,t]),o}function Gue({activeCwd:e,translate:t}){let{value:n}=zr(ot),r=(0,d.useMemo)(()=>n?Kr(n):0,[n]),i=(0,d.useMemo)(()=>n?qr(n,t(`common.plugins`)):[],[n,t]),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(void 0);return(0,d.useEffect)(()=>{e!==s.current&&(s.current=e,at(e??null),ot.load().catch(e=>console.error(`[pi-web] load updates:`,e)))},[e]),{updatesBadge:r,updateItems:i,updatesBannerDismissed:a,setUpdatesBannerDismissed:o}}function Kue({panelOpen:e,highlighted:t,onToggle:n}){let{t:r}=I(),i=r(e?`sidebar.hide`:`sidebar.show`);return(0,F.jsx)(L,{label:i,children:(0,F.jsx)(`button`,{onClick:n,"aria-controls":`widget-panel`,"aria-expanded":e,"aria-label":i,"data-testid":`widget-panel-toggle`,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:36,height:36,padding:0,background:`none`,border:`none`,borderLeft:`1px solid var(--border)`,color:t?`var(--text)`:`var(--text-muted)`,cursor:`pointer`,flexShrink:0,transition:`color 0.12s`,"--hover-color":`var(--text)`},className:`hover-shift`,children:(0,F.jsxs)(`svg`,{width:R[`4xl`],height:R[`4xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`rect`,{x:`3`,y:`3`,width:R[`4xl`],height:R[`4xl`],rx:`2`}),(0,F.jsx)(`line`,{x1:`15`,y1:`3`,x2:`15`,y2:`21`})]})})})}function que(){return(0,F.jsxs)(`div`,{role:`status`,"aria-label":`Loading`,"data-testid":`boot-splash`,style:{position:`fixed`,inset:0,zIndex:9999,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:18,background:`var(--bg)`,color:`var(--text-muted)`},children:[(0,F.jsx)(`div`,{style:{fontSize:`var(--text-6xl)`,fontWeight:700,color:`var(--accent)`,letterSpacing:`0.02em`},children:`pi`}),(0,F.jsx)(`div`,{style:{width:22,height:22,border:`2px solid var(--border)`,borderTopColor:`var(--accent)`,borderRadius:`50%`,animation:`boot-spin 0.8s linear infinite`}}),(0,F.jsx)(`style`,{children:`@keyframes boot-spin { to { transform: rotate(360deg); } }`})]})}function Jue(){let{t:e}=I(),t=(0,d.useSyncExternalStore)(OJ,kJ,kJ);if(t.length===0)return null;let n=t[t.length-1],r={...n,message:MY(n.message,e)},i=t.length;return(0,F.jsx)(Ac,{open:!0,onOpenChange:()=>{},children:(0,F.jsxs)(Pc,{children:[(0,F.jsx)(Ic,{style:{position:`fixed`,inset:0,zIndex:1200,background:`rgba(0, 0, 0, 0.45)`}}),(0,F.jsxs)(Bc,{role:`alertdialog`,"aria-modal":`true`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),style:{position:`fixed`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,zIndex:1200,maxWidth:480,width:`calc(100% - 48px)`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:10,padding:`16px 20px`,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.35)`},children:[(0,F.jsxs)(Gc,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10,fontSize:`var(--text-base)`,fontWeight:600,color:`var(--text)`},children:[(0,F.jsx)(`span`,{style:{color:`var(--status-error)`},children:`⚠`}),(0,F.jsx)(`span`,{children:i>1?e(`errors.titleCount`,{count:i}):e(`errors.title`)})]}),(0,F.jsx)(qc,{asChild:!0,children:(0,F.jsx)(`div`,{children:r.kind===`api`?(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:6},children:[(0,F.jsxs)(`span`,{style:{fontSize:`var(--text-xs)`,padding:`1px 8px`,borderRadius:999,background:`color-mix(in srgb, var(--status-error) 14%, transparent)`,color:`var(--status-error)`,fontWeight:600,whiteSpace:`nowrap`},children:[`HTTP `,r.status||`ERR`]}),r.context&&(0,F.jsx)(`span`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`},children:r.context})]}),(0,F.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text)`,wordBreak:`break-word`},children:r.message})]}):(0,F.jsxs)(`div`,{children:[r.context&&(0,F.jsx)(`div`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginBottom:6},children:r.context}),(0,F.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text)`,wordBreak:`break-word`},children:r.message})]})})}),(0,F.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:16},children:[i>1&&(0,F.jsx)(`button`,{type:`button`,onClick:jJ,style:{border:`1px solid var(--border)`,background:`none`,color:`var(--text-muted)`,borderRadius:6,padding:`4px 12px`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:e(`errors.clearAll`)}),(0,F.jsx)(`button`,{type:`button`,onClick:AJ,style:{border:`none`,background:`var(--accent)`,color:`#fff`,borderRadius:6,padding:`4px 14px`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:e(`errors.close`)})]})]})]})})}var Yue=3e3,Xue=6e4;function z9(e,t){return e?e.error?e.path.split(/[\\/]/).pop()||t:e.name||e.firstMessage.slice(0,50)||t.slice(0,12):t.slice(0,12)}function Zue(e,t){return e.filter(e=>!t.has(e))}function Que(e,t,n,r){switch(e.type){case`prompt_error`:case`extension_error`:{if(!n.errors)return null;let t=e.errorMessage??r(`i18n.commandFailed`);return{title:r(`chat.taskErrorNotificationTitle`),body:t,tag:`agent-error-${e.sessionId}`}}case`extension_ui_request`:{if(!n.questions)return null;let t=e.method;if(t!==`select`&&t!==`confirm`&&t!==`input`&&t!==`editor`)return null;let i=e.title??r(`chat.questionNotificationTitle`);return{title:r(`chat.questionNotificationTitle`),body:i,tag:`question-${e.id??e.sessionId}`}}default:return null}}function $ue(){let{t:e}=I(),{notifyEvents:t}=Tn(),[n,r]=(0,d.useState)([]),i=(0,d.useRef)([]);(0,d.useEffect)(()=>{i.current=n});let a=(0,d.useRef)(t);(0,d.useEffect)(()=>{a.current=t});let o=(0,d.useRef)(e);(0,d.useEffect)(()=>{o.current=e});let{runningSessionIds:s}=vZ(),c=(0,d.useRef)(!1),l=(0,d.useRef)([]),u=(0,d.useRef)(new Map);(0,d.useEffect)(()=>{if(!a.current.taskComplete)return;let e=c.current?l.current:null;if(l.current=[...s],c.current=!0,!e)return;let t=Zue(e,s);if(t.length===0)return;let n=Date.now();for(let e of t){let t=u.current.get(e);t!==void 0&&n-t<Yue||(i.current.some(t=>t.id===e)||p.current(),console.info(`[notify] completion via running-snapshot (${e})`),gJ({title:o.current(`chat.taskCompleteNotificationTitle`),body:o.current(`chat.sessionCompletedNotificationBody`,{name:z9(i.current.find(t=>t.id===e),e)}),tag:`session-complete-${e}`,notifyWhileActive:a.current.notifyWhileActive}))}},[s]);let f=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`,{cache:`no-store`});if(!e.ok)return;let t=await e.json();t.sessions&&r(t.sessions)}catch{}},[]),p=(0,d.useRef)(f);return(0,d.useEffect)(()=>{p.current=f}),(0,d.useEffect)(()=>{f();let e=setInterval(()=>void f(),Xue);return()=>clearInterval(e)},[f]),(0,d.useEffect)(()=>ge({ch:`global`},e=>{let t=e;if(!t.sessionId)return;let n=t.sessionId;(t.type===`prompt_error`||t.type===`extension_error`)&&u.current.set(n,Date.now()),i.current.some(e=>e.id===n)||p.current();let r=Que(t,z9(i.current.find(e=>e.id===n),n),a.current,o.current);r&&(console.info(`[agent-events] notifying: ${r.title}`),gJ({...r,notifyWhileActive:a.current.notifyWhileActive}))}),[]),null}var ede=3;function tde(){let{t:e}=I(),t=(0,d.useSyncExternalStore)(cn,ln,ln);if(t.length===0)return null;let n=t.slice(0,ede),r=t.length-n.length;return(0,F.jsx)(`div`,{"aria-busy":`true`,style:{position:`fixed`,inset:0,zIndex:1150,background:`color-mix(in srgb, var(--bg) 40%, transparent)`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,minWidth:220,maxWidth:`60vw`,padding:`14px 18px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:`var(--radius)`,boxShadow:`0 8px 32px rgba(0,0,0,0.25)`},children:[n.map(t=>(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,fontSize:`var(--text-sm)`,color:`var(--text)`},children:[(0,F.jsx)(`div`,{style:{width:14,height:14,flexShrink:0,border:`2px solid var(--border)`,borderTopColor:`var(--accent)`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`}}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.label||e(`loading.inProgress`)})]},t.id)),r>0&&(0,F.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:e(`loading.more`,{count:r})})]})})}function nde({cwd:e,busy:t,error:n,onCancel:r,onConfirm:i}){let{t:a}=I();return(0,F.jsx)(ym,{open:!0,onOpenChange:e=>{!e&&!t&&r()},children:(0,F.jsxs)(Cm,{className:`w-[440px] gap-0 overflow-hidden rounded-lg p-0`,style:{zIndex:1100,maxWidth:`100%`},showCloseButton:!1,onPointerDownOutside:e=>{t&&e.preventDefault()},onEscapeKeyDown:e=>{t&&e.preventDefault()},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,gap:12,padding:`18px 18px 14px`},children:[(0,F.jsxs)(`svg`,{width:R[`5xl`],height:R[`5xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--status-warning)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0,marginTop:1},children:[(0,F.jsx)(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z`}),(0,F.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),(0,F.jsxs)(`div`,{style:{minWidth:0},children:[(0,F.jsx)(wm,{style:{fontSize:`var(--text-2xl)`,fontWeight:700,color:`var(--text)`,lineHeight:1.4},children:a(`trust.dialogTitle`)}),(0,F.jsx)(Tm,{style:{marginTop:7,fontSize:`var(--text-base)`,lineHeight:1.6,color:`var(--text-muted)`},children:a(`trust.dialogBody`)}),(0,F.jsx)(`code`,{style:{display:`block`,marginTop:10,padding:`8px 10px`,border:`1px solid var(--border)`,borderRadius:5,background:`var(--bg)`,color:`var(--text)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,overflowWrap:`anywhere`},children:e}),n&&(0,F.jsx)(`div`,{role:`alert`,style:{marginTop:10,color:`var(--status-error)`,fontSize:`var(--text-base)`,lineHeight:1.5},children:n})]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`10px 18px`,borderTop:`1px solid var(--border)`},children:[(0,F.jsx)(vm,{type:`button`,variant:`outline`,onClick:r,disabled:t,className:`h-8 px-3 text-xs`,children:a(`trust.cancel`)}),(0,F.jsx)(vm,{type:`button`,onClick:i,disabled:t,className:`h-8 px-3 text-xs`,style:{cursor:t?`wait`:`pointer`},children:a(t?`trust.trusting`:`trust.trustProject`)})]})]})})}function rde(e){return e.error?e.path.split(/[\\/]/).pop()||e.id:e.name||e.firstMessage.slice(0,50)||e.id.slice(0,12)}var B9=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``).replace(/^[a-zA-Z]:/,e=>e.toLowerCase()),V9=e=>Math.max(...e.map(e=>{let t=new Date(e.modified).getTime();return Number.isNaN(t)?0:t})),ide=(e,t)=>V9(t.sessions)-V9(e.sessions);function ade(e,t,n){return!t||e.some(e=>e.id===t.id)?e:[{...t,projectRoot:t.projectRoot??n(t.cwd)??void 0},...e]}function ode({filteredSessions:e,selectedSession:t,projectRootFor:n,selectedCwd:r,savedWorkspaces:i}){let a=ade(e,t,n),o=new Map,s=new Map;for(let e of a){let t=e.projectRoot??e.cwd??`unknown`,n=t===`unknown`?t:B9(t);o.has(n)||(o.set(n,[]),s.set(n,t)),o.get(n).push(e)}let c=[...o.entries()].map(([e,t])=>({root:s.get(e)??e,sessions:t})).sort(ide),l=[];if(r){let e=n(r);e&&!o.has(B9(e))&&l.push({root:e,sessions:[]})}let u=new Set([...o.keys()]);for(let e of l)u.add(B9(e.root));let d=[];for(let e of i??[]){let t=B9(e);u.has(t)||(u.add(t),d.push({root:e,sessions:[]}))}return[...l,...c,...d]}function sde(e,t){return t?e.map(e=>({...e,sessions:e.sessions.filter(e=>rde(e).toLowerCase().includes(t))})).filter(e=>e.sessions.length>0):e}var H9=`pi-web:unread-session-ids`;function cde(){if(typeof window>`u`)return new Set;try{let e=window.localStorage.getItem(H9);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function U9(e){if(!(typeof window>`u`))try{e.size===0?window.localStorage.removeItem(H9):window.localStorage.setItem(H9,JSON.stringify([...e]))}catch{}}function lde(){let[e,t]=(0,d.useState)(()=>cde());return(0,d.useEffect)(()=>{U9(e)},[e]),{unreadSessionIds:e,setUnreadSessionIds:t}}function ude(){let{t:e}=I();return(0,F.jsx)(`span`,{title:e(`sidebar.newActivity`),"aria-label":e(`sidebar.newSessionActivity`),style:{width:14,height:14,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,color:`var(--accent)`},children:(0,F.jsxs)(`svg`,{width:R.xl,height:R.xl,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,style:{display:`block`},children:[(0,F.jsx)(`circle`,{cx:`7`,cy:`7`,r:`2.5`,fill:`currentColor`}),(0,F.jsx)(`circle`,{cx:`7`,cy:`7`,r:`3`,stroke:`currentColor`,strokeWidth:`1.4`,opacity:`0.32`,style:{transformOrigin:`center`,animation:`session-ring-pulse 1.6s ease-in-out infinite`}})]})})}function dde({savedWorkspaces:e,onSavedWorkspacesChange:t,setSelectedCwd:n}){let[r,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(``),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(!1);return{customPathOpen:r,setCustomPathOpen:i,customPathError:s,setCustomPathError:c,customPathValidating:l,commitCustomPath:(0,d.useCallback)(async r=>{let s=(r??a).trim();if(!(!s||l)){u(!0),c(null);try{let r=await fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:s})}),a=await r.json().catch(()=>({}));if(!r.ok||a.error){c(a.error??`HTTP ${r.status}`);return}let l=a.cwd??s;if(n(l),i(!1),o(``),t){let n=e??[];n.some(e=>B9(e)===B9(l))||t([...n,l])}}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}},[a,l,e,t,n])}}function fde({savedWorkspaces:e,onSavedWorkspacesChange:t,onSessionDeleted:n,loadSessions:r}){let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!1);return{confirmDeleteGroup:i,setConfirmDeleteGroup:a,deletingGroup:o,handleDeleteGroup:(0,d.useCallback)(async i=>{a(null),s(!0);try{await Promise.all(i.sessions.map(e=>fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`}).then(t=>{t.ok||console.error(`[sidebar] failed to delete ${e.id}:`,t.status)}).catch(t=>console.error(`[sidebar] failed to delete ${e.id}:`,t))));for(let e of i.sessions)n?.(e.id);let a=e??[];t&&a.some(e=>B9(e)===B9(i.root))&&t(a.filter(e=>B9(e)!==B9(i.root))),r(!1,!0)}finally{s(!1)}},[e,t,n,r])}}var pde=2e3;function mde({selectedSessionId:e,refreshKey:t,runningSessionIds:n,setUnreadSessionIds:r,setRunningSessionIds:i,runningPollAuthoritativeRef:a,setError:o}){let[s,c]=(0,d.useState)([]),[l,u]=(0,d.useState)(!0),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(!1),g=(0,d.useRef)(new Set),_=(0,d.useRef)(null),v=(0,d.useRef)(0),y=(0,d.useCallback)(async(e=!1,t=!1)=>{try{e&&u(!0);let n=t?await et.refresh():await et.load();c(n.sessions),a.current||i(new Set(n.runningSessionIds??[]));let s=new Set(n.sessions.map(e=>e.id));r(e=>{if(e.size===0)return e;let t=new Set([...e].filter(e=>s.has(e)));return t.size===e.size?e:t}),o(null),e||(h(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>h(!1),2e3))}catch(e){o(String(e))}finally{e&&u(!1)}},[r,i,a,o]),b=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{let e=!b.current;b.current=!0,y(e,e)},[y,t]),(0,d.useEffect)(()=>{let t=[...g.current].filter(t=>!n.has(t)&&t!==e),i=[...n];if((t.length>0||i.length>0)&&r(e=>{let n=new Set(e);return i.forEach(e=>n.delete(e)),t.forEach(e=>n.add(e)),n}),t.length>0&&y(!1),[...n].filter(e=>!s.some(t=>t.id===e)).length>0){let e=Date.now();e-v.current>=pde&&(v.current=e,y(!1,!0))}g.current=n},[n,e,s,y,r]),(0,d.useEffect)(()=>{e&&(OX(e),r(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}))},[e,r]),(0,d.useEffect)(()=>{fetch(`/api/home`).then(e=>e.json()).then(e=>{e.home&&p(e.home)}).catch(e=>console.error(`[pi-web] load home dir:`,e))},[]),{allSessions:s,loading:l,sessionRefreshDone:m,homeDir:f,loadSessions:y}}var W9=(e,t)=>e.replace(/\\/g,`/`)===t.replace(/\\/g,`/`);function G9(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?t(`sidebar.justNow`):i<60?t(`sidebar.minutesAgo`,{count:i}):a<24?t(`sidebar.hoursAgo`,{count:a}):o<7?t(`sidebar.daysAgo`,{count:o}):n.toLocaleDateString()}function hde(e){let t=new Map;for(let n of e){let e=n.projectRoot??n.cwd;if(!e)continue;let r=t.get(e);(!r||n.modified>r)&&t.set(e,n.modified)}return[...t.entries()].sort((e,t)=>t[1].localeCompare(e[1])).map(([e])=>e)}function K9(e,t){return t&&e.startsWith(t)?`~${e.slice(t.length)}`:e}function gde(e){let t=e.split(/[\\/]+/).filter(Boolean);return t.length?t[t.length-1]:e}function q9({text:e,style:t}){return(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,display:`block`,minWidth:0,lineHeight:1.35,direction:`rtl`,textAlign:`left`,...t},children:(0,F.jsx)(`span`,{style:{unicodeBidi:`plaintext`},children:e})})}function J9({session:e}){return(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,color:`var(--danger)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:`${e.path}: ${e.error}`,children:[(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0},children:[(0,F.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,F.jsx)(`path`,{d:`M12 9v4`}),(0,F.jsx)(`path`,{d:`M12 17h.01`})]}),e.error]})}var Y9=140;function _de({open:e,children:t,style:n}){let[r,i]=(0,d.useState)(e),[a,o]=(0,d.useState)(e);return(0,d.useEffect)(()=>{let t,n;return e?(i(!0),o(!1),t=window.requestAnimationFrame(()=>{t=window.requestAnimationFrame(()=>o(!0))})):(o(!1),n=setTimeout(()=>i(!1),Y9)),()=>{t!==void 0&&window.cancelAnimationFrame(t),n&&clearTimeout(n)}},[e]),r?(0,F.jsx)(`div`,{style:{...n,opacity:+!!a,transform:a?`translateY(0) scale(1)`:`translateY(-8px) scale(0.96)`,transformOrigin:`top center`,transition:`opacity ${Y9}ms ease, transform ${Y9}ms ease`,pointerEvents:e?`auto`:`none`},children:t}):null}function vde({worktreeState:e,allSessions:t,selectedCwd:n,setSelectedCwd:r,onCwdChange:i,initialSessionId:a,skipInitialProjectSelection:o,onSelectSession:s,onInitialRestoreDone:c,markSeen:l}){let u=(0,d.useCallback)(n=>n?e?.forCwd&&W9(e.forCwd,n)||e?.worktrees.some(e=>W9(e.path,n))?e.projectRoot:t.find(e=>e.cwd&&W9(e.cwd,n))?.projectRoot??n:null,[e,t]),f=(0,d.useRef)(null);(0,d.useEffect)(()=>{f.current!==n&&(f.current=n,i?.(n,u(n)))},[n,i,u]);let p=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(!(t.length===0||o)&&n===null){if(a&&!p.current){p.current=!0;let e=t.find(e=>e.id===a);if(e){r(e.cwd),l(e.id),s(e,!0);return}c?.()}let e=hde(t);e.length>0&&r(e[0])}},[t,n,a,o,s,c,l,r]),{projectRootFor:u}}function yde({onUnseenSession:e}){let[t,n]=(0,d.useState)(()=>new Set);return{seenSessionIds:t,markSeen:(0,d.useCallback)(e=>{n(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),handleUnseen:(0,d.useCallback)(t=>{n(e=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),n}),he(t),e?.(t)},[e])}}function bde(e){let{selectedCwd:t,selectedCwdProp:n,refreshKey:r,setSelectedCwd:i}=e,[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(null),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(``),w=(0,d.useRef)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(null);(0,d.useEffect)(()=>{n&&n!==E.current&&(E.current=n,i(n))},[n,i]);let D=(0,d.useCallback)(()=>{c(!1),u(!1),p(``),h(null),y(null),C(``)},[]),[O,k]=(0,d.useState)(0);(0,d.useLayoutEffect)(()=>{if(!t){o(null),x(null);return}let e=!1;return x(t),fetch(`/api/worktrees?cwd=${encodeURIComponent(t)}`).then(e=>e.json()).then(n=>{if(!e){if(x(null),n.error||!n.projectRoot){o(null);return}o({forCwd:t,projectRoot:n.projectRoot,isGit:n.isGit??!1,isTopLevel:n.isTopLevel??!1,worktrees:n.worktrees??[]})}}).catch(()=>{e||(x(null),o(null))}),()=>{e=!0}},[t,O,r]);let A=(0,d.useCallback)(async()=>{let e=f.trim();if(!(!e||g||!a)){_(!0),h(null);try{let t=await fetch(`/api/worktrees`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:a.projectRoot,branch:e})}),n=await t.json().catch(()=>({}));if(!t.ok||n.error||!n.path){h(n.error??`HTTP ${t.status}`);return}D(),o(t=>t&&{...t,forCwd:n.path,worktrees:[...t.worktrees,{path:n.path,branch:e,isMain:!1}]}),i(n.path),k(e=>e+1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}},[D,f,g,a,i]),j=(0,d.useCallback)(async(e,n)=>{if(!(!a||g)){_(!0),h(null);try{let r=await fetch(`/api/worktrees`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:a.projectRoot,path:e,force:n})}),o=await r.json().catch(()=>({}));if(!r.ok){if(o.dirty&&!n){y(e);return}h(o.error??`HTTP ${r.status}`);return}D(),t&&e&&W9(t,e)&&i(a.projectRoot),k(e=>e+1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}},[D,a,g,t,i]);return(0,d.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&D()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[D]),{worktreeState:a,worktreeLoadingCwd:b,wtDropdownOpen:s,setWtDropdownOpen:c,wtNewOpen:l,setWtNewOpen:u,wtNewBranch:f,setWtNewBranch:p,wtError:m,setWtError:h,wtBusy:g,wtConfirmRemove:v,setWtConfirmRemove:y,wtFilter:S,setWtFilter:C,wtDropdownRef:w,wtNewInputRef:T,closeWorktrees:D,handleCreateWorktree:A,handleRemoveWorktree:j}}function xde({selectedCwd:e,worktreeState:t,selectedProject:n,worktreeLoadingCwd:r,t:i}){let a=!!(t?.isGit&&t.isTopLevel&&e&&n===t.projectRoot),o=e&&t&&n===t.projectRoot&&!a?t.isGit?{label:i(`sidebar.openRepoRoot`),title:i(`sidebar.openRepoRootTitle`)}:{label:i(`sidebar.gitRepoRootOnly`),title:i(`sidebar.gitRepoRootOnlyTitle`)}:null,s=!!(e&&r===e);return{showWorktreeSwitcher:a,worktreeLoading:s,inactiveWorktreeSelector:o??(s&&!a?{label:i(`sidebar.worktrees`),title:i(`sidebar.checkingWorktrees`)}:null)}}function Sde({selectedSession:e,selectedSessionId:t,refreshKey:n,selectedCwdProp:r,savedWorkspaces:i,onSavedWorkspacesChange:a,onUnseenSession:o,onCwdChange:s,initialSessionId:c,skipInitialProjectSelection:l,onSelectSession:u,onInitialRestoreDone:f,onSessionDeleted:p}){let{t:m}=I(),[h,g]=(0,d.useState)(null),_=dde({savedWorkspaces:i,onSavedWorkspacesChange:a,setSelectedCwd:g}),v=bde({selectedCwd:h,selectedCwdProp:r,refreshKey:n,setSelectedCwd:g}),{worktreeState:y,worktreeLoadingCwd:b}=v,[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(``),T=(0,d.useRef)(null);(0,d.useEffect)(()=>{x&&T.current?.focus()},[x]);let{seenSessionIds:E,markSeen:D,handleUnseen:O}=yde({onUnseenSession:o}),{unreadSessionIds:k,setUnreadSessionIds:A}=lde(),j=jX(),{runningSessionIds:M,runningPhases:N,runningPhaseSince:ee,runningBusySince:te,setRunningSessionIds:P,runningPollAuthoritativeRef:ne}=vZ(),[re,ie]=(0,d.useState)(null),{allSessions:ae,loading:oe,sessionRefreshDone:se,homeDir:ce,loadSessions:le}=mde({selectedSessionId:t,refreshKey:n,runningSessionIds:M,setUnreadSessionIds:A,setRunningSessionIds:P,runningPollAuthoritativeRef:ne,setError:ie});(0,d.useEffect)(()=>{U9(k)},[k]);let{projectRootFor:ue}=vde({worktreeState:y,allSessions:ae,selectedCwd:h,setSelectedCwd:g,onCwdChange:s,initialSessionId:c,skipInitialProjectSelection:l,onSelectSession:u,onInitialRestoreDone:f,markSeen:D}),[de,fe]=(0,d.useState)({}),[pe,me]=(0,d.useState)(null),he=ue(h),ge=ae,{showWorktreeSwitcher:_e,inactiveWorktreeSelector:ve}=xde({selectedCwd:h,worktreeState:y,selectedProject:he,worktreeLoadingCwd:b,t:m}),{confirmDeleteGroup:F,setConfirmDeleteGroup:ye,deletingGroup:be,handleDeleteGroup:xe}=fde({savedWorkspaces:i,onSavedWorkspacesChange:a,onSessionDeleted:p,loadSessions:le}),Se=(0,d.useMemo)(()=>ode({filteredSessions:ge,selectedSession:e,projectRootFor:ue,selectedCwd:h,savedWorkspaces:i}),[ge,h,ue,e,i]),Ce=C.trim().toLowerCase();return{t:m,selectedCwd:h,setSelectedCwd:g,selectedSessionId:t,customPath:_,wt:v,workspaceSearchOpen:x,setWorkspaceSearchOpen:S,workspaceSearchQuery:C,setWorkspaceSearchQuery:w,workspaceSearchInputRef:T,seenSessionIds:E,markSeen:D,handleUnseen:O,unreadSessionIds:k,interactionBadges:j,runningSessionIds:M,runningPhases:N,runningPhaseSince:ee,runningBusySince:te,error:re,setError:ie,loading:oe,sessionRefreshDone:se,homeDir:ce,loadSessions:le,groupCollapsed:de,setGroupCollapsed:fe,hoveredGroup:pe,setHoveredGroup:me,selectedProject:he,showWorktreeSwitcher:_e,inactiveWorktreeSelector:ve,confirmDeleteGroup:F,setConfirmDeleteGroup:ye,deletingGroup:be,handleDeleteGroup:xe,wsQuery:Ce,visibleGroups:(0,d.useMemo)(()=>sde(Se,Ce),[Se,Ce])}}function Cde({searchQuery:e,setSearchQuery:t,currentPath:n,hasUncommittedPath:r,canSelect:i,busy:a,onCancel:o,onSelect:s}){let{t:c}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{className:`directory-picker-footer`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:10,flexShrink:0,padding:`10px 18px`,borderTop:`1px solid var(--border)`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flex:1,minWidth:0},children:[(0,F.jsxs)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{color:`var(--text-dim)`,flexShrink:0},children:[(0,F.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,F.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),(0,F.jsx)(Rx,{className:`directory-picker-search h-8 flex-1`,type:`text`,value:e,placeholder:c(`directoryPicker.search`),"aria-label":c(`directoryPicker.search`),autoComplete:`off`,spellCheck:!1,style:_S,onChange:e=>t(e.target.value)})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,flexShrink:0},children:[(0,F.jsx)(`button`,{className:`directory-picker-action`,type:`button`,onClick:o,disabled:a,style:{padding:`6px 14px`,border:`1px solid var(--border)`,borderRadius:6,background:`none`,color:`var(--text-muted)`,cursor:a?`default`:`pointer`,fontSize:`var(--text-lg)`},children:c(`i18n.cancel`)}),(0,F.jsx)(`button`,{className:`directory-picker-action`,type:`button`,onClick:()=>s(n),disabled:!i,title:c(r?`directoryPicker.openBeforeSelecting`:`directoryPicker.selectCurrentDirectory`),style:{padding:`6px 16px`,border:0,borderRadius:6,background:`var(--accent)`,color:`var(--on-accent)`,fontSize:`var(--text-lg)`,fontWeight:600,opacity:i?1:.6,cursor:i?`pointer`:`default`},children:c(a?`i18n.checking`:`directoryPicker.selectThisFolder`)})]})]})})}function wde({loading:e,drives:t,filteredDrives:n,filteredDirectories:r,query:i,navigateTo:a,loadError:o,error:s}){let{t:c}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{className:`directory-picker-list`,style:{flex:1,minHeight:0,overflow:`auto`,padding:`8px 10px`},children:[e?(0,F.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:c(`directoryPicker.loadingDirectories`)}):t===null?r.length>0?r.map(e=>(0,F.jsxs)(`button`,{className:`directory-picker-entry`,type:`button`,onClick:()=>void a(e.path),title:e.path,style:{width:`100%`,minHeight:30,display:`flex`,alignItems:`center`,gap:7,padding:`5px 8px`,border:0,borderRadius:5,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`},children:[(0,F.jsx)(vS,{}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})]},e.path)):(0,F.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:c(i?`directoryPicker.noMatches`:`directoryPicker.noSubdirectories`)}):n.length>0?n.map(e=>(0,F.jsxs)(`button`,{className:`directory-picker-entry`,type:`button`,onClick:()=>void a(e.path),title:e.path,style:{width:`100%`,minHeight:34,display:`flex`,alignItems:`center`,gap:7,padding:`6px 8px`,border:0,borderRadius:5,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`},children:[(0,F.jsx)(yS,{}),(0,F.jsx)(`span`,{children:e.name})]},e.path)):(0,F.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:c(i?`directoryPicker.noMatches`:`directoryPicker.noDrives`)}),(o||s)&&(0,F.jsx)(`div`,{style:{padding:`8px`,color:`var(--status-error)`,fontSize:`var(--text-sm)`},children:o??s})]})})}function Tde({handlePathSubmit:e,navigateTo:t,parentDirectory:n,loading:r,canNavigateUp:i,pathInputRef:a,pathInput:o,setPathInput:s,setLoadError:c}){let{t:l}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`form`,{onSubmit:e,style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0,padding:`10px 14px`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsx)(`button`,{className:`directory-picker-back`,type:`button`,onClick:()=>void t(n??void 0),disabled:r||!i,title:l(`directoryPicker.goToParent`),"aria-label":l(`directoryPicker.goToParent`),style:{width:36,height:36,padding:0,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,border:`1px solid var(--border)`,borderRadius:6,background:`#ffffff`,color:`var(--text-muted)`,cursor:i?`pointer`:`default`,opacity:i?1:.45},children:(0,F.jsx)(`svg`,{width:R[`3xl`],height:R[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`m18 15-6-6-6 6`})})}),(0,F.jsx)(`label`,{htmlFor:`directory-path`,style:{position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0},children:l(`directoryPicker.directoryPath`)}),(0,F.jsx)(Rx,{className:`directory-picker-path h-9 flex-1 font-mono text-xs`,id:`directory-path`,type:`text`,ref:a,value:o,placeholder:`/path/to/project or ~/project`,autoComplete:`off`,spellCheck:!1,style:_S,onChange:e=>{s(e.target.value),c(null)}}),(0,F.jsx)(`button`,{className:`directory-picker-action`,type:`submit`,disabled:!o.trim(),title:l(`directoryPicker.goToDirectory`),style:{minWidth:58,height:36,padding:`0 12px`,border:`1px solid var(--border)`,borderRadius:6,background:`#ffffff`,color:`var(--text-muted)`,cursor:o.trim()?`pointer`:`default`,opacity:o.trim()?1:.6},children:l(`directoryPicker.go`)})]})})}function Ede({onCancel:e,onSelect:t,busy:n=!1,error:r}){let{t:i}=I(),[a,o]=(0,d.useState)(!0),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)([]),[g,_]=(0,d.useState)(null),[v,y]=(0,d.useState)(``),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(!0),w=(0,d.useRef)(null),T=(0,d.useCallback)(async e=>{C(!0),x(null);try{let t=await gS(e),n=t.path??e??`/`;c(n),u(t.parentPath??null),p(n),h(t.directories??[]),_(t.drives??null),y(``)}catch(e){x(e instanceof Error?e.message:String(e))}finally{C(!1)}},[]);(0,d.useEffect)(()=>{T()},[T]);let E=e=>{e.preventDefault();let t=f.trim();t&&T(t)},D=f.trim()!==s,O=!!s&&!D&&!n,k=!!l||bS(s),A=v.trim().toLowerCase(),j=e=>!A||e.toLowerCase().includes(A),M=g===null?[]:g.filter(e=>j(e.name)||j(e.path)),N=m.filter(e=>j(e.name));return(0,F.jsx)(ym,{open:a,onOpenChange:t=>{!t&&!n&&(o(!1),e())},children:(0,F.jsxs)(Cm,{className:`directory-picker-light flex w-[520px] max-w-[calc(100vw-16px)] flex-col gap-0 overflow-hidden p-0`,style:{height:`min(620px, calc(100dvh - 16px))`},showCloseButton:!1,onPointerDownOutside:e=>{n&&e.preventDefault()},onEscapeKeyDown:e=>{n&&e.preventDefault()},onOpenAutoFocus:e=>{e.preventDefault(),w.current?.focus()},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexShrink:0,padding:`12px 18px`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsx)(wm,{style:{fontWeight:700,fontSize:`var(--text-2xl)`,color:`var(--text)`},children:i(`directoryPicker.selectDirectory`)}),(0,F.jsx)(xm,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,disabled:n,title:i(`i18n.close`),"aria-label":i(`i18n.close`),style:{padding:`2px 6px`,border:0,background:`none`,color:`var(--text-muted)`,fontSize:`var(--text-5xl)`,lineHeight:1,cursor:n?`default`:`pointer`,opacity:n?.5:1},children:`×`})})]}),(0,F.jsx)(Tde,{handlePathSubmit:E,navigateTo:T,parentDirectory:l,loading:S,canNavigateUp:k,pathInputRef:w,pathInput:f,setPathInput:p,setLoadError:x}),(0,F.jsx)(wde,{loading:S,drives:g,filteredDrives:M,filteredDirectories:N,query:A,navigateTo:T,loadError:b,error:r}),(0,F.jsx)(Cde,{searchQuery:v,setSearchQuery:y,currentPath:s,hasUncommittedPath:D,canSelect:O,busy:n,onCancel:e,onSelect:t})]})})}function Dde({title:e,label:t}){return(0,F.jsxs)(`button`,{type:`button`,"aria-disabled":`true`,tabIndex:-1,title:e,style:{width:`100%`,height:29,boxSizing:`border-box`,marginTop:6,display:`flex`,alignItems:`center`,gap:6,padding:`0 10px`,border:`1px solid var(--border)`,borderRadius:7,background:`var(--bg-hover)`,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,lineHeight:1.35,whiteSpace:`nowrap`,textAlign:`left`,cursor:`default`,opacity:.82},children:[(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:t})]})}function Ode(e,t){return{cursor:e?`default`:`pointer`,background:e?`color-mix(in srgb, var(--status-error) 6%, transparent)`:t?`var(--bg-hover)`:`var(--bg)`}}function kde({hasInteraction:e,hasRunning:t,collapsed:n}){return{background:e&&n?`linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`:t&&n?`linear-gradient(90deg, transparent 13%, color-mix(in srgb, var(--accent) 18%, transparent) 25%, transparent 37%, transparent 63%, color-mix(in srgb, var(--shine-highlight) 50%, transparent) 75%, transparent 87%), linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`:`linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`,backgroundSize:t&&n&&!e?`200% 100%, auto`:void 0,animation:e&&n?`interaction-bg-blink 1s ease-in-out infinite`:t&&n?`pi-status-shine 1.5s linear infinite`:void 0}}function X9(e){return{cursor:e?`default`:`pointer`,opacity:e?.6:1}}function Ade({group:e,groupSelected:t,hoveredGroup:n,confirmDeleteGroup:r,deletingGroup:i,runningSessionIds:a,interactionBadges:o,collapsed:s,setHoveredGroup:c,setGroupCollapsed:l,setConfirmDeleteGroup:u,handleDeleteGroup:d,handleNewSession:f,copyText:p}){let{t:m}=I(),h=e.sessions.some(e=>a.has(e.id)),g=e.sessions.some(e=>o.has(e.id)),_=r===e.root,v=n===e.root;return(0,F.jsx)(`div`,{"data-testid":`workspace-group-header`,onMouseEnter:()=>c(e.root),onMouseLeave:()=>c(null),style:{display:`flex`,alignItems:`center`,gap:4,height:40,padding:`0 2px`,boxSizing:`border-box`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600,textTransform:`none`,letterSpacing:.6,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,...Ode(_,v)},onClick:_?void 0:()=>{l(t=>({...t,[e.root]:!t[e.root]}))},children:_?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:m(`sidebar.deleteWorkspace`,{count:e.sessions.length})}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:5,flexShrink:0},children:[(0,F.jsx)(`button`,{onClick:t=>{t.stopPropagation(),d(e)},disabled:i,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,height:22,padding:`0 9px`,background:`var(--status-error)`,border:`none`,borderRadius:5,color:`var(--on-error)`,fontSize:`var(--text-sm)`,fontWeight:600,whiteSpace:`nowrap`,...X9(i)},children:m(`sidebar.delete`)}),(0,F.jsx)(`button`,{onClick:e=>{e.stopPropagation(),u(null)},disabled:i,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:22,padding:`0 9px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,fontWeight:500,whiteSpace:`nowrap`,...X9(i)},children:m(`sidebar.cancel`)})]})]}):(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,flex:1,minWidth:0,height:38,boxSizing:`border-box`,padding:`0 8px`,border:`none`,borderRadius:0,...kde({hasInteraction:g,hasRunning:h,collapsed:s}),boxShadow:`0 2px 8px var(--shadow-color)`,margin:`0 -2px`},children:[(0,F.jsxs)(`span`,{style:{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:30,height:22,flexShrink:0},children:[(0,F.jsx)(`svg`,{width:`30`,height:`22`,viewBox:`0 0 24 24`,fill:t?`color-mix(in srgb, var(--accent) 18%, transparent)`:`var(--bg)`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:t?`var(--accent)`:`var(--text-muted)`,opacity:.95},children:(0,F.jsx)(`path`,{d:`M4 20h16a2 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 2v13c0 1.1.9 2 2 2Z`})}),(0,F.jsx)(`span`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -38%)`,color:`var(--text-muted)`,fontSize:`var(--text-xs)`,fontWeight:400,lineHeight:1,textAlign:`center`,fontVariantNumeric:`tabular-nums`,userSelect:`none`},children:e.sessions.length})]}),(0,F.jsx)(L,{label:e.root,wrapperStyle:{flex:1,minWidth:0,overflow:`hidden`},children:(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:`100%`,lineHeight:`20px`},children:gde(e.root)})}),v&&(0,F.jsx)(tJ,{items:[{key:`new-session`,onClick:t=>{t.stopPropagation(),f(e.root)},title:m(`sidebar.newSessionTitle`,{path:e.root}),icon:(0,F.jsx)(gr,{size:R.base})},{key:`copy-path`,onClick:t=>{t.stopPropagation(),p(e.root)},title:m(`sidebar.copyPath`),icon:(0,F.jsx)(qn,{size:R.base})},{key:`delete-workspace`,onClick:t=>{t.stopPropagation(),u(e.root)},title:m(`sidebar.deleteWorkspaceTitle`),danger:!0,icon:(0,F.jsx)(jr,{size:R.base})}]})]})})})}function jde(e){return e.error?e.path.split(/[\\/]/).pop()||e.id:e.name||e.firstMessage.slice(0,50)||e.id.slice(0,12)}function Mde({hasInteractionBadge:e,depth:t,confirmDelete:n,renaming:r,hovered:i,deleting:a}){return{height:54,animation:e?`interaction-bg-blink 1s ease-in-out infinite`:void 0,display:`flex`,alignItems:`center`,paddingLeft:t>0?t*12+14:14,paddingRight:8,cursor:n||r?`default`:`pointer`,backgroundColor:n?`color-mix(in srgb, var(--status-error) 6%, transparent)`:i?`var(--bg-hover)`:`transparent`,transition:`background 0.1s`,opacity:a?.5:1,gap:6,overflow:`hidden`}}function Nde({session:e,hovered:t,isSeen:n,onUnseen:r,startRename:i,handleDeleteClick:a}){let{t:o}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(tJ,{visible:t,items:[...n&&r?[{key:`unseen`,onClick:t=>{t.stopPropagation(),r(e.id)},title:o(`sidebar.disconnect`)||`断开`,icon:(0,F.jsx)(Nr,{size:R.base})}]:[],{key:`copy-path`,onClick:t=>{t.stopPropagation(),gK(e.path)},title:o(`sidebar.copyPath`),icon:(0,F.jsx)(qn,{size:R.base})},{key:`rename`,testId:`session-rename`,onClick:i,title:o(`sidebar.rename`),icon:(0,F.jsx)(mr,{size:R.xl})},{key:`delete`,testId:`session-delete`,onClick:a,title:o(`sidebar.deleteWithShiftClick`),danger:!0,icon:(0,F.jsx)(jr,{size:R.xl})}]})})}function Pde({collapsed:e,onToggleCollapse:t}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(L,{label:e?`Expand forks`:`Collapse forks`,children:(0,F.jsx)(`button`,{onClick:e=>{e.stopPropagation(),t?.()},style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,padding:0,flexShrink:0,background:`none`,border:`none`,color:`var(--text-dim)`,cursor:`pointer`,transform:e?`rotate(-90deg)`:`none`,transition:`transform 0.15s`},children:(0,F.jsx)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,F.jsx)(`polyline`,{points:`2 3.5 5 6.5 8 3.5`})})})})})}function Fde({session:e,title:t,onConfirm:n,onCancel:r}){let{t:i}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,F.jsx)(`div`,{style:{fontSize:`var(--text-base)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t}),(0,F.jsxs)(`div`,{style:{marginTop:2,display:`flex`,alignItems:`center`,gap:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.error?(0,F.jsx)(J9,{session:e}):(0,F.jsx)(`span`,{title:e.modified,children:G9(e.modified,i)}),(0,F.jsx)(`span`,{children:i(`sidebar.messagesCount`,{count:e.messageCount})})]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:5,flexShrink:0},children:[(0,F.jsxs)(`button`,{onClick:n,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,height:30,padding:`0 11px`,background:`var(--status-error)`,border:`none`,borderRadius:6,color:`var(--on-error)`,cursor:`pointer`,fontSize:`var(--text-base)`,fontWeight:600,whiteSpace:`nowrap`},children:[(0,F.jsx)(jr,{size:R.base}),i(`sidebar.delete`)]}),(0,F.jsx)(`button`,{onClick:r,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:30,padding:`0 11px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:6,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-base)`,fontWeight:500,whiteSpace:`nowrap`},children:i(`sidebar.cancel`)})]})]})})}function Ide({session:e,title:t,isSelected:n,isSeen:r,isRunning:i,isUnread:a,phase:o,elapsed:s,totalElapsed:c}){let{t:l}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,minWidth:0,fontSize:`var(--text-base)`,fontWeight:n?600:400,lineHeight:1.4,color:r?`var(--text)`:`var(--text-dim)`},title:t,children:(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},children:t})}),(0,F.jsxs)(`div`,{style:{marginTop:2,display:`flex`,alignItems:`center`,gap:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.error?(0,F.jsx)(J9,{session:e}):i?(0,F.jsx)(o9,{phase:o??{kind:`running_command`},elapsed:s,totalElapsed:c}):a?(0,F.jsx)(ude,{}):(0,F.jsx)(`span`,{title:e.modified,children:G9(e.modified,l)}),!e.error&&i?null:(0,F.jsx)(`span`,{children:l(`sidebar.messagesCount`,{count:e.messageCount})}),e.worktreeBranch&&(0,F.jsxs)(`span`,{title:`Worktree: ${e.cwd}`,style:{display:`flex`,alignItems:`center`,gap:3,color:`var(--accent)`,minWidth:0,overflow:`hidden`},children:[(0,F.jsxs)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.worktreeBranch})]})]})]})})}function Lde({session:e,isSelected:t,isRunning:n,phase:r,phaseSince:i,busySince:a,isUnread:o,isSeen:s=!0,hasInteractionBadge:c=!1,onClick:l,onRenamed:u,onDeleted:f,onUnseen:p,depth:m=0,hasChildren:h=!1,collapsed:g=!1,onToggleCollapse:_}){let{t:v}=I(),y=yZ(!!(n&&r),i),b=yZ(!!n,a),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(!1),[T,E]=(0,d.useState)(``),[D,O]=(0,d.useState)(!1),[k,A]=(0,d.useState)(!1),j=(0,d.useRef)(null),M=jde(e),N=(0,d.useCallback)(t=>{t.stopPropagation(),E(e.name??``),w(!0),setTimeout(()=>j.current?.select(),0)},[e.name]),ee=(0,d.useCallback)(async()=>{let t=T.trim();if(w(!1),t!==(e.name??``))try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:t})}),u?.()}catch{}},[T,e.id,e.name,u]),te=(0,d.useCallback)(async()=>{O(!1),A(!0);try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`}),f?.(e.id)}catch{A(!1)}},[e.id,f]),P=(0,d.useCallback)(e=>{e.stopPropagation(),e.shiftKey?te():O(!0)},[te]),ne=(0,d.useCallback)(e=>{e.stopPropagation(),te()},[te]),re=(0,d.useCallback)(e=>{e.stopPropagation(),O(!1)},[]),ie=(0,d.useCallback)(e=>{e.key===`Enter`&&ee(),e.key===`Escape`&&w(!1)},[ee]);return(0,F.jsx)(`div`,{"data-testid":`session-item`,"data-session-id":e.id,onClick:D||C?void 0:l,title:c?v(`sidebar.interactionBadge`):void 0,onMouseEnter:()=>S(!0),onMouseLeave:()=>{S(!1)},style:Mde({hasInteractionBadge:c,depth:m,confirmDelete:D,renaming:C,hovered:x,deleting:k}),className:t&&!D?`row-selected-gradient`:void 0,children:(0,F.jsx)(Rde,{session:e,title:M,inputRef:j,isSelected:t,isSeen:s,isUnread:o,isRunning:n,phase:r,elapsed:y,totalElapsed:b,depth:m,hasChildren:h,collapsed:g,onToggleCollapse:_,hovered:x,confirmDelete:D,renaming:C,renameValue:T,onRenameChange:E,commitRename:ee,handleRenameKeyDown:ie,handleDeleteClick:P,handleDeleteConfirm:ne,handleDeleteCancel:re,startRename:N,onUnseen:p})})}function Rde({session:e,title:t,inputRef:n,isSelected:r,isSeen:i,isUnread:a,isRunning:o,phase:s,elapsed:c,totalElapsed:l,depth:u,hasChildren:d,collapsed:f,onToggleCollapse:p,hovered:m,confirmDelete:h,renaming:g,renameValue:_,onRenameChange:v,commitRename:y,handleRenameKeyDown:b,handleDeleteClick:x,handleDeleteConfirm:S,handleDeleteCancel:C,startRename:w,onUnseen:T}){return h?(0,F.jsx)(Fde,{session:e,title:t,onConfirm:S,onCancel:C}):g?(0,F.jsx)(`input`,{ref:n,"data-testid":`session-rename-input`,value:_,onChange:e=>v(e.target.value),onBlur:y,onKeyDown:b,autoFocus:!0,style:{flex:1,fontSize:`var(--text-base)`,padding:`5px 8px`,border:`1px solid var(--accent)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,height:30}}):(0,F.jsxs)(F.Fragment,{children:[u>0&&(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-dim)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(Ide,{session:e,title:t,isSelected:r,isSeen:i,isRunning:o,isUnread:a,phase:s,elapsed:c,totalElapsed:l}),d&&(0,F.jsx)(Pde,{collapsed:f,onToggleCollapse:p}),(0,F.jsx)(Nde,{session:e,hovered:m,isSeen:i,onUnseen:T,startRename:w,handleDeleteClick:x})]})}function Z9({node:e,selectedSessionId:t,runningSessionIds:n,runningPhases:r,runningPhaseSince:i,runningBusySince:a,unreadSessionIds:o,seenSessionIds:s,interactionBadges:c,onSelectSession:l,onRenamed:u,onSessionDeleted:f,onUnseen:p,depth:m}){let[h,g]=(0,d.useState)(!1),_=e.children.length>0;return(0,F.jsxs)(`div`,{style:{paddingBottom:1,backgroundImage:`linear-gradient(90deg, transparent, var(--border), transparent)`,backgroundPosition:`0 100%`,backgroundSize:`100% 1px`,backgroundRepeat:`no-repeat`},children:[(0,F.jsxs)(`div`,{style:{position:`relative`},children:[m>0&&(0,F.jsx)(`div`,{style:{position:`absolute`,left:m*12+6,top:0,bottom:0,width:1,background:`var(--border)`,pointerEvents:`none`}}),(0,F.jsx)(Lde,{session:e.session,isSelected:e.session.id===t,isRunning:n.has(e.session.id),phase:r[e.session.id],phaseSince:i[e.session.id],busySince:a[e.session.id],isUnread:o.has(e.session.id),isSeen:s.has(e.session.id),hasInteractionBadge:c.has(e.session.id),onClick:()=>l(e.session),onRenamed:u,onDeleted:e=>f?.(e),onUnseen:p,depth:m,hasChildren:_,collapsed:h,onToggleCollapse:()=>g(e=>!e)})]}),_&&!h&&(0,F.jsx)(`div`,{children:e.children.map(e=>(0,F.jsx)(Z9,{node:e,selectedSessionId:t,runningSessionIds:n,runningPhases:r,runningPhaseSince:i,runningBusySince:a,unreadSessionIds:o,seenSessionIds:s,interactionBadges:c,onSelectSession:l,onRenamed:u,onSessionDeleted:f,onUnseen:p,depth:m+1},e.session.id))})]})}function zde(e){let t=new Map;for(let n of e)t.set(n.id,{session:n,children:[]});let n=new Map;for(let t of e)t.parentSessionId&&n.set(t.id,t.parentSessionId);function r(e){let r=n.get(e),i=new Set;for(;r;){if(i.has(r))return null;if(i.add(r),t.has(r))return r;r=n.get(r)}return null}let i=[];for(let e of t.values()){let n=r(e.session.id);n?t.get(n).children.push(e):i.push(e)}let a=e=>{e.sort((e,t)=>t.session.modified.localeCompare(e.session.modified)),e.forEach(e=>a(e.children))};return a(i),i}function Bde({visibleGroups:e,selectedSessionId:t,selectedProject:n,wsQuery:r,groupCollapsed:i,hoveredGroup:a,confirmDeleteGroup:o,deletingGroup:s,runningSessionIds:c,runningPhases:l,runningPhaseSince:u,runningBusySince:d,unreadSessionIds:f,seenSessionIds:p,interactionBadges:m,setHoveredGroup:h,setGroupCollapsed:g,setConfirmDeleteGroup:_,handleDeleteGroup:v,handleNewSession:y,copyText:b,handleSelectSessionFromList:x,onSessionDeleted:S,handleUnseen:C,loadSessions:w}){let{t:T}=I();return(0,F.jsx)(F.Fragment,{children:e.map(e=>{let E=e.sessions.some(e=>e.id===t)||e.root===n;return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(Ade,{group:e,groupSelected:E,hoveredGroup:a,confirmDeleteGroup:o,deletingGroup:s,runningSessionIds:c,interactionBadges:m,collapsed:!!i[e.root],setHoveredGroup:h,setGroupCollapsed:g,setConfirmDeleteGroup:_,handleDeleteGroup:v,handleNewSession:y,copyText:b}),(r||!i[e.root])&&(e.sessions.length===0?(0,F.jsx)(`div`,{style:{padding:`10px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`},children:T(`sidebar.noSessions`)}):zde(e.sessions).map(e=>(0,F.jsx)(Z9,{node:e,selectedSessionId:t,runningSessionIds:c,runningPhases:l,runningPhaseSince:u,runningBusySince:d,unreadSessionIds:f,seenSessionIds:p,interactionBadges:m,onSelectSession:x,onRenamed:()=>w(!1,!0),onSessionDeleted:e=>{S?.(e),w(!1,!0)},onUnseen:C,depth:0},e.session.id)))]},e.root)})})}function Vde({loading:e,error:t,noSearchResults:n}){let{t:r}=I();return e?(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`16px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`div`,{style:{width:14,height:14,border:`2px solid var(--border)`,borderTopColor:`var(--text-dim)`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`,flexShrink:0}}),r(`sidebar.loading`)]}):t?(0,F.jsx)(`div`,{style:{padding:`12px 14px`,color:`var(--status-error)`,fontSize:`var(--text-base)`},children:t}):n?(0,F.jsx)(`div`,{style:{padding:`16px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:r(`sidebar.searchSessionsNoResults`)}):null}function Hde({searchOpen:e,onToggleSearch:t,onNewWorkspace:n,onRefresh:r,refreshDone:i}){let{t:a}=I();return(0,F.jsx)(tJ,{items:[{key:`search`,testId:`workspace-search-toggle`,onClick:t,title:a(`sidebar.searchSessions`),ariaPressed:e,color:e?`var(--accent)`:`var(--text-muted)`,background:e?`var(--bg-selected)`:void 0,icon:(0,F.jsx)(Sr,{size:R.lg})},{key:`new-workspace`,testId:`new-workspace`,onClick:n,title:a(`sidebar.newWorkspace`),color:`var(--text-muted)`,icon:(0,F.jsx)(er,{size:R.xl})},{key:`refresh`,testId:`session-refresh`,onClick:r,title:a(`sidebar.refresh`),skipHover:i,color:i?`var(--status-success)`:`var(--text-muted)`,background:i?`color-mix(in srgb, var(--status-success) 18%, transparent)`:void 0,icon:i?(0,F.jsx)(zn,{size:R.xl,color:`var(--status-success)`,strokeWidth:2.5}):(0,F.jsx)(vr,{size:R.xl})}]})}function Ude({value:e,onChange:t,onClear:n,inputRef:r}){let{t:i}=I();return(0,F.jsxs)(`div`,{"data-testid":`workspace-search`,style:{display:`flex`,alignItems:`center`,gap:4,width:`100%`,minWidth:0,padding:`4px 8px`,background:`var(--bg)`,borderBottom:`1px solid var(--border)`,boxSizing:`border-box`},children:[(0,F.jsx)(Sr,{size:R.lg,color:`var(--text-muted)`,style:{flexShrink:0}}),(0,F.jsx)(`input`,{ref:r,value:e,onChange:e=>t(e.target.value),placeholder:i(`sidebar.searchSessionsPlaceholder`),"aria-label":i(`sidebar.searchSessions`),style:{flex:1,minWidth:0,background:`transparent`,border:`none`,outline:`none`,color:`var(--text)`,fontSize:`var(--text-sm)`}}),e&&(0,F.jsx)(`button`,{type:`button`,onClick:n,"aria-label":i(`chat.clearSearch`),style:{border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0,padding:0},children:`✕`})]})}function Wde({wtNewOpen:e,setWtNewOpen:t,wtNewBranch:n,setWtNewBranch:r,wtNewInputRef:i,handleCreateWorktree:a,wtBusy:o,setWtError:s}){let{t:c}=I();return(0,F.jsx)(F.Fragment,{children:e?(0,F.jsxs)(`div`,{style:{padding:`6px 8px`},children:[(0,F.jsx)(`input`,{ref:i,"data-testid":`worktree-new-branch-input`,value:n,onChange:e=>{r(e.target.value),s(null)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),a()),e.key===`Escape`&&(t(!1),r(``),s(null))},placeholder:c(`sidebar.branchName`),style:{width:`100%`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,padding:`5px 8px`,border:`1px solid var(--accent)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,boxSizing:`border-box`}}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:5,marginTop:5},children:[(0,F.jsx)(`button`,{"data-testid":`worktree-create`,onClick:()=>void a(),disabled:o||!n.trim(),style:{flex:1,padding:`4px 0`,background:`var(--accent)`,border:`none`,borderRadius:5,color:`var(--on-accent)`,fontSize:`var(--text-sm)`,fontWeight:600,cursor:o||!n.trim()?`not-allowed`:`pointer`,opacity:o||!n.trim()?.65:1},children:c(o?`sidebar.creating`:`sidebar.create`)}),(0,F.jsx)(`button`,{onClick:()=>{t(!1),r(``),s(null)},style:{flex:1,padding:`4px 0`,background:`var(--bg-hover)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:c(`sidebar.cancel`)})]})]}):(0,F.jsxs)(`button`,{"data-testid":`worktree-new`,onClick:e=>{e.stopPropagation(),t(!0),s(null),setTimeout(()=>i.current?.focus(),0)},title:c(`sidebar.createWorktreeTitle`),style:{display:`flex`,alignItems:`center`,gap:7,width:`100%`,padding:`8px 10px`,background:`none`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-sm)`},children:[(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.1`,strokeLinecap:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`5`,y1:`1`,x2:`5`,y2:`9`}),(0,F.jsx)(`line`,{x1:`1`,y1:`5`,x2:`9`,y2:`5`})]}),(0,F.jsx)(`span`,{children:c(`sidebar.newWorktree`)})]})})}function Gde({worktrees:e,visibleWorktrees:t,selectedCwd:n,homeDir:r,wtConfirmRemove:i,setWtConfirmRemove:a,handleRemoveWorktree:o,wtBusy:s,setSelectedCwd:c,closeWorktrees:l,showWtFilter:u,wtFilter:d}){let{t:f}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{maxHeight:`min(40vh, 300px)`,overflowY:`auto`},children:[t.map(t=>{let u=W9(t.path,n)||t.isMain&&!e.some(e=>W9(e.path,n));return i===t.path?(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`7px 10px`,borderBottom:`1px solid var(--border)`,background:`color-mix(in srgb, var(--status-error) 6%, transparent)`},children:[(0,F.jsx)(`span`,{style:{flex:1,fontSize:`var(--text-sm)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:f(`sidebar.forceRemoveCheckout`)}),(0,F.jsx)(`button`,{"data-testid":`worktree-force-remove`,onClick:()=>void o(t.path,!0),disabled:s,style:{padding:`3px 9px`,background:`var(--status-error)`,border:`none`,borderRadius:5,color:`var(--on-error)`,fontSize:`var(--text-sm)`,fontWeight:600,cursor:`pointer`,flexShrink:0},children:f(`sidebar.force`)}),(0,F.jsx)(`button`,{onClick:()=>a(null),style:{padding:`3px 9px`,background:`var(--bg-hover)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`,flexShrink:0},children:f(`sidebar.cancel`)})]},t.path):(0,F.jsxs)(`div`,{className:`wt-row`,"data-testid":`worktree-row`,style:{display:`flex`,alignItems:`center`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsxs)(`button`,{"data-testid":`worktree-item`,onClick:()=>{c(t.path),l()},title:t.path,style:{flex:1,minWidth:0,display:`flex`,alignItems:`center`,gap:7,padding:`8px 10px`,background:`var(--bg)`,border:`none`,color:u?`var(--text)`:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`},children:[u?(0,F.jsx)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:(0,F.jsx)(`polyline`,{points:`1.5 5 4 7.5 8.5 2.5`})}):(0,F.jsx)(`span`,{style:{width:10,flexShrink:0}}),(0,F.jsx)(q9,{text:t.branch??K9(t.path,r),style:{flex:1}}),t.isMain&&(0,F.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:f(`sidebar.main`)})]}),!t.isMain&&(0,F.jsx)(`button`,{"data-testid":`worktree-remove`,onClick:()=>void o(t.path,!1),disabled:s,title:f(`sidebar.removeWorktreeTitle`,{path:t.path}),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:34,height:28,padding:0,marginRight:4,background:`none`,border:`none`,color:`var(--text-dim)`,cursor:`pointer`,borderRadius:5,flexShrink:0,transition:`color 0.12s, background 0.12s`,"--hover-color":`var(--status-error)`,"--hover-bg":`color-mix(in srgb, var(--status-error) 8%, transparent)`},className:`hover-shift`,children:(0,F.jsxs)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,F.jsx)(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),(0,F.jsx)(`path`,{d:`M10 11v6M14 11v6`}),(0,F.jsx)(`path`,{d:`M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2`})]})})]},t.path)}),u&&t.length===0&&d.trim()&&(0,F.jsx)(`div`,{style:{padding:`8px 10px`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:f(`sidebar.noMatchingWorktrees`)})]})})}function Kde({wt:e,selectedCwd:t,homeDir:n,setSelectedCwd:r}){let{t:i}=I(),{worktreeState:a,wtFilter:o,setWtFilter:s,wtDropdownOpen:c,setWtDropdownOpen:l,wtDropdownRef:u,closeWorktrees:d,handleRemoveWorktree:f,wtConfirmRemove:p,setWtConfirmRemove:m,wtBusy:h,wtNewOpen:g,setWtNewOpen:_,wtNewBranch:v,setWtNewBranch:y,wtNewInputRef:b,handleCreateWorktree:x,wtError:S,setWtError:C}=e;if(!a)return null;let w=a.worktrees.find(e=>W9(e.path,t))??a.worktrees.find(e=>e.isMain),T=a.worktrees.length>=8,E=T&&o.trim()?a.worktrees.filter(e=>(e.branch??K9(e.path,n)).toLowerCase().includes(o.trim().toLowerCase())):a.worktrees;return(0,F.jsxs)(`div`,{ref:u,"data-testid":`worktree-switcher`,style:{position:`relative`,marginTop:6},children:[(0,F.jsxs)(`button`,{"data-testid":`worktree-switcher-trigger`,onClick:()=>l(e=>!e),title:w?i(`sidebar.switchWorktreeTitle`,{path:w.path}):i(`sidebar.switchWorktree`),style:{width:`100%`,height:29,boxSizing:`border-box`,display:`flex`,alignItems:`center`,gap:6,padding:`0 10px`,background:`var(--bg-input)`,border:`1px solid var(--border)`,borderRadius:7,cursor:`pointer`,fontSize:`var(--text-sm)`,lineHeight:1.35,color:`var(--text-muted)`,textAlign:`left`},children:[(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0,color:w&&!w.isMain?`var(--accent)`:`var(--text-dim)`},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(q9,{text:w?w.branch??K9(w.path,n):`…`,style:{flex:1,fontFamily:`var(--font-mono)`,color:`var(--text)`}}),w?.isMain&&(0,F.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:i(`sidebar.main`)}),a.worktrees.length>1&&(0,F.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:a.worktrees.length}),(0,F.jsx)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:(0,F.jsx)(`polyline`,{points:`2 3.5 5 6.5 8 3.5`})})]}),(0,F.jsxs)(_de,{open:c,style:{position:`absolute`,top:`calc(100% + 4px)`,left:0,right:0,zIndex:100,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:8,boxShadow:`0 6px 20px var(--shadow-color)`,overflow:`hidden`},children:[T&&(0,F.jsx)(`div`,{style:{padding:`6px 8px`,borderBottom:`1px solid var(--border)`},children:(0,F.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(s(``),d())},placeholder:i(`sidebar.filterWorktrees`),autoFocus:!0,style:{width:`100%`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,padding:`5px 8px`,border:`1px solid var(--border)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,boxSizing:`border-box`}})}),(0,F.jsx)(Gde,{worktrees:a.worktrees,visibleWorktrees:E,selectedCwd:t,homeDir:n,wtConfirmRemove:p,setWtConfirmRemove:m,handleRemoveWorktree:f,wtBusy:h,setSelectedCwd:r,closeWorktrees:d,showWtFilter:T,wtFilter:o}),(0,F.jsx)(Wde,{wtNewOpen:g,setWtNewOpen:_,wtNewBranch:v,setWtNewBranch:y,wtNewInputRef:b,handleCreateWorktree:x,wtBusy:h,setWtError:C}),S&&(0,F.jsx)(`div`,{style:{padding:`5px 10px 8px`,color:`var(--status-error)`,fontSize:`var(--text-sm)`,lineHeight:1.35,overflowWrap:`anywhere`},children:S})]})]})}function qde({sb:e,handleSelectSessionFromList:t,handleNewSession:n,onSessionDeleted:r}){let{t:i}=I(),{customPath:a,wt:o,selectedCwd:s,setSelectedCwd:c,homeDir:l,workspaceSearchOpen:u,setWorkspaceSearchOpen:d,workspaceSearchQuery:f,setWorkspaceSearchQuery:p,workspaceSearchInputRef:m,loadSessions:h,sessionRefreshDone:g,showWorktreeSwitcher:_,inactiveWorktreeSelector:v,loading:y,error:b,wsQuery:x,visibleGroups:S}=e;return(0,F.jsxs)(F.Fragment,{children:[a.customPathOpen&&(0,F.jsx)(Ede,{busy:a.customPathValidating,error:a.customPathError,onCancel:()=>{a.setCustomPathOpen(!1),a.setCustomPathError(null)},onSelect:e=>void a.commitCustomPath(e)}),(0,F.jsxs)(cJ,{title:i(`sidebar.workspace`),open:!0,onToggle:()=>{},collapsible:!1,testId:`workspace-scroll`,hintTestId:`workspace`,scrollStyle:{flex:`1 1 auto`,minHeight:80,background:`var(--bg)`},style:{flex:1,minHeight:0},actions:(0,F.jsx)(Hde,{searchOpen:u,onToggleSearch:()=>{u&&p(``),d(e=>!e)},onNewWorkspace:()=>a.setCustomPathOpen(!0),onRefresh:()=>h(!1,!0),refreshDone:g}),headerExtra:(0,F.jsxs)(F.Fragment,{children:[u&&(0,F.jsx)(Ude,{value:f,onChange:p,onClear:()=>{p(``),m.current?.focus()},inputRef:m}),_&&(0,F.jsx)(Kde,{wt:o,selectedCwd:s,homeDir:l,setSelectedCwd:c}),v&&(0,F.jsx)(Dde,{title:v.title,label:v.label})]}),children:[(0,F.jsx)(Vde,{loading:y,error:b,noSearchResults:!y&&!b&&!!x&&S.length===0}),(0,F.jsx)(Bde,{visibleGroups:S,selectedSessionId:e.selectedSessionId,selectedProject:e.selectedProject,wsQuery:x,groupCollapsed:e.groupCollapsed,hoveredGroup:e.hoveredGroup,confirmDeleteGroup:e.confirmDeleteGroup,deletingGroup:e.deletingGroup,runningSessionIds:e.runningSessionIds,runningPhases:e.runningPhases,runningPhaseSince:e.runningPhaseSince,runningBusySince:e.runningBusySince,unreadSessionIds:e.unreadSessionIds,seenSessionIds:e.seenSessionIds,interactionBadges:e.interactionBadges,setHoveredGroup:e.setHoveredGroup,setGroupCollapsed:e.setGroupCollapsed,setConfirmDeleteGroup:e.setConfirmDeleteGroup,handleDeleteGroup:e.handleDeleteGroup,handleNewSession:n,copyText:gK,handleSelectSessionFromList:t,onSessionDeleted:r,handleUnseen:e.handleUnseen,loadSessions:h})]})]})}function Jde({selectedSessionId:e,selectedSession:t,onSelectSession:n,onNewSession:r,initialSessionId:i,skipInitialProjectSelection:a,onInitialRestoreDone:o,refreshKey:s,onSessionDeleted:c,onUnseenSession:l,selectedCwd:u,onCwdChange:f,savedWorkspaces:p,onSavedWorkspacesChange:m,onOpenFile:h}){let{t:g}=I(),_=Sde({selectedSession:t,selectedSessionId:e,refreshKey:s,selectedCwdProp:u,savedWorkspaces:p,onSavedWorkspacesChange:m,onUnseenSession:l,onCwdChange:f,initialSessionId:i,skipInitialProjectSelection:a,onSelectSession:n,onInitialRestoreDone:o,onSessionDeleted:c}),{setError:v,loadSessions:y,markSeen:b,setSelectedCwd:x}=_,S=(0,d.useCallback)(async e=>{try{if((await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`HEAD`})).status===404){v(g(`sidebar.sessionDeleted`)),y(!1,!0);return}}catch{}e.cwd&&x(e.cwd),b(e.id),n(e)},[n,g,y,b,v,x]),C=(0,d.useCallback)(e=>{let t=e??_.selectedCwd;if(!t)return;let n=typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;r?.(n,t)},[_.selectedCwd,r]);return(0,F.jsx)(`div`,{"data-testid":`session-sidebar`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:(0,F.jsx)(qde,{sb:_,handleSelectSessionFromList:S,handleNewSession:C,onSessionDeleted:e=>{c?.(e),_.loadSessions(!1,!0)}})})}var Yde=e=>window.history.replaceState(null,``,e);function Xde(e){return e?`Pi Web · ${e}`:`Pi Web`}function Zde(e,t){return e&&!t}function Qde(e,t,n){return e?t:n}function $de(e,t){return!!(e&&t?.requiresTrust&&!t.trusted)}function efe(e,t){return e>0&&!t}function tfe(e,t){return!!(e&&t)}function nfe(e,t,n,r){t&&n(!1),r(t=>t===e?null:e)}function rfe(e,t,n){e&&t(),n(e=>!e)}function ife(e,t,n){e&&!t&&n(!1)}function afe(e,t,n){e?t(e=>!e):n(e=>!e)}function ofe(e){return e?fS(e)||e:null}function Q9(e){return e?.id??null}function sfe(e,t){return e?.cwd??t}function $9(e){return e?MK(e.filePath):`file:`}function cfe(){let[e,t]=(0,d.useState)(!1);(0,d.useEffect)(()=>{t(!0)},[]);let[n]=(0,d.useState)(()=>tq(new URLSearchParams(window.location.search))),{isDark:r,toggleTheme:i}=WK(),{locale:a,setLocale:o,t:s,supportedLocales:c}=I(),l=Ge();XK();let{settingsValue:u,defaultThinkingLevel:f,setDefaultThinkingLevel:p,compaction:m,retry:h,defaultProjectTrust:g,setDefaultProjectTrust:_,subagents:v,savedWorkspaces:y,handleSavedWorkspacesChange:b,widgetGeometries:x,setWidgetGeometry:S,widgetMessages:C,addWidgetMessage:w,removeWidgetMessage:T,updateWidgetMessage:E,fontScale:D,setFontScale:O}=en({isDark:r,toggleTheme:i}),[k,A]=(0,d.useState)(null),{selectedSession:j,effectiveNewSessionCwd:M,showChat:N,projectTrustCwd:ee,refreshKey:te,sessionKey:P,explorerRefreshKey:ne,setExplorerRefreshKey:re,modelsRefreshKey:ie,setModelsRefreshKey:ae,activeCwd:oe,initialCwdStatus:se,initialCwdError:ce,initialSessionRestored:le,projectTrust:ue,projectTrustDialogOpen:de,setProjectTrustDialogOpen:fe,projectTrustBusy:pe,projectTrustError:me,setProjectTrustError:he,extensionDialogActiveRef:ge,handleSelectSession:_e,handleNewSession:ve,handleSessionCreated:ye,handleAgentEnd:be,handleSessionRenamed:xe,handleSessionForked:Se,handleSessionDeleted:we,handleSessionUnseen:Te,handleCwdChange:Ee,handleTrustProject:De,handleExplorerRefresh:Oe,handleInitialRestoreDone:ke}=Sn({initialNavigation:n,onProjectSwitch:()=>{A(null),Ae(e=>e.filter(e=>e.kind!==`file`)),je(null),Yde(`/`)},onSessionSelected:e=>ife(l,e,$e),onTopPanelReset:()=>A(null)}),{setSavedTabs:Ae,setActiveSavedId:je,configTabOpen:Me,configSection:Ne,setConfigSection:Pe,configTabActive:Fe,activeFileTab:Ie,fileTabs:Le,modelConfigFocus:Re,handleOpenFile:ze,openConfigTab:Be,handleOpenModelConfig:Ve,closeConfigTab:He,handleCloseMainTab:Ue}=zK({onSessionSelected:()=>{gt(!1),l&&$e(!1)},onRefreshModels:()=>ae(e=>e+1)}),{updatesBadge:We,updateItems:Ke,updatesBannerDismissed:qe,setUpdatesBannerDismissed:Xe}=Gue({activeCwd:oe,translate:s}),Ze=(0,d.useCallback)(e=>{ze(e,fS(e),{sourceSessionId:Q9(j)})},[ze,j]),[Qe,$e]=(0,d.useState)(!0),{sidebarResizer:et,widgetPanelResizer:tt,mobileSidebarReady:nt}=zue({isMobile:l,sidebarOpen:Qe,setSidebarOpen:$e,translate:s}),rt=(0,d.useRef)(null),it=(0,d.useRef)(null),at=(0,d.useRef)(null),ot=(0,d.useRef)(null),st=Fx(),ct=(0,d.useCallback)(()=>{st.schedule(()=>{A(null)},150)},[st]),lt=st.cancel,ut=Wue({activeTopPanel:k,isMobile:l,tabBarRef:rt,sidebarTopBarRef:it,languageBtnRef:at,fontScaleBtnRef:ot}),dt=(0,d.useCallback)(e=>nfe(e,l,$e,A),[l]),ft=(0,d.useCallback)(()=>rfe(l,()=>A(null),$e),[l]),{widgetPanelOpen:pt,setWidgetPanelOpen:mt,widgetsTabActive:ht,setWidgetsTabActive:gt,extensionWidgets:_t,closedWidgets:vt,handleCloseWidget:yt,handleReopenWidget:bt,handleExtensionWidgetsChange:xt,rightSidebarOpen:St,setRightSidebarOpen:Ct,closedWidgetCount:wt}=ZK({widgetGeometries:x,setWidgetGeometry:S}),Tt=Qde(l,pt,St),{chatInputRef:Et,handleAtMention:Dt,handleAtMentions:Ot,handleFileLineMention:kt}=Lue(),At=n.sessionId;Je({onNewSession:e=>ve(`kb-${Date.now()}`,e),activeCwd:oe});let jt=Zde(le,N),Mt=rq({translate:s,closedWidgetCount:wt,configTabOpen:Me,fileTabs:Le}),Nt=ofe(oe),Pt=Xde(Nt),Ft=Q9(j),It=sfe(j,M);(0,d.useEffect)(()=>{eq(Pt)},[Pt]),(0,d.useEffect)(()=>{let e=()=>{eq(Pt)};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Pt]);let Lt=Ye(),Rt=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(yJ,{topBarRef:it,notifyPermission:Lt,isDark:r,toggleTheme:i,updatesBadge:We,openConfigTab:Be,isMobile:l,setSidebarOpen:$e,activeTopPanel:k,setActiveTopPanel:A,cancelCloseTopPanel:lt,scheduleCloseTopPanel:ct,languageBtnRef:at,fontScaleBtnRef:ot}),efe(We,qe)&&(0,F.jsx)(Iue,{items:Ke,openConfigTab:Be,setConfigSection:Pe,onDismiss:()=>Xe(!0)}),(0,F.jsx)(Jde,{selectedSessionId:Ft,selectedSession:j,onSelectSession:_e,onNewSession:ve,initialSessionId:At,skipInitialProjectSelection:n.requestedCwd!==null,onInitialRestoreDone:ke,refreshKey:te,onSessionDeleted:we,onUnseenSession:Te,selectedCwd:It,onCwdChange:Ee,savedWorkspaces:y,onSavedWorkspacesChange:b,onOpenFile:ze})]});if(!e)return(0,F.jsx)(que,{});let zt=(0,F.jsx)(pJ,{sidebarOpen:Qe,onToggle:ft}),Bt=$de(N,ue)?(0,F.jsx)(xJ,{isMobile:l,onClick:()=>{he(null),fe(!0)}}):null,Vt=(0,F.jsx)(Kue,{panelOpen:Tt,highlighted:pt,onToggle:()=>{afe(l,mt,Ct)}});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(wn,{value:u,children:(0,F.jsx)(KK,{value:{activeTopPanel:k,toggleTopPanel:dt,closeTopPanel:()=>A(null)},children:(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(Xr,{delayDuration:0,children:[(0,F.jsx)($ue,{}),(0,F.jsxs)(Ce,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,width:`100%`,height:`var(--app-viewport-height, 100dvh)`,paddingLeft:`env(safe-area-inset-left)`,paddingRight:`env(safe-area-inset-right)`,overflow:`hidden`,background:`var(--bg)`},children:[(0,F.jsx)(dJ,{sidebarResizer:et,sidebarOpen:Qe,mobileSidebarReady:nt,setSidebarOpen:$e,sidebarContent:Rt,translate:s}),(0,F.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`,minWidth:0},children:[(0,F.jsx)(bJ,{activeTopPanel:k,setActiveTopPanel:A,topPanelPos:ut,cancelCloseTopPanel:lt,scheduleCloseTopPanel:ct,translate:s,locale:a,setLocale:o,supportedLocales:c,fontScale:D,setFontScale:O}),(0,F.jsxs)(hK,{tabs:Mt,activeTabId:iq({configTabActive:Fe,widgetsTabActive:ht,activeFileTab:Ie}),leftExtra:zt,rightExtra:Vt,onSelectTab:e=>{let t=aq(e);gt(t.widgetsTabActive),je(t.activeSavedId)},onCloseTab:Ue,tabBarRef:rt,overlay:(0,F.jsx)(nq,{initialCwdStatus:se,requestedCwd:n.requestedCwd,initialCwdError:ce,showPlaceholder:jt,activeCwd:oe,translate:s}),children:[(0,F.jsx)(pK,{id:AK,testId:`config-tab-pane`,children:(0,F.jsx)(Rle,{configSection:Ne,setConfigSection:Pe,projectTrustCwd:ee,sessionId:Ft,closeConfigTab:He,handleOpenFile:ze,sidebarResizer:et,widgetPanelResizer:tt,modelConfigFocus:Re,defaultThinkingLevel:f,setDefaultThinkingLevel:p,compaction:m,retry:h,defaultProjectTrust:g,setDefaultProjectTrust:_,subagents:v})}),(0,F.jsx)(pK,{id:$9(Ie),testId:`file-tab-pane`,children:(0,F.jsx)(Nue,{activeFileTab:Ie,activeCwd:oe,explorerRefreshKey:ne,setExplorerRefreshKey:re,handleFileLineMention:kt,handleOpenFile:ze})}),(0,F.jsx)(pK,{id:kK,keepAlive:!0,testId:`chat-tab-pane`,scroll:`hidden`,activeWhen:N,children:(0,F.jsx)(Lle,{sessionKey:P,selectedSession:j,effectiveNewSessionCwd:M,handleAgentEnd:be,handleSessionCreated:ye,handleSessionForked:Se,modelsRefreshKey:ie,handleOpenModelConfig:Ve,chatInputRef:Et,handleOpenLinkedFile:Ze,handleSessionRenamed:xe,activeCwdName:Nt,trustWarningElement:Bt,closedWidgets:vt,handleCloseWidget:yt,handleExtensionWidgetsChange:xt,extensionDialogActiveRef:ge})}),(0,F.jsx)(pK,{id:jK,keepAlive:!0,testId:`widgets-tab-pane`,zIndex:1,activeWhen:N,children:(0,F.jsx)(Fue,{widgetGeometries:x,widgetMessages:C,addWidgetMessage:w,removeWidgetMessage:T,updateWidgetMessage:E,extensionWidgets:_t,closedWidgets:vt,handleReopenWidget:bt})})]})]}),(0,F.jsx)(uJ,{isMobile:l,rightSidebarOpen:St,rightSidebarOpenEffective:Tt,widgetPanelResizer:tt,translate:s,cwd:It,sessionId:Ft,handleOpenFile:ze,explorerRefreshKey:ne,handleExplorerRefresh:Oe,handleAtMention:Dt,handleAtMentions:Ot,openConfigTab:Be})]}),tfe(de,ee)&&ee&&(0,F.jsx)(nde,{cwd:ee,busy:pe,error:me,onCancel:()=>{pe||fe(!1)},onConfirm:()=>void De()})]})]})})})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Jue,{}),(0,F.jsx)(tde,{})]})]})}var lfe=class extends d.Component{constructor(...e){super(...e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){DJ(e,`render error`)}render(){return this.state.hasError?(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,height:`100vh`,color:`var(--text)`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`span`,{children:`⚠️`}),(0,F.jsx)(`span`,{children:`Something went wrong while rendering.`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{this.setState({hasError:!1})},style:{border:`1px solid var(--border)`,background:`none`,color:`var(--text)`,borderRadius:6,padding:`4px 14px`,cursor:`pointer`},children:`Try again`})]}):this.props.children}};function ufe(){return(0,d.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let e=()=>{navigator.serviceWorker.register(`/sw.js?v=0.17.3`,{scope:`/`,updateViaCache:`none`}).catch(e=>{console.error(`Failed to register the Pi Web service worker:`,e)})};if(document.readyState===`complete`){e();return}return window.addEventListener(`load`,e,{once:!0}),()=>window.removeEventListener(`load`,e)},[]),null}var dfe=`piE2eFixtureDir`;function ffe(){return typeof window>`u`?null:new URL(window.location.href).searchParams.get(`piE2eFixtureDir`)}function pfe(){if(typeof document>`u`)return;let e=ffe();e&&(document.cookie=`${dfe}=${encodeURIComponent(e)}; path=/; SameSite=Lax`)}async function mfe(){pfe(),PJ(!0),LJ();let e=FJ(`boot`),t=null;try{let n=await tt.load();e(`preferences catalog loaded`,`locale=${n.firstPaint?.locale}`);let r=n.firstPaint?.locale;(r===`en`||r===`zh-CN`)&&(t=r,document.documentElement.lang=r===`zh-CN`?`zh-CN`:`en`);let i=n.theme;if(i===`dark`?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`),i)try{localStorage.setItem(`pi-theme`,i)}catch{}}catch{}e(`root render`),window.addEventListener(`unhandledrejection`,e=>{DJ(e.reason,`unhandled promise rejection`)}),window.addEventListener(`error`,e=>{let t=(e.error instanceof Error?e.error.message:``)||e.message||``;t.includes(`ResizeObserver loop`)||t.startsWith(`Script error`)||DJ(e.error??e.message,`uncaught error`)}),(0,f.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(d.StrictMode,{children:(0,F.jsx)(lfe,{children:(0,F.jsxs)(Be,{initialLocale:t,children:[(0,F.jsx)(cfe,{}),(0,F.jsx)(ufe,{})]})})}))}mfe();export{p4 as a,i as c,a3 as i,y8 as n,I as o,S8 as r,ve as s,P3 as t};
|
|
496
|
+
`)?r===`mermaid`?(0,F.jsx)(D5,{code:i.replace(/\n$/,``),defaultPreview:!0}):(0,F.jsx)(w5,{code:i.replace(/\n$/,``),lang:r}):(0,F.jsx)(`code`,{className:e,...n,children:t})},pre({children:e}){return(0,F.jsx)(F.Fragment,{children:e})},a({href:e,children:r,...i}){return delete i.node,(0,F.jsx)(aW,{href:e,markdownDir:t,onOpenFile:n,...i,children:r})},img({src:e,alt:n,...a}){delete a.node;let o=typeof e==`string`?rW(e,t,r??t):null,s=o?x9(o,`read`,i):e;return(0,F.jsx)(`img`,{src:s,alt:n??``,loading:`lazy`,...a})}},children:e})})}var M9=`file-find-hits`,N9=`file-find-current`,gue=1e4;function _ue(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){if(!(e.nodeValue??``).trim())return NodeFilter.FILTER_REJECT;let t=e.parentElement;return!t||t.closest(`.file-source-line, .file-diff-line`)&&!t.closest(`.file-source-line-content, .file-diff-line-content`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),r=n.nextNode();for(;r;)t.push(r),r=n.nextNode();return t}function vue(e){let t=_ue(e),n=[],r=[],i=0;for(let e of t)r.push(i),n.push(e.nodeValue??``),i+=e.nodeValue?.length??0;return{text:n.join(``),nodes:t,starts:r}}function P9(e,t){let n=0,r=e.starts.length-1;for(;n<r;){let i=n+r+1>>1;e.starts[i]<=t?n=i:r=i-1}return{node:e.nodes[n],offset:t-e.starts[n]}}function yue(e,t){let n=vue(e),r=n.text.toLowerCase(),i=t.toLowerCase(),a=[],o=r.indexOf(i);for(;o!==-1&&a.length<gue;){let e=document.createRange(),t=P9(n,o),s=P9(n,o+i.length);e.setStart(t.node,t.offset),e.setEnd(s.node,s.offset),a.push(e),o=r.indexOf(i,o+i.length)}return a}function bue({open:e,onClose:t,reindexKey:n,containerRef:r}){let{t:i}=I(),a=(0,d.useRef)(null),[o,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(0),[u,f]=(0,d.useState)(0),p=(0,d.useRef)([]);(0,d.useEffect)(()=>{e&&a.current?.focus()},[e]),(0,d.useEffect)(()=>{let t=r.current,n=o.trim();if(!e||!t||!n){CSS.highlights.delete(M9),CSS.highlights.delete(N9),p.current=[],l(0),f(0);return}let i=yue(t,n);return p.current=i,CSS.highlights.set(M9,new Highlight(...i)),l(i.length),f(e=>i.length?Math.min(e,i.length-1):0),()=>{CSS.highlights.delete(M9),CSS.highlights.delete(N9)}},[e,o,n,r]),(0,d.useEffect)(()=>{let e=p.current[u];if(!e){CSS.highlights.delete(N9);return}CSS.highlights.set(N9,new Highlight(e)),e.startContainer.parentElement?.scrollIntoView({block:`center`})},[u,c,n]);let m=e=>{c&&f(t=>(t+e+c)%c)};return e?(0,F.jsxs)(`div`,{className:`file-find-bar`,role:`search`,children:[(0,F.jsx)(`input`,{ref:a,className:`file-find-input`,type:`text`,value:o,placeholder:i(`files.find`),"aria-label":i(`files.find`),onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),m(e.shiftKey?-1:1)):e.key===`Escape`&&(e.preventDefault(),t())}}),(0,F.jsx)(`span`,{className:`file-find-count`,children:o.trim()?c>0?`${u+1}/${c}`:i(`files.findNoResults`):``}),(0,F.jsx)(`button`,{type:`button`,className:`file-find-btn`,"aria-label":i(`files.findPrev`),disabled:!c,onClick:()=>m(-1),children:(0,F.jsx)(Vn,{size:R.base})}),(0,F.jsx)(`button`,{type:`button`,className:`file-find-btn`,"aria-label":i(`files.findNext`),disabled:!c,onClick:()=>m(1),children:(0,F.jsx)(Bn,{size:R.base})}),(0,F.jsx)(`button`,{type:`button`,className:`file-find-btn`,"aria-label":i(`files.findClose`),onClick:t,children:(0,F.jsx)(Lr,{size:R.base})})]}):null}var xue=(0,d.lazy)(()=>p4(()=>import(`./CodeMirrorEditor-Ch5CyAol.js`),__vite__mapDeps([20,1])));function F9({enabled:e,reindexKey:t,className:n,style:r,children:i}){let a=(0,d.useRef)(null),[o,s]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{if(!e){s(!1);return}let t=e=>{if(!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()!==`f`)return;let t=e.target;t instanceof Element&&t.closest(`input, textarea, [contenteditable='true']`)||(e.preventDefault(),s(!0))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),(0,F.jsxs)(`div`,{style:{position:`relative`,height:`100%`,minWidth:0},children:[(0,F.jsx)(`div`,{ref:a,className:n,style:{...r,height:`100%`,overflow:`auto`,paddingBottom:e&&o?40:void 0},children:i}),e&&(0,F.jsx)(bue,{open:o,onClose:()=>s(!1),containerRef:a,reindexKey:t})]})}function Sue({editMode:e,draft:t,filePath:n,language:r,isDark:i,handleEditorChange:a,handleSave:o,highlightReady:s,wrapLines:c,content:l}){return(0,F.jsx)(F9,{enabled:!e,reindexKey:`${l}\u0000${s}\u0000${c}`,className:`file-viewer-source`,style:{display:`block`,background:`var(--bg)`},children:e?(0,F.jsx)(d.Suspense,{fallback:(0,F.jsx)(`div`,{style:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`var(--text-muted)`},children:(0,F.jsx)(ur,{size:R.lg,className:`animate-spin`,"aria-hidden":`true`})}),children:(0,F.jsx)(xue,{initialValue:t,language:r,isDark:i,onChange:a,onSave:o},n)}):s?(0,F.jsx)($8,{className:c?`file-source-view is-wrapped`:`file-source-view`,language:r===`text`?`plaintext`:r,style:i?C5:S5,showLineNumbers:!0,lineNumberStyle:{...w9},customStyle:{margin:0,padding:0,border:0,background:`var(--bg)`,...C9,width:c?`100%`:`max-content`,minWidth:`100%`,minHeight:`100%`,overflow:`visible`},codeTagProps:{style:{fontFamily:`var(--font-mono)`,overflowWrap:c?`anywhere`:`normal`}},renderer:e=>(0,F.jsx)(lue,{...e,wrapLines:c}),wrapLongLines:c,children:l}):(0,F.jsx)(`pre`,{className:c?`file-source-view is-wrapped`:`file-source-view`,style:{margin:0,padding:0,border:0,background:`var(--bg)`,...C9,fontFamily:`var(--font-mono)`,whiteSpace:c?`pre-wrap`:`pre`,overflowWrap:c?`anywhere`:`normal`,width:c?`100%`:`max-content`,minWidth:`100%`,minHeight:`100%`,overflow:`visible`},children:l})})}function Cue({hasGitDiff:e,gitDiffPatch:t,t:n}){return e?(0,F.jsx)(F9,{enabled:!0,reindexKey:t??``,children:(0,F.jsx)(mue,{patch:t})}):(0,F.jsx)(`div`,{style:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`var(--text-muted)`,fontSize:`var(--text-lg)`},children:n(`i18n.noChanges`)})}function wue({isHtml:e,isMarkdown:t,content:n,t:r,markdownPreview:i,markdownDirectory:a,onOpenFile:o,cwd:s,sourceSessionId:c}){return e?(0,F.jsx)(F9,{enabled:!1,reindexKey:``,children:(0,F.jsx)(`iframe`,{srcDoc:n,sandbox:`allow-scripts`,style:{width:`100%`,height:`100%`,border:`none`,background:`var(--bg)`},title:r(`i18n.htmlPreview`)})}):t?(0,F.jsx)(F9,{enabled:!0,reindexKey:i,children:(0,F.jsx)(hue,{preview:i,markdownDir:a,onOpenFile:o,cwd:s,sourceSessionId:c})}):null}function Tue({contentRef:e,filePath:t,effectiveDisplayMode:n,editMode:r,draft:i,language:a,isDark:o,handleEditorChange:s,handleSave:c,highlightReady:l,wrapLines:u,content:d,hasGitDiff:f,gitDiffPatch:p,t:m,isHtml:h,isMarkdown:g,markdownPreview:_,markdownDirectory:v,onOpenFile:y,cwd:b,sourceSessionId:x}){return(0,F.jsxs)(`div`,{ref:e,className:`file-viewer-content`,style:{flex:1,overflow:`auto`,paddingRight:4,background:`var(--bg)`},children:[n===`source`&&(0,F.jsx)(Sue,{editMode:r,draft:i,filePath:t,language:a,isDark:o,handleEditorChange:s,handleSave:c,highlightReady:l,wrapLines:u,content:d}),n===`diff`&&(0,F.jsx)(Cue,{hasGitDiff:f,gitDiffPatch:p,t:m}),n===`preview`&&(0,F.jsx)(wue,{isHtml:h,isMarkdown:g,content:d,t:m,markdownPreview:_,markdownDirectory:v,onOpenFile:y,cwd:b,sourceSessionId:x})]})}function Eue(e){return e?.language===`markdown`?RU(e.content):``}function Due({data:e,isDeletedDiff:t,displayMode:n,content:r,filePath:i,t:a}){let o=e?.language??`text`,s=o===`html`,c=o===`markdown`,l=s||c,u=pS(i),d=r.split(`
|
|
497
|
+
`);return{language:o,isHtml:s,isMarkdown:c,hasPreview:l,markdownDirectory:u,lines:d,effectiveDisplayMode:t?`diff`:n,displayModes:t?[`diff`]:[`source`,...l?[`preview`]:[],`diff`],metadata:t?a(`files.deleted`):`${o} · ${d.length} lines · ${S9(e?.size??0)}`}}function Oue({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){let{isDark:c}=WK(),{t:l}=I(),[u,f]=(0,d.useState)(`source`),[p,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(!1),{data:_,setData:v,loading:y,error:b,loadStatus:x,fetchContent:S}=iue({filePath:e,sourceSessionId:n,onFileChange:()=>{f(s===`diff`?`diff`:`source`),g(!1),ee(),re()}}),C=_?.content??``,{editMode:w,draft:T,dirty:E,saveState:D,saveError:O,editModeRef:k,enterEdit:A,cancelEdit:j,handleEditorChange:M,handleSave:N,resetEditState:ee}=fue({filePath:e,onSaved:a,content:C,applySavedContent:e=>v(t=>t&&{...t,content:e}),reload:()=>{S(e)}}),{gitDiff:te,gitDiffLoading:P,fetchGitDiff:ne,resetGitDiff:re}=aue({cwd:t,filePath:e,gitRefreshKey:o}),{watching:ie,closeWatch:ae}=E9(e,n,()=>{k.current||(S(e),ne(e))});(0,d.useEffect)(()=>{_?.language===`markdown`&&s!==`diff`&&f(`preview`)},[_?.language,s]);let oe=te?.supported===!0&&typeof te.patch==`string`,se=oe&&te.status===`deleted`;(0,d.useEffect)(()=>{se&&ae()},[se,ae]);let ce=(0,d.useMemo)(()=>Eue(_),[_]),{contentRef:le,selectedLineRange:ue,handleMentionSelectedLines:de}=uue({filePath:e,cwd:t,content:C,displayMode:u,onMentionLines:i});return(0,d.useEffect)(()=>{m(!1)},[C]),(0,d.useEffect)(()=>{if((se?`diff`:u)!==`source`||p)return;let e=setTimeout(()=>m(!0),0);return()=>clearTimeout(e)},[se,u,p]),(0,F.jsx)(kue,{filePath:e,cwd:t??void 0,sourceSessionId:n??void 0,onOpenFile:r,isDark:c,t:l,loading:y,error:b,loadStatus:x,displayMode:u,setDisplayMode:f,gitDiffLoading:P,data:_,watching:ie,isDeletedDiff:se,hasGitDiff:oe,wrapLines:h,setWrapLines:g,content:C,editMode:w,dirty:E,handleSave:N,saveState:D,saveError:O,enterEdit:A,cancelEdit:j,highlightReady:p,selectedLineRange:ue,handleMentionSelectedLines:de,draft:T,handleEditorChange:M,markdownPreview:ce,gitDiffPatch:oe?te.patch:null,contentRef:le})}function kue({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,isDark:i,t:a,loading:o,error:s,loadStatus:c,displayMode:l,setDisplayMode:u,gitDiffLoading:d,data:f,watching:p,isDeletedDiff:m,hasGitDiff:h,wrapLines:g,setWrapLines:_,content:v,editMode:y,dirty:b,handleSave:x,saveState:S,saveError:C,enterEdit:w,cancelEdit:T,highlightReady:E,selectedLineRange:D,handleMentionSelectedLines:O,draft:k,handleEditorChange:A,markdownPreview:j,gitDiffPatch:M,contentRef:N}){if(o||l===`diff`&&d)return(0,F.jsx)(Aue,{t:a});if(s&&!m)return(0,F.jsx)(jue,{loadStatus:c,error:s,filePath:e,sourceSessionId:n,cwd:t,t:a});if(!f&&!m)return null;let{language:ee,isHtml:te,isMarkdown:P,markdownDirectory:ne,effectiveDisplayMode:re,displayModes:ie,metadata:ae}=Due({data:f,isDeletedDiff:m,displayMode:l,content:v,filePath:e,t:a});return(0,F.jsxs)(`div`,{className:`file-viewer-shell`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,F.jsx)(rue,{filePath:e,cwd:t,metadata:ae,watching:p,isDeletedDiff:m,displayModes:ie,effectiveDisplayMode:re,setDisplayMode:u,wrapLines:g,setWrapLines:_,editMode:y,dirty:b,handleSave:x,saveState:S,saveError:C,enterEdit:w,cancelEdit:T,highlightReady:E,selectedLineRange:D,handleMentionSelectedLines:O,fileContent:v,sourceSessionId:n,t:a}),(0,F.jsx)(Tue,{contentRef:N,filePath:e,effectiveDisplayMode:re,editMode:y,draft:k,language:ee,isDark:i,handleEditorChange:A,handleSave:x,highlightReady:E,wrapLines:g,content:v,hasGitDiff:h,gitDiffPatch:M,t:a,isHtml:te,isMarkdown:P,markdownPreview:j,markdownDirectory:ne,onOpenFile:r,cwd:t??void 0,sourceSessionId:n})]})}function Aue({t:e}){return(0,F.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,color:`var(--text-muted)`,fontSize:`var(--text-lg)`},children:[(0,F.jsx)(ur,{size:R.lg,className:`animate-spin`,"aria-hidden":`true`}),e(`i18n.loading`)]})}function jue({loadStatus:e,error:t,filePath:n,sourceSessionId:r,cwd:i,t:a}){return(0,F.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24,color:`var(--status-error)`,fontSize:`var(--text-lg)`,textAlign:`center`},children:[(0,F.jsx)(`div`,{children:e===413?a(`files.fileTooLargeForPreview`,{limit:S9(zle)}):t}),e===413&&(0,F.jsx)(O9,{filePath:n,sourceSessionId:r,cwd:i})]})}function Mue({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){return Kle(e)?(0,F.jsx)(Xle,{filePath:e,cwd:t,sourceSessionId:n}):qle(e)?(0,F.jsx)(Zle,{filePath:e,cwd:t,sourceSessionId:n}):Jle(e)?(0,F.jsx)(Qle,{filePath:e,cwd:t,sourceSessionId:n}):(0,F.jsx)(Oue,{filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s})}function Nue({activeFileTab:e,activeCwd:t,explorerRefreshKey:n,setExplorerRefreshKey:r,handleFileLineMention:i,handleOpenFile:a}){return(0,F.jsx)(F.Fragment,{children:e&&(0,F.jsx)(Mue,{filePath:e.filePath,cwd:t??void 0,sourceSessionId:e.sourceSessionId,gitRefreshKey:n,initialDisplayMode:e.initialDisplayMode,onMentionLines:i,onSaved:()=>r(e=>e+1),onOpenFile:t=>a(t,fS(t),{sourceSessionId:e.sourceSessionId})})})}function Pue({geometries:e,messages:t,onAddMessage:n,onRemoveMessage:r,onUpdateMessage:i,widgets:a,closedKeys:o,onReopen:s}){let{t:c}=I(),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),m=(0,d.useRef)(null);(0,d.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]);let h=e=>a.find(t=>t.key===e)?.lines[0],g=(e,t,n)=>{s(e),p({key:e,x:t,y:n}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>p(null),2500)},_=[...new Set([...Object.keys(e),...o.keys()])].map(t=>[t,e[t]]);return(0,F.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,background:`var(--bg)`},children:[_.length===0?(0,F.jsx)(`div`,{style:{padding:`32px 16px`,textAlign:`center`,color:`var(--text-dim)`,fontSize:`var(--text-lg)`,lineHeight:1.6},children:c(`config.widgets.empty`)}):(0,F.jsx)(`div`,{style:{flex:1,minHeight:0,overflowY:`auto`,padding:10,display:`flex`,flexDirection:`row`,flexWrap:`wrap`,alignContent:`flex-start`,gap:6},children:_.map(([e,a])=>{let s=t[e]??[],d=o.has(e),f=h(e);return(0,F.jsxs)(`div`,{"data-testid":`widget-config-item-${e}`,style:{flex:`1 1 200px`,boxSizing:`border-box`,padding:`8px 10px`,borderRadius:5,background:`var(--bg-panel)`,border:`1px solid var(--border)`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:7,flexWrap:`wrap`},children:[(0,F.jsxs)(`div`,{style:{minWidth:0,flex:`1 1 120px`},children:[(0,F.jsx)(`div`,{style:{fontSize:`var(--text-base)`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),a&&(0,F.jsxs)(`div`,{style:{marginTop:2,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,color:`var(--text-dim)`},children:[c(`config.widgets.x`),`: `,a.x,` `,c(`config.widgets.y`),`: `,a.y,` ·`,` `,c(`config.widgets.width`),`: `,a.width,` `,c(`config.widgets.height`),`:`,` `,a.height]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[d&&(0,F.jsxs)(`button`,{type:`button`,"data-testid":`widget-expand-${e}`,"aria-label":c(`widgets.reopen`),title:c(`widgets.reopen`),onClick:t=>g(e,t.clientX,t.clientY),style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 8px`,borderRadius:5,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},className:`hover-shift`,children:[(0,F.jsx)(Zn,{size:13,"aria-hidden":!0}),c(`widgets.reopen`)]}),(0,F.jsxs)(`button`,{type:`button`,"data-testid":`widget-bind-${e}`,onClick:()=>u(e),style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 8px`,borderRadius:5,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:[(0,F.jsx)(cr,{size:13,"aria-hidden":!0}),c(`config.widgets.bind`)]})]})]}),f&&(0,F.jsx)(`div`,{style:{marginTop:4,fontSize:`var(--text-sm)`,color:`var(--text-muted)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:f}),(0,F.jsx)(CG,{messages:s,onAdd:t=>n(e,t),onRemove:t=>r(e,t),onUpdate:(t,n)=>i(e,t,n),bindOpen:l===e,onBindOpenChange:e=>{e||u(null)},ns:`widgets`,bindTestIdPrefix:`widget-bind`,editTestIdPrefix:`widget-edit`,chipTestIdPrefix:`widget-bound-${e}`,bindHintArgs:{key:e}})]},e)})}),f&&(0,F.jsx)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":`widget-expanded-toast`,style:{position:`fixed`,left:Math.min(f.x,window.innerWidth-180),top:f.y+12,transform:`translateX(-50%)`,zIndex:2e3,padding:`8px 12px`,borderRadius:7,border:`1px solid var(--status-success)`,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-base)`,boxShadow:`0 4px 16px var(--shadow-strong)`,whiteSpace:`nowrap`},children:c(`widgets.expandedToChat`,{key:f.key})})]})}function Fue({widgetGeometries:e,widgetMessages:t,addWidgetMessage:n,removeWidgetMessage:r,updateWidgetMessage:i,extensionWidgets:a,closedWidgets:o,handleReopenWidget:s}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(Pue,{geometries:e,messages:t,onAddMessage:n,onRemoveMessage:r,onUpdateMessage:i,widgets:a,closedKeys:o,onReopen:s})})}function Iue({items:e,openConfigTab:t,setConfigSection:n,onDismiss:r}){let{t:i}=I();return(0,F.jsxs)(`div`,{role:`status`,"data-testid":`update-banner`,style:{display:`flex`,alignItems:`center`,gap:8,padding:`6px 12px`,borderBottom:`1px solid var(--border)`,background:`color-mix(in srgb, var(--status-warning) 10%, var(--bg-panel))`,fontSize:`var(--text-sm)`,color:`var(--text)`,flexShrink:0},children:[(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:i(`updates.banner`,{items:e.join(`, `)})}),(0,F.jsx)(`button`,{type:`button`,"data-testid":`update-banner-view`,onClick:()=>{t(),n(`updates`)},style:{padding:`3px 10px`,border:`1px solid var(--border)`,borderRadius:6,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0},children:i(`updates.view`)}),(0,F.jsx)(`button`,{type:`button`,"aria-label":i(`i18n.close`),onClick:r,style:{padding:`2px 6px`,border:`none`,background:`none`,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0},children:`✕`})]})}function Lue(){let e=(0,d.useRef)(null);return{chatInputRef:e,handleAtMention:(0,d.useCallback)((t,n)=>{e.current?.insertText(IQ(t,n))},[]),handleAtMentions:(0,d.useCallback)(t=>{let n=RQ(t);n&&e.current?.insertText(n)},[]),handleFileLineMention:(0,d.useCallback)((t,n,r)=>{e.current?.insertText(LQ(t,n,r))},[])}}function Rue(e){try{let t=window.localStorage.getItem(e);if(t===null)return null;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:null}catch{return null}}function I9(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function L9(e){let{ariaLabel:t,cssVariable:n,defaultWidth:r,getDefaultWidth:i,getMaxWidth:a,growthDirection:o,maxWidth:s,minWidth:c,storageKey:l,widthRef:u}=e,f=(0,d.useRef)(null),p=(0,d.useRef)(null),m=(0,d.useRef)(!1),[h,g]=(0,d.useState)(r),[_,v]=(0,d.useState)(!1),y=(0,d.useCallback)(()=>Math.min(s,Math.max(c,a())),[a,s,c]),b=(0,d.useCallback)(e=>ci(e,c,y()),[y,c]),x=(0,d.useCallback)(e=>{u.current=e,f.current?.style.setProperty(n,`${e}px`)},[n,u]),S=(0,d.useCallback)((e,t={})=>{let{forcePersist:n=!1,persist:r=!0}=t,i=b(e),a=i!==u.current;return x(i),g(i),r&&(a||n)&&I9(l,i),i},[x,b,l,u]),C=(0,d.useCallback)(e=>{document.body.style.cursor=e.previousCursor,document.body.style.userSelect=e.previousUserSelect},[]),w=(0,d.useCallback)(e=>{let t=p.current;if(!(!t||t.pointerId!==e)){p.current=null,C(t),v(!1),S(u.current,{forcePersist:!0});try{t.target.hasPointerCapture(e)&&t.target.releasePointerCapture(e)}catch{}}},[S,C,u]),T=(0,d.useCallback)(e=>{if(e.pointerType===`mouse`&&e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=p.current;t&&w(t.pointerId);let n=e.currentTarget;n.focus({preventScroll:!0}),n.setPointerCapture(e.pointerId),p.current={pointerId:e.pointerId,startX:e.clientX,startWidth:u.current,target:n,previousCursor:document.body.style.cursor,previousUserSelect:document.body.style.userSelect},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,v(!0)},[w,u]),E=(0,d.useCallback)(e=>{let t=p.current;if(!t||t.pointerId!==e.pointerId)return;if(e.pointerType===`mouse`&&e.buttons===0){w(e.pointerId);return}e.preventDefault();let n=o===`right`?1:-1,r=b(t.startWidth+(e.clientX-t.startX)*n);x(r),e.currentTarget.setAttribute(`aria-valuenow`,String(r)),e.currentTarget.setAttribute(`aria-valuetext`,`${r} px`)},[x,b,w,o]),D=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),O=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),k=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),A=(0,d.useCallback)(()=>{let e=i?.()??r;S(e,{forcePersist:!0})},[S,r,i]),j=(0,d.useCallback)(()=>{S(u.current)},[S,u]),M=(0,d.useCallback)(e=>{let t=e.shiftKey?32:12,n=o===`right`?`ArrowRight`:`ArrowLeft`,r=o===`right`?`ArrowLeft`:`ArrowRight`;e.key===n?(e.preventDefault(),S(u.current+t,{forcePersist:!0})):e.key===r?(e.preventDefault(),S(u.current-t,{forcePersist:!0})):e.key===`Home`?(e.preventDefault(),S(c,{forcePersist:!0})):e.key===`End`?(e.preventDefault(),S(y(),{forcePersist:!0})):e.key===`Enter`&&(e.preventDefault(),A())},[S,y,o,c,A,u]);return(0,d.useEffect)(()=>{if(m.current)return;m.current=!0;let e=Rue(l),t=e??i?.()??r,n=S(t,{persist:!1});e!==null&&e!==n&&I9(l,n)},[S,r,i,l]),(0,d.useEffect)(()=>{if(!m.current)return;S(u.current);let e=()=>{S(u.current)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[S,u]),(0,d.useEffect)(()=>{if(!_)return;let e=()=>{let e=p.current;e&&w(e.pointerId)},t=()=>{document.visibilityState!==`visible`&&e()};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,t)}},[w,_]),(0,d.useEffect)(()=>()=>{let e=p.current;e&&(p.current=null,C(e))},[C]),{isResizing:_,panelRef:f,reclampWidth:j,resetWidth:A,setWidth:e=>S(e,{forcePersist:!0}),separatorProps:{"aria-label":t,"aria-orientation":`vertical`,"aria-valuemax":y(),"aria-valuemin":c,"aria-valuenow":h,"aria-valuetext":`${h} px`,onDoubleClick:A,onKeyDown:M,onLostPointerCapture:k,onPointerCancel:O,onPointerDown:T,onPointerMove:E,onPointerUp:D,role:`separator`,tabIndex:0},width:h}}function zue({isMobile:e,sidebarOpen:t,setSidebarOpen:n,translate:r}){let[i,a]=(0,d.useState)(!1),o=(0,d.useRef)(280),s=(0,d.useRef)(280),c=(0,d.useCallback)(()=>typeof window>`u`?480:li({viewportWidth:window.innerWidth,rightPanelOpen:!1,rightPanelWidth:0}),[]),l=L9({ariaLabel:r(`layout.resizeSidebar`),cssVariable:`--sidebar-width`,defaultWidth:280,getMaxWidth:c,growthDirection:`right`,maxWidth:480,minWidth:180,storageKey:`pi-sidebar-width`,widthRef:o}),u=l.reclampWidth,f=L9({ariaLabel:r(`layout.resizeWidgetPanel`),cssVariable:`--widget-panel-width`,defaultWidth:280,getMaxWidth:()=>typeof window>`u`?560:ui({viewportWidth:window.innerWidth,sidebarOpen:t,sidebarWidth:l.width}),growthDirection:`left`,maxWidth:560,minWidth:200,storageKey:`pi-widget-panel-width`,widthRef:s});return(0,d.useEffect)(()=>{e&&n(!1)},[e,n]),(0,d.useEffect)(()=>{a(!0)},[]),(0,d.useEffect)(()=>{u()},[u]),{sidebarResizer:l,widgetPanelResizer:f,mobileSidebarReady:i}}var Bue=176,Vue=224,Hue=86,Uue=116;function R9(e){let t=e.button.getBoundingClientRect(),n=e.row?.getBoundingClientRect(),r=n?.top??t.top,i=n?.bottom??t.bottom,a=Math.min(e.menuWidth,n?.width??e.tabRect.width),o=Math.min(t.left-1,Math.max(n?.left??e.tabRect.left,(n?.right??e.tabRect.right)-a)),s=i+4;return{top:s+e.estHeight>window.innerHeight-4?r-e.estHeight:s,left:o,width:a}}function Wue({activeTopPanel:e,isMobile:t,tabBarRef:n,sidebarTopBarRef:r,languageBtnRef:i,fontScaleBtnRef:a}){let[o,s]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!e)return;let o=()=>{if(document.hidden)return;let o=n.current?.getBoundingClientRect();if(o){if(e===`language`&&!t&&i.current){let e=R9({menuWidth:Bue,estHeight:Hue,button:i.current,row:r.current,tabRect:o});s(e);return}if(e===`fontSize`&&!t&&a.current){let e=R9({menuWidth:Vue,estHeight:Uue,button:a.current,row:r.current,tabRect:o});s(e);return}s({top:o.bottom,left:o.left,width:o.width})}};o();let c=new ResizeObserver(o);return n.current&&c.observe(n.current),i.current&&c.observe(i.current),a.current&&c.observe(a.current),()=>c.disconnect()},[e,t]),o}function Gue({activeCwd:e,translate:t}){let{value:n}=zr(ot),r=(0,d.useMemo)(()=>n?Kr(n):0,[n]),i=(0,d.useMemo)(()=>n?qr(n,t(`common.plugins`)):[],[n,t]),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(void 0);return(0,d.useEffect)(()=>{e!==s.current&&(s.current=e,at(e??null),ot.load().catch(e=>console.error(`[pi-web] load updates:`,e)))},[e]),{updatesBadge:r,updateItems:i,updatesBannerDismissed:a,setUpdatesBannerDismissed:o}}function Kue({panelOpen:e,highlighted:t,onToggle:n}){let{t:r}=I(),i=r(e?`sidebar.hide`:`sidebar.show`);return(0,F.jsx)(L,{label:i,children:(0,F.jsx)(`button`,{onClick:n,"aria-controls":`widget-panel`,"aria-expanded":e,"aria-label":i,"data-testid":`widget-panel-toggle`,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:36,height:36,padding:0,background:`none`,border:`none`,borderLeft:`1px solid var(--border)`,color:t?`var(--text)`:`var(--text-muted)`,cursor:`pointer`,flexShrink:0,transition:`color 0.12s`,"--hover-color":`var(--text)`},className:`hover-shift`,children:(0,F.jsxs)(`svg`,{width:R[`4xl`],height:R[`4xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`rect`,{x:`3`,y:`3`,width:R[`4xl`],height:R[`4xl`],rx:`2`}),(0,F.jsx)(`line`,{x1:`15`,y1:`3`,x2:`15`,y2:`21`})]})})})}function que(){return(0,F.jsxs)(`div`,{role:`status`,"aria-label":`Loading`,"data-testid":`boot-splash`,style:{position:`fixed`,inset:0,zIndex:9999,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:18,background:`var(--bg)`,color:`var(--text-muted)`},children:[(0,F.jsx)(`div`,{style:{fontSize:`var(--text-6xl)`,fontWeight:700,color:`var(--accent)`,letterSpacing:`0.02em`},children:`pi`}),(0,F.jsx)(`div`,{style:{width:22,height:22,border:`2px solid var(--border)`,borderTopColor:`var(--accent)`,borderRadius:`50%`,animation:`boot-spin 0.8s linear infinite`}}),(0,F.jsx)(`style`,{children:`@keyframes boot-spin { to { transform: rotate(360deg); } }`})]})}function Jue(){let{t:e}=I(),t=(0,d.useSyncExternalStore)(OJ,kJ,kJ);if(t.length===0)return null;let n=t[t.length-1],r={...n,message:MY(n.message,e)},i=t.length;return(0,F.jsx)(Ac,{open:!0,onOpenChange:()=>{},children:(0,F.jsxs)(Pc,{children:[(0,F.jsx)(Ic,{style:{position:`fixed`,inset:0,zIndex:1200,background:`rgba(0, 0, 0, 0.45)`}}),(0,F.jsxs)(Bc,{role:`alertdialog`,"aria-modal":`true`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),style:{position:`fixed`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,zIndex:1200,maxWidth:480,width:`calc(100% - 48px)`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:10,padding:`16px 20px`,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.35)`},children:[(0,F.jsxs)(Gc,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10,fontSize:`var(--text-base)`,fontWeight:600,color:`var(--text)`},children:[(0,F.jsx)(`span`,{style:{color:`var(--status-error)`},children:`⚠`}),(0,F.jsx)(`span`,{children:i>1?e(`errors.titleCount`,{count:i}):e(`errors.title`)})]}),(0,F.jsx)(qc,{asChild:!0,children:(0,F.jsx)(`div`,{children:r.kind===`api`?(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:6},children:[(0,F.jsxs)(`span`,{style:{fontSize:`var(--text-xs)`,padding:`1px 8px`,borderRadius:999,background:`color-mix(in srgb, var(--status-error) 14%, transparent)`,color:`var(--status-error)`,fontWeight:600,whiteSpace:`nowrap`},children:[`HTTP `,r.status||`ERR`]}),r.context&&(0,F.jsx)(`span`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`},children:r.context})]}),(0,F.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text)`,wordBreak:`break-word`},children:r.message})]}):(0,F.jsxs)(`div`,{children:[r.context&&(0,F.jsx)(`div`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginBottom:6},children:r.context}),(0,F.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text)`,wordBreak:`break-word`},children:r.message})]})})}),(0,F.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:16},children:[i>1&&(0,F.jsx)(`button`,{type:`button`,onClick:jJ,style:{border:`1px solid var(--border)`,background:`none`,color:`var(--text-muted)`,borderRadius:6,padding:`4px 12px`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:e(`errors.clearAll`)}),(0,F.jsx)(`button`,{type:`button`,onClick:AJ,style:{border:`none`,background:`var(--accent)`,color:`#fff`,borderRadius:6,padding:`4px 14px`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:e(`errors.close`)})]})]})]})})}var Yue=3e3,Xue=6e4;function z9(e,t){return e?e.error?e.path.split(/[\\/]/).pop()||t:e.name||e.firstMessage.slice(0,50)||t.slice(0,12):t.slice(0,12)}function Zue(e,t){return e.filter(e=>!t.has(e))}function Que(e,t,n,r){switch(e.type){case`prompt_error`:case`extension_error`:{if(!n.errors)return null;let t=e.errorMessage??r(`i18n.commandFailed`);return{title:r(`chat.taskErrorNotificationTitle`),body:t,tag:`agent-error-${e.sessionId}`}}case`extension_ui_request`:{if(!n.questions)return null;let t=e.method;if(t!==`select`&&t!==`confirm`&&t!==`input`&&t!==`editor`)return null;let i=e.title??r(`chat.questionNotificationTitle`);return{title:r(`chat.questionNotificationTitle`),body:i,tag:`question-${e.id??e.sessionId}`}}default:return null}}function $ue(){let{t:e}=I(),{notifyEvents:t}=Tn(),[n,r]=(0,d.useState)([]),i=(0,d.useRef)([]);(0,d.useEffect)(()=>{i.current=n});let a=(0,d.useRef)(t);(0,d.useEffect)(()=>{a.current=t});let o=(0,d.useRef)(e);(0,d.useEffect)(()=>{o.current=e});let{runningSessionIds:s}=vZ(),c=(0,d.useRef)(!1),l=(0,d.useRef)([]),u=(0,d.useRef)(new Map);(0,d.useEffect)(()=>{if(!a.current.taskComplete)return;let e=c.current?l.current:null;if(l.current=[...s],c.current=!0,!e)return;let t=Zue(e,s);if(t.length===0)return;let n=Date.now();for(let e of t){let t=u.current.get(e);t!==void 0&&n-t<Yue||(i.current.some(t=>t.id===e)||p.current(),console.info(`[notify] completion via running-snapshot (${e})`),gJ({title:o.current(`chat.taskCompleteNotificationTitle`),body:o.current(`chat.sessionCompletedNotificationBody`,{name:z9(i.current.find(t=>t.id===e),e)}),tag:`session-complete-${e}`,notifyWhileActive:a.current.notifyWhileActive}))}},[s]);let f=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`,{cache:`no-store`});if(!e.ok)return;let t=await e.json();t.sessions&&r(t.sessions)}catch{}},[]),p=(0,d.useRef)(f);return(0,d.useEffect)(()=>{p.current=f}),(0,d.useEffect)(()=>{f();let e=setInterval(()=>void f(),Xue);return()=>clearInterval(e)},[f]),(0,d.useEffect)(()=>ge({ch:`global`},e=>{let t=e;if(!t.sessionId)return;let n=t.sessionId;(t.type===`prompt_error`||t.type===`extension_error`)&&u.current.set(n,Date.now()),i.current.some(e=>e.id===n)||p.current();let r=Que(t,z9(i.current.find(e=>e.id===n),n),a.current,o.current);r&&(console.info(`[agent-events] notifying: ${r.title}`),gJ({...r,notifyWhileActive:a.current.notifyWhileActive}))}),[]),null}var ede=3;function tde(){let{t:e}=I(),t=(0,d.useSyncExternalStore)(cn,ln,ln);if(t.length===0)return null;let n=t.slice(0,ede),r=t.length-n.length;return(0,F.jsx)(`div`,{"aria-busy":`true`,style:{position:`fixed`,inset:0,zIndex:1150,background:`color-mix(in srgb, var(--bg) 40%, transparent)`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,minWidth:220,maxWidth:`60vw`,padding:`14px 18px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:`var(--radius)`,boxShadow:`0 8px 32px rgba(0,0,0,0.25)`},children:[n.map(t=>(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,fontSize:`var(--text-sm)`,color:`var(--text)`},children:[(0,F.jsx)(`div`,{style:{width:14,height:14,flexShrink:0,border:`2px solid var(--border)`,borderTopColor:`var(--accent)`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`}}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.label||e(`loading.inProgress`)})]},t.id)),r>0&&(0,F.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:e(`loading.more`,{count:r})})]})})}function nde({cwd:e,busy:t,error:n,onCancel:r,onConfirm:i}){let{t:a}=I();return(0,F.jsx)(ym,{open:!0,onOpenChange:e=>{!e&&!t&&r()},children:(0,F.jsxs)(Cm,{className:`w-[440px] gap-0 overflow-hidden rounded-lg p-0`,style:{zIndex:1100,maxWidth:`100%`},showCloseButton:!1,onPointerDownOutside:e=>{t&&e.preventDefault()},onEscapeKeyDown:e=>{t&&e.preventDefault()},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,gap:12,padding:`18px 18px 14px`},children:[(0,F.jsxs)(`svg`,{width:R[`5xl`],height:R[`5xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--status-warning)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0,marginTop:1},children:[(0,F.jsx)(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z`}),(0,F.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),(0,F.jsxs)(`div`,{style:{minWidth:0},children:[(0,F.jsx)(wm,{style:{fontSize:`var(--text-2xl)`,fontWeight:700,color:`var(--text)`,lineHeight:1.4},children:a(`trust.dialogTitle`)}),(0,F.jsx)(Tm,{style:{marginTop:7,fontSize:`var(--text-base)`,lineHeight:1.6,color:`var(--text-muted)`},children:a(`trust.dialogBody`)}),(0,F.jsx)(`code`,{style:{display:`block`,marginTop:10,padding:`8px 10px`,border:`1px solid var(--border)`,borderRadius:5,background:`var(--bg)`,color:`var(--text)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,overflowWrap:`anywhere`},children:e}),n&&(0,F.jsx)(`div`,{role:`alert`,style:{marginTop:10,color:`var(--status-error)`,fontSize:`var(--text-base)`,lineHeight:1.5},children:n})]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`10px 18px`,borderTop:`1px solid var(--border)`},children:[(0,F.jsx)(vm,{type:`button`,variant:`outline`,onClick:r,disabled:t,className:`h-8 px-3 text-xs`,children:a(`trust.cancel`)}),(0,F.jsx)(vm,{type:`button`,onClick:i,disabled:t,className:`h-8 px-3 text-xs`,style:{cursor:t?`wait`:`pointer`},children:a(t?`trust.trusting`:`trust.trustProject`)})]})]})})}function rde(e){return e.error?e.path.split(/[\\/]/).pop()||e.id:e.name||e.firstMessage.slice(0,50)||e.id.slice(0,12)}var B9=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``).replace(/^[a-zA-Z]:/,e=>e.toLowerCase()),V9=e=>Math.max(...e.map(e=>{let t=new Date(e.modified).getTime();return Number.isNaN(t)?0:t})),ide=(e,t)=>V9(t.sessions)-V9(e.sessions);function ade(e,t,n){return!t||e.some(e=>e.id===t.id)?e:[{...t,projectRoot:t.projectRoot??n(t.cwd)??void 0},...e]}function ode({filteredSessions:e,selectedSession:t,projectRootFor:n,selectedCwd:r,savedWorkspaces:i}){let a=ade(e,t,n),o=new Map,s=new Map;for(let e of a){let t=e.projectRoot??e.cwd??`unknown`,n=t===`unknown`?t:B9(t);o.has(n)||(o.set(n,[]),s.set(n,t)),o.get(n).push(e)}let c=[...o.entries()].map(([e,t])=>({root:s.get(e)??e,sessions:t})).sort(ide),l=[];if(r){let e=n(r);e&&!o.has(B9(e))&&l.push({root:e,sessions:[]})}let u=new Set([...o.keys()]);for(let e of l)u.add(B9(e.root));let d=[];for(let e of i??[]){let t=B9(e);u.has(t)||(u.add(t),d.push({root:e,sessions:[]}))}return[...l,...c,...d]}function sde(e,t){return t?e.map(e=>({...e,sessions:e.sessions.filter(e=>rde(e).toLowerCase().includes(t))})).filter(e=>e.sessions.length>0):e}var H9=`pi-web:unread-session-ids`;function cde(){if(typeof window>`u`)return new Set;try{let e=window.localStorage.getItem(H9);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function U9(e){if(!(typeof window>`u`))try{e.size===0?window.localStorage.removeItem(H9):window.localStorage.setItem(H9,JSON.stringify([...e]))}catch{}}function lde(){let[e,t]=(0,d.useState)(()=>cde());return(0,d.useEffect)(()=>{U9(e)},[e]),{unreadSessionIds:e,setUnreadSessionIds:t}}function ude(){let{t:e}=I();return(0,F.jsx)(`span`,{title:e(`sidebar.newActivity`),"aria-label":e(`sidebar.newSessionActivity`),style:{width:14,height:14,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,color:`var(--accent)`},children:(0,F.jsxs)(`svg`,{width:R.xl,height:R.xl,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,style:{display:`block`},children:[(0,F.jsx)(`circle`,{cx:`7`,cy:`7`,r:`2.5`,fill:`currentColor`}),(0,F.jsx)(`circle`,{cx:`7`,cy:`7`,r:`3`,stroke:`currentColor`,strokeWidth:`1.4`,opacity:`0.32`,style:{transformOrigin:`center`,animation:`session-ring-pulse 1.6s ease-in-out infinite`}})]})})}function dde({savedWorkspaces:e,onSavedWorkspacesChange:t,setSelectedCwd:n}){let[r,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(``),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(!1);return{customPathOpen:r,setCustomPathOpen:i,customPathError:s,setCustomPathError:c,customPathValidating:l,commitCustomPath:(0,d.useCallback)(async r=>{let s=(r??a).trim();if(!(!s||l)){u(!0),c(null);try{let r=await fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:s})}),a=await r.json().catch(()=>({}));if(!r.ok||a.error){c(a.error??`HTTP ${r.status}`);return}let l=a.cwd??s;if(n(l),i(!1),o(``),t){let n=e??[];n.some(e=>B9(e)===B9(l))||t([...n,l])}}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}},[a,l,e,t,n])}}function fde({savedWorkspaces:e,onSavedWorkspacesChange:t,onSessionDeleted:n,loadSessions:r}){let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(!1);return{confirmDeleteGroup:i,setConfirmDeleteGroup:a,deletingGroup:o,handleDeleteGroup:(0,d.useCallback)(async i=>{a(null),s(!0);try{await Promise.all(i.sessions.map(e=>fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`}).then(t=>{t.ok||console.error(`[sidebar] failed to delete ${e.id}:`,t.status)}).catch(t=>console.error(`[sidebar] failed to delete ${e.id}:`,t))));for(let e of i.sessions)n?.(e.id);let a=e??[];t&&a.some(e=>B9(e)===B9(i.root))&&t(a.filter(e=>B9(e)!==B9(i.root))),r(!1,!0)}finally{s(!1)}},[e,t,n,r])}}var pde=2e3;function mde({selectedSessionId:e,refreshKey:t,runningSessionIds:n,setUnreadSessionIds:r,setRunningSessionIds:i,runningPollAuthoritativeRef:a,setError:o}){let[s,c]=(0,d.useState)([]),[l,u]=(0,d.useState)(!0),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(!1),g=(0,d.useRef)(new Set),_=(0,d.useRef)(null),v=(0,d.useRef)(0),y=(0,d.useCallback)(async(e=!1,t=!1)=>{try{e&&u(!0);let n=t?await et.refresh():await et.load();c(n.sessions),a.current||i(new Set(n.runningSessionIds??[]));let s=new Set(n.sessions.map(e=>e.id));r(e=>{if(e.size===0)return e;let t=new Set([...e].filter(e=>s.has(e)));return t.size===e.size?e:t}),o(null),e||(h(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>h(!1),2e3))}catch(e){o(String(e))}finally{e&&u(!1)}},[r,i,a,o]),b=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{let e=!b.current;b.current=!0,y(e,e)},[y,t]),(0,d.useEffect)(()=>{let t=[...g.current].filter(t=>!n.has(t)&&t!==e),i=[...n];if((t.length>0||i.length>0)&&r(e=>{let n=new Set(e);return i.forEach(e=>n.delete(e)),t.forEach(e=>n.add(e)),n}),t.length>0&&y(!1),[...n].filter(e=>!s.some(t=>t.id===e)).length>0){let e=Date.now();e-v.current>=pde&&(v.current=e,y(!1,!0))}g.current=n},[n,e,s,y,r]),(0,d.useEffect)(()=>{e&&(OX(e),r(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}))},[e,r]),(0,d.useEffect)(()=>{fetch(`/api/home`).then(e=>e.json()).then(e=>{e.home&&p(e.home)}).catch(e=>console.error(`[pi-web] load home dir:`,e))},[]),{allSessions:s,loading:l,sessionRefreshDone:m,homeDir:f,loadSessions:y}}var W9=(e,t)=>e.replace(/\\/g,`/`)===t.replace(/\\/g,`/`);function G9(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?t(`sidebar.justNow`):i<60?t(`sidebar.minutesAgo`,{count:i}):a<24?t(`sidebar.hoursAgo`,{count:a}):o<7?t(`sidebar.daysAgo`,{count:o}):n.toLocaleDateString()}function hde(e){let t=new Map;for(let n of e){let e=n.projectRoot??n.cwd;if(!e)continue;let r=t.get(e);(!r||n.modified>r)&&t.set(e,n.modified)}return[...t.entries()].sort((e,t)=>t[1].localeCompare(e[1])).map(([e])=>e)}function K9(e,t){return t&&e.startsWith(t)?`~${e.slice(t.length)}`:e}function gde(e){let t=e.split(/[\\/]+/).filter(Boolean);return t.length?t[t.length-1]:e}function q9({text:e,style:t}){return(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,display:`block`,minWidth:0,lineHeight:1.35,direction:`rtl`,textAlign:`left`,...t},children:(0,F.jsx)(`span`,{style:{unicodeBidi:`plaintext`},children:e})})}function J9({session:e}){return(0,F.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,color:`var(--danger)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:`${e.path}: ${e.error}`,children:[(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0},children:[(0,F.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,F.jsx)(`path`,{d:`M12 9v4`}),(0,F.jsx)(`path`,{d:`M12 17h.01`})]}),e.error]})}var Y9=140;function _de({open:e,children:t,style:n}){let[r,i]=(0,d.useState)(e),[a,o]=(0,d.useState)(e);return(0,d.useEffect)(()=>{let t,n;return e?(i(!0),o(!1),t=window.requestAnimationFrame(()=>{t=window.requestAnimationFrame(()=>o(!0))})):(o(!1),n=setTimeout(()=>i(!1),Y9)),()=>{t!==void 0&&window.cancelAnimationFrame(t),n&&clearTimeout(n)}},[e]),r?(0,F.jsx)(`div`,{style:{...n,opacity:+!!a,transform:a?`translateY(0) scale(1)`:`translateY(-8px) scale(0.96)`,transformOrigin:`top center`,transition:`opacity ${Y9}ms ease, transform ${Y9}ms ease`,pointerEvents:e?`auto`:`none`},children:t}):null}function vde({worktreeState:e,allSessions:t,selectedCwd:n,setSelectedCwd:r,onCwdChange:i,initialSessionId:a,skipInitialProjectSelection:o,onSelectSession:s,onInitialRestoreDone:c,markSeen:l}){let u=(0,d.useCallback)(n=>n?e?.forCwd&&W9(e.forCwd,n)||e?.worktrees.some(e=>W9(e.path,n))?e.projectRoot:t.find(e=>e.cwd&&W9(e.cwd,n))?.projectRoot??n:null,[e,t]),f=(0,d.useRef)(null);(0,d.useEffect)(()=>{f.current!==n&&(f.current=n,i?.(n,u(n)))},[n,i,u]);let p=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(!(t.length===0||o)&&n===null){if(a&&!p.current){p.current=!0;let e=t.find(e=>e.id===a);if(e){r(e.cwd),l(e.id),s(e,!0);return}c?.()}let e=hde(t);e.length>0&&r(e[0])}},[t,n,a,o,s,c,l,r]),{projectRootFor:u}}function yde({onUnseenSession:e}){let[t,n]=(0,d.useState)(()=>new Set);return{seenSessionIds:t,markSeen:(0,d.useCallback)(e=>{n(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),handleUnseen:(0,d.useCallback)(t=>{n(e=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),n}),he(t),e?.(t)},[e])}}function bde(e){let{selectedCwd:t,selectedCwdProp:n,refreshKey:r,setSelectedCwd:i}=e,[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(null),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(``),w=(0,d.useRef)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(null);(0,d.useEffect)(()=>{n&&n!==E.current&&(E.current=n,i(n))},[n,i]);let D=(0,d.useCallback)(()=>{c(!1),u(!1),p(``),h(null),y(null),C(``)},[]),[O,k]=(0,d.useState)(0);(0,d.useLayoutEffect)(()=>{if(!t){o(null),x(null);return}let e=!1;return x(t),fetch(`/api/worktrees?cwd=${encodeURIComponent(t)}`).then(e=>e.json()).then(n=>{if(!e){if(x(null),n.error||!n.projectRoot){o(null);return}o({forCwd:t,projectRoot:n.projectRoot,isGit:n.isGit??!1,isTopLevel:n.isTopLevel??!1,worktrees:n.worktrees??[]})}}).catch(()=>{e||(x(null),o(null))}),()=>{e=!0}},[t,O,r]);let A=(0,d.useCallback)(async()=>{let e=f.trim();if(!(!e||g||!a)){_(!0),h(null);try{let t=await fetch(`/api/worktrees`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:a.projectRoot,branch:e})}),n=await t.json().catch(()=>({}));if(!t.ok||n.error||!n.path){h(n.error??`HTTP ${t.status}`);return}D(),o(t=>t&&{...t,forCwd:n.path,worktrees:[...t.worktrees,{path:n.path,branch:e,isMain:!1}]}),i(n.path),k(e=>e+1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}},[D,f,g,a,i]),j=(0,d.useCallback)(async(e,n)=>{if(!(!a||g)){_(!0),h(null);try{let r=await fetch(`/api/worktrees`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:a.projectRoot,path:e,force:n})}),o=await r.json().catch(()=>({}));if(!r.ok){if(o.dirty&&!n){y(e);return}h(o.error??`HTTP ${r.status}`);return}D(),t&&e&&W9(t,e)&&i(a.projectRoot),k(e=>e+1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}},[D,a,g,t,i]);return(0,d.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&D()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[D]),{worktreeState:a,worktreeLoadingCwd:b,wtDropdownOpen:s,setWtDropdownOpen:c,wtNewOpen:l,setWtNewOpen:u,wtNewBranch:f,setWtNewBranch:p,wtError:m,setWtError:h,wtBusy:g,wtConfirmRemove:v,setWtConfirmRemove:y,wtFilter:S,setWtFilter:C,wtDropdownRef:w,wtNewInputRef:T,closeWorktrees:D,handleCreateWorktree:A,handleRemoveWorktree:j}}function xde({selectedCwd:e,worktreeState:t,selectedProject:n,worktreeLoadingCwd:r,t:i}){let a=!!(t?.isGit&&t.isTopLevel&&e&&n===t.projectRoot),o=e&&t&&n===t.projectRoot&&!a?t.isGit?{label:i(`sidebar.openRepoRoot`),title:i(`sidebar.openRepoRootTitle`)}:{label:i(`sidebar.gitRepoRootOnly`),title:i(`sidebar.gitRepoRootOnlyTitle`)}:null,s=!!(e&&r===e);return{showWorktreeSwitcher:a,worktreeLoading:s,inactiveWorktreeSelector:o??(s&&!a?{label:i(`sidebar.worktrees`),title:i(`sidebar.checkingWorktrees`)}:null)}}function Sde({selectedSession:e,selectedSessionId:t,refreshKey:n,selectedCwdProp:r,savedWorkspaces:i,onSavedWorkspacesChange:a,onUnseenSession:o,onCwdChange:s,initialSessionId:c,skipInitialProjectSelection:l,onSelectSession:u,onInitialRestoreDone:f,onSessionDeleted:p}){let{t:m}=I(),[h,g]=(0,d.useState)(null),_=dde({savedWorkspaces:i,onSavedWorkspacesChange:a,setSelectedCwd:g}),v=bde({selectedCwd:h,selectedCwdProp:r,refreshKey:n,setSelectedCwd:g}),{worktreeState:y,worktreeLoadingCwd:b}=v,[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(``),T=(0,d.useRef)(null);(0,d.useEffect)(()=>{x&&T.current?.focus()},[x]);let{seenSessionIds:E,markSeen:D,handleUnseen:O}=yde({onUnseenSession:o}),{unreadSessionIds:k,setUnreadSessionIds:A}=lde(),j=jX(),{runningSessionIds:M,runningPhases:N,runningPhaseSince:ee,runningBusySince:te,setRunningSessionIds:P,runningPollAuthoritativeRef:ne}=vZ(),[re,ie]=(0,d.useState)(null),{allSessions:ae,loading:oe,sessionRefreshDone:se,homeDir:ce,loadSessions:le}=mde({selectedSessionId:t,refreshKey:n,runningSessionIds:M,setUnreadSessionIds:A,setRunningSessionIds:P,runningPollAuthoritativeRef:ne,setError:ie});(0,d.useEffect)(()=>{U9(k)},[k]);let{projectRootFor:ue}=vde({worktreeState:y,allSessions:ae,selectedCwd:h,setSelectedCwd:g,onCwdChange:s,initialSessionId:c,skipInitialProjectSelection:l,onSelectSession:u,onInitialRestoreDone:f,markSeen:D}),[de,fe]=(0,d.useState)({}),[pe,me]=(0,d.useState)(null),he=ue(h),ge=ae,{showWorktreeSwitcher:_e,inactiveWorktreeSelector:ve}=xde({selectedCwd:h,worktreeState:y,selectedProject:he,worktreeLoadingCwd:b,t:m}),{confirmDeleteGroup:F,setConfirmDeleteGroup:ye,deletingGroup:be,handleDeleteGroup:xe}=fde({savedWorkspaces:i,onSavedWorkspacesChange:a,onSessionDeleted:p,loadSessions:le}),Se=(0,d.useMemo)(()=>ode({filteredSessions:ge,selectedSession:e,projectRootFor:ue,selectedCwd:h,savedWorkspaces:i}),[ge,h,ue,e,i]),Ce=C.trim().toLowerCase();return{t:m,selectedCwd:h,setSelectedCwd:g,selectedSessionId:t,customPath:_,wt:v,workspaceSearchOpen:x,setWorkspaceSearchOpen:S,workspaceSearchQuery:C,setWorkspaceSearchQuery:w,workspaceSearchInputRef:T,seenSessionIds:E,markSeen:D,handleUnseen:O,unreadSessionIds:k,interactionBadges:j,runningSessionIds:M,runningPhases:N,runningPhaseSince:ee,runningBusySince:te,error:re,setError:ie,loading:oe,sessionRefreshDone:se,homeDir:ce,loadSessions:le,groupCollapsed:de,setGroupCollapsed:fe,hoveredGroup:pe,setHoveredGroup:me,selectedProject:he,showWorktreeSwitcher:_e,inactiveWorktreeSelector:ve,confirmDeleteGroup:F,setConfirmDeleteGroup:ye,deletingGroup:be,handleDeleteGroup:xe,wsQuery:Ce,visibleGroups:(0,d.useMemo)(()=>sde(Se,Ce),[Se,Ce])}}function Cde({searchQuery:e,setSearchQuery:t,currentPath:n,hasUncommittedPath:r,canSelect:i,busy:a,onCancel:o,onSelect:s}){let{t:c}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{className:`directory-picker-footer`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:10,flexShrink:0,padding:`10px 18px`,borderTop:`1px solid var(--border)`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flex:1,minWidth:0},children:[(0,F.jsxs)(`svg`,{width:R.lg,height:R.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{color:`var(--text-dim)`,flexShrink:0},children:[(0,F.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,F.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),(0,F.jsx)(Rx,{className:`directory-picker-search h-8 flex-1`,type:`text`,value:e,placeholder:c(`directoryPicker.search`),"aria-label":c(`directoryPicker.search`),autoComplete:`off`,spellCheck:!1,style:_S,onChange:e=>t(e.target.value)})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,flexShrink:0},children:[(0,F.jsx)(`button`,{className:`directory-picker-action`,type:`button`,onClick:o,disabled:a,style:{padding:`6px 14px`,border:`1px solid var(--border)`,borderRadius:6,background:`none`,color:`var(--text-muted)`,cursor:a?`default`:`pointer`,fontSize:`var(--text-lg)`},children:c(`i18n.cancel`)}),(0,F.jsx)(`button`,{className:`directory-picker-action`,type:`button`,onClick:()=>s(n),disabled:!i,title:c(r?`directoryPicker.openBeforeSelecting`:`directoryPicker.selectCurrentDirectory`),style:{padding:`6px 16px`,border:0,borderRadius:6,background:`var(--accent)`,color:`var(--on-accent)`,fontSize:`var(--text-lg)`,fontWeight:600,opacity:i?1:.6,cursor:i?`pointer`:`default`},children:c(a?`i18n.checking`:`directoryPicker.selectThisFolder`)})]})]})})}function wde({loading:e,drives:t,filteredDrives:n,filteredDirectories:r,query:i,navigateTo:a,loadError:o,error:s}){let{t:c}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{className:`directory-picker-list`,style:{flex:1,minHeight:0,overflow:`auto`,padding:`8px 10px`},children:[e?(0,F.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:c(`directoryPicker.loadingDirectories`)}):t===null?r.length>0?r.map(e=>(0,F.jsxs)(`button`,{className:`directory-picker-entry`,type:`button`,onClick:()=>void a(e.path),title:e.path,style:{width:`100%`,minHeight:30,display:`flex`,alignItems:`center`,gap:7,padding:`5px 8px`,border:0,borderRadius:5,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`},children:[(0,F.jsx)(vS,{}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})]},e.path)):(0,F.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:c(i?`directoryPicker.noMatches`:`directoryPicker.noSubdirectories`)}):n.length>0?n.map(e=>(0,F.jsxs)(`button`,{className:`directory-picker-entry`,type:`button`,onClick:()=>void a(e.path),title:e.path,style:{width:`100%`,minHeight:34,display:`flex`,alignItems:`center`,gap:7,padding:`6px 8px`,border:0,borderRadius:5,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`},children:[(0,F.jsx)(yS,{}),(0,F.jsx)(`span`,{children:e.name})]},e.path)):(0,F.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:c(i?`directoryPicker.noMatches`:`directoryPicker.noDrives`)}),(o||s)&&(0,F.jsx)(`div`,{style:{padding:`8px`,color:`var(--status-error)`,fontSize:`var(--text-sm)`},children:o??s})]})})}function Tde({handlePathSubmit:e,navigateTo:t,parentDirectory:n,loading:r,canNavigateUp:i,pathInputRef:a,pathInput:o,setPathInput:s,setLoadError:c}){let{t:l}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`form`,{onSubmit:e,style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0,padding:`10px 14px`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsx)(`button`,{className:`directory-picker-back`,type:`button`,onClick:()=>void t(n??void 0),disabled:r||!i,title:l(`directoryPicker.goToParent`),"aria-label":l(`directoryPicker.goToParent`),style:{width:36,height:36,padding:0,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,border:`1px solid var(--border)`,borderRadius:6,background:`#ffffff`,color:`var(--text-muted)`,cursor:i?`pointer`:`default`,opacity:i?1:.45},children:(0,F.jsx)(`svg`,{width:R[`3xl`],height:R[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`m18 15-6-6-6 6`})})}),(0,F.jsx)(`label`,{htmlFor:`directory-path`,style:{position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0},children:l(`directoryPicker.directoryPath`)}),(0,F.jsx)(Rx,{className:`directory-picker-path h-9 flex-1 font-mono text-xs`,id:`directory-path`,type:`text`,ref:a,value:o,placeholder:`/path/to/project or ~/project`,autoComplete:`off`,spellCheck:!1,style:_S,onChange:e=>{s(e.target.value),c(null)}}),(0,F.jsx)(`button`,{className:`directory-picker-action`,type:`submit`,disabled:!o.trim(),title:l(`directoryPicker.goToDirectory`),style:{minWidth:58,height:36,padding:`0 12px`,border:`1px solid var(--border)`,borderRadius:6,background:`#ffffff`,color:`var(--text-muted)`,cursor:o.trim()?`pointer`:`default`,opacity:o.trim()?1:.6},children:l(`directoryPicker.go`)})]})})}function Ede({onCancel:e,onSelect:t,busy:n=!1,error:r}){let{t:i}=I(),[a,o]=(0,d.useState)(!0),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)([]),[g,_]=(0,d.useState)(null),[v,y]=(0,d.useState)(``),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(!0),w=(0,d.useRef)(null),T=(0,d.useCallback)(async e=>{C(!0),x(null);try{let t=await gS(e),n=t.path??e??`/`;c(n),u(t.parentPath??null),p(n),h(t.directories??[]),_(t.drives??null),y(``)}catch(e){x(e instanceof Error?e.message:String(e))}finally{C(!1)}},[]);(0,d.useEffect)(()=>{T()},[T]);let E=e=>{e.preventDefault();let t=f.trim();t&&T(t)},D=f.trim()!==s,O=!!s&&!D&&!n,k=!!l||bS(s),A=v.trim().toLowerCase(),j=e=>!A||e.toLowerCase().includes(A),M=g===null?[]:g.filter(e=>j(e.name)||j(e.path)),N=m.filter(e=>j(e.name));return(0,F.jsx)(ym,{open:a,onOpenChange:t=>{!t&&!n&&(o(!1),e())},children:(0,F.jsxs)(Cm,{className:`directory-picker-light flex w-[520px] max-w-[calc(100vw-16px)] flex-col gap-0 overflow-hidden p-0`,style:{height:`min(620px, calc(100dvh - 16px))`},showCloseButton:!1,onPointerDownOutside:e=>{n&&e.preventDefault()},onEscapeKeyDown:e=>{n&&e.preventDefault()},onOpenAutoFocus:e=>{e.preventDefault(),w.current?.focus()},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexShrink:0,padding:`12px 18px`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsx)(wm,{style:{fontWeight:700,fontSize:`var(--text-2xl)`,color:`var(--text)`},children:i(`directoryPicker.selectDirectory`)}),(0,F.jsx)(xm,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,disabled:n,title:i(`i18n.close`),"aria-label":i(`i18n.close`),style:{padding:`2px 6px`,border:0,background:`none`,color:`var(--text-muted)`,fontSize:`var(--text-5xl)`,lineHeight:1,cursor:n?`default`:`pointer`,opacity:n?.5:1},children:`×`})})]}),(0,F.jsx)(Tde,{handlePathSubmit:E,navigateTo:T,parentDirectory:l,loading:S,canNavigateUp:k,pathInputRef:w,pathInput:f,setPathInput:p,setLoadError:x}),(0,F.jsx)(wde,{loading:S,drives:g,filteredDrives:M,filteredDirectories:N,query:A,navigateTo:T,loadError:b,error:r}),(0,F.jsx)(Cde,{searchQuery:v,setSearchQuery:y,currentPath:s,hasUncommittedPath:D,canSelect:O,busy:n,onCancel:e,onSelect:t})]})})}function Dde({title:e,label:t}){return(0,F.jsxs)(`button`,{type:`button`,"aria-disabled":`true`,tabIndex:-1,title:e,style:{width:`100%`,height:29,boxSizing:`border-box`,marginTop:6,display:`flex`,alignItems:`center`,gap:6,padding:`0 10px`,border:`1px solid var(--border)`,borderRadius:7,background:`var(--bg-hover)`,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,lineHeight:1.35,whiteSpace:`nowrap`,textAlign:`left`,cursor:`default`,opacity:.82},children:[(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:t})]})}function Ode(e,t){return{cursor:e?`default`:`pointer`,background:e?`color-mix(in srgb, var(--status-error) 6%, transparent)`:t?`var(--bg-hover)`:`var(--bg)`}}function kde({hasInteraction:e,hasRunning:t,collapsed:n}){return{background:e&&n?`linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`:t&&n?`linear-gradient(90deg, transparent 13%, color-mix(in srgb, var(--accent) 18%, transparent) 25%, transparent 37%, transparent 63%, color-mix(in srgb, var(--shine-highlight) 50%, transparent) 75%, transparent 87%), linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`:`linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`,backgroundSize:t&&n&&!e?`200% 100%, auto`:void 0,animation:e&&n?`interaction-bg-blink 1s ease-in-out infinite`:t&&n?`pi-status-shine 1.5s linear infinite`:void 0}}function X9(e){return{cursor:e?`default`:`pointer`,opacity:e?.6:1}}function Ade({group:e,groupSelected:t,hoveredGroup:n,confirmDeleteGroup:r,deletingGroup:i,runningSessionIds:a,interactionBadges:o,collapsed:s,setHoveredGroup:c,setGroupCollapsed:l,setConfirmDeleteGroup:u,handleDeleteGroup:d,handleNewSession:f,copyText:p}){let{t:m}=I(),h=e.sessions.some(e=>a.has(e.id)),g=e.sessions.some(e=>o.has(e.id)),_=r===e.root,v=n===e.root;return(0,F.jsx)(`div`,{"data-testid":`workspace-group-header`,onMouseEnter:()=>c(e.root),onMouseLeave:()=>c(null),style:{display:`flex`,alignItems:`center`,gap:4,height:40,padding:`0 2px`,boxSizing:`border-box`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600,textTransform:`none`,letterSpacing:.6,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,...Ode(_,v)},onClick:_?void 0:()=>{l(t=>({...t,[e.root]:!t[e.root]}))},children:_?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:m(`sidebar.deleteWorkspace`,{count:e.sessions.length})}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:5,flexShrink:0},children:[(0,F.jsx)(`button`,{onClick:t=>{t.stopPropagation(),d(e)},disabled:i,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,height:22,padding:`0 9px`,background:`var(--status-error)`,border:`none`,borderRadius:5,color:`var(--on-error)`,fontSize:`var(--text-sm)`,fontWeight:600,whiteSpace:`nowrap`,...X9(i)},children:m(`sidebar.delete`)}),(0,F.jsx)(`button`,{onClick:e=>{e.stopPropagation(),u(null)},disabled:i,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:22,padding:`0 9px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,fontWeight:500,whiteSpace:`nowrap`,...X9(i)},children:m(`sidebar.cancel`)})]})]}):(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,flex:1,minWidth:0,height:38,boxSizing:`border-box`,padding:`0 8px`,border:`none`,borderRadius:0,...kde({hasInteraction:g,hasRunning:h,collapsed:s}),boxShadow:`0 2px 8px var(--shadow-color)`,margin:`0 -2px`},children:[(0,F.jsxs)(`span`,{style:{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:30,height:22,flexShrink:0},children:[(0,F.jsx)(`svg`,{width:`30`,height:`22`,viewBox:`0 0 24 24`,fill:t?`color-mix(in srgb, var(--accent) 18%, transparent)`:`var(--bg)`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:t?`var(--accent)`:`var(--text-muted)`,opacity:.95},children:(0,F.jsx)(`path`,{d:`M4 20h16a2 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 2v13c0 1.1.9 2 2 2Z`})}),(0,F.jsx)(`span`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -38%)`,color:`var(--text-muted)`,fontSize:`var(--text-xs)`,fontWeight:400,lineHeight:1,textAlign:`center`,fontVariantNumeric:`tabular-nums`,userSelect:`none`},children:e.sessions.length})]}),(0,F.jsx)(L,{label:e.root,wrapperStyle:{flex:1,minWidth:0,overflow:`hidden`},children:(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:`100%`,lineHeight:`20px`},children:gde(e.root)})}),v&&(0,F.jsx)(tJ,{items:[{key:`new-session`,onClick:t=>{t.stopPropagation(),f(e.root)},title:m(`sidebar.newSessionTitle`,{path:e.root}),icon:(0,F.jsx)(gr,{size:R.base})},{key:`copy-path`,onClick:t=>{t.stopPropagation(),p(e.root)},title:m(`sidebar.copyPath`),icon:(0,F.jsx)(qn,{size:R.base})},{key:`delete-workspace`,onClick:t=>{t.stopPropagation(),u(e.root)},title:m(`sidebar.deleteWorkspaceTitle`),danger:!0,icon:(0,F.jsx)(jr,{size:R.base})}]})]})})})}function jde(e){return e.error?e.path.split(/[\\/]/).pop()||e.id:e.name||e.firstMessage.slice(0,50)||e.id.slice(0,12)}function Mde({hasInteractionBadge:e,depth:t,confirmDelete:n,renaming:r,hovered:i,deleting:a}){return{height:54,animation:e?`interaction-bg-blink 1s ease-in-out infinite`:void 0,display:`flex`,alignItems:`center`,paddingLeft:t>0?t*12+14:14,paddingRight:8,cursor:n||r?`default`:`pointer`,backgroundColor:n?`color-mix(in srgb, var(--status-error) 6%, transparent)`:i?`var(--bg-hover)`:`transparent`,transition:`background 0.1s`,opacity:a?.5:1,gap:6,overflow:`hidden`}}function Nde({session:e,hovered:t,isSeen:n,onUnseen:r,startRename:i,handleDeleteClick:a}){let{t:o}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(tJ,{visible:t,items:[...n&&r?[{key:`unseen`,onClick:t=>{t.stopPropagation(),r(e.id)},title:o(`sidebar.disconnect`)||`断开`,icon:(0,F.jsx)(Nr,{size:R.base})}]:[],{key:`copy-path`,onClick:t=>{t.stopPropagation(),gK(e.path)},title:o(`sidebar.copyPath`),icon:(0,F.jsx)(qn,{size:R.base})},{key:`rename`,testId:`session-rename`,onClick:i,title:o(`sidebar.rename`),icon:(0,F.jsx)(mr,{size:R.xl})},{key:`delete`,testId:`session-delete`,onClick:a,title:o(`sidebar.deleteWithShiftClick`),danger:!0,icon:(0,F.jsx)(jr,{size:R.xl})}]})})}function Pde({collapsed:e,onToggleCollapse:t}){return(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(L,{label:e?`Expand forks`:`Collapse forks`,children:(0,F.jsx)(`button`,{onClick:e=>{e.stopPropagation(),t?.()},style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,padding:0,flexShrink:0,background:`none`,border:`none`,color:`var(--text-dim)`,cursor:`pointer`,transform:e?`rotate(-90deg)`:`none`,transition:`transform 0.15s`},children:(0,F.jsx)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,F.jsx)(`polyline`,{points:`2 3.5 5 6.5 8 3.5`})})})})})}function Fde({session:e,title:t,onConfirm:n,onCancel:r}){let{t:i}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,F.jsx)(`div`,{style:{fontSize:`var(--text-base)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t}),(0,F.jsxs)(`div`,{style:{marginTop:2,display:`flex`,alignItems:`center`,gap:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.error?(0,F.jsx)(J9,{session:e}):(0,F.jsx)(`span`,{title:e.modified,children:G9(e.modified,i)}),(0,F.jsx)(`span`,{children:i(`sidebar.messagesCount`,{count:e.messageCount})})]})]}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:5,flexShrink:0},children:[(0,F.jsxs)(`button`,{onClick:n,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,height:30,padding:`0 11px`,background:`var(--status-error)`,border:`none`,borderRadius:6,color:`var(--on-error)`,cursor:`pointer`,fontSize:`var(--text-base)`,fontWeight:600,whiteSpace:`nowrap`},children:[(0,F.jsx)(jr,{size:R.base}),i(`sidebar.delete`)]}),(0,F.jsx)(`button`,{onClick:r,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:30,padding:`0 11px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:6,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-base)`,fontWeight:500,whiteSpace:`nowrap`},children:i(`sidebar.cancel`)})]})]})})}function Ide({session:e,title:t,isSelected:n,isSeen:r,isRunning:i,isUnread:a,phase:o,elapsed:s,totalElapsed:c}){let{t:l}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,F.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,minWidth:0,fontSize:`var(--text-base)`,fontWeight:n?600:400,lineHeight:1.4,color:r?`var(--text)`:`var(--text-dim)`},title:t,children:(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},children:t})}),(0,F.jsxs)(`div`,{style:{marginTop:2,display:`flex`,alignItems:`center`,gap:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.error?(0,F.jsx)(J9,{session:e}):i?(0,F.jsx)(o9,{phase:o??{kind:`running_command`},elapsed:s,totalElapsed:c}):a?(0,F.jsx)(ude,{}):(0,F.jsx)(`span`,{title:e.modified,children:G9(e.modified,l)}),!e.error&&i?null:(0,F.jsx)(`span`,{children:l(`sidebar.messagesCount`,{count:e.messageCount})}),e.worktreeBranch&&(0,F.jsxs)(`span`,{title:`Worktree: ${e.cwd}`,style:{display:`flex`,alignItems:`center`,gap:3,color:`var(--accent)`,minWidth:0,overflow:`hidden`},children:[(0,F.jsxs)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.worktreeBranch})]})]})]})})}function Lde({session:e,isSelected:t,isRunning:n,phase:r,phaseSince:i,busySince:a,isUnread:o,isSeen:s=!0,hasInteractionBadge:c=!1,onClick:l,onRenamed:u,onDeleted:f,onUnseen:p,depth:m=0,hasChildren:h=!1,collapsed:g=!1,onToggleCollapse:_}){let{t:v}=I(),y=yZ(!!(n&&r),i),b=yZ(!!n,a),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(!1),[T,E]=(0,d.useState)(``),[D,O]=(0,d.useState)(!1),[k,A]=(0,d.useState)(!1),j=(0,d.useRef)(null),M=jde(e),N=(0,d.useCallback)(t=>{t.stopPropagation(),E(e.name??``),w(!0),setTimeout(()=>j.current?.select(),0)},[e.name]),ee=(0,d.useCallback)(async()=>{let t=T.trim();if(w(!1),t!==(e.name??``))try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:t})}),u?.()}catch{}},[T,e.id,e.name,u]),te=(0,d.useCallback)(async()=>{O(!1),A(!0);try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`}),f?.(e.id)}catch{A(!1)}},[e.id,f]),P=(0,d.useCallback)(e=>{e.stopPropagation(),e.shiftKey?te():O(!0)},[te]),ne=(0,d.useCallback)(e=>{e.stopPropagation(),te()},[te]),re=(0,d.useCallback)(e=>{e.stopPropagation(),O(!1)},[]),ie=(0,d.useCallback)(e=>{e.key===`Enter`&&ee(),e.key===`Escape`&&w(!1)},[ee]);return(0,F.jsx)(`div`,{"data-testid":`session-item`,"data-session-id":e.id,onClick:D||C?void 0:l,title:c?v(`sidebar.interactionBadge`):void 0,onMouseEnter:()=>S(!0),onMouseLeave:()=>{S(!1)},style:Mde({hasInteractionBadge:c,depth:m,confirmDelete:D,renaming:C,hovered:x,deleting:k}),className:t&&!D?`row-selected-gradient`:void 0,children:(0,F.jsx)(Rde,{session:e,title:M,inputRef:j,isSelected:t,isSeen:s,isUnread:o,isRunning:n,phase:r,elapsed:y,totalElapsed:b,depth:m,hasChildren:h,collapsed:g,onToggleCollapse:_,hovered:x,confirmDelete:D,renaming:C,renameValue:T,onRenameChange:E,commitRename:ee,handleRenameKeyDown:ie,handleDeleteClick:P,handleDeleteConfirm:ne,handleDeleteCancel:re,startRename:N,onUnseen:p})})}function Rde({session:e,title:t,inputRef:n,isSelected:r,isSeen:i,isUnread:a,isRunning:o,phase:s,elapsed:c,totalElapsed:l,depth:u,hasChildren:d,collapsed:f,onToggleCollapse:p,hovered:m,confirmDelete:h,renaming:g,renameValue:_,onRenameChange:v,commitRename:y,handleRenameKeyDown:b,handleDeleteClick:x,handleDeleteConfirm:S,handleDeleteCancel:C,startRename:w,onUnseen:T}){return h?(0,F.jsx)(Fde,{session:e,title:t,onConfirm:S,onCancel:C}):g?(0,F.jsx)(`input`,{ref:n,"data-testid":`session-rename-input`,value:_,onChange:e=>v(e.target.value),onBlur:y,onKeyDown:b,autoFocus:!0,style:{flex:1,fontSize:`var(--text-base)`,padding:`5px 8px`,border:`1px solid var(--accent)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,height:30}}):(0,F.jsxs)(F.Fragment,{children:[u>0&&(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-dim)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(Ide,{session:e,title:t,isSelected:r,isSeen:i,isRunning:o,isUnread:a,phase:s,elapsed:c,totalElapsed:l}),d&&(0,F.jsx)(Pde,{collapsed:f,onToggleCollapse:p}),(0,F.jsx)(Nde,{session:e,hovered:m,isSeen:i,onUnseen:T,startRename:w,handleDeleteClick:x})]})}function Z9({node:e,selectedSessionId:t,runningSessionIds:n,runningPhases:r,runningPhaseSince:i,runningBusySince:a,unreadSessionIds:o,seenSessionIds:s,interactionBadges:c,onSelectSession:l,onRenamed:u,onSessionDeleted:f,onUnseen:p,depth:m}){let[h,g]=(0,d.useState)(!1),_=e.children.length>0;return(0,F.jsxs)(`div`,{style:{paddingBottom:1,backgroundImage:`linear-gradient(90deg, transparent, var(--border), transparent)`,backgroundPosition:`0 100%`,backgroundSize:`100% 1px`,backgroundRepeat:`no-repeat`},children:[(0,F.jsxs)(`div`,{style:{position:`relative`},children:[m>0&&(0,F.jsx)(`div`,{style:{position:`absolute`,left:m*12+6,top:0,bottom:0,width:1,background:`var(--border)`,pointerEvents:`none`}}),(0,F.jsx)(Lde,{session:e.session,isSelected:e.session.id===t,isRunning:n.has(e.session.id),phase:r[e.session.id],phaseSince:i[e.session.id],busySince:a[e.session.id],isUnread:o.has(e.session.id),isSeen:s.has(e.session.id),hasInteractionBadge:c.has(e.session.id),onClick:()=>l(e.session),onRenamed:u,onDeleted:e=>f?.(e),onUnseen:p,depth:m,hasChildren:_,collapsed:h,onToggleCollapse:()=>g(e=>!e)})]}),_&&!h&&(0,F.jsx)(`div`,{children:e.children.map(e=>(0,F.jsx)(Z9,{node:e,selectedSessionId:t,runningSessionIds:n,runningPhases:r,runningPhaseSince:i,runningBusySince:a,unreadSessionIds:o,seenSessionIds:s,interactionBadges:c,onSelectSession:l,onRenamed:u,onSessionDeleted:f,onUnseen:p,depth:m+1},e.session.id))})]})}function zde(e){let t=new Map;for(let n of e)t.set(n.id,{session:n,children:[]});let n=new Map;for(let t of e)t.parentSessionId&&n.set(t.id,t.parentSessionId);function r(e){let r=n.get(e),i=new Set;for(;r;){if(i.has(r))return null;if(i.add(r),t.has(r))return r;r=n.get(r)}return null}let i=[];for(let e of t.values()){let n=r(e.session.id);n?t.get(n).children.push(e):i.push(e)}let a=e=>{e.sort((e,t)=>t.session.modified.localeCompare(e.session.modified)),e.forEach(e=>a(e.children))};return a(i),i}function Bde({visibleGroups:e,selectedSessionId:t,selectedProject:n,wsQuery:r,groupCollapsed:i,hoveredGroup:a,confirmDeleteGroup:o,deletingGroup:s,runningSessionIds:c,runningPhases:l,runningPhaseSince:u,runningBusySince:d,unreadSessionIds:f,seenSessionIds:p,interactionBadges:m,setHoveredGroup:h,setGroupCollapsed:g,setConfirmDeleteGroup:_,handleDeleteGroup:v,handleNewSession:y,copyText:b,handleSelectSessionFromList:x,onSessionDeleted:S,handleUnseen:C,loadSessions:w}){let{t:T}=I();return(0,F.jsx)(F.Fragment,{children:e.map(e=>{let E=e.sessions.some(e=>e.id===t)||e.root===n;return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(Ade,{group:e,groupSelected:E,hoveredGroup:a,confirmDeleteGroup:o,deletingGroup:s,runningSessionIds:c,interactionBadges:m,collapsed:!!i[e.root],setHoveredGroup:h,setGroupCollapsed:g,setConfirmDeleteGroup:_,handleDeleteGroup:v,handleNewSession:y,copyText:b}),(r||!i[e.root])&&(e.sessions.length===0?(0,F.jsx)(`div`,{style:{padding:`10px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`},children:T(`sidebar.noSessions`)}):zde(e.sessions).map(e=>(0,F.jsx)(Z9,{node:e,selectedSessionId:t,runningSessionIds:c,runningPhases:l,runningPhaseSince:u,runningBusySince:d,unreadSessionIds:f,seenSessionIds:p,interactionBadges:m,onSelectSession:x,onRenamed:()=>w(!1,!0),onSessionDeleted:e=>{S?.(e),w(!1,!0)},onUnseen:C,depth:0},e.session.id)))]},e.root)})})}function Vde({loading:e,error:t,noSearchResults:n}){let{t:r}=I();return e?(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`16px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`div`,{style:{width:14,height:14,border:`2px solid var(--border)`,borderTopColor:`var(--text-dim)`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`,flexShrink:0}}),r(`sidebar.loading`)]}):t?(0,F.jsx)(`div`,{style:{padding:`12px 14px`,color:`var(--status-error)`,fontSize:`var(--text-base)`},children:t}):n?(0,F.jsx)(`div`,{style:{padding:`16px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:r(`sidebar.searchSessionsNoResults`)}):null}function Hde({searchOpen:e,onToggleSearch:t,onNewWorkspace:n,onRefresh:r,refreshDone:i}){let{t:a}=I();return(0,F.jsx)(tJ,{items:[{key:`search`,testId:`workspace-search-toggle`,onClick:t,title:a(`sidebar.searchSessions`),ariaPressed:e,color:e?`var(--accent)`:`var(--text-muted)`,background:e?`var(--bg-selected)`:void 0,icon:(0,F.jsx)(Sr,{size:R.lg})},{key:`new-workspace`,testId:`new-workspace`,onClick:n,title:a(`sidebar.newWorkspace`),color:`var(--text-muted)`,icon:(0,F.jsx)(er,{size:R.xl})},{key:`refresh`,testId:`session-refresh`,onClick:r,title:a(`sidebar.refresh`),skipHover:i,color:i?`var(--status-success)`:`var(--text-muted)`,background:i?`color-mix(in srgb, var(--status-success) 18%, transparent)`:void 0,icon:i?(0,F.jsx)(zn,{size:R.xl,color:`var(--status-success)`,strokeWidth:2.5}):(0,F.jsx)(vr,{size:R.xl})}]})}function Ude({value:e,onChange:t,onClear:n,inputRef:r}){let{t:i}=I();return(0,F.jsxs)(`div`,{"data-testid":`workspace-search`,style:{display:`flex`,alignItems:`center`,gap:4,width:`100%`,minWidth:0,padding:`4px 8px`,background:`var(--bg)`,borderBottom:`1px solid var(--border)`,boxSizing:`border-box`},children:[(0,F.jsx)(Sr,{size:R.lg,color:`var(--text-muted)`,style:{flexShrink:0}}),(0,F.jsx)(`input`,{ref:r,value:e,onChange:e=>t(e.target.value),placeholder:i(`sidebar.searchSessionsPlaceholder`),"aria-label":i(`sidebar.searchSessions`),style:{flex:1,minWidth:0,background:`transparent`,border:`none`,outline:`none`,color:`var(--text)`,fontSize:`var(--text-sm)`}}),e&&(0,F.jsx)(`button`,{type:`button`,onClick:n,"aria-label":i(`chat.clearSearch`),style:{border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0,padding:0},children:`✕`})]})}function Wde({wtNewOpen:e,setWtNewOpen:t,wtNewBranch:n,setWtNewBranch:r,wtNewInputRef:i,handleCreateWorktree:a,wtBusy:o,setWtError:s}){let{t:c}=I();return(0,F.jsx)(F.Fragment,{children:e?(0,F.jsxs)(`div`,{style:{padding:`6px 8px`},children:[(0,F.jsx)(`input`,{ref:i,"data-testid":`worktree-new-branch-input`,value:n,onChange:e=>{r(e.target.value),s(null)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),a()),e.key===`Escape`&&(t(!1),r(``),s(null))},placeholder:c(`sidebar.branchName`),style:{width:`100%`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,padding:`5px 8px`,border:`1px solid var(--accent)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,boxSizing:`border-box`}}),(0,F.jsxs)(`div`,{style:{display:`flex`,gap:5,marginTop:5},children:[(0,F.jsx)(`button`,{"data-testid":`worktree-create`,onClick:()=>void a(),disabled:o||!n.trim(),style:{flex:1,padding:`4px 0`,background:`var(--accent)`,border:`none`,borderRadius:5,color:`var(--on-accent)`,fontSize:`var(--text-sm)`,fontWeight:600,cursor:o||!n.trim()?`not-allowed`:`pointer`,opacity:o||!n.trim()?.65:1},children:c(o?`sidebar.creating`:`sidebar.create`)}),(0,F.jsx)(`button`,{onClick:()=>{t(!1),r(``),s(null)},style:{flex:1,padding:`4px 0`,background:`var(--bg-hover)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:c(`sidebar.cancel`)})]})]}):(0,F.jsxs)(`button`,{"data-testid":`worktree-new`,onClick:e=>{e.stopPropagation(),t(!0),s(null),setTimeout(()=>i.current?.focus(),0)},title:c(`sidebar.createWorktreeTitle`),style:{display:`flex`,alignItems:`center`,gap:7,width:`100%`,padding:`8px 10px`,background:`none`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-sm)`},children:[(0,F.jsxs)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.1`,strokeLinecap:`round`,style:{flexShrink:0},children:[(0,F.jsx)(`line`,{x1:`5`,y1:`1`,x2:`5`,y2:`9`}),(0,F.jsx)(`line`,{x1:`1`,y1:`5`,x2:`9`,y2:`5`})]}),(0,F.jsx)(`span`,{children:c(`sidebar.newWorktree`)})]})})}function Gde({worktrees:e,visibleWorktrees:t,selectedCwd:n,homeDir:r,wtConfirmRemove:i,setWtConfirmRemove:a,handleRemoveWorktree:o,wtBusy:s,setSelectedCwd:c,closeWorktrees:l,showWtFilter:u,wtFilter:d}){let{t:f}=I();return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(`div`,{style:{maxHeight:`min(40vh, 300px)`,overflowY:`auto`},children:[t.map(t=>{let u=W9(t.path,n)||t.isMain&&!e.some(e=>W9(e.path,n));return i===t.path?(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`7px 10px`,borderBottom:`1px solid var(--border)`,background:`color-mix(in srgb, var(--status-error) 6%, transparent)`},children:[(0,F.jsx)(`span`,{style:{flex:1,fontSize:`var(--text-sm)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:f(`sidebar.forceRemoveCheckout`)}),(0,F.jsx)(`button`,{"data-testid":`worktree-force-remove`,onClick:()=>void o(t.path,!0),disabled:s,style:{padding:`3px 9px`,background:`var(--status-error)`,border:`none`,borderRadius:5,color:`var(--on-error)`,fontSize:`var(--text-sm)`,fontWeight:600,cursor:`pointer`,flexShrink:0},children:f(`sidebar.force`)}),(0,F.jsx)(`button`,{onClick:()=>a(null),style:{padding:`3px 9px`,background:`var(--bg-hover)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`,flexShrink:0},children:f(`sidebar.cancel`)})]},t.path):(0,F.jsxs)(`div`,{className:`wt-row`,"data-testid":`worktree-row`,style:{display:`flex`,alignItems:`center`,borderBottom:`1px solid var(--border)`},children:[(0,F.jsxs)(`button`,{"data-testid":`worktree-item`,onClick:()=>{c(t.path),l()},title:t.path,style:{flex:1,minWidth:0,display:`flex`,alignItems:`center`,gap:7,padding:`8px 10px`,background:`var(--bg)`,border:`none`,color:u?`var(--text)`:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`},children:[u?(0,F.jsx)(`svg`,{width:R.xs,height:R.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:(0,F.jsx)(`polyline`,{points:`1.5 5 4 7.5 8.5 2.5`})}):(0,F.jsx)(`span`,{style:{width:10,flexShrink:0}}),(0,F.jsx)(q9,{text:t.branch??K9(t.path,r),style:{flex:1}}),t.isMain&&(0,F.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:f(`sidebar.main`)})]}),!t.isMain&&(0,F.jsx)(`button`,{"data-testid":`worktree-remove`,onClick:()=>void o(t.path,!1),disabled:s,title:f(`sidebar.removeWorktreeTitle`,{path:t.path}),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:34,height:28,padding:0,marginRight:4,background:`none`,border:`none`,color:`var(--text-dim)`,cursor:`pointer`,borderRadius:5,flexShrink:0,transition:`color 0.12s, background 0.12s`,"--hover-color":`var(--status-error)`,"--hover-bg":`color-mix(in srgb, var(--status-error) 8%, transparent)`},className:`hover-shift`,children:(0,F.jsxs)(`svg`,{width:R.base,height:R.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,F.jsx)(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),(0,F.jsx)(`path`,{d:`M10 11v6M14 11v6`}),(0,F.jsx)(`path`,{d:`M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2`})]})})]},t.path)}),u&&t.length===0&&d.trim()&&(0,F.jsx)(`div`,{style:{padding:`8px 10px`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:f(`sidebar.noMatchingWorktrees`)})]})})}function Kde({wt:e,selectedCwd:t,homeDir:n,setSelectedCwd:r}){let{t:i}=I(),{worktreeState:a,wtFilter:o,setWtFilter:s,wtDropdownOpen:c,setWtDropdownOpen:l,wtDropdownRef:u,closeWorktrees:d,handleRemoveWorktree:f,wtConfirmRemove:p,setWtConfirmRemove:m,wtBusy:h,wtNewOpen:g,setWtNewOpen:_,wtNewBranch:v,setWtNewBranch:y,wtNewInputRef:b,handleCreateWorktree:x,wtError:S,setWtError:C}=e;if(!a)return null;let w=a.worktrees.find(e=>W9(e.path,t))??a.worktrees.find(e=>e.isMain),T=a.worktrees.length>=8,E=T&&o.trim()?a.worktrees.filter(e=>(e.branch??K9(e.path,n)).toLowerCase().includes(o.trim().toLowerCase())):a.worktrees;return(0,F.jsxs)(`div`,{ref:u,"data-testid":`worktree-switcher`,style:{position:`relative`,marginTop:6},children:[(0,F.jsxs)(`button`,{"data-testid":`worktree-switcher-trigger`,onClick:()=>l(e=>!e),title:w?i(`sidebar.switchWorktreeTitle`,{path:w.path}):i(`sidebar.switchWorktree`),style:{width:`100%`,height:29,boxSizing:`border-box`,display:`flex`,alignItems:`center`,gap:6,padding:`0 10px`,background:`var(--bg-input)`,border:`1px solid var(--border)`,borderRadius:7,cursor:`pointer`,fontSize:`var(--text-sm)`,lineHeight:1.35,color:`var(--text-muted)`,textAlign:`left`},children:[(0,F.jsxs)(`svg`,{width:R.sm,height:R.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0,color:w&&!w.isMain?`var(--accent)`:`var(--text-dim)`},children:[(0,F.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,F.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,F.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,F.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,F.jsx)(q9,{text:w?w.branch??K9(w.path,n):`…`,style:{flex:1,fontFamily:`var(--font-mono)`,color:`var(--text)`}}),w?.isMain&&(0,F.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:i(`sidebar.main`)}),a.worktrees.length>1&&(0,F.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:a.worktrees.length}),(0,F.jsx)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:(0,F.jsx)(`polyline`,{points:`2 3.5 5 6.5 8 3.5`})})]}),(0,F.jsxs)(_de,{open:c,style:{position:`absolute`,top:`calc(100% + 4px)`,left:0,right:0,zIndex:100,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:8,boxShadow:`0 6px 20px var(--shadow-color)`,overflow:`hidden`},children:[T&&(0,F.jsx)(`div`,{style:{padding:`6px 8px`,borderBottom:`1px solid var(--border)`},children:(0,F.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(s(``),d())},placeholder:i(`sidebar.filterWorktrees`),autoFocus:!0,style:{width:`100%`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,padding:`5px 8px`,border:`1px solid var(--border)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,boxSizing:`border-box`}})}),(0,F.jsx)(Gde,{worktrees:a.worktrees,visibleWorktrees:E,selectedCwd:t,homeDir:n,wtConfirmRemove:p,setWtConfirmRemove:m,handleRemoveWorktree:f,wtBusy:h,setSelectedCwd:r,closeWorktrees:d,showWtFilter:T,wtFilter:o}),(0,F.jsx)(Wde,{wtNewOpen:g,setWtNewOpen:_,wtNewBranch:v,setWtNewBranch:y,wtNewInputRef:b,handleCreateWorktree:x,wtBusy:h,setWtError:C}),S&&(0,F.jsx)(`div`,{style:{padding:`5px 10px 8px`,color:`var(--status-error)`,fontSize:`var(--text-sm)`,lineHeight:1.35,overflowWrap:`anywhere`},children:S})]})]})}function qde({sb:e,handleSelectSessionFromList:t,handleNewSession:n,onSessionDeleted:r}){let{t:i}=I(),{customPath:a,wt:o,selectedCwd:s,setSelectedCwd:c,homeDir:l,workspaceSearchOpen:u,setWorkspaceSearchOpen:d,workspaceSearchQuery:f,setWorkspaceSearchQuery:p,workspaceSearchInputRef:m,loadSessions:h,sessionRefreshDone:g,showWorktreeSwitcher:_,inactiveWorktreeSelector:v,loading:y,error:b,wsQuery:x,visibleGroups:S}=e;return(0,F.jsxs)(F.Fragment,{children:[a.customPathOpen&&(0,F.jsx)(Ede,{busy:a.customPathValidating,error:a.customPathError,onCancel:()=>{a.setCustomPathOpen(!1),a.setCustomPathError(null)},onSelect:e=>void a.commitCustomPath(e)}),(0,F.jsxs)(cJ,{title:i(`sidebar.workspace`),open:!0,onToggle:()=>{},collapsible:!1,testId:`workspace-scroll`,hintTestId:`workspace`,scrollStyle:{flex:`1 1 auto`,minHeight:80,background:`var(--bg)`},style:{flex:1,minHeight:0},actions:(0,F.jsx)(Hde,{searchOpen:u,onToggleSearch:()=>{u&&p(``),d(e=>!e)},onNewWorkspace:()=>a.setCustomPathOpen(!0),onRefresh:()=>h(!1,!0),refreshDone:g}),headerExtra:(0,F.jsxs)(F.Fragment,{children:[u&&(0,F.jsx)(Ude,{value:f,onChange:p,onClear:()=>{p(``),m.current?.focus()},inputRef:m}),_&&(0,F.jsx)(Kde,{wt:o,selectedCwd:s,homeDir:l,setSelectedCwd:c}),v&&(0,F.jsx)(Dde,{title:v.title,label:v.label})]}),children:[(0,F.jsx)(Vde,{loading:y,error:b,noSearchResults:!y&&!b&&!!x&&S.length===0}),(0,F.jsx)(Bde,{visibleGroups:S,selectedSessionId:e.selectedSessionId,selectedProject:e.selectedProject,wsQuery:x,groupCollapsed:e.groupCollapsed,hoveredGroup:e.hoveredGroup,confirmDeleteGroup:e.confirmDeleteGroup,deletingGroup:e.deletingGroup,runningSessionIds:e.runningSessionIds,runningPhases:e.runningPhases,runningPhaseSince:e.runningPhaseSince,runningBusySince:e.runningBusySince,unreadSessionIds:e.unreadSessionIds,seenSessionIds:e.seenSessionIds,interactionBadges:e.interactionBadges,setHoveredGroup:e.setHoveredGroup,setGroupCollapsed:e.setGroupCollapsed,setConfirmDeleteGroup:e.setConfirmDeleteGroup,handleDeleteGroup:e.handleDeleteGroup,handleNewSession:n,copyText:gK,handleSelectSessionFromList:t,onSessionDeleted:r,handleUnseen:e.handleUnseen,loadSessions:h})]})]})}function Jde({selectedSessionId:e,selectedSession:t,onSelectSession:n,onNewSession:r,initialSessionId:i,skipInitialProjectSelection:a,onInitialRestoreDone:o,refreshKey:s,onSessionDeleted:c,onUnseenSession:l,selectedCwd:u,onCwdChange:f,savedWorkspaces:p,onSavedWorkspacesChange:m,onOpenFile:h}){let{t:g}=I(),_=Sde({selectedSession:t,selectedSessionId:e,refreshKey:s,selectedCwdProp:u,savedWorkspaces:p,onSavedWorkspacesChange:m,onUnseenSession:l,onCwdChange:f,initialSessionId:i,skipInitialProjectSelection:a,onSelectSession:n,onInitialRestoreDone:o,onSessionDeleted:c}),{setError:v,loadSessions:y,markSeen:b,setSelectedCwd:x}=_,S=(0,d.useCallback)(async e=>{try{if((await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`HEAD`})).status===404){v(g(`sidebar.sessionDeleted`)),y(!1,!0);return}}catch{}e.cwd&&x(e.cwd),b(e.id),n(e)},[n,g,y,b,v,x]),C=(0,d.useCallback)(e=>{let t=e??_.selectedCwd;if(!t)return;let n=typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;r?.(n,t)},[_.selectedCwd,r]);return(0,F.jsx)(`div`,{"data-testid":`session-sidebar`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:(0,F.jsx)(qde,{sb:_,handleSelectSessionFromList:S,handleNewSession:C,onSessionDeleted:e=>{c?.(e),_.loadSessions(!1,!0)}})})}var Yde=e=>window.history.replaceState(null,``,e);function Xde(e){return e?`Pi Web · ${e}`:`Pi Web`}function Zde(e,t){return e&&!t}function Qde(e,t,n){return e?t:n}function $de(e,t){return!!(e&&t?.requiresTrust&&!t.trusted)}function efe(e,t){return e>0&&!t}function tfe(e,t){return!!(e&&t)}function nfe(e,t,n,r){t&&n(!1),r(t=>t===e?null:e)}function rfe(e,t,n){e&&t(),n(e=>!e)}function ife(e,t,n){e&&!t&&n(!1)}function afe(e,t,n){e?t(e=>!e):n(e=>!e)}function ofe(e){return e?fS(e)||e:null}function Q9(e){return e?.id??null}function sfe(e,t){return e?.cwd??t}function $9(e){return e?MK(e.filePath):`file:`}function cfe(){let[e,t]=(0,d.useState)(!1);(0,d.useEffect)(()=>{t(!0)},[]);let[n]=(0,d.useState)(()=>tq(new URLSearchParams(window.location.search))),{isDark:r,toggleTheme:i}=WK(),{locale:a,setLocale:o,t:s,supportedLocales:c}=I(),l=Ge();XK();let{settingsValue:u,defaultThinkingLevel:f,setDefaultThinkingLevel:p,compaction:m,retry:h,defaultProjectTrust:g,setDefaultProjectTrust:_,subagents:v,savedWorkspaces:y,handleSavedWorkspacesChange:b,widgetGeometries:x,setWidgetGeometry:S,widgetMessages:C,addWidgetMessage:w,removeWidgetMessage:T,updateWidgetMessage:E,fontScale:D,setFontScale:O}=en({isDark:r,toggleTheme:i}),[k,A]=(0,d.useState)(null),{selectedSession:j,effectiveNewSessionCwd:M,showChat:N,projectTrustCwd:ee,refreshKey:te,sessionKey:P,explorerRefreshKey:ne,setExplorerRefreshKey:re,modelsRefreshKey:ie,setModelsRefreshKey:ae,activeCwd:oe,initialCwdStatus:se,initialCwdError:ce,initialSessionRestored:le,projectTrust:ue,projectTrustDialogOpen:de,setProjectTrustDialogOpen:fe,projectTrustBusy:pe,projectTrustError:me,setProjectTrustError:he,extensionDialogActiveRef:ge,handleSelectSession:_e,handleNewSession:ve,handleSessionCreated:ye,handleAgentEnd:be,handleSessionRenamed:xe,handleSessionForked:Se,handleSessionDeleted:we,handleSessionUnseen:Te,handleCwdChange:Ee,handleTrustProject:De,handleExplorerRefresh:Oe,handleInitialRestoreDone:ke}=Sn({initialNavigation:n,onProjectSwitch:()=>{A(null),Ae(e=>e.filter(e=>e.kind!==`file`)),je(null),Yde(`/`)},onSessionSelected:e=>ife(l,e,$e),onTopPanelReset:()=>A(null)}),{setSavedTabs:Ae,setActiveSavedId:je,configTabOpen:Me,configSection:Ne,setConfigSection:Pe,configTabActive:Fe,activeFileTab:Ie,fileTabs:Le,modelConfigFocus:Re,handleOpenFile:ze,openConfigTab:Be,handleOpenModelConfig:Ve,closeConfigTab:He,handleCloseMainTab:Ue}=zK({onSessionSelected:()=>{gt(!1),l&&$e(!1)},onRefreshModels:()=>ae(e=>e+1)}),{updatesBadge:We,updateItems:Ke,updatesBannerDismissed:qe,setUpdatesBannerDismissed:Xe}=Gue({activeCwd:oe,translate:s}),Ze=(0,d.useCallback)(e=>{ze(e,fS(e),{sourceSessionId:Q9(j)})},[ze,j]),[Qe,$e]=(0,d.useState)(!0),{sidebarResizer:et,widgetPanelResizer:tt,mobileSidebarReady:nt}=zue({isMobile:l,sidebarOpen:Qe,setSidebarOpen:$e,translate:s}),rt=(0,d.useRef)(null),it=(0,d.useRef)(null),at=(0,d.useRef)(null),ot=(0,d.useRef)(null),st=Fx(),ct=(0,d.useCallback)(()=>{st.schedule(()=>{A(null)},150)},[st]),lt=st.cancel,ut=Wue({activeTopPanel:k,isMobile:l,tabBarRef:rt,sidebarTopBarRef:it,languageBtnRef:at,fontScaleBtnRef:ot}),dt=(0,d.useCallback)(e=>nfe(e,l,$e,A),[l]),ft=(0,d.useCallback)(()=>rfe(l,()=>A(null),$e),[l]),{widgetPanelOpen:pt,setWidgetPanelOpen:mt,widgetsTabActive:ht,setWidgetsTabActive:gt,extensionWidgets:_t,closedWidgets:vt,handleCloseWidget:yt,handleReopenWidget:bt,handleExtensionWidgetsChange:xt,rightSidebarOpen:St,setRightSidebarOpen:Ct,closedWidgetCount:wt}=ZK({widgetGeometries:x,setWidgetGeometry:S}),Tt=Qde(l,pt,St),{chatInputRef:Et,handleAtMention:Dt,handleAtMentions:Ot,handleFileLineMention:kt}=Lue(),At=n.sessionId;Je({onNewSession:e=>ve(`kb-${Date.now()}`,e),activeCwd:oe});let jt=Zde(le,N),Mt=rq({translate:s,closedWidgetCount:wt,configTabOpen:Me,fileTabs:Le}),Nt=ofe(oe),Pt=Xde(Nt),Ft=Q9(j),It=sfe(j,M);(0,d.useEffect)(()=>{eq(Pt)},[Pt]),(0,d.useEffect)(()=>{let e=()=>{eq(Pt)};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[Pt]);let Lt=Ye(),Rt=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(yJ,{topBarRef:it,notifyPermission:Lt,isDark:r,toggleTheme:i,updatesBadge:We,openConfigTab:Be,isMobile:l,setSidebarOpen:$e,activeTopPanel:k,setActiveTopPanel:A,cancelCloseTopPanel:lt,scheduleCloseTopPanel:ct,languageBtnRef:at,fontScaleBtnRef:ot}),efe(We,qe)&&(0,F.jsx)(Iue,{items:Ke,openConfigTab:Be,setConfigSection:Pe,onDismiss:()=>Xe(!0)}),(0,F.jsx)(Jde,{selectedSessionId:Ft,selectedSession:j,onSelectSession:_e,onNewSession:ve,initialSessionId:At,skipInitialProjectSelection:n.requestedCwd!==null,onInitialRestoreDone:ke,refreshKey:te,onSessionDeleted:we,onUnseenSession:Te,selectedCwd:It,onCwdChange:Ee,savedWorkspaces:y,onSavedWorkspacesChange:b,onOpenFile:ze})]});if(!e)return(0,F.jsx)(que,{});let zt=(0,F.jsx)(pJ,{sidebarOpen:Qe,onToggle:ft}),Bt=$de(N,ue)?(0,F.jsx)(xJ,{isMobile:l,onClick:()=>{he(null),fe(!0)}}):null,Vt=(0,F.jsx)(Kue,{panelOpen:Tt,highlighted:pt,onToggle:()=>{afe(l,mt,Ct)}});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(wn,{value:u,children:(0,F.jsx)(KK,{value:{activeTopPanel:k,toggleTopPanel:dt,closeTopPanel:()=>A(null)},children:(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)(Xr,{delayDuration:0,children:[(0,F.jsx)($ue,{}),(0,F.jsxs)(Ce,{children:[(0,F.jsxs)(`div`,{style:{display:`flex`,width:`100%`,height:`var(--app-viewport-height, 100dvh)`,paddingLeft:`env(safe-area-inset-left)`,paddingRight:`env(safe-area-inset-right)`,overflow:`hidden`,background:`var(--bg)`},children:[(0,F.jsx)(dJ,{sidebarResizer:et,sidebarOpen:Qe,mobileSidebarReady:nt,setSidebarOpen:$e,sidebarContent:Rt,translate:s}),(0,F.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`,minWidth:0},children:[(0,F.jsx)(bJ,{activeTopPanel:k,setActiveTopPanel:A,topPanelPos:ut,cancelCloseTopPanel:lt,scheduleCloseTopPanel:ct,translate:s,locale:a,setLocale:o,supportedLocales:c,fontScale:D,setFontScale:O}),(0,F.jsxs)(hK,{tabs:Mt,activeTabId:iq({configTabActive:Fe,widgetsTabActive:ht,activeFileTab:Ie}),leftExtra:zt,rightExtra:Vt,onSelectTab:e=>{let t=aq(e);gt(t.widgetsTabActive),je(t.activeSavedId)},onCloseTab:Ue,tabBarRef:rt,overlay:(0,F.jsx)(nq,{initialCwdStatus:se,requestedCwd:n.requestedCwd,initialCwdError:ce,showPlaceholder:jt,activeCwd:oe,translate:s}),children:[(0,F.jsx)(pK,{id:AK,testId:`config-tab-pane`,children:(0,F.jsx)(Rle,{configSection:Ne,setConfigSection:Pe,projectTrustCwd:ee,sessionId:Ft,closeConfigTab:He,handleOpenFile:ze,sidebarResizer:et,widgetPanelResizer:tt,modelConfigFocus:Re,defaultThinkingLevel:f,setDefaultThinkingLevel:p,compaction:m,retry:h,defaultProjectTrust:g,setDefaultProjectTrust:_,subagents:v})}),(0,F.jsx)(pK,{id:$9(Ie),testId:`file-tab-pane`,children:(0,F.jsx)(Nue,{activeFileTab:Ie,activeCwd:oe,explorerRefreshKey:ne,setExplorerRefreshKey:re,handleFileLineMention:kt,handleOpenFile:ze})}),(0,F.jsx)(pK,{id:kK,keepAlive:!0,testId:`chat-tab-pane`,scroll:`hidden`,activeWhen:N,children:(0,F.jsx)(Lle,{sessionKey:P,selectedSession:j,effectiveNewSessionCwd:M,handleAgentEnd:be,handleSessionCreated:ye,handleSessionForked:Se,modelsRefreshKey:ie,handleOpenModelConfig:Ve,chatInputRef:Et,handleOpenLinkedFile:Ze,handleSessionRenamed:xe,activeCwdName:Nt,trustWarningElement:Bt,closedWidgets:vt,handleCloseWidget:yt,handleExtensionWidgetsChange:xt,extensionDialogActiveRef:ge})}),(0,F.jsx)(pK,{id:jK,keepAlive:!0,testId:`widgets-tab-pane`,zIndex:1,activeWhen:N,children:(0,F.jsx)(Fue,{widgetGeometries:x,widgetMessages:C,addWidgetMessage:w,removeWidgetMessage:T,updateWidgetMessage:E,extensionWidgets:_t,closedWidgets:vt,handleReopenWidget:bt})})]})]}),(0,F.jsx)(uJ,{isMobile:l,rightSidebarOpen:St,rightSidebarOpenEffective:Tt,widgetPanelResizer:tt,translate:s,cwd:It,sessionId:Ft,handleOpenFile:ze,explorerRefreshKey:ne,handleExplorerRefresh:Oe,handleAtMention:Dt,handleAtMentions:Ot,openConfigTab:Be})]}),tfe(de,ee)&&ee&&(0,F.jsx)(nde,{cwd:ee,busy:pe,error:me,onCancel:()=>{pe||fe(!1)},onConfirm:()=>void De()})]})]})})})}),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Jue,{}),(0,F.jsx)(tde,{})]})]})}var lfe=class extends d.Component{constructor(...e){super(...e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){DJ(e,`render error`)}render(){return this.state.hasError?(0,F.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,height:`100vh`,color:`var(--text)`,fontSize:`var(--text-base)`},children:[(0,F.jsx)(`span`,{children:`⚠️`}),(0,F.jsx)(`span`,{children:`Something went wrong while rendering.`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{this.setState({hasError:!1})},style:{border:`1px solid var(--border)`,background:`none`,color:`var(--text)`,borderRadius:6,padding:`4px 14px`,cursor:`pointer`},children:`Try again`})]}):this.props.children}};function ufe(){return(0,d.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let e=()=>{navigator.serviceWorker.register(`/sw.js?v=0.17.5`,{scope:`/`,updateViaCache:`none`}).catch(e=>{console.error(`Failed to register the Pi Web service worker:`,e)})};if(document.readyState===`complete`){e();return}return window.addEventListener(`load`,e,{once:!0}),()=>window.removeEventListener(`load`,e)},[]),null}var dfe=`piE2eFixtureDir`;function ffe(){return typeof window>`u`?null:new URL(window.location.href).searchParams.get(`piE2eFixtureDir`)}function pfe(){if(typeof document>`u`)return;let e=ffe();e&&(document.cookie=`${dfe}=${encodeURIComponent(e)}; path=/; SameSite=Lax`)}async function mfe(){pfe(),PJ(!0),LJ();let e=FJ(`boot`),t=null;try{let n=await tt.load();e(`preferences catalog loaded`,`locale=${n.firstPaint?.locale}`);let r=n.firstPaint?.locale;(r===`en`||r===`zh-CN`)&&(t=r,document.documentElement.lang=r===`zh-CN`?`zh-CN`:`en`);let i=n.theme;if(i===`dark`?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`),i)try{localStorage.setItem(`pi-theme`,i)}catch{}}catch{}e(`root render`),window.addEventListener(`unhandledrejection`,e=>{DJ(e.reason,`unhandled promise rejection`)}),window.addEventListener(`error`,e=>{let t=(e.error instanceof Error?e.error.message:``)||e.message||``;t.includes(`ResizeObserver loop`)||t.startsWith(`Script error`)||DJ(e.error??e.message,`uncaught error`)}),(0,f.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(d.StrictMode,{children:(0,F.jsx)(lfe,{children:(0,F.jsxs)(Be,{initialLocale:t,children:[(0,F.jsx)(cfe,{}),(0,F.jsx)(ufe,{})]})})}))}mfe();export{p4 as a,i as c,a3 as i,y8 as n,I as o,S8 as r,ve as s,P3 as t};
|