@jyork0828/pi-pilot 0.0.5 → 0.0.7
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/index.js +3023 -635
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/public/assets/ArtifactsPanel-DUiRwx7S.js +1 -0
- package/public/assets/ResourcesPanel-Cn_gw159.js +19 -0
- package/public/assets/SessionTree-CBIw_kzf.js +16 -0
- package/public/assets/SettingsPage-cULKjgtu.js +51 -0
- package/public/assets/index-CX2ohSDO.js +238 -0
- package/public/assets/index-CyoTMDCN.css +1 -0
- package/public/assets/markdown-CY-Rm0E5.js +45 -0
- package/public/assets/shiki-BZ0sbaMe.js +152 -0
- package/public/index.html +12 -3
- package/public/assets/index-CBa7EReb.js +0 -411
- package/public/assets/index-DeSNeuE1.css +0 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/scss-D5BDwBP9.js","assets/ruby-CV7NnX5q.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/sql-CRqJ_cUM.js","assets/graphql-ChdNCCLP.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/cpp-DIPi6g--.js","assets/c-BIGW1oBm.js","assets/shellscript-Yzrsuije.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/php-Csjmro_R.js","assets/json-Cp-IABpG.js","assets/vue-DMJtu8ND.js","assets/svelte-DR4MIrkg.js","assets/elixir-CkH2-t6x.js","assets/SettingsPage-cULKjgtu.js","assets/markdown-CY-Rm0E5.js","assets/shiki-BZ0sbaMe.js","assets/ResourcesPanel-Cn_gw159.js","assets/SessionTree-CBIw_kzf.js","assets/ArtifactsPanel-DUiRwx7S.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var _m=Object.defineProperty;var Sc=e=>{throw TypeError(e)};var Tm=(e,t,n)=>t in e?_m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xt=(e,t,n)=>Tm(e,typeof t!="symbol"?t+"":t,n),gl=(e,t,n)=>t.has(e)||Sc("Cannot "+n);var y=(e,t,n)=>(gl(e,t,"read from private field"),n?n.call(e):t.get(e)),O=(e,t,n)=>t.has(e)?Sc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),L=(e,t,n,r)=>(gl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),$=(e,t,n)=>(gl(e,t,"access private method"),n);var To=(e,t,n,r)=>({set _(s){L(e,t,s,n)},get _(){return y(e,t,r)}});import{r as b,j as i,R as Po,M as Pm,a as Rm}from"./markdown-CY-Rm0E5.js";import{_ as z,c as Mm,a as Lm}from"./shiki-BZ0sbaMe.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var jf={exports:{}},st={},Sf={exports:{}},Nf={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* scheduler.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/(function(e){function t(M,D){var F=M.length;M.push(D);e:for(;0<F;){var Q=F-1>>>1,Z=M[Q];if(0<s(Z,D))M[Q]=D,M[F]=Z,F=Q;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var D=M[0],F=M.pop();if(F!==D){M[0]=F;e:for(var Q=0,Z=M.length,lt=Z>>>1;Q<lt;){var Me=2*(Q+1)-1,Ft=M[Me],Qe=Me+1,_e=M[Qe];if(0>s(Ft,F))Qe<Z&&0>s(_e,Ft)?(M[Q]=_e,M[Qe]=F,Q=Qe):(M[Q]=Ft,M[Me]=F,Q=Me);else if(Qe<Z&&0>s(_e,F))M[Q]=_e,M[Qe]=F,Q=Qe;else break e}}return D}function s(M,D){var F=M.sortIndex-D.sortIndex;return F!==0?F:M.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var u=[],c=[],h=1,p=null,d=3,x=!1,v=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(M){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=M)r(c),D.sortIndex=D.expirationTime,t(u,D);else break;D=n(c)}}function w(M){if(k=!1,g(M),!v)if(n(u)!==null)v=!0,Fe(S);else{var D=n(c);D!==null&&it(w,D.startTime-M)}}function S(M,D){v=!1,k&&(k=!1,f(C),C=-1),x=!0;var F=d;try{for(g(D),p=n(u);p!==null&&(!(p.expirationTime>D)||M&&!q());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,d=p.priorityLevel;var Z=Q(p.expirationTime<=D);D=e.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(u)&&r(u),g(D)}else r(u);p=n(u)}if(p!==null)var lt=!0;else{var Me=n(c);Me!==null&&it(w,Me.startTime-D),lt=!1}return lt}finally{p=null,d=F,x=!1}}var N=!1,E=null,C=-1,T=5,R=-1;function q(){return!(e.unstable_now()-R<T)}function U(){if(E!==null){var M=e.unstable_now();R=M;var D=!0;try{D=E(!0,M)}finally{D?me():(N=!1,E=null)}}else N=!1}var me;if(typeof m=="function")me=function(){m(U)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,je=ce.port2;ce.port1.onmessage=U,me=function(){je.postMessage(null)}}else me=function(){j(U,0)};function Fe(M){E=M,N||(N=!0,me())}function it(M,D){C=j(function(){M(e.unstable_now())},D)}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(M){M.callback=null},e.unstable_continueExecution=function(){v||x||(v=!0,Fe(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(M){switch(d){case 1:case 2:case 3:var D=3;break;default:D=d}var F=d;d=D;try{return M()}finally{d=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,D){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var F=d;d=M;try{return D()}finally{d=F}},e.unstable_scheduleCallback=function(M,D,F){var Q=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?Q+F:Q):F=Q,M){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=F+Z,M={id:h++,callback:D,priorityLevel:M,startTime:F,expirationTime:Z,sortIndex:-1},F>Q?(M.sortIndex=F,t(c,M),n(u)===null&&M===n(c)&&(k?(f(C),C=-1):k=!0,it(w,F-Q))):(M.sortIndex=Z,t(u,M),v||x||(v=!0,Fe(S))),M},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(M){var D=d;return function(){var F=d;d=D;try{return M.apply(this,arguments)}finally{d=F}}}})(Nf);Sf.exports=Nf;var Im=Sf.exports;/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-dom.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Om=b,rt=Im;function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;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."}var Cf=new Set,qs={};function xr(e,t){es(e,t),es(e+"Capture",t)}function es(e,t){for(qs[e]=t,e=0;e<t.length;e++)Cf.add(t[e])}var Zt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ea=Object.prototype.hasOwnProperty,Dm=/^[: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]*$/,Nc={},Cc={};function Am(e){return ea.call(Cc,e)?!0:ea.call(Nc,e)?!1:Dm.test(e)?Cc[e]=!0:(Nc[e]=!0,!1)}function Fm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zm(e,t,n,r){if(t===null||typeof t>"u"||Fm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function qe(e,t,n,r,s,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new qe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Re[e]=new qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var mu=/[\-:]([a-z])/g;function gu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(mu,gu);Re[t]=new qe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mu,gu);Re[t]=new qe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mu,gu);Re[t]=new qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new qe(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function xu(e,t,n,r){var s=Re.hasOwnProperty(t)?Re[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zm(t,n,s,r)&&(n=null),r||s===null?Am(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var rn=Om.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ro=Symbol.for("react.element"),br=Symbol.for("react.portal"),kr=Symbol.for("react.fragment"),yu=Symbol.for("react.strict_mode"),ta=Symbol.for("react.profiler"),Ef=Symbol.for("react.provider"),_f=Symbol.for("react.context"),vu=Symbol.for("react.forward_ref"),na=Symbol.for("react.suspense"),ra=Symbol.for("react.suspense_list"),wu=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),Tf=Symbol.for("react.offscreen"),Ec=Symbol.iterator;function ps(e){return e===null||typeof e!="object"?null:(e=Ec&&e[Ec]||e["@@iterator"],typeof e=="function"?e:null)}var ue=Object.assign,xl;function Ss(e){if(xl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);xl=t&&t[1]||""}return`
|
|
19
|
+
`+xl+e}var yl=!1;function vl(e,t){if(!e||yl)return"";yl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
|
|
20
|
+
`),o=r.stack.split(`
|
|
21
|
+
`),l=s.length-1,a=o.length-1;1<=l&&0<=a&&s[l]!==o[a];)a--;for(;1<=l&&0<=a;l--,a--)if(s[l]!==o[a]){if(l!==1||a!==1)do if(l--,a--,0>a||s[l]!==o[a]){var u=`
|
|
22
|
+
`+s[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=a);break}}}finally{yl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ss(e):""}function Um(e){switch(e.tag){case 5:return Ss(e.type);case 16:return Ss("Lazy");case 13:return Ss("Suspense");case 19:return Ss("SuspenseList");case 0:case 2:case 15:return e=vl(e.type,!1),e;case 11:return e=vl(e.type.render,!1),e;case 1:return e=vl(e.type,!0),e;default:return""}}function sa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case kr:return"Fragment";case br:return"Portal";case ta:return"Profiler";case yu:return"StrictMode";case na:return"Suspense";case ra:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _f:return(e.displayName||"Context")+".Consumer";case Ef:return(e._context.displayName||"Context")+".Provider";case vu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wu:return t=e.displayName||null,t!==null?t:sa(e.type)||"Memo";case fn:t=e._payload,e=e._init;try{return sa(e(t))}catch{}}return null}function $m(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sa(t);case 8:return t===yu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function zn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bm(e){var t=Pf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mo(e){e._valueTracker||(e._valueTracker=Bm(e))}function Rf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function di(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function oa(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function _c(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=zn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mf(e,t){t=t.checked,t!=null&&xu(e,"checked",t,!1)}function ia(e,t){Mf(e,t);var n=zn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?la(e,t.type,n):t.hasOwnProperty("defaultValue")&&la(e,t.type,zn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function la(e,t,n){(t!=="number"||di(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ns=Array.isArray;function Lr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+zn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function aa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return ue({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(_(92));if(Ns(n)){if(1<n.length)throw Error(_(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:zn(n)}}function Lf(e,t){var n=zn(t.value),r=zn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Rc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function If(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ua(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?If(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Lo,Of=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Lo=Lo||document.createElement("div"),Lo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Lo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Qs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qm=["Webkit","ms","Moz","O"];Object.keys(Rs).forEach(function(e){qm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rs[t]=Rs[e]})});function Df(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Rs.hasOwnProperty(e)&&Rs[e]?(""+t).trim():t+"px"}function Af(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Df(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Qm=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ca(e,t){if(t){if(Qm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function da(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 fa=null;function bu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pa=null,Ir=null,Or=null;function Mc(e){if(e=ko(e)){if(typeof pa!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Gi(t),pa(e.stateNode,e.type,t))}}function Ff(e){Ir?Or?Or.push(e):Or=[e]:Ir=e}function zf(){if(Ir){var e=Ir,t=Or;if(Or=Ir=null,Mc(e),t)for(e=0;e<t.length;e++)Mc(t[e])}}function Uf(e,t){return e(t)}function $f(){}var wl=!1;function Bf(e,t,n){if(wl)return e(t,n);wl=!0;try{return Uf(e,t,n)}finally{wl=!1,(Ir!==null||Or!==null)&&($f(),zf())}}function Hs(e,t){var n=e.stateNode;if(n===null)return null;var r=Gi(n);if(r===null)return null;n=r[t];e: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 e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(_(231,t,typeof n));return n}var ha=!1;if(Zt)try{var hs={};Object.defineProperty(hs,"passive",{get:function(){ha=!0}}),window.addEventListener("test",hs,hs),window.removeEventListener("test",hs,hs)}catch{ha=!1}function Hm(e,t,n,r,s,o,l,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var Ms=!1,fi=null,pi=!1,ma=null,Vm={onError:function(e){Ms=!0,fi=e}};function Wm(e,t,n,r,s,o,l,a,u){Ms=!1,fi=null,Hm.apply(Vm,arguments)}function Km(e,t,n,r,s,o,l,a,u){if(Wm.apply(this,arguments),Ms){if(Ms){var c=fi;Ms=!1,fi=null}else throw Error(_(198));pi||(pi=!0,ma=c)}}function yr(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 qf(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 Lc(e){if(yr(e)!==e)throw Error(_(188))}function Gm(e){var t=e.alternate;if(!t){if(t=yr(e),t===null)throw Error(_(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Lc(s),e;if(o===r)return Lc(s),t;o=o.sibling}throw Error(_(188))}if(n.return!==r.return)n=s,r=o;else{for(var l=!1,a=s.child;a;){if(a===n){l=!0,n=s,r=o;break}if(a===r){l=!0,r=s,n=o;break}a=a.sibling}if(!l){for(a=o.child;a;){if(a===n){l=!0,n=o,r=s;break}if(a===r){l=!0,r=o,n=s;break}a=a.sibling}if(!l)throw Error(_(189))}}if(n.alternate!==r)throw Error(_(190))}if(n.tag!==3)throw Error(_(188));return n.stateNode.current===n?e:t}function Qf(e){return e=Gm(e),e!==null?Hf(e):null}function Hf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Hf(e);if(t!==null)return t;e=e.sibling}return null}var Vf=rt.unstable_scheduleCallback,Ic=rt.unstable_cancelCallback,Xm=rt.unstable_shouldYield,Ym=rt.unstable_requestPaint,ge=rt.unstable_now,Jm=rt.unstable_getCurrentPriorityLevel,ku=rt.unstable_ImmediatePriority,Wf=rt.unstable_UserBlockingPriority,hi=rt.unstable_NormalPriority,Zm=rt.unstable_LowPriority,Kf=rt.unstable_IdlePriority,Hi=null,Dt=null;function eg(e){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(Hi,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:rg,tg=Math.log,ng=Math.LN2;function rg(e){return e>>>=0,e===0?32:31-(tg(e)/ng|0)|0}var Io=64,Oo=4194304;function Cs(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~s;a!==0?r=Cs(a):(o&=l,o!==0&&(r=Cs(o)))}else l=n&~s,l!==0?r=Cs(l):o!==0&&(r=Cs(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-St(t),s=1<<n,r|=e[n],t&=~s;return r}function sg(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function og(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var l=31-St(o),a=1<<l,u=s[l];u===-1?(!(a&n)||a&r)&&(s[l]=sg(a,t)):u<=t&&(e.expiredLanes|=a),o&=~a}}function ga(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gf(){var e=Io;return Io<<=1,!(Io&4194240)&&(Io=64),e}function bl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function ig(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-St(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function ju(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Y=0;function Xf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Yf,Su,Jf,Zf,ep,xa=!1,Do=[],Pn=null,Rn=null,Mn=null,Vs=new Map,Ws=new Map,gn=[],lg="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 submit".split(" ");function Oc(e,t){switch(e){case"focusin":case"focusout":Pn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":Vs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ws.delete(t.pointerId)}}function ms(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=ko(t),t!==null&&Su(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ag(e,t,n,r,s){switch(t){case"focusin":return Pn=ms(Pn,e,t,n,r,s),!0;case"dragenter":return Rn=ms(Rn,e,t,n,r,s),!0;case"mouseover":return Mn=ms(Mn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Vs.set(o,ms(Vs.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Ws.set(o,ms(Ws.get(o)||null,e,t,n,r,s)),!0}return!1}function tp(e){var t=Kn(e.target);if(t!==null){var n=yr(t);if(n!==null){if(t=n.tag,t===13){if(t=qf(n),t!==null){e.blockedOn=t,ep(e.priority,function(){Jf(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 Jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ya(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fa=r,n.target.dispatchEvent(r),fa=null}else return t=ko(n),t!==null&&Su(t),e.blockedOn=n,!1;t.shift()}return!0}function Dc(e,t,n){Jo(e)&&n.delete(t)}function ug(){xa=!1,Pn!==null&&Jo(Pn)&&(Pn=null),Rn!==null&&Jo(Rn)&&(Rn=null),Mn!==null&&Jo(Mn)&&(Mn=null),Vs.forEach(Dc),Ws.forEach(Dc)}function gs(e,t){e.blockedOn===t&&(e.blockedOn=null,xa||(xa=!0,rt.unstable_scheduleCallback(rt.unstable_NormalPriority,ug)))}function Ks(e){function t(s){return gs(s,e)}if(0<Do.length){gs(Do[0],e);for(var n=1;n<Do.length;n++){var r=Do[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Pn!==null&&gs(Pn,e),Rn!==null&&gs(Rn,e),Mn!==null&&gs(Mn,e),Vs.forEach(t),Ws.forEach(t),n=0;n<gn.length;n++)r=gn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<gn.length&&(n=gn[0],n.blockedOn===null);)tp(n),n.blockedOn===null&&gn.shift()}var Dr=rn.ReactCurrentBatchConfig,gi=!0;function cg(e,t,n,r){var s=Y,o=Dr.transition;Dr.transition=null;try{Y=1,Nu(e,t,n,r)}finally{Y=s,Dr.transition=o}}function dg(e,t,n,r){var s=Y,o=Dr.transition;Dr.transition=null;try{Y=4,Nu(e,t,n,r)}finally{Y=s,Dr.transition=o}}function Nu(e,t,n,r){if(gi){var s=ya(e,t,n,r);if(s===null)Rl(e,t,r,xi,n),Oc(e,r);else if(ag(s,e,t,n,r))r.stopPropagation();else if(Oc(e,r),t&4&&-1<lg.indexOf(e)){for(;s!==null;){var o=ko(s);if(o!==null&&Yf(o),o=ya(e,t,n,r),o===null&&Rl(e,t,r,xi,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Rl(e,t,r,null,n)}}var xi=null;function ya(e,t,n,r){if(xi=null,e=bu(r),e=Kn(e),e!==null)if(t=yr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=qf(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 xi=e,null}function np(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Jm()){case ku:return 1;case Wf:return 4;case hi:case Zm:return 16;case Kf:return 536870912;default:return 16}default:return 16}}var _n=null,Cu=null,Zo=null;function rp(){if(Zo)return Zo;var e,t=Cu,n=t.length,r,s="value"in _n?_n.value:_n.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===s[o-r];r++);return Zo=s.slice(e,1<r?1-r:void 0)}function ei(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 Ao(){return!0}function Ac(){return!1}function ot(e){function t(n,r,s,o,l){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ao:Ac,this.isPropagationStopped=Ac,this}return ue(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ao)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ao)},persist:function(){},isPersistent:Ao}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Eu=ot(ls),bo=ue({},ls,{view:0,detail:0}),fg=ot(bo),kl,jl,xs,Vi=ue({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_u,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!==xs&&(xs&&e.type==="mousemove"?(kl=e.screenX-xs.screenX,jl=e.screenY-xs.screenY):jl=kl=0,xs=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:jl}}),Fc=ot(Vi),pg=ue({},Vi,{dataTransfer:0}),hg=ot(pg),mg=ue({},bo,{relatedTarget:0}),Sl=ot(mg),gg=ue({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),xg=ot(gg),yg=ue({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vg=ot(yg),wg=ue({},ls,{data:0}),zc=ot(wg),bg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kg={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"},jg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jg[e])?!!t[e]:!1}function _u(){return Sg}var Ng=ue({},bo,{key:function(e){if(e.key){var t=bg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ei(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_u,charCode:function(e){return e.type==="keypress"?ei(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ei(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cg=ot(Ng),Eg=ue({},Vi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uc=ot(Eg),_g=ue({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_u}),Tg=ot(_g),Pg=ue({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rg=ot(Pg),Mg=ue({},Vi,{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}),Lg=ot(Mg),Ig=[9,13,27,32],Tu=Zt&&"CompositionEvent"in window,Ls=null;Zt&&"documentMode"in document&&(Ls=document.documentMode);var Og=Zt&&"TextEvent"in window&&!Ls,sp=Zt&&(!Tu||Ls&&8<Ls&&11>=Ls),$c=" ",Bc=!1;function op(e,t){switch(e){case"keyup":return Ig.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ip(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jr=!1;function Dg(e,t){switch(e){case"compositionend":return ip(t);case"keypress":return t.which!==32?null:(Bc=!0,$c);case"textInput":return e=t.data,e===$c&&Bc?null:e;default:return null}}function Ag(e,t){if(jr)return e==="compositionend"||!Tu&&op(e,t)?(e=rp(),Zo=Cu=_n=null,jr=!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 sp&&t.locale!=="ko"?null:t.data;default:return null}}var Fg={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 qc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Fg[e.type]:t==="textarea"}function lp(e,t,n,r){Ff(r),t=yi(t,"onChange"),0<t.length&&(n=new Eu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Is=null,Gs=null;function zg(e){yp(e,0)}function Wi(e){var t=Cr(e);if(Rf(t))return e}function Ug(e,t){if(e==="change")return t}var ap=!1;if(Zt){var Nl;if(Zt){var Cl="oninput"in document;if(!Cl){var Qc=document.createElement("div");Qc.setAttribute("oninput","return;"),Cl=typeof Qc.oninput=="function"}Nl=Cl}else Nl=!1;ap=Nl&&(!document.documentMode||9<document.documentMode)}function Hc(){Is&&(Is.detachEvent("onpropertychange",up),Gs=Is=null)}function up(e){if(e.propertyName==="value"&&Wi(Gs)){var t=[];lp(t,Gs,e,bu(e)),Bf(zg,t)}}function $g(e,t,n){e==="focusin"?(Hc(),Is=t,Gs=n,Is.attachEvent("onpropertychange",up)):e==="focusout"&&Hc()}function Bg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wi(Gs)}function qg(e,t){if(e==="click")return Wi(t)}function Qg(e,t){if(e==="input"||e==="change")return Wi(t)}function Hg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ct=typeof Object.is=="function"?Object.is:Hg;function Xs(e,t){if(Ct(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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 s=n[r];if(!ea.call(t,s)||!Ct(e[s],t[s]))return!1}return!0}function Vc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wc(e,t){var n=Vc(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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vc(n)}}function cp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dp(){for(var e=window,t=di();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=di(e.document)}return t}function Pu(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")}function Vg(e){var t=dp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&cp(n.ownerDocument.documentElement,n)){if(r!==null&&Pu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=Wc(n,o);var l=Wc(n,r);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Wg=Zt&&"documentMode"in document&&11>=document.documentMode,Sr=null,va=null,Os=null,wa=!1;function Kc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wa||Sr==null||Sr!==di(r)||(r=Sr,"selectionStart"in r&&Pu(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}),Os&&Xs(Os,r)||(Os=r,r=yi(va,"onSelect"),0<r.length&&(t=new Eu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function Fo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Nr={animationend:Fo("Animation","AnimationEnd"),animationiteration:Fo("Animation","AnimationIteration"),animationstart:Fo("Animation","AnimationStart"),transitionend:Fo("Transition","TransitionEnd")},El={},fp={};Zt&&(fp=document.createElement("div").style,"AnimationEvent"in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),"TransitionEvent"in window||delete Nr.transitionend.transition);function Ki(e){if(El[e])return El[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fp)return El[e]=t[n];return e}var pp=Ki("animationend"),hp=Ki("animationiteration"),mp=Ki("animationstart"),gp=Ki("transitionend"),xp=new Map,Gc="abort auxClick 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(" ");function $n(e,t){xp.set(e,t),xr(t,[e])}for(var _l=0;_l<Gc.length;_l++){var Tl=Gc[_l],Kg=Tl.toLowerCase(),Gg=Tl[0].toUpperCase()+Tl.slice(1);$n(Kg,"on"+Gg)}$n(pp,"onAnimationEnd");$n(hp,"onAnimationIteration");$n(mp,"onAnimationStart");$n("dblclick","onDoubleClick");$n("focusin","onFocus");$n("focusout","onBlur");$n(gp,"onTransitionEnd");es("onMouseEnter",["mouseout","mouseover"]);es("onMouseLeave",["mouseout","mouseover"]);es("onPointerEnter",["pointerout","pointerover"]);es("onPointerLeave",["pointerout","pointerover"]);xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xr("onBeforeInput",["compositionend","keypress","textInput","paste"]);xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Es="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(" "),Xg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Es));function Xc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Km(r,t,void 0,e),e.currentTarget=null}function yp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var l=r.length-1;0<=l;l--){var a=r[l],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==o&&s.isPropagationStopped())break e;Xc(s,a,c),o=u}else for(l=0;l<r.length;l++){if(a=r[l],u=a.instance,c=a.currentTarget,a=a.listener,u!==o&&s.isPropagationStopped())break e;Xc(s,a,c),o=u}}}if(pi)throw e=ma,pi=!1,ma=null,e}function ne(e,t){var n=t[Na];n===void 0&&(n=t[Na]=new Set);var r=e+"__bubble";n.has(r)||(vp(t,e,2,!1),n.add(r))}function Pl(e,t,n){var r=0;t&&(r|=4),vp(n,e,r,t)}var zo="_reactListening"+Math.random().toString(36).slice(2);function Ys(e){if(!e[zo]){e[zo]=!0,Cf.forEach(function(n){n!=="selectionchange"&&(Xg.has(n)||Pl(n,!1,e),Pl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zo]||(t[zo]=!0,Pl("selectionchange",!1,t))}}function vp(e,t,n,r){switch(np(t)){case 1:var s=cg;break;case 4:s=dg;break;default:s=Nu}n=s.bind(null,t,n,e),s=void 0,!ha||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Rl(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(l===4)for(l=r.return;l!==null;){var u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;l=l.return}for(;a!==null;){if(l=Kn(a),l===null)return;if(u=l.tag,u===5||u===6){r=o=l;continue e}a=a.parentNode}}r=r.return}Bf(function(){var c=o,h=bu(n),p=[];e:{var d=xp.get(e);if(d!==void 0){var x=Eu,v=e;switch(e){case"keypress":if(ei(n)===0)break e;case"keydown":case"keyup":x=Cg;break;case"focusin":v="focus",x=Sl;break;case"focusout":v="blur",x=Sl;break;case"beforeblur":case"afterblur":x=Sl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Fc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=hg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=Tg;break;case pp:case hp:case mp:x=xg;break;case gp:x=Rg;break;case"scroll":x=fg;break;case"wheel":x=Lg;break;case"copy":case"cut":case"paste":x=vg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Uc}var k=(t&4)!==0,j=!k&&e==="scroll",f=k?d!==null?d+"Capture":null:d;k=[];for(var m=c,g;m!==null;){g=m;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,f!==null&&(w=Hs(m,f),w!=null&&k.push(Js(m,w,g)))),j)break;m=m.return}0<k.length&&(d=new x(d,v,null,n,h),p.push({event:d,listeners:k}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",d&&n!==fa&&(v=n.relatedTarget||n.fromElement)&&(Kn(v)||v[en]))break e;if((x||d)&&(d=h.window===h?h:(d=h.ownerDocument)?d.defaultView||d.parentWindow:window,x?(v=n.relatedTarget||n.toElement,x=c,v=v?Kn(v):null,v!==null&&(j=yr(v),v!==j||v.tag!==5&&v.tag!==6)&&(v=null)):(x=null,v=c),x!==v)){if(k=Fc,w="onMouseLeave",f="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(k=Uc,w="onPointerLeave",f="onPointerEnter",m="pointer"),j=x==null?d:Cr(x),g=v==null?d:Cr(v),d=new k(w,m+"leave",x,n,h),d.target=j,d.relatedTarget=g,w=null,Kn(h)===c&&(k=new k(f,m+"enter",v,n,h),k.target=g,k.relatedTarget=j,w=k),j=w,x&&v)t:{for(k=x,f=v,m=0,g=k;g;g=vr(g))m++;for(g=0,w=f;w;w=vr(w))g++;for(;0<m-g;)k=vr(k),m--;for(;0<g-m;)f=vr(f),g--;for(;m--;){if(k===f||f!==null&&k===f.alternate)break t;k=vr(k),f=vr(f)}k=null}else k=null;x!==null&&Yc(p,d,x,k,!1),v!==null&&j!==null&&Yc(p,j,v,k,!0)}}e:{if(d=c?Cr(c):window,x=d.nodeName&&d.nodeName.toLowerCase(),x==="select"||x==="input"&&d.type==="file")var S=Ug;else if(qc(d))if(ap)S=Qg;else{S=Bg;var N=$g}else(x=d.nodeName)&&x.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(S=qg);if(S&&(S=S(e,c))){lp(p,S,n,h);break e}N&&N(e,d,c),e==="focusout"&&(N=d._wrapperState)&&N.controlled&&d.type==="number"&&la(d,"number",d.value)}switch(N=c?Cr(c):window,e){case"focusin":(qc(N)||N.contentEditable==="true")&&(Sr=N,va=c,Os=null);break;case"focusout":Os=va=Sr=null;break;case"mousedown":wa=!0;break;case"contextmenu":case"mouseup":case"dragend":wa=!1,Kc(p,n,h);break;case"selectionchange":if(Wg)break;case"keydown":case"keyup":Kc(p,n,h)}var E;if(Tu)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else jr?op(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(sp&&n.locale!=="ko"&&(jr||C!=="onCompositionStart"?C==="onCompositionEnd"&&jr&&(E=rp()):(_n=h,Cu="value"in _n?_n.value:_n.textContent,jr=!0)),N=yi(c,C),0<N.length&&(C=new zc(C,e,null,n,h),p.push({event:C,listeners:N}),E?C.data=E:(E=ip(n),E!==null&&(C.data=E)))),(E=Og?Dg(e,n):Ag(e,n))&&(c=yi(c,"onBeforeInput"),0<c.length&&(h=new zc("onBeforeInput","beforeinput",null,n,h),p.push({event:h,listeners:c}),h.data=E))}yp(p,t)})}function Js(e,t,n){return{instance:e,listener:t,currentTarget:n}}function yi(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Hs(e,n),o!=null&&r.unshift(Js(e,o,s)),o=Hs(e,t),o!=null&&r.push(Js(e,o,s))),e=e.return}return r}function vr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Yc(e,t,n,r,s){for(var o=t._reactName,l=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,s?(u=Hs(n,o),u!=null&&l.unshift(Js(n,u,a))):s||(u=Hs(n,o),u!=null&&l.push(Js(n,u,a)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var Yg=/\r\n?/g,Jg=/\u0000|\uFFFD/g;function Jc(e){return(typeof e=="string"?e:""+e).replace(Yg,`
|
|
23
|
+
`).replace(Jg,"")}function Uo(e,t,n){if(t=Jc(t),Jc(e)!==t&&n)throw Error(_(425))}function vi(){}var ba=null,ka=null;function ja(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sa=typeof setTimeout=="function"?setTimeout:void 0,Zg=typeof clearTimeout=="function"?clearTimeout:void 0,Zc=typeof Promise=="function"?Promise:void 0,ex=typeof queueMicrotask=="function"?queueMicrotask:typeof Zc<"u"?function(e){return Zc.resolve(null).then(e).catch(tx)}:Sa;function tx(e){setTimeout(function(){throw e})}function Ml(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ks(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ks(t)}function Ln(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==="$?")break;if(t==="/$")return null}}return e}function ed(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var as=Math.random().toString(36).slice(2),It="__reactFiber$"+as,Zs="__reactProps$"+as,en="__reactContainer$"+as,Na="__reactEvents$"+as,nx="__reactListeners$"+as,rx="__reactHandles$"+as;function Kn(e){var t=e[It];if(t)return t;for(var n=e.parentNode;n;){if(t=n[en]||n[It]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ed(e);e!==null;){if(n=e[It])return n;e=ed(e)}return t}e=n,n=e.parentNode}return null}function ko(e){return e=e[It]||e[en],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function Gi(e){return e[Zs]||null}var Ca=[],Er=-1;function Bn(e){return{current:e}}function se(e){0>Er||(e.current=Ca[Er],Ca[Er]=null,Er--)}function ee(e,t){Er++,Ca[Er]=e.current,e.current=t}var Un={},Ae=Bn(Un),Ge=Bn(!1),ur=Un;function ts(e,t){var n=e.type.contextTypes;if(!n)return Un;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Xe(e){return e=e.childContextTypes,e!=null}function wi(){se(Ge),se(Ae)}function td(e,t,n){if(Ae.current!==Un)throw Error(_(168));ee(Ae,t),ee(Ge,n)}function wp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(_(108,$m(e)||"Unknown",s));return ue({},n,r)}function bi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,ur=Ae.current,ee(Ae,e),ee(Ge,Ge.current),!0}function nd(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=wp(e,t,ur),r.__reactInternalMemoizedMergedChildContext=e,se(Ge),se(Ae),ee(Ae,e)):se(Ge),ee(Ge,n)}var qt=null,Xi=!1,Ll=!1;function bp(e){qt===null?qt=[e]:qt.push(e)}function sx(e){Xi=!0,bp(e)}function qn(){if(!Ll&&qt!==null){Ll=!0;var e=0,t=Y;try{var n=qt;for(Y=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}qt=null,Xi=!1}catch(s){throw qt!==null&&(qt=qt.slice(e+1)),Vf(ku,qn),s}finally{Y=t,Ll=!1}}return null}var _r=[],Tr=0,ki=null,ji=0,ct=[],dt=0,cr=null,Kt=1,Gt="";function Vn(e,t){_r[Tr++]=ji,_r[Tr++]=ki,ki=e,ji=t}function kp(e,t,n){ct[dt++]=Kt,ct[dt++]=Gt,ct[dt++]=cr,cr=e;var r=Kt;e=Gt;var s=32-St(r)-1;r&=~(1<<s),n+=1;var o=32-St(t)+s;if(30<o){var l=s-s%5;o=(r&(1<<l)-1).toString(32),r>>=l,s-=l,Kt=1<<32-St(t)+s|n<<s|r,Gt=o+e}else Kt=1<<o|n<<s|r,Gt=e}function Ru(e){e.return!==null&&(Vn(e,1),kp(e,1,0))}function Mu(e){for(;e===ki;)ki=_r[--Tr],_r[Tr]=null,ji=_r[--Tr],_r[Tr]=null;for(;e===cr;)cr=ct[--dt],ct[dt]=null,Gt=ct[--dt],ct[dt]=null,Kt=ct[--dt],ct[dt]=null}var nt=null,tt=null,oe=!1,kt=null;function jp(e,t){var n=pt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function rd(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,nt=e,tt=Ln(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,nt=e,tt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=cr!==null?{id:Kt,overflow:Gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,nt=e,tt=null,!0):!1;default:return!1}}function Ea(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _a(e){if(oe){var t=tt;if(t){var n=t;if(!rd(e,t)){if(Ea(e))throw Error(_(418));t=Ln(n.nextSibling);var r=nt;t&&rd(e,t)?jp(r,n):(e.flags=e.flags&-4097|2,oe=!1,nt=e)}}else{if(Ea(e))throw Error(_(418));e.flags=e.flags&-4097|2,oe=!1,nt=e}}}function sd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;nt=e}function $o(e){if(e!==nt)return!1;if(!oe)return sd(e),oe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ja(e.type,e.memoizedProps)),t&&(t=tt)){if(Ea(e))throw Sp(),Error(_(418));for(;t;)jp(e,t),t=Ln(t.nextSibling)}if(sd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tt=Ln(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tt=null}}else tt=nt?Ln(e.stateNode.nextSibling):null;return!0}function Sp(){for(var e=tt;e;)e=Ln(e.nextSibling)}function ns(){tt=nt=null,oe=!1}function Lu(e){kt===null?kt=[e]:kt.push(e)}var ox=rn.ReactCurrentBatchConfig;function ys(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(_(309));var r=n.stateNode}if(!r)throw Error(_(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(l){var a=s.refs;l===null?delete a[o]:a[o]=l},t._stringRef=o,t)}if(typeof e!="string")throw Error(_(284));if(!n._owner)throw Error(_(290,e))}return e}function Bo(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function od(e){var t=e._init;return t(e._payload)}function Np(e){function t(f,m){if(e){var g=f.deletions;g===null?(f.deletions=[m],f.flags|=16):g.push(m)}}function n(f,m){if(!e)return null;for(;m!==null;)t(f,m),m=m.sibling;return null}function r(f,m){for(f=new Map;m!==null;)m.key!==null?f.set(m.key,m):f.set(m.index,m),m=m.sibling;return f}function s(f,m){return f=An(f,m),f.index=0,f.sibling=null,f}function o(f,m,g){return f.index=g,e?(g=f.alternate,g!==null?(g=g.index,g<m?(f.flags|=2,m):g):(f.flags|=2,m)):(f.flags|=1048576,m)}function l(f){return e&&f.alternate===null&&(f.flags|=2),f}function a(f,m,g,w){return m===null||m.tag!==6?(m=Ul(g,f.mode,w),m.return=f,m):(m=s(m,g),m.return=f,m)}function u(f,m,g,w){var S=g.type;return S===kr?h(f,m,g.props.children,w,g.key):m!==null&&(m.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===fn&&od(S)===m.type)?(w=s(m,g.props),w.ref=ys(f,m,g),w.return=f,w):(w=li(g.type,g.key,g.props,null,f.mode,w),w.ref=ys(f,m,g),w.return=f,w)}function c(f,m,g,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==g.containerInfo||m.stateNode.implementation!==g.implementation?(m=$l(g,f.mode,w),m.return=f,m):(m=s(m,g.children||[]),m.return=f,m)}function h(f,m,g,w,S){return m===null||m.tag!==7?(m=ar(g,f.mode,w,S),m.return=f,m):(m=s(m,g),m.return=f,m)}function p(f,m,g){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Ul(""+m,f.mode,g),m.return=f,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ro:return g=li(m.type,m.key,m.props,null,f.mode,g),g.ref=ys(f,null,m),g.return=f,g;case br:return m=$l(m,f.mode,g),m.return=f,m;case fn:var w=m._init;return p(f,w(m._payload),g)}if(Ns(m)||ps(m))return m=ar(m,f.mode,g,null),m.return=f,m;Bo(f,m)}return null}function d(f,m,g,w){var S=m!==null?m.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:a(f,m,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ro:return g.key===S?u(f,m,g,w):null;case br:return g.key===S?c(f,m,g,w):null;case fn:return S=g._init,d(f,m,S(g._payload),w)}if(Ns(g)||ps(g))return S!==null?null:h(f,m,g,w,null);Bo(f,g)}return null}function x(f,m,g,w,S){if(typeof w=="string"&&w!==""||typeof w=="number")return f=f.get(g)||null,a(m,f,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ro:return f=f.get(w.key===null?g:w.key)||null,u(m,f,w,S);case br:return f=f.get(w.key===null?g:w.key)||null,c(m,f,w,S);case fn:var N=w._init;return x(f,m,g,N(w._payload),S)}if(Ns(w)||ps(w))return f=f.get(g)||null,h(m,f,w,S,null);Bo(m,w)}return null}function v(f,m,g,w){for(var S=null,N=null,E=m,C=m=0,T=null;E!==null&&C<g.length;C++){E.index>C?(T=E,E=null):T=E.sibling;var R=d(f,E,g[C],w);if(R===null){E===null&&(E=T);break}e&&E&&R.alternate===null&&t(f,E),m=o(R,m,C),N===null?S=R:N.sibling=R,N=R,E=T}if(C===g.length)return n(f,E),oe&&Vn(f,C),S;if(E===null){for(;C<g.length;C++)E=p(f,g[C],w),E!==null&&(m=o(E,m,C),N===null?S=E:N.sibling=E,N=E);return oe&&Vn(f,C),S}for(E=r(f,E);C<g.length;C++)T=x(E,f,C,g[C],w),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?C:T.key),m=o(T,m,C),N===null?S=T:N.sibling=T,N=T);return e&&E.forEach(function(q){return t(f,q)}),oe&&Vn(f,C),S}function k(f,m,g,w){var S=ps(g);if(typeof S!="function")throw Error(_(150));if(g=S.call(g),g==null)throw Error(_(151));for(var N=S=null,E=m,C=m=0,T=null,R=g.next();E!==null&&!R.done;C++,R=g.next()){E.index>C?(T=E,E=null):T=E.sibling;var q=d(f,E,R.value,w);if(q===null){E===null&&(E=T);break}e&&E&&q.alternate===null&&t(f,E),m=o(q,m,C),N===null?S=q:N.sibling=q,N=q,E=T}if(R.done)return n(f,E),oe&&Vn(f,C),S;if(E===null){for(;!R.done;C++,R=g.next())R=p(f,R.value,w),R!==null&&(m=o(R,m,C),N===null?S=R:N.sibling=R,N=R);return oe&&Vn(f,C),S}for(E=r(f,E);!R.done;C++,R=g.next())R=x(E,f,C,R.value,w),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?C:R.key),m=o(R,m,C),N===null?S=R:N.sibling=R,N=R);return e&&E.forEach(function(U){return t(f,U)}),oe&&Vn(f,C),S}function j(f,m,g,w){if(typeof g=="object"&&g!==null&&g.type===kr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ro:e:{for(var S=g.key,N=m;N!==null;){if(N.key===S){if(S=g.type,S===kr){if(N.tag===7){n(f,N.sibling),m=s(N,g.props.children),m.return=f,f=m;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===fn&&od(S)===N.type){n(f,N.sibling),m=s(N,g.props),m.ref=ys(f,N,g),m.return=f,f=m;break e}n(f,N);break}else t(f,N);N=N.sibling}g.type===kr?(m=ar(g.props.children,f.mode,w,g.key),m.return=f,f=m):(w=li(g.type,g.key,g.props,null,f.mode,w),w.ref=ys(f,m,g),w.return=f,f=w)}return l(f);case br:e:{for(N=g.key;m!==null;){if(m.key===N)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){n(f,m.sibling),m=s(m,g.children||[]),m.return=f,f=m;break e}else{n(f,m);break}else t(f,m);m=m.sibling}m=$l(g,f.mode,w),m.return=f,f=m}return l(f);case fn:return N=g._init,j(f,m,N(g._payload),w)}if(Ns(g))return v(f,m,g,w);if(ps(g))return k(f,m,g,w);Bo(f,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,m!==null&&m.tag===6?(n(f,m.sibling),m=s(m,g),m.return=f,f=m):(n(f,m),m=Ul(g,f.mode,w),m.return=f,f=m),l(f)):n(f,m)}return j}var rs=Np(!0),Cp=Np(!1),Si=Bn(null),Ni=null,Pr=null,Iu=null;function Ou(){Iu=Pr=Ni=null}function Du(e){var t=Si.current;se(Si),e._currentValue=t}function Ta(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ar(e,t){Ni=e,Iu=Pr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Iu!==e)if(e={context:e,memoizedValue:t,next:null},Pr===null){if(Ni===null)throw Error(_(308));Pr=e,Ni.dependencies={lanes:0,firstContext:e}}else Pr=Pr.next=e;return t}var Gn=null;function Au(e){Gn===null?Gn=[e]:Gn.push(e)}function Ep(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Au(t)):(n.next=s.next,s.next=n),t.interleaved=n,tn(e,r)}function tn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var pn=!1;function Fu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _p(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Xt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function In(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,tn(e,n)}return s=r.interleaved,s===null?(t.next=t,Au(r)):(t.next=s.next,s.next=t),r.interleaved=t,tn(e,n)}function ti(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ju(e,n)}}function id(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ci(e,t,n,r){var s=e.updateQueue;pn=!1;var o=s.firstBaseUpdate,l=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var u=a,c=u.next;u.next=null,l===null?o=c:l.next=c,l=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==l&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=u))}if(o!==null){var p=s.baseState;l=0,h=c=u=null,a=o;do{var d=a.lane,x=a.eventTime;if((r&d)===d){h!==null&&(h=h.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,k=a;switch(d=t,x=n,k.tag){case 1:if(v=k.payload,typeof v=="function"){p=v.call(x,p,d);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=k.payload,d=typeof v=="function"?v.call(x,p,d):v,d==null)break e;p=ue({},p,d);break e;case 2:pn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=s.effects,d===null?s.effects=[a]:d.push(a))}else x={eventTime:x,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=x,u=p):h=h.next=x,l|=d;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;d=a,a=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(h===null&&(u=p),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);fr|=l,e.lanes=l,e.memoizedState=p}}function ld(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(_(191,s));s.call(r)}}}var jo={},At=Bn(jo),eo=Bn(jo),to=Bn(jo);function Xn(e){if(e===jo)throw Error(_(174));return e}function zu(e,t){switch(ee(to,t),ee(eo,e),ee(At,jo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ua(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ua(t,e)}se(At),ee(At,t)}function ss(){se(At),se(eo),se(to)}function Tp(e){Xn(to.current);var t=Xn(At.current),n=ua(t,e.type);t!==n&&(ee(eo,e),ee(At,n))}function Uu(e){eo.current===e&&(se(At),se(eo))}var le=Bn(0);function Ei(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 Il=[];function $u(){for(var e=0;e<Il.length;e++)Il[e]._workInProgressVersionPrimary=null;Il.length=0}var ni=rn.ReactCurrentDispatcher,Ol=rn.ReactCurrentBatchConfig,dr=0,ae=null,we=null,Ne=null,_i=!1,Ds=!1,no=0,ix=0;function Le(){throw Error(_(321))}function Bu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ct(e[n],t[n]))return!1;return!0}function qu(e,t,n,r,s,o){if(dr=o,ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ni.current=e===null||e.memoizedState===null?cx:dx,e=n(r,s),Ds){o=0;do{if(Ds=!1,no=0,25<=o)throw Error(_(301));o+=1,Ne=we=null,t.updateQueue=null,ni.current=fx,e=n(r,s)}while(Ds)}if(ni.current=Ti,t=we!==null&&we.next!==null,dr=0,Ne=we=ae=null,_i=!1,t)throw Error(_(300));return e}function Qu(){var e=no!==0;return no=0,e}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ne===null?ae.memoizedState=Ne=e:Ne=Ne.next=e,Ne}function gt(){if(we===null){var e=ae.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Ne===null?ae.memoizedState:Ne.next;if(t!==null)Ne=t,we=e;else{if(e===null)throw Error(_(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ne===null?ae.memoizedState=Ne=e:Ne=Ne.next=e}return Ne}function ro(e,t){return typeof t=="function"?t(e):t}function Dl(e){var t=gt(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=we,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var l=s.next;s.next=o.next,o.next=l}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var a=l=null,u=null,c=o;do{var h=c.lane;if((dr&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var p={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(a=u=p,l=r):u=u.next=p,ae.lanes|=h,fr|=h}c=c.next}while(c!==null&&c!==o);u===null?l=r:u.next=a,Ct(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,ae.lanes|=o,fr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Al(e){var t=gt(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var l=s=s.next;do o=e(o,l.action),l=l.next;while(l!==s);Ct(o,t.memoizedState)||(Ke=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Pp(){}function Rp(e,t){var n=ae,r=gt(),s=t(),o=!Ct(r.memoizedState,s);if(o&&(r.memoizedState=s,Ke=!0),r=r.queue,Hu(Ip.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Ne!==null&&Ne.memoizedState.tag&1){if(n.flags|=2048,so(9,Lp.bind(null,n,r,s,t),void 0,null),Ce===null)throw Error(_(349));dr&30||Mp(n,t,s)}return s}function Mp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lp(e,t,n,r){t.value=n,t.getSnapshot=r,Op(t)&&Dp(e)}function Ip(e,t,n){return n(function(){Op(t)&&Dp(e)})}function Op(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ct(e,n)}catch{return!0}}function Dp(e){var t=tn(e,1);t!==null&&Nt(t,e,1,-1)}function ad(e){var t=Tt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:e},t.queue=e,e=e.dispatch=ux.bind(null,ae,e),[t.memoizedState,e]}function so(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ap(){return gt().memoizedState}function ri(e,t,n,r){var s=Tt();ae.flags|=e,s.memoizedState=so(1|t,n,void 0,r===void 0?null:r)}function Yi(e,t,n,r){var s=gt();r=r===void 0?null:r;var o=void 0;if(we!==null){var l=we.memoizedState;if(o=l.destroy,r!==null&&Bu(r,l.deps)){s.memoizedState=so(t,n,o,r);return}}ae.flags|=e,s.memoizedState=so(1|t,n,o,r)}function ud(e,t){return ri(8390656,8,e,t)}function Hu(e,t){return Yi(2048,8,e,t)}function Fp(e,t){return Yi(4,2,e,t)}function zp(e,t){return Yi(4,4,e,t)}function Up(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $p(e,t,n){return n=n!=null?n.concat([e]):null,Yi(4,4,Up.bind(null,t,e),n)}function Vu(){}function Bp(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qp(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Qp(e,t,n){return dr&21?(Ct(n,t)||(n=Gf(),ae.lanes|=n,fr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function lx(e,t){var n=Y;Y=n!==0&&4>n?n:4,e(!0);var r=Ol.transition;Ol.transition={};try{e(!1),t()}finally{Y=n,Ol.transition=r}}function Hp(){return gt().memoizedState}function ax(e,t,n){var r=Dn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Vp(e))Wp(t,n);else if(n=Ep(e,t,n,r),n!==null){var s=Be();Nt(n,e,r,s),Kp(n,t,r)}}function ux(e,t,n){var r=Dn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vp(e))Wp(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,a=o(l,n);if(s.hasEagerState=!0,s.eagerState=a,Ct(a,l)){var u=t.interleaved;u===null?(s.next=s,Au(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Ep(e,t,s,r),n!==null&&(s=Be(),Nt(n,e,r,s),Kp(n,t,r))}}function Vp(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function Wp(e,t){Ds=_i=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Kp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ju(e,n)}}var Ti={readContext:mt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},cx={readContext:mt,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:ud,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ri(4194308,4,Up.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ri(4194308,4,e,t)},useInsertionEffect:function(e,t){return ri(4,2,e,t)},useMemo:function(e,t){var n=Tt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Tt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ax.bind(null,ae,e),[r.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:ad,useDebugValue:Vu,useDeferredValue:function(e){return Tt().memoizedState=e},useTransition:function(){var e=ad(!1),t=e[0];return e=lx.bind(null,e[1]),Tt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ae,s=Tt();if(oe){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),Ce===null)throw Error(_(349));dr&30||Mp(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,ud(Ip.bind(null,r,o,e),[e]),r.flags|=2048,so(9,Lp.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Tt(),t=Ce.identifierPrefix;if(oe){var n=Gt,r=Kt;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=no++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ix++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dx={readContext:mt,useCallback:Bp,useContext:mt,useEffect:Hu,useImperativeHandle:$p,useInsertionEffect:Fp,useLayoutEffect:zp,useMemo:qp,useReducer:Dl,useRef:Ap,useState:function(){return Dl(ro)},useDebugValue:Vu,useDeferredValue:function(e){var t=gt();return Qp(t,we.memoizedState,e)},useTransition:function(){var e=Dl(ro)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Pp,useSyncExternalStore:Rp,useId:Hp,unstable_isNewReconciler:!1},fx={readContext:mt,useCallback:Bp,useContext:mt,useEffect:Hu,useImperativeHandle:$p,useInsertionEffect:Fp,useLayoutEffect:zp,useMemo:qp,useReducer:Al,useRef:Ap,useState:function(){return Al(ro)},useDebugValue:Vu,useDeferredValue:function(e){var t=gt();return we===null?t.memoizedState=e:Qp(t,we.memoizedState,e)},useTransition:function(){var e=Al(ro)[0],t=gt().memoizedState;return[e,t]},useMutableSource:Pp,useSyncExternalStore:Rp,useId:Hp,unstable_isNewReconciler:!1};function vt(e,t){if(e&&e.defaultProps){t=ue({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ue({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ji={isMounted:function(e){return(e=e._reactInternals)?yr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Be(),s=Dn(e),o=Xt(r,s);o.payload=t,n!=null&&(o.callback=n),t=In(e,o,s),t!==null&&(Nt(t,e,s,r),ti(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Be(),s=Dn(e),o=Xt(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=In(e,o,s),t!==null&&(Nt(t,e,s,r),ti(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Be(),r=Dn(e),s=Xt(n,r);s.tag=2,t!=null&&(s.callback=t),t=In(e,s,r),t!==null&&(Nt(t,e,r,n),ti(t,e,r))}};function cd(e,t,n,r,s,o,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,l):t.prototype&&t.prototype.isPureReactComponent?!Xs(n,r)||!Xs(s,o):!0}function Gp(e,t,n){var r=!1,s=Un,o=t.contextType;return typeof o=="object"&&o!==null?o=mt(o):(s=Xe(t)?ur:Ae.current,r=t.contextTypes,o=(r=r!=null)?ts(e,s):Un),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ji,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function dd(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&&Ji.enqueueReplaceState(t,t.state,null)}function Ra(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Fu(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=mt(o):(o=Xe(t)?ur:Ae.current,s.context=ts(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Pa(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Ji.enqueueReplaceState(s,s.state,null),Ci(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function os(e,t){try{var n="",r=t;do n+=Um(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
24
|
+
Error generating stack: `+o.message+`
|
|
25
|
+
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function Fl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ma(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var px=typeof WeakMap=="function"?WeakMap:Map;function Xp(e,t,n){n=Xt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ri||(Ri=!0,Ba=r),Ma(e,t)},n}function Yp(e,t,n){n=Xt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Ma(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Ma(e,t),typeof r!="function"&&(On===null?On=new Set([this]):On.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function fd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new px;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Ex.bind(null,e,t,n),t.then(e,e))}function pd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function hd(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Xt(-1,1),t.tag=2,In(n,t,1))),n.lanes|=1),e)}var hx=rn.ReactCurrentOwner,Ke=!1;function Ue(e,t,n,r){t.child=e===null?Cp(t,null,n,r):rs(t,e.child,n,r)}function md(e,t,n,r,s){n=n.render;var o=t.ref;return Ar(t,s),r=qu(e,t,n,r,o,s),n=Qu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,nn(e,t,s)):(oe&&n&&Ru(t),t.flags|=1,Ue(e,t,r,s),t.child)}function gd(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!ec(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Jp(e,t,o,r,s)):(e=li(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:Xs,n(l,r)&&e.ref===t.ref)return nn(e,t,s)}return t.flags|=1,e=An(o,r),e.ref=t.ref,e.return=t,t.child=e}function Jp(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Xs(o,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,nn(e,t,s)}return La(e,t,n,r,s)}function Zp(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ee(Mr,Je),Je|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ee(Mr,Je),Je|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ee(Mr,Je),Je|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ee(Mr,Je),Je|=r;return Ue(e,t,s,n),t.child}function eh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function La(e,t,n,r,s){var o=Xe(n)?ur:Ae.current;return o=ts(t,o),Ar(t,s),n=qu(e,t,n,r,o,s),r=Qu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,nn(e,t,s)):(oe&&r&&Ru(t),t.flags|=1,Ue(e,t,n,s),t.child)}function xd(e,t,n,r,s){if(Xe(n)){var o=!0;bi(t)}else o=!1;if(Ar(t,s),t.stateNode===null)si(e,t),Gp(t,n,r),Ra(t,n,r,s),r=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var u=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=mt(c):(c=Xe(n)?ur:Ae.current,c=ts(t,c));var h=n.getDerivedStateFromProps,p=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function";p||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||u!==c)&&dd(t,l,r,c),pn=!1;var d=t.memoizedState;l.state=d,Ci(t,r,l,s),u=t.memoizedState,a!==r||d!==u||Ge.current||pn?(typeof h=="function"&&(Pa(t,n,h,r),u=t.memoizedState),(a=pn||cd(t,n,a,r,d,u,c))?(p||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),l.props=r,l.state=u,l.context=c,r=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,_p(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:vt(t.type,a),l.props=c,p=t.pendingProps,d=l.context,u=n.contextType,typeof u=="object"&&u!==null?u=mt(u):(u=Xe(n)?ur:Ae.current,u=ts(t,u));var x=n.getDerivedStateFromProps;(h=typeof x=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==p||d!==u)&&dd(t,l,r,u),pn=!1,d=t.memoizedState,l.state=d,Ci(t,r,l,s);var v=t.memoizedState;a!==p||d!==v||Ge.current||pn?(typeof x=="function"&&(Pa(t,n,x,r),v=t.memoizedState),(c=pn||cd(t,n,c,r,d,v,u)||!1)?(h||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,v,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,v,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),l.props=r,l.state=v,l.context=u,r=c):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Ia(e,t,n,r,o,s)}function Ia(e,t,n,r,s,o){eh(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return s&&nd(t,n,!1),nn(e,t,o);r=t.stateNode,hx.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=rs(t,e.child,null,o),t.child=rs(t,null,a,o)):Ue(e,t,a,o),t.memoizedState=r.state,s&&nd(t,n,!0),t.child}function th(e){var t=e.stateNode;t.pendingContext?td(e,t.pendingContext,t.pendingContext!==t.context):t.context&&td(e,t.context,!1),zu(e,t.containerInfo)}function yd(e,t,n,r,s){return ns(),Lu(s),t.flags|=256,Ue(e,t,n,r),t.child}var Oa={dehydrated:null,treeContext:null,retryLane:0};function Da(e){return{baseLanes:e,cachePool:null,transitions:null}}function nh(e,t,n){var r=t.pendingProps,s=le.current,o=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ee(le,s&1),e===null)return _a(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,o?(r=t.mode,o=t.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=tl(l,r,0,null),e=ar(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Da(n),t.memoizedState=Oa,e):Wu(t,l));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return mx(e,t,l,r,a,s,n);if(o){o=r.fallback,l=t.mode,s=e.child,a=s.sibling;var u={mode:"hidden",children:r.children};return!(l&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=An(s,u),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=An(a,o):(o=ar(o,l,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,l=e.child.memoizedState,l=l===null?Da(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=Oa,r}return o=e.child,e=o.sibling,r=An(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Wu(e,t){return t=tl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function qo(e,t,n,r){return r!==null&&Lu(r),rs(t,e.child,null,n),e=Wu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mx(e,t,n,r,s,o,l){if(n)return t.flags&256?(t.flags&=-257,r=Fl(Error(_(422))),qo(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=tl({mode:"visible",children:r.children},s,0,null),o=ar(o,s,l,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&rs(t,e.child,null,l),t.child.memoizedState=Da(l),t.memoizedState=Oa,o);if(!(t.mode&1))return qo(e,t,l,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(_(419)),r=Fl(o,r,void 0),qo(e,t,l,r)}if(a=(l&e.childLanes)!==0,Ke||a){if(r=Ce,r!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|l)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,tn(e,s),Nt(r,e,s,-1))}return Zu(),r=Fl(Error(_(421))),qo(e,t,l,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=_x.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,tt=Ln(s.nextSibling),nt=t,oe=!0,kt=null,e!==null&&(ct[dt++]=Kt,ct[dt++]=Gt,ct[dt++]=cr,Kt=e.id,Gt=e.overflow,cr=t),t=Wu(t,r.children),t.flags|=4096,t)}function vd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ta(e.return,t,n)}function zl(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function rh(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Ue(e,t,r.children,n),r=le.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vd(e,n,t);else if(e.tag===19)vd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ee(le,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ei(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),zl(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ei(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}zl(t,!0,n,null,o);break;case"together":zl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function si(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,n=An(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=An(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gx(e,t,n){switch(t.tag){case 3:th(t),ns();break;case 5:Tp(t);break;case 1:Xe(t.type)&&bi(t);break;case 4:zu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;ee(Si,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ee(le,le.current&1),t.flags|=128,null):n&t.child.childLanes?nh(e,t,n):(ee(le,le.current&1),e=nn(e,t,n),e!==null?e.sibling:null);ee(le,le.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return rh(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ee(le,le.current),r)break;return null;case 22:case 23:return t.lanes=0,Zp(e,t,n)}return nn(e,t,n)}var sh,Aa,oh,ih;sh=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Aa=function(){};oh=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Xn(At.current);var o=null;switch(n){case"input":s=oa(e,s),r=oa(e,r),o=[];break;case"select":s=ue({},s,{value:void 0}),r=ue({},r,{value:void 0}),o=[];break;case"textarea":s=aa(e,s),r=aa(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vi)}ca(n,r);var l;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(qs.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(l in a)!a.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&a[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(o||(o=[]),o.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(qs.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&ne("scroll",e),o||a===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};ih=function(e,t,n,r){n!==r&&(t.flags|=4)};function vs(e,t){if(!oe)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 Ie(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xx(e,t,n){var r=t.pendingProps;switch(Mu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(t),null;case 1:return Xe(t.type)&&wi(),Ie(t),null;case 3:return r=t.stateNode,ss(),se(Ge),se(Ae),$u(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&($o(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,kt!==null&&(Ha(kt),kt=null))),Aa(e,t),Ie(t),null;case 5:Uu(t);var s=Xn(to.current);if(n=t.type,e!==null&&t.stateNode!=null)oh(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return Ie(t),null}if(e=Xn(At.current),$o(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[It]=t,r[Zs]=o,e=(t.mode&1)!==0,n){case"dialog":ne("cancel",r),ne("close",r);break;case"iframe":case"object":case"embed":ne("load",r);break;case"video":case"audio":for(s=0;s<Es.length;s++)ne(Es[s],r);break;case"source":ne("error",r);break;case"img":case"image":case"link":ne("error",r),ne("load",r);break;case"details":ne("toggle",r);break;case"input":_c(r,o),ne("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ne("invalid",r);break;case"textarea":Pc(r,o),ne("invalid",r)}ca(n,o),s=null;for(var l in o)if(o.hasOwnProperty(l)){var a=o[l];l==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&Uo(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Uo(r.textContent,a,e),s=["children",""+a]):qs.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&ne("scroll",r)}switch(n){case"input":Mo(r),Tc(r,o,!0);break;case"textarea":Mo(r),Rc(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=vi)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=If(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[It]=t,e[Zs]=r,sh(e,t,!1,!1),t.stateNode=e;e:{switch(l=da(n,r),n){case"dialog":ne("cancel",e),ne("close",e),s=r;break;case"iframe":case"object":case"embed":ne("load",e),s=r;break;case"video":case"audio":for(s=0;s<Es.length;s++)ne(Es[s],e);s=r;break;case"source":ne("error",e),s=r;break;case"img":case"image":case"link":ne("error",e),ne("load",e),s=r;break;case"details":ne("toggle",e),s=r;break;case"input":_c(e,r),s=oa(e,r),ne("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ue({},r,{value:void 0}),ne("invalid",e);break;case"textarea":Pc(e,r),s=aa(e,r),ne("invalid",e);break;default:s=r}ca(n,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var u=a[o];o==="style"?Af(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Of(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Qs(e,u):typeof u=="number"&&Qs(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(qs.hasOwnProperty(o)?u!=null&&o==="onScroll"&&ne("scroll",e):u!=null&&xu(e,o,u,l))}switch(n){case"input":Mo(e),Tc(e,r,!1);break;case"textarea":Mo(e),Rc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+zn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Lr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Lr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=vi)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ie(t),null;case 6:if(e&&t.stateNode!=null)ih(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(n=Xn(to.current),Xn(At.current),$o(t)){if(r=t.stateNode,n=t.memoizedProps,r[It]=t,(o=r.nodeValue!==n)&&(e=nt,e!==null))switch(e.tag){case 3:Uo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Uo(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[It]=t,t.stateNode=r}return Ie(t),null;case 13:if(se(le),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(oe&&tt!==null&&t.mode&1&&!(t.flags&128))Sp(),ns(),t.flags|=98560,o=!1;else if(o=$o(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(_(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(_(317));o[It]=t}else ns(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ie(t),o=!1}else kt!==null&&(Ha(kt),kt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||le.current&1?ke===0&&(ke=3):Zu())),t.updateQueue!==null&&(t.flags|=4),Ie(t),null);case 4:return ss(),Aa(e,t),e===null&&Ys(t.stateNode.containerInfo),Ie(t),null;case 10:return Du(t.type._context),Ie(t),null;case 17:return Xe(t.type)&&wi(),Ie(t),null;case 19:if(se(le),o=t.memoizedState,o===null)return Ie(t),null;if(r=(t.flags&128)!==0,l=o.rendering,l===null)if(r)vs(o,!1);else{if(ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ei(e),l!==null){for(t.flags|=128,vs(o,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ee(le,le.current&1|2),t.child}e=e.sibling}o.tail!==null&&ge()>is&&(t.flags|=128,r=!0,vs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ei(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!oe)return Ie(t),null}else 2*ge()-o.renderingStartTime>is&&n!==1073741824&&(t.flags|=128,r=!0,vs(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ge(),t.sibling=null,n=le.current,ee(le,r?n&1|2:n&1),t):(Ie(t),null);case 22:case 23:return Ju(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Je&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function yx(e,t){switch(Mu(t),t.tag){case 1:return Xe(t.type)&&wi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ss(),se(Ge),se(Ae),$u(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Uu(t),null;case 13:if(se(le),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(le),null;case 4:return ss(),null;case 10:return Du(t.type._context),null;case 22:case 23:return Ju(),null;case 24:return null;default:return null}}var Qo=!1,De=!1,vx=typeof WeakSet=="function"?WeakSet:Set,I=null;function Rr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function Fa(e,t,n){try{n()}catch(r){pe(e,t,r)}}var wd=!1;function wx(e,t){if(ba=gi,e=dp(),Pu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,a=-1,u=-1,c=0,h=0,p=e,d=null;t:for(;;){for(var x;p!==n||s!==0&&p.nodeType!==3||(a=l+s),p!==o||r!==0&&p.nodeType!==3||(u=l+r),p.nodeType===3&&(l+=p.nodeValue.length),(x=p.firstChild)!==null;)d=p,p=x;for(;;){if(p===e)break t;if(d===n&&++c===s&&(a=l),d===o&&++h===r&&(u=l),(x=p.nextSibling)!==null)break;p=d,d=p.parentNode}p=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ka={focusedElem:e,selectionRange:n},gi=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var k=v.memoizedProps,j=v.memoizedState,f=t.stateNode,m=f.getSnapshotBeforeUpdate(t.elementType===t.type?k:vt(t.type,k),j);f.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(w){pe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return v=wd,wd=!1,v}function As(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Fa(t,n,o)}s=s.next}while(s!==r)}}function Zi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function za(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function lh(e){var t=e.alternate;t!==null&&(e.alternate=null,lh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[It],delete t[Zs],delete t[Na],delete t[nx],delete t[rx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ah(e){return e.tag===5||e.tag===3||e.tag===4}function bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ah(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ua(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vi));else if(r!==4&&(e=e.child,e!==null))for(Ua(e,t,n),e=e.sibling;e!==null;)Ua(e,t,n),e=e.sibling}function $a(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&&(e=e.child,e!==null))for($a(e,t,n),e=e.sibling;e!==null;)$a(e,t,n),e=e.sibling}var Te=null,bt=!1;function an(e,t,n){for(n=n.child;n!==null;)uh(e,t,n),n=n.sibling}function uh(e,t,n){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(Hi,n)}catch{}switch(n.tag){case 5:De||Rr(n,t);case 6:var r=Te,s=bt;Te=null,an(e,t,n),Te=r,bt=s,Te!==null&&(bt?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(bt?(e=Te,n=n.stateNode,e.nodeType===8?Ml(e.parentNode,n):e.nodeType===1&&Ml(e,n),Ks(e)):Ml(Te,n.stateNode));break;case 4:r=Te,s=bt,Te=n.stateNode.containerInfo,bt=!0,an(e,t,n),Te=r,bt=s;break;case 0:case 11:case 14:case 15:if(!De&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Fa(n,t,l),s=s.next}while(s!==r)}an(e,t,n);break;case 1:if(!De&&(Rr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){pe(n,t,a)}an(e,t,n);break;case 21:an(e,t,n);break;case 22:n.mode&1?(De=(r=De)||n.memoizedState!==null,an(e,t,n),De=r):an(e,t,n);break;default:an(e,t,n)}}function kd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vx),t.forEach(function(r){var s=Tx.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function yt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:Te=a.stateNode,bt=!1;break e;case 3:Te=a.stateNode.containerInfo,bt=!0;break e;case 4:Te=a.stateNode.containerInfo,bt=!0;break e}a=a.return}if(Te===null)throw Error(_(160));uh(o,l,s),Te=null,bt=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){pe(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ch(t,e),t=t.sibling}function ch(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yt(t,e),_t(e),r&4){try{As(3,e,e.return),Zi(3,e)}catch(k){pe(e,e.return,k)}try{As(5,e,e.return)}catch(k){pe(e,e.return,k)}}break;case 1:yt(t,e),_t(e),r&512&&n!==null&&Rr(n,n.return);break;case 5:if(yt(t,e),_t(e),r&512&&n!==null&&Rr(n,n.return),e.flags&32){var s=e.stateNode;try{Qs(s,"")}catch(k){pe(e,e.return,k)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,l=n!==null?n.memoizedProps:o,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Mf(s,o),da(a,l);var c=da(a,o);for(l=0;l<u.length;l+=2){var h=u[l],p=u[l+1];h==="style"?Af(s,p):h==="dangerouslySetInnerHTML"?Of(s,p):h==="children"?Qs(s,p):xu(s,h,p,c)}switch(a){case"input":ia(s,o);break;case"textarea":Lf(s,o);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var x=o.value;x!=null?Lr(s,!!o.multiple,x,!1):d!==!!o.multiple&&(o.defaultValue!=null?Lr(s,!!o.multiple,o.defaultValue,!0):Lr(s,!!o.multiple,o.multiple?[]:"",!1))}s[Zs]=o}catch(k){pe(e,e.return,k)}}break;case 6:if(yt(t,e),_t(e),r&4){if(e.stateNode===null)throw Error(_(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(k){pe(e,e.return,k)}}break;case 3:if(yt(t,e),_t(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ks(t.containerInfo)}catch(k){pe(e,e.return,k)}break;case 4:yt(t,e),_t(e);break;case 13:yt(t,e),_t(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Xu=ge())),r&4&&kd(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(De=(c=De)||h,yt(t,e),De=c):yt(t,e),_t(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(I=e,h=e.child;h!==null;){for(p=I=h;I!==null;){switch(d=I,x=d.child,d.tag){case 0:case 11:case 14:case 15:As(4,d,d.return);break;case 1:Rr(d,d.return);var v=d.stateNode;if(typeof v.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(k){pe(r,n,k)}}break;case 5:Rr(d,d.return);break;case 22:if(d.memoizedState!==null){Sd(p);continue}}x!==null?(x.return=d,I=x):Sd(p)}h=h.sibling}e:for(h=null,p=e;;){if(p.tag===5){if(h===null){h=p;try{s=p.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=p.stateNode,u=p.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=Df("display",l))}catch(k){pe(e,e.return,k)}}}else if(p.tag===6){if(h===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(k){pe(e,e.return,k)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;h===p&&(h=null),p=p.return}h===p&&(h=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:yt(t,e),_t(e),r&4&&kd(e);break;case 21:break;default:yt(t,e),_t(e)}}function _t(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ah(n)){var r=n;break e}n=n.return}throw Error(_(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Qs(s,""),r.flags&=-33);var o=bd(e);$a(e,o,s);break;case 3:case 4:var l=r.stateNode.containerInfo,a=bd(e);Ua(e,a,l);break;default:throw Error(_(161))}}catch(u){pe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bx(e,t,n){I=e,dh(e)}function dh(e,t,n){for(var r=(e.mode&1)!==0;I!==null;){var s=I,o=s.child;if(s.tag===22&&r){var l=s.memoizedState!==null||Qo;if(!l){var a=s.alternate,u=a!==null&&a.memoizedState!==null||De;a=Qo;var c=De;if(Qo=l,(De=u)&&!c)for(I=s;I!==null;)l=I,u=l.child,l.tag===22&&l.memoizedState!==null?Nd(s):u!==null?(u.return=l,I=u):Nd(s);for(;o!==null;)I=o,dh(o),o=o.sibling;I=s,Qo=a,De=c}jd(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,I=o):jd(e)}}function jd(e){for(;I!==null;){var t=I;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:De||Zi(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!De)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:vt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&ld(t,o,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ld(t,l,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var p=h.dehydrated;p!==null&&Ks(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}De||t.flags&512&&za(t)}catch(d){pe(t,t.return,d)}}if(t===e){I=null;break}if(n=t.sibling,n!==null){n.return=t.return,I=n;break}I=t.return}}function Sd(e){for(;I!==null;){var t=I;if(t===e){I=null;break}var n=t.sibling;if(n!==null){n.return=t.return,I=n;break}I=t.return}}function Nd(e){for(;I!==null;){var t=I;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zi(4,t)}catch(u){pe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){pe(t,s,u)}}var o=t.return;try{za(t)}catch(u){pe(t,o,u)}break;case 5:var l=t.return;try{za(t)}catch(u){pe(t,l,u)}}}catch(u){pe(t,t.return,u)}if(t===e){I=null;break}var a=t.sibling;if(a!==null){a.return=t.return,I=a;break}I=t.return}}var kx=Math.ceil,Pi=rn.ReactCurrentDispatcher,Ku=rn.ReactCurrentOwner,ht=rn.ReactCurrentBatchConfig,K=0,Ce=null,xe=null,Pe=0,Je=0,Mr=Bn(0),ke=0,oo=null,fr=0,el=0,Gu=0,Fs=null,We=null,Xu=0,is=1/0,Bt=null,Ri=!1,Ba=null,On=null,Ho=!1,Tn=null,Mi=0,zs=0,qa=null,oi=-1,ii=0;function Be(){return K&6?ge():oi!==-1?oi:oi=ge()}function Dn(e){return e.mode&1?K&2&&Pe!==0?Pe&-Pe:ox.transition!==null?(ii===0&&(ii=Gf()),ii):(e=Y,e!==0||(e=window.event,e=e===void 0?16:np(e.type)),e):1}function Nt(e,t,n,r){if(50<zs)throw zs=0,qa=null,Error(_(185));wo(e,n,r),(!(K&2)||e!==Ce)&&(e===Ce&&(!(K&2)&&(el|=n),ke===4&&xn(e,Pe)),Ye(e,r),n===1&&K===0&&!(t.mode&1)&&(is=ge()+500,Xi&&qn()))}function Ye(e,t){var n=e.callbackNode;og(e,t);var r=mi(e,e===Ce?Pe:0);if(r===0)n!==null&&Ic(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ic(n),t===1)e.tag===0?sx(Cd.bind(null,e)):bp(Cd.bind(null,e)),ex(function(){!(K&6)&&qn()}),n=null;else{switch(Xf(r)){case 1:n=ku;break;case 4:n=Wf;break;case 16:n=hi;break;case 536870912:n=Kf;break;default:n=hi}n=vh(n,fh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function fh(e,t){if(oi=-1,ii=0,K&6)throw Error(_(327));var n=e.callbackNode;if(Fr()&&e.callbackNode!==n)return null;var r=mi(e,e===Ce?Pe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Li(e,r);else{t=r;var s=K;K|=2;var o=hh();(Ce!==e||Pe!==t)&&(Bt=null,is=ge()+500,lr(e,t));do try{Nx();break}catch(a){ph(e,a)}while(!0);Ou(),Pi.current=o,K=s,xe!==null?t=0:(Ce=null,Pe=0,t=ke)}if(t!==0){if(t===2&&(s=ga(e),s!==0&&(r=s,t=Qa(e,s))),t===1)throw n=oo,lr(e,0),xn(e,r),Ye(e,ge()),n;if(t===6)xn(e,r);else{if(s=e.current.alternate,!(r&30)&&!jx(s)&&(t=Li(e,r),t===2&&(o=ga(e),o!==0&&(r=o,t=Qa(e,o))),t===1))throw n=oo,lr(e,0),xn(e,r),Ye(e,ge()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:Wn(e,We,Bt);break;case 3:if(xn(e,r),(r&130023424)===r&&(t=Xu+500-ge(),10<t)){if(mi(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Be(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Sa(Wn.bind(null,e,We,Bt),t);break}Wn(e,We,Bt);break;case 4:if(xn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var l=31-St(r);o=1<<l,l=t[l],l>s&&(s=l),r&=~o}if(r=s,r=ge()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kx(r/1960))-r,10<r){e.timeoutHandle=Sa(Wn.bind(null,e,We,Bt),r);break}Wn(e,We,Bt);break;case 5:Wn(e,We,Bt);break;default:throw Error(_(329))}}}return Ye(e,ge()),e.callbackNode===n?fh.bind(null,e):null}function Qa(e,t){var n=Fs;return e.current.memoizedState.isDehydrated&&(lr(e,t).flags|=256),e=Li(e,t),e!==2&&(t=We,We=n,t!==null&&Ha(t)),e}function Ha(e){We===null?We=e:We.push.apply(We,e)}function jx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!Ct(o(),s))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 xn(e,t){for(t&=~Gu,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),r=1<<n;e[n]=-1,t&=~r}}function Cd(e){if(K&6)throw Error(_(327));Fr();var t=mi(e,0);if(!(t&1))return Ye(e,ge()),null;var n=Li(e,t);if(e.tag!==0&&n===2){var r=ga(e);r!==0&&(t=r,n=Qa(e,r))}if(n===1)throw n=oo,lr(e,0),xn(e,t),Ye(e,ge()),n;if(n===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wn(e,We,Bt),Ye(e,ge()),null}function Yu(e,t){var n=K;K|=1;try{return e(t)}finally{K=n,K===0&&(is=ge()+500,Xi&&qn())}}function pr(e){Tn!==null&&Tn.tag===0&&!(K&6)&&Fr();var t=K;K|=1;var n=ht.transition,r=Y;try{if(ht.transition=null,Y=1,e)return e()}finally{Y=r,ht.transition=n,K=t,!(K&6)&&qn()}}function Ju(){Je=Mr.current,se(Mr)}function lr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Zg(n)),xe!==null)for(n=xe.return;n!==null;){var r=n;switch(Mu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wi();break;case 3:ss(),se(Ge),se(Ae),$u();break;case 5:Uu(r);break;case 4:ss();break;case 13:se(le);break;case 19:se(le);break;case 10:Du(r.type._context);break;case 22:case 23:Ju()}n=n.return}if(Ce=e,xe=e=An(e.current,null),Pe=Je=t,ke=0,oo=null,Gu=el=fr=0,We=Fs=null,Gn!==null){for(t=0;t<Gn.length;t++)if(n=Gn[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var l=o.next;o.next=s,r.next=l}n.pending=r}Gn=null}return e}function ph(e,t){do{var n=xe;try{if(Ou(),ni.current=Ti,_i){for(var r=ae.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}_i=!1}if(dr=0,Ne=we=ae=null,Ds=!1,no=0,Ku.current=null,n===null||n.return===null){ke=1,oo=t,xe=null;break}e:{var o=e,l=n.return,a=n,u=t;if(t=Pe,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=a,p=h.tag;if(!(h.mode&1)&&(p===0||p===11||p===15)){var d=h.alternate;d?(h.updateQueue=d.updateQueue,h.memoizedState=d.memoizedState,h.lanes=d.lanes):(h.updateQueue=null,h.memoizedState=null)}var x=pd(l);if(x!==null){x.flags&=-257,hd(x,l,a,o,t),x.mode&1&&fd(o,c,t),t=x,u=c;var v=t.updateQueue;if(v===null){var k=new Set;k.add(u),t.updateQueue=k}else v.add(u);break e}else{if(!(t&1)){fd(o,c,t),Zu();break e}u=Error(_(426))}}else if(oe&&a.mode&1){var j=pd(l);if(j!==null){!(j.flags&65536)&&(j.flags|=256),hd(j,l,a,o,t),Lu(os(u,a));break e}}o=u=os(u,a),ke!==4&&(ke=2),Fs===null?Fs=[o]:Fs.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var f=Xp(o,u,t);id(o,f);break e;case 1:a=u;var m=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(On===null||!On.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=Yp(o,a,t);id(o,w);break e}}o=o.return}while(o!==null)}gh(n)}catch(S){t=S,xe===n&&n!==null&&(xe=n=n.return);continue}break}while(!0)}function hh(){var e=Pi.current;return Pi.current=Ti,e===null?Ti:e}function Zu(){(ke===0||ke===3||ke===2)&&(ke=4),Ce===null||!(fr&268435455)&&!(el&268435455)||xn(Ce,Pe)}function Li(e,t){var n=K;K|=2;var r=hh();(Ce!==e||Pe!==t)&&(Bt=null,lr(e,t));do try{Sx();break}catch(s){ph(e,s)}while(!0);if(Ou(),K=n,Pi.current=r,xe!==null)throw Error(_(261));return Ce=null,Pe=0,ke}function Sx(){for(;xe!==null;)mh(xe)}function Nx(){for(;xe!==null&&!Xm();)mh(xe)}function mh(e){var t=yh(e.alternate,e,Je);e.memoizedProps=e.pendingProps,t===null?gh(e):xe=t,Ku.current=null}function gh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=yx(n,t),n!==null){n.flags&=32767,xe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ke=6,xe=null;return}}else if(n=xx(n,t,Je),n!==null){xe=n;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);ke===0&&(ke=5)}function Wn(e,t,n){var r=Y,s=ht.transition;try{ht.transition=null,Y=1,Cx(e,t,n,r)}finally{ht.transition=s,Y=r}return null}function Cx(e,t,n,r){do Fr();while(Tn!==null);if(K&6)throw Error(_(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(ig(e,o),e===Ce&&(xe=Ce=null,Pe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ho||(Ho=!0,vh(hi,function(){return Fr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=ht.transition,ht.transition=null;var l=Y;Y=1;var a=K;K|=4,Ku.current=null,wx(e,n),ch(n,e),Vg(ka),gi=!!ba,ka=ba=null,e.current=n,bx(n),Ym(),K=a,Y=l,ht.transition=o}else e.current=n;if(Ho&&(Ho=!1,Tn=e,Mi=s),o=e.pendingLanes,o===0&&(On=null),eg(n.stateNode),Ye(e,ge()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Ri)throw Ri=!1,e=Ba,Ba=null,e;return Mi&1&&e.tag!==0&&Fr(),o=e.pendingLanes,o&1?e===qa?zs++:(zs=0,qa=e):zs=0,qn(),null}function Fr(){if(Tn!==null){var e=Xf(Mi),t=ht.transition,n=Y;try{if(ht.transition=null,Y=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,Mi=0,K&6)throw Error(_(331));var s=K;for(K|=4,I=e.current;I!==null;){var o=I,l=o.child;if(I.flags&16){var a=o.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for(I=c;I!==null;){var h=I;switch(h.tag){case 0:case 11:case 15:As(8,h,o)}var p=h.child;if(p!==null)p.return=h,I=p;else for(;I!==null;){h=I;var d=h.sibling,x=h.return;if(lh(h),h===c){I=null;break}if(d!==null){d.return=x,I=d;break}I=x}}}var v=o.alternate;if(v!==null){var k=v.child;if(k!==null){v.child=null;do{var j=k.sibling;k.sibling=null,k=j}while(k!==null)}}I=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,I=l;else e:for(;I!==null;){if(o=I,o.flags&2048)switch(o.tag){case 0:case 11:case 15:As(9,o,o.return)}var f=o.sibling;if(f!==null){f.return=o.return,I=f;break e}I=o.return}}var m=e.current;for(I=m;I!==null;){l=I;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,I=g;else e:for(l=m;I!==null;){if(a=I,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Zi(9,a)}}catch(S){pe(a,a.return,S)}if(a===l){I=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,I=w;break e}I=a.return}}if(K=s,qn(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(Hi,e)}catch{}r=!0}return r}finally{Y=n,ht.transition=t}}return!1}function Ed(e,t,n){t=os(n,t),t=Xp(e,t,1),e=In(e,t,1),t=Be(),e!==null&&(wo(e,1,t),Ye(e,t))}function pe(e,t,n){if(e.tag===3)Ed(e,e,n);else for(;t!==null;){if(t.tag===3){Ed(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(On===null||!On.has(r))){e=os(n,e),e=Yp(t,e,1),t=In(t,e,1),e=Be(),t!==null&&(wo(t,1,e),Ye(t,e));break}}t=t.return}}function Ex(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Be(),e.pingedLanes|=e.suspendedLanes&n,Ce===e&&(Pe&n)===n&&(ke===4||ke===3&&(Pe&130023424)===Pe&&500>ge()-Xu?lr(e,0):Gu|=n),Ye(e,t)}function xh(e,t){t===0&&(e.mode&1?(t=Oo,Oo<<=1,!(Oo&130023424)&&(Oo=4194304)):t=1);var n=Be();e=tn(e,t),e!==null&&(wo(e,t,n),Ye(e,n))}function _x(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xh(e,n)}function Tx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),xh(e,n)}var yh;yh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,gx(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,oe&&t.flags&1048576&&kp(t,ji,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;si(e,t),e=t.pendingProps;var s=ts(t,Ae.current);Ar(t,n),s=qu(null,t,r,e,s,n);var o=Qu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Xe(r)?(o=!0,bi(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Fu(t),s.updater=Ji,t.stateNode=s,s._reactInternals=t,Ra(t,r,e,n),t=Ia(null,t,r,!0,o,n)):(t.tag=0,oe&&o&&Ru(t),Ue(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(si(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Rx(r),e=vt(r,e),s){case 0:t=La(null,t,r,e,n);break e;case 1:t=xd(null,t,r,e,n);break e;case 11:t=md(null,t,r,e,n);break e;case 14:t=gd(null,t,r,vt(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vt(r,s),La(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vt(r,s),xd(e,t,r,s,n);case 3:e:{if(th(t),e===null)throw Error(_(387));r=t.pendingProps,o=t.memoizedState,s=o.element,_p(e,t),Ci(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=os(Error(_(423)),t),t=yd(e,t,r,n,s);break e}else if(r!==s){s=os(Error(_(424)),t),t=yd(e,t,r,n,s);break e}else for(tt=Ln(t.stateNode.containerInfo.firstChild),nt=t,oe=!0,kt=null,n=Cp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ns(),r===s){t=nn(e,t,n);break e}Ue(e,t,r,n)}t=t.child}return t;case 5:return Tp(t),e===null&&_a(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,l=s.children,ja(r,s)?l=null:o!==null&&ja(r,o)&&(t.flags|=32),eh(e,t),Ue(e,t,l,n),t.child;case 6:return e===null&&_a(t),null;case 13:return nh(e,t,n);case 4:return zu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rs(t,null,r,n):Ue(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vt(r,s),md(e,t,r,s,n);case 7:return Ue(e,t,t.pendingProps,n),t.child;case 8:return Ue(e,t,t.pendingProps.children,n),t.child;case 12:return Ue(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,l=s.value,ee(Si,r._currentValue),r._currentValue=l,o!==null)if(Ct(o.value,l)){if(o.children===s.children&&!Ge.current){t=nn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){l=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Xt(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ta(o.return,n,t),a.lanes|=n;break}u=u.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(_(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Ta(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Ue(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Ar(t,n),s=mt(s),r=r(s),t.flags|=1,Ue(e,t,r,n),t.child;case 14:return r=t.type,s=vt(r,t.pendingProps),s=vt(r.type,s),gd(e,t,r,s,n);case 15:return Jp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:vt(r,s),si(e,t),t.tag=1,Xe(r)?(e=!0,bi(t)):e=!1,Ar(t,n),Gp(t,r,s),Ra(t,r,s,n),Ia(null,t,r,!0,e,n);case 19:return rh(e,t,n);case 22:return Zp(e,t,n)}throw Error(_(156,t.tag))};function vh(e,t){return Vf(e,t)}function Px(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.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 pt(e,t,n,r){return new Px(e,t,n,r)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rx(e){if(typeof e=="function")return ec(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vu)return 11;if(e===wu)return 14}return 2}function An(e,t){var n=e.alternate;return n===null?(n=pt(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&14680064,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}function li(e,t,n,r,s,o){var l=2;if(r=e,typeof e=="function")ec(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case kr:return ar(n.children,s,o,t);case yu:l=8,s|=8;break;case ta:return e=pt(12,n,t,s|2),e.elementType=ta,e.lanes=o,e;case na:return e=pt(13,n,t,s),e.elementType=na,e.lanes=o,e;case ra:return e=pt(19,n,t,s),e.elementType=ra,e.lanes=o,e;case Tf:return tl(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ef:l=10;break e;case _f:l=9;break e;case vu:l=11;break e;case wu:l=14;break e;case fn:l=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=pt(l,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function ar(e,t,n,r){return e=pt(7,e,r,t),e.lanes=n,e}function tl(e,t,n,r){return e=pt(22,e,r,t),e.elementType=Tf,e.lanes=n,e.stateNode={isHidden:!1},e}function Ul(e,t,n){return e=pt(6,e,null,t),e.lanes=n,e}function $l(e,t,n){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mx(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bl(0),this.expirationTimes=bl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function tc(e,t,n,r,s,o,l,a,u){return e=new Mx(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fu(o),e}function Lx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:br,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function wh(e){if(!e)return Un;e=e._reactInternals;e:{if(yr(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Xe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var n=e.type;if(Xe(n))return wp(e,n,t)}return t}function bh(e,t,n,r,s,o,l,a,u){return e=tc(n,r,!0,e,s,o,l,a,u),e.context=wh(null),n=e.current,r=Be(),s=Dn(n),o=Xt(r,s),o.callback=t??null,In(n,o,s),e.current.lanes=s,wo(e,s,r),Ye(e,r),e}function nl(e,t,n,r){var s=t.current,o=Be(),l=Dn(s);return n=wh(n),t.context===null?t.context=n:t.pendingContext=n,t=Xt(o,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=In(s,t,l),e!==null&&(Nt(e,s,l,o),ti(e,s,l)),l}function Ii(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function _d(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function nc(e,t){_d(e,t),(e=e.alternate)&&_d(e,t)}function Ix(){return null}var kh=typeof reportError=="function"?reportError:function(e){console.error(e)};function rc(e){this._internalRoot=e}rl.prototype.render=rc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));nl(e,t,null,null)};rl.prototype.unmount=rc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){nl(null,e,null,null)}),t[en]=null}};function rl(e){this._internalRoot=e}rl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gn.length&&t!==0&&t<gn[n].priority;n++);gn.splice(n,0,e),n===0&&tp(e)}};function sc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function sl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Td(){}function Ox(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Ii(l);o.call(c)}}var l=bh(t,r,e,0,null,!1,!1,"",Td);return e._reactRootContainer=l,e[en]=l.current,Ys(e.nodeType===8?e.parentNode:e),pr(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Ii(u);a.call(c)}}var u=tc(e,0,!1,null,null,!1,!1,"",Td);return e._reactRootContainer=u,e[en]=u.current,Ys(e.nodeType===8?e.parentNode:e),pr(function(){nl(t,u,n,r)}),u}function ol(e,t,n,r,s){var o=n._reactRootContainer;if(o){var l=o;if(typeof s=="function"){var a=s;s=function(){var u=Ii(l);a.call(u)}}nl(t,l,e,s)}else l=Ox(n,t,e,s,r);return Ii(l)}Yf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Cs(t.pendingLanes);n!==0&&(ju(t,n|1),Ye(t,ge()),!(K&6)&&(is=ge()+500,qn()))}break;case 13:pr(function(){var r=tn(e,1);if(r!==null){var s=Be();Nt(r,e,1,s)}}),nc(e,1)}};Su=function(e){if(e.tag===13){var t=tn(e,134217728);if(t!==null){var n=Be();Nt(t,e,134217728,n)}nc(e,134217728)}};Jf=function(e){if(e.tag===13){var t=Dn(e),n=tn(e,t);if(n!==null){var r=Be();Nt(n,e,t,r)}nc(e,t)}};Zf=function(){return Y};ep=function(e,t){var n=Y;try{return Y=e,t()}finally{Y=n}};pa=function(e,t,n){switch(t){case"input":if(ia(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Gi(r);if(!s)throw Error(_(90));Rf(r),ia(r,s)}}}break;case"textarea":Lf(e,n);break;case"select":t=n.value,t!=null&&Lr(e,!!n.multiple,t,!1)}};Uf=Yu;$f=pr;var Dx={usingClientEntryPoint:!1,Events:[ko,Cr,Gi,Ff,zf,Yu]},ws={findFiberByHostInstance:Kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ax={bundleType:ws.bundleType,version:ws.version,rendererPackageName:ws.rendererPackageName,rendererConfig:ws.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Qf(e),e===null?null:e.stateNode},findFiberByHostInstance:ws.findFiberByHostInstance||Ix,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vo.isDisabled&&Vo.supportsFiber)try{Hi=Vo.inject(Ax),Dt=Vo}catch{}}st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Dx;st.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sc(t))throw Error(_(200));return Lx(e,t,null,n)};st.createRoot=function(e,t){if(!sc(e))throw Error(_(299));var n=!1,r="",s=kh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=tc(e,1,!1,null,null,n,!1,r,s),e[en]=t.current,Ys(e.nodeType===8?e.parentNode:e),new rc(t)};st.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=Qf(t),e=e===null?null:e.stateNode,e};st.flushSync=function(e){return pr(e)};st.hydrate=function(e,t,n){if(!sl(t))throw Error(_(200));return ol(null,e,t,!0,n)};st.hydrateRoot=function(e,t,n){if(!sc(e))throw Error(_(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",l=kh;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=bh(t,null,e,1,n??null,s,!1,o,l),e[en]=t.current,Ys(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new rl(t)};st.render=function(e,t,n){if(!sl(t))throw Error(_(200));return ol(null,e,t,!1,n)};st.unmountComponentAtNode=function(e){if(!sl(e))throw Error(_(40));return e._reactRootContainer?(pr(function(){ol(null,null,e,!1,function(){e._reactRootContainer=null,e[en]=null})}),!0):!1};st.unstable_batchedUpdates=Yu;st.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!sl(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return ol(e,t,n,!1,r)};st.version="18.3.1-next-f1338f8080-20240426";function jh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jh)}catch(e){console.error(e)}}jh(),jf.exports=st;var Fx=jf.exports,Sh,Pd=Fx;Sh=Pd.createRoot,Pd.hydrateRoot;var us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Jn,vn,$r,ff,zx=(ff=class extends us{constructor(){super();O(this,Jn);O(this,vn);O(this,$r);L(this,$r,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){y(this,vn)||this.setEventListener(y(this,$r))}onUnsubscribe(){var t;this.hasListeners()||((t=y(this,vn))==null||t.call(this),L(this,vn,void 0))}setEventListener(t){var n;L(this,$r,t),(n=y(this,vn))==null||n.call(this),L(this,vn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){y(this,Jn)!==t&&(L(this,Jn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof y(this,Jn)=="boolean"?y(this,Jn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jn=new WeakMap,vn=new WeakMap,$r=new WeakMap,ff),oc=new zx,Ux={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},wn,hu,pf,$x=(pf=class{constructor(){O(this,wn,Ux);O(this,hu,!1)}setTimeoutProvider(e){L(this,wn,e)}setTimeout(e,t){return y(this,wn).setTimeout(e,t)}clearTimeout(e){y(this,wn).clearTimeout(e)}setInterval(e,t){return y(this,wn).setInterval(e,t)}clearInterval(e){y(this,wn).clearInterval(e)}},wn=new WeakMap,hu=new WeakMap,pf),Yn=new $x;function Bx(e){setTimeout(e,0)}var qx=typeof window>"u"||"Deno"in globalThis;function $e(){}function Qx(e,t){return typeof e=="function"?e(t):e}function Va(e){return typeof e=="number"&&e>=0&&e!==1/0}function Nh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fn(e,t){return typeof e=="function"?e(t):e}function et(e,t){return typeof e=="function"?e(t):e}function Rd(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:l,stale:a}=e;if(l){if(r){if(t.queryHash!==ic(l,t.options))return!1}else if(!io(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function Md(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(hr(t.options.mutationKey)!==hr(o))return!1}else if(!io(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function ic(e,t){return((t==null?void 0:t.queryKeyHashFn)||hr)(e)}function hr(e){return JSON.stringify(e,(t,n)=>Wa(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function io(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>io(e[n],t[n])):!1}var Hx=Object.prototype.hasOwnProperty;function Ch(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Ld(e)&&Ld(t);if(!r&&!(Wa(e)&&Wa(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),a=l.length,u=r?new Array(a):{};let c=0;for(let h=0;h<a;h++){const p=r?h:l[h],d=e[p],x=t[p];if(d===x){u[p]=d,(r?h<o:Hx.call(e,p))&&c++;continue}if(d===null||x===null||typeof d!="object"||typeof x!="object"){u[p]=x;continue}const v=Ch(d,x,n+1);u[p]=v,v===d&&c++}return o===a&&c===o?e:u}function Oi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ld(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wa(e){if(!Id(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Id(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Id(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vx(e){return new Promise(t=>{Yn.setTimeout(t,e)})}function Ka(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ch(e,t):t}function Wx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Kx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var lc=Symbol();function Eh(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===lc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ac(e,t){return typeof e=="function"?e(...t):!!e}function Gx(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var lo=(()=>{let e=()=>qx;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ga(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var Xx=Bx;function Yx(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=Xx;const o=a=>{t?e.push(a):s(()=>{n(a)})},l=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(u=>{n(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||l()}return u},batchCalls:a=>(...u)=>{o(()=>{a(...u)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var be=Yx(),Br,bn,qr,hf,Jx=(hf=class extends us{constructor(){super();O(this,Br,!0);O(this,bn);O(this,qr);L(this,qr,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){y(this,bn)||this.setEventListener(y(this,qr))}onUnsubscribe(){var t;this.hasListeners()||((t=y(this,bn))==null||t.call(this),L(this,bn,void 0))}setEventListener(t){var n;L(this,qr,t),(n=y(this,bn))==null||n.call(this),L(this,bn,t(this.setOnline.bind(this)))}setOnline(t){y(this,Br)!==t&&(L(this,Br,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return y(this,Br)}},Br=new WeakMap,bn=new WeakMap,qr=new WeakMap,hf),Di=new Jx;function Zx(e){return Math.min(1e3*2**e,3e4)}function _h(e){return(e??"online")==="online"?Di.isOnline():!0}var Xa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Th(e){let t=!1,n=0,r;const s=Ga(),o=()=>s.status!=="pending",l=k=>{var j;if(!o()){const f=new Xa(k);d(f),(j=e.onCancel)==null||j.call(e,f)}},a=()=>{t=!0},u=()=>{t=!1},c=()=>oc.isFocused()&&(e.networkMode==="always"||Di.isOnline())&&e.canRun(),h=()=>_h(e.networkMode)&&e.canRun(),p=k=>{o()||(r==null||r(),s.resolve(k))},d=k=>{o()||(r==null||r(),s.reject(k))},x=()=>new Promise(k=>{var j;r=f=>{(o()||c())&&k(f)},(j=e.onPause)==null||j.call(e)}).then(()=>{var k;r=void 0,o()||(k=e.onContinue)==null||k.call(e)}),v=()=>{if(o())return;let k;const j=n===0?e.initialPromise:void 0;try{k=j??e.fn()}catch(f){k=Promise.reject(f)}Promise.resolve(k).then(p).catch(f=>{var N;if(o())return;const m=e.retry??(lo.isServer()?0:3),g=e.retryDelay??Zx,w=typeof g=="function"?g(n,f):g,S=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,f);if(t||!S){d(f);return}n++,(N=e.onFail)==null||N.call(e,n,f),Vx(w).then(()=>c()?void 0:x()).then(()=>{t?d(f):v()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:u,canStart:h,start:()=>(h()?v():x().then(v),s)}}var Zn,mf,Ph=(mf=class{constructor(){O(this,Zn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Va(this.gcTime)&&L(this,Zn,Yn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(lo.isServer()?1/0:5*60*1e3))}clearGcTimeout(){y(this,Zn)!==void 0&&(Yn.clearTimeout(y(this,Zn)),L(this,Zn,void 0))}},Zn=new WeakMap,mf);function ey(e){return{onFetch:(t,n)=>{var h,p,d,x,v;const r=t.options,s=(d=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:d.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],l=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const c=async()=>{let k=!1;const j=g=>{Gx(g,()=>t.signal,()=>k=!0)},f=Eh(t.options,t.fetchOptions),m=async(g,w,S)=>{if(k)return Promise.reject(t.signal.reason);if(w==null&&g.pages.length)return Promise.resolve(g);const E=(()=>{const q={client:t.client,queryKey:t.queryKey,pageParam:w,direction:S?"backward":"forward",meta:t.options.meta};return j(q),q})(),C=await f(E),{maxPages:T}=t.options,R=S?Kx:Wx;return{pages:R(g.pages,C,T),pageParams:R(g.pageParams,w,T)}};if(s&&o.length){const g=s==="backward",w=g?ty:Od,S={pages:o,pageParams:l},N=w(r,S);a=await m(S,N,g)}else{const g=e??o.length;do{const w=u===0?l[0]??r.initialPageParam:Od(r,a);if(u>0&&w==null)break;a=await m(a,w),u++}while(u<g)}return a};t.options.persister?t.fetchFn=()=>{var k,j;return(j=(k=t.options).persister)==null?void 0:j.call(k,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Od(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ty(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Qr,er,Hr,ut,tr,Se,mo,nr,Ze,Rh,$t,gf,ny=(gf=class extends Ph{constructor(t){super();O(this,Ze);O(this,Qr);O(this,er);O(this,Hr);O(this,ut);O(this,tr);O(this,Se);O(this,mo);O(this,nr);L(this,nr,!1),L(this,mo,t.defaultOptions),this.setOptions(t.options),this.observers=[],L(this,tr,t.client),L(this,ut,y(this,tr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,L(this,er,Ad(this.options)),this.state=t.state??y(this,er),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return y(this,Qr)}get promise(){var t;return(t=y(this,Se))==null?void 0:t.promise}setOptions(t){if(this.options={...y(this,mo),...t},t!=null&&t._type&&L(this,Qr,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Ad(this.options);n.data!==void 0&&(this.setState(Dd(n.data,n.dataUpdatedAt)),L(this,er,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&y(this,ut).remove(this)}setData(t,n){const r=Ka(this.state.data,t,this.options);return $(this,Ze,$t).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){$(this,Ze,$t).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=y(this,Se))==null?void 0:r.promise;return(s=y(this,Se))==null||s.cancel(t),n?n.then($e).catch($e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return y(this,er)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>et(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lc||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Fn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Nh(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=y(this,Se))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=y(this,Se))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),y(this,ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(y(this,Se)&&(y(this,nr)||$(this,Ze,Rh).call(this)?y(this,Se).cancel({revert:!0}):y(this,Se).cancelRetry()),this.scheduleGc()),y(this,ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$(this,Ze,$t).call(this,{type:"invalidate"})}async fetch(t,n){var c,h,p,d,x,v,k,j,f,m,g;if(this.state.fetchStatus!=="idle"&&((c=y(this,Se))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(y(this,Se))return y(this,Se).continueRetry(),y(this,Se).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(S=>S.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(L(this,nr,!0),r.signal)})},o=()=>{const w=Eh(this.options,n),N=(()=>{const E={client:y(this,tr),queryKey:this.queryKey,meta:this.meta};return s(E),E})();return L(this,nr,!1),this.options.persister?this.options.persister(w,N,this):w(N)},a=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:y(this,tr),state:this.state,fetchFn:o};return s(w),w})(),u=y(this,Qr)==="infinite"?ey(this.options.pages):this.options.behavior;u==null||u.onFetch(a,this),L(this,Hr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&$(this,Ze,$t).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta}),L(this,Se,Th({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:w=>{w instanceof Xa&&w.revert&&this.setState({...y(this,Hr),fetchStatus:"idle"}),r.abort()},onFail:(w,S)=>{$(this,Ze,$t).call(this,{type:"failed",failureCount:w,error:S})},onPause:()=>{$(this,Ze,$t).call(this,{type:"pause"})},onContinue:()=>{$(this,Ze,$t).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await y(this,Se).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(x=(d=y(this,ut).config).onSuccess)==null||x.call(d,w,this),(k=(v=y(this,ut).config).onSettled)==null||k.call(v,w,this.state.error,this),w}catch(w){if(w instanceof Xa){if(w.silent)return y(this,Se).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw $(this,Ze,$t).call(this,{type:"error",error:w}),(f=(j=y(this,ut).config).onError)==null||f.call(j,w,this),(g=(m=y(this,ut).config).onSettled)==null||g.call(m,this.state.data,w,this),w}finally{this.scheduleGc()}}},Qr=new WeakMap,er=new WeakMap,Hr=new WeakMap,ut=new WeakMap,tr=new WeakMap,Se=new WeakMap,mo=new WeakMap,nr=new WeakMap,Ze=new WeakSet,Rh=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},$t=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Mh(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Dd(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return L(this,Hr,t.manual?s:void 0),s;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),be.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),y(this,ut).notify({query:this,type:"updated",action:t})})},gf);function Mh(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_h(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Dd(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ad(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var He,W,go,ze,rr,Vr,Qt,kn,xo,Wr,Kr,sr,or,jn,Gr,G,_s,Ya,Ja,Za,eu,tu,nu,ru,Lh,xf,ry=(xf=class extends us{constructor(t,n){super();O(this,G);O(this,He);O(this,W);O(this,go);O(this,ze);O(this,rr);O(this,Vr);O(this,Qt);O(this,kn);O(this,xo);O(this,Wr);O(this,Kr);O(this,sr);O(this,or);O(this,jn);O(this,Gr,new Set);this.options=n,L(this,He,t),L(this,kn,null),L(this,Qt,Ga()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(y(this,W).addObserver(this),Fd(y(this,W),this.options)?$(this,G,_s).call(this):this.updateResult(),$(this,G,eu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return su(y(this,W),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return su(y(this,W),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$(this,G,tu).call(this),$(this,G,nu).call(this),y(this,W).removeObserver(this)}setOptions(t){const n=this.options,r=y(this,W);if(this.options=y(this,He).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof et(this.options.enabled,y(this,W))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$(this,G,ru).call(this),y(this,W).setOptions(this.options),n._defaulted&&!Oi(this.options,n)&&y(this,He).getQueryCache().notify({type:"observerOptionsUpdated",query:y(this,W),observer:this});const s=this.hasListeners();s&&zd(y(this,W),r,this.options,n)&&$(this,G,_s).call(this),this.updateResult(),s&&(y(this,W)!==r||et(this.options.enabled,y(this,W))!==et(n.enabled,y(this,W))||Fn(this.options.staleTime,y(this,W))!==Fn(n.staleTime,y(this,W)))&&$(this,G,Ya).call(this);const o=$(this,G,Ja).call(this);s&&(y(this,W)!==r||et(this.options.enabled,y(this,W))!==et(n.enabled,y(this,W))||o!==y(this,jn))&&$(this,G,Za).call(this,o)}getOptimisticResult(t){const n=y(this,He).getQueryCache().build(y(this,He),t),r=this.createResult(n,t);return oy(this,r)&&(L(this,ze,r),L(this,Vr,this.options),L(this,rr,y(this,W).state)),r}getCurrentResult(){return y(this,ze)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&y(this,Qt).status==="pending"&&y(this,Qt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){y(this,Gr).add(t)}getCurrentQuery(){return y(this,W)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=y(this,He).defaultQueryOptions(t),r=y(this,He).getQueryCache().build(y(this,He),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return $(this,G,_s).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),y(this,ze)))}createResult(t,n){var T;const r=y(this,W),s=this.options,o=y(this,ze),l=y(this,rr),a=y(this,Vr),c=t!==r?t.state:y(this,go),{state:h}=t;let p={...h},d=!1,x;if(n._optimisticResults){const R=this.hasListeners(),q=!R&&Fd(t,n),U=R&&zd(t,r,n,s);(q||U)&&(p={...p,...Mh(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:k,status:j}=p;x=p.data;let f=!1;if(n.placeholderData!==void 0&&x===void 0&&j==="pending"){let R;o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=o.data,f=!0):R=typeof n.placeholderData=="function"?n.placeholderData((T=y(this,Kr))==null?void 0:T.state.data,y(this,Kr)):n.placeholderData,R!==void 0&&(j="success",x=Ka(o==null?void 0:o.data,R,n),d=!0)}if(n.select&&x!==void 0&&!f)if(o&&x===(l==null?void 0:l.data)&&n.select===y(this,xo))x=y(this,Wr);else try{L(this,xo,n.select),x=n.select(x),x=Ka(o==null?void 0:o.data,x,n),L(this,Wr,x),L(this,kn,null)}catch(R){L(this,kn,R)}y(this,kn)&&(v=y(this,kn),x=y(this,Wr),k=Date.now(),j="error");const m=p.fetchStatus==="fetching",g=j==="pending",w=j==="error",S=g&&m,N=x!==void 0,C={status:j,fetchStatus:p.fetchStatus,isPending:g,isSuccess:j==="success",isError:w,isInitialLoading:S,isLoading:S,data:x,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:k,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:w&&!N,isPaused:p.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&N,isStale:uc(t,n),refetch:this.refetch,promise:y(this,Qt),isEnabled:et(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=C.data!==void 0,q=C.status==="error"&&!R,U=je=>{q?je.reject(C.error):R&&je.resolve(C.data)},me=()=>{const je=L(this,Qt,C.promise=Ga());U(je)},ce=y(this,Qt);switch(ce.status){case"pending":t.queryHash===r.queryHash&&U(ce);break;case"fulfilled":(q||C.data!==ce.value)&&me();break;case"rejected":(!q||C.error!==ce.reason)&&me();break}}return C}updateResult(){const t=y(this,ze),n=this.createResult(y(this,W),this.options);if(L(this,rr,y(this,W).state),L(this,Vr,this.options),y(this,rr).data!==void 0&&L(this,Kr,y(this,W)),Oi(n,t))return;L(this,ze,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!y(this,Gr).size)return!0;const l=new Set(o??y(this,Gr));return this.options.throwOnError&&l.add("error"),Object.keys(y(this,ze)).some(a=>{const u=a;return y(this,ze)[u]!==t[u]&&l.has(u)})};$(this,G,Lh).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$(this,G,eu).call(this)}},He=new WeakMap,W=new WeakMap,go=new WeakMap,ze=new WeakMap,rr=new WeakMap,Vr=new WeakMap,Qt=new WeakMap,kn=new WeakMap,xo=new WeakMap,Wr=new WeakMap,Kr=new WeakMap,sr=new WeakMap,or=new WeakMap,jn=new WeakMap,Gr=new WeakMap,G=new WeakSet,_s=function(t){$(this,G,ru).call(this);let n=y(this,W).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($e)),n},Ya=function(){$(this,G,tu).call(this);const t=Fn(this.options.staleTime,y(this,W));if(lo.isServer()||y(this,ze).isStale||!Va(t))return;const r=Nh(y(this,ze).dataUpdatedAt,t)+1;L(this,sr,Yn.setTimeout(()=>{y(this,ze).isStale||this.updateResult()},r))},Ja=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(y(this,W)):this.options.refetchInterval)??!1},Za=function(t){$(this,G,nu).call(this),L(this,jn,t),!(lo.isServer()||et(this.options.enabled,y(this,W))===!1||!Va(y(this,jn))||y(this,jn)===0)&&L(this,or,Yn.setInterval(()=>{(this.options.refetchIntervalInBackground||oc.isFocused())&&$(this,G,_s).call(this)},y(this,jn)))},eu=function(){$(this,G,Ya).call(this),$(this,G,Za).call(this,$(this,G,Ja).call(this))},tu=function(){y(this,sr)!==void 0&&(Yn.clearTimeout(y(this,sr)),L(this,sr,void 0))},nu=function(){y(this,or)!==void 0&&(Yn.clearInterval(y(this,or)),L(this,or,void 0))},ru=function(){const t=y(this,He).getQueryCache().build(y(this,He),this.options);if(t===y(this,W))return;const n=y(this,W);L(this,W,t),L(this,go,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lh=function(t){be.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(y(this,ze))}),y(this,He).getQueryCache().notify({query:y(this,W),type:"observerResultsUpdated"})})},xf);function sy(e,t){return et(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&et(t.retryOnMount,e)===!1)}function Fd(e,t){return sy(e,t)||e.state.data!==void 0&&su(e,t,t.refetchOnMount)}function su(e,t,n){if(et(t.enabled,e)!==!1&&Fn(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&uc(e,t)}return!1}function zd(e,t,n,r){return(e!==t||et(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&uc(e,n)}function uc(e,t){return et(t.enabled,e)!==!1&&e.isStaleByTime(Fn(t.staleTime,e))}function oy(e,t){return!Oi(e.getCurrentResult(),t)}var yo,Rt,Oe,ir,Mt,dn,yf,iy=(yf=class extends Ph{constructor(t){super();O(this,Mt);O(this,yo);O(this,Rt);O(this,Oe);O(this,ir);L(this,yo,t.client),this.mutationId=t.mutationId,L(this,Oe,t.mutationCache),L(this,Rt,[]),this.state=t.state||Ih(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){y(this,Rt).includes(t)||(y(this,Rt).push(t),this.clearGcTimeout(),y(this,Oe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){L(this,Rt,y(this,Rt).filter(n=>n!==t)),this.scheduleGc(),y(this,Oe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){y(this,Rt).length||(this.state.status==="pending"?this.scheduleGc():y(this,Oe).remove(this))}continue(){var t;return((t=y(this,ir))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,u,c,h,p,d,x,v,k,j,f,m,g,w,S,N,E;const n=()=>{$(this,Mt,dn).call(this,{type:"continue"})},r={client:y(this,yo),meta:this.options.meta,mutationKey:this.options.mutationKey};L(this,ir,Th({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(C,T)=>{$(this,Mt,dn).call(this,{type:"failed",failureCount:C,error:T})},onPause:()=>{$(this,Mt,dn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>y(this,Oe).canRun(this)}));const s=this.state.status==="pending",o=!y(this,ir).canStart();try{if(s)n();else{$(this,Mt,dn).call(this,{type:"pending",variables:t,isPaused:o}),y(this,Oe).config.onMutate&&await y(this,Oe).config.onMutate(t,this,r);const T=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,r));T!==this.state.context&&$(this,Mt,dn).call(this,{type:"pending",context:T,variables:t,isPaused:o})}const C=await y(this,ir).start();return await((c=(u=y(this,Oe).config).onSuccess)==null?void 0:c.call(u,C,t,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,C,t,this.state.context,r)),await((x=(d=y(this,Oe).config).onSettled)==null?void 0:x.call(d,C,null,this.state.variables,this.state.context,this,r)),await((k=(v=this.options).onSettled)==null?void 0:k.call(v,C,null,t,this.state.context,r)),$(this,Mt,dn).call(this,{type:"success",data:C}),C}catch(C){try{await((f=(j=y(this,Oe).config).onError)==null?void 0:f.call(j,C,t,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((g=(m=this.options).onError)==null?void 0:g.call(m,C,t,this.state.context,r))}catch(T){Promise.reject(T)}try{await((S=(w=y(this,Oe).config).onSettled)==null?void 0:S.call(w,void 0,C,this.state.variables,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((E=(N=this.options).onSettled)==null?void 0:E.call(N,void 0,C,t,this.state.context,r))}catch(T){Promise.reject(T)}throw $(this,Mt,dn).call(this,{type:"error",error:C}),C}finally{y(this,Oe).runNext(this)}}},yo=new WeakMap,Rt=new WeakMap,Oe=new WeakMap,ir=new WeakMap,Mt=new WeakSet,dn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),be.batch(()=>{y(this,Rt).forEach(r=>{r.onMutationUpdate(t)}),y(this,Oe).notify({mutation:this,type:"updated",action:t})})},yf);function Ih(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ht,wt,vo,vf,ly=(vf=class extends us{constructor(t={}){super();O(this,Ht);O(this,wt);O(this,vo);this.config=t,L(this,Ht,new Set),L(this,wt,new Map),L(this,vo,0)}build(t,n,r){const s=new iy({client:t,mutationCache:this,mutationId:++To(this,vo)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){y(this,Ht).add(t);const n=Wo(t);if(typeof n=="string"){const r=y(this,wt).get(n);r?r.push(t):y(this,wt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(y(this,Ht).delete(t)){const n=Wo(t);if(typeof n=="string"){const r=y(this,wt).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&y(this,wt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Wo(t);if(typeof n=="string"){const r=y(this,wt).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Wo(t);if(typeof n=="string"){const s=(r=y(this,wt).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){be.batch(()=>{y(this,Ht).forEach(t=>{this.notify({type:"removed",mutation:t})}),y(this,Ht).clear(),y(this,wt).clear()})}getAll(){return Array.from(y(this,Ht))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Md(n,r))}findAll(t={}){return this.getAll().filter(n=>Md(t,n))}notify(t){be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return be.batch(()=>Promise.all(t.map(n=>n.continue().catch($e))))}},Ht=new WeakMap,wt=new WeakMap,vo=new WeakMap,vf);function Wo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Vt,Sn,Ve,Wt,Jt,ai,ou,wf,ay=(wf=class extends us{constructor(n,r){super();O(this,Jt);O(this,Vt);O(this,Sn);O(this,Ve);O(this,Wt);L(this,Vt,n),this.setOptions(r),this.bindMethods(),$(this,Jt,ai).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=y(this,Vt).defaultMutationOptions(n),Oi(this.options,r)||y(this,Vt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:y(this,Ve),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&hr(r.mutationKey)!==hr(this.options.mutationKey)?this.reset():((s=y(this,Ve))==null?void 0:s.state.status)==="pending"&&y(this,Ve).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=y(this,Ve))==null||n.removeObserver(this)}onMutationUpdate(n){$(this,Jt,ai).call(this),$(this,Jt,ou).call(this,n)}getCurrentResult(){return y(this,Sn)}reset(){var n;(n=y(this,Ve))==null||n.removeObserver(this),L(this,Ve,void 0),$(this,Jt,ai).call(this),$(this,Jt,ou).call(this)}mutate(n,r){var s;return L(this,Wt,r),(s=y(this,Ve))==null||s.removeObserver(this),L(this,Ve,y(this,Vt).getMutationCache().build(y(this,Vt),this.options)),y(this,Ve).addObserver(this),y(this,Ve).execute(n)}},Vt=new WeakMap,Sn=new WeakMap,Ve=new WeakMap,Wt=new WeakMap,Jt=new WeakSet,ai=function(){var r;const n=((r=y(this,Ve))==null?void 0:r.state)??Ih();L(this,Sn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ou=function(n){be.batch(()=>{var r,s,o,l,a,u,c,h;if(y(this,Wt)&&this.hasListeners()){const p=y(this,Sn).variables,d=y(this,Sn).context,x={client:y(this,Vt),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=y(this,Wt)).onSuccess)==null||s.call(r,n.data,p,d,x)}catch(v){Promise.reject(v)}try{(l=(o=y(this,Wt)).onSettled)==null||l.call(o,n.data,null,p,d,x)}catch(v){Promise.reject(v)}}else if((n==null?void 0:n.type)==="error"){try{(u=(a=y(this,Wt)).onError)==null||u.call(a,n.error,p,d,x)}catch(v){Promise.reject(v)}try{(h=(c=y(this,Wt)).onSettled)==null||h.call(c,void 0,n.error,p,d,x)}catch(v){Promise.reject(v)}}}this.listeners.forEach(p=>{p(y(this,Sn))})})},wf),Lt,bf,uy=(bf=class extends us{constructor(t={}){super();O(this,Lt);this.config=t,L(this,Lt,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??ic(s,n);let l=this.get(o);return l||(l=new ny({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){y(this,Lt).has(t.queryHash)||(y(this,Lt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=y(this,Lt).get(t.queryHash);n&&(t.destroy(),n===t&&y(this,Lt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){be.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return y(this,Lt).get(t)}getAll(){return[...y(this,Lt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Rd(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Rd(t,r)):n}notify(t){be.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){be.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){be.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Lt=new WeakMap,bf),de,Nn,Cn,Xr,Yr,En,Jr,Zr,kf,cy=(kf=class{constructor(e={}){O(this,de);O(this,Nn);O(this,Cn);O(this,Xr);O(this,Yr);O(this,En);O(this,Jr);O(this,Zr);L(this,de,e.queryCache||new uy),L(this,Nn,e.mutationCache||new ly),L(this,Cn,e.defaultOptions||{}),L(this,Xr,new Map),L(this,Yr,new Map),L(this,En,0)}mount(){To(this,En)._++,y(this,En)===1&&(L(this,Jr,oc.subscribe(async e=>{e&&(await this.resumePausedMutations(),y(this,de).onFocus())})),L(this,Zr,Di.subscribe(async e=>{e&&(await this.resumePausedMutations(),y(this,de).onOnline())})))}unmount(){var e,t;To(this,En)._--,y(this,En)===0&&((e=y(this,Jr))==null||e.call(this),L(this,Jr,void 0),(t=y(this,Zr))==null||t.call(this),L(this,Zr,void 0))}isFetching(e){return y(this,de).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return y(this,Nn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=y(this,de).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=y(this,de).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Fn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return y(this,de).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=y(this,de).get(r.queryHash),o=s==null?void 0:s.state.data,l=Qx(t,o);if(l!==void 0)return y(this,de).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return be.batch(()=>y(this,de).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=y(this,de).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=y(this,de);be.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=y(this,de);return be.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=be.batch(()=>y(this,de).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then($e).catch($e)}invalidateQueries(e,t={}){return be.batch(()=>(y(this,de).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=be.batch(()=>y(this,de).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch($e)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($e)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=y(this,de).build(this,t);return n.isStaleByTime(Fn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($e).catch($e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Di.isOnline()?y(this,Nn).resumePausedMutations():Promise.resolve()}getQueryCache(){return y(this,de)}getMutationCache(){return y(this,Nn)}getDefaultOptions(){return y(this,Cn)}setDefaultOptions(e){L(this,Cn,e)}setQueryDefaults(e,t){y(this,Xr).set(hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...y(this,Xr).values()],n={};return t.forEach(r=>{io(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){y(this,Yr).set(hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...y(this,Yr).values()],n={};return t.forEach(r=>{io(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...y(this,Cn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ic(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...y(this,Cn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){y(this,de).clear(),y(this,Nn).clear()}},de=new WeakMap,Nn=new WeakMap,Cn=new WeakMap,Xr=new WeakMap,Yr=new WeakMap,En=new WeakMap,Jr=new WeakMap,Zr=new WeakMap,kf),Oh=b.createContext(void 0),he=e=>{const t=b.useContext(Oh);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},dy=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Oh.Provider,{value:e,children:t})),Dh=b.createContext(!1),fy=()=>b.useContext(Dh);Dh.Provider;function py(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hy=b.createContext(py()),my=()=>b.useContext(hy),gy=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ac(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},xy=e=>{b.useEffect(()=>{e.clearReset()},[e])},yy=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||ac(n,[e.error,r])),vy=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wy=(e,t)=>e.isLoading&&e.isFetching&&!t,by=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ud=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ky(e,t,n){var d,x,v,k;const r=fy(),s=my(),o=he(),l=o.defaultQueryOptions(e);(x=(d=o.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||x.call(d,l);const a=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",vy(l),gy(l,s,a),xy(s);const u=!o.getQueryCache().get(l.queryHash),[c]=b.useState(()=>new t(o,l)),h=c.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(j=>{const f=p?c.subscribe(be.batchCalls(j)):$e;return c.updateResult(),f},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),b.useEffect(()=>{c.setOptions(l)},[l,c]),by(l,h))throw Ud(l,c,s);if(yy({result:h,errorResetBoundary:s,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw h.error;if((k=(v=o.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||k.call(v,l,h),l.experimental_prefetchInRender&&!lo.isServer()&&wy(h,r)){const j=u?Ud(l,c,s):a==null?void 0:a.promise;j==null||j.catch($e).finally(()=>{c.updateResult()})}return l.notifyOnChangeProps?h:c.trackResult(h)}function sn(e,t){return ky(e,ry)}function Ee(e,t){const n=he(),[r]=b.useState(()=>new ay(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const s=b.useSyncExternalStore(b.useCallback(l=>r.subscribe(be.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=b.useCallback((l,a)=>{r.mutate(l,a).catch($e)},[r]);if(s.error&&ac(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}class jy{constructor(){xt(this,"ws");xt(this,"listeners",new Set);xt(this,"reconnectListeners",new Set);xt(this,"reconnectAttempt",0);xt(this,"shouldRun",!1);xt(this,"url");xt(this,"outbox",[]);xt(this,"lastSubscribe");xt(this,"_connectionEpoch",0);const t=location.protocol==="https:"?"wss:":"ws:";this.url=`${t}//${location.host}/ws`}start(){this.shouldRun||(this.shouldRun=!0,this.connect())}stop(){var t;this.shouldRun=!1,this.outbox=[],this.lastSubscribe=void 0,this._connectionEpoch=0,(t=this.ws)==null||t.close(),this.ws=void 0}send(t){var n;if(t.type==="subscribe"&&(this.lastSubscribe=t),((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.ws.send(JSON.stringify(t));return}this.outbox.push(t),this.shouldRun||this.start()}on(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onReconnect(t){return this.reconnectListeners.add(t),()=>this.reconnectListeners.delete(t)}get readyState(){var t;return((t=this.ws)==null?void 0:t.readyState)??WebSocket.CLOSED}get connectionEpoch(){return this._connectionEpoch}connect(){const t=new WebSocket(this.url);this.ws=t,t.addEventListener("open",()=>{if(this.reconnectAttempt=0,this._connectionEpoch+=1,this._connectionEpoch>1&&this.lastSubscribe&&t.send(JSON.stringify(this.lastSubscribe)),this._connectionEpoch>1)for(const r of this.reconnectListeners)try{r()}catch{}const n=this.outbox;this.outbox=[];for(const r of n)t.send(JSON.stringify(r))}),t.addEventListener("message",n=>{let r;try{r=JSON.parse(n.data)}catch{return}for(const s of this.listeners)s(r)}),t.addEventListener("close",()=>{if(this.ws=void 0,!this.shouldRun)return;const n=Math.min(15e3,500*2**this.reconnectAttempt);this.reconnectAttempt+=1,setTimeout(()=>{this.shouldRun&&this.connect()},n)}),t.addEventListener("error",()=>{})}}const fe=new jy,Sy=3e4;async function J(e,t){const{timeout:n,...r}=t??{},s=r.signal??AbortSignal.timeout(n??Sy);return Ny(e,r,s)}async function Ny(e,t,n){const r=await fetch(e,{...t,signal:n,headers:{"Content-Type":"application/json",...t.headers??{}}});if(!r.ok){const s=await r.text().catch(()=>"");throw new Error(Cy(s)??`${r.status} ${r.statusText}${s?`: ${s}`:""}`)}return await r.json()}function Cy(e){if(e)try{const t=JSON.parse(e);if(t&&typeof t.error=="string"&&t.error.length>0)return t.error}catch{}}const So=e=>["config",e],Ey=(e,t)=>["config",e,t??"__none__"];function _y(e,t){return sn({queryKey:Ey(e,t),queryFn:()=>{if(!e)throw new Error("workspaceId required");return J(`/api/workspaces/${encodeURIComponent(e)}/config`)},enabled:!!e})}function Ty(e){const t=he();return Ee({mutationFn:n=>J(`/api/workspaces/${encodeURIComponent(e)}/config/model`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:So(e)})})}function Py(e){const t=he();return Ee({mutationFn:n=>J(`/api/workspaces/${encodeURIComponent(e)}/config/thinking-level`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:So(e)})})}function nb(e){const t=he();return Ee({mutationFn:n=>J(`/api/workspaces/${encodeURIComponent(e)}/config/tools`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>t.invalidateQueries({queryKey:So(e)})})}function Ry(e,t){const n=he();return Ee({mutationFn:r=>{const s=`/api/workspaces/${encodeURIComponent(e)}/config/session-name`,o=t?`${s}?sessionPath=${encodeURIComponent(t)}`:s;return J(o,{method:"PUT",body:JSON.stringify(r)})},onSuccess:()=>{n.invalidateQueries({queryKey:So(e)}),n.invalidateQueries({queryKey:["workspace-sessions",e]})}})}function My(){const e=he();b.useEffect(()=>fe.on(n=>{n.type==="event"&&(n.payload.kind!=="session_info_changed"&&n.payload.kind!=="thinking_level_changed"||e.invalidateQueries({queryKey:So(n.workspaceId)}))}),[e])}function Ah(e){const t=he(),{queryKey:n,messageTypes:r,eventKinds:s}=e,o=b.useRef(n);o.current=n,b.useEffect(()=>{const l=r?new Set(r):void 0,a=s?new Set(s):void 0;return fe.on(c=>{if(l&&c.type!=="event"&&l.has(c.type)){const h=c.workspaceId;h&&t.invalidateQueries({queryKey:o.current(h)});return}a&&c.type==="event"&&a.has(c.payload.kind)&&t.invalidateQueries({queryKey:o.current(c.workspaceId)})})},[t,r,s])}function cc(e){return["workspace-sessions",e]}function Fh(e){return{queryKey:cc(e),queryFn:()=>J(`/api/workspaces/${encodeURIComponent(e)}/sessions`).then(t=>t.sessions),staleTime:3e4}}function Ly(e){return sn({...Fh(e??""),enabled:!!e})}function Iy(e){const t=he();return Ee({mutationFn:n=>{if(!e)throw new Error("workspaceId required");const r=`?path=${encodeURIComponent(n)}`;return J(`/api/workspaces/${encodeURIComponent(e)}/sessions${r}`,{method:"DELETE"})},onSuccess:()=>t.invalidateQueries({queryKey:cc(e)})})}function Oy(e,t){return Ee({mutationFn:async()=>{const n=`/api/workspaces/${encodeURIComponent(e)}/export`,r=t?`${n}?sessionPath=${encodeURIComponent(t)}`:n,s=await J(r),o=new Blob([s.html],{type:"text/html"}),l=URL.createObjectURL(o),a=document.createElement("a");a.href=l,a.download=s.filename,a.click(),URL.revokeObjectURL(l)}})}const Dy=["subscribed"],Ay=["agent_start","agent_end","compaction_end","session_info_changed"];function Fy(){Ah({queryKey:e=>cc(e),messageTypes:Dy,eventKinds:Ay})}function zh(e){return["session-tree",e]}function rb(e,t){return sn({queryKey:zh(e),enabled:!!e&&t,staleTime:2e3,queryFn:()=>{if(!e)throw new Error("workspaceId required");return J(`/api/workspaces/${encodeURIComponent(e)}/tree`)}})}const zy=["subscribed","navigate_tree_result"],Uy=["agent_end","compaction_end"];function $y(){Ah({queryKey:e=>zh(e),messageTypes:zy,eventKinds:Uy})}const on=e=>["resources",e],il=e=>["resources",e,"skill-body"],ll=e=>["resources",e,"prompt-body"];function Et(e,t=""){return`/api/workspaces/${encodeURIComponent(e)}/resources${t}`}function Uh(e){return sn({queryKey:on(e),queryFn:()=>{if(!e)throw new Error("workspaceId required");return J(Et(e))},enabled:!!e})}function By(e){const t=he();return Ee({mutationFn:()=>J(Et(e,"/reload"),{method:"POST"}),onSuccess:n=>{t.setQueryData(on(e),n),t.invalidateQueries({queryKey:il(e)}),t.invalidateQueries({queryKey:ll(e)})}})}function sb(e){const t=he();return Ee({mutationFn:n=>J(Et(e,"/builtin-extensions"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(on(e),n)})}function ob(e,t){return sn({queryKey:[...il(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return J(`${Et(e,"/skill")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function ib(e){const t=he();return Ee({mutationFn:n=>J(Et(e,"/skills"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(on(e),n)})}function lb(e){const t=he();return Ee({mutationFn:n=>J(Et(e,"/skills"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(on(e),n),t.invalidateQueries({queryKey:il(e)})}})}function ab(e){const t=he();return Ee({mutationFn:({filePath:n})=>J(`${Et(e,"/skills")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(on(e),n),t.invalidateQueries({queryKey:il(e)})}})}function ub(e,t){return sn({queryKey:[...ll(e),t],queryFn:()=>{if(!t)throw new Error("filePath required");return J(`${Et(e,"/prompt")}?path=${encodeURIComponent(t)}`)},enabled:!!t,refetchOnWindowFocus:!1,staleTime:1/0})}function cb(e){const t=he();return Ee({mutationFn:n=>J(Et(e,"/prompts"),{method:"POST",body:JSON.stringify(n)}),onSuccess:n=>t.setQueryData(on(e),n)})}function db(e){const t=he();return Ee({mutationFn:n=>J(Et(e,"/prompts"),{method:"PUT",body:JSON.stringify(n)}),onSuccess:n=>{t.setQueryData(on(e),n),t.invalidateQueries({queryKey:ll(e)})}})}function fb(e){const t=he();return Ee({mutationFn:({filePath:n})=>J(`${Et(e,"/prompts")}?path=${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:n=>{t.setQueryData(on(e),n),t.invalidateQueries({queryKey:ll(e)})}})}/**
|
|
26
|
+
* @license lucide-react v0.468.0 - ISC
|
|
27
|
+
*
|
|
28
|
+
* This source code is licensed under the ISC license.
|
|
29
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
30
|
+
*/const qy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$h=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
31
|
+
* @license lucide-react v0.468.0 - ISC
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the ISC license.
|
|
34
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var Qy={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"};/**
|
|
36
|
+
* @license lucide-react v0.468.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/const Hy=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...a},u)=>b.createElement("svg",{ref:u,...Qy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$h("lucide",s),...a},[...l.map(([c,h])=>b.createElement(c,h)),...Array.isArray(o)?o:[o]]));/**
|
|
41
|
+
* @license lucide-react v0.468.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const X=(e,t)=>{const n=b.forwardRef(({className:r,...s},o)=>b.createElement(Hy,{ref:o,iconNode:t,className:$h(`lucide-${qy(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
46
|
+
* @license lucide-react v0.468.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const iu=X("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
51
|
+
* @license lucide-react v0.468.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const lu=X("Blocks",[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]]);/**
|
|
56
|
+
* @license lucide-react v0.468.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const al=X("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
61
|
+
* @license lucide-react v0.468.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const No=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
66
|
+
* @license lucide-react v0.468.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const Vy=X("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
71
|
+
* @license lucide-react v0.468.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const dc=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
76
|
+
* @license lucide-react v0.468.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Wy=X("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
81
|
+
* @license lucide-react v0.468.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const Ky=X("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
86
|
+
* @license lucide-react v0.468.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const Bh=X("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
91
|
+
* @license lucide-react v0.468.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const Gy=X("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
96
|
+
* @license lucide-react v0.468.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const qh=X("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"}]]);/**
|
|
101
|
+
* @license lucide-react v0.468.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const Xy=X("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
106
|
+
* @license lucide-react v0.468.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const Yy=X("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
111
|
+
* @license lucide-react v0.468.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const Jy=X("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
116
|
+
* @license lucide-react v0.468.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const Zy=X("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
121
|
+
* @license lucide-react v0.468.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const fc=X("Folder",[["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"}]]);/**
|
|
126
|
+
* @license lucide-react v0.468.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const e0=X("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
131
|
+
* @license lucide-react v0.468.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const $d=X("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
136
|
+
* @license lucide-react v0.468.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const t0=X("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
141
|
+
* @license lucide-react v0.468.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const mr=X("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
146
|
+
* @license lucide-react v0.468.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const n0=X("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"}]]);/**
|
|
151
|
+
* @license lucide-react v0.468.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const r0=X("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
156
|
+
* @license lucide-react v0.468.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const Qh=X("RefreshCw",[["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"}]]);/**
|
|
161
|
+
* @license lucide-react v0.468.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const Bd=X("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
166
|
+
* @license lucide-react v0.468.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const s0=X("Shrink",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]);/**
|
|
171
|
+
* @license lucide-react v0.468.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const o0=X("SquareSlash",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
|
|
176
|
+
* @license lucide-react v0.468.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const i0=X("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
181
|
+
* @license lucide-react v0.468.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const Hh=X("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
186
|
+
* @license lucide-react v0.468.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const Ai=X("TriangleAlert",[["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"}]]);/**
|
|
191
|
+
* @license lucide-react v0.468.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const pc=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Vh(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Vh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function l0(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Vh(e))&&(r&&(r+=" "),r+=t);return r}const hc="-",a0=e=>{const t=c0(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const a=l.split(hc);return a[0]===""&&a.length!==1&&a.shift(),Wh(a,t)||u0(l)},getConflictingClassGroupIds:(l,a)=>{const u=n[l]||[];return a&&r[l]?[...u,...r[l]]:u}}},Wh=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Wh(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(hc);return(l=t.validators.find(({validator:a})=>a(o)))==null?void 0:l.classGroupId},qd=/^\[(.+)\]$/,u0=e=>{if(qd.test(e)){const t=qd.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},c0=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return f0(Object.entries(e.classGroups),n).forEach(([o,l])=>{au(l,r,o,t)}),r},au=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Qd(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(d0(s)){au(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,l])=>{au(l,Qd(t,o),n,r)})})},Qd=(e,t)=>{let n=e;return t.split(hc).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},d0=e=>e.isThemeGetter,f0=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,a])=>[t+l,a])):o);return[n,s]}):e,p0=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return s(o,l),l},set(o,l){n.has(o)?n.set(o,l):s(o,l)}}},Kh="!",h0=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,l=a=>{const u=[];let c=0,h=0,p;for(let j=0;j<a.length;j++){let f=a[j];if(c===0){if(f===s&&(r||a.slice(j,j+o)===t)){u.push(a.slice(h,j)),h=j+o;continue}if(f==="/"){p=j;continue}}f==="["?c++:f==="]"&&c--}const d=u.length===0?a:a.substring(h),x=d.startsWith(Kh),v=x?d.substring(1):d,k=p&&p>h?p-h:void 0;return{modifiers:u,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:k}};return n?a=>n({className:a,parseClassName:l}):l},m0=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},g0=e=>({cache:p0(e.cacheSize),parseClassName:h0(e),...a0(e)}),x0=/\s+/,y0=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],l=e.trim().split(x0);let a="";for(let u=l.length-1;u>=0;u-=1){const c=l[u],{modifiers:h,hasImportantModifier:p,baseClassName:d,maybePostfixModifierPosition:x}=n(c);let v=!!x,k=r(v?d.substring(0,x):d);if(!k){if(!v){a=c+(a.length>0?" "+a:a);continue}if(k=r(d),!k){a=c+(a.length>0?" "+a:a);continue}v=!1}const j=m0(h).join(":"),f=p?j+Kh:j,m=f+k;if(o.includes(m))continue;o.push(m);const g=s(k,v);for(let w=0;w<g.length;++w){const S=g[w];o.push(f+S)}a=c+(a.length>0?" "+a:a)}return a};function v0(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gh(t))&&(r&&(r+=" "),r+=n);return r}const Gh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gh(e[r]))&&(n&&(n+=" "),n+=t);return n};function w0(e,...t){let n,r,s,o=l;function l(u){const c=t.reduce((h,p)=>p(h),e());return n=g0(c),r=n.cache.get,s=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const h=y0(u,n);return s(u,h),h}return function(){return o(v0.apply(null,arguments))}}const te=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Xh=/^\[(?:([a-z-]+):)?(.+)\]$/i,b0=/^\d+\/\d+$/,k0=new Set(["px","full","screen"]),j0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,S0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,N0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,C0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ut=e=>zr(e)||k0.has(e)||b0.test(e),un=e=>cs(e,"length",O0),zr=e=>!!e&&!Number.isNaN(Number(e)),Bl=e=>cs(e,"number",zr),bs=e=>!!e&&Number.isInteger(Number(e)),_0=e=>e.endsWith("%")&&zr(e.slice(0,-1)),B=e=>Xh.test(e),cn=e=>j0.test(e),T0=new Set(["length","size","percentage"]),P0=e=>cs(e,T0,Yh),R0=e=>cs(e,"position",Yh),M0=new Set(["image","url"]),L0=e=>cs(e,M0,A0),I0=e=>cs(e,"",D0),ks=()=>!0,cs=(e,t,n)=>{const r=Xh.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},O0=e=>S0.test(e)&&!N0.test(e),Yh=()=>!1,D0=e=>C0.test(e),A0=e=>E0.test(e),F0=()=>{const e=te("colors"),t=te("spacing"),n=te("blur"),r=te("brightness"),s=te("borderColor"),o=te("borderRadius"),l=te("borderSpacing"),a=te("borderWidth"),u=te("contrast"),c=te("grayscale"),h=te("hueRotate"),p=te("invert"),d=te("gap"),x=te("gradientColorStops"),v=te("gradientColorStopPositions"),k=te("inset"),j=te("margin"),f=te("opacity"),m=te("padding"),g=te("saturate"),w=te("scale"),S=te("sepia"),N=te("skew"),E=te("space"),C=te("translate"),T=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",B,t],U=()=>[B,t],me=()=>["",Ut,un],ce=()=>["auto",zr,B],je=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Fe=()=>["solid","dashed","dotted","double","none"],it=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",B],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[zr,B];return{cacheSize:500,separator:":",theme:{colors:[ks],spacing:[Ut,un],blur:["none","",cn,B],brightness:Q(),borderColor:[e],borderRadius:["none","","full",cn,B],borderSpacing:U(),borderWidth:me(),contrast:Q(),grayscale:D(),hueRotate:Q(),invert:D(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[_0,un],inset:q(),margin:q(),opacity:Q(),padding:U(),saturate:Q(),scale:Q(),sepia:D(),skew:Q(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",B]}],container:["container"],columns:[{columns:[cn]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...je(),B]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bs,B]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",B]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",bs,B]}],"grid-cols":[{"grid-cols":[ks]}],"col-start-end":[{col:["auto",{span:["full",bs,B]},B]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[ks]}],"row-start-end":[{row:["auto",{span:[bs,B]},B]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",B]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",B]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",B,t]}],"min-w":[{"min-w":[B,t,"min","max","fit"]}],"max-w":[{"max-w":[B,t,"none","full","min","max","fit","prose",{screen:[cn]},cn]}],h:[{h:[B,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[B,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[B,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[B,t,"auto","min","max","fit"]}],"font-size":[{text:["base",cn,un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bl]}],"font-family":[{font:[ks]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",B]}],"line-clamp":[{"line-clamp":["none",zr,Bl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ut,B]}],"list-image":[{"list-image":["none",B]}],"list-style-type":[{list:["none","disc","decimal",B]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Fe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ut,un]}],"underline-offset":[{"underline-offset":["auto",Ut,B]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",B]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...je(),R0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",P0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},L0]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...Fe(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:Fe()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Fe()]}],"outline-offset":[{"outline-offset":[Ut,B]}],"outline-w":[{outline:[Ut,un]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[Ut,un]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cn,I0]}],"shadow-color":[{shadow:[ks]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...it(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":it()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",cn,B]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[g]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",B]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",B]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",B]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[bs,B]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",B]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",B]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",B]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ut,un,Bl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},z0=w0(F0);function P(...e){return z0(l0(e))}const U0={online:"bg-signal-ok",streaming:"bg-brand",idle:"bg-muted-foreground/40",error:"bg-signal-error",warning:"bg-signal-warn"};function $0({state:e}){return i.jsx("span",{className:P("inline-block h-1.5 w-1.5 shrink-0 rounded-full",U0[e],e==="streaming"&&"animate-[v2-halo-brand_2.4s_ease-out_infinite]")})}const B0={default:"text-muted-foreground bg-muted border-border",brand:"text-brand bg-brand-ghost border-brand-ghost",ok:"text-signal-ok bg-signal-ok/[0.10] border-transparent",warn:"text-signal-warn bg-signal-warn/[0.10] border-transparent",error:"text-signal-error bg-error-ghost border-transparent",ghost:"text-muted-foreground bg-transparent border-border-soft"};function re({tone:e="default",mono:t=!1,className:n,title:r,children:s}){return i.jsx("span",{title:r,className:P("inline-flex items-center gap-1.5 rounded-full border px-[9px] py-[2px] text-[11.5px] font-medium leading-[1.5]",t?"font-mono tracking-normal":"tracking-[-0.005em]",B0[e],n),children:s})}function jt({children:e,className:t}){return i.jsx("kbd",{className:P("inline-flex min-w-[18px] items-center justify-center rounded-[5px] border border-border bg-card px-1.5 py-px text-[10.5px] font-medium leading-none text-muted-foreground","border-b-[1.5px] border-b-border-hi",t),children:e})}function ui({active:e,title:t,onClick:n,disabled:r,className:s,children:o,...l}){return i.jsx("button",{type:"button",title:t,onClick:n,disabled:r,"aria-label":l["aria-label"]??t,className:P("inline-flex h-[30px] w-[30px] shrink-0 items-center justify-center rounded-full border text-[13px] transition-[color,background-color,border-color,transform] duration-200 ring-brand-focus disabled:cursor-not-allowed disabled:opacity-50 active:scale-[0.9]",e?"border-brand-ghost bg-brand-ghost text-brand":"border-transparent text-muted-foreground hover:bg-accent/70 hover:text-foreground hover:border-border-soft",s),children:o})}function ln({tool:e,className:t}){const n="currentColor";switch(e){case"read":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 3h7l3 3v5a1 1 0 0 1-1 1H2zM9 3v3h3"})});case"edit":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 10l7-7 2 2-7 7H2zM8.5 3.5L10.5 5.5"})});case"write":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 2h6l3 3v7H3zM7 2v9M3 7h9"})});case"bash":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 4l3 3-3 3M7 10h5"})});case"grep":case"find":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"6",cy:"6",r:"3.5"}),i.jsx("path",{d:"M9 9l3 3"})]});case"ls":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M2 4h10M2 7h10M2 10h6"})});case"todo":return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 4l1.5 1.5L7 3M3 8l1.5 1.5L7 7M9 4.5h3M9 8.5h3"})});case"ask_user":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"7",cy:"7",r:"5"}),i.jsx("path",{d:"M5.5 5.5a1.5 1.5 0 0 1 3 0c0 .9-.9 1.2-1.5 1.7v.6"}),i.jsx("circle",{cx:"7",cy:"10",r:"0.4",fill:n})]});case"web_search":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"7",cy:"7",r:"5"}),i.jsx("path",{d:"M2 7h10"}),i.jsx("path",{d:"M7 2c1.7 1.5 1.7 8.5 0 10"}),i.jsx("path",{d:"M7 2c-1.7 1.5-1.7 8.5 0 10"})]});case"web_fetch":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M7 2v6"}),i.jsx("path",{d:"M4.5 5.5L7 8l2.5-2.5"}),i.jsx("path",{d:"M2.5 11h9"})]});case"subagent":return i.jsxs("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"2",y:"2",width:"4.5",height:"4.5",rx:"1"}),i.jsx("rect",{x:"7.5",y:"7.5",width:"4.5",height:"4.5",rx:"1"}),i.jsx("path",{d:"M6.5 4.25h2.25a1 1 0 0 1 1 1V7.5"})]});default:return i.jsx("svg",{className:t,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:n,strokeWidth:1.2,children:i.jsx("circle",{cx:"7",cy:"7",r:"3"})})}}function wr(e){return e==null?"—":e<1e3?`${Math.round(e)}ms`:e<1e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/1e3)}s`}function Hd(e){if(e!=null)return e>=3e3?"text-signal-error":e>=1500?"text-signal-warn":"text-brand"}function yn({className:e}){return i.jsx("span",{"aria-hidden":!0,className:P("inline-block animate-pulse rounded-[5px] bg-accent/70",e)})}function pb({rows:e=3,className:t,rowClassName:n}){return i.jsx("div",{className:P("flex flex-col gap-2",t),children:Array.from({length:e}).map((r,s)=>i.jsx(yn,{className:P("h-3",s===e-1?"w-2/3":"w-full",n)},s))})}const hb="w-[320px]",mb=480,gb="pi-pilot-artifact-width",xb=320,Fi={compact:"max-w-[920px]",comfortable:"max-w-[860px]"},ul="max-h-80",Jh="w-[48px]",q0=272,Q0="pi-pilot-sidebar-width",H0=200,V0=100;function Zh(e){if(!e||typeof e!="object")return[];const n=e.tasks;return Array.isArray(n)?n.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r;if(typeof s.id!="number"||typeof s.subject!="string")return[];if(!s.subject.trim())return[];const o=s.status;return o!=="pending"&&o!=="in_progress"&&o!=="completed"&&o!=="deleted"?[]:[{id:s.id,subject:s.subject,status:o,description:typeof s.description=="string"?s.description:void 0}]}):[]}function em(e){return e.filter(t=>t.status!=="deleted")}const Vd=e=>{let t;const n=new Set,r=(c,h)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const d=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,d))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,s,a);return a},W0=e=>e?Vd(e):Vd,K0=e=>e;function G0(e,t=K0){const n=Po.useSyncExternalStore(e.subscribe,Po.useCallback(()=>t(e.getState()),[e,t]),Po.useCallback(()=>t(e.getInitialState()),[e,t]));return Po.useDebugValue(n),n}const Wd=e=>{const t=W0(e),n=r=>G0(t,r);return Object.assign(n,t),n},ds=e=>e?Wd(e):Wd,X0=12;function zi(e,t){return`${e}\0${t??""}`}function Us(){return{steer:[],followUp:[],deliveryOrder:[]}}function Kd(e){return{steer:[...e.steer],followUp:[...e.followUp],deliveryOrder:[...e.deliveryOrder]}}function Y0(e,t,n){return{...e,[n]:[...e[n],t]}}const Pt=new Map;let uu=!1;function J0(){const e=uu;return uu=!1,e}function Z0(e){const t=Pt.get(zi(e.workspaceId,e.sessionPath));t&&(tv(t,e.payload),t.backgroundFresh=!0)}function ev(e,t){const n=Pt.get(zi(e,t));n&&(n.backgroundFresh=!1)}function tv(e,t){switch(t.kind){case"agent_start":e.running=!0;return;case"agent_end":e.running=!1;return;case"message_start":{if(t.role==="user"){if(t.text!==void 0){const n=nm(e.items,t.text,e.queuedOriginals);e.items=n.items,e.queuedOriginals=n.queuedOriginals}return}t.role==="assistant"&&(e.items=[...e.items,{id:Ot(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]);return}case"message_end":{if(t.role!=="assistant")return;const n=ao(e.items);if(n<0)return;const r=e.items.slice();r[n]={...r[n],streaming:!1},e.items=r;return}case"message_update":{if(t.delta.kind==="other")return;const n=ao(e.items);if(n<0)return;const r=e.items[n],s=e.items.slice();s[n]=t.delta.kind==="text"?{...r,text:r.text+t.delta.text}:{...r,thinking:r.thinking+t.delta.text},e.items=s;return}case"tool_execution_start":e.items=[...e.items,{id:Ot(),kind:"tool",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args,text:"",status:"running"}];return;case"tool_execution_update":e.items=e.items.map(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId?{...n,text:t.partialText??n.text,...t.details!==void 0?{details:t.details}:{}}:n);return;case"tool_execution_end":e.items=e.items.map(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId?{...n,text:t.text??n.text,status:t.isError?"error":"ok",...t.details!==void 0?{details:t.details}:{}}:n);return;case"queue_update":e.queuedOriginals=tm(e.queuedOriginals,e.queueSteering,e.queueFollowUp,t.steering,t.followUp),e.queueSteering=t.steering,e.queueFollowUp=t.followUp;return;case"compaction_start":e.compaction={reason:t.reason};return;case"compaction_end":e.compaction=void 0;return;case"context_usage":e.contextUsage={tokens:t.tokens,contextWindow:t.contextWindow,percent:t.percent};return;case"assistant_timing":{for(let n=e.items.length-1;n>=0;n--){const r=e.items[n];if(r.kind==="assistant"&&!r.streaming&&r.totalMs===void 0){const s=e.items.slice();s[n]={...r,firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},e.items=s;break}}return}default:return}}let nv=1;const Ot=()=>String(nv++),rv=100,hn=new Map;function Gd(e,t){if(e!==t){for(hn.has(e)&&hn.delete(e);hn.size>=rv;){const n=hn.keys().next().value;if(n!==void 0)hn.delete(n);else break}hn.set(e,t)}}function tm(e,t,n,r,s){const o=Math.max(0,t.length-r.length),l=Math.max(0,n.length-s.length),a=[];if(o>0&&l===0)for(let u=0;u<o;u++)a.push("steer");else if(l>0&&o===0)for(let u=0;u<l;u++)a.push("followUp");return a.length===0?e:{...e,deliveryOrder:[...e.deliveryOrder,...a]}}function sv(e){const t=e.deliveryOrder[0];if(!t)return{original:void 0,queuedOriginals:e};const n=e.deliveryOrder.slice(1),r=e[t],s=r[0],o=s===void 0?r:r.slice(1);return t==="steer"?{original:s,queuedOriginals:{steer:o,followUp:e.followUp,deliveryOrder:n}}:{original:s,queuedOriginals:{steer:e.steer,followUp:o,deliveryOrder:n}}}function nm(e,t,n){const r=e.findIndex(l=>l.kind==="user"&&l.pending===!0);if(r>=0){const l=e.slice(),a=l[r];return Gd(t,a.text),l[r]={...a,pending:!1},{items:l,queuedOriginals:n}}const s=sv(n),o=s.original??t;return s.original!==void 0&&Gd(t,s.original),{items:[...e,{id:Ot(),kind:"user",text:o}],queuedOriginals:s.queuedOriginals}}let $s="",Bs="",Yt=null;function Ui(){if(Yt!==null&&(cancelAnimationFrame(Yt),Yt=null),$s===""&&Bs==="")return;const e=$s,t=Bs;$s="",Bs="",V.setState(n=>{const r=ao(n.items);if(r<0)return{};const s=n.items[r],o=n.items.slice();return o[r]={...s,text:e?s.text+e:s.text,thinking:t?s.thinking+t:s.thinking},{items:o}})}function Xd(){if(Yt===null){if(typeof requestAnimationFrame!="function"){Ui();return}Yt=requestAnimationFrame(()=>{Yt=null,Ui()})}}function cu(){Yt!==null&&(cancelAnimationFrame(Yt),Yt=null),$s="",Bs=""}const du={scrollTop:0,stickToBottom:!0},V=ds(e=>({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:Us(),compaction:void 0,contextUsage:void 0,latency:void 0,composerDraft:"",scrollInfo:du,reset:()=>{cu(),hn.clear(),Pt.clear(),e({sessionPath:void 0,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:Us(),compaction:void 0,contextUsage:void 0,latency:void 0,composerDraft:"",scrollInfo:du})},pushUser:t=>e(n=>({items:[...n.items,{id:Ot(),kind:"user",text:t,pending:!0}]})),rememberQueuedUser:(t,n)=>e(r=>({queuedOriginals:Y0(r.queuedOriginals,t,n)})),apply:t=>{if(t.type==="event"&&t.payload.kind==="message_update"){const n=t.payload.delta;n.kind==="text"?($s+=n.text,Xd()):n.kind==="thinking"&&(Bs+=n.text,Xd());return}Ui(),e(n=>iv(n,t))},setSwitching:t=>e({switching:t}),setComposerDraft:t=>e({composerDraft:t}),setScrollInfo:t=>e({scrollInfo:t}),applyHistory:(t,n)=>{cu(),e({latency:void 0,items:t.map(r=>{if(r.kind==="user"){const s=hn.get(r.text)??r.text;return{id:Ot(),kind:"user",text:s,entryId:r.entryId}}return r.kind==="assistant"?{id:Ot(),kind:"assistant",text:r.text,thinking:r.thinking,streaming:!1,firstTokenMs:void 0,totalMs:void 0}:r.kind==="tool"?{id:Ot(),kind:"tool",toolCallId:r.toolCallId,toolName:r.toolName,args:ov(r.args),text:r.text,status:r.isError?"error":"ok",...r.details!==void 0?{details:r.details}:{}}:{id:Ot(),kind:"bash",command:r.command,output:r.output,exitCode:r.exitCode}}),running:n,...n?{}:{queueSteering:[],queueFollowUp:[],queuedOriginals:Us()}})},saveSnapshot:t=>{const n=V.getState();Ui();const r=zi(t,n.sessionPath),s={sessionPath:n.sessionPath,items:n.items,running:n.running,queueSteering:n.queueSteering,queueFollowUp:n.queueFollowUp,queuedOriginals:Kd(n.queuedOriginals),compaction:n.compaction,contextUsage:n.contextUsage,latency:n.latency,composerDraft:n.composerDraft,scrollInfo:n.scrollInfo,backgroundFresh:!1};for(Pt.has(r)&&Pt.delete(r);Pt.size>=X0;){const o=Pt.keys().next().value;if(o!==void 0)Pt.delete(o);else break}Pt.set(r,s)},restoreSnapshot:(t,n)=>{const r=Pt.get(zi(t,n));if(!r)return{restored:!1,wasFresh:!1};const s=r.backgroundFresh;return V.setState({items:r.items,running:r.running,queueSteering:r.queueSteering,queueFollowUp:r.queueFollowUp,queuedOriginals:Kd(r.queuedOriginals),compaction:r.compaction,contextUsage:r.contextUsage,latency:r.latency,composerDraft:r.composerDraft,scrollInfo:r.scrollInfo}),r.backgroundFresh=!1,{restored:!0,wasFresh:s}}}));function ov(e){if(!(e==null||e==="")){if(typeof e=="object"&&!Array.isArray(e))return e;if(typeof e=="string")try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}}}function iv(e,t){if(t.type==="subscribed"){cu();const n=V.getState().restoreSnapshot(t.workspaceId,t.sessionPath);return uu=n.restored?n.wasFresh:!1,n.restored?{sessionPath:t.sessionPath,switching:!1}:{sessionPath:t.sessionPath,items:[],running:!1,switching:!1,queueSteering:[],queueFollowUp:[],queuedOriginals:Us(),compaction:void 0,latency:void 0,composerDraft:"",scrollInfo:du}}if(t.type==="error"){const n={};if(e.switching&&(n.switching=!1),t.command==="prompt"){const r=e.items.findIndex(s=>s.kind==="user"&&s.pending===!0);if(r>=0){const s=e.items.slice(),o=s[r];s[r]={...o,pending:!1},n.items=s}else n.queuedOriginals=Us()}return n}return t.type==="navigate_tree_result"?{}:t.type!=="event"?{}:lv(e,t.payload)}function lv(e,t){var n;switch(t.kind){case"agent_start":return{running:!0};case"agent_end":return{running:!1};case"message_start":{if(t.role==="user"){if(t.text===void 0)return{};const r=nm(e.items,t.text,e.queuedOriginals);return{items:r.items,queuedOriginals:r.queuedOriginals}}return t.role!=="assistant"?{}:{items:[...e.items,{id:Ot(),kind:"assistant",text:"",thinking:"",streaming:!0,firstTokenMs:void 0,totalMs:void 0}]}}case"message_end":{if(t.role!=="assistant")return{};const r=ao(e.items);if(r<0)return{};const s=e.items.slice();return s[r]={...s[r],streaming:!1},{items:s}}case"message_update":{if(t.delta.kind==="other")return{};const r=ao(e.items);if(r<0)return{};const s=e.items[r],o=t.delta.kind==="text"?{...s,text:s.text+t.delta.text}:{...s,thinking:s.thinking+t.delta.text},l=e.items.slice();return l[r]=o,{items:l}}case"tool_execution_start":return{items:[...e.items,{id:Ot(),kind:"tool",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args,text:"",status:"running"}]};case"tool_execution_update":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.partialText??r.text,...t.details!==void 0?{details:t.details}:{}}:r)};case"tool_execution_end":return{items:e.items.map(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId?{...r,text:t.text??r.text,status:t.isError?"error":"ok",...t.details!==void 0?{details:t.details}:{}}:r)};case"queue_update":return{queueSteering:t.steering,queueFollowUp:t.followUp,queuedOriginals:tm(e.queuedOriginals,e.queueSteering,e.queueFollowUp,t.steering,t.followUp)};case"compaction_start":return{compaction:{reason:t.reason}};case"compaction_end":return{compaction:void 0};case"context_usage":return{contextUsage:{tokens:t.tokens,contextWindow:t.contextWindow,percent:t.percent}};case"assistant_timing":{const r=((n=e.latency)==null?void 0:n.rollingFirstTokenMs)??[],s=t.firstTokenMs==null?r:[...r,t.firstTokenMs].slice(-5),o={lastFirstTokenMs:t.firstTokenMs,lastTotalMs:t.totalMs,rollingFirstTokenMs:s};let l=-1;for(let u=e.items.length-1;u>=0;u--){const c=e.items[u];if(c.kind==="assistant"&&!c.streaming&&c.totalMs===void 0){l=u;break}}if(l<0)return{latency:o};const a=e.items.slice();return a[l]={...a[l],firstTokenMs:t.firstTokenMs,totalMs:t.totalMs},{items:a,latency:o}}default:return{}}}function ao(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="assistant"&&n.streaming)return t}return-1}function av(){const e=V(h=>{for(let p=h.items.length-1;p>=0;p--){const d=h.items[p];if(d&&d.kind==="tool"&&d.toolName==="todo"&&d.details)return d.details}}),[t,n]=b.useState(!1),r=b.useId(),s=Zh(e),o=em(s);if(o.length===0)return null;const l=o.length,a=o.filter(h=>h.status==="completed").length,u=l===0?0:a/l,c=o.find(h=>h.status==="in_progress");return i.jsxs("div",{className:"relative z-10 shrink-0 border-b border-border bg-popover",children:[i.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(h=>!h),className:"flex w-full items-center gap-2.5 px-4 py-1.5 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:[i.jsx(No,{className:P("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180"),"aria-hidden":!0}),i.jsx(ln,{tool:"todo",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Todos"}),i.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums text-muted-foreground",children:[a,"/",l]}),i.jsx("span",{className:`inline-block h-1 ${Jh} shrink-0 overflow-hidden rounded-full bg-border-soft`,role:"progressbar","aria-valuemin":0,"aria-valuenow":a,"aria-valuemax":l,"aria-label":`Todo progress: ${a} of ${l} completed`,children:i.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${u*100}%`}})}),c&&i.jsxs("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:[i.jsx("span",{className:"text-muted-foreground/70",children:"· "}),i.jsx(mr,{className:"mr-1 inline-block h-3 w-3 text-brand align-[-2px] animate-v2-spin","aria-hidden":!0}),c.subject]}),!c&&i.jsx("span",{className:"flex-1","aria-hidden":!0})]}),t&&i.jsx("ul",{id:r,className:"border-t border-border-soft bg-background px-4 py-1.5","aria-label":"Todo items",children:o.map(h=>i.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[i.jsx("span",{className:"mt-[2px] shrink-0",children:h.status==="completed"?i.jsx(al,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):h.status==="in_progress"?i.jsx(mr,{className:"h-3.5 w-3.5 text-brand animate-v2-spin","aria-label":"In progress"}):i.jsx(Bh,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),i.jsxs("span",{className:P("min-w-0 flex-1 text-[12.5px] leading-[1.5]",h.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":h.status==="in_progress"?"text-foreground font-medium":"text-muted-foreground"),children:[i.jsxs("span",{className:"mr-1.5 font-mono text-[11px] text-muted-foreground/50",children:["#",h.id]}),h.subject]})]},h.id))})]})}function uv(){const e=V(n=>n.compaction),t=V(n=>{var r;return(r=n.contextUsage)==null?void 0:r.percent});return e?i.jsxs("div",{className:"relative z-10 flex shrink-0 items-center gap-3 border-b border-border bg-signal-warn/[0.10] px-4 py-2 text-[12.5px] text-signal-warn",children:[i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:"animate-v2-spin",children:i.jsx("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor",strokeWidth:"1.4",strokeDasharray:"3 3"})}),i.jsx("span",{className:"flex-1",children:cv(e)}),t!=null&&i.jsxs("span",{className:"font-mono text-[11px] tabular-nums",children:["Context ",Math.round(t),"%"]})]}):null}function cv(e){switch(e.reason){case"manual":return"Compacting context (manual)…";case"threshold":return"Compacting context — threshold reached";case"overflow":return"Compacting context (overflow) — will retry the prompt";default:return"Compacting context…"}}function dv(e,t,n=!0){return sn({queryKey:["fs","browse",e??"~",t],queryFn:()=>{const r=new URLSearchParams;e!==void 0&&r.set("path",e),t&&r.set("showHidden","1");const s=r.toString();return J(`/api/fs/browse${s?`?${s}`:""}`)},enabled:n,staleTime:3e4})}function fv(e,t,n=!0){const r=t.toLowerCase();return sn({queryKey:["fs","search-files",e??"",r],queryFn:()=>{if(!e)throw new Error("workspaceId required");const s=new URLSearchParams;return r&&s.set("q",r),J(`/api/workspaces/${encodeURIComponent(e)}/files/search${s.toString()?`?${s.toString()}`:""}`)},enabled:n&&!!e,staleTime:5e3})}const fu="pi-pilot-density";function pv(){try{const e=localStorage.getItem(fu);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"}const rm=ds((e,t)=>({density:pv(),setDensity:n=>{try{localStorage.setItem(fu,n)}catch{}e({density:n})},toggle:()=>{const n=t().density==="compact"?"comfortable":"compact";try{localStorage.setItem(fu,n)}catch{}e({density:n})}}));function Yd(e,t){if(t<=0)return null;const n=e.slice(0,t),r=/(?:^|\s)([/@])(\S*)$/.exec(n);if(!r)return null;const s=r[1]??"",o=r[2]??"",l=(r.index??0)+(r[0].length-1-o.length);return{kind:s==="/"?"slash":"at",tokenStart:l,query:o}}function hv(e){const t=[],n=/(^|\s)([/@])(\S+)/g;let r;for(;(r=n.exec(e))!==null;){const s=r[1]??"",o=r[2]??"",l=r[3]??"",a=(r.index??0)+s.length,u=a+1+l.length;t.push({kind:o==="/"?"slash":"at",start:a,end:u,body:e.slice(a,u)})}return t}const sm=[{value:"followUp",label:"Follow-up",description:"Queue after the current reply"},{value:"steer",label:"Steer",description:"Guide the current reply"}];function Ko(e){var t;return((t=sm.find(n=>n.value===e))==null?void 0:t.label)??e}const Jd=50,mv=/\$\{@:\d+(?::\d+)?\}|\$ARGUMENTS|\$@|\$\d+/;function gv(e){return!!e.argumentHint||mv.test(e.content)}function xv(e,t){if(!e)return[];const n=t.toLowerCase(),r=[];for(const s of e.skills)n&&!s.name.toLowerCase().includes(n)||r.push({key:`skill:${s.filePath}`,label:`/skill:${s.name}`,description:s.description||void 0,insertText:`/skill:${s.name} `});for(const s of e.prompts){if(n&&!s.name.toLowerCase().includes(n))continue;const o={key:`prompt:${s.filePath}`,label:`/${s.name}`,description:s.argumentHint?`${s.description??"prompt"} · ${s.argumentHint}`:s.description||"prompt"};gv(s)?o.insertText=`/${s.name} `:o.prompt={name:s.name,description:s.description},r.push(o)}for(const s of e.extensions){const o=s.source.label==="inline";for(const l of s.commands)n&&!l.toLowerCase().includes(n)||r.push({key:`cmd:${s.resolvedPath}:${l}`,label:`/${l}`,description:o?`pi-pilot · ${l}`:`extension · ${s.source.label}`,insertText:`/${l} `})}return r.length>Jd?r.slice(0,Jd):r}function yv(e){return e?e.entries.map(t=>({key:t.path,label:t.relPath,insertText:`@${t.relPath} `})):[]}function vv({workspaceId:e,onSend:t,onAbort:n,running:r,disabled:s}){var _e;const o=V(A=>A.composerDraft),l=V(A=>A.setComposerDraft),a=o,u=l,[c,h]=b.useState(0),[p,d]=b.useState(!1),[x,v]=b.useState(0),[k,j]=b.useState(null),[f,m]=b.useState(null),[g,w]=b.useState("followUp"),S=b.useRef(null),N=b.useRef(null),E=b.useRef(!1),C=rm(A=>A.density)==="compact",T=b.useMemo(()=>Yd(a,c),[a,c]),R=T==null?void 0:T.kind,q=(T==null?void 0:T.query)??"",U=Uh(R==="slash"?e:void 0),me=fv(e,R==="at"?q:"",R==="at"),ce=b.useMemo(()=>R?R==="slash"?xv(U.data,q):yv(me.data):[],[R,q,U.data,me.data]),je=T?`${T.kind}:${T.tokenStart}:${T.query}`:null,Fe=!!T&&ce.length>0&&k!==je;b.useEffect(()=>{v(0)},[je]),b.useEffect(()=>{k&&k!==je&&j(null)},[je,k]),b.useEffect(()=>{m(null)},[e]),b.useEffect(()=>{r||w("followUp")},[r]),b.useEffect(()=>{var A;f&&((A=N.current)==null||A.focus())},[f]);const it=()=>requestAnimationFrame(()=>{var A;return(A=S.current)==null?void 0:A.focus()}),M=()=>{if(s)return;const A=r?g:void 0;if(f){t(`/${f.name}`,A),m(null),u(""),h(0),it();return}const ie=a.trim();ie&&(t(ie,A),u(""),h(0))},D=()=>{m(null),it()},F=A=>{A.key==="Enter"&&!A.shiftKey?(A.preventDefault(),M()):(A.key==="Backspace"||A.key==="Delete"||A.key==="Escape")&&(A.preventDefault(),D())},Q=A=>{if(A.prompt){m(A.prompt),u(""),h(0),j(null),E.current=!1;return}const ie=S.current,fs=(ie==null?void 0:ie.value)??a,hl=(ie==null?void 0:ie.selectionStart)??c,Hn=Yd(fs,hl);if(!Hn)return;const Eo=A.insertText??"",_o=Hn.tokenStart+1+Hn.query.length,ml=fs.slice(0,Hn.tokenStart),H=fs.slice(_o),ye=`${ml}${Eo}${H}`,ve=Hn.tokenStart+Eo.length;u(ye),h(ve),j(null),requestAnimationFrame(()=>{const at=S.current;at&&(at.focus(),at.setSelectionRange(ve,ve))})},Z=()=>{E.current=!0},lt=()=>{E.current=!1},Me=A=>{if(!(E.current||A.nativeEvent.isComposing||A.nativeEvent.keyCode===229)){if(Fe){if(A.key==="ArrowDown"){A.preventDefault(),v(ie=>(ie+1)%ce.length);return}if(A.key==="ArrowUp"){A.preventDefault(),v(ie=>(ie-1+ce.length)%ce.length);return}if(A.key==="Enter"||A.key==="Tab"){A.preventDefault();const ie=ce[x]??ce[0];ie&&Q(ie);return}if(A.key==="Escape"){A.preventDefault(),je&&j(je);return}}A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),M())}},Ft=s?"Switching session…":r?`Agent is running — ${Ko(g)} on Enter…`:"Write a message…",Qe=f!==null||!!a.trim();return i.jsx("div",{className:"relative shrink-0 pb-3 pt-3 v2-rise-in",children:i.jsxs("div",{className:P("pointer-events-auto mx-auto w-full px-6",C?Fi.compact:Fi.comfortable),children:[i.jsxs("div",{className:P("relative rounded-[18px] border bg-card transition-shadow",p?"border-brand-ghost shadow-[0_4px_24px_-8px_hsl(var(--brand)/0.24),0_0_0_3px_hsl(var(--brand)/0.10)]":"border-border-hi shadow-glow-lg"),children:[!f&&Fe&&T&&i.jsx(jv,{kind:T.kind,query:T.query,items:ce,selectedIdx:x,loading:T.kind==="slash"?U.isPending:me.isPending,truncated:T.kind==="at"?!!((_e=me.data)!=null&&_e.truncated):!1,onPick:Q,onHover:v}),f?i.jsx("div",{ref:N,tabIndex:0,role:"group","aria-label":`Loaded prompt /${f.name}`,onKeyDown:F,onFocus:()=>d(!0),onBlur:()=>d(!1),className:P("block w-full p-2 outline-none ring-brand-focus",r?"pr-28":"pr-20"),children:i.jsxs("div",{className:"flex items-start gap-2.5 rounded-[10px] border border-border-soft bg-muted/60 px-3 py-2.5",children:[i.jsx(o0,{className:"mt-px h-4 w-4 shrink-0 text-brand"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"font-mono text-[13px] leading-tight text-foreground",children:["/",f.name]}),f.description&&i.jsx("div",{className:"mt-0.5 truncate text-[12px] text-muted-foreground",children:f.description})]})]})}):i.jsx(wv,{textareaRef:S,text:a,onTextChange:(A,ie)=>{u(A),h(ie)},onCaretChange:h,onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:Me,onCompositionStart:Z,onCompositionEnd:lt,disabled:s,placeholder:Ft}),i.jsxs("div",{className:"absolute bottom-2 right-2 z-10 flex items-center gap-1.5",children:[f&&i.jsx("button",{type:"button",onClick:D,disabled:s,title:"Remove","aria-label":"Remove loaded prompt",className:"inline-flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50 ring-brand-focus",children:i.jsx(pc,{className:"h-3.5 w-3.5"})}),r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:M,disabled:s||!Qe,title:`Send as ${Ko(g).toLowerCase()}`,"aria-label":`Send as ${Ko(g)}`,className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-border-soft bg-card text-foreground transition-[color,background-color,transform] duration-200 hover:bg-accent active:scale-[0.9] disabled:cursor-not-allowed disabled:opacity-50 ring-brand-focus",children:i.jsx(iu,{className:"h-4 w-4",strokeWidth:2.5})}),i.jsx("button",{type:"button",onClick:n,disabled:s,title:"Stop streaming",className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-error-ghost text-signal-error transition-[color,background-color,transform] duration-200 hover:bg-error-subtle active:scale-[0.9] disabled:opacity-50 ring-brand-focus",children:i.jsx(i0,{className:"h-3 w-3",fill:"currentColor"})})]}):i.jsx("button",{type:"button",onClick:M,disabled:s||!Qe,title:"Send",className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-brand text-[hsl(var(--brand-foreground))] transition-[color,background-color,transform] duration-200 hover:bg-brand-strong active:scale-[0.9] disabled:cursor-not-allowed disabled:bg-border-soft disabled:text-muted-foreground ring-brand-focus",children:i.jsx(iu,{className:"h-4 w-4",strokeWidth:2.5})})]})]}),i.jsxs("div",{className:P("mt-1.5 flex flex-wrap items-center gap-2 text-[11.5px] text-muted-foreground",r?"justify-between":"justify-center"),children:[r&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-muted-foreground/80",children:"while running"}),i.jsx("div",{role:"radiogroup","aria-label":"Prompt behavior while running",className:"inline-flex rounded-full border border-border-soft bg-muted/60 p-0.5",children:sm.map(A=>{const ie=A.value===g;return i.jsx("button",{type:"button",role:"radio","aria-checked":ie,onClick:()=>w(A.value),title:A.description,className:P("rounded-full px-2 py-0.5 text-[11px] transition-colors ring-brand-focus",ie?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:A.label},A.value)})})]}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[i.jsx(jt,{children:"⏎"}),i.jsx("span",{children:r?Ko(g).toLowerCase():"send"}),i.jsx("span",{className:"text-muted-foreground/50",children:"·"}),f?i.jsxs(i.Fragment,{children:[i.jsx(jt,{children:"⌫"}),i.jsx("span",{children:"remove"})]}):i.jsxs(i.Fragment,{children:[i.jsx(jt,{children:"⇧⏎"}),i.jsx("span",{children:"newline"}),i.jsx("span",{className:"text-muted-foreground/50",children:"·"}),i.jsx(jt,{children:"/"}),i.jsx("span",{children:"commands"}),i.jsx("span",{className:"text-muted-foreground/50",children:"·"}),i.jsx(jt,{children:"@"}),i.jsx("span",{children:"files"})]})]})]})]})})}const Zd="block max-h-[180px] min-h-[44px] w-full resize-none pl-4 pr-24 pt-3 pb-3 font-sans text-[14px] leading-[1.55] tracking-[-0.005em] whitespace-pre-wrap break-words",ef=180;function wv({textareaRef:e,text:t,onTextChange:n,onCaretChange:r,onFocus:s,onBlur:o,onKeyDown:l,onCompositionStart:a,onCompositionEnd:u,disabled:c,placeholder:h}){const p=b.useRef(null),[d,x]=b.useState(!1),v=b.useMemo(()=>hv(t),[t]),k=b.useCallback(()=>{const S=e.current;S&&r(S.selectionStart??0)},[e,r]),j=b.useCallback(()=>{const S=e.current,N=p.current;!S||!N||(N.scrollTop=S.scrollTop,N.scrollLeft=S.scrollLeft)},[e,p]);b.useLayoutEffect(()=>{const S=e.current;if(!S)return;S.style.height="auto";const N=Math.min(S.scrollHeight,ef);S.style.height=`${N}px`,S.style.overflowY=S.scrollHeight>ef?"auto":"hidden",j()},[t,e,j]);const f=b.useMemo(()=>bv(t,v),[t,v]),g=v.length>0,w=d?"text-transparent":"text-foreground";return i.jsxs("div",{className:"relative",children:[g&&i.jsxs("div",{ref:p,"aria-hidden":!0,className:P(Zd,"pointer-events-none absolute inset-0 overflow-hidden whitespace-pre-wrap"),children:[f.map((S,N)=>S.kind==="text"?i.jsx("span",{className:w,children:S.text},N):i.jsx(kv,{body:S.text,hideText:d},N)),""]}),i.jsx("textarea",{ref:e,"data-composer-input":!0,value:t,onChange:S=>n(S.target.value,S.target.selectionStart??S.target.value.length),onSelect:k,onClick:k,onKeyUp:k,onScroll:j,onCompositionStart:()=>{x(!0),a==null||a()},onCompositionEnd:()=>{x(!1),u==null||u()},onFocus:s,onBlur:o,onKeyDown:l,disabled:c,placeholder:h,spellCheck:!1,autoCorrect:"off",rows:1,className:P(Zd,"relative bg-transparent caret-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",g&&!d?"text-transparent selection:text-transparent selection:bg-brand/20":"text-foreground")})]})}function bv(e,t){if(t.length===0)return[{kind:"text",text:e}];const n=[];let r=0;for(const s of t)s.start>r&&n.push({kind:"text",text:e.slice(r,s.start)}),n.push({kind:s.kind,text:e.slice(s.start,s.end)}),r=s.end;return r<e.length&&n.push({kind:"text",text:e.slice(r)}),n}function kv({body:e,hideText:t=!1}){return i.jsx("span",{className:P("inline rounded-[3px] bg-brand-ghost [box-decoration-break:clone] [-webkit-box-decoration-break:clone]",t?"text-transparent":"text-brand"),children:e})}function jv({kind:e,query:t,items:n,selectedIdx:r,loading:s,truncated:o,onPick:l,onHover:a}){const u=b.useRef(null);b.useEffect(()=>{const p=u.current;if(!p)return;const d=p.querySelector(`[data-idx="${r}"]`);d==null||d.scrollIntoView({block:"nearest"})},[r]);const c=e==="slash"?"Commands":"Files",h=t?`"${t}"`:"";return i.jsxs("div",{className:"absolute bottom-full left-0 right-0 z-30 mb-2 overflow-hidden rounded-[10px] border border-border bg-popover shadow-panel",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-border-soft bg-muted px-3 py-2 text-[11.5px] text-muted-foreground",children:[i.jsxs("span",{children:[i.jsx("span",{className:"font-medium text-foreground",children:c}),h&&i.jsx("span",{className:"ml-1.5 font-mono text-muted-foreground",children:h})]}),i.jsx("span",{className:"font-mono text-[10.5px] tabular-nums",children:s?"…":`${n.length}${o?"+":""}`})]}),i.jsx("div",{ref:u,className:"max-h-64 overflow-y-auto py-1",children:n.map((p,d)=>{const x=d===r;return i.jsxs("button",{type:"button","data-idx":d,onMouseDown:v=>{v.preventDefault(),l(p)},onMouseEnter:()=>a(d),className:P("flex w-full flex-col gap-0.5 px-3 py-1.5 text-left text-[12.5px] transition-colors",x?"bg-brand-ghost text-foreground":"hover:bg-accent/60"),children:[i.jsx("span",{className:"truncate font-mono text-foreground",children:p.label}),p.description&&i.jsx("span",{className:P("truncate text-[11px]",x?"text-brand-strong":"text-muted-foreground"),children:p.description})]},p.key)})}),i.jsxs("div",{className:"flex items-center gap-2 border-t border-border-soft bg-muted px-3 py-1.5 text-[11px] text-muted-foreground",children:[i.jsx(jt,{children:"↑↓"}),"nav",i.jsx(jt,{children:"⏎"}),"insert",i.jsx(jt,{children:"Esc"}),"dismiss"]})]})}function cl({size:e=28,running:t=!1,filled:n,className:r,title:s="pi-pilot"}){const o=n??t;return i.jsx("span",{role:"img","aria-label":s,title:s,className:P("inline-flex shrink-0 items-center justify-center rounded-full",o?"bg-brand text-[hsl(var(--brand-foreground))] border border-brand":"bg-card text-brand border border-border-hi",r),style:{width:e,height:e,fontFamily:'"Instrument Serif", "Times New Roman", serif',fontSize:Math.round(e*.5),fontStyle:"italic",lineHeight:1,letterSpacing:"-0.02em"},children:"π"})}function Sv({className:e}){return i.jsx("span",{className:P("font-sans text-[15px] font-medium tracking-[-0.01em] text-foreground",e),children:"pi-pilot"})}function om({title:e,tagline:t,hint:n,suggestions:r,onPickSuggestion:s}){return i.jsxs("div",{className:"relative z-10 flex max-w-[480px] flex-col items-center px-8 text-center v2-hero-in",children:[i.jsxs("div",{className:"relative",children:[i.jsxs("span",{"aria-hidden":!0,className:"pointer-events-none absolute left-1/2 top-1/2 -z-10 h-[140px] w-[140px] -translate-x-1/2 -translate-y-1/2",children:[i.jsx("span",{className:"absolute inset-0 rounded-full opacity-70 blur-2xl",style:{background:"conic-gradient(from 0deg, hsl(var(--brand) / 0.5), hsl(var(--signal-ok) / 0.25), hsl(var(--brand-strong) / 0.45), hsl(var(--brand) / 0.5))",animation:"v2-aurora 9s ease-in-out infinite"}}),i.jsx("span",{className:"absolute inset-2 rounded-full opacity-50 blur-2xl",style:{background:"conic-gradient(from 120deg, hsl(var(--brand-strong) / 0.4), hsl(var(--brand) / 0.2), hsl(var(--signal-ok) / 0.3), hsl(var(--brand-strong) / 0.4))",animation:"v2-aurora-2 11s ease-in-out infinite"}})]}),i.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 -m-3 rounded-full bg-brand/[0.12] blur-xl v2-glow-breathe"}),i.jsx(cl,{size:56,filled:!0})]}),i.jsx("h2",{className:"mt-5 font-serif text-[36px] italic font-normal leading-[1.05] tracking-[-0.02em]",style:{backgroundImage:"linear-gradient(180deg, hsl(var(--foreground)) 0%, hsl(var(--foreground)) 45%, hsl(var(--foreground) / 0.68) 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent"},children:e}),i.jsx("p",{className:"mt-2 text-[14.5px] leading-[1.6] tracking-[-0.005em] text-muted-foreground",children:t}),n&&i.jsxs("div",{className:"mt-6 inline-flex items-center gap-2 rounded-[10px] border border-border bg-card/80 backdrop-blur-sm px-3.5 py-2 text-[12.5px] text-muted-foreground shadow-sm",children:[n.keys.map(o=>i.jsx(jt,{children:o},o)),i.jsx("span",{children:n.label})]}),r&&r.length>0&&s&&i.jsx("div",{className:"mt-7 flex w-full flex-col gap-2",children:r.map((o,l)=>i.jsxs("button",{type:"button",onClick:()=>s(o.prompt),style:{animationDelay:`${.12+l*.06}s`},className:P("group/sugg v2-rise-soft flex items-center gap-2.5 rounded-xl border border-border-soft bg-card/70 px-3.5 py-2.5 text-left backdrop-blur-[2px]","transition-[border-color,background-color,transform,box-shadow] duration-200","hover:border-brand-ghost hover:bg-brand-ghost hover:shadow-glow-sm active:scale-[0.99] ring-brand-focus"),children:[i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[13px] font-medium text-foreground",children:o.label}),i.jsx("span",{className:"mt-0.5 block truncate text-[12px] text-muted-foreground",children:o.prompt})]}),i.jsx("span",{className:"shrink-0 text-[14px] text-muted-foreground transition-colors group-hover/sugg:text-brand",children:"↵"})]},o.label))})]})}const gr=ds(e=>({toasts:[],errSeen:0,warnSeen:0,pushToast:t=>e(n=>({toasts:[...n.toasts,t],errSeen:n.errSeen+(t.notifyType==="error"?1:0),warnSeen:n.warnSeen+(t.notifyType==="warning"?1:0)})),dismissToast:t=>e(n=>({toasts:n.toasts.filter(r=>r.id!==t)})),resetCounters:()=>e({errSeen:0,warnSeen:0})})),Nv=1500,im={typescript:()=>z(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>z(()=>import("./tsx-COt5Ahok.js"),[]),javascript:()=>z(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>z(()=>import("./jsx-g9-lgVsj.js"),[]),json:()=>z(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>z(()=>import("./jsonc-Des-eS-w.js"),[]),yaml:()=>z(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>z(()=>import("./toml-vGWfd6FD.js"),[]),markdown:()=>z(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>z(()=>import("./mdx-Cmh6b_Ma.js"),[]),html:()=>z(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2])),css:()=>z(()=>import("./css-CLj8gQPS.js"),[]),scss:()=>z(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([3,2])),less:()=>z(()=>import("./less-B1dDrJ26.js"),[]),python:()=>z(()=>import("./python-B6aJPvgy.js"),[]),ruby:()=>z(()=>import("./ruby-CV7NnX5q.js"),__vite__mapDeps([4,0,1,2,5,6,7,8,9,10,11,12,13,14,15,16])),go:()=>z(()=>import("./go-C27-OAKa.js"),[]),rust:()=>z(()=>import("./rust-B1yitclQ.js"),[]),java:()=>z(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>z(()=>import("./kotlin-BdnUsdx6.js"),[]),swift:()=>z(()=>import("./swift-D82vCrfD.js"),[]),csharp:()=>z(()=>import("./csharp-DSvCPggb.js"),[]),c:()=>z(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>z(()=>import("./cpp-DIPi6g--.js"),__vite__mapDeps([12,13,7])),"objective-c":()=>z(()=>import("./objective-c-DXmwc3jG.js"),[]),php:()=>z(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([17,0,1,2,5,6,7,18])),shellscript:()=>z(()=>import("./shellscript-Yzrsuije.js"),[]),sql:()=>z(()=>import("./sql-CRqJ_cUM.js"),[]),dockerfile:()=>z(()=>import("./dockerfile-BcOcwvcX.js"),[]),xml:()=>z(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([5,6])),vue:()=>z(()=>import("./vue-DMJtu8ND.js"),__vite__mapDeps([19,2,1,9,18,0])),svelte:()=>z(()=>import("./svelte-DR4MIrkg.js"),__vite__mapDeps([20,1,9,2])),graphql:()=>z(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([8,1,9,10,11])),diff:()=>z(()=>import("./diff-D97Zzqfu.js"),[]),ini:()=>z(()=>import("./ini-BEwlwnbL.js"),[]),make:()=>z(()=>import("./make-CHLpvVh8.js"),[]),lua:()=>z(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([15,13])),r:()=>z(()=>import("./r-Dspwwk_N.js"),[]),scala:()=>z(()=>import("./scala-C151Ov-r.js"),[]),dart:()=>z(()=>import("./dart-bE4Kk8sk.js"),[]),elixir:()=>z(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([21,0,1,2])),haskell:()=>z(()=>import("./haskell-Df6bDoY_.js"),[])},Cv={ts:"typescript",js:"javascript",py:"python",rb:"ruby",rs:"rust",kt:"kotlin","c++":"cpp",cs:"csharp",objc:"objective-c",sh:"shellscript",shell:"shellscript",bash:"shellscript",zsh:"shellscript",fish:"shellscript",yml:"yaml",md:"markdown",makefile:"make",gnumakefile:"make",mk:"make",docker:"dockerfile","docker-compose":"yaml"};function Ev(e){if(!e)return null;const t=e.toLowerCase().trim();return t?t in im?t:Cv[t]??null:null}let ql=null;const tf=new Set,Ql=new Map;async function lm(){return ql||(ql=(async()=>{const[e,t]=await Promise.all([z(()=>import("./github-light-DAi9KRSo.js"),[]),z(()=>import("./github-dark-DHJKELXO.js"),[])]);return Mm({themes:[e.default,t.default],langs:[],engine:Lm()})})()),ql}async function _v(e){if(tf.has(e))return;const t=Ql.get(e);if(t)return t;const n=im[e];if(!n)return;const r=(async()=>{try{const s=await lm(),o=await n();await s.loadLanguage(o),tf.add(e)}finally{Ql.delete(e)}})();return Ql.set(e,r),r}async function Tv(e,t,n){const r=Ev(t);if(!r||e.length===0)return null;let s=0;for(let l=0;l<e.length;l++)e.charCodeAt(l)===10&&s++;return s+1>Nv?null:(await _v(r),(await lm()).codeToHtml(e,{lang:r,themes:{light:"github-light",dark:"github-dark"},defaultColor:!1,transformers:n==null?void 0:n.transformers}))}function dl({code:e,lang:t,wrap:n=!1,tone:r="default",transformers:s,className:o,defer:l=!1,diffRoles:a}){const[u,c]=b.useState(null),h=b.useMemo(()=>a?[Pv(a),...s??[]]:s,[a,s]);b.useEffect(()=>{let v=!1;if(c(null),!l)return Tv(e,t,{transformers:h}).then(k=>{v||c(k)}).catch(k=>{}),()=>{v=!0}},[e,t,h,l]);const p=n?"whitespace-pre-wrap break-words":"whitespace-pre",d=r==="muted"?"text-muted-foreground":"text-foreground",x="font-mono text-[12px] leading-relaxed";if(u===null){if(a){const v=e.length===0?[""]:e.split(`
|
|
196
|
+
`);return i.jsx("pre",{className:P("diff-unified overflow-auto",x,p,d,o),children:v.map((k,j)=>{const f=a[j]??"context",m=f==="add"?"+":f==="del"?"−":" ";return i.jsxs("div",{className:P("flex",am(f)),children:[i.jsx("span",{className:"diff-marker-cell",children:m}),i.jsx("span",{className:"flex-1 pr-2",children:k||" "})]},j)})})}return i.jsx("pre",{className:P("overflow-auto",x,p,d,o),children:e})}return i.jsx("div",{className:P("shiki-mount overflow-auto",x,n&&"shiki-wrap",d,a&&"diff-unified",o),dangerouslySetInnerHTML:{__html:u}})}function am(e){return e==="add"?"diff-line-add":e==="del"?"diff-line-del":void 0}function Pv(e){return{name:"pi-pilot-unified-diff",line(t,n){const r=e[n-1]??"context",s=r==="add"?"+":r==="del"?"−":" ";t.children.unshift({type:"element",tagName:"span",properties:{class:"diff-marker-cell"},children:[{type:"text",value:s}]});const o=am(r);if(o){const l=t.properties??(t.properties={}),a=typeof l.class=="string"?l.class:Array.isArray(l.class)?l.class.join(" "):"";l.class=a?`${a} ${o}`:o}}}}const um="pi-pilot-theme",Ur=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):void 0;function Hl(e){return e!=="system"?e:Ur!=null&&Ur.matches?"dark":"light"}function Rv(){try{const e=localStorage.getItem(um);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function Vl(e){const t=document.documentElement.classList;e==="dark"?t.add("dark"):t.remove("dark");const n=document.querySelector('meta[name="theme-color"]');n&&n.setAttribute("content",e==="dark"?"#0C0E12":"#F4EFE5")}const cm=ds((e,t)=>{const n=Rv(),r=Hl(n);Vl(r);const s=()=>{const{choice:o}=t();if(o!=="system")return;const l=Hl("system");Vl(l),e({resolved:l})};return Ur==null||Ur.addEventListener("change",s),{choice:n,resolved:r,setTheme:o=>{const l=Hl(o);Vl(l);try{localStorage.setItem(um,o)}catch{}e({choice:o,resolved:l})}}});cm.getState();const nf=80,Mv=600;function Lv({code:e,lang:t,className:n}){const r=b.useRef(null),[s,o]=b.useState(nf),l=cm(a=>a.resolved);return b.useEffect(()=>{const a=u=>{var h;if(u.source!==((h=r.current)==null?void 0:h.contentWindow))return;const c=u.data;!c||c.type!=="pi-preview-height"||typeof c.height=="number"&&o(Math.max(nf,Math.min(Mv,Math.ceil(c.height))))};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),i.jsx("iframe",{ref:r,title:`${t??"html"} preview`,sandbox:"allow-scripts",srcDoc:Iv(e,l),className:P("block w-full border-0 bg-transparent",n),style:{height:s}})}function Iv(e,t){return`<!doctype html>
|
|
197
|
+
<html>
|
|
198
|
+
<head>
|
|
199
|
+
<meta charset="utf-8">
|
|
200
|
+
<meta http-equiv="Content-Security-Policy" content="${["default-src 'none'","img-src data: blob:","media-src data: blob:","style-src 'unsafe-inline'","font-src data:","script-src 'unsafe-inline'","connect-src 'none'","form-action 'none'","base-uri 'none'","frame-src 'none'"].join("; ")}">
|
|
201
|
+
<meta name="color-scheme" content="${t}">
|
|
202
|
+
<style>
|
|
203
|
+
html { color-scheme: ${t}; }
|
|
204
|
+
html, body { margin: 0; padding: 0; background: Canvas; color: CanvasText; }
|
|
205
|
+
body { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; }
|
|
206
|
+
</style>
|
|
207
|
+
</head>
|
|
208
|
+
<body>
|
|
209
|
+
${e}
|
|
210
|
+
<script>
|
|
211
|
+
(function () {
|
|
212
|
+
// Measure <body>, not <html>: documentElement.scrollHeight is floored at
|
|
213
|
+
// the iframe's own viewport height, which feeds back on itself and never
|
|
214
|
+
// shrinks. body sizes to its content.
|
|
215
|
+
function report() {
|
|
216
|
+
var body = document.body;
|
|
217
|
+
if (!body) return;
|
|
218
|
+
var h = Math.max(body.scrollHeight, Math.ceil(body.getBoundingClientRect().height));
|
|
219
|
+
parent.postMessage({ type: "pi-preview-height", height: h }, "*");
|
|
220
|
+
}
|
|
221
|
+
window.addEventListener("load", report);
|
|
222
|
+
if (window.ResizeObserver) {
|
|
223
|
+
try {
|
|
224
|
+
new ResizeObserver(report).observe(document.body);
|
|
225
|
+
} catch (e) {}
|
|
226
|
+
}
|
|
227
|
+
report();
|
|
228
|
+
})();
|
|
229
|
+
<\/script>
|
|
230
|
+
</body>
|
|
231
|
+
</html>`}const dm=b.createContext(!1);function uo({text:e,streaming:t,className:n}){return i.jsxs("div",{className:P("font-sans text-[14px] leading-[1.5] tracking-[-0.005em] text-foreground","[&>p:last-child]:inline","[overflow-wrap:anywhere]",n),children:[i.jsx(dm.Provider,{value:t??!1,children:i.jsx(Pm,{remarkPlugins:[Rm],components:Ov,children:e})}),t&&i.jsx("span",{className:"ml-1 inline-block h-[15px] w-[2.5px] translate-y-[2px] rounded-full bg-brand align-baseline animate-v2-caret","aria-hidden":!0})]})}const Ov={h1:({children:e})=>i.jsx("h1",{className:"mb-2.5 mt-6 text-[21px] font-semibold tracking-[-0.02em] text-foreground first:mt-0",children:e}),h2:({children:e})=>i.jsx("h2",{className:"mb-2 mt-5 text-[17px] font-semibold tracking-[-0.015em] text-foreground first:mt-0",children:e}),h3:({children:e})=>i.jsx("h3",{className:"mb-1.5 mt-4 text-[15px] font-semibold tracking-[-0.01em] text-foreground first:mt-0",children:e}),h4:({children:e})=>i.jsx("h4",{className:"mb-1.5 mt-3.5 text-[14px] font-semibold tracking-[-0.005em] text-foreground first:mt-0",children:e}),h5:({children:e})=>i.jsx("h5",{className:"mb-1 mt-3 text-[13px] font-medium text-foreground first:mt-0",children:e}),h6:({children:e})=>i.jsx("h6",{className:"mb-1 mt-3 text-[12.5px] font-medium uppercase tracking-[0.04em] text-muted-foreground first:mt-0",children:e}),strong:({children:e})=>i.jsx("strong",{className:"font-medium text-foreground",children:e}),em:({children:e})=>i.jsx("em",{className:"italic text-foreground",children:e}),p:({children:e})=>i.jsx("p",{className:"my-2 first:mt-0 last:mb-0",children:e}),a:({href:e,children:t})=>i.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-brand underline underline-offset-2 transition-colors hover:text-brand-strong",children:t}),hr:()=>i.jsx("hr",{className:"my-3 border-t border-border-soft"}),ul:({children:e})=>i.jsx("ul",{className:"my-2 flex list-none flex-col gap-[3px] pl-5",children:e}),ol:({children:e,start:t})=>i.jsx("ol",{className:"my-2 flex list-decimal flex-col gap-[3px] pl-6 marker:font-mono marker:text-[12px] marker:text-muted-foreground [&>li::before]:!content-none",start:t??void 0,children:e}),li:({children:e,...t})=>{const n=typeof t.className=="string"&&t.className.includes("task-list-item");return i.jsx("li",{className:P("relative",!n&&"pl-3 before:absolute before:left-0 before:top-0 before:text-muted-foreground before:content-['·']"),children:e})},blockquote:({children:e})=>i.jsx("blockquote",{className:"my-2 border-l-2 border-brand-subtle pl-3 text-muted-foreground",children:e}),table:({children:e})=>i.jsx("div",{className:"my-3 overflow-x-auto rounded-md border border-border-soft",children:i.jsx("table",{className:"w-full border-collapse text-[12.5px]",children:e})}),thead:({children:e})=>i.jsx("thead",{className:"border-b border-border-soft bg-muted",children:e}),tbody:({children:e})=>i.jsx("tbody",{children:e}),tr:({children:e})=>i.jsx("tr",{className:"border-b border-border-soft/60 last:border-b-0",children:e}),th:({children:e,style:t})=>i.jsx("th",{style:t,className:"px-2.5 py-2 text-left text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground",children:e}),td:({children:e,style:t})=>i.jsx("td",{style:t,className:"px-2.5 py-1.5 align-top text-foreground",children:e}),img:({src:e,alt:t})=>i.jsx("img",{src:e,alt:t,className:"my-2 max-w-full rounded-md border border-border-soft"}),pre:({node:e,children:t})=>{const n=Dv(e);return n?i.jsx(zv,{code:n.code,lang:n.lang}):i.jsx("pre",{className:"my-3 overflow-x-auto rounded-md border border-border-soft bg-muted px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground",children:t})},code:({className:e,children:t,...n})=>typeof e=="string"&&/\blanguage-/.test(e)?i.jsx("code",{className:e,...n,children:t}):i.jsx("code",{className:"rounded-[5px] border border-border-soft bg-muted px-1.5 py-px font-mono text-[12px] text-foreground",...n,children:t})};function Dv(e){var l;if(!e||!Array.isArray(e.children))return null;const t=e.children.find(a=>a.type==="element"&&a.tagName==="code");if(!t)return null;const n=(l=t.properties)==null?void 0:l.className,r=Array.isArray(n)?n.find(a=>typeof a=="string"&&a.startsWith("language-")):void 0,s=r?r.slice(9):void 0;let o="";for(const a of t.children||[])a.type==="text"&&typeof a.value=="string"&&(o+=a.value);return o.endsWith(`
|
|
232
|
+
`)&&(o=o.slice(0,-1)),{code:o,lang:s}}const Av=new Set(["html","svg"]),Fv="code";function zv({code:e,lang:t}){const n=gr(x=>x.pushToast),[r,s]=b.useState(!1),[o,l]=b.useState(Fv),a=b.useContext(dm),c=!!t&&Av.has(t.toLowerCase())&&!a,h=c&&o==="preview",p=async()=>{if(e)try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1200)}catch{n({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}},d=t&&t.trim()?t.trim().toLowerCase():"text";return i.jsxs("div",{className:"group/code relative my-3 overflow-hidden rounded-lg border border-border bg-card shadow-glow",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border-soft bg-muted/30 py-1 pl-3.5 pr-1.5",children:[i.jsx("span",{className:"select-none font-mono text-[11px] leading-none tracking-[0.02em] text-muted-foreground",children:d}),i.jsxs("div",{className:"flex items-center gap-1",children:[c&&i.jsxs("div",{className:"flex items-center gap-0.5 rounded-md border border-border-soft bg-card p-0.5 text-[11px] font-medium",children:[i.jsxs("button",{type:"button",onClick:()=>l("code"),"aria-pressed":o==="code",className:P("flex items-center gap-1 rounded-[5px] px-1.5 py-0.5 transition-colors",o==="code"?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Gy,{className:"h-3 w-3"}),"Code"]}),i.jsxs("button",{type:"button",onClick:()=>l("preview"),"aria-pressed":o==="preview",className:P("flex items-center gap-1 rounded-[5px] px-1.5 py-0.5 transition-colors",o==="preview"?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Jy,{className:"h-3 w-3"}),"Preview"]})]}),i.jsx("button",{type:"button",onClick:p,title:"Copy code","aria-label":"Copy code",className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium leading-none text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:r?i.jsxs(i.Fragment,{children:[i.jsx(al,{className:"h-3 w-3 text-signal-ok"}),"Copied"]}):i.jsxs(i.Fragment,{children:[i.jsx(qh,{className:"h-3 w-3"}),"Copy"]})})]})]}),h?i.jsx(Lv,{code:e,lang:t}):i.jsx(dl,{code:e,lang:t,className:"px-3.5 py-3",defer:a})]})}function Uv(e){if(!e||typeof e!="object")return null;const t=e;if(t.kind==="option"){const n=Array.isArray(t.indices)?t.indices.filter(l=>typeof l=="number"):void 0,r=Array.isArray(t.labels)?t.labels.filter(l=>typeof l=="string"):void 0,s=n&&n.length>0,o=r&&r.length>0;return!s&&!o?null:{kind:"option",indices:n,labels:r}}return t.kind==="other"&&typeof t.text=="string"?{kind:"other",text:t.text}:t.kind==="skip"?{kind:"skip"}:t.kind==="timeout"?{kind:"timeout"}:null}function $v(e){if(e.startsWith("User selected:")){const t=[],n=/"([^"]+)"/g;let r;for(;(r=n.exec(e))!==null;)t.push(r[1]);return t.length>0?{kind:"option",labels:t}:{kind:"unknown"}}if(e.startsWith("User answered (freeform):")){const t=e.match(/"([\s\S]*)"\s*$/);return{kind:"other",text:t?t[1]:""}}return e.startsWith("User chose to skip")?{kind:"skip"}:e.startsWith("No answer within")?{kind:"timeout"}:{kind:"unknown"}}function Bv(e){if(!e)return null;const t=typeof e.question=="string"?e.question:null;if(!t)return null;const n=Array.isArray(e.options)?e.options:[],r=[];for(const s of n){if(!s||typeof s!="object")continue;const o=s;typeof o.label=="string"&&r.push({label:o.label,description:typeof o.description=="string"?o.description:void 0})}return r.length<2?null:{question:t,header:typeof e.header=="string"?e.header:void 0,options:r,multiSelect:e.multiSelect===!0,allowOther:e.allowOther!==!1}}function qv({item:e,onSubmit:t}){const n=b.useMemo(()=>Bv(e.args),[e.args]);return n?e.status==="error"?i.jsxs($i,{children:[i.jsx(Bi,{header:n.header,statusPill:i.jsx(re,{tone:"warn",children:"aborted"})}),i.jsx(mc,{text:n.question}),i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12px] text-muted-foreground",children:"Question dismissed before an answer was recorded."})]}):e.status==="ok"?i.jsx(Wv,{parsed:n,details:e.details,resultText:e.text}):i.jsx(Qv,{parsed:n,onSubmit:t}):i.jsxs($i,{children:[i.jsx(Bi,{header:void 0}),i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12.5px] text-muted-foreground",children:e.text||"ask_user: malformed arguments"})]})}function Qv({parsed:e,onSubmit:t}){const[n,r]=b.useState(new Set),[s,o]=b.useState(!1),[l,a]=b.useState(""),[u,c]=b.useState(!1);b.useEffect(()=>{if(!u)return;const k=setTimeout(()=>c(!1),12e3);return()=>clearTimeout(k)},[u]);const h=k=>{r(j=>{if(e.multiSelect){const f=new Set(j);return f.has(k)?f.delete(k):f.add(k),f.size>0&&o(!1),f}return o(!1),new Set([k])})},p=()=>{o(k=>{const j=!k;return j&&r(new Set),j})},d=s?l.trim().length>0:n.size>0,x=()=>{!d||u||(c(!0),t(s?{kind:"other",text:l.trim()}:{kind:"option",indices:[...n].sort((k,j)=>k-j)}))},v=()=>{u||(c(!0),t({kind:"skip"}))};return i.jsxs($i,{children:[i.jsx(Bi,{header:e.header,statusPill:u?i.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground",children:[i.jsx(mr,{className:"h-3 w-3 text-brand animate-v2-spin"}),"sending"]}):i.jsx(re,{tone:"brand",children:"awaiting"})}),i.jsx(mc,{text:e.question}),i.jsxs("ul",{className:"flex flex-col gap-1.5 border-t border-border-soft bg-background px-3 py-2",children:[e.options.map((k,j)=>i.jsx("li",{children:i.jsx(Hv,{option:k,checked:n.has(j),disabled:u,multi:e.multiSelect,onToggle:()=>h(j)})},j)),e.allowOther&&i.jsx("li",{children:i.jsx(Vv,{checked:s,value:l,disabled:u,onToggle:p,onChange:a,onEnter:x})})]}),i.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border-soft bg-muted/50 px-3 py-2",children:[i.jsx("button",{type:"button",onClick:v,disabled:u,className:"rounded-md px-3 py-1 text-[12px] text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground disabled:opacity-50 ring-brand-focus",children:"Skip"}),i.jsx("button",{type:"button",onClick:x,disabled:!d||u,className:P("rounded-md px-3 py-1 text-[12px] font-medium transition-colors ring-brand-focus",d&&!u?"bg-brand text-brand-foreground hover:bg-brand/90":"bg-muted text-muted-foreground cursor-not-allowed"),children:"Submit"})]})]})}function Hv({option:e,checked:t,disabled:n,multi:r,onToggle:s}){return i.jsxs("button",{type:"button",onClick:s,disabled:n,className:P("flex w-full items-start gap-2.5 rounded-md border px-2.5 py-1.5 text-left transition-colors ring-brand-focus",t?"border-brand bg-brand-ghost":"border-border-soft bg-card hover:border-border hover:bg-accent/40",n&&"cursor-not-allowed opacity-60"),children:[i.jsx("span",{className:P("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center border",r?"rounded-[3px]":"rounded-full",t?"border-brand bg-brand":"border-muted-foreground/40 bg-background"),"aria-hidden":!0,children:t&&i.jsx("span",{className:P("block bg-brand-foreground",r?"h-2 w-2 rounded-[1px]":"h-1.5 w-1.5 rounded-full")})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:P("block text-[12.5px] leading-[1.4]",t?"font-medium text-foreground":"text-foreground"),children:e.label}),e.description&&i.jsx("span",{className:"mt-0.5 block text-[11.5px] leading-[1.45] text-muted-foreground",children:e.description})]})]})}function Vv({checked:e,value:t,disabled:n,onToggle:r,onChange:s,onEnter:o}){return i.jsxs("div",{className:P("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",e?"border-brand bg-brand-ghost":"border-border-soft bg-card",n&&"cursor-not-allowed opacity-60"),children:[i.jsx("button",{type:"button",onClick:r,disabled:n,"aria-pressed":e,"aria-label":"Other",className:P("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border ring-brand-focus transition-colors",e?"border-brand bg-brand":"border-muted-foreground/40 bg-background"),children:e&&i.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-brand-foreground"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[12.5px] leading-[1.4] text-foreground",children:"Other"}),i.jsx("input",{type:"text",value:t,placeholder:"Type your answer",disabled:n||!e,onChange:l=>s(l.target.value),onFocus:()=>{e||r()},onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o())},className:P("mt-1 block w-full rounded-md border border-border-soft bg-background px-2 py-1 text-[12px] text-foreground placeholder:text-muted-foreground/60 ring-brand-focus disabled:opacity-50")})]})]})}function Wv({parsed:e,details:t,resultText:n}){const r=b.useMemo(()=>Uv(t)??$v(n),[t,n]),s=b.useMemo(()=>{if(r.kind!=="option")return new Set;if(r.indices)return new Set(r.indices);const l=new Set;return e.options.forEach((a,u)=>{var c;(c=r.labels)!=null&&c.includes(a.label)&&l.add(u)}),l},[r,e.options]),o=r.kind==="skip"?i.jsx(re,{tone:"warn",children:"skipped"}):r.kind==="timeout"?i.jsx(re,{tone:"warn",children:"timed out"}):i.jsx(re,{tone:"ok",children:"answered"});return i.jsxs($i,{children:[i.jsx(Bi,{header:e.header,statusPill:o}),i.jsx(mc,{text:e.question}),i.jsxs("ul",{className:"flex flex-col gap-1.5 border-t border-border-soft bg-background px-3 py-2",children:[e.options.map((l,a)=>{const u=s.has(a);return i.jsxs("li",{className:P("flex items-start gap-2.5 rounded-md border px-2.5 py-1.5",u?"border-brand bg-brand-ghost":"border-border-soft bg-card opacity-60"),children:[i.jsx("span",{className:P("mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center border",e.multiSelect?"rounded-[3px]":"rounded-full",u?"border-brand bg-brand":"border-muted-foreground/30 bg-background"),"aria-hidden":!0,children:u&&i.jsx("span",{className:P("block bg-brand-foreground",e.multiSelect?"h-2 w-2 rounded-[1px]":"h-1.5 w-1.5 rounded-full")})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:P("block text-[12.5px] leading-[1.4]",u?"font-medium text-foreground":"text-muted-foreground"),children:l.label}),l.description&&i.jsx("span",{className:"mt-0.5 block text-[11.5px] leading-[1.45] text-muted-foreground/80",children:l.description})]})]},a)}),r.kind==="other"&&i.jsxs("li",{className:P("flex items-start gap-2.5 rounded-md border border-brand bg-brand-ghost px-2.5 py-1.5"),children:[i.jsx("span",{className:"mt-[2px] flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full border border-brand bg-brand","aria-hidden":!0,children:i.jsx("span",{className:"block h-1.5 w-1.5 rounded-full bg-brand-foreground"})}),i.jsxs("span",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block text-[12.5px] font-medium leading-[1.4] text-foreground",children:"Other"}),i.jsx("span",{className:"mt-0.5 block text-[12px] leading-[1.45] text-muted-foreground [overflow-wrap:anywhere]",children:r.text||"(empty)"})]})]})]}),(r.kind==="skip"||r.kind==="timeout"||r.kind==="unknown")&&i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[12px] text-muted-foreground",children:n})]})}function $i({children:e}){return i.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function Bi({header:e,statusPill:t}){return i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[i.jsx(ln,{tool:"ask_user",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Ask user"}),e&&i.jsx(re,{tone:"ghost",className:"shrink-0 max-w-[120px] truncate",children:e}),i.jsx("span",{className:"min-w-0 flex-1"}),t]})}function mc({text:e}){return i.jsx("div",{className:"border-t border-border-soft bg-background px-3 py-2 text-[13px] leading-[1.5] text-foreground",children:e})}const fl="create_artifact",Kv=new Set(["html","svg","markdown","code"]);function Gv(e){return e.kind==="tool"&&e.toolName===fl}function fm(e){const t=e.args;if(!t||typeof t!="object")return null;const n=t,{type:r,title:s,content:o}=n;if(typeof r!="string"||!Kv.has(r)||typeof s!="string"||!s.trim()||typeof o!="string")return null;const l=typeof n.id=="string"&&n.id.trim()?n.id.trim():e.toolCallId,a=typeof n.language=="string"?n.language:void 0;return{toolCallId:e.toolCallId,id:l,type:r,title:s,content:o,...a?{language:a}:{}}}function yb(e){const t=[];for(const n of e){if(!Gv(n))continue;const r=fm(n);r&&t.push(r)}return t}function vb(e){return e.length?e[e.length-1]:null}function wb(e,t){if(!t)return null;for(let n=e.length-1;n>=0;n--)if(e[n].toolCallId===t)return e[n];return null}function Xv(e,t){return e.filter(n=>n.id===t)}function bb(e,t){const n=Xv(e,t.id),r=n.findIndex(s=>s.toolCallId===t.toolCallId);return{index:r>=0?r+1:n.length,count:n.length}}function kb(e){const t=[],n=new Map;for(const r of e)n.has(r.id)||t.push(r.id),n.set(r.id,r);return t.map(r=>n.get(r))}const co=ds(e=>({rightPanel:null,togglePanel:t=>e(n=>({rightPanel:n.rightPanel===t?null:t})),openPanel:t=>e({rightPanel:t}),closePanel:()=>e({rightPanel:null})})),pu=ds(e=>({selectedToolCallId:null,open:t=>{e({selectedToolCallId:t}),co.getState().openPanel("artifact")},select:t=>e({selectedToolCallId:t}),clear:()=>e({selectedToolCallId:null})})),Yv=25e4;function Jv(e,t){if(e===t)return Wl(e).map(p=>({role:"context",text:p}));const n=Wl(e),r=Wl(t);let s=0;const o=Math.min(n.length,r.length);for(;s<o&&n[s]===r[s];)s++;let l=n.length,a=r.length;for(;l>s&&a>s&&n[l-1]===r[a-1];)l--,a--;const u=[];for(let p=0;p<s;p++)u.push({role:"context",text:n[p]});const c=n.slice(s,l),h=r.slice(s,a);if(c.length*h.length>Yv){for(const p of c)u.push({role:"del",text:p});for(const p of h)u.push({role:"add",text:p})}else u.push(...t1(c,h));for(let p=l;p<n.length;p++)u.push({role:"context",text:n[p]});return u}function Zv(e){return{code:e.map(t=>t.text).join(`
|
|
233
|
+
`),roles:e.map(t=>t.role)}}function e1(e){let t=0,n=0;for(const r of e)r.role==="add"?t++:r.role==="del"&&n++;return{adds:t,dels:n}}function Wl(e){return e===""?[]:e.split(`
|
|
234
|
+
`)}function t1(e,t){const n=e.length,r=t.length;if(n===0)return t.map(u=>({role:"add",text:u}));if(r===0)return e.map(u=>({role:"del",text:u}));const s=Array.from({length:n+1},()=>new Array(r+1).fill(0));for(let u=n-1;u>=0;u--)for(let c=r-1;c>=0;c--)s[u][c]=e[u]===t[c]?s[u+1][c+1]+1:Math.max(s[u+1][c],s[u][c+1]);const o=[];let l=0,a=0;for(;l<n&&a<r;)e[l]===t[a]?(o.push({role:"context",text:e[l]}),l++,a++):s[l+1][a]>=s[l][a+1]?(o.push({role:"del",text:e[l]}),l++):(o.push({role:"add",text:t[a]}),a++);for(;l<n;)o.push({role:"del",text:e[l++]});for(;a<r;)o.push({role:"add",text:t[a++]});return o}function fo({children:e}){return i.jsx("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:e})}function po({children:e,tone:t="muted-foreground"}){return i.jsx("pre",{className:P(`${ul} overflow-auto whitespace-pre-wrap break-words border-t border-border-soft bg-background px-3 py-2 font-mono text-[12px] leading-relaxed`,t==="foreground"?"text-foreground":"text-muted-foreground"),children:e})}function Qn({hasBody:e,header:t,body:n}){const[r,s]=b.useState(!1),o=b.useId();return e?i.jsxs(fo,{children:[i.jsx("div",{role:"button",tabIndex:0,"aria-label":"Toggle details","aria-expanded":r,"aria-controls":o,onClick:()=>s(l=>!l),onKeyDown:l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),s(a=>!a))},className:"w-full cursor-pointer text-left ring-brand-focus transition-colors hover:bg-accent/30",children:t}),r&&n&&i.jsx("div",{id:o,children:n})]}):i.jsx(fo,{children:t})}function gc({name:e,verb:t,path:n,status:r,suffix:s,stats:o}){return i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:e,className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:t}),n?i.jsx(pm,{path:n}):i.jsx("span",{className:"flex-1 text-muted-foreground",children:"…"}),s&&i.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:s}),o&&(o.adds>0||o.dels>0)&&i.jsxs("span",{className:"shrink-0 font-mono text-[11.5px] tabular-nums",children:[o.adds>0&&i.jsxs("span",{className:"text-signal-ok",children:["+",o.adds]}),o.adds>0&&o.dels>0&&" ",o.dels>0&&i.jsxs("span",{className:"text-signal-error",children:["−",o.dels]})]}),i.jsx(xc,{status:r})]})}function xc({status:e}){return e==="ok"?i.jsx(re,{tone:"ok",children:"done"}):e==="error"?i.jsx(re,{tone:"error",children:"error"}):i.jsx(re,{tone:"warn",children:"running"})}function pm({path:e}){const t=gr(l=>l.pushToast),[n,r]=b.useState(!1),s=ci(e),o=async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1200),t({id:`copy-${Date.now()}`,workspaceId:"",message:`Copied: ${s}`,notifyType:"info"})}catch{t({id:`copy-${Date.now()}`,workspaceId:"",message:"Copy failed — clipboard not available",notifyType:"warning"})}};return i.jsxs("button",{type:"button",onClick:o,title:`${e} — click to copy`,className:"group inline-flex min-w-0 flex-1 items-center gap-1 truncate text-left font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground transition-colors hover:text-foreground",children:[i.jsx("span",{className:"truncate",children:s}),n?i.jsx(al,{className:"h-3 w-3 shrink-0 text-signal-ok"}):i.jsx(qh,{className:"h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})]})}function n1({index:e,rows:t,multi:n,lang:r}){const{code:s,roles:o}=b.useMemo(()=>Zv(t),[t]);return t.length===0?null:i.jsxs("div",{className:"overflow-hidden rounded-md border border-border-soft bg-card",children:[n&&i.jsxs("div",{className:"border-b border-border-soft bg-muted px-2.5 py-1 text-[11px] text-muted-foreground",children:["Edit ",e+1]}),i.jsx(dl,{code:s,lang:r,diffRoles:o})]})}function ci(e){const t="/Users/";if(e.startsWith(t)){const n=e.slice(t.length),r=n.indexOf("/");if(r>0)return"~/"+n.slice(r+1)}if(e.length>60){const n=e.split("/").filter(Boolean);if(n.length>2)return".../"+n.slice(-2).join("/")}return e}function hm(e){return e&&typeof e=="object"?e:void 0}function ft(e){return typeof e=="string"?e:void 0}function rf(e){return typeof e=="number"?e:void 0}function yc(e){return ft(e==null?void 0:e.path)??ft(e==null?void 0:e.file_path)}function r1(e){if(!e)return[];if(Array.isArray(e.edits))return e.edits.flatMap(r=>{if(!r||typeof r!="object")return[];const s=r.oldText??r.old_string,o=r.newText??r.new_string;return typeof s=="string"&&typeof o=="string"?[{oldText:s,newText:o}]:[]});const t=ft(e.old_string)??ft(e.oldText),n=ft(e.new_string)??ft(e.newText);return typeof t=="string"&&typeof n=="string"?[{oldText:t,newText:n}]:[]}function s1(e,t){if(!t)return;if(e==="grep"){const r=ft(t.pattern),s=ft(t.path);if(r)return`/${r}/${s?` in ${ci(s)}`:""}`}if(e==="find"){const r=ft(t.pattern),s=ft(t.path);if(r)return`${r}${s?` in ${ci(s)}`:""}`}if(e==="ls"){const r=ft(t.path);return r?ci(r):"."}const n=Object.keys(t);if(n.length!==0)return`(${n.slice(0,4).join(", ")}${n.length>4?", …":""})`}function o1({item:e}){const t=pu(o=>o.open),n=pu(o=>o.selectedToolCallId),r=fm(e);if(!r)return i.jsx(fo,{children:i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-[12.5px] text-muted-foreground",children:[i.jsx(lu,{className:"h-3.5 w-3.5 shrink-0"}),"Artifact"]})});const s=n===r.toolCallId;return i.jsx(fo,{children:i.jsxs("button",{type:"button",onClick:()=>t(r.toolCallId),className:P("flex w-full items-center gap-2.5 px-3 py-2 text-left ring-brand-focus transition-colors hover:bg-accent/40",s&&"bg-brand-ghost/40"),children:[i.jsx(lu,{className:"h-4 w-4 shrink-0 text-brand"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground",children:r.title}),i.jsx(re,{tone:"ghost",children:r.type}),e.status==="running"?i.jsx(re,{tone:"warn",children:"saving"}):e.status==="error"?i.jsx(re,{tone:"error",children:"error"}):i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-[11.5px] font-medium text-brand",children:["Open",i.jsx(dc,{className:"h-3 w-3"})]})]})})}const i1=new Set(["queued","running","done","failed","timeout","aborted"]);function l1(e){if(!e||typeof e!="object")return;const t=e;if(t.version!==1||!Array.isArray(t.tasks))return;const n=[];for(const r of t.tasks){if(!r||typeof r!="object")continue;const s=r;if(typeof s.agent!="string"||typeof s.task!="string")continue;const o=typeof s.status=="string"&&i1.has(s.status)?s.status:"done";n.push({agent:s.agent,agentSource:s.agentSource==="builtin"||s.agentSource==="user"||s.agentSource==="project"?s.agentSource:void 0,task:s.task,status:o,activity:u1(s.activity),usage:c1(s.usage),model:mn(s.model),stopReason:mn(s.stopReason),errorMessage:mn(s.errorMessage),stderrTail:mn(s.stderrTail),durationMs:Ts(s.durationMs),finalPreview:mn(s.finalPreview),transcriptPath:mn(s.transcriptPath)})}return n}function a1(e){if(!e||typeof e!="object")return{};const t=e;let n;if(Array.isArray(t.tasks)){const r=[];for(const s of t.tasks){if(!s||typeof s!="object")continue;const o=s;typeof o.agent=="string"&&typeof o.task=="string"&&r.push({agent:o.agent,task:o.task})}r.length>0&&(n=r)}return{agent:mn(t.agent),task:mn(t.task),tasks:n}}function u1(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const r=n.label;typeof r=="string"&&r&&t.push(r)}return t}function c1(e){if(!e||typeof e!="object")return;const t=e,n=Ts(t.input),r=Ts(t.output),s=Ts(t.cost),o=Ts(t.turns);if(!(n===void 0&&r===void 0&&o===void 0))return{input:n??0,output:r??0,cost:s??0,turns:o??0}}function mn(e){return typeof e=="string"&&e!==""?e:void 0}function Ts(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function mm(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function d1({item:e}){const t=a1(e.args),n=e.status==="running"?"running":e.status==="error"?"failed":"done",r=l1(e.details)??(t.tasks??(t.agent||t.task?[{agent:t.agent??"agent",task:t.task??""}]:[])).map(v=>({agent:v.agent,task:v.task,status:n,activity:[]})),s=p1(r,n),o=s==="running"||s==="queued",l=r.length>1,a=r[0],u=(a==null?void 0:a.task)??"",c=o&&e.text?e.text:l?r.map(v=>v.agent).join(" + "):u.replace(/\s+/g," "),h=h1(r),p=h.turns>0?`${h.turns}t · ${mm(h.tokens)} tok · $${h.cost.toFixed(3)}`:void 0,d=i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"subagent",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Subagent"}),i.jsx(re,{tone:"ghost",children:l?`${r.length} tasks`:(a==null?void 0:a.agent)??"agent"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:c}),p&&i.jsx("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:p}),i.jsx(gm,{status:s})]}),x=i.jsx("div",{className:"flex flex-col border-t border-border-soft bg-background",children:r.map((v,k)=>i.jsx(f1,{task:v,index:l?k:void 0,count:r.length},k))});return i.jsx(Qn,{hasBody:r.length>0,header:d,body:x})}function f1({task:e,index:t,count:n}){const r=e.status==="running"||e.status==="queued",s=e.status==="failed"||e.status==="timeout",o=e.usage,l=o&&o.turns>0?`${o.turns}t · ${mm(o.input+o.output)} tok · $${o.cost.toFixed(3)}`:void 0;return i.jsxs("div",{className:t!==void 0&&t>0?"border-t border-border":void 0,children:[t!==void 0&&i.jsxs("div",{className:"flex items-center gap-2 px-3 pb-0.5 pt-2",children:[i.jsxs("span",{className:"font-mono text-[10.5px] text-muted-foreground/70",children:[t+1,"/",n]}),i.jsx(re,{tone:"ghost",children:e.agent}),l&&i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:l}),i.jsx(gm,{status:e.status})]}),e.task&&i.jsxs("div",{className:"border-b border-border-soft px-3 py-2",children:[i.jsx(Go,{children:"Brief"}),i.jsx("div",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-muted-foreground",children:e.task})]}),e.activity.length>0&&i.jsxs("div",{className:"border-b border-border-soft px-3 py-2",children:[i.jsxs(Go,{children:["Activity",r?" (live)":""]}),i.jsx("div",{className:"max-h-40 overflow-auto font-mono text-[12px] leading-relaxed text-muted-foreground",children:e.activity.map((a,u)=>i.jsx("div",{className:"truncate",children:a},u))})]}),e.finalPreview&&i.jsxs("div",{className:"px-3 py-2",children:[i.jsx(Go,{children:"Report"}),i.jsx(uo,{text:e.finalPreview,className:"text-[13px]"})]}),s&&i.jsxs("div",{className:"border-t border-border-soft px-3 py-2",children:[i.jsx(Go,{children:"Diagnostics"}),e.errorMessage&&i.jsx("div",{className:"whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-signal-error",children:e.errorMessage}),e.stderrTail&&i.jsx("pre",{className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words font-mono text-[11.5px] leading-relaxed text-muted-foreground",children:e.stderrTail})]}),e.transcriptPath&&i.jsxs("div",{className:"flex items-center gap-2 border-t border-border-soft px-3 py-1.5 text-[11.5px] text-muted-foreground",children:[i.jsx("span",{className:"shrink-0",children:"Transcript"}),i.jsx(pm,{path:e.transcriptPath})]})]})}function p1(e,t){if(e.length===0)return t;if(e.length===1)return e[0].status;const n=new Set(e.map(r=>r.status));return n.has("running")?"running":n.has("queued")?"queued":n.has("failed")?"failed":n.has("timeout")?"timeout":n.has("aborted")?"aborted":"done"}function h1(e){let t=0,n=0,r=0;for(const s of e)s.usage&&(t+=s.usage.turns,n+=s.usage.input+s.usage.output,r+=s.usage.cost);return{turns:t,tokens:n,cost:r}}function gm({status:e}){switch(e){case"done":return i.jsx(re,{tone:"ok",children:"done"});case"failed":return i.jsx(re,{tone:"error",children:"failed"});case"timeout":return i.jsx(re,{tone:"error",children:"timeout"});case"aborted":return i.jsx(re,{tone:"ghost",children:"aborted"});case"queued":return i.jsx(re,{tone:"warn",children:"queued"});default:return i.jsx(re,{tone:"warn",children:"running"})}}function Go({children:e}){return i.jsx("div",{className:"mb-1 text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground/70",children:e})}function m1(e){if(!e||typeof e!="object")return;const t=e;if(t.version!==1||t.kind!=="search")return;const n=[];if(Array.isArray(t.results))for(const r of t.results){if(!r||typeof r!="object")continue;const s=r;typeof s.url=="string"&&n.push({title:typeof s.title=="string"&&s.title?s.title:s.url,url:s.url,content:typeof s.content=="string"?s.content:"",score:ym(s.score),publishedDate:sf(s.publishedDate)})}return{query:typeof t.query=="string"?t.query:"",answer:sf(t.answer),results:n}}function g1(e){if(!e||typeof e!="object")return;const t=e;if(t.version!==1||t.kind!=="fetch")return;const n=[];if(Array.isArray(t.results))for(const s of t.results){if(!s||typeof s!="object")continue;const o=s;typeof o.url=="string"&&n.push({url:o.url,content:typeof o.content=="string"?o.content:"",chars:ym(o.chars)??0})}const r=[];if(Array.isArray(t.failed))for(const s of t.failed){if(!s||typeof s!="object")continue;const o=s;typeof o.url=="string"&&r.push({url:o.url,error:typeof o.error=="string"?o.error:"extraction failed"})}return{results:n,failed:r}}function x1(e){if(!e||typeof e!="object")return;const t=e.query;return typeof t=="string"&&t?t:void 0}function y1(e){if(!e||typeof e!="object")return;const t=e.urls;if(!Array.isArray(t))return;const n=t.filter(r=>typeof r=="string");return n.length?n:void 0}function qi(e){try{return new URL(e).host.replace(/^www\./,"")}catch{return}}function xm(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?e:void 0}catch{return}}function v1(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function sf(e){return typeof e=="string"&&e!==""?e:void 0}function ym(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function w1({item:e}){const t=m1(e.details),n=(t==null?void 0:t.query)??x1(e.args)??"",r=(t==null?void 0:t.results)??[],s=t==null?void 0:t.answer,o=e.status==="error",l=i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"web_search",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Web search"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:n?`“${n}”`:"…"}),r.length>0&&i.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:[r.length," result",r.length===1?"":"s"]}),i.jsx(vm,{status:e.status,runningLabel:"searching"})]}),a=o||!!s||r.length>0,u=i.jsxs("div",{className:"flex flex-col border-t border-border-soft bg-background",children:[o&&e.text&&i.jsx(wm,{text:e.text}),s&&i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsx(S1,{children:"Answer"}),i.jsx("div",{className:"whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground",children:s})]}),r.map((c,h)=>i.jsx(b1,{index:h,title:c.title,url:c.url,snippet:c.content},h))]});return i.jsx(Qn,{hasBody:a,header:l,body:u})}function b1({index:e,title:t,url:n,snippet:r}){const s=qi(n);return i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"w-4 shrink-0 text-right font-mono text-[10.5px] text-muted-foreground/60",children:e+1}),i.jsx("a",{href:xm(n),target:"_blank",rel:"noreferrer noopener",onClick:o=>o.stopPropagation(),title:n,className:"min-w-0 flex-1 truncate text-[12.5px] text-foreground transition-colors hover:text-brand hover:underline",children:t}),s&&i.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:s})]}),r&&i.jsx("div",{className:"mt-1 max-h-16 overflow-hidden pl-6 text-[12px] leading-relaxed text-muted-foreground",children:r})]})}function k1({item:e}){const t=g1(e.details),n=e.status==="error",r=(t==null?void 0:t.results)??[],s=(t==null?void 0:t.failed)??[],o=y1(e.args)??[],l=(r.length?r.map(d=>d.url):o).map(d=>qi(d)).filter(d=>!!d),a=l.length===0?"…":l.length<=2?l.join(", "):`${l[0]} +${l.length-1} more`,u=r.length+s.length||o.length,c=i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"web_fetch",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Web fetch"}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:a}),u>0&&i.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground",children:[u," page",u===1?"":"s"]}),i.jsx(vm,{status:e.status,runningLabel:"fetching"})]}),h=n||r.length>0||s.length>0,p=i.jsxs("div",{className:"flex flex-col border-t border-border-soft bg-background",children:[n&&e.text&&i.jsx(wm,{text:e.text}),r.map((d,x)=>i.jsx(j1,{url:d.url,chars:d.chars,preview:d.content},x)),s.map((d,x)=>i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"shrink-0 font-mono text-[11.5px] text-signal-error",children:"failed"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] text-muted-foreground",title:d.url,children:qi(d.url)??d.url})]}),i.jsx("div",{className:"mt-1 break-words text-[12px] leading-relaxed text-signal-error",children:d.error})]},`f${x}`))]});return i.jsx(Qn,{hasBody:h,header:c,body:p})}function j1({url:e,chars:t,preview:n}){const r=qi(e);return i.jsxs("div",{className:"border-b border-border-soft px-3 py-2 last:border-b-0",children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("a",{href:xm(e),target:"_blank",rel:"noreferrer noopener",onClick:s=>s.stopPropagation(),title:e,className:"min-w-0 flex-1 truncate font-mono text-[12px] text-foreground transition-colors hover:text-brand hover:underline",children:r??e}),i.jsxs("span",{className:"shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground/70",children:[v1(t)," chars"]})]}),n&&i.jsx("div",{className:"mt-1 max-h-24 overflow-hidden whitespace-pre-wrap break-words font-mono text-[11.5px] leading-relaxed text-muted-foreground",children:n})]})}function vm({status:e,runningLabel:t}){return e==="ok"?i.jsx(re,{tone:"ok",children:"done"}):e==="error"?i.jsx(re,{tone:"error",children:"error"}):i.jsx(re,{tone:"warn",children:t})}function S1({children:e}){return i.jsx("div",{className:"mb-1 text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground/70",children:e})}function wm({text:e}){return i.jsx("div",{className:"whitespace-pre-wrap break-words border-b border-border-soft px-3 py-2 font-mono text-[12px] leading-relaxed text-signal-error last:border-b-0",children:e})}const Kl={30:"text-zinc-800 dark:text-zinc-200",31:"text-red-600 dark:text-red-400",32:"text-green-600 dark:text-green-400",33:"text-yellow-600 dark:text-yellow-400",34:"text-blue-600 dark:text-blue-400",35:"text-purple-600 dark:text-purple-400",36:"text-cyan-600 dark:text-cyan-400",37:"text-zinc-500 dark:text-zinc-400",90:"text-zinc-500 dark:text-zinc-500",91:"text-red-500 dark:text-red-300",92:"text-green-500 dark:text-green-300",93:"text-yellow-500 dark:text-yellow-300",94:"text-blue-500 dark:text-blue-300",95:"text-purple-500 dark:text-purple-300",96:"text-cyan-500 dark:text-cyan-300",97:"text-zinc-100"};function N1(e){if(e<0||e>255||e<16)return;if(e<232){const n=e-16,r=Math.floor(n/36),s=Math.floor(n%36/6),o=n%6,l=[0,95,135,175,215,255];return`rgb(${l[r]},${l[s]},${l[o]})`}const t=8+(e-232)*10;return`rgb(${t},${t},${t})`}function C1(e,t){const n={...e};for(let r=0;r<t.length;r++){const s=t[r];switch(s){case 0:n.fgClass=void 0,n.fgStyle=void 0,n.bold=!1,n.dim=!1,n.italic=!1,n.underline=!1;break;case 1:n.bold=!0;break;case 2:n.dim=!0;break;case 3:n.italic=!0;break;case 4:n.underline=!0;break;case 22:n.bold=!1,n.dim=!1;break;case 23:n.italic=!1;break;case 24:n.underline=!1;break;case 39:n.fgClass=void 0,n.fgStyle=void 0;break;case 38:{const o=t[r+1];if(o===5){const l=t[r+2];if(typeof l=="number"){const a=N1(l);if(a)n.fgStyle=a,n.fgClass=void 0;else if(l<16){const u=l<8?30+l:90+(l-8);n.fgClass=Kl[u],n.fgStyle=void 0}}r+=2}else if(o===2){const l=t[r+2],a=t[r+3],u=t[r+4];typeof l=="number"&&typeof a=="number"&&typeof u=="number"&&(n.fgStyle=`rgb(${l},${a},${u})`,n.fgClass=void 0),r+=4}break}default:Kl[s]&&(n.fgClass=Kl[s],n.fgStyle=void 0)}}return n}const of=/\x1b(?:\[([0-9;]*)([a-zA-Z])|\][^\x07\x1b]*(?:\x07|\x1b\\))/g;function E1(e){return e.includes("\r")?e.split(`
|
|
235
|
+
`).map(t=>{if(!t.includes("\r"))return t;const n=t.split("\r");return n[n.length-1]??""}).join(`
|
|
236
|
+
`):e}function ho(e){const t=E1(e),n=[];let r={},s=0,o=0;const l=u=>{if(!u)return;if(!_1(r)){n.push(u);return}const c=T1(r),h=P1(r);n.push(i.jsx("span",{className:c||void 0,style:h,children:u},o++))};of.lastIndex=0;let a;for(;(a=of.exec(t))!==null;){const u=a.index;if(u>s&&l(t.slice(s,u)),a[2]==="m"){const c=a[1]?a[1].split(";").map(h=>h===""?0:Number(h)):[0];r=C1(r,c)}s=u+a[0].length}return s<t.length&&l(t.slice(s)),n}function _1(e){return!!(e.fgClass||e.fgStyle||e.bold||e.dim||e.italic||e.underline)}function T1(e){const t=[];return e.fgClass&&t.push(e.fgClass),e.bold&&t.push("font-bold"),e.dim&&t.push("opacity-60"),e.italic&&t.push("italic"),e.underline&&t.push("underline"),t.join(" ")}function P1(e){return e.fgStyle?{color:e.fgStyle}:void 0}const R1={ts:"typescript",mts:"typescript",cts:"typescript",tsx:"tsx",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",json:"json",jsonc:"jsonc",yaml:"yaml",yml:"yaml",toml:"toml",md:"markdown",mdx:"mdx",html:"html",htm:"html",css:"css",scss:"scss",less:"less",py:"python",pyi:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",kts:"kotlin",swift:"swift",cs:"csharp",c:"c",h:"c",cc:"cpp",cpp:"cpp",cxx:"cpp",hpp:"cpp",hh:"cpp",m:"objective-c",mm:"objective-c",php:"php",sh:"shellscript",bash:"shellscript",zsh:"shellscript",fish:"shellscript",sql:"sql",xml:"xml",vue:"vue",svelte:"svelte",graphql:"graphql",gql:"graphql",diff:"diff",patch:"diff",ini:"ini",cfg:"ini",conf:"ini",lua:"lua",r:"r",scala:"scala",dart:"dart",ex:"elixir",exs:"elixir",hs:"haskell"},M1={dockerfile:"dockerfile",makefile:"make",gnumakefile:"make"};function vc(e){if(!e)return;const t=e.lastIndexOf("/"),n=(t>=0?e.slice(t+1):e).toLowerCase();if(!n)return;const r=M1[n];if(r)return r;const s=n.lastIndexOf(".");if(s<=0)return;const o=n.slice(s+1);return R1[o]}function L1({item:e,args:t}){const n=yc(t),r=vc(n),s=b.useMemo(()=>r1(t),[t]),o=b.useMemo(()=>s.map(c=>Jv(c.oldText,c.newText)),[s]),l=e.status==="error",a=b.useMemo(()=>{let c=0,h=0;for(const p of o){const d=e1(p);c+=d.adds,h+=d.dels}return{adds:c,dels:h}},[o]),u=o.length>0||!!e.text;return i.jsx(Qn,{hasBody:u,header:i.jsx(gc,{name:"edit",verb:"Edited",path:n,status:e.status,stats:a}),body:i.jsxs(i.Fragment,{children:[o.length>0&&i.jsx("div",{className:`${ul} flex flex-col gap-2 overflow-auto border-t border-border-soft bg-background p-2`,children:o.map((c,h)=>i.jsx(n1,{index:h,rows:c,multi:o.length>1,lang:r},h))}),e.text&&(o.length===0||l)&&i.jsx(po,{children:ho(e.text)})]})})}function I1({item:e,args:t}){const n=yc(t),r=ft(t==null?void 0:t.content)??"",s=vc(n),o=e.status==="error",l=!!r||!!e.text,a=r?r.split(`
|
|
237
|
+
`).length:void 0;return i.jsx(Qn,{hasBody:l,header:i.jsx(gc,{name:"write",verb:"Wrote",path:n,status:e.status,suffix:a?`${a} ln`:void 0}),body:i.jsxs(i.Fragment,{children:[r&&i.jsx("div",{className:`${ul} overflow-auto border-t border-border-soft bg-background px-3 py-2`,children:i.jsx(dl,{code:r,lang:s})}),!r&&e.text&&i.jsx(po,{children:ho(e.text)}),r&&o&&e.text&&i.jsx(po,{children:ho(e.text)})]})})}function O1({item:e,args:t}){const n=yc(t),r=vc(n),s=rf(t==null?void 0:t.offset),o=rf(t==null?void 0:t.limit),l=o!==void 0?`lines ${s??1}–${(s??1)+o-1}`:s!==void 0?`from line ${s}`:void 0,a=!!e.text;return i.jsx(Qn,{hasBody:a,header:i.jsx(gc,{name:"read",verb:"Read",path:n,status:e.status,suffix:l}),body:e.text?i.jsx("div",{className:`${ul} overflow-auto border-t border-border-soft bg-background px-3 py-2`,children:i.jsx(dl,{code:e.text,lang:r,wrap:!0,tone:"muted"})}):void 0})}function lf({command:e,output:t,exitCode:n,running:r,errored:s}){const l=r?"running":s===!0||n!==void 0&&n!==0?"error":"ok",a=!!t,u=t?t.split(`
|
|
238
|
+
`).length:void 0;return i.jsx(Qn,{hasBody:a,header:i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:"bash",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"text-[12.5px] text-foreground",children:"Ran"}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11.5px] tracking-[-0.005em] text-muted-foreground",children:e}),u!=null&&i.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:[u," ln"]}),n!==void 0&&n!==0&&i.jsxs("span",{className:"font-mono text-[11px] text-signal-error",children:["exit ",n]}),i.jsx(xc,{status:l})]}),body:t?i.jsx(po,{tone:"foreground",children:ho(t)}):void 0})}function bm({item:e,args:t}){const n=s1(e.toolName,t),r=!!e.text;return i.jsx(Qn,{hasBody:r,header:i.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5",children:[i.jsx(ln,{tool:e.toolName,className:"shrink-0 text-muted-foreground"}),i.jsxs("span",{className:"min-w-0 flex-1 truncate text-[12.5px] text-muted-foreground",children:[i.jsx("span",{className:"text-foreground",children:e.toolName}),n&&i.jsx("span",{className:"ml-2 font-mono text-[11.5px]",children:n})]}),i.jsx(xc,{status:e.status})]}),body:e.text?i.jsx(po,{children:ho(e.text)}):void 0})}function D1({item:e,isCurrent:t}){const n=b.useMemo(()=>em(Zh(e.details)),[e.details]),r=n.length,[s,o]=b.useState(!1),l=b.useId();if(r===0)return i.jsx(bm,{item:e,args:hm(e.args)});const a=n.filter(p=>p.status==="completed").length,u=a/r,c=t||s,h=i.jsxs(i.Fragment,{children:[!t&&i.jsx(No,{className:P("h-3 w-3 shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")}),i.jsx(ln,{tool:"todo",className:"shrink-0 text-muted-foreground"}),i.jsx("span",{className:"shrink-0 text-[12.5px] text-foreground",children:"Todos"}),i.jsxs("span",{className:"inline-flex min-w-0 flex-1 items-center gap-2 text-[12px] text-muted-foreground",children:[i.jsxs("span",{className:"font-mono text-[11.5px] tabular-nums",children:[a,"/",r]}),i.jsx("span",{className:`inline-block h-1 ${Jh} overflow-hidden rounded-full bg-border-soft`,role:"progressbar","aria-valuemin":0,"aria-valuenow":a,"aria-valuemax":r,"aria-label":`Todo progress: ${a} of ${r} completed`,children:i.jsx("span",{className:"block h-full rounded-full bg-brand transition-[width] duration-300",style:{width:`${u*100}%`}})})]})]});return i.jsxs(fo,{children:[t?i.jsx("div",{className:"flex items-center gap-2.5 px-3 py-2",children:h}):i.jsx("button",{type:"button","aria-expanded":s,"aria-controls":l,onClick:()=>o(p=>!p),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:h}),c&&i.jsx("ul",{id:l,className:"border-t border-border-soft bg-background px-3 py-1.5","aria-label":"Todo items",children:n.map(p=>i.jsxs("li",{className:"flex items-start gap-2 py-[3px]",children:[i.jsx("span",{className:"mt-[2px] shrink-0",children:p.status==="completed"?i.jsx(al,{className:"h-3.5 w-3.5 text-signal-ok","aria-hidden":!0}):p.status==="in_progress"?t?i.jsx(mr,{className:"h-3.5 w-3.5 text-brand animate-v2-spin","aria-label":"In progress"}):i.jsx(Ky,{className:"h-3.5 w-3.5 text-muted-foreground/70","aria-label":"Was in progress"}):i.jsx(Bh,{className:"h-3.5 w-3.5 text-muted-foreground/40","aria-hidden":!0})}),i.jsxs("span",{className:P("min-w-0 flex-1 text-[12.5px] leading-[1.5]",p.status==="completed"?"text-muted-foreground line-through decoration-muted-foreground/30":p.status==="in_progress"&&t?"text-foreground font-medium":"text-muted-foreground"),children:[i.jsxs("span",{className:"mr-1.5 font-mono text-[11px] text-muted-foreground/50",children:["#",p.id]}),p.subject]})]},p.id))})]})}function km({item:e,isCurrentTodo:t=!0}){if(e.kind==="bash")return i.jsx(lf,{command:e.command,output:e.output,exitCode:e.exitCode,running:!1});const n=hm(e.args),r=e.toolName;if(r==="edit")return i.jsx(L1,{item:e,args:n});if(r==="write")return i.jsx(I1,{item:e,args:n});if(r==="read")return i.jsx(O1,{item:e,args:n});if(r==="bash")return i.jsx(lf,{command:z1(n==null?void 0:n.command)??"",output:e.text,exitCode:void 0,running:e.status==="running",errored:e.status==="error"});if(r==="todo")return i.jsx(D1,{item:e,isCurrent:t});if(r==="ask_user"){const s=o=>{fe.send({type:"answer_question",toolCallId:e.toolCallId,answer:o})};return i.jsx(qv,{item:e,onSubmit:s})}return r==="create_artifact"?i.jsx(o1,{item:e}):r==="subagent"?i.jsx(d1,{item:e}):r==="web_search"?i.jsx(w1,{item:e}):r==="web_fetch"?i.jsx(k1,{item:e}):i.jsx(bm,{item:e,args:n})}function A1({items:e}){const[t,n]=b.useState(!1),r=b.useId(),s=F1(e);return i.jsxs("div",{className:"overflow-hidden rounded-[10px] border border-border-soft bg-muted",children:[i.jsxs("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:()=>n(o=>!o),className:"flex w-full items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-accent/40 ring-brand-focus",children:[i.jsx(No,{className:P("h-3 w-3 shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")}),i.jsxs("span",{className:"shrink-0 text-[12.5px] font-medium text-foreground",children:[e.length," actions"]}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground",children:s.map(o=>`${o.count} ${o.name}`).join(" · ")}),i.jsx(re,{tone:"ghost",children:t?"open":"batched"})]}),t&&i.jsx("div",{id:r,className:"flex flex-col gap-2 border-t border-border-soft bg-card p-2",children:e.map(o=>i.jsx(km,{item:o,isCurrentTodo:!1},o.id))})]})}function F1(e){const t=new Map;for(const n of e){const r=n.kind==="bash"?"bash":n.toolName;t.set(r,(t.get(r)??0)+1)}return Array.from(t.entries()).sort((n,r)=>r[1]-n[1]).map(([n,r])=>({name:n,count:r}))}function z1(e){return typeof e=="string"?e:void 0}function U1(e){const t=[];let n=[];const r=()=>{n.length!==0&&(n.length===1?t.push({kind:"single",item:n[0]}):t.push({kind:"group",items:n}),n=[])};for(const s of e)if(s.kind==="tool"||s.kind==="bash")q1(s)||Qi(s)||Q1(s)||H1(s)||V1(s)?(r(),t.push({kind:"single",item:s})):n.push(s);else{if(B1(s))continue;r(),t.push({kind:"single",item:s})}return r(),K1(t)}function $1(e){const t=[];let n=!1;for(const r of e){if(r.kind==="single"&&r.item.kind==="user"){n=!1,t.push({entry:r,leadHeader:!1,showHeader:!1});continue}if(r.kind==="single"&&r.item.kind==="assistant"){const o=!n;r.item.text&&(n=!0),t.push({entry:r,leadHeader:!1,showHeader:o});continue}const s=!n;n=!0,t.push({entry:r,leadHeader:s,showHeader:!1})}return t}function B1(e){return e.kind==="assistant"&&e.text.length===0}function q1(e){return e.kind==="tool"?e.status==="error":e.exitCode!==void 0&&e.exitCode!==0}function Qi(e){return e.kind==="tool"&&e.toolName==="todo"}function Q1(e){return e.kind==="tool"&&e.toolName==="ask_user"}function H1(e){return e.kind==="tool"&&e.toolName===fl}function V1(e){return e.kind==="tool"&&e.toolName==="subagent"}function W1(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind==="single"&&Qi(n.item))return n.item.id}}function K1(e){const t=new Set;let n=0;for(let r=0;r<=e.length;r++){const s=r===e.length,o=!s&&e[r].kind==="single"&&e[r].item.kind==="user";if(s||o){let l=-1;for(let a=r-1;a>=n;a--){const u=e[a];if(u.kind==="single"&&Qi(u.item)){l=a;break}}if(l!==-1)for(let a=n;a<r;a++){const u=e[a];a!==l&&u.kind==="single"&&Qi(u.item)&&t.add(a)}n=r}}return t.size===0?e:e.filter((r,s)=>!t.has(s))}function G1({items:e,running:t,bottomPad:n,workspaceId:r,onFork:s}){const o=rm(d=>d.density)==="compact",l=b.useRef(null),a=b.useRef(!0);b.useLayoutEffect(()=>{const d=l.current;if(!d)return;const{scrollInfo:x}=V.getState();a.current=x.stickToBottom,x.stickToBottom?d.scrollTop=d.scrollHeight:d.scrollTop=x.scrollTop},[]);const u=b.useCallback(()=>{const d=l.current;d&&(a.current=d.scrollHeight-d.scrollTop-d.clientHeight<30,V.getState().setScrollInfo({scrollTop:d.scrollTop,stickToBottom:a.current}))},[]);b.useEffect(()=>{const d=l.current;!d||!a.current||(d.scrollTop=d.scrollHeight)},[e,t]),b.useEffect(()=>{const d=l.current;!d||!a.current||(d.scrollTop=d.scrollHeight)},[n]);const{rows:c,currentTodoId:h}=b.useMemo(()=>{const d=U1(e);return{rows:$1(d),currentTodoId:W1(d)}},[e]),p=e.length===0&&!t;return i.jsx("div",{ref:l,onScroll:u,className:P("relative z-10 min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",p?"flex items-center justify-center":"pt-4"),style:p?void 0:{maskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 56px), transparent 100%)"},children:p?i.jsx(om,{title:"Ready when you are.",tagline:"Send a message to brief your co-pilot. Enter submits, Shift+Enter inserts a newline.",hint:{keys:["⏎"],label:"Send"},suggestions:[{label:"Explain this codebase",prompt:"Give me a tour of this project — its main modules, how they fit together, and where I'd start to make changes."},{label:"Find & fix a bug",prompt:"Help me find a bug. I'll paste the symptoms; you read the relevant code and propose a fix."},{label:"Draft a feature",prompt:"Draft the scaffolding for a new feature I'll describe, then walk me through the design trade-offs."}],onPickSuggestion:d=>{V.getState().setComposerDraft(d),requestAnimationFrame(()=>{var x;(x=document.querySelector("textarea[data-composer-input]"))==null||x.focus()})}}):i.jsx("div",{className:P("mx-auto flex w-full flex-col px-6",o?`${Fi.compact} gap-1`:`${Fi.comfortable} gap-4`),style:{paddingBottom:n},children:c.flatMap(({entry:d,leadHeader:x,showHeader:v})=>{if(d.kind==="single"&&d.item.kind==="user")return[i.jsx(Gl,{item:d.item,isCurrentTodo:d.item.id===h,compact:o,onFork:s},d.item.id)];if(d.kind==="single"&&d.item.kind==="assistant")return[i.jsx(Gl,{item:d.item,isCurrentTodo:d.item.id===h,compact:o,showHeader:v},d.item.id)];const k=[];if(x){const j=d.kind==="group"?d.items[0].id:d.item.id;k.push(i.jsx(Y1,{compact:o},`pilot-hdr:${j}`))}if(d.kind==="single")k.push(i.jsx(Gl,{item:d.item,isCurrentTodo:d.item.id===h,compact:o},d.item.id));else{const j=`group:${d.items[0].id}`;k.push(i.jsx(X1,{group:d,compact:o},j))}return k})})})}const Gl=b.memo(function({item:t,isCurrentTodo:n,compact:r=!1,showHeader:s=!0,onFork:o}){return t.kind==="user"?i.jsx(J1,{item:t,compact:r,onFork:o}):t.kind==="assistant"?i.jsx(Z1,{item:t,compact:r,showHeader:s}):t.kind==="tool"||t.kind==="bash"?i.jsx("div",{className:r?"pl-4 border-l-2 border-border-soft ml-0.5":"pl-10",children:i.jsx(km,{item:t,isCurrentTodo:n})}):null});function X1({group:e,compact:t=!1}){return i.jsx("div",{className:t?"pl-4 border-l-2 border-border-soft ml-0.5":"pl-10",children:i.jsx(A1,{items:e.items})})}function Y1({compact:e=!1}){return e?i.jsxs("div",{className:"flex items-center gap-2 pt-1.5",children:[i.jsx("span",{className:"h-px flex-1 bg-border-soft"}),i.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Pilot"}),i.jsx("span",{className:"h-px flex-1 bg-border-soft"})]}):i.jsxs("div",{className:"-mb-[6px] flex gap-3",children:[i.jsx(cl,{size:28,filled:!0}),i.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:i.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"})})]})}function J1({item:e,compact:t=!1,onFork:n}){const r=n&&e.entryId&&!e.pending;return t?i.jsxs("div",{className:"group/user v2-rise-soft flex items-baseline gap-2 pt-2",children:[i.jsx("span",{className:"shrink-0 text-[11.5px] font-medium text-brand",children:"You"}),i.jsx("div",{className:"min-w-0 flex-1 text-[13.5px] leading-[1.45] text-foreground [overflow-wrap:anywhere]",children:i.jsx(uo,{text:e.text})}),r&&i.jsx("button",{type:"button",onClick:()=>n(e.entryId),title:"Fork from here",className:"shrink-0 opacity-0 group-hover/user:opacity-100 transition-opacity duration-150 text-muted-foreground hover:text-brand",children:i.jsx($d,{className:"h-3 w-3"})})]}):i.jsxs("div",{className:"group/user v2-rise-soft flex flex-col items-end gap-1.5",children:[i.jsxs("div",{className:"relative max-w-[78%] rounded-[14px] rounded-br-[4px] border border-brand-ghost bg-brand-ghost px-3.5 py-2.5 text-[14px] leading-[1.5] text-foreground [overflow-wrap:anywhere]",children:[i.jsx(uo,{text:e.text}),r&&i.jsx("button",{type:"button",onClick:()=>n(e.entryId),title:"Fork from here",className:"absolute -left-7 bottom-2 opacity-0 group-hover/user:opacity-100 transition-opacity duration-150 rounded-full p-1 text-muted-foreground hover:text-brand hover:bg-brand-ghost",children:i.jsx($d,{className:"h-3 w-3"})})]}),i.jsx(Ps,{children:"You"})]})}function Z1({item:e,compact:t=!1,showHeader:n=!0}){return e.text?t?i.jsxs("div",{className:"v2-rise-soft flex gap-0",children:[i.jsx("div",{className:"mr-4 flex w-0.5 shrink-0 self-stretch rounded-full bg-brand/30"}),i.jsxs("div",{className:"min-w-0 flex-1 py-0.5 [overflow-wrap:anywhere]",children:[n&&i.jsxs("div",{className:"mb-0.5 flex items-baseline gap-2",children:[i.jsx("span",{className:"text-[11.5px] font-medium text-brand",children:"Pilot"}),!e.streaming&&typeof e.firstTokenMs=="number"&&i.jsx(Ps,{className:P(Hd(e.firstTokenMs)),title:e.totalMs!=null?`first token ${wr(e.firstTokenMs)} · total ${wr(e.totalMs)}`:void 0,children:wr(e.firstTokenMs)}),e.streaming&&i.jsx(Ps,{className:"text-brand",children:"streaming…"})]}),i.jsx(uo,{text:e.text,streaming:e.streaming,className:"text-[13.5px] leading-[1.45]"})]})]}):i.jsxs("div",{className:"v2-rise-soft flex gap-3",children:[n?i.jsx(cl,{size:28,filled:!0}):i.jsx("div",{"aria-hidden":!0,className:"w-7 shrink-0"}),i.jsxs("div",{className:"min-w-0 flex-1 pt-0.5 [overflow-wrap:anywhere]",children:[n&&i.jsxs("div",{className:"mb-1 flex items-baseline gap-2",children:[i.jsx("span",{className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Pilot"}),!e.streaming&&typeof e.firstTokenMs=="number"&&i.jsx(Ps,{className:P(Hd(e.firstTokenMs)),title:e.totalMs!=null?`first token ${wr(e.firstTokenMs)} · total ${wr(e.totalMs)}`:void 0,children:wr(e.firstTokenMs)}),e.streaming&&i.jsx(Ps,{className:"text-brand",children:"streaming…"})]}),i.jsx(uo,{text:e.text,streaming:e.streaming})]})]}):null}function Ps({children:e,className:t,title:n}){return i.jsx("span",{title:n,className:P("text-[11px] tracking-[-0.005em] text-muted-foreground",t),children:e})}function ew({workspaceId:e,sessionPath:t,running:n,onCompact:r}){const s=V(v=>{var k;return(k=v.contextUsage)==null?void 0:k.percent}),o=V(v=>v.contextUsage!==void 0),l=V(v=>v.compaction),{data:a}=_y(e,t),u=co(v=>v.rightPanel),c=co(v=>v.togglePanel),h=V(v=>v.items.some(k=>k.kind==="tool"&&k.toolName===fl)),p=s!=null?Math.round(s):null,d=o&&p==null,x=p!=null||d;return i.jsxs("header",{className:"relative z-20 shrink-0 border-b border-border/60 bg-popover/80 backdrop-blur-md",children:[i.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-foreground/[0.06] to-transparent"}),i.jsxs("div",{className:"flex items-center gap-2 px-4 py-[10px]",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:n&&i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-[11.5px] font-medium text-brand",children:[i.jsxs("span",{className:"flex items-center gap-[3px]",children:[i.jsx("span",{className:"h-1 w-1 rounded-full bg-brand animate-v2-dot"}),i.jsx("span",{className:"h-1 w-1 rounded-full bg-brand animate-v2-dot-2"}),i.jsx("span",{className:"h-1 w-1 rounded-full bg-brand animate-v2-dot-3"})]}),i.jsx("span",{className:"ml-0.5",children:"thinking"})]})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a&&i.jsx(sw,{workspaceId:e,currentModel:a.currentModel,availableModels:a.availableModels,thinkingLevel:a.thinkingLevel,availableThinkingLevels:a.availableThinkingLevels,disabled:n}),(a==null?void 0:a.currentModel)&&x&&i.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),x&&i.jsxs(re,{tone:"ghost",className:"hidden md:inline-flex",title:d?"Context · recalculating after compaction":`Context · ${p}%`,children:[i.jsx("span",{className:"text-muted-foreground",children:"Context"}),i.jsx("span",{className:P("font-mono text-[11px] tabular-nums",d?"text-muted-foreground/70":"text-foreground"),children:d?"—":`${p}%`}),i.jsx("span",{className:"inline-block h-1 w-[22px] overflow-hidden rounded-full bg-border-soft",children:d?i.jsx("span",{className:"block h-full w-full animate-v2-pulse bg-brand/50"}):i.jsx("span",{className:"block h-full rounded-full bg-gradient-to-r from-brand-strong to-brand transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,p??0)}%`}})})]}),i.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),i.jsx(ui,{active:u==="tree",onClick:()=>c("tree"),title:"Session Tree",children:i.jsx(e0,{className:"h-3.5 w-3.5"})}),i.jsx(ui,{active:u==="resources",onClick:()=>c("resources"),title:"Resources",children:i.jsx(Zy,{className:"h-3.5 w-3.5"})}),(h||u==="artifact")&&i.jsx(ui,{active:u==="artifact",onClick:()=>c("artifact"),title:"Artifacts",children:i.jsx(lu,{className:"h-3.5 w-3.5"})}),i.jsx("span",{"aria-hidden":!0,className:"hidden h-4 w-px bg-border md:inline-block"}),i.jsx(tw,{workspaceId:e,sessionPath:t,running:n,compacting:!!l,onCompact:r})]})]})]})}function tw({workspaceId:e,sessionPath:t,running:n,compacting:r,onCompact:s}){const[o,l]=b.useState(!1),[a,u]=b.useState(!1),[c,h]=b.useState(""),p=b.useRef(null),d=b.useRef(null),x=Oy(e,t),v=By(e),k=Ry(e,t);b.useEffect(()=>{if(!o)return;const f=m=>{p.current&&!p.current.contains(m.target)&&(l(!1),u(!1))};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[o]),b.useEffect(()=>{var f;a&&((f=d.current)==null||f.focus())},[a]);const j=()=>{const f=c.trim();f&&k.mutate({name:f}),u(!1),l(!1)};return i.jsxs("div",{ref:p,className:"relative",children:[i.jsx(ui,{active:o,onClick:()=>l(f=>!f),title:"Session actions",children:i.jsx(Yy,{className:"h-3.5 w-3.5"})}),o&&i.jsx("div",{className:"absolute right-0 top-[calc(100%+6px)] z-50 w-[200px] origin-top-right animate-in fade-in zoom-in-95 overflow-hidden rounded-xl border border-border/80 bg-popover shadow-menu",children:i.jsx("div",{className:"py-1",children:a?i.jsx("div",{className:"px-3 py-2",children:i.jsx("input",{ref:d,type:"text",value:c,onChange:f=>h(f.target.value),onKeyDown:f=>{f.key==="Enter"&&j(),f.key==="Escape"&&(u(!1),l(!1))},placeholder:"Session name…",className:"w-full rounded-md border border-border bg-card px-2 py-1 text-[12px] text-foreground outline-none focus:border-brand/50"})}):i.jsxs(i.Fragment,{children:[i.jsx(Xo,{icon:i.jsx(s0,{className:"h-3.5 w-3.5"}),label:"Compact context",disabled:n||r,onClick:()=>{s(),l(!1)}}),i.jsx(Xo,{icon:i.jsx(Xy,{className:"h-3.5 w-3.5"}),label:"Export HTML",disabled:x.isPending,onClick:()=>{x.mutate(),l(!1)}}),i.jsx(Xo,{icon:i.jsx(n0,{className:"h-3.5 w-3.5"}),label:"Rename session",onClick:()=>{h(""),u(!0)}}),i.jsx(Xo,{icon:i.jsx(Qh,{className:"h-3.5 w-3.5"}),label:"Reload resources",disabled:v.isPending,onClick:()=>{v.mutate(),l(!1)}})]})})})]})}function Xo({icon:e,label:t,disabled:n,onClick:r}){return i.jsxs("button",{type:"button",disabled:n,onClick:r,className:P("flex w-full items-center gap-2.5 px-3 py-[7px] text-left text-[12px] text-foreground transition-colors",n?"cursor-not-allowed opacity-40":"hover:bg-accent/50"),children:[i.jsx("span",{className:"shrink-0 text-muted-foreground",children:e}),i.jsx("span",{children:t})]})}function Xl(e){return`${e.provider}/${e.modelId}`}function nw(e){const t=new Map;for(const n of e){const r=t.get(n.provider);r?r.push(n):t.set(n.provider,[n])}return Array.from(t.entries())}const rw={off:"Off",minimal:"Min",low:"Low",medium:"Med",high:"High",xhigh:"Max"};function sw({workspaceId:e,currentModel:t,availableModels:n,thinkingLevel:r,availableThinkingLevels:s,disabled:o}){const[l,a]=b.useState(!1),[u,c]=b.useState(-1),h=b.useRef(null),p=b.useRef(null),d=b.useRef(null),x=Ty(e),v=Py(e),k=t?Xl(t):"",j=nw(n),f=n.map(Xl),m=f.indexOf(k);if(b.useEffect(()=>{if(!l)return;const w=S=>{h.current&&!h.current.contains(S.target)&&a(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[l]),b.useEffect(()=>{if(!l)return;const w=S=>{var N,E;switch(S.key){case"Escape":S.preventDefault(),a(!1),(N=d.current)==null||N.focus();break;case"ArrowDown":S.preventDefault(),c(C=>{const T=C<f.length-1?C+1:0;return Yl(p.current,T),T});break;case"ArrowUp":S.preventDefault(),c(C=>{const T=C>0?C-1:f.length-1;return Yl(p.current,T),T});break;case"Enter":{S.preventDefault();const C=f[u],T=n[u];C&&T&&C!==k&&x.mutate({provider:T.provider,modelId:T.modelId}),a(!1),(E=d.current)==null||E.focus();break}}};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[l,u,f,k,n,x]),b.useEffect(()=>{if(l){const w=m>=0?m:0;c(w),requestAnimationFrame(()=>Yl(p.current,w))}},[l,m]),!t)return null;let g=0;return i.jsxs("div",{ref:h,className:"relative hidden md:block",children:[i.jsxs("button",{ref:d,type:"button",onClick:()=>a(w=>!w),disabled:o,title:t.modelId,className:P("inline-flex items-center gap-1 rounded-full border px-2.5 py-[2.5px] text-[11.5px] font-medium leading-[1.5] tracking-[-0.005em] transition-all duration-150",l?"border-brand/30 bg-brand-ghost/50 text-brand-strong":"border-border-soft bg-transparent text-foreground",o?"cursor-not-allowed opacity-50":"cursor-pointer hover:border-border-hi hover:bg-accent/40"),children:[i.jsx("span",{className:"max-w-[180px] truncate",children:t.name}),i.jsx(No,{className:P("h-2.5 w-2.5 shrink-0 opacity-50 transition-transform duration-150",l&&"rotate-180 opacity-80")})]}),l&&i.jsxs("div",{className:"absolute right-0 top-[calc(100%+6px)] z-50 w-[260px] origin-top-right animate-in fade-in zoom-in-95 overflow-hidden rounded-xl border border-border/80 bg-popover shadow-menu",role:"listbox","aria-label":"Switch model",children:[i.jsxs("div",{ref:p,className:"max-h-[320px] overflow-y-auto overscroll-contain py-1",children:[n.length===0&&i.jsx("div",{className:"px-4 py-6 text-center text-[12px] text-muted-foreground",children:"No models available. Add one in Settings → Models."}),j.map(([w,S],N)=>i.jsxs("div",{children:[N>0&&i.jsx("div",{className:"mx-3 my-1 h-px bg-border-soft"}),i.jsx("div",{className:"px-3 pb-0.5 pt-2",children:i.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.06em] text-muted-foreground/70",children:w})}),S.map(E=>{const C=Xl(E),T=C===k,R=g++,q=R===u;return i.jsx("button",{type:"button",role:"option","aria-selected":T,"data-option-index":R,onMouseEnter:()=>c(R),onClick:()=>{a(!1),T||x.mutate({provider:E.provider,modelId:E.modelId})},className:P("flex w-[calc(100%-8px)] items-center rounded-lg mx-1 px-2 py-[6px] text-left transition-colors duration-100",T?"bg-brand-ghost font-medium text-brand-strong":q?"bg-accent/50 text-foreground":"text-foreground"),children:i.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px]",children:E.name})},C)})]},w))]}),s.length>0&&i.jsxs("div",{className:"border-t border-border-soft bg-popover/95 px-2 py-2",children:[i.jsx("div",{className:"px-1 pb-1.5",children:i.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.06em] text-muted-foreground/70",children:"Thinking effort"})}),i.jsx("div",{className:"flex gap-0.5 rounded-lg border border-border-soft bg-card/40 p-0.5",children:s.map(w=>i.jsx("button",{type:"button",onClick:()=>v.mutate({level:w}),disabled:o||v.isPending,className:P("min-w-0 flex-1 truncate rounded-md px-1 py-1 text-[10.5px] font-medium transition-colors",w===r?"bg-brand-ghost text-brand-strong":"text-muted-foreground hover:bg-accent/50 hover:text-foreground",(o||v.isPending)&&"cursor-not-allowed opacity-50"),children:rw[w]??w},w))})]})]})]})}function Yl(e,t){if(!e)return;const n=e.querySelector(`[data-option-index="${t}"]`);n==null||n.scrollIntoView({block:"nearest"})}function ow(e,t){const n=V(x=>x.apply),r=V(x=>x.pushUser),s=V(x=>x.rememberQueuedUser),o=V(x=>x.reset),l=V(x=>x.setSwitching),a=V(x=>x.applyHistory),u=V(x=>x.switching),c=b.useRef(null),h=b.useRef(null),p=b.useRef(0),d=b.useRef(e);return d.current=e,b.useEffect(()=>(fe.start(),()=>{}),[]),b.useEffect(()=>fe.on(v=>{if(v.type==="background_evicted"){ev(v.workspaceId,v.sessionPath);return}const k=h.current;if(v.type==="event"){const j=k?k.expectedWorkspaceId:d.current,f=k?k.expectedSessionPath:V.getState().sessionPath??null;if(v.workspaceId!==j||v.sessionPath!==f){Z0(v);return}if(k){k.buffer.push(v);return}}if(v.type==="subscribed"){const j=V.getState();if(j.sessionPath!==void 0&&j.sessionPath===v.sessionPath&&d.current===v.workspaceId)return}n(v),jm(v)}),[n]),b.useEffect(()=>{if(!e){o();return}t&&l(!0),fe.send({type:"subscribe",workspaceId:e,...t?{sessionPath:t.path}:{}})},[e,t,o,l]),b.useEffect(()=>fe.onReconnect(()=>{c.current=null}),[]),b.useEffect(()=>{const x=k=>{if(k.type!=="subscribed")return;const j=k.workspaceId,f=k.sessionPath,m=c.current;if(m&&m.wsId===j&&m.sp===f)return;const g=h.current;if(g&&g.controller.abort(),c.current={wsId:j,sp:f},J0()){h.current=null;return}const w=++p.current,S=new AbortController,N={token:w,expectedWorkspaceId:j,expectedSessionPath:f,controller:S,buffer:[]};h.current=N;const E=fe.connectionEpoch,C=f?`?sessionPath=${encodeURIComponent(f)}`:"";J(`/api/workspaces/${j}/history${C}`,{signal:S.signal}).then(T=>{var U;if(((U=h.current)==null?void 0:U.token)!==w)return;const R=()=>{var me;((me=h.current)==null?void 0:me.token)===w&&(h.current=null)};if(fe.connectionEpoch!==E){R();return}if(V.getState().sessionPath!==f){R();return}a(T.items,T.isStreaming),js(N),h.current=null}).catch(T=>{var R;(T==null?void 0:T.name)!=="AbortError"&&((R=h.current)==null?void 0:R.token)===w&&(console.error("[useSessionStream] history fetch failed:",T),js(N),h.current=null)})},v=fe.on(x);return()=>{v();const k=h.current;k&&(k.controller.abort(),h.current=null,js(k))}},[a]),b.useEffect(()=>{const x=k=>{if(k.type!=="navigate_tree_result")return;if(k.cancelled){l(!1);return}const j=d.current;if(!j){l(!1);return}const m=V.getState().sessionPath,g=h.current;g&&g.controller.abort();const w=++p.current,S=new AbortController,N={token:w,expectedWorkspaceId:j,expectedSessionPath:m??null,controller:S,buffer:[]};h.current=N;const E=k.editorText,C=fe.connectionEpoch,T=m?`?sessionPath=${encodeURIComponent(m)}`:"";J(`/api/workspaces/${j}/history${T}`,{signal:S.signal}).then(R=>{var q;if(((q=h.current)==null?void 0:q.token)===w){if(fe.connectionEpoch!==C){h.current=null,l(!1);return}a(R.items,R.isStreaming),js(N),h.current=null,E&&V.getState().setComposerDraft(E),l(!1)}}).catch(R=>{var q;(R==null?void 0:R.name)!=="AbortError"&&((q=h.current)==null?void 0:q.token)===w&&(console.error("[useSessionStream] navigate history fetch failed:",R),js(N),h.current=null,l(!1))})};return fe.on(x)},[a,l]),b.useMemo(()=>({sendPrompt(x,v){!e||u||(v!=null&&v.skipOptimistic||(v!=null&&v.streamingBehavior?s(x,v.streamingBehavior):r(x)),fe.send({type:"prompt",message:x,...v!=null&&v.streamingBehavior?{streamingBehavior:v.streamingBehavior}:{}}))},abort(){e&&fe.send({type:"abort"})},newSession(){e&&(l(!0),fe.send({type:"new_session",workspaceId:e}))},fork(x){e&&(l(!0),fe.send({type:"fork",workspaceId:e,entryId:x}))},navigateTree(x,v){!e||u||(l(!0),fe.send({type:"navigate_tree",workspaceId:e,targetId:x,summarize:v==null?void 0:v.summarize,customInstructions:v==null?void 0:v.customInstructions}))},compact(){e&&fe.send({type:"compact"})}}),[e,r,s,l,u])}function js(e){const{expectedWorkspaceId:t,expectedSessionPath:n,buffer:r}=e;for(const s of r)s.type==="event"&&s.workspaceId===t&&s.sessionPath===n&&(V.getState().apply(s),jm(s))}function jm(e){if(e.type!=="event")return;const t=e.payload;t.kind==="tool_execution_end"&&(t.toolName!==fl||t.isError||pu.getState().open(t.toolCallId))}function iw({workspaceId:e,sessionRequest:t}){const n=V(j=>j.items),r=V(j=>j.running),s=V(j=>j.switching),o=V(j=>j.sessionPath),{sendPrompt:l,abort:a,fork:u,compact:c}=ow(e,t),h=Uh(e).data,p=b.useMemo(()=>lw(h),[h]),d=b.useCallback((j,f)=>{const m=aw(j,p);l(j,{skipOptimistic:m,streamingBehavior:f})},[l,p]),x=b.useRef(null),[v,k]=b.useState(0);return b.useLayoutEffect(()=>{const j=x.current;if(!j)return;k(j.getBoundingClientRect().height);const f=new ResizeObserver(m=>{const g=m[0];g&&k(g.contentRect.height)});return f.observe(j),()=>f.disconnect()},[e]),e?i.jsxs("main",{className:"relative flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-clip bg-background",children:[i.jsx(ew,{workspaceId:e,sessionPath:o,running:r,onCompact:c}),i.jsx(uv,{}),i.jsx(av,{}),i.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[i.jsx("div",{className:"v2-fade-in flex min-h-0 flex-1 flex-col",children:i.jsx(G1,{items:n,running:r,bottomPad:v,workspaceId:e,onFork:u})},o??"none"),i.jsx("div",{ref:x,className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 flex flex-col",children:i.jsx(vv,{workspaceId:e,onSend:d,onAbort:a,running:r,disabled:s})})]})]}):i.jsx("main",{className:"relative flex flex-1 items-center justify-center bg-background",children:i.jsx(om,{title:"Ready when you are.",tagline:"Pick or add a workspace from the left to begin a session."})})}function lw(e){const t=new Set;if(!e)return t;for(const n of e.extensions)for(const r of n.commands)t.add(r);return t}function aw(e,t){if(t.size===0||!e.startsWith("/"))return!1;const n=e.slice(1),r=n.search(/\s/),s=r===-1?n:n.slice(0,r);return t.has(s)}const uw=120;function cw(){var e;return typeof window<"u"&&((e=window.matchMedia)==null?void 0:e.call(window,"(prefers-reduced-motion: reduce)").matches)===!0}function wc({open:e,onClose:t,zIndex:n=100,className:r,role:s="dialog",ariaLabelledBy:o,ariaDescribedBy:l,children:a}){const[u,c]=b.useState(e),[h,p]=b.useState(!1),d=b.useRef(!1),x=b.useRef(e);b.useEffect(()=>{const j=x.current;if(x.current=e,e&&!j)c(!0),p(!1),d.current=!1;else if(!e&&j&&!d.current){if(cw()){c(!1);return}d.current=!0,p(!0)}},[e]),b.useEffect(()=>{if(!h)return;const j=window.setTimeout(()=>{d.current=!1,p(!1),c(!1)},uw+40);return()=>window.clearTimeout(j)},[h]),b.useEffect(()=>{if(!u)return;const j=f=>{f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),t())};return document.addEventListener("keydown",j,!0),()=>document.removeEventListener("keydown",j,!0)},[u,t]);const v=()=>{d.current&&(d.current=!1,p(!1),c(!1))};if(!u)return null;const k=h;return i.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:n},children:[i.jsx("div",{className:P("absolute inset-0 bg-background/60 backdrop-blur-[2px]",k?"v2-fade-out":"v2-fade-in"),onClick:t,onMouseDown:j=>j.stopPropagation()}),i.jsx("div",{role:s,"aria-modal":"true","aria-labelledby":o,"aria-describedby":l,className:P("relative z-10 flex flex-col overflow-hidden rounded-xl border border-border bg-card shadow-panel",k?"v2-dialog-out":"v2-dialog-in",r),onMouseDown:j=>j.stopPropagation(),onAnimationEnd:v,children:a})]})}const pl=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||navigator.userAgent),dw=pl?"⌘":"Ctrl",af=pl?"⏎":"Enter",fw=pl?"⇧":"Shift",pw=pl?"⌫":"Backspace",hw=[{group:"Global",rows:[{keys:[dw,"B"],label:"Toggle sidebar"},{keys:["?"],label:"Open this cheat-sheet"}]},{group:"Composer",rows:[{keys:[af],label:"Send"},{keys:[fw,af],label:"New line"},{keys:["/"],label:"Slash commands & prompts"},{keys:["@"],label:"Mention a file"}]},{group:"Messages",rows:[{keys:[pw],label:"Remove loaded prompt card",note:"when a preset card is staged"}]}];function mw({open:e,onClose:t}){return i.jsxs(wc,{open:e,onClose:t,className:"mx-4 w-full max-w-md",ariaLabelledBy:"kbd-shortcuts-title",children:[i.jsxs("header",{className:"flex h-[44px] items-center justify-between border-b border-border-soft px-4",children:[i.jsx("h2",{id:"kbd-shortcuts-title",className:"text-[13px] font-medium tracking-[-0.005em] text-foreground",children:"Keyboard shortcuts"}),i.jsxs("span",{className:"text-[11.5px] text-muted-foreground",children:["Press ",i.jsx(jt,{children:"Esc"})," to close"]})]}),i.jsx("div",{className:"flex flex-col gap-4 overflow-y-auto p-4",children:hw.map(n=>i.jsxs("section",{className:"flex flex-col gap-1.5",children:[i.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-[0.04em] text-muted-foreground",children:n.group}),i.jsx("ul",{className:"flex flex-col gap-1",children:n.rows.map((r,s)=>i.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md px-1 py-1",children:[i.jsxs("div",{className:"flex min-w-0 flex-col",children:[i.jsx("span",{className:"truncate text-[12.5px] text-foreground",children:r.label}),r.note&&i.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:r.note})]}),i.jsx("span",{className:"flex shrink-0 items-center gap-1",children:r.keys.map(o=>i.jsx(jt,{children:o},o))})]},s))})]},n.group))})]})}let gw=0,xw=0;function yw(e){const t=gr(n=>n.pushToast);b.useEffect(()=>fe.on(r=>{if(r.type!=="error")return;const s=r.command?`${r.command}: ${r.message}`:r.message;t({id:`wserr-${++gw}`,workspaceId:e??"",message:s,notifyType:"error"})}),[t,e])}function vw(){const e=gr(t=>t.pushToast);b.useEffect(()=>fe.on(n=>{if(n.type!=="extension_error")return;const r=bw(n.extensionPath);e({id:`exterr-${++xw}`,workspaceId:n.workspaceId,message:`${r}: ${n.event}: ${n.message}`,notifyType:"error"})}),[e])}function ww(e){const t=gr(n=>n.pushToast);b.useEffect(()=>{},[t,e])}function bw(e){if(!e)return"extension";const t=e.replace(/\/+$/,""),n=t.split("/"),r=n.at(-1)||t;return/^(index|extension)\.(ts|js|mjs|cjs)$/.test(r)&&n.length>=2?n[n.length-2]:r.replace(/\.(ts|js|mjs|cjs)$/,"")}function kw(){const e=gr(n=>n.toasts),t=gr(n=>n.dismissToast);return i.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-40 flex w-72 flex-col gap-2",children:e.map(n=>i.jsx(jw,{toast:n,onClose:()=>t(n.id)},n.id))})}function jw({toast:e,onClose:t}){b.useEffect(()=>{const s=e.notifyType==="error"?8e3:4e3,o=setTimeout(t,s);return()=>clearTimeout(o)},[t,e.notifyType]);const n=e.notifyType==="error"||e.notifyType==="warning"?Ai:e.notifyType==="info"?t0:Wy,r=e.notifyType==="error"?"border-l-signal-error text-signal-error":e.notifyType==="warning"?"border-l-signal-warn text-signal-warn":"border-l-brand text-foreground";return i.jsxs("div",{className:P("pointer-events-auto flex items-start gap-2 rounded-[10px] border border-border bg-card p-3 text-[12.5px] shadow-glow-lg","border-l-[3px]",r),children:[i.jsx(n,{className:P("mt-0.5 h-3.5 w-3.5 shrink-0",e.notifyType==="info"&&"text-brand")}),i.jsx("div",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-foreground",children:e.message}),i.jsx("button",{type:"button",onClick:t,className:"text-muted-foreground transition-colors hover:text-foreground","aria-label":"Dismiss",children:i.jsx(pc,{className:"h-3 w-3"})})]})}const Co=["workspaces"];function Sw(){return sn({queryKey:Co,queryFn:()=>J("/api/workspaces").then(e=>e.workspaces)})}function Nw(){const e=he();return Ee({mutationFn:async t=>(await J("/api/workspaces",{method:"POST",body:JSON.stringify(t)})).workspace,onSuccess:()=>e.invalidateQueries({queryKey:Co})})}function Cw(){const e=he();return Ee({mutationFn:t=>J(`/api/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>e.invalidateQueries({queryKey:Co})})}function Ew(){const e=he();return Ee({mutationFn:async t=>(await J("/api/workspaces/reorder",{method:"PUT",body:JSON.stringify(t)})).workspaces,onSuccess:t=>{e.setQueryData(Co,t)}})}function jb(){const e=he();return Ee({mutationFn:async({id:t,trustProjectAgents:n})=>(await J(`/api/workspaces/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({trustProjectAgents:n})})).workspace,onSuccess:t=>{e.setQueryData(Co,n=>n==null?void 0:n.map(r=>r.id===t.id?t:r))}})}function _w({open:e,initialPath:t,onClose:n,onPick:r,error:s,busy:o}){const[l,a]=b.useState(t),[u,c]=b.useState(t??""),[h,p]=b.useState(!1),{data:d,isFetching:x,error:v}=dv(l,h,e),k=d==null?void 0:d.path;b.useEffect(()=>{k&&k!==l&&(a(k),c(k))},[k,l]),b.useEffect(()=>{e&&(a(t),c(t??""))},[e,t]);const j=(d==null?void 0:d.path)??l??"",f=s??(v instanceof Error?v.message:void 0);return i.jsxs(wc,{open:e,onClose:n,className:"m-4 h-[32rem] w-full max-w-2xl",children:[i.jsxs("header",{className:"flex items-center justify-between border-b border-border/70 bg-card/40 px-4 py-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[i.jsx(fc,{className:"h-4 w-4 text-brand"}),"Add workspace"]}),i.jsx("button",{type:"button",onClick:n,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground ring-brand-focus","aria-label":"Close",children:i.jsx(pc,{className:"h-4 w-4"})})]}),i.jsx(Tw,{value:u,onChange:c,onSubmit:()=>{const m=u.trim();m&&a(m)}}),i.jsx(Pw,{path:j,onJump:a}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx(Rw,{entries:(d==null?void 0:d.entries)??[],parent:(d==null?void 0:d.parent)??null,loading:x&&!d,error:v instanceof Error&&!d?v.message:void 0,onEnter:a})}),i.jsxs("footer",{className:"border-t border-border/70 bg-card/40 px-4 py-3",children:[i.jsxs("label",{className:"mb-2 flex items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("input",{type:"checkbox",checked:h,onChange:m=>p(m.target.checked),className:"h-3.5 w-3.5 accent-[hsl(var(--brand))]"}),"Show hidden directories"]}),i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("p",{className:"flex-1 truncate font-mono text-xs text-foreground",children:j||"—"}),i.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i.jsx("button",{type:"button",onClick:n,className:"rounded-md px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground ring-brand-focus",children:"Cancel"}),i.jsxs("button",{type:"button",disabled:!j||o,onClick:()=>void r(j),className:P("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ring-brand-focus",!j||o?"bg-muted text-muted-foreground/70 cursor-not-allowed":"bg-brand text-brand-foreground hover:bg-brand-strong shadow-glow-sm"),children:[o&&i.jsx(mr,{className:"h-3 w-3 animate-spin"}),"Add this folder"]})]})]}),f&&i.jsx("p",{className:"mt-2 rounded-md border border-error-ghost bg-error-ghost px-2 py-1 text-xs text-signal-error",children:f})]})]})}function Tw({value:e,onChange:t,onSubmit:n}){const r=b.useRef(null);return b.useEffect(()=>{var s;(s=r.current)==null||s.focus()},[]),i.jsx("div",{className:"border-b border-border/70 bg-background/30 px-4 py-2",children:i.jsx("input",{ref:r,type:"text",value:e,onChange:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),n())},placeholder:"/absolute/path (Enter to jump)",className:"w-full rounded-md border border-input bg-card/60 px-2.5 py-1.5 font-mono text-xs text-foreground outline-none transition-colors focus:border-brand/40 focus:ring-1 focus:ring-brand/40"})})}function Pw({path:e,onJump:t}){const n=b.useMemo(()=>Mw(e),[e]);return i.jsxs("nav",{className:"flex items-center gap-0.5 overflow-x-auto border-b border-border/70 bg-background/20 px-3 py-1.5 text-xs",children:[n.length===0&&i.jsx("span",{className:"text-muted-foreground",children:"—"}),n.map((r,s)=>i.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[i.jsx("button",{type:"button",onClick:()=>t(r.path),className:"rounded px-1.5 py-0.5 text-foreground/90 transition-colors hover:bg-accent hover:text-foreground",children:r.label}),s<n.length-1&&i.jsx(dc,{className:"h-3 w-3 text-muted-foreground"})]},r.path))]})}function Rw({entries:e,parent:t,loading:n,error:r,onEnter:s}){return n?i.jsxs("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:[i.jsx(mr,{className:"mr-2 h-3 w-3 animate-spin"}),"Loading…"]}):r?i.jsx("div",{className:"p-4 text-xs text-signal-error",children:r}):i.jsxs("ul",{className:"p-1.5",children:[t&&i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>s(t),className:uf,children:[i.jsx(iu,{className:"h-4 w-4 shrink-0 opacity-70"}),i.jsx("span",{className:"text-muted-foreground",children:".. (parent)"})]})}),e.length===0&&i.jsx("li",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"(no subdirectories)"}),e.map(o=>i.jsx("li",{children:i.jsxs("button",{type:"button",onClick:()=>s(o.path),className:uf,children:[i.jsx(fc,{className:"h-4 w-4 shrink-0 text-brand/70 opacity-80"}),i.jsx("span",{className:"truncate",children:o.name})]})},o.path))]})}const uf=P("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm","text-foreground/90 transition-colors hover:bg-accent hover:text-foreground");function Mw(e){if(!e)return[];const t=e.split("/").filter(Boolean),n=[{label:"/",path:"/"}];let r="";for(const s of t)r+=`/${s}`,n.push({label:s,path:r});return n}const Jl=e=>typeof e=="function"?e():e;function Lw({storageKey:e,defaultWidth:t,min:n,max:r,side:s="right",enabled:o=!0,onResizeEnd:l}){const[a,u]=b.useState(()=>{try{const N=localStorage.getItem(e);if(N){const E=parseInt(N,10);if(!isNaN(E)&&E>=n&&E<=Jl(r))return E}}catch{}return t}),[c,h]=b.useState(!1),p=b.useRef(!1),d=b.useRef(0),x=b.useRef(a),v=b.useRef(a),k=b.useRef(a),j=b.useRef(Jl(r)),f=b.useRef(s),m=b.useRef(n),g=b.useRef(l);b.useEffect(()=>{f.current=s,m.current=n,g.current=l},[s,n,l]),b.useEffect(()=>{v.current=a},[a]),b.useEffect(()=>{if(!o)return;const N=()=>{const E=Jl(r);j.current=E,u(C=>Math.min(C,E))};return N(),window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[o,r]),b.useEffect(()=>{if(!c)try{localStorage.setItem(e,String(a))}catch{}},[a,c,e]);const w=b.useCallback(N=>{N.preventDefault(),p.current=!0,h(!0),d.current=N.clientX,x.current=v.current,k.current=v.current,document.documentElement.classList.add("is-col-resizing")},[]),S=b.useCallback(()=>{u(t)},[t]);return b.useEffect(()=>{if(!o)return;const N=C=>{if(!p.current)return;const T=f.current==="left"?d.current-C.clientX:C.clientX-d.current,R=x.current+T;k.current=R,u(Math.max(m.current,Math.min(j.current,R)))},E=()=>{var C;p.current&&(p.current=!1,h(!1),document.documentElement.classList.remove("is-col-resizing"),(C=g.current)==null||C.call(g,k.current))};return document.addEventListener("mousemove",N),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",E),p.current&&(p.current=!1,document.documentElement.classList.remove("is-col-resizing"))}},[o]),{width:a,isResizing:c,onMouseDown:w,onDoubleClick:S}}function Iw({open:e,title:t,message:n,confirmLabel:r="Confirm",cancelLabel:s="Cancel",variant:o="default",onConfirm:l,onCancel:a}){const u=b.useRef(null),c=b.useRef(null);b.useEffect(()=>{if(e)c.current=document.activeElement,requestAnimationFrame(()=>{var p;return(p=u.current)==null?void 0:p.focus()});else if(c.current){const p=c.current;c.current=null,p.isConnected&&p.focus()}},[e]),b.useEffect(()=>{if(!e)return;const p=d=>{d.key==="Enter"&&(d.preventDefault(),d.stopPropagation(),l())};return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[e,l]);const h=o==="danger";return i.jsxs(wc,{open:e,onClose:a,zIndex:200,role:"alertdialog",ariaLabelledBy:"confirm-dialog-title",ariaDescribedBy:"confirm-dialog-message",className:"mx-4 w-full max-w-sm",children:[i.jsx("div",{className:"px-5 pt-5 pb-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[h&&i.jsx("span",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-error-subtle",children:i.jsx(Ai,{className:"h-4 w-4 text-signal-error"})}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[i.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-foreground",children:t}),i.jsx("p",{id:"confirm-dialog-message",className:"whitespace-pre-line text-[13px] leading-relaxed text-muted-foreground",children:n})]})]})}),i.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border bg-muted/40 px-5 py-3",children:[s!==null&&i.jsx("button",{type:"button",onClick:a,className:P("rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors","border border-border bg-card text-foreground/80","hover:bg-accent hover:text-foreground","focus:outline-none focus:ring-2 focus:ring-brand/40"),children:s}),i.jsx("button",{ref:u,type:"button",onClick:l,className:P("rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors","focus:outline-none focus:ring-2",h?"bg-signal-error text-white hover:bg-signal-error/90 focus:ring-signal-error/40":"bg-brand text-brand-foreground hover:bg-brand-strong focus:ring-brand/40"),children:r})]})]})}const Sm=b.createContext(null);function Nm(){const e=b.useContext(Sm);if(!e)throw new Error("useConfirm must be used within a <ConfirmProvider />");return e}function Ow({children:e}){const[t,n]=b.useState(null),r=b.useRef(null),s=b.useCallback(l=>(r.current&&(r.current(!1),r.current=null),new Promise(a=>{r.current=a,n({...l,open:!0})})),[]),o=b.useCallback(l=>{var a;n(u=>u?{...u,open:!1}:null),(a=r.current)==null||a.call(r,l),r.current=null},[]);return i.jsxs(Sm.Provider,{value:s,children:[e,i.jsx(Iw,{open:(t==null?void 0:t.open)??!1,title:(t==null?void 0:t.title)??"",message:(t==null?void 0:t.message)??"",confirmLabel:t==null?void 0:t.confirmLabel,cancelLabel:t==null?void 0:t.cancelLabel,variant:t==null?void 0:t.variant,onConfirm:()=>o(!0),onCancel:()=>o(!1)})]})}const Dw=()=>Math.min(window.innerWidth*.6,500);function Aw({activeId:e,onSelect:t,onSelectSession:n,onNewSession:r,collapsed:s,onToggleCollapse:o,onOpenSettings:l}){const{data:a,isLoading:u}=Sw(),c=he(),h=Nw(),p=Cw(),d=Ew(),x=Nm(),[v,k]=b.useState(!1),[j,f]=b.useState(void 0),[m,g]=b.useState(new Set),{width:w,isResizing:S,onMouseDown:N,onDoubleClick:E}=Lw({storageKey:Q0,defaultWidth:q0,min:H0,max:Dw,side:"right",onResizeEnd:H=>{H<V0&&!s&&o()}}),C=b.useCallback(H=>{c.prefetchQuery(Fh(H))},[c]),T=b.useCallback(H=>{g(ye=>{const ve=new Set(ye);return ve.has(H)?ve.delete(H):ve.add(H),ve})},[]),R=b.useRef(x);R.current=x;const q=b.useRef(p);q.current=p;const U=b.useCallback(async(H,ye)=>{await R.current({title:"Remove workspace",message:`Remove "${ye}" from the list? (Files are not deleted.)`,confirmLabel:"Remove",variant:"danger"})&&q.current.mutateAsync(H)},[]),me=V(H=>H.running),ce=V(H=>H.sessionPath),[je,Fe]=b.useState(null),[it,M]=b.useState(null),[D,F]=b.useState(null),Q=b.useRef(null),Z=b.useRef(null),lt=b.useRef(null),[Me,Ft]=b.useState(null),Qe=b.useRef(0),_e=b.useMemo(()=>{if(!a)return;if(!Me)return a;const H=new Map(a.map(at=>[at.id,at])),ye=new Set(Me),ve=[];for(const at of Me){const zt=H.get(at);zt&&ve.push(zt)}for(const at of a)ye.has(at.id)||ve.push(at);return ve},[a,Me]),A=b.useCallback(H=>{Q.current=H,Fe(H)},[]),ie=b.useCallback(()=>{Q.current=null,Z.current=null,lt.current=null,Fe(null),M(null),F(null)},[]),fs=b.useCallback((H,ye)=>{const ve=Q.current;!ve||H===ve||(Z.current=H,lt.current=ye,M(H),F(ye))},[]),hl=b.useCallback(()=>{const H=Q.current,ye=Z.current,ve=lt.current;if(!H||!ye||!ve||!a)return;const zt=[...Me??a.map(Em=>Em.id)],bc=zt.indexOf(H);if(bc===-1)return;zt.splice(bc,1);let kc=zt.indexOf(ye);ve==="after"&&(kc+=1),zt.splice(kc,0,H);const jc=++Qe.current;Ft(zt),d.mutate({ids:zt},{onSuccess:()=>{Qe.current===jc&&Ft(null)},onError:()=>{Qe.current===jc&&Ft(null)}}),Q.current=null,Z.current=null,lt.current=null,Fe(null),M(null),F(null)},[a,Me,d]),Hn=b.useCallback(()=>{Z.current=null,lt.current=null,M(null),F(null)},[]),Eo=async H=>{f(void 0);try{const ye=await h.mutateAsync({path:H});k(!1),t(ye.id)}catch(ye){f(ye instanceof Error?ye.message:String(ye))}},_o=(_e==null?void 0:_e.length)??0,ml=s?56:w;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:P("relative h-full shrink-0",!S&&"transition-[width] duration-300 ease-out"),style:{width:`${ml}px`},children:[i.jsx("div",{className:"absolute inset-0 overflow-clip border-r border-border",children:i.jsxs("aside",{className:"flex h-full flex-col overflow-hidden bg-popover will-change-transform",style:{width:`${w}px`,contain:"layout style"},children:[i.jsxs("header",{className:"flex h-[54px] shrink-0 items-center",children:[i.jsx("div",{className:"flex h-full w-[56px] shrink-0 items-center justify-center",children:i.jsx(cl,{size:28,filled:me})}),i.jsx("div",{className:P("flex min-w-0 flex-1 items-center pr-3 transition-opacity duration-200 ease-out",s?"opacity-0":"opacity-100"),children:i.jsx(Sv,{})})]}),i.jsxs("div",{className:"relative flex h-[40px] shrink-0 items-center",children:[i.jsxs("div",{className:P("flex w-full items-center justify-between px-4 transition-opacity duration-200 ease-out",s?"pointer-events-none opacity-0":"opacity-100"),children:[i.jsxs("h2",{className:"m-0 flex items-center gap-1.5 whitespace-nowrap text-[10.5px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/70",children:["Workspaces",_o>0&&i.jsx("span",{className:"rounded-full bg-muted px-1.5 py-px text-[10px] font-medium tabular-nums leading-none text-muted-foreground/80",children:_o})]}),i.jsxs("button",{type:"button",tabIndex:s?-1:0,onClick:()=>{f(void 0),k(!0)},className:"inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-[12px] text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:[i.jsx("span",{className:"text-[15px] leading-none text-brand",children:"+"}),i.jsx("span",{children:"Add"})]})]}),i.jsx("div",{className:P("absolute inset-y-0 left-0 flex w-[56px] items-center justify-center transition-opacity duration-200 ease-out",s?"opacity-100":"pointer-events-none opacity-0"),children:i.jsx("button",{type:"button",tabIndex:s?0:-1,onClick:()=>{f(void 0),k(!0)},className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-[16px] leading-none text-brand transition-colors hover:bg-accent/70",title:"Add workspace","aria-label":"Add workspace",children:"+"})})]}),i.jsxs("ul",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overflow-x-hidden px-2 pb-3",onDragLeave:Hn,children:[i.jsx(cf,{show:!!u,collapsed:s,label:"Loading…"}),i.jsx(cf,{show:!u&&(_e==null?void 0:_e.length)===0,collapsed:s,label:"No workspaces yet",variant:"dashed"}),_e==null?void 0:_e.map(H=>i.jsx(Fw,{id:H.id,name:H.name,active:e===H.id,hasActiveSession:e===H.id&&!!ce,expanded:m.has(H.id),collapsed:s,isDragging:je===H.id,showDropBefore:it===H.id&&D==="before",showDropAfter:it===H.id&&D==="after",onSelect:t,onToggleExpand:T,onSelectSession:n,onNewSession:r,onDeleteWorkspace:U,onPrefetch:C,onDragStart:A,onDragOver:fs,onDragEnd:ie,onDrop:hl},H.id))]}),i.jsx(Bw,{collapsed:s,onOpenSettings:l})]})}),!s&&i.jsx("div",{onMouseDown:N,onDoubleClick:E,className:P("absolute right-0 top-0 z-30 h-full w-px cursor-col-resize","bg-transparent hover:bg-brand/60 transition-colors",S&&"bg-brand"),"aria-label":"Resize sidebar",title:"Drag to resize · double-click to reset",children:i.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2"})}),i.jsx("button",{type:"button",onClick:o,className:"absolute right-0 top-1/2 z-40 -translate-y-1/2 translate-x-1/2 rounded-full border border-border bg-card p-1 text-muted-foreground shadow-glow transition-colors hover:text-foreground","aria-label":s?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",title:s?"Expand sidebar (Ctrl+B)":"Collapse sidebar (Ctrl+B)",children:s?i.jsx(dc,{className:"h-3.5 w-3.5"}):i.jsx(Vy,{className:"h-3.5 w-3.5"})})]}),i.jsx(_w,{open:v,onClose:()=>k(!1),onPick:Eo,error:j,busy:h.isPending})]})}function cf({show:e,collapsed:t,label:n,variant:r}){return e?i.jsx("li",{className:P("overflow-hidden text-center text-[12px] text-muted-foreground","transition-[opacity,max-height,margin,padding] duration-300 ease-out",r==="dashed"&&"rounded-lg border border-dashed border-border-soft bg-background/60",t?"pointer-events-none my-0 max-h-0 py-0 opacity-0":r==="dashed"?"mt-1 max-h-[80px] px-3 py-5 opacity-100":"max-h-[40px] px-3 py-2 opacity-100"),children:n}):null}const Fw=b.memo(function({id:t,name:n,active:r,hasActiveSession:s,expanded:o,collapsed:l,isDragging:a,showDropBefore:u,showDropAfter:c,onSelect:h,onToggleExpand:p,onSelectSession:d,onNewSession:x,onDeleteWorkspace:v,onPrefetch:k,onDragStart:j,onDragOver:f,onDragEnd:m,onDrop:g}){return i.jsxs("li",{className:P("group/ws relative",a&&"opacity-40"),draggable:!l,onMouseEnter:()=>k(t),onDragStart:w=>{j(t),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",t)},onDragOver:w=>{w.preventDefault(),w.dataTransfer.dropEffect="move";const S=w.currentTarget.getBoundingClientRect(),N=S.top+S.height/2;f(t,w.clientY<N?"before":"after")},onDragLeave:()=>{},onDrop:w=>{w.preventDefault(),g()},onDragEnd:m,children:[u&&i.jsx("span",{className:"pointer-events-none absolute inset-x-1 top-0 z-10 h-[2px] rounded-full bg-brand"}),i.jsxs("div",{className:"relative flex h-[30px] items-center",children:[r&&!l&&!s&&i.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-1/2 z-10 h-[16px] w-[2px] -translate-y-1/2 rounded-full bg-brand"}),i.jsxs("button",{type:"button",onClick:()=>{r||h(t),p(t)},title:l?n:void 0,"aria-label":n,className:P("flex h-full w-full items-center rounded-md pr-2 text-left text-[13px] transition-colors",r?s?P("text-foreground/90",!l&&"hover:bg-accent/30"):P("font-medium text-foreground",!l&&"bg-accent/50"):"text-muted-foreground hover:text-foreground",!l&&!r&&"hover:bg-accent/40"),children:[i.jsx("span",{className:"flex h-full w-[40px] shrink-0 items-center justify-center",children:i.jsx("span",{className:P("flex h-7 w-7 items-center justify-center rounded-md transition-colors",l&&(r?"bg-accent/60 text-brand":"group-hover/ws:bg-accent/40")),children:i.jsx(fc,{className:P("h-[14px] w-[14px] transition-colors",r?"text-brand opacity-100":"opacity-70")})})}),i.jsx("span",{className:P("min-w-0 flex-1 truncate pr-1.5 transition-opacity duration-300 ease-out",l?"pointer-events-none opacity-0":"opacity-100"),children:n}),!l&&i.jsx(No,{className:P("h-3 w-3 shrink-0 opacity-40 transition-transform duration-200",!o&&"-rotate-90")})]}),!l&&i.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),x(t)},title:"New session","aria-label":"New session",className:"absolute right-6 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground opacity-40 transition-[opacity,background,color] hover:bg-accent/70 hover:text-foreground hover:opacity-100",children:i.jsx(r0,{className:"h-3.5 w-3.5"})})]}),i.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),v(t,n)},className:P("pointer-events-none absolute right-2 top-[15px] -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-opacity duration-150","opacity-0 hover:bg-error-ghost hover:text-signal-error",!l&&"group-hover/ws:pointer-events-auto group-hover/ws:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100"),"aria-label":"Remove workspace",title:"Remove workspace",tabIndex:l?-1:0,children:i.jsx(Hh,{className:"h-3 w-3"})}),i.jsx(zw,{workspaceId:t,expanded:o,collapsed:l,onSelectSession:d}),c&&i.jsx("span",{className:"pointer-events-none absolute inset-x-1 bottom-0 z-10 h-[2px] rounded-full bg-brand"})]})}),df=5;function zw({workspaceId:e,expanded:t,collapsed:n,onSelectSession:r}){const s=t&&!n,[o,l]=b.useState(!1),[a,u]=b.useState(!1);if(b.useEffect(()=>{if(!s){u(!1);return}l(!0),u(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>u(!0))});return()=>cancelAnimationFrame(h)},[s]),!o)return null;const c=a&&s;return i.jsx("div",{className:P("grid ease-out transition-[grid-template-rows,opacity] duration-200",c?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),...c?void 0:{inert:""},children:i.jsx("div",{className:"min-h-0 overflow-hidden",children:i.jsx(Uw,{workspaceId:e,onSelectSession:r})})})}function Uw({workspaceId:e,onSelectSession:t}){const{data:n,isLoading:r}=Ly(e),s=Iy(e),o=Nm(),l=V(d=>d.sessionPath),[a,u]=b.useState(df),c=b.useCallback(async d=>{if(s.isPending)return;const x=Yo(d);await o({title:"Delete session",message:`Delete session "${x}"? This cannot be undone.`,confirmLabel:"Delete",variant:"danger"})&&s.mutate(d.path,{onError:async k=>{await o({title:"Delete failed",message:`Failed to delete session: ${k.message}`,confirmLabel:"OK",cancelLabel:null})}})},[o,s]),h=(n==null?void 0:n.slice(0,a))??[],p=((n==null?void 0:n.length)??0)>a;return r&&!n?i.jsx("div",{className:"flex flex-col gap-0.5 pb-1",children:Array.from({length:3}).map((d,x)=>i.jsx("div",{className:"flex h-[28px] items-center pl-10 pr-6",children:i.jsx("div",{className:"h-2.5 w-full animate-pulse rounded bg-muted/60"})},x))}):i.jsxs("div",{className:"pb-1",children:[h.map(d=>{const x=d.path===l,v=s.isPending&&s.variables===d.path;return i.jsxs("div",{className:"group/session relative",children:[i.jsxs("button",{type:"button",onClick:()=>{x||t(e,d.path)},title:Yo(d),className:P("relative flex h-[28px] w-full items-center gap-1.5 rounded-md pl-10 pr-6 text-left text-[12.5px] transition-colors",x?"bg-brand-ghost font-medium text-foreground":"text-muted-foreground hover:bg-accent/40 hover:text-foreground"),children:[d.running?i.jsx("span",{title:"Running",className:"absolute left-[20px] top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-brand animate-v2-pulse"}):x?i.jsx("span",{className:"absolute left-[20px] top-1/2 h-[14px] w-[2px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-brand"}):i.jsx("span",{className:"absolute left-[20px] top-1/2 -translate-x-1/2 -translate-y-1/2 text-[6px] leading-none opacity-40",children:"●"}),i.jsx("span",{className:"truncate",children:Yo(d)})]}),!x&&i.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),c(d)},disabled:s.isPending,title:"Delete session","aria-label":`Delete session ${Yo(d)}`,className:P("absolute right-1.5 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-opacity","hover:bg-error-ghost hover:text-signal-error",v?"opacity-100":"opacity-0 group-hover/session:opacity-100"),children:v?i.jsx(mr,{className:"h-3 w-3 animate-spin"}):i.jsx(Hh,{className:"h-3 w-3"})})]},d.path)}),p&&i.jsx("button",{type:"button",onClick:()=>u(d=>d+df),className:"flex h-[26px] w-full items-center pl-10 pr-2 text-[12px] text-muted-foreground/60 transition-colors hover:text-muted-foreground",children:"See more"})]})}function Yo(e){return e.name?e.name:e.preview?e.preview:$w(e.path)}function $w(e){return e.split("/").at(-1)??e}function Bw({collapsed:e,onOpenSettings:t}){return i.jsxs("footer",{className:"relative flex h-[40px] shrink-0 items-center gap-2 border-t border-border-soft px-4",children:[i.jsxs("div",{className:P("flex w-full items-center gap-2 text-[11.5px] text-muted-foreground transition-opacity duration-200 ease-out",e?"pointer-events-none opacity-0":"opacity-100"),children:[i.jsx($0,{state:"online"}),i.jsx("span",{children:"Online"}),i.jsx("span",{className:"flex-1"}),i.jsx("button",{type:"button",tabIndex:e?-1:0,onClick:t,title:"Settings","aria-label":"Settings",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:i.jsx(Bd,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:P("absolute inset-y-0 left-0 flex w-[56px] items-center justify-center transition-opacity duration-200 ease-out",e?"opacity-100":"pointer-events-none opacity-0"),children:i.jsx("button",{type:"button",tabIndex:e?0:-1,onClick:t,title:"Settings","aria-label":"Settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent/70 hover:text-foreground",children:i.jsx(Bd,{className:"h-3.5 w-3.5"})})})]})}const qw=b.lazy(()=>z(()=>import("./SettingsPage-cULKjgtu.js"),__vite__mapDeps([22,23,24])).then(e=>({default:e.SettingsPage}))),Qw=b.lazy(()=>z(()=>import("./ResourcesPanel-Cn_gw159.js"),__vite__mapDeps([25,23,24])).then(e=>({default:e.ResourcesPanel}))),Hw=b.lazy(()=>z(()=>import("./SessionTree-CBIw_kzf.js"),__vite__mapDeps([26,23,24])).then(e=>({default:e.SessionTree}))),Vw=b.lazy(()=>z(()=>import("./ArtifactsPanel-DUiRwx7S.js"),__vite__mapDeps([27,23,24])).then(e=>({default:e.ArtifactsPanel})));function Zl(){return i.jsxs("div",{className:"flex h-full w-[320px] shrink-0 flex-col border-l border-border bg-popover",children:[i.jsx("div",{className:"h-[44px] border-b border-border-soft"}),i.jsxs("div",{className:"space-y-2 p-3",children:[i.jsx(yn,{className:"h-6 w-20 rounded-md"}),Array.from({length:5}).map((e,t)=>i.jsx(yn,{className:"h-12 w-full rounded-[10px]"},t))]})]})}function Ww(){return i.jsxs("div",{className:"flex h-full w-full bg-background",children:[i.jsxs("nav",{className:"flex shrink-0 flex-col border-r border-border bg-popover",style:{width:272},children:[i.jsx("header",{className:"flex h-[60px] shrink-0 items-center px-3"}),i.jsx("div",{className:"flex flex-col gap-1 px-2 py-1",children:Array.from({length:4}).map((e,t)=>i.jsx(yn,{className:"h-9 w-full rounded-lg"},t))})]}),i.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[i.jsx("header",{className:"flex h-[60px] shrink-0 items-center border-b border-border-soft px-8",children:i.jsx(yn,{className:"h-4 w-28"})}),i.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-4 px-8 py-6",children:[i.jsx(yn,{className:"h-16 w-full rounded-lg"}),i.jsx(yn,{className:"h-24 w-full rounded-lg"}),i.jsx(yn,{className:"h-16 w-full rounded-lg"})]})]})]})}function Kw(){const[e,t]=b.useState(void 0),[n,r]=b.useState(!1),[s,o]=b.useState("chat"),[l,a]=b.useState(void 0),u=co(g=>g.rightPanel),c=co(g=>g.closePanel),h=b.useRef(void 0),p=b.useCallback(g=>{const w=h.current;w&&V.getState().saveSnapshot(w),h.current=g},[]),d=b.useCallback(g=>{p(g),t(g),a(void 0)},[p]),x=b.useCallback((g,w)=>{p(g),t(g),a(S=>({path:w,nonce:((S==null?void 0:S.nonce)??0)+1}))},[p]),v=b.useCallback(g=>{p(g),t(g),a(void 0),fe.send({type:"new_session",workspaceId:g})},[p]);yw(e),vw(),My(),$y(),Fy(),ww(e);const k=b.useCallback(()=>{r(g=>!g)},[]),[j,f]=b.useState(!1);b.useEffect(()=>{const g=w=>{if((w.ctrlKey||w.metaKey)&&(w.key==="b"||w.key==="B")){w.preventDefault(),k();return}if(w.key==="?"&&!w.ctrlKey&&!w.metaKey&&!w.altKey){const S=document.activeElement,N=S==null?void 0:S.tagName;S instanceof HTMLElement&&S.isContentEditable||N==="INPUT"||N==="TEXTAREA"||N==="SELECT"||(w.preventDefault(),f(C=>!C))}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[k]);const m=s==="settings";return i.jsxs(Ow,{children:[i.jsx("div",{className:m?"contents":"hidden",children:i.jsx(b.Suspense,{fallback:i.jsx(Ww,{}),children:i.jsx(qw,{workspaceId:e,onBack:()=>o("chat")})})}),i.jsxs("div",{className:m?"hidden":"flex h-full",children:[i.jsx(Aw,{activeId:e,onSelect:d,onSelectSession:x,onNewSession:v,collapsed:n,onToggleCollapse:k,onOpenSettings:()=>o("settings")}),i.jsx(iw,{workspaceId:e,sessionRequest:l},e??"none"),e&&i.jsxs(i.Fragment,{children:[i.jsx(b.Suspense,{fallback:i.jsx(Zl,{}),children:i.jsx(Qw,{workspaceId:e,open:u==="resources",onClose:c},`res-${e}`)}),i.jsx(b.Suspense,{fallback:i.jsx(Zl,{}),children:i.jsx(Hw,{workspaceId:e,open:u==="tree",onClose:c},`tree-${e}`)}),i.jsx(b.Suspense,{fallback:i.jsx(Zl,{}),children:i.jsx(Vw,{open:u==="artifact",onClose:c},`art-${e}`)})]})]}),i.jsx(kw,{}),i.jsx(mw,{open:j,onClose:()=>f(!1)})]})}class Gw extends b.Component{constructor(){super(...arguments);xt(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback:i.jsx(Xw,{error:this.state.error,onReset:()=>this.setState({error:null})}):this.props.children}}function Xw({error:e,onReset:t}){return i.jsx("div",{className:"flex h-full items-center justify-center bg-background text-foreground",children:i.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 p-8 text-center v2-hero-in",children:[i.jsx("span",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-error-ghost bg-error-subtle",children:i.jsx(Ai,{className:"h-5 w-5 text-signal-error"})}),i.jsx("h1",{className:"text-[16px] font-semibold tracking-[-0.01em] text-foreground",children:"Something went wrong"}),i.jsx("p",{className:"max-w-[320px] text-[13.5px] leading-relaxed text-muted-foreground",children:e.message||"An unexpected error occurred."}),i.jsxs("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-card px-3.5 py-2 text-[13px] font-medium text-foreground transition-[color,background-color,border-color,transform] duration-200 hover:bg-accent hover:border-border-soft active:scale-[0.98] ring-brand-focus",children:[i.jsx(Qh,{className:"h-3.5 w-3.5"}),"Try again"]})]})})}const Yw=new cy({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:1,staleTime:5e3,gcTime:3e5}}}),Cm=document.getElementById("root");if(!Cm)throw new Error("missing #root");Sh(Cm).render(i.jsx(b.StrictMode,{children:i.jsx(dy,{client:Yw,children:i.jsx(Gw,{children:i.jsx(Kw,{})})})}));export{Uh as $,mb as A,lu as B,al as C,wc as D,Jy as E,Nm as F,e0 as G,dl as H,ui as I,cb as J,ib as K,mr as L,fb as M,ab as N,rm as O,hb as P,gr as Q,Qh as R,q0 as S,ln as T,Ee as U,ub as V,sn as W,pc as X,he as Y,By as Z,Lw as _,xb as a,rb as a0,sb as a1,Ty as a2,Py as a3,nb as a4,jb as a5,ob as a6,cm as a7,db as a8,lb as a9,Sw as aa,bb as ab,Xv as ac,fe as ad,gb as b,uo as c,No as d,Vy as e,dc as f,Gy as g,qh as h,n0 as i,re as j,r0 as k,Q0 as l,Lv as m,yn as n,pb as o,Hh as p,J as q,P as r,X as s,yb as t,kb as u,wb as v,vb as w,pu as x,V as y,_y as z};
|